@ironbee-ai/cli 0.5.2 → 0.6.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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/analysis/cross-session.d.ts +1 -1
- package/dist/analysis/cross-session.js +1 -1
- package/dist/analysis/cross-session.js.map +1 -1
- package/dist/analysis/time-analysis.js +3 -3
- package/dist/analysis/time-analysis.js.map +1 -1
- package/dist/analysis/verdict-details.d.ts +1 -1
- package/dist/clients/claude/hooks/clear-verdict.d.ts.map +1 -1
- package/dist/clients/claude/hooks/clear-verdict.js +17 -9
- package/dist/clients/claude/hooks/clear-verdict.js.map +1 -1
- package/dist/clients/claude/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/claude/hooks/require-verification.js +31 -4
- package/dist/clients/claude/hooks/require-verification.js.map +1 -1
- package/dist/clients/claude/hooks/session-end.d.ts.map +1 -1
- package/dist/clients/claude/hooks/session-end.js +6 -1
- package/dist/clients/claude/hooks/session-end.js.map +1 -1
- package/dist/clients/claude/hooks/session-start.d.ts.map +1 -1
- package/dist/clients/claude/hooks/session-start.js +9 -3
- package/dist/clients/claude/hooks/session-start.js.map +1 -1
- package/dist/clients/claude/hooks/track-action.d.ts +25 -4
- package/dist/clients/claude/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/claude/hooks/track-action.js +160 -29
- package/dist/clients/claude/hooks/track-action.js.map +1 -1
- package/dist/clients/claude/hooks/verify-gate.d.ts.map +1 -1
- package/dist/clients/claude/hooks/verify-gate.js +5 -0
- package/dist/clients/claude/hooks/verify-gate.js.map +1 -1
- package/dist/clients/claude/index.d.ts.map +1 -1
- package/dist/clients/claude/index.js +18 -1
- package/dist/clients/claude/index.js.map +1 -1
- package/dist/clients/claude/util.d.ts +74 -0
- package/dist/clients/claude/util.d.ts.map +1 -0
- package/dist/clients/claude/util.js +352 -0
- package/dist/clients/claude/util.js.map +1 -0
- package/dist/clients/cursor/hooks/clear-verdict.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/clear-verdict.js +19 -10
- package/dist/clients/cursor/hooks/clear-verdict.js.map +1 -1
- package/dist/clients/cursor/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/require-verification.js +28 -4
- package/dist/clients/cursor/hooks/require-verification.js.map +1 -1
- package/dist/clients/cursor/hooks/session-end.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/session-end.js +6 -1
- package/dist/clients/cursor/hooks/session-end.js.map +1 -1
- package/dist/clients/cursor/hooks/session-start.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/session-start.js +7 -2
- package/dist/clients/cursor/hooks/session-start.js.map +1 -1
- package/dist/clients/cursor/hooks/track-action.d.ts +30 -8
- package/dist/clients/cursor/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/track-action.js +192 -54
- package/dist/clients/cursor/hooks/track-action.js.map +1 -1
- package/dist/clients/cursor/hooks/verify-gate.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/verify-gate.js +4 -0
- package/dist/clients/cursor/hooks/verify-gate.js.map +1 -1
- package/dist/clients/cursor/index.d.ts.map +1 -1
- package/dist/clients/cursor/index.js +13 -2
- package/dist/clients/cursor/index.js.map +1 -1
- package/dist/clients/cursor/util.d.ts +52 -0
- package/dist/clients/cursor/util.d.ts.map +1 -0
- package/dist/clients/cursor/util.js +264 -0
- package/dist/clients/cursor/util.js.map +1 -0
- package/dist/commands/analyze.js +3 -3
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/hook.js +1 -2
- package/dist/commands/hook.js.map +1 -1
- package/dist/commands/process-job-file.d.ts +10 -0
- package/dist/commands/process-job-file.d.ts.map +1 -0
- package/dist/commands/process-job-file.js +19 -0
- package/dist/commands/process-job-file.js.map +1 -0
- package/dist/commands/queue.d.ts +12 -0
- package/dist/commands/queue.d.ts.map +1 -0
- package/dist/commands/queue.js +495 -0
- package/dist/commands/queue.js.map +1 -0
- package/dist/hooks/core/actions.d.ts +168 -27
- package/dist/hooks/core/actions.d.ts.map +1 -1
- package/dist/hooks/core/actions.js +81 -4
- package/dist/hooks/core/actions.js.map +1 -1
- package/dist/hooks/core/activity.d.ts.map +1 -1
- package/dist/hooks/core/activity.js +13 -6
- package/dist/hooks/core/activity.js.map +1 -1
- package/dist/hooks/core/session-state.d.ts +19 -7
- package/dist/hooks/core/session-state.d.ts.map +1 -1
- package/dist/hooks/core/session-state.js +66 -12
- package/dist/hooks/core/session-state.js.map +1 -1
- package/dist/hooks/core/submit-verdict.d.ts.map +1 -1
- package/dist/hooks/core/submit-verdict.js +13 -4
- package/dist/hooks/core/submit-verdict.js.map +1 -1
- package/dist/hooks/core/verification-lifecycle.d.ts.map +1 -1
- package/dist/hooks/core/verification-lifecycle.js +14 -4
- package/dist/hooks/core/verification-lifecycle.js.map +1 -1
- package/dist/hooks/core/verify-gate.d.ts.map +1 -1
- package/dist/hooks/core/verify-gate.js +31 -19
- package/dist/hooks/core/verify-gate.js.map +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/collector.d.ts +64 -5
- package/dist/lib/collector.d.ts.map +1 -1
- package/dist/lib/collector.js +107 -44
- package/dist/lib/collector.js.map +1 -1
- package/dist/lib/config.d.ts +72 -8
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +40 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/queue/dead-letter.d.ts +26 -0
- package/dist/queue/dead-letter.d.ts.map +1 -0
- package/dist/queue/dead-letter.js +233 -0
- package/dist/queue/dead-letter.js.map +1 -0
- package/dist/queue/drain.d.ts +36 -0
- package/dist/queue/drain.d.ts.map +1 -0
- package/dist/queue/drain.js +170 -0
- package/dist/queue/drain.js.map +1 -0
- package/dist/queue/flush.d.ts +64 -0
- package/dist/queue/flush.d.ts.map +1 -0
- package/dist/queue/flush.js +119 -0
- package/dist/queue/flush.js.map +1 -0
- package/dist/queue/handlers/send-event.d.ts +23 -0
- package/dist/queue/handlers/send-event.d.ts.map +1 -0
- package/dist/queue/handlers/send-event.js +131 -0
- package/dist/queue/handlers/send-event.js.map +1 -0
- package/dist/queue/index.d.ts +30 -0
- package/dist/queue/index.d.ts.map +1 -0
- package/dist/queue/index.js +71 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/paths.d.ts +40 -0
- package/dist/queue/paths.d.ts.map +1 -0
- package/dist/queue/paths.js +107 -0
- package/dist/queue/paths.js.map +1 -0
- package/dist/queue/process-file.d.ts +22 -0
- package/dist/queue/process-file.d.ts.map +1 -0
- package/dist/queue/process-file.js +257 -0
- package/dist/queue/process-file.js.map +1 -0
- package/dist/queue/register-handlers.d.ts +26 -0
- package/dist/queue/register-handlers.d.ts.map +1 -0
- package/dist/queue/register-handlers.js +36 -0
- package/dist/queue/register-handlers.js.map +1 -0
- package/dist/queue/registry.d.ts +42 -0
- package/dist/queue/registry.d.ts.map +1 -0
- package/dist/queue/registry.js +36 -0
- package/dist/queue/registry.js.map +1 -0
- package/dist/queue/snapshot.d.ts +16 -0
- package/dist/queue/snapshot.d.ts.map +1 -0
- package/dist/queue/snapshot.js +39 -0
- package/dist/queue/snapshot.js.map +1 -0
- package/dist/queue/spawn.d.ts +15 -0
- package/dist/queue/spawn.d.ts.map +1 -0
- package/dist/queue/spawn.js +45 -0
- package/dist/queue/spawn.js.map +1 -0
- package/dist/queue/submit.d.ts +19 -0
- package/dist/queue/submit.d.ts.map +1 -0
- package/dist/queue/submit.js +94 -0
- package/dist/queue/submit.js.map +1 -0
- package/dist/queue/types.d.ts +77 -0
- package/dist/queue/types.d.ts.map +1 -0
- package/dist/queue/types.js +83 -0
- package/dist/queue/types.js.map +1 -0
- package/dist/queue/worker-log.d.ts +21 -0
- package/dist/queue/worker-log.d.ts.map +1 -0
- package/dist/queue/worker-log.js +140 -0
- package/dist/queue/worker-log.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IronBee CLI — Queue submit()
|
|
4
|
+
*
|
|
5
|
+
* See docs/job-queue.md §5.1.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.submit = submit;
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const crypto_1 = require("crypto");
|
|
11
|
+
const types_1 = require("./types");
|
|
12
|
+
const paths_1 = require("./paths");
|
|
13
|
+
const flush_1 = require("./flush");
|
|
14
|
+
const config_1 = require("../lib/config");
|
|
15
|
+
const logger_1 = require("../lib/logger");
|
|
16
|
+
/**
|
|
17
|
+
* Append a job to `<projectDir>/.ironbee/sessions/<sessionId>/queue/jobs.jsonl`
|
|
18
|
+
* via a single O_APPEND write. Returns the job id.
|
|
19
|
+
*
|
|
20
|
+
* Throws:
|
|
21
|
+
* - InvalidSessionIdError if sessionId fails validation
|
|
22
|
+
* - JobTooLargeError if serialized line > 4 KB
|
|
23
|
+
* - IOError on filesystem errors (including short write)
|
|
24
|
+
*/
|
|
25
|
+
function submit(projectDir, sessionId, type, data, opts) {
|
|
26
|
+
(0, paths_1.validateSessionId)(sessionId);
|
|
27
|
+
// Defense-in-depth gate: when the queue is disabled (default), drop the
|
|
28
|
+
// job before touching the filesystem. Callers should already short-circuit
|
|
29
|
+
// before constructing a payload, but this guard stops a stray submit()
|
|
30
|
+
// from creating the queue dir or growing jobs.jsonl needlessly.
|
|
31
|
+
if (!(0, config_1.isJobQueueEnabled)(projectDir)) {
|
|
32
|
+
const id = opts?.id ?? (0, crypto_1.randomUUID)();
|
|
33
|
+
logger_1.logger.debug(`submit: jobQueue disabled, dropping job type=${type} id=${id}`);
|
|
34
|
+
return id;
|
|
35
|
+
}
|
|
36
|
+
const dir = (0, paths_1.queueDir)(projectDir, sessionId);
|
|
37
|
+
try {
|
|
38
|
+
(0, fs_1.mkdirSync)(dir, { recursive: true, mode: 0o700 });
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
throw new types_1.IOError(`failed to mkdir queue dir: ${dir}`, e);
|
|
42
|
+
}
|
|
43
|
+
const id = opts?.id ?? (0, crypto_1.randomUUID)();
|
|
44
|
+
const job = {
|
|
45
|
+
id,
|
|
46
|
+
type,
|
|
47
|
+
created_at: new Date().toISOString(),
|
|
48
|
+
data,
|
|
49
|
+
};
|
|
50
|
+
const line = JSON.stringify(job) + "\n";
|
|
51
|
+
const bytes = Buffer.from(line, "utf-8");
|
|
52
|
+
if (bytes.length > types_1.MAX_LINE_BYTES) {
|
|
53
|
+
throw new types_1.JobTooLargeError(bytes.length);
|
|
54
|
+
}
|
|
55
|
+
const filePath = (0, paths_1.liveQueueFile)(projectDir, sessionId);
|
|
56
|
+
const flags = fs_1.constants.O_CREAT
|
|
57
|
+
| fs_1.constants.O_WRONLY
|
|
58
|
+
| fs_1.constants.O_APPEND
|
|
59
|
+
| (typeof fs_1.constants.O_NOFOLLOW === "number" ? fs_1.constants.O_NOFOLLOW : 0);
|
|
60
|
+
let fd;
|
|
61
|
+
try {
|
|
62
|
+
fd = (0, fs_1.openSync)(filePath, flags, 0o600);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
throw new types_1.IOError(`failed to open ${filePath}`, e);
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
let written;
|
|
69
|
+
try {
|
|
70
|
+
written = (0, fs_1.writeSync)(fd, bytes, 0, bytes.length);
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
// ENOSPC / EIO / etc — wrap to preserve spec §5.1 contract that
|
|
74
|
+
// submit() throws IOError with the underlying errno.
|
|
75
|
+
throw new types_1.IOError(`failed to write to ${filePath}`, e);
|
|
76
|
+
}
|
|
77
|
+
if (written !== bytes.length) {
|
|
78
|
+
throw new types_1.IOError(`short write on ${filePath}: wrote ${written} of ${bytes.length} bytes`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
try {
|
|
83
|
+
(0, fs_1.closeSync)(fd);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// ignore close errors — the write has already landed (or failed)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// size-based auto-flush trigger. Fail-safe: never propagates exceptions
|
|
90
|
+
// to submit()'s caller, the line has already been persisted.
|
|
91
|
+
(0, flush_1.maybeAutoFlush)(projectDir, sessionId);
|
|
92
|
+
return id;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit.js","sourceRoot":"","sources":["../../src/queue/submit.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA4BH,wBA8EC;AAxGD,2BAAyF;AACzF,mCAAoC;AACpC,mCAKiB;AACjB,mCAAqE;AACrE,mCAAyC;AACzC,0CAAkD;AAClD,0CAAuC;AAMvC;;;;;;;;GAQG;AACH,SAAgB,MAAM,CAClB,UAAkB,EAClB,SAAiB,EACjB,IAAY,EACZ,IAAW,EACX,IAAoB;IAEpB,IAAA,yBAAiB,EAAC,SAAS,CAAC,CAAC;IAE7B,wEAAwE;IACxE,2EAA2E;IAC3E,uEAAuE;IACvE,gEAAgE;IAChE,IAAI,CAAC,IAAA,0BAAiB,EAAC,UAAU,CAAC,EAAE,CAAC;QACjC,MAAM,EAAE,GAAW,IAAI,EAAE,EAAE,IAAI,IAAA,mBAAU,GAAE,CAAC;QAC5C,eAAM,CAAC,KAAK,CAAC,gDAAgD,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;QAC9E,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,GAAG,GAAW,IAAA,gBAAQ,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACpD,IAAI,CAAC;QACD,IAAA,cAAS,EAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,CAAU,EAAE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EAAE,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YAClB,gEAAgE;YAChE,qDAAqD;YACrD,MAAM,IAAI,eAAO,CAAC,sBAAsB,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;YAC3B,MAAM,IAAI,eAAO,CAAC,kBAAkB,QAAQ,WAAW,OAAO,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC;QAC/F,CAAC;IACL,CAAC;YAAS,CAAC;QACP,IAAI,CAAC;YACD,IAAA,cAAS,EAAC,EAAE,CAAC,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACL,iEAAiE;QACrE,CAAC;IACL,CAAC;IAED,wEAAwE;IACxE,6DAA6D;IAC7D,IAAA,sBAAc,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAEtC,OAAO,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IronBee CLI — Queue Types & Errors
|
|
3
|
+
*
|
|
4
|
+
* See docs/job-queue.md §4 (job format), §6 (error classification).
|
|
5
|
+
*/
|
|
6
|
+
export declare class InvalidSessionIdError extends Error {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
export declare class JobTooLargeError extends Error {
|
|
10
|
+
readonly sizeBytes: number;
|
|
11
|
+
constructor(sizeBytes: number);
|
|
12
|
+
}
|
|
13
|
+
export declare class IOError extends Error {
|
|
14
|
+
readonly cause?: unknown;
|
|
15
|
+
constructor(message: string, cause?: unknown);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Handler throws this on transient failures (network timeout, 5xx, 429).
|
|
19
|
+
* Worker leaves the snapshot on disk for later retry.
|
|
20
|
+
*/
|
|
21
|
+
export declare class TransientError extends Error {
|
|
22
|
+
constructor(message: string);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Handler throws this on auth failures (401, 403, expired credential).
|
|
26
|
+
* Worker leaves the snapshot on disk and logs an operator-actionable error.
|
|
27
|
+
*/
|
|
28
|
+
export declare class AuthError extends Error {
|
|
29
|
+
constructor(message: string);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Handler's batch `dispatch()` throws this when the downstream rejected the
|
|
33
|
+
* batch but we don't know which line caused it — worker falls back to
|
|
34
|
+
* per-job `dispatchSingle()`.
|
|
35
|
+
*/
|
|
36
|
+
export declare class BadRequestBatchError extends Error {
|
|
37
|
+
constructor(message: string);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Handler's `dispatchSingle()` throws this on a permanent per-job failure
|
|
41
|
+
* (400 for this specific job). Worker dead-letters the job and continues.
|
|
42
|
+
*/
|
|
43
|
+
export declare class BadRequestError extends Error {
|
|
44
|
+
constructor(message: string);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Job envelope — exactly three queue-owned top-level fields plus the opaque
|
|
48
|
+
* `data` payload. Mirrors the spec's §4 schema.
|
|
49
|
+
*/
|
|
50
|
+
export interface Job<TData = unknown> {
|
|
51
|
+
id: string;
|
|
52
|
+
type: string;
|
|
53
|
+
created_at: string;
|
|
54
|
+
data: TData;
|
|
55
|
+
}
|
|
56
|
+
export interface DeadLetterParsed {
|
|
57
|
+
id: string;
|
|
58
|
+
received_at: string;
|
|
59
|
+
source_file: string;
|
|
60
|
+
category: string;
|
|
61
|
+
original: Job;
|
|
62
|
+
}
|
|
63
|
+
export interface DeadLetterParseError {
|
|
64
|
+
id: string;
|
|
65
|
+
received_at: string;
|
|
66
|
+
source_file: string;
|
|
67
|
+
category: string;
|
|
68
|
+
raw: string;
|
|
69
|
+
}
|
|
70
|
+
export type DeadLetterEntry = DeadLetterParsed | DeadLetterParseError;
|
|
71
|
+
export declare const MAX_LINE_BYTES: number;
|
|
72
|
+
export declare const DEAD_LETTER_ROTATE_BYTES: number;
|
|
73
|
+
export declare const DEAD_LETTER_RETAIN_COUNT: number;
|
|
74
|
+
export declare const WORKER_LOG_ROTATE_BYTES: number;
|
|
75
|
+
export declare const WORKER_LOG_RETAIN_COUNT: number;
|
|
76
|
+
export declare const DEAD_LETTER_RAW_MAX: number;
|
|
77
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/queue/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qBAAa,qBAAsB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI9B;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACvC,SAAgB,SAAS,EAAE,MAAM,CAAC;gBACtB,SAAS,EAAE,MAAM;CAKhC;AAED,qBAAa,OAAQ,SAAQ,KAAK;IAC9B,SAAgB,KAAK,CAAC,EAAE,OAAO,CAAC;gBACpB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAK/C;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI9B;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACpB,OAAO,EAAE,MAAM;CAI9B;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI9B;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI9B;AAED;;;GAGG;AACH,MAAM,WAAW,GAAG,CAAC,KAAK,GAAG,OAAO;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,GAAG,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAEtE,eAAO,MAAM,cAAc,EAAE,MAAa,CAAC;AAC3C,eAAO,MAAM,wBAAwB,EAAE,MAAyB,CAAC;AACjE,eAAO,MAAM,wBAAwB,EAAE,MAAU,CAAC;AAClD,eAAO,MAAM,uBAAuB,EAAE,MAAyB,CAAC;AAChE,eAAO,MAAM,uBAAuB,EAAE,MAAU,CAAC;AACjD,eAAO,MAAM,mBAAmB,EAAE,MAAY,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IronBee CLI — Queue Types & Errors
|
|
4
|
+
*
|
|
5
|
+
* See docs/job-queue.md §4 (job format), §6 (error classification).
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.DEAD_LETTER_RAW_MAX = exports.WORKER_LOG_RETAIN_COUNT = exports.WORKER_LOG_ROTATE_BYTES = exports.DEAD_LETTER_RETAIN_COUNT = exports.DEAD_LETTER_ROTATE_BYTES = exports.MAX_LINE_BYTES = exports.BadRequestError = exports.BadRequestBatchError = exports.AuthError = exports.TransientError = exports.IOError = exports.JobTooLargeError = exports.InvalidSessionIdError = void 0;
|
|
9
|
+
class InvalidSessionIdError extends Error {
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "InvalidSessionIdError";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.InvalidSessionIdError = InvalidSessionIdError;
|
|
16
|
+
class JobTooLargeError extends Error {
|
|
17
|
+
constructor(sizeBytes) {
|
|
18
|
+
super(`job line exceeds 4 KB limit (${sizeBytes} bytes)`);
|
|
19
|
+
this.name = "JobTooLargeError";
|
|
20
|
+
this.sizeBytes = sizeBytes;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.JobTooLargeError = JobTooLargeError;
|
|
24
|
+
class IOError extends Error {
|
|
25
|
+
constructor(message, cause) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.name = "IOError";
|
|
28
|
+
this.cause = cause;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.IOError = IOError;
|
|
32
|
+
/**
|
|
33
|
+
* Handler throws this on transient failures (network timeout, 5xx, 429).
|
|
34
|
+
* Worker leaves the snapshot on disk for later retry.
|
|
35
|
+
*/
|
|
36
|
+
class TransientError extends Error {
|
|
37
|
+
constructor(message) {
|
|
38
|
+
super(message);
|
|
39
|
+
this.name = "TransientError";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.TransientError = TransientError;
|
|
43
|
+
/**
|
|
44
|
+
* Handler throws this on auth failures (401, 403, expired credential).
|
|
45
|
+
* Worker leaves the snapshot on disk and logs an operator-actionable error.
|
|
46
|
+
*/
|
|
47
|
+
class AuthError extends Error {
|
|
48
|
+
constructor(message) {
|
|
49
|
+
super(message);
|
|
50
|
+
this.name = "AuthError";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.AuthError = AuthError;
|
|
54
|
+
/**
|
|
55
|
+
* Handler's batch `dispatch()` throws this when the downstream rejected the
|
|
56
|
+
* batch but we don't know which line caused it — worker falls back to
|
|
57
|
+
* per-job `dispatchSingle()`.
|
|
58
|
+
*/
|
|
59
|
+
class BadRequestBatchError extends Error {
|
|
60
|
+
constructor(message) {
|
|
61
|
+
super(message);
|
|
62
|
+
this.name = "BadRequestBatchError";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.BadRequestBatchError = BadRequestBatchError;
|
|
66
|
+
/**
|
|
67
|
+
* Handler's `dispatchSingle()` throws this on a permanent per-job failure
|
|
68
|
+
* (400 for this specific job). Worker dead-letters the job and continues.
|
|
69
|
+
*/
|
|
70
|
+
class BadRequestError extends Error {
|
|
71
|
+
constructor(message) {
|
|
72
|
+
super(message);
|
|
73
|
+
this.name = "BadRequestError";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.BadRequestError = BadRequestError;
|
|
77
|
+
exports.MAX_LINE_BYTES = 4096;
|
|
78
|
+
exports.DEAD_LETTER_ROTATE_BYTES = 10 * 1024 * 1024;
|
|
79
|
+
exports.DEAD_LETTER_RETAIN_COUNT = 3;
|
|
80
|
+
exports.WORKER_LOG_ROTATE_BYTES = 10 * 1024 * 1024;
|
|
81
|
+
exports.WORKER_LOG_RETAIN_COUNT = 5;
|
|
82
|
+
exports.DEAD_LETTER_RAW_MAX = 512;
|
|
83
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/queue/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,MAAa,qBAAsB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACxC,CAAC;CACJ;AALD,sDAKC;AAED,MAAa,gBAAiB,SAAQ,KAAK;IAEvC,YAAY,SAAiB;QACzB,KAAK,CAAC,gCAAgC,SAAS,SAAS,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;CACJ;AAPD,4CAOC;AAED,MAAa,OAAQ,SAAQ,KAAK;IAE9B,YAAY,OAAe,EAAE,KAAe;QAC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ue.md §8.1.
|
|
5
|
+
*/
|
|
6
|
+
export type WorkerLogLevel = "INFO" | "WARN" | "ERROR" | "DEBUG";
|
|
7
|
+
export declare class WorkerLog {
|
|
8
|
+
private readonly projectDir;
|
|
9
|
+
private readonly sessionId;
|
|
10
|
+
constructor(projectDir: string, sessionId: string);
|
|
11
|
+
info(msg: string): void;
|
|
12
|
+
warn(msg: string): void;
|
|
13
|
+
error(msg: string): void;
|
|
14
|
+
debug(msg: string): void;
|
|
15
|
+
private write;
|
|
16
|
+
private format;
|
|
17
|
+
private appendLine;
|
|
18
|
+
private rotateIfNeeded;
|
|
19
|
+
private enforceRetention;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=worker-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-log.d.ts","sourceRoot":"","sources":["../../src/queue/worker-log.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjE,qBAAa,SAAS;IAClB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAK1C,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IACvB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IACvB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IACxB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAE/B,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,MAAM;IAqBd,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,cAAc;IA0BtB,OAAO,CAAC,gBAAgB;CAmC3B"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IronBee CLI — Worker Log + Rotation
|
|
4
|
+
*
|
|
5
|
+
* See docs/job-queue.md §8.1.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.WorkerLog = void 0;
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const crypto_1 = require("crypto");
|
|
12
|
+
const string_decoder_1 = require("string_decoder");
|
|
13
|
+
const types_1 = require("./types");
|
|
14
|
+
const paths_1 = require("./paths");
|
|
15
|
+
class WorkerLog {
|
|
16
|
+
constructor(projectDir, sessionId) {
|
|
17
|
+
this.projectDir = projectDir;
|
|
18
|
+
this.sessionId = sessionId;
|
|
19
|
+
}
|
|
20
|
+
info(msg) { this.write("INFO", msg); }
|
|
21
|
+
warn(msg) { this.write("WARN", msg); }
|
|
22
|
+
error(msg) { this.write("ERROR", msg); }
|
|
23
|
+
debug(msg) { this.write("DEBUG", msg); }
|
|
24
|
+
write(level, msg) {
|
|
25
|
+
try {
|
|
26
|
+
const line = this.format(level, msg);
|
|
27
|
+
this.appendLine(line);
|
|
28
|
+
this.rotateIfNeeded();
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// worker log failures are never fatal
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
format(level, msg) {
|
|
35
|
+
const timestamp = new Date().toISOString();
|
|
36
|
+
let line = `${timestamp} [${level}] ${msg}\n`;
|
|
37
|
+
const bytes = Buffer.from(line, "utf-8");
|
|
38
|
+
if (bytes.length <= types_1.MAX_LINE_BYTES) {
|
|
39
|
+
return line;
|
|
40
|
+
}
|
|
41
|
+
// truncate msg to fit under 4 KB with an ellipsis marker. Use
|
|
42
|
+
// StringDecoder so a multi-byte UTF-8 codepoint at the budget
|
|
43
|
+
// boundary is dropped cleanly instead of producing U+FFFD.
|
|
44
|
+
const prefix = `${timestamp} [${level}] `;
|
|
45
|
+
const budget = types_1.MAX_LINE_BYTES - Buffer.byteLength(prefix, "utf-8") - Buffer.byteLength("…\n", "utf-8");
|
|
46
|
+
const safeBudget = Math.max(0, budget);
|
|
47
|
+
const decoder = new string_decoder_1.StringDecoder("utf-8");
|
|
48
|
+
const truncated = decoder.write(Buffer.from(msg, "utf-8").subarray(0, safeBudget));
|
|
49
|
+
// intentionally skip decoder.end() — we want to DROP any incomplete
|
|
50
|
+
// trailing codepoint, not emit a replacement char.
|
|
51
|
+
line = `${prefix}${truncated}…\n`;
|
|
52
|
+
return line;
|
|
53
|
+
}
|
|
54
|
+
appendLine(line) {
|
|
55
|
+
const dir = (0, paths_1.queueDir)(this.projectDir, this.sessionId);
|
|
56
|
+
(0, fs_1.mkdirSync)(dir, { recursive: true, mode: 0o700 });
|
|
57
|
+
const path = (0, paths_1.workerLogFile)(this.projectDir, this.sessionId);
|
|
58
|
+
const flags = fs_1.constants.O_CREAT
|
|
59
|
+
| fs_1.constants.O_WRONLY
|
|
60
|
+
| fs_1.constants.O_APPEND
|
|
61
|
+
| (typeof fs_1.constants.O_NOFOLLOW === "number" ? fs_1.constants.O_NOFOLLOW : 0);
|
|
62
|
+
const fd = (0, fs_1.openSync)(path, flags, 0o600);
|
|
63
|
+
try {
|
|
64
|
+
const bytes = Buffer.from(line, "utf-8");
|
|
65
|
+
(0, fs_1.writeSync)(fd, bytes, 0, bytes.length);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
try {
|
|
69
|
+
(0, fs_1.closeSync)(fd);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// ignore
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
rotateIfNeeded() {
|
|
77
|
+
const path = (0, paths_1.workerLogFile)(this.projectDir, this.sessionId);
|
|
78
|
+
let size;
|
|
79
|
+
try {
|
|
80
|
+
size = (0, fs_1.statSync)(path).size;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (size <= types_1.WORKER_LOG_ROTATE_BYTES) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const dir = (0, paths_1.queueDir)(this.projectDir, this.sessionId);
|
|
89
|
+
const rotated = (0, path_1.join)(dir, `worker-${(0, crypto_1.randomUUID)()}.log`);
|
|
90
|
+
try {
|
|
91
|
+
(0, fs_1.renameSync)(path, rotated);
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
const err = e;
|
|
95
|
+
if (err.code === "ENOENT") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
this.enforceRetention();
|
|
101
|
+
}
|
|
102
|
+
enforceRetention() {
|
|
103
|
+
const dir = (0, paths_1.queueDir)(this.projectDir, this.sessionId);
|
|
104
|
+
let entries;
|
|
105
|
+
try {
|
|
106
|
+
entries = (0, fs_1.readdirSync)(dir);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const rotated = [];
|
|
112
|
+
for (const name of entries) {
|
|
113
|
+
if (!paths_1.WORKER_LOG_ROTATED_REGEX.test(name)) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const full = (0, path_1.join)(dir, name);
|
|
117
|
+
try {
|
|
118
|
+
const st = (0, fs_1.statSync)(full);
|
|
119
|
+
rotated.push({ path: full, mtimeMs: st.mtimeMs });
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
// ignore
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (rotated.length <= types_1.WORKER_LOG_RETAIN_COUNT) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
rotated.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
129
|
+
for (let i = types_1.WORKER_LOG_RETAIN_COUNT; i < rotated.length; i++) {
|
|
130
|
+
try {
|
|
131
|
+
(0, fs_1.unlinkSync)(rotated[i].path);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
// ignore
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.WorkerLog = WorkerLog;
|
|
140
|
+
//# sourceMappingURL=worker-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-log.js","sourceRoot":"","sources":["../../src/queue/worker-log.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,2BAUY;AACZ,+BAA4B;AAC5B,mCAAoC;AACpC,mDAA+C;AAC/C,mCAIiB;AACjB,mCAA4E;AAI5E,MAAa,SAAS;IAIlB,YAAY,UAAkB,EAAE,SAAiB;QAC7C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IAEM,IAAI,CAAC,GAAW,IAAU,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACpD,IAAI,CAAC,GAAW,IAAU,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACpD,KAAK,CAAC,GAAW,IAAU,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,KAAK,CAAC,GAAW,IAAU,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAErD,KAAK,CAAC,KAAqB,EAAE,GAAW;QAC5C,IAAI,CAAC;YACD,MAAM,IAAI,GAAW,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACL,sCAAsC;QAC1C,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,KAAqB,EAAE,GAAW;QAC7C,MAA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