litepaseo 0.5.6 → 0.6.0

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +30 -0
  3. package/dist/server/cli.mjs +2 -2
  4. package/dist/server/{worker-CmAqDSYh.mjs → worker-CVzQyHuc.mjs} +352 -12
  5. package/dist/web/assets/{ChangesPanel-BnTVUHsq.js → ChangesPanel-DIPRhLGF.js} +1 -1
  6. package/dist/web/assets/ChangesPanel-DIPRhLGF.js.br +0 -0
  7. package/dist/web/assets/ChangesPanel-DIPRhLGF.js.gz +0 -0
  8. package/dist/web/assets/{CodeBlockNode-BoKDZ0JS.js → CodeBlockNode-1jLt7_Qg.js} +1 -1
  9. package/dist/web/assets/CodeBlockNode-1jLt7_Qg.js.br +0 -0
  10. package/dist/web/assets/CodeBlockNode-1jLt7_Qg.js.gz +0 -0
  11. package/dist/web/assets/{ConversationSearch-p0etRxgC.js → ConversationSearch-DnThnJwz.js} +1 -1
  12. package/dist/web/assets/ConversationSearch-DnThnJwz.js.br +0 -0
  13. package/dist/web/assets/ConversationSearch-DnThnJwz.js.gz +0 -0
  14. package/dist/web/assets/{FileViewer-owdH5GIA.js → FileViewer-C7hjYtIt.js} +1 -1
  15. package/dist/web/assets/FileViewer-C7hjYtIt.js.br +0 -0
  16. package/dist/web/assets/FileViewer-C7hjYtIt.js.gz +0 -0
  17. package/dist/web/assets/{FilesPanel-DYBMdkk5.js → FilesPanel-CopR9wHo.js} +1 -1
  18. package/dist/web/assets/FilesPanel-CopR9wHo.js.br +0 -0
  19. package/dist/web/assets/FilesPanel-CopR9wHo.js.gz +0 -0
  20. package/dist/web/assets/HostSettings-Buiqtp3W.css +1 -0
  21. package/dist/web/assets/HostSettings-Crh6kdfn.js +5 -0
  22. package/dist/web/assets/HostSettings-Crh6kdfn.js.br +0 -0
  23. package/dist/web/assets/HostSettings-Crh6kdfn.js.gz +0 -0
  24. package/dist/web/assets/{MarkdownMessage-Do9_IwWQ.js → MarkdownMessage-D9AOStO3.js} +5 -5
  25. package/dist/web/assets/MarkdownMessage-D9AOStO3.js.br +0 -0
  26. package/dist/web/assets/MarkdownMessage-D9AOStO3.js.gz +0 -0
  27. package/dist/web/assets/{PreCodeBlock-CQ2q4dl9.js → PreCodeBlock-n-u3kB8y.js} +1 -1
  28. package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-77_eYcBx.js → PreCodeBlock.vue_vue_type_style_index_0_lang-Bu-UHxOC.js} +1 -1
  29. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Bu-UHxOC.js.br +0 -0
  30. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-Bu-UHxOC.js.gz +0 -0
  31. package/dist/web/assets/{TerminalPanel-mJ-uVP4H.css → TerminalPanel-BzfVCEVB.css} +1 -1
  32. package/dist/web/assets/TerminalPanel-BzfVCEVB.css.br +0 -0
  33. package/dist/web/assets/TerminalPanel-BzfVCEVB.css.gz +0 -0
  34. package/dist/web/assets/TerminalPanel-XKAvits_.js +3 -0
  35. package/dist/web/assets/TerminalPanel-XKAvits_.js.br +0 -0
  36. package/dist/web/assets/TerminalPanel-XKAvits_.js.gz +0 -0
  37. package/dist/web/assets/{Tooltip-OdIQMGsu.js → Tooltip-86C3mXgh.js} +1 -1
  38. package/dist/web/assets/Tooltip-86C3mXgh.js.br +0 -0
  39. package/dist/web/assets/Tooltip-86C3mXgh.js.gz +0 -0
  40. package/dist/web/assets/index-By174Ngx.js +34 -0
  41. package/dist/web/assets/index-By174Ngx.js.br +0 -0
  42. package/dist/web/assets/index-By174Ngx.js.gz +0 -0
  43. package/dist/web/assets/{index-TxZBiF5p.css → index-C3fN0Z6a.css} +1 -1
  44. package/dist/web/assets/index-C3fN0Z6a.css.br +0 -0
  45. package/dist/web/assets/index-C3fN0Z6a.css.gz +0 -0
  46. package/dist/web/assets/{index10-CTkwtErI.js → index10-cVShFlBT.js} +1 -1
  47. package/dist/web/assets/index10-cVShFlBT.js.br +0 -0
  48. package/dist/web/assets/index10-cVShFlBT.js.gz +0 -0
  49. package/dist/web/assets/index3-Cc4X3pXd.js +1 -0
  50. package/dist/web/assets/index4-BsfClVXh.js +1 -0
  51. package/dist/web/assets/{index5-BbWlUsx-.js → index5-DjmbgR7j.js} +1 -1
  52. package/dist/web/assets/index5-DjmbgR7j.js.br +0 -0
  53. package/dist/web/assets/{index5-BbWlUsx-.js.gz → index5-DjmbgR7j.js.gz} +0 -0
  54. package/dist/web/assets/{index6-Dses7vNn.js → index6-B2szeyga.js} +1 -1
  55. package/dist/web/assets/index6-B2szeyga.js.br +0 -0
  56. package/dist/web/assets/index6-B2szeyga.js.gz +0 -0
  57. package/dist/web/assets/{index7-CTAZbJp4.js → index7-BUHmuNsk.js} +1 -1
  58. package/dist/web/assets/index7-BUHmuNsk.js.br +0 -0
  59. package/dist/web/assets/index7-BUHmuNsk.js.gz +0 -0
  60. package/dist/web/assets/{index8-YjUeN24v.js → index8-Bo6Wogoc.js} +1 -1
  61. package/dist/web/assets/index8-Bo6Wogoc.js.br +0 -0
  62. package/dist/web/assets/index8-Bo6Wogoc.js.gz +0 -0
  63. package/dist/web/assets/{index9-CDZfgaSG.js → index9-ARxM0jwK.js} +1 -1
  64. package/dist/web/assets/index9-ARxM0jwK.js.br +0 -0
  65. package/dist/web/assets/index9-ARxM0jwK.js.gz +0 -0
  66. package/dist/web/index.html +2 -2
  67. package/dist/web/index.html.br +0 -0
  68. package/dist/web/index.html.gz +0 -0
  69. package/docs/provider-message-delivery.md +35 -0
  70. package/package.json +3 -2
  71. package/dist/web/assets/ChangesPanel-BnTVUHsq.js.br +0 -0
  72. package/dist/web/assets/ChangesPanel-BnTVUHsq.js.gz +0 -0
  73. package/dist/web/assets/CodeBlockNode-BoKDZ0JS.js.br +0 -0
  74. package/dist/web/assets/CodeBlockNode-BoKDZ0JS.js.gz +0 -0
  75. package/dist/web/assets/ConversationSearch-p0etRxgC.js.br +0 -0
  76. package/dist/web/assets/ConversationSearch-p0etRxgC.js.gz +0 -0
  77. package/dist/web/assets/FileViewer-owdH5GIA.js.br +0 -0
  78. package/dist/web/assets/FileViewer-owdH5GIA.js.gz +0 -0
  79. package/dist/web/assets/FilesPanel-DYBMdkk5.js.br +0 -0
  80. package/dist/web/assets/FilesPanel-DYBMdkk5.js.gz +0 -0
  81. package/dist/web/assets/MarkdownMessage-Do9_IwWQ.js.br +0 -0
  82. package/dist/web/assets/MarkdownMessage-Do9_IwWQ.js.gz +0 -0
  83. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-77_eYcBx.js.br +0 -0
  84. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-77_eYcBx.js.gz +0 -0
  85. package/dist/web/assets/TerminalPanel-DoT3tI6b.js +0 -3
  86. package/dist/web/assets/TerminalPanel-DoT3tI6b.js.br +0 -0
  87. package/dist/web/assets/TerminalPanel-DoT3tI6b.js.gz +0 -0
  88. package/dist/web/assets/TerminalPanel-mJ-uVP4H.css.br +0 -0
  89. package/dist/web/assets/TerminalPanel-mJ-uVP4H.css.gz +0 -0
  90. package/dist/web/assets/Tooltip-OdIQMGsu.js.br +0 -0
  91. package/dist/web/assets/Tooltip-OdIQMGsu.js.gz +0 -0
  92. package/dist/web/assets/index-TxZBiF5p.css.br +0 -0
  93. package/dist/web/assets/index-TxZBiF5p.css.gz +0 -0
  94. package/dist/web/assets/index-UkMiyQue.js +0 -34
  95. package/dist/web/assets/index-UkMiyQue.js.br +0 -0
  96. package/dist/web/assets/index-UkMiyQue.js.gz +0 -0
  97. package/dist/web/assets/index10-CTkwtErI.js.br +0 -0
  98. package/dist/web/assets/index10-CTkwtErI.js.gz +0 -0
  99. package/dist/web/assets/index3-C-PUkuSG.js +0 -1
  100. package/dist/web/assets/index4-ChuPUEvK.js +0 -1
  101. package/dist/web/assets/index5-BbWlUsx-.js.br +0 -0
  102. package/dist/web/assets/index6-Dses7vNn.js.br +0 -0
  103. package/dist/web/assets/index6-Dses7vNn.js.gz +0 -0
  104. package/dist/web/assets/index7-CTAZbJp4.js.br +0 -0
  105. package/dist/web/assets/index7-CTAZbJp4.js.gz +0 -0
  106. package/dist/web/assets/index8-YjUeN24v.js.br +0 -0
  107. package/dist/web/assets/index8-YjUeN24v.js.gz +0 -0
  108. package/dist/web/assets/index9-CDZfgaSG.js.br +0 -0
  109. package/dist/web/assets/index9-CDZfgaSG.js.gz +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0
4
+
5
+ - Set an instance name in Web Settings; show it in browser tabs, the sidebar and sign-in, and synchronize it across connected clients.
6
+ - 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.
7
+ - Manage agent and terminal profiles, and select them when creating sessions and terminals. Configure providers, additional models and metadata generation priorities.
8
+ - Manage Paseo skill selection and installed host plugins, including trusted source installation. Keep LitePaseo voice input and notifications independent.
9
+ - 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.
10
+ - Increase phone conversation text to 16px and improve form and supporting-text sizes without changing desktop typography.
11
+
12
+ ## 0.5.7
13
+
14
+ - Default to Steer for supported providers and Queue otherwise; keep composer controls contained at narrow widths and increased zoom.
15
+ - Offer separate Queue, native Steer, and Interrupt modes. Reject unsupported providers without sending and preserve drafts. Explain that the existing Paseo API may interrupt if native steering is unavailable at runtime; no daemon changes are included.
16
+
3
17
  ## 0.5.6
4
18
 
5
19
  - Align the pinned-project icon beside the project name, preserving a single compact row.
package/README.md CHANGED
@@ -46,6 +46,7 @@ package, with no separate database service to deploy.
46
46
  - Pin projects from their ⋮ menu to keep important repositories at the top of the Projects sidebar. Pins follow pin order and sync across devices; Unpin restores activity ordering.
47
47
  - Create sessions, choose a provider/model, send messages, stop turns, and answer
48
48
  permission requests or structured questions.
49
+ - Choose Queue to wait for the current turn or Interrupt to stop it and send a new message. Native Claude, Codex, OpenCode, Pi and OMP adapters also offer Steer. Paseo may interrupt if native steering is unavailable at runtime; Litepaseo cannot suppress that fallback through the current API. See [provider support](docs/provider-message-delivery.md).
49
50
  - Queue messages on the server while an agent works; they continue after you close the browser
50
51
  and survive server restarts. Edit, drop or send one at once as an
51
52
  interrupt; rewind a conversation (and, where the provider supports it, its files)
@@ -139,6 +140,35 @@ Both take effect immediately and sign out every browser. A token sent as
139
140
  `Authorization: Bearer` (for scripts) is accepted only on direct connections, never
140
141
  through a tunnel or proxy, and only while authenticator sign-in is off.
141
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
+
142
172
  ### Voice input
143
173
 
144
174
  Voice input is off until you add a transcription service in **Settings → Voice input**: a
@@ -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.5.6";
11
+ const VERSION = "0.6.0";
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-CmAqDSYh.mjs");
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
@@ -171,6 +171,21 @@ var VersionedCollection = class {
171
171
  this.tail = node;
172
172
  }
173
173
  };
174
+ // src/server/message-delivery.ts
175
+ const nativeSteering = /* @__PURE__ */ new Set([
176
+ "claude",
177
+ "codex",
178
+ "opencode",
179
+ "pi",
180
+ "omp"
181
+ ]);
182
+ function messageDeliveryModes(provider) {
183
+ return nativeSteering.has(provider) ? [
184
+ "queue",
185
+ "steer",
186
+ "interrupt"
187
+ ] : ["queue", "interrupt"];
188
+ }
174
189
  // src/server/host-directory.ts
175
190
  const PAGE = 200;
176
191
  const RETRY_MS$1 = 2e3;
@@ -409,6 +424,7 @@ function summarize(hostId, agent, project, activity = time(agent.updatedAt)) {
409
424
  status: agent.status,
410
425
  turnActive,
411
426
  provider: agent.provider,
427
+ deliveryModes: messageDeliveryModes(agent.provider),
412
428
  cwd: agent.cwd,
413
429
  project: project?.projectName || basename$1(agent.cwd) || "Other",
414
430
  projectKey: project?.projectKey ?? null,
@@ -1168,6 +1184,277 @@ var Hosts = class {
1168
1184
  for (const listener of listeners) listener();
1169
1185
  }
1170
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
+ }
1171
1458
  // src/server/message-images.ts
1172
1459
  const key = (host, agent, id) => `message-images:${JSON.stringify([
1173
1460
  host,
@@ -1763,12 +2050,22 @@ function registerWorkspaceRoutes(app, hosts, store, valid) {
1763
2050
  cwd: path,
1764
2051
  rows: z.number().int().min(4).max(500),
1765
2052
  cols: z.number().int().min(10).max(1e3),
1766
- name: z.string().max(80).optional()
2053
+ name: z.string().max(80).optional(),
2054
+ profileId: z.string().optional()
1767
2055
  }).parse(await c.req.json());
1768
- const result = await hosts.get(c.req.param("host")).driver.createTerminal(input.cwd, input.name, void 0, { size: {
1769
- rows: input.rows,
1770
- cols: input.cols
1771
- } });
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
+ });
1772
2069
  if (!result.terminal) return c.json({ error: result.error ?? "Could not open a terminal" }, 502);
1773
2070
  return c.json({
1774
2071
  id: result.terminal.id,
@@ -3116,9 +3413,11 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3116
3413
  c.set("session", session);
3117
3414
  await next();
3118
3415
  });
3416
+ const instanceName = () => store.setting("instance-name") ?? "";
3119
3417
  app.get("/api/auth", (c) => c.json({
3120
3418
  authenticated: !!c.get("session"),
3121
- totp: auth.totpEnabled()
3419
+ totp: auth.totpEnabled(),
3420
+ ...instanceName() ? { instanceName: instanceName() } : {}
3122
3421
  }));
3123
3422
  app.post("/api/login", async (c) => {
3124
3423
  const input = z.object({
@@ -3340,7 +3639,8 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3340
3639
  hostFlush = void 0;
3341
3640
  const message = {
3342
3641
  type: "hosts",
3343
- hosts: hostStates()
3642
+ hosts: hostStates(),
3643
+ instanceName: instanceName()
3344
3644
  };
3345
3645
  for (const stream of directoryStreams) stream.send(message);
3346
3646
  }, HOST_FLUSH_MS);
@@ -3375,6 +3675,19 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3375
3675
  });
3376
3676
  return c.json(pins);
3377
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
+ });
3378
3691
  app.get("/api/stream", (c) => {
3379
3692
  const since = Number(c.req.query("since"));
3380
3693
  const resumable = c.req.query("generation") === hosts.agents.generation && Number.isInteger(since);
@@ -3388,7 +3701,8 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3388
3701
  };
3389
3702
  send({
3390
3703
  type: "hosts",
3391
- hosts: hostStates()
3704
+ hosts: hostStates(),
3705
+ instanceName: instanceName()
3392
3706
  });
3393
3707
  send({
3394
3708
  type: "project-pins",
@@ -3471,6 +3785,7 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3471
3785
  model: z.string().trim().min(1).max(300).optional(),
3472
3786
  modeId: z.string().trim().min(1).max(200).optional(),
3473
3787
  thinkingOptionId: z.string().trim().min(1).max(200).optional(),
3788
+ featureValues: z.record(z.string(), z.unknown()).optional(),
3474
3789
  prompt: z.string().max(1e5).optional(),
3475
3790
  worktreeBranch: z.string().trim().min(1).max(200).optional()
3476
3791
  }).parse(await c.req.json());
@@ -3488,6 +3803,7 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3488
3803
  cwd: input.cwd,
3489
3804
  config: {
3490
3805
  provider: `${input.provider}/${model}`,
3806
+ ...input.featureValues ? { featureValues: input.featureValues } : {},
3491
3807
  ...input.modeId ? { modeId: input.modeId } : {},
3492
3808
  ...input.thinkingOptionId ? { thinkingOptionId: input.thinkingOptionId } : {}
3493
3809
  },
@@ -3908,8 +4224,31 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3908
4224
  text: z.string().trim().max(1e5),
3909
4225
  attachmentIds: z.array(z.string().uuid()).max(4).refine((ids) => new Set(ids).size === ids.length).default([]),
3910
4226
  messageId: z.string().uuid(),
3911
- behavior: z.enum(["steer", "interrupt"])
4227
+ behavior: z.enum([
4228
+ "send",
4229
+ "steer",
4230
+ "interrupt"
4231
+ ])
3912
4232
  }).refine((input) => !!input.text || input.attachmentIds.length > 0).parse(await c.req.json());
4233
+ if (input.behavior === "steer") {
4234
+ const provider = hosts.get(c.req.param("host")).directory.facts(c.req.param("agent"))?.provider;
4235
+ if (!provider || !messageDeliveryModes(provider).includes("steer")) return c.json({
4236
+ error: "Steer is unavailable for this provider. Your message was not sent. Choose Queue or Interrupt.",
4237
+ delivery: "not-sent"
4238
+ }, 409);
4239
+ const summary = hosts.agents.get(`${c.req.param("host")}:${c.req.param("agent")}`);
4240
+ if (!(summary && summary.status !== "initializing" && (summary.turnActive === true || summary.turnActive === void 0 && summary.status === "running"))) return c.json({
4241
+ error: "There is no active turn to steer. Your message was not sent. Wait for the agent or send a new message.",
4242
+ delivery: "not-sent"
4243
+ }, 409);
4244
+ }
4245
+ if (input.behavior === "send") {
4246
+ const summary = hosts.agents.get(`${c.req.param("host")}:${c.req.param("agent")}`);
4247
+ if (!(summary && (summary.turnActive === false || summary.turnActive === void 0 && summary.status !== "running" && summary.status !== "initializing"))) return c.json({
4248
+ error: "The agent is no longer idle. Your message was not sent. Choose Queue or Interrupt.",
4249
+ delivery: "not-sent"
4250
+ }, 409);
4251
+ }
3913
4252
  let prepared;
3914
4253
  try {
3915
4254
  prepared = await attachments.prepare(hosts, attachmentOwner(c), c.req.param("host"), c.req.param("agent"), input.attachmentIds);
@@ -3923,7 +4262,7 @@ function createApp(store, hosts, token, webRoot, options = {}) {
3923
4262
  try {
3924
4263
  await hosts.get(c.req.param("host")).api.agents.ref(c.req.param("agent")).send(input.text, {
3925
4264
  messageId: input.messageId,
3926
- activeTurnBehavior: input.behavior,
4265
+ activeTurnBehavior: input.behavior === "send" ? "steer" : input.behavior,
3927
4266
  ...prepared.images.length ? { images: prepared.images } : {},
3928
4267
  ...prepared.attachments.length ? { attachments: prepared.attachments } : {}
3929
4268
  });
@@ -4127,6 +4466,7 @@ function createApp(store, hosts, token, webRoot, options = {}) {
4127
4466
  });
4128
4467
  }
4129
4468
  });
4469
+ registerHostSettings(app, hosts);
4130
4470
  registerWorkspaceRoutes(app, hosts, store, (c) => streamValidity(c));
4131
4471
  app.get("/api/usage", async (c) => c.json(await usage.report(c.req.query("refresh") === "1")));
4132
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{n as p}from"./index-UkMiyQue.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)+` @@
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{n as p}from"./index-By174Ngx.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};