MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / wrapperSpec

Function wrapperSpec

lib/update.ts:97–109  ·  view source on GitHub ↗
(wrapperDir: string, name: string)

Source from the content-addressed store, hash-verified

95}
96
97function wrapperSpec(wrapperDir: string, name: string) {
98 if (name.startsWith("@")) {
99 const [scope, pkg] = name.split("/")
100 if (!scope || !pkg || basename(dirname(wrapperDir)) !== scope) return undefined
101 const prefix = `${pkg}@`
102 const base = basename(wrapperDir)
103 return base.startsWith(prefix) ? base.slice(prefix.length) : undefined
104 }
105
106 const prefix = `${name}@`
107 const base = basename(wrapperDir)
108 return base.startsWith(prefix) ? base.slice(prefix.length) : undefined
109}
110
111export function isAutoUpdatableSpec(spec: string) {
112 const value = spec.trim()

Callers 1

updateRemoveDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected