openbot 0.2.14 → 0.3.0

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.
Files changed (80) hide show
  1. package/dist/agents/openbot/index.js +76 -0
  2. package/dist/agents/openbot/middleware/approval.js +132 -0
  3. package/dist/agents/openbot/runtime.js +289 -0
  4. package/dist/agents/openbot/system-prompt.js +32 -0
  5. package/dist/agents/openbot/tools/delegation.js +78 -0
  6. package/dist/agents/openbot/tools/mcp.js +99 -0
  7. package/dist/agents/openbot/tools/shell.js +91 -0
  8. package/dist/agents/openbot/tools/storage.js +75 -0
  9. package/dist/agents/openbot/tools/ui.js +176 -0
  10. package/dist/agents/system.js +20 -93
  11. package/dist/app/cli.js +0 -0
  12. package/dist/app/config.js +4 -1
  13. package/dist/app/server.js +15 -8
  14. package/dist/bus/agent-package.js +1 -0
  15. package/dist/bus/plugin.js +1 -0
  16. package/dist/bus/services.js +600 -0
  17. package/dist/bus/types.js +1 -0
  18. package/dist/harness/context.js +131 -0
  19. package/dist/harness/event-normalizer.js +59 -0
  20. package/dist/harness/orchestrator.js +27 -227
  21. package/dist/harness/process.js +25 -3
  22. package/dist/harness/queue-processor.js +227 -0
  23. package/dist/harness/runtime-factory.js +103 -0
  24. package/dist/plugins/ai-sdk/index.js +37 -0
  25. package/dist/plugins/ai-sdk/runtime.js +330 -0
  26. package/dist/plugins/ai-sdk/system-prompt.js +3 -0
  27. package/dist/plugins/ai-sdk.js +277 -87
  28. package/dist/plugins/approval/index.js +159 -0
  29. package/dist/plugins/approval.js +163 -0
  30. package/dist/plugins/delegation/index.js +79 -0
  31. package/dist/plugins/delegation.js +67 -11
  32. package/dist/plugins/mcp/index.js +108 -0
  33. package/dist/plugins/shell/index.js +99 -0
  34. package/dist/plugins/shell.js +123 -0
  35. package/dist/plugins/storage-tools/index.js +85 -0
  36. package/dist/plugins/storage.js +240 -5
  37. package/dist/plugins/ui/index.js +184 -0
  38. package/dist/plugins/ui.js +185 -21
  39. package/dist/registry/agents.js +138 -0
  40. package/dist/registry/plugins.js +91 -50
  41. package/dist/services/agent-packages.js +103 -0
  42. package/dist/services/plugins.js +98 -0
  43. package/dist/services/storage.js +360 -94
  44. package/docs/agents.md +39 -66
  45. package/docs/architecture.md +1 -1
  46. package/docs/plugins.md +70 -58
  47. package/docs/templates/AGENT.example.md +57 -0
  48. package/package.json +8 -7
  49. package/src/app/cli.ts +1 -1
  50. package/src/app/config.ts +14 -4
  51. package/src/app/server.ts +23 -10
  52. package/src/app/types.ts +385 -16
  53. package/src/assets/icon.svg +4 -1
  54. package/src/bus/plugin.ts +67 -0
  55. package/src/bus/services.ts +666 -0
  56. package/src/bus/types.ts +147 -0
  57. package/src/harness/context.ts +160 -0
  58. package/src/harness/event-normalizer.ts +82 -0
  59. package/src/harness/orchestrator.ts +35 -273
  60. package/src/harness/process.ts +28 -4
  61. package/src/harness/queue-processor.ts +309 -0
  62. package/src/harness/runtime-factory.ts +125 -0
  63. package/src/plugins/ai-sdk/index.ts +44 -0
  64. package/src/plugins/ai-sdk/runtime.ts +410 -0
  65. package/src/plugins/ai-sdk/system-prompt.ts +4 -0
  66. package/src/plugins/approval/index.ts +228 -0
  67. package/src/plugins/delegation/index.ts +94 -0
  68. package/src/plugins/mcp/index.ts +128 -0
  69. package/src/plugins/shell/index.ts +123 -0
  70. package/src/plugins/storage-tools/index.ts +101 -0
  71. package/src/plugins/ui/index.ts +227 -0
  72. package/src/registry/plugins.ts +106 -55
  73. package/src/services/plugins.ts +133 -0
  74. package/src/services/storage.ts +465 -137
  75. package/src/agents/system.ts +0 -112
  76. package/src/plugins/ai-sdk.ts +0 -197
  77. package/src/plugins/delegation.ts +0 -60
  78. package/src/plugins/mcp.ts +0 -154
  79. package/src/plugins/storage.ts +0 -725
  80. 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
- };