@framers/agentos 0.12.13 → 0.12.14

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.
Files changed (71) hide show
  1. package/README.md +1 -1
  2. package/dist/api/agent.d.ts +35 -1
  3. package/dist/api/agent.d.ts.map +1 -1
  4. package/dist/api/agent.js +8 -0
  5. package/dist/api/agent.js.map +1 -1
  6. package/dist/api/gmi.d.ts +21 -0
  7. package/dist/api/gmi.d.ts.map +1 -0
  8. package/dist/api/gmi.js +527 -0
  9. package/dist/api/gmi.js.map +1 -0
  10. package/dist/api/runtime/agentCognitiveMemory.d.ts +82 -0
  11. package/dist/api/runtime/agentCognitiveMemory.d.ts.map +1 -0
  12. package/dist/api/runtime/agentCognitiveMemory.js +277 -0
  13. package/dist/api/runtime/agentCognitiveMemory.js.map +1 -0
  14. package/dist/api/runtime/capabilityContract.d.ts +21 -1
  15. package/dist/api/runtime/capabilityContract.d.ts.map +1 -1
  16. package/dist/api/runtime/capabilityContract.js +15 -15
  17. package/dist/api/runtime/capabilityContract.js.map +1 -1
  18. package/dist/api/runtime/gmiCognition.d.ts +66 -0
  19. package/dist/api/runtime/gmiCognition.d.ts.map +1 -0
  20. package/dist/api/runtime/gmiCognition.js +58 -0
  21. package/dist/api/runtime/gmiCognition.js.map +1 -0
  22. package/dist/api/runtime/gmiPersona.d.ts +16 -0
  23. package/dist/api/runtime/gmiPersona.d.ts.map +1 -0
  24. package/dist/api/runtime/gmiPersona.js +91 -0
  25. package/dist/api/runtime/gmiPersona.js.map +1 -0
  26. package/dist/api/runtime/gmiResults.d.ts +98 -0
  27. package/dist/api/runtime/gmiResults.d.ts.map +1 -0
  28. package/dist/api/runtime/gmiResults.js +333 -0
  29. package/dist/api/runtime/gmiResults.js.map +1 -0
  30. package/dist/api/runtime/gmiSession.d.ts +85 -0
  31. package/dist/api/runtime/gmiSession.d.ts.map +1 -0
  32. package/dist/api/runtime/gmiSession.js +285 -0
  33. package/dist/api/runtime/gmiSession.js.map +1 -0
  34. package/dist/api/runtime/gmiTranscript.d.ts +48 -0
  35. package/dist/api/runtime/gmiTranscript.d.ts.map +1 -0
  36. package/dist/api/runtime/gmiTranscript.js +110 -0
  37. package/dist/api/runtime/gmiTranscript.js.map +1 -0
  38. package/dist/api/runtime/lightweightAgentDiagnostics.d.ts +6 -1
  39. package/dist/api/runtime/lightweightAgentDiagnostics.d.ts.map +1 -1
  40. package/dist/api/runtime/lightweightAgentDiagnostics.js +9 -2
  41. package/dist/api/runtime/lightweightAgentDiagnostics.js.map +1 -1
  42. package/dist/api/sessionHistory.d.ts +43 -1
  43. package/dist/api/sessionHistory.d.ts.map +1 -1
  44. package/dist/api/sessionHistory.js +56 -1
  45. package/dist/api/sessionHistory.js.map +1 -1
  46. package/dist/api/sessionTranscript.d.ts +8 -0
  47. package/dist/api/sessionTranscript.d.ts.map +1 -1
  48. package/dist/api/sessionTranscript.js.map +1 -1
  49. package/dist/api/transferStyle.d.ts +8 -0
  50. package/dist/api/transferStyle.d.ts.map +1 -1
  51. package/dist/api/transferStyle.js +4 -1
  52. package/dist/api/transferStyle.js.map +1 -1
  53. package/dist/api/types.d.ts +11 -0
  54. package/dist/api/types.d.ts.map +1 -1
  55. package/dist/api/types.js.map +1 -1
  56. package/dist/cognition/substrate/GMI.d.ts.map +1 -1
  57. package/dist/cognition/substrate/GMI.js +54 -2
  58. package/dist/cognition/substrate/GMI.js.map +1 -1
  59. package/dist/cognition/substrate/IGMI.d.ts +23 -1
  60. package/dist/cognition/substrate/IGMI.d.ts.map +1 -1
  61. package/dist/cognition/substrate/IGMI.js.map +1 -1
  62. package/dist/io/vision/VisionPipeline.d.ts +5 -0
  63. package/dist/io/vision/VisionPipeline.d.ts.map +1 -1
  64. package/dist/io/vision/VisionPipeline.js +28 -13
  65. package/dist/io/vision/VisionPipeline.js.map +1 -1
  66. package/dist/io/vision/index.d.ts.map +1 -1
  67. package/dist/io/vision/index.js +2 -0
  68. package/dist/io/vision/index.js.map +1 -1
  69. package/dist/io/vision/types.d.ts +11 -0
  70. package/dist/io/vision/types.d.ts.map +1 -1
  71. package/package.json +1 -1
@@ -0,0 +1,277 @@
1
+ /**
2
+ * @file agentCognitiveMemory.ts
3
+ * Cognitive memory for GMIs built from agent options (`agent({ runtime: 'gmi' })`,
4
+ * spec D7): a {@link CognitiveMemoryManager} over an in-memory vector store, the
5
+ * in-memory knowledge graph, an embedding manager for `memory.embedding`, a
6
+ * working memory of its own and the persona's HEXACO traits.
7
+ *
8
+ * One manager serves every session of an agent. Each GMI's memory bridge passes
9
+ * the session's mood on every encode, retrieve and assemble call and scopes
10
+ * recall to the session's user and conversation, so the manager's own mood
11
+ * callback is neutral. The memory graph runs on the `'knowledge-graph'` backend
12
+ * over the same in-memory knowledge graph, because the `'graphology'` backend
13
+ * needs graphology, an optional peer dependency. Consolidation runs only when
14
+ * `memory.consolidation.enabled` is true. The build embeds one test text through
15
+ * the embedding model it sets up, so a model that cannot answer, or answers with
16
+ * another size than memory expects, fails the build instead of leaving memory empty.
17
+ */
18
+ import { CognitiveMemoryManager } from '../../cognition/memory/CognitiveMemoryManager.js';
19
+ import { KnowledgeGraph } from '../../cognition/memory/retrieval/graph/knowledge/KnowledgeGraph.js';
20
+ import { EmbeddingManager } from '../../cognition/rag/EmbeddingManager.js';
21
+ import { InMemoryVectorStore } from '../../cognition/rag/vector_stores/InMemoryVectorStore.js';
22
+ import { InMemoryWorkingMemory } from '../../cognition/substrate/memory/InMemoryWorkingMemory.js';
23
+ import { HEXACO_TRAIT_KEYS, normalizeHexacoTraits } from '../../cognition/substrate/personas/hexaco.js';
24
+ import { createProviderManager, resolveModelOption, resolveProvider } from '../model.js';
25
+ /**
26
+ * Output sizes of the embedding models agentos knows, as each returns them when
27
+ * no `dimensions` is requested: OpenAI's (text-embedding-3 in
28
+ * https://developers.openai.com/api/docs/guides/embeddings; all three as
29
+ * OpenAIProvider records them for its model listing), nomic-embed-text's
30
+ * (https://huggingface.co/nomic-ai/nomic-embed-text-v1.5) and Gemini's (the
31
+ * sizes GeminiProvider's catalog records).
32
+ */
33
+ const KNOWN_EMBEDDING_DIMENSIONS = new Map([
34
+ ['text-embedding-3-small', 1536],
35
+ ['text-embedding-3-large', 3072],
36
+ ['text-embedding-ada-002', 1536],
37
+ ['nomic-embed-text', 768],
38
+ ['gemini-embedding-001', 3072],
39
+ ['gemini-embedding-2', 3072],
40
+ ]);
41
+ /** Providers whose agentos implementation has no embeddings: their `generateEmbeddings` always throws. */
42
+ const PROVIDERS_WITHOUT_EMBEDDINGS = new Map([
43
+ ['anthropic', 'Anthropic'],
44
+ ['groq', 'Groq'],
45
+ ['xai', 'xAI'],
46
+ ['claude-code-cli', 'The Claude Code CLI'],
47
+ ['gemini-cli', 'The Gemini CLI'],
48
+ ]);
49
+ const NEUTRAL_PAD = { valence: 0, arousal: 0, dominance: 0 };
50
+ function messageOf(error) {
51
+ return error instanceof Error ? error.message : String(error);
52
+ }
53
+ /** An Error carrying the error it reports as `cause`. */
54
+ function errorWithCause(message, cause) {
55
+ return Object.assign(new Error(message), { cause });
56
+ }
57
+ function refuseProviderWithoutEmbeddings(providerId) {
58
+ const label = PROVIDERS_WITHOUT_EMBEDDINGS.get(providerId.toLowerCase());
59
+ if (label) {
60
+ throw new Error(`gmi(): ${label} has no embedding models in agentos; set memory.embedding to a provider that has them, such as openai or ollama.`);
61
+ }
62
+ }
63
+ /** The size of a model in {@link KNOWN_EMBEDDING_DIMENSIONS}, also under a vendor prefix (`openai/...`) or an Ollama tag (`...:latest`). */
64
+ function knownDimension(modelId) {
65
+ const exact = KNOWN_EMBEDDING_DIMENSIONS.get(modelId);
66
+ if (exact !== undefined)
67
+ return exact;
68
+ const base = modelId.slice(modelId.lastIndexOf('/') + 1).split(':')[0];
69
+ return KNOWN_EMBEDDING_DIMENSIONS.get(base);
70
+ }
71
+ /** `memory.embedding.dimension`, refused when it is set and is not a positive integer. */
72
+ function checkedDimension(memory) {
73
+ const declared = memory.embedding?.dimension;
74
+ if (declared !== undefined && !(Number.isInteger(declared) && declared > 0)) {
75
+ throw new Error(`gmi(): memory.embedding.dimension must be a positive integer; got ${String(declared)}.`);
76
+ }
77
+ return declared;
78
+ }
79
+ /**
80
+ * Resolves the embedding model from `memory.embedding`, or, when it is unset,
81
+ * from the environment: OpenAI's default embedding model when OPENAI_API_KEY is
82
+ * set, else Ollama's when OLLAMA_BASE_URL is set. Only checks whether those two
83
+ * are set; the provider's credentials are resolved when the memory is built.
84
+ */
85
+ function resolveEmbeddingTarget(memory, env) {
86
+ const requested = memory.embedding?.provider || (env.OPENAI_API_KEY ? 'openai' : env.OLLAMA_BASE_URL ? 'ollama' : undefined);
87
+ if (!requested) {
88
+ throw new Error('gmi(): cognitive memory needs an embedding model. Set memory.embedding: { provider, model } or set OPENAI_API_KEY or OLLAMA_BASE_URL.');
89
+ }
90
+ refuseProviderWithoutEmbeddings(requested);
91
+ let model;
92
+ try {
93
+ model = resolveModelOption({ provider: requested, model: memory.embedding?.model }, 'embedding');
94
+ }
95
+ catch (error) {
96
+ throw errorWithCause(`gmi(): memory.embedding: ${messageOf(error)}`, error);
97
+ }
98
+ // A `provider:model` id names its own provider, which may be one that cannot embed.
99
+ refuseProviderWithoutEmbeddings(model.providerId);
100
+ const declared = checkedDimension(memory);
101
+ const dimension = declared ?? knownDimension(model.modelId);
102
+ if (dimension === undefined) {
103
+ throw new Error(`gmi(): set memory.embedding.dimension for the embedding model '${model.modelId}'; agentos does not know its output size.`);
104
+ }
105
+ return { ...model, dimension };
106
+ }
107
+ /**
108
+ * Checks, when the agent is built, that cognitive memory has an embedding model
109
+ * it can use, so a missing or unusable one fails before the first send. Reads
110
+ * the environment only to pick the provider when `memory.embedding` is unset;
111
+ * credentials are read when the memory is built.
112
+ *
113
+ * @param memory - The agent's memory config.
114
+ * @param env - The environment to read OPENAI_API_KEY and OLLAMA_BASE_URL from (defaults to `process.env`).
115
+ * @throws {Error} Naming `memory.embedding` when no provider is set or detected, when the
116
+ * provider has no embeddings (Anthropic, Groq, xAI, the Claude Code and Gemini CLIs), when the
117
+ * model does not resolve, or when the model's output size is unknown and
118
+ * `memory.embedding.dimension` is unset or not a positive integer.
119
+ */
120
+ export function assertEmbeddingAvailable(memory, env = process.env) {
121
+ resolveEmbeddingTarget(memory, env);
122
+ }
123
+ /**
124
+ * The checks on `memory.embedding` that read no environment, for `gmi()` to run
125
+ * when the agent is built: with a provider set, that it has embeddings, that the
126
+ * model resolves on it, that a declared dimension is a positive integer, and that
127
+ * the model's output size is known or declared. With no provider set, the
128
+ * provider is picked from the environment when the memory is first built, and
129
+ * only a declared dimension is checked here.
130
+ *
131
+ * @param memory - The agent's memory config.
132
+ * @throws {Error} Naming `memory.embedding`, as {@link assertEmbeddingAvailable} does.
133
+ */
134
+ export function assertEmbeddingConfig(memory) {
135
+ if (memory.embedding?.provider) {
136
+ resolveEmbeddingTarget(memory, {});
137
+ return;
138
+ }
139
+ checkedDimension(memory);
140
+ }
141
+ /** The text the build embeds once to check the embedding model. */
142
+ const PROBE_TEXT = 'cognitive memory embedding check';
143
+ /**
144
+ * Embeds {@link PROBE_TEXT} once through the provider and model the embedding
145
+ * manager will call, and fails when the model cannot answer (an Ollama model
146
+ * that was never pulled, a model the provider does not serve) or answers with
147
+ * another size than memory expects. Without this check the build succeeds and
148
+ * memory stays empty: the embedding manager drops each failed or wrong-size
149
+ * vector, the memory store refuses the trace, and the GMI's memory bridge only
150
+ * records a trace warning.
151
+ *
152
+ * @param provider - The provider the embedding manager will call.
153
+ * @param model - The resolved provider and model.
154
+ * @param expected - The vector size memory expects.
155
+ * @param declared - `memory.embedding.dimension`, when set.
156
+ */
157
+ async function probeEmbeddingModel(provider, model, expected, declared) {
158
+ const label = `cognitive memory's embedding model '${model.modelId}' on ${model.providerId}`;
159
+ let response;
160
+ try {
161
+ response = await provider.generateEmbeddings(model.modelId, [PROBE_TEXT]);
162
+ }
163
+ catch (error) {
164
+ throw errorWithCause(`gmi(): ${label} failed a test call (memory.embedding): ${messageOf(error)}`, error);
165
+ }
166
+ if (response?.error) {
167
+ throw errorWithCause(`gmi(): ${label} failed a test call (memory.embedding): ${response.error.message}`, response.error);
168
+ }
169
+ const vector = response?.data?.[0]?.embedding;
170
+ const size = Array.isArray(vector) ? vector.length : 0;
171
+ if (size === 0) {
172
+ throw new Error(`gmi(): ${label} returned no vector for a test call (memory.embedding).`);
173
+ }
174
+ if (size !== expected) {
175
+ const expectation = declared !== undefined
176
+ ? `memory.embedding.dimension (${declared}) declares ${declared}`
177
+ : `agentos expects ${expected} for this model`;
178
+ throw new Error(`gmi(): ${label} returns ${size} values, while ${expectation}; set memory.embedding.dimension to ${size}.`);
179
+ }
180
+ }
181
+ async function buildEmbeddingManager(memory) {
182
+ const target = resolveEmbeddingTarget(memory, process.env);
183
+ let resolved;
184
+ let providerManager;
185
+ try {
186
+ resolved = resolveProvider(target.providerId, target.modelId);
187
+ providerManager = await createProviderManager(resolved);
188
+ }
189
+ catch (error) {
190
+ // The chat model may run on the same provider with other credentials; name the memory's.
191
+ throw errorWithCause(`gmi(): cognitive memory could not start its embedding provider '${target.providerId}' (memory.embedding): ${messageOf(error)}`, error);
192
+ }
193
+ const provider = providerManager.getProvider(resolved.providerId);
194
+ if (!provider) {
195
+ throw new Error(`gmi(): cognitive memory's embedding provider '${resolved.providerId}' is not available (memory.embedding).`);
196
+ }
197
+ await probeEmbeddingModel(provider, resolved, target.dimension, memory.embedding?.dimension);
198
+ const manager = new EmbeddingManager();
199
+ await manager.initialize({
200
+ embeddingModels: [{ modelId: resolved.modelId, providerId: resolved.providerId, dimension: target.dimension, isDefault: true }],
201
+ defaultModelId: resolved.modelId,
202
+ enableCache: true,
203
+ }, providerManager);
204
+ return { manager, dimension: target.dimension };
205
+ }
206
+ /**
207
+ * Builds and initialises the cognitive memory manager an agent's GMIs share.
208
+ *
209
+ * @param opts - The persona, the memory config, the mechanisms and an optional embedding manager.
210
+ * @returns The manager and a `close()` that releases it.
211
+ * @throws {Error} When the embedding model is missing or unusable (see {@link assertEmbeddingAvailable}),
212
+ * when its provider has no credentials or fails to start, when a test embedding through it
213
+ * fails or returns another size than memory expects (skipped for an embedding manager the
214
+ * caller passes), or when the manager fails to initialise.
215
+ */
216
+ export async function createAgentCognitiveMemory(opts) {
217
+ const owned = opts.embeddingManager === undefined;
218
+ const embedding = opts.embeddingManager
219
+ ? { manager: opts.embeddingManager, dimension: await opts.embeddingManager.getEmbeddingDimension() }
220
+ : await buildEmbeddingManager(opts.memory);
221
+ const storeId = `gmi-memory-${opts.persona.id}`;
222
+ const vectorStoreConfig = {
223
+ id: storeId,
224
+ type: 'in_memory',
225
+ similarityMetric: 'cosine',
226
+ defaultEmbeddingDimension: embedding.dimension,
227
+ };
228
+ const vectorStore = new InMemoryVectorStore();
229
+ await vectorStore.initialize(vectorStoreConfig);
230
+ const knowledgeGraph = new KnowledgeGraph();
231
+ await knowledgeGraph.initialize();
232
+ const workingMemory = new InMemoryWorkingMemory();
233
+ await workingMemory.initialize(storeId);
234
+ // Canonical trait names (honestyHumility reads as honesty); 0.5 for a trait the persona leaves out.
235
+ const declared = normalizeHexacoTraits(opts.persona.personalityTraits);
236
+ const traits = {};
237
+ for (const key of HEXACO_TRAIT_KEYS)
238
+ traits[key] = declared[key] ?? 0.5;
239
+ const consolidationEnabled = opts.memory.consolidation?.enabled === true;
240
+ if (consolidationEnabled && opts.memory.consolidation?.interval) {
241
+ console.warn(`[agentos] gmi(): memory.consolidation.interval ('${opts.memory.consolidation.interval}') is not applied; consolidation runs every hour.`);
242
+ }
243
+ const config = {
244
+ workingMemory,
245
+ knowledgeGraph,
246
+ vectorStore,
247
+ embeddingManager: embedding.manager,
248
+ agentId: opts.persona.id,
249
+ traits,
250
+ moodProvider: () => ({ ...NEUTRAL_PAD }),
251
+ featureDetectionStrategy: 'keyword',
252
+ graph: { backend: 'knowledge-graph' },
253
+ ...(opts.mechanisms ? { cognitiveMechanisms: opts.mechanisms } : {}),
254
+ consolidation: { enabled: consolidationEnabled },
255
+ };
256
+ const manager = new CognitiveMemoryManager();
257
+ await manager.initialize(config);
258
+ let closing;
259
+ return {
260
+ manager,
261
+ close: () => (closing ?? (closing = (async () => {
262
+ try {
263
+ await manager.shutdown();
264
+ }
265
+ finally {
266
+ try {
267
+ await vectorStore.shutdown();
268
+ }
269
+ finally {
270
+ if (owned)
271
+ await embedding.manager.shutdown?.();
272
+ }
273
+ }
274
+ })())),
275
+ };
276
+ }
277
+ //# sourceMappingURL=agentCognitiveMemory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentCognitiveMemory.js","sourceRoot":"","sources":["../../../src/api/runtime/agentCognitiveMemory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAG1F,OAAO,EAAE,cAAc,EAAE,MAAM,oEAAoE,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAOxG,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,eAAe,EAA2C,MAAM,aAAa,CAAC;AAElI;;;;;;;GAOG;AACH,MAAM,0BAA0B,GAAgC,IAAI,GAAG,CAAC;IACtE,CAAC,wBAAwB,EAAE,IAAI,CAAC;IAChC,CAAC,wBAAwB,EAAE,IAAI,CAAC;IAChC,CAAC,wBAAwB,EAAE,IAAI,CAAC;IAChC,CAAC,kBAAkB,EAAE,GAAG,CAAC;IACzB,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC9B,CAAC,oBAAoB,EAAE,IAAI,CAAC;CAC7B,CAAC,CAAC;AAEH,0GAA0G;AAC1G,MAAM,4BAA4B,GAAgC,IAAI,GAAG,CAAC;IACxE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M;QACN,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;QACxC,wBAAwB,EAAE,SAAS;QACnC,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;QACrC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,aAAa,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;KACjD,CAAC;IACF,MAAM,OAAO,GAAG,IAAI,sBAAsB,EAAE,CAAC;IAC7C,MAAM,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,OAAkC,CAAC;IACvC,OAAO;QACL,OAAO;QACP,KAAK,EAAE,GAAG,EAAE,CACV,CAAC,OAAO,KAAP,OAAO,GAAK,CAAC,KAAK,IAAI,EAAE;YACvB,IAAI,CAAC;gBACH,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC3B,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC;oBACH,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;gBAC/B,CAAC;wBAAS,CAAC;oBACT,IAAI,KAAK;wBAAE,MAAM,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;gBAClD,CAAC;YACH,CAAC;QACH,CAAC,CAAC,EAAE,EAAC;KACR,CAAC;AACJ,CAAC"}
@@ -1,4 +1,9 @@
1
- export type CapabilitySurface = 'agent' | 'generation' | 'runtime';
1
+ /**
2
+ * Where a config field is read: `agent` (the lightweight `agent()` helper on its
3
+ * legacy runtime), `generation` (generateText and streamText), `runtime` (the full
4
+ * AgentOS runtime) and `gmi` (`agent({ runtime: 'gmi' })` and `gmi()`).
5
+ */
6
+ export type CapabilitySurface = 'agent' | 'generation' | 'runtime' | 'gmi';
2
7
  export type CapabilitySupport = 'enforced' | 'partially_enforced' | 'accepted_but_deferred' | 'runtime_only';
3
8
  export declare const CAPABILITY_KEYS: readonly ["tools", "memory", "rag", "discovery", "guardrails", "security", "permissions", "hitl", "emergent", "voice", "channels", "output", "provenance", "observability", "controls"];
4
9
  export type CapabilityKey = (typeof CAPABILITY_KEYS)[number];
@@ -7,76 +12,91 @@ export declare const BASE_AGENT_CONFIG_CAPABILITY_CONTRACT: {
7
12
  readonly agent: "enforced";
8
13
  readonly generation: "enforced";
9
14
  readonly runtime: "enforced";
15
+ readonly gmi: "enforced";
10
16
  };
11
17
  readonly memory: {
12
18
  readonly agent: "partially_enforced";
13
19
  readonly generation: "runtime_only";
14
20
  readonly runtime: "enforced";
21
+ readonly gmi: "enforced";
15
22
  };
16
23
  readonly rag: {
17
24
  readonly agent: "accepted_but_deferred";
18
25
  readonly generation: "runtime_only";
19
26
  readonly runtime: "enforced";
27
+ readonly gmi: "accepted_but_deferred";
20
28
  };
21
29
  readonly discovery: {
22
30
  readonly agent: "accepted_but_deferred";
23
31
  readonly generation: "runtime_only";
24
32
  readonly runtime: "enforced";
33
+ readonly gmi: "accepted_but_deferred";
25
34
  };
26
35
  readonly guardrails: {
27
36
  readonly agent: "accepted_but_deferred";
28
37
  readonly generation: "partially_enforced";
29
38
  readonly runtime: "enforced";
39
+ readonly gmi: "accepted_but_deferred";
30
40
  };
31
41
  readonly security: {
32
42
  readonly agent: "accepted_but_deferred";
33
43
  readonly generation: "runtime_only";
34
44
  readonly runtime: "enforced";
45
+ readonly gmi: "accepted_but_deferred";
35
46
  };
36
47
  readonly permissions: {
37
48
  readonly agent: "accepted_but_deferred";
38
49
  readonly generation: "partially_enforced";
39
50
  readonly runtime: "enforced";
51
+ readonly gmi: "accepted_but_deferred";
40
52
  };
41
53
  readonly hitl: {
42
54
  readonly agent: "accepted_but_deferred";
43
55
  readonly generation: "runtime_only";
44
56
  readonly runtime: "enforced";
57
+ readonly gmi: "accepted_but_deferred";
45
58
  };
46
59
  readonly emergent: {
47
60
  readonly agent: "accepted_but_deferred";
48
61
  readonly generation: "runtime_only";
49
62
  readonly runtime: "enforced";
63
+ readonly gmi: "accepted_but_deferred";
50
64
  };
51
65
  readonly voice: {
52
66
  readonly agent: "accepted_but_deferred";
53
67
  readonly generation: "runtime_only";
54
68
  readonly runtime: "enforced";
69
+ readonly gmi: "runtime_only";
55
70
  };
56
71
  readonly channels: {
57
72
  readonly agent: "accepted_but_deferred";
58
73
  readonly generation: "runtime_only";
59
74
  readonly runtime: "enforced";
75
+ readonly gmi: "runtime_only";
60
76
  };
61
77
  readonly output: {
62
78
  readonly agent: "accepted_but_deferred";
63
79
  readonly generation: "runtime_only";
64
80
  readonly runtime: "enforced";
81
+ readonly gmi: "accepted_but_deferred";
65
82
  };
66
83
  readonly provenance: {
67
84
  readonly agent: "accepted_but_deferred";
68
85
  readonly generation: "runtime_only";
69
86
  readonly runtime: "enforced";
87
+ readonly gmi: "accepted_but_deferred";
70
88
  };
71
89
  readonly observability: {
72
90
  readonly agent: "partially_enforced";
73
91
  readonly generation: "partially_enforced";
74
92
  readonly runtime: "enforced";
93
+ readonly gmi: "partially_enforced";
75
94
  };
76
95
  readonly controls: {
77
96
  readonly agent: "partially_enforced";
78
97
  readonly generation: "runtime_only";
79
98
  readonly runtime: "enforced";
99
+ readonly gmi: "partially_enforced";
80
100
  };
81
101
  };
82
102
  export declare function getCapabilitySupport(surface: CapabilitySurface, key: CapabilityKey): CapabilitySupport;
@@ -1 +1 @@
1
- {"version":3,"file":"capabilityContract.d.ts","sourceRoot":"","sources":["../../../src/api/runtime/capabilityContract.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,oBAAoB,GACpB,uBAAuB,GACvB,cAAc,CAAC;AAEnB,eAAO,MAAM,eAAe,yLAgBlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBsC,CAAC;AAEzF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,aAAa,GACjB,iBAAiB,CAEnB"}
1
+ {"version":3,"file":"capabilityContract.d.ts","sourceRoot":"","sources":["../../../src/api/runtime/capabilityContract.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,GAAG,KAAK,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,oBAAoB,GACpB,uBAAuB,GACvB,cAAc,CAAC;AAEnB,eAAO,MAAM,eAAe,yLAgBlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBsC,CAAC;AAEzF,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,aAAa,GACjB,iBAAiB,CAEnB"}
@@ -16,21 +16,21 @@ export const CAPABILITY_KEYS = [
16
16
  'controls',
17
17
  ];
18
18
  export const BASE_AGENT_CONFIG_CAPABILITY_CONTRACT = {
19
- tools: { agent: 'enforced', generation: 'enforced', runtime: 'enforced' },
20
- memory: { agent: 'partially_enforced', generation: 'runtime_only', runtime: 'enforced' },
21
- rag: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
22
- discovery: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
23
- guardrails: { agent: 'accepted_but_deferred', generation: 'partially_enforced', runtime: 'enforced' },
24
- security: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
25
- permissions: { agent: 'accepted_but_deferred', generation: 'partially_enforced', runtime: 'enforced' },
26
- hitl: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
27
- emergent: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
28
- voice: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
29
- channels: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
30
- output: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
31
- provenance: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced' },
32
- observability: { agent: 'partially_enforced', generation: 'partially_enforced', runtime: 'enforced' },
33
- controls: { agent: 'partially_enforced', generation: 'runtime_only', runtime: 'enforced' },
19
+ tools: { agent: 'enforced', generation: 'enforced', runtime: 'enforced', gmi: 'enforced' },
20
+ memory: { agent: 'partially_enforced', generation: 'runtime_only', runtime: 'enforced', gmi: 'enforced' },
21
+ rag: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'accepted_but_deferred' },
22
+ discovery: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'accepted_but_deferred' },
23
+ guardrails: { agent: 'accepted_but_deferred', generation: 'partially_enforced', runtime: 'enforced', gmi: 'accepted_but_deferred' },
24
+ security: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'accepted_but_deferred' },
25
+ permissions: { agent: 'accepted_but_deferred', generation: 'partially_enforced', runtime: 'enforced', gmi: 'accepted_but_deferred' },
26
+ hitl: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'accepted_but_deferred' },
27
+ emergent: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'accepted_but_deferred' },
28
+ voice: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'runtime_only' },
29
+ channels: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'runtime_only' },
30
+ output: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'accepted_but_deferred' },
31
+ provenance: { agent: 'accepted_but_deferred', generation: 'runtime_only', runtime: 'enforced', gmi: 'accepted_but_deferred' },
32
+ observability: { agent: 'partially_enforced', generation: 'partially_enforced', runtime: 'enforced', gmi: 'partially_enforced' },
33
+ controls: { agent: 'partially_enforced', generation: 'runtime_only', runtime: 'enforced', gmi: 'partially_enforced' },
34
34
  };
35
35
  export function getCapabilitySupport(surface, key) {
36
36
  return BASE_AGENT_CONFIG_CAPABILITY_CONTRACT[key][surface];
@@ -1 +1 @@
1
- {"version":3,"file":"capabilityContract.js","sourceRoot":"","sources":["../../../src/api/runtime/capabilityContract.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO;IACP,QAAQ;IACR,KAAK;IACL,WAAW;IACX,YAAY;IACZ,UAAU;IACV,aAAa;IACb,MAAM;IACN,UAAU;IACV,OAAO;IACP,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,UAAU;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE;IACzE,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE;IACxF,GAAG,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE;IACxF,SAAS,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAA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options (`agent({ runtime: 'gmi' })`).
4
+ *
5
+ * `light` (the default) is a GMI with its reasoning trace and nothing else
6
+ * unless `memory` is set. `full` adds cognitive memory with every mechanism,
7
+ * sentiment tracking and every metaprompt preset. A {@link CognitionConfig}
8
+ * sets each switch on its own.
9
+ */
10
+ import type { MemoryConfig } from '../types.js';
11
+ import type { CognitiveMechanismsConfig } from '../../cognition/memory/mechanisms/types.js';
12
+ import type { SentimentTrackingConfig } from '../../cognition/substrate/personas/IPersonaDefinition.js';
13
+ /** A named cognition profile. */
14
+ export type CognitionProfile = 'light' | 'full';
15
+ /** A metaprompt preset, named as `SentimentTrackingConfig.presets` names it. */
16
+ export type MetapromptPreset = Exclude<NonNullable<SentimentTrackingConfig['presets']>[number], 'all'>;
17
+ /** Each cognition switch set explicitly, in place of a named profile. */
18
+ export interface CognitionConfig {
19
+ /** Cognitive memory: false, true (defaults) or a MemoryConfig. Unset: the agent's `memory` option. */
20
+ memory?: boolean | MemoryConfig;
21
+ /**
22
+ * Memory mechanisms: true (the agent's `cognitiveMechanisms`, or every
23
+ * mechanism at its defaults), false (none) or a per-mechanism config.
24
+ * Unset means true. Needs memory.
25
+ */
26
+ mechanisms?: boolean | CognitiveMechanismsConfig;
27
+ /** Sentiment tracking: every user turn is scored by the utility AI's lexicon. */
28
+ sentiment?: boolean;
29
+ /**
30
+ * Metaprompt presets: `'all'`, a list of presets, or false. Needs
31
+ * `sentiment`: the presets answer the events sentiment tracking raises.
32
+ */
33
+ metaprompts?: 'all' | MetapromptPreset[] | false;
34
+ }
35
+ /** What a GMI built from agent options runs. */
36
+ export interface ResolvedCognition {
37
+ profile: CognitionProfile | 'custom';
38
+ /** The cognitive memory config, or false for none. */
39
+ memory: MemoryConfig | false;
40
+ /** The mechanisms config the memory manager runs; undefined when memory or the mechanisms are off. */
41
+ mechanisms: CognitiveMechanismsConfig | undefined;
42
+ sentiment: boolean;
43
+ /** The metaprompt presets; false when sentiment is off. */
44
+ metaprompts: 'all' | MetapromptPreset[] | false;
45
+ }
46
+ /** The agent options {@link resolveCognition} reads. */
47
+ export interface CognitionInputs {
48
+ cognition?: CognitionProfile | CognitionConfig;
49
+ memory?: boolean | MemoryConfig;
50
+ cognitiveMechanisms?: CognitiveMechanismsConfig;
51
+ }
52
+ /**
53
+ * Resolves an agent's `cognition`, `memory` and `cognitiveMechanisms` options
54
+ * into the switches a GMI runs with.
55
+ *
56
+ * - `light`: memory only when `memory` is set (then every mechanism, or the
57
+ * agent's `cognitiveMechanisms`); no sentiment tracking, no metaprompts.
58
+ * - `full`: memory unless `memory: false`, every mechanism (or the agent's
59
+ * `cognitiveMechanisms`), sentiment tracking and every metaprompt preset.
60
+ * - A {@link CognitionConfig}: each switch as set, with `memory` falling back
61
+ * to the agent's `memory` option.
62
+ *
63
+ * @throws {Error} When `cognition` names an unknown profile or an unknown metaprompt preset.
64
+ */
65
+ export declare function resolveCognition(opts: CognitionInputs): ResolvedCognition;
66
+ //# sourceMappingURL=gmiCognition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gmiCognition.d.ts","sourceRoot":"","sources":["../../../src/api/runtime/gmiCognition.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AAGxG,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhD,gFAAgF;AAChF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;AAEvG,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,sGAAsG;IACtG,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,yBAAyB,CAAC;IACjD,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,gBAAgB,EAAE,GAAG,KAAK,CAAC;CAClD;AAED,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,gBAAgB,GAAG,QAAQ,CAAC;IACrC,sDAAsD;IACtD,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC;IAC7B,sGAAsG;IACtG,UAAU,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,2DAA2D;IAC3D,WAAW,EAAE,KAAK,GAAG,gBAAgB,EAAE,GAAG,KAAK,CAAC;CACjD;AAED,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,gBAAgB,GAAG,eAAe,CAAC;IAC/C,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAChC,mBAAmB,CAAC,EAAE,yBAAyB,CAAC;CACjD;AAuBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,iBAAiB,CAsBzE"}
@@ -0,0 +1,58 @@
1
+ import { SENTIMENT_PRESET_IDS } from '../../cognition/substrate/personas/personaNormalization.js';
2
+ function memoryOf(value) {
3
+ if (value === undefined || value === false)
4
+ return false;
5
+ return value === true ? {} : value;
6
+ }
7
+ function presetsOf(value) {
8
+ if (value === undefined || value === false)
9
+ return false;
10
+ if (value === 'all')
11
+ return 'all';
12
+ if (!Array.isArray(value)) {
13
+ throw new Error("cognition.metaprompts must be 'all', a list of presets, or false.");
14
+ }
15
+ const unknown = value.filter((name) => !Object.prototype.hasOwnProperty.call(SENTIMENT_PRESET_IDS, name));
16
+ if (unknown.length > 0) {
17
+ throw new Error(`cognition.metaprompts: unknown preset ${unknown.map((name) => `'${String(name)}'`).join(', ')}; ` +
18
+ `use 'all' or a list of ${Object.keys(SENTIMENT_PRESET_IDS).join(', ')}.`);
19
+ }
20
+ return [...value];
21
+ }
22
+ /**
23
+ * Resolves an agent's `cognition`, `memory` and `cognitiveMechanisms` options
24
+ * into the switches a GMI runs with.
25
+ *
26
+ * - `light`: memory only when `memory` is set (then every mechanism, or the
27
+ * agent's `cognitiveMechanisms`); no sentiment tracking, no metaprompts.
28
+ * - `full`: memory unless `memory: false`, every mechanism (or the agent's
29
+ * `cognitiveMechanisms`), sentiment tracking and every metaprompt preset.
30
+ * - A {@link CognitionConfig}: each switch as set, with `memory` falling back
31
+ * to the agent's `memory` option.
32
+ *
33
+ * @throws {Error} When `cognition` names an unknown profile or an unknown metaprompt preset.
34
+ */
35
+ export function resolveCognition(opts) {
36
+ const c = opts.cognition ?? 'light';
37
+ if (c === 'light') {
38
+ const memory = memoryOf(opts.memory);
39
+ return { profile: 'light', memory, mechanisms: memory ? (opts.cognitiveMechanisms ?? {}) : undefined, sentiment: false, metaprompts: false };
40
+ }
41
+ if (c === 'full') {
42
+ const memory = memoryOf(opts.memory ?? true);
43
+ return { profile: 'full', memory, mechanisms: memory ? (opts.cognitiveMechanisms ?? {}) : undefined, sentiment: true, metaprompts: 'all' };
44
+ }
45
+ if (typeof c !== 'object') {
46
+ throw new Error(`cognition: unknown profile '${String(c)}'; use 'light', 'full' or a CognitionConfig.`);
47
+ }
48
+ const memory = memoryOf(c.memory ?? opts.memory);
49
+ const mechanisms = !memory || c.mechanisms === false
50
+ ? undefined
51
+ : c.mechanisms === true || c.mechanisms === undefined
52
+ ? (opts.cognitiveMechanisms ?? {})
53
+ : c.mechanisms;
54
+ const sentiment = c.sentiment === true;
55
+ const metaprompts = presetsOf(c.metaprompts);
56
+ return { profile: 'custom', memory, mechanisms, sentiment, metaprompts: sentiment ? metaprompts : false };
57
+ }
58
+ //# sourceMappingURL=gmiCognition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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,IAAI,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IACnB,MAAM,SAAS,GAAG,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC;IACvC,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC7C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type AgentOptions } from '../agent.js';
2
+ import type { IPersonaDefinition } from '../../cognition/substrate/personas/IPersonaDefinition.js';
3
+ import type { ITool } from '../../core/tools/ITool.js';
4
+ import type { ResolvedCognition } from './gmiCognition.js';
5
+ /** The session store bounds history (spec D10), so the GMI's own count window stays out of the way. */
6
+ export declare const GMI_SESSION_MAX_HISTORY_MESSAGES = 100000;
7
+ /**
8
+ * Builds the persona of a GMI from agent options (spec D6).
9
+ *
10
+ * @param opts - The agent's options.
11
+ * @param cognition - The resolved profile ({@link resolveCognition}): sentiment tracking and metaprompts.
12
+ * @param tools - The agent's tools, adapted: they decide the chain-of-thought text and the persona's capabilities.
13
+ * @throws {Error} When no provider or model can be resolved, as `generateText` throws.
14
+ */
15
+ export declare function personaFromAgentOptions(opts: AgentOptions, cognition: ResolvedCognition, tools: ITool[]): IPersonaDefinition;
16
+ //# sourceMappingURL=gmiPersona.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gmiPersona.d.ts","sourceRoot":"","sources":["../../../src/api/runtime/gmiPersona.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKnE,OAAO,KAAK,EAAE,kBAAkB,EAA2B,MAAM,0DAA0D,CAAC;AAC5H,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,uGAAuG;AACvG,eAAO,MAAM,gCAAgC,SAAU,CAAC;AAsCxD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,kBAAkB,CAsB5H"}