replicas-engine 0.1.227 → 0.1.229
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 +78 -7
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -352,6 +352,9 @@ function parsePosixEnvFile(content) {
|
|
|
352
352
|
return result;
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
+
// ../shared/src/git.ts
|
|
356
|
+
var GIT_PARTIAL_CLONE_FILTER = "blob:none";
|
|
357
|
+
|
|
355
358
|
// ../shared/src/default-skills/replicas-agent/abilities/computer.ts
|
|
356
359
|
var SECTION = `### Computer use (Linux desktop control)
|
|
357
360
|
Drive the workspace's Linux desktop - open a browser, click, type, scroll, screenshot, record - and surface a live noVNC viewer to the user via the \`replicas computer\` CLI. Every Replicas workspace boots with Xvfb / openbox / x11vnc / noVNC pre-installed.
|
|
@@ -1773,7 +1776,7 @@ function isClaudeAuthErrorText(text) {
|
|
|
1773
1776
|
}
|
|
1774
1777
|
|
|
1775
1778
|
// ../shared/src/engine/environment.ts
|
|
1776
|
-
var DAYTONA_SNAPSHOT_ID = "28-05-2026-royal-york-
|
|
1779
|
+
var DAYTONA_SNAPSHOT_ID = "28-05-2026-royal-york-v6";
|
|
1777
1780
|
|
|
1778
1781
|
// ../shared/src/engine/types.ts
|
|
1779
1782
|
var DEFAULT_CHAT_TITLES = {
|
|
@@ -2717,7 +2720,7 @@ var GitService = class {
|
|
|
2717
2720
|
};
|
|
2718
2721
|
const persistedState = await loadRepoState(repo.name);
|
|
2719
2722
|
const persistedBranch = persistedState?.currentBranch;
|
|
2720
|
-
runGitCommand(["fetch", "--all", "--prune"], repo.path);
|
|
2723
|
+
runGitCommand(["fetch", "--all", "--prune", `--filter=${GIT_PARTIAL_CLONE_FILTER}`], repo.path);
|
|
2721
2724
|
if (persistedBranch && branchExists(persistedBranch, repo.path)) {
|
|
2722
2725
|
const currentBranch = getCurrentBranch(repo.path);
|
|
2723
2726
|
if (currentBranch !== persistedBranch) {
|
|
@@ -6276,6 +6279,65 @@ function dispatchAspNotification(notification, handlers) {
|
|
|
6276
6279
|
handler(notification);
|
|
6277
6280
|
}
|
|
6278
6281
|
|
|
6282
|
+
// src/managers/codex-asp/transcript-update-coalescer.ts
|
|
6283
|
+
var TRANSCRIPT_UPDATE_COALESCE_MS = 1e3;
|
|
6284
|
+
var TranscriptUpdateCoalescer = class {
|
|
6285
|
+
constructor(flush, intervalMs = TRANSCRIPT_UPDATE_COALESCE_MS) {
|
|
6286
|
+
this.flush = flush;
|
|
6287
|
+
this.intervalMs = intervalMs;
|
|
6288
|
+
}
|
|
6289
|
+
flush;
|
|
6290
|
+
intervalMs;
|
|
6291
|
+
timer = null;
|
|
6292
|
+
pendingThreadId = null;
|
|
6293
|
+
lastFlushAt = 0;
|
|
6294
|
+
schedule(threadId, options = {}) {
|
|
6295
|
+
this.pendingThreadId = threadId;
|
|
6296
|
+
if (options.immediate) {
|
|
6297
|
+
this.flushNow(threadId);
|
|
6298
|
+
return;
|
|
6299
|
+
}
|
|
6300
|
+
const now = Date.now();
|
|
6301
|
+
const elapsed = now - this.lastFlushAt;
|
|
6302
|
+
if (elapsed >= this.intervalMs) {
|
|
6303
|
+
this.flushNow(threadId);
|
|
6304
|
+
return;
|
|
6305
|
+
}
|
|
6306
|
+
if (this.timer) {
|
|
6307
|
+
return;
|
|
6308
|
+
}
|
|
6309
|
+
this.timer = setTimeout(() => {
|
|
6310
|
+
const pendingThreadId = this.pendingThreadId;
|
|
6311
|
+
if (pendingThreadId) {
|
|
6312
|
+
this.flushNow(pendingThreadId);
|
|
6313
|
+
}
|
|
6314
|
+
}, this.intervalMs - elapsed);
|
|
6315
|
+
}
|
|
6316
|
+
flushPending() {
|
|
6317
|
+
const pendingThreadId = this.pendingThreadId;
|
|
6318
|
+
if (pendingThreadId) {
|
|
6319
|
+
this.flushNow(pendingThreadId);
|
|
6320
|
+
return;
|
|
6321
|
+
}
|
|
6322
|
+
this.clearTimer();
|
|
6323
|
+
}
|
|
6324
|
+
dispose() {
|
|
6325
|
+
this.pendingThreadId = null;
|
|
6326
|
+
this.clearTimer();
|
|
6327
|
+
}
|
|
6328
|
+
flushNow(threadId) {
|
|
6329
|
+
this.clearTimer();
|
|
6330
|
+
this.pendingThreadId = null;
|
|
6331
|
+
this.lastFlushAt = Date.now();
|
|
6332
|
+
this.flush(threadId);
|
|
6333
|
+
}
|
|
6334
|
+
clearTimer() {
|
|
6335
|
+
if (!this.timer) return;
|
|
6336
|
+
clearTimeout(this.timer);
|
|
6337
|
+
this.timer = null;
|
|
6338
|
+
}
|
|
6339
|
+
};
|
|
6340
|
+
|
|
6279
6341
|
// src/managers/codex-asp/codex-asp-manager.ts
|
|
6280
6342
|
var CodexAspManager = class extends CodingAgentManager {
|
|
6281
6343
|
currentThreadId = null;
|
|
@@ -6286,6 +6348,9 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6286
6348
|
codexAspSequence = 0;
|
|
6287
6349
|
quotaStatus = new CodexQuotaStatusTracker();
|
|
6288
6350
|
currentGoal = null;
|
|
6351
|
+
transcriptUpdateCoalescer = new TranscriptUpdateCoalescer((threadId) => {
|
|
6352
|
+
this.flushTranscriptUpdated(threadId);
|
|
6353
|
+
});
|
|
6289
6354
|
constructor(options) {
|
|
6290
6355
|
super(options);
|
|
6291
6356
|
this.initializeManager(this.processMessageInternal.bind(this));
|
|
@@ -6412,6 +6477,8 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6412
6477
|
}
|
|
6413
6478
|
throw error;
|
|
6414
6479
|
} finally {
|
|
6480
|
+
this.transcriptUpdateCoalescer.flushPending();
|
|
6481
|
+
this.transcriptUpdateCoalescer.dispose();
|
|
6415
6482
|
this.activeTurnId = null;
|
|
6416
6483
|
await this.onTurnComplete();
|
|
6417
6484
|
}
|
|
@@ -6549,7 +6616,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6549
6616
|
observedTurnId = notification.params.turn.id;
|
|
6550
6617
|
this.activeTurnId = notification.params.turn.id;
|
|
6551
6618
|
this.mergeTranscriptTurn(notification.params.threadId, notification.params.turn);
|
|
6552
|
-
this.emitTranscriptUpdated(notification.params.threadId);
|
|
6619
|
+
this.emitTranscriptUpdated(notification.params.threadId, { immediate: true });
|
|
6553
6620
|
linearForwarder.sendEvent(convertCodexAspNotification(notification, linearSessionId ?? ""));
|
|
6554
6621
|
},
|
|
6555
6622
|
[TURN_PLAN_UPDATED_METHOD]: (notification) => {
|
|
@@ -6570,7 +6637,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6570
6637
|
"in_progress",
|
|
6571
6638
|
"started"
|
|
6572
6639
|
);
|
|
6573
|
-
this.emitTranscriptUpdated(notification.params.threadId);
|
|
6640
|
+
this.emitTranscriptUpdated(notification.params.threadId, { immediate: true });
|
|
6574
6641
|
linearForwarder.sendEvent(convertCodexAspNotification(notification, linearSessionId ?? ""));
|
|
6575
6642
|
},
|
|
6576
6643
|
[ITEM_COMPLETED_METHOD]: (notification) => {
|
|
@@ -6588,7 +6655,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6588
6655
|
itemFailed ? "failed" : "completed",
|
|
6589
6656
|
"completed"
|
|
6590
6657
|
);
|
|
6591
|
-
this.emitTranscriptUpdated(notification.params.threadId);
|
|
6658
|
+
this.emitTranscriptUpdated(notification.params.threadId, { immediate: true });
|
|
6592
6659
|
linearForwarder.sendEvent(convertCodexAspNotification(notification, linearSessionId ?? ""));
|
|
6593
6660
|
},
|
|
6594
6661
|
[AGENT_MESSAGE_DELTA_METHOD]: (notification) => {
|
|
@@ -6638,7 +6705,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6638
6705
|
}
|
|
6639
6706
|
const completedTurn = items.length > 0 ? { ...turn, items, itemsView: "full" } : turn;
|
|
6640
6707
|
this.mergeTranscriptTurn(notification.params.threadId, completedTurn);
|
|
6641
|
-
this.emitTranscriptUpdated(notification.params.threadId);
|
|
6708
|
+
this.emitTranscriptUpdated(notification.params.threadId, { immediate: true });
|
|
6642
6709
|
resolveCompleted(completedTurn);
|
|
6643
6710
|
}
|
|
6644
6711
|
};
|
|
@@ -6674,6 +6741,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6674
6741
|
host.client.off("notification", onNotification);
|
|
6675
6742
|
host.client.off("serverRequest", onServerRequest);
|
|
6676
6743
|
host.client.off("dispose", onDispose);
|
|
6744
|
+
this.transcriptUpdateCoalescer.flushPending();
|
|
6677
6745
|
await removeTempImageFiles(tempImagePaths);
|
|
6678
6746
|
if (host.client.isDisposed) {
|
|
6679
6747
|
this.threadAttached = false;
|
|
@@ -6924,7 +6992,10 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
6924
6992
|
this.historyEvents.push(event);
|
|
6925
6993
|
return event;
|
|
6926
6994
|
}
|
|
6927
|
-
emitTranscriptUpdated(threadId) {
|
|
6995
|
+
emitTranscriptUpdated(threadId, options = {}) {
|
|
6996
|
+
this.transcriptUpdateCoalescer.schedule(threadId, options);
|
|
6997
|
+
}
|
|
6998
|
+
flushTranscriptUpdated(threadId) {
|
|
6928
6999
|
const updatedAt = this.codexAspTranscript?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
6929
7000
|
const transcript = this.codexAspTranscript ? structuredClone(this.codexAspTranscript) : null;
|
|
6930
7001
|
const updatePayload = {
|