replicas-engine 0.1.570 → 0.1.572
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 +22 -19
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -989,7 +989,7 @@ function getGoalCommandObjectiveValidationError(message, goalMode) {
|
|
|
989
989
|
|
|
990
990
|
// ../shared/src/default-skills/replicas-agent/abilities/computer.ts
|
|
991
991
|
var SECTION = `### Computer use (Linux desktop control)
|
|
992
|
-
Drive the workspace's Linux desktop - open a browser, click, type, scroll, screenshot, record - via the \`replicas computer\` CLI. Every Replicas workspace boots with
|
|
992
|
+
Drive the workspace's Linux desktop - open a browser, click, type, scroll, screenshot, record - via the \`replicas computer\` CLI. Every Replicas workspace boots with a live H.264 and Opus stream published as an authenticated preview, so a \`Desktop\` tab is always available in the dashboard. Use \`replicas computer info\` to get the viewer URL when you want to share it (e.g. point a user on Slack at the live stream).
|
|
993
993
|
|
|
994
994
|
**Reference:** \`references/COMPUTER-USE.md\`
|
|
995
995
|
|
|
@@ -1000,7 +1000,7 @@ Use this when:
|
|
|
1000
1000
|
- You want to record a screen capture of a task as proof to share back`;
|
|
1001
1001
|
var REFERENCE = `# Computer use (Linux desktop control)
|
|
1002
1002
|
|
|
1003
|
-
Every Replicas workspace boots with a full Linux desktop stack - Xvfb (1920\xD71080), openbox, tint2,
|
|
1003
|
+
Every Replicas workspace boots with a full Linux desktop stack - Xvfb (1920\xD71080), openbox, tint2, PulseAudio, ffmpeg, and Google Chrome. The engine auto-registers the H.264 and Opus viewer (port 6080) as an authenticated preview at startup, so the dashboard \`Desktop\` tab is live the moment the workspace is up. You drive the desktop through the \`replicas computer\` CLI.
|
|
1004
1004
|
|
|
1005
1005
|
Use this for anything the user can't reasonably do via an API - clicking around web apps, filling forms, testing UI changes, dragging files between desktop apps, recording a walkthrough.
|
|
1006
1006
|
|
|
@@ -1052,7 +1052,7 @@ replicas media upload /tmp/demo.mp4 --name "Demo recording"
|
|
|
1052
1052
|
## Command reference
|
|
1053
1053
|
|
|
1054
1054
|
### \`replicas computer info\`
|
|
1055
|
-
Prints the live
|
|
1055
|
+
Prints the live desktop viewer URL (\`https://6080-<hash>.tryreplicas.com/\`). The engine auto-registers this authenticated preview on startup; \`info\` just looks it up. Use it when you want to share the live stream URL with the user out-of-band (e.g. in a Slack reply) - the dashboard \`Desktop\` tab already points at the same URL automatically.
|
|
1056
1056
|
|
|
1057
1057
|
If invoked very early in the workspace lifecycle, \`info\` will poll briefly while the engine finishes registering the preview, then error if it's still not available.
|
|
1058
1058
|
|
|
@@ -1198,18 +1198,18 @@ Then embed the printed \`\` line in your chat reply. See \`MEDI
|
|
|
1198
1198
|
|
|
1199
1199
|
| Component | Where |
|
|
1200
1200
|
|---|---|
|
|
1201
|
-
| \`xvfb\`, \`openbox\`, \`tint2\`, \`
|
|
1201
|
+
| \`xvfb\`, \`openbox\`, \`tint2\`, \`pulseaudio\`, \`xautomation\`, \`xdotool\`, \`scrot\`, \`ffmpeg\`, \`google-chrome\` | Baked into the workspace image |
|
|
1202
1202
|
| \`replicas-computer\`, desktop assets, and service unit | Installed by \`replicas-computer setup\` during the image build |
|
|
1203
|
-
| Xvfb / openbox / tint2 /
|
|
1204
|
-
|
|
|
1203
|
+
| Xvfb / openbox / tint2 / PulseAudio / stream processes | Managed by \`replicas-computer.service\` |
|
|
1204
|
+
| Desktop stream URL (port 6080) | Registered by the engine on startup (authenticated) |
|
|
1205
1205
|
| Dashboard \`Desktop\` tab | Always available once the engine has registered the preview |
|
|
1206
1206
|
|
|
1207
1207
|
You can call any of the input tools (\`click\`, \`type\`, \`screenshot\`, etc.) immediately - the daemons are already running.
|
|
1208
1208
|
`;
|
|
1209
1209
|
var COMPUTER_ABILITY = {
|
|
1210
1210
|
label: "Computer use",
|
|
1211
|
-
description: "Drive the workspace's Linux desktop and stream a live
|
|
1212
|
-
bullet: "- Driving the workspace Linux desktop (open a browser, click, type, scroll, screenshot, record) and exposing a live
|
|
1211
|
+
description: "Drive the workspace's Linux desktop and stream a live H.264 and Opus viewer.",
|
|
1212
|
+
bullet: "- Driving the workspace Linux desktop (open a browser, click, type, scroll, screenshot, record) and exposing a live audio and video stream in the dashboard",
|
|
1213
1213
|
section: SECTION,
|
|
1214
1214
|
referenceFile: { name: "COMPUTER-USE.md", content: REFERENCE }
|
|
1215
1215
|
};
|
|
@@ -3078,7 +3078,7 @@ function hasChatStarted(chat) {
|
|
|
3078
3078
|
}
|
|
3079
3079
|
|
|
3080
3080
|
// ../shared/src/engine/environment.ts
|
|
3081
|
-
var
|
|
3081
|
+
var DESKTOP_STREAM_PORT = 6080;
|
|
3082
3082
|
|
|
3083
3083
|
// ../shared/src/engine/v1.ts
|
|
3084
3084
|
import { z } from "zod";
|
|
@@ -5139,7 +5139,7 @@ function messageForItem(item) {
|
|
|
5139
5139
|
};
|
|
5140
5140
|
}
|
|
5141
5141
|
if (item.type === "reasoning") {
|
|
5142
|
-
if (!item.text
|
|
5142
|
+
if (!item.text) return null;
|
|
5143
5143
|
return {
|
|
5144
5144
|
id: `reasoning-${item.id}`,
|
|
5145
5145
|
type: "reasoning",
|
|
@@ -7927,12 +7927,12 @@ var ATTEMPT_TIMEOUT_MS = 8e3;
|
|
|
7927
7927
|
async function attemptRegistration() {
|
|
7928
7928
|
try {
|
|
7929
7929
|
const response = await monolithRequest("/v1/previews", {
|
|
7930
|
-
body: { port:
|
|
7930
|
+
body: { port: DESKTOP_STREAM_PORT, authenticated: true },
|
|
7931
7931
|
signal: AbortSignal.timeout(ATTEMPT_TIMEOUT_MS)
|
|
7932
7932
|
});
|
|
7933
7933
|
if (response.ok || response.status === 409) {
|
|
7934
7934
|
console.log(
|
|
7935
|
-
`[DesktopPreview] Registered port ${
|
|
7935
|
+
`[DesktopPreview] Registered port ${DESKTOP_STREAM_PORT} (status ${response.status}).`
|
|
7936
7936
|
);
|
|
7937
7937
|
return true;
|
|
7938
7938
|
}
|
|
@@ -7959,7 +7959,7 @@ async function registerDesktopPreview() {
|
|
|
7959
7959
|
await new Promise((resolve4) => setTimeout(resolve4, RETRY_DELAY_MS));
|
|
7960
7960
|
}
|
|
7961
7961
|
console.error(
|
|
7962
|
-
`[DesktopPreview] Gave up registering port ${
|
|
7962
|
+
`[DesktopPreview] Gave up registering port ${DESKTOP_STREAM_PORT} after ${REGISTRATION_TIMEOUT_MS}ms`
|
|
7963
7963
|
);
|
|
7964
7964
|
}
|
|
7965
7965
|
|
|
@@ -10780,7 +10780,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
|
10780
10780
|
var MIN_CODEX_CLI_VERSION = "0.144.6";
|
|
10781
10781
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
10782
10782
|
var codexCliVersionEnsured = null;
|
|
10783
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
10783
|
+
var ENGINE_PACKAGE_VERSION = "0.1.572";
|
|
10784
10784
|
var INITIALIZE_METHOD = "initialize";
|
|
10785
10785
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
10786
10786
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -16554,16 +16554,18 @@ var ChatService = class {
|
|
|
16554
16554
|
chat.hasActiveTurn = false;
|
|
16555
16555
|
chat.activeMessageId = null;
|
|
16556
16556
|
this.analyticsService.noteTurnEnded(chatId);
|
|
16557
|
+
const completedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
16557
16558
|
this.publish({
|
|
16558
16559
|
type: "chat.turn.completed",
|
|
16559
16560
|
payload: {
|
|
16560
16561
|
chatId,
|
|
16561
16562
|
isComplete: true,
|
|
16562
|
-
processing: chat.provider.hasActiveBackgroundTasks?.() ?? false
|
|
16563
|
+
processing: chat.provider.hasActiveBackgroundTasks?.() ?? false,
|
|
16564
|
+
completedAt
|
|
16563
16565
|
}
|
|
16564
16566
|
}).catch(() => {
|
|
16565
16567
|
});
|
|
16566
|
-
monolithService.sendEvent({ type: "agent_response_complete", payload: {} }).catch(() => {
|
|
16568
|
+
monolithService.sendEvent({ type: "agent_response_complete", payload: { completedAt } }).catch(() => {
|
|
16567
16569
|
});
|
|
16568
16570
|
uploadChatTranscript(
|
|
16569
16571
|
chatId,
|
|
@@ -16575,7 +16577,7 @@ var ChatService = class {
|
|
|
16575
16577
|
flushAllCanvasItems().catch((err) => {
|
|
16576
16578
|
console.error("[ChatService] Failed to upload canvas items:", { chatId, err });
|
|
16577
16579
|
});
|
|
16578
|
-
await this.publishAgentTurnCompleteWebhook(chat);
|
|
16580
|
+
await this.publishAgentTurnCompleteWebhook(chat, completedAt);
|
|
16579
16581
|
}
|
|
16580
16582
|
getRuntimeChat(chatId) {
|
|
16581
16583
|
const chat = this.chats.get(chatId) ?? null;
|
|
@@ -16657,7 +16659,7 @@ var ChatService = class {
|
|
|
16657
16659
|
} catch {
|
|
16658
16660
|
}
|
|
16659
16661
|
}
|
|
16660
|
-
async publishAgentTurnCompleteWebhook(chat) {
|
|
16662
|
+
async publishAgentTurnCompleteWebhook(chat, completedAt) {
|
|
16661
16663
|
await Promise.all([
|
|
16662
16664
|
githubTokenManager.refreshOnce().catch(() => {
|
|
16663
16665
|
}),
|
|
@@ -16689,6 +16691,7 @@ var ChatService = class {
|
|
|
16689
16691
|
try {
|
|
16690
16692
|
const payload = {
|
|
16691
16693
|
...linearSessionId ? { linearSessionId } : {},
|
|
16694
|
+
...completedAt ? { completedAt } : {},
|
|
16692
16695
|
repoStatuses,
|
|
16693
16696
|
...errors?.length ? { errors } : {},
|
|
16694
16697
|
...errors?.length && errorNotificationTarget ? { errorNotificationTarget } : {}
|
|
@@ -18524,7 +18527,7 @@ async function checkActiveSSHSessions() {
|
|
|
18524
18527
|
}
|
|
18525
18528
|
function checkDesktopReady() {
|
|
18526
18529
|
return new Promise((resolve4) => {
|
|
18527
|
-
const socket = connect({ host: "127.0.0.1", port:
|
|
18530
|
+
const socket = connect({ host: "127.0.0.1", port: DESKTOP_STREAM_PORT });
|
|
18528
18531
|
const done = (ready) => {
|
|
18529
18532
|
socket.destroy();
|
|
18530
18533
|
resolve4(ready);
|