Skip to content

Commit 8c48761

Browse files
committed
refactor
1 parent 0e7630d commit 8c48761

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

lib/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const PRUNED_CONTENT_MESSAGE = '[Output removed to save context - information superseded or no longer needed]'

lib/hooks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Logger } from "./logger"
33
import type { PluginConfig } from "./config"
44
import { syncToolCache } from "./state/tool-cache"
55
import { deduplicate } from "./strategies"
6+
import { prune } from "./prune"
67

78

89
export function createChatMessageTransformHandler(

lib/prune.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { SessionState, WithParts } from "./state"
2+
import type { Logger } from "./logger"
3+
import type { PluginConfig } from "./config"
4+
5+
export const prune = (
6+
state: SessionState,
7+
logger: Logger,
8+
config: PluginConfig,
9+
messages: WithParts[]
10+
): void => {
11+
pruneToolOutputs(state, logger, config, messages)
12+
}
13+
14+
const pruneToolOutputs = (
15+
state: SessionState,
16+
logger: Logger,
17+
config: PluginConfig,
18+
messages: WithParts[]
19+
): void => {
20+
21+
}

0 commit comments

Comments
 (0)