herdctl 0.0.1 → 0.0.2
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/bin/herdctl.js +9 -0
- package/dist/commands/__tests__/config.test.d.ts +2 -0
- package/dist/commands/__tests__/config.test.d.ts.map +1 -0
- package/dist/commands/__tests__/config.test.js +299 -0
- package/dist/commands/__tests__/config.test.js.map +1 -0
- package/dist/commands/__tests__/init.test.d.ts +2 -0
- package/dist/commands/__tests__/init.test.d.ts.map +1 -0
- package/dist/commands/__tests__/init.test.js +247 -0
- package/dist/commands/__tests__/init.test.js.map +1 -0
- package/dist/commands/__tests__/start.test.d.ts +2 -0
- package/dist/commands/__tests__/start.test.d.ts.map +1 -0
- package/dist/commands/__tests__/start.test.js +185 -0
- package/dist/commands/__tests__/start.test.js.map +1 -0
- package/dist/commands/__tests__/status.test.d.ts +2 -0
- package/dist/commands/__tests__/status.test.d.ts.map +1 -0
- package/dist/commands/__tests__/status.test.js +342 -0
- package/dist/commands/__tests__/status.test.js.map +1 -0
- package/dist/commands/__tests__/stop.test.d.ts +2 -0
- package/dist/commands/__tests__/stop.test.d.ts.map +1 -0
- package/dist/commands/__tests__/stop.test.js +229 -0
- package/dist/commands/__tests__/stop.test.js.map +1 -0
- package/dist/commands/__tests__/trigger.test.d.ts +2 -0
- package/dist/commands/__tests__/trigger.test.d.ts.map +1 -0
- package/dist/commands/__tests__/trigger.test.js +321 -0
- package/dist/commands/__tests__/trigger.test.js.map +1 -0
- package/dist/commands/cancel.d.ts +20 -0
- package/dist/commands/cancel.d.ts.map +1 -0
- package/dist/commands/cancel.js +263 -0
- package/dist/commands/cancel.js.map +1 -0
- package/dist/commands/config.d.ts +26 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +287 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/init.d.ts +16 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +305 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/job.d.ts +19 -0
- package/dist/commands/job.d.ts.map +1 -0
- package/dist/commands/job.js +460 -0
- package/dist/commands/job.js.map +1 -0
- package/dist/commands/jobs.d.ts +23 -0
- package/dist/commands/jobs.d.ts.map +1 -0
- package/dist/commands/jobs.js +328 -0
- package/dist/commands/jobs.js.map +1 -0
- package/dist/commands/logs.d.ts +25 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +360 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/start.d.ts +17 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +166 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +18 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +373 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/stop.d.ts +18 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +161 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/commands/trigger.d.ts +23 -0
- package/dist/commands/trigger.d.ts.map +1 -0
- package/dist/commands/trigger.js +332 -0
- package/dist/commands/trigger.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +283 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -7
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* herdctl job - Show job details and logs
|
|
3
|
+
*
|
|
4
|
+
* Commands:
|
|
5
|
+
* - herdctl job <id> Show job details
|
|
6
|
+
* - herdctl job <id> --logs Show job output
|
|
7
|
+
* - herdctl job <id> --json JSON output
|
|
8
|
+
*/
|
|
9
|
+
import { FleetManager, ConfigNotFoundError, isFleetManagerError, isJobNotFoundError, JobManager, } from "@herdctl/core";
|
|
10
|
+
/**
|
|
11
|
+
* Default state directory
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_STATE_DIR = ".herdctl";
|
|
14
|
+
/**
|
|
15
|
+
* Check if colors should be disabled
|
|
16
|
+
*/
|
|
17
|
+
function shouldUseColor() {
|
|
18
|
+
if (process.env.NO_COLOR !== undefined && process.env.NO_COLOR !== "") {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (process.env.FORCE_COLOR !== undefined && process.env.FORCE_COLOR !== "0") {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return process.stdout.isTTY === true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* ANSI color codes
|
|
28
|
+
*/
|
|
29
|
+
const colors = {
|
|
30
|
+
reset: "\x1b[0m",
|
|
31
|
+
bold: "\x1b[1m",
|
|
32
|
+
dim: "\x1b[2m",
|
|
33
|
+
green: "\x1b[32m",
|
|
34
|
+
yellow: "\x1b[33m",
|
|
35
|
+
red: "\x1b[31m",
|
|
36
|
+
cyan: "\x1b[36m",
|
|
37
|
+
gray: "\x1b[90m",
|
|
38
|
+
blue: "\x1b[34m",
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Get a colored string, respecting NO_COLOR
|
|
42
|
+
*/
|
|
43
|
+
function colorize(text, color) {
|
|
44
|
+
if (!shouldUseColor()) {
|
|
45
|
+
return text;
|
|
46
|
+
}
|
|
47
|
+
return `${colors[color]}${text}${colors.reset}`;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get status color based on job status
|
|
51
|
+
*/
|
|
52
|
+
function getStatusColor(status) {
|
|
53
|
+
switch (status) {
|
|
54
|
+
case "running":
|
|
55
|
+
return "green";
|
|
56
|
+
case "pending":
|
|
57
|
+
return "yellow";
|
|
58
|
+
case "completed":
|
|
59
|
+
return "cyan";
|
|
60
|
+
case "failed":
|
|
61
|
+
return "red";
|
|
62
|
+
case "cancelled":
|
|
63
|
+
return "gray";
|
|
64
|
+
default:
|
|
65
|
+
return "reset";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Format job status with color
|
|
70
|
+
*/
|
|
71
|
+
function formatStatus(status) {
|
|
72
|
+
const color = getStatusColor(status);
|
|
73
|
+
return colorize(status, color);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Format duration in human-readable format
|
|
77
|
+
*/
|
|
78
|
+
function formatDuration(seconds) {
|
|
79
|
+
if (seconds === null || seconds === undefined) {
|
|
80
|
+
return "-";
|
|
81
|
+
}
|
|
82
|
+
const minutes = Math.floor(seconds / 60);
|
|
83
|
+
const hours = Math.floor(minutes / 60);
|
|
84
|
+
const days = Math.floor(hours / 24);
|
|
85
|
+
if (days > 0) {
|
|
86
|
+
return `${days}d ${hours % 24}h ${minutes % 60}m ${Math.floor(seconds % 60)}s`;
|
|
87
|
+
}
|
|
88
|
+
else if (hours > 0) {
|
|
89
|
+
return `${hours}h ${minutes % 60}m ${Math.floor(seconds % 60)}s`;
|
|
90
|
+
}
|
|
91
|
+
else if (minutes > 0) {
|
|
92
|
+
return `${minutes}m ${Math.floor(seconds % 60)}s`;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return `${Math.floor(seconds)}s`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Format timestamp to local timezone
|
|
100
|
+
*/
|
|
101
|
+
function formatTimestamp(isoTimestamp) {
|
|
102
|
+
if (!isoTimestamp) {
|
|
103
|
+
return "-";
|
|
104
|
+
}
|
|
105
|
+
const date = new Date(isoTimestamp);
|
|
106
|
+
return date.toLocaleString(undefined, {
|
|
107
|
+
year: "numeric",
|
|
108
|
+
month: "short",
|
|
109
|
+
day: "numeric",
|
|
110
|
+
hour: "2-digit",
|
|
111
|
+
minute: "2-digit",
|
|
112
|
+
second: "2-digit",
|
|
113
|
+
hour12: false,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Format job details for console output
|
|
118
|
+
*/
|
|
119
|
+
function formatJobDetails(job) {
|
|
120
|
+
const lines = [];
|
|
121
|
+
// Header
|
|
122
|
+
lines.push("");
|
|
123
|
+
lines.push(colorize(`Job: ${job.id}`, "bold"));
|
|
124
|
+
lines.push("═".repeat(60));
|
|
125
|
+
// Basic info
|
|
126
|
+
lines.push(`Agent: ${job.agent}`);
|
|
127
|
+
if (job.schedule) {
|
|
128
|
+
lines.push(`Schedule: ${job.schedule}`);
|
|
129
|
+
}
|
|
130
|
+
lines.push(`Status: ${formatStatus(job.status)}`);
|
|
131
|
+
lines.push(`Trigger Type: ${job.trigger_type}`);
|
|
132
|
+
// Timing
|
|
133
|
+
lines.push("");
|
|
134
|
+
lines.push(colorize("Timing", "bold"));
|
|
135
|
+
lines.push("─".repeat(30));
|
|
136
|
+
lines.push(`Started: ${formatTimestamp(job.started_at)}`);
|
|
137
|
+
lines.push(`Finished: ${formatTimestamp(job.finished_at)}`);
|
|
138
|
+
lines.push(`Duration: ${formatDuration(job.duration_seconds)}`);
|
|
139
|
+
// Exit info
|
|
140
|
+
if (job.exit_reason) {
|
|
141
|
+
lines.push("");
|
|
142
|
+
lines.push(colorize("Exit Info", "bold"));
|
|
143
|
+
lines.push("─".repeat(30));
|
|
144
|
+
const exitColor = job.exit_reason === "success" ? "green" : "red";
|
|
145
|
+
lines.push(`Exit Reason: ${colorize(job.exit_reason, exitColor)}`);
|
|
146
|
+
}
|
|
147
|
+
// Session info
|
|
148
|
+
if (job.session_id || job.forked_from) {
|
|
149
|
+
lines.push("");
|
|
150
|
+
lines.push(colorize("Session", "bold"));
|
|
151
|
+
lines.push("─".repeat(30));
|
|
152
|
+
if (job.session_id) {
|
|
153
|
+
lines.push(`Session ID: ${colorize(job.session_id, "dim")}`);
|
|
154
|
+
}
|
|
155
|
+
if (job.forked_from) {
|
|
156
|
+
lines.push(`Forked From: ${colorize(job.forked_from, "cyan")}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// Prompt
|
|
160
|
+
if (job.prompt) {
|
|
161
|
+
lines.push("");
|
|
162
|
+
lines.push(colorize("Prompt", "bold"));
|
|
163
|
+
lines.push("─".repeat(30));
|
|
164
|
+
// Truncate long prompts
|
|
165
|
+
const maxPromptLength = 500;
|
|
166
|
+
if (job.prompt.length > maxPromptLength) {
|
|
167
|
+
lines.push(job.prompt.substring(0, maxPromptLength) + "...");
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
lines.push(job.prompt);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// Summary
|
|
174
|
+
if (job.summary) {
|
|
175
|
+
lines.push("");
|
|
176
|
+
lines.push(colorize("Summary", "bold"));
|
|
177
|
+
lines.push("─".repeat(30));
|
|
178
|
+
lines.push(job.summary);
|
|
179
|
+
}
|
|
180
|
+
// Output file
|
|
181
|
+
if (job.output_file) {
|
|
182
|
+
lines.push("");
|
|
183
|
+
lines.push(colorize("Output File", "bold"));
|
|
184
|
+
lines.push("─".repeat(30));
|
|
185
|
+
lines.push(colorize(job.output_file, "dim"));
|
|
186
|
+
}
|
|
187
|
+
lines.push("");
|
|
188
|
+
return lines.join("\n");
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Format raw output message for console display
|
|
192
|
+
*/
|
|
193
|
+
function formatOutputMessage(entry) {
|
|
194
|
+
switch (entry.type) {
|
|
195
|
+
case "assistant":
|
|
196
|
+
if (entry.content) {
|
|
197
|
+
process.stdout.write(entry.content);
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
case "tool_use":
|
|
201
|
+
if (entry.tool_name) {
|
|
202
|
+
console.log(colorize(`[Tool: ${entry.tool_name}]`, "dim"));
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case "tool_result":
|
|
206
|
+
if (entry.result !== undefined) {
|
|
207
|
+
const resultStr = typeof entry.result === "string"
|
|
208
|
+
? entry.result
|
|
209
|
+
: JSON.stringify(entry.result);
|
|
210
|
+
const truncated = resultStr.length > 100
|
|
211
|
+
? resultStr.substring(0, 100) + "..."
|
|
212
|
+
: resultStr;
|
|
213
|
+
console.log(colorize(`[Result: ${truncated}]`, "dim"));
|
|
214
|
+
}
|
|
215
|
+
if (entry.error) {
|
|
216
|
+
console.log(colorize(`[Tool Error: ${entry.error}]`, "red"));
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
case "error":
|
|
220
|
+
if (entry.message) {
|
|
221
|
+
console.log(colorize(`[Error: ${entry.message}]`, "red"));
|
|
222
|
+
}
|
|
223
|
+
break;
|
|
224
|
+
case "system":
|
|
225
|
+
if (entry.content) {
|
|
226
|
+
console.log(colorize(`[System: ${entry.content}]`, "yellow"));
|
|
227
|
+
}
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Format a LogEntry (from streamJobOutput) for console display
|
|
233
|
+
*/
|
|
234
|
+
function formatLogEntry(entry) {
|
|
235
|
+
// LogEntry has level and message fields
|
|
236
|
+
const levelColor = entry.level === "error" ? "red" :
|
|
237
|
+
entry.level === "warn" ? "yellow" : "reset";
|
|
238
|
+
console.log(colorize(entry.message, levelColor));
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Show job details (herdctl job)
|
|
242
|
+
*/
|
|
243
|
+
export async function jobCommand(jobId, options) {
|
|
244
|
+
const stateDir = options.state || DEFAULT_STATE_DIR;
|
|
245
|
+
const isJsonOutput = options.json === true;
|
|
246
|
+
const showLogs = options.logs === true;
|
|
247
|
+
// Create FleetManager
|
|
248
|
+
const manager = new FleetManager({
|
|
249
|
+
configPath: options.config,
|
|
250
|
+
stateDir,
|
|
251
|
+
});
|
|
252
|
+
// Track if we're shutting down (for log streaming)
|
|
253
|
+
let isShuttingDown = false;
|
|
254
|
+
/**
|
|
255
|
+
* Graceful shutdown handler for log streaming
|
|
256
|
+
*/
|
|
257
|
+
function shutdown() {
|
|
258
|
+
if (isShuttingDown) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
isShuttingDown = true;
|
|
262
|
+
if (!isJsonOutput) {
|
|
263
|
+
console.log("");
|
|
264
|
+
console.log(colorize("Interrupted.", "yellow"));
|
|
265
|
+
}
|
|
266
|
+
process.exit(130);
|
|
267
|
+
}
|
|
268
|
+
try {
|
|
269
|
+
// Initialize to load configuration
|
|
270
|
+
await manager.initialize();
|
|
271
|
+
// Create JobManager to query job
|
|
272
|
+
const { join } = await import("node:path");
|
|
273
|
+
const jobsDir = join(stateDir, "jobs");
|
|
274
|
+
const jobManager = new JobManager({
|
|
275
|
+
jobsDir,
|
|
276
|
+
});
|
|
277
|
+
// Get job with output if logs requested
|
|
278
|
+
const job = await jobManager.getJob(jobId, {
|
|
279
|
+
includeOutput: showLogs,
|
|
280
|
+
});
|
|
281
|
+
if (showLogs) {
|
|
282
|
+
// Stream logs mode
|
|
283
|
+
process.on("SIGINT", shutdown);
|
|
284
|
+
process.on("SIGTERM", shutdown);
|
|
285
|
+
if (isJsonOutput) {
|
|
286
|
+
// Output job metadata first
|
|
287
|
+
const jobJson = {
|
|
288
|
+
job: {
|
|
289
|
+
id: job.id,
|
|
290
|
+
agent: job.agent,
|
|
291
|
+
schedule: job.schedule,
|
|
292
|
+
status: job.status,
|
|
293
|
+
triggerType: job.trigger_type,
|
|
294
|
+
exitReason: job.exit_reason,
|
|
295
|
+
sessionId: job.session_id,
|
|
296
|
+
forkedFrom: job.forked_from,
|
|
297
|
+
startedAt: job.started_at,
|
|
298
|
+
finishedAt: job.finished_at,
|
|
299
|
+
durationSeconds: job.duration_seconds,
|
|
300
|
+
prompt: job.prompt,
|
|
301
|
+
summary: job.summary,
|
|
302
|
+
outputFile: job.output_file,
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
console.log(JSON.stringify(jobJson));
|
|
306
|
+
// Output each log entry as NDJSON
|
|
307
|
+
if (job.output) {
|
|
308
|
+
for (const entry of job.output) {
|
|
309
|
+
console.log(JSON.stringify(entry));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
// Show job header
|
|
315
|
+
console.log("");
|
|
316
|
+
console.log(colorize(`Job: ${job.id}`, "bold"));
|
|
317
|
+
console.log(`Agent: ${job.agent} | Status: ${formatStatus(job.status)} | Duration: ${formatDuration(job.duration_seconds)}`);
|
|
318
|
+
console.log("═".repeat(80));
|
|
319
|
+
console.log("");
|
|
320
|
+
// Show existing output
|
|
321
|
+
if (job.output && job.output.length > 0) {
|
|
322
|
+
for (const entry of job.output) {
|
|
323
|
+
if (isShuttingDown)
|
|
324
|
+
break;
|
|
325
|
+
formatOutputMessage(entry);
|
|
326
|
+
}
|
|
327
|
+
console.log("");
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
console.log(colorize("No output available for this job.", "dim"));
|
|
331
|
+
console.log("");
|
|
332
|
+
}
|
|
333
|
+
// If job is still running, stream live output
|
|
334
|
+
if (job.status === "running" || job.status === "pending") {
|
|
335
|
+
console.log(colorize("Streaming live output (Ctrl+C to stop)...", "dim"));
|
|
336
|
+
console.log("");
|
|
337
|
+
try {
|
|
338
|
+
for await (const entry of manager.streamJobOutput(jobId)) {
|
|
339
|
+
if (isShuttingDown)
|
|
340
|
+
break;
|
|
341
|
+
formatLogEntry(entry);
|
|
342
|
+
}
|
|
343
|
+
if (!isShuttingDown) {
|
|
344
|
+
console.log("");
|
|
345
|
+
console.log(colorize("Job completed.", "green"));
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
catch (streamError) {
|
|
349
|
+
if (!isShuttingDown) {
|
|
350
|
+
console.log("");
|
|
351
|
+
console.log(colorize(`Stream error: ${streamError instanceof Error ? streamError.message : String(streamError)}`, "red"));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
// Details mode
|
|
359
|
+
if (isJsonOutput) {
|
|
360
|
+
const output = {
|
|
361
|
+
job: {
|
|
362
|
+
id: job.id,
|
|
363
|
+
agent: job.agent,
|
|
364
|
+
schedule: job.schedule,
|
|
365
|
+
status: job.status,
|
|
366
|
+
triggerType: job.trigger_type,
|
|
367
|
+
exitReason: job.exit_reason,
|
|
368
|
+
sessionId: job.session_id,
|
|
369
|
+
forkedFrom: job.forked_from,
|
|
370
|
+
startedAt: job.started_at,
|
|
371
|
+
finishedAt: job.finished_at,
|
|
372
|
+
durationSeconds: job.duration_seconds,
|
|
373
|
+
prompt: job.prompt,
|
|
374
|
+
summary: job.summary,
|
|
375
|
+
outputFile: job.output_file,
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
console.log(JSON.stringify(output, null, 2));
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
console.log(formatJobDetails(job));
|
|
382
|
+
console.log(`Run 'herdctl job ${jobId} --logs' to view job output.`);
|
|
383
|
+
console.log("");
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
// Handle specific error types
|
|
389
|
+
if (error instanceof ConfigNotFoundError) {
|
|
390
|
+
if (isJsonOutput) {
|
|
391
|
+
console.log(JSON.stringify({
|
|
392
|
+
error: {
|
|
393
|
+
code: "CONFIG_NOT_FOUND",
|
|
394
|
+
message: "No configuration file found",
|
|
395
|
+
startDirectory: error.startDirectory,
|
|
396
|
+
},
|
|
397
|
+
}));
|
|
398
|
+
process.exit(1);
|
|
399
|
+
}
|
|
400
|
+
console.error("");
|
|
401
|
+
console.error("Error: No configuration file found.");
|
|
402
|
+
console.error(`Searched from: ${error.startDirectory}`);
|
|
403
|
+
console.error("");
|
|
404
|
+
console.error("Run 'herdctl init' to create a configuration file.");
|
|
405
|
+
process.exit(1);
|
|
406
|
+
}
|
|
407
|
+
if (isJobNotFoundError(error)) {
|
|
408
|
+
if (isJsonOutput) {
|
|
409
|
+
console.log(JSON.stringify({
|
|
410
|
+
error: {
|
|
411
|
+
code: "JOB_NOT_FOUND",
|
|
412
|
+
message: error.message,
|
|
413
|
+
jobId: jobId,
|
|
414
|
+
},
|
|
415
|
+
}));
|
|
416
|
+
process.exit(1);
|
|
417
|
+
}
|
|
418
|
+
console.error("");
|
|
419
|
+
console.error(`Error: Job '${jobId}' not found.`);
|
|
420
|
+
console.error("");
|
|
421
|
+
console.error("Run 'herdctl jobs' to see recent jobs.");
|
|
422
|
+
process.exit(1);
|
|
423
|
+
}
|
|
424
|
+
if (isFleetManagerError(error)) {
|
|
425
|
+
if (isJsonOutput) {
|
|
426
|
+
console.log(JSON.stringify({
|
|
427
|
+
error: {
|
|
428
|
+
code: error.code,
|
|
429
|
+
message: error.message,
|
|
430
|
+
},
|
|
431
|
+
}));
|
|
432
|
+
process.exit(1);
|
|
433
|
+
}
|
|
434
|
+
console.error("");
|
|
435
|
+
console.error(`Error: ${error.message}`);
|
|
436
|
+
if (error.code) {
|
|
437
|
+
console.error(`Code: ${error.code}`);
|
|
438
|
+
}
|
|
439
|
+
process.exit(1);
|
|
440
|
+
}
|
|
441
|
+
// Handle interruption during shutdown gracefully
|
|
442
|
+
if (isShuttingDown) {
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
// Generic error
|
|
446
|
+
if (isJsonOutput) {
|
|
447
|
+
console.log(JSON.stringify({
|
|
448
|
+
error: {
|
|
449
|
+
code: "UNKNOWN_ERROR",
|
|
450
|
+
message: error instanceof Error ? error.message : String(error),
|
|
451
|
+
},
|
|
452
|
+
}));
|
|
453
|
+
process.exit(1);
|
|
454
|
+
}
|
|
455
|
+
console.error("");
|
|
456
|
+
console.error("Error:", error instanceof Error ? error.message : String(error));
|
|
457
|
+
process.exit(1);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
//# sourceMappingURL=job.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../src/commands/job.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,GAGX,MAAM,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,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* herdctl jobs - List jobs with filtering and pagination
|
|
3
|
+
*
|
|
4
|
+
* Commands:
|
|
5
|
+
* - herdctl jobs List recent jobs (last 20)
|
|
6
|
+
* - herdctl jobs --agent <name> Jobs for specific agent
|
|
7
|
+
* - herdctl jobs --status running Filter by status
|
|
8
|
+
* - herdctl jobs --limit 50 Custom limit
|
|
9
|
+
* - herdctl jobs --json JSON output
|
|
10
|
+
*/
|
|
11
|
+
export interface JobsOptions {
|
|
12
|
+
agent?: string;
|
|
13
|
+
status?: string;
|
|
14
|
+
limit?: number;
|
|
15
|
+
json?: boolean;
|
|
16
|
+
state?: string;
|
|
17
|
+
config?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* List jobs (herdctl jobs)
|
|
21
|
+
*/
|
|
22
|
+
export declare function jobsCommand(options: JobsOptions): Promise<void>;
|
|
23
|
+
//# sourceMappingURL=jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/commands/jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4ND;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA8JrE"}
|