MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / add

Method add

src/schedule/store.ts:101–121  ·  view source on GitHub ↗
(input: {
    name: string;
    cron: string;
    prompt: string;
    cwd: string;
    model?: string;
    allowedTools?: string[];
    deliver?: string;
    recipe?: string;
  })

Source from the content-addressed store, hash-verified

99 }
100
101 add(input: {
102 name: string;
103 cron: string;
104 prompt: string;
105 cwd: string;
106 model?: string;
107 allowedTools?: string[];
108 deliver?: string;
109 recipe?: string;
110 }): ScheduleEntry {
111 const parsed = parseCron(input.cron); // throws on invalid
112 const next = nextAfter(parsed, new Date());
113 const id = uuidv4();
114 const allowed = input.allowedTools && input.allowedTools.length > 0 ? JSON.stringify(input.allowedTools) : null;
115 this.db.prepare(`
116 INSERT INTO schedules (id, name, cron, prompt, cwd, model, allowed_tools, next_run_at, deliver, recipe)
117 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
118 `).run(id, input.name, input.cron, input.prompt, input.cwd, input.model ?? null, allowed, next?.toISOString() ?? null,
119 input.deliver ?? null, input.recipe ?? null);
120 return this.get(id)!;
121 }
122
123 remove(idOrName: string): boolean {
124 const e = this.resolve(idOrName);

Callers 15

partition.test.tsFile · 0.80
task-tool.test.tsFile · 0.80
schedule.test.tsFile · 0.80
index.tsFile · 0.80
expandToolPatternsFunction · 0.80
executeMethod · 0.80
pickCheckersFunction · 0.80
parsePageRangeFunction · 0.80
buildFallbackChainFunction · 0.80
collectTypesFunction · 0.80
selectRelevantPassagesFunction · 0.80

Calls 4

getMethod · 0.95
parseCronFunction · 0.85
nextAfterFunction · 0.85
runMethod · 0.65

Tested by

no test coverage detected