limixbot 0.3.105 → 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/cli.js +1 -1
- package/dist/assets/{ActivityPanel-Cbm_MV4_.js → ActivityPanel-Dwy_8Ssw.js} +1 -1
- package/dist/assets/{App-CdDhOj9Z.js → App-DER9VjCj.js} +11 -11
- package/dist/assets/{AppEventEditor-Cbwuipry.js → AppEventEditor-DVPTS46l.js} +1 -1
- package/dist/assets/{BotSettingsDialog-C8LF47q9.js → BotSettingsDialog-CBMhMWpP.js} +1 -1
- package/dist/assets/{BrowserPanel-Xb2e7PXu.js → BrowserPanel-cuhGe02X.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-BNS5E_18.js → BrowserProfilesManager-DCwRz57j.js} +1 -1
- package/dist/assets/{CloudAddDialog-f84YQfvX.js → CloudAddDialog-jmGkr7Un.js} +1 -1
- package/dist/assets/{ComputerFilesPane-BsZ9OtSJ.js → ComputerFilesPane-8K2V3RhW.js} +1 -1
- package/dist/assets/{ComputerPanel-a3_n-Lx2.js → ComputerPanel-pAbCBPNK.js} +2 -2
- package/dist/assets/{DataPanel-C3buf1SP.js → DataPanel-Cqk9kG4Y.js} +1 -1
- package/dist/assets/{GrokMoveDialog-B43cbS0W.js → GrokMoveDialog-CpK4k-BS.js} +1 -1
- package/dist/assets/{InspectorPanel-Cs9FS_iX.js → InspectorPanel-Cy2voxQ9.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-C1Yic9QC.js → KeyboardShortcutsModal-CLLeb5RM.js} +1 -1
- package/dist/assets/{LimixResizeHandles-DKF6WDfT.js → LimixResizeHandles-DN3T-Sxj.js} +1 -1
- package/dist/assets/{LiveDesktop-xm24_62C.js → LiveDesktop-D1zL4cXe.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-B91eNABI.js → LocalVmWorkspace-OPstoi6j.js} +1 -1
- package/dist/assets/{MacLocalControl-CurQWXB4.js → MacLocalControl-BAU_Mxfl.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-8kMe2rTR.js → MarkdownFilePreview-DiDEa2VP.js} +1 -1
- package/dist/assets/{NewBotDialog-dJmhmATK.js → NewBotDialog-_fhvtWem.js} +1 -1
- package/dist/assets/{PhoneAppDialog-CGplah7d.js → PhoneAppDialog-TisX6Kkd.js} +1 -1
- package/dist/assets/{PluginsPanel-Boc4Pd3r.js → PluginsPanel-mfBuYBSI.js} +1 -1
- package/dist/assets/{ProIntroduction-J0r_kMie.js → ProIntroduction-DS75WAZy.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-lJv8UpKf.js → RemoteAgentSettingsPanel-B148emwo.js} +1 -1
- package/dist/assets/{RoomPanel-C0PK6RRW.js → RoomPanel-B_RUQv3X.js} +1 -1
- package/dist/assets/{RoutinesPage-DMdxfslh.js → RoutinesPage-Bt3nAr6K.js} +1 -1
- package/dist/assets/{SettingsModal-DtTIkNSu.js → SettingsModal-BjEnjf-l.js} +1 -1
- package/dist/assets/{ShareTeamDialog-BVjQQgRH.js → ShareTeamDialog-CFdVjk7Z.js} +1 -1
- package/dist/assets/{SignedInSites--OK-tl6k.js → SignedInSites-ChIudtJC.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-bC-6F_Y3.js → TeamLibraryPanel-C5ba9U3p.js} +1 -1
- package/dist/assets/{TeamMapPage-4zEXJFbR.js → TeamMapPage-CMv2EOnM.js} +1 -1
- package/dist/assets/{TriggersPage-BT6g9Qzg.js → TriggersPage-DAFkA0uT.js} +1 -1
- package/dist/assets/{VisibilitySection-CxIPRF7z.js → VisibilitySection-CLxd2eiH.js} +1 -1
- package/dist/assets/{WebhookTrigger-DkFSYsbI.js → WebhookTrigger-C6ySSY-L.js} +1 -1
- package/dist/assets/{WorksOnGrid-Cl8JsM01.js → WorksOnGrid-DDm8ZPUS.js} +1 -1
- package/dist/assets/{core-6oEBX5E0.js → core-Ce8mfU6p.js} +1 -1
- package/dist/assets/{import-name-lXRpvJU5.js → import-name-CzRqCqhy.js} +1 -1
- package/dist/assets/{index-DJS0AZbc.js → index-DQSfzGc3.js} +1 -1
- package/dist/assets/{index-Dv79GO2D.js → index-DsdqtVg4.js} +2 -2
- package/dist/assets/{mcp-servers-CQx7iElK.js → mcp-servers-DQMAYnlB.js} +1 -1
- package/dist/assets/{new-bot-DDzAckAK.js → new-bot-C23M4Uux.js} +1 -1
- package/dist/assets/{org-library-DpkG9WUs.js → org-library-Dq1l049t.js} +1 -1
- package/dist/assets/{package-format-CQ9ehT0X.js → package-format-C7ReB3QW.js} +1 -1
- package/dist/assets/{remote-desktop-panel-C-3gtWIh.js → remote-desktop-panel-Bn0lktN4.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/cloud-home-start.js +3 -3
- package/dist-server/index.js +137 -132
- package/dist-server/{openmausbot.js → limixbot.js} +195 -196
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +195 -196
- 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-agent.js +2 -2
- package/dist-server/server/fleet-cli.js +4 -4
- package/dist-server/server/fleet.js +23 -17
- package/dist-server/server/headless/main.js +27 -27
- package/dist-server/server/index.js +10 -4
- 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/dist-server/server/{openmausbot.js → limixbot.js} +0 -0
|
@@ -170,7 +170,7 @@ export function createBotApiHost(deps) {
|
|
|
170
170
|
}
|
|
171
171
|
catch (error) {
|
|
172
172
|
markRunning(botId, threadId, false);
|
|
173
|
-
if (opened)
|
|
173
|
+
if (opened && !channel?.delivery)
|
|
174
174
|
deps.discard?.(botId, threadId);
|
|
175
175
|
const busy = z.object({ code: z.enum(["thread_busy", "thread_limit"]) }).safeParse(error).success;
|
|
176
176
|
fail(busy ? 409 : 502, busy ? BUSY : COULD_NOT_ANSWER, error instanceof Error ? error.message : String(error));
|
|
@@ -207,18 +207,21 @@ export function createBotApiHost(deps) {
|
|
|
207
207
|
* Bot API caller, confined. Waits for the answer up to `waitMs`. */
|
|
208
208
|
async function askFromChannel(botId, input) {
|
|
209
209
|
const store = deps.store;
|
|
210
|
+
const savedTask = input.threadId ? store.taskByThread(botId, input.threadId) : undefined;
|
|
211
|
+
const channelThread = savedTask && Boolean(savedTask.botApi) === !input.owner ? savedTask.threadId : undefined;
|
|
212
|
+
if (deps.channelModelChanging?.(botId, channelThread))
|
|
213
|
+
failBeforeAcceptance("capacity_busy");
|
|
210
214
|
if (!input.owner) {
|
|
211
|
-
if (!
|
|
212
|
-
fail(
|
|
215
|
+
if (savedTask && !savedTask.botApi)
|
|
216
|
+
fail(404, "no such thread");
|
|
217
|
+
if (!deps.canConfine(botId, channelThread))
|
|
218
|
+
throw Object.assign(new Error(CANNOT_CONFINE), { status: 403, code: "guest_engine" });
|
|
213
219
|
let attachments = [];
|
|
214
|
-
const answer = await runCall(botId, { message: input.text, ...(
|
|
220
|
+
const answer = await runCall(botId, { message: input.text, ...(channelThread ? { thread: channelThread } : {}), wait: Math.round((input.waitMs ?? 600_000) / 1000) }, () => { }, { attachment: input.attachment, delivery: input.delivery, collect(files) { attachments = files; } });
|
|
215
221
|
const body = answer.body;
|
|
216
222
|
return { threadId: body.thread, ...(attachments.length ? { attachments } : {}), reply: body.reply ?? "", ...(body.status ? { status: body.status } : {}) };
|
|
217
223
|
}
|
|
218
|
-
let threadId =
|
|
219
|
-
const known = threadId ? store.taskByThread(botId, threadId) : undefined;
|
|
220
|
-
if (!known || known.botApi)
|
|
221
|
-
threadId = undefined;
|
|
224
|
+
let threadId = channelThread;
|
|
222
225
|
if (threadId && deps.threadBusy(botId, threadId))
|
|
223
226
|
failBeforeAcceptance("thread_busy");
|
|
224
227
|
if (!deps.canStart(botId, threadId ?? ""))
|
|
@@ -9,6 +9,7 @@ import { createCipheriv, createDecipheriv, createHash, randomBytes, timingSafeEq
|
|
|
9
9
|
import { mkdirSync, readFileSync } from "node:fs";
|
|
10
10
|
import { dirname, join } from "node:path";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
+
import { redactSecretsInText } from "../../shared/redact.js";
|
|
12
13
|
import { retryableBusySchema } from "../bot-api.js";
|
|
13
14
|
import { writeFileAtomic } from "../atomic.js";
|
|
14
15
|
import { PASS } from "../routes/table.js";
|
|
@@ -77,6 +78,19 @@ const text = (label) => ({
|
|
|
77
78
|
failed: "Bot chưa trả lời được lúc này. Thử lại sau.",
|
|
78
79
|
empty: "Bot đã làm xong nhưng không có câu trả lời bằng chữ.",
|
|
79
80
|
});
|
|
81
|
+
function channelAiFailure(error, owner) {
|
|
82
|
+
const issue = z.object({ code: z.string().optional(), detail: z.string().optional() }).safeParse(error);
|
|
83
|
+
if (!issue.success)
|
|
84
|
+
return;
|
|
85
|
+
if (issue.data.code === "guest_engine" || /too old to run this turn without a shell|kept its shell, so it can.t run this turn/i.test(issue.data.detail ?? ""))
|
|
86
|
+
return "Mô hình đang chọn chưa hỗ trợ trò chuyện với khách trên kênh này. Hãy báo chủ bot chọn mô hình hỗ trợ quyền khách trong Limix Bot.";
|
|
87
|
+
if (!owner || !issue.data.detail)
|
|
88
|
+
return;
|
|
89
|
+
if (/not (?:logged|signed) in|sign[ -]?in required|sign in again|authentication required|invalid api key|unauthorized|unauthenticated/i.test(issue.data.detail))
|
|
90
|
+
return "Tài khoản AI của mô hình đang chọn cần xác thực. Mở Cài đặt → AI trong Limix Bot để kết nối lại, rồi gửi một tin nhắn mới.";
|
|
91
|
+
if (/model (?:not found|is unavailable)|provider instance .*unavailable|model_not_found/i.test(issue.data.detail))
|
|
92
|
+
return "Mô hình đã chọn hiện không khả dụng. Hãy chọn một mô hình đang hoạt động trong cài đặt của bot rồi gửi một tin nhắn mới.";
|
|
93
|
+
}
|
|
80
94
|
const ZALO_RECEIPT = /^(?:\*\*)?(?:(?:mình|tôi|em)\s+)?đã nhận(?: được)? tin nhắn(?:\s*[::]?\s+(?:“([^”\r\n]*)”|"([^"\r\n]*)"|'([^'\r\n]*)'|‘([^’\r\n]*)’)|(?: của bạn)?(?=\s*[.!。]|\s*$))\s*[.!。]?(?:\*\*)?\s*/iu;
|
|
81
95
|
function zaloGroupReply(reply, message, hasMedia) {
|
|
82
96
|
const receipt = ZALO_RECEIPT.exec(reply);
|
|
@@ -393,8 +407,9 @@ export function createBotChannels(deps) {
|
|
|
393
407
|
catch (error) {
|
|
394
408
|
if (signal.aborted)
|
|
395
409
|
return;
|
|
396
|
-
|
|
397
|
-
|
|
410
|
+
const detail = z.object({ detail: z.string() }).safeParse(error);
|
|
411
|
+
log(`${kind}: ${redactSecretsInText(detail.success ? detail.data.detail : failure(error)).slice(0, 600)}`);
|
|
412
|
+
result = { reply: channelAiFailure(error, owner) ?? (error === mediaUnavailable ? say.mediaFailed : say.failed) };
|
|
398
413
|
}
|
|
399
414
|
finally {
|
|
400
415
|
clearInterval(typing);
|
|
@@ -187,7 +187,7 @@ export async function captureFrame(ports, target) {
|
|
|
187
187
|
const probe = await ports.probe(target);
|
|
188
188
|
if (!probe?.connected)
|
|
189
189
|
throw new Error("the browser has no open page to picture");
|
|
190
|
-
const file = join(tmpdir(), `
|
|
190
|
+
const file = join(tmpdir(), `limixbot-browser-${randomUUID()}.jpg`);
|
|
191
191
|
try {
|
|
192
192
|
closeSync(openSync(file, "wx", 0o600));
|
|
193
193
|
let answer;
|
|
@@ -74,7 +74,7 @@ export async function ensureCaddy(options) {
|
|
|
74
74
|
const digest = createHash("sha512").update(body).digest("hex");
|
|
75
75
|
if (digest !== asset.sha512)
|
|
76
76
|
throw new Error("the Caddy download failed its SHA-512 check; nothing was installed");
|
|
77
|
-
const scratch = mkdtempSync(join(tmpdir(), "
|
|
77
|
+
const scratch = mkdtempSync(join(tmpdir(), "limix-caddy-"));
|
|
78
78
|
try {
|
|
79
79
|
const archive = join(scratch, asset.name);
|
|
80
80
|
writeFileSync(archive, body, { mode: 0o600 });
|
|
@@ -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) {
|
|
@@ -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.
|
|
@@ -402,8 +408,8 @@ export function deletePlan(input) {
|
|
|
402
408
|
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
|
-
{ kind: "run", argv: ["npm", "install", "-g", "
|
|
406
|
-
...running.map((workspace) => ({ kind: "run", argv: ["systemctl", "restart",
|
|
411
|
+
{ kind: "run", argv: ["npm", "install", "-g", "limixbot@latest"], why: "install the release every workspace runs from" },
|
|
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
|
}
|
|
@@ -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 });
|