replicas-engine 0.1.579 → 0.1.580
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/index.js +30 -18
- package/package.json +1 -1
- package/dist/src/bowser-UXBOYYAJ.js +0 -2821
- package/dist/src/chunk-6NGTYZPX.js +0 -3140
- package/dist/src/chunk-A6ZHMNK4.js +0 -436
- package/dist/src/chunk-B7L4ZPGB.js +0 -1052
- package/dist/src/chunk-EB4AJ2V6.js +0 -576
- package/dist/src/chunk-JWM4YXMZ.js +0 -1491
- package/dist/src/chunk-QE4MMXQA.js +0 -2102
- package/dist/src/dist-es-4XW324ME.js +0 -376
- package/dist/src/dist-es-6PMBQ4JI.js +0 -87
- package/dist/src/dist-es-GB67RX6P.js +0 -492
- package/dist/src/dist-es-OTROFLRA.js +0 -169
- package/dist/src/dist-es-VF5HSV72.js +0 -47
- package/dist/src/dist-es-VJJ2WNNG.js +0 -317
- package/dist/src/dist-es-XMRJV7XN.js +0 -69
- package/dist/src/event-streams-3JEJVYQR.js +0 -1376
- package/dist/src/loadSso-QDS4L4DG.js +0 -574
- package/dist/src/signin-EETD6KX2.js +0 -738
- package/dist/src/sso-oidc-25HRWVRW.js +0 -827
- package/dist/src/sts-2O2TZS6K.js +0 -6367
package/dist/src/index.js
CHANGED
|
@@ -10896,7 +10896,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
|
10896
10896
|
var MIN_CODEX_CLI_VERSION = "0.144.6";
|
|
10897
10897
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
10898
10898
|
var codexCliVersionEnsured = null;
|
|
10899
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
10899
|
+
var ENGINE_PACKAGE_VERSION = "0.1.580";
|
|
10900
10900
|
var INITIALIZE_METHOD = "initialize";
|
|
10901
10901
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
10902
10902
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -13822,6 +13822,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
13822
13822
|
nonAssistantMessageIds = /* @__PURE__ */ new Set();
|
|
13823
13823
|
activeLinearForwarder = null;
|
|
13824
13824
|
forwardedLinearPartKeys = /* @__PURE__ */ new Set();
|
|
13825
|
+
handledAccountRateLimit = false;
|
|
13825
13826
|
modelVariants = /* @__PURE__ */ new Map();
|
|
13826
13827
|
handledPermissionRequestIds = /* @__PURE__ */ new Set();
|
|
13827
13828
|
pendingPermissionRequestIds = /* @__PURE__ */ new Set();
|
|
@@ -13844,18 +13845,20 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
13844
13845
|
return this.historyFile;
|
|
13845
13846
|
}
|
|
13846
13847
|
async interruptActiveTurn() {
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
{ sessionID: this.sessionId, directory: this.workingDirectory },
|
|
13852
|
-
{ throwOnError: true }
|
|
13853
|
-
);
|
|
13854
|
-
} catch (error) {
|
|
13855
|
-
console.error("[OpencodeManager] Failed to abort Opencode session:", error);
|
|
13856
|
-
}
|
|
13848
|
+
try {
|
|
13849
|
+
await this.abortActiveTurn();
|
|
13850
|
+
} catch (error) {
|
|
13851
|
+
console.error("[OpencodeManager] Failed to abort Opencode session:", error);
|
|
13857
13852
|
}
|
|
13858
13853
|
}
|
|
13854
|
+
async abortActiveTurn() {
|
|
13855
|
+
this.activeAbortController?.abort();
|
|
13856
|
+
if (!this.client || !this.sessionId) return;
|
|
13857
|
+
await this.client.session.abort(
|
|
13858
|
+
{ sessionID: this.sessionId, directory: this.workingDirectory },
|
|
13859
|
+
{ throwOnError: true }
|
|
13860
|
+
);
|
|
13861
|
+
}
|
|
13859
13862
|
async getHistory() {
|
|
13860
13863
|
await this.historyFile.flush();
|
|
13861
13864
|
const history = await this.historyFile.load();
|
|
@@ -14017,6 +14020,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
14017
14020
|
const controller = new AbortController();
|
|
14018
14021
|
const linearSessionId = ENGINE_ENV.REPLICAS_LINEAR_SESSION_ID;
|
|
14019
14022
|
const linearForwarder = new LinearEventForwarder(linearSessionId);
|
|
14023
|
+
this.handledAccountRateLimit = false;
|
|
14020
14024
|
this.activeAbortController = controller;
|
|
14021
14025
|
this.activeLinearForwarder = linearForwarder;
|
|
14022
14026
|
this.forwardedLinearPartKeys.clear();
|
|
@@ -14104,6 +14108,11 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
14104
14108
|
return;
|
|
14105
14109
|
}
|
|
14106
14110
|
if (event.type === "message.updated") this.recordOpencodeMessageRole(payload);
|
|
14111
|
+
if (event.type === "session.status") {
|
|
14112
|
+
this.handleAccountRateLimit(payload).catch((error) => {
|
|
14113
|
+
console.error("[OpencodeManager] Failed to stop account-rate-limited turn:", error);
|
|
14114
|
+
});
|
|
14115
|
+
}
|
|
14107
14116
|
if (event.type === "session.next.tool.input.ended") {
|
|
14108
14117
|
const callId = typeof payload.callID === "string" ? payload.callID : void 0;
|
|
14109
14118
|
if (callId && typeof payload.text === "string") {
|
|
@@ -14123,6 +14132,15 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
14123
14132
|
if (this.recordOpencodeNextPart(event.type, payload)) return;
|
|
14124
14133
|
this.recordHistoryEvent(`opencode-${event.type}`, payload, this.historyFile);
|
|
14125
14134
|
}
|
|
14135
|
+
async handleAccountRateLimit(payload) {
|
|
14136
|
+
const status = isRecord4(payload.status) ? payload.status : null;
|
|
14137
|
+
const action = isRecord4(status?.action) ? status.action : null;
|
|
14138
|
+
if (status?.type !== "retry" || action?.reason !== "account_rate_limit" || this.handledAccountRateLimit) return;
|
|
14139
|
+
this.handledAccountRateLimit = true;
|
|
14140
|
+
const message = typeof status.message === "string" ? status.message : typeof action.message === "string" ? action.message : "OpenCode Go usage limit reached.";
|
|
14141
|
+
this.recordHistoryEvent("opencode-error", { message, code: "account_rate_limit" }, this.historyFile);
|
|
14142
|
+
await this.abortActiveTurn();
|
|
14143
|
+
}
|
|
14126
14144
|
async respondToOpencodePermission(type, payload) {
|
|
14127
14145
|
if (!this.client) return;
|
|
14128
14146
|
const requestId = typeof payload.id === "string" ? payload.id : void 0;
|
|
@@ -14221,13 +14239,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
14221
14239
|
historyFile: this.historyFile,
|
|
14222
14240
|
recordHistoryEvent: this.recordHistoryEvent.bind(this)
|
|
14223
14241
|
});
|
|
14224
|
-
this.
|
|
14225
|
-
if (this.client && this.sessionId) {
|
|
14226
|
-
await this.client.session.abort(
|
|
14227
|
-
{ sessionID: this.sessionId, directory: this.workingDirectory },
|
|
14228
|
-
{ throwOnError: true }
|
|
14229
|
-
);
|
|
14230
|
-
}
|
|
14242
|
+
await this.abortActiveTurn();
|
|
14231
14243
|
this.handledToolCallIds.add(toolUseId);
|
|
14232
14244
|
} finally {
|
|
14233
14245
|
this.pendingToolCallIds.delete(toolUseId);
|