MCPcopy Create free account
hub / github.com/Noumena-Network/code / getContextEfficiencyAttachment

Function getContextEfficiencyAttachment

src/utils/attachments.ts:3970–3990  ·  view source on GitHub ↗
(
  messages: Message[],
)

Source from the content-addressed store, hash-verified

3968 * compact boundaries.
3969 */
3970export function getContextEfficiencyAttachment(
3971 messages: Message[],
3972): Attachment[] {
3973 if (!feature('HISTORY_SNIP')) {
3974 return []
3975 }
3976 // Gate must match SnipTool.isEnabled() — don't nudge toward a tool that
3977 // isn't in the tool list. Lazy require keeps this file snip-string-free.
3978 const { isSnipRuntimeEnabled, shouldNudgeForSnips } =
3979 // eslint-disable-next-line @typescript-eslint/no-require-imports
3980 require('../services/compact/snipCompact.js') as typeof import('../services/compact/snipCompact.js')
3981 if (!isSnipRuntimeEnabled()) {
3982 return []
3983 }
3984
3985 if (!shouldNudgeForSnips(messages)) {
3986 return []
3987 }
3988
3989 return [{ type: 'context_efficiency' }]
3990}
3991
3992
3993function isFileReadDenied(

Callers 1

getAttachmentsFunction · 0.85

Calls 2

isSnipRuntimeEnabledFunction · 0.85
shouldNudgeForSnipsFunction · 0.85

Tested by

no test coverage detected