MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / readSmallTextFile

Function readSmallTextFile

src/index.js:543–549  ·  view source on GitHub ↗
(filePath, maxBytes = 120_000)

Source from the content-addressed store, hash-verified

541
542function commandName(name) { return String(name || "") }
543function isPreset(name) { return ["loop-dev", "loop-testfix", "loop-compact", "loop-progress", "loop-safe-dev", "loop-command", "loop-cmd", "loop-prompt", "loop-ask", "loop-shell"].includes(name) }
544function isLoopCommandName(name) {
545 return name === "loop" || name === "loop-stop" || name === "loop-remove" || name === "loop-clear" || name === "loop-status" || name === "loop-logs" || name === "loop-help" || name === "loop-now" || name === "loop-pause" || name === "loop-resume" || name === "loop-doctor" || name === "loop-init" || name === "loop-export" || name === "loop-goal" || name === "loop-goal-status" || name === "loop-goal-pause" || name === "loop-goal-resume" || name === "loop-goal-clear" || name === "loop-goal-done" || name === "loop-goal-complete" || name === "loop-goal-blocked" || isPreset(name)
546}
547
548function normalizeArgsForKey(args) {
549 if (args === undefined || args === null) return ""
550 if (typeof args === "string") return args.trim().replace(/\s+/g, " ")
551 if (Array.isArray(args)) return args.map(normalizeArgsForKey).join(" ").trim().replace(/\s+/g, " ")
552 try { return JSON.stringify(args) } catch { return String(args) }

Callers 2

buildGoalPromptFunction · 0.85
buildPromptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected