limixbot 0.3.104 → 0.3.106
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/cli.js +1 -1
- package/dist/assets/{ActivityPanel-B_BFcQD1.js → ActivityPanel-CCcPfgz5.js} +1 -1
- package/dist/assets/{App-DOuYLwnE.js → App-zBBulOuW.js} +87 -87
- package/dist/assets/{AppEventEditor-C3cZ-v-l.js → AppEventEditor-DwF0_M1b.js} +1 -1
- package/dist/assets/{BotSettingsDialog-BMuKIpww.js → BotSettingsDialog-DxU0bbvL.js} +1 -1
- package/dist/assets/{BrowserPanel-CC-RRiSn.js → BrowserPanel-BhTErfef.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-B0GcUR61.js → BrowserProfilesManager-Db3HtlGT.js} +1 -1
- package/dist/assets/{CloudAddDialog-Bns4-VJs.js → CloudAddDialog-kamEe44b.js} +1 -1
- package/dist/assets/{ComputerFilesPane-CHWnwnyk.js → ComputerFilesPane-CcKrhxHb.js} +1 -1
- package/dist/assets/{ComputerPanel-B1TMcjMd.js → ComputerPanel-xvhrDI3V.js} +2 -2
- package/dist/assets/{DataPanel-DCtcWWfV.js → DataPanel-U-hn3L__.js} +1 -1
- package/dist/assets/{GrokMoveDialog-CwmgOFtK.js → GrokMoveDialog-DUq8KP9G.js} +1 -1
- package/dist/assets/{InspectorPanel-1YpI0E3t.js → InspectorPanel-USPl8hOG.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-B_owLnyN.js → KeyboardShortcutsModal-p9ysRLk1.js} +1 -1
- package/dist/assets/{LimixResizeHandles-1D1y4qZD.js → LimixResizeHandles-BKWnbJ2i.js} +1 -1
- package/dist/assets/{LiveDesktop-jXy_R_-h.js → LiveDesktop-DhWsbWD4.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-CKzcFrsY.js → LocalVmWorkspace-CmUPQxAR.js} +1 -1
- package/dist/assets/{MacLocalControl-DFrayZKr.js → MacLocalControl-BhwfZLHm.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-B_JAYfDZ.js → MarkdownFilePreview-CuhD_8FB.js} +1 -1
- package/dist/assets/{NewBotDialog-xEVUHYzY.js → NewBotDialog-wcLErpXf.js} +1 -1
- package/dist/assets/{PhoneAppDialog-BikoiMIZ.js → PhoneAppDialog-DgId8RUc.js} +1 -1
- package/dist/assets/{PluginsPanel-CEabZXl-.js → PluginsPanel-mk1MGvXs.js} +1 -1
- package/dist/assets/{ProIntroduction-Blb7Wmj3.js → ProIntroduction-BYE3bQsp.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-DGtLZgfO.js → RemoteAgentSettingsPanel-CKiEG2R6.js} +1 -1
- package/dist/assets/{RoomPanel-CqgxxG2B.js → RoomPanel-DOg2_LNg.js} +1 -1
- package/dist/assets/{RoutinesPage-DOYhHb1J.js → RoutinesPage-BsAHR1A_.js} +1 -1
- package/dist/assets/{SettingsModal-DCf_JvOw.js → SettingsModal-B2079ETl.js} +1 -1
- package/dist/assets/{ShareTeamDialog-D9cYlv14.js → ShareTeamDialog-do0hDEeZ.js} +1 -1
- package/dist/assets/{SignedInSites-D_byvV9n.js → SignedInSites-GP2V7pnE.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-bHG22KXB.js → TeamLibraryPanel-DZT4YTMk.js} +1 -1
- package/dist/assets/{TeamMapPage-CAHJkbt_.js → TeamMapPage-D0E4dgpI.js} +1 -1
- package/dist/assets/{TriggersPage-B-T5-6Gl.js → TriggersPage-DjLrZqK8.js} +1 -1
- package/dist/assets/{VisibilitySection-GegFqGuc.js → VisibilitySection-D1WhMCk7.js} +1 -1
- package/dist/assets/{WebhookTrigger-u8vsfbeo.js → WebhookTrigger-DhQjWpWp.js} +1 -1
- package/dist/assets/{WorksOnGrid-B2-l_Q_m.js → WorksOnGrid-BXuGA0Sp.js} +1 -1
- package/dist/assets/{core-DKDCBur-.js → core-B3DZ2YZD.js} +1 -1
- package/dist/assets/{import-name-BSGBLqrq.js → import-name-DMgD6yXZ.js} +1 -1
- package/dist/assets/{index-0gVCHCZc.js → index-Bi9hjnIk.js} +2 -2
- package/dist/assets/{index-ChuMYBhY.js → index-DSJo2jnB.js} +1 -1
- package/dist/assets/{mcp-servers-BrqGhNro.js → mcp-servers-B7A4aRDZ.js} +1 -1
- package/dist/assets/{new-bot-EzUjd6fV.js → new-bot-OFavyOJo.js} +1 -1
- package/dist/assets/{org-library-ucusWjRb.js → org-library-D--Qr-TG.js} +1 -1
- package/dist/assets/{package-format-pX5YUAjH.js → package-format-CamEIwIj.js} +1 -1
- package/dist/assets/{remote-desktop-panel-pMGwFFBO.js → remote-desktop-panel-D_S7gQya.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/cloud-home-start.js +3 -3
- package/dist-server/index.js +118 -113
- package/dist-server/{openmausbot.js → limixbot.js} +78 -78
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +78 -78
- package/dist-server/server/bot-api-host.js +11 -8
- package/dist-server/server/bot-channels/engine.js +17 -2
- package/dist-server/server/browser-relay.js +1 -1
- package/dist-server/server/caddy.js +1 -1
- package/dist-server/server/cli-invocation.js +5 -5
- package/dist-server/server/cli-usage.js +25 -25
- package/dist-server/server/cli.js +3 -3
- package/dist-server/server/container-computer.js +1 -1
- package/dist-server/server/drivers/antigravity-acp.js +1 -1
- package/dist-server/server/enterprise.js +2 -2
- package/dist-server/server/fleet.js +1 -1
- package/dist-server/server/headless/main.js +27 -27
- package/dist-server/server/index.js +10 -4
- package/dist-server/server/limix-skill-requirements.js +8 -1
- package/dist-server/server/move-freeze.js +2 -2
- package/dist-server/server/package-export.js +3 -3
- package/dist-server/server/sentinel/paths.js +1 -1
- package/dist-server/server/service-cli.js +6 -6
- package/dist-server/server/service-unit.js +5 -5
- package/dist-server/server/tts/system-voices.js +1 -1
- package/dist-server/server/update-check.js +4 -4
- package/dist-server/server/workspace-backup.js +2 -2
- package/dist-server/server-launcher.js +3 -2
- package/dist-server/workspace-backup.worker.js +5 -5
- package/package.json +1 -1
- package/skills/video-workflow/SKILL.md +14 -0
- /package/dist-server/server/{openmausbot.js → limixbot.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** How this CLI was started, so every command it prints can be pasted as is: `npx
|
|
2
|
-
* checkout, the Docker image's `docker compose exec omb
|
|
1
|
+
/** How this CLI was started, so every command it prints can be pasted as is: `npx limixbot`, `pnpm omb` in a
|
|
2
|
+
* checkout, the Docker image's `docker compose exec omb limixbot` (OMB_CLI_PREFIX), or plain `limixbot`. */
|
|
3
3
|
export function cliPrefix(env = process.env, script = process.argv[1] ?? "") {
|
|
4
4
|
const fixed = env.OMB_CLI_PREFIX?.trim();
|
|
5
5
|
if (fixed)
|
|
@@ -8,10 +8,10 @@ export function cliPrefix(env = process.env, script = process.argv[1] ?? "") {
|
|
|
8
8
|
return "pnpm omb";
|
|
9
9
|
// npm 7+ runs an `npx` package from its cache's `_npx` folder (npm_command=exec alone also marks `npx vitest`).
|
|
10
10
|
if (/[\\/]_npx[\\/]/.test(script))
|
|
11
|
-
return "npx
|
|
12
|
-
return "
|
|
11
|
+
return "npx limixbot";
|
|
12
|
+
return "limixbot";
|
|
13
13
|
}
|
|
14
|
-
/** `
|
|
14
|
+
/** `limixbot <rest>` the way this CLI was started. */
|
|
15
15
|
export function cliCommand(rest, env, script) {
|
|
16
16
|
return `${cliPrefix(env, script)} ${rest}`;
|
|
17
17
|
}
|
|
@@ -2,53 +2,53 @@ export { HEADLESS_VERBS as HEADLESS_VERB_NAMES } from "./headless/args.js";
|
|
|
2
2
|
export const HEADLESS_USAGE = `Drive a running workspace (scripts, CI, other agents):
|
|
3
3
|
limixbot doctor check the server answers and an engine is ready
|
|
4
4
|
limixbot doctor --host check this Linux machine can run a server (exit 7 if not)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
limixbot bots | channels | models your bots, your rooms, the engines and their models
|
|
6
|
+
limixbot run BOT "do this" give a bot one job and wait until it and every teammate it asked are done
|
|
7
|
+
limixbot send BOT "text" send one message and return at once
|
|
8
|
+
limixbot wait BOT wait on work already running
|
|
9
|
+
limixbot messages BOT the latest messages of a conversation
|
|
10
|
+
limixbot interrupt BOT [--tree] press Stop (--tree: and every teammate on its job)
|
|
11
|
+
limixbot export BOT --out DIR write a job's transcripts, files and screens to DIR
|
|
12
|
+
limixbot events [--job THREAD] the server's live events as JSON lines
|
|
13
|
+
limixbot team apply FILE make the workspace match a team file (team export writes one)
|
|
14
|
+
limixbot engine set claude --key-env ANTHROPIC_API_KEY give it an engine without a screen
|
|
15
15
|
limixbot connect URL --code CODE --out FILE get a token for a workspace elsewhere
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
limixbot token create NAME --out FILE [--expires 90d] a token for CI that ends on its date (token list, token revoke ID)
|
|
17
|
+
limixbot new-bot | new-channel | set-model | edit | mcp
|
|
18
18
|
|
|
19
19
|
Server: --url URL (or OPENMAUSBOT_URL), --port N (or OMB_PORT), else this computer's.
|
|
20
20
|
Token: OPENMAUSBOT_TOKEN or --token-file FILE. --json prints one JSON document;
|
|
21
21
|
progress goes to stderr (--quiet drops it). limixbot help VERB for the details.`;
|
|
22
|
-
/** The usage text, its commands written the way this CLI was started (`npx
|
|
23
|
-
export function usage(prefix = "
|
|
24
|
-
return USAGE.split("\n").map((line) => line.replace(/^(\s+)
|
|
22
|
+
/** The usage text, its commands written the way this CLI was started (`npx limixbot …`). */
|
|
23
|
+
export function usage(prefix = "limixbot") {
|
|
24
|
+
return USAGE.split("\n").map((line) => line.replace(/^(\s+)limixbot(?= )/, `$1${prefix}`)).join("\n");
|
|
25
25
|
}
|
|
26
|
-
export const USAGE = `
|
|
26
|
+
export const USAGE = `limixbot — your team of AI bots, ready in a few steps
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
limixbot set up once, then open your workspace
|
|
29
29
|
limixbot setup [--data-dir DIR]
|
|
30
30
|
limixbot start [the same options as serve]
|
|
31
31
|
limixbot serve [--port 8799] [--data-dir DIR] [--label NAME]
|
|
32
32
|
[--public-url https://host | --domain HOST | --tunnel | --tailscale] [--lan] [--relay]
|
|
33
33
|
limixbot pair [--label NAME] [--phone [ios|android]] [--ttl 24h] [--public-url https://host]
|
|
34
|
-
|
|
34
|
+
limixbot devices [revoke ID]
|
|
35
35
|
limixbot status
|
|
36
|
-
|
|
36
|
+
limixbot --version
|
|
37
37
|
limixbot login [--email you@example.com] [--relay]
|
|
38
38
|
limixbot logout
|
|
39
|
-
|
|
39
|
+
limixbot access list | add EMAIL [--chat-only] | remove EMAIL
|
|
40
40
|
limixbot service install [the same way-in options as serve] [--port N] [--data-dir DIR] | uninstall
|
|
41
41
|
[--sentinel] (the health scan below, every two minutes, instead of the server)
|
|
42
|
-
|
|
42
|
+
limixbot sentinel [--data-dir DIR] [--out DIR] [--once] [--json] (read-only health scan; see --help)
|
|
43
43
|
limixbot browser install [--with-deps] | status
|
|
44
|
-
|
|
44
|
+
limixbot fleet init --domain HOST [--operator USER] | create NAME --admin EMAIL [--member EMAIL] [--brand FILE]
|
|
45
45
|
[--anthropic-key-file FILE] [--cap USD] [--license-key KEY] [--memory 1G]
|
|
46
46
|
| list | users NAME add|remove EMAIL [--chat-only] | suspend NAME | resume NAME
|
|
47
47
|
| delete NAME --yes [--keep-data] | upgrade (all take --dry-run)
|
|
48
48
|
| agent [--socket PATH] [--group USER] (root; installed by init --operator)
|
|
49
49
|
|
|
50
50
|
setup choose AI access and optional phone access; keep existing bots and chats
|
|
51
|
-
start same as
|
|
51
|
+
start same as limixbot: use your saved settings and open the workspace
|
|
52
52
|
serve starts the server without prompts; in a terminal it prints a pairing
|
|
53
53
|
code, the link to paste into the desktop app (+ → Connect to a
|
|
54
54
|
server) and a QR for a phone
|
|
@@ -113,6 +113,6 @@ Ways in (pick one; --lan can join any):
|
|
|
113
113
|
|
|
114
114
|
${HEADLESS_USAGE}
|
|
115
115
|
|
|
116
|
-
Install once with \`npm install -g
|
|
117
|
-
Or run without a global install: \`npx
|
|
116
|
+
Install once with \`npm install -g limixbot\`, then type \`limixbot\`.
|
|
117
|
+
Or run without a global install: \`npx limixbot\`. Node 24+ is required.
|
|
118
118
|
`;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// openmausbot logout
|
|
12
12
|
// openmausbot run | send | wait | doctor | team apply | export | …
|
|
13
13
|
//
|
|
14
|
-
// This module only exports:
|
|
14
|
+
// This module only exports: limixbot.ts runs main(), so bundling this file into other entries never runs it twice.
|
|
15
15
|
import { spawn } from "node:child_process";
|
|
16
16
|
import { randomBytes } from "node:crypto";
|
|
17
17
|
import { closeSync, existsSync, mkdirSync, openSync, readFileSync } from "node:fs";
|
|
@@ -249,7 +249,7 @@ async function api(port, path, init = {}) {
|
|
|
249
249
|
const body = await res.json().catch(() => ({}));
|
|
250
250
|
return { status: res.status, body };
|
|
251
251
|
}
|
|
252
|
-
export const SERVICE_TRUST_HELP = "This server does not treat commands on this computer as its owner (OMB_LOOPBACK_TRUST=service, or a hosted workspace), so it will not pair devices or list sessions for them. Sign in as an admin and use Settings → Remote access, let people sign in with their email (
|
|
252
|
+
export const SERVICE_TRUST_HELP = "This server does not treat commands on this computer as its owner (OMB_LOOPBACK_TRUST=service, or a hosted workspace), so it will not pair devices or list sessions for them. Sign in as an admin and use Settings → Remote access, let people sign in with their email (limixbot access add you@example.com), or restart the server with OMB_LOOPBACK_TRUST=owner.";
|
|
253
253
|
function refusedAsService(status, body) {
|
|
254
254
|
return status === 403 && typeof body?.error === "string" && /shared server|Sign in through the workspace portal/.test(body.error);
|
|
255
255
|
}
|
|
@@ -475,7 +475,7 @@ export async function runAccess(options, io = defaultIo()) {
|
|
|
475
475
|
};
|
|
476
476
|
if (options.accessAction === "list") {
|
|
477
477
|
if (!admins.length && !members.length) {
|
|
478
|
-
io.log("nobody can sign in with an email yet; pairing codes only. Add someone with:
|
|
478
|
+
io.log("nobody can sign in with an email yet; pairing codes only. Add someone with: limixbot access add you@example.com");
|
|
479
479
|
return 0;
|
|
480
480
|
}
|
|
481
481
|
for (const entry of admins)
|
|
@@ -665,7 +665,7 @@ function baseImagePullArgs(runtime) {
|
|
|
665
665
|
}
|
|
666
666
|
async function prepareManagedImage(runtime, runner) {
|
|
667
667
|
await runner(runtime, baseImagePullArgs(runtime), 10 * 60_000);
|
|
668
|
-
const context = await mkdtemp(join(tmpdir(), "
|
|
668
|
+
const context = await mkdtemp(join(tmpdir(), "limixbot-cua-image-"));
|
|
669
669
|
try {
|
|
670
670
|
await writeFile(join(context, "Dockerfile"), managedImageDockerfile(), { mode: 0o600 });
|
|
671
671
|
await runner(runtime, ["build", ...(runtime === "container" ? [] : ["--force-rm"]), "-t", IMAGE, context], 10 * 60_000); // the legacy builder keeps a failed step's container without --force-rm
|
|
@@ -560,7 +560,7 @@ export function isValidAntigravityInitializeResult(initialized, expectedVersion)
|
|
|
560
560
|
return true;
|
|
561
561
|
}
|
|
562
562
|
export async function validateAntigravityRuntime(runtime, expectedVersion) {
|
|
563
|
-
const profileDirectory = await mkdtemp(join(tmpdir(), "
|
|
563
|
+
const profileDirectory = await mkdtemp(join(tmpdir(), "limix-antigravity-verify-"));
|
|
564
564
|
let client;
|
|
565
565
|
let tempDirectory;
|
|
566
566
|
let failed = false;
|
|
@@ -174,9 +174,9 @@ export function licenseWarning(status) {
|
|
|
174
174
|
export function describeEdition(status) {
|
|
175
175
|
if (status.edition === "enterprise") {
|
|
176
176
|
const until = status.expiresAt ? ` until ${status.expiresAt}` : "";
|
|
177
|
-
return `
|
|
177
|
+
return `Limix Bot enterprise edition for ${status.customer}${until}: ${status.features.join(", ") || "no features"}`;
|
|
178
178
|
}
|
|
179
|
-
return `
|
|
179
|
+
return `Limix Bot open-source edition${status.notice ? ` (${status.notice})` : ""}`;
|
|
180
180
|
}
|
|
181
181
|
/** The edition as Settings shows it: a licence block only while an Enterprise licence is near or past expiry. */
|
|
182
182
|
export function editionForSettings(status) {
|
|
@@ -402,7 +402,7 @@ export function deletePlan(input) {
|
|
|
402
402
|
export function upgradePlan(input) {
|
|
403
403
|
const running = Object.values(input.registry.workspaces).filter((workspace) => workspace.status === "running").sort((a, b) => a.slug.localeCompare(b.slug));
|
|
404
404
|
return [
|
|
405
|
-
{ kind: "run", argv: ["npm", "install", "-g", "
|
|
405
|
+
{ kind: "run", argv: ["npm", "install", "-g", "limixbot@latest"], why: "install the release every workspace runs from" },
|
|
406
406
|
...running.map((workspace) => ({ kind: "run", argv: ["systemctl", "restart", `openmausbot@${workspace.slug}.service`], why: `restart ${workspace.slug} on the new release` })),
|
|
407
407
|
...running.map((workspace) => ({ kind: "health", url: `http://127.0.0.1:${workspace.port}/api/health`, why: `wait for ${workspace.slug}` })),
|
|
408
408
|
];
|
|
@@ -20,18 +20,18 @@ limixbot doctor --host [--data-dir DIR] [--port 8799] [--domain HOST]
|
|
|
20
20
|
Check this Linux machine can run the server and the bots' sandbox: the system, Docker or Podman, user
|
|
21
21
|
namespaces, seccomp, cgroup v2, free disk, size, ports and the clock. Each problem says its fix.
|
|
22
22
|
Exit 0 ready (warnings allowed), 7 something is missing. On macOS and Windows it says it is for Linux.`,
|
|
23
|
-
bots: "
|
|
24
|
-
channels: "
|
|
25
|
-
models: "
|
|
26
|
-
messages: `
|
|
23
|
+
bots: "limixbot bots\n Your bots and what each is doing.",
|
|
24
|
+
channels: "limixbot channels\n Your rooms (group chats) and who is in them.",
|
|
25
|
+
models: "limixbot models\n The engines and the models each offers (use them as INSTANCE/MODEL).",
|
|
26
|
+
messages: `limixbot messages TARGET [--limit 30]\n The latest messages of a conversation (at most 200).
|
|
27
27
|
${T}`,
|
|
28
|
-
send: `
|
|
28
|
+
send: `limixbot send TARGET (TEXT | --text TEXT | --message-file FILE | -) [--task new|current|ID] [--title T] [--send-id ID] [--dry-run]
|
|
29
29
|
Send one message and return at once. It goes to the conversation the bot or room has open (--task current,
|
|
30
30
|
the default), to a new one (--task new, titled by --title or the message's first line), or to --task ID.
|
|
31
31
|
It says which conversation it went to. The same --send-id never sends twice.
|
|
32
32
|
${T}`,
|
|
33
|
-
"send-channel": "
|
|
34
|
-
run: `
|
|
33
|
+
"send-channel": "limixbot send-channel --channel ID (TEXT | --text TEXT) [--task new|current|ID] [--title T] [--dry-run]\n The same as send, for a room named by id.",
|
|
34
|
+
run: `limixbot run TARGET (TEXT | --message-file FILE | -) [--task new|current|ID] [--title T]
|
|
35
35
|
[--wait job|turn|none] [--timeout 30m] [--on-input exit|wait|stop] [--on-timeout leave|stop]
|
|
36
36
|
[--strict] [--export DIR [--force]]
|
|
37
37
|
Give a bot or room one job and wait until it, and every teammate it asked, is done.
|
|
@@ -42,53 +42,53 @@ limixbot doctor --host [--data-dir DIR] [--port 8799] [--domain HOST]
|
|
|
42
42
|
--on-timeout: leave the work running, or stop it. --strict: a teammate that failed fails the run.
|
|
43
43
|
Exit 0 done, 1 failed or stopped, 3 needs you, 4 timed out, 130 Ctrl-C (the work keeps running).
|
|
44
44
|
${T}`,
|
|
45
|
-
wait: `
|
|
45
|
+
wait: `limixbot wait TARGET [--for job|turn] [--timeout 30m] [--on-input …] [--on-timeout …] [--strict] [--since MS]
|
|
46
46
|
Wait on a conversation already running (after run --wait none, Ctrl-C or a restarted CI step).
|
|
47
47
|
--since MS (which run prints) keeps watching the same job, so one that ended meanwhile reports how.
|
|
48
48
|
Nothing running: it returns at once (exit 0). Same exit codes as run.
|
|
49
49
|
${T}`,
|
|
50
|
-
interrupt: `
|
|
50
|
+
interrupt: `limixbot interrupt TARGET [--tree] [--dry-run]\n Press Stop on a conversation. --tree also stops every teammate still working on its job.
|
|
51
51
|
${T}`,
|
|
52
|
-
"new-bot": "
|
|
53
|
-
"new-channel": "
|
|
54
|
-
"set-model": "
|
|
55
|
-
edit: "
|
|
56
|
-
export: `
|
|
52
|
+
"new-bot": "limixbot new-bot NAME [--title T] [--team T] [--model INSTANCE/MODEL] [--effort E]\n Make a bot.",
|
|
53
|
+
"new-channel": "limixbot new-channel NAME --members A,B [--team T]\n Make a room from bots, by name or id.",
|
|
54
|
+
"set-model": "limixbot set-model BOT --model INSTANCE/MODEL [--effort E] [--task ID] [--dry-run]\n Change an idle bot's model (or one idle conversation's, with --task).",
|
|
55
|
+
edit: "limixbot edit BOT --message ID (TEXT | --text TEXT) [--task ID] [--dry-run]\n Rewrite an earlier message of yours and have the bot answer again from there.",
|
|
56
|
+
export: `limixbot export TARGET --out DIR [--root ID] [--since MS] [--max-files 200] [--max-screens 100] [--max-bytes 500MB] [--force]
|
|
57
57
|
Write a conversation's job to DIR: the job tree, every transcript (secrets removed),
|
|
58
58
|
the files its replies link to, and screen captures. --root keeps one job.
|
|
59
59
|
${T}`,
|
|
60
|
-
events: `
|
|
60
|
+
events: `limixbot events [--thread ID]… [--job THREAD_ID [--until-settled]] [--kind K,…] [--since CURSOR] [--screens] [--jsonl]
|
|
61
61
|
The server's live events, one JSON line each: messages, threads, bots and rooms, or the kinds --kind names
|
|
62
62
|
(--kind message,runtime adds token-level events to messages).
|
|
63
63
|
--job follows the threads of one conversation's job; --until-settled ends with it.`,
|
|
64
|
-
team: "
|
|
65
|
-
"team apply": `
|
|
64
|
+
team: "limixbot team apply FILE | team export --out FILE (see help team apply, help team export)",
|
|
65
|
+
"team apply": `limixbot team apply FILE [--dry-run | --check] [--prune] [--rotate-secrets] [--wait-idle 2m]
|
|
66
66
|
Make the workspace match a team file (YAML or JSON): teams and briefs, bots, skills, Chiefs,
|
|
67
67
|
rooms and engines. Prints the plan, then applies it; a second apply prints "No changes.".
|
|
68
68
|
--dry-run only prints the plan; --check exits 6 if anything would change. --prune deletes bots
|
|
69
69
|
and rooms the file leaves out, in teams marked prune: true. Keys come from { env } or { file },
|
|
70
70
|
and a key already set is kept unless --rotate-secrets. docs/headless-cli.md has the format.`,
|
|
71
|
-
"team export": "
|
|
72
|
-
engine: "
|
|
73
|
-
"engine set": `
|
|
71
|
+
"team export": "limixbot team export [--team NAME]… --out FILE\n Write the workspace (or some teams) as a team file; skills go beside it, keys as placeholders,\n and a key written into a soul, brief or skill is taken out.",
|
|
72
|
+
engine: "limixbot engine set KIND … | engine list (see help engine set)",
|
|
73
|
+
"engine set": `limixbot engine set KIND (--key-env VAR | --key-file FILE) [--base-url URL] [--only-claude-api] [--install] [--rotate] [--dry-run]
|
|
74
74
|
Give the workspace an engine key: claude, openai, openrouter, openai-compatible, xai, groq, greenference, modelgo, mistral or cerebras.
|
|
75
75
|
The key is never printed. One already set is kept unless --rotate. --install installs the engine's
|
|
76
76
|
command if it is not running already, so a script can run this on every start.
|
|
77
77
|
claude: the key runs every Claude bot; --only-claude-api keeps it to "Claude (API key)" bots.`,
|
|
78
|
-
"engine list": "
|
|
78
|
+
"engine list": "limixbot engine list\n The engines, whether each is ready, and which keys are set (never their values).",
|
|
79
79
|
connect: `limixbot connect [URL] [--code CODE] --out FILE [--label NAME] [--client] [--force]
|
|
80
80
|
Get a token for a workspace you reach over the network, saved to FILE (only you can read it).
|
|
81
81
|
On this computer's own server the code is made for you; elsewhere, get one from Settings → Phone.
|
|
82
82
|
Then use it: --url URL --token-file FILE (or OPENMAUSBOT_URL and OPENMAUSBOT_TOKEN).`,
|
|
83
|
-
mcp: "
|
|
84
|
-
token: "
|
|
85
|
-
"token create": `
|
|
83
|
+
mcp: "limixbot mcp\n Serve the Limix Bot MCP tools on stdin and stdout, for an agent (docs/mcp-server.md).",
|
|
84
|
+
token: "limixbot token create NAME --out FILE … | token list | token revoke ID (see help token create)",
|
|
85
|
+
"token create": `limixbot token create NAME --out FILE [--scope client|admin] [--expires 90d] [--force]
|
|
86
86
|
An access token for CI and scripts, saved to FILE (only you can read it) and never printed.
|
|
87
87
|
It ends on its date (--expires, at most the server's session limit: 180 days unless OMB_SESSION_MAX_DAYS)
|
|
88
88
|
and never renews. --scope client (the default) can chat and answer approvals; admin can change settings.
|
|
89
|
-
Then: --url URL --token-file FILE. It is listed with
|
|
90
|
-
"token list": "
|
|
91
|
-
"token revoke": "
|
|
89
|
+
Then: --url URL --token-file FILE. It is listed with limixbot sessions too.`,
|
|
90
|
+
"token list": "limixbot token list\n The access tokens, their scope, when each ends and when it was last used (never the token).",
|
|
91
|
+
"token revoke": "limixbot token revoke ID\n End an access token at once (limixbot token list shows the ids).",
|
|
92
92
|
};
|
|
93
93
|
const VERBS = {
|
|
94
94
|
doctor, bots: list, channels: list, models: list, messages, send, "send-channel": send, run: runVerb, wait: waitVerb,
|
|
@@ -9877,7 +9877,13 @@ const webhooks = new WebhookManager({
|
|
|
9877
9877
|
}, ...createWebhookRoomPost({ store, cfg, roomTalks })
|
|
9878
9878
|
});
|
|
9879
9879
|
const webhookRequests = new WebhookRequestService({ store, webhooks, botName: (botId) => store.bot(botId)?.name ?? "the bot" });
|
|
9880
|
-
const botApi = createBotApiHost({ store, startTurn, threadBusy, careFacts: (botId, message) => { const bot = store.bot(botId); return bot ? industryGuestFacts(bot, message, servers => managedPolicy.filterMcp(servers)) : Promise.resolve(undefined); }, canStart: (botId, threadId) => canAdmitDirectTurn(botId, threadId, false),
|
|
9880
|
+
const botApi = createBotApiHost({ store, startTurn, threadBusy, careFacts: (botId, message) => { const bot = store.bot(botId); return bot ? industryGuestFacts(bot, message, servers => managedPolicy.filterMcp(servers)) : Promise.resolve(undefined); }, canStart: (botId, threadId) => canAdmitDirectTurn(botId, threadId, false), channelModelChanging: (botId, threadId) => {
|
|
9881
|
+
const selection = threadId ? turnSelection(botId, threadId) : store.bot(botId)?.modelSelection;
|
|
9882
|
+
return Boolean(store.bot(botId)?.approvalGrant || selection && providerInstancesChanging.has(selection.instanceId));
|
|
9883
|
+
}, canConfine: (botId, threadId) => {
|
|
9884
|
+
const selection = threadId ? turnSelection(botId, threadId) : store.bot(botId)?.modelSelection;
|
|
9885
|
+
return registry.get(selection?.instanceId ?? "")?.adapter.capabilities.guestTurns === "confined";
|
|
9886
|
+
}, discard: (botId, threadId) => { store.deleteTask(botId, threadId); }, included: () => !cloudPlanTier.starter(), opened: (threadId) => { if (CLOUD_OWNER_KEY)
|
|
9881
9887
|
threadStarters.set(threadId, CLOUD_OWNER_KEY); }, hooksBaseUrl: () => webhookIngressStatus().baseUrl, manageRefusal: (auth, botId) => auth.scopes.includes("admin") || (CLOUD_TEAM && levelOf(auth, botId) === "edit") ? null : refusalFor(store.bot(botId)?.name ?? "this bot", "edit").error, claimRequest: () => { cloudPower?.arrived("/hooks", {}); moveFreeze.assertTurns(); return workspaceMaintenance.request(); }, record: (auth, row) => appendAdminAction(DATA_DIR, { ...row, actor: decisionActorFor(auth) }) });
|
|
9882
9888
|
const appTriggers = createAppTriggerHost({ store, webhooks, webhookBase: () => webhookIngressStatus().baseUrl, routines: () => routines, botState: unattendedDispatchState, timeZone: routineTimeZone, emit: broadcast, connectionMode: () => composio.connectionMode(cfg),
|
|
9883
9889
|
access: composio.brokerAccess, connectedApps: () => composio.connectedServices(cfg), visibleBot: (auth, botId) => visibleTo(viewerFor(auth)).bot(botId),
|
|
@@ -9896,11 +9902,11 @@ try {
|
|
|
9896
9902
|
claimRequest: () => { cloudPower?.arrived("/hooks", {}); moveFreeze.assertTurns(); return workspaceMaintenance.request(); }, door: botApi.door,
|
|
9897
9903
|
});
|
|
9898
9904
|
const advertised = WEBHOOK_PUBLIC_URL ? ` (advertised as ${webhookIngress.baseUrl})` : "";
|
|
9899
|
-
console.log(`
|
|
9905
|
+
console.log(`limixbot webhook receiver on http://${webhookIngress.host}:${webhookIngress.port}${webhookIngress.socketServer ? ` and ${process.env.OMB_WEBHOOK_SOCKET?.trim()}` : ""}${advertised}`);
|
|
9900
9906
|
}
|
|
9901
9907
|
catch (error) {
|
|
9902
9908
|
webhookIngressError = error instanceof Error ? error.message : String(error);
|
|
9903
|
-
console.error(`
|
|
9909
|
+
console.error(`limixbot webhook receiver unavailable: ${webhookIngressError}`);
|
|
9904
9910
|
}
|
|
9905
9911
|
const webhookIngressStatus = () => ({
|
|
9906
9912
|
available: Boolean(webhookIngress),
|
|
@@ -16119,7 +16125,7 @@ server.listen(PORT, listenHost(server), async () => {
|
|
|
16119
16125
|
companyRuntimeReady();
|
|
16120
16126
|
cloudHealth?.speed.ready();
|
|
16121
16127
|
void tailnetShare.start(process.env);
|
|
16122
|
-
console.log(`
|
|
16128
|
+
console.log(`limixbot server on http://127.0.0.1:${PORT}`);
|
|
16123
16129
|
personWaits.boot();
|
|
16124
16130
|
browserSweep.start();
|
|
16125
16131
|
startCloudTeamPolicy({ cloudHome: CLOUD_HOME, dataDir: DATA_DIR, managed: managedPolicy, sessions });
|
|
@@ -15,6 +15,7 @@ const BIN = /^[a-z0-9][a-z0-9_.-]{0,79}$/i;
|
|
|
15
15
|
const object = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
16
16
|
export function extractSkillRequirements(text) {
|
|
17
17
|
const out = [];
|
|
18
|
+
const optionalKeys = new Set();
|
|
18
19
|
const add = (kind, value, evidence) => {
|
|
19
20
|
if (typeof value !== "string" || !value.trim())
|
|
20
21
|
return;
|
|
@@ -56,6 +57,12 @@ export function extractSkillRequirements(text) {
|
|
|
56
57
|
if (!["bins", "tools", "npm", "packages", "python", "pip", "env", "mcp"].includes(key))
|
|
57
58
|
add("review", `${key}: ${JSON.stringify(req[key])}`, "SKILL.md metadata");
|
|
58
59
|
}
|
|
60
|
+
for (const [key, kind] of [["bins", "bin"], ["npm", "npm"], ["python", "python"]]) {
|
|
61
|
+
const start = out.length;
|
|
62
|
+
read(object(metadata.optionalRequirements)[key], kind, `metadata.optionalRequirements.${key}`);
|
|
63
|
+
for (const req of out.slice(start))
|
|
64
|
+
optionalKeys.add(`${req.kind}:${req.name}`);
|
|
65
|
+
}
|
|
59
66
|
if (fields.compatibility)
|
|
60
67
|
add("review", fields.compatibility, "compatibility");
|
|
61
68
|
}
|
|
@@ -106,7 +113,7 @@ export function extractSkillRequirements(text) {
|
|
|
106
113
|
add("review", line.trim(), "Requirements mentioned in skill instructions");
|
|
107
114
|
}
|
|
108
115
|
const unique = new Map(out.map((req) => [`${req.kind}:${req.name}:${req.required ?? ""}`, req]));
|
|
109
|
-
return [...unique.values()];
|
|
116
|
+
return [...unique.values()].map(req => optionalKeys.has(`${req.kind}:${req.name}`) ? { ...req, optional: true } : req);
|
|
110
117
|
}
|
|
111
118
|
export function findSkillBinary(name, dirs, platform = process.platform) {
|
|
112
119
|
if (!BIN.test(name))
|
|
@@ -29,8 +29,8 @@ const READS = new Set(["GET", "HEAD", "OPTIONS"]);
|
|
|
29
29
|
/** What a frozen copy keeps once its workspace is deleted: the marker, this server's identity, Files, downloaded tools
|
|
30
30
|
* and caches, and its own runtime files. Everything else, credentials included, is the person's workspace. */
|
|
31
31
|
const DEVICE_STATE = new Set(["moved.json", "environment-id", "sync", "tools", "cache", ".cache", "tmp", ".tmp", "dist-native", "tunnel-runtime",
|
|
32
|
-
".limixbot-server-child", "openmausbot-server.lease"]);
|
|
33
|
-
const kept = (name) => DEVICE_STATE.has(name) ||
|
|
32
|
+
".limixbot-server-child", ".openmausbot-server-child", "openmausbot-server.lease", "limixbot-server.lease"]);
|
|
33
|
+
const kept = (name) => DEVICE_STATE.has(name) || /^(?:limixbot|openmausbot)-server\.lease\./.test(name);
|
|
34
34
|
/** Switches off every automation that is on, or only those named by key ("routine:<id>", "call:<id>", "webhook:<id>",
|
|
35
35
|
* "app-event:<id>", "wait:<id>"); the person can switch each on again by hand, and a wait is cancelled. Done while frozen,
|
|
36
36
|
* so none of them runs once the freeze lifts. One that can't be switched off is logged, never a reason to stay frozen.
|
|
@@ -161,7 +161,7 @@ export function createBotPackageExport(input) {
|
|
|
161
161
|
enabledAfterInstall: false,
|
|
162
162
|
}];
|
|
163
163
|
});
|
|
164
|
-
const id = portableKey(input.name, "
|
|
164
|
+
const id = portableKey(input.name, "limix-package", new Set());
|
|
165
165
|
const agents = bots.map((bot) => {
|
|
166
166
|
const appearance = { color: bot.color };
|
|
167
167
|
if (bot.mascotExpression)
|
|
@@ -634,7 +634,7 @@ export function createTeamPackageExport(input) {
|
|
|
634
634
|
const exportedRoutines = new Set(routines.map((routine) => routine.key));
|
|
635
635
|
return {
|
|
636
636
|
document,
|
|
637
|
-
filename: `${document.package.id}-${document.package.release}.
|
|
637
|
+
filename: `${document.package.id}-${document.package.release}.limix.json`,
|
|
638
638
|
redacted: [...new Set([...addressRedactions, ...redacted])],
|
|
639
639
|
skipped,
|
|
640
640
|
published: {
|
|
@@ -720,7 +720,7 @@ export function createLibraryPackageExport(input) {
|
|
|
720
720
|
}
|
|
721
721
|
return {
|
|
722
722
|
document,
|
|
723
|
-
filename: `${document.package.id}-${document.package.release}.
|
|
723
|
+
filename: `${document.package.id}-${document.package.release}.limix.json`,
|
|
724
724
|
redacted,
|
|
725
725
|
skipped,
|
|
726
726
|
published: { packageId, lastRelease: release },
|
|
@@ -3,7 +3,7 @@ import { createHash } from "node:crypto";
|
|
|
3
3
|
import { existsSync, realpathSync } from "node:fs";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { basename, dirname, join, posix, resolve, win32 } from "node:path";
|
|
6
|
-
const FOLDER = "
|
|
6
|
+
const FOLDER = "limixbot-sentinel";
|
|
7
7
|
export function defaultSentinelOut(dataDir, platform = process.platform, home = homedir(), env = process.env) {
|
|
8
8
|
const path = platform === "win32" ? win32 : posix;
|
|
9
9
|
const state = env.XDG_STATE_HOME && path.isAbsolute(env.XDG_STATE_HOME) ? env.XDG_STATE_HOME : path.join(home, ".local", "state");
|
|
@@ -57,7 +57,7 @@ export function runServiceCommand(input, io) {
|
|
|
57
57
|
home,
|
|
58
58
|
bindsLowPorts: Boolean(input.domain),
|
|
59
59
|
...(input.label ? { label: input.label } : {}),
|
|
60
|
-
...(script !== input.script ? { cliPrefix: "npx
|
|
60
|
+
...(script !== input.script ? { cliPrefix: "npx limixbot" } : {}),
|
|
61
61
|
};
|
|
62
62
|
const rendered = platform === "darwin" ? launchdPlist(spec) : systemdUnit(spec);
|
|
63
63
|
mkdirSync(input.dataDir, { recursive: true, mode: 0o700 });
|
|
@@ -84,10 +84,10 @@ function pinnedCopy(input, io) {
|
|
|
84
84
|
version = undefined;
|
|
85
85
|
}
|
|
86
86
|
const prefix = join(input.dataDir, "app", version ?? "latest");
|
|
87
|
-
const command = `npm install --prefix ${prefix}
|
|
88
|
-
io.log(`this run comes from npx's cache, which npm prunes: installing
|
|
87
|
+
const command = `npm install --prefix ${prefix} limixbot@${version ?? "latest"}`;
|
|
88
|
+
io.log(`this run comes from npx's cache, which npm prunes: installing limixbot ${version ?? ""} into ${prefix} for the service`.replace(" ", " "));
|
|
89
89
|
const installed = (input.installCopy ?? installWithNpm)(prefix, version ?? "latest");
|
|
90
|
-
const script = join(prefix, "node_modules", "
|
|
90
|
+
const script = join(prefix, "node_modules", "limixbot", "dist-server", "limixbot.js");
|
|
91
91
|
if (installed && (input.exists ?? existsSync)(script))
|
|
92
92
|
return script;
|
|
93
93
|
io.error(`could not install that copy. Run this, then the same service install command again from it:\n ${command}\n node ${script} service install …`);
|
|
@@ -96,7 +96,7 @@ function pinnedCopy(input, io) {
|
|
|
96
96
|
function installWithNpm(prefix, version) {
|
|
97
97
|
mkdirSync(prefix, { recursive: true, mode: 0o700 });
|
|
98
98
|
const npm = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
99
|
-
return spawnSync(npm, ["install", "--prefix", prefix, `
|
|
99
|
+
return spawnSync(npm, ["install", "--prefix", prefix, `limixbot@${version}`, "--no-audit", "--no-fund"], { stdio: "inherit" }).status === 0;
|
|
100
100
|
}
|
|
101
101
|
function bundleHasSentinel(script) {
|
|
102
102
|
try {
|
|
@@ -163,6 +163,6 @@ function runSentinelService(input, platform, home, io) {
|
|
|
163
163
|
io.log("");
|
|
164
164
|
io.log(`issues: ${join(out, "issues.jsonl")}`);
|
|
165
165
|
io.log(`logs: ${platform === "darwin" ? join(out, "sentinel.log") : "journalctl --user -u openmausbot-sentinel"}`);
|
|
166
|
-
io.log("after an app update or a Node upgrade, check the schedule still points at both:
|
|
166
|
+
io.log("after an app update or a Node upgrade, check the schedule still points at both: limixbot sentinel --check-install");
|
|
167
167
|
return 0;
|
|
168
168
|
}
|
|
@@ -16,7 +16,7 @@ export function serviceCommand(spec) {
|
|
|
16
16
|
}
|
|
17
17
|
export function systemdUnit(spec) {
|
|
18
18
|
const lines = [
|
|
19
|
-
"# Written by `
|
|
19
|
+
"# Written by `limixbot service install`. Re-run it to change the options.",
|
|
20
20
|
"[Unit]",
|
|
21
21
|
`Description=Limix Bot${spec.label ? ` (${spec.label})` : ""}`,
|
|
22
22
|
"After=network-online.target",
|
|
@@ -88,7 +88,7 @@ export function launchdPlist(spec) {
|
|
|
88
88
|
export function unstableInstallWarning(script) {
|
|
89
89
|
const normalized = script.replace(/\\/g, "/");
|
|
90
90
|
if (/\/_npx\//.test(normalized) || /\/\.npm\/_npx\//.test(normalized)) {
|
|
91
|
-
return `this command runs from an npx cache (${dirname(script)}), which npm may delete at any time. Install it permanently first (npm install -g
|
|
91
|
+
return `this command runs from an npx cache (${dirname(script)}), which npm may delete at any time. Install it permanently first (npm install -g limixbot) and run \`limixbot service install\` from that install.`;
|
|
92
92
|
}
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
@@ -119,10 +119,10 @@ export const SENTINEL_INTERVAL_SECONDS = 120;
|
|
|
119
119
|
/** The app's executable run as Node (ELECTRON_RUN_AS_NODE) survives app updates and Node upgrades; null for an app predating Sentinel. */
|
|
120
120
|
export function shippedSentinelCli(platform, home, exists, hasSentinel = () => true) {
|
|
121
121
|
const candidates = platform === "darwin"
|
|
122
|
-
? ["/Applications/
|
|
123
|
-
node: join(app, "Contents", "MacOS", "Limix Bot"), script: join(app, "Contents", "Resources", "server", "
|
|
122
|
+
? ["/Applications/Limix Bot.app", join(home, "Applications", "Limix Bot.app")].map((app) => ({
|
|
123
|
+
node: join(app, "Contents", "MacOS", "Limix Bot"), script: join(app, "Contents", "Resources", "server", "limixbot.js"),
|
|
124
124
|
}))
|
|
125
|
-
: platform === "linux" ? [{ node: "/opt/OpenMausBot/openmausbot", script: "/opt/OpenMausBot/resources/server/
|
|
125
|
+
: platform === "linux" ? [{ node: "/opt/OpenMausBot/openmausbot", script: "/opt/OpenMausBot/resources/server/limixbot.js" }] : [];
|
|
126
126
|
return candidates.find((cli) => exists(cli.node) && exists(cli.script) && hasSentinel(cli.script)) ?? null;
|
|
127
127
|
}
|
|
128
128
|
export function sentinelCommand(spec) {
|
|
@@ -38,7 +38,7 @@ export async function synthesizeSystem(text, voiceId, run = defaultRun) {
|
|
|
38
38
|
const trimmed = text.trim();
|
|
39
39
|
if (!trimmed)
|
|
40
40
|
return { bytes: new Uint8Array(), mime: "audio/wav" };
|
|
41
|
-
const dir = await mkdtemp(join(tmpdir(), "
|
|
41
|
+
const dir = await mkdtemp(join(tmpdir(), "limixbot-say-"));
|
|
42
42
|
const out = join(dir, "utterance.wav");
|
|
43
43
|
try {
|
|
44
44
|
const args = ["-o", out, "--data-format=LEI16@22050"];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// A self-hosted server cannot replace itself, so this only says whether a newer version exists and how this install is updated.
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { join, sep } from "node:path";
|
|
4
|
-
export const LATEST_RELEASE_URL = "https://api.github.com/repos/
|
|
4
|
+
export const LATEST_RELEASE_URL = "https://api.github.com/repos/leomieo/limix-bot/releases/latest";
|
|
5
5
|
/** Written by .github/workflows/promote-stable.yml: the released version our own Clouds have run for 48 hours. */
|
|
6
|
-
export const STABLE_CHANNEL_URL = "https://raw.githubusercontent.com/
|
|
6
|
+
export const STABLE_CHANNEL_URL = "https://raw.githubusercontent.com/leomieo/limix-bot/channels/stable.json";
|
|
7
7
|
const CACHE_MS = 60 * 60_000;
|
|
8
8
|
/** How long the last answer stands in when the channel cannot be read: an outage of GitHub is no reason to say nothing. */
|
|
9
9
|
const STALE_MS = 24 * 60 * 60_000;
|
|
@@ -19,7 +19,7 @@ export function updateCommand(install, target) {
|
|
|
19
19
|
switch (install) {
|
|
20
20
|
case "docker": return { command: target && !target.stable ? `git pull && ./update.sh --version ${target.version}` : "git pull && ./update.sh", restart: false };
|
|
21
21
|
case "podman": return { command: "git pull && cd deploy/podman && PODMAN_COMPOSE_PROVIDER=podman-compose podman compose --env-file .env -f compose.yaml up -d --build", restart: false };
|
|
22
|
-
case "npm": return { command: `npm install -g
|
|
22
|
+
case "npm": return { command: `npm install -g limixbot@${target?.version ?? "latest"}`, restart: true };
|
|
23
23
|
case "git": return { command: "git pull && pnpm install", restart: true };
|
|
24
24
|
default: return undefined;
|
|
25
25
|
}
|
|
@@ -89,7 +89,7 @@ export function createUpdateChecker(options) {
|
|
|
89
89
|
...updateCommand(options.install),
|
|
90
90
|
});
|
|
91
91
|
const ask = (url) => fetchJson(url, {
|
|
92
|
-
headers: { accept: "application/vnd.github+json", "user-agent": "
|
|
92
|
+
headers: { accept: "application/vnd.github+json", "user-agent": "limixbot-update-check" },
|
|
93
93
|
signal: AbortSignal.timeout(8_000),
|
|
94
94
|
});
|
|
95
95
|
/** Null until a first version has been promoted: the record does not exist yet. */
|
|
@@ -29,7 +29,7 @@ const EXCLUDED = new Set([
|
|
|
29
29
|
".limixbot-server-child", "environment-id", "sessions.json", "tunnel-account.json",
|
|
30
30
|
"team-computers.json",
|
|
31
31
|
"vm-working-folders.json",
|
|
32
|
-
"openmausbot-server.lease", "box-create-requests.lock", "messages.db-wal", "messages.db-shm",
|
|
32
|
+
".limixbot-server-child", ".openmausbot-server-child", "openmausbot-server.lease", "limixbot-server.lease", "box-create-requests.lock", "messages.db-wal", "messages.db-shm",
|
|
33
33
|
"runtime.db-wal", "runtime.db-shm",
|
|
34
34
|
"decider-log",
|
|
35
35
|
"cloud-owner.json",
|
|
@@ -57,7 +57,7 @@ const EXCLUSION_NOTES = [
|
|
|
57
57
|
];
|
|
58
58
|
const RESTORE_WARNING = "Restoring pauses routines, webhooks and calendar calls, ends every wait, and does not resume pending delegations, queued chat messages or queued runs. Definitions and historical receipts are retained; review before enabling them again.";
|
|
59
59
|
function excluded(name) {
|
|
60
|
-
return EXCLUDED.has(name) || excludedWorkspaceAuthPath(name) ||
|
|
60
|
+
return EXCLUDED.has(name) || excludedWorkspaceAuthPath(name) || /^(?:limixbot|openmausbot)-server\.lease\./.test(name) || name.startsWith("box-create-requests.lock.") || /^perm-[A-Za-z0-9_-]+\.sock$/.test(name);
|
|
61
61
|
}
|
|
62
62
|
function forbiddenArchivePath(path) {
|
|
63
63
|
const folded = path.toLowerCase();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { createRequire as __ombCreateRequire } from "node:module";
|
|
2
2
|
const require = __ombCreateRequire(import.meta.url);
|
|
3
|
-
import{spawn}from"node:child_process";import{existsSync as existsSync2,realpathSync}from"node:fs";import{homedir}from"node:os";import{dirname,join as join2,resolve}from"node:path";import{fileURLToPath,pathToFileURL}from"node:url";import{freemem,totalmem}from"node:os";var MB=1024*1024;function boxMemoryFrom(constrained,total){let cgroupLimit=constrained>0&&constrained<total?constrained:null;return{bytes:cgroupLimit??total,cgroupLimit}}var box;function boxMemory(){return box??=boxMemoryFrom(process.constrainedMemory?.()??0,totalmem()),box}var HEAP_SHARE=.6,HEAP_MIN_MB=128,HEAP_MAX_MB=4096;function heapSizeArgs(cgroupLimit,nodeOptions){return cgroupLimit===null||/--max[-_]old[-_]space[-_]size/.test(nodeOptions??"")?[]:[`--max-old-space-size=${Math.min(HEAP_MAX_MB,Math.max(HEAP_MIN_MB,Math.floor(cgroupLimit*HEAP_SHARE/MB)))}`]}import{execFileSync}from"node:child_process";import{existsSync,linkSync,mkdirSync,readdirSync,readFileSync,readlinkSync,renameSync,unlinkSync,writeFileSync}from"node:fs";import{hostname,uptime}from"node:os";import{join}from"node:path";var LEASE_NAME="openmausbot-server.lease",DELEGATED_CHILD_DIR=".limixbot-server-child";var UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,MAX_PID=2147483647,MAX_BOOT_ID=128;var DataDirLeaseError=class extends Error{name="DataDirLeaseError"};function leaseError(message,cause){return Object.assign(new DataDirLeaseError(message),{cause})}function isPid(value){return Number.isInteger(value)&&value>0&&value<=MAX_PID}var cachedBootSession;function readBootSession(){try{if(process.platform==="linux")return normalizeBootId(readFileSync("/proc/sys/kernel/random/boot_id","utf8"));if(process.platform==="darwin")return normalizeBootId(execFileSync("/usr/sbin/sysctl",["-n","ker\
|
|
3
|
+
import{spawn}from"node:child_process";import{existsSync as existsSync2,realpathSync}from"node:fs";import{homedir}from"node:os";import{dirname,join as join2,resolve}from"node:path";import{fileURLToPath,pathToFileURL}from"node:url";import{freemem,totalmem}from"node:os";var MB=1024*1024;function boxMemoryFrom(constrained,total){let cgroupLimit=constrained>0&&constrained<total?constrained:null;return{bytes:cgroupLimit??total,cgroupLimit}}var box;function boxMemory(){return box??=boxMemoryFrom(process.constrainedMemory?.()??0,totalmem()),box}var HEAP_SHARE=.6,HEAP_MIN_MB=128,HEAP_MAX_MB=4096;function heapSizeArgs(cgroupLimit,nodeOptions){return cgroupLimit===null||/--max[-_]old[-_]space[-_]size/.test(nodeOptions??"")?[]:[`--max-old-space-size=${Math.min(HEAP_MAX_MB,Math.max(HEAP_MIN_MB,Math.floor(cgroupLimit*HEAP_SHARE/MB)))}`]}import{execFileSync}from"node:child_process";import{existsSync,linkSync,mkdirSync,readdirSync,readFileSync,readlinkSync,renameSync,unlinkSync,writeFileSync}from"node:fs";import{hostname,uptime}from"node:os";import{join}from"node:path";var LEASE_NAME="limixbot-server.lease",LEGACY_LEASE_NAME="openmausbot-server.lease",DELEGATED_CHILD_DIR=".limixbot-server-child";var UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,MAX_PID=2147483647,MAX_BOOT_ID=128;var DataDirLeaseError=class extends Error{name="DataDirLeaseError"};function leaseError(message,cause){return Object.assign(new DataDirLeaseError(message),{cause})}function isPid(value){return Number.isInteger(value)&&value>0&&value<=MAX_PID}var cachedBootSession;function readBootSession(){try{if(process.platform==="linux")return normalizeBootId(readFileSync("/proc/sys/kernel/random/boot_id","utf8"));if(process.platform==="darwin")return normalizeBootId(execFileSync("/usr/sbin/sysctl",["-n","ker\
|
|
4
4
|
n.bootsessionuuid"],{encoding:"utf8",timeout:5e3,stdio:["ignore","pipe","ignore"]}))}catch{}return null}function normalizeBootId(value){let id=String(value).trim();return id.length>0&&id.length<=MAX_BOOT_ID&&!/[^0-9A-Za-z:_.-]/.test(id)?id:null}function bootSession(){return cachedBootSession===void 0&&(cachedBootSession=readBootSession()),cachedBootSession}function isBootIdentity(value){return value===null||typeof value=="string"&&normalizeBootId(value)===value}var cachedPidNamespace;function readPidNamespace(){if(process.platform!=="linux")return null;try{return/^pid:\[([1-9][0-9]{0,19})\]$/.exec(readlinkSync("/proc/self/ns/pid"))?.[1]??null}catch{return null}}function pidNamespace(){return cachedPidNamespace===void 0&&(cachedPidNamespace=readPidNamespace()),cachedPidNamespace}function isPidNamespace(value){return value===null||typeof value=="str\
|
|
5
5
|
ing"&&/^[1-9][0-9]{0,19}$/.test(value)}function isStartTicks(value){return value===null||Number.isSafeInteger(value)&&value>=0}function isLeaseOwner(value){return!value||typeof value!="object"||Array.isArray(value)?!1:value.version===1&&isPid(value.pid)&&typeof value.host=="string"&&value.host.length>0&&value.host.length<=255&&!/[\r\n\0]/.test(value.host)&&typeof value.token=="string"&&UUID.test(value.token)&&typeof value.createdAt=="number"&&Number.isFinite(value.createdAt)&&value.createdAt>0&&(value.boot===void 0||isBootIdentity(value.boot))&&(value.uptime===void 0||Number.isInteger(value.uptime)&&value.uptime>=0)&&(value.
|
|
6
6
|
ns===void 0||isPidNamespace(value.ns))&&(value.start===void 0||isStartTicks(value.start))}function parseRecord(path,invalidMessage,validate){let raw;try{raw=readFileSync(path,"utf8")}catch(error){if(error?.code==="ENOENT")return null;throw leaseError("Limix Bot cannot read the data-directory lease; refusing to start to protect its state.",error)}let record;try{record=JSON.parse(raw)}catch(error){throw leaseError(invalidMessage,error)}if(!validate(record))throw leaseError(invalidMessage);return record}function readOwner(path){return parseRecord(path,"The Limix Bot data-directory lease\
|
|
7
7
|
is invalid; refusing to start to protect its state.",isLeaseOwner)}function unlinkExact(path,message){try{unlinkSync(path)}catch(error){if(error?.code!=="ENOENT")throw leaseError(message,error)}}function validateDataDir(dataDir){if(typeof dataDir!="string"||dataDir.trim().length===0||/[\r\n\0]/.test(dataDir))throw leaseError("Limix Bot cannot lease an invalid data directory.");return dataDir}function clearRecordsFromEarlierRunOfThisContainer(dataDir){let boot=bootSession(),ns=pidNamespace();return boot===null||ns===null?[]:clearRecords(dataDir,record=>record.host===hostname()&&record.boot===boot&&typeof record.ns=="string"&&record.ns!==ns)}function clearRecords(dataDir,stale){validateDataDir(dataDir);let entries;try{entries=readdirSync(dataDir)}catch(error){if(error?.code==="ENOENT")return[];throw leaseError("Limix Bot cannot read its data directory.",error)}let paths=[join(dataDir,
|
|
8
|
-
LEASE_NAME),join(dataDir,DELEGATED_CHILD_DIR,LEASE_NAME),...entries.filter(name=>name.startsWith(`${
|
|
8
|
+
LEASE_NAME),join(dataDir,DELEGATED_CHILD_DIR,LEASE_NAME),join(dataDir,LEGACY_LEASE_NAME),join(dataDir,DELEGATED_CHILD_DIR,LEGACY_LEASE_NAME),join(dataDir,".openmausbot-server-child",LEGACY_LEASE_NAME),...entries.filter(name=>[LEASE_NAME,LEGACY_LEASE_NAME].some(prefix=>name.startsWith(`${prefix}.reap-`))).map(name=>join(dataDir,name))],cleared=[];for(let path of paths){let record=readOwner(path);!record||!stale(record)||(unlinkExact(path,"Limix Bot could not remove the data-directory record anoth\
|
|
9
|
+
er machine left."),cleared.push({path,host:record.host,pid:record.pid}))}return cleared}function restartPolicy(now=Date.now){let restarts=0,startedAt=now();return{again(code,stopping=!1){return now()-startedAt>=6e4&&(restarts=0),stopping||code!==75||restarts>=5?!1:(restarts++,startedAt=now(),!0)}}}function serverCommand(here,env,options={}){let bootstrap=join2(here,"desktop-entry.mjs"),cached=(options.exists??existsSync2)(bootstrap),dataDir=env.OMB_DATA_DIR||join2(homedir(),".limixbot");return{args:[...heapSizeArgs((options.box??boxMemory()).cgroupLimit,env.NODE_OPTIONS),cached?bootstrap:join2(here,"index.js")],env:cached?{...env,OMB_SERVER_COMPILE_CACHE:join2(dataDir,"cache","node-compile")}:env}}function superviseServer(start,options={}){let signals=options.signals??process,now=options.
|
|
9
10
|
now??Date.now;return new Promise(done=>{let child,stopping=!1,policy=restartPolicy(now),pass=signal=>()=>{stopping=!0,child.kill(signal)},onTerm=pass("SIGTERM"),onInt=pass("SIGINT"),finish=code=>{signals.off("SIGTERM",onTerm),signals.off("SIGINT",onInt),done(code)},run=()=>{child=start(),child.once("error",()=>finish(1)),child.once("exit",(code,signal)=>{if(policy.again(code,stopping)){console.log("Limix Bot is starting again to finish installing a copy from the desktop app\u2026"),run();return}
|
|
10
11
|
finish(code??(stopping&&(signal==="SIGTERM"||signal==="SIGINT")?0:1))})};signals.on("SIGTERM",onTerm),signals.on("SIGINT",onInt),run()})}function isEntry(){try{return!!process.argv[1]&&import.meta.url===pathToFileURL(realpathSync(resolve(process.argv[1]))).href}catch{return!1}}if(isEntry()){let dataDir=process.env.OMB_DATA_DIR||join2(homedir(),".limixbot");try{for(let{path,pid}of clearRecordsFromEarlierRunOfThisContainer(dataDir))console.log(`Removed ${path}, left by this container's server (pro\
|
|
11
12
|
cess ${pid}) when it stopped without closing.`)}catch(error){console.warn(`The data folder's lease could not be checked: ${error instanceof Error?error.message:String(error)}`)}let server=serverCommand(dirname(fileURLToPath(import.meta.url)),process.env);superviseServer(()=>spawn(process.execPath,server.args,{stdio:"inherit",env:server.env})).then(code=>{process.exitCode=code})}export{serverCommand,superviseServer};
|