@pensar/apex 2.4.0 → 2.5.0-canary.22f2eb52
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/build/agent-7qtpem5z.js +12 -0
- package/build/agent-9khcyh5t.js +14 -0
- package/build/agent-bsyhck0a.js +12 -0
- package/build/{agent-5ejt5vpz.js → agent-ywewzc2h.js} +42 -42
- package/build/{apps-17wvz1d7.js → apps-11akynyv.js} +74 -43
- package/build/{auth-z3h9859n.js → auth-dd6r9mk4.js} +57 -61
- package/build/blackboxAgent-hbra4k00.js +12 -0
- package/build/blackboxPentest-bn5evs2z.js +61 -0
- package/build/{cli-xshasbwe.js → cli-3v9zs5wm.js} +31 -52
- package/build/{cli-mavved45.js → cli-4z46kyrk.js} +86 -93
- package/build/cli-7vby0hk6.js +12136 -0
- package/build/{cli-gq40s5b3.js → cli-8kkaeb70.js} +33 -46
- package/build/cli-8w8k4dph.js +15 -0
- package/build/cli-ag6jtndp.js +32 -0
- package/build/{cli-2cbwdk78.js → cli-ak78mweh.js} +4 -4
- package/build/cli-bb02pjt0.js +1485 -0
- package/build/{cli-k71t434r.js → cli-ec2hwkv3.js} +34 -76
- package/build/{cli-vnynf0js.js → cli-f5rw841m.js} +11 -5
- package/build/{cli-k8kc47pq.js → cli-gamfs2yq.js} +118 -115
- package/build/{cli-32z0017y.js → cli-gq5sk2j3.js} +36 -60
- package/build/{cli-bc05qbss.js → cli-h6y3bt60.js} +13 -21
- package/build/{cli-tkc598ey.js → cli-j1916nvj.js} +10035 -7661
- package/build/{cli-5k33webc.js → cli-jw1xftqm.js} +355 -332
- package/build/{cli-tznv8pf1.js → cli-n4h7ygp5.js} +4 -4
- package/build/{cli-b1adytsy.js → cli-q45hcq3f.js} +67 -39
- package/build/{cli-repbyhkk.js → cli-qkb3v2nw.js} +26063 -25373
- package/build/{cli-j54qa6tm.js → cli-qktcyj48.js} +1 -1
- package/build/cli-retw3rw5.js +12 -0
- package/build/cli-tjm77pmx.js +12075 -0
- package/build/{cli-dm0fc0bm.js → cli-v1sarr4y.js} +5 -9
- package/build/{cli-9rhzhgx2.js → cli-v8ph8hy2.js} +5 -5
- package/build/{cli-vq52kp7j.js → cli-vkxx4jzv.js} +147 -128
- package/build/cli-wfb4gde1.js +22 -0
- package/build/{cli-ee3axgts.js → cli-xbhr5khz.js} +1 -1
- package/build/cli-z82n3qk1.js +6 -0
- package/build/cli.js +689 -132
- package/build/{config-f1mj4nhd.js → config-kv5v9ctn.js} +29 -29
- package/build/{doctor-ekneewa3.js → doctor-xs4s5km8.js} +4 -9
- package/build/{fastStrike-8zka43xs.js → fastStrike-b8t8f916.js} +26 -28
- package/build/{fixes-b89s5haw.js → fixes-kcckqx3s.js} +22 -27
- package/build/getMachineId-bsd-zr67nd9p.js +36 -0
- package/build/getMachineId-darwin-fd1d562d.js +36 -0
- package/build/getMachineId-linux-kjmg243j.js +29 -0
- package/build/getMachineId-unsupported-n4r58vke.js +19 -0
- package/build/getMachineId-win-yzgpfsrb.js +38 -0
- package/build/index-3mzr07h0.js +9 -0
- package/build/index-63zf8jxx.js +12 -0
- package/build/index-a1bg29j1.js +1559 -0
- package/build/{index-cbwn03kz.js → index-a2xycbjs.js} +12 -31
- package/build/{index-6d22pyxt.js → index-ae81pvwg.js} +2995 -2432
- package/build/index-cbajq2xy.js +17 -0
- package/build/index-cn4p95gh.js +100 -0
- package/build/index-kas88svr.js +36 -0
- package/build/index-mr20g8k4.js +22 -0
- package/build/{index-psqjpw5m.js → index-nweqptgs.js} +7 -7
- package/build/{index-sf16jm0m.js → index-rx5jn1nz.js} +137 -162
- package/build/{issues-xx5bs4md.js → issues-jm28k288.js} +81 -35
- package/build/{logs-qtxe51w2.js → logs-r02tbz89.js} +20 -25
- package/build/{multipart-parser-g2xxkezz.js → multipart-parser-vjjdbpd1.js} +10 -10
- package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-mmfejh1j.js} +6 -13
- package/build/{parse-rtccymzn.js → parse-cqecqrc5.js} +0 -4
- package/build/pentest-13jcm4cy.js +21 -0
- package/build/{pentests-6ks3szc4.js → pentests-jyn4zs7n.js} +23 -28
- package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-m3qkbpv6.js} +16 -20
- package/build/{targets-sxygyj87.js → targets-rqv57as0.js} +22 -27
- package/build/threatModel-scmz36xr.js +19 -0
- package/build/{token-3bbp59y6.js → token-n0tmq8n5.js} +2 -2
- package/build/{token-util-6xjme11b.js → token-util-bv80pj47.js} +1 -2
- package/build/{uninstall-tvsh81v8.js → uninstall-bme62bdg.js} +7 -4
- package/build/{upload-7wdyyqmr.js → upload-hwpgx1ha.js} +7 -13
- package/build/{utils-7fwdkqk6.js → utils-abtz5mmk.js} +7 -29
- package/package.json +8 -2
- package/build/agent-mvpgvgks.js +0 -19
- package/build/agent-nhs1w5w0.js +0 -29
- package/build/authentication-3s97cpk4.js +0 -19
- package/build/blackboxAgent-gw0a1ca4.js +0 -19
- package/build/blackboxPentest-44333zss.js +0 -37
- package/build/cli-0n4r54hq.js +0 -414
- package/build/cli-72cvcqhg.js +0 -22
- package/build/cli-qqt4gj1w.js +0 -53
- package/build/cli-swpbx60z.js +0 -24441
- package/build/index-4ad3sdwk.js +0 -39
- package/build/index-ghwf5z3v.js +0 -12
- package/build/index-hqjdg6fg.js +0 -205
- package/build/index-mtq7kmxz.js +0 -12856
- package/build/index-rbzhk712.js +0 -33
- package/build/index-y5w6n3tb.js +0 -19
- package/build/main-mmjp338j.js +0 -324
- package/build/pentest-xtc1sjdw.js +0 -29
- package/build/threatModel-xsm6fwk5.js +0 -27
- /package/build/{cli-c8131c4q.js → cli-0wsh8j2t.js} +0 -0
- /package/build/{cli-e08r86zk.js → cli-b3dvxjgk.js} +0 -0
- /package/build/{cli-fw5r7pfj.js → cli-q126f6ef.js} +0 -0
- /package/build/{cli-9fsre5pt.js → cli-qba2x69h.js} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
import {
|
|
3
|
+
config2,
|
|
4
|
+
init_config
|
|
5
|
+
} from "./cli-wfb4gde1.js";
|
|
2
6
|
import {
|
|
3
7
|
isSensitiveHeaderName,
|
|
4
8
|
renderHeaderValue
|
|
5
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-b3dvxjgk.js";
|
|
6
10
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
parseHeadersFromFile
|
|
10
|
-
} from "./cli-dm0fc0bm.js";
|
|
11
|
+
markCommandFailed
|
|
12
|
+
} from "./cli-z82n3qk1.js";
|
|
11
13
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import"./cli-vnynf0js.js";
|
|
17
|
-
import"./cli-bc05qbss.js";
|
|
14
|
+
parseHeaderLine2,
|
|
15
|
+
parseHeadersFromFile2,
|
|
16
|
+
formatParseError2
|
|
17
|
+
} from "./cli-v1sarr4y.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/config.ts
|
|
20
20
|
init_config();
|
|
@@ -50,11 +50,11 @@ function printHeaders(headers, showSecrets) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
async function loadDefaults() {
|
|
53
|
-
const cfg = await
|
|
53
|
+
const cfg = await config2.get();
|
|
54
54
|
return cfg.defaultHeaders ? { ...cfg.defaultHeaders } : {};
|
|
55
55
|
}
|
|
56
56
|
async function saveDefaults(headers) {
|
|
57
|
-
await
|
|
57
|
+
await config2.update({
|
|
58
58
|
defaultHeaders: headers,
|
|
59
59
|
defaultHeadersUpdatedAt: new Date().toISOString()
|
|
60
60
|
});
|
|
@@ -68,19 +68,19 @@ async function cmdAdd(args, allowOverwrite) {
|
|
|
68
68
|
const value = args[0];
|
|
69
69
|
if (!value) {
|
|
70
70
|
console.error('Error: expected "Name: Value" argument');
|
|
71
|
-
|
|
71
|
+
return markCommandFailed();
|
|
72
72
|
}
|
|
73
|
-
const parsed =
|
|
73
|
+
const parsed = parseHeaderLine2(value);
|
|
74
74
|
if (!parsed.ok) {
|
|
75
75
|
console.error(`Invalid header:
|
|
76
|
-
${
|
|
77
|
-
|
|
76
|
+
${formatParseError2(parsed.error)}`);
|
|
77
|
+
return markCommandFailed();
|
|
78
78
|
}
|
|
79
79
|
const headers = await loadDefaults();
|
|
80
80
|
const canonical = Object.keys(headers).find((k) => k.toLowerCase() === parsed.value.name.toLowerCase());
|
|
81
81
|
if (canonical && !allowOverwrite) {
|
|
82
82
|
console.error(`Header "${canonical}" already exists. Use \`pensar config headers set\` to overwrite.`);
|
|
83
|
-
|
|
83
|
+
return markCommandFailed();
|
|
84
84
|
}
|
|
85
85
|
if (canonical && canonical !== parsed.value.name) {
|
|
86
86
|
delete headers[canonical];
|
|
@@ -93,13 +93,13 @@ async function cmdRemove(args) {
|
|
|
93
93
|
const name = args[0];
|
|
94
94
|
if (!name) {
|
|
95
95
|
console.error("Error: expected <Name> argument");
|
|
96
|
-
|
|
96
|
+
return markCommandFailed();
|
|
97
97
|
}
|
|
98
98
|
const headers = await loadDefaults();
|
|
99
99
|
const canonical = Object.keys(headers).find((k) => k.toLowerCase() === name.toLowerCase());
|
|
100
100
|
if (!canonical) {
|
|
101
101
|
console.error(`No default header named "${name}".`);
|
|
102
|
-
|
|
102
|
+
return markCommandFailed();
|
|
103
103
|
}
|
|
104
104
|
delete headers[canonical];
|
|
105
105
|
await saveDefaults(headers);
|
|
@@ -109,7 +109,7 @@ async function cmdClear(args) {
|
|
|
109
109
|
const confirmed = args.includes("--yes") || args.includes("-y");
|
|
110
110
|
if (!confirmed) {
|
|
111
111
|
console.error("Refusing to clear without confirmation. Pass --yes to proceed.");
|
|
112
|
-
|
|
112
|
+
return markCommandFailed();
|
|
113
113
|
}
|
|
114
114
|
await saveDefaults({});
|
|
115
115
|
console.log("Cleared all default headers.");
|
|
@@ -118,15 +118,15 @@ async function cmdImport(args) {
|
|
|
118
118
|
const file = args[0];
|
|
119
119
|
if (!file) {
|
|
120
120
|
console.error("Error: expected <file> argument");
|
|
121
|
-
|
|
121
|
+
return markCommandFailed();
|
|
122
122
|
}
|
|
123
|
-
const parsed = await
|
|
123
|
+
const parsed = await parseHeadersFromFile2(file);
|
|
124
124
|
if (!parsed.ok) {
|
|
125
125
|
for (const err of parsed.error) {
|
|
126
126
|
console.error(`Import error:
|
|
127
|
-
${
|
|
127
|
+
${formatParseError2(err)}`);
|
|
128
128
|
}
|
|
129
|
-
|
|
129
|
+
return markCommandFailed();
|
|
130
130
|
}
|
|
131
131
|
const next = {};
|
|
132
132
|
for (const entry of parsed.value) {
|
|
@@ -145,7 +145,7 @@ async function main() {
|
|
|
145
145
|
if (sub !== "headers") {
|
|
146
146
|
console.error(`Unknown 'pensar config' subcommand: ${sub}`);
|
|
147
147
|
console.error("Only 'headers' is supported today.");
|
|
148
|
-
|
|
148
|
+
return markCommandFailed();
|
|
149
149
|
}
|
|
150
150
|
const op = args[1];
|
|
151
151
|
const rest = args.slice(2);
|
|
@@ -178,11 +178,11 @@ async function main() {
|
|
|
178
178
|
default:
|
|
179
179
|
console.error(`Unknown headers operation: ${op}`);
|
|
180
180
|
showHelp();
|
|
181
|
-
|
|
181
|
+
return markCommandFailed();
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
main().catch((err) => {
|
|
184
|
+
await main().catch((err) => {
|
|
185
185
|
console.error(`
|
|
186
186
|
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
187
|
-
|
|
187
|
+
return markCommandFailed();
|
|
188
188
|
});
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import"./cli-wfb4gde1.js";
|
|
2
|
+
import"./cli-j1916nvj.js";
|
|
1
3
|
import {
|
|
2
4
|
toolExists
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-0n4r54hq.js";
|
|
6
|
-
import"./cli-swpbx60z.js";
|
|
7
|
-
import"./cli-j54qa6tm.js";
|
|
8
|
-
import"./cli-72cvcqhg.js";
|
|
9
|
-
import"./cli-9rhzhgx2.js";
|
|
10
|
-
import"./cli-vnynf0js.js";
|
|
11
|
-
import"./cli-bc05qbss.js";
|
|
5
|
+
} from "./cli-n4h7ygp5.js";
|
|
6
|
+
import"./cli-qktcyj48.js";
|
|
12
7
|
|
|
13
8
|
// src/core/doctor.ts
|
|
14
9
|
import { execSync, spawnSync } from "node:child_process";
|
|
@@ -1,40 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
REPORT_FILENAME_JSON,
|
|
3
|
-
REPORT_FILENAME_MD,
|
|
4
|
-
buildPentestReport,
|
|
5
|
-
renderJson,
|
|
6
|
-
renderMarkdown
|
|
7
|
-
} from "./cli-b1adytsy.js";
|
|
8
|
-
import"./cli-9fsre5pt.js";
|
|
9
|
-
import"./cli-qqt4gj1w.js";
|
|
10
1
|
import {
|
|
11
2
|
FindingsRegistry,
|
|
12
3
|
OffensiveSecurityAgent
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
4
|
+
} from "./cli-qkb3v2nw.js";
|
|
5
|
+
import"./cli-wfb4gde1.js";
|
|
6
|
+
import {
|
|
7
|
+
init_zod
|
|
8
|
+
} from "./cli-j1916nvj.js";
|
|
9
|
+
import"./cli-n4h7ygp5.js";
|
|
10
|
+
import {
|
|
11
|
+
buildPentestReport,
|
|
12
|
+
renderJson,
|
|
13
|
+
renderMarkdown,
|
|
14
|
+
REPORT_FILENAME_MD,
|
|
15
|
+
REPORT_FILENAME_JSON
|
|
16
|
+
} from "./cli-q45hcq3f.js";
|
|
17
|
+
import"./cli-qba2x69h.js";
|
|
15
18
|
import {
|
|
16
19
|
createThreatModelPrompt
|
|
17
|
-
} from "./cli-
|
|
18
|
-
import"./cli-c8131c4q.js";
|
|
19
|
-
import"./cli-tkc598ey.js";
|
|
20
|
-
import"./cli-0n4r54hq.js";
|
|
20
|
+
} from "./cli-q126f6ef.js";
|
|
21
21
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-9rhzhgx2.js";
|
|
28
|
-
import"./cli-vnynf0js.js";
|
|
29
|
-
import"./cli-bc05qbss.js";
|
|
22
|
+
string,
|
|
23
|
+
boolean,
|
|
24
|
+
object
|
|
25
|
+
} from "./cli-tjm77pmx.js";
|
|
26
|
+
import"./cli-qktcyj48.js";
|
|
30
27
|
|
|
31
28
|
// src/core/workflows/fastStrike.ts
|
|
32
29
|
init_zod();
|
|
33
30
|
import { writeFileSync } from "node:fs";
|
|
34
31
|
import { join } from "node:path";
|
|
35
|
-
var FastStrikeResult =
|
|
36
|
-
solved:
|
|
37
|
-
summary:
|
|
32
|
+
var FastStrikeResult = object({
|
|
33
|
+
solved: boolean().describe("True if the objective was achieved — a vulnerability was confirmed and, where applicable, the flag or sensitive data was extracted."),
|
|
34
|
+
summary: string().describe("Concise account of the vulnerability exploited, the exact steps that worked, and any flag or sensitive data recovered.")
|
|
38
35
|
});
|
|
39
36
|
var FAST_STRIKE_SYSTEM_PROMPT = `You are an elite offensive security operator running a fast strike against a single target. You work ALONE and finish the job yourself — there is no team to hand off to, no swarm to spawn, no plan to file. Your edge is discipline and observation, not volume.
|
|
40
37
|
|
|
@@ -63,6 +60,7 @@ async function runFastStrike(input) {
|
|
|
63
60
|
abortSignal,
|
|
64
61
|
eventBus,
|
|
65
62
|
onStepFinish,
|
|
63
|
+
onCacheMetrics,
|
|
66
64
|
enableThinking,
|
|
67
65
|
openAIReasoningEffort,
|
|
68
66
|
prompt,
|
|
@@ -97,7 +95,7 @@ ${combined}` : combined;
|
|
|
97
95
|
label: "Fast Strike",
|
|
98
96
|
metadata: { target }
|
|
99
97
|
});
|
|
100
|
-
const findingsRegistry = FindingsRegistry.fromDirectory(session.findingsPath, { model, authConfig, abortSignal });
|
|
98
|
+
const findingsRegistry = FindingsRegistry.fromDirectory(session.findingsPath, { model, authConfig, abortSignal, sessionId: session.id });
|
|
101
99
|
const promptParts = [`Target: ${target}`];
|
|
102
100
|
if (operatorGuidance)
|
|
103
101
|
promptParts.push(operatorGuidance);
|
|
@@ -119,6 +117,7 @@ ${combined}` : combined;
|
|
|
119
117
|
abortSignal,
|
|
120
118
|
eventBus,
|
|
121
119
|
onStepFinish,
|
|
120
|
+
onCacheMetrics,
|
|
122
121
|
enableThinking,
|
|
123
122
|
openAIReasoningEffort
|
|
124
123
|
});
|
|
@@ -171,6 +170,5 @@ ${combined}` : combined;
|
|
|
171
170
|
};
|
|
172
171
|
}
|
|
173
172
|
export {
|
|
174
|
-
FAST_STRIKE_SYSTEM_PROMPT,
|
|
175
173
|
runFastStrike
|
|
176
174
|
};
|
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
import"./cli-wfb4gde1.js";
|
|
3
|
+
import"./cli-j1916nvj.js";
|
|
4
|
+
import"./cli-qkb3v2nw.js";
|
|
5
|
+
import"./cli-n4h7ygp5.js";
|
|
6
|
+
import"./cli-8kkaeb70.js";
|
|
7
|
+
import"./cli-gq5sk2j3.js";
|
|
8
|
+
import"./cli-gamfs2yq.js";
|
|
9
|
+
import"./cli-jw1xftqm.js";
|
|
10
|
+
import"./cli-3v9zs5wm.js";
|
|
11
|
+
import"./cli-4z46kyrk.js";
|
|
12
|
+
import"./cli-q45hcq3f.js";
|
|
2
13
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-32z0017y.js";
|
|
12
|
-
import"./cli-k8kc47pq.js";
|
|
13
|
-
import"./cli-9fsre5pt.js";
|
|
14
|
-
import"./cli-qqt4gj1w.js";
|
|
15
|
-
import"./cli-repbyhkk.js";
|
|
16
|
-
import"./cli-tznv8pf1.js";
|
|
17
|
-
import"./cli-fw5r7pfj.js";
|
|
18
|
-
import"./cli-c8131c4q.js";
|
|
19
|
-
import"./cli-tkc598ey.js";
|
|
20
|
-
import"./cli-0n4r54hq.js";
|
|
21
|
-
import"./cli-swpbx60z.js";
|
|
22
|
-
import"./cli-j54qa6tm.js";
|
|
23
|
-
import"./cli-72cvcqhg.js";
|
|
24
|
-
import"./cli-9rhzhgx2.js";
|
|
25
|
-
import"./cli-vnynf0js.js";
|
|
26
|
-
import"./cli-bc05qbss.js";
|
|
14
|
+
listFixes,
|
|
15
|
+
getFix
|
|
16
|
+
} from "./cli-vkxx4jzv.js";
|
|
17
|
+
import {
|
|
18
|
+
markCommandFailed
|
|
19
|
+
} from "./cli-z82n3qk1.js";
|
|
20
|
+
import"./cli-qba2x69h.js";
|
|
21
|
+
import"./cli-qktcyj48.js";
|
|
27
22
|
|
|
28
23
|
// src/cli/fixes.ts
|
|
29
24
|
function showHelp() {
|
|
@@ -49,7 +44,7 @@ async function main() {
|
|
|
49
44
|
if (!fixId) {
|
|
50
45
|
console.error("Error: fix ID is required");
|
|
51
46
|
console.error("Usage: pensar fixes get <fixId>");
|
|
52
|
-
|
|
47
|
+
return markCommandFailed();
|
|
53
48
|
}
|
|
54
49
|
const fix = await getFix(fixId);
|
|
55
50
|
console.log(JSON.stringify(fix, null, 2));
|
|
@@ -60,7 +55,7 @@ async function main() {
|
|
|
60
55
|
} catch (err) {
|
|
61
56
|
console.error(`
|
|
62
57
|
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
63
|
-
|
|
58
|
+
return markCommandFailed();
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
|
-
main();
|
|
61
|
+
await main();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_execAsync
|
|
3
|
+
} from "./cli-8w8k4dph.js";
|
|
4
|
+
import {
|
|
5
|
+
require_src6
|
|
6
|
+
} from "./cli-bb02pjt0.js";
|
|
7
|
+
import {
|
|
8
|
+
__commonJS,
|
|
9
|
+
__require
|
|
10
|
+
} from "./cli-h6y3bt60.js";
|
|
11
|
+
|
|
12
|
+
// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js
|
|
13
|
+
var require_getMachineId_bsd = __commonJS(function(exports) {
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getMachineId = undefined;
|
|
16
|
+
var fs_1 = __require("fs");
|
|
17
|
+
var execAsync_1 = require_execAsync();
|
|
18
|
+
var api_1 = require_src6();
|
|
19
|
+
async function getMachineId() {
|
|
20
|
+
try {
|
|
21
|
+
const result = await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" });
|
|
22
|
+
return result.trim();
|
|
23
|
+
} catch (e) {
|
|
24
|
+
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const result = await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid");
|
|
28
|
+
return result.stdout.trim();
|
|
29
|
+
} catch (e) {
|
|
30
|
+
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
exports.getMachineId = getMachineId;
|
|
35
|
+
});
|
|
36
|
+
export default require_getMachineId_bsd();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_execAsync
|
|
3
|
+
} from "./cli-8w8k4dph.js";
|
|
4
|
+
import {
|
|
5
|
+
require_src6
|
|
6
|
+
} from "./cli-bb02pjt0.js";
|
|
7
|
+
import {
|
|
8
|
+
__commonJS
|
|
9
|
+
} from "./cli-h6y3bt60.js";
|
|
10
|
+
|
|
11
|
+
// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js
|
|
12
|
+
var require_getMachineId_darwin = __commonJS(function(exports) {
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.getMachineId = undefined;
|
|
15
|
+
var execAsync_1 = require_execAsync();
|
|
16
|
+
var api_1 = require_src6();
|
|
17
|
+
async function getMachineId() {
|
|
18
|
+
try {
|
|
19
|
+
const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"');
|
|
20
|
+
const idLine = result.stdout.split(`
|
|
21
|
+
`).find((line) => line.includes("IOPlatformUUID"));
|
|
22
|
+
if (!idLine) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const parts = idLine.split('" = "');
|
|
26
|
+
if (parts.length === 2) {
|
|
27
|
+
return parts[1].slice(0, -1);
|
|
28
|
+
}
|
|
29
|
+
} catch (e) {
|
|
30
|
+
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
exports.getMachineId = getMachineId;
|
|
35
|
+
});
|
|
36
|
+
export default require_getMachineId_darwin();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_src6
|
|
3
|
+
} from "./cli-bb02pjt0.js";
|
|
4
|
+
import {
|
|
5
|
+
__commonJS,
|
|
6
|
+
__require
|
|
7
|
+
} from "./cli-h6y3bt60.js";
|
|
8
|
+
|
|
9
|
+
// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js
|
|
10
|
+
var require_getMachineId_linux = __commonJS(function(exports) {
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getMachineId = undefined;
|
|
13
|
+
var fs_1 = __require("fs");
|
|
14
|
+
var api_1 = require_src6();
|
|
15
|
+
async function getMachineId() {
|
|
16
|
+
const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
|
|
17
|
+
for (const path of paths) {
|
|
18
|
+
try {
|
|
19
|
+
const result = await fs_1.promises.readFile(path, { encoding: "utf8" });
|
|
20
|
+
return result.trim();
|
|
21
|
+
} catch (e) {
|
|
22
|
+
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
exports.getMachineId = getMachineId;
|
|
28
|
+
});
|
|
29
|
+
export default require_getMachineId_linux();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_src6
|
|
3
|
+
} from "./cli-bb02pjt0.js";
|
|
4
|
+
import {
|
|
5
|
+
__commonJS
|
|
6
|
+
} from "./cli-h6y3bt60.js";
|
|
7
|
+
|
|
8
|
+
// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js
|
|
9
|
+
var require_getMachineId_unsupported = __commonJS(function(exports) {
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.getMachineId = undefined;
|
|
12
|
+
var api_1 = require_src6();
|
|
13
|
+
async function getMachineId() {
|
|
14
|
+
api_1.diag.debug("could not read machine-id: unsupported platform");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
exports.getMachineId = getMachineId;
|
|
18
|
+
});
|
|
19
|
+
export default require_getMachineId_unsupported();
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_execAsync
|
|
3
|
+
} from "./cli-8w8k4dph.js";
|
|
4
|
+
import {
|
|
5
|
+
require_src6
|
|
6
|
+
} from "./cli-bb02pjt0.js";
|
|
7
|
+
import {
|
|
8
|
+
__commonJS,
|
|
9
|
+
__require
|
|
10
|
+
} from "./cli-h6y3bt60.js";
|
|
11
|
+
|
|
12
|
+
// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js
|
|
13
|
+
var require_getMachineId_win = __commonJS(function(exports) {
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getMachineId = undefined;
|
|
16
|
+
var process = __require("process");
|
|
17
|
+
var execAsync_1 = require_execAsync();
|
|
18
|
+
var api_1 = require_src6();
|
|
19
|
+
async function getMachineId() {
|
|
20
|
+
const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid";
|
|
21
|
+
let command = "%windir%\\System32\\REG.exe";
|
|
22
|
+
if (process.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process.env) {
|
|
23
|
+
command = "%windir%\\sysnative\\cmd.exe /c " + command;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const result = await (0, execAsync_1.execAsync)(`${command} ${args}`);
|
|
27
|
+
const parts = result.stdout.split("REG_SZ");
|
|
28
|
+
if (parts.length === 2) {
|
|
29
|
+
return parts[1].trim();
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
exports.getMachineId = getMachineId;
|
|
37
|
+
});
|
|
38
|
+
export default require_getMachineId_win();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ALL_TOOL_NAMES2,
|
|
3
|
+
SKILL_TOOL_NAMES2
|
|
4
|
+
} from "./cli-qkb3v2nw.js";
|
|
5
|
+
import"./cli-wfb4gde1.js";
|
|
6
|
+
import"./cli-j1916nvj.js";
|
|
7
|
+
import"./cli-n4h7ygp5.js";
|
|
8
|
+
import"./cli-qktcyj48.js";
|
|
9
|
+
export {
|
|
10
|
+
ALL_TOOL_NAMES2 as ALL_TOOL_NAMES,
|
|
11
|
+
SKILL_TOOL_NAMES2 as SKILL_TOOL_NAMES
|
|
12
|
+
};
|