Files
OmniRoute/open-sse/services/compression/rules/en/context.json
diegosouzapw 970f6a3ae7 feat(compression): expand caveman parity and MCP metadata compression
Compress MCP registry and list metadata descriptions for tools, prompts,
resources, and resource templates while keeping tool-response bodies
unchanged. Expose those savings in compression status as
`mcp_metadata_estimate` metadata rather than provider usage.

Add Caveman rule-pack support for custom regex flags and match-specific
replacement maps, update English rules for upstream parity, and tighten
article and pleasantry handling. Also process RTK multipart text blocks
independently so mixed media content compresses safely without
duplicating output.
2026-05-03 09:14:20 -03:00

89 lines
2.6 KiB
JSON

{
"language": "en",
"category": "context",
"rules": [
{
"name": "compound_collapse",
"pattern": "\\band any potential\\b",
"replacement": "",
"context": "all",
"category": "context",
"minIntensity": "full"
},
{
"name": "explanatory_prefix",
"pattern": "\\b(?:The function appears to be handling|The code seems to|The class is|This module is)\\b",
"replacement": "Function:",
"replacementMap": {
"the function appears to be handling": "Function:",
"the code seems to": "Code:",
"the class is": "Class:",
"this module is": "Module:"
},
"context": "all",
"category": "context",
"minIntensity": "lite"
},
{
"name": "question_to_directive",
"pattern": "\\b(?:Can you explain why|Could you show me how|Would you tell me|Can you tell me)\\b\\s*",
"replacement": "Explain why ",
"replacementMap": {
"can you explain why": "Explain why ",
"could you show me how": "Show how ",
"would you tell me": "Tell me ",
"can you tell me": "Tell me "
},
"context": "user",
"category": "context",
"minIntensity": "lite"
},
{
"name": "context_setup",
"pattern": "\\b(?:I have the following code|Here is my code|Below is the code)\\b\\s*[:.]?\\s*",
"replacement": "Code:",
"context": "user",
"category": "context",
"minIntensity": "lite"
},
{
"name": "intent_clarification",
"pattern": "\\b(?:What I'm trying to do is|My objective is to|What I need is|I'm aiming to)\\b\\s*",
"replacement": "Goal:",
"context": "user",
"category": "context",
"minIntensity": "lite"
},
{
"name": "background_removal",
"pattern": "\\b(?:As you may know,?\\s*|As we discussed earlier,?\\s*)",
"replacement": "",
"context": "all",
"category": "context",
"minIntensity": "lite"
},
{
"name": "meta_commentary",
"pattern": "^(?:Note that|Keep in mind that|Remember that)\\b\\s*",
"replacement": "",
"context": "all",
"category": "context",
"minIntensity": "lite"
},
{
"name": "purpose_statement",
"pattern": "\\b(?:for the purpose of|with the goal of|in an effort to|for every)\\b",
"replacement": "for",
"replacementMap": {
"for the purpose of": "for",
"with the goal of": "to",
"in an effort to": "to",
"for every": "per"
},
"context": "all",
"category": "context",
"minIntensity": "lite"
}
]
}