replicas-engine 0.1.1711 → 0.1.1712
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-T2CXYVZF.js → asp-host-6GAO2RSN.js} +6 -6
- package/dist/src/{chunk-3IYO6WEC.js → chunk-65ZPGPRS.js} +3 -3
- package/dist/src/{chunk-3RRWFM72.js → chunk-F7V3PQLH.js} +2 -2
- package/dist/src/{chunk-DYUIDLQS.js → chunk-NYD3PMJT.js} +1 -1
- package/dist/src/{chunk-PEOWIIUQ.js → chunk-OZZ4KYIJ.js} +7 -7
- package/dist/src/{chunk-W5VOK3QE.js → chunk-RPU6OJA6.js} +1 -1
- package/dist/src/{chunk-P5MWT2MK.js → chunk-RQWM6JC4.js} +1 -1
- package/dist/src/{chunk-LPHQEIB3.js → chunk-SKA5LFKD.js} +2 -2
- package/dist/src/{chunk-6WODSJ26.js → chunk-T4B2VCBO.js} +1 -1
- package/dist/src/{chunk-I2NAL7UU.js → chunk-UJDIMALI.js} +2 -2
- package/dist/src/{chunk-SP24IP7X.js → chunk-VRDOHLAY.js} +97 -22
- package/dist/src/codemode-mcp.js +3 -3
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +10 -10
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
listCodexModelsForDetails,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-OZZ4KYIJ.js";
|
|
12
|
+
import "./chunk-RPU6OJA6.js";
|
|
13
|
+
import "./chunk-UJDIMALI.js";
|
|
14
|
+
import "./chunk-65ZPGPRS.js";
|
|
15
|
+
import "./chunk-RQWM6JC4.js";
|
|
16
16
|
import "./chunk-UZSNFLDQ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-VRDOHLAY.js";
|
|
18
18
|
import "./chunk-VEQXQN22.js";
|
|
19
19
|
export {
|
|
20
20
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -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-RQWM6JC4.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VRDOHLAY.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -244,7 +244,7 @@ function getCodexModelProvider(method) {
|
|
|
244
244
|
if (method === "foundry") return "azure";
|
|
245
245
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
246
246
|
}
|
|
247
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
247
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1712";
|
|
248
248
|
var INITIALIZE_METHOD = "initialize";
|
|
249
249
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
250
250
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UJDIMALI.js";
|
|
9
9
|
import {
|
|
10
10
|
COMMAND_PROTECTION_MAX_MESSAGE_FILE_BYTES,
|
|
11
11
|
COMMAND_PROTECTION_REPO_GIT_ARGS,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseCommandProtectionRequest,
|
|
19
19
|
toCommandProtectionRepoState,
|
|
20
20
|
withRetry
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VRDOHLAY.js";
|
|
22
22
|
|
|
23
23
|
// src/services/command-protection-service.ts
|
|
24
24
|
import { readFile, stat } from "fs/promises";
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
subagentCodexMcpConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RPU6OJA6.js";
|
|
7
7
|
import {
|
|
8
8
|
ENGINE_ENV,
|
|
9
9
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
resolveDiffBase,
|
|
16
16
|
runGitCommand,
|
|
17
17
|
setAgentCredentialSnapshot
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UJDIMALI.js";
|
|
19
19
|
import {
|
|
20
20
|
AppServerProcess,
|
|
21
21
|
buildCodexAgentEnv
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-65ZPGPRS.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBPROCESS_MAX_BUFFER,
|
|
25
25
|
execFileAsync
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RQWM6JC4.js";
|
|
27
27
|
import {
|
|
28
28
|
isRecord
|
|
29
29
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
shrunkImageSize,
|
|
64
64
|
splitManagerInstructions,
|
|
65
65
|
withTimeout
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-VRDOHLAY.js";
|
|
67
67
|
|
|
68
68
|
// src/managers/codex-token-manager.ts
|
|
69
69
|
import { promises as fs } from "fs";
|
|
@@ -463,7 +463,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
463
463
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
464
464
|
await this.applyCredentialsResponse(data);
|
|
465
465
|
setAgentCredentialSnapshot("codex", data);
|
|
466
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
466
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-6GAO2RSN.js");
|
|
467
467
|
await restartCodexAspHostIfRunning2();
|
|
468
468
|
});
|
|
469
469
|
await this.start(true);
|
|
@@ -485,7 +485,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
485
485
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
486
486
|
await this.applyCredentialsResponse(data);
|
|
487
487
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
488
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
488
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-6GAO2RSN.js");
|
|
489
489
|
await restartCodexAspHostIfRunning2();
|
|
490
490
|
}
|
|
491
491
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
SUBAGENT_MCP_TOOL_NAMES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VRDOHLAY.js";
|
|
7
7
|
|
|
8
8
|
// src/managers/subagent-mcp-config.ts
|
|
9
9
|
import { existsSync } 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
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VRDOHLAY.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-7ZDAVYTV.js";
|
|
7
7
|
import {
|
|
8
8
|
AspClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-65ZPGPRS.js";
|
|
10
10
|
import {
|
|
11
11
|
ASTER_BASE_URL,
|
|
12
12
|
ASTER_PROVIDER,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isRecord,
|
|
19
19
|
readOllamaAuthEnv,
|
|
20
20
|
readOpenAICompatibleAuthEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VRDOHLAY.js";
|
|
22
22
|
|
|
23
23
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
24
24
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -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-RQWM6JC4.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
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-VRDOHLAY.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -16885,6 +16885,8 @@ function describeHarnessSwitch(message2) {
|
|
|
16885
16885
|
// ../shared/src/shell-commands.ts
|
|
16886
16886
|
var SHELL_OPAQUE = "\0";
|
|
16887
16887
|
var MAX_DEPTH = 8;
|
|
16888
|
+
var MAX_LOOP_VALUES = 20;
|
|
16889
|
+
var MAX_LOOP_ITERATIONS = 500;
|
|
16888
16890
|
var OPERATOR = /&&|\|\||;;|\|&|<<<|<<-|<<|&>>|&>|>>|>&|>\||<&|<>|[;&|()<>]/y;
|
|
16889
16891
|
var NAME = /[A-Za-z_]\w*/y;
|
|
16890
16892
|
var SHELLS = /* @__PURE__ */ new Set(["sh", "bash", "zsh", "dash", "ksh"]);
|
|
@@ -16897,12 +16899,12 @@ var WRAPPER_VALUE_OPTIONS = {
|
|
|
16897
16899
|
};
|
|
16898
16900
|
var ANSI_C_ESCAPES = { n: "\n", t: " ", r: "\r", a: "\x07", b: "\b", e: "\x1B", E: "\x1B", f: "\f", v: "\v" };
|
|
16899
16901
|
function parseShellScript(script, cwd) {
|
|
16900
|
-
const scope = { src: script, vars: /* @__PURE__ */ new Map(), dir: cwd, commands: [], depth: 0, subshell: false };
|
|
16902
|
+
const scope = { src: script, vars: /* @__PURE__ */ new Map(), dir: cwd, commands: [], depth: 0, subshell: false, loopBudget: { left: MAX_LOOP_ITERATIONS } };
|
|
16901
16903
|
parseUntil(scope, 0, false);
|
|
16902
16904
|
return scope.commands;
|
|
16903
16905
|
}
|
|
16904
16906
|
function resolveShellPath(dir, path) {
|
|
16905
|
-
if (path.includes(SHELL_OPAQUE)
|
|
16907
|
+
if (path.includes(SHELL_OPAQUE)) return null;
|
|
16906
16908
|
if (!path.startsWith("/") && dir === null) return null;
|
|
16907
16909
|
const parts = [];
|
|
16908
16910
|
for (const part of (path.startsWith("/") ? path : `${dir}/${path}`).split("/")) {
|
|
@@ -16979,18 +16981,15 @@ function assign(scope, assignments) {
|
|
|
16979
16981
|
}
|
|
16980
16982
|
}
|
|
16981
16983
|
function emit(scope, raw) {
|
|
16982
|
-
const { argv
|
|
16983
|
-
if (argv.length === 0)
|
|
16984
|
-
assign(scope, assignments);
|
|
16985
|
-
return;
|
|
16986
|
-
}
|
|
16984
|
+
const { argv } = stripCommandPrefixes(raw.words);
|
|
16985
|
+
if (argv.length === 0) return;
|
|
16987
16986
|
const stdin = commandStdin(raw);
|
|
16988
16987
|
const output = staticOutput(argv, stdin) ?? SHELL_OPAQUE;
|
|
16989
16988
|
const stdinFile = raw.redirects.findLast(({ op }) => op === "<" || op === "0<");
|
|
16990
16989
|
const name = argv[0].split("/").pop() ?? "";
|
|
16991
16990
|
const flag = SHELLS.has(name) ? argv.findIndex((arg, index) => index > 0 && /^-[A-Za-z]*c[A-Za-z]*$/.test(arg)) : -1;
|
|
16992
16991
|
const script = flag > 0 ? argv[flag + 1] : SHELLS.has(name) && argv.length === 1 && stdin !== SHELL_OPAQUE ? stdin : name === "eval" ? argv.slice(1).join(" ") : void 0;
|
|
16993
|
-
const truncated = script !== void 0 && scope.depth >= MAX_DEPTH;
|
|
16992
|
+
const truncated = script !== void 0 && (scope.depth >= MAX_DEPTH || raw.truncated === true);
|
|
16994
16993
|
scope.commands.push({
|
|
16995
16994
|
argv,
|
|
16996
16995
|
dir: scope.dir,
|
|
@@ -16998,7 +16997,7 @@ function emit(scope, raw) {
|
|
|
16998
16997
|
afterAnd: raw.afterAnd,
|
|
16999
16998
|
stdinFile: stdinFile ? resolveShellPath(scope.dir, stdinFile.target) : null,
|
|
17000
16999
|
stdinTarget: stdinFile?.target ?? null,
|
|
17001
|
-
writes: raw.redirects.
|
|
17000
|
+
writes: raw.redirects.filter(({ op, target }) => /^(?:1?>|1?>\||1?>>|&>|&>>|>&)$/.test(op) && !/^(?:\d+|-)$/.test(target)).map(({ op, target }, index, outputs) => ({ path: resolveShellPath(scope.dir, target), target, content: index === outputs.length - 1 ? output : "", append: op.endsWith(">>") })),
|
|
17002
17001
|
wrapper: script !== void 0,
|
|
17003
17002
|
truncated,
|
|
17004
17003
|
piped: raw.pipeFrom !== void 0,
|
|
@@ -17006,10 +17005,8 @@ function emit(scope, raw) {
|
|
|
17006
17005
|
});
|
|
17007
17006
|
if (name === "cd" || name === "pushd" || name === "popd") {
|
|
17008
17007
|
scope.dir = name !== "popd" && argv[1] && argv[1] !== "-" ? resolveShellPath(scope.dir, argv[1]) : null;
|
|
17009
|
-
} else if (["export", "declare", "local", "readonly"].includes(name)) {
|
|
17010
|
-
assign(scope, argv.slice(1).filter((arg) => /^[A-Za-z_]\w*=/.test(arg)));
|
|
17011
17008
|
}
|
|
17012
|
-
if (script && !truncated) parseUntil({ src: script, vars: name === "eval" ? scope.vars : /* @__PURE__ */ new Map(), dir: scope.dir, commands: scope.commands, depth: scope.depth + 1, subshell: scope.subshell || raw.subshell }, 0, false);
|
|
17009
|
+
if (script && !truncated) parseUntil({ src: script, vars: name === "eval" ? scope.vars : /* @__PURE__ */ new Map(), dir: scope.dir, commands: scope.commands, depth: scope.depth + 1, subshell: scope.subshell || raw.subshell, loopBudget: scope.loopBudget }, 0, false);
|
|
17013
17010
|
}
|
|
17014
17011
|
function readHeredocBodies(scope, heredocs, start) {
|
|
17015
17012
|
const { src } = scope;
|
|
@@ -17057,7 +17054,7 @@ function readDoubleQuoted(scope, start, terminator) {
|
|
|
17057
17054
|
return { value, end: i };
|
|
17058
17055
|
}
|
|
17059
17056
|
function substitute(scope, src, start, closeParen) {
|
|
17060
|
-
const child = { src, vars: new Map(scope.vars), dir: scope.dir, commands: [], depth: scope.depth + 1, subshell: true };
|
|
17057
|
+
const child = { src, vars: new Map(scope.vars), dir: scope.dir, commands: [], depth: scope.depth + 1, subshell: true, loopBudget: scope.loopBudget };
|
|
17061
17058
|
const end = parseUntil(child, start, closeParen);
|
|
17062
17059
|
scope.commands.push(...child.commands);
|
|
17063
17060
|
const [only] = child.commands;
|
|
@@ -17098,16 +17095,22 @@ function readExpansion(scope, i, inDouble) {
|
|
|
17098
17095
|
if (next && /[0-9@*#?$!-]/.test(next)) return { value: SHELL_OPAQUE, end: i + 2 };
|
|
17099
17096
|
return { value: "$", end: i + 1 };
|
|
17100
17097
|
}
|
|
17101
|
-
function parseUntil(scope, start, closeParen) {
|
|
17098
|
+
function parseUntil(scope, start, closeParen, untilDone = false) {
|
|
17102
17099
|
const { src } = scope;
|
|
17103
17100
|
let i = start;
|
|
17104
17101
|
let line = [];
|
|
17105
17102
|
let current = { words: [], redirects: [], heredocs: [], afterAnd: false, subshell: false };
|
|
17103
|
+
let previous;
|
|
17106
17104
|
let pendingHeredocs = [];
|
|
17107
17105
|
let word = null;
|
|
17108
17106
|
let quoted = false;
|
|
17109
17107
|
let redirect = null;
|
|
17110
17108
|
let parens = 0;
|
|
17109
|
+
let keyword = null;
|
|
17110
|
+
let openLoops = 0;
|
|
17111
|
+
let afterOr = false;
|
|
17112
|
+
const conditional = /* @__PURE__ */ new Set();
|
|
17113
|
+
const scoped = /* @__PURE__ */ new Set();
|
|
17111
17114
|
const append = (text4, isQuoted = false) => {
|
|
17112
17115
|
word = (word ?? "") + text4;
|
|
17113
17116
|
quoted ||= isQuoted;
|
|
@@ -17121,6 +17124,7 @@ function parseUntil(scope, start, closeParen) {
|
|
|
17121
17124
|
} else if (redirect) {
|
|
17122
17125
|
current.redirects.push({ op: redirect, target: word });
|
|
17123
17126
|
} else {
|
|
17127
|
+
if (current.words.length === 0 && !quoted && (word === "do" || word === "done")) keyword = { word, header: previous?.words };
|
|
17124
17128
|
current.words.push(word);
|
|
17125
17129
|
}
|
|
17126
17130
|
word = null;
|
|
@@ -17132,14 +17136,80 @@ function parseUntil(scope, start, closeParen) {
|
|
|
17132
17136
|
const done = current;
|
|
17133
17137
|
if (op === "&") done.subshell = true;
|
|
17134
17138
|
current = { words: [], redirects: [], heredocs: [], pipeFrom: op === "|" || op === "|&" ? done : void 0, afterAnd: op === "&&", subshell: parens > 0 };
|
|
17135
|
-
|
|
17139
|
+
const endChain = () => {
|
|
17140
|
+
if (op === void 0 || ["&&", "|", "|&"].includes(op) || done.words[0] === "for") return;
|
|
17141
|
+
for (const name of conditional) scope.vars.set(name, SHELL_OPAQUE);
|
|
17142
|
+
conditional.clear();
|
|
17143
|
+
};
|
|
17144
|
+
if (done.words.length === 0 && done.redirects.length === 0 && done.heredocs.length === 0) {
|
|
17145
|
+
endChain();
|
|
17146
|
+
return;
|
|
17147
|
+
}
|
|
17148
|
+
line.push(done);
|
|
17149
|
+
previous = done;
|
|
17150
|
+
const { argv, assignments } = stripCommandPrefixes(done.words);
|
|
17151
|
+
const assigned = argv.length === 0 ? assignments : ["export", "declare", "local", "readonly"].includes(argv[0]) ? argv.slice(1).filter((arg) => /^[A-Za-z_]\w*=/.test(arg)) : [];
|
|
17152
|
+
assign(scope, assigned);
|
|
17153
|
+
const names = assigned.map((assignment) => assignment.slice(0, assignment.indexOf("=")));
|
|
17154
|
+
if (done.afterAnd || afterOr) for (const name of names) conditional.add(name);
|
|
17155
|
+
if (done.subshell) for (const name of names) scoped.add(name);
|
|
17156
|
+
if (op === ")" && parens === 0 || op === "&") {
|
|
17157
|
+
for (const name of scoped) scope.vars.set(name, SHELL_OPAQUE);
|
|
17158
|
+
scoped.clear();
|
|
17159
|
+
}
|
|
17160
|
+
afterOr = op === "||";
|
|
17161
|
+
endChain();
|
|
17162
|
+
if (argv[0] === "eval") {
|
|
17163
|
+
if (pendingHeredocs.length > 0) done.truncated = true;
|
|
17164
|
+
else {
|
|
17165
|
+
for (const raw of line) emit(scope, raw);
|
|
17166
|
+
line = [];
|
|
17167
|
+
}
|
|
17168
|
+
}
|
|
17169
|
+
};
|
|
17170
|
+
const unrollFor = (header) => {
|
|
17171
|
+
current = { words: [], redirects: [], heredocs: [], afterAnd: false, subshell: parens > 0 };
|
|
17172
|
+
flush();
|
|
17173
|
+
const words = header.slice(3);
|
|
17174
|
+
const literal = header[2] === "in" && words.length > 0 && words.length <= MAX_LOOP_VALUES && words.every((value) => !value.includes(SHELL_OPAQUE) && !/[\s*?[{]/.test(value));
|
|
17175
|
+
const values = literal ? words : [SHELL_OPAQUE];
|
|
17176
|
+
scope.loopBudget.left -= values.length;
|
|
17177
|
+
if (scope.loopBudget.left < 0) {
|
|
17178
|
+
scope.commands.push({ argv: header, dir: scope.dir, stdinFile: null, stdinTarget: null, writes: [], wrapper: true, truncated: true, afterAnd: false, piped: false, subshell: scope.subshell });
|
|
17179
|
+
values.splice(0, values.length, SHELL_OPAQUE);
|
|
17180
|
+
}
|
|
17181
|
+
let end = src.length;
|
|
17182
|
+
for (const value of values) {
|
|
17183
|
+
scope.vars.set(header[1], value);
|
|
17184
|
+
end = parseUntil(scope, i, false, true);
|
|
17185
|
+
}
|
|
17186
|
+
i = end;
|
|
17136
17187
|
};
|
|
17137
|
-
const
|
|
17138
|
-
|
|
17188
|
+
const takeKeyword = () => {
|
|
17189
|
+
const taken = keyword;
|
|
17190
|
+
keyword = null;
|
|
17191
|
+
return taken;
|
|
17192
|
+
};
|
|
17193
|
+
const flush = (op) => {
|
|
17194
|
+
endCommand(op);
|
|
17139
17195
|
for (const raw of line) emit(scope, raw);
|
|
17140
17196
|
line = [];
|
|
17141
17197
|
};
|
|
17142
17198
|
while (i < src.length) {
|
|
17199
|
+
const { word: boundary, header } = takeKeyword() ?? {};
|
|
17200
|
+
if (boundary === "do") {
|
|
17201
|
+
if (header?.[0] === "for" && /^[A-Za-z_]\w*$/.test(header[1] ?? "")) {
|
|
17202
|
+
unrollFor(header);
|
|
17203
|
+
continue;
|
|
17204
|
+
}
|
|
17205
|
+
openLoops++;
|
|
17206
|
+
} else if (boundary === "done") {
|
|
17207
|
+
if (openLoops > 0) openLoops--;
|
|
17208
|
+
else if (untilDone) {
|
|
17209
|
+
flush();
|
|
17210
|
+
return i;
|
|
17211
|
+
}
|
|
17212
|
+
}
|
|
17143
17213
|
const c = src[i];
|
|
17144
17214
|
if (c === "\\") {
|
|
17145
17215
|
if (src[i + 1] !== "\n") append(src[i + 1] ?? "", true);
|
|
@@ -17162,7 +17232,7 @@ function parseUntil(scope, start, closeParen) {
|
|
|
17162
17232
|
endWord();
|
|
17163
17233
|
i = readHeredocBodies(scope, pendingHeredocs, i + 1);
|
|
17164
17234
|
pendingHeredocs = [];
|
|
17165
|
-
flush();
|
|
17235
|
+
flush("\n");
|
|
17166
17236
|
} else if (c === " " || c === " " || c === "\r") {
|
|
17167
17237
|
endWord();
|
|
17168
17238
|
i++;
|
|
@@ -17173,7 +17243,7 @@ function parseUntil(scope, start, closeParen) {
|
|
|
17173
17243
|
OPERATOR.lastIndex = i;
|
|
17174
17244
|
const op = OPERATOR.exec(src)?.[0];
|
|
17175
17245
|
if (!op) {
|
|
17176
|
-
append(c);
|
|
17246
|
+
append(c === "~" && word === null && /^(?:[/\s;&|()<>]|$)/.test(src[i + 1] ?? "") ? scope.vars.get("HOME") ?? SANDBOX_PATHS.HOME_DIR : c);
|
|
17177
17247
|
i++;
|
|
17178
17248
|
continue;
|
|
17179
17249
|
}
|
|
@@ -21718,7 +21788,7 @@ async function withRetry(label, fn, options) {
|
|
|
21718
21788
|
}
|
|
21719
21789
|
|
|
21720
21790
|
// ../shared/src/tensorlake.ts
|
|
21721
|
-
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-21-
|
|
21791
|
+
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-21-v10";
|
|
21722
21792
|
var TENSORLAKE_DISK_MB = 100 * 1024;
|
|
21723
21793
|
|
|
21724
21794
|
// ../shared/src/egress.ts
|
|
@@ -22958,16 +23028,21 @@ function toCommandProtectionRepoState(outputs) {
|
|
|
22958
23028
|
mergeInProgress: Boolean(mergeHead)
|
|
22959
23029
|
};
|
|
22960
23030
|
}
|
|
22961
|
-
function
|
|
23031
|
+
function catSources({ argv, dir, writes }) {
|
|
23032
|
+
const args = argv.slice(1);
|
|
23033
|
+
return writes.length > 0 && argv[0].split("/").pop() === "cat" && args.length > 0 && args.every((arg) => !arg.startsWith("-")) ? args.map((arg) => resolveShellPath(dir, arg)) : null;
|
|
23034
|
+
}
|
|
23035
|
+
function findCommandProtectionGitLookups({ commands, invocations }) {
|
|
22962
23036
|
const writes = invocations.filter(({ subcommand }) => subcommand === "commit" || subcommand === "push");
|
|
22963
23037
|
const messageFiles = writes.flatMap(({ subcommand, args, dir, command }) => {
|
|
22964
23038
|
const { file } = subcommand === "commit" ? parseCommitArgs(args) : { file: void 0 };
|
|
22965
23039
|
const path = file === "-" ? command.stdinFile : file === void 0 ? null : resolveShellPath(dir, file);
|
|
22966
23040
|
return path ? [path] : [];
|
|
22967
23041
|
});
|
|
23042
|
+
const sources = writes.some(({ subcommand }) => subcommand === "commit") ? commands.flatMap((command) => catSources(command) ?? []) : [];
|
|
22968
23043
|
return {
|
|
22969
23044
|
repoDirs: [...new Set(writes.flatMap(({ dir }) => dir === null ? [] : [dir]))],
|
|
22970
|
-
messageFiles: [
|
|
23045
|
+
messageFiles: [.../* @__PURE__ */ new Set([...messageFiles, ...sources.filter((path) => path !== null)])]
|
|
22971
23046
|
};
|
|
22972
23047
|
}
|
|
22973
23048
|
function shouldRefreshPullRequests(toolName, toolInput) {
|
package/dist/src/codemode-mcp.js
CHANGED
|
@@ -4,15 +4,15 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
getManagedPiMcpServers,
|
|
6
6
|
managedMcpServerProcess
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NYD3PMJT.js";
|
|
8
8
|
import "./chunk-7ZDAVYTV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-RPU6OJA6.js";
|
|
10
10
|
import {
|
|
11
11
|
isRecord
|
|
12
12
|
} from "./chunk-UZSNFLDQ.js";
|
|
13
13
|
import {
|
|
14
14
|
rankToolsByQuery
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VRDOHLAY.js";
|
|
16
16
|
import "./chunk-VEQXQN22.js";
|
|
17
17
|
|
|
18
18
|
// src/codemode-mcp.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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-F7V3PQLH.js";
|
|
7
|
+
import "./chunk-UJDIMALI.js";
|
|
8
|
+
import "./chunk-RQWM6JC4.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-VRDOHLAY.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SKA5LFKD.js";
|
|
18
18
|
import "./chunk-7ZDAVYTV.js";
|
|
19
19
|
import {
|
|
20
20
|
AppServerProcess,
|
|
21
21
|
buildCodexAgentEnv
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-65ZPGPRS.js";
|
|
23
|
+
import "./chunk-RQWM6JC4.js";
|
|
24
24
|
import {
|
|
25
25
|
AGENT,
|
|
26
26
|
OPENCODE_GO_PROVIDER,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
headlessAgentUsagePath,
|
|
31
31
|
isRecord,
|
|
32
32
|
withTimeout
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-VRDOHLAY.js";
|
|
34
34
|
import "./chunk-VEQXQN22.js";
|
|
35
35
|
|
|
36
36
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -90,12 +90,12 @@ import {
|
|
|
90
90
|
import {
|
|
91
91
|
getManagedPiMcpServers,
|
|
92
92
|
managedMcpServerProcess
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-NYD3PMJT.js";
|
|
94
94
|
import {
|
|
95
95
|
evaluateCommandProtection,
|
|
96
96
|
extractToolCommand,
|
|
97
97
|
reportCommandProtectionBlock
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-F7V3PQLH.js";
|
|
99
99
|
import {
|
|
100
100
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
101
101
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
spawnMuseMsp,
|
|
130
130
|
startMuseSession,
|
|
131
131
|
uuidV7
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-SKA5LFKD.js";
|
|
133
133
|
import {
|
|
134
134
|
MUSE_AUTH_PATH,
|
|
135
135
|
OPENCODE_AUTH_PATH,
|
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
} from "./chunk-7ZDAVYTV.js";
|
|
138
138
|
import {
|
|
139
139
|
publishedPullRequestUrls
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-T4B2VCBO.js";
|
|
141
141
|
import {
|
|
142
142
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
143
143
|
AsyncLock,
|
|
@@ -215,12 +215,12 @@ import {
|
|
|
215
215
|
transcriptSecrets,
|
|
216
216
|
upsertCredentialFileLines,
|
|
217
217
|
writeSecureCredentialFile
|
|
218
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-OZZ4KYIJ.js";
|
|
219
219
|
import {
|
|
220
220
|
SUBAGENT_MCP_TOOL_TIMEOUT_MS,
|
|
221
221
|
engineScriptProcess,
|
|
222
222
|
subagentMcpProcessConfig
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-RPU6OJA6.js";
|
|
224
224
|
import {
|
|
225
225
|
ENGINE_ENV,
|
|
226
226
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -231,18 +231,18 @@ import {
|
|
|
231
231
|
resolveDiffBase,
|
|
232
232
|
setAgentCredentialSnapshot,
|
|
233
233
|
setLinearSessionId
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-UJDIMALI.js";
|
|
235
235
|
import {
|
|
236
236
|
AspRequestTimeoutError,
|
|
237
237
|
AspResponseError,
|
|
238
238
|
buildCodexAgentEnv,
|
|
239
239
|
getCodexModelProvider
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-65ZPGPRS.js";
|
|
241
241
|
import {
|
|
242
242
|
SUBPROCESS_MAX_BUFFER,
|
|
243
243
|
execAsync,
|
|
244
244
|
execFileAsync
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-RQWM6JC4.js";
|
|
246
246
|
import {
|
|
247
247
|
isRecord
|
|
248
248
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -543,7 +543,7 @@ import {
|
|
|
543
543
|
workspaceTokenRequestSchema,
|
|
544
544
|
workspaceTokenResponseSchema,
|
|
545
545
|
wrapInTag
|
|
546
|
-
} from "./chunk-
|
|
546
|
+
} from "./chunk-VRDOHLAY.js";
|
|
547
547
|
import {
|
|
548
548
|
__commonJS,
|
|
549
549
|
__export,
|
|
@@ -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-T4B2VCBO.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-VRDOHLAY.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