limixbot 0.3.106 → 0.3.107
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/assets/{ActivityPanel-CCcPfgz5.js → ActivityPanel-Dwy_8Ssw.js} +1 -1
- package/dist/assets/{App-zBBulOuW.js → App-DER9VjCj.js} +8 -8
- package/dist/assets/{AppEventEditor-DwF0_M1b.js → AppEventEditor-DVPTS46l.js} +1 -1
- package/dist/assets/{BotSettingsDialog-DxU0bbvL.js → BotSettingsDialog-CBMhMWpP.js} +1 -1
- package/dist/assets/{BrowserPanel-BhTErfef.js → BrowserPanel-cuhGe02X.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-Db3HtlGT.js → BrowserProfilesManager-DCwRz57j.js} +1 -1
- package/dist/assets/{CloudAddDialog-kamEe44b.js → CloudAddDialog-jmGkr7Un.js} +1 -1
- package/dist/assets/{ComputerFilesPane-CcKrhxHb.js → ComputerFilesPane-8K2V3RhW.js} +1 -1
- package/dist/assets/{ComputerPanel-xvhrDI3V.js → ComputerPanel-pAbCBPNK.js} +2 -2
- package/dist/assets/{DataPanel-U-hn3L__.js → DataPanel-Cqk9kG4Y.js} +1 -1
- package/dist/assets/{GrokMoveDialog-DUq8KP9G.js → GrokMoveDialog-CpK4k-BS.js} +1 -1
- package/dist/assets/{InspectorPanel-USPl8hOG.js → InspectorPanel-Cy2voxQ9.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-p9ysRLk1.js → KeyboardShortcutsModal-CLLeb5RM.js} +1 -1
- package/dist/assets/{LimixResizeHandles-BKWnbJ2i.js → LimixResizeHandles-DN3T-Sxj.js} +1 -1
- package/dist/assets/{LiveDesktop-DhWsbWD4.js → LiveDesktop-D1zL4cXe.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-CmUPQxAR.js → LocalVmWorkspace-OPstoi6j.js} +1 -1
- package/dist/assets/{MacLocalControl-BhwfZLHm.js → MacLocalControl-BAU_Mxfl.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-CuhD_8FB.js → MarkdownFilePreview-DiDEa2VP.js} +1 -1
- package/dist/assets/{NewBotDialog-wcLErpXf.js → NewBotDialog-_fhvtWem.js} +1 -1
- package/dist/assets/{PhoneAppDialog-DgId8RUc.js → PhoneAppDialog-TisX6Kkd.js} +1 -1
- package/dist/assets/{PluginsPanel-mk1MGvXs.js → PluginsPanel-mfBuYBSI.js} +1 -1
- package/dist/assets/{ProIntroduction-BYE3bQsp.js → ProIntroduction-DS75WAZy.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-CKiEG2R6.js → RemoteAgentSettingsPanel-B148emwo.js} +1 -1
- package/dist/assets/{RoomPanel-DOg2_LNg.js → RoomPanel-B_RUQv3X.js} +1 -1
- package/dist/assets/{RoutinesPage-BsAHR1A_.js → RoutinesPage-Bt3nAr6K.js} +1 -1
- package/dist/assets/{SettingsModal-B2079ETl.js → SettingsModal-BjEnjf-l.js} +1 -1
- package/dist/assets/{ShareTeamDialog-do0hDEeZ.js → ShareTeamDialog-CFdVjk7Z.js} +1 -1
- package/dist/assets/{SignedInSites-GP2V7pnE.js → SignedInSites-ChIudtJC.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-DZT4YTMk.js → TeamLibraryPanel-C5ba9U3p.js} +1 -1
- package/dist/assets/{TeamMapPage-D0E4dgpI.js → TeamMapPage-CMv2EOnM.js} +1 -1
- package/dist/assets/{TriggersPage-DjLrZqK8.js → TriggersPage-DAFkA0uT.js} +1 -1
- package/dist/assets/{VisibilitySection-D1WhMCk7.js → VisibilitySection-CLxd2eiH.js} +1 -1
- package/dist/assets/{WebhookTrigger-DhQjWpWp.js → WebhookTrigger-C6ySSY-L.js} +1 -1
- package/dist/assets/{WorksOnGrid-BXuGA0Sp.js → WorksOnGrid-DDm8ZPUS.js} +1 -1
- package/dist/assets/{core-B3DZ2YZD.js → core-Ce8mfU6p.js} +1 -1
- package/dist/assets/{import-name-DMgD6yXZ.js → import-name-CzRqCqhy.js} +1 -1
- package/dist/assets/{index-DSJo2jnB.js → index-DQSfzGc3.js} +1 -1
- package/dist/assets/{index-Bi9hjnIk.js → index-DsdqtVg4.js} +2 -2
- package/dist/assets/{mcp-servers-B7A4aRDZ.js → mcp-servers-DQMAYnlB.js} +1 -1
- package/dist/assets/{new-bot-OFavyOJo.js → new-bot-C23M4Uux.js} +1 -1
- package/dist/assets/{org-library-D--Qr-TG.js → org-library-Dq1l049t.js} +1 -1
- package/dist/assets/{package-format-CamEIwIj.js → package-format-C7ReB3QW.js} +1 -1
- package/dist/assets/{remote-desktop-panel-D_S7gQya.js → remote-desktop-panel-Bn0lktN4.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/index.js +35 -35
- package/dist-server/limixbot.js +118 -119
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +118 -119
- package/dist-server/server/fleet-agent.js +2 -2
- package/dist-server/server/fleet-cli.js +4 -4
- package/dist-server/server/fleet.js +22 -16
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { appendFileSync, chmodSync, existsSync, mkdirSync, rmSync } from "node:f
|
|
|
4
4
|
import { createServer } from "node:http";
|
|
5
5
|
import { dirname } from "node:path";
|
|
6
6
|
import { defaultFleetDeps, executePlan, loadRegistry, markProvisioningFailed, planFleetAction } from "./fleet-cli.js";
|
|
7
|
-
import { assertSlug, fleetLayout, fleetUser, openRouterModelIds, workspaceDataDir } from "./fleet.js";
|
|
7
|
+
import { assertSlug, fleetLayout, fleetUser, fleetWorkspaceUnit, openRouterModelIds, workspaceDataDir } from "./fleet.js";
|
|
8
8
|
const MAX_BODY = 256 * 1024;
|
|
9
9
|
export function readBody(req) {
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
@@ -132,7 +132,7 @@ export function createFleetAgent(options) {
|
|
|
132
132
|
const workspaces = [];
|
|
133
133
|
for (const workspace of Object.values(registry.workspaces).sort((a, b) => a.slug.localeCompare(b.slug))) {
|
|
134
134
|
const live = workspace.status === "running" || workspace.status === "suspended"
|
|
135
|
-
? (await deps.run(["systemctl", "is-active",
|
|
135
|
+
? (await deps.run(["systemctl", "is-active", fleetWorkspaceUnit(workspace.slug)])).output.trim() || "unknown"
|
|
136
136
|
: workspace.status;
|
|
137
137
|
workspaces.push(statusOnly ? { slug: workspace.slug, live } : { ...workspace, live, usage: workspaceUsage(layout, workspace.slug, now(), deps) });
|
|
138
138
|
}
|
|
@@ -4,7 +4,7 @@ import { appendFileSync, closeSync, existsSync, fsyncSync, lstatSync, mkdirSync,
|
|
|
4
4
|
import { posix } from "node:path";
|
|
5
5
|
import { writeFileAtomic } from "./atomic.js";
|
|
6
6
|
import { unstableInstallWarning } from "./service-unit.js";
|
|
7
|
-
import { applySignIn, assertManagedWorkspace, assertSlug, assertUnixUser, createPlan, deletePlan, describeSteps, fleetLayout, fleetUser, fenceRules, initPlan, MANAGED_OPENROUTER, managedOpenRouterModels, parseRegistry, resumePlan, suspendPlan, upgradePlan, workspaceDataDir, workspaceHome, } from "./fleet.js";
|
|
7
|
+
import { applySignIn, assertManagedWorkspace, assertSlug, assertUnixUser, createPlan, deletePlan, describeSteps, fleetLayout, fleetUser, fleetWorkspaceDropIn, fleetWorkspaceUnit, fenceRules, initPlan, MANAGED_OPENROUTER, managedOpenRouterModels, parseRegistry, resumePlan, suspendPlan, upgradePlan, workspaceDataDir, workspaceHome, } from "./fleet.js";
|
|
8
8
|
// Tenant-controlled ancestors can be renamed between any two filesystem calls: the boundary is dropping ALL root authority
|
|
9
9
|
// before I/O, not a preceding lstat. The checks also reject visible symlinks, shared inodes and special files.
|
|
10
10
|
const TENANT_IO = String.raw `
|
|
@@ -215,7 +215,7 @@ export async function executePlan(steps, deps, io) {
|
|
|
215
215
|
}
|
|
216
216
|
case "health":
|
|
217
217
|
if (!(await deps.health(step.url, HEALTH_TIMEOUT_MS)))
|
|
218
|
-
return failed(io, step.why, `${step.url} did not answer within ${HEALTH_TIMEOUT_MS / 1000}s; check journalctl -u
|
|
218
|
+
return failed(io, step.why, `${step.url} did not answer within ${HEALTH_TIMEOUT_MS / 1000}s; check journalctl -u limixbot@<slug>.service`);
|
|
219
219
|
break;
|
|
220
220
|
case "note":
|
|
221
221
|
io.log(step.text);
|
|
@@ -274,7 +274,7 @@ export function planFleetAction(input, deps) {
|
|
|
274
274
|
const registry = loadRegistry(layout, deps);
|
|
275
275
|
if (registry.workspaces[input.slug])
|
|
276
276
|
throw new Error(`workspace "${input.slug}" already exists`);
|
|
277
|
-
for (const path of [workspaceHome(layout, input.slug), posix.join(layout.instancesDir, `${input.slug}.env`), posix.join(layout.caddyDir, `${input.slug}.caddy`),
|
|
277
|
+
for (const path of [workspaceHome(layout, input.slug), posix.join(layout.instancesDir, `${input.slug}.env`), posix.join(layout.caddyDir, `${input.slug}.caddy`), fleetWorkspaceDropIn(layout, input.slug)]) {
|
|
278
278
|
if (deps.pathExists(path))
|
|
279
279
|
throw new Error(`workspace path already exists: ${path}; recover or remove it explicitly before provisioning a fresh workspace`);
|
|
280
280
|
}
|
|
@@ -408,7 +408,7 @@ export async function runFleetCommand(input, io, deps = defaultFleetDeps()) {
|
|
|
408
408
|
return 0;
|
|
409
409
|
}
|
|
410
410
|
for (const workspace of rows) {
|
|
411
|
-
const live = asRoot && (workspace.status === "running" || workspace.status === "suspended") ? (await deps.run(["systemctl", "is-active",
|
|
411
|
+
const live = asRoot && (workspace.status === "running" || workspace.status === "suspended") ? (await deps.run(["systemctl", "is-active", fleetWorkspaceUnit(workspace.slug)])).output.trim() : workspace.status;
|
|
412
412
|
io.log(`${workspace.slug.padEnd(24)} https://${workspace.host.padEnd(40)} :${String(workspace.port).padEnd(6)} ${live}`);
|
|
413
413
|
}
|
|
414
414
|
return 0;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
// Many client workspaces on one Linux server, each its own OS user and `
|
|
1
|
+
// Many client workspaces on one Linux server, each its own OS user and `limixbot@<slug>` service. This module only plans:
|
|
2
2
|
// it renders files and fixed argument lists as steps, and never builds a shell command string.
|
|
3
3
|
import { posix } from "node:path";
|
|
4
|
-
const { join } = posix;
|
|
4
|
+
const { dirname, join } = posix;
|
|
5
|
+
const WORKSPACE_UNIT_PREFIX = "limixbot@";
|
|
6
|
+
export function fleetWorkspaceUnit(slug) {
|
|
7
|
+
return `${WORKSPACE_UNIT_PREFIX}${slug}.service`;
|
|
8
|
+
}
|
|
9
|
+
export function fleetWorkspaceDropIn(layout, slug) {
|
|
10
|
+
return join(dirname(layout.unitFile), `${fleetWorkspaceUnit(slug)}.d`);
|
|
11
|
+
}
|
|
5
12
|
/** A workspace name: DNS label and Unix user suffix at once. */
|
|
6
13
|
export const FLEET_SLUG = /^[a-z][a-z0-9-]{1,30}$/;
|
|
7
14
|
export const FLEET_USER_PREFIX = "omb-";
|
|
@@ -13,7 +20,7 @@ export function fleetLayout(root = "/") {
|
|
|
13
20
|
etcDir: at("etc", "openmausbot"),
|
|
14
21
|
registryFile: at("etc", "openmausbot", "fleet.json"),
|
|
15
22
|
instancesDir: at("etc", "openmausbot", "instances"),
|
|
16
|
-
unitFile: at("etc", "systemd", "system", "
|
|
23
|
+
unitFile: at("etc", "systemd", "system", fleetWorkspaceUnit("")),
|
|
17
24
|
fenceFile: at("etc", "openmausbot", "fence.nft"),
|
|
18
25
|
fenceUnitFile: at("etc", "systemd", "system", "openmausbot-fence.service"),
|
|
19
26
|
caddyDir: at("etc", "caddy", "omb.d"),
|
|
@@ -29,7 +36,7 @@ export function agentUnit(spec) {
|
|
|
29
36
|
const layout = spec.layout ?? fleetLayout();
|
|
30
37
|
const strip = spec.script.endsWith(".ts") ? " --experimental-strip-types" : "";
|
|
31
38
|
return [
|
|
32
|
-
"# Written by `
|
|
39
|
+
"# Written by `limixbot fleet init`. The operator workspace creates and manages workspaces through this.",
|
|
33
40
|
"[Unit]",
|
|
34
41
|
"Description=Limix Bot fleet agent",
|
|
35
42
|
"After=network-online.target",
|
|
@@ -91,7 +98,7 @@ export function templateUnit(spec) {
|
|
|
91
98
|
const layout = spec.layout ?? fleetLayout();
|
|
92
99
|
const strip = spec.script.endsWith(".ts") ? " --experimental-strip-types" : "";
|
|
93
100
|
return [
|
|
94
|
-
"# Written by `
|
|
101
|
+
"# Written by `limixbot fleet init`. One unit for every workspace: %i is the slug.",
|
|
95
102
|
"[Unit]",
|
|
96
103
|
"Description=Limix Bot workspace %i",
|
|
97
104
|
"After=network-online.target openmausbot-fence.service",
|
|
@@ -125,7 +132,7 @@ export function templateUnit(spec) {
|
|
|
125
132
|
}
|
|
126
133
|
export function fenceUnit(layout = fleetLayout()) {
|
|
127
134
|
return [
|
|
128
|
-
"# Written by `
|
|
135
|
+
"# Written by `limixbot fleet init`: keeps each workspace's loopback ports to its own user.",
|
|
129
136
|
"[Unit]",
|
|
130
137
|
"Description=Limix Bot per-workspace loopback fence",
|
|
131
138
|
"",
|
|
@@ -141,7 +148,7 @@ export function fenceUnit(layout = fleetLayout()) {
|
|
|
141
148
|
}
|
|
142
149
|
/** nftables: only a workspace's own user, Caddy and root may open its loopback ports, so a bot's shell cannot reach a sibling's API. */
|
|
143
150
|
export function fenceRules(workspaces) {
|
|
144
|
-
const lines = ["#!/usr/sbin/nft -f", "# Written by `
|
|
151
|
+
const lines = ["#!/usr/sbin/nft -f", "# Written by `limixbot fleet`; regenerated on every create, suspend, resume and delete.", "add table inet openmausbot", "flush table inet openmausbot", "table inet openmausbot {", "\tchain output {", "\t\ttype filter hook output priority 0; policy accept;"];
|
|
145
152
|
for (const workspace of [...workspaces].sort((a, b) => a.slug.localeCompare(b.slug))) {
|
|
146
153
|
if (workspace.status !== "running" && workspace.status !== "suspended" && workspace.status !== "retained" && !workspace.accountCreated)
|
|
147
154
|
continue;
|
|
@@ -314,14 +321,14 @@ export function createPlan(input) {
|
|
|
314
321
|
{ kind: "write", path: join(layout.instancesDir, `${workspace.slug}.env`), content: instanceEnv({ workspace, dataDir, licenseKey: input.licenseKey, portalUrl: input.seed.portalUrl }), mode: 0o600 },
|
|
315
322
|
...(input.memoryMax
|
|
316
323
|
? [
|
|
317
|
-
{ kind: "mkdir", path:
|
|
318
|
-
{ kind: "write", path: join(layout
|
|
324
|
+
{ kind: "mkdir", path: fleetWorkspaceDropIn(layout, workspace.slug), mode: 0o755 },
|
|
325
|
+
{ kind: "write", path: join(fleetWorkspaceDropIn(layout, workspace.slug), "limits.conf"), content: `[Service]\nMemoryMax=${input.memoryMax}\n`, mode: 0o644 },
|
|
319
326
|
]
|
|
320
327
|
: []),
|
|
321
328
|
{ kind: "write", path: layout.fenceFile, content: fenceRules(Object.values(registry.workspaces)), mode: 0o600 },
|
|
322
329
|
{ kind: "run", argv: ["nft", "-f", layout.fenceFile], why: "fence the new ports to their user" },
|
|
323
330
|
{ kind: "run", argv: ["systemctl", "daemon-reload"], why: "pick up the workspace's environment and limits" },
|
|
324
|
-
{ kind: "run", argv: ["systemctl", "enable", "--now",
|
|
331
|
+
{ kind: "run", argv: ["systemctl", "enable", "--now", fleetWorkspaceUnit(workspace.slug)], why: "start the workspace now and at boot" },
|
|
325
332
|
{ kind: "health", url: `http://127.0.0.1:${workspace.port}/api/health`, why: "wait for the workspace to answer" },
|
|
326
333
|
{ kind: "write", path: join(layout.caddyDir, `${workspace.slug}.caddy`), content: caddySite(workspace), mode: 0o644 },
|
|
327
334
|
{ kind: "run", argv: ["systemctl", "reload", "caddy"], why: `serve https://${workspace.host} and fetch its certificate` },
|
|
@@ -350,7 +357,7 @@ export function suspendPlan(input) {
|
|
|
350
357
|
return {
|
|
351
358
|
registry,
|
|
352
359
|
steps: [
|
|
353
|
-
{ kind: "run", argv: ["systemctl", "disable", "--now",
|
|
360
|
+
{ kind: "run", argv: ["systemctl", "disable", "--now", fleetWorkspaceUnit(workspace.slug)], why: "stop the workspace and keep it stopped at boot" },
|
|
354
361
|
{ kind: "write", path: join(layout.caddyDir, `${workspace.slug}.caddy`), content: caddySite(workspace), mode: 0o644 },
|
|
355
362
|
{ kind: "run", argv: ["systemctl", "reload", "caddy"], why: "show the suspended page instead" },
|
|
356
363
|
{ kind: "write", path: layout.registryFile, content: `${JSON.stringify(registry, null, 2)}\n`, mode: 0o600 },
|
|
@@ -363,7 +370,7 @@ export function resumePlan(input) {
|
|
|
363
370
|
return {
|
|
364
371
|
registry,
|
|
365
372
|
steps: [
|
|
366
|
-
{ kind: "run", argv: ["systemctl", "enable", "--now",
|
|
373
|
+
{ kind: "run", argv: ["systemctl", "enable", "--now", fleetWorkspaceUnit(workspace.slug)], why: "start the workspace again" },
|
|
367
374
|
{ kind: "health", url: `http://127.0.0.1:${workspace.port}/api/health`, why: "wait for the workspace to answer" },
|
|
368
375
|
{ kind: "write", path: join(layout.caddyDir, `${workspace.slug}.caddy`), content: caddySite(workspace), mode: 0o644 },
|
|
369
376
|
{ kind: "run", argv: ["systemctl", "reload", "caddy"], why: "serve it again" },
|
|
@@ -380,15 +387,14 @@ export function deletePlan(input) {
|
|
|
380
387
|
assertManagedWorkspace(workspace);
|
|
381
388
|
const { [input.slug]: _gone, ...rest } = input.registry.workspaces;
|
|
382
389
|
const registry = { ...input.registry, workspaces: input.keepData ? { ...rest, [input.slug]: { ...workspace, status: "retained" } } : rest };
|
|
383
|
-
const unitsDir = layout.unitFile.replace(/openmausbot@\.service$/, "");
|
|
384
390
|
return {
|
|
385
391
|
registry,
|
|
386
392
|
steps: [
|
|
387
|
-
{ kind: "run", argv: ["systemctl", "disable", "--now",
|
|
393
|
+
{ kind: "run", argv: ["systemctl", "disable", "--now", fleetWorkspaceUnit(workspace.slug)], why: "stop the workspace" },
|
|
388
394
|
{ kind: "remove", path: join(layout.caddyDir, `${workspace.slug}.caddy`) },
|
|
389
395
|
{ kind: "run", argv: ["systemctl", "reload", "caddy"], why: "stop serving its address" },
|
|
390
396
|
{ kind: "remove", path: join(layout.instancesDir, `${workspace.slug}.env`) },
|
|
391
|
-
{ kind: "remove", path: join(
|
|
397
|
+
{ kind: "remove", path: join(fleetWorkspaceDropIn(layout, workspace.slug), "limits.conf") },
|
|
392
398
|
{ kind: "write", path: layout.fenceFile, content: fenceRules(Object.values(registry.workspaces)), mode: 0o600 },
|
|
393
399
|
{ kind: "run", argv: ["nft", "-f", layout.fenceFile], why: input.keepData ? "keep the retained account's fence" : "drop its fence rule" },
|
|
394
400
|
// Keep the nologin account too: recycling its UID would hand the preserved home to a new workspace.
|
|
@@ -403,7 +409,7 @@ export function upgradePlan(input) {
|
|
|
403
409
|
const running = Object.values(input.registry.workspaces).filter((workspace) => workspace.status === "running").sort((a, b) => a.slug.localeCompare(b.slug));
|
|
404
410
|
return [
|
|
405
411
|
{ kind: "run", argv: ["npm", "install", "-g", "limixbot@latest"], why: "install the release every workspace runs from" },
|
|
406
|
-
...running.map((workspace) => ({ kind: "run", argv: ["systemctl", "restart",
|
|
412
|
+
...running.map((workspace) => ({ kind: "run", argv: ["systemctl", "restart", fleetWorkspaceUnit(workspace.slug)], why: `restart ${workspace.slug} on the new release` })),
|
|
407
413
|
...running.map((workspace) => ({ kind: "health", url: `http://127.0.0.1:${workspace.port}/api/health`, why: `wait for ${workspace.slug}` })),
|
|
408
414
|
];
|
|
409
415
|
}
|