limixbot 0.3.128 → 0.3.130
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-CHKvr2ME.js → ActivityPanel-CswemPGx.js} +1 -1
- package/dist/assets/{App-Qdd4Etr0.js → App-CeGk9O7P.js} +135 -134
- package/dist/assets/{AppEventEditor-Csl8OvHJ.js → AppEventEditor-lydjfKAA.js} +1 -1
- package/dist/assets/{BotSettingsDialog-Dn7V8EPs.js → BotSettingsDialog-BGO7s2Sa.js} +4 -4
- package/dist/assets/{BrowserPanel-DYrgjhY2.js → BrowserPanel-WFfhXRW4.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-DwXg-QiX.js → BrowserProfilesManager-DAI3EyaZ.js} +1 -1
- package/dist/assets/{CloudAddDialog-BQjw6clv.js → CloudAddDialog-Lo18f6GE.js} +1 -1
- package/dist/assets/{ComputerFilesPane-BIzdtDkx.js → ComputerFilesPane-LtL8VMhS.js} +1 -1
- package/dist/assets/{ComputerPanel-CKZMmU5N.js → ComputerPanel-mEdoL4Dh.js} +2 -2
- package/dist/assets/{DataPanel-CJCYQhq6.js → DataPanel-HeNk8eOt.js} +1 -1
- package/dist/assets/{DesktopViewer-B9mw98xI.js → DesktopViewer-DCC-jq_j.js} +1 -1
- package/dist/assets/{GrokMoveDialog-CxxR6jXV.js → GrokMoveDialog-I9x5B1Kv.js} +1 -1
- package/dist/assets/{InspectorPanel-k_9WS8hD.js → InspectorPanel-C-ocpaf1.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-9xKBwfgq.js → KeyboardShortcutsModal-D73O8To_.js} +1 -1
- package/dist/assets/{LimixResizeHandles-D4x0jvkS.js → LimixResizeHandles-kOyb_U62.js} +1 -1
- package/dist/assets/{LiveDesktop-p14AEwq0.js → LiveDesktop-DYg8H5rp.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-CB6dGKzv.js → LocalVmWorkspace-BsGviUnb.js} +1 -1
- package/dist/assets/{MacLocalControl-BxHl2r5v.js → MacLocalControl-Db0f-6Gc.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-CxQMvU7b.js → MarkdownFilePreview-Dj8Z6Mm0.js} +1 -1
- package/dist/assets/{MenuMotion-DG5tk0i3.js → MenuMotion-CgVWckHz.js} +1 -1
- package/dist/assets/{NewBotDialog-CUUNMAJe.js → NewBotDialog-Bp8-zb5M.js} +1 -1
- package/dist/assets/{PhoneAppDialog-DD2dlPAo.js → PhoneAppDialog-BWtFp9EN.js} +1 -1
- package/dist/assets/{PlacesRail-CAV7kW3Y.js → PlacesRail-CKR79j8d.js} +1 -1
- package/dist/assets/{PluginsPanel-8exPvXZV.js → PluginsPanel-BZe968J8.js} +2 -2
- package/dist/assets/{ProIntroduction-BkNqiByI.js → ProIntroduction-CZGUC6Ms.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-CgZvA4c3.js → RemoteAgentSettingsPanel-CCOe2O1O.js} +1 -1
- package/dist/assets/{RoomPanel-DU0mkU7E.js → RoomPanel-jgyrxLn2.js} +1 -1
- package/dist/assets/{RoutinesPage-D13_xSg1.js → RoutinesPage-D5Z3pmtB.js} +2 -2
- package/dist/assets/{SettingsModal-CcZSHI1Q.js → SettingsModal-CeKynb83.js} +2 -2
- package/dist/assets/{ShareTeamDialog-B6YC_fNs.js → ShareTeamDialog-D7qwIwXJ.js} +1 -1
- package/dist/assets/{SignedInSites-DhGidV0n.js → SignedInSites-Dh9imU42.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-BbEiwnZ3.js → TeamLibraryPanel-nz4rcGmz.js} +1 -1
- package/dist/assets/{TeamMapPage-KMzRj_VW.js → TeamMapPage-CLdRh0ZK.js} +1 -1
- package/dist/assets/{TriggersPage-HTxYYCjT.js → TriggersPage-BByyX4CZ.js} +1 -1
- package/dist/assets/VisibilitySection-BNhdo2-L.js +22 -0
- package/dist/assets/{WebhookTrigger-oZ3yokI_.js → WebhookTrigger-DxDhbnYz.js} +1 -1
- package/dist/assets/{WorksOnGrid-CTR6tAQZ.js → WorksOnGrid-CUh8CexO.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV-v0NjYm2N.js → abnfDiagram-YUKMZFIV-uSJsuKuD.js} +1 -1
- package/dist/assets/{activity-DONzM_Hr.js → activity-CmQeVvqw.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-C9p47RSg.js → architectureDiagram-47P4ROYG-Br4Cv9sO.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-BjCDCsDZ.js → blockDiagram-E7TT5TSB-CzcaYs_s.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-BwcLeGrs.js → c4Diagram-CRA5TL53-CDGjKlxD.js} +1 -1
- package/dist/assets/{calendar-days-C0163EM9.js → calendar-days-DSUOH-dL.js} +1 -1
- package/dist/assets/channel-N74fzi1P.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-DkMrEZ1P.js → chunk-2Q5K7J3B-CvuZ4KJD.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-BvT5jzrf.js → chunk-5VM5RSS4-negAvO9N.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-BPY6DMgY.js → chunk-7TKQ45FW-DA_OVnE1.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-CA02FkCe.js → chunk-AW2ZBBNX-Dbtemotq.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-DR_HIm4k.js → chunk-FVRAUYC3-Cnt25BNn.js} +2 -2
- package/dist/assets/{chunk-HTAEGDNF--Q5YJ5qq.js → chunk-HTAEGDNF-CtrZ11_G.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-CdUxnp0z.js → chunk-JWPE2WC7-DKZW0s8n.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-CZ_kOJX4.js → chunk-KQW6MTUR-DLg5U6as.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-Baw_LI4a.js → chunk-XXDRQBXY-pkGzgUQb.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-C3p6RSXv.js → classDiagram-v2-K4WV4PDN-BUBR3HPE.js} +1 -1
- package/dist/assets/{coins-CRTGCu3d.js → coins-Dbmac6SO.js} +1 -1
- package/dist/assets/{core-CC13tV5g.js → core-BA6DGyEo.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-DexASxvw.js → cose-bilkent-JH36ORCC-BukDY2ET.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-CnBYCH8E.js → cynefin-EF2NZ3EQ-B3XBpINL.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-BxlPVTxc.js → cynefinDiagram-3GCD6N5R-BV0SrhK6.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-DwHsGS35.js → dagre-W4DXFKR2-DzXXYwns.js} +1 -1
- package/dist/assets/{diagram-2UJZ2QOL-BitCWJhQ.js → diagram-2UJZ2QOL-BmOG88-j.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-DVq8AK9P.js → diagram-OVF4WLC6-C9zP_sNp.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-B1CGGTYD.js → diagram-PFPMY2P6-UzTTpwh8.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-BJOrT_fX.js → diagram-UMYRVEAY-Bo-9jQh-.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-CqTidMyp.js → diagram-YEKJPTXX-eNeARjiU.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-BrETFWbJ.js → diagram-ZIFT7M5P-Bp8Apm58.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-odzlCiG_.js → ebnfDiagram-VR2GEFS7-CThvAW5-.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS-DOqejjFU.js → elk-IJKZMXRS-CIAQeuC1.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-pus74-u1.js → erDiagram-O2IAPWRE-DJc0-QG5.js} +1 -1
- package/dist/assets/{file-up-VlqNWssp.js → file-up-uBDzou4C.js} +1 -1
- package/dist/assets/{flowDiagram-OXPTDLAJ-BoR02YXy.js → flowDiagram-OXPTDLAJ-CX1UCZsi.js} +1 -1
- package/dist/assets/{ganttDiagram-R7TSEDQI-DEWJjq9w.js → ganttDiagram-R7TSEDQI-CFCWgBLl.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-A0Ut1vzJ.js → gitGraphDiagram-XJZIOB7I-BY59AEfH.js} +1 -1
- package/dist/assets/{import-name-N3p-c6pH.js → import-name-gQROrWbj.js} +1 -1
- package/dist/assets/{index-DGGq7mDN.js → index-CkdvX5_R.js} +1 -1
- package/dist/assets/{index-98brgMNT.js → index-a4OBw5ZS.js} +3 -3
- package/dist/assets/{infoDiagram-5W2HQ5XZ-IrI9xNS5.js → infoDiagram-5W2HQ5XZ-CiWYCcE-.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-CcZaBkPV.js → ishikawaDiagram-K3B6WC7H-DXZKShaj.js} +1 -1
- package/dist/assets/{journeyDiagram-COXZFDF6-Lhq1JIrG.js → journeyDiagram-COXZFDF6-qrPSJHoF.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-Dpnd1w1Z.js → kanban-definition-P3RFRI5V-Ch9e9C4r.js} +1 -1
- package/dist/assets/{mermaid.core-CwYv1-pN.js → mermaid.core-DQALiqHr.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-BQu-1VuI.js → mindmap-definition-LZFPQGKD-BirJD4xj.js} +1 -1
- package/dist/assets/{minimize-BRtvUvR3.js → minimize-DlAHYBEI.js} +1 -1
- package/dist/assets/{monitor-Gc_xwWHG.js → monitor-B-DfxCLW.js} +1 -1
- package/dist/assets/{new-bot-DhIjBWvQ.js → new-bot-CAtQzQF1.js} +1 -1
- package/dist/assets/{org-library-CmwcxARS.js → org-library-PVNP5n7J.js} +1 -1
- package/dist/assets/{package-format-BWl-RWvM.js → package-format-xp0kEF1i.js} +1 -1
- package/dist/assets/{pegDiagram-BGZESJAR-C2kBJx8q.js → pegDiagram-BGZESJAR-UzkL237f.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-3IGf8-rd.js → pieDiagram-CAPJLFHJ-CPI42dPn.js} +1 -1
- package/dist/assets/{quadrantDiagram-GDMTTRAM-Ds0i1JJu.js → quadrantDiagram-GDMTTRAM-BEcjaKog.js} +1 -1
- package/dist/assets/{rail-BxO9nJ7b.js → rail-DzsIoRRT.js} +1 -1
- package/dist/assets/{railroadDiagram-SM67HX2B-C5HMZeLZ.js → railroadDiagram-SM67HX2B-B0KHoW-7.js} +1 -1
- package/dist/assets/{remote-desktop-panel-CVj-6tJX.js → remote-desktop-panel-BtSv4c6E.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-W7wEhXbS.js → requirementDiagram-X7JNWC4A-BdBqE5oc.js} +1 -1
- package/dist/assets/{sankeyDiagram-UM26HJRW-BIIvZEMK.js → sankeyDiagram-UM26HJRW-o-m5UnNV.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-B6ZAapb0.js → sequenceDiagram-ZO4K6R2Y-CS89JhnM.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-CijBtoJ-.js → sizeCapture-INFHLROL-u3jsM9rY.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-gVAJTp58.js → stateDiagram-v2-TBUQTH76-ZR8x5js6.js} +1 -1
- package/dist/assets/styles-_tGCSCNl.css +1 -0
- package/dist/assets/{swimlanes-N4OXWK64-1T5CmmoT.js → swimlanes-N4OXWK64-CxHXcQ4B.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-DJxa56rP.js +8 -0
- package/dist/assets/{team-share-DZ71boDj.js → team-share-DNj2KZjX.js} +1 -1
- package/dist/assets/{timeline-definition-YOQAKGHF-b2WZ1F71.js → timeline-definition-YOQAKGHF-Bhgot_xM.js} +1 -1
- package/dist/assets/{usecaseDiagram-VIAY4XPW-DvPVm705.js → usecaseDiagram-VIAY4XPW-C4T3EUA4.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-BG-PWVxl.js → vennDiagram-BLWOH2XV-B1Z8NDj7.js} +1 -1
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-5xjAr3nW.js → wardleyDiagram-YMQ3BMBF-D3gNVcd7.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-DgoVlD5n.js → xychartDiagram-TAQBALBS-CM-Am2Dc.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/rail.html +6 -6
- package/dist-server/bot-box/box-check.js +6 -6
- package/dist-server/drivers/agents-proxy.js +50 -48
- package/dist-server/hybrid-plugin-gateway.js +1489 -0
- package/dist-server/index.js +5689 -5583
- package/dist-server/limixbot.js +517 -508
- package/dist-server/mcp-gate.js +76 -61
- package/dist-server/mcp-remote-proxy.js +26 -23
- package/dist-server/mcp-server.js +28 -25
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +517 -508
- package/dist-server/scripts/mcp-server.js +30 -27
- package/dist-server/server/agents-turn.js +1 -0
- 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/auto-approve.js +2 -0
- package/dist-server/server/bot-box/env.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/cli-usage.js +2 -2
- package/dist-server/server/drivers/acp/native-process-sampler.js +84 -0
- package/dist-server/server/drivers/acp/quiet-status.js +12 -3
- package/dist-server/server/drivers/agents-call.js +4 -0
- package/dist-server/server/drivers/agents-catalog-profile.js +1 -0
- package/dist-server/server/drivers/agents-catalog.js +16 -1
- package/dist-server/server/drivers/agents-mcp-env.js +1 -1
- package/dist-server/server/drivers/claude-elicitation.js +21 -9
- package/dist-server/server/drivers/elicited-consent.js +24 -0
- package/dist-server/server/headless/client.js +10 -9
- package/dist-server/server/headless/main.js +1 -1
- package/dist-server/server/host/trust-answers.js +34 -1
- package/dist-server/server/hybrid-plugin-gateway.js +162 -0
- package/dist-server/server/hybrid-plugin-manifest.js +99 -0
- package/dist-server/server/index.js +120 -5
- package/dist-server/server/limix-native-path.js +8 -0
- package/dist-server/server/mcp-app-connections.js +58 -5
- package/dist-server/server/mcp-gate-tasks.js +75 -0
- package/dist-server/server/mcp-gate.js +81 -5
- package/dist-server/server/mcp-http.js +34 -6
- package/dist-server/server/mcp-native-response.js +112 -0
- package/dist-server/server/mcp-skills.js +263 -0
- package/dist-server/server/mcp-trim.js +15 -8
- package/dist-server/server/outbound-hold.js +13 -2
- package/dist-server/server/outbound-requests.js +71 -0
- package/dist-server/server/plugin-hub.js +259 -25
- package/dist-server/server/plugin-passages.js +16 -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/routes/plugin-mcp.js +118 -0
- package/dist-server/server/routes/plugin-studio.js +50 -0
- package/dist-server/server/runtime/tree.js +1 -1
- package/dist-server/server/side-jobs.js +1 -1
- package/dist-server/shared/plugin-hub.js +6 -2
- package/dist-server/vps-container-mcp.js +6 -6
- package/package.json +1 -1
- package/skills/limix-bot-factory/SKILL.md +2 -0
- package/skills/limix-bot-factory/assets/schemas/bot-spec.schema.json +14 -0
- package/skills/limix-bot-factory/references/integration-blueprint.md +1 -1
- package/skills/limix-bot-factory/references/vi.md +4 -0
- package/skills/limix-bot-factory/scripts/factorylib/cli.py +2 -1
- package/skills/limix-bot-factory/scripts/factorylib/core.py +19 -1
- package/skills/limix-bot-factory/scripts/factorylib/engine.py +10 -1
- package/skills/limix-bot-factory/scripts/mcp_server.py +3 -3
- package/dist/assets/VisibilitySection-CZiqicF5.js +0 -22
- package/dist/assets/channel-BloV1v8U.js +0 -1
- package/dist/assets/mcp-servers-z68ouwLN.js +0 -1
- package/dist/assets/styles-DiAFRlxu.css +0 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-D0mOoyOD.js +0 -8
- /package/dist/assets/{styles-Be5qq6WR.js → styles-CE92r4H3.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Server: --url, --port,
|
|
2
|
-
// is being looked for; it comes from
|
|
1
|
+
// Server: --url, --port, LIMIXBOT_URL or OMB_PORT, else the desktop ports. A credential never travels while a server
|
|
2
|
+
// is being looked for; it comes from LIMIXBOT_TOKEN or --token-file only (a command line leaks).
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { EXIT, flag, HeadlessError, usageError } from "./args.js";
|
|
5
5
|
const DISCOVERY_PORTS = [8799, 18799, 28799];
|
|
@@ -11,7 +11,7 @@ export async function loadMcp() {
|
|
|
11
11
|
}
|
|
12
12
|
catch (error) {
|
|
13
13
|
mcpModule = undefined;
|
|
14
|
-
throw usageError(`
|
|
14
|
+
throw usageError(`LIMIXBOT_URL is not usable: ${error instanceof Error ? error.message : String(error)}`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
/** Never printed. */
|
|
@@ -29,7 +29,7 @@ export function readToken(flags, env) {
|
|
|
29
29
|
throw usageError(`--token-file ${file} is empty`);
|
|
30
30
|
return token;
|
|
31
31
|
}
|
|
32
|
-
return env.OPENMAUSBOT_TOKEN?.trim() || undefined;
|
|
32
|
+
return env.LIMIXBOT_TOKEN?.trim() || env.OPENMAUSBOT_TOKEN?.trim() || undefined;
|
|
33
33
|
}
|
|
34
34
|
export function namedServer(flags, env) {
|
|
35
35
|
const url = flag(flags, "url")?.trim();
|
|
@@ -38,8 +38,9 @@ export function namedServer(flags, env) {
|
|
|
38
38
|
const port = flag(flags, "port")?.trim();
|
|
39
39
|
if (port)
|
|
40
40
|
return { port };
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const configuredUrl = env.LIMIXBOT_URL?.trim() || env.OPENMAUSBOT_URL?.trim();
|
|
42
|
+
if (configuredUrl)
|
|
43
|
+
return { url: configuredUrl };
|
|
43
44
|
return env.OMB_PORT?.trim() ? { port: env.OMB_PORT.trim() } : undefined;
|
|
44
45
|
}
|
|
45
46
|
export async function openClient(flags, deps, mutating) {
|
|
@@ -66,13 +67,13 @@ export async function openClient(flags, deps, mutating) {
|
|
|
66
67
|
throw usageError("mutating commands require an explicit Limix Bot instance", "start `control-omb launch`, then pass its URL with --url");
|
|
67
68
|
}
|
|
68
69
|
if (token) {
|
|
69
|
-
throw usageError("a token needs a named server, so it is never sent while looking for one", "pass --url (or --port), or set
|
|
70
|
+
throw usageError("a token needs a named server, so it is never sent while looking for one", "pass --url (or --port), or set LIMIXBOT_URL or OMB_PORT");
|
|
70
71
|
}
|
|
71
72
|
try {
|
|
72
73
|
baseUrl = await mcp.probeBaseUrls(DISCOVERY_PORTS.map((port) => `http://127.0.0.1:${port}`));
|
|
73
74
|
}
|
|
74
75
|
catch {
|
|
75
|
-
throw new HeadlessError(`no Limix Bot server answered on 127.0.0.1 ports ${DISCOVERY_PORTS.join(", ")}`, EXIT.unreachable, "start one with `limixbot serve`, or name one with --url or
|
|
76
|
+
throw new HeadlessError(`no Limix Bot server answered on 127.0.0.1 ports ${DISCOVERY_PORTS.join(", ")}`, EXIT.unreachable, "start one with `limixbot serve`, or name one with --url or LIMIXBOT_URL");
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
const request = deps.request ?? mcp.request;
|
|
@@ -119,7 +120,7 @@ export async function explain(error, baseUrl) {
|
|
|
119
120
|
return usageError(message);
|
|
120
121
|
const status = typeof error?.status === "number" ? error.status : undefined;
|
|
121
122
|
if (status === 401) {
|
|
122
|
-
return new HeadlessError("this server needs a credential and did not accept the one given", EXIT.unreachable, "get one with `limixbot connect URL --out FILE`, then pass --token-file FILE or set
|
|
123
|
+
return new HeadlessError("this server needs a credential and did not accept the one given", EXIT.unreachable, "get one with `limixbot connect URL --out FILE`, then pass --token-file FILE or set LIMIXBOT_TOKEN");
|
|
123
124
|
}
|
|
124
125
|
if (status === 403) {
|
|
125
126
|
return new HeadlessError(`not allowed: ${message}`, EXIT.unreachable, "this needs a paired session with the right scope: `limixbot connect` mints one on this computer");
|
|
@@ -79,7 +79,7 @@ limixbot doctor --host [--data-dir DIR] [--port 8799] [--domain HOST]
|
|
|
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
|
-
Then use it: --url URL --token-file FILE (or
|
|
82
|
+
Then use it: --url URL --token-file FILE (or LIMIXBOT_URL and LIMIXBOT_TOKEN).`,
|
|
83
83
|
mcp: "limixbot mcp\n Serve the Limix Bot MCP tools on stdin and stdout, for an agent (docs/mcp-server.md).",
|
|
84
84
|
token: "limixbot token create NAME --out FILE … | token list | token revoke ID (see help token create)",
|
|
85
85
|
"token create": `limixbot token create NAME --out FILE [--scope client|admin] [--expires 90d] [--force]
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, statSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { once } from "node:events";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { parseDocument } from "yaml";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { approvedForExport, pluginId } from "./hybrid-plugin-manifest.js";
|
|
9
|
+
const pin = z.object({ id: pluginId, sha256: z.string().regex(/^[a-f0-9]{64}$/), kind: z.enum(["skills", "resources"]), name: z.string().regex(/^[a-z0-9-]{1,64}$/) }).strict();
|
|
10
|
+
const pins = z.array(pin).min(1).max(32);
|
|
11
|
+
const grantSchema = z.object({ tokenHash: z.string().regex(/^[a-f0-9]{64}$/), pins });
|
|
12
|
+
const digest = (value) => createHash("sha256").update(value).digest("hex");
|
|
13
|
+
const revision = "2026-07-28";
|
|
14
|
+
const cache = { ttlMs: 0, cacheScope: "private" };
|
|
15
|
+
const clientId = z.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
|
|
16
|
+
function grantFile(dir, client) {
|
|
17
|
+
return join(dir, "plugin-gateway", clientId.parse(client) + ".json");
|
|
18
|
+
}
|
|
19
|
+
function entries(dir, allowed) {
|
|
20
|
+
const dbFile = join(dir, "plugin-library.json");
|
|
21
|
+
if (!existsSync(dbFile) || statSync(dbFile).size > 32 * 1024 * 1024)
|
|
22
|
+
return [];
|
|
23
|
+
const db = JSON.parse(readFileSync(dbFile, "utf8"));
|
|
24
|
+
if (db.schemaVersion !== 2 || !Array.isArray(db.installed))
|
|
25
|
+
return [];
|
|
26
|
+
return allowed.flatMap(pin => {
|
|
27
|
+
const approved = approvedForExport(db, pin.id, pin.sha256);
|
|
28
|
+
if (approved?.type !== "local")
|
|
29
|
+
return [];
|
|
30
|
+
const part = approved.components[pin.kind].find(item => item.name === pin.name);
|
|
31
|
+
if (!part)
|
|
32
|
+
return [];
|
|
33
|
+
const uri = pin.kind === "skills" ? `skill://${pin.id}/${part.name}/SKILL.md` : `limix-resource://${pin.id}/${part.name}`;
|
|
34
|
+
return [{ ...part, kind: pin.kind, uri }];
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export function grantPluginAccess(dir, client, input) {
|
|
38
|
+
const selected = pins.parse(input);
|
|
39
|
+
const available = entries(dir, selected);
|
|
40
|
+
if (new Set(available.map(part => part.uri)).size !== selected.length)
|
|
41
|
+
throw Error("Every component must belong to an approved local revision");
|
|
42
|
+
const file = grantFile(dir, client);
|
|
43
|
+
mkdirSync(join(dir, "plugin-gateway"), { recursive: true, mode: 0o700 });
|
|
44
|
+
const token = randomBytes(32).toString("hex");
|
|
45
|
+
writeFileSync(file, JSON.stringify({ pins: selected, tokenHash: digest(token) }), { mode: 0o600, flag: "wx" });
|
|
46
|
+
return token;
|
|
47
|
+
}
|
|
48
|
+
export function pluginGateway(dir, client, token) {
|
|
49
|
+
const file = grantFile(dir, client);
|
|
50
|
+
const serverInfo = { name: "Limix MCP Gateway", version: "1.0.0" };
|
|
51
|
+
let started = 0, requests = 0;
|
|
52
|
+
return (method, params) => {
|
|
53
|
+
const grant = grantSchema.parse(JSON.parse(readFileSync(file, "utf8")));
|
|
54
|
+
if (!timingSafeEqual(Buffer.from(digest(token), "hex"), Buffer.from(grant.tokenHash, "hex")))
|
|
55
|
+
throw Error("Access denied");
|
|
56
|
+
if (Date.now() - started >= 60000) {
|
|
57
|
+
started = Date.now();
|
|
58
|
+
requests = 0;
|
|
59
|
+
}
|
|
60
|
+
if (++requests > 120)
|
|
61
|
+
throw Error("Request limit exceeded");
|
|
62
|
+
const audit = join(dir, "plugin-gateway", client + ".audit.jsonl");
|
|
63
|
+
if (existsSync(audit) && statSync(audit).size > 1024 * 1024)
|
|
64
|
+
renameSync(audit, audit + ".1");
|
|
65
|
+
appendFileSync(audit, JSON.stringify({ at: new Date().toISOString(), method: method.slice(0, 80) }) + "\n", { mode: 0o600 });
|
|
66
|
+
const capabilities = { resources: {}, tools: {}, extensions: { "io.modelcontextprotocol/skills": {} } };
|
|
67
|
+
if (method === "initialize")
|
|
68
|
+
return { protocolVersion: "2025-11-25", capabilities: { resources: {}, tools: {} }, serverInfo };
|
|
69
|
+
const meta = params._meta;
|
|
70
|
+
const version = meta?.["io.modelcontextprotocol/protocolVersion"];
|
|
71
|
+
if (version !== undefined && version !== revision)
|
|
72
|
+
throw Error("Unsupported protocol revision");
|
|
73
|
+
const modern = version === revision;
|
|
74
|
+
const wrap = (result) => modern ? { resultType: "complete", ...cache, ...result } : result;
|
|
75
|
+
if (method === "server/discover" && modern)
|
|
76
|
+
return wrap({ supportedVersions: [revision], capabilities, _meta: { "io.modelcontextprotocol/serverInfo": serverInfo } });
|
|
77
|
+
if (method === "ping")
|
|
78
|
+
return wrap({});
|
|
79
|
+
const available = entries(dir, grant.pins);
|
|
80
|
+
const description = ({ uri, name, description }) => ({ uri, name, description, mimeType: "text/markdown" });
|
|
81
|
+
const skills = available.filter(part => part.kind === "skills").map(part => {
|
|
82
|
+
const header = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(part.content);
|
|
83
|
+
if (!header)
|
|
84
|
+
throw Error("Invalid skill");
|
|
85
|
+
const doc = parseDocument(header[1], { schema: "core", uniqueKeys: true });
|
|
86
|
+
if (doc.errors.length || doc.warnings.length)
|
|
87
|
+
throw Error("Invalid skill");
|
|
88
|
+
return { uri: part.uri, frontmatter: doc.toJS({ maxAliasCount: 0 }), resources: [{ uri: part.uri, digest: "sha256:" + digest(part.content), size: Buffer.byteLength(part.content) }] };
|
|
89
|
+
});
|
|
90
|
+
if (method === "skills/list" && modern)
|
|
91
|
+
return wrap({ skills });
|
|
92
|
+
if (method === "skills/get" && modern) {
|
|
93
|
+
const skill = skills.find(part => part.uri === params.uri);
|
|
94
|
+
if (skill)
|
|
95
|
+
return wrap({ skill });
|
|
96
|
+
}
|
|
97
|
+
if (method === "resources/list")
|
|
98
|
+
return wrap({ resources: available.map(description) });
|
|
99
|
+
if (method === "tools/list")
|
|
100
|
+
return wrap({ tools: [{ name: "read_plugin_resource", description: "Read an explicitly shared plugin resource by URI.", inputSchema: { type: "object", additionalProperties: false, properties: { uri: { type: "string" } }, required: ["uri"] } }] });
|
|
101
|
+
if (method === "resources/read" || (method === "tools/call" && params.name === "read_plugin_resource")) {
|
|
102
|
+
const uri = method === "resources/read" ? params.uri : params.arguments?.uri;
|
|
103
|
+
const row = available.find(part => part.uri === uri);
|
|
104
|
+
if (row)
|
|
105
|
+
return wrap(method === "resources/read" ? { contents: [{ uri: row.uri, mimeType: "text/markdown", text: row.content }] } : { content: [{ type: "text", text: row.content }] });
|
|
106
|
+
}
|
|
107
|
+
throw Error("Unknown method or unavailable component");
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
async function main() {
|
|
111
|
+
const [command, directory, client, input] = process.argv.slice(2);
|
|
112
|
+
if (!directory || !client)
|
|
113
|
+
throw Error("Usage: hybrid-plugin-gateway.ts grant|serve|revoke DATA_DIR CLIENT [PINS.json]");
|
|
114
|
+
const dir = resolve(directory);
|
|
115
|
+
if (command === "grant" && input) {
|
|
116
|
+
process.stdout.write(grantPluginAccess(dir, client, JSON.parse(readFileSync(input, "utf8"))) + "\n");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (command === "revoke") {
|
|
120
|
+
unlinkSync(grantFile(dir, client));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (command !== "serve" || !process.env.LIMIX_PLUGIN_GATEWAY_TOKEN)
|
|
124
|
+
throw Error("A client token is required to serve");
|
|
125
|
+
const rpc = pluginGateway(dir, client, process.env.LIMIX_PLUGIN_GATEWAY_TOKEN);
|
|
126
|
+
const send = async (response) => {
|
|
127
|
+
if (!process.stdout.write(JSON.stringify(response) + "\n"))
|
|
128
|
+
await once(process.stdout, "drain");
|
|
129
|
+
};
|
|
130
|
+
let buffer = "";
|
|
131
|
+
process.stdin.setEncoding("utf8");
|
|
132
|
+
for await (const chunk of process.stdin) {
|
|
133
|
+
buffer += chunk;
|
|
134
|
+
let pos;
|
|
135
|
+
while ((pos = buffer.indexOf("\n")) >= 0) {
|
|
136
|
+
if (pos > 65536)
|
|
137
|
+
throw Error("Request exceeds 64 KiB");
|
|
138
|
+
const line = buffer.slice(0, pos);
|
|
139
|
+
buffer = buffer.slice(pos + 1);
|
|
140
|
+
let id = null;
|
|
141
|
+
try {
|
|
142
|
+
const msg = JSON.parse(line);
|
|
143
|
+
if (msg.jsonrpc !== "2.0" || typeof msg.method !== "string")
|
|
144
|
+
throw Error("Invalid request");
|
|
145
|
+
if (msg.id === undefined)
|
|
146
|
+
continue;
|
|
147
|
+
if (typeof msg.id !== "string" && typeof msg.id !== "number")
|
|
148
|
+
throw Error("Invalid request");
|
|
149
|
+
id = msg.id;
|
|
150
|
+
await send({ jsonrpc: "2.0", id, result: rpc(msg.method, msg.params ?? {}) });
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
await send({ jsonrpc: "2.0", id, error: { code: -32602, message: "Invalid request or access denied" } });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (buffer.length > 65536)
|
|
157
|
+
throw Error("Request exceeds 64 KiB");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
|
|
161
|
+
main().catch(() => { process.stderr.write("Limix MCP Gateway could not complete the request. Check client, grant and workspace.\n"); process.exitCode = 1; });
|
|
162
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { pluginContentKinds } from "../shared/plugin-hub.js";
|
|
4
|
+
import { isSkillName, parseSkillMd, scanSkillText, SKILL_FILE_MAX_BYTES } from "../shared/skill-md.js";
|
|
5
|
+
import { holdsCredential } from "../shared/redact.js";
|
|
6
|
+
export const pluginId = z.string().max(80).regex(/^[a-z0-9]+(?:[.-][a-z0-9]+)*$/);
|
|
7
|
+
export const pluginVersion = z.string().max(40).regex(/^\d+\.\d+\.\d+$/);
|
|
8
|
+
export const labels = (max) => z.object({ en: z.string().min(1).max(max), vi: z.string().min(1).max(max) }).strict();
|
|
9
|
+
export const serverName = z.string().regex(/^[\w-]{1,80}$/);
|
|
10
|
+
const unique = (entries) => new Set(entries).size === entries.length;
|
|
11
|
+
const text = z.object({
|
|
12
|
+
name: z.string().refine(isSkillName), description: z.string().min(1).max(1024), content: z.string().min(1).max(SKILL_FILE_MAX_BYTES),
|
|
13
|
+
}).strict();
|
|
14
|
+
const texts = z.array(text).max(32).refine(items => unique(items.map(item => item.name))).default([]);
|
|
15
|
+
const source = z.object({ server: serverName, uri: z.string().min(1).max(2048), revision: z.string().min(1).max(512) }).strict();
|
|
16
|
+
export const manifestSchema = z.object({
|
|
17
|
+
schemaVersion: z.literal("1.0.0"), id: pluginId, version: pluginVersion, name: labels(96), description: labels(1024),
|
|
18
|
+
license: z.string().trim().min(1).max(512), type: z.enum(["local", "remote-mcp", "hybrid"]),
|
|
19
|
+
components: z.object({
|
|
20
|
+
skills: texts, resources: texts, frameworks: texts, guardrails: texts,
|
|
21
|
+
mcpServers: z.array(serverName).max(12).refine(unique).default([]),
|
|
22
|
+
tools: z.array(z.string().regex(/^[a-zA-Z0-9_.-]{1,128}$/)).max(64).refine(unique).default([]),
|
|
23
|
+
}).strict(),
|
|
24
|
+
localization: z.union([
|
|
25
|
+
z.object({ core: z.literal("en"), interface: z.literal("vi") }).strict(),
|
|
26
|
+
z.object({ core: z.literal("original"), interface: z.literal("original") }).strict(),
|
|
27
|
+
]),
|
|
28
|
+
source: source.optional(),
|
|
29
|
+
permissions: z.object({ shell: z.literal(false), filesystem: z.array(z.string()).max(0), network: z.array(z.string()).max(0), secrets: z.array(z.string()).max(0) }).strict().optional(),
|
|
30
|
+
security: z.object({ approvalRequired: z.literal(true), sandboxRequired: z.literal(true), verifyIntegrity: z.literal(true) }).strict().optional(),
|
|
31
|
+
}).strict().superRefine((m, ctx) => {
|
|
32
|
+
const issue = (message) => ctx.addIssue({ code: "custom", message });
|
|
33
|
+
const remote = m.components.mcpServers.length > 0;
|
|
34
|
+
const content = pluginContentKinds.some(kind => m.components[kind].length > 0);
|
|
35
|
+
if (remote !== (m.type !== "local"))
|
|
36
|
+
issue("The manifest type must match its MCP connections");
|
|
37
|
+
if (m.type === "hybrid" && !content)
|
|
38
|
+
issue("A hybrid plugin needs a local component");
|
|
39
|
+
if (!remote && !content && !m.components.tools.length)
|
|
40
|
+
issue("The package is empty");
|
|
41
|
+
if (m.source && (m.type !== "remote-mcp" || !m.components.mcpServers.includes(m.source.server)))
|
|
42
|
+
issue("Invalid skill origin");
|
|
43
|
+
if (!m.source && m.localization.core !== "en")
|
|
44
|
+
issue("Local packages require an English core");
|
|
45
|
+
const encoded = JSON.stringify(m);
|
|
46
|
+
if (Buffer.byteLength(encoded) > 512 * 1024)
|
|
47
|
+
issue("Package exceeds the 512 KiB limit");
|
|
48
|
+
if (holdsCredential(encoded))
|
|
49
|
+
issue("A plugin manifest cannot contain credentials");
|
|
50
|
+
for (const skill of m.components.skills) {
|
|
51
|
+
const parsed = parseSkillMd(skill.content);
|
|
52
|
+
if ("error" in parsed || parsed.name !== skill.name || !parsed.body.trim())
|
|
53
|
+
issue("SKILL.md must contain a matching name, description and body");
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export const hurdleEvaluation = z.object({
|
|
57
|
+
schemaVersion: z.union([z.literal(2), z.literal(3)]),
|
|
58
|
+
id: z.string().regex(/^run_[0-9a-f-]{36}$/),
|
|
59
|
+
state: z.literal("complete"),
|
|
60
|
+
verdict: z.enum(["pass", "fail", "incomplete", "unknown"]),
|
|
61
|
+
snapshotFingerprint: z.string().regex(/^sha256:[0-9a-f]{64}$/),
|
|
62
|
+
}).strict();
|
|
63
|
+
export const scanPluginContent = manifest => {
|
|
64
|
+
const warnings = new Set();
|
|
65
|
+
const inspect = (label, value) => {
|
|
66
|
+
for (const warning of scanSkillText(value))
|
|
67
|
+
warnings.add(label + ": " + warning);
|
|
68
|
+
if (/\b(ignore|override|bypass|disregard)\b.{0,48}\b(instructions?|policy|policies|permissions?|approval)\b/i.test(value)) {
|
|
69
|
+
warnings.add(label + ": instructions may attempt to override host policy");
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
for (const kind of pluginContentKinds) {
|
|
73
|
+
for (const part of manifest.components[kind])
|
|
74
|
+
inspect(kind + "/" + part.name, part.description + "\n" + part.content);
|
|
75
|
+
}
|
|
76
|
+
for (const lang of ["en", "vi"])
|
|
77
|
+
inspect(lang, manifest.name[lang] + "\n" + manifest.description[lang]);
|
|
78
|
+
if (manifest.source && manifest.license === "Unspecified")
|
|
79
|
+
warnings.add("Remote source does not declare a license");
|
|
80
|
+
return [...warnings];
|
|
81
|
+
};
|
|
82
|
+
export function reviewManifest(manifest, evaluate = scanPluginContent) {
|
|
83
|
+
const { id, version, name, description } = manifest;
|
|
84
|
+
const sha256 = createHash("sha256").update(JSON.stringify(manifest)).digest("hex");
|
|
85
|
+
return { id, version, name, description, requiresMcp: manifest.components.mcpServers, manifest, sha256, warnings: evaluate(manifest) };
|
|
86
|
+
}
|
|
87
|
+
export function approvedForExport(input, id, sha256) {
|
|
88
|
+
const library = z.object({ schemaVersion: z.literal(2), installed: z.array(z.unknown()) }).safeParse(input);
|
|
89
|
+
if (!library.success)
|
|
90
|
+
return null;
|
|
91
|
+
for (const row of library.data.installed) {
|
|
92
|
+
if (!row || typeof row !== "object" || !("sha256" in row) || row.sha256 !== sha256 || !("manifest" in row))
|
|
93
|
+
continue;
|
|
94
|
+
const checked = manifestSchema.safeParse(row.manifest);
|
|
95
|
+
if (checked.success && checked.data.id === id && !checked.data.source && reviewManifest(checked.data).sha256 === sha256)
|
|
96
|
+
return checked.data;
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
@@ -136,7 +136,7 @@ import { DataFailure } from "./data/types.js";
|
|
|
136
136
|
import { TeamComputers, teamComputerOwner } from "./team-computers.js";
|
|
137
137
|
import { isEffortLevel } from "../shared/wire.js";
|
|
138
138
|
import { isPersistentQuestionCard, shouldSettleRequestCard } from "../shared/ask-question.js";
|
|
139
|
-
import { parseToolScope } from "../shared/tool-scope.js";
|
|
139
|
+
import { allowsTool, canUseMcpServer, parseToolScope } from "../shared/tool-scope.js";
|
|
140
140
|
import { boatCreateRecoverySnapshot } from "./boat-create-idempotency.js";
|
|
141
141
|
import { boatDeletionSnapshot } from "./boat-delete-journal.js";
|
|
142
142
|
import { liveDecisionRefusal } from "../shared/live-approval.js";
|
|
@@ -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";
|
|
@@ -535,6 +535,10 @@ import { createGroupOrderRoutes } from "./routes/group-order.js";
|
|
|
535
535
|
import { createBotLifecycleRoutes } from "./routes/bot-lifecycle.js";
|
|
536
536
|
import { createBotSkillsRoutes } from "./routes/bot-skills.js";
|
|
537
537
|
import { startHubAutoSync } from "./limix-skill-hub.js";
|
|
538
|
+
import { createPluginStudio } from "./routes/plugin-studio.js";
|
|
539
|
+
import { createPluginMcpRoutes, readPluginComponent } from "./routes/plugin-mcp.js";
|
|
540
|
+
import { customMcpServers as pluginServerSpecs } from "./config.js";
|
|
541
|
+
import { withMcpSignIn } from "./mcp-oauth.js";
|
|
538
542
|
import { createPluginHub } from "./plugin-hub.js";
|
|
539
543
|
import { limixBundledFor, limixSelectBundled, limixSkillDefaultsMigration } from "./limix-skill-store.js";
|
|
540
544
|
import { createSkillShareRoutes } from "./routes/skill-share.js";
|
|
@@ -1849,7 +1853,7 @@ researchAvailability.available();
|
|
|
1849
1853
|
function agentsIntegration(botId, threadId, depth, skillAuthoring, generation, roomHandoffId, hostFiles = false, automated = false) {
|
|
1850
1854
|
const bot = store.bot(botId), speaking = botForThread(botId, threadId) ?? bot;
|
|
1851
1855
|
// Only advertises the tools; the routes behind them refuse regardless.
|
|
1852
|
-
const host = { skillAuthoring: skillAuthoringEnabled(cfg), sharedComputers: botLending(), cloudHome: Boolean(CLOUD_HOME), team: Boolean(CLOUD_TEAM),
|
|
1856
|
+
const host = { pluginRead: Boolean(bot && pluginHub.hasComponents(bot, Object.keys(engineMcpServers(bot)))), skillAuthoring: skillAuthoringEnabled(cfg), sharedComputers: botLending(), cloudHome: Boolean(CLOUD_HOME), team: Boolean(CLOUD_TEAM),
|
|
1853
1857
|
voiceNotes: tts.voiceReady(cfg, speaking?.voice) && speaking?.voiceNotes !== false, x: Boolean(researchCredential(cfg.treg?.key)), research: researchAvailability.available(), imageGeneration: imageGenerationReady(cfg), meetings: boat.boatConfigured(cfg) };
|
|
1854
1858
|
return { ...agentsProxyLaunch(), env: agentsServerEnv({ threadId, bot: bot ?? { id: botId }, room: Boolean(store.groupByThread(threadId)), teamComputer: Boolean(bot && inheritedTeamComputer(bot)), botDriven: automated || botDrivenConversation(store.taskByThread(botId, threadId)), host }, { generation, depth, skillAuthoring, roomHandoffId, ...(hostFiles && !CLOUD_HOME && !HOSTED_WORKSPACE ? { deliversSavedFiles: true } : {}) }, (turn) => mintInternalCapability({ botId, threadId, kind: "agents", createdBots: 0, openedThreads: 0, ...turn }), `http://127.0.0.1:${PORT}`) };
|
|
1855
1859
|
}
|
|
@@ -6773,6 +6777,7 @@ bus.subscribe((event) => {
|
|
|
6773
6777
|
const verdict = permission && asker && event.requestId
|
|
6774
6778
|
? heldAtSafetyFloor(event, autoVerdict(effectiveApprovalMode, event.tool, {
|
|
6775
6779
|
requiresExplicitApproval: event.requiresExplicitApproval,
|
|
6780
|
+
humanElicitation: event.humanElicitation,
|
|
6776
6781
|
commandAllowed: Boolean(command && commandAllowlist.matches(asker.id, command)),
|
|
6777
6782
|
toolAllowed: Boolean(toolAllowKey && asker.alwaysAllow?.includes(toolAllowKey)), ownFilesRead: !guestDriven && readsOwnFiles(DATA_DIR, asker.id, event), // never in a guest's turn: the folder holds its owner's memory
|
|
6778
6783
|
}))
|
|
@@ -9573,7 +9578,54 @@ const outsideWrites = createOutsideWrites({ store, notify, language: (threadId)
|
|
|
9573
9578
|
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
9579
|
const outboundRequests = new OutboundRequestService();
|
|
9575
9580
|
const outboundHold = createOutboundHold({ store, dataDir: DATA_DIR, outboundRequests, holdMs: OUTBOUND_HOLD_MS, connectorThread, activeGroupTurnForBot, notify });
|
|
9576
|
-
const
|
|
9581
|
+
const pendingSends = new PendingOutboundSends(join(DATA_DIR, "pending-outbound"));
|
|
9582
|
+
async function outboundGmailConnection() {
|
|
9583
|
+
const settings = cfg.composio;
|
|
9584
|
+
if (CLOUD_HOME || HOSTED_WORKSPACE || !settings?.apiKey?.trim() || !settings.userId)
|
|
9585
|
+
return;
|
|
9586
|
+
const accounts = (await composio.connectedServices(cfg)).gmail?.accounts.filter(account => /^active$/i.test(account.status));
|
|
9587
|
+
if (cfg.composio !== settings || accounts?.length !== 1)
|
|
9588
|
+
return;
|
|
9589
|
+
return createHash("sha256").update(JSON.stringify([settings, accounts[0].id, process.env.OMB_COMPOSIO_API])).digest("hex");
|
|
9590
|
+
}
|
|
9591
|
+
async function sendRecoveredOutbound(requestId, saved) {
|
|
9592
|
+
const payload = { jsonrpc: "2.0", id: requestId, method: "tools/call",
|
|
9593
|
+
params: { name: "GMAIL_SEND_EMAIL", arguments: saved.args } };
|
|
9594
|
+
const calls = connectorCallsIn(payload.params.name, saved.args);
|
|
9595
|
+
const services = await composio.connectedServiceSlugs(cfg);
|
|
9596
|
+
const settings = cfg.composio;
|
|
9597
|
+
if (await outboundGmailConnection() !== saved.connection)
|
|
9598
|
+
throw new Error("Gmail connection changed");
|
|
9599
|
+
const result = await composio.relayMcp(cfg, payload, undefined, () => {
|
|
9600
|
+
const bot = store.bot(saved.botId);
|
|
9601
|
+
if (!bot || bot.composio === false || cfg.composio !== settings ||
|
|
9602
|
+
!directChatOf(saved.botId, saved.threadId) || outsideDrivenThread(saved.threadId) ||
|
|
9603
|
+
proactive.fence.refusesConnectorCall(bot, saved.threadId, payload) ||
|
|
9604
|
+
managedPolicy.appsCallRefusal(calls, services) ||
|
|
9605
|
+
!connectorAccessDecision(bot.connectorScopes, calls, services).ok ||
|
|
9606
|
+
!evaluateConnectorTools([payload.params.name], bot.connectorTools, services).allowed ||
|
|
9607
|
+
!pendingSends.get(requestId, saved.threadId))
|
|
9608
|
+
throw new Error("The original send is no longer authorized");
|
|
9609
|
+
pendingSends.claim(requestId);
|
|
9610
|
+
});
|
|
9611
|
+
if (!confirmedOutboundSend(result))
|
|
9612
|
+
throw new Error("Gmail did not confirm delivery");
|
|
9613
|
+
}
|
|
9614
|
+
function confirmedOutboundSend(result) {
|
|
9615
|
+
if (result.status < 200 || result.status >= 300)
|
|
9616
|
+
return false;
|
|
9617
|
+
try {
|
|
9618
|
+
const reply = JSON.parse(new TextDecoder().decode(result.bytes));
|
|
9619
|
+
return Boolean(reply.result && !reply.error && !reply.result.isError);
|
|
9620
|
+
}
|
|
9621
|
+
catch {
|
|
9622
|
+
return false;
|
|
9623
|
+
}
|
|
9624
|
+
}
|
|
9625
|
+
const { resolveAndSendTrust } = createTrustAnswers({
|
|
9626
|
+
store, dataDir: DATA_DIR, teamMemoryRequests, outsideWrites, outboundRequests,
|
|
9627
|
+
pendingSends, sendRecovered: sendRecoveredOutbound,
|
|
9628
|
+
});
|
|
9577
9629
|
const profileRequests = new ProfileRequestService({
|
|
9578
9630
|
store,
|
|
9579
9631
|
autoApply: appliesDirectly,
|
|
@@ -12544,6 +12596,22 @@ const pluginHub = createPluginHub(DATA_DIR, () => ({
|
|
|
12544
12596
|
teams: store.sections.filter(Boolean),
|
|
12545
12597
|
}));
|
|
12546
12598
|
pluginHub.pruneTeams(store.sections);
|
|
12599
|
+
async function resolvePluginServer(name, botId) {
|
|
12600
|
+
if (!Object.hasOwn(cfg.mcpServers ?? {}, name) || teamConnections.personMcp().includes(name))
|
|
12601
|
+
return null;
|
|
12602
|
+
const spec = managedPolicy.filterMcp(pluginServerSpecs(cfg, [name]))[name];
|
|
12603
|
+
if (!spec || ("url" in spec && botBox.enabled()))
|
|
12604
|
+
return null;
|
|
12605
|
+
await mcpKeys.warm(name, spec);
|
|
12606
|
+
const keyed = mcpKeys.resolve(name, spec, botId);
|
|
12607
|
+
if (!keyed.ok)
|
|
12608
|
+
return null;
|
|
12609
|
+
return (await withMcpSignIn({ [name]: keyed.server }, mcpOAuth))[name] ?? null;
|
|
12610
|
+
}
|
|
12611
|
+
ROUTES.push(createPluginMcpRoutes(pluginHub, resolvePluginServer, DATA_DIR), createPluginStudio(async (botId, prompt, signal) => {
|
|
12612
|
+
assertWithinBudget(cfg, DATA_DIR);
|
|
12613
|
+
return sideJobs.text("plugin-draft", botId)?.generateText(prompt, { timeoutMs: 45_000, signal });
|
|
12614
|
+
}));
|
|
12547
12615
|
const skillsRoutes = createBotSkillsRoutes({ store, cfg, listBotSkills, readBotSkillFile, stagedSkillListing });
|
|
12548
12616
|
ROUTES.push(skillsRoutes, pluginHub.route);
|
|
12549
12617
|
startHubAutoSync();
|
|
@@ -13050,7 +13118,7 @@ const handleRequest = async (req, res) => {
|
|
|
13050
13118
|
// Two public routes come first; everything else needs the loopback owner or a paired session with the right scope.
|
|
13051
13119
|
if (method === "GET" && !path.startsWith("/api/") && !path.startsWith("/.well-known/") && (moveFreeze.screen(path) ? (res.writeHead(302, { location: moveFreeze.screen(path), "cache-control": "no-store" }).end(), true) : serveStatic(res, path, STATIC_DIR)))
|
|
13052
13120
|
return;
|
|
13053
|
-
if (method === "GET" && path === "/.well-known/openmausbot/environment") {
|
|
13121
|
+
if (method === "GET" && (path === "/.well-known/limixbot/environment" || path === "/.well-known/openmausbot/environment")) {
|
|
13054
13122
|
return json(res, 200, environmentDescriptor({ environmentId: ENVIRONMENT_ID, ...TEAM_LABEL, desktopManaged: DESKTOP_MANAGED, emailSignIn: !HOSTED_WORKSPACE && !CLOUD_HOME && emailSignIn.enabled(), sharedComputers: lendingEnabled(), cloudHome: Boolean(CLOUD_HOME), cloudTeam: CLOUD_TEAM !== null, ownHome: ownHome.takesMove() }));
|
|
13055
13123
|
}
|
|
13056
13124
|
const domainCheck = /^\/\.well-known\/openmausbot\/domain-check\/([a-f0-9]{64})$/.exec(path);
|
|
@@ -14163,6 +14231,23 @@ const handleRequest = async (req, res) => {
|
|
|
14163
14231
|
task: store.taskByThread(from.id, threadId)?.title,
|
|
14164
14232
|
});
|
|
14165
14233
|
}
|
|
14234
|
+
if (method === "POST" && path === "/api/internal/plugin-read") {
|
|
14235
|
+
const input = await readInternalBody();
|
|
14236
|
+
if ((internalCapability.pluginReads ?? 0) >= 32)
|
|
14237
|
+
return json(res, 429, { error: "Plugin read budget exhausted for this turn" });
|
|
14238
|
+
internalCapability.pluginReads = (internalCapability.pluginReads ?? 0) + 1;
|
|
14239
|
+
if (!allowsTool(internalSender.toolScope, { kind: "mcp", server: "agents", name: "plugin_read" }, input))
|
|
14240
|
+
return json(res, 403, { error: "Plugin reads disabled for this bot" });
|
|
14241
|
+
const allowed = () => Object.keys(engineMcpServers(internalSender)).filter(name => canUseMcpServer(internalSender.toolScope, name));
|
|
14242
|
+
const result = await readPluginComponent(pluginHub, resolvePluginServer, internalSender, allowed, input, DATA_DIR, mcpServersHost.probeAs({ bot: internalSender.id }), origin => {
|
|
14243
|
+
if (internalCapability.pluginOrigin && internalCapability.pluginOrigin !== origin)
|
|
14244
|
+
return false;
|
|
14245
|
+
internalCapability.pluginOrigin = origin;
|
|
14246
|
+
return true;
|
|
14247
|
+
});
|
|
14248
|
+
requireActiveInternalCapability();
|
|
14249
|
+
return json(res, result.status, result.body);
|
|
14250
|
+
}
|
|
14166
14251
|
if (method === "GET" && path === "/api/internal/skills") {
|
|
14167
14252
|
if (!skillAuthoringEnabled(cfg))
|
|
14168
14253
|
return json(res, 403, { error: "skill authoring is not enabled in Settings" });
|
|
@@ -15143,17 +15228,37 @@ const handleRequest = async (req, res) => {
|
|
|
15143
15228
|
if (opaque && currentSender.connectorTools !== undefined && !sandbox.open(currentSender))
|
|
15144
15229
|
return refuseOutbound(sandbox.refusal);
|
|
15145
15230
|
const fullAccess = outboundTool !== null && sendsFreely();
|
|
15231
|
+
const recoverableArgs = rpcParams?.name === "GMAIL_SEND_EMAIL" && !actor.access &&
|
|
15232
|
+
directChatOf(currentSender.id, internalCapability.threadId) && !outsideDrivenThread(internalCapability.threadId)
|
|
15233
|
+
? exactGmailSend(rpcParams.arguments)
|
|
15234
|
+
: undefined;
|
|
15235
|
+
const outboundConnection = recoverableArgs ? await outboundGmailConnection().catch(() => undefined) : undefined;
|
|
15236
|
+
requireActiveInternalCapability();
|
|
15146
15237
|
const held = outboundTool
|
|
15147
15238
|
? await outboundHold.hold({
|
|
15148
15239
|
bot: currentSender, threadId: internalCapability.threadId, tool: outboundTool, calls: outboundCalls, opaque, fullAccess,
|
|
15149
15240
|
active: () => internalCapabilityIsActive(internalCapability),
|
|
15241
|
+
...(recoverableArgs && outboundConnection ? {
|
|
15242
|
+
persist: (requestId, expiresAt) => pendingSends.save(requestId, {
|
|
15243
|
+
botId: currentSender.id, threadId: internalCapability.threadId, connection: outboundConnection,
|
|
15244
|
+
expiresAt, args: recoverableArgs,
|
|
15245
|
+
}),
|
|
15246
|
+
discard: (requestId) => pendingSends.discard(requestId),
|
|
15247
|
+
} : {}),
|
|
15150
15248
|
})
|
|
15151
15249
|
: { ok: true, approved: false };
|
|
15152
15250
|
if (!held.ok)
|
|
15153
15251
|
return refuseOutbound(held.text);
|
|
15252
|
+
if (held.approved && outboundCalls.some(call => call.slug === "GMAIL_SEND_DRAFT")) {
|
|
15253
|
+
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.");
|
|
15254
|
+
}
|
|
15154
15255
|
const outboundApproved = held.approved;
|
|
15155
15256
|
if (outboundApproved)
|
|
15156
15257
|
requireActiveInternalCapability();
|
|
15258
|
+
if (held.requestId && await outboundGmailConnection().catch(() => undefined) !== outboundConnection) {
|
|
15259
|
+
pendingSends.discard(held.requestId);
|
|
15260
|
+
return refuseOutbound("The Gmail connection changed after review. Request a new approval before sending.");
|
|
15261
|
+
}
|
|
15157
15262
|
let dispatchRefusal;
|
|
15158
15263
|
const refuseDispatch = (text) => {
|
|
15159
15264
|
dispatchRefusal = text;
|
|
@@ -15190,6 +15295,14 @@ const handleRequest = async (req, res) => {
|
|
|
15190
15295
|
refuseDispatch(error instanceof Error ? error.message : String(error));
|
|
15191
15296
|
}
|
|
15192
15297
|
}
|
|
15298
|
+
if (held.requestId) {
|
|
15299
|
+
try {
|
|
15300
|
+
pendingSends.claim(held.requestId);
|
|
15301
|
+
}
|
|
15302
|
+
catch {
|
|
15303
|
+
refuseDispatch("This send is no longer pending. Check the sent folder before trying again.");
|
|
15304
|
+
}
|
|
15305
|
+
}
|
|
15193
15306
|
for (const key of nextDrafts)
|
|
15194
15307
|
reservedDrafts.add(key);
|
|
15195
15308
|
}, undefined, teamConnections.via(actor.access)[1]);
|
|
@@ -15199,6 +15312,8 @@ const handleRequest = async (req, res) => {
|
|
|
15199
15312
|
return refuseOutbound(dispatchRefusal);
|
|
15200
15313
|
throw error;
|
|
15201
15314
|
}
|
|
15315
|
+
if (held.requestId && confirmedOutboundSend(upstream))
|
|
15316
|
+
pendingSends.complete(held.requestId);
|
|
15202
15317
|
const headers = {
|
|
15203
15318
|
"content-type": upstream.contentType,
|
|
15204
15319
|
"cache-control": "no-store",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { SERVER_ROOT } from "./proxy-paths.js";
|
|
3
|
+
export function limixNativeResource(name) {
|
|
4
|
+
const directory = import.meta.url.endsWith(".ts")
|
|
5
|
+
? join(SERVER_ROOT, "..", "dist-native", "limix-native", `${process.platform}-${process.arch}`)
|
|
6
|
+
: join(SERVER_ROOT, "..", "limix-native");
|
|
7
|
+
return join(directory, name);
|
|
8
|
+
}
|