openmausbot 0.1.75 → 0.1.76
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-BtT047dk.css +1 -0
- package/dist/assets/{index-BTlyRwLl.js → index-C6blGSq5.js} +1 -1
- package/dist/assets/index-fKXFpB_J.js +305 -0
- package/dist/index.html +2 -2
- package/dist-server/companion/src/routes.js +6 -2
- package/dist-server/drivers/agents-proxy.js +133 -11
- package/dist-server/index.js +2602 -869
- package/dist-server/mcp-gate.js +28 -18
- package/dist-server/openmausbot.js +202 -120
- package/dist-server/pair-cli.js +202 -120
- package/dist-server/server/agent-tool-policy.js +1 -0
- package/dist-server/server/atomic.js +37 -1
- package/dist-server/server/bot-overview.js +5 -1
- package/dist-server/server/chief-of-staff.js +17 -12
- package/dist-server/server/delegations.js +177 -63
- package/dist-server/server/drivers/acp/hermes.js +21 -3
- package/dist-server/server/drivers/agents-proxy.js +113 -10
- package/dist-server/server/drivers/claude.js +31 -14
- package/dist-server/server/drivers/openai-chat.js +90 -67
- package/dist-server/server/drivers/openai-compat.js +9 -1
- package/dist-server/server/drivers/pi.js +18 -3
- package/dist-server/server/env-path.js +18 -17
- package/dist-server/server/index.js +1112 -312
- package/dist-server/server/message-db.js +21 -0
- package/dist-server/server/peer-roster.js +48 -9
- package/dist-server/server/procs.js +19 -3
- package/dist-server/server/room-handoffs.js +237 -0
- package/dist-server/server/section-context.js +64 -14
- package/dist-server/server/store.js +247 -8
- package/dist-server/server/surface.js +16 -5
- package/dist-server/server/team-backup.js +17 -1
- package/dist-server/server/team-setup-requests.js +252 -0
- package/dist-server/server/turn-dispatch-guard.js +31 -3
- package/dist-server/shared/approval-mode.js +7 -0
- package/dist-server/shared/team-backup.js +1 -0
- package/dist-server/shared/team-setup.js +1 -0
- package/package.json +1 -1
- package/dist/assets/index-CeMbvsgx.js +0 -305
- package/dist/assets/index-DH7Zax6L.css +0 -1
package/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/app-icon.svg" />
|
|
7
7
|
<title>OpenMausBot</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-fKXFpB_J.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BtT047dk.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
|
@@ -140,12 +140,16 @@ const ALLOWED = [
|
|
|
140
140
|
{ method: "POST", path: /^\/api\/routines\/[\w-]+\/run$/ },
|
|
141
141
|
{ method: "POST", path: /^\/api\/routine-runs\/[\w-]+\/(?:cancel|seen)$/ },
|
|
142
142
|
// Multi-account Composio management exposes opaque ids and aliases only.
|
|
143
|
-
//
|
|
144
|
-
//
|
|
143
|
+
// Account-level removal is allowed: the handler still proves the account
|
|
144
|
+
// belongs to the host's own user before revoking, and a paired client can
|
|
145
|
+
// already add accounts — connectable but not disconnectable is the bug
|
|
146
|
+
// being fixed here. The whole-service DELETE stays denied: it belongs to
|
|
147
|
+
// the host.
|
|
145
148
|
{ method: "GET", path: /^\/api\/connectors\/catalog$/ },
|
|
146
149
|
{ method: "GET", path: /^\/api\/connectors\/connected$/ },
|
|
147
150
|
{ method: "GET", path: /^\/api\/connectors$/ },
|
|
148
151
|
{ method: "POST", path: /^\/api\/connectors\/[\w-]+\/authorize$/ },
|
|
152
|
+
{ method: "DELETE", path: /^\/api\/connectors\/[\w-]+\/accounts\/[\w-]+$/ },
|
|
149
153
|
// Inline connector cards are scoped by bot, transcript message, and
|
|
150
154
|
// thread. They expose the same opaque OAuth authorization already allowed
|
|
151
155
|
// above, then only poll, resume, or dismiss that exact pending card.
|
|
@@ -41,6 +41,7 @@ function isCredentialTargetId(value) {
|
|
|
41
41
|
// server/agent-tool-policy.ts
|
|
42
42
|
var READ_ONLY_AGENT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
43
43
|
"list_bots",
|
|
44
|
+
"list_team_setup",
|
|
44
45
|
"list_rooms",
|
|
45
46
|
"list_threads",
|
|
46
47
|
"check_delegation",
|
|
@@ -63,6 +64,25 @@ function agentToolAnnotations(name) {
|
|
|
63
64
|
return isReadOnlyAgentTool(name) ? READ_ONLY_ANNOTATIONS : void 0;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
// server/peer-roster.ts
|
|
68
|
+
var ROSTER_NAME_MAX = 80;
|
|
69
|
+
var oneLine = (value) => {
|
|
70
|
+
let flattened = "";
|
|
71
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
72
|
+
const code = value.charCodeAt(i);
|
|
73
|
+
const breaksOut = code < 32 || code >= 127 && code <= 159 || code === 8232 || code === 8233;
|
|
74
|
+
flattened += breaksOut ? " " : value[i];
|
|
75
|
+
}
|
|
76
|
+
return flattened.replace(/\s+/g, " ").trim();
|
|
77
|
+
};
|
|
78
|
+
var clip = (value, max) => {
|
|
79
|
+
const flat = oneLine(value);
|
|
80
|
+
return flat.length > max ? `${flat.slice(0, max - 1)}\u2026` : flat;
|
|
81
|
+
};
|
|
82
|
+
function peerName(value) {
|
|
83
|
+
return clip(value.replace(/[[\]]/g, " "), ROSTER_NAME_MAX);
|
|
84
|
+
}
|
|
85
|
+
|
|
66
86
|
// server/drivers/agents-proxy.ts
|
|
67
87
|
var HARNESS = process.env.OMB_HARNESS_URL ?? "http://127.0.0.1:8799";
|
|
68
88
|
var BOT_ID = process.env.OMB_BOT_ID ?? "";
|
|
@@ -313,14 +333,30 @@ var ROUTINE_FIELDS_SCHEMA = {
|
|
|
313
333
|
}
|
|
314
334
|
};
|
|
315
335
|
var TOOLS = [
|
|
336
|
+
{
|
|
337
|
+
name: "list_room_targets",
|
|
338
|
+
description: "Discover actual OpenMausBot teammates and rooms in your allowed teams. Works in a normal bot conversation too; no room is required. Returns bot and room IDs, roles and working folders, never other conversations' history. Use these bots, not native coding helpers with similar names, when the user asks their team to work together.",
|
|
339
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false }
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: "coordinate_bots",
|
|
343
|
+
description: "Ask existing OpenMausBot teammates for advice or assign concrete work. From normal chat each assignment gets a separate recipient conversation; from a room it defaults to this room. Use group_id from list_room_targets for a specific room. Name 1-4 bot_ids: they receive only your brief and use their own model, tools and permissions. Busy bots queue. They can consult their specialists; all results return here and resume you automatically. Include exact file paths, constraints and what must be verified. After sending all assignments, END your turn; do not poll or wait. On return, resolve tradeoffs, verify the requested outcome and request concrete corrections if necessary before giving one final answer. Do not send acknowledgements as new work.",
|
|
344
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {
|
|
345
|
+
group_id: { type: "string", description: "Optional destination room. Omit for this room, or separate recipient tasks when chatting directly." },
|
|
346
|
+
bot_ids: { type: "array", items: { type: "string" }, minItems: 1, maxItems: 4, uniqueItems: true },
|
|
347
|
+
message: { type: "string", minLength: 1, maxLength: 4e3, description: "Self-contained question or task for these teammates. Send separate requests when responsibilities differ." },
|
|
348
|
+
request_key: { type: "string", description: "A short unique assignment key. Reuse for an identical retry." },
|
|
349
|
+
rework: { type: "boolean", description: "True only for concrete additional work from someone who already completed a request." }
|
|
350
|
+
}, required: ["bot_ids", "message", "request_key"] }
|
|
351
|
+
},
|
|
316
352
|
{
|
|
317
353
|
name: "list_bots",
|
|
318
|
-
description: "List the other bots (agents) in your
|
|
354
|
+
description: "List the other bots (agents) you may contact in your own team and any additional teams the owner has explicitly allowed you to coordinate, with their team, model and current status. Call this to discover exact teammate IDs before assigning work or requesting advice through your available coordination tools.",
|
|
319
355
|
inputSchema: { type: "object", properties: {} }
|
|
320
356
|
},
|
|
321
357
|
{
|
|
322
358
|
name: "list_rooms",
|
|
323
|
-
description: "List the shared rooms (team channels) you belong to, with the other members of each. Call this before post_to_room
|
|
359
|
+
description: "List the shared rooms (team channels) you belong to, with the other members of each. Call this before post_to_room. One-to-one bot channels are never listed; discover individual teammates with list_bots. A room you are in but cannot post into is named without an id, together with the reason, so you can tell the user why.",
|
|
324
360
|
inputSchema: { type: "object", additionalProperties: false, properties: {} }
|
|
325
361
|
},
|
|
326
362
|
{
|
|
@@ -373,12 +409,12 @@ var TOOLS = [
|
|
|
373
409
|
},
|
|
374
410
|
{
|
|
375
411
|
name: "list_threads",
|
|
376
|
-
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
|
|
412
|
+
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, idle, or closed), 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.",
|
|
377
413
|
inputSchema: { type: "object", additionalProperties: false, properties: {} }
|
|
378
414
|
},
|
|
379
415
|
{
|
|
380
416
|
name: "close_thread",
|
|
381
|
-
description: "Mark a thread you opened (or one of your own) as finished once you have read its result: it
|
|
417
|
+
description: "Mark a thread you opened (or one of your own) as finished once you have read its result: it leaves the person's default sidebar list (still under all threads, with a note saying you closed it) and list_threads reports it as closed. 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.",
|
|
382
418
|
inputSchema: {
|
|
383
419
|
type: "object",
|
|
384
420
|
additionalProperties: false,
|
|
@@ -427,6 +463,54 @@ var TOOLS = [
|
|
|
427
463
|
required: ["name", "role", "instructions"]
|
|
428
464
|
}
|
|
429
465
|
},
|
|
466
|
+
{
|
|
467
|
+
name: "list_team_setup",
|
|
468
|
+
description: "Chief of Staff only: list authorized teams, teammate IDs, and exact engine/model choices for team setup. Call before proposing configuration; never invent model IDs. Existing thread models are independent of bot defaults.",
|
|
469
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {} }
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "propose_team_setup",
|
|
473
|
+
description: "Chief of Staff only: propose all requested specialist creation, profile/model configuration, and authorized team moves in ONE combined review card. Nothing changes until the user applies it. Use exact catalog engine/model IDs from list_team_setup. Combine all fields for each bot; use the same create key or botId to coalesce repeated entries. New teams must be named explicitly in newTeams and have a specialist in this plan; the card also asks to authorize your access to just those new teams. Existing unauthorized teams cannot be included. Models change bot defaults for groups/new threads; existing threads and execution permissions stay unchanged. After proposing, end your turn. The decision and structured result automatically resume you once; do not ask again, poll, or repeat the proposal.",
|
|
474
|
+
inputSchema: {
|
|
475
|
+
type: "object",
|
|
476
|
+
additionalProperties: false,
|
|
477
|
+
properties: {
|
|
478
|
+
reason: { type: "string", minLength: 1, maxLength: 500 },
|
|
479
|
+
newTeams: { type: "array", maxItems: 8, items: { type: "string", minLength: 1, maxLength: 60 } },
|
|
480
|
+
operations: { type: "array", minItems: 1, maxItems: 24, items: {
|
|
481
|
+
type: "object",
|
|
482
|
+
additionalProperties: false,
|
|
483
|
+
properties: {
|
|
484
|
+
action: { type: "string", enum: ["create", "update"] },
|
|
485
|
+
key: { type: "string", description: "For create: your stable short name for this new bot in this plan." },
|
|
486
|
+
botId: { type: "string", description: "For update: exact existing bot ID from list_team_setup." },
|
|
487
|
+
fields: { type: "object", additionalProperties: false, properties: {
|
|
488
|
+
name: { type: "string", maxLength: 100 },
|
|
489
|
+
title: { type: "string", maxLength: 200 },
|
|
490
|
+
description: { type: "string", maxLength: 4e3 },
|
|
491
|
+
soul: { type: "string", description: "Standing instructions; required with name/title/modelSelection for every new bot." },
|
|
492
|
+
section: { type: "string", maxLength: 60, description: "Exact authorized existing team, or a team explicitly named in newTeams. Empty string means General." },
|
|
493
|
+
modelSelection: { type: "object", additionalProperties: false, properties: {
|
|
494
|
+
instanceId: { type: "string" },
|
|
495
|
+
model: { type: "string" },
|
|
496
|
+
effort: { type: "string" }
|
|
497
|
+
}, required: ["instanceId", "model"] }
|
|
498
|
+
} }
|
|
499
|
+
},
|
|
500
|
+
required: ["action", "fields"]
|
|
501
|
+
} }
|
|
502
|
+
},
|
|
503
|
+
required: ["reason", "operations"]
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: "propose_bot_deletion",
|
|
508
|
+
description: "Chief of Staff only: when the user explicitly asks to delete a named teammate, create a separate confirmation card for that exact bot. Deletion removes its conversations, memory, instructions and skills; generated project files remain. Running work and owned computers can block deletion. Never delete yourself, substitute an archive, or put deletion into a setup batch. End your turn after proposing; the decision and result resume you once.",
|
|
509
|
+
inputSchema: { type: "object", additionalProperties: false, properties: {
|
|
510
|
+
bot_id: { type: "string", minLength: 1 },
|
|
511
|
+
reason: { type: "string", minLength: 1, maxLength: 500 }
|
|
512
|
+
}, required: ["bot_id", "reason"] }
|
|
513
|
+
},
|
|
430
514
|
{
|
|
431
515
|
name: "create_room",
|
|
432
516
|
description: "Create a room in your own section when the user asks for one (maximum four per turn). Chiefs only. Choose active peers from list_bots; you are included automatically as the default responder. This creates no turns or messages. Section moves stay with the user. If peer approval is enabled, ask the user to make the room change instead.",
|
|
@@ -665,7 +749,11 @@ var TOOLS = [
|
|
|
665
749
|
return annotations ? { ...tool, annotations } : tool;
|
|
666
750
|
});
|
|
667
751
|
var SKILL_TOOL_NAMES = /* @__PURE__ */ new Set(["skills_list", "skill_manage"]);
|
|
668
|
-
var
|
|
752
|
+
var AUTHORING_TOOLS = SKILL_AUTHORING_ENABLED ? TOOLS : TOOLS.filter((tool) => !SKILL_TOOL_NAMES.has(tool.name));
|
|
753
|
+
var ROOM_ONLY_TOOLS = /* @__PURE__ */ new Set(["list_room_targets", "coordinate_bots"]);
|
|
754
|
+
var ROOM_REPLACED_TOOLS = /* @__PURE__ */ new Set(["ask_bot", "delegate_bot", "check_delegation", "wait_delegation", "start_thread", "send_to_thread", "wait_thread"]);
|
|
755
|
+
var COORDINATING = process.env.OMB_ROOM_TURN === "1";
|
|
756
|
+
var AVAILABLE_TOOLS = COORDINATING ? AUTHORING_TOOLS.filter((tool) => !ROOM_REPLACED_TOOLS.has(tool.name)) : AUTHORING_TOOLS.filter((tool) => !ROOM_ONLY_TOOLS.has(tool.name));
|
|
669
757
|
var send = (msg) => process.stdout.write(JSON.stringify(msg) + "\n");
|
|
670
758
|
var ok = (id, result) => send({ jsonrpc: "2.0", id, result });
|
|
671
759
|
var rpcErr = (id, code, message) => send({ jsonrpc: "2.0", id, error: { code, message } });
|
|
@@ -749,20 +837,36 @@ function recallSpeaker(hit) {
|
|
|
749
837
|
return hit.role === "user" ? "user" : "you";
|
|
750
838
|
}
|
|
751
839
|
async function callTool(name, args) {
|
|
840
|
+
if (name === "list_room_targets") {
|
|
841
|
+
const r = await api("/api/internal/room-targets");
|
|
842
|
+
return { text: JSON.stringify(r), ...r.error ? { isError: true } : {} };
|
|
843
|
+
}
|
|
844
|
+
if (name === "coordinate_bots") {
|
|
845
|
+
const r = await api("/api/internal/coordinate-bots", { method: "POST", body: JSON.stringify({
|
|
846
|
+
groupId: args.group_id,
|
|
847
|
+
botIds: args.bot_ids,
|
|
848
|
+
message: args.message,
|
|
849
|
+
requestKey: args.request_key,
|
|
850
|
+
rework: args.rework
|
|
851
|
+
}) });
|
|
852
|
+
return { text: JSON.stringify(r), ...r.error ? { isError: true } : {} };
|
|
853
|
+
}
|
|
752
854
|
if (name === "list_bots") {
|
|
753
855
|
const r = await api(`/api/internal/agents?self=${encodeURIComponent(BOT_ID)}`);
|
|
754
856
|
const bots = r.bots ?? [];
|
|
755
|
-
if (!bots.length) return { text: "No other bots
|
|
857
|
+
if (!bots.length) return { text: "No other reachable bots yet." };
|
|
756
858
|
const lines = bots.map((b) => {
|
|
757
859
|
const role = b.title ? ` \u2014 ${b.title}` : "";
|
|
758
860
|
const about = b.description ? ` (${String(b.description).slice(0, 120)})` : "";
|
|
759
|
-
|
|
861
|
+
const state = typeof b.statusText === "string" ? b.status === "available" ? "" : b.statusText : b.busy ? "busy" : "";
|
|
862
|
+
const team = typeof b.section === "string" ? `, team: ${peerName(b.section) || "General"}` : "";
|
|
863
|
+
return `- ${b.name}${role}${about} [id: ${b.id}, model: ${b.model}${team}${state ? `, ${state}` : ""}]`;
|
|
760
864
|
});
|
|
761
865
|
return {
|
|
762
|
-
text: `
|
|
866
|
+
text: `Reachable teammates:
|
|
763
867
|
${lines.join("\n")}
|
|
764
868
|
|
|
765
|
-
Assign work with delegate_bot. Use ask_bot only for a short answer you need inline
|
|
869
|
+
${COORDINATING ? "Use coordinate_bots for advice or concrete work, then end your turn. Busy teammates queue and results resume you automatically." : "Assign work with delegate_bot. Use ask_bot only for a short answer you need inline."}`
|
|
766
870
|
};
|
|
767
871
|
}
|
|
768
872
|
if (name === "list_rooms") {
|
|
@@ -880,7 +984,10 @@ ${r.text ?? "(no reply)"}` };
|
|
|
880
984
|
if (r.status === "done") return { text: `${who} finished task ${taskId}:
|
|
881
985
|
${String(r.result || "(no reply text)")}` };
|
|
882
986
|
if (r.status === "queued") {
|
|
883
|
-
|
|
987
|
+
const why = r.targetStatus === "waiting-on-user" ? ` ${who} is waiting on the user, so it goes through after they answer.` : r.targetStatus === "working" ? ` ${who} is busy with other work.` : "";
|
|
988
|
+
const expiresInMs = Number(r.expiresInMs);
|
|
989
|
+
const expiry = !Number.isFinite(expiresInMs) ? "" : expiresInMs <= 0 ? " It is past its 24-hour limit and will expire the next time it cannot be delivered." : ` It expires if not picked up within ${Math.ceil(expiresInMs / 36e5)} hour${Math.ceil(expiresInMs / 36e5) === 1 ? "" : "s"}.`;
|
|
990
|
+
return { text: `Task ${taskId} is still queued \u2014 ${who} hasn't picked it up yet${waitMs ? ` after ${timeout}s` : ""}.${why}${expiry} Keep working and check again later.` };
|
|
884
991
|
}
|
|
885
992
|
if (r.status === "running") {
|
|
886
993
|
const elapsedMs = Number.isFinite(r.elapsedMs) ? Number(r.elapsedMs) : 0;
|
|
@@ -962,6 +1069,21 @@ ${lines.join("\n")}` };
|
|
|
962
1069
|
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.`
|
|
963
1070
|
};
|
|
964
1071
|
}
|
|
1072
|
+
if (name === "list_team_setup") {
|
|
1073
|
+
return { text: JSON.stringify(await api("/api/internal/team-setup-catalog")) };
|
|
1074
|
+
}
|
|
1075
|
+
if (name === "propose_team_setup" || name === "propose_bot_deletion") {
|
|
1076
|
+
const deleting = name === "propose_bot_deletion";
|
|
1077
|
+
const result = await api(deleting ? "/api/internal/bot-deletion-requests" : "/api/internal/team-setup-requests", {
|
|
1078
|
+
method: "POST",
|
|
1079
|
+
body: JSON.stringify({
|
|
1080
|
+
fromBotId: BOT_ID,
|
|
1081
|
+
fromThreadId: THREAD_ID,
|
|
1082
|
+
...deleting ? { targetBotId: args.bot_id, reason: args.reason } : { plan: args }
|
|
1083
|
+
})
|
|
1084
|
+
});
|
|
1085
|
+
return { text: `One review card is visible: ${String(result.title)}. Nothing has been applied. End this turn; the decision and structured result resume you automatically once. Do not ask again, poll, or repeat this proposal.` };
|
|
1086
|
+
}
|
|
965
1087
|
if (name === "create_bot") {
|
|
966
1088
|
const botName = String(args.name ?? "").trim();
|
|
967
1089
|
const role = String(args.role ?? "").trim();
|
|
@@ -984,7 +1106,7 @@ ${lines.join("\n")}` };
|
|
|
984
1106
|
});
|
|
985
1107
|
createdThisTurn += 1;
|
|
986
1108
|
return {
|
|
987
|
-
text: `Created @${r.name ?? botName} in ${r.section ?? "General"} [id: ${r.id}]. Assign work with delegate_bot.`
|
|
1109
|
+
text: `Created @${r.name ?? botName} in ${r.section ?? "General"} [id: ${r.id}]. Assign work with ${COORDINATING ? "coordinate_bots" : "delegate_bot"}.`
|
|
988
1110
|
};
|
|
989
1111
|
}
|
|
990
1112
|
if (name === "create_room") {
|