@dexto/core 1.5.3 → 1.5.4

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 (92) hide show
  1. package/dist/agent/DextoAgent.cjs +284 -1
  2. package/dist/agent/DextoAgent.d.ts +114 -0
  3. package/dist/agent/DextoAgent.d.ts.map +1 -1
  4. package/dist/agent/DextoAgent.js +275 -1
  5. package/dist/agent/schemas.d.ts +51 -21
  6. package/dist/agent/schemas.d.ts.map +1 -1
  7. package/dist/context/compaction/overflow.cjs +6 -10
  8. package/dist/context/compaction/overflow.d.ts +14 -11
  9. package/dist/context/compaction/overflow.d.ts.map +1 -1
  10. package/dist/context/compaction/overflow.js +6 -10
  11. package/dist/context/compaction/providers/reactive-overflow-provider.cjs +15 -0
  12. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts +15 -0
  13. package/dist/context/compaction/providers/reactive-overflow-provider.d.ts.map +1 -1
  14. package/dist/context/compaction/providers/reactive-overflow-provider.js +15 -0
  15. package/dist/context/compaction/schemas.cjs +22 -2
  16. package/dist/context/compaction/schemas.d.ts +45 -0
  17. package/dist/context/compaction/schemas.d.ts.map +1 -1
  18. package/dist/context/compaction/schemas.js +22 -2
  19. package/dist/context/compaction/strategies/reactive-overflow.cjs +166 -26
  20. package/dist/context/compaction/strategies/reactive-overflow.d.ts +21 -0
  21. package/dist/context/compaction/strategies/reactive-overflow.d.ts.map +1 -1
  22. package/dist/context/compaction/strategies/reactive-overflow.js +166 -26
  23. package/dist/context/manager.cjs +278 -31
  24. package/dist/context/manager.d.ts +192 -5
  25. package/dist/context/manager.d.ts.map +1 -1
  26. package/dist/context/manager.js +285 -32
  27. package/dist/context/types.d.ts +6 -0
  28. package/dist/context/types.d.ts.map +1 -1
  29. package/dist/context/utils.cjs +77 -11
  30. package/dist/context/utils.d.ts +86 -8
  31. package/dist/context/utils.d.ts.map +1 -1
  32. package/dist/context/utils.js +71 -11
  33. package/dist/events/index.cjs +4 -0
  34. package/dist/events/index.d.ts +41 -7
  35. package/dist/events/index.d.ts.map +1 -1
  36. package/dist/events/index.js +4 -0
  37. package/dist/llm/executor/stream-processor.cjs +19 -1
  38. package/dist/llm/executor/stream-processor.d.ts +3 -0
  39. package/dist/llm/executor/stream-processor.d.ts.map +1 -1
  40. package/dist/llm/executor/stream-processor.js +19 -1
  41. package/dist/llm/executor/turn-executor.cjs +219 -30
  42. package/dist/llm/executor/turn-executor.d.ts +62 -10
  43. package/dist/llm/executor/turn-executor.d.ts.map +1 -1
  44. package/dist/llm/executor/turn-executor.js +219 -30
  45. package/dist/llm/executor/types.d.ts +28 -0
  46. package/dist/llm/executor/types.d.ts.map +1 -1
  47. package/dist/llm/formatters/vercel.cjs +36 -28
  48. package/dist/llm/formatters/vercel.d.ts.map +1 -1
  49. package/dist/llm/formatters/vercel.js +36 -28
  50. package/dist/llm/services/factory.cjs +3 -2
  51. package/dist/llm/services/factory.d.ts +3 -1
  52. package/dist/llm/services/factory.d.ts.map +1 -1
  53. package/dist/llm/services/factory.js +3 -2
  54. package/dist/llm/services/vercel.cjs +34 -6
  55. package/dist/llm/services/vercel.d.ts +23 -3
  56. package/dist/llm/services/vercel.d.ts.map +1 -1
  57. package/dist/llm/services/vercel.js +34 -6
  58. package/dist/session/chat-session.cjs +20 -11
  59. package/dist/session/chat-session.d.ts +9 -4
  60. package/dist/session/chat-session.d.ts.map +1 -1
  61. package/dist/session/chat-session.js +20 -11
  62. package/dist/session/compaction-service.cjs +139 -0
  63. package/dist/session/compaction-service.d.ts +81 -0
  64. package/dist/session/compaction-service.d.ts.map +1 -0
  65. package/dist/session/compaction-service.js +106 -0
  66. package/dist/session/session-manager.cjs +146 -0
  67. package/dist/session/session-manager.d.ts +50 -0
  68. package/dist/session/session-manager.d.ts.map +1 -1
  69. package/dist/session/session-manager.js +146 -0
  70. package/dist/session/title-generator.cjs +2 -2
  71. package/dist/session/title-generator.js +2 -2
  72. package/dist/systemPrompt/in-built-prompts.cjs +36 -0
  73. package/dist/systemPrompt/in-built-prompts.d.ts +18 -1
  74. package/dist/systemPrompt/in-built-prompts.d.ts.map +1 -1
  75. package/dist/systemPrompt/in-built-prompts.js +25 -0
  76. package/dist/systemPrompt/manager.cjs +22 -0
  77. package/dist/systemPrompt/manager.d.ts +10 -0
  78. package/dist/systemPrompt/manager.d.ts.map +1 -1
  79. package/dist/systemPrompt/manager.js +22 -0
  80. package/dist/systemPrompt/registry.cjs +2 -1
  81. package/dist/systemPrompt/registry.d.ts +1 -1
  82. package/dist/systemPrompt/registry.d.ts.map +1 -1
  83. package/dist/systemPrompt/registry.js +2 -1
  84. package/dist/systemPrompt/schemas.cjs +7 -0
  85. package/dist/systemPrompt/schemas.d.ts +13 -13
  86. package/dist/systemPrompt/schemas.d.ts.map +1 -1
  87. package/dist/systemPrompt/schemas.js +7 -0
  88. package/dist/utils/index.cjs +3 -1
  89. package/dist/utils/index.d.ts +1 -0
  90. package/dist/utils/index.d.ts.map +1 -1
  91. package/dist/utils/index.js +1 -0
  92. package/package.json +1 -1
@@ -585,6 +585,30 @@ Either:
585
585
  signal: cleanupSignal
586
586
  });
587
587
  listeners.push({ event: "tool:running", listener: toolRunningListener });
588
+ const contextCompactingListener = (data) => {
589
+ if (data.sessionId !== sessionId) return;
590
+ eventQueue.push({ name: "context:compacting", ...data });
591
+ };
592
+ this.agentEventBus.on("context:compacting", contextCompactingListener, {
593
+ signal: cleanupSignal
594
+ });
595
+ listeners.push({ event: "context:compacting", listener: contextCompactingListener });
596
+ const contextCompactedListener = (data) => {
597
+ if (data.sessionId !== sessionId) return;
598
+ eventQueue.push({ name: "context:compacted", ...data });
599
+ };
600
+ this.agentEventBus.on("context:compacted", contextCompactedListener, {
601
+ signal: cleanupSignal
602
+ });
603
+ listeners.push({ event: "context:compacted", listener: contextCompactedListener });
604
+ const sessionContinuedListener = (data) => {
605
+ if (data.previousSessionId !== sessionId) return;
606
+ eventQueue.push({ name: "session:continued", ...data });
607
+ };
608
+ this.agentEventBus.on("session:continued", sessionContinuedListener, {
609
+ signal: cleanupSignal
610
+ });
611
+ listeners.push({ event: "session:continued", listener: sessionContinuedListener });
588
612
  const messageQueuedListener = (data) => {
589
613
  if (data.sessionId !== sessionId) return;
590
614
  eventQueue.push({ name: "message:queued", ...data });
@@ -744,12 +768,18 @@ Either:
744
768
  contentParts = [{ type: "text", text: textContent }];
745
769
  }
746
770
  const session = await this.sessionManager.getSession(sessionId) || await this.sessionManager.createSession(sessionId);
747
- await session.stream(contentParts, signal ? { signal } : void 0);
771
+ const streamResult = await session.stream(
772
+ contentParts,
773
+ signal ? { signal } : void 0
774
+ );
748
775
  this.sessionManager.incrementMessageCount(session.id).catch(
749
776
  (error) => this.logger.warn(
750
777
  `Failed to increment message count: ${error instanceof Error ? error.message : String(error)}`
751
778
  )
752
779
  );
780
+ if (streamResult.didCompact && streamResult.compaction) {
781
+ await this.handleSessionContinuation(session, streamResult.compaction);
782
+ }
753
783
  } catch (err) {
754
784
  const error = err instanceof DextoRuntimeError || err instanceof DextoValidationError ? err : err instanceof Error ? err : AgentError.streamFailed(String(err));
755
785
  completed = true;
@@ -1123,6 +1153,173 @@ Either:
1123
1153
  sessionId
1124
1154
  });
1125
1155
  }
1156
+ /**
1157
+ * Manually compact the context using session-native compaction.
1158
+ *
1159
+ * Session-native compaction creates a NEW session with the summary as initial context,
1160
+ * providing clean session isolation while maintaining traceability via linking.
1161
+ *
1162
+ * The old session is marked as compacted with `continuedTo` pointing to the new session,
1163
+ * and the new session has `continuedFrom` pointing back to the old session.
1164
+ *
1165
+ * @param sessionId Session ID of the session to compact (required)
1166
+ * @returns Compaction result with new session info, or null if compaction was skipped
1167
+ */
1168
+ async compactContext(sessionId) {
1169
+ this.ensureStarted();
1170
+ if (!sessionId || typeof sessionId !== "string") {
1171
+ throw AgentError.apiValidationError(
1172
+ "sessionId is required and must be a non-empty string"
1173
+ );
1174
+ }
1175
+ const session = await this.sessionManager.getSession(sessionId);
1176
+ if (!session) {
1177
+ throw SessionError.notFound(sessionId);
1178
+ }
1179
+ const llmService = session.getLLMService();
1180
+ const compactionStrategy = llmService.getCompactionStrategy();
1181
+ if (!compactionStrategy) {
1182
+ this.logger.warn(
1183
+ `Compaction strategy not configured for session ${sessionId} - skipping manual compaction`
1184
+ );
1185
+ return null;
1186
+ }
1187
+ const { SessionCompactionService } = await import("../session/compaction-service.js");
1188
+ const compactionService = new SessionCompactionService(
1189
+ this.sessionManager,
1190
+ compactionStrategy,
1191
+ this.logger
1192
+ );
1193
+ const compactionResult = await compactionService.compact(session, {
1194
+ reason: "manual",
1195
+ eventBus: this.agentEventBus
1196
+ });
1197
+ if (!compactionResult) {
1198
+ this.logger.debug(`Compaction skipped for session ${sessionId} - nothing to compact`);
1199
+ return null;
1200
+ }
1201
+ this.logger.info(
1202
+ `Session-native compaction complete: ${sessionId} \u2192 ${compactionResult.newSessionId}, ${compactionResult.originalMessages} messages \u2192 ~${compactionResult.summaryTokens} token summary`
1203
+ );
1204
+ return {
1205
+ previousSessionId: compactionResult.previousSessionId,
1206
+ newSessionId: compactionResult.newSessionId,
1207
+ summaryTokens: compactionResult.summaryTokens,
1208
+ originalMessages: compactionResult.originalMessages
1209
+ };
1210
+ }
1211
+ /**
1212
+ * Get the chain of linked sessions (ancestors and descendants) for a session.
1213
+ * Useful for displaying session history and understanding compaction lineage.
1214
+ *
1215
+ * @param sessionId Any session ID in the chain
1216
+ * @returns Array of session data in the chain, ordered chronologically (oldest first)
1217
+ */
1218
+ async getSessionLineage(sessionId) {
1219
+ this.ensureStarted();
1220
+ if (!sessionId || typeof sessionId !== "string") {
1221
+ throw AgentError.apiValidationError(
1222
+ "sessionId is required and must be a non-empty string"
1223
+ );
1224
+ }
1225
+ const chain = await this.sessionManager.getSessionChain(sessionId);
1226
+ if (chain.length === 0) {
1227
+ throw SessionError.notFound(sessionId);
1228
+ }
1229
+ const currentIndex = chain.findIndex((s) => s.id === sessionId);
1230
+ if (currentIndex < 0) {
1231
+ throw SessionError.notFound(sessionId);
1232
+ }
1233
+ return {
1234
+ chain: chain.map((s) => {
1235
+ const item = {
1236
+ id: s.id,
1237
+ createdAt: s.createdAt
1238
+ };
1239
+ if (s.continuedFrom !== void 0) {
1240
+ item.continuedFrom = s.continuedFrom;
1241
+ }
1242
+ if (s.continuedTo !== void 0) {
1243
+ item.continuedTo = s.continuedTo;
1244
+ }
1245
+ if (s.compactedAt !== void 0) {
1246
+ item.compactedAt = s.compactedAt;
1247
+ }
1248
+ return item;
1249
+ }),
1250
+ currentIndex
1251
+ };
1252
+ }
1253
+ /**
1254
+ * Get context usage statistics for a session.
1255
+ * Useful for monitoring context window usage and compaction status.
1256
+ *
1257
+ * @param sessionId Session ID (required)
1258
+ * @returns Context statistics including token estimates and message counts
1259
+ */
1260
+ async getContextStats(sessionId) {
1261
+ this.ensureStarted();
1262
+ if (!sessionId || typeof sessionId !== "string") {
1263
+ throw AgentError.apiValidationError(
1264
+ "sessionId is required and must be a non-empty string"
1265
+ );
1266
+ }
1267
+ const session = await this.sessionManager.getSession(sessionId);
1268
+ if (!session) {
1269
+ throw SessionError.notFound(sessionId);
1270
+ }
1271
+ const contextManager = session.getContextManager();
1272
+ const contributorContext = { mcpManager: this.mcpManager };
1273
+ const llmService = session.getLLMService();
1274
+ const tools = await llmService.getAllTools();
1275
+ const tokenEstimate = await contextManager.getContextTokenEstimate(
1276
+ contributorContext,
1277
+ tools
1278
+ );
1279
+ const history = await contextManager.getHistory();
1280
+ const runtimeConfig = this.stateManager.getRuntimeConfig(sessionId);
1281
+ const compactionConfig = runtimeConfig.compaction;
1282
+ const modelContextWindow = contextManager.getMaxInputTokens();
1283
+ let maxContextTokens = modelContextWindow;
1284
+ if (compactionConfig?.maxContextTokens !== void 0) {
1285
+ maxContextTokens = Math.min(maxContextTokens, compactionConfig.maxContextTokens);
1286
+ }
1287
+ const thresholdPercent = compactionConfig?.thresholdPercent ?? 0.9;
1288
+ if (thresholdPercent < 1) {
1289
+ maxContextTokens = Math.floor(maxContextTokens * thresholdPercent);
1290
+ }
1291
+ const hasSummary = history.some(
1292
+ (msg) => msg.metadata?.isSummary === true || msg.metadata?.isSessionSummary === true
1293
+ );
1294
+ const llmConfig = runtimeConfig.llm;
1295
+ const { getModelDisplayName } = await import("../llm/registry.js");
1296
+ const modelDisplayName = getModelDisplayName(llmConfig.model, llmConfig.provider);
1297
+ const estimatedTokens = tokenEstimate.estimated;
1298
+ const compactionCount = await this.sessionManager.getCompactionCount(sessionId);
1299
+ return {
1300
+ estimatedTokens,
1301
+ actualTokens: tokenEstimate.actual,
1302
+ maxContextTokens,
1303
+ modelContextWindow,
1304
+ thresholdPercent,
1305
+ usagePercent: maxContextTokens > 0 ? Math.round(estimatedTokens / maxContextTokens * 100) : 0,
1306
+ messageCount: tokenEstimate.stats.originalMessageCount,
1307
+ filteredMessageCount: tokenEstimate.stats.filteredMessageCount,
1308
+ prunedToolCount: tokenEstimate.stats.prunedToolCount,
1309
+ hasSummary,
1310
+ compactionCount,
1311
+ model: llmConfig.model,
1312
+ modelDisplayName,
1313
+ breakdown: {
1314
+ systemPrompt: tokenEstimate.breakdown.systemPrompt,
1315
+ tools: tokenEstimate.breakdown.tools,
1316
+ messages: tokenEstimate.breakdown.messages
1317
+ },
1318
+ ...tokenEstimate.calculationBasis && {
1319
+ calculationBasis: tokenEstimate.calculationBasis
1320
+ }
1321
+ };
1322
+ }
1126
1323
  // ============= LLM MANAGEMENT =============
1127
1324
  /**
1128
1325
  * Gets the current LLM configuration with all defaults applied.
@@ -1198,6 +1395,83 @@ Either:
1198
1395
  }
1199
1396
  return validatedConfig;
1200
1397
  }
1398
+ /**
1399
+ * Handles session-native continuation after compaction.
1400
+ *
1401
+ * When context compaction occurs, this method:
1402
+ * 1. Receives compaction data directly (summary text + preserved messages)
1403
+ * 2. Creates a new continuation session
1404
+ * 3. Adds the summary as the first message in the new session
1405
+ * 4. Adds preserved messages to the new session
1406
+ * 5. Links the old and new sessions for traceability
1407
+ * 6. Emits session:continued event for UI to handle session switch
1408
+ *
1409
+ * IMPORTANT: The original session is NOT modified. The summary was never added to it.
1410
+ * This is the clean session-native compaction approach where:
1411
+ * - Original session: UNCHANGED (full history preserved)
1412
+ * - New session: [summary, ...preservedMessages]
1413
+ *
1414
+ * @param currentSession The session that triggered compaction
1415
+ * @param compactionData The compaction data with summary text and preserved messages
1416
+ */
1417
+ async handleSessionContinuation(currentSession, compactionData) {
1418
+ const currentSessionId = currentSession.id;
1419
+ try {
1420
+ const { summaryText, preservedMessages, summarizedCount } = compactionData;
1421
+ if (!summaryText) {
1422
+ this.logger.warn(
1423
+ `Session continuation skipped: empty summary text for session ${currentSessionId}`
1424
+ );
1425
+ return;
1426
+ }
1427
+ const { sessionId: newSessionId, session: newSession } = await this.sessionManager.createContinuationSession(currentSessionId);
1428
+ const sessionSummaryMessage = {
1429
+ role: "assistant",
1430
+ content: [{ type: "text", text: summaryText }],
1431
+ timestamp: Date.now(),
1432
+ metadata: {
1433
+ isSessionSummary: true,
1434
+ continuedFrom: currentSessionId,
1435
+ summarizedAt: Date.now(),
1436
+ originalMessageCount: summarizedCount,
1437
+ originalFirstTimestamp: compactionData.originalFirstTimestamp,
1438
+ originalLastTimestamp: compactionData.originalLastTimestamp
1439
+ }
1440
+ };
1441
+ const newContextManager = newSession.getContextManager();
1442
+ await newContextManager.addMessage(sessionSummaryMessage);
1443
+ for (const msg of preservedMessages) {
1444
+ await newContextManager.addMessage(msg);
1445
+ }
1446
+ await this.sessionManager.markSessionCompacted(currentSessionId, newSessionId);
1447
+ const { estimateMessagesTokens } = await import("../context/utils.js");
1448
+ const summaryTokens = estimateMessagesTokens([sessionSummaryMessage]);
1449
+ const totalOriginalMessages = summarizedCount + preservedMessages.length;
1450
+ const newSessionLLMConfig = this.stateManager.getRuntimeConfig(newSessionId).llm;
1451
+ const { getModelDisplayName } = await import("../llm/registry.js");
1452
+ const modelDisplayName = getModelDisplayName(
1453
+ newSessionLLMConfig.model,
1454
+ newSessionLLMConfig.provider
1455
+ );
1456
+ this.logger.info(
1457
+ `Session continuation: ${currentSessionId} \u2192 ${newSessionId} (${totalOriginalMessages} messages \u2192 summary + ${preservedMessages.length} preserved)`
1458
+ );
1459
+ this.agentEventBus.emit("session:continued", {
1460
+ previousSessionId: currentSessionId,
1461
+ newSessionId,
1462
+ summaryTokens,
1463
+ originalMessages: totalOriginalMessages,
1464
+ reason: "overflow",
1465
+ sessionId: newSessionId,
1466
+ model: newSessionLLMConfig.model,
1467
+ modelDisplayName
1468
+ });
1469
+ } catch (error) {
1470
+ this.logger.error(
1471
+ `Failed to handle session continuation for ${currentSessionId}: ${error instanceof Error ? error.message : String(error)}`
1472
+ );
1473
+ }
1474
+ }
1201
1475
  /**
1202
1476
  * Performs the actual LLM switch with a validated configuration.
1203
1477
  * This is a helper method that handles state management and session switching.
@@ -1138,18 +1138,18 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
1138
1138
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1139
1139
  } & {
1140
1140
  type: z.ZodLiteral<"dynamic">;
1141
- source: z.ZodEnum<["date", "resources"]>;
1141
+ source: z.ZodEnum<["date", "env", "resources"]>;
1142
1142
  }, "strict", z.ZodTypeAny, {
1143
1143
  type: "dynamic";
1144
1144
  enabled: boolean;
1145
1145
  id: string;
1146
1146
  priority: number;
1147
- source: "date" | "resources";
1147
+ source: "date" | "env" | "resources";
1148
1148
  }, {
1149
1149
  type: "dynamic";
1150
1150
  id: string;
1151
1151
  priority: number;
1152
- source: "date" | "resources";
1152
+ source: "date" | "env" | "resources";
1153
1153
  enabled?: boolean | undefined;
1154
1154
  }>, z.ZodObject<{
1155
1155
  id: z.ZodString;
@@ -1216,7 +1216,7 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
1216
1216
  enabled: boolean;
1217
1217
  id: string;
1218
1218
  priority: number;
1219
- source: "date" | "resources";
1219
+ source: "date" | "env" | "resources";
1220
1220
  } | {
1221
1221
  type: "file";
1222
1222
  options: {
@@ -1242,7 +1242,7 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
1242
1242
  type: "dynamic";
1243
1243
  id: string;
1244
1244
  priority: number;
1245
- source: "date" | "resources";
1245
+ source: "date" | "env" | "resources";
1246
1246
  enabled?: boolean | undefined;
1247
1247
  } | {
1248
1248
  type: "file";
@@ -3183,12 +3183,18 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
3183
3183
  compaction: z.ZodDefault<z.ZodObject<{
3184
3184
  type: z.ZodString;
3185
3185
  enabled: z.ZodDefault<z.ZodBoolean>;
3186
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
3187
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
3186
3188
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
3187
3189
  type: z.ZodString;
3188
3190
  enabled: z.ZodDefault<z.ZodBoolean>;
3191
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
3192
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
3189
3193
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
3190
3194
  type: z.ZodString;
3191
3195
  enabled: z.ZodDefault<z.ZodBoolean>;
3196
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
3197
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
3192
3198
  }, z.ZodTypeAny, "passthrough">>>;
3193
3199
  }, "strict", z.ZodTypeAny, {
3194
3200
  llm: {
@@ -3312,7 +3318,7 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
3312
3318
  enabled: boolean;
3313
3319
  id: string;
3314
3320
  priority: number;
3315
- source: "date" | "resources";
3321
+ source: "date" | "env" | "resources";
3316
3322
  } | {
3317
3323
  type: "file";
3318
3324
  options: {
@@ -3417,6 +3423,8 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
3417
3423
  compaction: {
3418
3424
  type: string;
3419
3425
  enabled: boolean;
3426
+ thresholdPercent: number;
3427
+ maxContextTokens?: number | undefined;
3420
3428
  } & {
3421
3429
  [k: string]: unknown;
3422
3430
  };
@@ -3629,7 +3637,7 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
3629
3637
  type: "dynamic";
3630
3638
  id: string;
3631
3639
  priority: number;
3632
- source: "date" | "resources";
3640
+ source: "date" | "env" | "resources";
3633
3641
  enabled?: boolean | undefined;
3634
3642
  } | {
3635
3643
  type: "file";
@@ -4018,6 +4026,8 @@ export declare function createAgentConfigSchema(options?: LLMValidationOptions):
4018
4026
  compaction?: z.objectInputType<{
4019
4027
  type: z.ZodString;
4020
4028
  enabled: z.ZodDefault<z.ZodBoolean>;
4029
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
4030
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
4021
4031
  }, z.ZodTypeAny, "passthrough"> | undefined;
4022
4032
  }>, "ValidatedAgentConfig">;
4023
4033
  /**
@@ -4059,18 +4069,18 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
4059
4069
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
4060
4070
  } & {
4061
4071
  type: z.ZodLiteral<"dynamic">;
4062
- source: z.ZodEnum<["date", "resources"]>;
4072
+ source: z.ZodEnum<["date", "env", "resources"]>;
4063
4073
  }, "strict", z.ZodTypeAny, {
4064
4074
  type: "dynamic";
4065
4075
  enabled: boolean;
4066
4076
  id: string;
4067
4077
  priority: number;
4068
- source: "date" | "resources";
4078
+ source: "date" | "env" | "resources";
4069
4079
  }, {
4070
4080
  type: "dynamic";
4071
4081
  id: string;
4072
4082
  priority: number;
4073
- source: "date" | "resources";
4083
+ source: "date" | "env" | "resources";
4074
4084
  enabled?: boolean | undefined;
4075
4085
  }>, z.ZodObject<{
4076
4086
  id: z.ZodString;
@@ -4137,7 +4147,7 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
4137
4147
  enabled: boolean;
4138
4148
  id: string;
4139
4149
  priority: number;
4140
- source: "date" | "resources";
4150
+ source: "date" | "env" | "resources";
4141
4151
  } | {
4142
4152
  type: "file";
4143
4153
  options: {
@@ -4163,7 +4173,7 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
4163
4173
  type: "dynamic";
4164
4174
  id: string;
4165
4175
  priority: number;
4166
- source: "date" | "resources";
4176
+ source: "date" | "env" | "resources";
4167
4177
  enabled?: boolean | undefined;
4168
4178
  } | {
4169
4179
  type: "file";
@@ -6104,12 +6114,18 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
6104
6114
  compaction: z.ZodDefault<z.ZodObject<{
6105
6115
  type: z.ZodString;
6106
6116
  enabled: z.ZodDefault<z.ZodBoolean>;
6117
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
6118
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
6107
6119
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6108
6120
  type: z.ZodString;
6109
6121
  enabled: z.ZodDefault<z.ZodBoolean>;
6122
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
6123
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
6110
6124
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6111
6125
  type: z.ZodString;
6112
6126
  enabled: z.ZodDefault<z.ZodBoolean>;
6127
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
6128
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
6113
6129
  }, z.ZodTypeAny, "passthrough">>>;
6114
6130
  }, "strict", z.ZodTypeAny, {
6115
6131
  llm: {
@@ -6233,7 +6249,7 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
6233
6249
  enabled: boolean;
6234
6250
  id: string;
6235
6251
  priority: number;
6236
- source: "date" | "resources";
6252
+ source: "date" | "env" | "resources";
6237
6253
  } | {
6238
6254
  type: "file";
6239
6255
  options: {
@@ -6338,6 +6354,8 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
6338
6354
  compaction: {
6339
6355
  type: string;
6340
6356
  enabled: boolean;
6357
+ thresholdPercent: number;
6358
+ maxContextTokens?: number | undefined;
6341
6359
  } & {
6342
6360
  [k: string]: unknown;
6343
6361
  };
@@ -6550,7 +6568,7 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
6550
6568
  type: "dynamic";
6551
6569
  id: string;
6552
6570
  priority: number;
6553
- source: "date" | "resources";
6571
+ source: "date" | "env" | "resources";
6554
6572
  enabled?: boolean | undefined;
6555
6573
  } | {
6556
6574
  type: "file";
@@ -6939,6 +6957,8 @@ export declare const AgentConfigSchema: z.ZodBranded<z.ZodObject<{
6939
6957
  compaction?: z.objectInputType<{
6940
6958
  type: z.ZodString;
6941
6959
  enabled: z.ZodDefault<z.ZodBoolean>;
6960
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
6961
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
6942
6962
  }, z.ZodTypeAny, "passthrough"> | undefined;
6943
6963
  }>, "ValidatedAgentConfig">;
6944
6964
  /**
@@ -6980,18 +7000,18 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
6980
7000
  enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6981
7001
  } & {
6982
7002
  type: z.ZodLiteral<"dynamic">;
6983
- source: z.ZodEnum<["date", "resources"]>;
7003
+ source: z.ZodEnum<["date", "env", "resources"]>;
6984
7004
  }, "strict", z.ZodTypeAny, {
6985
7005
  type: "dynamic";
6986
7006
  enabled: boolean;
6987
7007
  id: string;
6988
7008
  priority: number;
6989
- source: "date" | "resources";
7009
+ source: "date" | "env" | "resources";
6990
7010
  }, {
6991
7011
  type: "dynamic";
6992
7012
  id: string;
6993
7013
  priority: number;
6994
- source: "date" | "resources";
7014
+ source: "date" | "env" | "resources";
6995
7015
  enabled?: boolean | undefined;
6996
7016
  }>, z.ZodObject<{
6997
7017
  id: z.ZodString;
@@ -7058,7 +7078,7 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
7058
7078
  enabled: boolean;
7059
7079
  id: string;
7060
7080
  priority: number;
7061
- source: "date" | "resources";
7081
+ source: "date" | "env" | "resources";
7062
7082
  } | {
7063
7083
  type: "file";
7064
7084
  options: {
@@ -7084,7 +7104,7 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
7084
7104
  type: "dynamic";
7085
7105
  id: string;
7086
7106
  priority: number;
7087
- source: "date" | "resources";
7107
+ source: "date" | "env" | "resources";
7088
7108
  enabled?: boolean | undefined;
7089
7109
  } | {
7090
7110
  type: "file";
@@ -9025,12 +9045,18 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
9025
9045
  compaction: z.ZodDefault<z.ZodObject<{
9026
9046
  type: z.ZodString;
9027
9047
  enabled: z.ZodDefault<z.ZodBoolean>;
9048
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
9049
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
9028
9050
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
9029
9051
  type: z.ZodString;
9030
9052
  enabled: z.ZodDefault<z.ZodBoolean>;
9053
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
9054
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
9031
9055
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
9032
9056
  type: z.ZodString;
9033
9057
  enabled: z.ZodDefault<z.ZodBoolean>;
9058
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
9059
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
9034
9060
  }, z.ZodTypeAny, "passthrough">>>;
9035
9061
  }, "strict", z.ZodTypeAny, {
9036
9062
  llm: {
@@ -9154,7 +9180,7 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
9154
9180
  enabled: boolean;
9155
9181
  id: string;
9156
9182
  priority: number;
9157
- source: "date" | "resources";
9183
+ source: "date" | "env" | "resources";
9158
9184
  } | {
9159
9185
  type: "file";
9160
9186
  options: {
@@ -9259,6 +9285,8 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
9259
9285
  compaction: {
9260
9286
  type: string;
9261
9287
  enabled: boolean;
9288
+ thresholdPercent: number;
9289
+ maxContextTokens?: number | undefined;
9262
9290
  } & {
9263
9291
  [k: string]: unknown;
9264
9292
  };
@@ -9471,7 +9499,7 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
9471
9499
  type: "dynamic";
9472
9500
  id: string;
9473
9501
  priority: number;
9474
- source: "date" | "resources";
9502
+ source: "date" | "env" | "resources";
9475
9503
  enabled?: boolean | undefined;
9476
9504
  } | {
9477
9505
  type: "file";
@@ -9860,6 +9888,8 @@ export declare const AgentConfigSchemaRelaxed: z.ZodBranded<z.ZodObject<{
9860
9888
  compaction?: z.objectInputType<{
9861
9889
  type: z.ZodString;
9862
9890
  enabled: z.ZodDefault<z.ZodBoolean>;
9891
+ maxContextTokens: z.ZodOptional<z.ZodNumber>;
9892
+ thresholdPercent: z.ZodDefault<z.ZodNumber>;
9863
9893
  }, z.ZodTypeAny, "passthrough"> | undefined;
9864
9894
  }>, "ValidatedAgentConfig">;
9865
9895
  export type AgentConfig = z.input<typeof AgentConfigSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/agent/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAyB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAkBxF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuExB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAA6C,CAAC;AAGnF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAGtE,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
@@ -22,19 +22,15 @@ __export(overflow_exports, {
22
22
  isOverflow: () => isOverflow
23
23
  });
24
24
  module.exports = __toCommonJS(overflow_exports);
25
- const DEFAULT_OUTPUT_BUFFER = 16e3;
26
- function isOverflow(tokens, modelLimits) {
27
- const { contextWindow, maxOutput } = modelLimits;
28
- const outputBuffer = Math.min(maxOutput, DEFAULT_OUTPUT_BUFFER);
29
- const usableTokens = contextWindow - outputBuffer;
25
+ function isOverflow(tokens, modelLimits, thresholdPercent = 0.9) {
26
+ const { contextWindow } = modelLimits;
27
+ const effectiveLimit = Math.floor(contextWindow * thresholdPercent);
30
28
  const inputTokens = tokens.inputTokens ?? 0;
31
- return inputTokens > usableTokens;
29
+ return inputTokens > effectiveLimit;
32
30
  }
33
31
  function getCompactionTarget(modelLimits, targetPercentage = 0.7) {
34
- const { contextWindow, maxOutput } = modelLimits;
35
- const outputBuffer = Math.min(maxOutput, DEFAULT_OUTPUT_BUFFER);
36
- const usableTokens = contextWindow - outputBuffer;
37
- return Math.floor(usableTokens * targetPercentage);
32
+ const { contextWindow } = modelLimits;
33
+ return Math.floor(contextWindow * targetPercentage);
38
34
  }
39
35
  // Annotate the CommonJS export names for ESM import in node:
40
36
  0 && (module.exports = {