@agent-tasks/mcp-server 0.11.0 → 0.13.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/README.md CHANGED
@@ -21,12 +21,13 @@ node mcp-server/dist/index.js
21
21
 
22
22
  ## Configuration
23
23
 
24
- Two environment variables:
24
+ Three environment variables:
25
25
 
26
- | Variable | Required | Default |
27
- | ---------------------- | -------- | ---------------------------------------- |
28
- | `AGENT_TASKS_TOKEN` | yes | — |
29
- | `AGENT_TASKS_BASE_URL` | no | `https://agent-tasks.opentriologue.ai` |
26
+ | Variable | Required | Default |
27
+ | -------------------------- | -------- | ---------------------------------------- |
28
+ | `AGENT_TASKS_TOKEN` | yes | — |
29
+ | `AGENT_TASKS_BASE_URL` | no | `https://agent-tasks.opentriologue.ai` |
30
+ | `AGENT_TASKS_MCP_LEGACY` | no | unset (default tool set only) |
30
31
 
31
32
  Obtain a token from the agent-tasks UI under **Settings → API Tokens**.
32
33
  The token scope determines which tools succeed at runtime; tools that require
@@ -48,7 +49,71 @@ Drop `--scope user` if you want it project-local instead. See
48
49
 
49
50
  ## Tools
50
51
 
51
- 35 tools total. All return the raw JSON response from the backend as a text block.
52
+ **23 tools registered by default.** rc-v1-C007 pruned 14 still-deprecated v1
53
+ verbs out of the default registration (`projects_list`, `projects_get`,
54
+ `tasks_list`, `tasks_instructions`, `tasks_create`, `tasks_claim`,
55
+ `tasks_release`, `tasks_transition`, `tasks_update`, `review_approve`,
56
+ `review_request_changes`, `review_claim`, `review_release`,
57
+ `pull_requests_comment`); handler code for all 14 is untouched, only their
58
+ registration is gated. Set `AGENT_TASKS_MCP_LEGACY=1` in the server
59
+ process's environment to register all 37 tools (the full pre-rc-v1-C007
60
+ set) for a client still depending on one of the pruned names. Two of the
61
+ pruned verbs, `tasks_list` and `projects_list`, are known to have had
62
+ active workflow users as of this pruning: `docs/response-contract-v1.md`'s
63
+ Motivation section measured `tasks_list` as the third-highest MCP token
64
+ consumer in the audited window, and `projects_list` was the only way to
65
+ resolve a project slug before `task_create`'s `projectSlug` field and
66
+ `project_tasks` shipped. Migrate those callers to the v2 replacements in
67
+ the table below, or set the flag while migrating.
68
+
69
+ The 8 converted v2 write verbs (`task_create`, `task_respec`, `task_finish`,
70
+ `task_submit_pr`, `task_note`, `task_merge`, `task_abandon`, and the
71
+ `tasks_comment` alias) return a small receipt by default
72
+ (`{ ok, task: { id, status? }, ... }`, per `docs/response-contract-v1.md`)
73
+ instead of the raw backend body; pass `include: ["task"]` on any of them to
74
+ get the full, pre-contract object back for that call. `tasks_get` returns a
75
+ summary projection with its own `include` vocabulary, and `signals_poll`
76
+ caps and cursors the backend response locally even though it takes no
77
+ `include` parameter of its own (see `docs/response-contract-v1.md`'s
78
+ read-verb section). Every other default-registered tool still returns the
79
+ raw JSON response from the backend as a text block. The 14 pruned, legacy-flag
80
+ verbs are exempt from these shape rules entirely (see
81
+ `docs/response-contract-v1.md`'s "Legacy-flag exemption"): they exist for
82
+ compatibility only, and most still return the raw backend body they always
83
+ did (`tasks_create`, for one, still echoes the caller's own `description`).
84
+
85
+ ### Replacement table: pruned v1 verbs → v2 equivalent
86
+
87
+ Set `AGENT_TASKS_MCP_LEGACY=1` to keep using a verb in this table while you
88
+ migrate the caller to its replacement.
89
+
90
+ | Pruned verb (legacy-only) | v2 replacement |
91
+ | --- | --- |
92
+ | `projects_list` | no v2 verb enumerates projects: ask the operator for the project's slug or id (the recipe `errors.ts`'s own `unknown_project_slug` teaching error gives), or set `AGENT_TASKS_MCP_LEGACY=1` to keep using this verb. Once you know the project, `project_tasks` browses its tasks and `task_pickup` finds the next piece of work without browsing |
93
+ | `projects_get` | `projects_get_effective_gates` for the gate/task-creation fields this verb's "non-deprecated use" needed; `project_tasks` for browsing |
94
+ | `tasks_list` | `task_pickup` for the single prioritized item, or `project_tasks` to browse a project |
95
+ | `tasks_instructions` | `task_start` with `include: ["instructions"]`, or the on-demand `workflow_primer` verb for the general lifecycle prose |
96
+ | `tasks_create` | `task_create` (same behavior, v2 naming, receipt by default) |
97
+ | `tasks_claim` | `task_start` (atomic claim + `in_progress` + instructions) |
98
+ | `tasks_release` | `task_abandon` (explicit bail-out with an audit trail) |
99
+ | `tasks_transition` | `task_start` / `task_finish` (the system owns transitions under v2) |
100
+ | `tasks_update` | `task_submit_pr` for branch/PR metadata, or `task_finish { prUrl }` |
101
+ | `review_approve` | `task_finish { outcome: "approve" }` after `task_start` on a review task |
102
+ | `review_request_changes` | `task_finish { outcome: "request_changes" }` after `task_start` on a review task |
103
+ | `review_claim` | `task_start` on a task in `review` status (review-claims polymorphically) |
104
+ | `review_release` | `task_abandon` |
105
+ | `pull_requests_comment` | `gh pr comment` directly, or `task_note` to leave the note on the task instead |
106
+
107
+ ### Onboarding
108
+
109
+ | Tool | Wraps |
110
+ | ------------------ | --------------------------------------------- |
111
+ | `workflow_primer` | served locally, no backend call |
112
+
113
+ `workflow_primer` is the one local-only tool in this package: it returns a
114
+ fixed onboarding string (`src/primer.ts`) and never calls the backend. See
115
+ `docs/response-contract-v1.md`'s "Onboarding channels by rate of change"
116
+ table.
52
117
 
53
118
  ### v2 verbs (task_*)
54
119
 
@@ -61,6 +126,7 @@ The canonical agent surface. Prefer these for all new integrations.
61
126
  | `task_note` | `POST /api/tasks/:id/comments` |
62
127
  | `task_finish` | `POST /api/tasks/:id/finish` |
63
128
  | `task_create` | `POST /api/projects/:projectId/tasks` |
129
+ | `task_respec` | `POST /api/tasks/:id/respec` |
64
130
  | `task_abandon` | `POST /api/tasks/:id/abandon` |
65
131
  | `task_submit_pr` | `POST /api/tasks/:id/submit-pr` |
66
132
  | `task_merge` | `POST /api/tasks/:id/merge` |
@@ -80,33 +146,46 @@ The canonical agent surface. Prefer these for all new integrations.
80
146
  | `task_attachment_list` | `GET /api/tasks/:id/attachments` |
81
147
  | `task_attachment_get` | `GET /api/tasks/:id/attachments/:attachmentId/content` |
82
148
 
83
- ### v1 aliases (tasks_* / review_* / pull_requests_* / projects_* / signals_*)
149
+ ### v1-named aliases still registered by default
84
150
 
85
- Still functional; most are deprecated in favour of the v2 verbs above.
151
+ Naming-convention siblings of the pruned surface below, but each stays
152
+ registered by default: `projects_get_effective_gates` and `project_tasks`
153
+ were never deprecated, `tasks_get` was upgraded into the read-verb surface
154
+ (rc-v1-C006), `tasks_comment` is the receipt-converted `task_note` alias,
155
+ `signals_poll` / `signals_ack` are still the only signal-inbox surface, and
156
+ `pull_requests_create` / `pull_requests_merge` were never deprecated either.
86
157
 
87
158
  | Tool | Wraps |
88
159
  | ------------------------ | ------------------------------------------------------------- |
89
- | `projects_list` | `GET /api/projects/available` |
90
- | `projects_get` | `GET /api/projects/:slugOrId` (or `/by-slug/:slug`) |
91
160
  | `projects_get_effective_gates` | `GET /api/projects/:id/effective-gates` |
92
161
  | `project_tasks` | `GET /api/projects/:id/tasks` |
93
- | `tasks_list` | `GET /api/tasks/claimable` |
94
162
  | `tasks_get` | `GET /api/tasks/:id` |
163
+ | `tasks_comment` | `POST /api/tasks/:id/comments` |
164
+ | `signals_poll` | `GET /api/agent/signals` |
165
+ | `signals_ack` | `POST /api/agent/signals/:id/ack` |
166
+ | `pull_requests_create` | `POST /api/github/pull-requests` |
167
+ | `pull_requests_merge` | `POST /api/github/pull-requests/:prNumber/merge` |
168
+
169
+ ### v1 aliases pruned from the default registration (legacy-only)
170
+
171
+ Set `AGENT_TASKS_MCP_LEGACY=1` to register these 14. See the replacement
172
+ table above for their v2 equivalents.
173
+
174
+ | Tool | Wraps |
175
+ | ------------------------ | ------------------------------------------------------------- |
176
+ | `projects_list` | `GET /api/projects/available` |
177
+ | `projects_get` | `GET /api/projects/:slugOrId` (or `/by-slug/:slug`) |
178
+ | `tasks_list` | `GET /api/tasks/claimable` |
95
179
  | `tasks_instructions` | `GET /api/tasks/:id/instructions` |
96
180
  | `tasks_create` | `POST /api/projects/:projectId/tasks` |
97
181
  | `tasks_claim` | `POST /api/tasks/:id/claim` |
98
182
  | `tasks_release` | `POST /api/tasks/:id/release` |
99
183
  | `tasks_transition` | `POST /api/tasks/:id/transition` |
100
184
  | `tasks_update` | `PATCH /api/tasks/:id` |
101
- | `tasks_comment` | `POST /api/tasks/:id/comments` |
102
185
  | `review_approve` | `POST /api/tasks/:id/review` (`action: approve`) |
103
186
  | `review_request_changes` | `POST /api/tasks/:id/review` (`action: request_changes`) |
104
187
  | `review_claim` | `POST /api/tasks/:id/review/claim` |
105
188
  | `review_release` | `POST /api/tasks/:id/review/release` |
106
- | `signals_poll` | `GET /api/agent/signals` |
107
- | `signals_ack` | `POST /api/agent/signals/:id/ack` |
108
- | `pull_requests_create` | `POST /api/github/pull-requests` |
109
- | `pull_requests_merge` | `POST /api/github/pull-requests/:prNumber/merge` |
110
189
  | `pull_requests_comment` | `POST /api/github/pull-requests/:prNumber/comments` |
111
190
 
112
191
  ### GitHub PR tools — delegation required
@@ -137,7 +216,9 @@ the endpoint returns 403. If the project has `requireDistinctReviewer`
137
216
  enabled, the merge caller must not be the task's claimant — same rule
138
217
  the `/transition` and `/review` endpoints apply. To bypass the gate,
139
218
  admins force-transition to `done` via `tasks_transition` with `force=true`
140
- first, then call this tool (which accepts `done` as a valid entry state).
219
+ first (set `AGENT_TASKS_MCP_LEGACY=1`, `tasks_transition` is pruned from
220
+ the default registration), then call this tool (which accepts `done` as a
221
+ valid entry state).
141
222
 
142
223
  ## Transport
143
224
 
@@ -163,12 +244,15 @@ curl -X POST https://agent-tasks.opentriologue.ai/api/mcp \
163
244
  - Stateless Streamable HTTP (no session ID, one round-trip per
164
245
  request)
165
246
  - Same Bearer auth as the rest of the agent-tasks REST API
166
- - The HTTP endpoint is a **hand-maintained subset** of the 35 tools
167
- this stdio package exposes. It covers the full v1 alias surface
168
- (projects_*, tasks_*, review_*, signals_*, pull_requests_*) but
169
- does **not** yet include the v2 verbs (task_pickup / task_start /
170
- task_finish / etc.), artifact tools (task_artifact_*), attachment
171
- tools (task_attachment_*), or project_tasks. The code comment in
247
+ - The HTTP endpoint is a **hand-maintained subset** of the 37 tools this
248
+ stdio package can expose (23 registered by default, the remaining 14
249
+ legacy-only under `AGENT_TASKS_MCP_LEGACY=1`, see "Tools" above). It
250
+ covers the full v1 alias surface (projects_*, tasks_*, review_*,
251
+ signals_*, pull_requests_*) but does **not** yet include the v2 verbs
252
+ (task_pickup / task_start /
253
+ task_finish / task_respec / etc.), the local-only `workflow_primer`
254
+ tool, artifact tools (task_artifact_*), attachment tools
255
+ (task_attachment_*), or project_tasks. The code comment in
172
256
  `backend/src/routes/mcp.ts` documents this gap explicitly.
173
257
  - GET / DELETE on `/api/mcp` return 405 with `Allow: POST`
174
258
 
package/dist/client.d.ts CHANGED
@@ -7,10 +7,86 @@ export declare class AgentTasksApiError extends Error {
7
7
  body: unknown;
8
8
  constructor(status: number, body: unknown, message: string);
9
9
  }
10
+ export declare class ProjectSlugNotFoundError extends Error {
11
+ readonly slug: string;
12
+ constructor(slug: string);
13
+ }
14
+ interface CreateTaskInput {
15
+ title: string;
16
+ description?: string;
17
+ priority?: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
18
+ workflowId?: string;
19
+ dueAt?: string;
20
+ externalRef?: string;
21
+ labels?: string[];
22
+ dependsOn?: string[];
23
+ debugFlavor?: boolean;
24
+ templateData?: Record<string, unknown>;
25
+ deliverableRepo?: string;
26
+ }
27
+ interface ListProjectTasksParams {
28
+ status?: string | string[];
29
+ priority?: string | string[];
30
+ labels?: string[];
31
+ unclaimed?: boolean;
32
+ limit?: number;
33
+ sort?: string;
34
+ cursor?: string;
35
+ }
10
36
  export declare class AgentTasksClient {
11
37
  private readonly config;
38
+ private readonly projectSlugCache;
12
39
  constructor(config: ClientConfig);
13
40
  private request;
41
+ /** Cache-first resolution. Also reports whether `id` was cache-served (vs
42
+ * a fresh network lookup THIS call), so withResolvedProjectSlug can tell
43
+ * a stale-cache-artifact failure apart from a genuine downstream error --
44
+ * see that function's own doc comment. Throws ProjectSlugNotFoundError on
45
+ * a fresh (non-cached) 404 -- see that class's own doc comment. */
46
+ private resolveProjectSlug;
47
+ /** Always hits the network (bypasses the cache), then (re)writes the
48
+ * cache entry on success. Used both for a cache miss/expiry and for the
49
+ * forced fresh retry in withResolvedProjectSlug below. */
50
+ private fetchAndCacheProjectSlug;
51
+ /**
52
+ * Resolves `slug` to a project id (cache-first) and calls `perform(id)`.
53
+ *
54
+ * `perform` failing downstream with a 404 OR a 403 is only worth a retry
55
+ * when `id` was CACHE-SERVED (rc-v1-C006 round-2 review, HIGH): the
56
+ * resolved id no longer working downstream can mean the project behind
57
+ * this slug was renamed/reassigned since the cache entry was written
58
+ * (404 -- the id no longer exists), or that the caller's access to that
59
+ * now-different project was revoked (403 -- both consumer routes,
60
+ * POST /projects/:id/tasks and GET /projects/:id/tasks, reject an
61
+ * inaccessible id via hasProjectAccess with 403 forbidden, NOT 404; see
62
+ * backend/src/routes/tasks.ts). A freshly-resolved id (cacheServed:
63
+ * false) failing the same way is never a stale-cache artifact -- nothing
64
+ * to invalidate -- so it propagates immediately, with no wasted retry
65
+ * round trip.
66
+ *
67
+ * When a cache-served id does fail this way, the cache entry is
68
+ * invalidated and the slug is re-resolved FRESH before deciding whether
69
+ * to retry `perform`:
70
+ * - the fresh id is IDENTICAL to the one that just failed: this was
71
+ * never a stale-cache issue, it is a genuine downstream error (most
72
+ * often a real permission denial) -- the ORIGINAL error propagates
73
+ * unchanged, `perform` is not called again, so a real 403 is never
74
+ * masked as a retry-fixed cache problem.
75
+ * - the fresh id DIFFERS: the cache genuinely was stale -- `perform` is
76
+ * retried exactly once against the fresh id. A second failure
77
+ * (including a second 404/403) propagates unchanged: this is a
78
+ * single retry, not a loop. `perform` is therefore called at most
79
+ * twice in total for one withResolvedProjectSlug call.
80
+ * - the fresh lookup itself 404s (the slug no longer resolves to ANY
81
+ * project): fetchAndCacheProjectSlug's own ProjectSlugNotFoundError
82
+ * propagates unchanged, mapped by tools.ts's callers to the
83
+ * unknown_project_slug teaching error, never a raw error leak.
84
+ * - the fresh lookup fails with anything ELSE (a 500, a network
85
+ * error): the ORIGINAL downstream error propagates, not the
86
+ * lookup's own failure -- the retry machinery must never replace a
87
+ * real denial with one of its own artifacts.
88
+ */
89
+ private withResolvedProjectSlug;
14
90
  listProjects(): Promise<unknown>;
15
91
  getProject(slugOrId: string): Promise<unknown>;
16
92
  getProjectEffectiveGates(projectId: string): Promise<unknown>;
@@ -22,29 +98,15 @@ export declare class AgentTasksClient {
22
98
  labels?: string[];
23
99
  claimedByAgentId?: string;
24
100
  verbose?: boolean;
101
+ sort?: string;
102
+ cursor?: string;
25
103
  }): Promise<unknown>;
26
- listProjectTasks(project: string, params?: {
27
- status?: string | string[];
28
- priority?: string | string[];
29
- labels?: string[];
30
- unclaimed?: boolean;
31
- limit?: number;
32
- }): Promise<unknown>;
104
+ listProjectTasks(project: string, params?: ListProjectTasksParams): Promise<unknown>;
105
+ private fetchProjectTasksPage;
33
106
  getTask(taskId: string): Promise<unknown>;
34
107
  getTaskInstructions(taskId: string): Promise<unknown>;
35
- createTask(projectId: string, input: {
36
- title: string;
37
- description?: string;
38
- priority?: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
39
- workflowId?: string;
40
- dueAt?: string;
41
- externalRef?: string;
42
- labels?: string[];
43
- dependsOn?: string[];
44
- debugFlavor?: boolean;
45
- templateData?: Record<string, unknown>;
46
- deliverableRepo?: string;
47
- }): Promise<unknown>;
108
+ createTask(projectId: string, input: CreateTaskInput): Promise<unknown>;
109
+ createTaskByProjectSlug(slug: string, input: CreateTaskInput): Promise<unknown>;
48
110
  claimTask(taskId: string): Promise<unknown>;
49
111
  releaseTask(taskId: string): Promise<unknown>;
50
112
  transitionTask(taskId: string, input: {
@@ -86,7 +148,11 @@ export declare class AgentTasksClient {
86
148
  prUrl: string;
87
149
  prNumber: number;
88
150
  }): Promise<unknown>;
89
- pollSignals(): Promise<unknown>;
151
+ respecTask(taskId: string, input: {
152
+ description?: string;
153
+ templateData?: Record<string, unknown>;
154
+ }): Promise<unknown>;
155
+ pollSignals(limit?: number): Promise<unknown>;
90
156
  listTaskArtifacts(taskId: string, type?: string): Promise<unknown>;
91
157
  getTaskArtifact(taskId: string, artifactId: string): Promise<unknown>;
92
158
  createTaskArtifact(taskId: string, input: {
@@ -131,3 +197,4 @@ export declare class AgentTasksClient {
131
197
  idempotencyKey?: string;
132
198
  }): Promise<unknown>;
133
199
  }
200
+ export {};
package/dist/client.js CHANGED
@@ -8,8 +8,40 @@ export class AgentTasksApiError extends Error {
8
8
  this.name = "AgentTasksApiError";
9
9
  }
10
10
  }
11
+ // rc-v1-C006: raised by the internal project-slug resolver (see
12
+ // resolveProjectSlug/withResolvedProjectSlug below) specifically when a
13
+ // FRESH (not cache-served) GET /projects/by-slug/:slug lookup 404s — i.e.
14
+ // the slug genuinely does not resolve to any project, as opposed to a
15
+ // cache-served id whose downstream use fails with 404 or 403 (that case is
16
+ // handled internally by withResolvedProjectSlug's own invalidate-and-retry,
17
+ // and never reaches a caller as this error). Kept distinct from the generic
18
+ // AgentTasksApiError so callers (tools.ts's task_create / project_tasks
19
+ // handlers) can map it to the errors.ts unknownProjectSlugError teaching
20
+ // error (naming projects_list as the recipe) instead of the generic
21
+ // http_404 degrade a raw 404 would otherwise produce.
22
+ export class ProjectSlugNotFoundError extends Error {
23
+ slug;
24
+ constructor(slug) {
25
+ super(`no project found for slug "${slug}"`);
26
+ this.slug = slug;
27
+ this.name = "ProjectSlugNotFoundError";
28
+ }
29
+ }
30
+ // TTL for the internal slug -> project id cache (rc-v1-C006). ~15 minutes,
31
+ // per the task spec: long enough that a session doing several project_tasks
32
+ // / task_create calls against the same project only pays the by-slug
33
+ // round-trip once, short enough that a slug reassignment (rare) is picked
34
+ // up again within one working session even without hitting the
35
+ // invalidate-and-retry path (withResolvedProjectSlug, triggered by a
36
+ // cache-served id's downstream 404 or 403).
37
+ const PROJECT_SLUG_CACHE_TTL_MS = 15 * 60 * 1000;
11
38
  export class AgentTasksClient {
12
39
  config;
40
+ // slug -> resolved project id, TTL-bounded. Instance-scoped (not shared
41
+ // across AgentTasksClient instances, not persisted): the mcp-server
42
+ // process holds exactly one client per running session, so this is
43
+ // effectively a per-session cache.
44
+ projectSlugCache = new Map();
13
45
  constructor(config) {
14
46
  this.config = config;
15
47
  }
@@ -45,6 +77,107 @@ export class AgentTasksClient {
45
77
  }
46
78
  return parsed;
47
79
  }
80
+ // ── Project-slug resolution (rc-v1-C006) ──────────────────────────────
81
+ //
82
+ // Shared by task_create's projectSlug alternative to projectId and by
83
+ // listProjectTasks's existing slug-or-id `project` param, so both callers
84
+ // pay the by-slug round trip at most once per TTL window instead of on
85
+ // every call. See docs/response-contract-v1.md; the cache and retry
86
+ // behavior itself is a task-spec requirement of rc-v1-C006, not yet
87
+ // written into that doc's own prose.
88
+ /** Cache-first resolution. Also reports whether `id` was cache-served (vs
89
+ * a fresh network lookup THIS call), so withResolvedProjectSlug can tell
90
+ * a stale-cache-artifact failure apart from a genuine downstream error --
91
+ * see that function's own doc comment. Throws ProjectSlugNotFoundError on
92
+ * a fresh (non-cached) 404 -- see that class's own doc comment. */
93
+ async resolveProjectSlug(slug) {
94
+ const cached = this.projectSlugCache.get(slug);
95
+ if (cached && cached.expiresAt > Date.now()) {
96
+ return { id: cached.id, cacheServed: true };
97
+ }
98
+ const id = await this.fetchAndCacheProjectSlug(slug);
99
+ return { id, cacheServed: false };
100
+ }
101
+ /** Always hits the network (bypasses the cache), then (re)writes the
102
+ * cache entry on success. Used both for a cache miss/expiry and for the
103
+ * forced fresh retry in withResolvedProjectSlug below. */
104
+ async fetchAndCacheProjectSlug(slug) {
105
+ let resolved;
106
+ try {
107
+ resolved = await this.request("GET", `/api/projects/by-slug/${encodeURIComponent(slug)}`);
108
+ }
109
+ catch (err) {
110
+ if (err instanceof AgentTasksApiError && err.status === 404) {
111
+ throw new ProjectSlugNotFoundError(slug);
112
+ }
113
+ throw err;
114
+ }
115
+ const id = resolved.project.id;
116
+ this.projectSlugCache.set(slug, { id, expiresAt: Date.now() + PROJECT_SLUG_CACHE_TTL_MS });
117
+ return id;
118
+ }
119
+ /**
120
+ * Resolves `slug` to a project id (cache-first) and calls `perform(id)`.
121
+ *
122
+ * `perform` failing downstream with a 404 OR a 403 is only worth a retry
123
+ * when `id` was CACHE-SERVED (rc-v1-C006 round-2 review, HIGH): the
124
+ * resolved id no longer working downstream can mean the project behind
125
+ * this slug was renamed/reassigned since the cache entry was written
126
+ * (404 -- the id no longer exists), or that the caller's access to that
127
+ * now-different project was revoked (403 -- both consumer routes,
128
+ * POST /projects/:id/tasks and GET /projects/:id/tasks, reject an
129
+ * inaccessible id via hasProjectAccess with 403 forbidden, NOT 404; see
130
+ * backend/src/routes/tasks.ts). A freshly-resolved id (cacheServed:
131
+ * false) failing the same way is never a stale-cache artifact -- nothing
132
+ * to invalidate -- so it propagates immediately, with no wasted retry
133
+ * round trip.
134
+ *
135
+ * When a cache-served id does fail this way, the cache entry is
136
+ * invalidated and the slug is re-resolved FRESH before deciding whether
137
+ * to retry `perform`:
138
+ * - the fresh id is IDENTICAL to the one that just failed: this was
139
+ * never a stale-cache issue, it is a genuine downstream error (most
140
+ * often a real permission denial) -- the ORIGINAL error propagates
141
+ * unchanged, `perform` is not called again, so a real 403 is never
142
+ * masked as a retry-fixed cache problem.
143
+ * - the fresh id DIFFERS: the cache genuinely was stale -- `perform` is
144
+ * retried exactly once against the fresh id. A second failure
145
+ * (including a second 404/403) propagates unchanged: this is a
146
+ * single retry, not a loop. `perform` is therefore called at most
147
+ * twice in total for one withResolvedProjectSlug call.
148
+ * - the fresh lookup itself 404s (the slug no longer resolves to ANY
149
+ * project): fetchAndCacheProjectSlug's own ProjectSlugNotFoundError
150
+ * propagates unchanged, mapped by tools.ts's callers to the
151
+ * unknown_project_slug teaching error, never a raw error leak.
152
+ * - the fresh lookup fails with anything ELSE (a 500, a network
153
+ * error): the ORIGINAL downstream error propagates, not the
154
+ * lookup's own failure -- the retry machinery must never replace a
155
+ * real denial with one of its own artifacts.
156
+ */
157
+ async withResolvedProjectSlug(slug, perform) {
158
+ const { id, cacheServed } = await this.resolveProjectSlug(slug);
159
+ try {
160
+ return await perform(id);
161
+ }
162
+ catch (err) {
163
+ const isRetryTrigger = err instanceof AgentTasksApiError && (err.status === 404 || err.status === 403);
164
+ if (!isRetryTrigger || !cacheServed)
165
+ throw err;
166
+ this.projectSlugCache.delete(slug);
167
+ let freshId;
168
+ try {
169
+ freshId = await this.fetchAndCacheProjectSlug(slug);
170
+ }
171
+ catch (lookupErr) {
172
+ if (lookupErr instanceof ProjectSlugNotFoundError)
173
+ throw lookupErr;
174
+ throw err;
175
+ }
176
+ if (freshId === id)
177
+ throw err;
178
+ return await perform(freshId);
179
+ }
180
+ }
48
181
  listProjects() {
49
182
  return this.request("GET", "/api/projects/available");
50
183
  }
@@ -79,24 +212,29 @@ export class AgentTasksClient {
79
212
  sp.set("claimedByAgentId", params.claimedByAgentId);
80
213
  if (params?.verbose)
81
214
  sp.set("verbose", "true");
215
+ if (params?.sort)
216
+ sp.set("sort", params.sort);
217
+ if (params?.cursor)
218
+ sp.set("cursor", params.cursor);
82
219
  const qs = sp.toString();
83
220
  return this.request("GET", qs.length > 0 ? `/api/tasks/claimable?${qs}` : `/api/tasks/claimable`);
84
221
  }
85
222
  // Browse tasks scoped to a single project. Accepts slug or UUID for
86
- // `project`; if a slug is passed we resolve it to a UUID first via the
87
- // existing by-slug lookup so callers don't have to chain projects_get
88
- // themselves. Mirrors the filter surface of the CLI's `tasks list
89
- // --project` flow and forwards to GET /api/projects/:id/tasks.
223
+ // `project`; if a slug is passed it is resolved to a UUID first via
224
+ // withResolvedProjectSlug's TTL-cached lookup (rc-v1-C006) so repeated
225
+ // calls with the same slug on this client instance pay the by-slug
226
+ // round trip once per TTL window, not on every call, without callers
227
+ // having to chain projects_get themselves. Mirrors the filter surface of
228
+ // the CLI's `tasks list --project` flow and forwards to GET
229
+ // /api/projects/:id/tasks. Throws ProjectSlugNotFoundError (not a bare
230
+ // AgentTasksApiError) when `project` is a slug that does not resolve on
231
+ // a fresh lookup -- see withResolvedProjectSlug.
90
232
  async listProjectTasks(project, params) {
91
233
  const isUuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(project);
92
- let projectId;
93
- if (isUuid) {
94
- projectId = project;
95
- }
96
- else {
97
- const resolved = (await this.request("GET", `/api/projects/by-slug/${encodeURIComponent(project)}`)).project;
98
- projectId = resolved.id;
99
- }
234
+ const fetchPage = (projectId) => this.fetchProjectTasksPage(projectId, params);
235
+ return isUuid ? fetchPage(project) : this.withResolvedProjectSlug(project, fetchPage);
236
+ }
237
+ fetchProjectTasksPage(projectId, params) {
100
238
  const sp = new URLSearchParams();
101
239
  if (params?.status !== undefined) {
102
240
  sp.set("status", Array.isArray(params.status) ? params.status.join(",") : params.status);
@@ -113,6 +251,10 @@ export class AgentTasksClient {
113
251
  sp.set("unclaimed", "true");
114
252
  if (params?.limit !== undefined)
115
253
  sp.set("limit", String(params.limit));
254
+ if (params?.sort)
255
+ sp.set("sort", params.sort);
256
+ if (params?.cursor)
257
+ sp.set("cursor", params.cursor);
116
258
  const qs = sp.toString();
117
259
  return this.request("GET", qs.length > 0
118
260
  ? `/api/projects/${projectId}/tasks?${qs}`
@@ -127,6 +269,13 @@ export class AgentTasksClient {
127
269
  createTask(projectId, input) {
128
270
  return this.request("POST", `/api/projects/${projectId}/tasks`, input);
129
271
  }
272
+ // rc-v1-C006: projectSlug alternative to task_create's projectId,
273
+ // resolved through the same TTL-cached slug resolver listProjectTasks
274
+ // uses. Throws ProjectSlugNotFoundError on a fresh (non-cached) 404 --
275
+ // see withResolvedProjectSlug.
276
+ createTaskByProjectSlug(slug, input) {
277
+ return this.withResolvedProjectSlug(slug, (projectId) => this.createTask(projectId, input));
278
+ }
130
279
  claimTask(taskId) {
131
280
  return this.request("POST", `/api/tasks/${taskId}/claim`);
132
281
  }
@@ -177,8 +326,17 @@ export class AgentTasksClient {
177
326
  submitPr(taskId, input) {
178
327
  return this.request("POST", `/api/tasks/${taskId}/submit-pr`, input);
179
328
  }
180
- pollSignals() {
181
- return this.request("GET", "/api/agent/signals");
329
+ respecTask(taskId, input) {
330
+ return this.request("POST", `/api/tasks/${taskId}/respec`, input);
331
+ }
332
+ // `limit` (rc-v1-C006): forwarded to the backend's own `?limit=` query
333
+ // param (backend/src/routes/signals.ts, hard-capped there at 200). The
334
+ // mcp-server-side cap+cursor (read.ts's paginateSignals) requests the
335
+ // backend's own max here so it can slice+cursor the full backlog
336
+ // client-side without a backend cursor param.
337
+ pollSignals(limit) {
338
+ const qs = limit !== undefined ? `?limit=${limit}` : "";
339
+ return this.request("GET", `/api/agent/signals${qs}`);
182
340
  }
183
341
  // ── Artifacts ────────────────────────────────────────────────────────────
184
342
  //
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAElC;IACA;IAFT,YACS,MAAc,EACd,IAAa,EACpB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAS;QAIpB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAE7C,KAAK,CAAC,OAAO,CACnB,MAAc,EACd,IAAY,EACZ,IAAc;QAEd,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC;QAC/D,MAAM,OAAO,GAA2B;YACtC,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;YAC5C,MAAM,EAAE,kBAAkB;SAC3B,CAAC;QACF,IAAI,IAAI,KAAK,S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CAAC,KAOpB;QACC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CACjB,MAAM,EACN,6BAA6B,QAAQ,WAAW,EAChD,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,23 @@
1
+ export interface DefaultWorkflowState {
2
+ name: string;
3
+ label: string;
4
+ terminal: boolean;
5
+ agentInstructions: string;
6
+ }
7
+ export declare const DEFAULT_WORKFLOW_STATES: readonly DefaultWorkflowState[];
8
+ /** State name -> agentInstructions. Convenience lookup for `receiptForStart`
9
+ * (include:["instructions"] fallback) and for rc-v1-C004's future
10
+ * workflow_primer verb. */
11
+ export declare const DEFAULT_WORKFLOW_AGENT_INSTRUCTIONS: Readonly<Record<string, string>>;
12
+ export interface DefaultWorkflowTransition {
13
+ to: string;
14
+ label: string;
15
+ requires?: string[];
16
+ }
17
+ /** from-state -> the edges leaving it, each with its `requires` gate list
18
+ * when one applies. Mirrors backend/src/services/default-workflow.ts's
19
+ * `DEFAULT_TRANSITIONS` verbatim (including the deliberate absence of
20
+ * `branchPresent` on the `open -> in_progress` edge — see that file's
21
+ * comment on why: requiring a branch before work even starts would
22
+ * self-checkmate the default workflow once task_start enforces gates). */
23
+ export declare const DEFAULT_WORKFLOW_TRANSITIONS: Readonly<Record<string, readonly DefaultWorkflowTransition[]>>;