@rlarua/agentteams-cli 0.0.1

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 (50) hide show
  1. package/README.md +428 -0
  2. package/dist/commands/agentConfig.d.ts +4 -0
  3. package/dist/commands/agentConfig.d.ts.map +1 -0
  4. package/dist/commands/agentConfig.js +34 -0
  5. package/dist/commands/agentConfig.js.map +1 -0
  6. package/dist/commands/convention.d.ts +4 -0
  7. package/dist/commands/convention.d.ts.map +1 -0
  8. package/dist/commands/convention.js +106 -0
  9. package/dist/commands/convention.js.map +1 -0
  10. package/dist/commands/dependency.d.ts +4 -0
  11. package/dist/commands/dependency.d.ts.map +1 -0
  12. package/dist/commands/dependency.js +34 -0
  13. package/dist/commands/dependency.js.map +1 -0
  14. package/dist/commands/index.d.ts +2 -0
  15. package/dist/commands/index.d.ts.map +1 -0
  16. package/dist/commands/index.js +295 -0
  17. package/dist/commands/index.js.map +1 -0
  18. package/dist/commands/init.d.ts +16 -0
  19. package/dist/commands/init.d.ts.map +1 -0
  20. package/dist/commands/init.js +77 -0
  21. package/dist/commands/init.js.map +1 -0
  22. package/dist/index.d.ts +3 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +206 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/types/index.d.ts +236 -0
  27. package/dist/types/index.d.ts.map +1 -0
  28. package/dist/types/index.js +6 -0
  29. package/dist/types/index.js.map +1 -0
  30. package/dist/utils/authServer.d.ts +22 -0
  31. package/dist/utils/authServer.d.ts.map +1 -0
  32. package/dist/utils/authServer.js +167 -0
  33. package/dist/utils/authServer.js.map +1 -0
  34. package/dist/utils/config.d.ts +31 -0
  35. package/dist/utils/config.d.ts.map +1 -0
  36. package/dist/utils/config.js +113 -0
  37. package/dist/utils/config.js.map +1 -0
  38. package/dist/utils/env.d.ts +7 -0
  39. package/dist/utils/env.d.ts.map +1 -0
  40. package/dist/utils/env.js +19 -0
  41. package/dist/utils/env.js.map +1 -0
  42. package/dist/utils/errors.d.ts +2 -0
  43. package/dist/utils/errors.d.ts.map +1 -0
  44. package/dist/utils/errors.js +33 -0
  45. package/dist/utils/errors.js.map +1 -0
  46. package/dist/utils/formatter.d.ts +2 -0
  47. package/dist/utils/formatter.d.ts.map +1 -0
  48. package/dist/utils/formatter.js +45 -0
  49. package/dist/utils/formatter.js.map +1 -0
  50. package/package.json +39 -0
package/README.md ADDED
@@ -0,0 +1,428 @@
1
+ # @rlarua/agentteams-cli
2
+
3
+ Command-line interface for AgentTeams API. Manage agent configurations, conventions, tasks, and status reports from your terminal.
4
+
5
+ ## Quick Start
6
+
7
+ ### 1. Install
8
+
9
+ ```bash
10
+ npm install -g @rlarua/agentteams-cli
11
+ ```
12
+
13
+ Or use directly with npx:
14
+
15
+ ```bash
16
+ npx @rlarua/agentteams-cli init
17
+ ```
18
+
19
+ ### 2. Initialize
20
+
21
+ Run `init` to authenticate and set up your project:
22
+
23
+ ```bash
24
+ agentteams init
25
+ ```
26
+
27
+ This command:
28
+ - Opens your browser for OAuth authentication
29
+ - Creates `.agentteams/config.json` with your credentials
30
+ - Downloads project conventions to `.agentteams/convention.md`
31
+ - Automatically detects your AI environment (Claude Code, opencode, codex)
32
+
33
+ **What gets created:**
34
+
35
+ ```
36
+ your-project/
37
+ ├── .agentteams/
38
+ │ ├── config.json # API credentials (gitignored)
39
+ │ └── convention.md # Project conventions
40
+ ```
41
+
42
+ **Important:** Add `.agentteams` to your `.gitignore` to protect API keys:
43
+
44
+ ```gitignore
45
+ # AgentTeams CLI config (contains API keys)
46
+ .agentteams
47
+ ```
48
+
49
+ ### 3. Use conventions
50
+
51
+ After initialization, conventions are automatically available to your AI agent. The CLI detects your environment and provides setup instructions.
52
+
53
+ **Manual setup (if needed):**
54
+
55
+ ```bash
56
+ # View downloaded conventions
57
+ agentteams convention show
58
+
59
+ # Append reference to CLAUDE.md (for Claude Code)
60
+ agentteams convention append
61
+
62
+ # Update conventions from server
63
+ agentteams convention update
64
+ ```
65
+
66
+ ## Commands
67
+
68
+ ### `init`
69
+
70
+ Initialize AgentTeams CLI with OAuth authentication.
71
+
72
+ ```bash
73
+ agentteams init
74
+ ```
75
+
76
+ **What it does:**
77
+ 1. Starts local OAuth server
78
+ 2. Opens browser for authentication
79
+ 3. Saves config to `.agentteams/config.json`
80
+ 4. Downloads conventions to `.agentteams/convention.md`
81
+
82
+ **SSH/Remote environments:**
83
+ If browser can't open automatically, copy the displayed URL and open it manually.
84
+
85
+ ### `convention`
86
+
87
+ Manage project conventions.
88
+
89
+ ```bash
90
+ # Show current conventions
91
+ agentteams convention show
92
+
93
+ # Append reference to CLAUDE.md
94
+ agentteams convention append
95
+
96
+ # Update conventions from server
97
+ agentteams convention update
98
+ ```
99
+
100
+ **`convention show`**
101
+ - Displays content of `.agentteams/convention.md`
102
+ - Requires prior `init` or `convention update`
103
+
104
+ **`convention append`**
105
+ - Adds convention reference to `CLAUDE.md`
106
+ - Creates backup at `CLAUDE.md.backup`
107
+ - Prompts for confirmation before modifying
108
+
109
+ **`convention update`**
110
+ - Downloads latest conventions from server
111
+ - Overwrites `.agentteams/convention.md`
112
+ - Merges all project conventions into single file
113
+
114
+ ### `agent-config`
115
+
116
+ Manage agent configurations.
117
+
118
+ ```bash
119
+ # List all agent configs
120
+ agentteams agent-config list
121
+ agentteams agent-config list --format text
122
+
123
+ # Get specific agent config
124
+ agentteams agent-config get --id <config-id>
125
+
126
+ # Delete agent config
127
+ agentteams agent-config delete --id <config-id>
128
+ ```
129
+
130
+ ### `status`
131
+
132
+ Manage agent status reports.
133
+
134
+ ```bash
135
+ # Report agent status
136
+ agentteams status report \
137
+ --agent-name "my-agent" \
138
+ --status "IN_PROGRESS" \
139
+ --project-id 1
140
+
141
+ # List all statuses
142
+ agentteams status list
143
+ agentteams status list --format text
144
+
145
+ # Get specific status
146
+ agentteams status get --id <status-id>
147
+
148
+ # Update status
149
+ agentteams status update --id <status-id> --status "COMPLETED"
150
+
151
+ # Delete status
152
+ agentteams status delete --id <status-id>
153
+ ```
154
+
155
+ **Status values:** `IDLE`, `IN_PROGRESS`, `COMPLETED`, `ERROR`
156
+
157
+ ### `task`
158
+
159
+ Manage tasks.
160
+
161
+ ```bash
162
+ # List all tasks
163
+ agentteams task list
164
+ agentteams task list --format text
165
+
166
+ # Get task by ID
167
+ agentteams task get --id 1
168
+
169
+ # Create task
170
+ agentteams task create \
171
+ --title "Implement feature X" \
172
+ --description "Details here" \
173
+ --status "PENDING" \
174
+ --priority "HIGH" \
175
+ --plan-id 1
176
+
177
+ # Update task
178
+ agentteams task update \
179
+ --id 1 \
180
+ --status "IN_PROGRESS"
181
+
182
+ # Assign task to agent
183
+ agentteams task assign --id 1 --agent "agent-name"
184
+
185
+ # Delete task
186
+ agentteams task delete --id 1
187
+ ```
188
+
189
+ **Task statuses:** `PENDING`, `IN_PROGRESS`, `DONE`, `CANCELLED`
190
+ **Priorities:** `LOW`, `MEDIUM`, `HIGH`
191
+
192
+ ### `comment`
193
+
194
+ Manage task comments.
195
+
196
+ ```bash
197
+ # Create comment
198
+ agentteams comment create \
199
+ --task-id 1 \
200
+ --content "Great work!" \
201
+ --author-id 1
202
+ ```
203
+
204
+ ### `report`
205
+
206
+ Create completion reports.
207
+
208
+ ```bash
209
+ # Create basic report
210
+ agentteams report create \
211
+ --task-id 1 \
212
+ --summary "Task completed successfully" \
213
+ --agent-id 1
214
+
215
+ # Create report with details
216
+ agentteams report create \
217
+ --task-id 1 \
218
+ --summary "Feature implemented" \
219
+ --agent-id 1 \
220
+ --details '{"hours": 2, "files_changed": 5}'
221
+ ```
222
+
223
+ ### `config`
224
+
225
+ View current configuration.
226
+
227
+ ```bash
228
+ # Show active config
229
+ agentteams config whoami
230
+ agentteams config whoami --format text
231
+ ```
232
+
233
+ Displays merged configuration from all sources (see Configuration Priority below).
234
+
235
+ ## Configuration
236
+
237
+ ### Configuration Priority
238
+
239
+ The CLI merges configuration from multiple sources with the following priority (highest to lowest):
240
+
241
+ 1. **CLI options** (command-line arguments)
242
+ 2. **Environment variables** (`AGENTTEAMS_*`)
243
+ 3. **Project config** (`.agentteams/config.json` in current or parent directory)
244
+ 4. **Global config** (`~/.agentteams/config.json`)
245
+
246
+ ### Configuration File Structure
247
+
248
+ `.agentteams/config.json`:
249
+
250
+ ```json
251
+ {
252
+ "teamId": "team_xxx",
253
+ "projectId": "proj_xxx",
254
+ "agentName": "my-agent",
255
+ "apiKey": "key_xxx",
256
+ "apiUrl": "http://localhost:3001"
257
+ }
258
+ ```
259
+
260
+ **Required fields:**
261
+ - `teamId`: Team identifier
262
+ - `projectId`: Project identifier
263
+ - `agentName`: Agent name
264
+ - `apiKey`: API authentication key
265
+ - `apiUrl`: API server URL
266
+
267
+ ### Environment Variables
268
+
269
+ Override config file values with environment variables:
270
+
271
+ ```bash
272
+ export AGENTTEAMS_API_KEY="key_your_api_key_here"
273
+ export AGENTTEAMS_API_URL="http://localhost:3001"
274
+ export AGENTTEAMS_TEAM_ID="team_xxx"
275
+ export AGENTTEAMS_PROJECT_ID="proj_xxx"
276
+ export AGENTTEAMS_AGENT_NAME="my-agent"
277
+ ```
278
+
279
+ **Use case:** CI/CD pipelines, temporary overrides, multi-environment setups.
280
+
281
+ ### Project vs Global Config
282
+
283
+ **Project config** (`.agentteams/config.json`):
284
+ - Stored in project directory
285
+ - Shared with team (if not gitignored)
286
+ - Automatically found by walking up directory tree
287
+
288
+ **Global config** (`~/.agentteams/config.json`):
289
+ - Stored in home directory
290
+ - User-specific defaults
291
+ - Lowest priority
292
+
293
+ **Recommendation:** Use project config for team projects, global config for personal defaults.
294
+
295
+ ## Output Formats
296
+
297
+ All commands support `--format` option:
298
+
299
+ ```bash
300
+ # JSON output (default, machine-readable)
301
+ agentteams task list --format json
302
+
303
+ # Text output (human-friendly)
304
+ agentteams task list --format text
305
+ ```
306
+
307
+ **JSON format:**
308
+ - Structured data
309
+ - Easy to parse with `jq` or scripts
310
+ - Default for most commands
311
+
312
+ **Text format:**
313
+ - Human-readable tables
314
+ - Better for terminal viewing
315
+ - Formatted with colors (if supported)
316
+
317
+ ## Error Handling
318
+
319
+ The CLI provides clear error messages:
320
+
321
+ | Error | Meaning | Solution |
322
+ |-------|---------|----------|
323
+ | **401 Unauthorized** | Invalid API key | Check `apiKey` in config or `AGENTTEAMS_API_KEY` |
324
+ | **403 Forbidden** | Cross-project access denied | Verify `projectId` matches resource |
325
+ | **404 Not Found** | Resource doesn't exist | Check ID or create resource first |
326
+ | **Network errors** | Can't connect to server | Verify `apiUrl` and server status |
327
+ | **Config not found** | No config file or env vars | Run `agentteams init` first |
328
+
329
+ ## .gitignore Setup
330
+
331
+ **Critical:** Always add `.agentteams` to `.gitignore` to prevent committing API keys:
332
+
333
+ ```gitignore
334
+ # AgentTeams CLI config (contains API keys)
335
+ .agentteams
336
+ ```
337
+
338
+ **What to commit:**
339
+ - Convention files (if you want to share them)
340
+ - Documentation referencing conventions
341
+
342
+ **What NOT to commit:**
343
+ - `.agentteams/config.json` (contains API keys)
344
+ - Any files with sensitive credentials
345
+
346
+ ## Development
347
+
348
+ ### Local Development
349
+
350
+ ```bash
351
+ # Clone repository
352
+ git clone https://github.com/your-org/agentteams.git
353
+ cd agentteams/cli
354
+
355
+ # Install dependencies
356
+ npm install
357
+
358
+ # Build
359
+ npm run build
360
+
361
+ # Run locally
362
+ node dist/index.js init
363
+
364
+ # Link for global testing
365
+ npm link
366
+ agentteams init
367
+ ```
368
+
369
+ ### Run Tests
370
+
371
+ ```bash
372
+ npm test
373
+ ```
374
+
375
+ ### Build
376
+
377
+ ```bash
378
+ npm run build
379
+ ```
380
+
381
+ Output: `dist/` directory with compiled JavaScript.
382
+
383
+ ## Publishing
384
+
385
+ To publish a new version to npm:
386
+
387
+ 1. **Update version** in package.json:
388
+ ```bash
389
+ npm version patch # 1.0.0 -> 1.0.1 (bug fixes)
390
+ npm version minor # 1.0.0 -> 1.1.0 (new features)
391
+ npm version major # 1.0.0 -> 2.0.0 (breaking changes)
392
+ ```
393
+
394
+ 2. **Publish to npm**:
395
+ ```bash
396
+ npm publish --access public
397
+ ```
398
+
399
+ Note: `--access public` is required for scoped packages (@rlarua/agentteams-cli)
400
+
401
+ 3. **Push git tag**:
402
+ ```bash
403
+ git push --follow-tags
404
+ ```
405
+
406
+ ### First-time setup
407
+
408
+ If publishing for the first time:
409
+
410
+ ```bash
411
+ # Login to npm
412
+ npm login
413
+
414
+ # Verify login
415
+ npm whoami
416
+ ```
417
+
418
+ ### Publishing checklist
419
+
420
+ - [ ] Tests pass: `npm test`
421
+ - [ ] Build succeeds: `npm run build`
422
+ - [ ] Version updated: `npm version [patch|minor|major]`
423
+ - [ ] Publish: `npm publish --access public`
424
+ - [ ] Git tag pushed: `git push --follow-tags`
425
+
426
+ ## License
427
+
428
+ MIT
@@ -0,0 +1,4 @@
1
+ export declare function agentConfigList(): Promise<any>;
2
+ export declare function agentConfigGet(id: string): Promise<any>;
3
+ export declare function agentConfigDelete(id: string): Promise<any>;
4
+ //# sourceMappingURL=agentConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentConfig.d.ts","sourceRoot":"","sources":["../../src/commands/agentConfig.ts"],"names":[],"mappings":"AAoBA,wBAAsB,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,CAOpD;AAED,wBAAsB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAO7D;AAED,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAUhE"}
@@ -0,0 +1,34 @@
1
+ import axios from 'axios';
2
+ import { loadConfig } from '../utils/config.js';
3
+ function getConfigOrThrow() {
4
+ const config = loadConfig();
5
+ if (!config) {
6
+ throw new Error('Configuration not found. Run "agentteams init" first or set AGENTTEAMS_* environment variables.');
7
+ }
8
+ return config;
9
+ }
10
+ function getHeaders(apiKey) {
11
+ return {
12
+ 'X-API-Key': apiKey,
13
+ 'Content-Type': 'application/json',
14
+ };
15
+ }
16
+ export async function agentConfigList() {
17
+ const config = getConfigOrThrow();
18
+ const response = await axios.get(`${config.apiUrl}/api/projects/${config.projectId}/agent-configs`, { headers: getHeaders(config.apiKey) });
19
+ return response.data;
20
+ }
21
+ export async function agentConfigGet(id) {
22
+ const config = getConfigOrThrow();
23
+ const response = await axios.get(`${config.apiUrl}/api/projects/${config.projectId}/agent-configs/${id}`, { headers: getHeaders(config.apiKey) });
24
+ return response.data;
25
+ }
26
+ export async function agentConfigDelete(id) {
27
+ const config = getConfigOrThrow();
28
+ const response = await axios.delete(`${config.apiUrl}/api/projects/${config.projectId}/agent-configs/${id}`, { headers: getHeaders(config.apiKey) });
29
+ if (response.status === 204) {
30
+ return { message: `Agent config ${id} deleted successfully.` };
31
+ }
32
+ return response.data;
33
+ }
34
+ //# sourceMappingURL=agentConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentConfig.js","sourceRoot":"","sources":["../../src/commands/agentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,SAAS,gBAAgB;IACvB,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,MAAc;IAChC,OAAO;QACL,WAAW,EAAE,MAAM;QACnB,cAAc,EAAE,kBAAkB;KACnC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAC9B,GAAG,MAAM,CAAC,MAAM,iBAAiB,MAAM,CAAC,SAAS,gBAAgB,EACjE,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACvC,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAU;IAC7C,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAC9B,GAAG,MAAM,CAAC,MAAM,iBAAiB,MAAM,CAAC,SAAS,kBAAkB,EAAE,EAAE,EACvE,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACvC,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EAAU;IAChD,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CACjC,GAAG,MAAM,CAAC,MAAM,iBAAiB,MAAM,CAAC,SAAS,kBAAkB,EAAE,EAAE,EACvE,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACvC,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;IACjE,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare function conventionShow(): Promise<string>;
2
+ export declare function conventionAppend(): Promise<string>;
3
+ export declare function conventionUpdate(): Promise<string>;
4
+ //# sourceMappingURL=convention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convention.d.ts","sourceRoot":"","sources":["../../src/commands/convention.ts"],"names":[],"mappings":"AAgCA,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAgBtD;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAmDxD;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAoDxD"}
@@ -0,0 +1,106 @@
1
+ import { existsSync, readFileSync, writeFileSync, copyFileSync } from "node:fs";
2
+ import { join, resolve } from "node:path";
3
+ import { createInterface } from "node:readline";
4
+ import axios from "axios";
5
+ import { loadConfig, findProjectConfig } from "../utils/config.js";
6
+ const CONVENTION_DIR = ".agentteams";
7
+ const CONVENTION_FILE = "convention.md";
8
+ const CLAUDE_MD = "CLAUDE.md";
9
+ const CLAUDE_MD_BACKUP = "CLAUDE.md.backup";
10
+ function findProjectRoot() {
11
+ const configPath = findProjectConfig(process.cwd());
12
+ if (!configPath)
13
+ return null;
14
+ // configPath = /path/.agentteams/config.json → resolve up 2 levels to project root
15
+ return resolve(configPath, "..", "..");
16
+ }
17
+ function confirm(message) {
18
+ const rl = createInterface({
19
+ input: process.stdin,
20
+ output: process.stdout,
21
+ });
22
+ return new Promise((resolve) => {
23
+ rl.question(`${message} (y/N): `, (answer) => {
24
+ rl.close();
25
+ resolve(answer.trim().toLowerCase() === "y");
26
+ });
27
+ });
28
+ }
29
+ export async function conventionShow() {
30
+ const projectRoot = findProjectRoot();
31
+ if (!projectRoot) {
32
+ throw new Error("No .agentteams directory found. Run 'agentteams init' first.");
33
+ }
34
+ const conventionPath = join(projectRoot, CONVENTION_DIR, CONVENTION_FILE);
35
+ if (!existsSync(conventionPath)) {
36
+ throw new Error(`Convention file not found: ${conventionPath}\nRun 'agentteams convention update' to download it.`);
37
+ }
38
+ return readFileSync(conventionPath, "utf-8");
39
+ }
40
+ export async function conventionAppend() {
41
+ const projectRoot = findProjectRoot();
42
+ if (!projectRoot) {
43
+ throw new Error("No .agentteams directory found. Run 'agentteams init' first.");
44
+ }
45
+ const conventionPath = join(projectRoot, CONVENTION_DIR, CONVENTION_FILE);
46
+ if (!existsSync(conventionPath)) {
47
+ throw new Error(`Convention file not found: ${conventionPath}\nRun 'agentteams convention update' first.`);
48
+ }
49
+ const claudeMdPath = join(projectRoot, CLAUDE_MD);
50
+ const backupPath = join(projectRoot, CLAUDE_MD_BACKUP);
51
+ const conventionRef = `\n\n<!-- AgentTeams Convention -->\nSee .agentteams/convention.md for project conventions.\n`;
52
+ if (existsSync(claudeMdPath)) {
53
+ const existingContent = readFileSync(claudeMdPath, "utf-8");
54
+ if (existingContent.includes("<!-- AgentTeams Convention -->")) {
55
+ return "Convention reference already exists in CLAUDE.md. No changes made.";
56
+ }
57
+ }
58
+ const confirmed = await confirm(`This will modify ${CLAUDE_MD} and create a backup at ${CLAUDE_MD_BACKUP}. Continue?`);
59
+ if (!confirmed) {
60
+ return "Operation cancelled by user.";
61
+ }
62
+ if (existsSync(claudeMdPath)) {
63
+ copyFileSync(claudeMdPath, backupPath);
64
+ const content = readFileSync(claudeMdPath, "utf-8");
65
+ writeFileSync(claudeMdPath, content + conventionRef, "utf-8");
66
+ }
67
+ else {
68
+ writeFileSync(claudeMdPath, `# Project Conventions${conventionRef}`, "utf-8");
69
+ }
70
+ const backupMsg = existsSync(backupPath)
71
+ ? `Backup created: ${CLAUDE_MD_BACKUP}`
72
+ : "New CLAUDE.md created (no previous file to backup).";
73
+ return `Convention reference appended to ${CLAUDE_MD}.\n${backupMsg}`;
74
+ }
75
+ export async function conventionUpdate() {
76
+ const config = loadConfig();
77
+ if (!config) {
78
+ throw new Error("Configuration not found. Run 'agentteams init' first or set environment variables.");
79
+ }
80
+ const projectRoot = findProjectRoot();
81
+ if (!projectRoot) {
82
+ throw new Error("No .agentteams directory found. Run 'agentteams init' first.");
83
+ }
84
+ const apiUrl = config.apiUrl.endsWith("/")
85
+ ? config.apiUrl.slice(0, -1)
86
+ : config.apiUrl;
87
+ const headers = {
88
+ "X-API-Key": config.apiKey,
89
+ "Content-Type": "application/json",
90
+ };
91
+ const listResponse = await axios.get(`${apiUrl}/api/projects/${config.projectId}/conventions`, { headers });
92
+ const conventions = listResponse.data?.data;
93
+ if (!conventions || conventions.length === 0) {
94
+ throw new Error("No conventions found for this project. Create one via the web dashboard first.");
95
+ }
96
+ const markdownParts = [];
97
+ for (const convention of conventions) {
98
+ const downloadResponse = await axios.get(`${apiUrl}/api/projects/${config.projectId}/conventions/${convention.id}/download`, { headers, responseType: "text" });
99
+ markdownParts.push(downloadResponse.data);
100
+ }
101
+ const fullMarkdown = markdownParts.join("\n\n---\n\n");
102
+ const conventionPath = join(projectRoot, CONVENTION_DIR, CONVENTION_FILE);
103
+ writeFileSync(conventionPath, fullMarkdown, "utf-8");
104
+ return `Convention updated successfully.\nDownloaded ${conventions.length} convention(s) to ${CONVENTION_DIR}/${CONVENTION_FILE}`;
105
+ }
106
+ //# sourceMappingURL=convention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convention.js","sourceRoot":"","sources":["../../src/commands/convention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,MAAM,eAAe,GAAG,eAAe,CAAC;AACxC,MAAM,SAAS,GAAG,WAAW,CAAC;AAC9B,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,SAAS,eAAe;IACtB,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACpD,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAC7B,mFAAmF;IACnF,OAAO,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAED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,MAAM,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAEvD,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAC1E,aAAa,CAAC,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAErD,OAAO,gDAAgD,WAAW,CAAC,MAAM,qBAAqB,cAAc,IAAI,eAAe,EAAE,CAAC;AACpI,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare function dependencyList(taskId: string): Promise<any>;
2
+ export declare function dependencyCreate(taskId: string, dependsOnId: string): Promise<any>;
3
+ export declare function dependencyDelete(taskId: string, depId: string): Promise<any>;
4
+ //# sourceMappingURL=dependency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency.d.ts","sourceRoot":"","sources":["../../src/commands/dependency.ts"],"names":[],"mappings":"AAoBA,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAOjE;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,GAAG,CAAC,CAQd;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,GAAG,CAAC,CAUd"}
@@ -0,0 +1,34 @@
1
+ import axios from 'axios';
2
+ import { loadConfig } from '../utils/config.js';
3
+ function getConfigOrThrow() {
4
+ const config = loadConfig();
5
+ if (!config) {
6
+ throw new Error('Configuration not found. Run "agentteams init" first or set AGENTTEAMS_* environment variables.');
7
+ }
8
+ return config;
9
+ }
10
+ function getHeaders(apiKey) {
11
+ return {
12
+ 'X-API-Key': apiKey,
13
+ 'Content-Type': 'application/json',
14
+ };
15
+ }
16
+ export async function dependencyList(taskId) {
17
+ const config = getConfigOrThrow();
18
+ const response = await axios.get(`${config.apiUrl}/api/tasks/${taskId}/dependencies`, { headers: getHeaders(config.apiKey) });
19
+ return response.data;
20
+ }
21
+ export async function dependencyCreate(taskId, dependsOnId) {
22
+ const config = getConfigOrThrow();
23
+ const response = await axios.post(`${config.apiUrl}/api/tasks/${taskId}/dependencies`, { dependsOnId: Number(dependsOnId) }, { headers: getHeaders(config.apiKey) });
24
+ return response.data;
25
+ }
26
+ export async function dependencyDelete(taskId, depId) {
27
+ const config = getConfigOrThrow();
28
+ const response = await axios.delete(`${config.apiUrl}/api/tasks/${taskId}/dependencies/${depId}`, { headers: getHeaders(config.apiKey) });
29
+ if (response.status === 204) {
30
+ return { message: `Dependency ${depId} deleted from task ${taskId}.` };
31
+ }
32
+ return response.data;
33
+ }
34
+ //# sourceMappingURL=dependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency.js","sourceRoot":"","sources":["../../src/commands/dependency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,SAAS,gBAAgB;IACvB,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,MAAc;IAChC,OAAO;QACL,WAAW,EAAE,MAAM;QACnB,cAAc,EAAE,kBAAkB;KACnC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAc;IACjD,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAC9B,GAAG,MAAM,CAAC,MAAM,cAAc,MAAM,eAAe,EACnD,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACvC,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAc,EACd,WAAmB;IAEnB,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAC/B,GAAG,MAAM,CAAC,MAAM,cAAc,MAAM,eAAe,EACnD,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,EACpC,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACvC,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAc,EACd,KAAa;IAEb,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CACjC,GAAG,MAAM,CAAC,MAAM,cAAc,MAAM,iBAAiB,KAAK,EAAE,EAC5D,EAAE,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACvC,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,sBAAsB,MAAM,GAAG,EAAE,CAAC;IACzE,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function executeCommand(resource: string, action: string, options: any): Promise<any>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAOA,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,GAAG,GACX,OAAO,CAAC,GAAG,CAAC,CAwCd"}