replicas-engine 0.1.783 → 0.1.785
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-B37T3HBC.js → asp-host-BGBU6WHK.js} +4 -4
- package/dist/src/{chunk-5JH7EC4O.js → chunk-65OJBHL5.js} +2 -2
- package/dist/src/{chunk-KQ3YMKTG.js → chunk-F7EM7PIH.js} +1 -1
- package/dist/src/{chunk-LRGDQU3J.js → chunk-LDKI2FFI.js} +2 -2
- package/dist/src/{chunk-4RKK2J4H.js → chunk-ROZZ457J.js} +4 -4
- package/dist/src/{chunk-MEGQEPML.js → chunk-YRK3AKS5.js} +1 -1
- package/dist/src/{chunk-TLLCE2K2.js → chunk-YSUQDUHX.js} +22 -27
- package/dist/src/command-protection-hook.js +3 -3
- package/dist/src/deepseek-command-protection-plugin.js +4 -4
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +31 -21
- package/dist/src/post-tool-pr-hook.js +2 -2
- 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-ROZZ457J.js";
|
|
9
|
+
import "./chunk-YRK3AKS5.js";
|
|
10
|
+
import "./chunk-LDKI2FFI.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-YSUQDUHX.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
export {
|
|
15
15
|
getCodexAspHost,
|
|
@@ -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-YRK3AKS5.js";
|
|
7
7
|
import {
|
|
8
8
|
extractCommandProtectionCommandText,
|
|
9
9
|
findGitCommitSignals,
|
|
10
10
|
findPrMergeSignals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YSUQDUHX.js";
|
|
12
12
|
|
|
13
13
|
// src/services/command-protection-service.ts
|
|
14
14
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
findCodeHostPullRequestUrls,
|
|
6
6
|
mayCreatePullRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YSUQDUHX.js";
|
|
8
8
|
|
|
9
9
|
// src/services/post-tool-pr-notifier.ts
|
|
10
10
|
async function notifyPostToolUse(toolName, toolInput, toolResult) {
|
|
@@ -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-YSUQDUHX.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.785";
|
|
245
245
|
var INITIALIZE_METHOD = "initialize";
|
|
246
246
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
247
247
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YRK3AKS5.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
buildCodexAgentEnv
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LDKI2FFI.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-YSUQDUHX.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-BGBU6WHK.js");
|
|
236
236
|
await restartCodexAspHostIfRunning2();
|
|
237
237
|
}
|
|
238
238
|
if (data.scope) {
|
|
@@ -885,41 +885,36 @@ function applyCodexAspTranscriptDelta(current, delta) {
|
|
|
885
885
|
updatedAt: delta.updatedAt,
|
|
886
886
|
turns: []
|
|
887
887
|
});
|
|
888
|
-
const turns = base.turns.map((turn) =>
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
}));
|
|
888
|
+
const turns = base.turns.map((turn) => delta.reset ? { ...turn, items: [...turn.items] } : turn);
|
|
889
|
+
const changedTurns = new Set(delta.reset ? turns : []);
|
|
890
|
+
const turnIndexes = new Map(turns.map((turn, index) => [turn.id, index]));
|
|
892
891
|
for (const turnDelta of delta.turns) {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
turn.completedAt = turnDelta.completedAt;
|
|
907
|
-
}
|
|
892
|
+
const turnIndex = turnIndexes.get(turnDelta.id) ?? turns.length;
|
|
893
|
+
const previousTurn = turns[turnIndex];
|
|
894
|
+
const turn = {
|
|
895
|
+
...previousTurn,
|
|
896
|
+
id: turnDelta.id,
|
|
897
|
+
status: turnDelta.status,
|
|
898
|
+
startedAt: turnDelta.startedAt,
|
|
899
|
+
completedAt: turnDelta.completedAt,
|
|
900
|
+
items: [...previousTurn?.items ?? []]
|
|
901
|
+
};
|
|
902
|
+
turnIndexes.set(turn.id, turnIndex);
|
|
903
|
+
turns[turnIndex] = turn;
|
|
904
|
+
const itemIndexes = new Map(turn.items.map((item, index) => [item.id, index]));
|
|
908
905
|
for (const itemDelta of turnDelta.items) {
|
|
909
|
-
const itemIndex =
|
|
906
|
+
const itemIndex = itemIndexes.get(itemDelta.id) ?? turn.items.length;
|
|
910
907
|
const patched = patchCodexAspTranscriptItem(turn.items[itemIndex], itemDelta);
|
|
911
908
|
if (!patched) continue;
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
} else {
|
|
915
|
-
turn.items[itemIndex] = patched;
|
|
916
|
-
}
|
|
909
|
+
itemIndexes.set(itemDelta.id, itemIndex);
|
|
910
|
+
turn.items[itemIndex] = patched;
|
|
917
911
|
}
|
|
912
|
+
changedTurns.add(turn);
|
|
918
913
|
}
|
|
919
|
-
|
|
920
|
-
for (const turn of turns) {
|
|
914
|
+
for (const turn of changedTurns) {
|
|
921
915
|
turn.items.sort((a, b) => (a.sequence ?? Number.MAX_SAFE_INTEGER) - (b.sequence ?? Number.MAX_SAFE_INTEGER) || Date.parse(a.timestamp) - Date.parse(b.timestamp));
|
|
922
916
|
}
|
|
917
|
+
turns.sort((a, b) => Date.parse(a.startedAt) - Date.parse(b.startedAt));
|
|
923
918
|
return {
|
|
924
919
|
threadId: delta.threadId,
|
|
925
920
|
updatedAt: delta.updatedAt,
|
|
@@ -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-65OJBHL5.js";
|
|
7
|
+
import "./chunk-YRK3AKS5.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-YSUQDUHX.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-65OJBHL5.js";
|
|
7
7
|
import {
|
|
8
8
|
notifyPostToolUse
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-F7EM7PIH.js";
|
|
10
|
+
import "./chunk-YRK3AKS5.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-YSUQDUHX.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/deepseek-command-protection-plugin.ts
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
AppServerProcess,
|
|
10
10
|
buildCodexAgentEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LDKI2FFI.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
getMemoryOutputSafetyViolation,
|
|
15
15
|
headlessAgentRequestSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YSUQDUHX.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-65OJBHL5.js";
|
|
95
95
|
import {
|
|
96
96
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
97
97
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -124,20 +124,20 @@ import {
|
|
|
124
124
|
recordCredentialFallback,
|
|
125
125
|
recordExhaustedCredential,
|
|
126
126
|
restartCodexAspHost
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-ROZZ457J.js";
|
|
128
128
|
import {
|
|
129
129
|
ENGINE_ENV,
|
|
130
130
|
IS_WARMING_MODE,
|
|
131
131
|
monolithRequest,
|
|
132
132
|
monolithService,
|
|
133
133
|
setAgentCredentialSnapshot
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-YRK3AKS5.js";
|
|
135
135
|
import {
|
|
136
136
|
AspClient,
|
|
137
137
|
SUBPROCESS_MAX_BUFFER,
|
|
138
138
|
execAsync,
|
|
139
139
|
execFileAsync
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-LDKI2FFI.js";
|
|
141
141
|
import {
|
|
142
142
|
isRecord as isRecord2
|
|
143
143
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -338,7 +338,7 @@ import {
|
|
|
338
338
|
spawnRelaySubagentRequestSchema,
|
|
339
339
|
stripAgentDiagnosticErrors,
|
|
340
340
|
withTimeout
|
|
341
|
-
} from "./chunk-
|
|
341
|
+
} from "./chunk-YSUQDUHX.js";
|
|
342
342
|
import {
|
|
343
343
|
__commonJS,
|
|
344
344
|
__export,
|
|
@@ -14698,7 +14698,8 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
14698
14698
|
attachedDeveloperInstructions = null;
|
|
14699
14699
|
historyFile;
|
|
14700
14700
|
codexAspTranscript = null;
|
|
14701
|
-
|
|
14701
|
+
lastEmittedTranscript = null;
|
|
14702
|
+
dirtyTranscriptTurns = /* @__PURE__ */ new Map();
|
|
14702
14703
|
codexAspSequence = 0;
|
|
14703
14704
|
quotaStatus = new CodexQuotaStatusTracker();
|
|
14704
14705
|
currentGoal = null;
|
|
@@ -15648,9 +15649,13 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15648
15649
|
}
|
|
15649
15650
|
mergeTranscriptSnapshot(snapshot) {
|
|
15650
15651
|
if (snapshot?.threadId && this.codexAspTranscript?.threadId !== snapshot.threadId) {
|
|
15651
|
-
this.
|
|
15652
|
+
this.lastEmittedTranscript = null;
|
|
15653
|
+
this.dirtyTranscriptTurns.clear();
|
|
15652
15654
|
}
|
|
15653
15655
|
this.codexAspTranscript = mergeCodexAspTranscripts(this.codexAspTranscript, snapshot);
|
|
15656
|
+
for (const turn of this.codexAspTranscript?.turns ?? []) {
|
|
15657
|
+
this.dirtyTranscriptTurns.set(turn.id, turn);
|
|
15658
|
+
}
|
|
15654
15659
|
this.syncTranscriptSequence(this.codexAspTranscript);
|
|
15655
15660
|
return this.codexAspTranscript;
|
|
15656
15661
|
}
|
|
@@ -15658,7 +15663,8 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15658
15663
|
if (this.codexAspTranscript?.threadId === threadId) {
|
|
15659
15664
|
return this.codexAspTranscript;
|
|
15660
15665
|
}
|
|
15661
|
-
this.
|
|
15666
|
+
this.lastEmittedTranscript = null;
|
|
15667
|
+
this.dirtyTranscriptTurns.clear();
|
|
15662
15668
|
this.codexAspTranscript = {
|
|
15663
15669
|
threadId,
|
|
15664
15670
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -15680,8 +15686,8 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15680
15686
|
};
|
|
15681
15687
|
transcript.turns.push(turn);
|
|
15682
15688
|
transcript.turns.sort((a, b) => Date.parse(a.startedAt) - Date.parse(b.startedAt));
|
|
15683
|
-
return turn;
|
|
15684
15689
|
}
|
|
15690
|
+
this.dirtyTranscriptTurns.set(turnId, turn);
|
|
15685
15691
|
if (Date.parse(startedAt) < Date.parse(turn.startedAt)) {
|
|
15686
15692
|
turn.startedAt = startedAt;
|
|
15687
15693
|
}
|
|
@@ -15836,6 +15842,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15836
15842
|
if (itemIndex === -1) return;
|
|
15837
15843
|
const item = turn.items[itemIndex];
|
|
15838
15844
|
if (item.type !== "commandExecution" && item.type !== "fileChange") return;
|
|
15845
|
+
this.dirtyTranscriptTurns.set(turnId, turn);
|
|
15839
15846
|
turn.items[itemIndex] = {
|
|
15840
15847
|
...item,
|
|
15841
15848
|
output: appendCodexAspTranscriptOutput(item.output, delta),
|
|
@@ -15887,6 +15894,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15887
15894
|
this.transcriptUpdateCoalescer.schedule(threadId, options);
|
|
15888
15895
|
}
|
|
15889
15896
|
buildTranscriptItemDelta(previous, current) {
|
|
15897
|
+
if (previous === current) return null;
|
|
15890
15898
|
if (!previous || previous.type !== current.type) {
|
|
15891
15899
|
return { id: current.id, item: structuredClone(current) };
|
|
15892
15900
|
}
|
|
@@ -15914,9 +15922,9 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15914
15922
|
return { id: current.id, item: structuredClone(current) };
|
|
15915
15923
|
}
|
|
15916
15924
|
buildTranscriptDelta(threadId, current) {
|
|
15917
|
-
const previous = this.
|
|
15925
|
+
const previous = this.lastEmittedTranscript;
|
|
15918
15926
|
const updatedAt = current?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
15919
|
-
if (!current || previous
|
|
15927
|
+
if (!current || !previous || previous.threadId !== current.threadId) {
|
|
15920
15928
|
return {
|
|
15921
15929
|
threadId,
|
|
15922
15930
|
updatedAt,
|
|
@@ -15925,8 +15933,8 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15925
15933
|
};
|
|
15926
15934
|
}
|
|
15927
15935
|
const turnDeltas = [];
|
|
15928
|
-
for (const currentTurn of
|
|
15929
|
-
const previousTurn = previous.turns.
|
|
15936
|
+
for (const currentTurn of this.dirtyTranscriptTurns.values()) {
|
|
15937
|
+
const previousTurn = previous.turns.get(currentTurn.id);
|
|
15930
15938
|
if (!previousTurn) {
|
|
15931
15939
|
turnDeltas.push({
|
|
15932
15940
|
id: currentTurn.id,
|
|
@@ -15937,8 +15945,9 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15937
15945
|
});
|
|
15938
15946
|
continue;
|
|
15939
15947
|
}
|
|
15948
|
+
const previousItems = new Map(previousTurn.items.map((item) => [item.id, item]));
|
|
15940
15949
|
const itemDeltas = currentTurn.items.map((item) => this.buildTranscriptItemDelta(
|
|
15941
|
-
|
|
15950
|
+
previousItems.get(item.id),
|
|
15942
15951
|
item
|
|
15943
15952
|
)).filter((item) => item !== null);
|
|
15944
15953
|
if (itemDeltas.length > 0 || currentTurn.status !== previousTurn.status || currentTurn.startedAt !== previousTurn.startedAt || currentTurn.completedAt !== previousTurn.completedAt) {
|
|
@@ -15966,15 +15975,16 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15966
15975
|
transcript: transcriptDelta.reset ?? null,
|
|
15967
15976
|
transcriptDelta
|
|
15968
15977
|
};
|
|
15969
|
-
this.
|
|
15970
|
-
threadId,
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
for (const emittedThreadId of this.lastEmittedTranscripts.keys()) {
|
|
15974
|
-
if (emittedThreadId !== threadId) {
|
|
15975
|
-
this.lastEmittedTranscripts.delete(emittedThreadId);
|
|
15978
|
+
if (this.codexAspTranscript) {
|
|
15979
|
+
const snapshot = this.lastEmittedTranscript ?? { threadId, turns: /* @__PURE__ */ new Map() };
|
|
15980
|
+
for (const turn of this.dirtyTranscriptTurns.values()) {
|
|
15981
|
+
snapshot.turns.set(turn.id, { ...turn, items: [...turn.items] });
|
|
15976
15982
|
}
|
|
15983
|
+
this.lastEmittedTranscript = snapshot;
|
|
15984
|
+
} else {
|
|
15985
|
+
this.lastEmittedTranscript = null;
|
|
15977
15986
|
}
|
|
15987
|
+
this.dirtyTranscriptTurns.clear();
|
|
15978
15988
|
const event = {
|
|
15979
15989
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
15980
15990
|
type: CODEX_ASP_TRANSCRIPT_UPDATED_EVENT_TYPE,
|
|
@@ -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-F7EM7PIH.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-YSUQDUHX.js";
|
|
11
11
|
import "./chunk-VEQXQN22.js";
|
|
12
12
|
|
|
13
13
|
// src/post-tool-pr-hook.ts
|
package/dist/src/relay-mcp.js
CHANGED