leakshield 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +546 -2
- package/README.zh-TW.md +565 -0
- package/dist/cli.js +61 -0
- package/dist/config/loader.js +94 -0
- package/dist/decision/deidentify.js +195 -0
- package/dist/decision/ingress.js +136 -0
- package/dist/decision/mapping-key.js +318 -0
- package/dist/decision/mapping-store.js +555 -0
- package/dist/decision/model.js +76 -0
- package/dist/decision/pseudonymization.js +1230 -0
- package/dist/decision/redaction.js +185 -0
- package/dist/decision/schema-strings.js +42 -0
- package/dist/doctor.js +438 -0
- package/dist/env-queries.js +584 -0
- package/dist/forget.js +56 -0
- package/dist/help.js +37 -0
- package/dist/i18n/en.js +71 -0
- package/dist/i18n/index.js +28 -0
- package/dist/i18n/zh-TW.js +71 -0
- package/dist/index.js +12 -0
- package/dist/opencode-env-tools.js +243 -0
- package/dist/opencode-hooks.js +84 -0
- package/dist/opencode-transparent-aisdk.js +100 -0
- package/dist/opencode-transparent-http.js +2315 -0
- package/dist/opencode-transparent-stream.js +192 -0
- package/dist/opencode-transparent-ws.js +298 -0
- package/dist/opencode-transparent.js +1492 -0
- package/dist/opencode-v2.js +216 -0
- package/dist/opencode.js +175 -0
- package/dist/plugin-options.js +100 -0
- package/dist/rules/builtin.js +283 -0
- package/dist/rules/dynamic.js +68 -0
- package/dist/scanner/encoding.js +274 -0
- package/dist/scanner/engine.js +321 -0
- package/dist/scanner/exact-values.js +99 -0
- package/dist/scanner/redaction-verifier.js +82 -0
- package/dist/scanner/unicode.js +157 -0
- package/dist/scanner/utils.js +60 -0
- package/dist/transports/cli.js +447 -0
- package/dist/transports/web-ui.js +540 -0
- package/dist/transports/web.js +200 -0
- package/dist/types.js +23 -0
- package/dist/utils/files.js +36 -0
- package/dist/utils/path-security.js +30 -0
- package/dist/utils/win-encoding.js +45 -0
- package/package.json +71 -4
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import * as http from "node:http";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { loadConfig } from "../config/loader.js";
|
|
5
|
+
import { toDecisionResult } from "../decision/model.js";
|
|
6
|
+
import { t } from "../i18n/index.js";
|
|
7
|
+
import { scanText } from "../scanner/engine.js";
|
|
8
|
+
import { redactAndVerify } from "../scanner/redaction-verifier.js";
|
|
9
|
+
import { WEB_UI_HTML } from "./web-ui.js";
|
|
10
|
+
const MAX_BODY_BYTES = 512 * 1024;
|
|
11
|
+
const BODY_TIMEOUT_MS = 10_000;
|
|
12
|
+
const RATE_LIMIT_MAX = 60;
|
|
13
|
+
const RATE_LIMIT_WINDOW_MS = 60_000;
|
|
14
|
+
const scanRequestSchema = z.object({
|
|
15
|
+
content: z.string().refine((value) => value.trim().length > 0),
|
|
16
|
+
});
|
|
17
|
+
const rateLimitMap = new Map();
|
|
18
|
+
const inlineScript = WEB_UI_HTML.match(/<script>([\s\S]*?)<\/script>/)?.[1];
|
|
19
|
+
const inlineStyle = WEB_UI_HTML.match(/<style>([\s\S]*?)<\/style>/)?.[1];
|
|
20
|
+
if (inlineScript === undefined || inlineStyle === undefined) {
|
|
21
|
+
throw new Error("Web UI inline script or style not found");
|
|
22
|
+
}
|
|
23
|
+
const inlineScriptHash = createHash("sha256")
|
|
24
|
+
.update(inlineScript, "utf8")
|
|
25
|
+
.digest("base64");
|
|
26
|
+
const inlineStyleHash = createHash("sha256")
|
|
27
|
+
.update(inlineStyle, "utf8")
|
|
28
|
+
.digest("base64");
|
|
29
|
+
const SECURITY_HEADERS = {
|
|
30
|
+
"Cache-Control": "no-store",
|
|
31
|
+
"Content-Security-Policy": [
|
|
32
|
+
"default-src 'none'",
|
|
33
|
+
"base-uri 'none'",
|
|
34
|
+
"child-src 'none'",
|
|
35
|
+
"connect-src 'self'",
|
|
36
|
+
"font-src 'none'",
|
|
37
|
+
"form-action 'none'",
|
|
38
|
+
"frame-ancestors 'none'",
|
|
39
|
+
"frame-src 'none'",
|
|
40
|
+
"img-src 'none'",
|
|
41
|
+
"manifest-src 'none'",
|
|
42
|
+
"media-src 'none'",
|
|
43
|
+
"object-src 'none'",
|
|
44
|
+
`script-src 'sha256-${inlineScriptHash}'`,
|
|
45
|
+
`script-src-elem 'sha256-${inlineScriptHash}'`,
|
|
46
|
+
"script-src-attr 'none'",
|
|
47
|
+
`style-src 'sha256-${inlineStyleHash}'`,
|
|
48
|
+
`style-src-elem 'sha256-${inlineStyleHash}'`,
|
|
49
|
+
"style-src-attr 'none'",
|
|
50
|
+
"worker-src 'none'",
|
|
51
|
+
"require-trusted-types-for 'script'",
|
|
52
|
+
"trusted-types 'none'",
|
|
53
|
+
].join("; "),
|
|
54
|
+
"Cross-Origin-Resource-Policy": "same-origin",
|
|
55
|
+
"Permissions-Policy": "camera=(), geolocation=(), microphone=()",
|
|
56
|
+
"Referrer-Policy": "no-referrer",
|
|
57
|
+
"X-Content-Type-Options": "nosniff",
|
|
58
|
+
"X-Frame-Options": "DENY",
|
|
59
|
+
};
|
|
60
|
+
function isAllowedHost(host) {
|
|
61
|
+
if (!host)
|
|
62
|
+
return false;
|
|
63
|
+
const hostname = host.startsWith("[")
|
|
64
|
+
? host.slice(1, host.indexOf("]"))
|
|
65
|
+
: host.split(":", 1)[0];
|
|
66
|
+
const lower = hostname.toLowerCase();
|
|
67
|
+
return lower === "127.0.0.1" || lower === "localhost" || lower === "::1";
|
|
68
|
+
}
|
|
69
|
+
function isRateLimited(ip) {
|
|
70
|
+
const now = Date.now();
|
|
71
|
+
const activeRequests = (rateLimitMap.get(ip) ?? []).filter((timestamp) => now - timestamp < RATE_LIMIT_WINDOW_MS);
|
|
72
|
+
if (activeRequests.length === 0) {
|
|
73
|
+
rateLimitMap.delete(ip);
|
|
74
|
+
}
|
|
75
|
+
if (activeRequests.length >= RATE_LIMIT_MAX)
|
|
76
|
+
return true;
|
|
77
|
+
rateLimitMap.set(ip, [...activeRequests, now]);
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
function writeJson(res, status, body) {
|
|
81
|
+
res.writeHead(status, {
|
|
82
|
+
...SECURITY_HEADERS,
|
|
83
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
84
|
+
});
|
|
85
|
+
res.end(JSON.stringify(body));
|
|
86
|
+
}
|
|
87
|
+
function writeError(res, status, message) {
|
|
88
|
+
if (res.headersSent || res.destroyed)
|
|
89
|
+
return;
|
|
90
|
+
writeJson(res, status, { error: message });
|
|
91
|
+
}
|
|
92
|
+
function handleScanRequest(req, res, config) {
|
|
93
|
+
const ip = req.socket.remoteAddress ?? "unknown";
|
|
94
|
+
if (isRateLimited(ip)) {
|
|
95
|
+
writeError(res, 429, "請稍後再試:每分鐘最多掃描 60 次");
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!req.headers["content-type"]?.toLowerCase().startsWith("application/json")) {
|
|
99
|
+
writeError(res, 415, "Content-Type 必須是 application/json");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const contentLength = Number.parseInt(req.headers["content-length"] ?? "0", 10);
|
|
103
|
+
if (Number.isFinite(contentLength) && contentLength > MAX_BODY_BYTES) {
|
|
104
|
+
writeError(res, 413, "內容超過 512 KB 上限");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const chunks = [];
|
|
108
|
+
let received = 0;
|
|
109
|
+
let complete = false;
|
|
110
|
+
const timer = setTimeout(() => {
|
|
111
|
+
if (complete)
|
|
112
|
+
return;
|
|
113
|
+
complete = true;
|
|
114
|
+
writeError(res, 408, "請求逾時");
|
|
115
|
+
req.destroy();
|
|
116
|
+
}, BODY_TIMEOUT_MS);
|
|
117
|
+
req.on("data", (chunk) => {
|
|
118
|
+
if (complete)
|
|
119
|
+
return;
|
|
120
|
+
received += chunk.length;
|
|
121
|
+
if (received > MAX_BODY_BYTES) {
|
|
122
|
+
complete = true;
|
|
123
|
+
clearTimeout(timer);
|
|
124
|
+
writeError(res, 413, "內容超過 512 KB 上限");
|
|
125
|
+
req.destroy();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
chunks.push(chunk);
|
|
129
|
+
});
|
|
130
|
+
req.on("end", () => {
|
|
131
|
+
if (complete)
|
|
132
|
+
return;
|
|
133
|
+
complete = true;
|
|
134
|
+
clearTimeout(timer);
|
|
135
|
+
try {
|
|
136
|
+
const parsedJson = JSON.parse(Buffer.concat(chunks).toString("utf-8"));
|
|
137
|
+
const parsedRequest = scanRequestSchema.safeParse(parsedJson);
|
|
138
|
+
if (!parsedRequest.success) {
|
|
139
|
+
writeError(res, 400, "content 必須是非空字串");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const { content } = parsedRequest.data;
|
|
143
|
+
const scan = scanText(content, config);
|
|
144
|
+
const { originalContent: _originalContent, safePreview: _safePreview, ...decision } = toDecisionResult(scan, content, config);
|
|
145
|
+
const redaction = scan.findings.length > 0
|
|
146
|
+
? redactAndVerify(content, config)
|
|
147
|
+
: undefined;
|
|
148
|
+
writeJson(res, 200, {
|
|
149
|
+
...decision,
|
|
150
|
+
redactedContent: redaction?.redacted,
|
|
151
|
+
redactionVerified: redaction?.verified,
|
|
152
|
+
residualFindings: redaction?.residualFindings,
|
|
153
|
+
wasTruncated: redaction?.wasTruncated ?? scan.was_truncated ?? false,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
writeError(res, 400, "無效的 JSON 內容");
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
req.on("error", () => {
|
|
161
|
+
complete = true;
|
|
162
|
+
clearTimeout(timer);
|
|
163
|
+
if (!res.headersSent && !res.destroyed)
|
|
164
|
+
res.destroy();
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
export function createWebServer() {
|
|
168
|
+
const config = loadConfig();
|
|
169
|
+
return http.createServer((req, res) => {
|
|
170
|
+
if (!isAllowedHost(req.headers.host)) {
|
|
171
|
+
writeError(res, 403, "不允許的 Host");
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (req.method === "GET" && req.url === "/") {
|
|
175
|
+
res.writeHead(200, {
|
|
176
|
+
...SECURITY_HEADERS,
|
|
177
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
178
|
+
});
|
|
179
|
+
res.end(WEB_UI_HTML);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (req.method === "POST" && req.url === "/scan") {
|
|
183
|
+
handleScanRequest(req, res, config);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
writeError(res, 404, "找不到資源");
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
export async function runWeb(port) {
|
|
190
|
+
const server = createWebServer();
|
|
191
|
+
await new Promise((resolve, reject) => {
|
|
192
|
+
server.once("error", reject);
|
|
193
|
+
server.listen(port, "127.0.0.1", () => {
|
|
194
|
+
console.log(t("web.server_title"));
|
|
195
|
+
console.log(t("web.server_url", { port }));
|
|
196
|
+
console.log(t("web.server_stop"));
|
|
197
|
+
resolve();
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-closed enumeration (R-round F1.2): the SGP2 category whitelist is
|
|
3
|
+
* enforced at persisted-seed intake, so the legal labels must exist as a
|
|
4
|
+
* value, not just a type. Keep list and type in one place.
|
|
5
|
+
*/
|
|
6
|
+
export const FINDING_TYPES = [
|
|
7
|
+
"API_KEY",
|
|
8
|
+
"SECRET",
|
|
9
|
+
"TOKEN",
|
|
10
|
+
"PII_EMAIL",
|
|
11
|
+
"PII_PHONE_TW",
|
|
12
|
+
"PII_PHONE_INTL",
|
|
13
|
+
"PII_ID_TW",
|
|
14
|
+
"DB_CONNECTION",
|
|
15
|
+
"PRIVATE_DOMAIN",
|
|
16
|
+
"NDA_KEYWORD",
|
|
17
|
+
"ENV_SECRET",
|
|
18
|
+
"CUSTOM",
|
|
19
|
+
"PII_CREDIT_CARD",
|
|
20
|
+
"PII_IBAN",
|
|
21
|
+
"PII_IP",
|
|
22
|
+
"PII_URL",
|
|
23
|
+
];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
// Run tasks with at most `limit` concurrent executions.
|
|
4
|
+
export async function runWithConcurrency(tasks, limit) {
|
|
5
|
+
const results = new Array(tasks.length);
|
|
6
|
+
let next = 0;
|
|
7
|
+
async function worker() {
|
|
8
|
+
while (next < tasks.length) {
|
|
9
|
+
const i = next++;
|
|
10
|
+
results[i] = await tasks[i]();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
await Promise.all(Array.from({ length: Math.min(limit, tasks.length) }, worker));
|
|
14
|
+
return results;
|
|
15
|
+
}
|
|
16
|
+
export const SKIP_DIRS = new Set(["node_modules", ".git", "dist", "build", ".next", "__pycache__"]);
|
|
17
|
+
export function collectFiles(dir, extensions, maxFiles = 100) {
|
|
18
|
+
const files = [];
|
|
19
|
+
function walk(d) {
|
|
20
|
+
if (files.length >= maxFiles)
|
|
21
|
+
return;
|
|
22
|
+
for (const entry of fs.readdirSync(d, { withFileTypes: true })) {
|
|
23
|
+
if (files.length >= maxFiles)
|
|
24
|
+
break;
|
|
25
|
+
if (entry.isDirectory() && !SKIP_DIRS.has(entry.name))
|
|
26
|
+
walk(path.join(d, entry.name));
|
|
27
|
+
else if (entry.isFile()) {
|
|
28
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
29
|
+
if (!extensions || extensions.includes(ext))
|
|
30
|
+
files.push(path.join(d, entry.name));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
walk(dir);
|
|
35
|
+
return files;
|
|
36
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve an inputPath relative to baseDir (does NOT call realpathSync —
|
|
4
|
+
* safe to call for paths that may not exist yet).
|
|
5
|
+
*/
|
|
6
|
+
export function resolveWorkspacePath(baseDir, inputPath) {
|
|
7
|
+
return path.resolve(baseDir, inputPath);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns true when candidatePath is inside (or equal to) baseDir.
|
|
11
|
+
* Both paths must already be absolute; call resolveWorkspacePath / realpathSync
|
|
12
|
+
* before passing them here.
|
|
13
|
+
*/
|
|
14
|
+
export function isPathInsideBase(baseDir, candidatePath) {
|
|
15
|
+
const relative = path.relative(baseDir, candidatePath);
|
|
16
|
+
return !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Validate a CLI scan path against the workspace root.
|
|
20
|
+
* Throws a user-facing Error when the path would escape the workspace and
|
|
21
|
+
* allowOutside is false.
|
|
22
|
+
* Returns the resolved absolute path on success.
|
|
23
|
+
*/
|
|
24
|
+
export function validateCliScanPath(baseDir, inputPath, allowOutside) {
|
|
25
|
+
const resolved = resolveWorkspacePath(baseDir, inputPath);
|
|
26
|
+
if (!allowOutside && !isPathInsideBase(baseDir, resolved)) {
|
|
27
|
+
throw new Error(`Path "${resolved}" is outside allowed workspace "${baseDir}". Use --allow-outside to override.`);
|
|
28
|
+
}
|
|
29
|
+
return resolved;
|
|
30
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windows terminal encoding initialisation.
|
|
3
|
+
*
|
|
4
|
+
* Windows cmd/PowerShell defaults to legacy code pages (437, 936, 950)
|
|
5
|
+
* instead of UTF-8 (65001). This module sets UTF-8 so Chinese / emoji
|
|
6
|
+
* output is not garbled.
|
|
7
|
+
*/
|
|
8
|
+
import { execSync } from "node:child_process";
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
let inited = false;
|
|
11
|
+
/** Try to switch Windows console to UTF-8 code page (65001). */
|
|
12
|
+
export function initWindowsEncoding() {
|
|
13
|
+
if (inited)
|
|
14
|
+
return;
|
|
15
|
+
inited = true;
|
|
16
|
+
if (process.platform !== "win32")
|
|
17
|
+
return;
|
|
18
|
+
try {
|
|
19
|
+
execSync("chcp 65001", { stdio: "pipe" });
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// chcp may not exist in msys / cygwin / stripped environments
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Read a file with BOM-aware encoding detection.
|
|
27
|
+
*
|
|
28
|
+
* Windows editors sometimes save files as UTF-16LE or UTF-8 with BOM.
|
|
29
|
+
* Plain `readFileSync(p, "utf-8")` mangles those.
|
|
30
|
+
*/
|
|
31
|
+
export function readFileWithEncoding(path) {
|
|
32
|
+
const raw = readFileSync(path);
|
|
33
|
+
const bomUtf16le = raw[0] === 0xff && raw[1] === 0xfe;
|
|
34
|
+
const bomUtf16be = raw[0] === 0xfe && raw[1] === 0xff;
|
|
35
|
+
const bomUtf8 = raw[0] === 0xef && raw[1] === 0xbb && raw[2] === 0xbf;
|
|
36
|
+
if (bomUtf16le) {
|
|
37
|
+
return new TextDecoder("utf-16le").decode(raw).replace(/\r\n/g, "\n");
|
|
38
|
+
}
|
|
39
|
+
if (bomUtf16be) {
|
|
40
|
+
return new TextDecoder("utf-16be").decode(raw).replace(/\r\n/g, "\n");
|
|
41
|
+
}
|
|
42
|
+
// Strip UTF-8 BOM if present
|
|
43
|
+
const content = bomUtf8 ? raw.toString("utf-8").slice(1) : raw.toString("utf-8");
|
|
44
|
+
return content.replace(/\r\n/g, "\n");
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leakshield",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "OpenCode plugin, CLI, and web scanner for sensitive content before sending it to AI",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jwcrystal/leakshield.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/jwcrystal/leakshield/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/jwcrystal/leakshield#readme",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"opencode",
|
|
16
|
+
"opencode-plugin",
|
|
17
|
+
"secrets",
|
|
18
|
+
"pii",
|
|
19
|
+
"redaction",
|
|
20
|
+
"pseudonymization",
|
|
21
|
+
"llm",
|
|
22
|
+
"security"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./dist/index.js",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=20"
|
|
35
|
+
},
|
|
36
|
+
"bin": {
|
|
37
|
+
"leakshield": "dist/cli.js"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
41
|
+
"build": "npm run clean && tsc",
|
|
42
|
+
"prepack": "npm run build",
|
|
43
|
+
"start": "node dist/cli.js --cli",
|
|
44
|
+
"dev": "tsx src/cli.ts --cli",
|
|
45
|
+
"scan": "tsx src/cli.ts --cli",
|
|
46
|
+
"web": "tsx src/cli.ts --web",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"binary": "bun build --compile --target=bun-darwin-arm64 ./src/cli.ts --outfile=leakshield",
|
|
50
|
+
"binary:win": "bun build --compile --target=bun-windows-x64 ./src/cli.ts --outfile=leakshield.exe",
|
|
51
|
+
"binary:win-icon": "node scripts/build-win.js",
|
|
52
|
+
"binary:linux": "bun build --compile --target=bun-linux-x64 ./src/cli.ts --outfile=leakshield-linux",
|
|
53
|
+
"binary:mac-intel": "bun build --compile --target=bun-darwin-x64 ./src/cli.ts --outfile=leakshield-intel",
|
|
54
|
+
"binary:all": "npm run binary && npm run binary:win && npm run binary:linux && npm run binary:mac-intel",
|
|
55
|
+
"bundle:mac": "npm run binary && bash scripts/bundle-mac.sh"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@opencode-ai/plugin": "^1.17.18",
|
|
59
|
+
"chalk": "^5.3.0",
|
|
60
|
+
"js-yaml": "^4.3.2",
|
|
61
|
+
"zod": "^3.22.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@opencode-ai/sdk": "^1.17.18",
|
|
65
|
+
"@opencode/plugin": "^2.0.19",
|
|
66
|
+
"@types/js-yaml": "^4.0.9",
|
|
67
|
+
"@types/node": "^20.0.0",
|
|
68
|
+
"rcedit": "^5.0.2",
|
|
69
|
+
"tsx": "^4.23.1",
|
|
70
|
+
"typescript": "^5.0.0",
|
|
71
|
+
"vitest": "^4.1.1"
|
|
72
|
+
}
|
|
73
|
+
}
|