limixbot 0.3.145 → 0.3.147
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-CqObZQbN.js → ActivityPanel-ha5UB6JF.js} +1 -1
- package/dist/assets/{App-DcG1JmK6.js → App-OHzELG1X.js} +104 -104
- package/dist/assets/{AppEventEditor-DR01sHAK.js → AppEventEditor-obfXqLac.js} +1 -1
- package/dist/assets/{BotSettingsDialog-BHgSIU9E.js → BotSettingsDialog-B4xJoXAR.js} +1 -1
- package/dist/assets/{BrowserPanel-g96rlnqQ.js → BrowserPanel-BA3MHxLE.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-UJJC6OPf.js → BrowserProfilesManager-C69B2qW7.js} +1 -1
- package/dist/assets/{CloudAddDialog-BjPYPhnk.js → CloudAddDialog-Cl1kfUfv.js} +1 -1
- package/dist/assets/{ComputerFilesPane-DA7MBSD0.js → ComputerFilesPane-CIE18AsH.js} +1 -1
- package/dist/assets/{ComputerPanel--rY7_KCN.js → ComputerPanel-DUlHlmJs.js} +2 -2
- package/dist/assets/{DataPanel-CEhe1WKo.js → DataPanel-BhAdUpy-.js} +1 -1
- package/dist/assets/{DesktopViewer-RNuariIo.js → DesktopViewer-uyCSG2he.js} +1 -1
- package/dist/assets/{GrokMoveDialog-DoUN6m5b.js → GrokMoveDialog-Cj9CtyFz.js} +1 -1
- package/dist/assets/{InspectorPanel-CdCXUouJ.js → InspectorPanel-CTOKraf7.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-CZ-BQqzV.js → KeyboardShortcutsModal-B8s_z7Bf.js} +1 -1
- package/dist/assets/KnowledgePanel-DWDBULkL.js +1 -0
- package/dist/assets/{LimixResizeHandles-BUe_6hSJ.js → LimixResizeHandles-C2c3aYPm.js} +1 -1
- package/dist/assets/{LiveDesktop-BnaxuTzU.js → LiveDesktop-BnagL5Xd.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-X1ev9Wov.js → LocalVmWorkspace-C_6HF5Be.js} +1 -1
- package/dist/assets/{MacLocalControl-RXW-1ET9.js → MacLocalControl-DfNRhU6Z.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-CIYTKbNj.js → MarkdownFilePreview-D8j47umK.js} +1 -1
- package/dist/assets/{MenuMotion-C-qcisoG.js → MenuMotion-B0aZnuh_.js} +1 -1
- package/dist/assets/{NewBotDialog-D_22AmDd.js → NewBotDialog-CxY9p3uW.js} +1 -1
- package/dist/assets/{PhoneAppDialog-WOhzSF82.js → PhoneAppDialog-BB0rq01m.js} +1 -1
- package/dist/assets/{PlacesRail-DoUGQSpd.js → PlacesRail-tZyNm-l3.js} +1 -1
- package/dist/assets/{PluginsPanel-DxM_qWtC.js → PluginsPanel-Cod2cJ3m.js} +6 -6
- package/dist/assets/{ProIntroduction-CQFDxYxi.js → ProIntroduction-BYeJLd6v.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-CdQmz7Qu.js → RemoteAgentSettingsPanel-DrDaWqZQ.js} +1 -1
- package/dist/assets/{RoomPanel-DVsYTCX7.js → RoomPanel-BldqgGbT.js} +1 -1
- package/dist/assets/{RoutinesPage-DG30sQw7.js → RoutinesPage-Dt5n6TUd.js} +3 -3
- package/dist/assets/{SettingsModal-BFeWJ1OS.js → SettingsModal-5DXP6Iyh.js} +1 -1
- package/dist/assets/{ShareTeamDialog-BLddRjax.js → ShareTeamDialog-Bzte6WGL.js} +1 -1
- package/dist/assets/{SignedInSites-BREmZ6gH.js → SignedInSites-f8T3aw_5.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-Sg1D_gYP.js → TeamLibraryPanel-PS2c5SeX.js} +1 -1
- package/dist/assets/{TeamMapPage-CP7ug7dF.js → TeamMapPage-DlOu0vvo.js} +1 -1
- package/dist/assets/{TriggersPage-DmY-ibGg.js → TriggersPage-t4c2-ZAC.js} +1 -1
- package/dist/assets/{VisibilitySection-BqQTMT_O.js → VisibilitySection-X3MwlVCH.js} +5 -5
- package/dist/assets/{WebhookTrigger-Bk2khhKt.js → WebhookTrigger-DlLdx-JP.js} +1 -1
- package/dist/assets/{WorksOnGrid-BhZTjLmG.js → WorksOnGrid-C-i85Bh5.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV-4h66COg4.js → abnfDiagram-YUKMZFIV-DDXPrZzl.js} +1 -1
- package/dist/assets/{activity-JVyqvn--.js → activity-BlL5ycb5.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-XVFtgz_w.js → architectureDiagram-47P4ROYG-BiqBgMDV.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-Bzpnrunu.js → blockDiagram-E7TT5TSB-vc1neoFp.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-Baf7lWcX.js → c4Diagram-CRA5TL53-CQbtBKOv.js} +1 -1
- package/dist/assets/{calendar-days-DJ8Sk4Wo.js → calendar-days-_dtxyR4U.js} +1 -1
- package/dist/assets/channel-BzyEyDo_.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-C01NJDuW.js → chunk-2Q5K7J3B-Dq_aCCIt.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-zCxCK82Z.js → chunk-5VM5RSS4-EcX_ZXzF.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-Dn3xzwzp.js → chunk-7TKQ45FW-BA7CgKU2.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-D5v1LEvi.js → chunk-AW2ZBBNX-DkvVwaph.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-B_j2BQfP.js → chunk-FVRAUYC3-CdyGRg6v.js} +2 -2
- package/dist/assets/{chunk-HTAEGDNF-CYEfb4lj.js → chunk-HTAEGDNF-CS-veEVV.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-DYxCqsdI.js → chunk-JWPE2WC7-BiUYpinX.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-BVs1owNv.js → chunk-KQW6MTUR-DDPkIuwB.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-oNREPc9w.js → chunk-XXDRQBXY-C4YyKEem.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-B8JOWdQM.js → classDiagram-v2-K4WV4PDN-BjmVbVHi.js} +1 -1
- package/dist/assets/{coins-D-zVxeJ6.js → coins-Cu3qn-3t.js} +1 -1
- package/dist/assets/{core-DGyt94O8.js → core-DpqVMT4r.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-Cvvvdg2x.js → cose-bilkent-JH36ORCC-Bra0B-5z.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-BlyJPVpP.js → cynefin-EF2NZ3EQ-BRMKNbnx.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-aXWhkS0N.js → cynefinDiagram-3GCD6N5R-DMhNix9A.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-CK9mZlxS.js → dagre-W4DXFKR2-BWwdFKCx.js} +1 -1
- package/dist/assets/{diagram-2UJZ2QOL-ciDDPAUW.js → diagram-2UJZ2QOL-D_4J-D-V.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-ZC2XGXAQ.js → diagram-OVF4WLC6-CQ4l30Dm.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-B_UNW8Y1.js → diagram-PFPMY2P6-D3W2IEHX.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-BzqwG15l.js → diagram-UMYRVEAY-C9cpNhET.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-f7zBrJwE.js → diagram-YEKJPTXX-DIyquCXt.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-QClomp2E.js → diagram-ZIFT7M5P-CO6216kK.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-BwcmIXBL.js → ebnfDiagram-VR2GEFS7-BeHXJPN4.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS-DPv8qzg-.js → elk-IJKZMXRS-BdT_tK3j.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-BHknllso.js → erDiagram-O2IAPWRE-Cz_TiHab.js} +1 -1
- package/dist/assets/{file-up-B5lQ3tIu.js → file-up-flw1aUka.js} +1 -1
- package/dist/assets/{flowDiagram-OXPTDLAJ-LwDo9oFR.js → flowDiagram-OXPTDLAJ-BXLr0anm.js} +1 -1
- package/dist/assets/{ganttDiagram-R7TSEDQI-DDXQuF2p.js → ganttDiagram-R7TSEDQI-C37QIpaR.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-DxAL8MxK.js → gitGraphDiagram-XJZIOB7I-Cs8fTfJZ.js} +1 -1
- package/dist/assets/{import-name-fUZKEQiu.js → import-name-B6edwqYP.js} +1 -1
- package/dist/assets/{index-C_1rKgRm.js → index-BruSVBU0.js} +3 -3
- package/dist/assets/{index-Bb6OwohQ.js → index-DDwC7qII.js} +2 -2
- package/dist/assets/{infoDiagram-5W2HQ5XZ-BxZNIlp6.js → infoDiagram-5W2HQ5XZ-BpliNVPR.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-C6c1u1w2.js → ishikawaDiagram-K3B6WC7H-Dov7w4qz.js} +1 -1
- package/dist/assets/{journeyDiagram-COXZFDF6-BrngL-3X.js → journeyDiagram-COXZFDF6-DoihiGaK.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-BhTOtF-B.js → kanban-definition-P3RFRI5V-D_gNx8dG.js} +1 -1
- package/dist/assets/{mermaid.core-Cy9_uq1T.js → mermaid.core-BYPxVPn-.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-Dr3QB9wA.js → mindmap-definition-LZFPQGKD-wH2aKxFy.js} +1 -1
- package/dist/assets/{minimize-Ct6C2khA.js → minimize-sGQL0Xsy.js} +1 -1
- package/dist/assets/{monitor-BZrhga_j.js → monitor-zecPzfR5.js} +1 -1
- package/dist/assets/{new-bot-DCA0S24E.js → new-bot-DehPHgMa.js} +1 -1
- package/dist/assets/{org-library-DgVAGwBY.js → org-library-CA4y9Ru8.js} +1 -1
- package/dist/assets/{package-format-BvWgfqGs.js → package-format-CpbqH_LB.js} +1 -1
- package/dist/assets/{pegDiagram-BGZESJAR-D0bSaHqd.js → pegDiagram-BGZESJAR-B7RTZksQ.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-B8i7ox8l.js → pieDiagram-CAPJLFHJ-B5mPB7O-.js} +1 -1
- package/dist/assets/{quadrantDiagram-GDMTTRAM-BcJTpsdR.js → quadrantDiagram-GDMTTRAM-CZqo7j7U.js} +1 -1
- package/dist/assets/{rail-Bzq4BbCt.js → rail-Ok0cs7cA.js} +1 -1
- package/dist/assets/{railroadDiagram-SM67HX2B-DSO-XOKW.js → railroadDiagram-SM67HX2B-MFpfIts_.js} +1 -1
- package/dist/assets/{remote-desktop-panel-BVRS7AXc.js → remote-desktop-panel-BIXUp23K.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-B5gEynme.js → requirementDiagram-X7JNWC4A-CJ49gC_q.js} +1 -1
- package/dist/assets/{sankeyDiagram-UM26HJRW-CK2T6Pgm.js → sankeyDiagram-UM26HJRW-DxpTSw3D.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-Dx9DVGEG.js → sequenceDiagram-ZO4K6R2Y-XEyCx2Ue.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-BbirmlCW.js → sizeCapture-INFHLROL-1Fx1tcNn.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-CuJOlmiS.js → stateDiagram-v2-TBUQTH76-CwxyNDK4.js} +1 -1
- package/dist/assets/styles-CMOouTIW.css +1 -0
- package/dist/assets/{styles-CLQR3ehf.js → styles-DO3EUxm2.js} +1 -1
- package/dist/assets/{swimlanes-N4OXWK64-BWFqBYF_.js → swimlanes-N4OXWK64-BuwwuENy.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-CcmXEgRh.js +8 -0
- package/dist/assets/{team-share-1e1FK9fo.js → team-share-CL18_anr.js} +1 -1
- package/dist/assets/{timeline-definition-YOQAKGHF-CzxPBKDi.js → timeline-definition-YOQAKGHF-CauwqKMA.js} +1 -1
- package/dist/assets/{usecaseDiagram-VIAY4XPW-B5-pXbU3.js → usecaseDiagram-VIAY4XPW-YZ3Cf2do.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-BccL1p-U.js → vennDiagram-BLWOH2XV-CDX8i7ID.js} +1 -1
- package/dist/assets/{vi-DyvsTHbT.js → vi-CiY3ddy3.js} +1 -1
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-DdJ9Pves.js → wardleyDiagram-YMQ3BMBF-CCdRrEMh.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-BAg7I3YQ.js → xychartDiagram-TAQBALBS-Vz4NaN0U.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/rail.html +5 -5
- package/dist-server/drivers/agents-proxy.js +412 -400
- package/dist-server/index.js +6845 -6649
- package/dist-server/knowledge-collection.worker.js +4737 -0
- package/dist-server/licenses/knowledge.txt +688 -0
- package/dist-server/limixbot.js +1560 -1542
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +1560 -1542
- package/dist-server/server/agents-turn.js +1 -0
- package/dist-server/server/bot-moves.js +16 -13
- package/dist-server/server/cloud-send-arrived.js +21 -3
- package/dist-server/server/drivers/agents-call.js +8 -0
- package/dist-server/server/drivers/agents-catalog-profile.js +1 -0
- package/dist-server/server/drivers/agents-catalog.js +4 -1
- package/dist-server/server/host/bot-access-gate.js +3 -0
- package/dist-server/server/index.js +52 -3
- package/dist-server/server/knowledge/core.bench.js +35 -0
- package/dist-server/server/knowledge/core.js +338 -0
- package/dist-server/server/knowledge/database.js +153 -0
- package/dist-server/server/knowledge/documents.js +169 -0
- package/dist-server/server/knowledge/files.js +64 -0
- package/dist-server/server/knowledge/host.js +158 -0
- package/dist-server/server/knowledge/memory.js +51 -0
- package/dist-server/server/knowledge/plugin.js +17 -0
- package/dist-server/server/knowledge/retrieval.js +90 -0
- package/dist-server/server/knowledge/schema.js +39 -0
- package/dist-server/server/knowledge/semantic.js +135 -0
- package/dist-server/server/knowledge/tools.js +58 -0
- package/dist-server/server/knowledge-collection-fetch.js +101 -0
- package/dist-server/server/knowledge-collection.js +300 -0
- package/dist-server/server/knowledge-collection.worker.js +142 -0
- package/dist-server/server/move-freeze.js +1 -16
- package/dist-server/server/plugin-hub.js +17 -0
- package/dist-server/server/routes/knowledge.js +48 -0
- package/dist-server/server/routes/move-freeze.js +2 -6
- package/package.json +1 -1
- package/dist/assets/channel-DJthUr0W.js +0 -1
- package/dist/assets/styles-CE5PtWhb.css +0 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-BjpCZGc-.js +0 -8
|
@@ -16,6 +16,7 @@ export function agentsServerEnv(conversation, turn, bearer, harnessUrl) {
|
|
|
16
16
|
OMB_COMMS_TOKEN: bearer(turn),
|
|
17
17
|
OMB_SKILL_AUTHORING_ENABLED: flag(host.skillAuthoring),
|
|
18
18
|
...(host.pluginRead ? { OMB_PLUGIN_READ: "1" } : {}),
|
|
19
|
+
...(host.knowledge ? { LIMIX_KNOWLEDGE: "1" } : {}),
|
|
19
20
|
OMB_MEMORY_ENABLED: flag(bot.memoryEnabled !== false),
|
|
20
21
|
OMB_SHARED_COMPUTERS_ENABLED: flag(host.sharedComputers),
|
|
21
22
|
OMB_CLOUD_HOME: flag(host.cloudHome), OMB_TEAM_PEOPLE: flag(host.team), OMB_ROOM: flag(conversation.room),
|
|
@@ -36,16 +36,12 @@ export function createBotMoves(deps) {
|
|
|
36
36
|
if (wait.botId === botId)
|
|
37
37
|
waits.cancel(wait.id, botId);
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
continue;
|
|
44
|
-
if (room.memberIds.every((id) => id === botId || deps.store.bot(id)?.movedTo || deps.store.bot(id)?.defaultBot))
|
|
45
|
-
continue;
|
|
46
|
-
deps.store.patchGroup?.(room.id, { memberIds: room.memberIds.filter((id) => id !== botId) });
|
|
39
|
+
for (const bot of deps.store.bots ?? []) {
|
|
40
|
+
const held = movedOf(bot);
|
|
41
|
+
if (held?.state === "moved" && held.team.id === MY_CLOUD_TEAM) {
|
|
42
|
+
deps.store.patchBot(bot.id, { hidden: false, movedTo: undefined, personalCloudCopyAt: held.at });
|
|
47
43
|
}
|
|
48
|
-
}
|
|
44
|
+
}
|
|
49
45
|
return {
|
|
50
46
|
/** The bot stops here for the move: no turns, its automations off and its waits cancelled. Busy while it answers; a
|
|
51
47
|
* bot already moved stays moved. Holding it again keeps what the first hold switched off. */
|
|
@@ -94,13 +90,18 @@ export function createBotMoves(deps) {
|
|
|
94
90
|
moved(botId, team) {
|
|
95
91
|
const bot = deps.store.bot(botId);
|
|
96
92
|
const held = movedOf(bot);
|
|
93
|
+
if (team.id === MY_CLOUD_TEAM && bot && !held && bot.personalCloudCopyAt !== undefined) {
|
|
94
|
+
return { movedTo: { team, state: "moved", at: bot.personalCloudCopyAt } };
|
|
95
|
+
}
|
|
97
96
|
if (!bot || !held || held.team.id !== team.id)
|
|
98
97
|
return { refused: "This bot is not moving to that team." };
|
|
98
|
+
if (team.id === MY_CLOUD_TEAM) {
|
|
99
|
+
const completed = { ...held, state: "moved", at: now() };
|
|
100
|
+
deps.store.patchBot(botId, { movedTo: undefined, hidden: false, personalCloudCopyAt: completed.at });
|
|
101
|
+
return { movedTo: completed };
|
|
102
|
+
}
|
|
99
103
|
if (held.state !== "moved") {
|
|
100
|
-
|
|
101
|
-
leaveRooms(botId);
|
|
102
|
-
else
|
|
103
|
-
deps.routines()?.removeForBot(botId);
|
|
104
|
+
deps.routines()?.removeForBot(botId);
|
|
104
105
|
cancelWaits(botId);
|
|
105
106
|
deps.store.patchBot(botId, { movedTo: { ...held, state: "moved", at: now() }, hidden: true });
|
|
106
107
|
}
|
|
@@ -110,6 +111,8 @@ export function createBotMoves(deps) {
|
|
|
110
111
|
back(botId) {
|
|
111
112
|
const bot = deps.store.bot(botId);
|
|
112
113
|
const held = movedOf(bot);
|
|
114
|
+
if (bot && !held && bot.personalCloudCopyAt !== undefined)
|
|
115
|
+
deps.store.patchBot(botId, { personalCloudCopyAt: undefined });
|
|
113
116
|
if (!bot || !held)
|
|
114
117
|
return { released: true };
|
|
115
118
|
if (held.team.id !== MY_CLOUD_TEAM)
|
|
@@ -59,7 +59,7 @@ export async function arrivedRoute(deps, { req, res, path, method, auth, json, r
|
|
|
59
59
|
return true;
|
|
60
60
|
}
|
|
61
61
|
const webhookIds = z.array(z.string().regex(/^[\w-]{1,128}$/u)).max(500);
|
|
62
|
-
const homeBody = z.object({ v: z.literal(1), webhooks: webhookIds.optional() });
|
|
62
|
+
const homeBody = z.object({ v: z.literal(1), webhooks: webhookIds.optional(), retainedAt: z.number().int().positive().optional() });
|
|
63
63
|
/** POST /api/cloud-send/home, on this computer once the bots came home with what they did on My Cloud: each bot that said
|
|
64
64
|
* on My Cloud that its webhook had a new address says once that it has an address here again; `webhooks`: only these, the
|
|
65
65
|
* ones this computer brought, when My Cloud goes on with other computers' bots. The record of where the bots came from
|
|
@@ -78,7 +78,24 @@ export async function homeRoute(deps, { req, res, path, method, json, readBody }
|
|
|
78
78
|
return true;
|
|
79
79
|
}
|
|
80
80
|
const only = body.data.webhooks ? new Set(body.data.webhooks) : null;
|
|
81
|
-
const
|
|
81
|
+
const retained = body.data.retainedAt;
|
|
82
|
+
const marker = join(deps.dataDir, "cloud-return-notified.json");
|
|
83
|
+
let told;
|
|
84
|
+
if (retained && only) {
|
|
85
|
+
let previous = 0;
|
|
86
|
+
try {
|
|
87
|
+
previous = Number(readFileSync(marker, "utf8"));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (error.code !== "ENOENT")
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
told = retained === previous ? [] : [...only];
|
|
94
|
+
writeFileAtomic(marker, String(retained), { mode: 0o600 });
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
told = (movedFrom(deps.dataDir)?.told ?? []).filter((id) => !only || only.has(id));
|
|
98
|
+
}
|
|
82
99
|
const hooks = deps.webhooks()?.list() ?? [];
|
|
83
100
|
const telling = told.flatMap((id) => {
|
|
84
101
|
const hook = hooks.find((candidate) => candidate.id === id);
|
|
@@ -86,7 +103,8 @@ export async function homeRoute(deps, { req, res, path, method, json, readBody }
|
|
|
86
103
|
return hook && bot ? [{ name: hook.name, threadId: bot.threadId }] : [];
|
|
87
104
|
});
|
|
88
105
|
// Gone before the lines go: coming home again after a crash here never has a bot say it twice.
|
|
89
|
-
|
|
106
|
+
if (!retained)
|
|
107
|
+
rmSync(join(deps.dataDir, FILE), { force: true });
|
|
90
108
|
for (const line of telling)
|
|
91
109
|
deps.store.appendMessage(line.threadId, botLine("chat.notice.webhookHome", line.name));
|
|
92
110
|
json(res, 200, { v: 1, told: telling.length });
|
|
@@ -193,6 +193,14 @@ export async function callTool(called, input, context) {
|
|
|
193
193
|
const member = agentsCallMember(name, args);
|
|
194
194
|
const { botId: BOT_ID, threadId: THREAD_ID } = context;
|
|
195
195
|
const { api, apiResponse } = context.client;
|
|
196
|
+
if (name.startsWith("knowledge_")) {
|
|
197
|
+
const result = await apiResponse("/api/internal/knowledge/" + name.slice("knowledge_".length), { method: "POST", body: JSON.stringify(args) });
|
|
198
|
+
if (!result.ok)
|
|
199
|
+
return { text: String(result.body.error ?? "Knowledge request failed."), isError: true };
|
|
200
|
+
const text = JSON.stringify(result.body);
|
|
201
|
+
const data = text.length <= 16_000 ? result.body : { truncated: true, excerpt: text.slice(0, 15_000), hint: "Narrow the search, reduce the limit or request one document." };
|
|
202
|
+
return { text: JSON.stringify(data), passthrough: { content: [{ type: "text", text: JSON.stringify(data) }], structuredContent: data } };
|
|
203
|
+
}
|
|
196
204
|
if (name === "vm_exec") {
|
|
197
205
|
const { ok, body } = await apiResponse("/api/internal/vm-exec", {
|
|
198
206
|
method: "POST",
|
|
@@ -3,6 +3,7 @@ import { toolsOffFromEnv } from "../../shared/tool-groups.js";
|
|
|
3
3
|
export function catalogProfileFromEnv(env) {
|
|
4
4
|
return {
|
|
5
5
|
...(env.OMB_PLUGIN_READ === "1" ? { pluginRead: true } : {}),
|
|
6
|
+
...(env.LIMIX_KNOWLEDGE === "1" ? { knowledge: true } : {}),
|
|
6
7
|
skillAuthoring: env.OMB_SKILL_AUTHORING_ENABLED === "1",
|
|
7
8
|
sharedComputers: env.OMB_SHARED_COMPUTERS_ENABLED === "1",
|
|
8
9
|
voiceNotes: env.OMB_VOICE_NOTES === "1",
|
|
@@ -13,6 +13,7 @@ import { COMPUTER_ASK_TOOL_DEFINITIONS, COMPUTER_ASK_TOOL_NAMES } from "./agents
|
|
|
13
13
|
import { IMAGE_TOOL_DEFINITIONS, IMAGE_TOOL_NAMES } from "./agents-image-tools.js";
|
|
14
14
|
import { MEETING_TOOL_DEFINITIONS, MEETING_TOOL_NAMES } from "./agents-meeting-tools.js";
|
|
15
15
|
import { MAUSBOT_TOOL_DEFINITIONS } from "./agents-mausbot-tools.js";
|
|
16
|
+
import { knowledgeTools } from "../knowledge/tools.js";
|
|
16
17
|
import { PERSON_TOOL_DEFINITIONS } from "./agents-person-tools.js";
|
|
17
18
|
import { RESEARCH_TOOL_DEFINITIONS, RESEARCH_TOOL_NAMES, X_TOOL_NAMES } from "./agents-research-tools.js";
|
|
18
19
|
import { advertisedSchema } from "./agents-schema.js";
|
|
@@ -155,6 +156,7 @@ const TRIGGER_FIELDS_SCHEMA = {
|
|
|
155
156
|
const CHIEF_PROFILE_TARGET = " A Chief of Staff may pass for_bot_id (from list_bots) for a requested change to another bot in its section.";
|
|
156
157
|
const APPLIES_OUTCOME = " Read the result: it applies immediately at every access level, and the person sees it with an Undo where possible. If applied, continue the work without another confirmation. Only a pending result (a Cloud conversation its owner did not drive) means ending the turn to wait for the owner. Never claim success without an applied result; report failures honestly. This does not elevate another bot's execution permissions.";
|
|
157
158
|
const TOOL_DEFINITIONS = [
|
|
159
|
+
...knowledgeTools.filter(tool => tool.name !== "knowledge_archive"),
|
|
158
160
|
{
|
|
159
161
|
name: "create_options_card",
|
|
160
162
|
description: "Show the person a native card with 2-6 choices in this Watcher conversation. The card is passive: a click returns the selected words as a reply and never authorizes or performs an external action. Use it for Watcher's review and draft-selection steps, then wait for the person's response.",
|
|
@@ -927,7 +929,8 @@ export function fullInputSchema(name) {
|
|
|
927
929
|
return FULL_INPUT_SCHEMAS.get(name);
|
|
928
930
|
}
|
|
929
931
|
function catalogTools(profile) {
|
|
930
|
-
const BOT_SCOPED_TOOLS = TOOL_DEFINITIONS.filter((tool) => (
|
|
932
|
+
const BOT_SCOPED_TOOLS = TOOL_DEFINITIONS.filter((tool) => (profile.knowledge === true || !tool.name.startsWith("knowledge_")) &&
|
|
933
|
+
(tool.name !== "plugin_read" || profile.pluginRead === true) &&
|
|
931
934
|
(profile.botId === WATCHER_OPTIONS_CARD_BOT_ID || !WATCHER_TOOL_NAMES.has(tool.name)) &&
|
|
932
935
|
(profile.memoryEnabled !== false || (tool.name !== "memory_update" && tool.name !== "memory_log")) &&
|
|
933
936
|
(profile.computerSelection === true || tool.name !== "select_computer") &&
|
|
@@ -10,6 +10,9 @@ export function levelNeeded(method, path) {
|
|
|
10
10
|
const verb = method.toUpperCase();
|
|
11
11
|
if (verb === "GET" || verb === "HEAD")
|
|
12
12
|
return "view";
|
|
13
|
+
const knowledge = /^\/api\/bots\/[\w-]+\/knowledge\/([a-z_]+)$/.exec(path);
|
|
14
|
+
if (knowledge && verb === "POST")
|
|
15
|
+
return /^(list|read|search|list_sources|history|backlinks|graph|get_stats|memory_recall|memory_consolidate|export|archive|jobs)$/.test(knowledge[1]) ? "view" : "edit";
|
|
13
16
|
if (/^\/api\/bots\/[\w-]+$/.test(path))
|
|
14
17
|
return null;
|
|
15
18
|
if (/^\/api\/bots\/[\w-]+\/(?:access|bot-api(?:\/new-key)?)$/.test(path))
|
|
@@ -544,6 +544,9 @@ import { createPluginMcpRoutes, readPluginComponent } from "./routes/plugin-mcp.
|
|
|
544
544
|
import { customMcpServers as pluginServerSpecs } from "./config.js";
|
|
545
545
|
import { withMcpSignIn } from "./mcp-oauth.js";
|
|
546
546
|
import { createPluginHub } from "./plugin-hub.js";
|
|
547
|
+
import { createKnowledgeHost } from "./knowledge/host.js";
|
|
548
|
+
import { KnowledgeError } from "./knowledge/schema.js";
|
|
549
|
+
import { knowledgeFailure, knowledgeRoutes } from "./routes/knowledge.js";
|
|
547
550
|
import { limixBundledFor, limixSelectBundled, limixSkillDefaultsMigration } from "./limix-skill-store.js";
|
|
548
551
|
import { createSkillShareRoutes } from "./routes/skill-share.js";
|
|
549
552
|
import { createTeamContextRoutes } from "./routes/team-context.js";
|
|
@@ -1859,7 +1862,7 @@ function agentsIntegration(botId, threadId, depth, skillAuthoring, generation, r
|
|
|
1859
1862
|
// Only advertises the tools; the routes behind them refuse regardless.
|
|
1860
1863
|
const host = { pluginRead: Boolean(bot && pluginHub.hasComponents(bot, [...Object.keys(engineMcpServers(bot)), ...(workspaceRead ? [WORKSPACE_READ] : [])])), skillAuthoring: skillAuthoringEnabled(cfg), sharedComputers: botLending(), cloudHome: Boolean(CLOUD_HOME), team: Boolean(CLOUD_TEAM),
|
|
1861
1864
|
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) };
|
|
1862
|
-
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, ...(workspaceRead ? { workspaceReadMounted: true } : {}) }), `http://127.0.0.1:${PORT}`) };
|
|
1865
|
+
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: { ...host, knowledge: Boolean(bot && knowledge.enabled(bot) && !cloudGuestDriven(threadId) && !botApiThread(threadId) && !proactive.fence.confines(threadId)) } }, { generation, depth, skillAuthoring, roomHandoffId, ...(hostFiles && !CLOUD_HOME && !HOSTED_WORKSPACE ? { deliversSavedFiles: true } : {}) }, (turn) => mintInternalCapability({ botId, threadId, kind: "agents", createdBots: 0, openedThreads: 0, ...turn, ...(workspaceRead ? { workspaceReadMounted: true } : {}) }), `http://127.0.0.1:${PORT}`) };
|
|
1863
1866
|
}
|
|
1864
1867
|
function workspaceReadAllowed(bot, threadId, cwd) {
|
|
1865
1868
|
return sameWorkspacePath(bot.cwd, cwd) && sameWorkspacePath(store.taskByThread(bot.id, threadId)?.cwd, cwd)
|
|
@@ -2994,7 +2997,7 @@ const wireTask = (task, botModel, awaiting = threadsAwaitingTeammates()) => {
|
|
|
2994
2997
|
};
|
|
2995
2998
|
/** Strips provider session ids (resumeCursors) here, not at call sites, so no broadcast or paired phone ever gets them. */
|
|
2996
2999
|
const wireBot = (bot) => {
|
|
2997
|
-
const { resumeCursors: _resumeCursors, tasks, approvalGrant, lastProfileRequestId: _lastProfileRequestId, lastTeamSetupReceipt: _lastTeamSetupReceipt, packageBase: _packageBase, assignedSkills: _assignedSkills, mainThreadChoice: _mainThreadChoice, ...rest } = bot;
|
|
3000
|
+
const { resumeCursors: _resumeCursors, tasks, approvalGrant, lastProfileRequestId: _lastProfileRequestId, lastTeamSetupReceipt: _lastTeamSetupReceipt, packageBase: _packageBase, assignedSkills: _assignedSkills, mainThreadChoice: _mainThreadChoice, personalCloudCopyAt: _personalCloudCopyAt, ...rest } = bot;
|
|
2998
3001
|
// Clients see Ask while an elevated grant awaits the desktop's confirmation, never a grant that may still roll back.
|
|
2999
3002
|
const visible = approvalGrant && !approvalGrant.threadOnly
|
|
3000
3003
|
? { ...rest, approvalMode: "ask", autoApprove: false }
|
|
@@ -3014,7 +3017,7 @@ function toolScopeForTurn(botId) {
|
|
|
3014
3017
|
return parsed.scope;
|
|
3015
3018
|
}
|
|
3016
3019
|
const wireTrustedApprovalBot = (bot) => {
|
|
3017
|
-
const { resumeCursors: _resumeCursors, tasks, approvalGrant: _approvalGrant, lastProfileRequestId: _lastProfileRequestId, lastTeamSetupReceipt: _lastTeamSetupReceipt, packageBase: _packageBase, assignedSkills: _assignedSkills, mainThreadChoice: _mainThreadChoice, ...rest } = bot;
|
|
3020
|
+
const { resumeCursors: _resumeCursors, tasks, approvalGrant: _approvalGrant, lastProfileRequestId: _lastProfileRequestId, lastTeamSetupReceipt: _lastTeamSetupReceipt, packageBase: _packageBase, assignedSkills: _assignedSkills, mainThreadChoice: _mainThreadChoice, personalCloudCopyAt: _personalCloudCopyAt, ...rest } = bot;
|
|
3018
3021
|
const awaiting = threadsAwaitingTeammates();
|
|
3019
3022
|
return { ...rest, approvalMode: approvalModeFor(rest), mainThreadId: botMainThread(bot.id), avatarUrl: rest.avatarUrl ?? null, ...(tasks ? { tasks: tasks.map((task) => wireTask(task, bot.modelSelection, awaiting)) } : {}) };
|
|
3020
3023
|
};
|
|
@@ -12633,6 +12636,22 @@ const pluginHub = createPluginHub(DATA_DIR, () => ({
|
|
|
12633
12636
|
teams: store.sections.filter(Boolean),
|
|
12634
12637
|
}));
|
|
12635
12638
|
pluginHub.pruneTeams(store.sections);
|
|
12639
|
+
const knowledge = createKnowledgeHost(DATA_DIR, ENVIRONMENT_ID, pluginHub, id => store.bot(id));
|
|
12640
|
+
ROUTES.push(knowledgeRoutes(knowledge, (auth, botId) => {
|
|
12641
|
+
const admin = ownerOrAdmin(auth) && !(auth.kind === "loopback" && auth.companionDevice);
|
|
12642
|
+
if ((!CLOUD_TEAM && !admin) || (CLOUD_PERSONAL && !cloudOwnerSession(auth)) ||
|
|
12643
|
+
(auth.kind === "loopback" && (auth.trust === "service" || auth.companionDevice)))
|
|
12644
|
+
throw new KnowledgeError(403, "Workspace access required.");
|
|
12645
|
+
if (auth.kind === "session" && !sessions.list().some(session => session.id === auth.session.id && session.expiresAt > Date.now()))
|
|
12646
|
+
throw new KnowledgeError(403, "Session expired.");
|
|
12647
|
+
const level = levelOf(auth, botId);
|
|
12648
|
+
if ((!admin && level === "none") || !store.bot(botId))
|
|
12649
|
+
throw new KnowledgeError(404, "Unknown bot.");
|
|
12650
|
+
const ownerId = CLOUD_TEAM && auth.kind === "session" ? personKey(auth.session) : "workspace-owner";
|
|
12651
|
+
const canWrite = admin || level === "edit";
|
|
12652
|
+
return { ownerId, canManage: admin, canWrite, human: true, memoryWrite: canWrite,
|
|
12653
|
+
memoryId: CLOUD_TEAM ? layerId(botId, memberAudience(ownerId)) : botId };
|
|
12654
|
+
}));
|
|
12636
12655
|
async function resolvePluginServer(name, botId) {
|
|
12637
12656
|
if (!Object.hasOwn(cfg.mcpServers ?? {}, name) || teamConnections.personMcp().includes(name))
|
|
12638
12657
|
return null;
|
|
@@ -14303,6 +14322,36 @@ const handleRequest = async (req, res) => {
|
|
|
14303
14322
|
task: store.taskByThread(from.id, threadId)?.title,
|
|
14304
14323
|
});
|
|
14305
14324
|
}
|
|
14325
|
+
if (method === "POST" && path.startsWith("/api/internal/knowledge/")) {
|
|
14326
|
+
const action = path.slice("/api/internal/knowledge/".length);
|
|
14327
|
+
const input = await readInternalBody(256_000);
|
|
14328
|
+
const identify = () => {
|
|
14329
|
+
const bot = store.bot(internalSender.id);
|
|
14330
|
+
const thread = internalCapability.threadId;
|
|
14331
|
+
if (!internalCapabilityIsActive(internalCapability) || !bot || cloudGuestDriven(thread) || botApiThread(thread)
|
|
14332
|
+
|| proactive.fence.confines(thread) || outsideDrivenThread(thread) || !allowsTool(bot.toolScope, { kind: "mcp", server: "agents", name: "knowledge_" + action }, input)
|
|
14333
|
+
|| (CLOUD_PERSONAL && cloudHomeOwnTurnRefusal(cloudLendingTurn(internalCapability)) !== null))
|
|
14334
|
+
throw new KnowledgeError(403, "Knowledge is unavailable in this conversation.");
|
|
14335
|
+
const audience = teamHost.audienceOf(thread);
|
|
14336
|
+
const room = store.groupByThread(thread);
|
|
14337
|
+
const ownerId = CLOUD_TEAM ? audienceMember(audience) ?? "audience-" + createHash("sha256").update(audience).digest("hex") : "workspace-owner";
|
|
14338
|
+
return { ownerId, canManage: false, human: false, canWrite: true,
|
|
14339
|
+
memoryWrite: (!room || roomFeedsBot(room, bot)) && turnOrigin(internalCapability).kind === "user",
|
|
14340
|
+
memoryId: teamHost.layer(bot.id, thread) };
|
|
14341
|
+
};
|
|
14342
|
+
if (action === "archive")
|
|
14343
|
+
return json(res, 403, { error: "Only available in the offline viewer." });
|
|
14344
|
+
if ((internalCapability.pluginReads ?? 0) >= 32)
|
|
14345
|
+
return json(res, 429, { error: "Knowledge tool budget exhausted for this turn." });
|
|
14346
|
+
internalCapability.pluginReads = (internalCapability.pluginReads ?? 0) + 1;
|
|
14347
|
+
try {
|
|
14348
|
+
return json(res, 200, await knowledge.run(internalSender.id, action, input, identify, callSignal));
|
|
14349
|
+
}
|
|
14350
|
+
catch (error) {
|
|
14351
|
+
const failure = knowledgeFailure(error);
|
|
14352
|
+
return json(res, failure.status, failure.body);
|
|
14353
|
+
}
|
|
14354
|
+
}
|
|
14306
14355
|
if (method === "POST" && path === "/api/internal/plugin-read") {
|
|
14307
14356
|
const input = await readInternalBody();
|
|
14308
14357
|
if ((internalCapability.pluginReads ?? 0) >= 32)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
const fixture = mkdtempSync(join(tmpdir(), "limix-knowledge-bench-"));
|
|
5
|
+
process.env.OMB_DATA_DIR = fixture;
|
|
6
|
+
const { KnowledgeVault } = await import("./core.js");
|
|
7
|
+
const vault = new KnowledgeVault(fixture);
|
|
8
|
+
const scope = { workspaceId: "bench", ownerId: "person", botId: "one" };
|
|
9
|
+
const count = 200;
|
|
10
|
+
try {
|
|
11
|
+
const begin = performance.now();
|
|
12
|
+
for (let n = 0; n < count; n++)
|
|
13
|
+
vault.execute(scope, "create", {
|
|
14
|
+
title: "Research " + n, body: "Limix Knowledge Engine\n" + ("Nghiên cứu quy trình giao hàng. ".repeat(40)) + "\nFact for reference" + n,
|
|
15
|
+
});
|
|
16
|
+
const writeMs = performance.now() - begin;
|
|
17
|
+
vault.execute(scope, "search", { query: "reference199" });
|
|
18
|
+
const durations = [];
|
|
19
|
+
let topOne = 0;
|
|
20
|
+
for (let n = 0; n < count; n++) {
|
|
21
|
+
const start = performance.now();
|
|
22
|
+
const results = vault.search(scope, { query: "reference" + n, token_budget: 128 }).results;
|
|
23
|
+
durations.push(performance.now() - start);
|
|
24
|
+
if (results[0]?.title === "Research " + n)
|
|
25
|
+
topOne++;
|
|
26
|
+
}
|
|
27
|
+
durations.sort((a, b) => a - b);
|
|
28
|
+
console.log(JSON.stringify({ node: process.version, platform: process.platform, documents: count, queries: count, top_one_correct: topOne,
|
|
29
|
+
note_bytes: vault.stats(scope).bytes, total_create_ms: Math.round(writeMs), bm25_p50_ms: +durations[Math.floor(count * 0.5)].toFixed(2),
|
|
30
|
+
bm25_p95_ms: +durations[Math.floor(count * 0.95)].toFixed(2), workload: "Warm FTS5, exact unique reference per note" }));
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
vault.close();
|
|
34
|
+
rmSync(fixture, { recursive: true, force: true });
|
|
35
|
+
}
|