vouchington-tooling 0.60.0 → 0.61.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/README.md +49 -0
- package/dist/cli/commands/sandbox-command-audit.d.mts +7 -0
- package/dist/cli/commands/sandbox-command-audit.mjs +27 -0
- package/dist/cli/index.mjs +2 -0
- package/dist/cli/parse-forwarded-commands.d.mts +3 -0
- package/dist/cli/parse-forwarded-commands.mjs +2 -0
- package/dist/cli/parse.d.mts +3 -0
- package/dist/cli/usage-text.d.mts +1 -1
- package/dist/cli/usage-text.mjs +9 -0
- package/dist/command-policy/payload.d.mts +2 -0
- package/dist/command-policy/payload.mjs +8 -0
- package/dist/sandbox-command-audit/args.d.mts +20 -0
- package/dist/sandbox-command-audit/args.mjs +64 -0
- package/dist/sandbox-command-audit/classify-prefixes.d.mts +23 -0
- package/dist/sandbox-command-audit/classify-prefixes.mjs +50 -0
- package/dist/sandbox-command-audit/classify.d.mts +46 -0
- package/dist/sandbox-command-audit/classify.mjs +74 -0
- package/dist/sandbox-command-audit/claude-extract.d.mts +23 -0
- package/dist/sandbox-command-audit/claude-extract.mjs +76 -0
- package/dist/sandbox-command-audit/claude-tool-uses.d.mts +15 -0
- package/dist/sandbox-command-audit/claude-tool-uses.mjs +53 -0
- package/dist/sandbox-command-audit/codex-extract.d.mts +21 -0
- package/dist/sandbox-command-audit/codex-extract.mjs +77 -0
- package/dist/sandbox-command-audit/codex-scan.d.mts +11 -0
- package/dist/sandbox-command-audit/codex-scan.mjs +98 -0
- package/dist/sandbox-command-audit/codex-spool.d.mts +14 -0
- package/dist/sandbox-command-audit/codex-spool.mjs +46 -0
- package/dist/sandbox-command-audit/discover-files.d.mts +44 -0
- package/dist/sandbox-command-audit/discover-files.mjs +85 -0
- package/dist/sandbox-command-audit/failure-text.d.mts +7 -0
- package/dist/sandbox-command-audit/failure-text.mjs +34 -0
- package/dist/sandbox-command-audit/fixtures.test-helpers.d.mts +34 -0
- package/dist/sandbox-command-audit/fixtures.test-helpers.mjs +41 -0
- package/dist/sandbox-command-audit/index.d.mts +26 -0
- package/dist/sandbox-command-audit/index.mjs +15 -0
- package/dist/sandbox-command-audit/json-record.d.mts +6 -0
- package/dist/sandbox-command-audit/json-record.mjs +16 -0
- package/dist/sandbox-command-audit/limits.d.mts +30 -0
- package/dist/sandbox-command-audit/limits.mjs +66 -0
- package/dist/sandbox-command-audit/repo-scope.d.mts +25 -0
- package/dist/sandbox-command-audit/repo-scope.mjs +79 -0
- package/dist/sandbox-command-audit/report-raw.d.mts +16 -0
- package/dist/sandbox-command-audit/report-raw.mjs +55 -0
- package/dist/sandbox-command-audit/report.d.mts +10 -0
- package/dist/sandbox-command-audit/report.mjs +61 -0
- package/dist/sandbox-command-audit/run.d.mts +36 -0
- package/dist/sandbox-command-audit/run.mjs +70 -0
- package/dist/sandbox-command-audit/scan.d.mts +10 -0
- package/dist/sandbox-command-audit/scan.mjs +79 -0
- package/dist/sandbox-command-audit/transcript-cwd.d.mts +14 -0
- package/dist/sandbox-command-audit/transcript-cwd.mjs +153 -0
- package/dist/sandbox-command-audit/types.d.mts +59 -0
- package/dist/sandbox-command-audit/types.mjs +23 -0
- package/dist/tmux/cli.mjs +1 -1
- package/dist/tmux/reminder-post-tool.d.mts +1 -1
- package/dist/tmux/reminder-post-tool.mjs +2 -2
- package/package.json +6 -1
- package/scripts/__pycache__/run_bounded_process.cpython-312.pyc +0 -0
- package/dist/tmux/hook-payload.d.mts +0 -8
- package/dist/tmux/hook-payload.mjs +0 -39
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import { open } from 'node:fs/promises';
|
|
54
|
+
import { join, relative, sep } from 'node:path';
|
|
55
|
+
import { openTranscriptLines } from "../retrospective-transcript/index.mjs";
|
|
56
|
+
const PREFIX_BYTES = 64 * 1024;
|
|
57
|
+
async function readPrefix(path, maxBytes) {
|
|
58
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
59
|
+
try {
|
|
60
|
+
const handle = __addDisposableResource(env_1, await open(path, 'r'), true);
|
|
61
|
+
const buffer = Buffer.alloc(maxBytes);
|
|
62
|
+
const { bytesRead } = await handle.read(buffer, 0, maxBytes, 0);
|
|
63
|
+
return { text: buffer.toString('utf8', 0, bytesRead), truncated: bytesRead === maxBytes };
|
|
64
|
+
}
|
|
65
|
+
catch (e_1) {
|
|
66
|
+
env_1.error = e_1;
|
|
67
|
+
env_1.hasError = true;
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
const result_1 = __disposeResources(env_1);
|
|
71
|
+
if (result_1)
|
|
72
|
+
await result_1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function nonEmptyString(value) {
|
|
76
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
77
|
+
}
|
|
78
|
+
function cwdFromRecord(record) {
|
|
79
|
+
if (typeof record !== 'object' || record === null)
|
|
80
|
+
return undefined;
|
|
81
|
+
const top = nonEmptyString(record.cwd);
|
|
82
|
+
if (top !== undefined)
|
|
83
|
+
return top;
|
|
84
|
+
return nonEmptyString(record.payload?.cwd);
|
|
85
|
+
}
|
|
86
|
+
function cwdFromLine(line) {
|
|
87
|
+
if (line.length === 0)
|
|
88
|
+
return undefined;
|
|
89
|
+
try {
|
|
90
|
+
return cwdFromRecord(JSON.parse(line));
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// A malformed or partial line is skipped: the cwd is read best-effort.
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// A prefix read almost always cuts its final line mid-object, so that fragment is dropped.
|
|
98
|
+
function cwdFromText(text, dropLastLine) {
|
|
99
|
+
const lines = text.split('\n');
|
|
100
|
+
for (const line of dropLastLine ? lines.slice(0, -1) : lines) {
|
|
101
|
+
const cwd = cwdFromLine(line);
|
|
102
|
+
if (cwd !== undefined)
|
|
103
|
+
return cwd;
|
|
104
|
+
}
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The first `cwd` in a transcript, top-level (Claude records) or at `payload.cwd` (Codex
|
|
109
|
+
* `session_meta`). It reads a 64 KB prefix and streams the whole file only when that prefix is
|
|
110
|
+
* truncated and yielded nothing. First-cwd-wins: a session that later `cd`s into another repo is
|
|
111
|
+
* bucketed by its earliest cwd.
|
|
112
|
+
*/
|
|
113
|
+
export async function readTranscriptCwd(path) {
|
|
114
|
+
const prefix = await readPrefix(path, PREFIX_BYTES);
|
|
115
|
+
const fromPrefix = cwdFromText(prefix.text, prefix.truncated);
|
|
116
|
+
if (fromPrefix !== undefined || !prefix.truncated)
|
|
117
|
+
return fromPrefix;
|
|
118
|
+
const opened = await openTranscriptLines(path);
|
|
119
|
+
if ('error' in opened)
|
|
120
|
+
throw new Error(opened.error);
|
|
121
|
+
for await (const line of opened.lines) {
|
|
122
|
+
const cwd = cwdFromLine(line);
|
|
123
|
+
if (cwd !== undefined)
|
|
124
|
+
return cwd;
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
// A Claude project directory name is a lossy encoding of the cwd, so distinct checkouts can share
|
|
129
|
+
// one. The cwd is therefore read per session: a top-level session file carries its own, and a
|
|
130
|
+
// subagent transcript under <session>/subagents/ resolves through its owning session file.
|
|
131
|
+
function owningSessionFile(projectsDir, path) {
|
|
132
|
+
const [projectDir, session, folder] = relative(projectsDir, path).split(sep);
|
|
133
|
+
return folder === 'subagents' ? join(projectsDir, projectDir, `${session}.jsonl`) : path;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Resolves a Claude transcript's cwd from its own session file (or its subagent's owning session)
|
|
137
|
+
* and memoizes it per session file. A session whose owner is missing or unreadable rejects, which
|
|
138
|
+
* discovery counts as an unknown cwd rather than guessing from a sibling session. A rejected
|
|
139
|
+
* lookup is evicted so the next call retries.
|
|
140
|
+
*/
|
|
141
|
+
export function claudeSessionCwdResolver(projectsDir) {
|
|
142
|
+
const cache = new Map();
|
|
143
|
+
return async (path) => {
|
|
144
|
+
const owner = owningSessionFile(projectsDir, path);
|
|
145
|
+
let resolved = cache.get(owner);
|
|
146
|
+
if (resolved === undefined) {
|
|
147
|
+
resolved = readTranscriptCwd(owner);
|
|
148
|
+
resolved.catch(() => cache.delete(owner));
|
|
149
|
+
cache.set(owner, resolved);
|
|
150
|
+
}
|
|
151
|
+
return resolved;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { AuditLimits, RawRetention } from './limits.mts';
|
|
2
|
+
export type ClaudeToolDenialKind = 'user-rejected' | 'permission-rule' | 'automode-blocked';
|
|
3
|
+
/** A failure bucket. `e2big` and `genuine` are built in; a rule may return any other label. */
|
|
4
|
+
export type FailureKind = string;
|
|
5
|
+
/** A Claude Bash tool_use with `input.dangerouslyDisableSandbox: true`. */
|
|
6
|
+
export type ClaudeEscalationRecord = {
|
|
7
|
+
source: 'claude';
|
|
8
|
+
command: string;
|
|
9
|
+
};
|
|
10
|
+
/** A Claude tool_result with a top-level `toolDenialKind`; `command` is unset when uncorrelated. */
|
|
11
|
+
export type ClaudeDenialRecord = {
|
|
12
|
+
source: 'claude';
|
|
13
|
+
kind: ClaudeToolDenialKind;
|
|
14
|
+
command?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
/** A Claude Bash tool_result with `is_error: true` whose text matched a failure signature. */
|
|
17
|
+
export type ClaudeSandboxFailureRecord = {
|
|
18
|
+
source: 'claude';
|
|
19
|
+
kind: FailureKind;
|
|
20
|
+
command?: string | undefined;
|
|
21
|
+
errorText: string;
|
|
22
|
+
};
|
|
23
|
+
/** A Codex CommandExecution whose output an injected rule classified. */
|
|
24
|
+
export type CodexSandboxFailureRecord = {
|
|
25
|
+
source: 'codex';
|
|
26
|
+
kind: FailureKind;
|
|
27
|
+
command?: string | undefined;
|
|
28
|
+
errorText: string;
|
|
29
|
+
};
|
|
30
|
+
/** Per-source counts of files dropped by repo scoping, so a cross-repo leak is never silent. */
|
|
31
|
+
export type SkipCounts = {
|
|
32
|
+
claude: number;
|
|
33
|
+
codex: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Failure classification supplied by the caller. It runs after the E2BIG check and before the
|
|
37
|
+
* built-in permission signatures, so a repository can claim a failure for its own bucket (for
|
|
38
|
+
* example a write-path denial that needs a sandbox config fix rather than an allow entry).
|
|
39
|
+
*/
|
|
40
|
+
export type ClassifyFailure = (command: string | undefined, text: string, source: 'claude' | 'codex') => FailureKind | undefined;
|
|
41
|
+
export type ScanRules = {
|
|
42
|
+
classifyFailure?: ClassifyFailure | undefined;
|
|
43
|
+
limits?: Partial<AuditLimits>;
|
|
44
|
+
};
|
|
45
|
+
export type ScanResult = {
|
|
46
|
+
claudeEscalations: ClaudeEscalationRecord[];
|
|
47
|
+
claudeDenials: ClaudeDenialRecord[];
|
|
48
|
+
claudeSandboxFailures: ClaudeSandboxFailureRecord[];
|
|
49
|
+
codexSandboxFailures: CodexSandboxFailureRecord[];
|
|
50
|
+
claudeFilesScanned: number;
|
|
51
|
+
codexFilesScanned: number;
|
|
52
|
+
readErrors: string[];
|
|
53
|
+
repoRoots: string[];
|
|
54
|
+
skippedOtherRepo: SkipCounts;
|
|
55
|
+
skippedUnknownCwd: SkipCounts;
|
|
56
|
+
/** Raw values exist for `--raw`; every cap is reported so a bounded run never looks complete. */
|
|
57
|
+
rawRetention: RawRetention;
|
|
58
|
+
};
|
|
59
|
+
export declare function emptyScanResult(): ScanResult;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function emptyScanResult() {
|
|
2
|
+
return {
|
|
3
|
+
claudeEscalations: [],
|
|
4
|
+
claudeDenials: [],
|
|
5
|
+
claudeSandboxFailures: [],
|
|
6
|
+
codexSandboxFailures: [],
|
|
7
|
+
claudeFilesScanned: 0,
|
|
8
|
+
codexFilesScanned: 0,
|
|
9
|
+
readErrors: [],
|
|
10
|
+
repoRoots: [],
|
|
11
|
+
skippedOtherRepo: { claude: 0, codex: 0 },
|
|
12
|
+
skippedUnknownCwd: { claude: 0, codex: 0 },
|
|
13
|
+
rawRetention: {
|
|
14
|
+
commandTextsTruncated: 0,
|
|
15
|
+
errorTextsTruncated: 0,
|
|
16
|
+
pendingToolUsesDropped: 0,
|
|
17
|
+
pendingToolUseBytesDropped: 0,
|
|
18
|
+
recordsDropped: 0,
|
|
19
|
+
rawBytesDropped: 0,
|
|
20
|
+
retainedRawBytes: 0,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
package/dist/tmux/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { runScript } from "../cli/commands/spawn-script.mjs";
|
|
3
3
|
import { packageScriptPath } from "../cli/script-path.mjs";
|
|
4
4
|
import { TMUX_USAGE } from "./cli-shared.mjs";
|
|
5
|
-
import { parseHookPayload } from "
|
|
5
|
+
import { parseHookPayload } from "../command-policy/hook/harness.mjs";
|
|
6
6
|
import { renderPostToolReminder } from "./reminder-post-tool.mjs";
|
|
7
7
|
import { runUp } from "./up.mjs";
|
|
8
8
|
export { TMUX_USAGE };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
import { packageScriptPath } from "../cli/script-path.mjs";
|
|
3
|
-
import { extractToolCommand,
|
|
3
|
+
import { extractToolCommand, hookToolExitCode, hookToolName } from "../command-policy/payload.mjs";
|
|
4
4
|
const PR_CREATE_COMMAND_PATTERN = /(^|[;&|])\s*gh\s+pr\s+create(\s|$)/;
|
|
5
5
|
const GIT_PUSH_COMMAND_PATTERN = /(^|[;&|])\s*git\s+push(\s|$)/;
|
|
6
6
|
const RESET_WORKTREE_PATTERN = /(^|[;&|])\s*(?:\S*\/)?reset-worktree(?:\.sh)?(?:\s+(--help|-h))?(?=[;&|]|\s|$)/g;
|
|
@@ -64,7 +64,7 @@ export function renderPostToolReminder(payload, options = {}) {
|
|
|
64
64
|
if (!SHELL_TOOLS.has(toolName))
|
|
65
65
|
return null;
|
|
66
66
|
const command = extractToolCommand(payload);
|
|
67
|
-
const exitCode =
|
|
67
|
+
const exitCode = hookToolExitCode(payload);
|
|
68
68
|
if (command === '' || (exitCode !== undefined && exitCode !== 0))
|
|
69
69
|
return null;
|
|
70
70
|
if (PR_CREATE_COMMAND_PATTERN.test(command)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vouchington-tooling",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.1",
|
|
4
4
|
"description": "Vouchington CLI and extractable tooling libraries.",
|
|
5
5
|
"homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -316,6 +316,11 @@
|
|
|
316
316
|
"import": "./dist/dead-code/index.mjs",
|
|
317
317
|
"default": "./dist/dead-code/index.mjs"
|
|
318
318
|
},
|
|
319
|
+
"./sandbox-command-audit": {
|
|
320
|
+
"types": "./dist/sandbox-command-audit/index.d.mts",
|
|
321
|
+
"import": "./dist/sandbox-command-audit/index.mjs",
|
|
322
|
+
"default": "./dist/sandbox-command-audit/index.mjs"
|
|
323
|
+
},
|
|
319
324
|
"./tmux": {
|
|
320
325
|
"types": "./dist/tmux/index.d.mts",
|
|
321
326
|
"import": "./dist/tmux/index.mjs",
|
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type HookPayload = Record<string, unknown>;
|
|
2
|
-
/** Tool name across Claude-compatible (`tool_name`), camelCase and bare (`name`) payloads. */
|
|
3
|
-
export declare function hookToolName(payload: HookPayload): string;
|
|
4
|
-
/** The shell command a tool call ran, or '' when the payload carries none. */
|
|
5
|
-
export declare function extractToolCommand(payload: HookPayload): string;
|
|
6
|
-
/** A numeric `exit_code` from the response shapes that carry one; undefined otherwise. */
|
|
7
|
-
export declare function toolExitCode(payload: HookPayload): number | undefined;
|
|
8
|
-
export declare function parseHookPayload(raw: string): HookPayload;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
function isRecord(value) {
|
|
2
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
|
-
}
|
|
4
|
-
/** Tool name across Claude-compatible (`tool_name`), camelCase and bare (`name`) payloads. */
|
|
5
|
-
export function hookToolName(payload) {
|
|
6
|
-
for (const key of ['tool_name', 'toolName', 'name']) {
|
|
7
|
-
const value = payload[key];
|
|
8
|
-
if (typeof value === 'string')
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
return '';
|
|
12
|
-
}
|
|
13
|
-
/** The shell command a tool call ran, or '' when the payload carries none. */
|
|
14
|
-
export function extractToolCommand(payload) {
|
|
15
|
-
for (const key of ['tool_input', 'toolInput', 'input']) {
|
|
16
|
-
const input = payload[key];
|
|
17
|
-
if (isRecord(input) && typeof input.command === 'string')
|
|
18
|
-
return input.command;
|
|
19
|
-
}
|
|
20
|
-
return typeof payload.command === 'string' ? payload.command : '';
|
|
21
|
-
}
|
|
22
|
-
/** A numeric `exit_code` from the response shapes that carry one; undefined otherwise. */
|
|
23
|
-
export function toolExitCode(payload) {
|
|
24
|
-
for (const key of ['tool_response', 'toolResponse', 'toolResult']) {
|
|
25
|
-
const response = payload[key];
|
|
26
|
-
if (isRecord(response) && typeof response.exit_code === 'number')
|
|
27
|
-
return response.exit_code;
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
export function parseHookPayload(raw) {
|
|
32
|
-
try {
|
|
33
|
-
const parsed = JSON.parse(raw);
|
|
34
|
-
return isRecord(parsed) ? parsed : {};
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return {};
|
|
38
|
-
}
|
|
39
|
-
}
|