replicas-engine 0.1.908 → 0.1.910
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-NQESGIUW.js → asp-host-7J3NRDPV.js} +4 -4
- package/dist/src/{chunk-J4YMMWVX.js → chunk-5CL42RWH.js} +7 -13
- package/dist/src/{chunk-XALZL5AE.js → chunk-EE6PRRN4.js} +2 -2
- package/dist/src/{chunk-FC2Z2DIV.js → chunk-K7TEHLJA.js} +2 -2
- package/dist/src/{chunk-7R7AQ77Z.js → chunk-PRJY4Y7V.js} +4 -4
- package/dist/src/{chunk-T4HLIO43.js → chunk-PZHMAH33.js} +53 -238
- package/dist/src/{chunk-2USMONJR.js → chunk-ZQQZKUCT.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +1662 -2329
- package/dist/src/post-tool-pr-hook.js +22 -4
- package/dist/src/relay-mcp.js +1 -1
- package/package.json +1 -3
- package/dist/src/chunk-U2NGMU7L.js +0 -30
- package/dist/src/deepseek-command-protection-plugin.js +0 -37
- package/dist/src/{mcp-panel-IBIVWX27.js → mcp-panel-2XMW56WJ.js} +3 -3
|
@@ -2,15 +2,33 @@
|
|
|
2
2
|
import { createRequire as __createRequire } from 'node:module';
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-2USMONJR.js";
|
|
5
|
+
publishedPullRequestUrls
|
|
6
|
+
} from "./chunk-ZQQZKUCT.js";
|
|
8
7
|
import {
|
|
9
8
|
isRecord
|
|
10
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import
|
|
10
|
+
import {
|
|
11
|
+
shouldRefreshPullRequests
|
|
12
|
+
} from "./chunk-PZHMAH33.js";
|
|
12
13
|
import "./chunk-VEQXQN22.js";
|
|
13
14
|
|
|
15
|
+
// src/services/post-tool-pr-notifier.ts
|
|
16
|
+
async function notifyPostToolUse(toolName, toolInput, result) {
|
|
17
|
+
const publication = result ? { toolName, toolInput, ...result } : void 0;
|
|
18
|
+
if (!shouldRefreshPullRequests(toolName, toolInput) && (!publication || publishedPullRequestUrls(publication).length === 0)) return false;
|
|
19
|
+
const port = process.env.REPLICAS_ENGINE_PORT;
|
|
20
|
+
const secret = process.env.REPLICAS_ENGINE_SECRET;
|
|
21
|
+
if (!port || !secret) throw new Error("Replicas engine connection is unavailable.");
|
|
22
|
+
const response = await fetch(`http://127.0.0.1:${port}/pull-requests/check`, {
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers: { "X-Replicas-Engine-Secret": secret, ...publication ? { "Content-Type": "application/json" } : {} },
|
|
25
|
+
...publication ? { body: JSON.stringify(publication) } : {},
|
|
26
|
+
signal: AbortSignal.timeout(3e4)
|
|
27
|
+
});
|
|
28
|
+
if (!response.ok) throw new Error(`Replicas pull request check failed (${response.status}).`);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
14
32
|
// src/post-tool-pr-hook.ts
|
|
15
33
|
async function main() {
|
|
16
34
|
let stdin = "";
|
package/dist/src/relay-mcp.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "replicas-engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.910",
|
|
4
4
|
"description": "Lightweight API server for Replicas workspaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -44,8 +44,6 @@
|
|
|
44
44
|
"@anthropic-ai/sdk": "0.128.0",
|
|
45
45
|
"@connectrpc/connect-node": "1.7.0",
|
|
46
46
|
"@cursor/sdk": "1.0.19",
|
|
47
|
-
"@deepseek-ai/dsh": "0.1.0-rc.7",
|
|
48
|
-
"@deepseek-ai/dsh-host-apiproxy": "0.1.0-rc.7",
|
|
49
47
|
"@earendil-works/pi-ai": "0.85.0",
|
|
50
48
|
"@earendil-works/pi-coding-agent": "0.85.0",
|
|
51
49
|
"@earendil-works/pi-server": "0.85.0",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
3
|
-
const require = __createRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
publishedPullRequestUrls
|
|
6
|
-
} from "./chunk-2USMONJR.js";
|
|
7
|
-
import {
|
|
8
|
-
shouldRefreshPullRequests
|
|
9
|
-
} from "./chunk-T4HLIO43.js";
|
|
10
|
-
|
|
11
|
-
// src/services/post-tool-pr-notifier.ts
|
|
12
|
-
async function notifyPostToolUse(toolName, toolInput, result) {
|
|
13
|
-
const publication = result ? { toolName, toolInput, ...result } : void 0;
|
|
14
|
-
if (!shouldRefreshPullRequests(toolName, toolInput) && (!publication || publishedPullRequestUrls(publication).length === 0)) return false;
|
|
15
|
-
const port = process.env.REPLICAS_ENGINE_PORT;
|
|
16
|
-
const secret = process.env.REPLICAS_ENGINE_SECRET;
|
|
17
|
-
if (!port || !secret) throw new Error("Replicas engine connection is unavailable.");
|
|
18
|
-
const response = await fetch(`http://127.0.0.1:${port}/pull-requests/check`, {
|
|
19
|
-
method: "POST",
|
|
20
|
-
headers: { "X-Replicas-Engine-Secret": secret, ...publication ? { "Content-Type": "application/json" } : {} },
|
|
21
|
-
...publication ? { body: JSON.stringify(publication) } : {},
|
|
22
|
-
signal: AbortSignal.timeout(3e4)
|
|
23
|
-
});
|
|
24
|
-
if (!response.ok) throw new Error(`Replicas pull request check failed (${response.status}).`);
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
notifyPostToolUse
|
|
30
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
3
|
-
const require = __createRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-FC2Z2DIV.js";
|
|
7
|
-
import {
|
|
8
|
-
notifyPostToolUse
|
|
9
|
-
} from "./chunk-U2NGMU7L.js";
|
|
10
|
-
import "./chunk-2USMONJR.js";
|
|
11
|
-
import "./chunk-7R7AQ77Z.js";
|
|
12
|
-
import "./chunk-UZSNFLDQ.js";
|
|
13
|
-
import "./chunk-T4HLIO43.js";
|
|
14
|
-
import "./chunk-VEQXQN22.js";
|
|
15
|
-
|
|
16
|
-
// src/deepseek-command-protection-plugin.ts
|
|
17
|
-
function replicasCommandProtection(context) {
|
|
18
|
-
context.on("tools/pre-execute", async (execution, next) => {
|
|
19
|
-
const result = await evaluateCommandProtection({
|
|
20
|
-
provider: "deepseek",
|
|
21
|
-
source: "deepseek_pre_tool_use",
|
|
22
|
-
toolName: execution.name,
|
|
23
|
-
toolInput: execution.arguments,
|
|
24
|
-
cwd: process.cwd(),
|
|
25
|
-
toolUseId: execution.callId
|
|
26
|
-
});
|
|
27
|
-
return result.allowed ? next() : { kind: "deny", reason: result.reason ?? "Blocked by Replicas command protection." };
|
|
28
|
-
});
|
|
29
|
-
context.on("tools/post-execute", async (execution, _result, next) => {
|
|
30
|
-
await notifyPostToolUse(execution.name, execution.arguments).catch(() => {
|
|
31
|
-
});
|
|
32
|
-
return next();
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
replicasCommandProtection as default
|
|
37
|
-
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from 'node:module';
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
createPanelKeys
|
|
6
|
-
} from "./chunk-HHIELO4H.js";
|
|
7
4
|
import {
|
|
8
5
|
isServerCacheValid,
|
|
9
6
|
isUiToolVisibleToModel,
|
|
10
7
|
resourceNameToToolName
|
|
11
8
|
} from "./chunk-UP57BRAF.js";
|
|
9
|
+
import {
|
|
10
|
+
createPanelKeys
|
|
11
|
+
} from "./chunk-HHIELO4H.js";
|
|
12
12
|
import {
|
|
13
13
|
getToolNameCandidates,
|
|
14
14
|
isServerDisabled,
|