@mastra/memory 0.0.0-error-handler-fix-20251020202607 → 0.0.0-execa-dynamic-import-20260304221256

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 (119) hide show
  1. package/CHANGELOG.md +2181 -3
  2. package/LICENSE.md +15 -0
  3. package/dist/_types/@internal_ai-sdk-v4/dist/index.d.ts +7562 -0
  4. package/dist/chunk-23EXJLET.cjs +84 -0
  5. package/dist/chunk-23EXJLET.cjs.map +1 -0
  6. package/dist/chunk-33ZIVK5L.js +5220 -0
  7. package/dist/chunk-33ZIVK5L.js.map +1 -0
  8. package/dist/chunk-BSDWQEU3.js +79 -0
  9. package/dist/chunk-BSDWQEU3.js.map +1 -0
  10. package/dist/chunk-DGUM43GV.js +10 -0
  11. package/dist/chunk-DGUM43GV.js.map +1 -0
  12. package/dist/chunk-EQ4M72KU.js +439 -0
  13. package/dist/chunk-EQ4M72KU.js.map +1 -0
  14. package/dist/chunk-HJYHDIOC.js +250 -0
  15. package/dist/chunk-HJYHDIOC.js.map +1 -0
  16. package/dist/chunk-IDRQZVB4.cjs +84 -0
  17. package/dist/chunk-IDRQZVB4.cjs.map +1 -0
  18. package/dist/chunk-JEQ2X3Z6.cjs +12 -0
  19. package/dist/chunk-JEQ2X3Z6.cjs.map +1 -0
  20. package/dist/chunk-LIBOSOHM.cjs +252 -0
  21. package/dist/chunk-LIBOSOHM.cjs.map +1 -0
  22. package/dist/chunk-Q7VDGOMJ.cjs +5240 -0
  23. package/dist/chunk-Q7VDGOMJ.cjs.map +1 -0
  24. package/dist/chunk-RC6RZVYE.js +79 -0
  25. package/dist/chunk-RC6RZVYE.js.map +1 -0
  26. package/dist/chunk-ZD3BKU5O.cjs +441 -0
  27. package/dist/chunk-ZD3BKU5O.cjs.map +1 -0
  28. package/dist/docs/SKILL.md +55 -0
  29. package/dist/docs/assets/SOURCE_MAP.json +103 -0
  30. package/dist/docs/references/docs-agents-agent-approval.md +588 -0
  31. package/dist/docs/references/docs-agents-agent-memory.md +209 -0
  32. package/dist/docs/references/docs-agents-network-approval.md +275 -0
  33. package/dist/docs/references/docs-agents-networks.md +299 -0
  34. package/dist/docs/references/docs-agents-supervisor-agents.md +304 -0
  35. package/dist/docs/references/docs-memory-memory-processors.md +314 -0
  36. package/dist/docs/references/docs-memory-message-history.md +260 -0
  37. package/dist/docs/references/docs-memory-observational-memory.md +255 -0
  38. package/dist/docs/references/docs-memory-overview.md +45 -0
  39. package/dist/docs/references/docs-memory-semantic-recall.md +288 -0
  40. package/dist/docs/references/docs-memory-storage.md +261 -0
  41. package/dist/docs/references/docs-memory-working-memory.md +400 -0
  42. package/dist/docs/references/reference-core-getMemory.md +50 -0
  43. package/dist/docs/references/reference-core-listMemory.md +56 -0
  44. package/dist/docs/references/reference-memory-clone-utilities.md +199 -0
  45. package/dist/docs/references/reference-memory-cloneThread.md +142 -0
  46. package/dist/docs/references/reference-memory-createThread.md +68 -0
  47. package/dist/docs/references/reference-memory-getThreadById.md +24 -0
  48. package/dist/docs/references/reference-memory-listThreads.md +145 -0
  49. package/dist/docs/references/reference-memory-memory-class.md +147 -0
  50. package/dist/docs/references/reference-memory-observational-memory.md +577 -0
  51. package/dist/docs/references/reference-processors-token-limiter-processor.md +115 -0
  52. package/dist/docs/references/reference-storage-dynamodb.md +282 -0
  53. package/dist/docs/references/reference-storage-libsql.md +135 -0
  54. package/dist/docs/references/reference-storage-mongodb.md +262 -0
  55. package/dist/docs/references/reference-storage-postgresql.md +526 -0
  56. package/dist/docs/references/reference-storage-upstash.md +160 -0
  57. package/dist/docs/references/reference-vectors-libsql.md +305 -0
  58. package/dist/docs/references/reference-vectors-mongodb.md +295 -0
  59. package/dist/docs/references/reference-vectors-pg.md +408 -0
  60. package/dist/docs/references/reference-vectors-upstash.md +294 -0
  61. package/dist/index.cjs +16008 -291
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/index.d.ts +252 -49
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +15970 -295
  66. package/dist/index.js.map +1 -1
  67. package/dist/observational-memory-3NJCJNCQ.cjs +64 -0
  68. package/dist/observational-memory-3NJCJNCQ.cjs.map +1 -0
  69. package/dist/observational-memory-SKDDNPFW.js +3 -0
  70. package/dist/observational-memory-SKDDNPFW.js.map +1 -0
  71. package/dist/processors/index.cjs +57 -158
  72. package/dist/processors/index.cjs.map +1 -1
  73. package/dist/processors/index.d.ts +1 -2
  74. package/dist/processors/index.d.ts.map +1 -1
  75. package/dist/processors/index.js +1 -156
  76. package/dist/processors/index.js.map +1 -1
  77. package/dist/processors/observational-memory/date-utils.d.ts +35 -0
  78. package/dist/processors/observational-memory/date-utils.d.ts.map +1 -0
  79. package/dist/processors/observational-memory/index.d.ts +18 -0
  80. package/dist/processors/observational-memory/index.d.ts.map +1 -0
  81. package/dist/processors/observational-memory/markers.d.ts +94 -0
  82. package/dist/processors/observational-memory/markers.d.ts.map +1 -0
  83. package/dist/processors/observational-memory/observational-memory.d.ts +842 -0
  84. package/dist/processors/observational-memory/observational-memory.d.ts.map +1 -0
  85. package/dist/processors/observational-memory/observer-agent.d.ts +140 -0
  86. package/dist/processors/observational-memory/observer-agent.d.ts.map +1 -0
  87. package/dist/processors/observational-memory/operation-registry.d.ts +14 -0
  88. package/dist/processors/observational-memory/operation-registry.d.ts.map +1 -0
  89. package/dist/processors/observational-memory/reflector-agent.d.ts +55 -0
  90. package/dist/processors/observational-memory/reflector-agent.d.ts.map +1 -0
  91. package/dist/processors/observational-memory/thresholds.d.ts +52 -0
  92. package/dist/processors/observational-memory/thresholds.d.ts.map +1 -0
  93. package/dist/processors/observational-memory/token-counter.d.ts +33 -0
  94. package/dist/processors/observational-memory/token-counter.d.ts.map +1 -0
  95. package/dist/processors/observational-memory/types.d.ts +539 -0
  96. package/dist/processors/observational-memory/types.d.ts.map +1 -0
  97. package/dist/token-6GSAFR2W-ABXTQD64.js +61 -0
  98. package/dist/token-6GSAFR2W-ABXTQD64.js.map +1 -0
  99. package/dist/token-6GSAFR2W-TW2P7HCS.cjs +63 -0
  100. package/dist/token-6GSAFR2W-TW2P7HCS.cjs.map +1 -0
  101. package/dist/token-APYSY3BW-2DN6RAUY.js +61 -0
  102. package/dist/token-APYSY3BW-2DN6RAUY.js.map +1 -0
  103. package/dist/token-APYSY3BW-ZQ7TMBY7.cjs +63 -0
  104. package/dist/token-APYSY3BW-ZQ7TMBY7.cjs.map +1 -0
  105. package/dist/token-util-NEHG7TUY-GYFEVMWP.cjs +10 -0
  106. package/dist/token-util-NEHG7TUY-GYFEVMWP.cjs.map +1 -0
  107. package/dist/token-util-NEHG7TUY-XQP3QSPX.js +8 -0
  108. package/dist/token-util-NEHG7TUY-XQP3QSPX.js.map +1 -0
  109. package/dist/token-util-RMHT2CPJ-6TGPE335.cjs +10 -0
  110. package/dist/token-util-RMHT2CPJ-6TGPE335.cjs.map +1 -0
  111. package/dist/token-util-RMHT2CPJ-RJEA3FAN.js +8 -0
  112. package/dist/token-util-RMHT2CPJ-RJEA3FAN.js.map +1 -0
  113. package/dist/tools/working-memory.d.ts +17 -24
  114. package/dist/tools/working-memory.d.ts.map +1 -1
  115. package/package.json +26 -25
  116. package/dist/processors/token-limiter.d.ts +0 -32
  117. package/dist/processors/token-limiter.d.ts.map +0 -1
  118. package/dist/processors/tool-call-filter.d.ts +0 -20
  119. package/dist/processors/tool-call-filter.d.ts.map +0 -1
@@ -0,0 +1,539 @@
1
+ import type { AgentConfig } from '@mastra/core/agent';
2
+ import type { ObservationalMemoryModelSettings } from '@mastra/core/memory';
3
+ /**
4
+ * Threshold can be a simple number or a dynamic range.
5
+ *
6
+ * Simple form:
7
+ * ```ts
8
+ * messageTokens: 10_000
9
+ * ```
10
+ *
11
+ * Range form (dynamic threshold based on observation space):
12
+ * ```ts
13
+ * messageTokens: { min: 8_000, max: 15_000 }
14
+ * ```
15
+ */
16
+ export type ThresholdRange = {
17
+ /** Minimum threshold (used when observations are full) */
18
+ min: number;
19
+ /** Maximum threshold (used when observations have room) */
20
+ max: number;
21
+ };
22
+ /**
23
+ * Model settings for Observer/Reflector agents.
24
+ * Re-exported from @mastra/core/memory for convenience.
25
+ */
26
+ export type ModelSettings = ObservationalMemoryModelSettings;
27
+ /**
28
+ * Google-specific provider options
29
+ */
30
+ export interface GoogleProviderOptions {
31
+ thinkingConfig?: {
32
+ thinkingBudget?: number;
33
+ includeThoughts?: boolean;
34
+ };
35
+ [key: string]: any;
36
+ }
37
+ /**
38
+ * Provider-specific options for model configuration.
39
+ * Compatible with core's ProviderOptions type.
40
+ */
41
+ export interface ProviderOptions {
42
+ google?: GoogleProviderOptions;
43
+ [key: string]: Record<string, any> | undefined;
44
+ }
45
+ /**
46
+ * Configuration for the observation step (Observer agent).
47
+ */
48
+ export interface ObservationConfig {
49
+ /**
50
+ * Model for the Observer agent.
51
+ * Can be a model ID string (e.g., 'openai/gpt-4o'), a LanguageModel instance,
52
+ * a function that returns either (for dynamic model selection),
53
+ * or an array of ModelWithRetries for fallback support.
54
+ *
55
+ * Cannot be set if a top-level `model` is also provided on ObservationalMemoryConfig.
56
+ *
57
+ * @default 'google/gemini-2.5-flash'
58
+ */
59
+ model?: AgentConfig['model'];
60
+ /**
61
+ * Token count of unobserved messages that triggers observation.
62
+ * When unobserved message tokens exceed this, the Observer is called.
63
+ *
64
+ * @default 30000
65
+ */
66
+ messageTokens?: number;
67
+ /**
68
+ * Model settings for the Observer agent.
69
+ * @default { temperature: 0.3 }
70
+ *
71
+ * Note: `maxOutputTokens: 100_000` is only applied by default when using
72
+ * the built-in default model selection.
73
+ */
74
+ modelSettings?: ModelSettings;
75
+ /**
76
+ * Provider-specific options.
77
+ * @default { google: { thinkingConfig: { thinkingBudget: 215 } } }
78
+ */
79
+ providerOptions?: ProviderOptions;
80
+ /**
81
+ * Maximum tokens per batch when observing multiple threads.
82
+ * Threads are chunked into batches of this size and processed in parallel.
83
+ * Lower values = more parallelism but more API calls.
84
+ * Higher values = fewer API calls but less parallelism.
85
+ *
86
+ * @default 10000
87
+ */
88
+ maxTokensPerBatch?: number;
89
+ /**
90
+ * Token interval for async background observation buffering.
91
+ * Can be an absolute token count (e.g. `5000`) or a fraction of `messageTokens`
92
+ * (e.g. `0.25` = buffer every 25% of threshold).
93
+ *
94
+ * Observations run asynchronously in the background at this interval,
95
+ * storing results in a buffer. When the main `messageTokens` threshold is reached,
96
+ * buffered observations are activated instantly (no blocking LLM call).
97
+ *
98
+ * Set to `false` to explicitly disable async buffering.
99
+ *
100
+ * Must resolve to less than `messageTokens`.
101
+ *
102
+ * @default 0.2 (buffer every 20% of messageTokens)
103
+ */
104
+ bufferTokens?: number | false;
105
+ /**
106
+ * Controls how many raw message tokens to retain after activation.
107
+ *
108
+ * - **Ratio (0 < value <= 1):** fraction of `messageTokens` to activate.
109
+ * The retention floor is `messageTokens * (1 - ratio)`.
110
+ * e.g. `0.8` with `messageTokens: 30000` → retain ~6000 tokens.
111
+ *
112
+ * - **Absolute (value >= 1000):** exact number of message tokens to retain.
113
+ * e.g. `3000` → always aim to keep ~3000 tokens of raw message history.
114
+ * Must be less than `messageTokens`.
115
+ *
116
+ * Values between 1 and 1000 are invalid.
117
+ *
118
+ * Requires `bufferTokens` to also be set.
119
+ *
120
+ * @default 0.8 (retain ~20% of messageTokens as raw messages)
121
+ */
122
+ bufferActivation?: number;
123
+ /**
124
+ * Token threshold above which synchronous (blocking) observation is forced.
125
+ * Between `messageTokens` and `blockAfter`, only async buffering/activation is used.
126
+ * Above `blockAfter`, a synchronous observation runs as a last resort.
127
+ *
128
+ * Accepts either:
129
+ * - A multiplier (1 < value < 2): multiplied by `messageTokens`.
130
+ * e.g. `blockAfter: 1.5` with `messageTokens: 20_000` → blocks at 30,000.
131
+ * - An absolute token count (≥ 2): must be greater than `messageTokens`.
132
+ *
133
+ * Only relevant when `bufferTokens` is set.
134
+ * If not set, synchronous observation is never used when async buffering is enabled.
135
+ */
136
+ blockAfter?: number;
137
+ /**
138
+ * Custom instructions to append to the Observer's system prompt.
139
+ * Use this to customize observation behavior for specific use cases.
140
+ */
141
+ instruction?: string;
142
+ }
143
+ /**
144
+ * Configuration for the reflection step (Reflector agent).
145
+ */
146
+ export interface ReflectionConfig {
147
+ /**
148
+ * Model for the Reflector agent.
149
+ * Can be a model ID string (e.g., 'openai/gpt-4o'), a LanguageModel instance,
150
+ * a function that returns either (for dynamic model selection),
151
+ * or an array of ModelWithRetries for fallback support.
152
+ *
153
+ * Cannot be set if a top-level `model` is also provided on ObservationalMemoryConfig.
154
+ *
155
+ * @default 'google/gemini-2.5-flash'
156
+ */
157
+ model?: AgentConfig['model'];
158
+ /**
159
+ * Token count of observations that triggers reflection.
160
+ * When observation tokens exceed this, the Reflector is called to condense them.
161
+ *
162
+ * @default 40000
163
+ */
164
+ observationTokens?: number;
165
+ /**
166
+ * Model settings for the Reflector agent.
167
+ * @default { temperature: 0 }
168
+ *
169
+ * Note: `maxOutputTokens: 100_000` is only applied by default when using
170
+ * the built-in default model selection.
171
+ */
172
+ modelSettings?: ModelSettings;
173
+ /**
174
+ * Provider-specific options.
175
+ * @default { google: { thinkingConfig: { thinkingBudget: 1024 } } }
176
+ */
177
+ providerOptions?: ProviderOptions;
178
+ /**
179
+ * Token threshold above which synchronous (blocking) reflection is forced.
180
+ * Between `observationTokens` and `blockAfter`, only async buffering/activation is used.
181
+ * Above `blockAfter`, a synchronous reflection runs as a last resort.
182
+ *
183
+ * Accepts either:
184
+ * - A multiplier (1 < value < 2): multiplied by `observationTokens`.
185
+ * e.g. `blockAfter: 1.5` with `observationTokens: 30_000` → blocks at 45,000.
186
+ * - An absolute token count (≥ 2): must be greater than `observationTokens`.
187
+ *
188
+ * Only relevant when `bufferActivation` is set.
189
+ * If not set, synchronous reflection is never used when async reflection is enabled.
190
+ */
191
+ blockAfter?: number;
192
+ /**
193
+ * Ratio (0-1) controlling when async reflection buffering starts.
194
+ * When observation tokens reach `observationTokens * bufferActivation`,
195
+ * reflection runs in the background. On activation at the full threshold,
196
+ * the buffered reflection replaces the line range it covers, preserving
197
+ * any new observations appended after that range.
198
+ *
199
+ * Requires `observation.bufferTokens` to also be set.
200
+ */
201
+ bufferActivation?: number;
202
+ /**
203
+ * Custom instructions to append to the Reflector's system prompt.
204
+ * Use this to customize reflection behavior for specific use cases.
205
+ */
206
+ instruction?: string;
207
+ }
208
+ /**
209
+ * Result from Observer agent
210
+ */
211
+ export interface ObserverResult {
212
+ /** The extracted observations */
213
+ observations: string;
214
+ /** Suggested continuation for the Actor */
215
+ suggestedContinuation?: string;
216
+ }
217
+ /**
218
+ * Result from Reflector agent
219
+ */
220
+ export interface ReflectorResult {
221
+ /** The condensed observations */
222
+ observations: string;
223
+ /** Suggested continuation for the Actor */
224
+ suggestedContinuation?: string;
225
+ /** True if the output was detected as degenerate (repetition loop) and should be discarded/retried */
226
+ degenerate?: boolean;
227
+ }
228
+ /**
229
+ * Config snapshot included in observation markers for debugging.
230
+ */
231
+ export interface ObservationMarkerConfig {
232
+ messageTokens: number;
233
+ observationTokens: number;
234
+ scope: 'thread' | 'resource';
235
+ }
236
+ /**
237
+ * Start marker inserted when observation begins.
238
+ * Everything BEFORE this marker will be observed.
239
+ *
240
+ * If this marker exists without a corresponding `end` or `failed` marker,
241
+ * observation is in progress.
242
+ */
243
+ /** Type of OM operation - observation or reflection */
244
+ export type OmOperationType = 'observation' | 'reflection';
245
+ export interface DataOmObservationStartPart {
246
+ type: 'data-om-observation-start';
247
+ data: {
248
+ /** Unique ID for this observation cycle - shared between start/end/failed markers */
249
+ cycleId: string;
250
+ /** Type of operation: 'observation' or 'reflection' */
251
+ operationType: OmOperationType;
252
+ /** When observation started */
253
+ startedAt: string;
254
+ /** Tokens being observed in this batch */
255
+ tokensToObserve: number;
256
+ /** The OM record ID this observation belongs to */
257
+ recordId: string;
258
+ /** This thread's ID */
259
+ threadId: string;
260
+ /** All thread IDs being observed in this batch (for resource-scoped) */
261
+ threadIds: string[];
262
+ /** Snapshot of config at observation time */
263
+ config: ObservationMarkerConfig;
264
+ };
265
+ }
266
+ /**
267
+ * End marker inserted when observation completes successfully.
268
+ * Parts BEFORE the corresponding `start` marker have been observed.
269
+ */
270
+ export interface DataOmObservationEndPart {
271
+ type: 'data-om-observation-end';
272
+ data: {
273
+ /** Unique ID for this observation cycle - shared between start/end/failed markers */
274
+ cycleId: string;
275
+ /** Type of operation: 'observation' or 'reflection' */
276
+ operationType: OmOperationType;
277
+ /** When observation completed */
278
+ completedAt: string;
279
+ /** Duration in milliseconds */
280
+ durationMs: number;
281
+ /** Total tokens that were observed */
282
+ tokensObserved: number;
283
+ /** Resulting observation tokens after compression */
284
+ observationTokens: number;
285
+ /** The actual observations generated in this cycle */
286
+ observations?: string;
287
+ /** Current task extracted by the Observer */
288
+ currentTask?: string;
289
+ /** Suggested response extracted by the Observer */
290
+ suggestedResponse?: string;
291
+ /** The OM record ID */
292
+ recordId: string;
293
+ /** This thread's ID */
294
+ threadId: string;
295
+ };
296
+ }
297
+ /**
298
+ * Failed marker inserted when observation fails.
299
+ * Allows for retry logic and debugging.
300
+ */
301
+ export interface DataOmObservationFailedPart {
302
+ type: 'data-om-observation-failed';
303
+ data: {
304
+ /** Unique ID for this observation cycle - shared between start/end/failed markers */
305
+ cycleId: string;
306
+ /** Type of operation: 'observation' or 'reflection' */
307
+ operationType: OmOperationType;
308
+ /** When observation failed */
309
+ failedAt: string;
310
+ /** Duration until failure in milliseconds */
311
+ durationMs: number;
312
+ /** Tokens that were attempted to observe */
313
+ tokensAttempted: number;
314
+ /** Error message */
315
+ error: string;
316
+ /** The OM record ID */
317
+ recordId: string;
318
+ /** This thread's ID */
319
+ threadId: string;
320
+ /** The buffered observations/reflection content (for UI expansion) */
321
+ observations?: string;
322
+ };
323
+ }
324
+ /**
325
+ * Status update streamed during agent execution to provide real-time
326
+ * observational memory state for UI feedback.
327
+ *
328
+ * Clients can calculate percentages from tokens/threshold pairs.
329
+ *
330
+ * @example
331
+ * ```ts
332
+ * // Message window usage
333
+ * const msgPercent = status.windows.active.messages.tokens / status.windows.active.messages.threshold;
334
+ *
335
+ * // Post-activation estimate for message window
336
+ * const postActivation = status.windows.active.messages.tokens - status.windows.buffered.observations.messageTokens;
337
+ * ```
338
+ */
339
+ export interface DataOmStatusPart {
340
+ type: 'data-om-status';
341
+ data: {
342
+ windows: {
343
+ /** Active context windows — current token usage and thresholds */
344
+ active: {
345
+ /** Message window: unobserved message tokens vs threshold that triggers observation */
346
+ messages: {
347
+ tokens: number;
348
+ threshold: number;
349
+ };
350
+ /** Observation window: observation tokens vs threshold that triggers reflection */
351
+ observations: {
352
+ tokens: number;
353
+ threshold: number;
354
+ };
355
+ };
356
+ /** Buffered content waiting to be activated */
357
+ buffered: {
358
+ /** Buffered observation chunks staged for activation */
359
+ observations: {
360
+ /** Number of chunks staged */
361
+ chunks: number;
362
+ /** Message tokens that will be cleared from context on activation */
363
+ messageTokens: number;
364
+ /** Projected message tokens that would be removed if activation happened now (based on bufferActivation ratio and chunk boundaries) */
365
+ projectedMessageRemoval: number;
366
+ /** Observation tokens that will be added on activation */
367
+ observationTokens: number;
368
+ /** Current state of observation buffering */
369
+ status: 'idle' | 'running' | 'complete';
370
+ };
371
+ /** Buffered reflection waiting to be activated */
372
+ reflection: {
373
+ /** Observation tokens that were fed into the reflector (pre-compression) */
374
+ inputObservationTokens: number;
375
+ /** Observation tokens the reflection will produce on activation (post-compression) */
376
+ observationTokens: number;
377
+ /** Current state of reflection buffering */
378
+ status: 'idle' | 'running' | 'complete';
379
+ };
380
+ };
381
+ };
382
+ /** The OM record ID */
383
+ recordId: string;
384
+ /** Thread ID */
385
+ threadId: string;
386
+ /** Step number in the agent loop */
387
+ stepNumber: number;
388
+ /** Current reflection generation count */
389
+ generationCount: number;
390
+ };
391
+ }
392
+ /**
393
+ * Start marker inserted when async buffering begins.
394
+ * Buffering runs in the background to pre-compute observations before the main threshold.
395
+ */
396
+ export interface DataOmBufferingStartPart {
397
+ type: 'data-om-buffering-start';
398
+ data: {
399
+ /** Unique ID for this buffering cycle - shared between start/end/failed markers */
400
+ cycleId: string;
401
+ /** Type of operation being buffered: 'observation' or 'reflection' */
402
+ operationType: OmOperationType;
403
+ /** When buffering started */
404
+ startedAt: string;
405
+ /** Tokens being buffered in this cycle */
406
+ tokensToBuffer: number;
407
+ /** The OM record ID this buffering belongs to */
408
+ recordId: string;
409
+ /** This thread's ID */
410
+ threadId: string;
411
+ /** All thread IDs being buffered (for resource-scoped) */
412
+ threadIds: string[];
413
+ /** Snapshot of config at buffering time */
414
+ config: ObservationMarkerConfig;
415
+ };
416
+ }
417
+ /**
418
+ * End marker inserted when async buffering completes successfully.
419
+ * The buffered content is stored but not yet activated (visible to the main context).
420
+ */
421
+ export interface DataOmBufferingEndPart {
422
+ type: 'data-om-buffering-end';
423
+ data: {
424
+ /** Unique ID for this buffering cycle - shared between start/end/failed markers */
425
+ cycleId: string;
426
+ /** Type of operation that was buffered: 'observation' or 'reflection' */
427
+ operationType: OmOperationType;
428
+ /** When buffering completed */
429
+ completedAt: string;
430
+ /** Duration in milliseconds */
431
+ durationMs: number;
432
+ /** Total tokens that were buffered */
433
+ tokensBuffered: number;
434
+ /** Resulting observation/reflection tokens after compression */
435
+ bufferedTokens: number;
436
+ /** The OM record ID */
437
+ recordId: string;
438
+ /** This thread's ID */
439
+ threadId: string;
440
+ /** The buffered observations/reflection content (for UI expansion) */
441
+ observations?: string;
442
+ };
443
+ }
444
+ /**
445
+ * Failed marker inserted when async buffering fails.
446
+ * The system will fall back to synchronous processing at threshold.
447
+ */
448
+ export interface DataOmBufferingFailedPart {
449
+ type: 'data-om-buffering-failed';
450
+ data: {
451
+ /** Unique ID for this buffering cycle - shared between start/end/failed markers */
452
+ cycleId: string;
453
+ /** Type of operation that failed: 'observation' or 'reflection' */
454
+ operationType: OmOperationType;
455
+ /** When buffering failed */
456
+ failedAt: string;
457
+ /** Duration until failure in milliseconds */
458
+ durationMs: number;
459
+ /** Tokens that were attempted to buffer */
460
+ tokensAttempted: number;
461
+ /** Error message */
462
+ error: string;
463
+ /** The OM record ID */
464
+ recordId: string;
465
+ /** This thread's ID */
466
+ threadId: string;
467
+ /** The buffered observations/reflection content (for UI expansion) */
468
+ observations?: string;
469
+ };
470
+ }
471
+ /**
472
+ * Union of all buffering marker types.
473
+ */
474
+ export type DataOmBufferingPart = DataOmBufferingStartPart | DataOmBufferingEndPart | DataOmBufferingFailedPart;
475
+ /**
476
+ * Marker inserted when buffered observations are activated (moved to active context).
477
+ * This is an instant operation that happens when the main threshold is reached.
478
+ */
479
+ export interface DataOmActivationPart {
480
+ type: 'data-om-activation';
481
+ data: {
482
+ /** Unique ID for this activation event */
483
+ cycleId: string;
484
+ /** Type of operation: 'observation' or 'reflection' */
485
+ operationType: OmOperationType;
486
+ /** When activation occurred */
487
+ activatedAt: string;
488
+ /** Number of buffered chunks that were activated */
489
+ chunksActivated: number;
490
+ /** Total tokens from messages that were activated */
491
+ tokensActivated: number;
492
+ /** Resulting observation tokens after activation */
493
+ observationTokens: number;
494
+ /** Number of messages that were observed via activation */
495
+ messagesActivated: number;
496
+ /** The OM record ID */
497
+ recordId: string;
498
+ /** This thread's ID */
499
+ threadId: string;
500
+ /** Current reflection generation count */
501
+ generationCount: number;
502
+ /** Snapshot of config at activation time */
503
+ config: ObservationMarkerConfig;
504
+ /** The actual observations from activated chunks (for UI display) */
505
+ observations?: string;
506
+ };
507
+ }
508
+ /**
509
+ * Union of all observation marker types.
510
+ */
511
+ export type DataOmObservationPart = DataOmObservationStartPart | DataOmObservationEndPart | DataOmObservationFailedPart | DataOmStatusPart;
512
+ /**
513
+ * Union of all OM data parts (observation, buffering, status, activation).
514
+ */
515
+ export type DataOmPart = DataOmObservationPart | DataOmBufferingPart | DataOmActivationPart;
516
+ /**
517
+ * @deprecated Use DataOmObservationStartPart and DataOmObservationEndPart instead.
518
+ * Kept for backwards compatibility during migration.
519
+ */
520
+ export interface DataOmObservedPart {
521
+ type: 'data-om-observed';
522
+ data: {
523
+ /** When this observation occurred */
524
+ observedAt: string;
525
+ /** Total tokens observed across all threads in this batch */
526
+ tokensObserved: number;
527
+ /** Resulting observation tokens after compression */
528
+ observationTokens: number;
529
+ /** The OM record ID this observation belongs to */
530
+ recordId: string;
531
+ /** This thread's ID */
532
+ threadId: string;
533
+ /** All thread IDs that were observed in this batch (for resource-scoped) */
534
+ threadIds: string[];
535
+ /** Snapshot of config at observation time (for debugging) */
536
+ config?: ObservationMarkerConfig;
537
+ };
538
+ }
539
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAE5E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAE7B;;;;;OAKG;IACH,aAAa,CAAC,EAA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QAExB,qDAAqD;QACrD,eAAe,EAAE,MAAM,CAAC;QAExB,oDAAoD;QACpD,iBAAiB,EAAE,MAAM,CAAC;QAE1B,2DAA2D;QAC3D,iBAAiB,EAAE,MAAM,CAAC;QAE1B,uBAAuB;QACvB,QAAQ,EAAE,MAAM,CAAC;QAEjB,uBAAuB;QACvB,QAAQ,EAAE,MAAM,CAAC;QAEjB,0CAA0C;QAC1C,eAAe,EAAE,MAAM,CAAC;QAExB,4CAA4C;QAC5C,MAAM,EAAE,uBAAuB,CAAC;QAEhC,qEAAqE;QACrE,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,0BAA0B,GAC1B,wBAAwB,GACxB,2BAA2B,GAC3B,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE;QACJ,qCAAqC;QACrC,UAAU,EAAE,MAAM,CAAC;QAEnB,6DAA6D;QAC7D,cAAc,EAAE,MAAM,CAAC;QAEvB,qDAAqD;QACrD,iBAAiB,EAAE,MAAM,CAAC;QAE1B,mDAAmD;QACnD,QAAQ,EAAE,MAAM,CAAC;QAEjB,uBAAuB;QACvB,QAAQ,EAAE,MAAM,CAAC;QAEjB,4EAA4E;QAC5E,SAAS,EAAE,MAAM,EAAE,CAAC;QAEpB,6DAA6D;QAC7D,MAAM,CAAC,EAAE,uBAAuB,CAAC;KAClC,CAAC;CACH"}
@@ -0,0 +1,61 @@
1
+ import { require_token_util } from './chunk-HJYHDIOC.js';
2
+ import { __commonJS, require_token_error } from './chunk-BSDWQEU3.js';
3
+
4
+ // ../_vendored/ai_v5/dist/token-6GSAFR2W.js
5
+ var require_token = __commonJS({
6
+ "../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token.js"(exports$1, module) {
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
+ var token_exports = {};
25
+ __export(token_exports, {
26
+ refreshToken: () => refreshToken
27
+ });
28
+ module.exports = __toCommonJS(token_exports);
29
+ var import_token_error = require_token_error();
30
+ var import_token_util = require_token_util();
31
+ async function refreshToken() {
32
+ const { projectId, teamId } = (0, import_token_util.findProjectInfo)();
33
+ let maybeToken = (0, import_token_util.loadToken)(projectId);
34
+ if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
35
+ const authToken = (0, import_token_util.getVercelCliToken)();
36
+ if (!authToken) {
37
+ throw new import_token_error.VercelOidcTokenError(
38
+ "Failed to refresh OIDC token: login to vercel cli"
39
+ );
40
+ }
41
+ if (!projectId) {
42
+ throw new import_token_error.VercelOidcTokenError(
43
+ "Failed to refresh OIDC token: project id not found"
44
+ );
45
+ }
46
+ maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
47
+ if (!maybeToken) {
48
+ throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
49
+ }
50
+ (0, import_token_util.saveToken)(maybeToken, projectId);
51
+ }
52
+ process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
53
+ return;
54
+ }
55
+ }
56
+ });
57
+ var token6GSAFR2W = require_token();
58
+
59
+ export { token6GSAFR2W as default };
60
+ //# sourceMappingURL=token-6GSAFR2W-ABXTQD64.js.map
61
+ //# sourceMappingURL=token-6GSAFR2W-ABXTQD64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/token.js"],"names":["exports"],"mappings":";;;;AAAA,IAAA,gBAAA,UAAA,CAAA;AAAA,EAAA,wFAAA,CAAAA,WAAA,MAAA,EAAA;AACA,IAAA,IAAI,YAAY,MAAA,CAAO,cAAA;AACvB,IAAA,IAAI,mBAAmB,MAAA,CAAO,wBAAA;AAC9B,IAAA,IAAI,oBAAoB,MAAA,CAAO,mBAAA;AAC/B,IAAA,IAAI,YAAA,GAAe,OAAO,SAAA,CAAU,cAAA;AACpC,IAAA,IAAI,QAAA,GAAW,CAAC,MAAA,EAAQ,GAAA,KAAQ;AAC9B,MAAA,KAAA,IAAS,IAAA,IAAQ,GAAA;AACf,QAAA,SAAA,CAAU,MAAA,EAAQ,MAAM,EAAE,GAAA,EAAK,IAAI,IAAI,CAAA,EAAG,UAAA,EAAY,IAAA,EAAM,CAAA;AAChE,IAAA,CAAA;AACA,IAAA,IAAI,WAAA,GAAc,CAAC,EAAA,EAAI,IAAA,EAAM,QAAQ,IAAA,KAAS;AAC5C,MAAA,IAAI,QAAQ,OAAO,IAAA,KAAS,QAAA,IAAY,OAAO,SAAS,UAAA,EAAY;AAClE,QAAA,KAAA,IAAS,GAAA,IAAO,kBAAkB,IAAI,CAAA;AACpC,UAAA,IAAI,CAAC,YAAA,CAAa,IAAA,CAAK,EAAA,EAAI,GAAG,KAAK,GAAA,KAAQ,MAAA;AACzC,YAAA,SAAA,CAAU,IAAI,GAAA,EAAK,EAAE,GAAA,EAAK,MAAM,KAAK,GAAG,CAAA,EAAG,UAAA,EAAY,EAAE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AM,CAAA;AACzF,QAAA,IAAI,CAAC,UAAA,EAAY;AACf,UAAA,MAAM,IAAI,kBAAA,CAAmB,oBAAA,CAAqB,8BAA8B,CAAA;AAClF,QAAA;AACA,QAAA,IAAI,iBAAA,CAAkB,SAAA,EAAW,UAAA,EAAY,SAAS,CAAA;AACxD,MAAA;AACA,MAAA,OAAA,CAAQ,GAAA,CAAI,oBAAoB,UAAA,CAAW,KAAA;AAC3C,MAAA;AACF,IAAA;AAAA,EAAA;AAAA,CAAA,CAAA","file":"token-6GSAFR2W-ABXTQD64.js","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken() {\n const { projectId, teamId } = (0, import_token_util.findProjectInfo)();\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {\n const authToken = (0, import_token_util.getVercelCliToken)();\n if (!authToken) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: login to vercel cli\"\n );\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: project id not found\"\n );\n }\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"]}