loopctl-mcp-server 3.11.2 → 3.12.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 +1 -0
- package/index.js +25 -0
- package/lib/handoff.js +4 -1
- package/lib/project-update.js +41 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -207,6 +207,7 @@ tool parameter.
|
|
|
207
207
|
| `create_project` | Create a new **work** project (epics/stories/custody). Requires orchestrator+ **and** a `human_anchored` tenant; an agent-rooted tenant gets `403 custody_tier_required` and should use `create_kb_scope`. |
|
|
208
208
|
| `delete_project` | **Needs a user-role key:** `LOOPCTL_USER_KEY` verbatim when set, else the default key (orchestrator role is 403 `insufficient_role`). Archives the project (status `archived`); no rows are removed and its slug stays taken. |
|
|
209
209
|
| `restore_project` | Restore an archived `kind: work` project, the reverse of `delete_project`; audited as `unarchived`. Orchestrator role or higher on a human-anchored tenant. Rejected (422) at the tenant's `max_projects` cap and for a kb scope (use `restore_kb_scope`). The only way to change a project's status back: PATCH refuses `status` with 422. |
|
|
210
|
+
| `update_project` | PATCH a project's `name`, `repo_url`, `description`, `tech_stack`, `mission` or `metadata`; a field left out is left alone, and a call naming none is refused locally. Slug and status are never set here. Orchestrator role or higher on a human-anchored tenant, sent with `LOOPCTL_ORCH_KEY` verbatim (else `LOOPCTL_USER_KEY`). A `repo_url` must be on no other active project, or `resolve_project` 409s `ambiguous_resolution` for that repo. |
|
|
210
211
|
| `get_progress` | Get progress summary for a project, including story counts by status. Pass `include_cost=true` for cost data. |
|
|
211
212
|
| `import_stories` | Import stories into a project from a structured payload (Epic 12 import format). Pass `merge: true` to add stories to epics that already exist (otherwise duplicates return 409). For large payloads, use `payload_path` to read JSON from disk instead of passing it inline. With `merge: true`, `report_orphans: true` adds `stories_orphaned` (the project's stories the payload does not mention; nothing is detached) — a signal only on a FULL round-trip of an export; without it the key is absent (#880). |
|
|
212
213
|
|
package/index.js
CHANGED
|
@@ -95,6 +95,7 @@ import {
|
|
|
95
95
|
githubCredential as githubCredentialRequest,
|
|
96
96
|
setGithubCredential as setGithubCredentialRequest,
|
|
97
97
|
} from "./lib/github-credential.js";
|
|
98
|
+
import { updateProject as updateProjectRequest } from "./lib/project-update.js";
|
|
98
99
|
import {
|
|
99
100
|
createEpic as createEpicRequest,
|
|
100
101
|
deleteEpic as deleteEpicRequest,
|
|
@@ -977,6 +978,10 @@ async function restoreProject({ project_id }) {
|
|
|
977
978
|
return toContent(result);
|
|
978
979
|
}
|
|
979
980
|
|
|
981
|
+
async function updateProject(args) {
|
|
982
|
+
return toContent(await updateProjectRequest(args, { apiCall: orchestratorPinnedApiCall }));
|
|
983
|
+
}
|
|
984
|
+
|
|
980
985
|
async function getProgress({ project_id, include_cost }) {
|
|
981
986
|
const params = new URLSearchParams();
|
|
982
987
|
if (include_cost) params.set("include_cost", "true");
|
|
@@ -4319,6 +4324,24 @@ const TOOLS = [
|
|
|
4319
4324
|
required: ["project_id"],
|
|
4320
4325
|
},
|
|
4321
4326
|
},
|
|
4327
|
+
{
|
|
4328
|
+
name: "update_project",
|
|
4329
|
+
description:
|
|
4330
|
+
"UPDATE a project's fields (PATCH /api/v1/projects/:id): name, repo_url, description, tech_stack, mission, metadata. Send only what changes; a field left out is left alone, and a call naming none is refused locally. The slug never changes, and status is not settable here (archive with delete_project, restore with restore_project). Setting repo_url makes resolve_project({repo_url}) and SessionStart find the project, so it must be the ONLY active project carrying that URL: a second one makes every lookup for the repo 409 ambiguous_resolution fleet-wide. Sent with LOOPCTL_ORCH_KEY verbatim, else LOOPCTL_USER_KEY, else the default key. Refusals: 403 insufficient_role below orchestrator role, 403 custody_tier_required on an agent-rooted tenant (the human-anchor gate), 404 for an id not in your tenant, 422 for an invalid field.",
|
|
4331
|
+
inputSchema: {
|
|
4332
|
+
type: "object",
|
|
4333
|
+
properties: {
|
|
4334
|
+
project_id: { type: "string", description: "The project's UUID." },
|
|
4335
|
+
name: { type: "string", description: "New name." },
|
|
4336
|
+
repo_url: { type: "string", description: "Git remote URL, e.g. https://github.com/owner/repo." },
|
|
4337
|
+
description: { type: "string", description: "New description." },
|
|
4338
|
+
tech_stack: { type: "string", description: "New tech stack summary." },
|
|
4339
|
+
mission: { type: "string", description: "New mission; an empty string clears it." },
|
|
4340
|
+
metadata: { type: "object", description: "Replaces the metadata map whole." },
|
|
4341
|
+
},
|
|
4342
|
+
required: ["project_id"],
|
|
4343
|
+
},
|
|
4344
|
+
},
|
|
4322
4345
|
{
|
|
4323
4346
|
name: "get_progress",
|
|
4324
4347
|
description: "Get progress summary for a project, including story counts by status. Pass include_cost=true to include cost data when available.",
|
|
@@ -10259,6 +10282,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
10259
10282
|
case "delete_project":
|
|
10260
10283
|
return await deleteProject(args);
|
|
10261
10284
|
|
|
10285
|
+
case "update_project":
|
|
10286
|
+
return await updateProject(args);
|
|
10262
10287
|
case "restore_project":
|
|
10263
10288
|
return await restoreProject(args);
|
|
10264
10289
|
|
package/lib/handoff.js
CHANGED
|
@@ -207,7 +207,10 @@ function postRemediation(status, channel) {
|
|
|
207
207
|
"member of it: channel writes on a work project require an agent assigned to a " +
|
|
208
208
|
"story there. The server's 'does not exist or does not belong to your tenant' " +
|
|
209
209
|
"wording is deliberately non-specific (it must not leak an existence oracle), so " +
|
|
210
|
-
"do NOT read it as the project being missing. "
|
|
210
|
+
"do NOT read it as the project being missing. Fix it with a membership story in " +
|
|
211
|
+
"THIS project, never a second channel: create_story, then contract_story, " +
|
|
212
|
+
"claim_story, start_story and request_review, and leave it there (verify, unclaim " +
|
|
213
|
+
"or release clears the assignee). Then call handoff again. "
|
|
211
214
|
: "";
|
|
212
215
|
|
|
213
216
|
return (
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `update_project`: the MCP half of `PATCH /api/v1/projects/:id` (`ProjectController.update`,
|
|
3
|
+
* loopctl #1036). Without it no session could set a work project's `repo_url`, so SessionStart,
|
|
4
|
+
* which resolves channels by `repo_url`, found no channel for that repo.
|
|
5
|
+
*
|
|
6
|
+
* WHAT THE ENDPOINT ACCEPTS: `name`, `repo_url`, `description`, `tech_stack`, `mission`,
|
|
7
|
+
* `metadata`. It drops every nil, so a request naming none is a 200 that changes nothing:
|
|
8
|
+
* refused here. `slug` never changes, and a body carrying `status` is a 422 (archive and
|
|
9
|
+
* restore have their own routes), so neither is ever sent. An empty `mission` clears it.
|
|
10
|
+
*
|
|
11
|
+
* KEY: orchestrator role on a human-anchored tenant; index.js injects the orchestrator-pinned
|
|
12
|
+
* `apiCall`, as it does for the epic writes.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { uuid as uuidRefusal } from "./delivery-loop.js";
|
|
16
|
+
|
|
17
|
+
export const PROJECT_UPDATABLE = ["name", "repo_url", "description", "tech_stack", "mission", "metadata"];
|
|
18
|
+
|
|
19
|
+
export function projectPath(projectId) {
|
|
20
|
+
return `/api/v1/projects/${encodeURIComponent(projectId)}`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function updateProject(args = {}, { apiCall } = {}) {
|
|
24
|
+
const refused = uuidRefusal(args.project_id, "project_id");
|
|
25
|
+
if (refused) return refused;
|
|
26
|
+
|
|
27
|
+
const body = {};
|
|
28
|
+
for (const key of PROJECT_UPDATABLE) {
|
|
29
|
+
if (args[key] != null) body[key] = args[key];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (Object.keys(body).length === 0) {
|
|
33
|
+
return {
|
|
34
|
+
error: true,
|
|
35
|
+
status: 0,
|
|
36
|
+
body: `update_project needs at least one of ${PROJECT_UPDATABLE.join(", ")}; nothing was sent.`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return apiCall("PATCH", projectPath(args.project_id), body);
|
|
41
|
+
}
|