replicas-engine 0.1.1484 → 0.1.1485
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-2HK7QT32.js → asp-host-KWA3JTHY.js} +5 -5
- package/dist/src/{chunk-QZ43VWR7.js → chunk-AV6SAXMO.js} +6 -6
- package/dist/src/{chunk-YXCKKNQQ.js → chunk-GPKTNFK6.js} +2 -2
- package/dist/src/{chunk-EV5BB5TU.js → chunk-H4EAIFP5.js} +2 -2
- package/dist/src/{chunk-AVLTHEIN.js → chunk-IL5H3ARK.js} +2 -2
- package/dist/src/{chunk-MBKXXNBY.js → chunk-JXHWGTUR.js} +3 -3
- package/dist/src/{chunk-LF5H4WKL.js → chunk-K2FAYKHI.js} +4 -1
- package/dist/src/{chunk-5NWZPFQW.js → chunk-VEJ25S6F.js} +1 -1
- package/dist/src/{chunk-6ZBLFVDT.js → chunk-WQHZJA2S.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +54 -32
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
listCodexModelsForDetails,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-AV6SAXMO.js";
|
|
12
|
+
import "./chunk-GPKTNFK6.js";
|
|
13
|
+
import "./chunk-JXHWGTUR.js";
|
|
14
|
+
import "./chunk-WQHZJA2S.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-K2FAYKHI.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
resolveDiffBase,
|
|
12
12
|
runGitCommand,
|
|
13
13
|
setAgentCredentialSnapshot
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GPKTNFK6.js";
|
|
15
15
|
import {
|
|
16
16
|
AppServerProcess,
|
|
17
17
|
buildCodexAgentEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JXHWGTUR.js";
|
|
19
19
|
import {
|
|
20
20
|
SUBPROCESS_MAX_BUFFER,
|
|
21
21
|
execFileAsync
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WQHZJA2S.js";
|
|
23
23
|
import {
|
|
24
24
|
isRecord
|
|
25
25
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
resolveOpenAICompatibleModelsUrl,
|
|
58
58
|
splitMothershipInstructions,
|
|
59
59
|
withTimeout
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-K2FAYKHI.js";
|
|
61
61
|
|
|
62
62
|
// src/managers/codex-token-manager.ts
|
|
63
63
|
import { promises as fs } from "fs";
|
|
@@ -320,7 +320,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
320
320
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
321
321
|
await this.applyCredentialsResponse(data);
|
|
322
322
|
setAgentCredentialSnapshot("codex", data);
|
|
323
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
323
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-KWA3JTHY.js");
|
|
324
324
|
await restartCodexAspHostIfRunning2();
|
|
325
325
|
});
|
|
326
326
|
await this.start(true);
|
|
@@ -342,7 +342,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
342
342
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
343
343
|
await this.applyCredentialsResponse(data);
|
|
344
344
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
345
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
345
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-KWA3JTHY.js");
|
|
346
346
|
await restartCodexAspHostIfRunning2();
|
|
347
347
|
}
|
|
348
348
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
SUBPROCESS_MAX_BUFFER,
|
|
6
6
|
execFileAsync
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WQHZJA2S.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord as isRecord2
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
provisionedDeviceSchema,
|
|
22
22
|
readReplicasRuntimeEnv,
|
|
23
23
|
serializePosixEnvFile
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-K2FAYKHI.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
AspClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JXHWGTUR.js";
|
|
7
7
|
import {
|
|
8
8
|
ASTER_BASE_URL,
|
|
9
9
|
ASTER_PROVIDER,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isRecord,
|
|
16
16
|
readOllamaAuthEnv,
|
|
17
17
|
readOpenAICompatibleAuthEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-K2FAYKHI.js";
|
|
19
19
|
|
|
20
20
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
21
21
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getOriginDefaultBranch,
|
|
7
7
|
monolithRequest,
|
|
8
8
|
runGitCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GPKTNFK6.js";
|
|
10
10
|
import {
|
|
11
11
|
extractCommandProtectionCommandText,
|
|
12
12
|
findCommandProtectionGitLookups,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
findScoutRepoWriteSignals,
|
|
16
16
|
parseCommandProtectionRequest,
|
|
17
17
|
withE2BRetry
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-K2FAYKHI.js";
|
|
19
19
|
|
|
20
20
|
// src/services/command-protection-service.ts
|
|
21
21
|
import { readFile, stat } from "fs/promises";
|
|
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
execFileAsync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WQHZJA2S.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K2FAYKHI.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
|
|
|
240
240
|
if (method === "foundry") return "azure";
|
|
241
241
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
242
242
|
}
|
|
243
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1485";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -11459,6 +11459,7 @@ var ENGINE_PORT = 3737;
|
|
|
11459
11459
|
var DESKTOP_STREAM_PORT = 6080;
|
|
11460
11460
|
var DEVICES_DIR = ".ssh/replicas-devices";
|
|
11461
11461
|
var DEVICE_SCREEN_FILE_SUFFIX = ".screen.json";
|
|
11462
|
+
var LOCAL_CONTROL_FILE_PREFIX = "desktop-";
|
|
11462
11463
|
|
|
11463
11464
|
// ../shared/src/git.ts
|
|
11464
11465
|
var GIT_CREDENTIAL_HELPER_FILENAME = ".git-credential-replicas";
|
|
@@ -14889,6 +14890,7 @@ var DEFAULT_USER_PREFERENCES = {
|
|
|
14889
14890
|
open_prs_in_graphite: false,
|
|
14890
14891
|
open_links_in_desktop_app: false,
|
|
14891
14892
|
port_forwarding: false,
|
|
14893
|
+
local_control: false,
|
|
14892
14894
|
spotify_controls: false,
|
|
14893
14895
|
appshot_shortcut: "command",
|
|
14894
14896
|
appshot_destination: "automatic",
|
|
@@ -19537,7 +19539,7 @@ var VOICE_WAVEFORM = {
|
|
|
19537
19539
|
};
|
|
19538
19540
|
|
|
19539
19541
|
// ../shared/src/e2b.ts
|
|
19540
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-11-
|
|
19542
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-11-v5";
|
|
19541
19543
|
|
|
19542
19544
|
// ../shared/src/e2b-retry.ts
|
|
19543
19545
|
var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
|
|
@@ -21988,6 +21990,7 @@ export {
|
|
|
21988
21990
|
DESKTOP_STREAM_PORT,
|
|
21989
21991
|
DEVICES_DIR,
|
|
21990
21992
|
DEVICE_SCREEN_FILE_SUFFIX,
|
|
21993
|
+
LOCAL_CONTROL_FILE_PREFIX,
|
|
21991
21994
|
GIT_CREDENTIAL_HELPER_FILENAME,
|
|
21992
21995
|
GITHUB_CREDENTIAL_REFRESH_PATH,
|
|
21993
21996
|
GITLAB_CREDENTIAL_REFRESH_PATH,
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K2FAYKHI.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-IL5H3ARK.js";
|
|
7
|
+
import "./chunk-GPKTNFK6.js";
|
|
8
|
+
import "./chunk-WQHZJA2S.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-K2FAYKHI.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-H4EAIFP5.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-JXHWGTUR.js";
|
|
22
|
+
import "./chunk-WQHZJA2S.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENT,
|
|
25
25
|
OPENCODE_GO_PROVIDER,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
headlessAgentUsagePath,
|
|
30
30
|
isRecord,
|
|
31
31
|
withTimeout
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-K2FAYKHI.js";
|
|
33
33
|
import "./chunk-VEQXQN22.js";
|
|
34
34
|
|
|
35
35
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
evaluateCommandProtection,
|
|
28
28
|
extractToolCommand,
|
|
29
29
|
reportCommandProtectionBlock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-IL5H3ARK.js";
|
|
31
31
|
import {
|
|
32
32
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
33
33
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -65,10 +65,10 @@ import {
|
|
|
65
65
|
spawnMuseMsp,
|
|
66
66
|
startMuseSession,
|
|
67
67
|
uuidV7
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-H4EAIFP5.js";
|
|
69
69
|
import {
|
|
70
70
|
publishedPullRequestUrls
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-VEJ25S6F.js";
|
|
72
72
|
import {
|
|
73
73
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
74
74
|
AsyncLock,
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
timestampFromSeconds,
|
|
144
144
|
upsertCredentialFileLines,
|
|
145
145
|
writeSecureCredentialFile
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-AV6SAXMO.js";
|
|
147
147
|
import {
|
|
148
148
|
ENGINE_ENV,
|
|
149
149
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -154,15 +154,15 @@ import {
|
|
|
154
154
|
resolveDiffBase,
|
|
155
155
|
setAgentCredentialSnapshot,
|
|
156
156
|
setLinearSessionId
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-GPKTNFK6.js";
|
|
158
158
|
import {
|
|
159
159
|
getCodexModelProvider
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-JXHWGTUR.js";
|
|
161
161
|
import {
|
|
162
162
|
SUBPROCESS_MAX_BUFFER,
|
|
163
163
|
execAsync,
|
|
164
164
|
execFileAsync
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-WQHZJA2S.js";
|
|
166
166
|
import {
|
|
167
167
|
isRecord as isRecord2
|
|
168
168
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -237,6 +237,7 @@ import {
|
|
|
237
237
|
InFlightMap,
|
|
238
238
|
LEARNED_SKILLS_MANIFEST_PATH,
|
|
239
239
|
LEARNED_SKILL_DIR_PREFIX,
|
|
240
|
+
LOCAL_CONTROL_FILE_PREFIX,
|
|
240
241
|
MAX_CANVAS_FILE_BYTES,
|
|
241
242
|
MAX_CANVAS_PREVIEW_BYTES,
|
|
242
243
|
MAX_CODEX_GOAL_OBJECTIVE_CHARS,
|
|
@@ -442,7 +443,7 @@ import {
|
|
|
442
443
|
workspaceTokenRequestSchema,
|
|
443
444
|
workspaceTokenResponseSchema,
|
|
444
445
|
wrapInTag
|
|
445
|
-
} from "./chunk-
|
|
446
|
+
} from "./chunk-K2FAYKHI.js";
|
|
446
447
|
import {
|
|
447
448
|
cloneMcpConfig,
|
|
448
449
|
ensureCompatibilityImports,
|
|
@@ -11021,7 +11022,8 @@ async function startDeviceRelays(names, paths, signal) {
|
|
|
11021
11022
|
}
|
|
11022
11023
|
|
|
11023
11024
|
// src/services/device-service.ts
|
|
11024
|
-
import {
|
|
11025
|
+
import { readdirSync } from "fs";
|
|
11026
|
+
import { mkdir as mkdir7, readdir as readdir2, rm as rm3, writeFile as writeFile4 } from "fs/promises";
|
|
11025
11027
|
import { join as join8 } from "path";
|
|
11026
11028
|
var DEVICES_DIR2 = join8(ENGINE_ENV.HOME_DIR, DEVICES_DIR);
|
|
11027
11029
|
var TAILSCALED_UNIT = "replicas-tailscaled";
|
|
@@ -11076,7 +11078,8 @@ async function joinTailnet(authKey, workspaceId, signal) {
|
|
|
11076
11078
|
}
|
|
11077
11079
|
async function connectDevices(signal) {
|
|
11078
11080
|
const { REPLICAS_ENV_DEVICES: devices, TS_AUTHKEY: authKey, REPLICAS_WORKSPACE_ID: workspaceId } = ENGINE_ENV;
|
|
11079
|
-
await
|
|
11081
|
+
const stale = (await readdir2(DEVICES_DIR2).catch(() => [])).filter((entry) => !entry.startsWith(LOCAL_CONTROL_FILE_PREFIX));
|
|
11082
|
+
await Promise.all(stale.map((entry) => rm3(join8(DEVICES_DIR2, entry), { recursive: true, force: true })));
|
|
11080
11083
|
const tailnetKey = devices.some((device) => device.host !== null) ? authKey : void 0;
|
|
11081
11084
|
if (!tailnetKey) await execFileAsync("sudo", ["systemctl", "stop", TAILSCALED_UNIT], { signal }).catch(() => void 0);
|
|
11082
11085
|
if (devices.length === 0) return;
|
|
@@ -11107,6 +11110,21 @@ function devicesInstruction() {
|
|
|
11107
11110
|
...screens.length > 0 ? [`To see and control the screen of ${screens.join(", ")}, run \`replicas computer screen <name>\`: it shows on this desktop, where the other \`replicas computer\` commands drive it. Prefer \`ssh\` when a command does the job.`] : []
|
|
11108
11111
|
].join(" ");
|
|
11109
11112
|
}
|
|
11113
|
+
function localControlInstruction() {
|
|
11114
|
+
let entries;
|
|
11115
|
+
try {
|
|
11116
|
+
entries = readdirSync(DEVICES_DIR2);
|
|
11117
|
+
} catch {
|
|
11118
|
+
return void 0;
|
|
11119
|
+
}
|
|
11120
|
+
const computers = entries.flatMap((entry) => entry.startsWith(LOCAL_CONTROL_FILE_PREFIX) && entry.endsWith(".conf") ? [`\`${entry.slice(LOCAL_CONTROL_FILE_PREFIX.length, -".conf".length)}\``] : []);
|
|
11121
|
+
if (computers.length === 0) return void 0;
|
|
11122
|
+
return [
|
|
11123
|
+
`The user turned on local control, so you can run commands on their own computer through the Replicas desktop app running there: ${computers.join(", ")}. Use \`ssh <name> '<command>'\`, \`scp\` and \`rsync\` as usual. Commands run as the user in their home directory with their login shell and no terminal, output streams back as it is produced, and a command stops if the connection drops.`,
|
|
11124
|
+
"It is a personal machine with the user's files and accounts: change only what the task needs, and ask before anything destructive or hard to undo.",
|
|
11125
|
+
'It works only while the desktop app is running there with local control on. If `ssh` closes straight away, such as "Connection closed by UNKNOWN port 65535", the app isn\'t running or local control is off: tell the user and ask them to open it. If a command gets "Operation not permitted" on the user\'s files, macOS is blocking the app: ask the user to allow Replicas under System Settings \u2192 Privacy & Security \u2192 Full Disk Access.'
|
|
11126
|
+
].join(" ");
|
|
11127
|
+
}
|
|
11110
11128
|
|
|
11111
11129
|
// src/services/chat/chat-service.ts
|
|
11112
11130
|
import { statSync as statSync4 } from "fs";
|
|
@@ -11351,7 +11369,7 @@ import {
|
|
|
11351
11369
|
} from "@anthropic-ai/claude-agent-sdk";
|
|
11352
11370
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
11353
11371
|
import { dirname as dirname3, join as join11 } from "path";
|
|
11354
|
-
import { mkdir as mkdir8, readdir as
|
|
11372
|
+
import { mkdir as mkdir8, readdir as readdir4, readFile as readFile7 } from "fs/promises";
|
|
11355
11373
|
import { homedir as homedir7 } from "os";
|
|
11356
11374
|
|
|
11357
11375
|
// src/utils/linear-converter.ts
|
|
@@ -12656,6 +12674,7 @@ ${note}` };
|
|
|
12656
12674
|
const repositorySystemPromptInstruction = this.getRepositorySystemPromptInstruction();
|
|
12657
12675
|
const environmentInstruction = this.getEnvironmentSystemPromptInstruction();
|
|
12658
12676
|
const deviceInstruction = devicesInstruction();
|
|
12677
|
+
const localControlGuidance = localControlInstruction();
|
|
12659
12678
|
const enginePortProtectionInstruction = this.getEnginePortProtectionInstruction();
|
|
12660
12679
|
const memoryInstruction = includeMemory ? this.buildMemoryInstruction() : void 0;
|
|
12661
12680
|
const parts = [];
|
|
@@ -12673,6 +12692,9 @@ ${note}` };
|
|
|
12673
12692
|
if (deviceInstruction) {
|
|
12674
12693
|
parts.push(deviceInstruction);
|
|
12675
12694
|
}
|
|
12695
|
+
if (localControlGuidance) {
|
|
12696
|
+
parts.push(localControlGuidance);
|
|
12697
|
+
}
|
|
12676
12698
|
if (repositorySystemPromptInstruction) {
|
|
12677
12699
|
parts.push(repositorySystemPromptInstruction);
|
|
12678
12700
|
}
|
|
@@ -12929,7 +12951,7 @@ var PullRequestCheckService = class {
|
|
|
12929
12951
|
var pullRequestCheckService = new PullRequestCheckService();
|
|
12930
12952
|
|
|
12931
12953
|
// src/services/skill-registry-service.ts
|
|
12932
|
-
import { readFile as readFile6, readdir as
|
|
12954
|
+
import { readFile as readFile6, readdir as readdir3, stat } from "fs/promises";
|
|
12933
12955
|
import { dirname as dirname2, isAbsolute, join as join10, relative, resolve } from "path";
|
|
12934
12956
|
var REGISTRY_ROOT_DIR = ".replicas/skill-registries";
|
|
12935
12957
|
var REGISTRY_MANIFEST = "manifest.json";
|
|
@@ -13123,7 +13145,7 @@ function uniqueStandaloneSkills(skills) {
|
|
|
13123
13145
|
}
|
|
13124
13146
|
async function safeReadDir(path7) {
|
|
13125
13147
|
try {
|
|
13126
|
-
return await
|
|
13148
|
+
return await readdir3(path7, { withFileTypes: true });
|
|
13127
13149
|
} catch (error) {
|
|
13128
13150
|
if (isNotFoundError(error)) return [];
|
|
13129
13151
|
throw error;
|
|
@@ -14055,7 +14077,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14055
14077
|
async forwardWorkflowAgentTranscripts(taskId) {
|
|
14056
14078
|
const workflow = this.workflowTranscripts.get(taskId);
|
|
14057
14079
|
if (!workflow || this.ambientTaskIds.has(taskId)) return;
|
|
14058
|
-
for (const file of await
|
|
14080
|
+
for (const file of await readdir4(workflow.dir).catch(() => [])) {
|
|
14059
14081
|
const agentId = /^agent-(.+)\.jsonl$/.exec(file)?.[1];
|
|
14060
14082
|
if (!agentId) continue;
|
|
14061
14083
|
const offset = workflow.offsets.get(file) ?? 0;
|
|
@@ -16604,7 +16626,7 @@ ${text.slice(-24e3)}`
|
|
|
16604
16626
|
};
|
|
16605
16627
|
|
|
16606
16628
|
// src/managers/cursor-manager.ts
|
|
16607
|
-
import { mkdir as mkdir11, readFile as readFile9, readdir as
|
|
16629
|
+
import { mkdir as mkdir11, readFile as readFile9, readdir as readdir5 } from "fs/promises";
|
|
16608
16630
|
import { basename as basename2, dirname as dirname5, extname, join as join14 } from "path";
|
|
16609
16631
|
import { Agent as CursorAgent2, AuthenticationError, CursorSdkError } from "@cursor/sdk";
|
|
16610
16632
|
|
|
@@ -16737,7 +16759,7 @@ function extractCursorCommandDescription(content) {
|
|
|
16737
16759
|
async function listCursorCommandsInDirectory(directory) {
|
|
16738
16760
|
let entries;
|
|
16739
16761
|
try {
|
|
16740
|
-
entries = await
|
|
16762
|
+
entries = await readdir5(directory, { withFileTypes: true });
|
|
16741
16763
|
} catch (error) {
|
|
16742
16764
|
if (isRecord2(error) && error.code === "ENOENT") return [];
|
|
16743
16765
|
console.warn("[CursorManager] Failed to read slash command directory:", error);
|
|
@@ -41134,7 +41156,7 @@ async function probeMcpEndpoint(url3) {
|
|
|
41134
41156
|
}
|
|
41135
41157
|
|
|
41136
41158
|
// ../node_modules/.bun/pi-mcp-adapter@2.32.1+f2da34192be1730e/node_modules/pi-mcp-adapter/npx-resolver.ts
|
|
41137
|
-
import { existsSync as existsSync9, readFileSync as readFileSync2, realpathSync, readdirSync, statSync as statSync2, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync2, openSync, readSync, closeSync, unlinkSync } from "fs";
|
|
41159
|
+
import { existsSync as existsSync9, readFileSync as readFileSync2, realpathSync, readdirSync as readdirSync2, statSync as statSync2, writeFileSync as writeFileSync3, renameSync, mkdirSync as mkdirSync2, openSync, readSync, closeSync, unlinkSync } from "fs";
|
|
41138
41160
|
import { join as join16, dirname as dirname8, extname as extname2, resolve as resolve2, sep } from "path";
|
|
41139
41161
|
|
|
41140
41162
|
// ../node_modules/.bun/pi-mcp-adapter@2.32.1+f2da34192be1730e/node_modules/pi-mcp-adapter/abort.ts
|
|
@@ -41431,7 +41453,7 @@ function findCachedPackageDir(cacheDir, packageName, exactVersion) {
|
|
|
41431
41453
|
const npxDir = join16(cacheDir, "_npx");
|
|
41432
41454
|
if (!existsSync9(npxDir)) return null;
|
|
41433
41455
|
const packagePathParts = packageName.startsWith("@") ? packageName.split("/") : [packageName];
|
|
41434
|
-
const candidates =
|
|
41456
|
+
const candidates = readdirSync2(npxDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => {
|
|
41435
41457
|
const full = join16(npxDir, entry.name);
|
|
41436
41458
|
const mtime = safeStatMtime(full);
|
|
41437
41459
|
return { name: entry.name, mtime };
|
|
@@ -59533,11 +59555,11 @@ import {
|
|
|
59533
59555
|
appendFile as appendFile4,
|
|
59534
59556
|
mkdir as mkdir17,
|
|
59535
59557
|
readFile as readFile13,
|
|
59536
|
-
readdir as
|
|
59558
|
+
readdir as readdir6,
|
|
59537
59559
|
rename as rename2,
|
|
59538
59560
|
unlink
|
|
59539
59561
|
} from "fs/promises";
|
|
59540
|
-
import { existsSync as existsSync14, readFileSync as readFileSync5, readdirSync as
|
|
59562
|
+
import { existsSync as existsSync14, readFileSync as readFileSync5, readdirSync as readdirSync3 } from "fs";
|
|
59541
59563
|
import { join as join24 } from "path";
|
|
59542
59564
|
var MAX_FAILED_RECORDS = 500;
|
|
59543
59565
|
var FLUSH_DEBOUNCE_MS = 15e3;
|
|
@@ -59586,7 +59608,7 @@ var AnalyticsRecordBuffer = class {
|
|
|
59586
59608
|
}
|
|
59587
59609
|
readStoredRecords() {
|
|
59588
59610
|
if (!existsSync14(ENGINE_DIR)) return [];
|
|
59589
|
-
return
|
|
59611
|
+
return readdirSync3(ENGINE_DIR, { withFileTypes: true }).filter((entry) => entry.isFile() && this.storageNames.some(
|
|
59590
59612
|
(storageName) => entry.name === `${storageName}.jsonl` || entry.name.startsWith(`${storageName}.`) && (entry.name.endsWith(".jsonl") || entry.name.endsWith(`.jsonl${UPLOADED_SUFFIX}`))
|
|
59591
59613
|
)).map(({ name }) => name).sort().flatMap((name) => this.parseRecords(readFileSync5(join24(ENGINE_DIR, name), "utf-8"))).map((record3) => {
|
|
59592
59614
|
const recordId = this.options.getRecordId?.(record3);
|
|
@@ -59628,7 +59650,7 @@ var AnalyticsRecordBuffer = class {
|
|
|
59628
59650
|
).catch(() => {
|
|
59629
59651
|
});
|
|
59630
59652
|
}
|
|
59631
|
-
const entries = await
|
|
59653
|
+
const entries = await readdir6(ENGINE_DIR).catch(() => []);
|
|
59632
59654
|
let flushed = 0;
|
|
59633
59655
|
let failed = 0;
|
|
59634
59656
|
for (const entry of entries) {
|
|
@@ -60475,7 +60497,7 @@ var KeepAliveService = class _KeepAliveService {
|
|
|
60475
60497
|
var keepAliveService = new KeepAliveService();
|
|
60476
60498
|
|
|
60477
60499
|
// src/services/canvas-service.ts
|
|
60478
|
-
import { readdir as
|
|
60500
|
+
import { readdir as readdir7, readFile as readFile15, stat as stat3 } from "fs/promises";
|
|
60479
60501
|
import { homedir as homedir8 } from "os";
|
|
60480
60502
|
import { join as join25 } from "path";
|
|
60481
60503
|
|
|
@@ -60545,7 +60567,7 @@ var CanvasService = class {
|
|
|
60545
60567
|
if (!current) continue;
|
|
60546
60568
|
let entries;
|
|
60547
60569
|
try {
|
|
60548
|
-
entries = await
|
|
60570
|
+
entries = await readdir7(current.directory, { withFileTypes: true });
|
|
60549
60571
|
} catch {
|
|
60550
60572
|
continue;
|
|
60551
60573
|
}
|
|
@@ -60752,7 +60774,7 @@ async function reconcileCanvasItems(filenames) {
|
|
|
60752
60774
|
// src/services/upload-chat-transcripts.ts
|
|
60753
60775
|
import { createReadStream as createReadStream3 } from "fs";
|
|
60754
60776
|
import { createHash as createHash8 } from "crypto";
|
|
60755
|
-
import { readFile as readFile16, readdir as
|
|
60777
|
+
import { readFile as readFile16, readdir as readdir8, stat as stat4 } from "fs/promises";
|
|
60756
60778
|
import { basename as basename3, join as join27 } from "path";
|
|
60757
60779
|
|
|
60758
60780
|
// src/services/chat/chat-senders.ts
|
|
@@ -60836,7 +60858,7 @@ async function flushAllChatTranscripts(chatsById = /* @__PURE__ */ new Map(), ca
|
|
|
60836
60858
|
for (const dir of HISTORY_DIRS) {
|
|
60837
60859
|
let entries;
|
|
60838
60860
|
try {
|
|
60839
|
-
entries = await
|
|
60861
|
+
entries = await readdir8(dir);
|
|
60840
60862
|
} catch {
|
|
60841
60863
|
continue;
|
|
60842
60864
|
}
|
|
@@ -60983,7 +61005,7 @@ async function flushRepoState() {
|
|
|
60983
61005
|
|
|
60984
61006
|
// src/services/upload-engine-logs.ts
|
|
60985
61007
|
import { createReadStream as createReadStream4 } from "fs";
|
|
60986
|
-
import { readdir as
|
|
61008
|
+
import { readdir as readdir9, stat as stat5 } from "fs/promises";
|
|
60987
61009
|
import { join as join28 } from "path";
|
|
60988
61010
|
var MAX_ENGINE_LOG_FLUSH_SESSIONS = 10;
|
|
60989
61011
|
var MAX_ENGINE_LOG_FLUSH_BYTES = 5 * 1024 * 1024;
|
|
@@ -60994,7 +61016,7 @@ async function flushAllEngineLogs() {
|
|
|
60994
61016
|
let failed = 0;
|
|
60995
61017
|
const deadline = Date.now() + ENGINE_LOG_FLUSH_TIMEOUT_MS;
|
|
60996
61018
|
await runBeforeDeadline((signal) => engineLogger.flush(signal), deadline);
|
|
60997
|
-
const files = await runBeforeDeadline(() =>
|
|
61019
|
+
const files = await runBeforeDeadline(() => readdir9(LOG_DIR), deadline).catch(() => []);
|
|
60998
61020
|
const currentFilename = engineLogger.sessionId ? `${engineLogger.sessionId}.log` : null;
|
|
60999
61021
|
const filenames = files.filter((filename) => {
|
|
61000
61022
|
if (!filename.endsWith(".log")) return false;
|
|
@@ -63870,7 +63892,7 @@ var RepoFileService = class {
|
|
|
63870
63892
|
// src/v1-routes.ts
|
|
63871
63893
|
import { Hono } from "hono";
|
|
63872
63894
|
import { z as z6 } from "zod";
|
|
63873
|
-
import { readdir as
|
|
63895
|
+
import { readdir as readdir11, stat as stat7, readFile as readFile22 } from "fs/promises";
|
|
63874
63896
|
import { openAsBlob } from "fs";
|
|
63875
63897
|
import { join as join35, resolve as resolve5 } from "path";
|
|
63876
63898
|
|
|
@@ -63881,7 +63903,7 @@ import { existsSync as existsSync16 } from "fs";
|
|
|
63881
63903
|
import { join as join34 } from "path";
|
|
63882
63904
|
|
|
63883
63905
|
// src/services/warm-hook-logs-service.ts
|
|
63884
|
-
import { mkdir as mkdir20, readFile as readFile20, writeFile as writeFile9, readdir as
|
|
63906
|
+
import { mkdir as mkdir20, readFile as readFile20, writeFile as writeFile9, readdir as readdir10, appendFile as appendFile6, unlink as unlink2 } from "fs/promises";
|
|
63885
63907
|
import { homedir as homedir11 } from "os";
|
|
63886
63908
|
import { join as join33 } from "path";
|
|
63887
63909
|
var LOGS_DIR2 = join33(homedir11(), ".replicas", "warm-hook-logs");
|
|
@@ -63917,7 +63939,7 @@ var WarmHookLogsService = class {
|
|
|
63917
63939
|
async getAllLogs() {
|
|
63918
63940
|
let files;
|
|
63919
63941
|
try {
|
|
63920
|
-
files = await
|
|
63942
|
+
files = await readdir10(LOGS_DIR2);
|
|
63921
63943
|
} catch (err) {
|
|
63922
63944
|
if (err.code === "ENOENT") {
|
|
63923
63945
|
return [];
|
|
@@ -65356,7 +65378,7 @@ data: ${JSON.stringify("Terminal session not found")}
|
|
|
65356
65378
|
});
|
|
65357
65379
|
app2.get("/logs", async (c) => {
|
|
65358
65380
|
try {
|
|
65359
|
-
const files = await
|
|
65381
|
+
const files = await readdir11(LOG_DIR).catch(() => []);
|
|
65360
65382
|
const logFiles = files.filter((f) => f.endsWith(".log"));
|
|
65361
65383
|
const sessions = await Promise.all(
|
|
65362
65384
|
logFiles.map(async (filename) => {
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
publishedPullRequestUrls
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VEJ25S6F.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
shouldRefreshPullRequests
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-K2FAYKHI.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/services/post-tool-pr-notifier.ts
|
package/dist/src/subagent-mcp.js
CHANGED