litepaseo 0.5.7 → 0.6.1
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/CHANGELOG.md +13 -0
- package/README.md +29 -0
- package/dist/server/cli.mjs +2 -2
- package/dist/server/{worker-B6Y-QiWf.mjs → worker-CVzQyHuc.mjs} +311 -10
- package/dist/web/assets/{ChangesPanel-DaDOM3_s.js → ChangesPanel-CLaeJXXw.js} +1 -1
- package/dist/web/assets/ChangesPanel-CLaeJXXw.js.br +0 -0
- package/dist/web/assets/ChangesPanel-CLaeJXXw.js.gz +0 -0
- package/dist/web/assets/{CodeBlockNode-Bmjhlqyp.js → CodeBlockNode-XaHrqBvK.js} +1 -1
- package/dist/web/assets/CodeBlockNode-XaHrqBvK.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-XaHrqBvK.js.gz +0 -0
- package/dist/web/assets/{ConversationSearch-DJ4QYtmj.js → ConversationSearch-ftx4GXv9.js} +1 -1
- package/dist/web/assets/ConversationSearch-ftx4GXv9.js.br +0 -0
- package/dist/web/assets/ConversationSearch-ftx4GXv9.js.gz +0 -0
- package/dist/web/assets/{FileViewer-Y2aEO2j0.js → FileViewer-5kwZorzK.js} +2 -2
- package/dist/web/assets/FileViewer-5kwZorzK.js.br +0 -0
- package/dist/web/assets/FileViewer-5kwZorzK.js.gz +0 -0
- package/dist/web/assets/{FilesPanel-B3AsUqg-.js → FilesPanel-B8dM9wUZ.js} +1 -1
- package/dist/web/assets/FilesPanel-B8dM9wUZ.js.br +8 -0
- package/dist/web/assets/FilesPanel-B8dM9wUZ.js.gz +0 -0
- package/dist/web/assets/HostSettings-Buiqtp3W.css +1 -0
- package/dist/web/assets/HostSettings-CM5zbQ-Z.js +5 -0
- package/dist/web/assets/HostSettings-CM5zbQ-Z.js.br +0 -0
- package/dist/web/assets/HostSettings-CM5zbQ-Z.js.gz +0 -0
- package/dist/web/assets/{MarkdownMessage-C0gh8J4b.js → MarkdownMessage-8rgYH5TV.js} +5 -5
- package/dist/web/assets/MarkdownMessage-8rgYH5TV.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-8rgYH5TV.js.gz +0 -0
- package/dist/web/assets/{PreCodeBlock-CesCzFkx.js → PreCodeBlock-D5UN7dQA.js} +1 -1
- package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-Ba1fLkSl.js → PreCodeBlock.vue_vue_type_style_index_0_lang-C5J4PTcm.js} +1 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-C5J4PTcm.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-C5J4PTcm.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-BvvKX0GR.js +3 -0
- package/dist/web/assets/TerminalPanel-BvvKX0GR.js.br +0 -0
- package/dist/web/assets/TerminalPanel-BvvKX0GR.js.gz +0 -0
- package/dist/web/assets/{TerminalPanel-mJ-uVP4H.css → TerminalPanel-BzfVCEVB.css} +1 -1
- package/dist/web/assets/TerminalPanel-BzfVCEVB.css.br +0 -0
- package/dist/web/assets/TerminalPanel-BzfVCEVB.css.gz +0 -0
- package/dist/web/assets/{Tooltip-DIikMJ22.js → Tooltip-CH6B-8OL.js} +1 -1
- package/dist/web/assets/Tooltip-CH6B-8OL.js.br +0 -0
- package/dist/web/assets/Tooltip-CH6B-8OL.js.gz +0 -0
- package/dist/web/assets/index-C1LEv69l.js +34 -0
- package/dist/web/assets/index-C1LEv69l.js.br +0 -0
- package/dist/web/assets/index-C1LEv69l.js.gz +0 -0
- package/dist/web/assets/index-CHx1Vepn.css +1 -0
- package/dist/web/assets/index-CHx1Vepn.css.br +0 -0
- package/dist/web/assets/index-CHx1Vepn.css.gz +0 -0
- package/dist/web/assets/{index10-hj-Sgk5x.js → index10-BKIBVN5Z.js} +1 -1
- package/dist/web/assets/index10-BKIBVN5Z.js.br +0 -0
- package/dist/web/assets/index10-BKIBVN5Z.js.gz +0 -0
- package/dist/web/assets/index3-cddVwm0b.js +1 -0
- package/dist/web/assets/index4-DvLS0hKE.js +1 -0
- package/dist/web/assets/{index5-CRAboP2A.js → index5-GzgYlIYX.js} +1 -1
- package/dist/web/assets/index5-GzgYlIYX.js.br +0 -0
- package/dist/web/assets/index5-GzgYlIYX.js.gz +0 -0
- package/dist/web/assets/{index6-BGPr-HYL.js → index6-Bg_likgg.js} +1 -1
- package/dist/web/assets/index6-Bg_likgg.js.br +0 -0
- package/dist/web/assets/index6-Bg_likgg.js.gz +0 -0
- package/dist/web/assets/{index7-BQWh7QGD.js → index7-R2quNxga.js} +1 -1
- package/dist/web/assets/index7-R2quNxga.js.br +0 -0
- package/dist/web/assets/index7-R2quNxga.js.gz +0 -0
- package/dist/web/assets/{index8-CWx2tKWF.js → index8-DpYGQbb_.js} +1 -1
- package/dist/web/assets/index8-DpYGQbb_.js.br +0 -0
- package/dist/web/assets/index8-DpYGQbb_.js.gz +0 -0
- package/dist/web/assets/{index9-CCEfqnDZ.js → index9-fVOIt8g8.js} +1 -1
- package/dist/web/assets/index9-fVOIt8g8.js.br +0 -0
- package/dist/web/assets/index9-fVOIt8g8.js.gz +0 -0
- package/dist/web/index.html +2 -2
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/package.json +1 -1
- package/dist/web/assets/ChangesPanel-DaDOM3_s.js.br +0 -0
- package/dist/web/assets/ChangesPanel-DaDOM3_s.js.gz +0 -0
- package/dist/web/assets/CodeBlockNode-Bmjhlqyp.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-Bmjhlqyp.js.gz +0 -0
- package/dist/web/assets/ConversationSearch-DJ4QYtmj.js.br +0 -0
- package/dist/web/assets/ConversationSearch-DJ4QYtmj.js.gz +0 -0
- package/dist/web/assets/FileViewer-Y2aEO2j0.js.br +0 -0
- package/dist/web/assets/FileViewer-Y2aEO2j0.js.gz +0 -0
- package/dist/web/assets/FilesPanel-B3AsUqg-.js.br +0 -0
- package/dist/web/assets/FilesPanel-B3AsUqg-.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-C0gh8J4b.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-C0gh8J4b.js.gz +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Ba1fLkSl.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Ba1fLkSl.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-axky8Jof.js +0 -3
- package/dist/web/assets/TerminalPanel-axky8Jof.js.br +0 -0
- package/dist/web/assets/TerminalPanel-axky8Jof.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-mJ-uVP4H.css.br +0 -0
- package/dist/web/assets/TerminalPanel-mJ-uVP4H.css.gz +0 -0
- package/dist/web/assets/Tooltip-DIikMJ22.js.br +0 -0
- package/dist/web/assets/Tooltip-DIikMJ22.js.gz +0 -0
- package/dist/web/assets/index-DnEgEfgK.js +0 -34
- package/dist/web/assets/index-DnEgEfgK.js.br +0 -0
- package/dist/web/assets/index-DnEgEfgK.js.gz +0 -0
- package/dist/web/assets/index-DvGie7O5.css +0 -1
- package/dist/web/assets/index-DvGie7O5.css.br +0 -0
- package/dist/web/assets/index-DvGie7O5.css.gz +0 -0
- package/dist/web/assets/index10-hj-Sgk5x.js.br +0 -0
- package/dist/web/assets/index10-hj-Sgk5x.js.gz +0 -0
- package/dist/web/assets/index3-B4Gwg_e0.js +0 -1
- package/dist/web/assets/index4-DkjtR4yv.js +0 -1
- package/dist/web/assets/index5-CRAboP2A.js.br +0 -0
- package/dist/web/assets/index5-CRAboP2A.js.gz +0 -0
- package/dist/web/assets/index6-BGPr-HYL.js.br +0 -0
- package/dist/web/assets/index6-BGPr-HYL.js.gz +0 -0
- package/dist/web/assets/index7-BQWh7QGD.js.br +0 -0
- package/dist/web/assets/index7-BQWh7QGD.js.gz +0 -0
- package/dist/web/assets/index8-CWx2tKWF.js.br +0 -0
- package/dist/web/assets/index8-CWx2tKWF.js.gz +0 -0
- package/dist/web/assets/index9-CCEfqnDZ.js.br +0 -0
- package/dist/web/assets/index9-CCEfqnDZ.js.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
- Make message image previews scrollable so square and tall images remain fully accessible on desktop and mobile; keep a visible close button and support keyboard scrolling.
|
|
6
|
+
|
|
7
|
+
## 0.6.0
|
|
8
|
+
|
|
9
|
+
- Set an instance name in Web Settings; show it in browser tabs, the sidebar and sign-in, and synchronize it across connected clients.
|
|
10
|
+
- Add per-host settings for agent instructions, orchestration/browser tools, idle cleanup, restart recovery, workspaces, usage and relay, with capability checks, conflict detection and save verification.
|
|
11
|
+
- Manage agent and terminal profiles, and select them when creating sessions and terminals. Configure providers, additional models and metadata generation priorities.
|
|
12
|
+
- Manage Paseo skill selection and installed host plugins, including trusted source installation. Keep LitePaseo voice input and notifications independent.
|
|
13
|
+
- Show remote daemon versions and status; request remote updates and restarts, track progress across navigation, and verify the replacement worker and installed version before reporting success. Respect Desktop-managed and unsupported installations.
|
|
14
|
+
- Increase phone conversation text to 16px and improve form and supporting-text sizes without changing desktop typography.
|
|
15
|
+
|
|
3
16
|
## 0.5.7
|
|
4
17
|
|
|
5
18
|
- Default to Steer for supported providers and Queue otherwise; keep composer controls contained at narrow widths and increased zoom.
|
package/README.md
CHANGED
|
@@ -140,6 +140,35 @@ Both take effect immediately and sign out every browser. A token sent as
|
|
|
140
140
|
`Authorization: Bearer` (for scripts) is accepted only on direct connections, never
|
|
141
141
|
through a tunnel or proxy, and only while authenticator sign-in is off.
|
|
142
142
|
|
|
143
|
+
### Instance name
|
|
144
|
+
|
|
145
|
+
Set **Settings → Instance → Instance name** to distinguish multiple LitePaseo
|
|
146
|
+
servers. The name appears in browser tabs, the sidebar and the sign-in screen,
|
|
147
|
+
and is saved on this instance for every device. Connected pages update immediately.
|
|
148
|
+
Clear the name to restore **LitePaseo**.
|
|
149
|
+
|
|
150
|
+
### Host settings
|
|
151
|
+
|
|
152
|
+
Open **Hosts → Settings** beside a connected host to configure its agents,
|
|
153
|
+
providers, profiles, metadata generation, terminals, skills and plugins. These
|
|
154
|
+
settings are saved on that Paseo host and affect its other clients too. Save
|
|
155
|
+
changes explicitly; reload if another client has changed the configuration.
|
|
156
|
+
Agent profiles can be applied in **New session**, and terminal profiles are
|
|
157
|
+
available beside the new-terminal button.
|
|
158
|
+
|
|
159
|
+
The same page shows the daemon version and full status. **Update & restart**
|
|
160
|
+
is available when the daemon supports self-update; Desktop-managed daemons
|
|
161
|
+
must be updated through Paseo Desktop. Remote lifecycle operations continue
|
|
162
|
+
on the LitePaseo server if you leave the page. Reopen the settings page to
|
|
163
|
+
check progress. Completion requires a replacement daemon; updates also verify
|
|
164
|
+
its running version. Operation tracking is in memory: after a LitePaseo server
|
|
165
|
+
restart, check the host version/status before retrying an uncertain operation.
|
|
166
|
+
|
|
167
|
+
Voice input and notifications keep their existing LitePaseo settings. Provider
|
|
168
|
+
credentials and arbitrary runtime environment overrides remain managed on the
|
|
169
|
+
host; this form does not expose them. Plugin-specific custom settings screens
|
|
170
|
+
and reviewed plugin-source updates remain available in the official client.
|
|
171
|
+
|
|
143
172
|
### Voice input
|
|
144
173
|
|
|
145
174
|
Voice input is off until you add a transcription service in **Settings → Voice input**: a
|
package/dist/server/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { DatabaseSync } from "node:sqlite";
|
|
|
8
8
|
import { homedir } from "node:os";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
// src/server/version.ts
|
|
11
|
-
const VERSION = "0.
|
|
11
|
+
const VERSION = "0.6.1";
|
|
12
12
|
// src/server/rotating-log.ts
|
|
13
13
|
/** One writer (the supervisor); bounded active file plus numbered archives. */
|
|
14
14
|
var RotatingLog = class {
|
|
@@ -1715,7 +1715,7 @@ async function run() {
|
|
|
1715
1715
|
if (name === "--help" || name === "-h") return console.log(mainHelp(VERSION, displayDirectory(), out));
|
|
1716
1716
|
if (name === "worker") {
|
|
1717
1717
|
const paths = await dataDirectory();
|
|
1718
|
-
const { runWorker } = await import("./worker-
|
|
1718
|
+
const { runWorker } = await import("./worker-CVzQyHuc.mjs");
|
|
1719
1719
|
return runWorker(paths.directory, fileURLToPath(new URL("../web/", import.meta.url)));
|
|
1720
1720
|
}
|
|
1721
1721
|
const command = findCommand(name);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as tokenFile, i as generateToken, n as Auth, o as Store, r as SESSION_TTL_MS, s as VERSION, t as effectiveConfig } from "./cli.mjs";
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { basename, dirname, isAbsolute, join, normalize } from "node:path";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { serve } from "@hono/node-server";
|
|
@@ -9,13 +9,13 @@ import { createPaseoApi } from "@getpaseo/client";
|
|
|
9
9
|
import { deriveAgentStateBucket } from "@getpaseo/protocol/agent-state-bucket";
|
|
10
10
|
import { timelineItemIdentity } from "@getpaseo/protocol/timeline-identity";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
+
import { AgentPermissionResponseSchema, AgentSkillSelectionSchema, MutableDaemonConfigPatchSchema } from "@getpaseo/protocol/messages";
|
|
12
13
|
import { lstat, readFile, realpath } from "node:fs/promises";
|
|
13
14
|
import { Hono } from "hono";
|
|
14
15
|
import { bodyLimit } from "hono/body-limit";
|
|
15
16
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
16
17
|
import { deleteCookie, getCookie, setCookie } from "hono/cookie";
|
|
17
18
|
import QRCode from "qrcode";
|
|
18
|
-
import { AgentPermissionResponseSchema } from "@getpaseo/protocol/messages";
|
|
19
19
|
import webpush from "web-push";
|
|
20
20
|
import WebSocket, { WebSocketServer } from "ws";
|
|
21
21
|
// src/server/diagnostics.ts
|
|
@@ -1184,6 +1184,277 @@ var Hosts = class {
|
|
|
1184
1184
|
for (const listener of listeners) listener();
|
|
1185
1185
|
}
|
|
1186
1186
|
};
|
|
1187
|
+
// src/server/host-lifecycle.ts
|
|
1188
|
+
function replacementReady(previous, current, expected) {
|
|
1189
|
+
if (current.serverId !== previous.serverId) throw new Error("Daemon identity changed; verify the host connection.");
|
|
1190
|
+
if (current.pid === previous.pid && (!previous.startedAt || !current.startedAt || previous.startedAt === current.startedAt)) return false;
|
|
1191
|
+
if (expected && current.version !== expected) throw new Error(`Installed ${expected}, but the running daemon reports ${current.version ?? "unknown"}.`);
|
|
1192
|
+
return true;
|
|
1193
|
+
}
|
|
1194
|
+
const reconnectFailure = (e) => [
|
|
1195
|
+
"DAEMON_CONNECTION_LOST",
|
|
1196
|
+
"DAEMON_REQUEST_TIMEOUT",
|
|
1197
|
+
"DAEMON_NOT_CONNECTED"
|
|
1198
|
+
].includes(String(e?.code));
|
|
1199
|
+
async function runLifecycle(hosts, host, job) {
|
|
1200
|
+
const driver = hosts.get(host).driver;
|
|
1201
|
+
let unsubscribe = () => {};
|
|
1202
|
+
try {
|
|
1203
|
+
const previous = await driver.getDaemonStatus();
|
|
1204
|
+
let expected;
|
|
1205
|
+
if (job.action === "update") {
|
|
1206
|
+
const requestId = randomUUID();
|
|
1207
|
+
unsubscribe = driver.on("daemon.update.progress", (event) => {
|
|
1208
|
+
if (event.payload.requestId === requestId) job.phase = event.payload.phase;
|
|
1209
|
+
});
|
|
1210
|
+
const result = await driver.updateDaemon(requestId);
|
|
1211
|
+
if (!result.success) throw new Error(result.error ?? "Package installation failed.");
|
|
1212
|
+
if (!result.newVersion) throw new Error("Package installation reported no version; verify the host before retrying.");
|
|
1213
|
+
expected = result.newVersion;
|
|
1214
|
+
} else try {
|
|
1215
|
+
await driver.restartServer("Requested from LitePaseo host settings");
|
|
1216
|
+
} catch (e) {
|
|
1217
|
+
if (!reconnectFailure(e)) throw e;
|
|
1218
|
+
}
|
|
1219
|
+
job.phase = "Waiting for the replacement daemon";
|
|
1220
|
+
const deadline = Date.now() + 6e5;
|
|
1221
|
+
while (Date.now() < deadline) {
|
|
1222
|
+
if (!hosts.clients.has(host)) throw new Error("Host removed while waiting for restart.");
|
|
1223
|
+
if (driver.getConnectionState().status === "connected") try {
|
|
1224
|
+
const status = await driver.getDaemonStatus();
|
|
1225
|
+
const current = {
|
|
1226
|
+
...status,
|
|
1227
|
+
version: status.version ?? driver.getLastServerInfoMessage()?.version
|
|
1228
|
+
};
|
|
1229
|
+
if (replacementReady(previous, current, expected)) {
|
|
1230
|
+
job.version = current.version ?? void 0;
|
|
1231
|
+
job.state = "complete";
|
|
1232
|
+
job.phase = "Replacement daemon verified";
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
} catch (e) {
|
|
1236
|
+
if (!reconnectFailure(e)) throw e;
|
|
1237
|
+
}
|
|
1238
|
+
await new Promise((resolve) => {
|
|
1239
|
+
setTimeout(resolve, 2e3).unref();
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
throw new Error("Replacement daemon could not be verified within ten minutes. Check host status and logs before retrying.");
|
|
1243
|
+
} catch (e) {
|
|
1244
|
+
job.state = "failed";
|
|
1245
|
+
job.error = e.message;
|
|
1246
|
+
job.phase = "Not confirmed";
|
|
1247
|
+
} finally {
|
|
1248
|
+
unsubscribe();
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
// src/server/host-settings.ts
|
|
1252
|
+
const SETTINGS_KEYS = [
|
|
1253
|
+
"mcp",
|
|
1254
|
+
"browserTools",
|
|
1255
|
+
"appendSystemPrompt",
|
|
1256
|
+
"idleRuntimeCleanup",
|
|
1257
|
+
"resumeOnStartup",
|
|
1258
|
+
"resumePrompt",
|
|
1259
|
+
"autoArchiveAfterMerge",
|
|
1260
|
+
"enableTerminalAgentHooks",
|
|
1261
|
+
"agentProfiles",
|
|
1262
|
+
"terminalProfiles",
|
|
1263
|
+
"metadataGeneration",
|
|
1264
|
+
"providers",
|
|
1265
|
+
"usage",
|
|
1266
|
+
"relay",
|
|
1267
|
+
"pluginsEnabled"
|
|
1268
|
+
];
|
|
1269
|
+
const providerKeys = [
|
|
1270
|
+
"enabled",
|
|
1271
|
+
"paseoTools",
|
|
1272
|
+
"additionalModels",
|
|
1273
|
+
"extends",
|
|
1274
|
+
"label",
|
|
1275
|
+
"command"
|
|
1276
|
+
];
|
|
1277
|
+
const gates = {
|
|
1278
|
+
relay: "relayConfig",
|
|
1279
|
+
pluginsEnabled: "plugins",
|
|
1280
|
+
agentProfiles: "agentProfiles",
|
|
1281
|
+
idleRuntimeCleanup: "idleRuntimeCleanupSetting",
|
|
1282
|
+
resumeOnStartup: "resumeOnStartupSetting",
|
|
1283
|
+
resumePrompt: "resumeOnStartupSetting"
|
|
1284
|
+
};
|
|
1285
|
+
function projectSettings(config) {
|
|
1286
|
+
const result = {};
|
|
1287
|
+
for (const key of SETTINGS_KEYS) if (config[key] !== void 0) result[key] = config[key];
|
|
1288
|
+
if (result.providers) result.providers = Object.fromEntries(Object.entries(result.providers).map(([id, value]) => {
|
|
1289
|
+
const p = value;
|
|
1290
|
+
return [id, Object.fromEntries(providerKeys.filter((k) => p[k] !== void 0).map((k) => [k, p[k]]))];
|
|
1291
|
+
}));
|
|
1292
|
+
return result;
|
|
1293
|
+
}
|
|
1294
|
+
function canonical(value) {
|
|
1295
|
+
if (Array.isArray(value)) return "[" + value.map(canonical).join(",") + "]";
|
|
1296
|
+
if (value && typeof value === "object") return "{" + Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => JSON.stringify(k) + ":" + canonical(v)).join(",") + "}";
|
|
1297
|
+
return JSON.stringify(value) ?? "null";
|
|
1298
|
+
}
|
|
1299
|
+
function retained(expected, actual) {
|
|
1300
|
+
if (!expected || typeof expected !== "object" || Array.isArray(expected)) return canonical(expected) === canonical(actual);
|
|
1301
|
+
return !!actual && typeof actual === "object" && Object.entries(expected).every(([k, v]) => retained(v, actual[k]));
|
|
1302
|
+
}
|
|
1303
|
+
const revision = (config) => createHash("sha256").update(canonical(config)).digest("hex");
|
|
1304
|
+
const patchSchema = MutableDaemonConfigPatchSchema.pick(Object.fromEntries(SETTINGS_KEYS.map((k) => [k, true]))).strict();
|
|
1305
|
+
function registerHostSettings(app, hosts) {
|
|
1306
|
+
const jobs = /* @__PURE__ */ new Map();
|
|
1307
|
+
const writers = /* @__PURE__ */ new Map();
|
|
1308
|
+
app.use("/api/hosts/:host/settings", async (c, next) => {
|
|
1309
|
+
if (c.req.method !== "PATCH") return next();
|
|
1310
|
+
const host = c.req.param("host"), previous = writers.get(host) ?? Promise.resolve();
|
|
1311
|
+
let release;
|
|
1312
|
+
const current = new Promise((resolve) => {
|
|
1313
|
+
release = resolve;
|
|
1314
|
+
});
|
|
1315
|
+
writers.set(host, current);
|
|
1316
|
+
await previous;
|
|
1317
|
+
try {
|
|
1318
|
+
await next();
|
|
1319
|
+
} finally {
|
|
1320
|
+
release();
|
|
1321
|
+
if (writers.get(host) === current) writers.delete(host);
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
1324
|
+
app.get("/api/hosts/:host/settings", async (c) => {
|
|
1325
|
+
const driver = hosts.get(c.req.param("host")).driver;
|
|
1326
|
+
const { config } = await driver.getDaemonConfig();
|
|
1327
|
+
const safe = projectSettings(config);
|
|
1328
|
+
const info = driver.getLastServerInfoMessage();
|
|
1329
|
+
return c.json({
|
|
1330
|
+
config: safe,
|
|
1331
|
+
revision: revision(safe),
|
|
1332
|
+
features: info?.features ?? {},
|
|
1333
|
+
version: info?.version ?? null,
|
|
1334
|
+
desktopManaged: info?.desktopManaged === true
|
|
1335
|
+
});
|
|
1336
|
+
});
|
|
1337
|
+
app.patch("/api/hosts/:host/settings", async (c) => {
|
|
1338
|
+
const body = z.object({
|
|
1339
|
+
revision: z.string(),
|
|
1340
|
+
patch: patchSchema
|
|
1341
|
+
}).strict().safeParse(await c.req.json());
|
|
1342
|
+
if (!body.success) return c.json({
|
|
1343
|
+
error: "Invalid host settings",
|
|
1344
|
+
issues: body.error.issues.map((i) => ({
|
|
1345
|
+
path: i.path.join("."),
|
|
1346
|
+
message: i.message
|
|
1347
|
+
}))
|
|
1348
|
+
}, 400);
|
|
1349
|
+
const driver = hosts.get(c.req.param("host")).driver;
|
|
1350
|
+
const features = driver.getLastServerInfoMessage()?.features;
|
|
1351
|
+
const { patch } = body.data;
|
|
1352
|
+
for (const key of Object.keys(patch)) if (gates[key] && features?.[gates[key]] !== true) return c.json({ error: `This host does not support ${key}` }, 409);
|
|
1353
|
+
if (patch.providers && Object.values(patch.providers).some((p) => Object.keys(p).some((k) => !providerKeys.includes(k)))) return c.json({ error: "Unsupported provider field" }, 400);
|
|
1354
|
+
const current = projectSettings((await driver.getDaemonConfig()).config);
|
|
1355
|
+
if (revision(current) !== body.data.revision) return c.json({ error: "Host settings changed elsewhere. Reload before saving." }, 409);
|
|
1356
|
+
if (patch.providers) {
|
|
1357
|
+
const publicProvider = z.object({
|
|
1358
|
+
enabled: z.boolean().optional(),
|
|
1359
|
+
label: z.string().trim().min(1).optional(),
|
|
1360
|
+
extends: z.enum([
|
|
1361
|
+
"claude",
|
|
1362
|
+
"codex",
|
|
1363
|
+
"copilot",
|
|
1364
|
+
"opencode",
|
|
1365
|
+
"pi",
|
|
1366
|
+
"omp",
|
|
1367
|
+
"acp"
|
|
1368
|
+
]).optional(),
|
|
1369
|
+
command: z.array(z.string().min(1)).min(1).optional(),
|
|
1370
|
+
paseoTools: z.object({
|
|
1371
|
+
enabled: z.boolean().optional(),
|
|
1372
|
+
disabledTools: z.array(z.string()).optional()
|
|
1373
|
+
}).strict().optional(),
|
|
1374
|
+
additionalModels: z.array(z.object({
|
|
1375
|
+
id: z.string().min(1),
|
|
1376
|
+
label: z.string().min(1),
|
|
1377
|
+
description: z.string().optional(),
|
|
1378
|
+
isDefault: z.boolean().optional(),
|
|
1379
|
+
thinkingOptions: z.array(z.unknown()).optional()
|
|
1380
|
+
}).passthrough()).optional()
|
|
1381
|
+
}).strict();
|
|
1382
|
+
if (!z.record(z.string().regex(/^[a-z][a-z0-9-]*$/), publicProvider).safeParse(patch.providers).success) return c.json({ error: "Invalid provider settings: check provider IDs, model names and commands" }, 400);
|
|
1383
|
+
}
|
|
1384
|
+
await driver.patchDaemonConfig(patch);
|
|
1385
|
+
const saved = projectSettings((await driver.getDaemonConfig()).config);
|
|
1386
|
+
for (const [key, value] of Object.entries(patch)) if (!retained(value, saved[key])) return c.json({ error: `The host did not retain ${key}. Some other changes may have applied; reload before retrying.` }, 409);
|
|
1387
|
+
return c.json({
|
|
1388
|
+
config: saved,
|
|
1389
|
+
revision: revision(saved),
|
|
1390
|
+
features: features ?? {}
|
|
1391
|
+
});
|
|
1392
|
+
});
|
|
1393
|
+
app.get("/api/hosts/:host/provider-diagnostic/:provider", async (c) => {
|
|
1394
|
+
return c.json(await hosts.get(c.req.param("host")).driver.getProviderDiagnostic(c.req.param("provider")));
|
|
1395
|
+
});
|
|
1396
|
+
app.get("/api/hosts/:host/skills", async (c) => c.json(await hosts.get(c.req.param("host")).driver.getAgentSkillsStatus()));
|
|
1397
|
+
app.put("/api/hosts/:host/skills", async (c) => {
|
|
1398
|
+
const input = z.object({
|
|
1399
|
+
selection: AgentSkillSelectionSchema,
|
|
1400
|
+
confirmedRemovals: z.array(z.string()).optional()
|
|
1401
|
+
}).strict().parse(await c.req.json());
|
|
1402
|
+
return c.json(await hosts.get(c.req.param("host")).driver.saveAgentSkillsSelection(input.selection, input.confirmedRemovals));
|
|
1403
|
+
});
|
|
1404
|
+
app.get("/api/hosts/:host/plugins", async (c) => {
|
|
1405
|
+
const plugins = await hosts.get(c.req.param("host")).driver.listPlugins();
|
|
1406
|
+
return c.json(plugins.map(({ id, name, enabled, status, description, error }) => ({
|
|
1407
|
+
id,
|
|
1408
|
+
name,
|
|
1409
|
+
enabled,
|
|
1410
|
+
status,
|
|
1411
|
+
description,
|
|
1412
|
+
error
|
|
1413
|
+
})));
|
|
1414
|
+
});
|
|
1415
|
+
app.post("/api/hosts/:host/plugins/:plugin/:action", async (c) => {
|
|
1416
|
+
const driver = hosts.get(c.req.param("host")).driver, id = c.req.param("plugin");
|
|
1417
|
+
if (!driver.getLastServerInfoMessage()?.features?.pluginManagement) return c.json({ error: "Plugin management is unavailable on this host" }, 409);
|
|
1418
|
+
const action = z.enum([
|
|
1419
|
+
"enable",
|
|
1420
|
+
"disable",
|
|
1421
|
+
"reload",
|
|
1422
|
+
"remove"
|
|
1423
|
+
]).parse(c.req.param("action"));
|
|
1424
|
+
if (action === "enable") await driver.enablePlugin(id);
|
|
1425
|
+
if (action === "disable") await driver.disablePlugin(id);
|
|
1426
|
+
if (action === "reload") await driver.reloadPlugin(id);
|
|
1427
|
+
if (action === "remove") await driver.removePlugin(id);
|
|
1428
|
+
return c.json({ ok: true });
|
|
1429
|
+
});
|
|
1430
|
+
app.post("/api/hosts/:host/plugins", async (c) => {
|
|
1431
|
+
const driver = hosts.get(c.req.param("host")).driver;
|
|
1432
|
+
if (!driver.getLastServerInfoMessage()?.features?.pluginSourceInstallation) return c.json({ error: "Plugin installation is unavailable on this host" }, 409);
|
|
1433
|
+
const input = z.object({ source: z.string().trim().min(1).max(4096) }).strict().parse(await c.req.json());
|
|
1434
|
+
await driver.installPluginSource(input);
|
|
1435
|
+
return c.json({ ok: true });
|
|
1436
|
+
});
|
|
1437
|
+
app.get("/api/hosts/:host/status", async (c) => c.json(await hosts.get(c.req.param("host")).driver.getDaemonStatus()));
|
|
1438
|
+
app.get("/api/hosts/:host/lifecycle", (c) => c.json(jobs.get(c.req.param("host")) ?? null));
|
|
1439
|
+
app.post("/api/hosts/:host/lifecycle/:action", async (c) => {
|
|
1440
|
+
const host = c.req.param("host"), driver = hosts.get(host).driver;
|
|
1441
|
+
const action = z.enum(["restart", "update"]).parse(c.req.param("action"));
|
|
1442
|
+
const info = driver.getLastServerInfoMessage();
|
|
1443
|
+
if (!info?.features?.daemonStatusRpc) return c.json({ error: "This host cannot verify daemon restarts. Update it manually first." }, 409);
|
|
1444
|
+
if (driver.getConnectionState().status !== "connected") return c.json({ error: "Host is not connected" }, 409);
|
|
1445
|
+
if (action === "update" && (info.desktopManaged || !info.features.daemonSelfUpdate)) return c.json({ error: info.desktopManaged ? "Update this host through Paseo Desktop." : "Self-update is unavailable for this installation." }, 409);
|
|
1446
|
+
const existing = jobs.get(host);
|
|
1447
|
+
if (existing?.state === "running") return c.json(existing, 202);
|
|
1448
|
+
const job = {
|
|
1449
|
+
action,
|
|
1450
|
+
state: "running",
|
|
1451
|
+
phase: "Starting"
|
|
1452
|
+
};
|
|
1453
|
+
jobs.set(host, job);
|
|
1454
|
+
runLifecycle(hosts, host, job);
|
|
1455
|
+
return c.json(job, 202);
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1187
1458
|
// src/server/message-images.ts
|
|
1188
1459
|
const key = (host, agent, id) => `message-images:${JSON.stringify([
|
|
1189
1460
|
host,
|
|
@@ -1779,12 +2050,22 @@ function registerWorkspaceRoutes(app, hosts, store, valid) {
|
|
|
1779
2050
|
cwd: path,
|
|
1780
2051
|
rows: z.number().int().min(4).max(500),
|
|
1781
2052
|
cols: z.number().int().min(10).max(1e3),
|
|
1782
|
-
name: z.string().max(80).optional()
|
|
2053
|
+
name: z.string().max(80).optional(),
|
|
2054
|
+
profileId: z.string().optional()
|
|
1783
2055
|
}).parse(await c.req.json());
|
|
1784
|
-
const
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
2056
|
+
const driver = hosts.get(c.req.param("host")).driver;
|
|
2057
|
+
const profile = input.profileId ? (await driver.getDaemonConfig()).config.terminalProfiles?.find((p) => p.id === input.profileId) : void 0;
|
|
2058
|
+
if (input.profileId && !profile) return c.json({ error: "Terminal profile no longer exists. Reload profiles." }, 409);
|
|
2059
|
+
const result = await driver.createTerminal(input.cwd, input.name ?? profile?.name, void 0, {
|
|
2060
|
+
...profile ? {
|
|
2061
|
+
command: profile.command,
|
|
2062
|
+
args: profile.args
|
|
2063
|
+
} : {},
|
|
2064
|
+
size: {
|
|
2065
|
+
rows: input.rows,
|
|
2066
|
+
cols: input.cols
|
|
2067
|
+
}
|
|
2068
|
+
});
|
|
1788
2069
|
if (!result.terminal) return c.json({ error: result.error ?? "Could not open a terminal" }, 502);
|
|
1789
2070
|
return c.json({
|
|
1790
2071
|
id: result.terminal.id,
|
|
@@ -3132,9 +3413,11 @@ function createApp(store, hosts, token, webRoot, options = {}) {
|
|
|
3132
3413
|
c.set("session", session);
|
|
3133
3414
|
await next();
|
|
3134
3415
|
});
|
|
3416
|
+
const instanceName = () => store.setting("instance-name") ?? "";
|
|
3135
3417
|
app.get("/api/auth", (c) => c.json({
|
|
3136
3418
|
authenticated: !!c.get("session"),
|
|
3137
|
-
totp: auth.totpEnabled()
|
|
3419
|
+
totp: auth.totpEnabled(),
|
|
3420
|
+
...instanceName() ? { instanceName: instanceName() } : {}
|
|
3138
3421
|
}));
|
|
3139
3422
|
app.post("/api/login", async (c) => {
|
|
3140
3423
|
const input = z.object({
|
|
@@ -3356,7 +3639,8 @@ function createApp(store, hosts, token, webRoot, options = {}) {
|
|
|
3356
3639
|
hostFlush = void 0;
|
|
3357
3640
|
const message = {
|
|
3358
3641
|
type: "hosts",
|
|
3359
|
-
hosts: hostStates()
|
|
3642
|
+
hosts: hostStates(),
|
|
3643
|
+
instanceName: instanceName()
|
|
3360
3644
|
};
|
|
3361
3645
|
for (const stream of directoryStreams) stream.send(message);
|
|
3362
3646
|
}, HOST_FLUSH_MS);
|
|
@@ -3391,6 +3675,19 @@ function createApp(store, hosts, token, webRoot, options = {}) {
|
|
|
3391
3675
|
});
|
|
3392
3676
|
return c.json(pins);
|
|
3393
3677
|
});
|
|
3678
|
+
app.get("/api/instance", (c) => c.json({ name: instanceName() }));
|
|
3679
|
+
app.put("/api/instance", async (c) => {
|
|
3680
|
+
const input = z.object({ name: z.string().trim().max(64).refine((name) => !/[\u0000-\u001f\u007f]/.test(name), "Use a single-line name") }).strict().safeParse(await c.req.json());
|
|
3681
|
+
if (!input.success) return c.json({ error: "Use an instance name of up to 64 characters on a single line." }, 400);
|
|
3682
|
+
store.setSetting("instance-name", input.data.name || null);
|
|
3683
|
+
const message = {
|
|
3684
|
+
type: "hosts",
|
|
3685
|
+
hosts: hostStates(),
|
|
3686
|
+
instanceName: instanceName()
|
|
3687
|
+
};
|
|
3688
|
+
for (const stream of directoryStreams) stream.send(message);
|
|
3689
|
+
return c.json({ name: instanceName() });
|
|
3690
|
+
});
|
|
3394
3691
|
app.get("/api/stream", (c) => {
|
|
3395
3692
|
const since = Number(c.req.query("since"));
|
|
3396
3693
|
const resumable = c.req.query("generation") === hosts.agents.generation && Number.isInteger(since);
|
|
@@ -3404,7 +3701,8 @@ function createApp(store, hosts, token, webRoot, options = {}) {
|
|
|
3404
3701
|
};
|
|
3405
3702
|
send({
|
|
3406
3703
|
type: "hosts",
|
|
3407
|
-
hosts: hostStates()
|
|
3704
|
+
hosts: hostStates(),
|
|
3705
|
+
instanceName: instanceName()
|
|
3408
3706
|
});
|
|
3409
3707
|
send({
|
|
3410
3708
|
type: "project-pins",
|
|
@@ -3487,6 +3785,7 @@ function createApp(store, hosts, token, webRoot, options = {}) {
|
|
|
3487
3785
|
model: z.string().trim().min(1).max(300).optional(),
|
|
3488
3786
|
modeId: z.string().trim().min(1).max(200).optional(),
|
|
3489
3787
|
thinkingOptionId: z.string().trim().min(1).max(200).optional(),
|
|
3788
|
+
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
3490
3789
|
prompt: z.string().max(1e5).optional(),
|
|
3491
3790
|
worktreeBranch: z.string().trim().min(1).max(200).optional()
|
|
3492
3791
|
}).parse(await c.req.json());
|
|
@@ -3504,6 +3803,7 @@ function createApp(store, hosts, token, webRoot, options = {}) {
|
|
|
3504
3803
|
cwd: input.cwd,
|
|
3505
3804
|
config: {
|
|
3506
3805
|
provider: `${input.provider}/${model}`,
|
|
3806
|
+
...input.featureValues ? { featureValues: input.featureValues } : {},
|
|
3507
3807
|
...input.modeId ? { modeId: input.modeId } : {},
|
|
3508
3808
|
...input.thinkingOptionId ? { thinkingOptionId: input.thinkingOptionId } : {}
|
|
3509
3809
|
},
|
|
@@ -4166,6 +4466,7 @@ function createApp(store, hosts, token, webRoot, options = {}) {
|
|
|
4166
4466
|
});
|
|
4167
4467
|
}
|
|
4168
4468
|
});
|
|
4469
|
+
registerHostSettings(app, hosts);
|
|
4169
4470
|
registerWorkspaceRoutes(app, hosts, store, (c) => streamValidity(c));
|
|
4170
4471
|
app.get("/api/usage", async (c) => c.json(await usage.report(c.req.query("refresh") === "1")));
|
|
4171
4472
|
app.get("/api/board", (c) => c.json(store.board()));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as e,G as t,I as n,P as r,S as i,T as a,f as o,g as s,ot as c,rt as l,v as u,y as d,z as f}from"./vue.runtime.esm-bundler-DwGo9CTz.js";import{
|
|
1
|
+
import{$ as e,G as t,I as n,P as r,S as i,T as a,f as o,g as s,ot as c,rt as l,v as u,y as d,z as f}from"./vue.runtime.esm-bundler-DwGo9CTz.js";import{o as p}from"./index-C1LEv69l.js";var m={class:`changes-panel`},h=[`disabled`],g={key:0,role:`alert`},_={key:1},v={key:2},y=[`onToggle`],b=[`onClick`],x={key:0},S={key:1},C={class:`hunk`},w=p(a({__name:`ChangesPanel`,props:{hostId:{},cwd:{},api:{type:Function}},setup(a){let p=a,w=e([]),T=e(``),E=e(!1),D=e(!1),O=0,k=e(new Set);r(()=>O++);async function A(){let e=++O;E.value=!0,T.value=``,w.value=[],D.value=!1,k.value=new Set;try{let t=await p.api(`/hosts/${encodeURIComponent(p.hostId)}/changes?cwd=${encodeURIComponent(p.cwd)}`);if(e!==O)return;w.value=t.files,D.value=!!t.diffTooLarge}catch(t){e===O&&(T.value=t.message)}finally{e===O&&(E.value=!1)}}async function j(e){try{await navigator.clipboard.writeText(e)}catch{T.value=`Could not copy path.`}}return t(()=>[p.hostId,p.cwd],()=>{w.value=[],A()},{immediate:!0}),(e,t)=>(n(),d(`section`,m,[t[0]||=s(`p`,null,`Workspace uncommitted changes · includes changes from all contributors.`,-1),s(`button`,{class:`btn`,disabled:E.value,onClick:A},c(E.value?`Loading…`:`Refresh changes`),9,h),T.value?(n(),d(`p`,g,c(T.value),1)):u(``,!0),D.value?(n(),d(`p`,_,`Diff exceeds the host limit; some changes are omitted.`)):u(``,!0),!E.value&&!T.value&&!w.value.length?(n(),d(`p`,v,`No uncommitted changes.`)):u(``,!0),(n(!0),d(o,null,f(w.value,e=>(n(),d(`details`,{key:e.path,onToggle:t=>t.target.open?k.value.add(e.path):k.value.delete(e.path)},[s(`summary`,null,[i(c(e.oldPath?e.oldPath+` → `:``)+c(e.path)+` `,1),s(`span`,null,`+`+c(e.additions)+` −`+c(e.deletions),1)]),s(`button`,{class:`btn btn-ghost`,onClick:t=>j(e.path)},`Copy path`,8,b),e.status===`binary`?(n(),d(`p`,x,`Binary file changed.`)):e.status===`too_large`?(n(),d(`p`,S,`File diff is too large to display.`)):u(``,!0),k.value.has(e.path)?(n(!0),d(o,{key:2},f(e.hunks,(e,t)=>(n(),d(`pre`,{key:t},[s(`code`,null,[s(`span`,C,`@@ −`+c(e.oldStart)+`,`+c(e.oldCount)+` +`+c(e.newStart)+`,`+c(e.newCount)+` @@
|
|
2
2
|
`,1),(n(!0),d(o,null,f(e.lines,(e,t)=>(n(),d(`span`,{key:t,class:l(e.type)},c(e.type===`add`?`+`:e.type===`remove`?`−`:` `)+c(e.content),3))),128))])]))),128)):u(``,!0)],40,y))),128))]))}}),[[`__scopeId`,`data-v-4de9f4ce`]]);export{w as default};
|
|
Binary file
|
|
Binary file
|