devteam-orchestrator-cli 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/LICENSE +21 -0
- package/README.md +309 -0
- package/dist/api-client.d.ts +199 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +184 -0
- package/dist/api-client.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +252 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/approve.d.ts +5 -0
- package/dist/commands/approve.d.ts.map +1 -0
- package/dist/commands/approve.js +190 -0
- package/dist/commands/approve.js.map +1 -0
- package/dist/commands/config-cmd.d.ts +7 -0
- package/dist/commands/config-cmd.d.ts.map +1 -0
- package/dist/commands/config-cmd.js +113 -0
- package/dist/commands/config-cmd.js.map +1 -0
- package/dist/commands/deploy.d.ts +7 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +179 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +118 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +6 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +73 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logs.d.ts +6 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +173 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/plan.d.ts +8 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +122 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/run.d.ts +10 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +154 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/status.d.ts +5 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +159 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/tasks.d.ts +7 -0
- package/dist/commands/tasks.d.ts.map +1 -0
- package/dist/commands/tasks.js +112 -0
- package/dist/commands/tasks.js.map +1 -0
- package/dist/commands/templates.d.ts +6 -0
- package/dist/commands/templates.d.ts.map +1 -0
- package/dist/commands/templates.js +82 -0
- package/dist/commands/templates.js.map +1 -0
- package/dist/commands/workers.d.ts +4 -0
- package/dist/commands/workers.d.ts.map +1 -0
- package/dist/commands/workers.js +98 -0
- package/dist/commands/workers.js.map +1 -0
- package/dist/config.d.ts +29 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +92 -0
- package/dist/config.js.map +1 -0
- package/dist/utils.d.ts +27 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +212 -0
- package/dist/utils.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matwal LTD
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# @devteam/cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for the DevTeam Orchestrator - manage AI agent swarms, tasks, workers, and templates from your terminal.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cd /root/devteam-cli
|
|
9
|
+
npm install
|
|
10
|
+
npm run build
|
|
11
|
+
npm link # Makes 'devteam' available globally
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
For development:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm run dev -- <command> # Run without building (uses tsx)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 1. Initialize a project
|
|
24
|
+
devteam init
|
|
25
|
+
|
|
26
|
+
# 2. Authenticate
|
|
27
|
+
devteam login
|
|
28
|
+
|
|
29
|
+
# 3. Check cluster status
|
|
30
|
+
devteam status
|
|
31
|
+
|
|
32
|
+
# 4. Run your first task
|
|
33
|
+
devteam run "Analyze this codebase and suggest improvements"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Commands
|
|
37
|
+
|
|
38
|
+
### `devteam init`
|
|
39
|
+
|
|
40
|
+
Initialize a new project in the current directory. Creates a `devteam.config.json` file with project-specific settings.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
devteam init # Interactive setup
|
|
44
|
+
devteam init -y # Accept all defaults
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `devteam login`
|
|
48
|
+
|
|
49
|
+
Authenticate with the DevTeam API. Stores your API key securely in the system config directory.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
devteam login # Interactive prompt
|
|
53
|
+
devteam login -k <api-key> # Provide key directly
|
|
54
|
+
devteam login -u https://... # Set custom API URL
|
|
55
|
+
devteam logout # Remove stored credentials
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `devteam run <prompt>`
|
|
59
|
+
|
|
60
|
+
Submit a task to the agent swarm and optionally stream live output.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
devteam run "Review this PR for security issues"
|
|
64
|
+
devteam run "Build a REST API for user management" -q gpu-queue -p high
|
|
65
|
+
devteam run "Run tests" -w surface-book --no-stream
|
|
66
|
+
devteam run "Analyze data" --json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Options:**
|
|
70
|
+
- `-q, --queue <queue>` - Target queue (gpu-queue, general-queue)
|
|
71
|
+
- `-p, --priority <priority>` - Task priority (low, normal, high, critical)
|
|
72
|
+
- `-w, --worker <worker>` - Target specific worker node
|
|
73
|
+
- `-t, --tag <tags...>` - Tags for the task
|
|
74
|
+
- `--timeout <ms>` - Task timeout in milliseconds
|
|
75
|
+
- `--no-stream` - Do not stream live output
|
|
76
|
+
- `--json` - Output in JSON format
|
|
77
|
+
|
|
78
|
+
### `devteam plan <goal>`
|
|
79
|
+
|
|
80
|
+
Generate an AI execution plan with DAG (Directed Acyclic Graph) visualization showing task dependencies.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
devteam plan "Build a full-stack e-commerce app"
|
|
84
|
+
devteam plan "Migrate database" --max-steps 5 --budget 50
|
|
85
|
+
devteam plan "Deploy to production" -x # Execute immediately
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Options:**
|
|
89
|
+
- `--max-steps <n>` - Maximum number of plan steps
|
|
90
|
+
- `--budget <amount>` - Budget limit in dollars
|
|
91
|
+
- `-c, --constraint <constraints...>` - Constraints for the plan
|
|
92
|
+
- `-x, --execute` - Execute immediately after creation
|
|
93
|
+
- `--json` - Output in JSON format
|
|
94
|
+
|
|
95
|
+
### `devteam deploy <template-id>`
|
|
96
|
+
|
|
97
|
+
Deploy a template from the marketplace with interactive input collection.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
devteam deploy contract-review-v1
|
|
101
|
+
devteam deploy dd-pack-v1 -i company="Acme Corp" -i industry=tech
|
|
102
|
+
devteam deploy my-template --dry-run
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Options:**
|
|
106
|
+
- `-q, --queue <queue>` - Target queue
|
|
107
|
+
- `-i, --input <inputs...>` - Template inputs as key=value pairs
|
|
108
|
+
- `--dry-run` - Validate without deploying
|
|
109
|
+
- `--json` - Output in JSON format
|
|
110
|
+
|
|
111
|
+
### `devteam templates [search]`
|
|
112
|
+
|
|
113
|
+
Browse and search the template marketplace.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
devteam templates # List all templates
|
|
117
|
+
devteam templates "contract" # Search by keyword
|
|
118
|
+
devteam templates --industry legal # Filter by industry
|
|
119
|
+
devteam templates --category analysis # Filter by category
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Options:**
|
|
123
|
+
- `--industry <industry>` - Filter by industry
|
|
124
|
+
- `--category <category>` - Filter by category
|
|
125
|
+
- `--json` - Output in JSON format
|
|
126
|
+
|
|
127
|
+
### `devteam status`
|
|
128
|
+
|
|
129
|
+
Display a dashboard-style overview of the cluster including workers, queues, and task statistics.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
devteam status # One-time snapshot
|
|
133
|
+
devteam status -w # Watch mode (refresh every 5s)
|
|
134
|
+
devteam status --json # JSON output for scripting
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Options:**
|
|
138
|
+
- `-w, --watch` - Watch mode with auto-refresh
|
|
139
|
+
- `--json` - Output in JSON format
|
|
140
|
+
|
|
141
|
+
### `devteam tasks`
|
|
142
|
+
|
|
143
|
+
List recent tasks with status, priority, and timing information.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
devteam tasks # Show last 20 tasks
|
|
147
|
+
devteam tasks -s running # Filter by status
|
|
148
|
+
devteam tasks -q gpu-queue -l 50 # Filter by queue, show 50
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Options:**
|
|
152
|
+
- `-s, --status <status>` - Filter by status (pending, running, completed, failed)
|
|
153
|
+
- `-q, --queue <queue>` - Filter by queue
|
|
154
|
+
- `-l, --limit <n>` - Number of tasks to show (default: 20)
|
|
155
|
+
- `--json` - Output in JSON format
|
|
156
|
+
|
|
157
|
+
### `devteam logs <task-id>`
|
|
158
|
+
|
|
159
|
+
Stream live agent output via WebSocket connection. Shows historical output for completed tasks.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
devteam logs abc123def # View task output
|
|
163
|
+
devteam logs abc123def -f # Follow mode
|
|
164
|
+
devteam logs abc123def --timestamps # Show timestamps
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Options:**
|
|
168
|
+
- `-f, --follow` - Follow mode: keep streaming
|
|
169
|
+
- `--timestamps` - Show timestamps for each line
|
|
170
|
+
- `--json` - Output raw JSON messages
|
|
171
|
+
|
|
172
|
+
### `devteam approve`
|
|
173
|
+
|
|
174
|
+
Interactive Human-in-the-Loop (HITL) approval queue. Review, approve, or reject pending agent decisions.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
devteam approve # Interactive review
|
|
178
|
+
devteam approve --auto # Auto-approve all pending
|
|
179
|
+
devteam approve --json # JSON output
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Each approval shows:
|
|
183
|
+
- Risk level (LOW / MEDIUM / HIGH / CRITICAL)
|
|
184
|
+
- Confidence score
|
|
185
|
+
- Waiting time
|
|
186
|
+
- Detailed context
|
|
187
|
+
|
|
188
|
+
Actions: **Approve (a)** | **Reject (r)** | **View details (v)** | **Skip (s)** | **Quit (q)**
|
|
189
|
+
|
|
190
|
+
### `devteam workers`
|
|
191
|
+
|
|
192
|
+
Show connected worker nodes with CPU, memory, GPU, and task queue information.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
devteam workers # Detailed view
|
|
196
|
+
devteam workers --json # JSON output
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### `devteam config`
|
|
200
|
+
|
|
201
|
+
View and manage CLI configuration.
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
devteam config # Show all config
|
|
205
|
+
devteam config --set apiUrl=https://... # Set a value
|
|
206
|
+
devteam config --get apiKey # Get a value
|
|
207
|
+
devteam config --reset # Reset to defaults
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Configuration
|
|
211
|
+
|
|
212
|
+
### Global Config
|
|
213
|
+
|
|
214
|
+
Stored in the system config directory (managed by the `conf` library). Contains:
|
|
215
|
+
|
|
216
|
+
| Key | Default | Description |
|
|
217
|
+
|-----|---------|-------------|
|
|
218
|
+
| `apiUrl` | `https://devteam.marsala.dev` | API server URL |
|
|
219
|
+
| `wsUrl` | `wss://devteam.marsala.dev/ws` | WebSocket URL |
|
|
220
|
+
| `apiKey` | (empty) | Authentication key |
|
|
221
|
+
| `defaultWorker` | (empty) | Preferred worker node |
|
|
222
|
+
| `outputFormat` | `table` | Output format (table, json, minimal) |
|
|
223
|
+
| `autoApprove` | `false` | Auto-approve HITL items |
|
|
224
|
+
|
|
225
|
+
### Project Config
|
|
226
|
+
|
|
227
|
+
Created by `devteam init` as `devteam.config.json` in the project root:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"name": "my-project",
|
|
232
|
+
"id": "proj_abc123",
|
|
233
|
+
"apiUrl": "https://devteam.marsala.dev",
|
|
234
|
+
"wsUrl": "wss://devteam.marsala.dev/ws",
|
|
235
|
+
"defaultQueue": "general-queue",
|
|
236
|
+
"workers": ["asus-gpu", "surface-book"],
|
|
237
|
+
"templates": [],
|
|
238
|
+
"environment": {}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Project config overrides global config for `apiUrl` and `wsUrl`.
|
|
243
|
+
|
|
244
|
+
## API Endpoints
|
|
245
|
+
|
|
246
|
+
The CLI communicates with the DevTeam Orchestrator API:
|
|
247
|
+
|
|
248
|
+
| Method | Endpoint | Command |
|
|
249
|
+
|--------|----------|---------|
|
|
250
|
+
| GET | `/api/health` | `login` (verification) |
|
|
251
|
+
| GET | `/api/status` | `status` |
|
|
252
|
+
| POST | `/api/tasks` | `run` |
|
|
253
|
+
| GET | `/api/tasks` | `tasks` |
|
|
254
|
+
| GET | `/api/tasks/:id` | `logs` |
|
|
255
|
+
| POST | `/api/tasks/:id/cancel` | (cancel) |
|
|
256
|
+
| POST | `/api/plans` | `plan` |
|
|
257
|
+
| POST | `/api/plans/:id/execute` | `plan -x` |
|
|
258
|
+
| GET | `/api/templates` | `templates` |
|
|
259
|
+
| GET | `/api/templates/:id` | `deploy` |
|
|
260
|
+
| POST | `/api/deploy` | `deploy` |
|
|
261
|
+
| GET | `/api/workers` | `workers` |
|
|
262
|
+
| GET | `/api/approvals` | `approve` |
|
|
263
|
+
| POST | `/api/approvals` | `approve` (submit) |
|
|
264
|
+
| WS | `/ws/tasks/:id/logs` | `logs` (streaming) |
|
|
265
|
+
| WS | `/ws/events` | `status -w` |
|
|
266
|
+
|
|
267
|
+
## Development
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Install dependencies
|
|
271
|
+
npm install
|
|
272
|
+
|
|
273
|
+
# Run in development mode
|
|
274
|
+
npm run dev -- status
|
|
275
|
+
npm run dev -- run "test task"
|
|
276
|
+
|
|
277
|
+
# Build TypeScript
|
|
278
|
+
npm run build
|
|
279
|
+
|
|
280
|
+
# Run built version
|
|
281
|
+
npm start -- status
|
|
282
|
+
|
|
283
|
+
# Link globally
|
|
284
|
+
npm link
|
|
285
|
+
devteam status
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Architecture
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
src/
|
|
292
|
+
cli.ts Main entry point (Commander.js program)
|
|
293
|
+
api-client.ts HTTP/WS client wrapper
|
|
294
|
+
config.ts Configuration management (conf library)
|
|
295
|
+
utils.ts Formatters, table rendering, colors
|
|
296
|
+
commands/
|
|
297
|
+
init.ts Project initialization
|
|
298
|
+
login.ts Authentication
|
|
299
|
+
run.ts Quick task execution
|
|
300
|
+
plan.ts Execution planning with DAG
|
|
301
|
+
deploy.ts Template deployment
|
|
302
|
+
templates.ts Template marketplace
|
|
303
|
+
status.ts Cluster dashboard
|
|
304
|
+
tasks.ts Task listing
|
|
305
|
+
logs.ts Live log streaming
|
|
306
|
+
approve.ts HITL approval queue
|
|
307
|
+
workers.ts Worker node display
|
|
308
|
+
config-cmd.ts Config management
|
|
309
|
+
```
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import WebSocket from 'ws';
|
|
2
|
+
export interface ApiResponse<T = unknown> {
|
|
3
|
+
ok: boolean;
|
|
4
|
+
status: number;
|
|
5
|
+
data: T;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TaskPayload {
|
|
9
|
+
prompt: string;
|
|
10
|
+
queue?: string;
|
|
11
|
+
priority?: string;
|
|
12
|
+
worker?: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface PlanPayload {
|
|
17
|
+
goal: string;
|
|
18
|
+
constraints?: string[];
|
|
19
|
+
maxSteps?: number;
|
|
20
|
+
budget?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface DeployPayload {
|
|
23
|
+
templateId: string;
|
|
24
|
+
inputs: Record<string, unknown>;
|
|
25
|
+
queue?: string;
|
|
26
|
+
dryRun?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ApprovalAction {
|
|
29
|
+
taskId: string;
|
|
30
|
+
action: 'approve' | 'reject';
|
|
31
|
+
comment?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ClusterStatus {
|
|
34
|
+
version: string;
|
|
35
|
+
uptime: number;
|
|
36
|
+
workers: WorkerInfo[];
|
|
37
|
+
queues: QueueInfo[];
|
|
38
|
+
tasks: TaskSummary;
|
|
39
|
+
}
|
|
40
|
+
export interface WorkerInfo {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
status: string;
|
|
44
|
+
ip: string;
|
|
45
|
+
cpu: number;
|
|
46
|
+
memory: number;
|
|
47
|
+
memoryTotal: number;
|
|
48
|
+
gpu?: string;
|
|
49
|
+
queues: string[];
|
|
50
|
+
currentTask?: string;
|
|
51
|
+
lastSeen: string;
|
|
52
|
+
taskQueue: string;
|
|
53
|
+
}
|
|
54
|
+
export interface QueueInfo {
|
|
55
|
+
name: string;
|
|
56
|
+
pending: number;
|
|
57
|
+
running: number;
|
|
58
|
+
workers: number;
|
|
59
|
+
}
|
|
60
|
+
export interface TaskSummary {
|
|
61
|
+
completed: number;
|
|
62
|
+
running: number;
|
|
63
|
+
failed: number;
|
|
64
|
+
pending: number;
|
|
65
|
+
total: number;
|
|
66
|
+
}
|
|
67
|
+
export interface TaskInfo {
|
|
68
|
+
id: string;
|
|
69
|
+
prompt: string;
|
|
70
|
+
status: string;
|
|
71
|
+
priority: string;
|
|
72
|
+
queue: string;
|
|
73
|
+
worker?: string;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
completedAt?: string;
|
|
77
|
+
duration?: number;
|
|
78
|
+
result?: unknown;
|
|
79
|
+
error?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface TemplateInfo {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
description: string;
|
|
85
|
+
industry: string;
|
|
86
|
+
category: string;
|
|
87
|
+
cost: string;
|
|
88
|
+
rating: number;
|
|
89
|
+
inputs: TemplateInput[];
|
|
90
|
+
author: string;
|
|
91
|
+
version: string;
|
|
92
|
+
downloads: number;
|
|
93
|
+
}
|
|
94
|
+
export interface TemplateInput {
|
|
95
|
+
name: string;
|
|
96
|
+
type: string;
|
|
97
|
+
description: string;
|
|
98
|
+
required: boolean;
|
|
99
|
+
default?: unknown;
|
|
100
|
+
options?: string[];
|
|
101
|
+
}
|
|
102
|
+
export interface ApprovalItem {
|
|
103
|
+
id: string;
|
|
104
|
+
taskId: string;
|
|
105
|
+
type: string;
|
|
106
|
+
title: string;
|
|
107
|
+
description: string;
|
|
108
|
+
risk: string;
|
|
109
|
+
confidence: number;
|
|
110
|
+
details: Record<string, unknown>;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
expiresAt?: string;
|
|
113
|
+
}
|
|
114
|
+
export declare class ApiClient {
|
|
115
|
+
private baseUrl;
|
|
116
|
+
private wsUrl;
|
|
117
|
+
private apiKey;
|
|
118
|
+
constructor();
|
|
119
|
+
private ensureAuth;
|
|
120
|
+
private headers;
|
|
121
|
+
private request;
|
|
122
|
+
getStatus(): Promise<ApiResponse<ClusterStatus>>;
|
|
123
|
+
healthCheck(): Promise<ApiResponse<{
|
|
124
|
+
status: string;
|
|
125
|
+
}>>;
|
|
126
|
+
createTask(payload: TaskPayload): Promise<ApiResponse<TaskInfo>>;
|
|
127
|
+
listTasks(options?: {
|
|
128
|
+
status?: string;
|
|
129
|
+
limit?: number;
|
|
130
|
+
offset?: number;
|
|
131
|
+
queue?: string;
|
|
132
|
+
}): Promise<ApiResponse<{
|
|
133
|
+
tasks: TaskInfo[];
|
|
134
|
+
total: number;
|
|
135
|
+
}>>;
|
|
136
|
+
getTask(taskId: string): Promise<ApiResponse<TaskInfo>>;
|
|
137
|
+
cancelTask(taskId: string): Promise<ApiResponse<TaskInfo>>;
|
|
138
|
+
createPlan(payload: PlanPayload): Promise<ApiResponse<{
|
|
139
|
+
id: string;
|
|
140
|
+
goal: string;
|
|
141
|
+
steps: Array<{
|
|
142
|
+
id: string;
|
|
143
|
+
name: string;
|
|
144
|
+
description: string;
|
|
145
|
+
dependencies: string[];
|
|
146
|
+
estimatedTime: string;
|
|
147
|
+
queue: string;
|
|
148
|
+
status: string;
|
|
149
|
+
}>;
|
|
150
|
+
estimatedTotal: string;
|
|
151
|
+
estimatedCost: number;
|
|
152
|
+
}>>;
|
|
153
|
+
executePlan(planId: string): Promise<ApiResponse<{
|
|
154
|
+
taskIds: string[];
|
|
155
|
+
}>>;
|
|
156
|
+
listTemplates(options?: {
|
|
157
|
+
search?: string;
|
|
158
|
+
industry?: string;
|
|
159
|
+
category?: string;
|
|
160
|
+
}): Promise<ApiResponse<{
|
|
161
|
+
templates: TemplateInfo[];
|
|
162
|
+
total: number;
|
|
163
|
+
}>>;
|
|
164
|
+
getTemplate(templateId: string): Promise<ApiResponse<TemplateInfo>>;
|
|
165
|
+
deployTemplate(payload: DeployPayload): Promise<ApiResponse<{
|
|
166
|
+
taskId: string;
|
|
167
|
+
status: string;
|
|
168
|
+
}>>;
|
|
169
|
+
listWorkers(): Promise<ApiResponse<{
|
|
170
|
+
workers: WorkerInfo[];
|
|
171
|
+
}>>;
|
|
172
|
+
listApprovals(): Promise<ApiResponse<{
|
|
173
|
+
approvals: ApprovalItem[];
|
|
174
|
+
}>>;
|
|
175
|
+
submitApproval(action: ApprovalAction): Promise<ApiResponse<{
|
|
176
|
+
status: string;
|
|
177
|
+
}>>;
|
|
178
|
+
streamTaskLogs(taskId: string, callbacks: {
|
|
179
|
+
onMessage: (data: LogMessage) => void;
|
|
180
|
+
onError: (err: Error) => void;
|
|
181
|
+
onClose: () => void;
|
|
182
|
+
}): WebSocket;
|
|
183
|
+
streamAllEvents(callbacks: {
|
|
184
|
+
onMessage: (data: unknown) => void;
|
|
185
|
+
onError: (err: Error) => void;
|
|
186
|
+
onClose: () => void;
|
|
187
|
+
}): WebSocket;
|
|
188
|
+
}
|
|
189
|
+
export interface LogMessage {
|
|
190
|
+
type: 'output' | 'error' | 'status' | 'progress' | 'complete';
|
|
191
|
+
timestamp: string;
|
|
192
|
+
content: string;
|
|
193
|
+
level?: string;
|
|
194
|
+
progress?: number;
|
|
195
|
+
total?: number;
|
|
196
|
+
metadata?: Record<string, unknown>;
|
|
197
|
+
}
|
|
198
|
+
export declare const apiClient: ApiClient;
|
|
199
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,IAAI,CAAC;AAE3B,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,OA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