openbot 0.2.3 → 0.2.6
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 +1 -1
- package/dist/agents/agent-creator.js +58 -19
- package/dist/agents/os-agent.js +1 -4
- package/dist/agents/planner-agent.js +32 -0
- package/dist/agents/topic-agent.js +1 -1
- package/dist/architecture/contracts.js +1 -0
- package/dist/architecture/execution-engine.js +151 -0
- package/dist/architecture/intent-classifier.js +26 -0
- package/dist/architecture/planner.js +106 -0
- package/dist/automation-worker.js +121 -0
- package/dist/automations.js +52 -0
- package/dist/cli.js +116 -146
- package/dist/config.js +20 -0
- package/dist/core/agents.js +41 -0
- package/dist/core/delegation.js +124 -0
- package/dist/core/manager.js +73 -0
- package/dist/core/plugins.js +77 -0
- package/dist/core/router.js +40 -0
- package/dist/installers.js +156 -0
- package/dist/marketplace.js +80 -0
- package/dist/open-bot.js +34 -157
- package/dist/orchestrator.js +247 -51
- package/dist/plugins/approval/index.js +107 -3
- package/dist/plugins/brain/index.js +17 -86
- package/dist/plugins/brain/memory.js +1 -1
- package/dist/plugins/brain/prompt.js +8 -13
- package/dist/plugins/brain/types.js +0 -15
- package/dist/plugins/file-system/index.js +8 -8
- package/dist/plugins/llm/context-shaping.js +177 -0
- package/dist/plugins/llm/index.js +223 -49
- package/dist/plugins/memory/index.js +220 -0
- package/dist/plugins/memory/memory.js +122 -0
- package/dist/plugins/memory/prompt.js +55 -0
- package/dist/plugins/memory/types.js +45 -0
- package/dist/plugins/shell/index.js +3 -3
- package/dist/plugins/skills/index.js +9 -9
- package/dist/registry/index.js +1 -4
- package/dist/registry/plugin-loader.js +361 -56
- package/dist/registry/plugin-registry.js +21 -4
- package/dist/registry/ts-agent-loader.js +4 -4
- package/dist/registry/yaml-agent-loader.js +78 -20
- package/dist/runtime/execution-trace.js +41 -0
- package/dist/runtime/intent-routing.js +26 -0
- package/dist/runtime/openbot-runtime.js +354 -0
- package/dist/server.js +513 -41
- package/dist/ui/widgets/approval-card.js +22 -2
- package/dist/ui/widgets/delegation.js +29 -0
- package/dist/version.js +62 -0
- package/package.json +4 -1
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import { ui } from '@melony/ui-kit/server';
|
|
2
|
-
export const approvalCard = (title,
|
|
2
|
+
export const approvalCard = (title, data, approveAction, denyAction) => ui.box({ border: true, radius: 'md', padding: 'md' }, [
|
|
3
3
|
ui.col({ gap: 'sm' }, [
|
|
4
4
|
ui.heading(title, { level: 4 }),
|
|
5
|
-
ui.text(
|
|
5
|
+
ui.text(data.summary, { size: 'sm', color: 'muted' }),
|
|
6
|
+
...(data.details?.length
|
|
7
|
+
? [
|
|
8
|
+
ui.box({ border: true, radius: 'sm', padding: 'sm' }, [
|
|
9
|
+
ui.col({ gap: 'xs' }, data.details.map((detail) => ui.row({ gap: 'sm', align: 'start' }, [
|
|
10
|
+
ui.text(`${detail.label}:`, { size: 'xs', color: 'muted', weight: 'semibold' }),
|
|
11
|
+
ui.text(detail.value, { size: 'xs' }),
|
|
12
|
+
]))),
|
|
13
|
+
]),
|
|
14
|
+
]
|
|
15
|
+
: []),
|
|
16
|
+
...(data.rawPayload
|
|
17
|
+
? [
|
|
18
|
+
ui.box({ border: true, radius: 'sm', padding: 'sm' }, [
|
|
19
|
+
ui.col({ gap: 'xs' }, [
|
|
20
|
+
ui.text('Full action payload', { size: 'xs', color: 'muted', weight: 'semibold' }),
|
|
21
|
+
ui.text(data.rawPayload, { size: 'xs' }),
|
|
22
|
+
]),
|
|
23
|
+
]),
|
|
24
|
+
]
|
|
25
|
+
: []),
|
|
6
26
|
ui.row({ gap: 'sm', justify: 'end' }, [
|
|
7
27
|
ui.button({ variant: 'outline', onClickAction: denyAction }, [
|
|
8
28
|
ui.text('Deny', { size: 'xs' })
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ui } from "@melony/ui-kit/server";
|
|
2
|
+
function stateLabel(state) {
|
|
3
|
+
if (state === "running")
|
|
4
|
+
return "Running";
|
|
5
|
+
if (state === "completed")
|
|
6
|
+
return "Completed";
|
|
7
|
+
return "Failed";
|
|
8
|
+
}
|
|
9
|
+
export const delegationWidget = (agentName, state, task, details) => {
|
|
10
|
+
const taskPreview = (task || "").trim();
|
|
11
|
+
const clippedTask = taskPreview.length > 240
|
|
12
|
+
? `${taskPreview.slice(0, 237)}...`
|
|
13
|
+
: taskPreview;
|
|
14
|
+
const detailsPreview = (details || "").trim();
|
|
15
|
+
const clippedDetails = detailsPreview.length > 400
|
|
16
|
+
? `${detailsPreview.slice(0, 397)}...`
|
|
17
|
+
: detailsPreview;
|
|
18
|
+
return ui.box({ border: true, radius: "md", padding: "md" }, [
|
|
19
|
+
ui.col({ gap: "sm" }, [
|
|
20
|
+
ui.heading(`Sub-agent: ${agentName}`, { level: 4 }),
|
|
21
|
+
ui.text(`State: ${stateLabel(state)}`, {
|
|
22
|
+
size: "xs",
|
|
23
|
+
color: state === "failed" ? "danger" : state === "completed" ? "success" : "muted",
|
|
24
|
+
}),
|
|
25
|
+
...(clippedTask ? [ui.text(`Task: ${clippedTask}`, { size: "sm", color: "muted" })] : []),
|
|
26
|
+
...(clippedDetails ? [ui.text(clippedDetails, { size: "sm" })] : []),
|
|
27
|
+
]),
|
|
28
|
+
]);
|
|
29
|
+
};
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
/**
|
|
5
|
+
* Gets the version of the currently running OpenBot instance.
|
|
6
|
+
* Works regardless of where the command is executed from.
|
|
7
|
+
*/
|
|
8
|
+
export function getCurrentVersion() {
|
|
9
|
+
try {
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = dirname(__filename);
|
|
12
|
+
// Look for package.json by walking up from the current directory
|
|
13
|
+
let currentDir = __dirname;
|
|
14
|
+
for (let i = 0; i < 4; i++) {
|
|
15
|
+
const pkgPath = join(currentDir, "package.json");
|
|
16
|
+
try {
|
|
17
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
18
|
+
if (pkg.name === "openbot") {
|
|
19
|
+
return pkg.version;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// Continue walking up
|
|
24
|
+
}
|
|
25
|
+
currentDir = dirname(currentDir);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
console.warn("Could not determine OpenBot version:", err);
|
|
30
|
+
}
|
|
31
|
+
// Fallback to a hardcoded version if detection fails
|
|
32
|
+
return "0.2.3";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Fetches the latest version from NPM registry and checks for updates.
|
|
36
|
+
*/
|
|
37
|
+
export async function getVersionStatus() {
|
|
38
|
+
const current = getCurrentVersion();
|
|
39
|
+
try {
|
|
40
|
+
const response = await fetch("https://registry.npmjs.org/openbot/latest", {
|
|
41
|
+
signal: AbortSignal.timeout(5000), // 5s timeout
|
|
42
|
+
});
|
|
43
|
+
if (!response.ok) {
|
|
44
|
+
throw new Error(`NPM registry returned ${response.status}`);
|
|
45
|
+
}
|
|
46
|
+
const data = await response.json();
|
|
47
|
+
const latest = data.version;
|
|
48
|
+
return {
|
|
49
|
+
current,
|
|
50
|
+
latest,
|
|
51
|
+
updateAvailable: current !== latest,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error("Failed to check for updates:", error);
|
|
56
|
+
return {
|
|
57
|
+
current,
|
|
58
|
+
latest: current,
|
|
59
|
+
updateAvailable: false,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|