@cjvana/claude-auto 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +10 -0
- package/LICENSE +21 -0
- package/README.md +435 -0
- package/dist/check-repo-6C4QI2M2.js +33 -0
- package/dist/check-repo-6C4QI2M2.js.map +1 -0
- package/dist/check-repo-SXWFIVO5.js +8 -0
- package/dist/check-repo-SXWFIVO5.js.map +1 -0
- package/dist/chunk-24PS2XSV.js +203 -0
- package/dist/chunk-24PS2XSV.js.map +1 -0
- package/dist/chunk-2D5E23XA.js +129 -0
- package/dist/chunk-2D5E23XA.js.map +1 -0
- package/dist/chunk-3NEANSUS.js +26 -0
- package/dist/chunk-3NEANSUS.js.map +1 -0
- package/dist/chunk-4I5UIASZ.js +71 -0
- package/dist/chunk-4I5UIASZ.js.map +1 -0
- package/dist/chunk-5LGOK52J.js +38 -0
- package/dist/chunk-5LGOK52J.js.map +1 -0
- package/dist/chunk-6RYMWH5M.js +35 -0
- package/dist/chunk-6RYMWH5M.js.map +1 -0
- package/dist/chunk-A6XWZPLY.js +56 -0
- package/dist/chunk-A6XWZPLY.js.map +1 -0
- package/dist/chunk-AWLSYOVF.js +61 -0
- package/dist/chunk-AWLSYOVF.js.map +1 -0
- package/dist/chunk-BY5YEOVG.js +75 -0
- package/dist/chunk-BY5YEOVG.js.map +1 -0
- package/dist/chunk-D4MBOIYQ.js +46 -0
- package/dist/chunk-D4MBOIYQ.js.map +1 -0
- package/dist/chunk-DVZC42TL.js +33 -0
- package/dist/chunk-DVZC42TL.js.map +1 -0
- package/dist/chunk-E3XVLTT4.js +13 -0
- package/dist/chunk-E3XVLTT4.js.map +1 -0
- package/dist/chunk-GLW7T4QE.js +116 -0
- package/dist/chunk-GLW7T4QE.js.map +1 -0
- package/dist/chunk-H2MUDYMW.js +23 -0
- package/dist/chunk-H2MUDYMW.js.map +1 -0
- package/dist/chunk-HF7PGQI3.js +69 -0
- package/dist/chunk-HF7PGQI3.js.map +1 -0
- package/dist/chunk-LBH6SLHH.js +543 -0
- package/dist/chunk-LBH6SLHH.js.map +1 -0
- package/dist/chunk-M53MPY3U.js +115 -0
- package/dist/chunk-M53MPY3U.js.map +1 -0
- package/dist/chunk-MI7OZ5XD.js +146 -0
- package/dist/chunk-MI7OZ5XD.js.map +1 -0
- package/dist/chunk-NB46PEG2.js +177 -0
- package/dist/chunk-NB46PEG2.js.map +1 -0
- package/dist/chunk-ORBF5IW3.js +60 -0
- package/dist/chunk-ORBF5IW3.js.map +1 -0
- package/dist/chunk-PFU5YLRH.js +131 -0
- package/dist/chunk-PFU5YLRH.js.map +1 -0
- package/dist/chunk-QLRCFKLU.js +34 -0
- package/dist/chunk-QLRCFKLU.js.map +1 -0
- package/dist/chunk-QQTIJN3S.js +167 -0
- package/dist/chunk-QQTIJN3S.js.map +1 -0
- package/dist/chunk-QRYCNVLT.js +72 -0
- package/dist/chunk-QRYCNVLT.js.map +1 -0
- package/dist/chunk-S6E67XMR.js +52 -0
- package/dist/chunk-S6E67XMR.js.map +1 -0
- package/dist/chunk-S6W4SURF.js +33 -0
- package/dist/chunk-S6W4SURF.js.map +1 -0
- package/dist/chunk-SMZYA6CY.js +121 -0
- package/dist/chunk-SMZYA6CY.js.map +1 -0
- package/dist/chunk-SNOA575X.js +12 -0
- package/dist/chunk-SNOA575X.js.map +1 -0
- package/dist/chunk-SZRIZBWI.js +44 -0
- package/dist/chunk-SZRIZBWI.js.map +1 -0
- package/dist/chunk-TAGHPCFT.js +47 -0
- package/dist/chunk-TAGHPCFT.js.map +1 -0
- package/dist/chunk-TGKCHHXT.js +34 -0
- package/dist/chunk-TGKCHHXT.js.map +1 -0
- package/dist/chunk-TORYFKPK.js +39 -0
- package/dist/chunk-TORYFKPK.js.map +1 -0
- package/dist/chunk-U35GRLBD.js +143 -0
- package/dist/chunk-U35GRLBD.js.map +1 -0
- package/dist/chunk-W2HBRERV.js +57 -0
- package/dist/chunk-W2HBRERV.js.map +1 -0
- package/dist/chunk-WYU476R2.js +119 -0
- package/dist/chunk-WYU476R2.js.map +1 -0
- package/dist/chunk-YMO45Z6G.js +69 -0
- package/dist/chunk-YMO45Z6G.js.map +1 -0
- package/dist/claude-auto-run.js +1717 -0
- package/dist/claude-auto-run.js.map +1 -0
- package/dist/claude-auto.js +186 -0
- package/dist/claude-auto.js.map +1 -0
- package/dist/cost-QGM3D4QW.js +72 -0
- package/dist/cost-QGM3D4QW.js.map +1 -0
- package/dist/cost-QKN3U7AG.js +11 -0
- package/dist/cost-QKN3U7AG.js.map +1 -0
- package/dist/create-T3BDDS6G.js +14 -0
- package/dist/create-T3BDDS6G.js.map +1 -0
- package/dist/create-U5WYKTD4.js +118 -0
- package/dist/create-U5WYKTD4.js.map +1 -0
- package/dist/crontab-CDMC2FDT.js +118 -0
- package/dist/crontab-CDMC2FDT.js.map +1 -0
- package/dist/crontab-MAJ52FOK.js +118 -0
- package/dist/crontab-MAJ52FOK.js.map +1 -0
- package/dist/crontab-PNEWANLW.js +12 -0
- package/dist/crontab-PNEWANLW.js.map +1 -0
- package/dist/edit-77E3ZQHM.js +134 -0
- package/dist/edit-77E3ZQHM.js.map +1 -0
- package/dist/edit-RVPRAAQ2.js +13 -0
- package/dist/edit-RVPRAAQ2.js.map +1 -0
- package/dist/index.d.ts +1137 -0
- package/dist/index.js +2049 -0
- package/dist/index.js.map +1 -0
- package/dist/launchd-7F27BIZB.js +166 -0
- package/dist/launchd-7F27BIZB.js.map +1 -0
- package/dist/launchd-HNZIWLNC.js +166 -0
- package/dist/launchd-HNZIWLNC.js.map +1 -0
- package/dist/launchd-LZGDP7BM.js +12 -0
- package/dist/launchd-LZGDP7BM.js.map +1 -0
- package/dist/list-OIGERGYJ.js +15 -0
- package/dist/list-OIGERGYJ.js.map +1 -0
- package/dist/list-T35RSQVU.js +73 -0
- package/dist/list-T35RSQVU.js.map +1 -0
- package/dist/logs-D5FNSCXE.js +12 -0
- package/dist/logs-D5FNSCXE.js.map +1 -0
- package/dist/logs-YVSFXBSB.js +40 -0
- package/dist/logs-YVSFXBSB.js.map +1 -0
- package/dist/pause-2YOLFMAR.js +12 -0
- package/dist/pause-2YOLFMAR.js.map +1 -0
- package/dist/pause-JB42JGTB.js +45 -0
- package/dist/pause-JB42JGTB.js.map +1 -0
- package/dist/pause-OJNUYBCJ.js +47 -0
- package/dist/pause-OJNUYBCJ.js.map +1 -0
- package/dist/remove-RXYKFYBI.js +12 -0
- package/dist/remove-RXYKFYBI.js.map +1 -0
- package/dist/remove-UASXZCOR.js +59 -0
- package/dist/remove-UASXZCOR.js.map +1 -0
- package/dist/report-CHAJH2SA.js +150 -0
- package/dist/report-CHAJH2SA.js.map +1 -0
- package/dist/report-IYGK5HTC.js +14 -0
- package/dist/report-IYGK5HTC.js.map +1 -0
- package/dist/resume-3ATNZP6D.js +13 -0
- package/dist/resume-3ATNZP6D.js.map +1 -0
- package/dist/resume-6WVGU6XW.js +48 -0
- package/dist/resume-6WVGU6XW.js.map +1 -0
- package/dist/resume-JVTR7OEX.js +50 -0
- package/dist/resume-JVTR7OEX.js.map +1 -0
- package/dist/schtasks-2EQAD3ES.js +11 -0
- package/dist/schtasks-2EQAD3ES.js.map +1 -0
- package/dist/schtasks-4V2IFD3A.js +142 -0
- package/dist/schtasks-4V2IFD3A.js.map +1 -0
- package/dist/schtasks-JGEPEKQS.js +142 -0
- package/dist/schtasks-JGEPEKQS.js.map +1 -0
- package/dist/tui-2DUPCX3Q.js +15 -0
- package/dist/tui-2DUPCX3Q.js.map +1 -0
- package/dist/tui-6LOGPILA.js +547 -0
- package/dist/tui-6LOGPILA.js.map +1 -0
- package/package.json +81 -0
- package/scripts/postinstall.mjs +65 -0
- package/scripts/preuninstall.mjs +33 -0
- package/skills/edit/SKILL.md +25 -0
- package/skills/list/SKILL.md +26 -0
- package/skills/logs/SKILL.md +33 -0
- package/skills/pause/SKILL.md +21 -0
- package/skills/remove/SKILL.md +22 -0
- package/skills/resume/SKILL.md +21 -0
- package/skills/setup/SKILL.md +195 -0
- package/skills/status/SKILL.md +27 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
execCommand
|
|
3
|
+
} from "./chunk-3NEANSUS.js";
|
|
4
|
+
import {
|
|
5
|
+
paths
|
|
6
|
+
} from "./chunk-H2MUDYMW.js";
|
|
7
|
+
import {
|
|
8
|
+
SchedulerError
|
|
9
|
+
} from "./chunk-YMO45Z6G.js";
|
|
10
|
+
|
|
11
|
+
// src/platform/crontab.ts
|
|
12
|
+
import { dirname, join } from "path";
|
|
13
|
+
import { fileURLToPath } from "url";
|
|
14
|
+
var MARKER_PREFIX = "# claude-auto:";
|
|
15
|
+
function buildEntryBlock(jobId, cronExpr, command, timezone) {
|
|
16
|
+
const logPath = `${paths.jobLogs(jobId)}/cron.log`;
|
|
17
|
+
const lines = [`${MARKER_PREFIX}${jobId}`];
|
|
18
|
+
if (timezone && timezone !== "UTC") {
|
|
19
|
+
lines.push(`CRON_TZ=${timezone}`);
|
|
20
|
+
}
|
|
21
|
+
lines.push(`${cronExpr} ${command} >> ${logPath} 2>&1`);
|
|
22
|
+
return lines.join("\n");
|
|
23
|
+
}
|
|
24
|
+
async function readCrontab() {
|
|
25
|
+
try {
|
|
26
|
+
const { stdout } = await execCommand("crontab", ["-l"]);
|
|
27
|
+
return stdout;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
30
|
+
if (msg.includes("no crontab")) {
|
|
31
|
+
return "";
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function writeCrontab(content) {
|
|
37
|
+
await execCommand("crontab", ["-"], { stdin: content });
|
|
38
|
+
}
|
|
39
|
+
function getRunnerPath() {
|
|
40
|
+
try {
|
|
41
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
42
|
+
return join(currentDir, "..", "..", "dist", "claude-auto-run.js");
|
|
43
|
+
} catch {
|
|
44
|
+
return join(process.cwd(), "dist", "claude-auto-run.js");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
var CrontabScheduler = class {
|
|
48
|
+
async register(job, _env) {
|
|
49
|
+
const registered = await this.isRegistered(job.id);
|
|
50
|
+
if (registered) {
|
|
51
|
+
throw new SchedulerError("crontab", `Job "${job.id}" is already registered`);
|
|
52
|
+
}
|
|
53
|
+
const current = await readCrontab();
|
|
54
|
+
const runnerPath = getRunnerPath();
|
|
55
|
+
const command = `${process.execPath} ${runnerPath} --job-id ${job.id}`;
|
|
56
|
+
const block = buildEntryBlock(job.id, job.schedule.cron, command, job.schedule.timezone);
|
|
57
|
+
const updated = `${current.trimEnd()}
|
|
58
|
+
${block}
|
|
59
|
+
`;
|
|
60
|
+
await writeCrontab(updated);
|
|
61
|
+
}
|
|
62
|
+
async unregister(jobId) {
|
|
63
|
+
const current = await readCrontab();
|
|
64
|
+
const lines = current.split("\n");
|
|
65
|
+
const marker = `${MARKER_PREFIX}${jobId}`;
|
|
66
|
+
const filtered = [];
|
|
67
|
+
let skipping = false;
|
|
68
|
+
for (const line of lines) {
|
|
69
|
+
if (line.trim() === marker) {
|
|
70
|
+
skipping = true;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (skipping && (line.startsWith("CRON_TZ=") || !line.startsWith("#") && line.trim() !== "")) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
skipping = false;
|
|
77
|
+
filtered.push(line);
|
|
78
|
+
}
|
|
79
|
+
await writeCrontab(filtered.join("\n"));
|
|
80
|
+
}
|
|
81
|
+
async isRegistered(jobId) {
|
|
82
|
+
const content = await readCrontab();
|
|
83
|
+
return content.includes(`${MARKER_PREFIX}${jobId}`);
|
|
84
|
+
}
|
|
85
|
+
async list() {
|
|
86
|
+
const content = await readCrontab();
|
|
87
|
+
const lines = content.split("\n");
|
|
88
|
+
const jobs = [];
|
|
89
|
+
for (let i = 0; i < lines.length; i++) {
|
|
90
|
+
const line = lines[i];
|
|
91
|
+
if (line.startsWith(MARKER_PREFIX)) {
|
|
92
|
+
const jobId = line.slice(MARKER_PREFIX.length).trim();
|
|
93
|
+
let entryLine = "";
|
|
94
|
+
let nextIdx = i + 1;
|
|
95
|
+
if (nextIdx < lines.length && lines[nextIdx].startsWith("CRON_TZ=")) {
|
|
96
|
+
nextIdx++;
|
|
97
|
+
}
|
|
98
|
+
if (nextIdx < lines.length) {
|
|
99
|
+
entryLine = lines[nextIdx];
|
|
100
|
+
}
|
|
101
|
+
if (entryLine.trim()) {
|
|
102
|
+
const parts = entryLine.trim().split(/\s+/);
|
|
103
|
+
if (parts.length >= 6) {
|
|
104
|
+
const schedule = parts.slice(0, 5).join(" ");
|
|
105
|
+
const command = parts.slice(5).join(" ");
|
|
106
|
+
jobs.push({ jobId, schedule, command });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return jobs;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
buildEntryBlock,
|
|
117
|
+
CrontabScheduler
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=chunk-WYU476R2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/platform/crontab.ts"],"sourcesContent":["import { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport type { JobConfig } from \"../core/types.js\";\nimport { SchedulerError } from \"../util/errors.js\";\nimport { execCommand } from \"../util/exec.js\";\nimport { paths } from \"../util/paths.js\";\nimport type { RegisteredJob, Scheduler } from \"./scheduler.js\";\n\nconst MARKER_PREFIX = \"# claude-auto:\";\n\n/**\n * Build a crontab entry block for a claude-auto job.\n *\n * Format:\n * # claude-auto:{jobId}\n * CRON_TZ={timezone} (only if timezone !== \"UTC\")\n * {cronExpr} {command} >> {logPath} 2>&1\n */\nexport function buildEntryBlock(\n\tjobId: string,\n\tcronExpr: string,\n\tcommand: string,\n\ttimezone?: string,\n): string {\n\tconst logPath = `${paths.jobLogs(jobId)}/cron.log`;\n\tconst lines: string[] = [`${MARKER_PREFIX}${jobId}`];\n\tif (timezone && timezone !== \"UTC\") {\n\t\tlines.push(`CRON_TZ=${timezone}`);\n\t}\n\tlines.push(`${cronExpr} ${command} >> ${logPath} 2>&1`);\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Read the current user's crontab. Returns empty string if none exists.\n */\nasync function readCrontab(): Promise<string> {\n\ttry {\n\t\tconst { stdout } = await execCommand(\"crontab\", [\"-l\"]);\n\t\treturn stdout;\n\t} catch (error: unknown) {\n\t\t// \"no crontab for user\" is not an error for our purposes\n\t\tconst msg = error instanceof Error ? error.message : String(error);\n\t\tif (msg.includes(\"no crontab\")) {\n\t\t\treturn \"\";\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/**\n * Write the full crontab content via stdin to `crontab -`.\n */\nasync function writeCrontab(content: string): Promise<void> {\n\tawait execCommand(\"crontab\", [\"-\"], { stdin: content });\n}\n\n/**\n * Resolve the runner script path. For now, compute relative to this module.\n */\nfunction getRunnerPath(): string {\n\ttry {\n\t\tconst currentDir = dirname(fileURLToPath(import.meta.url));\n\t\treturn join(currentDir, \"..\", \"..\", \"dist\", \"claude-auto-run.js\");\n\t} catch {\n\t\t// Fallback for test/bundle environments\n\t\treturn join(process.cwd(), \"dist\", \"claude-auto-run.js\");\n\t}\n}\n\n/**\n * CrontabScheduler implements the Scheduler interface for Linux systems.\n * Uses comment-tagged crontab entries for identification and CRUD.\n */\nexport class CrontabScheduler implements Scheduler {\n\tasync register(job: JobConfig, _env?: Record<string, string>): Promise<void> {\n\t\tconst registered = await this.isRegistered(job.id);\n\t\tif (registered) {\n\t\t\tthrow new SchedulerError(\"crontab\", `Job \"${job.id}\" is already registered`);\n\t\t}\n\n\t\tconst current = await readCrontab();\n\n\t\tconst runnerPath = getRunnerPath();\n\t\tconst command = `${process.execPath} ${runnerPath} --job-id ${job.id}`;\n\t\tconst block = buildEntryBlock(job.id, job.schedule.cron, command, job.schedule.timezone);\n\n\t\tconst updated = `${current.trimEnd()}\\n${block}\\n`;\n\t\tawait writeCrontab(updated);\n\t}\n\n\tasync unregister(jobId: string): Promise<void> {\n\t\tconst current = await readCrontab();\n\t\tconst lines = current.split(\"\\n\");\n\t\tconst marker = `${MARKER_PREFIX}${jobId}`;\n\n\t\tconst filtered: string[] = [];\n\t\tlet skipping = false;\n\n\t\tfor (const line of lines) {\n\t\t\tif (line.trim() === marker) {\n\t\t\t\tskipping = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tskipping &&\n\t\t\t\t(line.startsWith(\"CRON_TZ=\") || (!line.startsWith(\"#\") && line.trim() !== \"\"))\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tskipping = false;\n\t\t\tfiltered.push(line);\n\t\t}\n\n\t\tawait writeCrontab(filtered.join(\"\\n\"));\n\t}\n\n\tasync isRegistered(jobId: string): Promise<boolean> {\n\t\tconst content = await readCrontab();\n\t\treturn content.includes(`${MARKER_PREFIX}${jobId}`);\n\t}\n\n\tasync list(): Promise<RegisteredJob[]> {\n\t\tconst content = await readCrontab();\n\t\tconst lines = content.split(\"\\n\");\n\t\tconst jobs: RegisteredJob[] = [];\n\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tconst line = lines[i];\n\t\t\tif (line.startsWith(MARKER_PREFIX)) {\n\t\t\t\tconst jobId = line.slice(MARKER_PREFIX.length).trim();\n\n\t\t\t\t// Look ahead: skip optional CRON_TZ line, then find the cron entry\n\t\t\t\tlet entryLine = \"\";\n\t\t\t\tlet nextIdx = i + 1;\n\n\t\t\t\tif (nextIdx < lines.length && lines[nextIdx].startsWith(\"CRON_TZ=\")) {\n\t\t\t\t\tnextIdx++;\n\t\t\t\t}\n\n\t\t\t\tif (nextIdx < lines.length) {\n\t\t\t\t\tentryLine = lines[nextIdx];\n\t\t\t\t}\n\n\t\t\t\tif (entryLine.trim()) {\n\t\t\t\t\t// Parse the cron fields (first 5 space-separated fields) and the command (rest)\n\t\t\t\t\tconst parts = entryLine.trim().split(/\\s+/);\n\t\t\t\t\tif (parts.length >= 6) {\n\t\t\t\t\t\tconst schedule = parts.slice(0, 5).join(\" \");\n\t\t\t\t\t\tconst command = parts.slice(5).join(\" \");\n\t\t\t\t\t\tjobs.push({ jobId, schedule, command });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jobs;\n\t}\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/util/errors.ts
|
|
2
|
+
var ConfigParseError = class extends Error {
|
|
3
|
+
constructor(filePath, parseErrors) {
|
|
4
|
+
const errorMessages = parseErrors.map((e) => ` - ${e.message}`).join("\n");
|
|
5
|
+
super(`YAML syntax error in ${filePath}:
|
|
6
|
+
${errorMessages}`);
|
|
7
|
+
this.filePath = filePath;
|
|
8
|
+
this.parseErrors = parseErrors;
|
|
9
|
+
}
|
|
10
|
+
name = "ConfigParseError";
|
|
11
|
+
};
|
|
12
|
+
var ConfigValidationError = class extends Error {
|
|
13
|
+
constructor(filePath, validationMessage) {
|
|
14
|
+
super(`Invalid config in ${filePath}:
|
|
15
|
+
${validationMessage}`);
|
|
16
|
+
this.filePath = filePath;
|
|
17
|
+
this.validationMessage = validationMessage;
|
|
18
|
+
}
|
|
19
|
+
name = "ConfigValidationError";
|
|
20
|
+
};
|
|
21
|
+
var SchedulerError = class extends Error {
|
|
22
|
+
constructor(platform, message, cause) {
|
|
23
|
+
super(`Scheduler error (${platform}): ${message}`);
|
|
24
|
+
this.platform = platform;
|
|
25
|
+
this.cause = cause;
|
|
26
|
+
}
|
|
27
|
+
name = "SchedulerError";
|
|
28
|
+
};
|
|
29
|
+
var CronValidationError = class extends Error {
|
|
30
|
+
constructor(expression, message) {
|
|
31
|
+
super(`Invalid cron expression "${expression}": ${message}`);
|
|
32
|
+
this.expression = expression;
|
|
33
|
+
}
|
|
34
|
+
name = "CronValidationError";
|
|
35
|
+
};
|
|
36
|
+
var GitOpsError = class extends Error {
|
|
37
|
+
constructor(operation, repoPath, message, cause) {
|
|
38
|
+
super(`Git operation '${operation}' failed in ${repoPath}: ${message}`);
|
|
39
|
+
this.operation = operation;
|
|
40
|
+
this.repoPath = repoPath;
|
|
41
|
+
this.cause = cause;
|
|
42
|
+
}
|
|
43
|
+
name = "GitOpsError";
|
|
44
|
+
};
|
|
45
|
+
var LockError = class extends Error {
|
|
46
|
+
constructor(jobId, message) {
|
|
47
|
+
super(`Lock error for job ${jobId}: ${message}`);
|
|
48
|
+
this.jobId = jobId;
|
|
49
|
+
}
|
|
50
|
+
name = "LockError";
|
|
51
|
+
};
|
|
52
|
+
var SpawnError = class extends Error {
|
|
53
|
+
constructor(message, exitCode) {
|
|
54
|
+
super(`Claude spawn error: ${message}`);
|
|
55
|
+
this.exitCode = exitCode;
|
|
56
|
+
}
|
|
57
|
+
name = "SpawnError";
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
ConfigParseError,
|
|
62
|
+
ConfigValidationError,
|
|
63
|
+
SchedulerError,
|
|
64
|
+
CronValidationError,
|
|
65
|
+
GitOpsError,
|
|
66
|
+
LockError,
|
|
67
|
+
SpawnError
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=chunk-YMO45Z6G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/util/errors.ts"],"sourcesContent":["export class ConfigParseError extends Error {\n\toverride name = \"ConfigParseError\" as const;\n\tconstructor(\n\t\tpublic readonly filePath: string,\n\t\tpublic readonly parseErrors: Array<{ message: string }>,\n\t) {\n\t\tconst errorMessages = parseErrors.map((e) => ` - ${e.message}`).join(\"\\n\");\n\t\tsuper(`YAML syntax error in ${filePath}:\\n${errorMessages}`);\n\t}\n}\n\nexport class ConfigValidationError extends Error {\n\toverride name = \"ConfigValidationError\" as const;\n\tconstructor(\n\t\tpublic readonly filePath: string,\n\t\tpublic readonly validationMessage: string,\n\t) {\n\t\tsuper(`Invalid config in ${filePath}:\\n${validationMessage}`);\n\t}\n}\n\nexport class SchedulerError extends Error {\n\toverride name = \"SchedulerError\" as const;\n\tconstructor(\n\t\tpublic readonly platform: string,\n\t\tmessage: string,\n\t\tpublic readonly cause?: Error,\n\t) {\n\t\tsuper(`Scheduler error (${platform}): ${message}`);\n\t}\n}\n\nexport class CronValidationError extends Error {\n\toverride name = \"CronValidationError\" as const;\n\tconstructor(\n\t\tpublic readonly expression: string,\n\t\tmessage: string,\n\t) {\n\t\tsuper(`Invalid cron expression \"${expression}\": ${message}`);\n\t}\n}\n\nexport class GitOpsError extends Error {\n\toverride name = \"GitOpsError\" as const;\n\tconstructor(\n\t\tpublic readonly operation: string,\n\t\tpublic readonly repoPath: string,\n\t\tmessage: string,\n\t\tpublic override readonly cause?: Error,\n\t) {\n\t\tsuper(`Git operation '${operation}' failed in ${repoPath}: ${message}`);\n\t}\n}\n\nexport class LockError extends Error {\n\toverride name = \"LockError\" as const;\n\tconstructor(\n\t\tpublic readonly jobId: string,\n\t\tmessage: string,\n\t) {\n\t\tsuper(`Lock error for job ${jobId}: ${message}`);\n\t}\n}\n\nexport class SpawnError extends Error {\n\toverride name = \"SpawnError\" as const;\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic readonly exitCode?: number,\n\t) {\n\t\tsuper(`Claude spawn error: ${message}`);\n\t}\n}\n"],"mappings":";AAAO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAE3C,YACiB,UACA,aACf;AACD,UAAM,gBAAgB,YAAY,IAAI,CAAC,MAAM,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,IAAI;AAC1E,UAAM,wBAAwB,QAAQ;AAAA,EAAM,aAAa,EAAE;AAJ3C;AACA;AAAA,EAIjB;AAAA,EAPS,OAAO;AAQjB;AAEO,IAAM,wBAAN,cAAoC,MAAM;AAAA,EAEhD,YACiB,UACA,mBACf;AACD,UAAM,qBAAqB,QAAQ;AAAA,EAAM,iBAAiB,EAAE;AAH5C;AACA;AAAA,EAGjB;AAAA,EANS,OAAO;AAOjB;AAEO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAEzC,YACiB,UAChB,SACgB,OACf;AACD,UAAM,oBAAoB,QAAQ,MAAM,OAAO,EAAE;AAJjC;AAEA;AAAA,EAGjB;AAAA,EAPS,OAAO;AAQjB;AAEO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAE9C,YACiB,YAChB,SACC;AACD,UAAM,4BAA4B,UAAU,MAAM,OAAO,EAAE;AAH3C;AAAA,EAIjB;AAAA,EANS,OAAO;AAOjB;AAEO,IAAM,cAAN,cAA0B,MAAM;AAAA,EAEtC,YACiB,WACA,UAChB,SACyB,OACxB;AACD,UAAM,kBAAkB,SAAS,eAAe,QAAQ,KAAK,OAAO,EAAE;AALtD;AACA;AAES;AAAA,EAG1B;AAAA,EARS,OAAO;AASjB;AAEO,IAAM,YAAN,cAAwB,MAAM;AAAA,EAEpC,YACiB,OAChB,SACC;AACD,UAAM,sBAAsB,KAAK,KAAK,OAAO,EAAE;AAH/B;AAAA,EAIjB;AAAA,EANS,OAAO;AAOjB;AAEO,IAAM,aAAN,cAAyB,MAAM;AAAA,EAErC,YACC,SACgB,UACf;AACD,UAAM,uBAAuB,OAAO,EAAE;AAFtB;AAAA,EAGjB;AAAA,EANS,OAAO;AAOjB;","names":[]}
|