openbot 0.2.14 → 0.3.1
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/agents/openbot/index.js +76 -0
- package/dist/agents/openbot/middleware/approval.js +132 -0
- package/dist/agents/openbot/runtime.js +289 -0
- package/dist/agents/openbot/system-prompt.js +32 -0
- package/dist/agents/openbot/tools/delegation.js +78 -0
- package/dist/agents/openbot/tools/mcp.js +99 -0
- package/dist/agents/openbot/tools/shell.js +91 -0
- package/dist/agents/openbot/tools/storage.js +75 -0
- package/dist/agents/openbot/tools/ui.js +176 -0
- package/dist/agents/system.js +20 -93
- package/dist/app/cli.js +1 -1
- package/dist/app/config.js +4 -1
- package/dist/app/server.js +15 -8
- package/dist/bus/agent-package.js +1 -0
- package/dist/bus/plugin.js +1 -0
- package/dist/bus/services.js +711 -0
- package/dist/bus/types.js +1 -0
- package/dist/harness/context.js +250 -0
- package/dist/harness/event-normalizer.js +59 -0
- package/dist/harness/orchestrator.js +27 -227
- package/dist/harness/process.js +25 -3
- package/dist/harness/queue-processor.js +227 -0
- package/dist/harness/runtime-factory.js +103 -0
- package/dist/plugins/ai-sdk/index.js +37 -0
- package/dist/plugins/ai-sdk/runtime.js +402 -0
- package/dist/plugins/ai-sdk/system-prompt.js +3 -0
- package/dist/plugins/ai-sdk.js +277 -87
- package/dist/plugins/approval/index.js +159 -0
- package/dist/plugins/approval.js +163 -0
- package/dist/plugins/delegation/index.js +79 -0
- package/dist/plugins/delegation.js +67 -11
- package/dist/plugins/mcp/index.js +108 -0
- package/dist/plugins/memory/index.js +71 -0
- package/dist/plugins/shell/index.js +99 -0
- package/dist/plugins/shell.js +123 -0
- package/dist/plugins/storage-tools/index.js +85 -0
- package/dist/plugins/storage.js +240 -5
- package/dist/plugins/ui/index.js +184 -0
- package/dist/plugins/ui.js +185 -21
- package/dist/registry/agents.js +138 -0
- package/dist/registry/plugins.js +93 -50
- package/dist/services/agent-packages.js +103 -0
- package/dist/services/memory.js +152 -0
- package/dist/services/plugins.js +98 -0
- package/dist/services/storage.js +366 -94
- package/docs/agents.md +52 -65
- package/docs/architecture.md +1 -1
- package/docs/plugins.md +70 -58
- package/docs/templates/AGENT.example.md +57 -0
- package/package.json +8 -7
- package/src/app/cli.ts +1 -1
- package/src/app/config.ts +14 -4
- package/src/app/server.ts +23 -10
- package/src/app/types.ts +445 -16
- package/src/assets/icon.svg +4 -1
- package/src/bus/plugin.ts +67 -0
- package/src/bus/services.ts +786 -0
- package/src/bus/types.ts +160 -0
- package/src/harness/context.ts +293 -0
- package/src/harness/event-normalizer.ts +82 -0
- package/src/harness/orchestrator.ts +35 -273
- package/src/harness/process.ts +28 -4
- package/src/harness/queue-processor.ts +309 -0
- package/src/harness/runtime-factory.ts +125 -0
- package/src/plugins/ai-sdk/index.ts +44 -0
- package/src/plugins/ai-sdk/runtime.ts +484 -0
- package/src/plugins/ai-sdk/system-prompt.ts +4 -0
- package/src/plugins/approval/index.ts +228 -0
- package/src/plugins/delegation/index.ts +94 -0
- package/src/plugins/mcp/index.ts +128 -0
- package/src/plugins/memory/index.ts +85 -0
- package/src/plugins/shell/index.ts +123 -0
- package/src/plugins/storage-tools/index.ts +101 -0
- package/src/plugins/ui/index.ts +227 -0
- package/src/registry/plugins.ts +108 -55
- package/src/services/memory.ts +213 -0
- package/src/services/plugins.ts +133 -0
- package/src/services/storage.ts +472 -137
- package/src/agents/system.ts +0 -112
- package/src/plugins/ai-sdk.ts +0 -197
- package/src/plugins/delegation.ts +0 -60
- package/src/plugins/mcp.ts +0 -154
- package/src/plugins/storage.ts +0 -725
- package/src/plugins/ui.ts +0 -57
package/src/plugins/ui.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { MelonyPlugin } from 'melony';
|
|
2
|
-
import { OpenBotEvent, OpenBotState } from '../app/types.js';
|
|
3
|
-
import z from 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* UI Plugin for Melony.
|
|
7
|
-
* Provides tools for agents to trigger interactive UI widgets.
|
|
8
|
-
*/
|
|
9
|
-
export const uiPlugin = (): MelonyPlugin<OpenBotState, OpenBotEvent> => (builder) => {
|
|
10
|
-
builder.on('action:render_ui_widget', async function* (event, context) {
|
|
11
|
-
const { kind, title, props } = event.data;
|
|
12
|
-
|
|
13
|
-
const finalProps = { ...(props as Record<string, unknown>) };
|
|
14
|
-
|
|
15
|
-
// Auto-inject todos if it's a todo_list and they aren't provided
|
|
16
|
-
if (kind === 'todo_list' && !finalProps.todos) {
|
|
17
|
-
finalProps.todos = (context.state.threadDetails?.state as any)?.todos || [];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
yield {
|
|
21
|
-
type: 'client:ui:widget',
|
|
22
|
-
data: {
|
|
23
|
-
widgetId: `${kind}_${Date.now()}`,
|
|
24
|
-
kind,
|
|
25
|
-
title: title || (kind === 'approval' ? 'Approval Required' : kind === 'todo_list' ? 'Task List' : 'Details Required'),
|
|
26
|
-
props: finalProps,
|
|
27
|
-
},
|
|
28
|
-
meta: event.meta,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const uiToolDefinitions = {
|
|
34
|
-
render_ui_widget: {
|
|
35
|
-
description: 'Render an interactive UI widget (approval, todo_list, or form) in the conversation.',
|
|
36
|
-
inputSchema: z.object({
|
|
37
|
-
kind: z.enum(['approval', 'todo_list', 'form']).describe('The type of widget to render.'),
|
|
38
|
-
title: z.string().optional().describe('Optional title for the widget.'),
|
|
39
|
-
props: z.record(z.string(), z.unknown()).describe(
|
|
40
|
-
'Properties for the widget. \n' +
|
|
41
|
-
'- For "approval": { message: string, actionId: string }\n' +
|
|
42
|
-
'- For "todo_list": { title?: string } (Note: current thread todos are auto-injected if not provided)\n' +
|
|
43
|
-
'- For "form": { schema: Array<{ id, label, type, options?, required? }>, submitLabel?: string }'
|
|
44
|
-
),
|
|
45
|
-
}),
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const plugin = {
|
|
50
|
-
name: 'ui',
|
|
51
|
-
description: 'UI Widgets plugin',
|
|
52
|
-
version: '1.0.0',
|
|
53
|
-
author: 'OpenBot',
|
|
54
|
-
license: 'MIT',
|
|
55
|
-
factory: uiPlugin,
|
|
56
|
-
toolDefinitions: uiToolDefinitions,
|
|
57
|
-
};
|