openbot 0.4.7 → 0.5.4
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/.claude/agents/runtime-security-reviewer.md +32 -0
- package/.claude/hooks/format.sh +18 -0
- package/.claude/hooks/protect-secrets.sh +23 -0
- package/.claude/settings.json +26 -0
- package/.claude/skills/deploy/SKILL.md +26 -0
- package/.claude/skills/new-plugin/SKILL.md +46 -0
- package/.dockerignore +9 -0
- package/.mcp.json +8 -0
- package/AGENTS.md +2 -2
- package/CLAUDE.md +50 -0
- package/Dockerfile +41 -0
- package/deploy/README.md +61 -0
- package/deploy/entrypoint.sh +6 -0
- package/deploy/fly.toml +36 -0
- package/dist/app/bootstrap.js +29 -0
- package/dist/app/cli.js +3 -1
- package/dist/app/cloud-mode.js +26 -0
- package/dist/app/config.js +61 -16
- package/dist/app/server.js +38 -6
- package/dist/plugins/approval/index.js +1 -1
- package/dist/plugins/bash/index.js +386 -164
- package/dist/plugins/memory/service.js +2 -5
- package/dist/plugins/openbot/context.js +17 -1
- package/dist/plugins/openbot/index.js +23 -8
- package/dist/plugins/openbot/model.js +59 -0
- package/dist/plugins/openbot/runtime.js +39 -56
- package/dist/plugins/openbot/system-prompt.js +43 -8
- package/dist/plugins/preview/index.js +267 -0
- package/dist/plugins/storage/index.js +3 -3
- package/dist/plugins/storage/service.js +58 -12
- package/dist/plugins/todo/index.js +131 -38
- package/dist/plugins/todo/service.js +93 -0
- package/dist/plugins/ui/index.js +8 -1
- package/dist/services/plugins/model-registry.js +101 -0
- package/dist/services/plugins/registry.js +6 -4
- package/dist/services/plugins/service.js +2 -6
- package/docs/agents.md +20 -2
- package/docs/architecture.md +1 -1
- package/docs/plugins.md +13 -3
- package/docs/templates/AGENT.example.md +1 -1
- package/package.json +5 -2
- package/pnpm-workspace.yaml +2 -0
- package/src/app/bootstrap.ts +43 -0
- package/src/app/cli.ts +3 -1
- package/src/app/cloud-mode.ts +41 -0
- package/src/app/config.ts +71 -19
- package/src/app/server.ts +45 -6
- package/src/app/types.ts +162 -31
- package/src/plugins/approval/index.ts +1 -1
- package/src/plugins/bash/index.ts +498 -185
- package/src/plugins/memory/service.ts +2 -5
- package/src/plugins/openbot/context.ts +17 -1
- package/src/plugins/openbot/index.ts +25 -10
- package/src/plugins/openbot/model.ts +76 -0
- package/src/plugins/openbot/runtime.ts +47 -69
- package/src/plugins/openbot/system-prompt.ts +43 -8
- package/src/plugins/preview/index.ts +323 -0
- package/src/plugins/storage/index.ts +5 -8
- package/src/plugins/storage/service.ts +79 -15
- package/src/plugins/todo/index.ts +166 -0
- package/src/plugins/todo/service.ts +123 -0
- package/src/plugins/ui/index.ts +8 -1
- package/src/services/plugins/domain.ts +2 -0
- package/src/services/plugins/model-registry.ts +146 -0
- package/src/services/plugins/registry.ts +6 -4
- package/src/services/plugins/service.ts +2 -6
- package/dist/agents/openbot/index.js +0 -76
- package/dist/agents/openbot/middleware/approval.js +0 -132
- package/dist/agents/openbot/runtime.js +0 -289
- package/dist/agents/openbot/system-prompt.js +0 -32
- package/dist/agents/openbot/tools/delegation.js +0 -78
- package/dist/agents/openbot/tools/mcp.js +0 -99
- package/dist/agents/openbot/tools/shell.js +0 -91
- package/dist/agents/openbot/tools/storage.js +0 -75
- package/dist/agents/openbot/tools/ui.js +0 -176
- package/dist/agents/system.js +0 -33
- package/dist/bus/agent-package.js +0 -1
- package/dist/bus/plugin.js +0 -1
- package/dist/bus/services.js +0 -754
- package/dist/bus/types.js +0 -1
- package/dist/harness/agent-harness.js +0 -45
- package/dist/harness/agent-invoke-run.js +0 -44
- package/dist/harness/agent-turn.js +0 -99
- package/dist/harness/channel-participants.js +0 -40
- package/dist/harness/constants.js +0 -2
- package/dist/harness/context-meter.js +0 -97
- package/dist/harness/context.js +0 -363
- package/dist/harness/dispatch.js +0 -144
- package/dist/harness/dispatcher.js +0 -156
- package/dist/harness/event-normalizer.js +0 -59
- package/dist/harness/history.js +0 -177
- package/dist/harness/mcp.js +0 -61
- package/dist/harness/orchestration.js +0 -88
- package/dist/harness/orchestrator.js +0 -149
- package/dist/harness/participants.js +0 -22
- package/dist/harness/process.js +0 -29
- package/dist/harness/queue-processor.js +0 -187
- package/dist/harness/run-harness.js +0 -154
- package/dist/harness/run.js +0 -98
- package/dist/harness/runtime-factory.js +0 -73
- package/dist/harness/runtime.js +0 -57
- package/dist/harness/todo-advance.js +0 -93
- package/dist/harness/todo-dispatch.js +0 -51
- package/dist/harness/todos.js +0 -5
- package/dist/harness/turn.js +0 -79
- package/dist/harness/types.js +0 -1
- package/dist/plugins/ai-sdk/index.js +0 -34
- package/dist/plugins/ai-sdk/runtime.js +0 -395
- package/dist/plugins/ai-sdk/system-prompt.js +0 -18
- package/dist/plugins/ai-sdk.js +0 -331
- package/dist/plugins/approval.js +0 -163
- package/dist/plugins/delegation.js +0 -108
- package/dist/plugins/mcp/index.js +0 -108
- package/dist/plugins/mcp.js +0 -140
- package/dist/plugins/shell/index.js +0 -100
- package/dist/plugins/shell.js +0 -123
- package/dist/plugins/storage-tools/index.js +0 -76
- package/dist/plugins/storage.js +0 -737
- package/dist/plugins/thread-namer/index.js +0 -72
- package/dist/plugins/threads/index.js +0 -114
- package/dist/plugins/ui.js +0 -211
- package/dist/plugins/workflow/index.js +0 -65
- package/dist/registry/agents.js +0 -138
- package/dist/registry/plugins.js +0 -110
- package/dist/services/agent-packages.js +0 -103
- package/dist/services/memory.js +0 -152
- package/dist/services/plugins.js +0 -98
- package/dist/services/storage.js +0 -1028
- package/dist/workflow/service.js +0 -106
- package/dist/workflow/types.js +0 -3
package/dist/workflow/service.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { generateId } from 'melony';
|
|
2
|
-
import { storageService } from '../services/storage.js';
|
|
3
|
-
import { WORKFLOW_SCHEMA_VERSION, WORKFLOW_THREAD_STATE_KEY, } from './types.js';
|
|
4
|
-
const asRecord = (value) => value && typeof value === 'object' && !Array.isArray(value)
|
|
5
|
-
? value
|
|
6
|
-
: {};
|
|
7
|
-
const isTodoStatus = (value) => value === 'pending' || value === 'done' || value === 'failed';
|
|
8
|
-
const parseTodo = (value) => {
|
|
9
|
-
const record = asRecord(value);
|
|
10
|
-
if (typeof record.id !== 'string' || !record.id)
|
|
11
|
-
return null;
|
|
12
|
-
if (typeof record.text !== 'string' || !record.text)
|
|
13
|
-
return null;
|
|
14
|
-
if (!isTodoStatus(record.status))
|
|
15
|
-
return null;
|
|
16
|
-
return {
|
|
17
|
-
id: record.id,
|
|
18
|
-
text: record.text,
|
|
19
|
-
status: record.status,
|
|
20
|
-
summary: typeof record.summary === 'string' ? record.summary : undefined,
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export const parseThreadWorkflow = (state) => {
|
|
24
|
-
const record = asRecord(state);
|
|
25
|
-
const raw = record[WORKFLOW_THREAD_STATE_KEY];
|
|
26
|
-
const workflow = asRecord(raw);
|
|
27
|
-
if (typeof workflow.id !== 'string' || !workflow.id)
|
|
28
|
-
return null;
|
|
29
|
-
if (!Array.isArray(workflow.todos))
|
|
30
|
-
return null;
|
|
31
|
-
const todos = workflow.todos
|
|
32
|
-
.map((todo) => parseTodo(todo))
|
|
33
|
-
.filter((todo) => todo !== null);
|
|
34
|
-
if (todos.length === 0 && !workflow.title)
|
|
35
|
-
return null;
|
|
36
|
-
return {
|
|
37
|
-
version: typeof workflow.version === 'number' ? workflow.version : WORKFLOW_SCHEMA_VERSION,
|
|
38
|
-
id: workflow.id,
|
|
39
|
-
title: typeof workflow.title === 'string' ? workflow.title : undefined,
|
|
40
|
-
todos,
|
|
41
|
-
updatedAt: typeof workflow.updatedAt === 'string' ? workflow.updatedAt : new Date().toISOString(),
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export const loadThreadWorkflow = async (channelId, threadId) => {
|
|
45
|
-
const details = await storageService.getThreadDetails({ channelId, threadId });
|
|
46
|
-
return parseThreadWorkflow(details.state);
|
|
47
|
-
};
|
|
48
|
-
export const persistWorkflow = async (channelId, threadId, workflow) => {
|
|
49
|
-
const next = {
|
|
50
|
-
...workflow,
|
|
51
|
-
version: WORKFLOW_SCHEMA_VERSION,
|
|
52
|
-
updatedAt: new Date().toISOString(),
|
|
53
|
-
};
|
|
54
|
-
await storageService.patchThreadState({
|
|
55
|
-
channelId,
|
|
56
|
-
threadId,
|
|
57
|
-
state: { [WORKFLOW_THREAD_STATE_KEY]: next },
|
|
58
|
-
});
|
|
59
|
-
return next;
|
|
60
|
-
};
|
|
61
|
-
export const setWorkflowPlan = async (options) => {
|
|
62
|
-
const { channelId, threadId, plan } = options;
|
|
63
|
-
const workflow = {
|
|
64
|
-
version: WORKFLOW_SCHEMA_VERSION,
|
|
65
|
-
id: `wf_${generateId()}`,
|
|
66
|
-
title: plan.title,
|
|
67
|
-
todos: plan.todos.map((t) => ({
|
|
68
|
-
id: t.id || `todo_${generateId()}`,
|
|
69
|
-
text: t.text,
|
|
70
|
-
status: 'pending',
|
|
71
|
-
})),
|
|
72
|
-
updatedAt: new Date().toISOString(),
|
|
73
|
-
};
|
|
74
|
-
return persistWorkflow(channelId, threadId, workflow);
|
|
75
|
-
};
|
|
76
|
-
export const updateWorkflowTodo = async (options) => {
|
|
77
|
-
const { channelId, threadId, update } = options;
|
|
78
|
-
const workflow = await loadThreadWorkflow(channelId, threadId);
|
|
79
|
-
if (!workflow)
|
|
80
|
-
throw new Error('No active workflow found.');
|
|
81
|
-
const todos = workflow.todos.map((todo) => {
|
|
82
|
-
if (todo.id !== update.todoId)
|
|
83
|
-
return todo;
|
|
84
|
-
return {
|
|
85
|
-
...todo,
|
|
86
|
-
...(update.status ? { status: update.status } : {}),
|
|
87
|
-
...(update.summary !== undefined ? { summary: update.summary } : {}),
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
return persistWorkflow(channelId, threadId, { ...workflow, todos });
|
|
91
|
-
};
|
|
92
|
-
export const formatWorkflowForPrompt = (workflow) => {
|
|
93
|
-
const lines = [
|
|
94
|
-
'## Current Workflow Plan',
|
|
95
|
-
workflow.title ? `Title: ${workflow.title}` : '',
|
|
96
|
-
'This plan is for your internal coordination. Update it as you progress.',
|
|
97
|
-
'',
|
|
98
|
-
].filter(Boolean);
|
|
99
|
-
for (const todo of workflow.todos) {
|
|
100
|
-
lines.push(`- [${todo.status}] ${todo.id}: ${todo.text}`);
|
|
101
|
-
if (todo.summary) {
|
|
102
|
-
lines.push(` Result: ${todo.summary}`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return lines.join('\n');
|
|
106
|
-
};
|
package/dist/workflow/types.js
DELETED