speexor 0.1.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.
- package/API-REFERENCE.md +201 -0
- package/ARCHITECTURE.md +548 -0
- package/CHANGELOG.md +52 -0
- package/CODE-OF-CONDUCT.md +83 -0
- package/CONTRIBUTING.md +98 -0
- package/FAQ.md +105 -0
- package/LICENSE.md +21 -0
- package/PUBLISH.md +77 -0
- package/README.md +179 -0
- package/REFACTOR-LOG.md +40 -0
- package/ROADMAP.md +78 -0
- package/SECURITY.md +79 -0
- package/SUMMARY.md +46 -0
- package/TESTING.md +140 -0
- package/dist/agent-5D3BVWNK.js +37 -0
- package/dist/agent-5D3BVWNK.js.map +1 -0
- package/dist/chunk-2F66BZYJ.js +212 -0
- package/dist/chunk-2F66BZYJ.js.map +1 -0
- package/dist/chunk-5NA2TFPG.js +3 -0
- package/dist/chunk-5NA2TFPG.js.map +1 -0
- package/dist/chunk-B7WLHC4W.js +666 -0
- package/dist/chunk-B7WLHC4W.js.map +1 -0
- package/dist/chunk-SXALZEOJ.js +345 -0
- package/dist/chunk-SXALZEOJ.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +287 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/index.d.ts +31 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.js +205 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/index.js +3 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/types-0q_okI2g.d.ts +205 -0
- package/docs/PRD01.md +264 -0
- package/docs/PRD02.md +299 -0
- package/docs/PRD03.md +0 -0
- package/docs/PRD04.md +349 -0
- package/docs/PRD05.md +312 -0
- package/docs/SETUP.md +94 -0
- package/docs/TROUBLESHOOTING.md +113 -0
- package/examples/basic.yaml +61 -0
- package/package.json +102 -0
- package/schema/config.schema.json +119 -0
- package/speexor.config.yaml.example +30 -0
package/API-REFERENCE.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
> Plugin interfaces, configuration schema, and core API documentation for Speexor.
|
|
4
|
+
|
|
5
|
+
## Plugin Interfaces
|
|
6
|
+
|
|
7
|
+
### PluginModule (Base Interface)
|
|
8
|
+
All plugins must implement this interface:
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
interface PluginModule {
|
|
12
|
+
name: string
|
|
13
|
+
version: string
|
|
14
|
+
type: PluginSlot // 'agent' | 'runtime' | 'workspace' | 'tracker' | 'scm' | 'notifier' | 'terminal'
|
|
15
|
+
initialize(context: PluginContext): Promise<void>
|
|
16
|
+
destroy(): Promise<void>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface PluginContext {
|
|
20
|
+
config: SpeexorConfig
|
|
21
|
+
eventBus: EventBus
|
|
22
|
+
logger: (msg: string) => void
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### AgentPlugin
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
interface AgentPlugin extends PluginModule {
|
|
30
|
+
type: 'agent'
|
|
31
|
+
spawn(task: AgentTask, runtime: RuntimeSession): Promise<AgentSession>
|
|
32
|
+
sendInput(sessionId: string, input: string): Promise<void>
|
|
33
|
+
getStatus(sessionId: string): Promise<AgentStatus>
|
|
34
|
+
kill(sessionId: string): Promise<void>
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### RuntimePlugin
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
interface RuntimePlugin extends PluginModule {
|
|
42
|
+
type: 'runtime'
|
|
43
|
+
createSession(worktreePath: string): Promise<RuntimeSession>
|
|
44
|
+
destroySession(sessionId: string): Promise<void>
|
|
45
|
+
sendInput(sessionId: string, input: string): Promise<void>
|
|
46
|
+
getOutput(sessionId: string): Promise<string>
|
|
47
|
+
getLiveStream(sessionId: string): AsyncIterable<string>
|
|
48
|
+
getStatus(sessionId: string): Promise<'running' | 'stopped' | 'error'>
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### WorkspacePlugin
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
interface WorkspacePlugin extends PluginModule {
|
|
56
|
+
type: 'workspace'
|
|
57
|
+
createWorktree(task: AgentTask): Promise<WorktreeSession>
|
|
58
|
+
removeWorktree(sessionId: string): Promise<void>
|
|
59
|
+
getWorktreePath(sessionId: string): string
|
|
60
|
+
listActive(): Promise<WorktreeSession[]>
|
|
61
|
+
cleanupStale(): Promise<string[]>
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### TrackerPlugin
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
interface TrackerPlugin extends PluginModule {
|
|
69
|
+
type: 'tracker'
|
|
70
|
+
fetchIssues(filter?: TrackerFilter): Promise<TrackerIssue[]>
|
|
71
|
+
getIssue(id: string): Promise<TrackerIssue | null>
|
|
72
|
+
onEvent(handler: (event: TrackerEvent) => void): void
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### SCMPlugin
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
interface SCMPlugin extends PluginModule {
|
|
80
|
+
type: 'scm'
|
|
81
|
+
createBranch(baseBranch: string, newBranch: string): Promise<void>
|
|
82
|
+
commitAndPush(branch: string, message: string): Promise<string>
|
|
83
|
+
createPullRequest(title: string, description: string, head: string, base: string): Promise<PRInfo>
|
|
84
|
+
getPRStatus(prId: string): Promise<PRStatus>
|
|
85
|
+
getPRComments(prId: string): Promise<PRComment[]>
|
|
86
|
+
getCIRuns(prId: string): Promise<CIRun[]>
|
|
87
|
+
mergePR(prId: string, method?: 'merge' | 'squash' | 'rebase'): Promise<void>
|
|
88
|
+
onEvent(handler: (event: TrackerEvent) => void): void
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### NotifierPlugin
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
interface NotifierPlugin extends PluginModule {
|
|
96
|
+
type: 'notifier'
|
|
97
|
+
notify(level: 'info' | 'warn' | 'error' | 'success', title: string, message: string): Promise<void>
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### TerminalPlugin
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
interface TerminalPlugin extends PluginModule {
|
|
105
|
+
type: 'terminal'
|
|
106
|
+
attach(sessionId: string): Promise<void>
|
|
107
|
+
detach(sessionId: string): Promise<void>
|
|
108
|
+
write(sessionId: string, data: string): Promise<void>
|
|
109
|
+
onData(sessionId: string, handler: (data: string) => void): void
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Core API
|
|
114
|
+
|
|
115
|
+
### SpeexorLifecycle
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
class SpeexorLifecycle {
|
|
119
|
+
constructor(config: SpeexorConfig)
|
|
120
|
+
initialize(): Promise<void>
|
|
121
|
+
registerPlugin(plugin: PluginModule): void
|
|
122
|
+
getPlugins<T>(slot: PluginSlot): T[]
|
|
123
|
+
getFirstPlugin<T>(slot: PluginSlot): T | undefined
|
|
124
|
+
spawnAgent(task: AgentTask): Promise<AgentSession>
|
|
125
|
+
stopSession(sessionId: string): Promise<void>
|
|
126
|
+
getSession(sessionId: string): AgentSession | undefined
|
|
127
|
+
listSessions(): AgentSession[]
|
|
128
|
+
destroy(): Promise<void>
|
|
129
|
+
getConfig(): SpeexorConfig
|
|
130
|
+
getStatus(): SessionStatus
|
|
131
|
+
eventBus: EventBus
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Config Functions
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
function loadConfig(cwd?: string): SpeexorConfig
|
|
139
|
+
function validateConfig(raw: unknown): SpeexorConfig
|
|
140
|
+
function generateDefaultConfig(repoUrl: string, projectName?: string): SpeexorConfig
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Plugin Loading
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
function loadAllPlugins(): PluginModule[]
|
|
147
|
+
function loadPluginByType(type: string): PluginModule | undefined
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Event Bus
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
function createEventBus(): EventBus
|
|
154
|
+
// EventBus: { emit(event, data), on(event, handler), off(event, handler), once(event, handler) }
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Configuration Schema
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
version: "1"
|
|
161
|
+
projects:
|
|
162
|
+
- name: <string>
|
|
163
|
+
repository: <string>
|
|
164
|
+
path?: <string>
|
|
165
|
+
branch?: <string>
|
|
166
|
+
provider:
|
|
167
|
+
primary: opencode | claude-code | aider | codex
|
|
168
|
+
fallback?: (opencode | claude-code | aider | codex)[]
|
|
169
|
+
concurrentLimit?: <1-20>
|
|
170
|
+
costLimit?: <number>
|
|
171
|
+
reactions?:
|
|
172
|
+
ci-failed?: { auto, action, retries, escalateAfter }
|
|
173
|
+
changes-requested?: { auto, action, retries, escalateAfter }
|
|
174
|
+
approved-and-green?: { auto, action, retries, escalateAfter }
|
|
175
|
+
plugins?:
|
|
176
|
+
tracker?: string
|
|
177
|
+
scm?: string
|
|
178
|
+
runtime?: string
|
|
179
|
+
notifier?: string
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Dashboard API
|
|
183
|
+
|
|
184
|
+
| Method | Path | Description |
|
|
185
|
+
|--------|------|-------------|
|
|
186
|
+
| GET | `/api/status` | Lifecycle status, project/agent counts, uptime |
|
|
187
|
+
| GET | `/api/projects` | Project configurations |
|
|
188
|
+
| GET | `/api/sessions` | Active sessions, worktrees, runtimes |
|
|
189
|
+
| GET | `/api/health` | Health check with memory stats |
|
|
190
|
+
| GET | `/` or `/dashboard` | HTML dashboard UI |
|
|
191
|
+
|
|
192
|
+
## CLI Reference
|
|
193
|
+
|
|
194
|
+
| Command | Description |
|
|
195
|
+
|---------|-------------|
|
|
196
|
+
| `speexor start [repo]` | Init project + start dashboard |
|
|
197
|
+
| `speexor agent spawn -t <id>` | Spawn agent for task |
|
|
198
|
+
| `speexor list` | List projects and agents |
|
|
199
|
+
| `speexor stop <session-id>` | Stop agent session |
|
|
200
|
+
| `speexor logs <session-id>` | Tail session logs |
|
|
201
|
+
| `speexor config-help` | Print config schema |
|