agent-tasks 1.5.0 → 1.6.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 (91) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +149 -42
  3. package/package.json +7 -1
  4. package/dist/context.d.ts +0 -17
  5. package/dist/context.d.ts.map +0 -1
  6. package/dist/context.js +0 -37
  7. package/dist/context.js.map +0 -1
  8. package/dist/db.d.ts +0 -10
  9. package/dist/db.d.ts.map +0 -1
  10. package/dist/db.js +0 -112
  11. package/dist/db.js.map +0 -1
  12. package/dist/domain/agent-bridge.d.ts +0 -13
  13. package/dist/domain/agent-bridge.d.ts.map +0 -1
  14. package/dist/domain/agent-bridge.js +0 -99
  15. package/dist/domain/agent-bridge.js.map +0 -1
  16. package/dist/domain/approvals.d.ts +0 -18
  17. package/dist/domain/approvals.d.ts.map +0 -1
  18. package/dist/domain/approvals.js +0 -89
  19. package/dist/domain/approvals.js.map +0 -1
  20. package/dist/domain/cleanup.d.ts +0 -28
  21. package/dist/domain/cleanup.d.ts.map +0 -1
  22. package/dist/domain/cleanup.js +0 -68
  23. package/dist/domain/cleanup.js.map +0 -1
  24. package/dist/domain/collaborators.d.ts +0 -14
  25. package/dist/domain/collaborators.d.ts.map +0 -1
  26. package/dist/domain/collaborators.js +0 -59
  27. package/dist/domain/collaborators.js.map +0 -1
  28. package/dist/domain/comments.d.ts +0 -14
  29. package/dist/domain/comments.d.ts.map +0 -1
  30. package/dist/domain/comments.js +0 -63
  31. package/dist/domain/comments.js.map +0 -1
  32. package/dist/domain/events.d.ts +0 -9
  33. package/dist/domain/events.d.ts.map +0 -1
  34. package/dist/domain/events.js +0 -52
  35. package/dist/domain/events.js.map +0 -1
  36. package/dist/domain/rules.d.ts +0 -2
  37. package/dist/domain/rules.d.ts.map +0 -1
  38. package/dist/domain/rules.js +0 -67
  39. package/dist/domain/rules.js.map +0 -1
  40. package/dist/domain/tasks.d.ts +0 -60
  41. package/dist/domain/tasks.d.ts.map +0 -1
  42. package/dist/domain/tasks.js +0 -616
  43. package/dist/domain/tasks.js.map +0 -1
  44. package/dist/domain/validate.d.ts +0 -14
  45. package/dist/domain/validate.d.ts.map +0 -1
  46. package/dist/domain/validate.js +0 -29
  47. package/dist/domain/validate.js.map +0 -1
  48. package/dist/event-bus.d.ts +0 -10
  49. package/dist/event-bus.d.ts.map +0 -1
  50. package/dist/event-bus.js +0 -38
  51. package/dist/event-bus.js.map +0 -1
  52. package/dist/index.d.ts +0 -3
  53. package/dist/index.d.ts.map +0 -1
  54. package/dist/index.js +0 -121
  55. package/dist/index.js.map +0 -1
  56. package/dist/server.d.ts +0 -10
  57. package/dist/server.d.ts.map +0 -1
  58. package/dist/server.js +0 -95
  59. package/dist/server.js.map +0 -1
  60. package/dist/session.d.ts +0 -7
  61. package/dist/session.d.ts.map +0 -1
  62. package/dist/session.js +0 -11
  63. package/dist/session.js.map +0 -1
  64. package/dist/storage/database.d.ts +0 -15
  65. package/dist/storage/database.d.ts.map +0 -1
  66. package/dist/storage/database.js +0 -215
  67. package/dist/storage/database.js.map +0 -1
  68. package/dist/tasks.d.ts +0 -32
  69. package/dist/tasks.d.ts.map +0 -1
  70. package/dist/tasks.js +0 -410
  71. package/dist/tasks.js.map +0 -1
  72. package/dist/transport/mcp.d.ts +0 -6
  73. package/dist/transport/mcp.d.ts.map +0 -1
  74. package/dist/transport/mcp.js +0 -573
  75. package/dist/transport/mcp.js.map +0 -1
  76. package/dist/transport/rest.d.ts +0 -4
  77. package/dist/transport/rest.d.ts.map +0 -1
  78. package/dist/transport/rest.js +0 -382
  79. package/dist/transport/rest.js.map +0 -1
  80. package/dist/transport/ws.d.ts +0 -10
  81. package/dist/transport/ws.d.ts.map +0 -1
  82. package/dist/transport/ws.js +0 -177
  83. package/dist/transport/ws.js.map +0 -1
  84. package/dist/types.d.ts +0 -146
  85. package/dist/types.d.ts.map +0 -1
  86. package/dist/types.js +0 -35
  87. package/dist/types.js.map +0 -1
  88. package/dist/ui/app.js +0 -648
  89. package/dist/ui/index.html +0 -82
  90. package/dist/ui/morphdom.min.js +0 -1
  91. package/dist/ui/styles.css +0 -805
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 keshrath
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 keshrath
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 CHANGED
@@ -1,26 +1,91 @@
1
1
  # agent-tasks
2
2
 
3
- Pipeline-driven task management for AI coding agents. An [MCP](https://modelcontextprotocol.io/) server that provides stage-gated task pipelines with dependencies, artifacts, and multi-agent claiming.
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
4
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20.11-brightgreen)](https://nodejs.org/)
5
+ [![Tests](https://img.shields.io/badge/tests-337%20passing-brightgreen)]()
6
+ [![MCP Tools](https://img.shields.io/badge/MCP%20tools-33-purple)]()
7
+ [![REST Endpoints](https://img.shields.io/badge/REST-18%20endpoints-orange)]()
4
8
 
5
- Part of the **agent-\*** family: [`agent-comm`](https://github.com/keshrath/agent-comm) (messaging) + `agent-tasks` (pipeline).
9
+ **Pipeline-driven task management for AI coding agents.** An [MCP](https://modelcontextprotocol.io/) server with stage-gated pipelines, multi-agent collaboration, and a real-time kanban dashboard. Tasks flow through configurable stages — `backlog`, `spec`, `plan`, `implement`, `test`, `review`, `done` — with dependency tracking, approval workflows, artifact versioning, and threaded comments.
10
+
11
+ Built for AI coding agents (Claude Code, Codex CLI, Gemini CLI, Aider) but works equally well with any MCP client, REST consumer, or WebSocket listener.
12
+
13
+ ---
14
+
15
+ | Light Theme | Dark Theme |
16
+ | -------------------------------------------------------- | ------------------------------------------------------ |
17
+ | ![Light mode dashboard](docs/assets/dashboard-light.png) | ![Dark mode dashboard](docs/assets/dashboard-dark.png) |
18
+
19
+ ---
20
+
21
+ ## Why agent-tasks?
22
+
23
+ When you run multiple AI agents on the same codebase, they need a shared task pipeline — not just a flat todo list. They need stages, dependencies, approvals, and visibility.
24
+
25
+ ---
6
26
 
7
27
  ## Features
8
28
 
9
- - **Pipeline stages** — tasks flow through configurable stages: `backlog spec plan implement test review done`
10
- - **Dependencies** — tasks can depend on other tasks; advancement is blocked until dependencies are met (with cycle detection)
11
- - **Artifacts** — attach specs, plans, test results, review notes to tasks at each stage
12
- - **Multi-agent claiming** — agents claim tasks from a shared queue; highest-priority unblocked task is served first
13
- - **Per-project pipelines** — customize stage definitions per project
14
- - **SQLite storage** — WAL-mode SQLite via better-sqlite3 for concurrent access
29
+ - **Pipeline stages** — configurable per project: `backlog` > `spec` > `plan` > `implement` > `test` > `review` > `done`
30
+ - **Task dependencies** — DAG with automatic cycle detection; blocks advancement until resolved
31
+ - **Approval workflows** — stage-gated approve/reject with auto-regress on rejection
32
+ - **Multi-agent collaboration** — roles (collaborator, reviewer, watcher), claiming, assignment
33
+ - **Subtask hierarchies** — parent/child task trees with progress tracking
34
+ - **Threaded comments** — async discussions between agents on any task
35
+ - **Artifact versioning** — per-stage document attachments with automatic versioning and diff viewer
36
+ - **Full-text search** — FTS5 search across task titles and descriptions
37
+ - **Real-time kanban dashboard** — drag-and-drop, side panel, inline creation, dark/light theme
38
+ - **3 transport layers** — MCP (stdio), REST API (HTTP), WebSocket (real-time events)
39
+ - **TodoWrite bridge** — intercepts Claude Code's built-in TodoWrite and syncs to the pipeline
40
+ - **Agent bridge** — notifies connected agents on task events
41
+
42
+ ---
15
43
 
16
44
  ## Quick Start
17
45
 
46
+ ### Install from npm
47
+
48
+ ```bash
49
+ npm install -g agent-tasks
50
+ ```
51
+
52
+ ### Or clone from source
53
+
18
54
  ```bash
55
+ git clone https://github.com/keshrath/agent-tasks.git
56
+ cd agent-tasks
19
57
  npm install
20
58
  npm run build
21
59
  ```
22
60
 
23
- ### As an MCP server (stdio)
61
+ ### Option 1: MCP server (for AI agents)
62
+
63
+ Add to your MCP client config (Claude Code, Cline, etc.):
64
+
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "agent-tasks": {
69
+ "command": "npx",
70
+ "args": ["agent-tasks"]
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ The dashboard auto-starts at http://localhost:3422 on the first MCP connection.
77
+
78
+ ### Option 2: Standalone server (for REST/WebSocket clients)
79
+
80
+ ```bash
81
+ node dist/server.js --port 3422
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Claude Code Integration
87
+
88
+ Add agent-tasks as an MCP server in `~/.claude/settings.json`:
24
89
 
25
90
  ```json
26
91
  {
@@ -33,42 +98,84 @@ npm run build
33
98
  }
34
99
  ```
35
100
 
36
- ## Tools
37
-
38
- | Tool | Description |
39
- | ------------------------ | ------------------------------------------------------------------------- |
40
- | `task_create` | Create a task with title, description, stage, priority, project, tags |
41
- | `task_list` | List tasks with filters (status, assignee, stage, project) and pagination |
42
- | `task_claim` | Claim a pending task — assigns it and advances from backlog |
43
- | `task_complete` | Mark a task as completed with a result |
44
- | `task_fail` | Mark a task as failed with an error |
45
- | `task_cancel` | Cancel a task |
46
- | `task_advance` | Advance to the next (or a specific) stage; checks dependencies |
47
- | `task_regress` | Send a task back to an earlier stage (e.g. review rejection) |
48
- | `task_update` | Update task metadata (title, description, priority, tags, assignee) |
49
- | `task_next` | Get the highest-priority unassigned task with all dependencies met |
50
- | `task_add_dependency` | Add a dependency between tasks (with cycle detection) |
51
- | `task_remove_dependency` | Remove a dependency |
52
- | `task_add_artifact` | Attach a document/artifact to a task at a specific stage |
53
- | `task_get_artifacts` | Retrieve artifacts for a task |
54
- | `task_pipeline_config` | Get or set pipeline stages for a project |
55
- | `task_set_session` | Set the session identity for tracking who creates/claims tasks |
56
-
57
- ## Configuration
58
-
59
- | Environment Variable | Description | Default |
60
- | -------------------- | ------------------------------------ | -------------------------- |
61
- | `AGENT_TASKS_DB` | Path to SQLite database | `~/.claude/agent-tasks.db` |
62
- | `AGENT_TASKS_TEST` | Use in-memory database (for testing) | — |
63
-
64
- ## Development
101
+ Once configured, Claude Code can use all 33 MCP tools directly — creating tasks, advancing stages, adding artifacts, commenting, and more. See the [Setup Guide](docs/SETUP.md) for detailed integration steps.
102
+
103
+ ---
104
+
105
+ ## MCP Tools (33)
106
+
107
+ | Category | Tools |
108
+ | ----------------------- | ----------------------------------------------------------------------------------------------------------- |
109
+ | **Task lifecycle** (12) | `task_create`, `task_list`, `task_next`, `task_claim`, `task_advance`, `task_regress`, `task_complete`, ... |
110
+ | **Subtasks & deps** (4) | `task_expand`, `task_get_subtasks`, `task_add_dependency`, `task_remove_dependency` |
111
+ | **Artifacts** (2) | `task_add_artifact`, `task_get_artifacts` |
112
+ | **Comments** (2) | `task_comment`, `task_get_comments` |
113
+ | **Collaboration** (2) | `task_add_collaborator`, `task_remove_collaborator` |
114
+ | **Approvals** (5) | `task_request_approval`, `task_approve`, `task_reject`, `task_pending_approvals`, `task_review_cycle` |
115
+ | **Config & utils** (4) | `task_pipeline_config`, `task_set_session`, `task_cleanup`, `task_generate_rules` |
116
+
117
+ See [full API reference](docs/api.md) for detailed descriptions of every tool and endpoint.
118
+
119
+ ## REST API (18 endpoints)
120
+
121
+ All endpoints return JSON. CORS enabled. See [full API reference](docs/api.md#rest-api-18-endpoints) for details.
122
+
123
+ ```
124
+ GET /health Health check with version + uptime
125
+ GET /api/tasks List tasks (status, stage, project, assignee filters)
126
+ GET /api/tasks/:id Get a single task
127
+ GET /api/tasks/:id/subtasks Subtasks of a parent
128
+ GET /api/tasks/:id/artifacts Artifacts (filter by stage)
129
+ GET /api/tasks/:id/comments Comments on a task
130
+ GET /api/tasks/:id/dependencies Dependencies for a task
131
+ GET /api/dependencies All dependencies across all tasks
132
+ GET /api/pipeline Pipeline stage configuration
133
+ GET /api/overview Full state dump
134
+ GET /api/agents Online agents
135
+ GET /api/search?q= Full-text search
136
+
137
+ POST /api/tasks Create a new task
138
+ PUT /api/tasks/:id Update task fields
139
+ PUT /api/tasks/:id/stage Change stage (advance or regress)
140
+ POST /api/tasks/:id/comments Add a comment
141
+ POST /api/cleanup Trigger manual cleanup
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Testing
65
147
 
66
148
  ```bash
67
- npm run dev # watch mode
68
- npm test # run tests
69
- npm run check # typecheck + lint + format + test
149
+ npm test # 337 tests across 12 suites
150
+ npm run test:watch # Watch mode
151
+ npm run test:coverage # Coverage report
152
+ npm run check # Full CI: typecheck + lint + format + test
70
153
  ```
71
154
 
155
+ ---
156
+
157
+ ## Environment variables
158
+
159
+ | Variable | Default | Description |
160
+ | -------------------------- | ------------------------------- | ---------------------------------------------------- |
161
+ | `AGENT_TASKS_DB` | `~/.agent-tasks/agent-tasks.db` | SQLite database file path |
162
+ | `AGENT_TASKS_PORT` | `3422` | Dashboard HTTP/WebSocket port |
163
+ | `AGENT_TASKS_INSTRUCTIONS` | enabled | Set to `0` to disable response-embedded instructions |
164
+ | `AGENT_COMM_URL` | `http://localhost:3421` | Agent-comm REST URL for bridge notifications |
165
+
166
+ ---
167
+
168
+ ## Documentation
169
+
170
+ - [API Reference](docs/api.md) — all 33 MCP tools, 18 REST endpoints, WebSocket protocol
171
+ - [Architecture](docs/architecture.md) — source structure, design principles, database schema
172
+ - [Dashboard](docs/dashboard.md) — kanban board features, keyboard shortcuts, screenshots
173
+ - [Hooks](docs/hooks.md) — TodoWrite bridge hook for Claude Code
174
+ - [Setup Guide](docs/SETUP.md) — detailed installation, integration, and configuration
175
+ - [Changelog](CHANGELOG.md)
176
+
177
+ ---
178
+
72
179
  ## License
73
180
 
74
- MIT
181
+ MIT — see [LICENSE](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-tasks",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Pipeline-driven task management for AI coding agents — stages, dependencies, artifacts, and multi-agent claiming",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,6 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "better-sqlite3": "^12.8.0",
37
+ "morphdom": "^2.7.8",
37
38
  "ws": "^8.20.0"
38
39
  },
39
40
  "devDependencies": {
@@ -71,8 +72,13 @@
71
72
  "LICENSE"
72
73
  ],
73
74
  "license": "MIT",
75
+ "author": "keshrath",
74
76
  "repository": {
75
77
  "type": "git",
76
78
  "url": "https://github.com/keshrath/agent-tasks.git"
79
+ },
80
+ "homepage": "https://github.com/keshrath/agent-tasks",
81
+ "bugs": {
82
+ "url": "https://github.com/keshrath/agent-tasks/issues"
77
83
  }
78
84
  }
package/dist/context.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import { type Db, type DbOptions } from './storage/database.js';
2
- import { EventBus } from './domain/events.js';
3
- import { TaskService } from './domain/tasks.js';
4
- import { CommentService } from './domain/comments.js';
5
- import { CollaboratorService } from './domain/collaborators.js';
6
- import { ApprovalService } from './domain/approvals.js';
7
- export interface AppContext {
8
- readonly db: Db;
9
- readonly events: EventBus;
10
- readonly tasks: TaskService;
11
- readonly comments: CommentService;
12
- readonly collaborators: CollaboratorService;
13
- readonly approvals: ApprovalService;
14
- close(): void;
15
- }
16
- export declare function createContext(dbOptions?: DbOptions): AppContext;
17
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAOA,OAAO,EAAY,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAwB/D"}
package/dist/context.js DELETED
@@ -1,37 +0,0 @@
1
- // =============================================================================
2
- // agent-tasks — Application context
3
- //
4
- // Dependency injection root. Creates and wires together all services.
5
- // Every layer receives its dependencies explicitly — no global state.
6
- // =============================================================================
7
- import { createDb } from './storage/database.js';
8
- import { EventBus } from './domain/events.js';
9
- import { TaskService } from './domain/tasks.js';
10
- import { CommentService } from './domain/comments.js';
11
- import { CollaboratorService } from './domain/collaborators.js';
12
- import { ApprovalService } from './domain/approvals.js';
13
- export function createContext(dbOptions) {
14
- const db = createDb(dbOptions);
15
- const events = new EventBus();
16
- let closed = false;
17
- const tasks = new TaskService(db, events);
18
- const comments = new CommentService(db, events);
19
- const collaborators = new CollaboratorService(db, events);
20
- const approvals = new ApprovalService(db, events);
21
- return {
22
- db,
23
- events,
24
- tasks,
25
- comments,
26
- collaborators,
27
- approvals,
28
- close() {
29
- if (closed)
30
- return;
31
- closed = true;
32
- events.removeAll();
33
- db.close();
34
- },
35
- };
36
- }
37
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oCAAoC;AACpC,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,gFAAgF;AAEhF,OAAO,EAAE,QAAQ,EAA2B,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAYxD,MAAM,UAAU,aAAa,CAAC,SAAqB;IACjD,MAAM,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC9B,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,aAAa,GAAG,IAAI,mBAAmB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAElD,OAAO;QACL,EAAE;QACF,MAAM;QACN,KAAK;QACL,QAAQ;QACR,aAAa;QACb,SAAS;QACT,KAAK;YACH,IAAI,MAAM;gBAAE,OAAO;YACnB,MAAM,GAAG,IAAI,CAAC;YACd,MAAM,CAAC,SAAS,EAAE,CAAC;YACnB,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/db.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import Database from 'better-sqlite3';
2
- export declare function log(level: string, msg: string): void;
3
- export declare function initDb(): Promise<Database.Database>;
4
- export declare function getDb(): Database.Database;
5
- export declare function transaction<T>(fn: () => T): T;
6
- export declare function queryAll<T>(sql: string, params?: unknown[]): T[];
7
- export declare function queryOne<T>(sql: string, params?: unknown[]): T | null;
8
- export declare function run(sql: string, params?: unknown[]): Database.RunResult;
9
- export declare function closeDb(): void;
10
- //# sourceMappingURL=db.d.ts.map
package/dist/db.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAOtC,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpD;AAED,wBAAsB,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAqBzD;AAED,wBAAgB,KAAK,IAAI,QAAQ,CAAC,QAAQ,CAGzC;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAG7C;AAuDD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,CAIhE;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,IAAI,CAKrE;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC,SAAS,CAIvE;AAED,wBAAgB,OAAO,IAAI,IAAI,CAS9B"}
package/dist/db.js DELETED
@@ -1,112 +0,0 @@
1
- import Database from 'better-sqlite3';
2
- import { homedir } from 'os';
3
- import { join } from 'path';
4
- import { mkdirSync } from 'fs';
5
- let db = null;
6
- export function log(level, msg) {
7
- process.stderr.write(`[agent-tasks:${level}] ${new Date().toISOString()} ${msg}\n`);
8
- }
9
- export async function initDb() {
10
- if (db)
11
- return db;
12
- const inMemory = !!process.env.AGENT_TASKS_TEST;
13
- if (inMemory) {
14
- db = new Database(':memory:');
15
- }
16
- else {
17
- const dir = join(homedir(), '.claude');
18
- mkdirSync(dir, { recursive: true });
19
- const dbPath = process.env.AGENT_TASKS_DB || join(dir, 'agent-tasks.db');
20
- db = new Database(dbPath);
21
- }
22
- db.pragma('journal_mode = WAL');
23
- db.pragma('busy_timeout = 5000');
24
- db.pragma('synchronous = NORMAL');
25
- db.pragma('foreign_keys = ON');
26
- initSchema(db);
27
- return db;
28
- }
29
- export function getDb() {
30
- if (!db)
31
- throw new Error('Database not initialized. Call initDb() first.');
32
- return db;
33
- }
34
- export function transaction(fn) {
35
- const database = getDb();
36
- return database.transaction(fn)();
37
- }
38
- function initSchema(database) {
39
- database.exec(`
40
- CREATE TABLE IF NOT EXISTS tasks (
41
- id INTEGER PRIMARY KEY AUTOINCREMENT,
42
- title TEXT NOT NULL,
43
- description TEXT,
44
- created_by TEXT NOT NULL,
45
- assigned_to TEXT,
46
- status TEXT NOT NULL DEFAULT 'pending',
47
- stage TEXT NOT NULL DEFAULT 'backlog',
48
- priority INTEGER NOT NULL DEFAULT 0,
49
- project TEXT,
50
- tags TEXT,
51
- result TEXT,
52
- created_at TEXT NOT NULL DEFAULT (datetime('now')),
53
- updated_at TEXT NOT NULL DEFAULT (datetime('now'))
54
- )
55
- `);
56
- database.exec(`CREATE INDEX IF NOT EXISTS idx_tasks_assigned ON tasks(assigned_to, status)`);
57
- database.exec(`CREATE INDEX IF NOT EXISTS idx_tasks_stage ON tasks(stage, priority)`);
58
- database.exec(`
59
- CREATE TABLE IF NOT EXISTS task_dependencies (
60
- task_id INTEGER NOT NULL,
61
- depends_on INTEGER NOT NULL,
62
- PRIMARY KEY (task_id, depends_on)
63
- )
64
- `);
65
- database.exec(`
66
- CREATE TABLE IF NOT EXISTS task_artifacts (
67
- id INTEGER PRIMARY KEY AUTOINCREMENT,
68
- task_id INTEGER NOT NULL,
69
- stage TEXT NOT NULL,
70
- name TEXT NOT NULL,
71
- content TEXT NOT NULL,
72
- created_by TEXT NOT NULL,
73
- created_at TEXT NOT NULL DEFAULT (datetime('now'))
74
- )
75
- `);
76
- database.exec(`CREATE INDEX IF NOT EXISTS idx_task_artifacts_task ON task_artifacts(task_id, stage)`);
77
- database.exec(`
78
- CREATE TABLE IF NOT EXISTS pipeline_config (
79
- project TEXT PRIMARY KEY,
80
- stages TEXT NOT NULL DEFAULT '["backlog","spec","plan","implement","test","review","done","cancelled"]',
81
- updated_at TEXT NOT NULL DEFAULT (datetime('now'))
82
- )
83
- `);
84
- }
85
- export function queryAll(sql, params) {
86
- const database = getDb();
87
- const stmt = database.prepare(sql);
88
- return (params?.length ? stmt.all(...params) : stmt.all());
89
- }
90
- export function queryOne(sql, params) {
91
- const database = getDb();
92
- const stmt = database.prepare(sql);
93
- const row = params?.length ? stmt.get(...params) : stmt.get();
94
- return row ?? null;
95
- }
96
- export function run(sql, params) {
97
- const database = getDb();
98
- const stmt = database.prepare(sql);
99
- return params?.length ? stmt.run(...params) : stmt.run();
100
- }
101
- export function closeDb() {
102
- if (db) {
103
- try {
104
- db.close();
105
- }
106
- catch (e) {
107
- log('warn', `Error closing db: ${e}`);
108
- }
109
- db = null;
110
- }
111
- }
112
- //# sourceMappingURL=db.js.map
package/dist/db.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,IAAI,EAAE,GAA6B,IAAI,CAAC;AAExC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,GAAW;IAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,KAAK,KAAK,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;AACtF,CAAC;AAED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,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,IAAI,EAAE,EAAE,CAAC;QACP,IAAI,CAAC;YACH,EAAE,CAAC,KAAK,EAAE,CAAC;QACb,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAAE,CAAC,CAAC;QACxC,CAAC;QACD,EAAE,GAAG,IAAI,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { EventBus } from './events.js';
2
- export declare class AgentBridge {
3
- private readonly events;
4
- private unsubs;
5
- constructor(events: EventBus);
6
- start(): void;
7
- stop(): void;
8
- fetchAgents(): Promise<unknown[]>;
9
- private notify;
10
- private notifyChannel;
11
- private postMessage;
12
- }
13
- //# sourceMappingURL=agent-bridge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-bridge.d.ts","sourceRoot":"","sources":["../../src/domain/agent-bridge.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,qBAAa,WAAW;IAGV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,MAAM,CAAsB;gBAEP,MAAM,EAAE,QAAQ;IAE7C,KAAK,IAAI,IAAI;IAiDb,IAAI,IAAI,IAAI;IAKZ,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAuBjC,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,WAAW;CA6BpB"}
@@ -1,99 +0,0 @@
1
- // =============================================================================
2
- // agent-tasks — Agent-comm bridge
3
- //
4
- // Listens to task events and forwards notifications to agents via
5
- // agent-comm's REST API. Lightweight runtime integration — no npm dependency.
6
- // =============================================================================
7
- import http from 'http';
8
- const AGENT_COMM_URL = process.env.AGENT_COMM_URL || 'http://localhost:3421';
9
- export class AgentBridge {
10
- events;
11
- unsubs = [];
12
- constructor(events) {
13
- this.events = events;
14
- }
15
- start() {
16
- this.unsubs.push(this.events.on('task:claimed', (e) => {
17
- const task = e.data.task;
18
- if (task.assigned_to) {
19
- this.notify(`Task #${task.id} "${task.title}" has been assigned to you.`, task.assigned_to);
20
- }
21
- }));
22
- this.unsubs.push(this.events.on('task:advanced', (e) => {
23
- const task = e.data.task;
24
- const toStage = e.data.to_stage;
25
- if (task.assigned_to) {
26
- this.notify(`Task #${task.id} "${task.title}" advanced to ${toStage}.`, task.assigned_to);
27
- }
28
- }));
29
- this.unsubs.push(this.events.on('comment:created', (e) => {
30
- const comment = e.data.comment;
31
- this.notifyChannel(`Comment on task #${comment.task_id} by ${comment.agent_id}: ${comment.content.slice(0, 100)}`);
32
- }));
33
- this.unsubs.push(this.events.on('approval:requested', (e) => {
34
- const approval = e.data.approval;
35
- if (approval.reviewer) {
36
- this.notify(`Approval requested for task #${approval.task_id} at stage ${approval.stage}.`, approval.reviewer);
37
- }
38
- }));
39
- }
40
- stop() {
41
- for (const unsub of this.unsubs)
42
- unsub();
43
- this.unsubs = [];
44
- }
45
- fetchAgents() {
46
- return new Promise((resolve) => {
47
- const url = new URL('/api/agents', AGENT_COMM_URL);
48
- http
49
- .get(url, { timeout: 3000 }, (res) => {
50
- let body = '';
51
- res.on('data', (c) => (body += c));
52
- res.on('end', () => {
53
- try {
54
- resolve(JSON.parse(body));
55
- }
56
- catch {
57
- resolve([]);
58
- }
59
- });
60
- })
61
- .on('error', () => resolve([]))
62
- .on('timeout', function () {
63
- this.destroy();
64
- resolve([]);
65
- });
66
- });
67
- }
68
- notify(content, agentName) {
69
- this.postMessage({ to: agentName, content }).catch(() => { });
70
- }
71
- notifyChannel(content) {
72
- this.postMessage({ channel: 'general', content }).catch(() => { });
73
- }
74
- postMessage(payload) {
75
- return new Promise((resolve) => {
76
- const data = JSON.stringify({ ...payload, from: 'agent-tasks' });
77
- const url = new URL('/api/messages', AGENT_COMM_URL);
78
- const req = http.request({
79
- hostname: url.hostname,
80
- port: url.port,
81
- path: url.pathname,
82
- method: 'POST',
83
- headers: {
84
- 'Content-Type': 'application/json',
85
- 'Content-Length': Buffer.byteLength(data),
86
- },
87
- timeout: 3000,
88
- }, () => resolve());
89
- req.on('error', () => resolve());
90
- req.on('timeout', () => {
91
- req.destroy();
92
- resolve();
93
- });
94
- req.write(data);
95
- req.end();
96
- });
97
- }
98
- }
99
- //# sourceMappingURL=agent-bridge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-bridge.js","sourceRoot":"","sources":["../../src/domain/agent-bridge.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,kCAAkC;AAClC,EAAE;AACF,kEAAkE;AAClE,8EAA8E;AAC9E,gFAAgF;AAEhF,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,uBAAuB,CAAC;AAE7E,MAAM,OAAO,WAAW;IAGO;IAFrB,MAAM,GAAmB,EAAE,CAAC;IAEpC,YAA6B,MAAgB;QAAhB,WAAM,GAAN,MAAM,CAAU;IAAG,CAAC;IAEjD,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE;YACnC,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAA2D,CAAC;YAChF,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,IAAI,CAAC,MAAM,CACT,SAAS,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,KAAK,6BAA6B,EAC5D,IAAI,CAAC,WAAW,CACjB,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CACH,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,IAAI,CAAC,MAAM,CAAC,EAAE,CA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AAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACpE,CAAC;IAEO,WAAW,CAAC,OAA+B;QACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;YACjE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;YAErD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CACtB;gBACE,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,IAAI,EAAE,GAAG,CAAC,QAAQ;gBAClB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,gBAAgB,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;iBAC1C;gBACD,OAAO,EAAE,IAAI;aACd,EACD,GAAG,EAAE,CAAC,OAAO,EAAE,CAChB,CAAC;YAEF,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACjC,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;gBACrB,GAAG,CAAC,OAAO,EAAE,CAAC;gBACd,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChB,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,18 +0,0 @@
1
- import type { Db } from '../storage/database.js';
2
- import type { EventBus } from './events.js';
3
- import type { TaskApproval } from '../types.js';
4
- export declare class ApprovalService {
5
- private readonly db;
6
- private readonly events;
7
- constructor(db: Db, events: EventBus);
8
- request(taskId: number, stage: string, reviewer?: string): TaskApproval;
9
- approve(approvalId: number, reviewer: string, comment?: string): TaskApproval;
10
- reject(approvalId: number, reviewer: string, comment?: string): TaskApproval;
11
- getPending(reviewer?: string): TaskApproval[];
12
- getForTask(taskId: number): TaskApproval[];
13
- isApprovalRequired(stage: string, project?: string): boolean;
14
- hasPendingApproval(taskId: number, stage: string): boolean;
15
- isApproved(taskId: number, stage: string): boolean;
16
- private resolve;
17
- }
18
- //# sourceMappingURL=approvals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../src/domain/approvals.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAIhE,qBAAa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,EAAE,EAAE,EAAE,EACN,MAAM,EAAE,QAAQ;IAGnC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY;IA6BvE,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY;IAK7E,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY;IAM5E,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,EAAE;IAY7C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE;IAO1C,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO;IAkB5D,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAQ1D,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAQlD,OAAO,CAAC,OAAO;CA4BhB"}