devanvil 0.0.0-stage → 2.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.ar.md +113 -0
- package/README.md +272 -2
- package/SECURITY.md +49 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +664 -0
- package/dist/core/contract-drift.d.ts +49 -0
- package/dist/core/contract-drift.js +312 -0
- package/dist/core/converters.d.ts +18 -0
- package/dist/core/converters.js +989 -0
- package/dist/core/cron.d.ts +33 -0
- package/dist/core/cron.js +309 -0
- package/dist/core/crypto.d.ts +59 -0
- package/dist/core/crypto.js +260 -0
- package/dist/core/curl.d.ts +17 -0
- package/dist/core/curl.js +174 -0
- package/dist/core/diff.d.ts +36 -0
- package/dist/core/diff.js +148 -0
- package/dist/core/encoding.d.ts +3 -0
- package/dist/core/encoding.js +143 -0
- package/dist/core/importers.d.ts +65 -0
- package/dist/core/importers.js +361 -0
- package/dist/core/jwt.d.ts +39 -0
- package/dist/core/jwt.js +269 -0
- package/dist/core/llm-tokens.d.ts +38 -0
- package/dist/core/llm-tokens.js +125 -0
- package/dist/core/log-analyzer.d.ts +30 -0
- package/dist/core/log-analyzer.js +155 -0
- package/dist/core/network.d.ts +72 -0
- package/dist/core/network.js +185 -0
- package/dist/core/oauth-protobuf.d.ts +74 -0
- package/dist/core/oauth-protobuf.js +396 -0
- package/dist/core/openapi.d.ts +27 -0
- package/dist/core/openapi.js +257 -0
- package/dist/core/pipeline.d.ts +28 -0
- package/dist/core/pipeline.js +154 -0
- package/dist/core/regex.d.ts +50 -0
- package/dist/core/regex.js +360 -0
- package/dist/core/runner.d.ts +53 -0
- package/dist/core/runner.js +250 -0
- package/dist/core/secrets.d.ts +87 -0
- package/dist/core/secrets.js +603 -0
- package/dist/core/security.d.ts +34 -0
- package/dist/core/security.js +301 -0
- package/dist/core/sql-explain.d.ts +50 -0
- package/dist/core/sql-explain.js +259 -0
- package/dist/core/tls.d.ts +44 -0
- package/dist/core/tls.js +169 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +31 -0
- package/dist/server/app.d.ts +31 -0
- package/dist/server/app.js +359 -0
- package/dist/server/http-proxy.d.ts +55 -0
- package/dist/server/http-proxy.js +373 -0
- package/dist/server/http-utils.d.ts +28 -0
- package/dist/server/http-utils.js +118 -0
- package/dist/server/load-tester.d.ts +53 -0
- package/dist/server/load-tester.js +137 -0
- package/dist/server/mcp.d.ts +35 -0
- package/dist/server/mcp.js +470 -0
- package/dist/server/mock-store.d.ts +38 -0
- package/dist/server/mock-store.js +238 -0
- package/dist/server/plugin-loader.d.ts +61 -0
- package/dist/server/plugin-loader.js +305 -0
- package/dist/server/recorder-store.d.ts +35 -0
- package/dist/server/recorder-store.js +147 -0
- package/dist/server/routes/network-routes.d.ts +3 -0
- package/dist/server/routes/network-routes.js +441 -0
- package/dist/server/routes/tools-routes.d.ts +3 -0
- package/dist/server/routes/tools-routes.js +299 -0
- package/dist/server/routes/workspace-routes.d.ts +3 -0
- package/dist/server/routes/workspace-routes.js +262 -0
- package/dist/server/webhook-store.d.ts +29 -0
- package/dist/server/webhook-store.js +100 -0
- package/dist/server/workspace-store.d.ts +91 -0
- package/dist/server/workspace-store.js +448 -0
- package/dist/server/ws-probe.d.ts +34 -0
- package/dist/server/ws-probe.js +291 -0
- package/dist/ui/app.js +290 -0
- package/dist/ui/favicon.svg +14 -0
- package/dist/ui/index.html +83 -0
- package/dist/ui/logo.png +0 -0
- package/dist/ui/styles.css +694 -0
- package/dist/ui/tools-data.js +719 -0
- package/dist/ui/tools-network.js +769 -0
- package/dist/ui/tools-ops.js +299 -0
- package/dist/ui/tools-pro.js +500 -0
- package/dist/ui/tools-security.js +397 -0
- package/dist/ui/tools-v12.js +765 -0
- package/dist/ui/tools-v13.js +321 -0
- package/dist/ui/tools-v20.js +563 -0
- package/dist/ui/tools-v21.js +411 -0
- package/package.json +75 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ModelBudgetEstimate {
|
|
2
|
+
model: string;
|
|
3
|
+
provider: string;
|
|
4
|
+
estimatedTokens: number;
|
|
5
|
+
contextWindow: number;
|
|
6
|
+
contextUsagePct: number;
|
|
7
|
+
inputCostPer1KCallsUsd: number;
|
|
8
|
+
}
|
|
9
|
+
export interface LlmTokenAnalysis {
|
|
10
|
+
characters: number;
|
|
11
|
+
bytes: number;
|
|
12
|
+
words: number;
|
|
13
|
+
lines: number;
|
|
14
|
+
estimatedBaseTokens: number;
|
|
15
|
+
codeDensity: 'prose' | 'mixed' | 'code-heavy';
|
|
16
|
+
models: ModelBudgetEstimate[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Offline BPE-calibrated tokenizer estimator handling English, Arabic/UTF-8, CJK,
|
|
20
|
+
* punctuation runs, numbers, and source code symbols more accurately than chars/4.
|
|
21
|
+
*/
|
|
22
|
+
export declare function estimateBpeTokens(text: string): number;
|
|
23
|
+
export declare function analyzeLlmText(text: string): LlmTokenAnalysis;
|
|
24
|
+
export interface CompactResult {
|
|
25
|
+
compacted: string;
|
|
26
|
+
originalTokens: number;
|
|
27
|
+
compactedTokens: number;
|
|
28
|
+
tokensSaved: number;
|
|
29
|
+
savingsPct: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Compacts prompt/code context by removing trailing whitespace, collapsing blank lines,
|
|
33
|
+
* and optionally stripping single-line // comments and minifying JSON blocks.
|
|
34
|
+
*/
|
|
35
|
+
export declare function compactContextText(input: string, options?: {
|
|
36
|
+
stripLineComments?: boolean;
|
|
37
|
+
minifyJson?: boolean;
|
|
38
|
+
}): CompactResult;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
const MODEL_SPECS = [
|
|
2
|
+
{ model: 'Claude Sonnet 4', provider: 'Anthropic', tokenMultiplier: 1.04, contextWindow: 200_000, inputUsdPer1M: 3.0 },
|
|
3
|
+
{ model: 'Claude Opus 4', provider: 'Anthropic', tokenMultiplier: 1.04, contextWindow: 200_000, inputUsdPer1M: 15.0 },
|
|
4
|
+
{ model: 'GPT-4o', provider: 'OpenAI', tokenMultiplier: 0.98, contextWindow: 128_000, inputUsdPer1M: 2.5 },
|
|
5
|
+
{ model: 'GPT-4.1 mini', provider: 'OpenAI', tokenMultiplier: 0.98, contextWindow: 1_000_000, inputUsdPer1M: 0.4 },
|
|
6
|
+
{ model: 'Gemini 2.5 Pro', provider: 'Google', tokenMultiplier: 1.0, contextWindow: 1_000_000, inputUsdPer1M: 1.25 },
|
|
7
|
+
{ model: 'Gemini 2.5 Flash', provider: 'Google', tokenMultiplier: 1.0, contextWindow: 1_000_000, inputUsdPer1M: 0.15 },
|
|
8
|
+
{ model: 'Llama 3.3 70B', provider: 'Meta', tokenMultiplier: 1.02, contextWindow: 128_000, inputUsdPer1M: 0.6 },
|
|
9
|
+
];
|
|
10
|
+
/**
|
|
11
|
+
* Offline BPE-calibrated tokenizer estimator handling English, Arabic/UTF-8, CJK,
|
|
12
|
+
* punctuation runs, numbers, and source code symbols more accurately than chars/4.
|
|
13
|
+
*/
|
|
14
|
+
export function estimateBpeTokens(text) {
|
|
15
|
+
if (!text)
|
|
16
|
+
return 0;
|
|
17
|
+
let tokens = 0;
|
|
18
|
+
// Split into coarse BPE-like chunks: ASCII words, digits, non-ASCII runs, whitespace, symbols
|
|
19
|
+
const chunkRe = /[A-Za-z]+|[0-9]{1,3}|[\u4E00-\u9FFF\u3040-\u30FF\uAC00-\uD7AF]|[\u0600-\u06FF]+|\s+|[^\sA-Za-z0-9]/g;
|
|
20
|
+
let m;
|
|
21
|
+
while ((m = chunkRe.exec(text)) !== null) {
|
|
22
|
+
const seg = m[0];
|
|
23
|
+
if (/^[A-Za-z]+$/.test(seg)) {
|
|
24
|
+
tokens += seg.length <= 5 ? 1 : Math.ceil(seg.length / 4.2);
|
|
25
|
+
}
|
|
26
|
+
else if (/^[0-9]+$/.test(seg)) {
|
|
27
|
+
tokens += 1;
|
|
28
|
+
}
|
|
29
|
+
else if (/^[\u0600-\u06FF]+$/.test(seg)) {
|
|
30
|
+
// Arabic script averages ~1.8 chars/token in modern BPE vocabularies
|
|
31
|
+
tokens += Math.ceil(seg.length / 1.8);
|
|
32
|
+
}
|
|
33
|
+
else if (/^[\u4E00-\u9FFF\u3040-\u30FF\uAC00-\uD7AF]$/.test(seg)) {
|
|
34
|
+
tokens += 1.1;
|
|
35
|
+
}
|
|
36
|
+
else if (/^\s+$/.test(seg)) {
|
|
37
|
+
// Single spaces merge with next word; newlines & indentation add tokens
|
|
38
|
+
const newlines = (seg.match(/\n/g) ?? []).length;
|
|
39
|
+
const extraSpaces = Math.max(0, seg.length - newlines - 1);
|
|
40
|
+
tokens += newlines + Math.floor(extraSpaces / 4);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
tokens += 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return Math.max(1, Math.round(tokens));
|
|
47
|
+
}
|
|
48
|
+
export function analyzeLlmText(text) {
|
|
49
|
+
const characters = text.length;
|
|
50
|
+
const bytes = Buffer.byteLength(text, 'utf8');
|
|
51
|
+
const trimmed = text.trim();
|
|
52
|
+
const words = trimmed ? trimmed.split(/\s+/).length : 0;
|
|
53
|
+
const lines = text ? text.replace(/\r\n/g, '\n').split('\n').length : 0;
|
|
54
|
+
const estimatedBaseTokens = estimateBpeTokens(text);
|
|
55
|
+
const symbolCount = (text.match(/[{}()[\];:=<>/*&|]/g) ?? []).length;
|
|
56
|
+
const symbolRatio = characters > 0 ? symbolCount / characters : 0;
|
|
57
|
+
const codeDensity = symbolRatio > 0.1 ? 'code-heavy' : symbolRatio > 0.035 ? 'mixed' : 'prose';
|
|
58
|
+
const models = MODEL_SPECS.map((spec) => {
|
|
59
|
+
const est = Math.round(estimatedBaseTokens * spec.tokenMultiplier);
|
|
60
|
+
const contextUsagePct = Math.round((est / spec.contextWindow) * 10000) / 100;
|
|
61
|
+
const inputCostPer1KCallsUsd = Math.round(((est * 1000) / 1_000_000) * spec.inputUsdPer1M * 10000) / 10000;
|
|
62
|
+
return {
|
|
63
|
+
model: spec.model,
|
|
64
|
+
provider: spec.provider,
|
|
65
|
+
estimatedTokens: est,
|
|
66
|
+
contextWindow: spec.contextWindow,
|
|
67
|
+
contextUsagePct,
|
|
68
|
+
inputCostPer1KCallsUsd,
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
characters,
|
|
73
|
+
bytes,
|
|
74
|
+
words,
|
|
75
|
+
lines,
|
|
76
|
+
estimatedBaseTokens,
|
|
77
|
+
codeDensity,
|
|
78
|
+
models,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Compacts prompt/code context by removing trailing whitespace, collapsing blank lines,
|
|
83
|
+
* and optionally stripping single-line // comments and minifying JSON blocks.
|
|
84
|
+
*/
|
|
85
|
+
export function compactContextText(input, options = {}) {
|
|
86
|
+
const originalTokens = estimateBpeTokens(input);
|
|
87
|
+
let out = input.replace(/\r\n/g, '\n');
|
|
88
|
+
if (options.minifyJson) {
|
|
89
|
+
try {
|
|
90
|
+
const parsed = JSON.parse(out);
|
|
91
|
+
out = JSON.stringify(parsed);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// Not pure JSON; continue with text compaction
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const lines = out.split('\n').map((line) => {
|
|
98
|
+
let cleaned = line.trimEnd();
|
|
99
|
+
if (options.stripLineComments && /^\s*\/\//.test(cleaned)) {
|
|
100
|
+
return '';
|
|
101
|
+
}
|
|
102
|
+
// Collapse deep indentation (4 spaces -> 1 space per level)
|
|
103
|
+
const leadingMatch = /^( +)/.exec(cleaned);
|
|
104
|
+
if (leadingMatch && leadingMatch[1].length >= 4) {
|
|
105
|
+
const levels = Math.floor(leadingMatch[1].length / 2);
|
|
106
|
+
cleaned = ' '.repeat(levels) + cleaned.slice(leadingMatch[1].length);
|
|
107
|
+
}
|
|
108
|
+
return cleaned;
|
|
109
|
+
});
|
|
110
|
+
// Collapse consecutive empty lines
|
|
111
|
+
const collapsed = [];
|
|
112
|
+
let prevEmpty = false;
|
|
113
|
+
for (const l of lines) {
|
|
114
|
+
const empty = l.trim() === '';
|
|
115
|
+
if (empty && prevEmpty)
|
|
116
|
+
continue;
|
|
117
|
+
collapsed.push(l);
|
|
118
|
+
prevEmpty = empty;
|
|
119
|
+
}
|
|
120
|
+
const compacted = collapsed.join('\n').trim();
|
|
121
|
+
const compactedTokens = estimateBpeTokens(compacted);
|
|
122
|
+
const tokensSaved = Math.max(0, originalTokens - compactedTokens);
|
|
123
|
+
const savingsPct = originalTokens > 0 ? Math.round((tokensSaved / originalTokens) * 1000) / 10 : 0;
|
|
124
|
+
return { compacted, originalTokens, compactedTokens, tokensSaved, savingsPct };
|
|
125
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ErrorFingerprintGroup {
|
|
2
|
+
fingerprint: string;
|
|
3
|
+
count: number;
|
|
4
|
+
level: string;
|
|
5
|
+
sampleLine: number;
|
|
6
|
+
sampleMessage: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LogAnalysisReport {
|
|
9
|
+
totalLines: number;
|
|
10
|
+
parsedJsonLines: number;
|
|
11
|
+
levels: Record<'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'other', number>;
|
|
12
|
+
httpStatusClasses: Record<'2xx' | '3xx' | '4xx' | '5xx', number>;
|
|
13
|
+
latencyStats?: {
|
|
14
|
+
samples: number;
|
|
15
|
+
minMs: number;
|
|
16
|
+
avgMs: number;
|
|
17
|
+
p50Ms: number;
|
|
18
|
+
p95Ms: number;
|
|
19
|
+
p99Ms: number;
|
|
20
|
+
maxMs: number;
|
|
21
|
+
};
|
|
22
|
+
topErrors: ErrorFingerprintGroup[];
|
|
23
|
+
secretFindingsCount: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Offline structured & unstructured log analyzer (NDJSON/JSONL, Pino, Winston, Nginx, Syslog).
|
|
27
|
+
* Computes level breakdown, HTTP status classes, latency percentiles (P50/P95/P99),
|
|
28
|
+
* deduplicated error fingerprints, and flags accidentally logged credentials.
|
|
29
|
+
*/
|
|
30
|
+
export declare function analyzeLogs(input: string): LogAnalysisReport;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { scanSecrets } from './secrets.js';
|
|
2
|
+
import { safeJsonParse } from './security.js';
|
|
3
|
+
function normalizeFingerprint(msg) {
|
|
4
|
+
return msg
|
|
5
|
+
.replace(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi, '<UUID>')
|
|
6
|
+
.replace(/\b\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?\b/g, '<TS>')
|
|
7
|
+
.replace(/\b(?:\d{1,3}\.){3}\d{1,3}\b/g, '<IP>')
|
|
8
|
+
.replace(/\b0x[0-9a-f]+\b/gi, '<HEX>')
|
|
9
|
+
.replace(/\b\d+(?:\.\d+)?(ms|us|ns|s|kb|mb|gb)?\b/gi, (_m, unit) => (unit ? `<N>${unit.toLowerCase()}` : '<N>'))
|
|
10
|
+
.replace(/\s+/g, ' ')
|
|
11
|
+
.trim()
|
|
12
|
+
.slice(0, 180);
|
|
13
|
+
}
|
|
14
|
+
function classifyLevel(raw) {
|
|
15
|
+
const s = raw.trim().toLowerCase();
|
|
16
|
+
if (s === 'fatal' || s === 'crit' || s === 'critical' || s === 'emerg' || s === '60')
|
|
17
|
+
return 'fatal';
|
|
18
|
+
if (s === 'err' || s === 'error' || s === '50')
|
|
19
|
+
return 'error';
|
|
20
|
+
if (s === 'warn' || s === 'warning' || s === '40')
|
|
21
|
+
return 'warn';
|
|
22
|
+
if (s === 'info' || s === 'notice' || s === '30')
|
|
23
|
+
return 'info';
|
|
24
|
+
if (s === 'debug' || s === 'trace' || s === '20' || s === '10')
|
|
25
|
+
return 'debug';
|
|
26
|
+
return 'other';
|
|
27
|
+
}
|
|
28
|
+
function percentile(sorted, p) {
|
|
29
|
+
if (sorted.length === 0)
|
|
30
|
+
return 0;
|
|
31
|
+
const idx = Math.min(sorted.length - 1, Math.max(0, Math.ceil((p / 100) * sorted.length) - 1));
|
|
32
|
+
return Math.round(sorted[idx] * 100) / 100;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Offline structured & unstructured log analyzer (NDJSON/JSONL, Pino, Winston, Nginx, Syslog).
|
|
36
|
+
* Computes level breakdown, HTTP status classes, latency percentiles (P50/P95/P99),
|
|
37
|
+
* deduplicated error fingerprints, and flags accidentally logged credentials.
|
|
38
|
+
*/
|
|
39
|
+
export function analyzeLogs(input) {
|
|
40
|
+
if (input.length > 2_000_000) {
|
|
41
|
+
throw new Error('Log input exceeds 2 MB safety limit');
|
|
42
|
+
}
|
|
43
|
+
const lines = input.split(/\r?\n/).filter((l) => l.trim().length > 0);
|
|
44
|
+
const levels = { fatal: 0, error: 0, warn: 0, info: 0, debug: 0, other: 0 };
|
|
45
|
+
const httpStatusClasses = { '2xx': 0, '3xx': 0, '4xx': 0, '5xx': 0 };
|
|
46
|
+
const latencies = [];
|
|
47
|
+
const errorMap = new Map();
|
|
48
|
+
let parsedJsonLines = 0;
|
|
49
|
+
for (let i = 0; i < lines.length; i++) {
|
|
50
|
+
const line = lines[i].trim();
|
|
51
|
+
const lineNum = i + 1;
|
|
52
|
+
let level = 'other';
|
|
53
|
+
let message = line;
|
|
54
|
+
let status;
|
|
55
|
+
let latMs;
|
|
56
|
+
if (line.startsWith('{') && line.endsWith('}')) {
|
|
57
|
+
try {
|
|
58
|
+
const obj = safeJsonParse(line);
|
|
59
|
+
if (obj && typeof obj === 'object') {
|
|
60
|
+
parsedJsonLines++;
|
|
61
|
+
const rawLvl = obj.level ?? obj.severity ?? obj.lvl;
|
|
62
|
+
if (rawLvl !== undefined)
|
|
63
|
+
level = classifyLevel(String(rawLvl));
|
|
64
|
+
const rawMsg = obj.msg ?? obj.message ?? obj.error ?? obj.err;
|
|
65
|
+
if (typeof rawMsg === 'string')
|
|
66
|
+
message = rawMsg;
|
|
67
|
+
else if (rawMsg && typeof rawMsg === 'object' && 'message' in rawMsg) {
|
|
68
|
+
message = String(rawMsg.message);
|
|
69
|
+
}
|
|
70
|
+
const rawStatus = obj.status ?? obj.statusCode ?? obj.httpStatus;
|
|
71
|
+
if (typeof rawStatus === 'number' && rawStatus >= 100 && rawStatus <= 599)
|
|
72
|
+
status = rawStatus;
|
|
73
|
+
const rawLat = obj.latencyMs ?? obj.durationMs ?? obj.responseTime ?? obj.duration;
|
|
74
|
+
if (typeof rawLat === 'number' && Number.isFinite(rawLat) && rawLat >= 0)
|
|
75
|
+
latMs = rawLat;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Fallback to plain-text parsing below
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (level === 'other') {
|
|
83
|
+
const m = line.match(/\b(FATAL|CRITICAL|ERROR|ERR|WARN|WARNING|INFO|DEBUG|TRACE)\b/i);
|
|
84
|
+
if (m)
|
|
85
|
+
level = classifyLevel(m[1]);
|
|
86
|
+
}
|
|
87
|
+
if (status === undefined) {
|
|
88
|
+
const sm = line.match(/(?:HTTP\/[12](?:\.\d)?"?\s+|\bstatus[=:\s]+)([2345]\d{2})\b/i);
|
|
89
|
+
if (sm)
|
|
90
|
+
status = Number(sm[1]);
|
|
91
|
+
}
|
|
92
|
+
if (latMs === undefined) {
|
|
93
|
+
const lm = line.match(/\b(?:latency|duration|time|took)[=:\s]+(\d+(?:\.\d+)?)\s*ms\b/i);
|
|
94
|
+
if (lm)
|
|
95
|
+
latMs = Number(lm[1]);
|
|
96
|
+
}
|
|
97
|
+
levels[level]++;
|
|
98
|
+
if (status !== undefined) {
|
|
99
|
+
if (status >= 200 && status < 300)
|
|
100
|
+
httpStatusClasses['2xx']++;
|
|
101
|
+
else if (status >= 300 && status < 400)
|
|
102
|
+
httpStatusClasses['3xx']++;
|
|
103
|
+
else if (status >= 400 && status < 500)
|
|
104
|
+
httpStatusClasses['4xx']++;
|
|
105
|
+
else if (status >= 500 && status < 600)
|
|
106
|
+
httpStatusClasses['5xx']++;
|
|
107
|
+
}
|
|
108
|
+
if (latMs !== undefined && Number.isFinite(latMs)) {
|
|
109
|
+
latencies.push(latMs);
|
|
110
|
+
}
|
|
111
|
+
if (level === 'error' || level === 'fatal' || (status !== undefined && status >= 500)) {
|
|
112
|
+
const fp = normalizeFingerprint(message);
|
|
113
|
+
const existing = errorMap.get(fp);
|
|
114
|
+
if (existing) {
|
|
115
|
+
existing.count++;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
errorMap.set(fp, {
|
|
119
|
+
fingerprint: fp,
|
|
120
|
+
count: 1,
|
|
121
|
+
level: level === 'other' ? 'error' : level,
|
|
122
|
+
sampleLine: lineNum,
|
|
123
|
+
sampleMessage: message.slice(0, 240),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
let latencyStats;
|
|
129
|
+
if (latencies.length > 0) {
|
|
130
|
+
latencies.sort((a, b) => a - b);
|
|
131
|
+
const sum = latencies.reduce((a, b) => a + b, 0);
|
|
132
|
+
latencyStats = {
|
|
133
|
+
samples: latencies.length,
|
|
134
|
+
minMs: Math.round(latencies[0] * 100) / 100,
|
|
135
|
+
avgMs: Math.round((sum / latencies.length) * 100) / 100,
|
|
136
|
+
p50Ms: percentile(latencies, 50),
|
|
137
|
+
p95Ms: percentile(latencies, 95),
|
|
138
|
+
p99Ms: percentile(latencies, 99),
|
|
139
|
+
maxMs: Math.round(latencies[latencies.length - 1] * 100) / 100,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const topErrors = Array.from(errorMap.values())
|
|
143
|
+
.sort((a, b) => b.count - a.count)
|
|
144
|
+
.slice(0, 15);
|
|
145
|
+
const secretFindingsCount = scanSecrets(input.slice(0, 500_000), { checkHighEntropy: false }).totalFindings;
|
|
146
|
+
return {
|
|
147
|
+
totalLines: lines.length,
|
|
148
|
+
parsedJsonLines,
|
|
149
|
+
levels,
|
|
150
|
+
httpStatusClasses,
|
|
151
|
+
latencyStats,
|
|
152
|
+
topErrors,
|
|
153
|
+
secretFindingsCount,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export interface CidrInfo {
|
|
2
|
+
cidr: string;
|
|
3
|
+
ipAddress: string;
|
|
4
|
+
prefix: number;
|
|
5
|
+
subnetMask: string;
|
|
6
|
+
wildcardMask: string;
|
|
7
|
+
networkAddress: string;
|
|
8
|
+
broadcastAddress: string;
|
|
9
|
+
firstHost: string;
|
|
10
|
+
lastHost: string;
|
|
11
|
+
totalAddresses: number;
|
|
12
|
+
usableHosts: number;
|
|
13
|
+
ipClass: string;
|
|
14
|
+
isPrivate: boolean;
|
|
15
|
+
binaryIp: string;
|
|
16
|
+
binaryMask: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function calculateCidr(cidrInput: string): CidrInfo;
|
|
19
|
+
export interface ChmodInfo {
|
|
20
|
+
octal: string;
|
|
21
|
+
symbolic: string;
|
|
22
|
+
command: string;
|
|
23
|
+
owner: {
|
|
24
|
+
read: boolean;
|
|
25
|
+
write: boolean;
|
|
26
|
+
execute: boolean;
|
|
27
|
+
};
|
|
28
|
+
group: {
|
|
29
|
+
read: boolean;
|
|
30
|
+
write: boolean;
|
|
31
|
+
execute: boolean;
|
|
32
|
+
};
|
|
33
|
+
others: {
|
|
34
|
+
read: boolean;
|
|
35
|
+
write: boolean;
|
|
36
|
+
execute: boolean;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export declare function parseChmod(input: string): ChmodInfo;
|
|
40
|
+
export interface ColorInfo {
|
|
41
|
+
hex: string;
|
|
42
|
+
rgb: {
|
|
43
|
+
r: number;
|
|
44
|
+
g: number;
|
|
45
|
+
b: number;
|
|
46
|
+
};
|
|
47
|
+
rgbCss: string;
|
|
48
|
+
hsl: {
|
|
49
|
+
h: number;
|
|
50
|
+
s: number;
|
|
51
|
+
l: number;
|
|
52
|
+
};
|
|
53
|
+
hslCss: string;
|
|
54
|
+
luminance: number;
|
|
55
|
+
}
|
|
56
|
+
export declare function parseHexColor(hexInput: string): ColorInfo;
|
|
57
|
+
export interface ContrastResult {
|
|
58
|
+
foreground: ColorInfo;
|
|
59
|
+
background: ColorInfo;
|
|
60
|
+
ratio: number;
|
|
61
|
+
aaNormal: boolean;
|
|
62
|
+
aaLarge: boolean;
|
|
63
|
+
aaaNormal: boolean;
|
|
64
|
+
aaaLarge: boolean;
|
|
65
|
+
}
|
|
66
|
+
export declare function checkColorContrast(fgHex: string, bgHex: string): ContrastResult;
|
|
67
|
+
export declare const HTTP_STATUS_CODES: Array<{
|
|
68
|
+
code: number;
|
|
69
|
+
title: string;
|
|
70
|
+
category: string;
|
|
71
|
+
description: string;
|
|
72
|
+
}>;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
function intToIpv4(n) {
|
|
2
|
+
return [(n >>> 24) & 0xff, (n >>> 16) & 0xff, (n >>> 8) & 0xff, n & 0xff].join('.');
|
|
3
|
+
}
|
|
4
|
+
function intToBinaryOctets(n) {
|
|
5
|
+
return [(n >>> 24) & 0xff, (n >>> 16) & 0xff, (n >>> 8) & 0xff, n & 0xff]
|
|
6
|
+
.map((o) => o.toString(2).padStart(8, '0'))
|
|
7
|
+
.join('.');
|
|
8
|
+
}
|
|
9
|
+
export function calculateCidr(cidrInput) {
|
|
10
|
+
const trimmed = cidrInput.trim();
|
|
11
|
+
const [ipStr, prefixStr] = trimmed.split('/');
|
|
12
|
+
if (!ipStr)
|
|
13
|
+
throw new Error('CIDR input is required (e.g. 192.168.1.0/24)');
|
|
14
|
+
const octets = ipStr.split('.');
|
|
15
|
+
if (octets.length !== 4 || octets.some((o) => !/^\d{1,3}$/.test(o) || Number(o) > 255)) {
|
|
16
|
+
throw new Error(`Invalid IPv4 address: "${ipStr}"`);
|
|
17
|
+
}
|
|
18
|
+
const prefix = prefixStr === undefined ? 32 : Number(prefixStr);
|
|
19
|
+
if (!Number.isInteger(prefix) || prefix < 0 || prefix > 32) {
|
|
20
|
+
throw new Error(`Invalid CIDR prefix "/${prefixStr}" (must be 0-32)`);
|
|
21
|
+
}
|
|
22
|
+
const ipInt = (((Number(octets[0]) << 24) |
|
|
23
|
+
(Number(octets[1]) << 16) |
|
|
24
|
+
(Number(octets[2]) << 8) |
|
|
25
|
+
Number(octets[3])) >>>
|
|
26
|
+
0);
|
|
27
|
+
const maskInt = prefix === 0 ? 0 : (0xffffffff << (32 - prefix)) >>> 0;
|
|
28
|
+
const wildcardInt = (~maskInt) >>> 0;
|
|
29
|
+
const networkInt = (ipInt & maskInt) >>> 0;
|
|
30
|
+
const broadcastInt = (networkInt | wildcardInt) >>> 0;
|
|
31
|
+
const totalAddresses = Math.pow(2, 32 - prefix);
|
|
32
|
+
const usableHosts = prefix === 32 ? 1 : prefix === 31 ? 2 : Math.max(totalAddresses - 2, 0);
|
|
33
|
+
const firstHostInt = prefix >= 31 ? networkInt : (networkInt + 1) >>> 0;
|
|
34
|
+
const lastHostInt = prefix >= 31 ? broadcastInt : (broadcastInt - 1) >>> 0;
|
|
35
|
+
const firstOctet = (ipInt >>> 24) & 0xff;
|
|
36
|
+
const secondOctet = (ipInt >>> 16) & 0xff;
|
|
37
|
+
const ipClass = firstOctet < 128 ? 'A' : firstOctet < 192 ? 'B' : firstOctet < 224 ? 'C' : firstOctet < 240 ? 'D (Multicast)' : 'E (Reserved)';
|
|
38
|
+
const isPrivate = firstOctet === 10 ||
|
|
39
|
+
firstOctet === 127 ||
|
|
40
|
+
(firstOctet === 172 && secondOctet >= 16 && secondOctet <= 31) ||
|
|
41
|
+
(firstOctet === 192 && secondOctet === 168) ||
|
|
42
|
+
(firstOctet === 169 && secondOctet === 254);
|
|
43
|
+
return {
|
|
44
|
+
cidr: `${intToIpv4(networkInt)}/${prefix}`,
|
|
45
|
+
ipAddress: ipStr,
|
|
46
|
+
prefix,
|
|
47
|
+
subnetMask: intToIpv4(maskInt),
|
|
48
|
+
wildcardMask: intToIpv4(wildcardInt),
|
|
49
|
+
networkAddress: intToIpv4(networkInt),
|
|
50
|
+
broadcastAddress: intToIpv4(broadcastInt),
|
|
51
|
+
firstHost: intToIpv4(firstHostInt),
|
|
52
|
+
lastHost: intToIpv4(lastHostInt),
|
|
53
|
+
totalAddresses,
|
|
54
|
+
usableHosts,
|
|
55
|
+
ipClass,
|
|
56
|
+
isPrivate,
|
|
57
|
+
binaryIp: intToBinaryOctets(ipInt),
|
|
58
|
+
binaryMask: intToBinaryOctets(maskInt),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function parseChmod(input) {
|
|
62
|
+
const s = input.trim();
|
|
63
|
+
let digits;
|
|
64
|
+
if (/^[0-7]{3,4}$/.test(s)) {
|
|
65
|
+
const tail = s.slice(-3);
|
|
66
|
+
digits = [Number(tail[0]), Number(tail[1]), Number(tail[2])];
|
|
67
|
+
}
|
|
68
|
+
else if (/^[-r][-w][-x][-r][-w][-x][-r][-w][-x]$/.test(s)) {
|
|
69
|
+
const tri = (chunk) => (chunk[0] === 'r' ? 4 : 0) + (chunk[1] === 'w' ? 2 : 0) + (chunk[2] === 'x' ? 1 : 0);
|
|
70
|
+
digits = [tri(s.slice(0, 3)), tri(s.slice(3, 6)), tri(s.slice(6, 9))];
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
throw new Error('Provide a 3-digit octal mode (e.g. 755) or 9-char symbolic mode (e.g. rwxr-xr-x)');
|
|
74
|
+
}
|
|
75
|
+
const toFlags = (d) => ({ read: Boolean(d & 4), write: Boolean(d & 2), execute: Boolean(d & 1) });
|
|
76
|
+
const toSym = (d) => `${d & 4 ? 'r' : '-'}${d & 2 ? 'w' : '-'}${d & 1 ? 'x' : '-'}`;
|
|
77
|
+
const octal = digits.join('');
|
|
78
|
+
const symbolic = digits.map(toSym).join('');
|
|
79
|
+
return {
|
|
80
|
+
octal,
|
|
81
|
+
symbolic,
|
|
82
|
+
command: `chmod ${octal} <path>`,
|
|
83
|
+
owner: toFlags(digits[0]),
|
|
84
|
+
group: toFlags(digits[1]),
|
|
85
|
+
others: toFlags(digits[2]),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export function parseHexColor(hexInput) {
|
|
89
|
+
let hex = hexInput.trim().replace(/^#/, '');
|
|
90
|
+
if (/^[0-9a-fA-F]{3}$/.test(hex)) {
|
|
91
|
+
hex = hex
|
|
92
|
+
.split('')
|
|
93
|
+
.map((c) => c + c)
|
|
94
|
+
.join('');
|
|
95
|
+
}
|
|
96
|
+
if (!/^[0-9a-fA-F]{6}$/.test(hex)) {
|
|
97
|
+
throw new Error(`Invalid HEX color: "${hexInput}" (expected #RGB or #RRGGBB)`);
|
|
98
|
+
}
|
|
99
|
+
const r = parseInt(hex.slice(0, 2), 16);
|
|
100
|
+
const g = parseInt(hex.slice(2, 4), 16);
|
|
101
|
+
const b = parseInt(hex.slice(4, 6), 16);
|
|
102
|
+
const rn = r / 255;
|
|
103
|
+
const gn = g / 255;
|
|
104
|
+
const bn = b / 255;
|
|
105
|
+
const max = Math.max(rn, gn, bn);
|
|
106
|
+
const min = Math.min(rn, gn, bn);
|
|
107
|
+
const l = (max + min) / 2;
|
|
108
|
+
let h = 0;
|
|
109
|
+
let s = 0;
|
|
110
|
+
if (max !== min) {
|
|
111
|
+
const d = max - min;
|
|
112
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
113
|
+
switch (max) {
|
|
114
|
+
case rn:
|
|
115
|
+
h = (gn - bn) / d + (gn < bn ? 6 : 0);
|
|
116
|
+
break;
|
|
117
|
+
case gn:
|
|
118
|
+
h = (bn - rn) / d + 2;
|
|
119
|
+
break;
|
|
120
|
+
case bn:
|
|
121
|
+
h = (rn - gn) / d + 4;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
h /= 6;
|
|
125
|
+
}
|
|
126
|
+
const linearize = (v) => (v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4));
|
|
127
|
+
const luminance = 0.2126 * linearize(rn) + 0.7152 * linearize(gn) + 0.0722 * linearize(bn);
|
|
128
|
+
const hDeg = Math.round(h * 360);
|
|
129
|
+
const sPct = Math.round(s * 100);
|
|
130
|
+
const lPct = Math.round(l * 100);
|
|
131
|
+
return {
|
|
132
|
+
hex: `#${hex.toUpperCase()}`,
|
|
133
|
+
rgb: { r, g, b },
|
|
134
|
+
rgbCss: `rgb(${r}, ${g}, ${b})`,
|
|
135
|
+
hsl: { h: hDeg, s: sPct, l: lPct },
|
|
136
|
+
hslCss: `hsl(${hDeg}, ${sPct}%, ${lPct}%)`,
|
|
137
|
+
luminance: Math.round(luminance * 10000) / 10000,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export function checkColorContrast(fgHex, bgHex) {
|
|
141
|
+
const foreground = parseHexColor(fgHex);
|
|
142
|
+
const background = parseHexColor(bgHex);
|
|
143
|
+
const lighter = Math.max(foreground.luminance, background.luminance);
|
|
144
|
+
const darker = Math.min(foreground.luminance, background.luminance);
|
|
145
|
+
const ratio = Math.round(((lighter + 0.05) / (darker + 0.05)) * 100) / 100;
|
|
146
|
+
return {
|
|
147
|
+
foreground,
|
|
148
|
+
background,
|
|
149
|
+
ratio,
|
|
150
|
+
aaNormal: ratio >= 4.5,
|
|
151
|
+
aaLarge: ratio >= 3.0,
|
|
152
|
+
aaaNormal: ratio >= 7.0,
|
|
153
|
+
aaaLarge: ratio >= 4.5,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export const HTTP_STATUS_CODES = [
|
|
157
|
+
{ code: 100, title: 'Continue', category: '1xx Informational', description: 'Client should continue with request body.' },
|
|
158
|
+
{ code: 101, title: 'Switching Protocols', category: '1xx Informational', description: 'Server is switching protocols (e.g. HTTP -> WebSocket).' },
|
|
159
|
+
{ code: 200, title: 'OK', category: '2xx Success', description: 'Standard response for successful HTTP requests.' },
|
|
160
|
+
{ code: 201, title: 'Created', category: '2xx Success', description: 'Request fulfilled and a new resource was created.' },
|
|
161
|
+
{ code: 202, title: 'Accepted', category: '2xx Success', description: 'Request accepted for asynchronous processing.' },
|
|
162
|
+
{ code: 204, title: 'No Content', category: '2xx Success', description: 'Succeeded with intentionally empty response body.' },
|
|
163
|
+
{ code: 206, title: 'Partial Content', category: '2xx Success', description: 'Delivering part of resource due to Range header.' },
|
|
164
|
+
{ code: 301, title: 'Moved Permanently', category: '3xx Redirection', description: 'Resource permanently moved to Location URL.' },
|
|
165
|
+
{ code: 302, title: 'Found', category: '3xx Redirection', description: 'Temporary redirect to another URI.' },
|
|
166
|
+
{ code: 304, title: 'Not Modified', category: '3xx Redirection', description: 'Cached version is still valid (ETag/If-Modified-Since).' },
|
|
167
|
+
{ code: 307, title: 'Temporary Redirect', category: '3xx Redirection', description: 'Temporary redirect preserving HTTP method and body.' },
|
|
168
|
+
{ code: 308, title: 'Permanent Redirect', category: '3xx Redirection', description: 'Permanent redirect preserving HTTP method and body.' },
|
|
169
|
+
{ code: 400, title: 'Bad Request', category: '4xx Client Error', description: 'Malformed syntax, invalid parameters, or failed validation.' },
|
|
170
|
+
{ code: 401, title: 'Unauthorized', category: '4xx Client Error', description: 'Authentication required or credentials invalid.' },
|
|
171
|
+
{ code: 403, title: 'Forbidden', category: '4xx Client Error', description: 'Authenticated client lacks permission for this resource.' },
|
|
172
|
+
{ code: 404, title: 'Not Found', category: '4xx Client Error', description: 'Requested resource could not be found.' },
|
|
173
|
+
{ code: 405, title: 'Method Not Allowed', category: '4xx Client Error', description: 'HTTP method not supported on this endpoint.' },
|
|
174
|
+
{ code: 408, title: 'Request Timeout', category: '4xx Client Error', description: 'Server timed out waiting for client request.' },
|
|
175
|
+
{ code: 409, title: 'Conflict', category: '4xx Client Error', description: 'Request conflicts with current resource state (e.g. duplicate key).' },
|
|
176
|
+
{ code: 413, title: 'Payload Too Large', category: '4xx Client Error', description: 'Request entity exceeds server size limits.' },
|
|
177
|
+
{ code: 415, title: 'Unsupported Media Type', category: '4xx Client Error', description: 'Request Content-Type is not supported.' },
|
|
178
|
+
{ code: 418, title: "I'm a Teapot", category: '4xx Client Error', description: 'RFC 2324 Hyper Text Coffee Pot Control Protocol.' },
|
|
179
|
+
{ code: 422, title: 'Unprocessable Content', category: '4xx Client Error', description: 'Well-formed syntax but semantic validation errors.' },
|
|
180
|
+
{ code: 429, title: 'Too Many Requests', category: '4xx Client Error', description: 'Rate limit exceeded; check Retry-After header.' },
|
|
181
|
+
{ code: 500, title: 'Internal Server Error', category: '5xx Server Error', description: 'Unexpected server-side exception.' },
|
|
182
|
+
{ code: 502, title: 'Bad Gateway', category: '5xx Server Error', description: 'Upstream server returned an invalid response.' },
|
|
183
|
+
{ code: 503, title: 'Service Unavailable', category: '5xx Server Error', description: 'Server overloaded or down for maintenance.' },
|
|
184
|
+
{ code: 504, title: 'Gateway Timeout', category: '5xx Server Error', description: 'Upstream service did not respond in time.' },
|
|
185
|
+
];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { decodeJwt } from './jwt.js';
|
|
2
|
+
type DecodedJwt = ReturnType<typeof decodeJwt>;
|
|
3
|
+
export interface PkceBundle {
|
|
4
|
+
codeVerifier: string;
|
|
5
|
+
codeChallenge: string;
|
|
6
|
+
codeChallengeMethod: 'S256';
|
|
7
|
+
state: string;
|
|
8
|
+
nonce: string;
|
|
9
|
+
authorizationUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PkceGenerateOptions {
|
|
12
|
+
verifierLength?: number;
|
|
13
|
+
authorizationEndpoint?: string;
|
|
14
|
+
clientId?: string;
|
|
15
|
+
redirectUri?: string;
|
|
16
|
+
scope?: string;
|
|
17
|
+
audience?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface OAuthCallbackAnalysis {
|
|
20
|
+
valid: boolean;
|
|
21
|
+
hasError: boolean;
|
|
22
|
+
error?: string;
|
|
23
|
+
errorDescription?: string;
|
|
24
|
+
code?: string;
|
|
25
|
+
state?: string;
|
|
26
|
+
stateMatches?: boolean;
|
|
27
|
+
tokenType?: string;
|
|
28
|
+
expiresIn?: string;
|
|
29
|
+
scope?: string;
|
|
30
|
+
decodedIdToken?: DecodedJwt;
|
|
31
|
+
decodedAccessToken?: DecodedJwt;
|
|
32
|
+
nonceMatches?: boolean;
|
|
33
|
+
pkceChallengeVerified?: boolean;
|
|
34
|
+
securityFindings: Array<{
|
|
35
|
+
severity: 'pass' | 'warn' | 'fail';
|
|
36
|
+
message: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export declare function computePkceS256Challenge(codeVerifier: string): string;
|
|
40
|
+
export declare function generatePkceBundle(options?: PkceGenerateOptions): PkceBundle;
|
|
41
|
+
export declare function analyzeOAuthCallback(callbackUrl: string, expected?: {
|
|
42
|
+
state?: string;
|
|
43
|
+
nonce?: string;
|
|
44
|
+
codeVerifier?: string;
|
|
45
|
+
codeChallenge?: string;
|
|
46
|
+
}): OAuthCallbackAnalysis;
|
|
47
|
+
export type ProtoWireTypeName = 'varint' | 'fixed64' | 'length-delimited' | 'start-group' | 'end-group' | 'fixed32';
|
|
48
|
+
export interface DecodedProtoField {
|
|
49
|
+
fieldNumber: number;
|
|
50
|
+
wireType: number;
|
|
51
|
+
wireTypeName: ProtoWireTypeName;
|
|
52
|
+
fieldName?: string;
|
|
53
|
+
schemaType?: string;
|
|
54
|
+
value: unknown;
|
|
55
|
+
alternatives?: Record<string, unknown>;
|
|
56
|
+
nested?: DecodedProtoField[];
|
|
57
|
+
}
|
|
58
|
+
export interface ProtobufDecodeResult {
|
|
59
|
+
byteLength: number;
|
|
60
|
+
inputEncoding: 'hex' | 'base64';
|
|
61
|
+
fields: DecodedProtoField[];
|
|
62
|
+
mappedObject?: Record<string, unknown>;
|
|
63
|
+
schemaMessage?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Decodes raw binary Protobuf payloads (hex or base64) into structured wire fields
|
|
67
|
+
* and optionally maps field numbers/types using a `.proto` message schema.
|
|
68
|
+
*/
|
|
69
|
+
export declare function decodeProtobufWire(input: string, options?: {
|
|
70
|
+
encoding?: 'auto' | 'hex' | 'base64';
|
|
71
|
+
protoSchema?: string;
|
|
72
|
+
messageName?: string;
|
|
73
|
+
}): ProtobufDecodeResult;
|
|
74
|
+
export {};
|