replicas-engine 0.1.820 → 0.1.822
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/src/{asp-host-FTSNKWVO.js → asp-host-5ANYDVA2.js} +4 -4
- package/dist/src/{chunk-PX2GRT54.js → chunk-36JSVUII.js} +2 -2
- package/dist/src/{chunk-6FLPUBVF.js → chunk-3OWWM4XG.js} +2 -2
- package/dist/src/{chunk-OCQQ6AO3.js → chunk-GVHELVNV.js} +8 -76
- package/dist/src/{chunk-GJ5ROWQX.js → chunk-Q2ZY5SAH.js} +4 -4
- package/dist/src/{chunk-C52ENUG3.js → chunk-QBZ6XTV7.js} +5 -7
- package/dist/src/{chunk-JAITEGC4.js → chunk-YBUQB2C2.js} +1 -1
- package/dist/src/command-protection-hook.js +3 -3
- package/dist/src/deepseek-command-protection-plugin.js +6 -6
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +15 -19
- package/dist/src/post-tool-pr-hook.js +3 -4
- package/dist/src/relay-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
getCodexAspHost,
|
|
6
6
|
restartCodexAspHost,
|
|
7
7
|
restartCodexAspHostIfRunning
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-Q2ZY5SAH.js";
|
|
9
|
+
import "./chunk-YBUQB2C2.js";
|
|
10
|
+
import "./chunk-36JSVUII.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-GVHELVNV.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
export {
|
|
15
15
|
getCodexAspHost,
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES,
|
|
6
6
|
isVersionBelow
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GVHELVNV.js";
|
|
8
8
|
|
|
9
9
|
// src/utils/codex-agent-env.ts
|
|
10
10
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -241,7 +241,7 @@ var DEFAULT_CODEX_ARGS = [
|
|
|
241
241
|
var MIN_CODEX_CLI_VERSION = "0.153.3";
|
|
242
242
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
243
243
|
var codexCliVersionEnsured = null;
|
|
244
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
244
|
+
var ENGINE_PACKAGE_VERSION = "0.1.822";
|
|
245
245
|
var INITIALIZE_METHOD = "initialize";
|
|
246
246
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
247
247
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
monolithRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YBUQB2C2.js";
|
|
7
7
|
import {
|
|
8
8
|
extractCommandProtectionCommandText,
|
|
9
9
|
findGitCommitSignals,
|
|
10
10
|
findPrMergeSignals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GVHELVNV.js";
|
|
12
12
|
|
|
13
13
|
// src/services/command-protection-service.ts
|
|
14
14
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -1839,53 +1839,6 @@ var LEGACY_WEB_APP_PATHS = {
|
|
|
1839
1839
|
home: "/home",
|
|
1840
1840
|
dashboardWorkspaces: `${DASHBOARD_PATH}/workspaces`
|
|
1841
1841
|
};
|
|
1842
|
-
var PR_URL_REGEX = /github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/;
|
|
1843
|
-
function parsePrUrl(url) {
|
|
1844
|
-
const match = url.match(PR_URL_REGEX);
|
|
1845
|
-
if (!match) return null;
|
|
1846
|
-
const [, owner, repo, numberStr] = match;
|
|
1847
|
-
const number = Number.parseInt(numberStr, 10);
|
|
1848
|
-
if (!Number.isFinite(number)) return null;
|
|
1849
|
-
return { owner, repo, number };
|
|
1850
|
-
}
|
|
1851
|
-
function parseCodeHostPrUrl(url) {
|
|
1852
|
-
const github = parsePrUrl(url);
|
|
1853
|
-
if (github) {
|
|
1854
|
-
return {
|
|
1855
|
-
...github,
|
|
1856
|
-
provider: "github",
|
|
1857
|
-
host: "github.com",
|
|
1858
|
-
repositoryPath: `${github.owner}/${github.repo}`,
|
|
1859
|
-
repoUrl: `https://github.com/${github.owner}/${github.repo}`
|
|
1860
|
-
};
|
|
1861
|
-
}
|
|
1862
|
-
let parsed;
|
|
1863
|
-
try {
|
|
1864
|
-
parsed = new URL(url);
|
|
1865
|
-
} catch {
|
|
1866
|
-
return null;
|
|
1867
|
-
}
|
|
1868
|
-
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return null;
|
|
1869
|
-
const segments = parsed.pathname.split("/").filter(Boolean);
|
|
1870
|
-
const separatorIndex = segments.indexOf("-");
|
|
1871
|
-
if (separatorIndex <= 0 || segments[separatorIndex + 1] !== "merge_requests") return null;
|
|
1872
|
-
const number = Number.parseInt(segments[separatorIndex + 2] ?? "", 10);
|
|
1873
|
-
if (!Number.isFinite(number)) return null;
|
|
1874
|
-
const repositorySegments = decodePathSegments(segments.slice(0, separatorIndex));
|
|
1875
|
-
const repo = repositorySegments[repositorySegments.length - 1];
|
|
1876
|
-
const owner = repositorySegments[0];
|
|
1877
|
-
if (!owner || !repo) return null;
|
|
1878
|
-
const repositoryPath = repositorySegments.join("/");
|
|
1879
|
-
return {
|
|
1880
|
-
provider: "gitlab",
|
|
1881
|
-
host: parsed.host.toLowerCase(),
|
|
1882
|
-
owner,
|
|
1883
|
-
repo,
|
|
1884
|
-
number,
|
|
1885
|
-
repositoryPath,
|
|
1886
|
-
repoUrl: `${parsed.origin}/${repositoryPath}`
|
|
1887
|
-
};
|
|
1888
|
-
}
|
|
1889
1842
|
function decodePathSegments(segments) {
|
|
1890
1843
|
return segments.map((segment) => {
|
|
1891
1844
|
try {
|
|
@@ -6873,10 +6826,6 @@ function stringifyCommandProtectionInput(value) {
|
|
|
6873
6826
|
return String(value);
|
|
6874
6827
|
}
|
|
6875
6828
|
}
|
|
6876
|
-
function findCodeHostPullRequestUrls(value) {
|
|
6877
|
-
const candidates = stringifyCommandProtectionInput(value).match(/https?:\/\/[^\s<>"'\\]+/g) ?? [];
|
|
6878
|
-
return [...new Set(candidates.map((url) => url.replace(/[),.;\]}]+$/, "")).filter((url) => parseCodeHostPrUrl(url) !== null))];
|
|
6879
|
-
}
|
|
6880
6829
|
function normalizeCommandProtectionText(text) {
|
|
6881
6830
|
return text.replace(/\\\n/g, " ").replace(/\s+/g, " ").trim().toLowerCase();
|
|
6882
6831
|
}
|
|
@@ -6933,36 +6882,20 @@ function findGitCommitSignals(request) {
|
|
|
6933
6882
|
const command = extractCommandProtectionCommandText(request, { stringifyFallback: true }) ?? "";
|
|
6934
6883
|
return findGitCommitCommands(command).length > 0 ? ["git-commit"] : [];
|
|
6935
6884
|
}
|
|
6936
|
-
function
|
|
6937
|
-
const
|
|
6938
|
-
|
|
6885
|
+
function shouldRefreshPullRequests(toolName, toolInput) {
|
|
6886
|
+
const name = toolName.toLowerCase();
|
|
6887
|
+
if (/(?:^|[_-])(?:(?:create|open|submit)[_-]?(?:pr|pull[_-]?request|mr|merge[_-]?request)|(?:pr|pull[_-]?request|mr|merge[_-]?request)[_-]?(?:create|open|submit)|(?:checkout|create|switch)[_-]?branch|branch[_-]?(?:checkout|create|switch))(?:$|[_-])/.test(name)) return true;
|
|
6888
|
+
const command = normalizeCommandProtectionText(extractCommandProtectionCommandText({ toolInput }) ?? "");
|
|
6939
6889
|
return [
|
|
6940
6890
|
/\bgit\s+push\b/,
|
|
6941
6891
|
/\bgit\s+(?:branch|checkout|switch|pull|merge|rebase|reset)\b/,
|
|
6942
6892
|
/\bgit\s+worktree\s+add\b/,
|
|
6943
|
-
/\bgh\
|
|
6944
|
-
/\bgh\s+api\b[\s\S]*(?:\/repos\/[^/\s]+\/[^/\s]+\/pulls\b|\bcreatepullrequest\b)/,
|
|
6893
|
+
/\bgh\s+pr\s+(?:checkout|create|new|ready|reopen)\b/,
|
|
6945
6894
|
/\b(?:glab|gitlab)\s+mr\s+(?:checkout|create)\b/,
|
|
6946
6895
|
/\bhub\s+pull-request\b/,
|
|
6947
6896
|
/\b(?:tea\s+pulls|bb\s+pr|az\s+repos\s+pr)\s+create\b/,
|
|
6948
|
-
/\
|
|
6949
|
-
|
|
6950
|
-
/\b(?:pr|pull[_-]?request|mr|merge[_-]?request)[_-]?(?:create|open|submit)\b/,
|
|
6951
|
-
/\b(?:checkout|create|switch)[_-]?branch\b/,
|
|
6952
|
-
/\bbranch[_-]?(?:checkout|create|switch)\b/,
|
|
6953
|
-
/\b(?:switched to|checked out|created and switched to)(?: a new)? branch\b/,
|
|
6954
|
-
/github\.com\/[^/\s]+\/[^/\s]+\/pull\/\d+\b/,
|
|
6955
|
-
/\/merge_requests\/\d+\b/,
|
|
6956
|
-
/\b(?:create|open|submit)(?:pull|merge)request\b/,
|
|
6957
|
-
/\b(?:pull|merge)request(?:create|open|submit)\b/,
|
|
6958
|
-
/\bmergerequestcreate\b/,
|
|
6959
|
-
/api\.github\.com\/repos\/[^/\s]+\/[^/\s]+\/pulls\b/,
|
|
6960
|
-
/\/projects\/[^/\s]+\/merge_requests\b/,
|
|
6961
|
-
/\/pullrequests\b/,
|
|
6962
|
-
/\/_apis\/git\/repositories\/[^/\s]+\/pullrequests\b/,
|
|
6963
|
-
/\/pulls\b[\s\S]*\b(?:post|create)\b/,
|
|
6964
|
-
/\/merge_requests\b[\s\S]*\b(?:post|create)\b/
|
|
6965
|
-
].some((pattern) => pattern.test(combined));
|
|
6897
|
+
/\bmutation\b[\s\S]*\b(?:createpullrequest|mergerequestcreate)\b/
|
|
6898
|
+
].some((pattern) => pattern.test(command)) || /\b(?:gh\s+api|glab\s+api|curl)\b/.test(command) && /(?:-x|--method|--request)[\s=]+['"]?post\b/.test(command) && /\/(?:pulls|merge_requests)\b/.test(command);
|
|
6966
6899
|
}
|
|
6967
6900
|
|
|
6968
6901
|
// ../shared/src/routes/plugin-catalog.ts
|
|
@@ -7890,11 +7823,10 @@ export {
|
|
|
7890
7823
|
CLAUDE_AUTH_ENV_KEYS_BY_METHOD,
|
|
7891
7824
|
AI_GATEWAY_BASE_URL,
|
|
7892
7825
|
fetchAiGatewayModels,
|
|
7893
|
-
findCodeHostPullRequestUrls,
|
|
7894
7826
|
extractCommandProtectionCommandText,
|
|
7895
7827
|
findPrMergeSignals,
|
|
7896
7828
|
findGitCommitSignals,
|
|
7897
|
-
|
|
7829
|
+
shouldRefreshPullRequests,
|
|
7898
7830
|
MAX_REPO_FILE_CONTENT_BYTES,
|
|
7899
7831
|
searchRepoFileIndex,
|
|
7900
7832
|
isExcludedRepoFilePath,
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YBUQB2C2.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
buildCodexAgentEnv
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-36JSVUII.js";
|
|
13
13
|
import {
|
|
14
14
|
CODEX_AUTH_ENV_KEYS,
|
|
15
15
|
CODEX_AUTH_ENV_KEYS_BY_METHOD,
|
|
16
16
|
codexAuthEnvFromResponse,
|
|
17
17
|
createErrorResult,
|
|
18
18
|
createSuccessResult
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GVHELVNV.js";
|
|
20
20
|
|
|
21
21
|
// src/managers/codex-token-manager.ts
|
|
22
22
|
import { promises as fs } from "fs";
|
|
@@ -232,7 +232,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
232
232
|
const data = await response.json();
|
|
233
233
|
await this.applyCredentialsResponse(data);
|
|
234
234
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
235
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
235
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-5ANYDVA2.js");
|
|
236
236
|
await restartCodexAspHostIfRunning2();
|
|
237
237
|
}
|
|
238
238
|
if (data.scope) {
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
import { createRequire as __createRequire } from 'node:module';
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "./chunk-OCQQ6AO3.js";
|
|
5
|
+
shouldRefreshPullRequests
|
|
6
|
+
} from "./chunk-GVHELVNV.js";
|
|
8
7
|
|
|
9
8
|
// src/services/post-tool-pr-notifier.ts
|
|
10
|
-
async function notifyPostToolUse(toolName, toolInput
|
|
11
|
-
if (!
|
|
9
|
+
async function notifyPostToolUse(toolName, toolInput) {
|
|
10
|
+
if (!shouldRefreshPullRequests(toolName, toolInput)) return false;
|
|
12
11
|
const port = process.env.REPLICAS_ENGINE_PORT;
|
|
13
12
|
const secret = process.env.REPLICAS_ENGINE_SECRET;
|
|
14
13
|
if (!port || !secret) throw new Error("Replicas engine connection is unavailable.");
|
|
15
14
|
const response = await fetch(`http://127.0.0.1:${port}/pull-requests/check`, {
|
|
16
15
|
method: "POST",
|
|
17
|
-
headers: { "X-Replicas-Engine-Secret": secret
|
|
18
|
-
body: JSON.stringify({ prUrls: findCodeHostPullRequestUrls(toolResult) }),
|
|
16
|
+
headers: { "X-Replicas-Engine-Secret": secret },
|
|
19
17
|
signal: AbortSignal.timeout(3e4)
|
|
20
18
|
});
|
|
21
19
|
if (!response.ok) throw new Error(`Replicas pull request check failed (${response.status}).`);
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-3OWWM4XG.js";
|
|
7
|
+
import "./chunk-YBUQB2C2.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-GVHELVNV.js";
|
|
12
12
|
import "./chunk-VEQXQN22.js";
|
|
13
13
|
|
|
14
14
|
// src/command-protection-hook.ts
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3OWWM4XG.js";
|
|
7
7
|
import {
|
|
8
8
|
notifyPostToolUse
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-QBZ6XTV7.js";
|
|
10
|
+
import "./chunk-YBUQB2C2.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-GVHELVNV.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/deepseek-command-protection-plugin.ts
|
|
@@ -25,8 +25,8 @@ function replicasCommandProtection(context) {
|
|
|
25
25
|
});
|
|
26
26
|
return result.allowed ? next() : { kind: "deny", reason: result.reason ?? "Blocked by Replicas command protection." };
|
|
27
27
|
});
|
|
28
|
-
context.on("tools/post-execute", async (execution,
|
|
29
|
-
await notifyPostToolUse(execution.name, execution.arguments
|
|
28
|
+
context.on("tools/post-execute", async (execution, _result, next) => {
|
|
29
|
+
await notifyPostToolUse(execution.name, execution.arguments).catch(() => {
|
|
30
30
|
});
|
|
31
31
|
return next();
|
|
32
32
|
});
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
AppServerProcess,
|
|
10
10
|
buildCodexAgentEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-36JSVUII.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
getMemoryOutputSafetyViolation,
|
|
15
15
|
headlessAgentRequestSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GVHELVNV.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
|
|
19
19
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
evaluateCommandProtection,
|
|
92
92
|
extractToolCommand,
|
|
93
93
|
reportCommandProtectionBlock
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-3OWWM4XG.js";
|
|
95
95
|
import {
|
|
96
96
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
97
97
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -131,20 +131,20 @@ import {
|
|
|
131
131
|
recordCredentialFallback,
|
|
132
132
|
recordExhaustedCredential,
|
|
133
133
|
restartCodexAspHost
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-Q2ZY5SAH.js";
|
|
135
135
|
import {
|
|
136
136
|
ENGINE_ENV,
|
|
137
137
|
IS_WARMING_MODE,
|
|
138
138
|
monolithRequest,
|
|
139
139
|
monolithService,
|
|
140
140
|
setAgentCredentialSnapshot
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-YBUQB2C2.js";
|
|
142
142
|
import {
|
|
143
143
|
AspClient,
|
|
144
144
|
SUBPROCESS_MAX_BUFFER,
|
|
145
145
|
execAsync,
|
|
146
146
|
execFileAsync
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-36JSVUII.js";
|
|
148
148
|
import {
|
|
149
149
|
isRecord as isRecord2
|
|
150
150
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -267,7 +267,6 @@ import {
|
|
|
267
267
|
extractToolResultText,
|
|
268
268
|
fetchAiGatewayModels,
|
|
269
269
|
fetchOpenCodeGoCatalog,
|
|
270
|
-
findCodeHostPullRequestUrls,
|
|
271
270
|
forkChatRequestSchema,
|
|
272
271
|
formatChatForkHandoffMessage,
|
|
273
272
|
getChatExecutionProvider,
|
|
@@ -318,7 +317,6 @@ import {
|
|
|
318
317
|
isValidEngineLogSessionId,
|
|
319
318
|
isValidRelayBaseProvider,
|
|
320
319
|
lastUserBlockText,
|
|
321
|
-
mayCreatePullRequest,
|
|
322
320
|
mergeSlashCommands,
|
|
323
321
|
messageRelaySubagentRequestSchema,
|
|
324
322
|
normalizeAutoCompactThreshold,
|
|
@@ -347,10 +345,11 @@ import {
|
|
|
347
345
|
serializeCanvasContentResponse,
|
|
348
346
|
serializeMuseAuthFile,
|
|
349
347
|
shellQuotePosix,
|
|
348
|
+
shouldRefreshPullRequests,
|
|
350
349
|
spawnRelaySubagentRequestSchema,
|
|
351
350
|
stripAgentDiagnosticErrors,
|
|
352
351
|
withTimeout
|
|
353
|
-
} from "./chunk-
|
|
352
|
+
} from "./chunk-GVHELVNV.js";
|
|
354
353
|
import {
|
|
355
354
|
__commonJS,
|
|
356
355
|
__export,
|
|
@@ -12165,15 +12164,14 @@ var PullRequestCheckService = class {
|
|
|
12165
12164
|
// Plain single-flight would hand a caller a result gathered before its PR
|
|
12166
12165
|
// existed, so callers arriving mid-run instead share one trailing run that
|
|
12167
12166
|
// starts after the current one settles.
|
|
12168
|
-
check(
|
|
12169
|
-
const registration = prUrls.length > 0 ? monolithService.sendEvent({ type: "pull_request_check", payload: { repoStatuses: [], prUrls } }) : Promise.resolve();
|
|
12167
|
+
check() {
|
|
12170
12168
|
const running = this.running;
|
|
12171
12169
|
const refresh = !running ? this.start() : this.trailing ??= running.catch(() => {
|
|
12172
12170
|
}).then(() => {
|
|
12173
12171
|
this.trailing = null;
|
|
12174
12172
|
return this.start();
|
|
12175
12173
|
});
|
|
12176
|
-
return
|
|
12174
|
+
return refresh;
|
|
12177
12175
|
}
|
|
12178
12176
|
start() {
|
|
12179
12177
|
const run = withTimeout(this.refresh(), CHECK_TIMEOUT_MS, "Pull request check timed out").finally(() => {
|
|
@@ -13440,8 +13438,8 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13440
13438
|
PostToolUse: [{
|
|
13441
13439
|
matcher: "*",
|
|
13442
13440
|
hooks: [async (input) => {
|
|
13443
|
-
if (input.hook_event_name === "PostToolUse" &&
|
|
13444
|
-
pullRequestCheckService.check(
|
|
13441
|
+
if (input.hook_event_name === "PostToolUse" && shouldRefreshPullRequests(input.tool_name, input.tool_input)) {
|
|
13442
|
+
pullRequestCheckService.check().catch(() => {
|
|
13445
13443
|
});
|
|
13446
13444
|
}
|
|
13447
13445
|
return {};
|
|
@@ -15485,8 +15483,8 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15485
15483
|
this.emitTranscriptUpdated(notification.params.threadId, { immediate: true });
|
|
15486
15484
|
linearForwarder.sendEvent(convertCodexAspNotification(notification, linearSessionId ?? ""));
|
|
15487
15485
|
const completedItem = notification.params.item;
|
|
15488
|
-
if (completedItem.type === "commandExecution" && completedItem.exitCode === 0 &&
|
|
15489
|
-
pullRequestCheckService.check(
|
|
15486
|
+
if (completedItem.type === "commandExecution" && completedItem.exitCode === 0 && shouldRefreshPullRequests("commandExecution", { command: completedItem.command }) || completedItem.type === "mcpToolCall" && completedItem.status === "completed" && shouldRefreshPullRequests(completedItem.tool, completedItem.arguments) || completedItem.type === "dynamicToolCall" && completedItem.success !== false && shouldRefreshPullRequests(completedItem.tool, completedItem.arguments)) {
|
|
15487
|
+
pullRequestCheckService.check().catch(() => {
|
|
15490
15488
|
});
|
|
15491
15489
|
}
|
|
15492
15490
|
},
|
|
@@ -59561,8 +59559,8 @@ function registerCommandProtection(cwd, historyFile, recordHistoryEvent) {
|
|
|
59561
59559
|
return void 0;
|
|
59562
59560
|
});
|
|
59563
59561
|
pi.on("tool_result", (event) => {
|
|
59564
|
-
if (!event.isError &&
|
|
59565
|
-
pullRequestCheckService.check(
|
|
59562
|
+
if (!event.isError && shouldRefreshPullRequests(event.toolName, event.input)) {
|
|
59563
|
+
pullRequestCheckService.check().catch(() => {
|
|
59566
59564
|
});
|
|
59567
59565
|
}
|
|
59568
59566
|
});
|
|
@@ -63768,9 +63766,7 @@ function jsonError(message, details) {
|
|
|
63768
63766
|
function createV1Routes(deps) {
|
|
63769
63767
|
const app2 = new Hono();
|
|
63770
63768
|
app2.post("/pull-requests/check", async (c) => {
|
|
63771
|
-
|
|
63772
|
-
const prUrls = isRecord2(body) && Array.isArray(body.prUrls) ? body.prUrls.filter((url3) => typeof url3 === "string") : [];
|
|
63773
|
-
pullRequestCheckService.check(prUrls).catch(() => {
|
|
63769
|
+
pullRequestCheckService.check().catch(() => {
|
|
63774
63770
|
});
|
|
63775
63771
|
return c.json({ accepted: true }, 202);
|
|
63776
63772
|
});
|
|
@@ -3,11 +3,11 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
notifyPostToolUse
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QBZ6XTV7.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-GVHELVNV.js";
|
|
11
11
|
import "./chunk-VEQXQN22.js";
|
|
12
12
|
|
|
13
13
|
// src/post-tool-pr-hook.ts
|
|
@@ -19,8 +19,7 @@ async function main() {
|
|
|
19
19
|
const record = isRecord(input) ? input : {};
|
|
20
20
|
const toolName = [record.tool_name, record.tool, record.name].find((value) => typeof value === "string") ?? "";
|
|
21
21
|
const toolInput = record.tool_input ?? record.arguments ?? record.args ?? ("command" in record ? { command: record.command } : record);
|
|
22
|
-
|
|
23
|
-
await notifyPostToolUse(toolName, toolInput, toolResult);
|
|
22
|
+
await notifyPostToolUse(toolName, toolInput);
|
|
24
23
|
} catch (error) {
|
|
25
24
|
process.stderr.write(`${error instanceof Error ? error.message : String(error)}
|
|
26
25
|
`);
|
package/dist/src/relay-mcp.js
CHANGED