limixbot 0.3.127 → 0.3.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActivityPanel-BFSwx00G.js → ActivityPanel-C092xjIk.js} +1 -1
- package/dist/assets/{App-UlXFr-rh.js → App-CFt1bVwj.js} +110 -110
- package/dist/assets/{AppEventEditor-B7Io0wi4.js → AppEventEditor-C00_DMLy.js} +1 -1
- package/dist/assets/{BotSettingsDialog-B7hW939m.js → BotSettingsDialog-81Yk4G56.js} +1 -1
- package/dist/assets/{BrowserPanel-2FEz8sUH.js → BrowserPanel-BZiZr6JO.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-DjtG76qN.js → BrowserProfilesManager-CIDDGvM_.js} +1 -1
- package/dist/assets/{CloudAddDialog-C0sa5ArG.js → CloudAddDialog-bLdejHsc.js} +1 -1
- package/dist/assets/{ComputerFilesPane-QFeb-ewE.js → ComputerFilesPane-Ce9ODuX8.js} +1 -1
- package/dist/assets/{ComputerPanel-sKgH3B7V.js → ComputerPanel-Dpekp0Z2.js} +2 -2
- package/dist/assets/{DataPanel-BNHLLw4V.js → DataPanel-i5mxANER.js} +1 -1
- package/dist/assets/{DesktopViewer-Ds7umweq.js → DesktopViewer-B9mw98xI.js} +1 -1
- package/dist/assets/{GrokMoveDialog-Ck_lC5co.js → GrokMoveDialog-DYarhzxZ.js} +1 -1
- package/dist/assets/{InspectorPanel-BNHiBYSd.js → InspectorPanel-D5ulGIOz.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-CAnRULUo.js → KeyboardShortcutsModal-BVDKAY0o.js} +1 -1
- package/dist/assets/{LimixResizeHandles-RBNUxAWK.js → LimixResizeHandles-Jjthi0zS.js} +1 -1
- package/dist/assets/{LiveDesktop-CBwaPn-v.js → LiveDesktop-CFqHs50a.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-C6Mp51Ya.js → LocalVmWorkspace-DbB_ec11.js} +1 -1
- package/dist/assets/{MacLocalControl-CB1n0Rwg.js → MacLocalControl-DoWLhevV.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-CEFVN7bO.js → MarkdownFilePreview-CCaYi8EP.js} +1 -1
- package/dist/assets/{MenuMotion-p_3OSw7G.js → MenuMotion-DG5tk0i3.js} +1 -1
- package/dist/assets/{NewBotDialog-BZyKYErk.js → NewBotDialog-CWbeGI3M.js} +1 -1
- package/dist/assets/{PhoneAppDialog-Xuvxu5R4.js → PhoneAppDialog-BErSSwmM.js} +1 -1
- package/dist/assets/{PlacesRail-HdHRCodH.js → PlacesRail-CAV7kW3Y.js} +1 -1
- package/dist/assets/{PluginsPanel-K8R5tGG1.js → PluginsPanel-BKQ4in_K.js} +1 -1
- package/dist/assets/{ProIntroduction-CekjUapV.js → ProIntroduction-DgDPOYzn.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-mGE8ZvE7.js → RemoteAgentSettingsPanel-BsD_TT_T.js} +1 -1
- package/dist/assets/{RoomPanel-DaJwgf2-.js → RoomPanel-UR35p-lT.js} +1 -1
- package/dist/assets/{RoutinesPage-YdlVSVTB.js → RoutinesPage-Cims3t6g.js} +1 -1
- package/dist/assets/{SettingsModal-D69DAjZz.js → SettingsModal-2S8H2h_g.js} +1 -1
- package/dist/assets/{ShareTeamDialog-CQCrALiU.js → ShareTeamDialog-org_7J0x.js} +1 -1
- package/dist/assets/{SignedInSites-CaLYcDmG.js → SignedInSites-Dp2PSLBK.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-BywQZ0U2.js → TeamLibraryPanel-Ch-zZVWY.js} +1 -1
- package/dist/assets/{TeamMapPage-8N6-aXaN.js → TeamMapPage-Ba7y1YPZ.js} +1 -1
- package/dist/assets/{TriggersPage-DcX1ruE_.js → TriggersPage-qUNQ79Nb.js} +1 -1
- package/dist/assets/{VisibilitySection-QNfma0_Q.js → VisibilitySection-DdEr_5bZ.js} +1 -1
- package/dist/assets/{WebhookTrigger-DjFrDFpT.js → WebhookTrigger-DjYDUzGP.js} +1 -1
- package/dist/assets/{WorksOnGrid-BPq4vW3n.js → WorksOnGrid-wPPuMbjR.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV--WCL2tMc.js → abnfDiagram-YUKMZFIV-v0NjYm2N.js} +1 -1
- package/dist/assets/{activity-sibNyUyL.js → activity-DONzM_Hr.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-B1hTlWSu.js → architectureDiagram-47P4ROYG-C9p47RSg.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-CR8Ikgnw.js → blockDiagram-E7TT5TSB-BjCDCsDZ.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-BCn3JBuz.js → c4Diagram-CRA5TL53-BwcLeGrs.js} +1 -1
- package/dist/assets/{calendar-days-B4jDUJhh.js → calendar-days-C0163EM9.js} +1 -1
- package/dist/assets/channel-BloV1v8U.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-Du-j8Umu.js → chunk-2Q5K7J3B-DkMrEZ1P.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-CPiVWlX1.js → chunk-5VM5RSS4-BvT5jzrf.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-BeWSj3er.js → chunk-7TKQ45FW-BPY6DMgY.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-BpnBu77E.js → chunk-AW2ZBBNX-CA02FkCe.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-bysqJhIZ.js → chunk-FVRAUYC3-DR_HIm4k.js} +2 -2
- package/dist/assets/{chunk-HTAEGDNF-lirRQO83.js → chunk-HTAEGDNF--Q5YJ5qq.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-D6tCBX7U.js → chunk-JWPE2WC7-CdUxnp0z.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-Bl29yJPi.js → chunk-KQW6MTUR-CZ_kOJX4.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-J7gpzVSr.js → chunk-XXDRQBXY-Baw_LI4a.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-CMuhYLe2.js → classDiagram-v2-K4WV4PDN-C3p6RSXv.js} +1 -1
- package/dist/assets/{coins-ClQfPsPX.js → coins-CRTGCu3d.js} +1 -1
- package/dist/assets/{core-B1gf3Z1c.js → core-C6iWxuTj.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-BPk6ajRx.js → cose-bilkent-JH36ORCC-DexASxvw.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-CdSZNyDb.js → cynefin-EF2NZ3EQ-CnBYCH8E.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-BWiP56VZ.js → cynefinDiagram-3GCD6N5R-BxlPVTxc.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-DlWQa6YL.js → dagre-W4DXFKR2-DwHsGS35.js} +1 -1
- package/dist/assets/{diagram-2UJZ2QOL-DzLU_CvL.js → diagram-2UJZ2QOL-BitCWJhQ.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-D5q75Tpg.js → diagram-OVF4WLC6-DVq8AK9P.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-B-0a4IjT.js → diagram-PFPMY2P6-B1CGGTYD.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-BcWzkqz1.js → diagram-UMYRVEAY-BJOrT_fX.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-JHnKjNA5.js → diagram-YEKJPTXX-CqTidMyp.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-VFRbybQZ.js → diagram-ZIFT7M5P-BrETFWbJ.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-Cgoe3hKK.js → ebnfDiagram-VR2GEFS7-odzlCiG_.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS-D7bwq_yP.js → elk-IJKZMXRS-DOqejjFU.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-CpPh8Fah.js → erDiagram-O2IAPWRE-pus74-u1.js} +1 -1
- package/dist/assets/{file-up-BQt7Df7g.js → file-up-VlqNWssp.js} +1 -1
- package/dist/assets/{flowDiagram-OXPTDLAJ-BaJnQZkq.js → flowDiagram-OXPTDLAJ-BoR02YXy.js} +1 -1
- package/dist/assets/{ganttDiagram-R7TSEDQI-Di9Ny9eQ.js → ganttDiagram-R7TSEDQI-DEWJjq9w.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-DMpC98bf.js → gitGraphDiagram-XJZIOB7I-A0Ut1vzJ.js} +1 -1
- package/dist/assets/{import-name-CU_qLPSL.js → import-name-Dzn9IajS.js} +1 -1
- package/dist/assets/{index-9b3nVh6T.js → index-ByrnprY3.js} +1 -1
- package/dist/assets/{index-CquxehuD.js → index-DoClz3zG.js} +3 -3
- package/dist/assets/{infoDiagram-5W2HQ5XZ-BwOcT6_N.js → infoDiagram-5W2HQ5XZ-IrI9xNS5.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-zxqGDW3L.js → ishikawaDiagram-K3B6WC7H-CcZaBkPV.js} +1 -1
- package/dist/assets/{journeyDiagram-COXZFDF6-AN1_ttld.js → journeyDiagram-COXZFDF6-Lhq1JIrG.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-DOYL5g17.js → kanban-definition-P3RFRI5V-Dpnd1w1Z.js} +1 -1
- package/dist/assets/{mcp-servers-D9YZ99kI.js → mcp-servers-iT-sFJLT.js} +1 -1
- package/dist/assets/{mermaid.core-DHkkkuN6.js → mermaid.core-CwYv1-pN.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-DoCFyCMx.js → mindmap-definition-LZFPQGKD-BQu-1VuI.js} +1 -1
- package/dist/assets/{minimize-ByFqP2FI.js → minimize-BRtvUvR3.js} +1 -1
- package/dist/assets/{monitor-DInAobl-.js → monitor-Gc_xwWHG.js} +1 -1
- package/dist/assets/{new-bot-DzOrSV2V.js → new-bot-CMIOaWIO.js} +1 -1
- package/dist/assets/{org-library-DcXalbrG.js → org-library-CwIWLSKR.js} +1 -1
- package/dist/assets/{package-format-KDg9nGi0.js → package-format-C4Kbcf94.js} +1 -1
- package/dist/assets/{pegDiagram-BGZESJAR-CKpEIG3z.js → pegDiagram-BGZESJAR-C2kBJx8q.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-DoffR53C.js → pieDiagram-CAPJLFHJ-3IGf8-rd.js} +1 -1
- package/dist/assets/{quadrantDiagram-GDMTTRAM-kaoXoO-E.js → quadrantDiagram-GDMTTRAM-Ds0i1JJu.js} +1 -1
- package/dist/assets/{rail-CMXP3rkT.js → rail-BxO9nJ7b.js} +1 -1
- package/dist/assets/{railroadDiagram-SM67HX2B-DeKMhm5p.js → railroadDiagram-SM67HX2B-C5HMZeLZ.js} +1 -1
- package/dist/assets/{remote-desktop-panel-ClkgPSQp.js → remote-desktop-panel-z23u6kyq.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-CdflPcl0.js → requirementDiagram-X7JNWC4A-W7wEhXbS.js} +1 -1
- package/dist/assets/{sankeyDiagram-UM26HJRW-B0-2F0b9.js → sankeyDiagram-UM26HJRW-BIIvZEMK.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-BrFZfWoC.js → sequenceDiagram-ZO4K6R2Y-B6ZAapb0.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-CZMn3-3_.js → sizeCapture-INFHLROL-CijBtoJ-.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-BeOXXJ0J.js → stateDiagram-v2-TBUQTH76-gVAJTp58.js} +1 -1
- package/dist/assets/styles-DiAFRlxu.css +1 -0
- package/dist/assets/{swimlanes-N4OXWK64-C3ZH7QZn.js → swimlanes-N4OXWK64-1T5CmmoT.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-D0mOoyOD.js +8 -0
- package/dist/assets/{team-share-DdYOqcXI.js → team-share-DZ71boDj.js} +1 -1
- package/dist/assets/{timeline-definition-YOQAKGHF-r0yv8R_y.js → timeline-definition-YOQAKGHF-b2WZ1F71.js} +1 -1
- package/dist/assets/{usecaseDiagram-VIAY4XPW-Dn-rjHRV.js → usecaseDiagram-VIAY4XPW-DvPVm705.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-B6g8THhH.js → vennDiagram-BLWOH2XV-BG-PWVxl.js} +1 -1
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-B-zEt-P1.js → wardleyDiagram-YMQ3BMBF-5xjAr3nW.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-BJsqiM_K.js → xychartDiagram-TAQBALBS-DgoVlD5n.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/rail.html +5 -5
- package/dist-server/index.js +440 -426
- package/dist-server/package.json +1 -1
- package/dist-server/server/app-settings/registry-bots.js +3 -3
- package/dist-server/server/app-settings/registry-window.js +2 -2
- package/dist-server/server/bot-channels/engine.js +2 -1
- package/dist-server/server/bot-channels/messenger.js +6 -6
- package/dist-server/server/host/trust-answers.js +34 -1
- package/dist-server/server/index.js +79 -2
- package/dist-server/server/outbound-hold.js +13 -2
- package/dist-server/server/outbound-requests.js +71 -0
- package/dist-server/server/routes/app-settings.js +2 -2
- package/dist-server/server/routes/bot-messages.js +2 -2
- package/dist-server/server/runtime/tree.js +1 -1
- package/package.json +1 -1
- package/dist/assets/channel-BhOgq7GX.js +0 -1
- package/dist/assets/styles-B8xkIKpA.css +0 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-87e__yCN.js +0 -8
- /package/dist/assets/{styles-CbbuPFF7.js → styles-Be5qq6WR.js} +0 -0
package/dist-server/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"0.3.
|
|
1
|
+
{"type":"module","version":"0.3.129"}
|
|
@@ -112,11 +112,11 @@ export function botEntries(deps, writable) {
|
|
|
112
112
|
patch: (one, { archived }) => ({ hidden: archived, ...(archived && one.chiefOfStaff ? { chiefOfStaff: false } : {}) }),
|
|
113
113
|
}),
|
|
114
114
|
writable({
|
|
115
|
-
id: "sidebar.showHelper", label: "Show
|
|
115
|
+
id: "sidebar.showHelper", label: "Show the Limix Assistant in the sidebar", help: "Whether this place's own bot, the Limix Assistant, has a row in the sidebar; it keeps working either way.", where: "Settings → Overview",
|
|
116
116
|
synonyms: ["helper", "starter", "default bot", "mausbot", "show helper"], value: z.boolean(), allowed: "true or false",
|
|
117
117
|
current: () => { const helper = deps.bots().find((one) => one.defaultBot); return helper ? !helper.sidebarHidden : undefined; },
|
|
118
|
-
describe: (show) => (deps.bots().some((one) => one.defaultBot) ? { change: show ? "Show
|
|
119
|
-
write: (show) => { const helper = deps.bots().find((one) => one.defaultBot); return helper ? deps.patchBot(helper.id, { sidebarHidden: !show }) : Promise.resolve("This place has no
|
|
118
|
+
describe: (show) => (deps.bots().some((one) => one.defaultBot) ? { change: show ? "Show the Limix Assistant in the sidebar" : "Take the Limix Assistant out of the sidebar; it keeps working" } : { refusal: "This place has no Limix Assistant of its own." }),
|
|
119
|
+
write: (show) => { const helper = deps.bots().find((one) => one.defaultBot); return helper ? deps.patchBot(helper.id, { sidebarHidden: !show }) : Promise.resolve("This place has no Limix Assistant of its own."); },
|
|
120
120
|
}),
|
|
121
121
|
perBot({
|
|
122
122
|
id: "bots.tools", label: "Bot tool groups", where: "a bot's Settings",
|
|
@@ -23,8 +23,8 @@ export function windowEntries(windowPref) {
|
|
|
23
23
|
flag("general.notificationFeed", "Notification feed", "Keep a feed of what bots did in the notifications panel.", "Settings → General", ["feed", "notification feed", "inbox"], "Keep a feed of bot updates", "Turn off the feed of bot updates"),
|
|
24
24
|
flag("general.analytics", "Usage analytics", "Send anonymous usage data to MausBot (PostHog) to improve the app.", "Settings → General", ["analytics", "telemetry", "privacy", "tracking"], "Send anonymous usage data from this app to MausBot's analytics (PostHog), off this computer", "Stop sending usage analytics"),
|
|
25
25
|
flag("general.openAtLogin", "Open at login", "Start MausBot when you log in to this computer (desktop app).", "Settings → General", ["startup", "launch", "login", "open at login"], "Open MausBot when you log in", "Don't open MausBot at login"),
|
|
26
|
-
windowPref("general.talkShortcut", "Talk shortcut", "A key held anywhere on this Mac to talk to
|
|
27
|
-
says: ({ enabled, key }) => (enabled ? `Hold ${key.replaceAll("-", "+")} anywhere to talk to
|
|
26
|
+
windowPref("general.talkShortcut", "Talk shortcut", "A key held anywhere on this Mac to talk to the Limix Assistant (desktop app).", "Settings → General", ["talk", "voice", "dictation", "microphone", "hotkey"], `{"enabled":true|false,"key":${TALK_KEYS.map((key) => `"${key}"`).join(" | ")}}`, {
|
|
27
|
+
says: ({ enabled, key }) => (enabled ? `Hold ${key.replaceAll("-", "+")} anywhere to talk to the Limix Assistant` : "Turn off the talk shortcut"),
|
|
28
28
|
}),
|
|
29
29
|
flag("account.productEmails", "Product update emails", "MausBot emails you product updates.", "Settings → Your account", ["emails", "newsletter", "product updates", "email updates"], "Get MausBot product update emails (your email address is sent to MausBot)", "Stop MausBot product update emails"),
|
|
30
30
|
wayIn("remote.wifi", "Same Wi-Fi", "Paired phones reach this computer on the same Wi-Fi network.", ["wifi", "wi-fi", "lan", "local network", "remote access"], "Let your paired phones reach this computer on the same Wi-Fi"),
|
|
@@ -297,7 +297,8 @@ export function createBotChannels(deps) {
|
|
|
297
297
|
await paced(adapter, botId, () => {
|
|
298
298
|
if (signal.aborted || !authorized() || sessions.get(lane) !== session)
|
|
299
299
|
throw new ChannelError("drop", "Connection changed");
|
|
300
|
-
|
|
300
|
+
const deliveryId = `${id}:${sent}`;
|
|
301
|
+
return file ? session.sendMedia(message.chatId, file, deliveryId) : session.send(message.chatId, parts[sent - media.length], deliveryId);
|
|
301
302
|
});
|
|
302
303
|
}
|
|
303
304
|
catch (error) {
|
|
@@ -40,12 +40,12 @@ export function messengerBridge(options) {
|
|
|
40
40
|
wake();
|
|
41
41
|
resolve();
|
|
42
42
|
}, { once: true }));
|
|
43
|
-
const enqueue = (chatId, text, file) => new Promise((resolve, reject) => {
|
|
43
|
+
const enqueue = (chatId, text, file, deliveryId) => new Promise((resolve, reject) => {
|
|
44
44
|
if (io.signal.aborted)
|
|
45
45
|
return reject(new ChannelError("drop", "Messenger: stopped"));
|
|
46
46
|
const id = ++nextId;
|
|
47
47
|
const timer = setTimeout(() => item.settle("timeout"), SEND_WAIT_MS);
|
|
48
|
-
const item = { id, chatId, text, file, settle: (error) => {
|
|
48
|
+
const item = { id, deliveryId, chatId, text, file, settle: (error) => {
|
|
49
49
|
clearTimeout(timer);
|
|
50
50
|
pending.delete(id);
|
|
51
51
|
bridge.outbox = bridge.outbox.filter((each) => each !== item);
|
|
@@ -61,10 +61,10 @@ export function messengerBridge(options) {
|
|
|
61
61
|
});
|
|
62
62
|
return {
|
|
63
63
|
done,
|
|
64
|
-
send: enqueue,
|
|
65
|
-
sendMedia: async (chatId, media) => {
|
|
64
|
+
send: (chatId, text, deliveryId) => enqueue(chatId, text, undefined, deliveryId),
|
|
65
|
+
sendMedia: async (chatId, media, deliveryId) => {
|
|
66
66
|
const file = await readChannelMedia(media);
|
|
67
|
-
await enqueue(chatId, "", { name: file.filename, base64: file.data.toString("base64") });
|
|
67
|
+
await enqueue(chatId, "", { name: file.filename, base64: file.data.toString("base64") }, deliveryId);
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
70
|
},
|
|
@@ -88,7 +88,7 @@ export function messengerBridge(options) {
|
|
|
88
88
|
if (!bridge.outbox.length)
|
|
89
89
|
await new Promise((resolve) => { const timer = setTimeout(resolve, OUTBOX_WAIT_MS); bridge.waiters.push(() => { clearTimeout(timer); resolve(); }); });
|
|
90
90
|
bridge.io.healthy();
|
|
91
|
-
return json(res, 200, { items: bridge.outbox.slice(0, 1).map(({ id, chatId, text, file }) => ({ id, chatId, text, ...(file ? { file } : {}) })) });
|
|
91
|
+
return json(res, 200, { items: bridge.outbox.slice(0, 1).map(({ id, deliveryId, chatId, text, file }) => ({ id, chatId, text, ...(deliveryId ? { deliveryId } : {}), ...(file ? { file } : {}) })) });
|
|
92
92
|
}
|
|
93
93
|
if (method !== "POST")
|
|
94
94
|
return json(res, 405, { error: "method not allowed" });
|
|
@@ -4,7 +4,7 @@ import { json } from "../harness/http.js";
|
|
|
4
4
|
export function createTrustAnswers(deps) {
|
|
5
5
|
const { store, teamMemoryRequests, outsideWrites, outboundRequests } = deps;
|
|
6
6
|
const DATA_DIR = deps.dataDir;
|
|
7
|
-
function resolveAndSendTrust(res, threadId, requestId, behavior) {
|
|
7
|
+
async function resolveAndSendTrust(res, threadId, requestId, behavior, mayRecover) {
|
|
8
8
|
const remembered = teamMemoryRequests.resolve(threadId, requestId, behavior) ?? outsideWrites.resolve(threadId, requestId, behavior);
|
|
9
9
|
if (remembered) {
|
|
10
10
|
json(res, 200, remembered);
|
|
@@ -15,6 +15,39 @@ export function createTrustAnswers(deps) {
|
|
|
15
15
|
const outboundBot = outboundCard.from?.botId ? store.bot(outboundCard.from.botId) : store.botByThread(threadId);
|
|
16
16
|
const result = outboundRequests.resolve({ threadId, requestId, behavior });
|
|
17
17
|
if (!result.claimed) {
|
|
18
|
+
const saved = deps.pendingSends.get(requestId, threadId);
|
|
19
|
+
if (saved && !mayRecover && behavior === "allow") {
|
|
20
|
+
json(res, 403, { error: "Only a workspace admin may approve this recovered send." });
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
if (saved && (!outboundCard.card.answered || outboundCard.card.answered === "allow")) {
|
|
24
|
+
if (behavior !== "allow") {
|
|
25
|
+
deps.pendingSends.discard(requestId);
|
|
26
|
+
store.patchMessage(threadId, outboundCard.id, { card: { ...outboundCard.card, answered: "deny" } });
|
|
27
|
+
json(res, 200, { ok: true, outcome: "rejected" });
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
await deps.sendRecovered(requestId, saved);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
json(res, 409, { error: "Limix Bot could not confirm this send. Check the sent folder before starting a new request." });
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
store.patchMessage(threadId, outboundCard.id, { card: { ...outboundCard.card, answered: "allow" } });
|
|
38
|
+
deps.pendingSends.complete(requestId);
|
|
39
|
+
appendDecision(DATA_DIR, { threadId, requestId, botId: saved.botId, tool: outboundCard.card.tool, decision: "user-approved", source: "user" });
|
|
40
|
+
json(res, 200, { ok: true, outcome: "allowed-once" });
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
if (deps.pendingSends.dispatching(requestId)) {
|
|
44
|
+
json(res, 409, { error: "This send is in progress or its result is unknown. Check the sent folder before starting a new request." });
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (outboundCard.card.answered === "allow" || outboundCard.card.answered === "deny") {
|
|
48
|
+
json(res, 200, { ok: true, outcome: outboundCard.card.answered === "allow" ? "allowed-once" : "rejected", alreadySettled: true });
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
18
51
|
if (!outboundCard.card.answered) {
|
|
19
52
|
store.patchMessage(threadId, outboundCard.id, { card: { ...outboundCard.card, answered: "unavailable", dismissed: true } });
|
|
20
53
|
}
|
|
@@ -441,7 +441,7 @@ import { profileRevision, profileSnapshot } from "./profile-revision.js";
|
|
|
441
441
|
import { flushAllProfileHistory, flushProfileHistory, readHistory, recordProfileChange, soulChanges } from "./profile-versions.js";
|
|
442
442
|
import { TeamMemory, TEAM_MEMORY_KINDS } from "./team-memory.js";
|
|
443
443
|
import { describeTool } from "./activity.js";
|
|
444
|
-
import { OutboundRequestService } from "./outbound-requests.js";
|
|
444
|
+
import { exactGmailSend, OutboundRequestService, PendingOutboundSends } from "./outbound-requests.js";
|
|
445
445
|
import { createOutboundHold, OUTBOUND_HOLD_MS } from "./outbound-hold.js";
|
|
446
446
|
import { connectorCallsIn, outboundCallsIn } from "../shared/outbound.js";
|
|
447
447
|
import { connectorAccessDecision, describeConnectorScopes } from "../shared/connector-scopes.js";
|
|
@@ -9573,7 +9573,54 @@ const outsideWrites = createOutsideWrites({ store, notify, language: (threadId)
|
|
|
9573
9573
|
writeMemory: (botId, threadId, change) => { const written = botMemoryUpdate(teamHost.layer(botId, threadId), change, { source: memorySourceLabel({ room: store.groupByThread(threadId), task: store.taskByThread(teamHost.baseBotId(botId), threadId), threadId }), aboutMe: null, prefer: null }); return written.ok ? null : written.error; } });
|
|
9574
9574
|
const outboundRequests = new OutboundRequestService();
|
|
9575
9575
|
const outboundHold = createOutboundHold({ store, dataDir: DATA_DIR, outboundRequests, holdMs: OUTBOUND_HOLD_MS, connectorThread, activeGroupTurnForBot, notify });
|
|
9576
|
-
const
|
|
9576
|
+
const pendingSends = new PendingOutboundSends(join(DATA_DIR, "pending-outbound"));
|
|
9577
|
+
async function outboundGmailConnection() {
|
|
9578
|
+
const settings = cfg.composio;
|
|
9579
|
+
if (CLOUD_HOME || HOSTED_WORKSPACE || !settings?.apiKey?.trim() || !settings.userId)
|
|
9580
|
+
return;
|
|
9581
|
+
const accounts = (await composio.connectedServices(cfg)).gmail?.accounts.filter(account => /^active$/i.test(account.status));
|
|
9582
|
+
if (cfg.composio !== settings || accounts?.length !== 1)
|
|
9583
|
+
return;
|
|
9584
|
+
return createHash("sha256").update(JSON.stringify([settings, accounts[0].id, process.env.OMB_COMPOSIO_API])).digest("hex");
|
|
9585
|
+
}
|
|
9586
|
+
async function sendRecoveredOutbound(requestId, saved) {
|
|
9587
|
+
const payload = { jsonrpc: "2.0", id: requestId, method: "tools/call",
|
|
9588
|
+
params: { name: "GMAIL_SEND_EMAIL", arguments: saved.args } };
|
|
9589
|
+
const calls = connectorCallsIn(payload.params.name, saved.args);
|
|
9590
|
+
const services = await composio.connectedServiceSlugs(cfg);
|
|
9591
|
+
const settings = cfg.composio;
|
|
9592
|
+
if (await outboundGmailConnection() !== saved.connection)
|
|
9593
|
+
throw new Error("Gmail connection changed");
|
|
9594
|
+
const result = await composio.relayMcp(cfg, payload, undefined, () => {
|
|
9595
|
+
const bot = store.bot(saved.botId);
|
|
9596
|
+
if (!bot || bot.composio === false || cfg.composio !== settings ||
|
|
9597
|
+
!directChatOf(saved.botId, saved.threadId) || outsideDrivenThread(saved.threadId) ||
|
|
9598
|
+
proactive.fence.refusesConnectorCall(bot, saved.threadId, payload) ||
|
|
9599
|
+
managedPolicy.appsCallRefusal(calls, services) ||
|
|
9600
|
+
!connectorAccessDecision(bot.connectorScopes, calls, services).ok ||
|
|
9601
|
+
!evaluateConnectorTools([payload.params.name], bot.connectorTools, services).allowed ||
|
|
9602
|
+
!pendingSends.get(requestId, saved.threadId))
|
|
9603
|
+
throw new Error("The original send is no longer authorized");
|
|
9604
|
+
pendingSends.claim(requestId);
|
|
9605
|
+
});
|
|
9606
|
+
if (!confirmedOutboundSend(result))
|
|
9607
|
+
throw new Error("Gmail did not confirm delivery");
|
|
9608
|
+
}
|
|
9609
|
+
function confirmedOutboundSend(result) {
|
|
9610
|
+
if (result.status < 200 || result.status >= 300)
|
|
9611
|
+
return false;
|
|
9612
|
+
try {
|
|
9613
|
+
const reply = JSON.parse(new TextDecoder().decode(result.bytes));
|
|
9614
|
+
return Boolean(reply.result && !reply.error && !reply.result.isError);
|
|
9615
|
+
}
|
|
9616
|
+
catch {
|
|
9617
|
+
return false;
|
|
9618
|
+
}
|
|
9619
|
+
}
|
|
9620
|
+
const { resolveAndSendTrust } = createTrustAnswers({
|
|
9621
|
+
store, dataDir: DATA_DIR, teamMemoryRequests, outsideWrites, outboundRequests,
|
|
9622
|
+
pendingSends, sendRecovered: sendRecoveredOutbound,
|
|
9623
|
+
});
|
|
9577
9624
|
const profileRequests = new ProfileRequestService({
|
|
9578
9625
|
store,
|
|
9579
9626
|
autoApply: appliesDirectly,
|
|
@@ -15143,17 +15190,37 @@ const handleRequest = async (req, res) => {
|
|
|
15143
15190
|
if (opaque && currentSender.connectorTools !== undefined && !sandbox.open(currentSender))
|
|
15144
15191
|
return refuseOutbound(sandbox.refusal);
|
|
15145
15192
|
const fullAccess = outboundTool !== null && sendsFreely();
|
|
15193
|
+
const recoverableArgs = rpcParams?.name === "GMAIL_SEND_EMAIL" && !actor.access &&
|
|
15194
|
+
directChatOf(currentSender.id, internalCapability.threadId) && !outsideDrivenThread(internalCapability.threadId)
|
|
15195
|
+
? exactGmailSend(rpcParams.arguments)
|
|
15196
|
+
: undefined;
|
|
15197
|
+
const outboundConnection = recoverableArgs ? await outboundGmailConnection().catch(() => undefined) : undefined;
|
|
15198
|
+
requireActiveInternalCapability();
|
|
15146
15199
|
const held = outboundTool
|
|
15147
15200
|
? await outboundHold.hold({
|
|
15148
15201
|
bot: currentSender, threadId: internalCapability.threadId, tool: outboundTool, calls: outboundCalls, opaque, fullAccess,
|
|
15149
15202
|
active: () => internalCapabilityIsActive(internalCapability),
|
|
15203
|
+
...(recoverableArgs && outboundConnection ? {
|
|
15204
|
+
persist: (requestId, expiresAt) => pendingSends.save(requestId, {
|
|
15205
|
+
botId: currentSender.id, threadId: internalCapability.threadId, connection: outboundConnection,
|
|
15206
|
+
expiresAt, args: recoverableArgs,
|
|
15207
|
+
}),
|
|
15208
|
+
discard: (requestId) => pendingSends.discard(requestId),
|
|
15209
|
+
} : {}),
|
|
15150
15210
|
})
|
|
15151
15211
|
: { ok: true, approved: false };
|
|
15152
15212
|
if (!held.ok)
|
|
15153
15213
|
return refuseOutbound(held.text);
|
|
15214
|
+
if (held.approved && outboundCalls.some(call => call.slug === "GMAIL_SEND_DRAFT")) {
|
|
15215
|
+
return refuseOutbound("This Gmail draft can change after review. Request a new approval with the exact recipients, subject, and body in an explicit send, or review and send the draft in Gmail.");
|
|
15216
|
+
}
|
|
15154
15217
|
const outboundApproved = held.approved;
|
|
15155
15218
|
if (outboundApproved)
|
|
15156
15219
|
requireActiveInternalCapability();
|
|
15220
|
+
if (held.requestId && await outboundGmailConnection().catch(() => undefined) !== outboundConnection) {
|
|
15221
|
+
pendingSends.discard(held.requestId);
|
|
15222
|
+
return refuseOutbound("The Gmail connection changed after review. Request a new approval before sending.");
|
|
15223
|
+
}
|
|
15157
15224
|
let dispatchRefusal;
|
|
15158
15225
|
const refuseDispatch = (text) => {
|
|
15159
15226
|
dispatchRefusal = text;
|
|
@@ -15190,6 +15257,14 @@ const handleRequest = async (req, res) => {
|
|
|
15190
15257
|
refuseDispatch(error instanceof Error ? error.message : String(error));
|
|
15191
15258
|
}
|
|
15192
15259
|
}
|
|
15260
|
+
if (held.requestId) {
|
|
15261
|
+
try {
|
|
15262
|
+
pendingSends.claim(held.requestId);
|
|
15263
|
+
}
|
|
15264
|
+
catch {
|
|
15265
|
+
refuseDispatch("This send is no longer pending. Check the sent folder before trying again.");
|
|
15266
|
+
}
|
|
15267
|
+
}
|
|
15193
15268
|
for (const key of nextDrafts)
|
|
15194
15269
|
reservedDrafts.add(key);
|
|
15195
15270
|
}, undefined, teamConnections.via(actor.access)[1]);
|
|
@@ -15199,6 +15274,8 @@ const handleRequest = async (req, res) => {
|
|
|
15199
15274
|
return refuseOutbound(dispatchRefusal);
|
|
15200
15275
|
throw error;
|
|
15201
15276
|
}
|
|
15277
|
+
if (held.requestId && confirmedOutboundSend(upstream))
|
|
15278
|
+
pendingSends.complete(held.requestId);
|
|
15202
15279
|
const headers = {
|
|
15203
15280
|
"content-type": upstream.contentType,
|
|
15204
15281
|
"cache-control": "no-store",
|
|
@@ -19,12 +19,19 @@ export function createOutboundHold(deps) {
|
|
|
19
19
|
const DATA_DIR = deps.dataDir;
|
|
20
20
|
const { holdMs } = deps;
|
|
21
21
|
return {
|
|
22
|
-
async hold({ bot: currentSender, threadId, tool: outboundTool, calls: outboundCalls, opaque, fullAccess, active }) {
|
|
22
|
+
async hold({ bot: currentSender, threadId, tool: outboundTool, calls: outboundCalls, opaque, fullAccess, active, persist, discard }) {
|
|
23
23
|
const refuseOutbound = (text) => ({ ok: false, text });
|
|
24
24
|
if (!sendsWithoutAsking(currentSender.outbound, fullAccess, opaque)) {
|
|
25
25
|
const { app, calls, summary } = outboundCard(outboundCalls);
|
|
26
26
|
const owner = connectorThread(currentSender.id, threadId);
|
|
27
27
|
const held = outboundRequests.open({ botId: currentSender.id, threadId, tool: outboundTool, timeoutMs: holdMs });
|
|
28
|
+
try {
|
|
29
|
+
persist?.(held.requestId, Date.now() + 24 * 60 * 60_000);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
outboundRequests.forget(held.requestId);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
28
35
|
const card = store.appendMessage(threadId, {
|
|
29
36
|
role: "bot",
|
|
30
37
|
kind: "options",
|
|
@@ -65,6 +72,10 @@ export function createOutboundHold(deps) {
|
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
if (answer !== "allow") {
|
|
75
|
+
if (answer === "timeout" && persist) {
|
|
76
|
+
return refuseOutbound("The send is still pending on its approval card for 24 hours. Do not start another send for this message.");
|
|
77
|
+
}
|
|
78
|
+
discard?.(held.requestId);
|
|
68
79
|
if (answer === "timeout") {
|
|
69
80
|
const stale = store.messagesFor(threadId).find((message) => message.id === card.id);
|
|
70
81
|
if (stale?.card && !stale.card.answered) {
|
|
@@ -75,7 +86,7 @@ export function createOutboundHold(deps) {
|
|
|
75
86
|
? "Limix Bot did not send this: nobody answered the approval in time. Ask the user before trying again."
|
|
76
87
|
: "Limix Bot did not send this: the user declined. Do not retry it; ask the user what they would like instead.");
|
|
77
88
|
}
|
|
78
|
-
return { ok: true, approved: true };
|
|
89
|
+
return { ok: true, approved: true, ...(persist ? { requestId: held.requestId } : {}) };
|
|
79
90
|
}
|
|
80
91
|
return { ok: true, approved: false };
|
|
81
92
|
},
|
|
@@ -1,5 +1,76 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, unlinkSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { writeFileAtomic } from "./atomic.js";
|
|
1
5
|
import { randomUUID } from "node:crypto";
|
|
2
6
|
import { describeTool } from "./activity.js";
|
|
7
|
+
const savedSend = z.object({
|
|
8
|
+
botId: z.string(),
|
|
9
|
+
threadId: z.string(),
|
|
10
|
+
connection: z.string(),
|
|
11
|
+
expiresAt: z.number(),
|
|
12
|
+
args: z.object({
|
|
13
|
+
recipient_email: z.string().min(1),
|
|
14
|
+
subject: z.string(),
|
|
15
|
+
body: z.string(),
|
|
16
|
+
user_id: z.literal("me").optional(),
|
|
17
|
+
extra_recipients: z.array(z.string()).optional(),
|
|
18
|
+
cc: z.array(z.string()).optional(),
|
|
19
|
+
}).strict(),
|
|
20
|
+
});
|
|
21
|
+
export function exactGmailSend(args) {
|
|
22
|
+
const parsed = savedSend.shape.args.safeParse(args);
|
|
23
|
+
return parsed.success && JSON.stringify(parsed.data).length <= 400 ? parsed.data : undefined;
|
|
24
|
+
}
|
|
25
|
+
export class PendingOutboundSends {
|
|
26
|
+
dir;
|
|
27
|
+
constructor(dir) { this.dir = dir; }
|
|
28
|
+
path(requestId) {
|
|
29
|
+
if (!/^[0-9a-f-]{36}$/.test(requestId))
|
|
30
|
+
throw new Error("Invalid outbound request ID");
|
|
31
|
+
return join(this.dir, requestId + ".json");
|
|
32
|
+
}
|
|
33
|
+
save(requestId, send) {
|
|
34
|
+
mkdirSync(this.dir, { recursive: true, mode: 0o700 });
|
|
35
|
+
writeFileAtomic(this.path(requestId), JSON.stringify(send), { mode: 0o600 });
|
|
36
|
+
}
|
|
37
|
+
get(requestId, threadId) {
|
|
38
|
+
if (!/^[0-9a-f-]{36}$/.test(requestId))
|
|
39
|
+
return;
|
|
40
|
+
try {
|
|
41
|
+
const saved = savedSend.parse(JSON.parse(readFileSync(this.path(requestId), "utf8")));
|
|
42
|
+
if (saved.threadId === threadId && saved.expiresAt > Date.now())
|
|
43
|
+
return saved;
|
|
44
|
+
if (saved.expiresAt <= Date.now())
|
|
45
|
+
this.discard(requestId);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (error.code !== "ENOENT")
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
discard(requestId) {
|
|
53
|
+
try {
|
|
54
|
+
unlinkSync(this.path(requestId));
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (error.code !== "ENOENT")
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
claim(requestId) {
|
|
62
|
+
const path = this.path(requestId);
|
|
63
|
+
// Consume the pending record before talking to Gmail. An ambiguous result must never be retried automatically.
|
|
64
|
+
renameSync(path, path + ".claimed");
|
|
65
|
+
writeFileAtomic(path + ".claimed", "", { mode: 0o600 });
|
|
66
|
+
}
|
|
67
|
+
dispatching(requestId) {
|
|
68
|
+
return /^[0-9a-f-]{36}$/.test(requestId) && existsSync(this.path(requestId) + ".claimed");
|
|
69
|
+
}
|
|
70
|
+
complete(requestId) {
|
|
71
|
+
unlinkSync(this.path(requestId) + ".claimed");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
3
74
|
export class OutboundRequestService {
|
|
4
75
|
held = new Map();
|
|
5
76
|
open(input) {
|
|
@@ -35,9 +35,9 @@ export function createWindowPrefs(deps) {
|
|
|
35
35
|
read: (id) => values.get(id),
|
|
36
36
|
write(id, value) {
|
|
37
37
|
if (!deps.windowOpen())
|
|
38
|
-
return "Open
|
|
38
|
+
return "Open Limix Bot on this computer first; this setting lives in the app window.";
|
|
39
39
|
if (!values.has(id))
|
|
40
|
-
return "The open
|
|
40
|
+
return "The open Limix Bot window can't change this here. It is changed in Limix Bot's desktop app on this computer.";
|
|
41
41
|
values.set(id, value);
|
|
42
42
|
deps.broadcast({ kind: "window-pref", id, value }, { adminOnly: true });
|
|
43
43
|
return null;
|
|
@@ -516,7 +516,7 @@ export function createBotMessageRoutes(deps) {
|
|
|
516
516
|
const access = deps.resolveAccessRequest?.(bot.threadId, String(body.requestId), behavior, body.message);
|
|
517
517
|
if (access)
|
|
518
518
|
return json(res, access.status, access.body);
|
|
519
|
-
if (resolveAndSendTrust(res, bot.threadId, String(body.requestId), behavior))
|
|
519
|
+
if (await resolveAndSendTrust(res, bot.threadId, String(body.requestId), behavior, auth.kind === "loopback" ? auth.trust !== "service" : auth.scopes.includes("admin")))
|
|
520
520
|
return;
|
|
521
521
|
const answer = { botId: bot.id, threadId: bot.threadId, requestId: String(body.requestId), behavior };
|
|
522
522
|
if (await resolveAndSendTeamSetup(res, { ...answer, ...(body.room === false ? { room: false } : {}) }, ownerReview(auth, req)))
|
|
@@ -603,7 +603,7 @@ export function createBotMessageRoutes(deps) {
|
|
|
603
603
|
const access = deps.resolveAccessRequest?.(threadId, requestId, behavior, body.message);
|
|
604
604
|
if (access)
|
|
605
605
|
return json(res, access.status, access.body);
|
|
606
|
-
if (resolveAndSendTrust(res, threadId, requestId, behavior))
|
|
606
|
+
if (await resolveAndSendTrust(res, threadId, requestId, behavior, auth.kind === "loopback" ? auth.trust !== "service" : auth.scopes.includes("admin")))
|
|
607
607
|
return;
|
|
608
608
|
const skillCard = store.messagesFor(threadId).find((message) => message.card?.requestId === requestId && message.card.skillRequest);
|
|
609
609
|
if (skillCard?.card?.skillRequest) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { terminal } from "./types.js";
|
|
2
2
|
export const CUT_TWICE = "Interrupted by another Limix Bot restart after resuming once; not resumed again. Some of its steps may already have taken effect.";
|
|
3
|
-
export const INTERRUPTED_OUTWARD = "Interrupted by
|
|
3
|
+
export const INTERRUPTED_OUTWARD = "Interrupted by a Limix Bot restart after it already";
|
|
4
4
|
const OUTWARD_SHOWN = 4;
|
|
5
5
|
const OUTWARD_LABEL_MAX = 48;
|
|
6
6
|
function describeOutward(label) {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,C as n}from"./mermaid.core-DHkkkuN6.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|