jinzd-ai-cli 0.4.307 → 0.4.309
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/README.md +2 -1
- package/README.zh-CN.md +1 -1
- package/THIRD_PARTY_NOTICES.md +3 -0
- package/dist/{agent-client-6GX6QQDU.js → agent-client-TIEAYZXV.js} +4 -1
- package/dist/{auth-PE3Z5OHS.js → auth-QTQNZ6IX.js} +2 -2
- package/dist/{batch-HMADXNOD.js → batch-H4WWSZQ3.js} +3 -3
- package/dist/{chat-index-2D5GK2DB.js → chat-index-7CLR4CBG.js} +4 -3
- package/dist/{chat-index-DGUOUUQW.js → chat-index-RLVLQRRC.js} +3 -2
- package/dist/{chunk-CIM2PV2F.js → chunk-2E5W2E64.js} +2 -2
- package/dist/chunk-2XMUCC42.js +67 -0
- package/dist/{chunk-VAV2IJ3R.js → chunk-3CNPJLVI.js} +1 -1
- package/dist/{chunk-KRCYR46A.js → chunk-3GEO2LPO.js} +264 -55
- package/dist/{chunk-OAXLMF3U.js → chunk-3YVNDYOY.js} +1 -1
- package/dist/{chunk-5GQL4TSZ.js → chunk-4BXTGXZ6.js} +2 -2
- package/dist/{chunk-RYQBBEMM.js → chunk-4PR5AVJ5.js} +115 -19
- package/dist/{chunk-GHWZVPUV.js → chunk-6JHACXB3.js} +7 -5
- package/dist/{chunk-IUVDZVZ4.js → chunk-AXTLYOA7.js} +24 -17
- package/dist/{chunk-XJOK5353.js → chunk-B3MPYI4E.js} +2 -2
- package/dist/chunk-BMLQPSHP.js +69 -0
- package/dist/{chunk-NRSYBKWA.js → chunk-C7CKDFJS.js} +1 -1
- package/dist/{chunk-SJFZPS65.js → chunk-EAVX3RLD.js} +1 -1
- package/dist/{chunk-VXEF2SWG.js → chunk-EHMMBIZT.js} +16 -12
- package/dist/chunk-FVXNEZEW.js +161 -0
- package/dist/{chunk-AHL6KOGM.js → chunk-HXINWG37.js} +2 -2
- package/dist/{chunk-3CKJOTVM.js → chunk-IW6Q66WS.js} +4 -4
- package/dist/chunk-JJFJWD35.js +162 -0
- package/dist/{chunk-NYNSYLFY.js → chunk-JL44HGZC.js} +1 -1
- package/dist/{chunk-3TBXHLSC.js → chunk-K4F7QEGW.js} +1 -1
- package/dist/{chunk-NUJTNH76.js → chunk-LBWKMTT3.js} +1 -1
- package/dist/{chunk-YKJO3SI4.js → chunk-LONB36SP.js} +16 -3
- package/dist/{chunk-WQ3OMEC4.js → chunk-M6HLYG33.js} +1 -1
- package/dist/{chunk-I4GQRMFV.js → chunk-M6YV5KSS.js} +6 -4
- package/dist/{chunk-KBDKKHXB.js → chunk-O6CGOVD4.js} +2 -2
- package/dist/{chunk-L2RJPVHV.js → chunk-O7MMYJAD.js} +266 -512
- package/dist/chunk-QMFMST2T.js +39 -0
- package/dist/{chunk-AQF6IXSR.js → chunk-RBCKX2FZ.js} +11 -6
- package/dist/{chunk-4W6VDVQU.js → chunk-RLERORUI.js} +246 -56
- package/dist/{chunk-MI4SFZGX.js → chunk-RMEJR3AW.js} +5 -2
- package/dist/{chunk-UFW4S3RU.js → chunk-RVMCY6DP.js} +1 -1
- package/dist/{chunk-LF67HWWR.js → chunk-RWRZVQCB.js} +1 -1
- package/dist/{chunk-NQJSPMY2.js → chunk-SCG2VBPB.js} +4 -4
- package/dist/chunk-SXIJLSVF.js +41 -0
- package/dist/{chunk-YFDQIUQ3.js → chunk-T42GXE7Y.js} +18 -18
- package/dist/chunk-TDQW2YHK.js +65 -0
- package/dist/{chunk-45UVJXFQ.js → chunk-W2UOVGRC.js} +1 -1
- package/dist/{ci-QD2Q7NWY.js → ci-H6GPHG4T.js} +7 -7
- package/dist/{ci-format-42XIZO5P.js → ci-format-U47GSGYU.js} +2 -2
- package/dist/{constants-5CMEFZQB.js → constants-GYJTB6KI.js} +1 -1
- package/dist/{constants-NMASHFDL.js → constants-SNJR6546.js} +1 -1
- package/dist/doctor-cli-J6LAQ5LU.js +18 -0
- package/dist/electron-server.js +922 -842
- package/dist/file-checkpoint-64A2AXHE.js +7 -0
- package/dist/{file-checkpoint-NKBHGC7L.js → file-checkpoint-VVPUJNCI.js} +2 -1
- package/dist/{hub-ZLF6GMQD.js → hub-G5FMMTVZ.js} +3 -3
- package/dist/{hub-server-CBKCP5VD.js → hub-server-JLC7CNP7.js} +55 -17
- package/dist/index.js +48 -42
- package/dist/{indexer-P3FPRTPJ.js → indexer-GKIWSSRP.js} +3 -3
- package/dist/indexer-VRXDZ74A.js +10 -0
- package/dist/{persist-S77WRVLD.js → persist-ZZXRWFBX.js} +4 -4
- package/dist/{persistent-memory-GJE7HKVK.js → persistent-memory-EXJBXL33.js} +3 -3
- package/dist/{persistent-memory-MBSBTBGY.js → persistent-memory-LEE454DW.js} +3 -3
- package/dist/{pr-SXRW24JG.js → pr-6PUHVJ6K.js} +7 -7
- package/dist/{project-trust-MUG325AW.js → project-trust-6CJB5ZMX.js} +1 -1
- package/dist/{project-trust-NKYHL3VZ.js → project-trust-KGG2BWKC.js} +1 -1
- package/dist/run-tests-2C7MWZBN.js +12 -0
- package/dist/run-tests-33ZVQE3Q.js +13 -0
- package/dist/{semantic-7GM5M4MU.js → semantic-N227CLSC.js} +4 -4
- package/dist/{semantic-QOBAXEQ4.js → semantic-TRQAZSRY.js} +4 -4
- package/dist/{server-GGEO7SA2.js → server-AJH5TBVO.js} +231 -103
- package/dist/{server-MO3EU2XD.js → server-CYAB56O3.js} +16 -14
- package/dist/{store-SIKHCUYJ.js → store-2N6PPPBP.js} +2 -2
- package/dist/{store-CMSSWZF7.js → store-76VVFDXM.js} +2 -2
- package/dist/{task-orchestrator-JGEEQ2OE.js → task-orchestrator-HNRV3YUD.js} +15 -14
- package/dist/{usage-B7RIAPPT.js → usage-ZN5DU6Z7.js} +4 -4
- package/dist/{vector-store-JAXWDZYW.js → vector-store-T2DVUMY4.js} +2 -2
- package/dist/{vector-store-PWIOQFTP.js → vector-store-V6UGEYWK.js} +2 -2
- package/dist/web/client/app.js +7 -0
- package/dist/web/client/app.js.br +0 -0
- package/dist/web/client/app.js.gz +0 -0
- package/dist/web/client/util.js +14 -23
- package/dist/web/client/util.js.br +0 -0
- package/dist/web/client/util.js.gz +0 -0
- package/dist/web/client/vendor/DOMPurify-LICENSE.txt +202 -0
- package/dist/web/client/vendor/purify.es.mjs +2722 -0
- package/dist/web/client/vendor/purify.es.mjs.br +0 -0
- package/dist/web/client/vendor/purify.es.mjs.gz +0 -0
- package/package.json +4 -2
- package/dist/chunk-4BKXL7SM.js +0 -98
- package/dist/chunk-6BUTA5VW.js +0 -38
- package/dist/chunk-IW3Q7AE5.js +0 -40
- package/dist/chunk-SKET65WZ.js +0 -96
- package/dist/doctor-cli-IOVSHBDI.js +0 -18
- package/dist/file-checkpoint-CGH6OJVI.js +0 -6
- package/dist/indexer-FPKY7LCT.js +0 -10
- package/dist/run-tests-EQCAMFQE.js +0 -10
- package/dist/run-tests-V3N7YV3P.js +0 -9
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/web/access.ts
|
|
4
|
+
import { randomBytes, timingSafeEqual } from "crypto";
|
|
5
|
+
import { networkInterfaces } from "os";
|
|
6
|
+
function equalToken(a, b) {
|
|
7
|
+
if (typeof a !== "string" || a.length > 4096) return false;
|
|
8
|
+
const left = Buffer.from(a), right = Buffer.from(b);
|
|
9
|
+
return left.length === right.length && timingSafeEqual(left, right);
|
|
10
|
+
}
|
|
11
|
+
var WebAccess = class {
|
|
12
|
+
constructor(host, externalOrigin) {
|
|
13
|
+
this.externalOrigin = externalOrigin;
|
|
14
|
+
if (!["0.0.0.0", "::"].includes(host)) this.hosts.add(host.includes(":") ? `[${host}]` : host.toLowerCase());
|
|
15
|
+
else for (const interfaces of Object.values(networkInterfaces())) for (const entry of interfaces ?? []) {
|
|
16
|
+
this.hosts.add(entry.address.includes(":") ? `[${entry.address}]` : entry.address);
|
|
17
|
+
}
|
|
18
|
+
if (externalOrigin && new URL(externalOrigin).origin !== externalOrigin) throw new Error("External origin must be an exact http(s) origin");
|
|
19
|
+
if (externalOrigin && !/^https?:\/\//.test(externalOrigin)) throw new Error("External origin must use HTTP(S)");
|
|
20
|
+
}
|
|
21
|
+
externalOrigin;
|
|
22
|
+
localToken = randomBytes(32).toString("base64url");
|
|
23
|
+
hosts = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
24
|
+
accepts(req) {
|
|
25
|
+
const host = req.headers.host;
|
|
26
|
+
if (!host) return false;
|
|
27
|
+
try {
|
|
28
|
+
const url = new URL(`http://${host}`);
|
|
29
|
+
const internal = this.hosts.has(url.hostname.toLowerCase()) && Number(url.port || 80) === req.socket.localPort;
|
|
30
|
+
const external = this.externalOrigin && new URL(this.externalOrigin).host === host;
|
|
31
|
+
if (!internal && !external) return false;
|
|
32
|
+
const origin = req.headers.origin;
|
|
33
|
+
return !origin || origin === (external ? this.externalOrigin : `http://${host}`);
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var AuthRateLimiter = class {
|
|
40
|
+
ips = /* @__PURE__ */ new Map();
|
|
41
|
+
start = 0;
|
|
42
|
+
count = 0;
|
|
43
|
+
take(ip) {
|
|
44
|
+
const now = Date.now();
|
|
45
|
+
if (now - this.start >= 6e4) {
|
|
46
|
+
this.start = now;
|
|
47
|
+
this.count = 0;
|
|
48
|
+
}
|
|
49
|
+
if (++this.count > 120) return false;
|
|
50
|
+
for (const [key, value] of this.ips) if (now - value.start >= 6e4) this.ips.delete(key);
|
|
51
|
+
let bucket = this.ips.get(ip);
|
|
52
|
+
if (!bucket) {
|
|
53
|
+
if (this.ips.size >= 2048) return false;
|
|
54
|
+
bucket = { start: now, count: 0 };
|
|
55
|
+
this.ips.set(ip, bucket);
|
|
56
|
+
}
|
|
57
|
+
return ++bucket.count <= 30;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
equalToken,
|
|
63
|
+
WebAccess,
|
|
64
|
+
AuthRateLimiter
|
|
65
|
+
};
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
CI_COMMENT_MARKER,
|
|
4
4
|
countSeverity,
|
|
5
5
|
runCi
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-IW6Q66WS.js";
|
|
7
|
+
import "./chunk-K4F7QEGW.js";
|
|
8
8
|
import "./chunk-HLWUDRBO.js";
|
|
9
9
|
import "./chunk-6YZEZFX5.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-EHMMBIZT.js";
|
|
11
|
+
import "./chunk-RBCKX2FZ.js";
|
|
12
|
+
import "./chunk-RMEJR3AW.js";
|
|
13
13
|
import "./chunk-TU3L3PW7.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-BMLQPSHP.js";
|
|
15
|
+
import "./chunk-3CNPJLVI.js";
|
|
16
16
|
export {
|
|
17
17
|
CI_COMMENT_MARKER,
|
|
18
18
|
countSeverity,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
formatDoctorReport,
|
|
4
|
+
runDoctorCli
|
|
5
|
+
} from "./chunk-SCG2VBPB.js";
|
|
6
|
+
import "./chunk-4BXTGXZ6.js";
|
|
7
|
+
import "./chunk-RS7SKYTS.js";
|
|
8
|
+
import "./chunk-EHMMBIZT.js";
|
|
9
|
+
import "./chunk-RBCKX2FZ.js";
|
|
10
|
+
import "./chunk-RMEJR3AW.js";
|
|
11
|
+
import "./chunk-TU3L3PW7.js";
|
|
12
|
+
import "./chunk-HOSJZMQS.js";
|
|
13
|
+
import "./chunk-BMLQPSHP.js";
|
|
14
|
+
import "./chunk-3CNPJLVI.js";
|
|
15
|
+
export {
|
|
16
|
+
formatDoctorReport,
|
|
17
|
+
runDoctorCli
|
|
18
|
+
};
|