bosun 0.41.0 → 0.41.2

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 (64) hide show
  1. package/.env.example +8 -0
  2. package/README.md +20 -0
  3. package/agent/agent-event-bus.mjs +248 -6
  4. package/agent/agent-pool.mjs +125 -28
  5. package/agent/agent-work-analyzer.mjs +8 -16
  6. package/agent/retry-queue.mjs +164 -0
  7. package/bosun.config.example.json +25 -0
  8. package/bosun.schema.json +825 -183
  9. package/cli.mjs +59 -5
  10. package/config/config.mjs +130 -3
  11. package/infra/monitor.mjs +693 -67
  12. package/infra/runtime-accumulator.mjs +376 -84
  13. package/infra/session-tracker.mjs +82 -25
  14. package/lib/codebase-audit.mjs +133 -18
  15. package/package.json +23 -4
  16. package/server/setup-web-server.mjs +25 -0
  17. package/server/ui-server.mjs +248 -29
  18. package/setup.mjs +27 -24
  19. package/shell/codex-shell.mjs +34 -3
  20. package/shell/copilot-shell.mjs +50 -8
  21. package/task/msg-hub.mjs +193 -0
  22. package/task/pipeline.mjs +544 -0
  23. package/task/task-cli.mjs +38 -2
  24. package/task/task-executor-pipeline.mjs +143 -0
  25. package/task/task-executor.mjs +36 -27
  26. package/telegram/get-telegram-chat-id.mjs +57 -47
  27. package/ui/components/workspace-switcher.js +7 -7
  28. package/ui/demo-defaults.js +15694 -10573
  29. package/ui/modules/settings-schema.js +2 -0
  30. package/ui/modules/state.js +54 -57
  31. package/ui/modules/voice-client-sdk.js +375 -36
  32. package/ui/modules/voice-client.js +140 -31
  33. package/ui/setup.html +68 -2
  34. package/ui/styles/components.css +57 -0
  35. package/ui/styles.css +201 -1
  36. package/ui/tabs/dashboard.js +74 -0
  37. package/ui/tabs/logs.js +10 -0
  38. package/ui/tabs/settings.js +178 -99
  39. package/ui/tabs/tasks.js +31 -1
  40. package/ui/tabs/telemetry.js +34 -0
  41. package/ui/tabs/workflow-canvas-utils.mjs +8 -1
  42. package/ui/tabs/workflows.js +532 -275
  43. package/voice/voice-agents-sdk.mjs +1 -1
  44. package/voice/voice-relay.mjs +6 -6
  45. package/workflow/declarative-workflows.mjs +145 -0
  46. package/workflow/msg-hub.mjs +237 -0
  47. package/workflow/pipeline-workflows.mjs +287 -0
  48. package/workflow/pipeline.mjs +828 -315
  49. package/workflow/workflow-cli.mjs +128 -0
  50. package/workflow/workflow-engine.mjs +329 -17
  51. package/workflow/workflow-nodes/custom-loader.mjs +250 -0
  52. package/workflow/workflow-nodes.mjs +1955 -223
  53. package/workflow/workflow-templates.mjs +26 -8
  54. package/workflow-templates/agents.mjs +0 -1
  55. package/workflow-templates/bosun-native.mjs +212 -2
  56. package/workflow-templates/continuation-loop.mjs +339 -0
  57. package/workflow-templates/github.mjs +516 -40
  58. package/workflow-templates/planning.mjs +446 -17
  59. package/workflow-templates/reliability.mjs +65 -12
  60. package/workflow-templates/task-batch.mjs +24 -8
  61. package/workflow-templates/task-lifecycle.mjs +83 -6
  62. package/workspace/context-cache.mjs +66 -18
  63. package/workspace/workspace-manager.mjs +2 -1
  64. package/workflow-templates/issue-continuation.mjs +0 -243
@@ -1,243 +0,0 @@
1
- /**
2
- * Issue State Continuation Loop Workflow Template
3
- *
4
- * This workflow monitors GitHub issues and automatically continues working on them
5
- * when their state changes (e.g., from "in progress" to "ready for review").
6
- *
7
- * It implements a "continuation loop" pattern that:
8
- * 1. Polls for issues in a specific state
9
- * 2. When an issue changes state, triggers an agent to work on it
10
- * 3. Updates the issue state based on work completion
11
- * 4. Repeats until issue is closed
12
- *
13
- * @module workflow-templates/issue-continuation
14
- */
15
-
16
- export const ISSUE_CONTINUATION_LOOP_TEMPLATE = {
17
- id: "template-issue-continuation-loop",
18
- name: "Issue Continuation Loop",
19
- description: "Monitor GitHub issues and automatically continue working when state changes",
20
- version: "1.0.0",
21
- category: "automation",
22
- icon: "🔄",
23
- metadata: {
24
- author: "bosun",
25
- tags: ["github", "issues", "automation", "loop"],
26
- repoRequired: true,
27
- },
28
-
29
- variables: {
30
- repo: {
31
- type: "string",
32
- required: true,
33
- description: "GitHub repository (owner/repo)",
34
- },
35
- issueState: {
36
- type: "string",
37
- default: "open",
38
- description: "Issue state to monitor (open, all)",
39
- },
40
- issueLabels: {
41
- type: "string",
42
- default: "",
43
- description: "Comma-separated labels to filter issues",
44
- },
45
- watchStates: {
46
- type: "string",
47
- default: "in_progress,ready_for_review",
48
- description: "States that trigger continuation",
49
- },
50
- pollIntervalMs: {
51
- type: "number",
52
- default: 60000,
53
- description: "How often to poll for state changes (ms)",
54
- },
55
- maxConcurrent: {
56
- type: "number",
57
- default: 3,
58
- description: "Maximum concurrent issue workflows",
59
- },
60
- assignOnStart: {
61
- type: "boolean",
62
- default: true,
63
- description: "Assign issue to bot when starting work",
64
- },
65
- commentOnStart: {
66
- type: "string",
67
- default: "Starting automated work on this issue.",
68
- description: "Comment to post when starting work",
69
- },
70
- commentOnComplete: {
71
- type: "string",
72
- default: "Automated work completed. Ready for review.",
73
- description: "Comment to post when work is complete",
74
- },
75
- botUsername: {
76
- type: "string",
77
- default: "bosun[bot]",
78
- description: "Bot username for assignments",
79
- },
80
- },
81
-
82
- triggers: {
83
- schedule: {
84
- enabled: true,
85
- cron: null,
86
- intervalMs: "{{pollIntervalMs}}",
87
- },
88
- manual: {
89
- enabled: true,
90
- },
91
- },
92
-
93
- nodes: [
94
- {
95
- id: "check-issues",
96
- type: "github-list-issues",
97
- label: "Check Issues",
98
- config: {
99
- repo: "{{repo}}",
100
- state: "{{issueState}}",
101
- labels: "{{issueLabels}}",
102
- sort: "updated",
103
- direction: "desc",
104
- },
105
- },
106
- {
107
- id: "filter-issues",
108
- type: "filter",
109
- label: "Filter by Watch States",
110
- config: {
111
- items: "{{check-issues.output}}",
112
- expression: `((item) => {
113
- const watchStates = String("{{watchStates}}").split(",").map(s => s.trim());
114
- const state = String(item.state || "").toLowerCase();
115
- const label = String(item.labels || "").toLowerCase();
116
- return watchStates.some(ws => state.includes(ws) || label.includes(ws));
117
- })`,
118
- },
119
- },
120
- {
121
- id: "check-already-working",
122
- type: "filter",
123
- label: "Filter Out Already Working",
124
- config: {
125
- items: "{{filter-issues.output}}",
126
- expression: `((item) => {
127
- const assignees = item.assignees || [];
128
- const botName = String("{{botUsername}}").toLowerCase();
129
- return !assignees.some(a => String(a.login || a || "").toLowerCase().includes(botName));
130
- })`,
131
- },
132
- },
133
- {
134
- id: "limit-concurrent",
135
- type: "limit",
136
- label: "Limit Concurrent",
137
- config: {
138
- items: "{{check-already-working.output}}",
139
- limit: "{{maxConcurrent}}",
140
- },
141
- },
142
- {
143
- id: "for-each-issue",
144
- type: "for-each",
145
- label: "Process Each Issue",
146
- items: "{{limit-concurrent.output}}",
147
- nodes: [
148
- {
149
- id: "assign-issue",
150
- type: "github-add-issue-assignees",
151
- label: "Assign Issue",
152
- condition: "{{assignOnStart}}",
153
- config: {
154
- repo: "{{repo}}",
155
- issueNumber: "{{for-each-issue.item.number}}",
156
- assignees: ["{{botUsername}}"],
157
- },
158
- },
159
- {
160
- id: "comment-start",
161
- type: "github-create-issue-comment",
162
- label: "Comment on Start",
163
- condition: "{{commentOnStart}}",
164
- config: {
165
- repo: "{{repo}}",
166
- issueNumber: "{{for-each-issue.item.number}}",
167
- body: "{{commentOnStart}}",
168
- },
169
- },
170
- {
171
- id: "analyze-issue",
172
- type: "agent-prompt",
173
- label: "Analyze Issue",
174
- config: {
175
- prompt: `Analyze this GitHub issue and create a task plan:\n\nTitle: {{for-each-issue.item.title}}\nBody: {{for-each-issue.item.body}}\n\nProvide:\n1. Summary of the issue\n2. Steps to reproduce (if bug)\n3. Proposed solution\n4. Files likely to be modified`,
176
- executor: "codex",
177
- model: "auto",
178
- },
179
- },
180
- {
181
- id: "execute-work",
182
- type: "agent-execute",
183
- label: "Execute Work",
184
- config: {
185
- prompt: "{{analyze-issue.output}}",
186
- taskKey: "issue-{{for-each-issue.item.number}}",
187
- executor: "codex",
188
- model: "auto",
189
- timeoutMs: 600000,
190
- },
191
- },
192
- {
193
- id: "update-issue-state",
194
- type: "github-update-issue",
195
- label: "Update Issue State",
196
- config: {
197
- repo: "{{repo}}",
198
- issueNumber: "{{for-each-issue.item.number}}",
199
- state: "open",
200
- labels: "{{for-each-issue.item.labels}},in-review",
201
- },
202
- },
203
- {
204
- id: "comment-complete",
205
- type: "github-create-issue-comment",
206
- label: "Comment on Complete",
207
- condition: "{{commentOnComplete}}",
208
- config: {
209
- repo: "{{repo}}",
210
- issueNumber: "{{for-each-issue.item.number}}",
211
- body: "{{commentOnComplete}}\n\n---\nWork completed by Bosun.\n{{execute-work.output}}",
212
- },
213
- },
214
- ],
215
- },
216
- {
217
- id: "wait",
218
- type: "delay",
219
- label: "Wait Before Next Poll",
220
- config: {
221
- delayMs: "{{pollIntervalMs}}",
222
- },
223
- },
224
- {
225
- id: "loop",
226
- type: "loop",
227
- label: "Continue Loop",
228
- source: "wait",
229
- target: "check-issues",
230
- },
231
- ],
232
-
233
- edges: [
234
- { source: "check-issues", target: "filter-issues" },
235
- { source: "filter-issues", target: "check-already-working" },
236
- { source: "check-already-working", target: "limit-concurrent" },
237
- { source: "limit-concurrent", target: "for-each-issue" },
238
- { source: "for-each-issue", target: "wait" },
239
- { source: "wait", target: "loop" },
240
- ],
241
- };
242
-
243
- export default ISSUE_CONTINUATION_LOOP_TEMPLATE;