verybot 0.1.8
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/README.md +167 -0
- package/dist/aliases/store.d.ts +21 -0
- package/dist/aliases/store.js +148 -0
- package/dist/aliases/types.d.ts +6 -0
- package/dist/aliases/types.js +1 -0
- package/dist/brain/agent-registry.d.ts +96 -0
- package/dist/brain/agent-registry.js +141 -0
- package/dist/brain/agent.d.ts +167 -0
- package/dist/brain/agent.js +932 -0
- package/dist/brain/channel-store.d.ts +27 -0
- package/dist/brain/channel-store.js +78 -0
- package/dist/brain/compaction.d.ts +37 -0
- package/dist/brain/compaction.js +214 -0
- package/dist/brain/context.d.ts +43 -0
- package/dist/brain/context.js +139 -0
- package/dist/brain/delegation-store.d.ts +33 -0
- package/dist/brain/delegation-store.js +106 -0
- package/dist/brain/loop.d.ts +24 -0
- package/dist/brain/loop.js +318 -0
- package/dist/brain/mcp-adapter.d.ts +43 -0
- package/dist/brain/mcp-adapter.js +244 -0
- package/dist/brain/memory-extractor.d.ts +26 -0
- package/dist/brain/memory-extractor.js +82 -0
- package/dist/brain/providers.d.ts +14 -0
- package/dist/brain/providers.js +85 -0
- package/dist/brain/queue.d.ts +18 -0
- package/dist/brain/queue.js +111 -0
- package/dist/brain/run-tools.d.ts +50 -0
- package/dist/brain/run-tools.js +136 -0
- package/dist/brain/session-key.d.ts +23 -0
- package/dist/brain/session-key.js +41 -0
- package/dist/brain/session-state.d.ts +36 -0
- package/dist/brain/session-state.js +51 -0
- package/dist/brain/session-store.d.ts +50 -0
- package/dist/brain/session-store.js +207 -0
- package/dist/brain/session.d.ts +32 -0
- package/dist/brain/session.js +75 -0
- package/dist/brain/task-subscriber.d.ts +56 -0
- package/dist/brain/task-subscriber.js +317 -0
- package/dist/brain/user-content.d.ts +16 -0
- package/dist/brain/user-content.js +32 -0
- package/dist/brain/utils.d.ts +4 -0
- package/dist/brain/utils.js +26 -0
- package/dist/brain/worker-coordinator.d.ts +25 -0
- package/dist/brain/worker-coordinator.js +83 -0
- package/dist/channels/commands.d.ts +50 -0
- package/dist/channels/commands.js +132 -0
- package/dist/channels/discord/channel.d.ts +29 -0
- package/dist/channels/discord/channel.js +159 -0
- package/dist/channels/discord/markdown.d.ts +19 -0
- package/dist/channels/discord/markdown.js +62 -0
- package/dist/channels/manager.d.ts +29 -0
- package/dist/channels/manager.js +100 -0
- package/dist/channels/slack/channel.d.ts +37 -0
- package/dist/channels/slack/channel.js +227 -0
- package/dist/channels/slack/markdown.d.ts +19 -0
- package/dist/channels/slack/markdown.js +62 -0
- package/dist/channels/specs.d.ts +32 -0
- package/dist/channels/specs.js +99 -0
- package/dist/channels/telegram/channel.d.ts +29 -0
- package/dist/channels/telegram/channel.js +182 -0
- package/dist/channels/telegram/markdown.d.ts +17 -0
- package/dist/channels/telegram/markdown.js +66 -0
- package/dist/channels/types.d.ts +26 -0
- package/dist/channels/types.js +1 -0
- package/dist/channels/whatsapp/channel.d.ts +34 -0
- package/dist/channels/whatsapp/channel.js +276 -0
- package/dist/channels/whatsapp/markdown.d.ts +20 -0
- package/dist/channels/whatsapp/markdown.js +51 -0
- package/dist/cli/claude-login.d.ts +5 -0
- package/dist/cli/claude-login.js +47 -0
- package/dist/cli/config.d.ts +5 -0
- package/dist/cli/config.js +78 -0
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.js +96 -0
- package/dist/computer/browser/actions.d.ts +31 -0
- package/dist/computer/browser/actions.js +148 -0
- package/dist/computer/browser/context-manager.d.ts +28 -0
- package/dist/computer/browser/context-manager.js +78 -0
- package/dist/computer/browser/manager.d.ts +91 -0
- package/dist/computer/browser/manager.js +344 -0
- package/dist/computer/browser/profile-badge.d.ts +13 -0
- package/dist/computer/browser/profile-badge.js +67 -0
- package/dist/computer/browser/screenshot.d.ts +5 -0
- package/dist/computer/browser/screenshot.js +21 -0
- package/dist/computer/browser/snapshot.d.ts +30 -0
- package/dist/computer/browser/snapshot.js +242 -0
- package/dist/computer/browser/tools.d.ts +5 -0
- package/dist/computer/browser/tools.js +167 -0
- package/dist/computer/browser/types.d.ts +26 -0
- package/dist/computer/browser/types.js +1 -0
- package/dist/computer/desktop/adapter.d.ts +25 -0
- package/dist/computer/desktop/adapter.js +11 -0
- package/dist/computer/desktop/macos.d.ts +24 -0
- package/dist/computer/desktop/macos.js +223 -0
- package/dist/computer/desktop/tools.d.ts +25 -0
- package/dist/computer/desktop/tools.js +114 -0
- package/dist/config/agent-config.d.ts +55 -0
- package/dist/config/agent-config.js +16 -0
- package/dist/config/model-catalog.d.ts +22 -0
- package/dist/config/model-catalog.js +112 -0
- package/dist/config/model-spec.d.ts +8 -0
- package/dist/config/model-spec.js +66 -0
- package/dist/config/store.d.ts +25 -0
- package/dist/config/store.js +143 -0
- package/dist/config.d.ts +110 -0
- package/dist/config.js +259 -0
- package/dist/control-ui/assets/index-Cbl7G5Sc.css +1 -0
- package/dist/control-ui/assets/index-Cu1P4C62.js +266 -0
- package/dist/control-ui/assets/noto-sans-cyrillic-ext-wght-normal-DSNfmdVt.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-cyrillic-wght-normal-B2hlT84T.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-devanagari-wght-normal-Cv-Vwajv.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-greek-ext-wght-normal-12T8GTDR.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-greek-wght-normal-Ymb6dZNd.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-latin-ext-wght-normal-W1qJv59z.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-latin-wght-normal-BYSzYMf3.woff2 +0 -0
- package/dist/control-ui/assets/noto-sans-vietnamese-wght-normal-DLTJy58D.woff2 +0 -0
- package/dist/control-ui/index.html +14 -0
- package/dist/control-ui/vite.svg +1 -0
- package/dist/events.d.ts +2 -0
- package/dist/events.js +11 -0
- package/dist/gateway/broadcast.d.ts +5 -0
- package/dist/gateway/broadcast.js +33 -0
- package/dist/gateway/methods/aliases.d.ts +17 -0
- package/dist/gateway/methods/aliases.js +22 -0
- package/dist/gateway/methods/chat.d.ts +33 -0
- package/dist/gateway/methods/chat.js +37 -0
- package/dist/gateway/methods/config.d.ts +14 -0
- package/dist/gateway/methods/config.js +24 -0
- package/dist/gateway/methods/models.d.ts +10 -0
- package/dist/gateway/methods/models.js +14 -0
- package/dist/gateway/methods/playbooks.d.ts +45 -0
- package/dist/gateway/methods/playbooks.js +488 -0
- package/dist/gateway/methods/prompt-templates.d.ts +27 -0
- package/dist/gateway/methods/prompt-templates.js +106 -0
- package/dist/gateway/methods/scheduler.d.ts +62 -0
- package/dist/gateway/methods/scheduler.js +129 -0
- package/dist/gateway/methods/sessions.d.ts +44 -0
- package/dist/gateway/methods/sessions.js +111 -0
- package/dist/gateway/methods/system.d.ts +12 -0
- package/dist/gateway/methods/system.js +39 -0
- package/dist/gateway/methods/tasks.d.ts +40 -0
- package/dist/gateway/methods/tasks.js +151 -0
- package/dist/gateway/methods/teams.d.ts +69 -0
- package/dist/gateway/methods/teams.js +376 -0
- package/dist/gateway/methods/tools.d.ts +6 -0
- package/dist/gateway/methods/tools.js +7 -0
- package/dist/gateway/methods/whatsapp.d.ts +19 -0
- package/dist/gateway/methods/whatsapp.js +35 -0
- package/dist/gateway/rpc.d.ts +38 -0
- package/dist/gateway/rpc.js +79 -0
- package/dist/gateway/server.d.ts +9 -0
- package/dist/gateway/server.js +137 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +254 -0
- package/dist/integrations/github.d.ts +7 -0
- package/dist/integrations/github.js +133 -0
- package/dist/integrations/mcp.d.ts +7 -0
- package/dist/integrations/mcp.js +106 -0
- package/dist/integrations/registry.d.ts +47 -0
- package/dist/integrations/registry.js +332 -0
- package/dist/integrations/scanner.d.ts +10 -0
- package/dist/integrations/scanner.js +122 -0
- package/dist/integrations/twitter.d.ts +10 -0
- package/dist/integrations/twitter.js +120 -0
- package/dist/integrations/types.d.ts +72 -0
- package/dist/integrations/types.js +1 -0
- package/dist/logger.d.ts +16 -0
- package/dist/logger.js +104 -0
- package/dist/markdown/chunk.d.ts +9 -0
- package/dist/markdown/chunk.js +52 -0
- package/dist/markdown/ir.d.ts +37 -0
- package/dist/markdown/ir.js +529 -0
- package/dist/markdown/render.d.ts +22 -0
- package/dist/markdown/render.js +148 -0
- package/dist/markdown/table-render.d.ts +43 -0
- package/dist/markdown/table-render.js +219 -0
- package/dist/markdown/tables.d.ts +17 -0
- package/dist/markdown/tables.js +27 -0
- package/dist/memory/embedding.d.ts +16 -0
- package/dist/memory/embedding.js +66 -0
- package/dist/memory/explicit.d.ts +16 -0
- package/dist/memory/explicit.js +29 -0
- package/dist/memory/extractor.d.ts +13 -0
- package/dist/memory/extractor.js +82 -0
- package/dist/memory/search.d.ts +15 -0
- package/dist/memory/search.js +57 -0
- package/dist/memory/session-learning.d.ts +23 -0
- package/dist/memory/session-learning.js +55 -0
- package/dist/memory/store.d.ts +36 -0
- package/dist/memory/store.js +334 -0
- package/dist/memory/types.d.ts +9 -0
- package/dist/memory/types.js +2 -0
- package/dist/paths.d.ts +28 -0
- package/dist/paths.js +48 -0
- package/dist/prompt-templates/builtins/index.d.ts +4 -0
- package/dist/prompt-templates/builtins/index.js +5 -0
- package/dist/prompt-templates/builtins/planner.d.ts +4 -0
- package/dist/prompt-templates/builtins/planner.js +77 -0
- package/dist/prompt-templates/store.d.ts +45 -0
- package/dist/prompt-templates/store.js +224 -0
- package/dist/prompt-templates/types.d.ts +10 -0
- package/dist/prompt-templates/types.js +1 -0
- package/dist/scheduler/connected-channels.d.ts +24 -0
- package/dist/scheduler/connected-channels.js +57 -0
- package/dist/scheduler/scheduler.d.ts +22 -0
- package/dist/scheduler/scheduler.js +132 -0
- package/dist/scheduler/store.d.ts +27 -0
- package/dist/scheduler/store.js +205 -0
- package/dist/scheduler/types.d.ts +29 -0
- package/dist/scheduler/types.js +1 -0
- package/dist/security/command-validator.d.ts +22 -0
- package/dist/security/command-validator.js +160 -0
- package/dist/security/docker-sandbox.d.ts +48 -0
- package/dist/security/docker-sandbox.js +218 -0
- package/dist/security/env-filter.d.ts +8 -0
- package/dist/security/env-filter.js +41 -0
- package/dist/skills/loader.d.ts +33 -0
- package/dist/skills/loader.js +132 -0
- package/dist/skills/prompt.d.ts +6 -0
- package/dist/skills/prompt.js +17 -0
- package/dist/skills/read-tool.d.ts +7 -0
- package/dist/skills/read-tool.js +24 -0
- package/dist/skills/scanner.d.ts +6 -0
- package/dist/skills/scanner.js +73 -0
- package/dist/skills/types.d.ts +15 -0
- package/dist/skills/types.js +1 -0
- package/dist/tasks/inline-attachment-content.d.ts +9 -0
- package/dist/tasks/inline-attachment-content.js +64 -0
- package/dist/tasks/store.d.ts +112 -0
- package/dist/tasks/store.js +519 -0
- package/dist/tasks/types.d.ts +129 -0
- package/dist/tasks/types.js +80 -0
- package/dist/teams/status-config.d.ts +8 -0
- package/dist/teams/status-config.js +40 -0
- package/dist/teams/store.d.ts +111 -0
- package/dist/teams/store.js +671 -0
- package/dist/teams/types.d.ts +30 -0
- package/dist/teams/types.js +1 -0
- package/dist/tools/bash.d.ts +18 -0
- package/dist/tools/bash.js +64 -0
- package/dist/tools/channel-history.d.ts +10 -0
- package/dist/tools/channel-history.js +43 -0
- package/dist/tools/delegate.d.ts +20 -0
- package/dist/tools/delegate.js +299 -0
- package/dist/tools/fs.d.ts +4 -0
- package/dist/tools/fs.js +335 -0
- package/dist/tools/integration-toggle.d.ts +14 -0
- package/dist/tools/integration-toggle.js +47 -0
- package/dist/tools/memory.d.ts +13 -0
- package/dist/tools/memory.js +59 -0
- package/dist/tools/prompt-templates.d.ts +7 -0
- package/dist/tools/prompt-templates.js +133 -0
- package/dist/tools/registry.d.ts +6 -0
- package/dist/tools/registry.js +9 -0
- package/dist/tools/schedule.d.ts +8 -0
- package/dist/tools/schedule.js +219 -0
- package/dist/tools/speak.d.ts +10 -0
- package/dist/tools/speak.js +56 -0
- package/dist/tools/tasks.d.ts +67 -0
- package/dist/tools/tasks.js +288 -0
- package/dist/tools/teams.d.ts +22 -0
- package/dist/tools/teams.js +470 -0
- package/dist/tools/web-fetch.d.ts +3 -0
- package/dist/tools/web-fetch.js +22 -0
- package/dist/tts/edge.d.ts +10 -0
- package/dist/tts/edge.js +60 -0
- package/dist/tts/speak.d.ts +12 -0
- package/dist/tts/speak.js +81 -0
- package/dist/tts/transcribe.d.ts +5 -0
- package/dist/tts/transcribe.js +40 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +22 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +13 -0
- package/package.json +102 -0
- package/verybot.js +2 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>ui</title>
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Cu1P4C62.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cbl7G5Sc.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/dist/events.d.ts
ADDED
package/dist/events.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
/** App-wide event bus. Business logic emits here; transport layers subscribe. */
|
|
3
|
+
const bus = new EventEmitter();
|
|
4
|
+
bus.setMaxListeners(50);
|
|
5
|
+
export function emit(event, payload) {
|
|
6
|
+
bus.emit(event, payload);
|
|
7
|
+
}
|
|
8
|
+
export function on(event, handler) {
|
|
9
|
+
bus.on(event, handler);
|
|
10
|
+
return () => { bus.off(event, handler); };
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WebSocket } from "ws";
|
|
2
|
+
export declare function addClient(ws: WebSocket): void;
|
|
3
|
+
/** Register a cleanup callback that fires when a specific WS disconnects. */
|
|
4
|
+
export declare function onClientClose(ws: WebSocket, fn: () => void): void;
|
|
5
|
+
export declare function broadcast(event: string, payload: unknown, excludeWs?: WebSocket): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const clients = new Set();
|
|
2
|
+
const cleanups = new Map();
|
|
3
|
+
export function addClient(ws) {
|
|
4
|
+
clients.add(ws);
|
|
5
|
+
ws.on("close", () => {
|
|
6
|
+
clients.delete(ws);
|
|
7
|
+
const fns = cleanups.get(ws);
|
|
8
|
+
if (fns) {
|
|
9
|
+
for (const fn of fns)
|
|
10
|
+
fn();
|
|
11
|
+
cleanups.delete(ws);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/** Register a cleanup callback that fires when a specific WS disconnects. */
|
|
16
|
+
export function onClientClose(ws, fn) {
|
|
17
|
+
let set = cleanups.get(ws);
|
|
18
|
+
if (!set) {
|
|
19
|
+
set = new Set();
|
|
20
|
+
cleanups.set(ws, set);
|
|
21
|
+
}
|
|
22
|
+
set.add(fn);
|
|
23
|
+
}
|
|
24
|
+
export function broadcast(event, payload, excludeWs) {
|
|
25
|
+
const msg = JSON.stringify({ type: "event", event, payload });
|
|
26
|
+
for (const ws of clients) {
|
|
27
|
+
if (ws === excludeWs)
|
|
28
|
+
continue;
|
|
29
|
+
if (ws.readyState === ws.OPEN) {
|
|
30
|
+
ws.send(msg);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CommandAliasStore } from "../../aliases/store.js";
|
|
2
|
+
export declare function aliasMethods(store: CommandAliasStore): {
|
|
3
|
+
"aliases.list": () => Promise<{
|
|
4
|
+
aliases: import("../../aliases/types.js").CommandAlias[];
|
|
5
|
+
}>;
|
|
6
|
+
"aliases.upsert": (params: {
|
|
7
|
+
alias: string;
|
|
8
|
+
expansion: string;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
alias: import("../../aliases/types.js").CommandAlias;
|
|
11
|
+
}>;
|
|
12
|
+
"aliases.delete": (params: {
|
|
13
|
+
alias: string;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
deleted: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function aliasMethods(store) {
|
|
2
|
+
return {
|
|
3
|
+
"aliases.list": async () => {
|
|
4
|
+
return { aliases: store.list() };
|
|
5
|
+
},
|
|
6
|
+
"aliases.upsert": async (params) => {
|
|
7
|
+
if (!params || typeof params.alias !== "string") {
|
|
8
|
+
throw new Error("alias is required and must be a string");
|
|
9
|
+
}
|
|
10
|
+
if (typeof params.expansion !== "string") {
|
|
11
|
+
throw new Error("expansion is required and must be a string");
|
|
12
|
+
}
|
|
13
|
+
return { alias: store.upsert(params.alias, params.expansion) };
|
|
14
|
+
},
|
|
15
|
+
"aliases.delete": async (params) => {
|
|
16
|
+
if (!params || typeof params.alias !== "string") {
|
|
17
|
+
throw new Error("alias is required and must be a string");
|
|
18
|
+
}
|
|
19
|
+
return { deleted: store.delete(params.alias) };
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Agent } from "../../brain/agent.js";
|
|
2
|
+
export declare function chatMethods(getAgent: () => Agent): {
|
|
3
|
+
"chat.send": (params: {
|
|
4
|
+
sessionKey: string;
|
|
5
|
+
message: string;
|
|
6
|
+
agentId?: string;
|
|
7
|
+
images?: string[];
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
status: string;
|
|
10
|
+
reply: string;
|
|
11
|
+
}>;
|
|
12
|
+
"chat.history": (params: {
|
|
13
|
+
sessionKey: string;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
messages: import("ai").ModelMessage[];
|
|
16
|
+
}>;
|
|
17
|
+
"chat.abort": (params: {
|
|
18
|
+
sessionKey: string;
|
|
19
|
+
}) => Promise<{
|
|
20
|
+
status: string;
|
|
21
|
+
}>;
|
|
22
|
+
"chat.learn": (params: {
|
|
23
|
+
sessionKey: string;
|
|
24
|
+
topic?: string;
|
|
25
|
+
}) => Promise<import("../../memory/session-learning.js").LearnSessionMemoriesResult>;
|
|
26
|
+
"chat.remember": (params: {
|
|
27
|
+
sessionKey: string;
|
|
28
|
+
fact: string;
|
|
29
|
+
}) => Promise<import("../../memory/explicit.js").SaveExplicitMemoryResult>;
|
|
30
|
+
"chat.teams": () => Promise<{
|
|
31
|
+
teams: import("../../brain/agent-registry.js").TeamInfo[];
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function chatMethods(getAgent) {
|
|
2
|
+
return {
|
|
3
|
+
"chat.send": async (params) => {
|
|
4
|
+
const reply = await getAgent().handleGatewayMessage(params.sessionKey, params.message, params.agentId, params.images);
|
|
5
|
+
return { status: "ok", reply };
|
|
6
|
+
},
|
|
7
|
+
"chat.history": async (params) => {
|
|
8
|
+
const session = getAgent().getSession(params.sessionKey);
|
|
9
|
+
return { messages: session?.getMessages() ?? [] };
|
|
10
|
+
},
|
|
11
|
+
"chat.abort": async (params) => {
|
|
12
|
+
const aborted = getAgent().abortSession(params.sessionKey);
|
|
13
|
+
return { status: aborted ? "ok" : "no_active_run" };
|
|
14
|
+
},
|
|
15
|
+
"chat.learn": async (params) => {
|
|
16
|
+
if (!params?.sessionKey || typeof params.sessionKey !== "string") {
|
|
17
|
+
throw new Error("sessionKey is required and must be a string");
|
|
18
|
+
}
|
|
19
|
+
if (params?.topic !== undefined && typeof params.topic !== "string") {
|
|
20
|
+
throw new Error("topic must be a string");
|
|
21
|
+
}
|
|
22
|
+
return getAgent().learnMemory(params.sessionKey, params.topic);
|
|
23
|
+
},
|
|
24
|
+
"chat.remember": async (params) => {
|
|
25
|
+
if (!params?.sessionKey || typeof params.sessionKey !== "string") {
|
|
26
|
+
throw new Error("sessionKey is required and must be a string");
|
|
27
|
+
}
|
|
28
|
+
if (!params?.fact || typeof params.fact !== "string") {
|
|
29
|
+
throw new Error("fact is required and must be a string");
|
|
30
|
+
}
|
|
31
|
+
return getAgent().rememberMemory(params.sessionKey, params.fact);
|
|
32
|
+
},
|
|
33
|
+
"chat.teams": async () => {
|
|
34
|
+
return { teams: getAgent().getTeams() };
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConfigStore } from "../../config/store.js";
|
|
2
|
+
import type { Agent } from "../../brain/agent.js";
|
|
3
|
+
export declare function configMethods(store: ConfigStore, getAgent: () => Agent): {
|
|
4
|
+
/** Return full config with secret values redacted. Teams live in TeamStore now. */
|
|
5
|
+
"config.get": () => Promise<{
|
|
6
|
+
config: import("../../config/store.js").ConfigData;
|
|
7
|
+
}>;
|
|
8
|
+
/** Merge partial update into config. Restores redacted secrets before saving. */
|
|
9
|
+
"config.patch": (params: {
|
|
10
|
+
patch: Record<string, unknown>;
|
|
11
|
+
}) => Promise<{
|
|
12
|
+
config: import("../../config/store.js").ConfigData;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { emit } from "../../events.js";
|
|
2
|
+
import { DEFAULT_TEAM_ID } from "../../config/agent-config.js";
|
|
3
|
+
/** Keys whose change affects the default team shown in the chat picker. */
|
|
4
|
+
const DEFAULT_TEAM_KEYS = new Set(["model", "identity"]);
|
|
5
|
+
export function configMethods(store, getAgent) {
|
|
6
|
+
return {
|
|
7
|
+
/** Return full config with secret values redacted. Teams live in TeamStore now. */
|
|
8
|
+
"config.get": async () => {
|
|
9
|
+
const config = store.getRedacted();
|
|
10
|
+
return { config };
|
|
11
|
+
},
|
|
12
|
+
/** Merge partial update into config. Restores redacted secrets before saving. */
|
|
13
|
+
"config.patch": async (params) => {
|
|
14
|
+
const touchesDefault = Object.keys(params.patch).some((k) => DEFAULT_TEAM_KEYS.has(k));
|
|
15
|
+
store.patchFromUI(params.patch);
|
|
16
|
+
if (touchesDefault) {
|
|
17
|
+
// Force agent to reload so getTeams() returns the new modelId
|
|
18
|
+
await getAgent().forceConfigReload();
|
|
19
|
+
emit("teamChange", { action: "updated", teamId: DEFAULT_TEAM_ID });
|
|
20
|
+
}
|
|
21
|
+
return { config: store.getRedacted() };
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MODEL_CATALOG } from "../../config/model-catalog.js";
|
|
2
|
+
/** Derive the UI picker list from the single catalog. */
|
|
3
|
+
const DEFAULT_MODELS = MODEL_CATALOG.map((m) => ({
|
|
4
|
+
value: `${m.provider}:${m.modelId}`,
|
|
5
|
+
group: m.group,
|
|
6
|
+
contextWindow: m.contextWindow,
|
|
7
|
+
}));
|
|
8
|
+
export function modelMethods() {
|
|
9
|
+
return {
|
|
10
|
+
"models.list": async () => {
|
|
11
|
+
return { models: DEFAULT_MODELS };
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
interface PlaybookScriptCodeFile {
|
|
2
|
+
path: string;
|
|
3
|
+
content: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function playbookMethods(): {
|
|
6
|
+
"playbooks.list": () => Promise<{
|
|
7
|
+
playbooks: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
triggers: string[];
|
|
11
|
+
tags: string[];
|
|
12
|
+
inIndex: boolean;
|
|
13
|
+
onDisk: boolean;
|
|
14
|
+
readmeExists: boolean;
|
|
15
|
+
scriptCount: number;
|
|
16
|
+
}[];
|
|
17
|
+
}>;
|
|
18
|
+
"playbooks.get": (params: unknown) => Promise<{
|
|
19
|
+
playbook: {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
triggers: string[];
|
|
23
|
+
tags: string[];
|
|
24
|
+
inIndex: boolean;
|
|
25
|
+
onDisk: boolean;
|
|
26
|
+
readmeExists: boolean;
|
|
27
|
+
readme: string;
|
|
28
|
+
scriptFiles: string[];
|
|
29
|
+
scriptCodeFiles: PlaybookScriptCodeFile[];
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
"playbooks.create": (params: unknown) => Promise<{
|
|
33
|
+
status: string;
|
|
34
|
+
}>;
|
|
35
|
+
"playbooks.update": (params: unknown) => Promise<{
|
|
36
|
+
status: string;
|
|
37
|
+
}>;
|
|
38
|
+
"playbooks.rename": (params: unknown) => Promise<{
|
|
39
|
+
status: string;
|
|
40
|
+
}>;
|
|
41
|
+
"playbooks.delete": (params: unknown) => Promise<{
|
|
42
|
+
status: string;
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
export {};
|