@drisp/cli 0.5.1 → 0.5.4
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/dist/{WorkflowInstallWizard-X754ND4V.js → WorkflowInstallWizard-7Y5PWAKW.js} +2 -2
- package/dist/athena-gateway.js +4113 -4
- package/dist/{chunk-A54HGVML.js → chunk-7E54JMXH.js} +126 -114
- package/dist/{chunk-PEBITVZQ.js → chunk-QVXHUJPH.js} +1944 -1117
- package/dist/cli.js +21 -380
- package/dist/dashboard-daemon.js +103 -8
- package/package.json +1 -1
- package/dist/chunk-2OJ3GGIP.js +0 -104
- package/dist/chunk-OB4HZXR5.js +0 -4124
- package/dist/chunk-ZVOGOZNT.js +0 -395
- package/dist/supervisor.js +0 -692
package/dist/chunk-2OJ3GGIP.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
// src/infra/daemon/logFile.ts
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
var DEFAULT_MAX_BYTES = 5 * 1024 * 1024;
|
|
5
|
-
var DEFAULT_MAX_FILES = 5;
|
|
6
|
-
function openDaemonLog(logPath, options = {}) {
|
|
7
|
-
const maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;
|
|
8
|
-
const maxFiles = options.maxFiles ?? DEFAULT_MAX_FILES;
|
|
9
|
-
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
10
|
-
fs.mkdirSync(path.dirname(logPath), { recursive: true, mode: 448 });
|
|
11
|
-
let fd = fs.openSync(logPath, "a", 384);
|
|
12
|
-
if (process.platform !== "win32") {
|
|
13
|
-
try {
|
|
14
|
-
fs.chmodSync(logPath, 384);
|
|
15
|
-
} catch {
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function rotate() {
|
|
19
|
-
try {
|
|
20
|
-
fs.closeSync(fd);
|
|
21
|
-
} catch {
|
|
22
|
-
}
|
|
23
|
-
for (let i = maxFiles - 1; i >= 1; i -= 1) {
|
|
24
|
-
const src = `${logPath}.${i}`;
|
|
25
|
-
const dst = `${logPath}.${i + 1}`;
|
|
26
|
-
try {
|
|
27
|
-
fs.renameSync(src, dst);
|
|
28
|
-
} catch (err) {
|
|
29
|
-
if (err.code !== "ENOENT") {
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
try {
|
|
34
|
-
fs.renameSync(logPath, `${logPath}.1`);
|
|
35
|
-
} catch (err) {
|
|
36
|
-
if (err.code !== "ENOENT") {
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
fd = fs.openSync(logPath, "a", 384);
|
|
40
|
-
if (process.platform !== "win32") {
|
|
41
|
-
try {
|
|
42
|
-
fs.chmodSync(logPath, 384);
|
|
43
|
-
} catch {
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function write(level, message) {
|
|
48
|
-
const line = `${now().toISOString()} ${level.toUpperCase()} ${redactSecrets(message)}
|
|
49
|
-
`;
|
|
50
|
-
const buf = Buffer.from(line, "utf-8");
|
|
51
|
-
let stat = null;
|
|
52
|
-
try {
|
|
53
|
-
stat = fs.fstatSync(fd);
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
if (stat && stat.size + buf.length > maxBytes) {
|
|
57
|
-
rotate();
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
fs.writeSync(fd, buf);
|
|
61
|
-
} catch {
|
|
62
|
-
try {
|
|
63
|
-
fs.closeSync(fd);
|
|
64
|
-
} catch {
|
|
65
|
-
}
|
|
66
|
-
try {
|
|
67
|
-
fd = fs.openSync(logPath, "a", 384);
|
|
68
|
-
fs.writeSync(fd, buf);
|
|
69
|
-
} catch {
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function close() {
|
|
74
|
-
try {
|
|
75
|
-
fs.closeSync(fd);
|
|
76
|
-
} catch {
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return { write, close, path: logPath };
|
|
80
|
-
}
|
|
81
|
-
var SECRET_PATTERNS = [
|
|
82
|
-
[/Bearer\s+[A-Za-z0-9._\-+/=]+/g, "Bearer ***"],
|
|
83
|
-
[
|
|
84
|
-
/(["']?(?:access|refresh)_?token["']?\s*[:=]\s*)["']?[A-Za-z0-9._\-+/=]+/gi,
|
|
85
|
-
'$1"***"'
|
|
86
|
-
],
|
|
87
|
-
[/(Sec-WebSocket-Protocol:\s*)\S+/gi, "$1***"],
|
|
88
|
-
[
|
|
89
|
-
/eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{4,}/g,
|
|
90
|
-
"***.***.***"
|
|
91
|
-
]
|
|
92
|
-
];
|
|
93
|
-
function redactSecrets(message) {
|
|
94
|
-
let out = message;
|
|
95
|
-
for (const [pattern, replacement] of SECRET_PATTERNS) {
|
|
96
|
-
out = out.replace(pattern, replacement);
|
|
97
|
-
}
|
|
98
|
-
return out;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export {
|
|
102
|
-
openDaemonLog
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=chunk-2OJ3GGIP.js.map
|