MCPcopy Create free account
hub / github.com/cortexkit/magic-context / patchDreamerTasksJsonc

Function patchDreamerTasksJsonc

packages/dashboard/src/lib/jsonc.ts:50–56  ·  view source on GitHub ↗
(text: string, tasks: Record<string, unknown>)

Source from the content-addressed store, hash-verified

48 * Throws on malformed input so the caller can refuse the save without clobbering the file.
49 */
50export function patchDreamerTasksJsonc(text: string, tasks: Record<string, unknown>): string {
51 const root = parseRoot(text);
52 const dreamer = isRecord(root.dreamer) ? root.dreamer : {};
53 root.dreamer = dreamer;
54 dreamer.tasks = tasks;
55 return stringifyJsonc(root);
56}
57
58/** Remove the project-level dreamer override while preserving the rest of the config file. */
59export function removeDreamerBlockJsonc(text: string): string {

Callers 3

handleSaveFunction · 0.90
toggleTaskFunction · 0.90
jsonc.test.tsFile · 0.90

Calls 3

parseRootFunction · 0.85
stringifyJsoncFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected