openmausbot 0.1.69 → 0.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-B2F__IRS.css +1 -0
- package/dist/assets/index-CLj3t5Ba.js +280 -0
- package/dist/assets/{index-BmHupgVJ.js → index-D1RGhLUK.js} +1 -1
- package/dist/index.html +2 -2
- package/dist-server/container-mcp.js +2 -0
- package/dist-server/drivers/agents-proxy.js +103 -0
- package/dist-server/index.js +1169 -576
- package/dist-server/local-computer-proxy.js +2 -0
- package/dist-server/openmausbot.js +456 -230
- package/dist-server/pair-cli.js +456 -230
- package/dist-server/prepare-cloudflared.js +20 -3
- package/dist-server/server/delegations.js +132 -74
- package/dist-server/server/drivers/agents-proxy.js +129 -0
- package/dist-server/server/drivers/claude-login-auth.js +102 -9
- package/dist-server/server/drivers/claude.js +11 -5
- package/dist-server/server/engine-install.js +137 -0
- package/dist-server/server/env-path.js +12 -0
- package/dist-server/server/harness/registry.js +31 -6
- package/dist-server/server/index.js +340 -22
- package/dist-server/server/peer-provenance.js +6 -2
- package/dist-server/server/routines.js +116 -55
- package/dist-server/server/steer-queue.js +20 -1
- package/dist-server/server/store.js +22 -4
- package/dist-server/server/system-prompt.js +1 -0
- package/dist-server/server/team-backup.js +18 -4
- package/dist-server/shared/team-backup.js +1 -0
- package/dist-server/vps-container-mcp.js +2 -0
- package/package.json +1 -1
- package/dist/assets/index-COp5lMnv.js +0 -279
- package/dist/assets/index-Jk7TIeyW.css +0 -1
|
@@ -49,6 +49,8 @@ var MAX_CREATED_PER_TURN = 4;
|
|
|
49
49
|
var createdThisTurn = 0;
|
|
50
50
|
var MAX_ROOM_POSTS_PER_TURN = 3;
|
|
51
51
|
var roomPostsThisTurn = 0;
|
|
52
|
+
var MAX_THREADS_PER_TURN = 5;
|
|
53
|
+
var threadsOpenedThisTurn = 0;
|
|
52
54
|
var delegationTaskIdsThisTurn = /* @__PURE__ */ new Set();
|
|
53
55
|
var WEEKDAYS = [
|
|
54
56
|
"monday",
|
|
@@ -342,6 +344,36 @@ var TOOLS = [
|
|
|
342
344
|
required: ["task_id"]
|
|
343
345
|
}
|
|
344
346
|
},
|
|
347
|
+
{
|
|
348
|
+
name: "list_threads",
|
|
349
|
+
description: "See your own threads and the threads you opened on teammates, newest first: each with its bot, title, state (running, waiting on the person, queued, or idle), whether the person has unread there, and the delegation id if it was a handoff. Use it to check how the threads you started are going before reporting to the person; write a thread's title as #Title when you mention it. A teammate's other threads are never listed \u2014 only the ones you opened. This is a read: it starts nothing and changes nothing.",
|
|
350
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {} }
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
name: "close_thread",
|
|
354
|
+
description: "Mark a thread you opened (or one of your own) as finished once you have read its result: it goes idle in the person's sidebar with a note saying you closed it. Nothing is deleted \u2014 deleting stays the person's decision \u2014 and a thread that is still running cannot be closed; wait for it or leave it. Use the thread id from list_threads or from the start_thread result. If a close is refused, do not retry it.",
|
|
355
|
+
inputSchema: {
|
|
356
|
+
type: "object",
|
|
357
|
+
additionalProperties: false,
|
|
358
|
+
properties: { thread_id: { type: "string", description: "The thread id from list_threads or start_thread." } },
|
|
359
|
+
required: ["thread_id"]
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
name: "start_thread",
|
|
364
|
+
description: `Open a new thread: one conversation with its own history and its own run, shown to the person as a row under the bot it belongs to. Leave bot_id out to open it on yourself, for a separate job that should run on its own ("review each pull request" \u2014 one thread per pull request) instead of inside this conversation. Give bot_id (from list_bots) to open it on a teammate: that is a handoff into a fresh thread, which starts after your current turn ends and whose result is delivered here, like delegate_bot. The title becomes the row's name, so make it short and specific; write it as #Title when you mention it to the person. Do not use it for a question you need answered right now (ask_bot), for one task where the teammate's usual conversation is fine (delegate_bot), or for a note nobody has to act on. If a call is refused, do not retry it: say what you still wanted opened.`,
|
|
365
|
+
inputSchema: {
|
|
366
|
+
type: "object",
|
|
367
|
+
additionalProperties: false,
|
|
368
|
+
properties: {
|
|
369
|
+
title: { type: "string", description: `The thread's name: one short line, at most 80 characters, specific enough to tell it apart from the others (for example "QA: PR #412 login fix").` },
|
|
370
|
+
message: { type: "string", description: "The complete first message of the thread \u2014 everything the run needs, since it will not see this conversation." },
|
|
371
|
+
bot_id: { type: "string", description: "Optional: the teammate's id from list_bots. Leave out to open the thread on yourself." },
|
|
372
|
+
folder: { type: "string", description: "Optional: the name of one of that bot's existing folders to file the thread under. Leave out unless the person named one." }
|
|
373
|
+
},
|
|
374
|
+
required: ["title", "message"]
|
|
375
|
+
}
|
|
376
|
+
},
|
|
345
377
|
{
|
|
346
378
|
name: "post_to_room",
|
|
347
379
|
description: "Put one message into a shared room you belong to, for example when the user asks you to tell the team something. Get group_id from list_rooms. This posts and returns: no room member's turn starts, nobody replies, and nothing comes back except confirmation \u2014 so never use it to ask a question or hand out work (use ask_bot or delegate_bot for those). Post once, say it in full, and tell the user what you posted. If a post is refused, do not retry it: say what you wanted to post in your reply instead.",
|
|
@@ -552,6 +584,12 @@ async function api(path, init) {
|
|
|
552
584
|
if (!res.ok) throw new Error(String(body.error ?? `HTTP ${res.status}`));
|
|
553
585
|
return body;
|
|
554
586
|
}
|
|
587
|
+
function ordinal(n) {
|
|
588
|
+
const rem100 = n % 100;
|
|
589
|
+
if (rem100 >= 11 && rem100 <= 13) return `${n}th`;
|
|
590
|
+
const rem10 = n % 10;
|
|
591
|
+
return `${n}${rem10 === 1 ? "st" : rem10 === 2 ? "nd" : rem10 === 3 ? "rd" : "th"}`;
|
|
592
|
+
}
|
|
555
593
|
function jsonRecord(value) {
|
|
556
594
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
557
595
|
}
|
|
@@ -760,6 +798,71 @@ Judge progress by this activity, not by waiting: real work keeps producing lines
|
|
|
760
798
|
}
|
|
761
799
|
return { text: `Task ${taskId} ended without a reply \u2014 ${String(r.status ?? "unknown")}${r.result ? `: ${String(r.result)}` : ""}.`, isError: true };
|
|
762
800
|
}
|
|
801
|
+
if (name === "list_threads") {
|
|
802
|
+
const query = new URLSearchParams({ fromBotId: BOT_ID, fromThreadId: THREAD_ID });
|
|
803
|
+
const r = await api(`/api/internal/threads?${query.toString()}`);
|
|
804
|
+
if (r.error) return { text: `Couldn't list threads: ${String(r.error)}`, isError: true };
|
|
805
|
+
const threads = Array.isArray(r.threads) ? r.threads.filter(jsonRecord) : [];
|
|
806
|
+
if (!threads.length) return { text: "No threads yet: you have none of your own beyond this one, and you have not opened any on a teammate." };
|
|
807
|
+
const stateWord = { running: "running", "waiting-on-you": "waiting on the person", queued: "queued", idle: "idle" };
|
|
808
|
+
const lines = threads.map((thread) => {
|
|
809
|
+
const where = thread.own === true ? "yours" : `on @${String(thread.botName)}`;
|
|
810
|
+
const state = stateWord[String(thread.state)] ?? String(thread.state);
|
|
811
|
+
const unread = thread.unread === true ? ", unread for the person" : "";
|
|
812
|
+
const handoff = typeof thread.delegationId === "string" && thread.delegationId ? ` [delegation id: ${thread.delegationId}]` : "";
|
|
813
|
+
return `- #${String(thread.title)} (${where}, ${state}${unread}) [thread id: ${String(thread.threadId)}]${handoff}`;
|
|
814
|
+
});
|
|
815
|
+
return { text: `Threads, newest first:
|
|
816
|
+
${lines.join("\n")}` };
|
|
817
|
+
}
|
|
818
|
+
if (name === "close_thread") {
|
|
819
|
+
const threadId = String(args.thread_id ?? "").trim();
|
|
820
|
+
if (!threadId) return { text: "close_thread needs the thread_id from list_threads or start_thread.", isError: true };
|
|
821
|
+
const r = await api(`/api/internal/threads/${encodeURIComponent(threadId)}/close`, { method: "POST", body: JSON.stringify({ fromBotId: BOT_ID, fromThreadId: THREAD_ID }) });
|
|
822
|
+
if (r.error) return { text: `Couldn't close that thread: ${String(r.error)}`, isError: true };
|
|
823
|
+
return { text: `Closed #${String(r.title)}${r.botName ? ` on @${String(r.botName)}` : ""}. It stays in the person's sidebar, idle, with a note that you closed it.` };
|
|
824
|
+
}
|
|
825
|
+
if (name === "start_thread") {
|
|
826
|
+
const title = String(args.title ?? "").trim();
|
|
827
|
+
const message = String(args.message ?? "").trim();
|
|
828
|
+
if (!title || !message) return { text: "start_thread needs title (one short line) and message (the complete first message).", isError: true };
|
|
829
|
+
if (threadsOpenedThisTurn >= MAX_THREADS_PER_TURN) {
|
|
830
|
+
return {
|
|
831
|
+
text: `You have already opened ${MAX_THREADS_PER_TURN} threads this turn, which is the limit. Do not retry \u2014 finish your turn and tell the person which threads you still wanted to open, so they can open them or ask you again.`,
|
|
832
|
+
isError: true
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
const toBotId = typeof args.bot_id === "string" ? args.bot_id.trim() : "";
|
|
836
|
+
const folder = typeof args.folder === "string" ? args.folder.trim() : "";
|
|
837
|
+
const body = { fromBotId: BOT_ID, fromThreadId: THREAD_ID, title, message, depth: DEPTH };
|
|
838
|
+
if (toBotId) body.toBotId = toBotId;
|
|
839
|
+
if (folder) body.folder = folder;
|
|
840
|
+
const r = await api("/api/internal/threads", { method: "POST", body: JSON.stringify(body) });
|
|
841
|
+
if (r.error && r.state !== "failed") return { text: `Couldn't open that thread: ${String(r.error)}`, isError: true };
|
|
842
|
+
threadsOpenedThisTurn += 1;
|
|
843
|
+
const threadTitle = String(r.title ?? title);
|
|
844
|
+
const threadId = String(r.threadId ?? "");
|
|
845
|
+
const where = r.self === true ? "on yourself" : `on @${String(r.botName ?? "that bot")}`;
|
|
846
|
+
const opened = `Opened thread #${threadTitle} ${where} [thread id: ${threadId}].`;
|
|
847
|
+
if (r.self === true) {
|
|
848
|
+
if (r.state === "running") {
|
|
849
|
+
return { text: `${opened} It is running now, in parallel with this conversation, and its result stays in that thread \u2014 it will not be delivered here. Mention it to the person as #${threadTitle}; use list_threads in a later turn to see how it is going.` };
|
|
850
|
+
}
|
|
851
|
+
if (r.state === "queued") {
|
|
852
|
+
const position = Number(r.position) || 1;
|
|
853
|
+
const limit = Number(r.limit) || 0;
|
|
854
|
+
return { text: `${opened} You are at your limit of ${limit} threads running at once, so it is ${ordinal(position)} in line and starts as soon as one of them finishes \u2014 nothing more to do. Mention it to the person as #${threadTitle}.` };
|
|
855
|
+
}
|
|
856
|
+
return { text: `${opened} It could not start: ${String(r.error ?? "unknown reason")}. The thread exists but nothing is running in it; tell the person.`, isError: true };
|
|
857
|
+
}
|
|
858
|
+
const delegationId = typeof r.delegationId === "string" ? r.delegationId.trim() : "";
|
|
859
|
+
if (delegationId) delegationTaskIdsThisTurn.add(delegationId);
|
|
860
|
+
const approval = r.approvalRequired === true ? " The person must approve this handoff first; their card appears after your turn ends." : "";
|
|
861
|
+
const timing = r.state === "queued" ? ` @${String(r.botName ?? "that bot")} can run ${Number(r.limit) || 0} threads at once and they are all spoken for, so it waits ${ordinal(Number(r.position) || 1)} in line for a free slot after this turn ends.` : " It starts when this turn ends, like any handoff.";
|
|
862
|
+
return {
|
|
863
|
+
text: `${opened}${timing}${approval} Its result will be delivered to this conversation automatically (delegation id: ${delegationId || "unknown"}). Acknowledge it, mention it to the person as #${threadTitle}, and finish your turn; do not check or wait for it in this turn.`
|
|
864
|
+
};
|
|
865
|
+
}
|
|
763
866
|
if (name === "create_bot") {
|
|
764
867
|
const botName = String(args.name ?? "").trim();
|
|
765
868
|
const role = String(args.role ?? "").trim();
|