hammer-ai 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -5
- package/dist/index.js +0 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -875,8 +875,6 @@ interface MemoryLayerConfig {
|
|
|
875
875
|
protectedContextTokens: number;
|
|
876
876
|
/** Maximum tokens for the rendered compressed state. */
|
|
877
877
|
stateBudgetTokens: number;
|
|
878
|
-
/** Hard cap on raw history entries (safety net). */
|
|
879
|
-
maxRawHistory: number;
|
|
880
878
|
/** Minimum turns between compaction attempts. */
|
|
881
879
|
compactionDebounceTurns: number;
|
|
882
880
|
/** Baseline token overhead for system prompt (conservative estimate). */
|
|
@@ -899,7 +897,7 @@ interface MemoryLayerConfig {
|
|
|
899
897
|
* - State rendering (converting TState to human-readable text)
|
|
900
898
|
*
|
|
901
899
|
* The base class provides:
|
|
902
|
-
* - Append-only raw history
|
|
900
|
+
* - Append-only raw history
|
|
903
901
|
* - Token-budgeted sliding window for recent messages
|
|
904
902
|
* - buildMessages assembly (system → state → recent)
|
|
905
903
|
* - Compaction triggering (debounce, threshold check, prune)
|
|
@@ -1152,8 +1150,6 @@ interface AgentMemoryLayerConfig {
|
|
|
1152
1150
|
protectedContextTokens: number;
|
|
1153
1151
|
/** Token budget for the rendered compressed state block. */
|
|
1154
1152
|
stateBudgetTokens: number;
|
|
1155
|
-
/** Hard cap on raw history entries. */
|
|
1156
|
-
maxRawHistory: number;
|
|
1157
1153
|
/** Minimum turns between compaction attempts. */
|
|
1158
1154
|
compactionDebounceTurns: number;
|
|
1159
1155
|
/** Token estimate for the system prompt. */
|
package/dist/index.js
CHANGED
|
@@ -4154,14 +4154,6 @@ var BaseMemoryLayer = class {
|
|
|
4154
4154
|
const timestamp = Date.now();
|
|
4155
4155
|
const msg = this.createMessage(id, role, content, this.currentTurn, timestamp);
|
|
4156
4156
|
this.rawHistory.push(msg);
|
|
4157
|
-
if (this.rawHistory.length > this.config.maxRawHistory) {
|
|
4158
|
-
const excess = this.rawHistory.length - this.config.maxRawHistory;
|
|
4159
|
-
const lastPrunedTurn = this.rawHistory[excess - 1].turn;
|
|
4160
|
-
this.rawHistory.splice(0, excess);
|
|
4161
|
-
if (this.compactionCursor.lastCompactedTurn < lastPrunedTurn) {
|
|
4162
|
-
this.compactionCursor.lastCompactedTurn = lastPrunedTurn;
|
|
4163
|
-
}
|
|
4164
|
-
}
|
|
4165
4157
|
this.onMessageAppended(msg);
|
|
4166
4158
|
return id;
|
|
4167
4159
|
}
|
|
@@ -5227,7 +5219,6 @@ var AgentMemoryLayer = class extends BaseMemoryLayer {
|
|
|
5227
5219
|
compactionTokenThreshold: config.compactionTokenThreshold,
|
|
5228
5220
|
protectedContextTokens: config.protectedContextTokens,
|
|
5229
5221
|
stateBudgetTokens: config.stateBudgetTokens,
|
|
5230
|
-
maxRawHistory: config.maxRawHistory,
|
|
5231
5222
|
compactionDebounceTurns: config.compactionDebounceTurns,
|
|
5232
5223
|
systemPromptOverhead: config.systemPromptOverhead,
|
|
5233
5224
|
tokenEstimator: config.tokenEstimator,
|
|
@@ -5734,7 +5725,6 @@ var SHARED_WORKSPACE_AGENT_MEMORY_PRESET = {
|
|
|
5734
5725
|
// 60_000
|
|
5735
5726
|
stateBudgetTokens: Math.floor(DEFAULT_MAX_CONTEXT_TOKENS * 0.05),
|
|
5736
5727
|
// 10_000
|
|
5737
|
-
maxRawHistory: 2e3,
|
|
5738
5728
|
compactionDebounceTurns: 3,
|
|
5739
5729
|
systemPromptOverhead: 4e3,
|
|
5740
5730
|
toolMemoryExtractor: DEFAULT_TOOL_MEMORY_EXTRACTOR
|
|
@@ -5744,7 +5734,6 @@ function createAgentMemoryLayer(_preset, overrides) {
|
|
|
5744
5734
|
compactionTokenThreshold: SHARED_WORKSPACE_AGENT_MEMORY_PRESET.compactionTokenThreshold,
|
|
5745
5735
|
protectedContextTokens: SHARED_WORKSPACE_AGENT_MEMORY_PRESET.protectedContextTokens,
|
|
5746
5736
|
stateBudgetTokens: SHARED_WORKSPACE_AGENT_MEMORY_PRESET.stateBudgetTokens,
|
|
5747
|
-
maxRawHistory: SHARED_WORKSPACE_AGENT_MEMORY_PRESET.maxRawHistory,
|
|
5748
5737
|
compactionDebounceTurns: SHARED_WORKSPACE_AGENT_MEMORY_PRESET.compactionDebounceTurns,
|
|
5749
5738
|
systemPromptOverhead: SHARED_WORKSPACE_AGENT_MEMORY_PRESET.systemPromptOverhead,
|
|
5750
5739
|
tokenEstimator: overrides?.tokenEstimator ?? new CharTokenEstimator(),
|