# Bundle patch for dsh-token-frugal. # # This row mounts the Host plugin. Every tunable lives here, in `config`, so the # effective policy is readable in one place and survives plugin upgrades: this # patch is a profile layer, not part of the plugin's code. # # The defaults below were chosen by replaying recorded sessions with # `node tools/measure-tokens.mjs --replay`; see README.md for the measured # before/after numbers on this machine. - insert: - id: token-frugal name: dsh-token-frugal config: enabled: true # Post-execute compression ------------------------------------------- # Character budget applied to any tool without its own entry below. defaultMaxChars: 1500 # Per-tool budgets. `read` keeps the most generous share because file # content is the substrate for later edits; terminal/search output is # mostly formatting, so it gets less. These are the values measured to # clear the 40% target with margin; README.md lists looser and tighter # profiles side by side. toolBudgets: read: 3000 web_fetch: 4000 web_search: 3000 pwsh: 1200 bash: 1200 grep: 1500 glob: 1500 cordis_inspect_query: 2000 cordis_inspect_list: 2000 plugin_manager: 2000 # Failed calls keep twice their budget: an error message is worth more # than a success message of the same size. errorBudgetFactor: 2 # Never touched, whatever their size. skipTools: [] # Blocks smaller than this are passed through byte-for-byte. minBlockChars: 320 # A rewrite must save at least this fraction or it is discarded, so # trivia never churns the request prefix. minGainRatio: 0.02 # Lossless transforms. Set `columns: false` if a workflow depends on # reading alignment-padded tables from tool output. transforms: terminal: true blankSpace: true columns: true repeatedLines: true numericRuns: true json: true columnMinSpaces: 3 repeatedMinRun: 3 numericMinRun: 6 # Head/tail elision -------------------------------------------------- headRatio: 0.45 tailRatio: 0.35 # Keep middle lines that mention errors/warnings rather than blind # slicing. structureAware: true # `spill` stores the full text through ctx.spillStore and names the # locator in the elision marker; if no backend is mounted, elision is # skipped and only the lossless transforms apply. `none` disables # elision outright. recovery: spill # A `read` result is reproducible from its , so it is recovered by # re-reading with offset/limit instead of by a spill artifact. readSourceRecovery: true # Diagnostics -------------------------------------------------------- logStatsEvery: 25 # Tool-catalogue visibility (agent/created) --------------------------- # Tools hidden from every agent through ctx.tools.restrict(). Empty # means the catalogue is left exactly as composed. Names must be real # global tools; unknown names are reported and ignored. Hiding a tool # changes the request envelope, so the first step after the change # records it as a `tool-removal` block and re-uses cache from there on. hiddenTools: [] # Example: a deployment that never delegates in the background can drop # the delegation schemas from every request: # hiddenTools: # - subagent # - subagent_fork # - workflow # Saving modes (the panel under the composer) ------------------------ # `modes` pins a mode from the patch. Anything omitted starts from the # value its v1 key implies, and the panel then owns it at runtime: the # plugin writes the panel's choice to a small state file next to this # profile and never rewrites this file. Mode ids: # terminal columns repeatedLines numericRuns json (all lossless) # elide head/tail trimming, always with a recovery path # catalogue apply hiddenTools # memo record the memory document # recall match the memory document and inject the hits modes: {} # Session memory document (v2) --------------------------------------- # One markdown file per workspace, one `## session` section per # conversation: your messages verbatim plus a turn digest drawn from the # replies. Recording costs no model tokens. The path is relative to the # session's workspace, so the record travels with the work; add it to # .gitignore when the workspace is a repository. memo: enabled: true path: .dsh-token-frugal/memory.md maxEntryChars: 2000 # Recall (v2) -------------------------------------------------------- # A new user message is matched against the document above and the best # blocks are injected as an `agent/inbox/spliced` event, which appends # to the request instead of rewriting it, so the provider's prefix cache # survives. `minMatchedTerms` is what stops one shared word from # spending tokens on an irrelevant extract. recall: enabled: true maxChars: 1200 maxBlocks: 4 minScore: 0.8 minMatchedTerms: 2 # The route the composer panel uses to read and change the modes. bridge: path: /dsh-token-frugal/modes