@cortexkit/opencode-magic-context 0.49.97 → 0.49.99
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/{announcement-8nj2jd87.js → announcement-p2xjv6cp.js} +4 -5
- package/dist/auto-search-worker.js +5 -5
- package/dist/chunk-embedding-write-worker.js +15 -16
- package/dist/{compaction-marker-candidates-a4b0anvv.js → compaction-marker-candidates-2apg7ewt.js} +2 -3
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/{compartment-chunk-embedding-re2cw7y3.js → compartment-chunk-embedding-gnemmf79.js} +7 -8
- package/dist/{conflict-warning-hook-wcq55y61.js → conflict-warning-hook-x1ynwzwz.js} +7 -8
- package/dist/{context-br04s0b6.js → context-z77a2jpx.js} +377 -60
- package/dist/{derive-budgets-g1sy72e8.js → derive-budgets-vbv0fwsd.js} +4 -5
- package/dist/embedding-backfill-79br4kk6.js +28 -0
- package/dist/embedding-worker-process.js +1 -2
- package/dist/embedding-worker.js +6 -7
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-probe.d.ts +10 -9
- package/dist/features/magic-context/memory/embedding-probe.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-response-slots.d.ts +13 -0
- package/dist/features/magic-context/memory/embedding-response-slots.d.ts.map +1 -0
- package/dist/features/magic-context/storage-native-replay.d.ts +2 -0
- package/dist/features/magic-context/storage-native-replay.d.ts.map +1 -1
- package/dist/{history-owner-74826t4n.js → history-owner-8dj31nyf.js} +2 -3
- package/dist/hooks/magic-context/apply-operations.d.ts +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-flush.d.ts +1 -1
- package/dist/hooks/magic-context/execute-flush.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +2 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-tbdy1hk0.js → index-0wj3jr8n.js} +6 -6
- package/dist/{index-j4dcjb8t.js → index-1vv1ka4a.js} +4 -4
- package/dist/{index-zfx7mtqa.js → index-2m3t73wk.js} +1 -1
- package/dist/{index-3fhb0j32.js → index-34xvre52.js} +223 -5
- package/dist/{index-pkxkeezb.js → index-4qc8d9by.js} +17 -17
- package/dist/{index-mmf6e740.js → index-507a56zb.js} +7 -7
- package/dist/{index-qdjxrbnr.js → index-5nf2a14a.js} +52 -45
- package/dist/{index-w9hxgntq.js → index-5xrj3zp4.js} +5 -5
- package/dist/{index-kj4bprep.js → index-61a853ky.js} +4 -4
- package/dist/{index-zmgp0tr6.js → index-74w347am.js} +3 -3
- package/dist/{index-hp46xe93.js → index-8hhmv0ff.js} +6 -6
- package/dist/{index-c205x7xd.js → index-8k9qpyjf.js} +1 -1
- package/dist/{index-tqtpgnhr.js → index-9awtk18w.js} +1 -1
- package/dist/{index-h7kta6cn.js → index-9eqt7755.js} +3 -3
- package/dist/{index-x49x59ar.js → index-9q7wzca8.js} +23 -25
- package/dist/{index-880a24vd.js → index-ab86c21b.js} +1 -1
- package/dist/{index-3n4j5rqc.js → index-abhmtj00.js} +1 -1
- package/dist/{index-tr4ep2ej.js → index-ajmy0v5j.js} +31 -0
- package/dist/{index-dj64gzg5.js → index-cayqdwf9.js} +2 -2
- package/dist/{index-0sqhg9nf.js → index-dnxnj42p.js} +12 -12
- package/dist/{index-0bjj9yf3.js → index-e6s2jpr8.js} +2 -2
- package/dist/{index-8v1brm5n.js → index-em72jhc0.js} +11 -11
- package/dist/{index-910gahfb.js → index-esym6cw4.js} +6 -8
- package/dist/{index-7sdns2ww.js → index-fd3hkyk1.js} +2 -2
- package/dist/{index-fgw241hh.js → index-gcf2x04k.js} +2 -2
- package/dist/{index-89xg64wb.js → index-geph2sa6.js} +2 -2
- package/dist/{index-45qgkg8j.js → index-h1qh9n8b.js} +2 -2
- package/dist/{index-9jvxq5rt.js → index-h1xvt8fw.js} +4 -4
- package/dist/{index-0ve29s6f.js → index-hbqxxb2n.js} +1 -1
- package/dist/{index-dnpcv1rg.js → index-hyvxmz3e.js} +4 -4
- package/dist/{index-hedgz8an.js → index-jsbgw33b.js} +1 -1
- package/dist/{index-mgy7g740.js → index-kjdys7e2.js} +1 -1
- package/dist/{index-e6ay1gez.js → index-mfx7hzyc.js} +2 -2
- package/dist/{index-7m2tnk8q.js → index-mhdavdd4.js} +31 -28
- package/dist/{index-r1d45dsr.js → index-nyjztqyj.js} +3 -3
- package/dist/{index-azkfw78y.js → index-qxzk5s30.js} +1 -1
- package/dist/{index-6mryx739.js → index-t7st85f5.js} +1 -1
- package/dist/{index-89bkkgcn.js → index-tyjx0dwz.js} +4 -4
- package/dist/{index-k34hc455.js → index-vdzd98ry.js} +2 -2
- package/dist/{index-hj78hvhm.js → index-vegw385y.js} +2 -2
- package/dist/{index-w7n7qkpf.js → index-w6kcwhhj.js} +4 -4
- package/dist/{index-xcej5kpt.js → index-xbna9akt.js} +5 -5
- package/dist/{index-cpbr0xvk.js → index-xtv4d4hv.js} +2 -2
- package/dist/{index-zkjx8gq3.js → index-xw608ytx.js} +11 -11
- package/dist/{index-jzrvdqb8.js → index-y5f5yg5a.js} +1 -1
- package/dist/index.js +55 -56
- package/dist/{logger-nmb2508f.js → logger-dgtrf43g.js} +1 -2
- package/dist/{message-fts-rowid-map-vcatdan0.js → message-fts-rowid-map-cfq59g6g.js} +4 -5
- package/dist/{message-index-bounded-abhwe610.js → message-index-bounded-6y7p974x.js} +10 -11
- package/dist/{message-time-backfill-zc5rsvhv.js → message-time-backfill-av870n4c.js} +2 -3
- package/dist/migration-worker.js +12 -13
- package/dist/plugin/rpc-handlers.d.ts +1 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-e566q4bg.js → project-embedding-registry-xy8dcdys.js} +13 -14
- package/dist/raw-ordinal-warmup-worker.js +8 -8
- package/dist/{read-session-chunk-sde0wym3.js → read-session-chunk-9ejnbe07.js} +8 -9
- package/dist/{read-session-raw-trhdgc9z.js → read-session-raw-pgc9gxtn.js} +2 -3
- package/dist/{recomp-orchestrator-dapm3e4v.js → recomp-orchestrator-9k91tkyx.js} +32 -33
- package/dist/render-9712q3gp.js +42 -0
- package/dist/{safe-notification-target-54ns7dv9.js → safe-notification-target-01j8km9e.js} +2 -3
- package/dist/{search-archive-4bbn3ztv.js → search-archive-5jr011gc.js} +11 -12
- package/dist/{search-11aw8wpq.js → search-yhaxy3e6.js} +25 -26
- package/dist/{send-session-notification-gxrj4w1r.js → send-session-notification-tfhs4dbc.js} +5 -6
- package/dist/shared/rpc-types.d.ts +5 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/status-view-check.d.ts.map +1 -1
- package/dist/shared/status-view.d.ts +8 -0
- package/dist/shared/status-view.d.ts.map +1 -1
- package/dist/shared/transcript.d.ts +1 -1
- package/dist/shared/transcript.d.ts.map +1 -1
- package/dist/{storage-tags-jq0c0zsn.js → storage-tags-vd3sgd4s.js} +5 -6
- package/dist/{store-29ksp6vy.js → store-235fjtsn.js} +6 -4
- package/dist/{store-reader-dgh3ssxx.js → store-reader-01e8t5j0.js} +4 -1
- package/dist/{transform-postprocess-phase-1xrjg6be.js → transform-postprocess-phase-mf5js6cs.js} +33 -34
- package/dist/v2/auto-search-worker.js +5 -5
- package/dist/v2/checkpoint-instruction-status.d.ts +13 -0
- package/dist/v2/checkpoint-instruction-status.d.ts.map +1 -0
- package/dist/v2/chunk-embedding-write-worker.js +15 -16
- package/dist/v2/{compaction-marker-candidates-6nypmsr3.js → compaction-marker-candidates-3rxg3f1e.js} +2 -3
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{compartment-chunk-embedding-jthtfhcd.js → compartment-chunk-embedding-6v74y2r3.js} +7 -8
- package/dist/v2/{context-43r0mzkp.js → context-4fej2dzv.js} +390 -69
- package/dist/v2/{derive-budgets-wj0q7s7d.js → derive-budgets-9237wmq5.js} +5 -6
- package/dist/v2/embedding-backfill-nhgp8znm.js +28 -0
- package/dist/v2/embedding-worker-process.js +1 -2
- package/dist/v2/embedding-worker.js +6 -7
- package/dist/v2/fold/idle.d.ts +11 -1
- package/dist/v2/fold/idle.d.ts.map +1 -1
- package/dist/v2/fold/instruction-supersession.d.ts +22 -1
- package/dist/v2/fold/instruction-supersession.d.ts.map +1 -1
- package/dist/v2/fold/native-replay-v3.d.ts +1 -0
- package/dist/v2/fold/native-replay-v3.d.ts.map +1 -1
- package/dist/v2/fold/native-replay.d.ts +73 -0
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/{history-owner-8pd5ax3n.js → history-owner-k4gx50a0.js} +2 -3
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/{logger-58jfese9.js → logger-0ys28353.js} +1 -2
- package/dist/v2/{message-fts-rowid-map-ax4vk78j.js → message-fts-rowid-map-88x2zbyj.js} +4 -5
- package/dist/v2/{message-index-bounded-qh794qxx.js → message-index-bounded-wj5rs9az.js} +10 -11
- package/dist/v2/{message-time-backfill-yj773saf.js → message-time-backfill-5p4vwd79.js} +2 -3
- package/dist/v2/migration-worker.js +12 -13
- package/dist/v2/{project-embedding-registry-z05xvckg.js → project-embedding-registry-qz9x79kn.js} +13 -14
- package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
- package/dist/v2/{read-session-chunk-8tn2dbn1.js → read-session-chunk-89ep8br4.js} +8 -9
- package/dist/v2/{read-session-raw-ywebck9q.js → read-session-raw-seh1kcvp.js} +2 -3
- package/dist/v2/recomp-orchestrator-9wap1z1d.js +68 -0
- package/dist/v2/render-bzzypsgy.js +42 -0
- package/dist/v2/{safe-notification-target-zrwbh6k7.js → safe-notification-target-3e2rq2ys.js} +2 -3
- package/dist/v2/{search-archive-8zqsf9e6.js → search-archive-4yr4hw2m.js} +11 -12
- package/dist/v2/{search-35cz80x0.js → search-ymm2crs3.js} +24 -25
- package/dist/v2/{send-session-notification-8x146x5y.js → send-session-notification-vtnk598k.js} +5 -6
- package/dist/v2/{server-vj0xbbrc.js → server-0b3ms151.js} +2 -2
- package/dist/v2/{server-r3h4fy4k.js → server-1bks09js.js} +5 -5
- package/dist/v2/{server-nnh81jqy.js → server-2ek9exbe.js} +6 -8
- package/dist/v2/{server-63ree5ns.js → server-2xng77ch.js} +1 -1
- package/dist/v2/{server-2sare4qg.js → server-3mb205v9.js} +4 -4
- package/dist/v2/{server-n34vzyfm.js → server-3qeqa3b6.js} +1 -1
- package/dist/v2/{server-av3p9c8k.js → server-54nc921b.js} +1 -1
- package/dist/v2/{server-2qvnr3t7.js → server-5zx51pm4.js} +1 -1
- package/dist/v2/{server-vsx9tsks.js → server-62t1852h.js} +11 -11
- package/dist/v2/{server-svccj9rd.js → server-6mq43ear.js} +4 -4
- package/dist/v2/{server-1fnsfm3a.js → server-6r3b0re0.js} +24 -26
- package/dist/v2/{server-db91dxwc.js → server-7861dnm3.js} +6 -6
- package/dist/v2/{server-6qax5pds.js → server-7c5p0bh1.js} +2 -2
- package/dist/v2/{server-z5cv5wm5.js → server-7wpw3wc6.js} +31 -28
- package/dist/v2/{server-11ra1pmx.js → server-8xgs110k.js} +4 -4
- package/dist/v2/{server-40vdz8sf.js → server-98xd6j4r.js} +2 -2
- package/dist/v2/{server-k3ntgf6n.js → server-b5eg9ct6.js} +2 -2
- package/dist/v2/{server-2cq3e1c1.js → server-b65sqz7y.js} +4 -4
- package/dist/v2/{server-ganavh75.js → server-bhr92yb4.js} +2 -2
- package/dist/v2/{server-4yrvbnnm.js → server-bzebqckc.js} +2 -2
- package/dist/v2/{server-rt8t6s2a.js → server-cc58mckk.js} +2 -2
- package/dist/v2/{server-xekyjy4w.js → server-d0h1gjz2.js} +6 -6
- package/dist/v2/{server-73bqw5c0.js → server-d46xewmt.js} +1 -1
- package/dist/v2/{server-rr5c0xcg.js → server-d4h86y7v.js} +2 -2
- package/dist/v2/{server-7tj8yzrv.js → server-e14d7ebh.js} +2 -2
- package/dist/v2/{server-gh2w75fn.js → server-e8ybwfv8.js} +3 -3
- package/dist/v2/{server-zemnpv92.js → server-ghk96d57.js} +4 -4
- package/dist/v2/{server-j1gxs1gj.js → server-h95cdc30.js} +1 -1
- package/dist/v2/{server-5t4nzfpt.js → server-j09jx1n9.js} +1 -1
- package/dist/v2/{server-n33hyq9t.js → server-jrs4gny6.js} +2 -2
- package/dist/v2/{server-7h4gwphm.js → server-pqgnjf38.js} +3 -3
- package/dist/v2/{server-379fd3n7.js → server-rbxtp4sm.js} +1 -1
- package/dist/v2/{server-2wz6y46g.js → server-sfffm587.js} +1 -1
- package/dist/v2/{server-bx5k66qc.js → server-vgy98kcd.js} +1 -1
- package/dist/v2/{server-kzrrdjp5.js → server-xc7t2r4k.js} +223 -5
- package/dist/v2/{server-z2nv8jdv.js → server-xn7fpv2b.js} +12 -12
- package/dist/v2/{server-tq523gj6.js → server-yacpgq4s.js} +1 -1
- package/dist/v2/{server-vtkbxzw1.js → server-ysg14rv1.js} +31 -0
- package/dist/v2/{server-qjjky07w.js → server-zedjjdc5.js} +11 -11
- package/dist/v2/server.js +8 -9
- package/dist/v2/{storage-tags-pcenytad.js → storage-tags-8kktww54.js} +5 -6
- package/dist/v2/{store-gx19qc3a.js → store-0kjfynwp.js} +6 -4
- package/dist/v2/{store-reader-qt2msa8z.js → store-reader-w0srb18d.js} +4 -1
- package/dist/v2/store-reader.d.ts +1 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/tui/index.d.ts +1 -1
- package/dist/v2/tui/index.d.ts.map +1 -1
- package/dist/v2/{v2-archive-reader-hvdyz30c.js → v2-archive-reader-veyqp15a.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-0d4ceff3.js → wrapup-orchestrator-89cg7p41.js} +33 -34
- package/dist/{v2-archive-reader-qs24chs6.js → v2-archive-reader-3s332fn7.js} +1 -1
- package/dist/wrapup-orchestrator-41rt7etq.js +55 -0
- package/package.json +2 -2
- package/src/shared/rpc-types.ts +6 -0
- package/src/shared/status-view-check.ts +11 -0
- package/src/shared/status-view.ts +24 -1
- package/src/shared/tag-transcript.ts +5 -4
- package/src/shared/test-preload-leak-scan.test.ts +56 -0
- package/src/shared/transcript.ts +1 -1
- package/src/v2/tui/index.ts +8 -1
- package/src/v2/tui/status-dialog-fallback.test.ts +21 -0
- package/dist/embedding-backfill-pdymqbnh.js +0 -29
- package/dist/index-dt7cyqfe.js +0 -223
- package/dist/render-6vmqzcem.js +0 -43
- package/dist/v2/embedding-backfill-16b16m38.js +0 -29
- package/dist/v2/recomp-orchestrator-vzygyqwn.js +0 -69
- package/dist/v2/render-9b5dxp9e.js +0 -43
- package/dist/v2/server-dt7cyqfe.js +0 -223
- package/dist/wrapup-orchestrator-v1mhjw55.js +0 -56
package/dist/index-dt7cyqfe.js
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
// src/shared/redaction.ts
|
|
2
|
-
import { homedir, userInfo } from "node:os";
|
|
3
|
-
function escapeRegex(value) {
|
|
4
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
5
|
-
}
|
|
6
|
-
var SECRET_WORDS = [
|
|
7
|
-
"key",
|
|
8
|
-
"token",
|
|
9
|
-
"secret",
|
|
10
|
-
"password",
|
|
11
|
-
"auth",
|
|
12
|
-
"authorization",
|
|
13
|
-
"bearer",
|
|
14
|
-
"credential"
|
|
15
|
-
];
|
|
16
|
-
var SECRET_SEGMENT_PATTERN = new RegExp(`^(?:${SECRET_WORDS.map((w) => `${w}s?`).join("|")})$`, "i");
|
|
17
|
-
var TRAILING_DESCRIPTORS = new Set(["id", "ids", "value", "values", "header", "headers"]);
|
|
18
|
-
function redactionTypeForKey(key) {
|
|
19
|
-
const normalized = key.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g, "_");
|
|
20
|
-
const suffix = normalized.split(".").filter(Boolean).at(-1) ?? normalized;
|
|
21
|
-
return suffix || "secret";
|
|
22
|
-
}
|
|
23
|
-
function isNonSecretScalarValue(value) {
|
|
24
|
-
const v = value.trim();
|
|
25
|
-
if (v === "true" || v === "false" || v === "null" || v === "undefined")
|
|
26
|
-
return true;
|
|
27
|
-
return /^[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(v);
|
|
28
|
-
}
|
|
29
|
-
var SECRET_QUALIFIERS = new Set([
|
|
30
|
-
"api",
|
|
31
|
-
"access",
|
|
32
|
-
"private",
|
|
33
|
-
"client",
|
|
34
|
-
"auth",
|
|
35
|
-
"authorization",
|
|
36
|
-
"secret",
|
|
37
|
-
"bearer",
|
|
38
|
-
"session",
|
|
39
|
-
"refresh",
|
|
40
|
-
"service",
|
|
41
|
-
"x",
|
|
42
|
-
"openai",
|
|
43
|
-
"anthropic",
|
|
44
|
-
"google",
|
|
45
|
-
"github",
|
|
46
|
-
"huggingface",
|
|
47
|
-
"aws",
|
|
48
|
-
"azure",
|
|
49
|
-
"id"
|
|
50
|
-
]);
|
|
51
|
-
var UNQUALIFIED_SECRET_SEGMENT_PATTERN = /^(?:password|secret|credential|bearer|authorization)s?$/;
|
|
52
|
-
function isSecretKey(key) {
|
|
53
|
-
const segments = key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().split(/[._-]+/).filter(Boolean);
|
|
54
|
-
if (segments.length === 0)
|
|
55
|
-
return false;
|
|
56
|
-
if (segments.length === 1) {
|
|
57
|
-
const first = segments[0];
|
|
58
|
-
return Boolean(first && SECRET_SEGMENT_PATTERN.test(first));
|
|
59
|
-
}
|
|
60
|
-
for (let i = 0;i < segments.length; i++) {
|
|
61
|
-
const seg = segments[i];
|
|
62
|
-
if (!seg || !SECRET_SEGMENT_PATTERN.test(seg))
|
|
63
|
-
continue;
|
|
64
|
-
let trailingOk = true;
|
|
65
|
-
for (let j = i + 1;j < segments.length; j++) {
|
|
66
|
-
const tail = segments[j];
|
|
67
|
-
if (!tail)
|
|
68
|
-
continue;
|
|
69
|
-
if (TRAILING_DESCRIPTORS.has(tail))
|
|
70
|
-
continue;
|
|
71
|
-
if (SECRET_SEGMENT_PATTERN.test(tail))
|
|
72
|
-
continue;
|
|
73
|
-
trailingOk = false;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
if (!trailingOk)
|
|
77
|
-
continue;
|
|
78
|
-
if (UNQUALIFIED_SECRET_SEGMENT_PATTERN.test(seg))
|
|
79
|
-
return true;
|
|
80
|
-
for (let k = i - 1;k >= 0; k--) {
|
|
81
|
-
const lead = segments[k];
|
|
82
|
-
if (lead && SECRET_QUALIFIERS.has(lead))
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
function sanitizePathString(value) {
|
|
89
|
-
const home = process.env.HOME || process.env.USERPROFILE || homedir();
|
|
90
|
-
const username = userInfo().username;
|
|
91
|
-
let sanitized = value;
|
|
92
|
-
if (home) {
|
|
93
|
-
sanitized = sanitized.replace(new RegExp(escapeRegex(home), "g"), "~");
|
|
94
|
-
}
|
|
95
|
-
sanitized = sanitized.replace(/\/Users\/[^/]+\//g, "/Users/<USER>/");
|
|
96
|
-
sanitized = sanitized.replace(/\/home\/[^/]+\//g, "/home/<USER>/");
|
|
97
|
-
sanitized = sanitized.replace(/C:\\Users\\[^\\]+\\/g, "C:\\Users\\<USER>\\");
|
|
98
|
-
if (username) {
|
|
99
|
-
const word = "[\\p{L}\\p{M}\\p{N}_]";
|
|
100
|
-
sanitized = sanitized.replace(new RegExp(`(?<!${word})${escapeRegex(username)}(?!${word})`, "gu"), "<USER>");
|
|
101
|
-
}
|
|
102
|
-
return sanitized;
|
|
103
|
-
}
|
|
104
|
-
var SECRET_TEXT_PATTERNS = [
|
|
105
|
-
{
|
|
106
|
-
pattern: /\bsk-ant-(?:api03-)?[A-Za-z0-9_-]{32,}/g,
|
|
107
|
-
replacement: "<ANTHROPIC_API_KEY_REDACTED>"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
pattern: /\bsk-(?:proj-)?[A-Za-z0-9_-]{12,}/g,
|
|
111
|
-
replacement: "<OPENAI_API_KEY_REDACTED>"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}/g,
|
|
115
|
-
replacement: "<GITHUB_PAT_REDACTED>"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-9_-]{30,}/g,
|
|
119
|
-
replacement: "<GITHUB_TOKEN_REDACTED>"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
pattern: /\bhf_[A-Za-z0-9]{30,}/g,
|
|
123
|
-
replacement: "<HUGGINGFACE_TOKEN_REDACTED>"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
pattern: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,
|
|
127
|
-
replacement: "<AWS_ACCESS_KEY_ID_REDACTED>"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
pattern: /\bxox[abprsuvc]-[A-Za-z0-9-]{10,}/g,
|
|
131
|
-
replacement: "<SLACK_TOKEN_REDACTED>"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
pattern: /\bAIza[A-Za-z0-9_-]{35}\b/g,
|
|
135
|
-
replacement: "<GOOGLE_API_KEY_REDACTED>"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
pattern: /\b(Authorization\s*:\s*Bearer\s+)([A-Za-z0-9._~+/=-]{8,})/gi,
|
|
139
|
-
replacement: (_full, prefix) => `${prefix}<REDACTED:bearer>`
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
pattern: /\b((?:Proxy-)?Authorization\s*:\s*(?:Basic|Digest|Token|Negotiate|NTLM)\s+)([A-Za-z0-9._~+/=-]{4,})/gi,
|
|
143
|
-
replacement: (_full, prefix) => `${prefix}<REDACTED:authorization>`
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
pattern: /\b((?:x-)?(?:api-?key|api-?token|auth-?token|access-?token)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
147
|
-
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:api_key>`
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
pattern: /\b((?:api[_-]?key|client[_-]?secret|access[_-]?token|token|secret|password|passwd|pwd)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
151
|
-
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:credential>`
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
pattern: /\b([a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:)([^\s/@]+)(@)/gi,
|
|
155
|
-
replacement: (_full, prefix, _password, at) => `${prefix}<REDACTED:password>${at}`
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
pattern: /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
|
|
159
|
-
replacement: "<JWT_REDACTED>"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
pattern: /(["'])([^"']*(?:key|token|secret|password|auth|bearer|credential)[^"']*)\1(\s*:\s*)(["'])([^"']*)\4/gi,
|
|
163
|
-
replacement: (full, quote, key, separator, valueQuote, value) => isNonSecretScalarValue(value) ? full : `${quote}${key}${quote}${separator}${valueQuote}<REDACTED:${redactionTypeForKey(key)}>${valueQuote}`
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
pattern: /\b([A-Za-z0-9_.-]*(?:key|token|secret|password|auth|bearer|credential)[A-Za-z0-9_.-]*)\s*=\s*([^\s'"`]+)/gi,
|
|
167
|
-
replacement: (full, key, value) => isNonSecretScalarValue(value) ? full : `${key}=<REDACTED:${redactionTypeForKey(key)}>`
|
|
168
|
-
}
|
|
169
|
-
];
|
|
170
|
-
function redactSecretText(value) {
|
|
171
|
-
let redacted = value;
|
|
172
|
-
for (const { pattern, replacement } of SECRET_TEXT_PATTERNS) {
|
|
173
|
-
if (typeof replacement === "string") {
|
|
174
|
-
redacted = redacted.replace(pattern, replacement);
|
|
175
|
-
} else {
|
|
176
|
-
redacted = redacted.replace(pattern, replacement);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return redacted;
|
|
180
|
-
}
|
|
181
|
-
function sanitizeDiagnosticText(value) {
|
|
182
|
-
return redactSecretText(sanitizePathString(value));
|
|
183
|
-
}
|
|
184
|
-
var SHAREABILITY_SENSITIVE_PATTERNS = [
|
|
185
|
-
/\bC:\/Users\/[^/\s]+/i,
|
|
186
|
-
/(?:^|\s)~\/[^\s]+/,
|
|
187
|
-
/\b(?:api[_-]?key|secret|token|password|passwd|pwd|client[_-]?secret|access[_-]?key)\b\s*[:=]\s*\S+/i,
|
|
188
|
-
/\b(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(?::\d+)?\b/i,
|
|
189
|
-
/\b(?:10|127)\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/,
|
|
190
|
-
/\b192\.168\.\d{1,3}\.\d{1,3}\b/,
|
|
191
|
-
/\b172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}\b/
|
|
192
|
-
];
|
|
193
|
-
function hasShareabilitySensitiveText(text) {
|
|
194
|
-
try {
|
|
195
|
-
if (sanitizeDiagnosticText(text) !== text)
|
|
196
|
-
return true;
|
|
197
|
-
return SHAREABILITY_SENSITIVE_PATTERNS.some((pattern) => pattern.test(text));
|
|
198
|
-
} catch {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
function sanitizeConfigValue(value, keyPath = []) {
|
|
203
|
-
if (value === null || typeof value === "number" || typeof value === "boolean")
|
|
204
|
-
return value;
|
|
205
|
-
const key = keyPath.at(-1) ?? "";
|
|
206
|
-
if (key && isSecretKey(key)) {
|
|
207
|
-
return `<REDACTED:${redactionTypeForKey(key)}>`;
|
|
208
|
-
}
|
|
209
|
-
if (typeof value === "string")
|
|
210
|
-
return sanitizeDiagnosticText(value);
|
|
211
|
-
if (Array.isArray(value)) {
|
|
212
|
-
return value.map((entry, index) => sanitizeConfigValue(entry, [...keyPath, String(index)]));
|
|
213
|
-
}
|
|
214
|
-
if (value && typeof value === "object") {
|
|
215
|
-
return Object.fromEntries(Object.entries(value).map(([entryKey, entry]) => [
|
|
216
|
-
entryKey,
|
|
217
|
-
sanitizeConfigValue(entry, [...keyPath, entryKey])
|
|
218
|
-
]));
|
|
219
|
-
}
|
|
220
|
-
return value;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export { sanitizeDiagnosticText, hasShareabilitySensitiveText, sanitizeConfigValue };
|
package/dist/render-6vmqzcem.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
renderMessageByOrdinal2,
|
|
3
|
-
renderVerboseRangeForTool2,
|
|
4
|
-
renderItemByTag2
|
|
5
|
-
} from "./index-h7kta6cn.js";
|
|
6
|
-
import"./index-8v1brm5n.js";
|
|
7
|
-
import"./index-880a24vd.js";
|
|
8
|
-
import"./index-89bkkgcn.js";
|
|
9
|
-
import"./index-2amn2s73.js";
|
|
10
|
-
import"./index-tr4ep2ej.js";
|
|
11
|
-
import"./index-hp46xe93.js";
|
|
12
|
-
import"./index-w7n7qkpf.js";
|
|
13
|
-
import"./index-1zx87sdm.js";
|
|
14
|
-
import"./index-k34hc455.js";
|
|
15
|
-
import"./index-r3f85n7y.js";
|
|
16
|
-
import"./index-j4dcjb8t.js";
|
|
17
|
-
import"./index-fgw241hh.js";
|
|
18
|
-
import"./index-zkjx8gq3.js";
|
|
19
|
-
import"./index-fb3zxn06.js";
|
|
20
|
-
import"./index-dnpcv1rg.js";
|
|
21
|
-
import"./index-fr0wbhdn.js";
|
|
22
|
-
import"./index-hj78hvhm.js";
|
|
23
|
-
import"./index-89xg64wb.js";
|
|
24
|
-
import"./index-c205x7xd.js";
|
|
25
|
-
import"./index-cpbr0xvk.js";
|
|
26
|
-
import"./index-hedgz8an.js";
|
|
27
|
-
import"./index-96ztjvkn.js";
|
|
28
|
-
import"./index-v0p37hm2.js";
|
|
29
|
-
import"./index-58e3y90n.js";
|
|
30
|
-
import"./index-tqtpgnhr.js";
|
|
31
|
-
import"./index-6mryx739.js";
|
|
32
|
-
import"./index-3n4j5rqc.js";
|
|
33
|
-
import"./index-zfx7mtqa.js";
|
|
34
|
-
import"./index-gzy5w8ya.js";
|
|
35
|
-
import"./index-3fhb0j32.js";
|
|
36
|
-
import"./index-pavzsdc6.js";
|
|
37
|
-
import"./index-dt7cyqfe.js";
|
|
38
|
-
import"./index-1d042x6w.js";
|
|
39
|
-
export {
|
|
40
|
-
renderItemByTag2 as renderItemByTag,
|
|
41
|
-
renderMessageByOrdinal2 as renderMessageByOrdinal,
|
|
42
|
-
renderVerboseRangeForTool2 as renderVerboseRangeForTool
|
|
43
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureMemoryEmbeddings2
|
|
3
|
-
} from "./server-ganavh75.js";
|
|
4
|
-
import"./server-z5cv5wm5.js";
|
|
5
|
-
import"./server-qjwpqvnf.js";
|
|
6
|
-
import"./server-2amn2s73.js";
|
|
7
|
-
import"./server-qt1qqasc.js";
|
|
8
|
-
import"./server-7h4gwphm.js";
|
|
9
|
-
import"./server-arfzfxe8.js";
|
|
10
|
-
import"./server-6qax5pds.js";
|
|
11
|
-
import"./server-zemnpv92.js";
|
|
12
|
-
import"./server-k3ntgf6n.js";
|
|
13
|
-
import"./server-n33hyq9t.js";
|
|
14
|
-
import"./server-40vdz8sf.js";
|
|
15
|
-
import"./server-av3p9c8k.js";
|
|
16
|
-
import"./server-96ztjvkn.js";
|
|
17
|
-
import"./server-v0p37hm2.js";
|
|
18
|
-
import"./server-tq523gj6.js";
|
|
19
|
-
import"./server-73bqw5c0.js";
|
|
20
|
-
import"./server-n34vzyfm.js";
|
|
21
|
-
import"./server-2wz6y46g.js";
|
|
22
|
-
import"./server-gzy5w8ya.js";
|
|
23
|
-
import"./server-kzrrdjp5.js";
|
|
24
|
-
import"./server-pavzsdc6.js";
|
|
25
|
-
import"./server-dt7cyqfe.js";
|
|
26
|
-
import"./server-1d042x6w.js";
|
|
27
|
-
export {
|
|
28
|
-
ensureMemoryEmbeddings2 as ensureMemoryEmbeddings
|
|
29
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isRecompFailure2,
|
|
3
|
-
isRecompSkip2,
|
|
4
|
-
extractRecompReason2,
|
|
5
|
-
setRecompStarting2,
|
|
6
|
-
setRecompNote2,
|
|
7
|
-
setRecompTerminal2,
|
|
8
|
-
buildRecompDeps2,
|
|
9
|
-
runManagedRecomp2
|
|
10
|
-
} from "./server-1fnsfm3a.js";
|
|
11
|
-
import"./server-379fd3n7.js";
|
|
12
|
-
import"./server-nnh81jqy.js";
|
|
13
|
-
import"./server-ganavh75.js";
|
|
14
|
-
import"./server-9emdjcb5.js";
|
|
15
|
-
import"./server-z5cv5wm5.js";
|
|
16
|
-
import"./server-qjwpqvnf.js";
|
|
17
|
-
import"./server-qjjky07w.js";
|
|
18
|
-
import"./server-5t4nzfpt.js";
|
|
19
|
-
import"./server-svccj9rd.js";
|
|
20
|
-
import"./server-2amn2s73.js";
|
|
21
|
-
import"./server-vtkbxzw1.js";
|
|
22
|
-
import"./server-rt8t6s2a.js";
|
|
23
|
-
import"./server-2cq3e1c1.js";
|
|
24
|
-
import"./server-qt1qqasc.js";
|
|
25
|
-
import"./server-db91dxwc.js";
|
|
26
|
-
import"./server-11ra1pmx.js";
|
|
27
|
-
import"./server-1zx87sdm.js";
|
|
28
|
-
import"./server-bx5k66qc.js";
|
|
29
|
-
import"./server-63ree5ns.js";
|
|
30
|
-
import"./server-vj0xbbrc.js";
|
|
31
|
-
import"./server-rr5c0xcg.js";
|
|
32
|
-
import"./server-n5wn7d9b.js";
|
|
33
|
-
import"./server-y14pawe1.js";
|
|
34
|
-
import"./server-7h4gwphm.js";
|
|
35
|
-
import"./server-arfzfxe8.js";
|
|
36
|
-
import"./server-6qax5pds.js";
|
|
37
|
-
import"./server-zemnpv92.js";
|
|
38
|
-
import"./server-k3ntgf6n.js";
|
|
39
|
-
import"./server-vsx9tsks.js";
|
|
40
|
-
import"./server-fb3zxn06.js";
|
|
41
|
-
import"./server-2sare4qg.js";
|
|
42
|
-
import"./server-fr0wbhdn.js";
|
|
43
|
-
import"./server-n33hyq9t.js";
|
|
44
|
-
import"./server-40vdz8sf.js";
|
|
45
|
-
import"./server-2qvnr3t7.js";
|
|
46
|
-
import"./server-4yrvbnnm.js";
|
|
47
|
-
import"./server-av3p9c8k.js";
|
|
48
|
-
import"./server-96ztjvkn.js";
|
|
49
|
-
import"./server-v0p37hm2.js";
|
|
50
|
-
import"./server-2ra6pwf3.js";
|
|
51
|
-
import"./server-tq523gj6.js";
|
|
52
|
-
import"./server-73bqw5c0.js";
|
|
53
|
-
import"./server-n34vzyfm.js";
|
|
54
|
-
import"./server-2wz6y46g.js";
|
|
55
|
-
import"./server-gzy5w8ya.js";
|
|
56
|
-
import"./server-kzrrdjp5.js";
|
|
57
|
-
import"./server-pavzsdc6.js";
|
|
58
|
-
import"./server-dt7cyqfe.js";
|
|
59
|
-
import"./server-1d042x6w.js";
|
|
60
|
-
export {
|
|
61
|
-
buildRecompDeps2 as buildRecompDeps,
|
|
62
|
-
extractRecompReason2 as extractRecompReason,
|
|
63
|
-
isRecompFailure2 as isRecompFailure,
|
|
64
|
-
isRecompSkip2 as isRecompSkip,
|
|
65
|
-
runManagedRecomp2 as runManagedRecomp,
|
|
66
|
-
setRecompNote2 as setRecompNote,
|
|
67
|
-
setRecompStarting2 as setRecompStarting,
|
|
68
|
-
setRecompTerminal2 as setRecompTerminal
|
|
69
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
renderMessageByOrdinal2,
|
|
3
|
-
renderVerboseRangeForTool2,
|
|
4
|
-
renderItemByTag2
|
|
5
|
-
} from "./server-gh2w75fn.js";
|
|
6
|
-
import"./server-qjjky07w.js";
|
|
7
|
-
import"./server-5t4nzfpt.js";
|
|
8
|
-
import"./server-svccj9rd.js";
|
|
9
|
-
import"./server-2amn2s73.js";
|
|
10
|
-
import"./server-vtkbxzw1.js";
|
|
11
|
-
import"./server-db91dxwc.js";
|
|
12
|
-
import"./server-11ra1pmx.js";
|
|
13
|
-
import"./server-1zx87sdm.js";
|
|
14
|
-
import"./server-bx5k66qc.js";
|
|
15
|
-
import"./server-arfzfxe8.js";
|
|
16
|
-
import"./server-zemnpv92.js";
|
|
17
|
-
import"./server-k3ntgf6n.js";
|
|
18
|
-
import"./server-vsx9tsks.js";
|
|
19
|
-
import"./server-fb3zxn06.js";
|
|
20
|
-
import"./server-2sare4qg.js";
|
|
21
|
-
import"./server-fr0wbhdn.js";
|
|
22
|
-
import"./server-n33hyq9t.js";
|
|
23
|
-
import"./server-40vdz8sf.js";
|
|
24
|
-
import"./server-2qvnr3t7.js";
|
|
25
|
-
import"./server-4yrvbnnm.js";
|
|
26
|
-
import"./server-av3p9c8k.js";
|
|
27
|
-
import"./server-96ztjvkn.js";
|
|
28
|
-
import"./server-v0p37hm2.js";
|
|
29
|
-
import"./server-2ra6pwf3.js";
|
|
30
|
-
import"./server-tq523gj6.js";
|
|
31
|
-
import"./server-73bqw5c0.js";
|
|
32
|
-
import"./server-n34vzyfm.js";
|
|
33
|
-
import"./server-2wz6y46g.js";
|
|
34
|
-
import"./server-gzy5w8ya.js";
|
|
35
|
-
import"./server-kzrrdjp5.js";
|
|
36
|
-
import"./server-pavzsdc6.js";
|
|
37
|
-
import"./server-dt7cyqfe.js";
|
|
38
|
-
import"./server-1d042x6w.js";
|
|
39
|
-
export {
|
|
40
|
-
renderItemByTag2 as renderItemByTag,
|
|
41
|
-
renderMessageByOrdinal2 as renderMessageByOrdinal,
|
|
42
|
-
renderVerboseRangeForTool2 as renderVerboseRangeForTool
|
|
43
|
-
};
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
// src/shared/redaction.ts
|
|
2
|
-
import { homedir, userInfo } from "node:os";
|
|
3
|
-
function escapeRegex(value) {
|
|
4
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
5
|
-
}
|
|
6
|
-
var SECRET_WORDS = [
|
|
7
|
-
"key",
|
|
8
|
-
"token",
|
|
9
|
-
"secret",
|
|
10
|
-
"password",
|
|
11
|
-
"auth",
|
|
12
|
-
"authorization",
|
|
13
|
-
"bearer",
|
|
14
|
-
"credential"
|
|
15
|
-
];
|
|
16
|
-
var SECRET_SEGMENT_PATTERN = new RegExp(`^(?:${SECRET_WORDS.map((w) => `${w}s?`).join("|")})$`, "i");
|
|
17
|
-
var TRAILING_DESCRIPTORS = new Set(["id", "ids", "value", "values", "header", "headers"]);
|
|
18
|
-
function redactionTypeForKey(key) {
|
|
19
|
-
const normalized = key.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g, "_");
|
|
20
|
-
const suffix = normalized.split(".").filter(Boolean).at(-1) ?? normalized;
|
|
21
|
-
return suffix || "secret";
|
|
22
|
-
}
|
|
23
|
-
function isNonSecretScalarValue(value) {
|
|
24
|
-
const v = value.trim();
|
|
25
|
-
if (v === "true" || v === "false" || v === "null" || v === "undefined")
|
|
26
|
-
return true;
|
|
27
|
-
return /^[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(v);
|
|
28
|
-
}
|
|
29
|
-
var SECRET_QUALIFIERS = new Set([
|
|
30
|
-
"api",
|
|
31
|
-
"access",
|
|
32
|
-
"private",
|
|
33
|
-
"client",
|
|
34
|
-
"auth",
|
|
35
|
-
"authorization",
|
|
36
|
-
"secret",
|
|
37
|
-
"bearer",
|
|
38
|
-
"session",
|
|
39
|
-
"refresh",
|
|
40
|
-
"service",
|
|
41
|
-
"x",
|
|
42
|
-
"openai",
|
|
43
|
-
"anthropic",
|
|
44
|
-
"google",
|
|
45
|
-
"github",
|
|
46
|
-
"huggingface",
|
|
47
|
-
"aws",
|
|
48
|
-
"azure",
|
|
49
|
-
"id"
|
|
50
|
-
]);
|
|
51
|
-
var UNQUALIFIED_SECRET_SEGMENT_PATTERN = /^(?:password|secret|credential|bearer|authorization)s?$/;
|
|
52
|
-
function isSecretKey(key) {
|
|
53
|
-
const segments = key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().split(/[._-]+/).filter(Boolean);
|
|
54
|
-
if (segments.length === 0)
|
|
55
|
-
return false;
|
|
56
|
-
if (segments.length === 1) {
|
|
57
|
-
const first = segments[0];
|
|
58
|
-
return Boolean(first && SECRET_SEGMENT_PATTERN.test(first));
|
|
59
|
-
}
|
|
60
|
-
for (let i = 0;i < segments.length; i++) {
|
|
61
|
-
const seg = segments[i];
|
|
62
|
-
if (!seg || !SECRET_SEGMENT_PATTERN.test(seg))
|
|
63
|
-
continue;
|
|
64
|
-
let trailingOk = true;
|
|
65
|
-
for (let j = i + 1;j < segments.length; j++) {
|
|
66
|
-
const tail = segments[j];
|
|
67
|
-
if (!tail)
|
|
68
|
-
continue;
|
|
69
|
-
if (TRAILING_DESCRIPTORS.has(tail))
|
|
70
|
-
continue;
|
|
71
|
-
if (SECRET_SEGMENT_PATTERN.test(tail))
|
|
72
|
-
continue;
|
|
73
|
-
trailingOk = false;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
if (!trailingOk)
|
|
77
|
-
continue;
|
|
78
|
-
if (UNQUALIFIED_SECRET_SEGMENT_PATTERN.test(seg))
|
|
79
|
-
return true;
|
|
80
|
-
for (let k = i - 1;k >= 0; k--) {
|
|
81
|
-
const lead = segments[k];
|
|
82
|
-
if (lead && SECRET_QUALIFIERS.has(lead))
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
function sanitizePathString(value) {
|
|
89
|
-
const home = process.env.HOME || process.env.USERPROFILE || homedir();
|
|
90
|
-
const username = userInfo().username;
|
|
91
|
-
let sanitized = value;
|
|
92
|
-
if (home) {
|
|
93
|
-
sanitized = sanitized.replace(new RegExp(escapeRegex(home), "g"), "~");
|
|
94
|
-
}
|
|
95
|
-
sanitized = sanitized.replace(/\/Users\/[^/]+\//g, "/Users/<USER>/");
|
|
96
|
-
sanitized = sanitized.replace(/\/home\/[^/]+\//g, "/home/<USER>/");
|
|
97
|
-
sanitized = sanitized.replace(/C:\\Users\\[^\\]+\\/g, "C:\\Users\\<USER>\\");
|
|
98
|
-
if (username) {
|
|
99
|
-
const word = "[\\p{L}\\p{M}\\p{N}_]";
|
|
100
|
-
sanitized = sanitized.replace(new RegExp(`(?<!${word})${escapeRegex(username)}(?!${word})`, "gu"), "<USER>");
|
|
101
|
-
}
|
|
102
|
-
return sanitized;
|
|
103
|
-
}
|
|
104
|
-
var SECRET_TEXT_PATTERNS = [
|
|
105
|
-
{
|
|
106
|
-
pattern: /\bsk-ant-(?:api03-)?[A-Za-z0-9_-]{32,}/g,
|
|
107
|
-
replacement: "<ANTHROPIC_API_KEY_REDACTED>"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
pattern: /\bsk-(?:proj-)?[A-Za-z0-9_-]{12,}/g,
|
|
111
|
-
replacement: "<OPENAI_API_KEY_REDACTED>"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}/g,
|
|
115
|
-
replacement: "<GITHUB_PAT_REDACTED>"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-9_-]{30,}/g,
|
|
119
|
-
replacement: "<GITHUB_TOKEN_REDACTED>"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
pattern: /\bhf_[A-Za-z0-9]{30,}/g,
|
|
123
|
-
replacement: "<HUGGINGFACE_TOKEN_REDACTED>"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
pattern: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,
|
|
127
|
-
replacement: "<AWS_ACCESS_KEY_ID_REDACTED>"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
pattern: /\bxox[abprsuvc]-[A-Za-z0-9-]{10,}/g,
|
|
131
|
-
replacement: "<SLACK_TOKEN_REDACTED>"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
pattern: /\bAIza[A-Za-z0-9_-]{35}\b/g,
|
|
135
|
-
replacement: "<GOOGLE_API_KEY_REDACTED>"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
pattern: /\b(Authorization\s*:\s*Bearer\s+)([A-Za-z0-9._~+/=-]{8,})/gi,
|
|
139
|
-
replacement: (_full, prefix) => `${prefix}<REDACTED:bearer>`
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
pattern: /\b((?:Proxy-)?Authorization\s*:\s*(?:Basic|Digest|Token|Negotiate|NTLM)\s+)([A-Za-z0-9._~+/=-]{4,})/gi,
|
|
143
|
-
replacement: (_full, prefix) => `${prefix}<REDACTED:authorization>`
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
pattern: /\b((?:x-)?(?:api-?key|api-?token|auth-?token|access-?token)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
147
|
-
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:api_key>`
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
pattern: /\b((?:api[_-]?key|client[_-]?secret|access[_-]?token|token|secret|password|passwd|pwd)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
151
|
-
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:credential>`
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
pattern: /\b([a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:)([^\s/@]+)(@)/gi,
|
|
155
|
-
replacement: (_full, prefix, _password, at) => `${prefix}<REDACTED:password>${at}`
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
pattern: /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
|
|
159
|
-
replacement: "<JWT_REDACTED>"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
pattern: /(["'])([^"']*(?:key|token|secret|password|auth|bearer|credential)[^"']*)\1(\s*:\s*)(["'])([^"']*)\4/gi,
|
|
163
|
-
replacement: (full, quote, key, separator, valueQuote, value) => isNonSecretScalarValue(value) ? full : `${quote}${key}${quote}${separator}${valueQuote}<REDACTED:${redactionTypeForKey(key)}>${valueQuote}`
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
pattern: /\b([A-Za-z0-9_.-]*(?:key|token|secret|password|auth|bearer|credential)[A-Za-z0-9_.-]*)\s*=\s*([^\s'"`]+)/gi,
|
|
167
|
-
replacement: (full, key, value) => isNonSecretScalarValue(value) ? full : `${key}=<REDACTED:${redactionTypeForKey(key)}>`
|
|
168
|
-
}
|
|
169
|
-
];
|
|
170
|
-
function redactSecretText(value) {
|
|
171
|
-
let redacted = value;
|
|
172
|
-
for (const { pattern, replacement } of SECRET_TEXT_PATTERNS) {
|
|
173
|
-
if (typeof replacement === "string") {
|
|
174
|
-
redacted = redacted.replace(pattern, replacement);
|
|
175
|
-
} else {
|
|
176
|
-
redacted = redacted.replace(pattern, replacement);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return redacted;
|
|
180
|
-
}
|
|
181
|
-
function sanitizeDiagnosticText(value) {
|
|
182
|
-
return redactSecretText(sanitizePathString(value));
|
|
183
|
-
}
|
|
184
|
-
var SHAREABILITY_SENSITIVE_PATTERNS = [
|
|
185
|
-
/\bC:\/Users\/[^/\s]+/i,
|
|
186
|
-
/(?:^|\s)~\/[^\s]+/,
|
|
187
|
-
/\b(?:api[_-]?key|secret|token|password|passwd|pwd|client[_-]?secret|access[_-]?key)\b\s*[:=]\s*\S+/i,
|
|
188
|
-
/\b(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(?::\d+)?\b/i,
|
|
189
|
-
/\b(?:10|127)\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/,
|
|
190
|
-
/\b192\.168\.\d{1,3}\.\d{1,3}\b/,
|
|
191
|
-
/\b172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}\b/
|
|
192
|
-
];
|
|
193
|
-
function hasShareabilitySensitiveText(text) {
|
|
194
|
-
try {
|
|
195
|
-
if (sanitizeDiagnosticText(text) !== text)
|
|
196
|
-
return true;
|
|
197
|
-
return SHAREABILITY_SENSITIVE_PATTERNS.some((pattern) => pattern.test(text));
|
|
198
|
-
} catch {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
function sanitizeConfigValue(value, keyPath = []) {
|
|
203
|
-
if (value === null || typeof value === "number" || typeof value === "boolean")
|
|
204
|
-
return value;
|
|
205
|
-
const key = keyPath.at(-1) ?? "";
|
|
206
|
-
if (key && isSecretKey(key)) {
|
|
207
|
-
return `<REDACTED:${redactionTypeForKey(key)}>`;
|
|
208
|
-
}
|
|
209
|
-
if (typeof value === "string")
|
|
210
|
-
return sanitizeDiagnosticText(value);
|
|
211
|
-
if (Array.isArray(value)) {
|
|
212
|
-
return value.map((entry, index) => sanitizeConfigValue(entry, [...keyPath, String(index)]));
|
|
213
|
-
}
|
|
214
|
-
if (value && typeof value === "object") {
|
|
215
|
-
return Object.fromEntries(Object.entries(value).map(([entryKey, entry]) => [
|
|
216
|
-
entryKey,
|
|
217
|
-
sanitizeConfigValue(entry, [...keyPath, entryKey])
|
|
218
|
-
]));
|
|
219
|
-
}
|
|
220
|
-
return value;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export { sanitizeDiagnosticText, hasShareabilitySensitiveText, sanitizeConfigValue };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runManagedWrapup2
|
|
3
|
-
} from "./index-mmf6e740.js";
|
|
4
|
-
import"./index-w9hxgntq.js";
|
|
5
|
-
import"./index-x49x59ar.js";
|
|
6
|
-
import"./index-azkfw78y.js";
|
|
7
|
-
import"./index-sd3egckz.js";
|
|
8
|
-
import"./index-910gahfb.js";
|
|
9
|
-
import"./index-0bjj9yf3.js";
|
|
10
|
-
import"./index-9emdjcb5.js";
|
|
11
|
-
import"./index-7m2tnk8q.js";
|
|
12
|
-
import"./index-qjwpqvnf.js";
|
|
13
|
-
import"./index-8v1brm5n.js";
|
|
14
|
-
import"./index-880a24vd.js";
|
|
15
|
-
import"./index-89bkkgcn.js";
|
|
16
|
-
import"./index-2amn2s73.js";
|
|
17
|
-
import"./index-tr4ep2ej.js";
|
|
18
|
-
import"./index-45qgkg8j.js";
|
|
19
|
-
import"./index-fqth7850.js";
|
|
20
|
-
import"./index-kj4bprep.js";
|
|
21
|
-
import"./index-qt1qqasc.js";
|
|
22
|
-
import"./index-hp46xe93.js";
|
|
23
|
-
import"./index-w7n7qkpf.js";
|
|
24
|
-
import"./index-1zx87sdm.js";
|
|
25
|
-
import"./index-k34hc455.js";
|
|
26
|
-
import"./index-y14pawe1.js";
|
|
27
|
-
import"./index-jzrvdqb8.js";
|
|
28
|
-
import"./index-r1d45dsr.js";
|
|
29
|
-
import"./index-r3f85n7y.js";
|
|
30
|
-
import"./index-7sdns2ww.js";
|
|
31
|
-
import"./index-j4dcjb8t.js";
|
|
32
|
-
import"./index-fgw241hh.js";
|
|
33
|
-
import"./index-zkjx8gq3.js";
|
|
34
|
-
import"./index-fb3zxn06.js";
|
|
35
|
-
import"./index-dnpcv1rg.js";
|
|
36
|
-
import"./index-fr0wbhdn.js";
|
|
37
|
-
import"./index-hj78hvhm.js";
|
|
38
|
-
import"./index-89xg64wb.js";
|
|
39
|
-
import"./index-c205x7xd.js";
|
|
40
|
-
import"./index-cpbr0xvk.js";
|
|
41
|
-
import"./index-hedgz8an.js";
|
|
42
|
-
import"./index-96ztjvkn.js";
|
|
43
|
-
import"./index-v0p37hm2.js";
|
|
44
|
-
import"./index-58e3y90n.js";
|
|
45
|
-
import"./index-tqtpgnhr.js";
|
|
46
|
-
import"./index-6mryx739.js";
|
|
47
|
-
import"./index-3n4j5rqc.js";
|
|
48
|
-
import"./index-zfx7mtqa.js";
|
|
49
|
-
import"./index-gzy5w8ya.js";
|
|
50
|
-
import"./index-3fhb0j32.js";
|
|
51
|
-
import"./index-pavzsdc6.js";
|
|
52
|
-
import"./index-dt7cyqfe.js";
|
|
53
|
-
import"./index-1d042x6w.js";
|
|
54
|
-
export {
|
|
55
|
-
runManagedWrapup2 as runManagedWrapup
|
|
56
|
-
};
|