loopctl-mcp-server 2.42.0 → 2.44.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/index.js +87 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -402,6 +402,41 @@ async function createProject({ name, slug, repo_url, description, tech_stack, mi
|
|
|
402
402
|
return toContent(result);
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
+
async function createKbScope({ name, slug, repo_url, description, tech_stack }) {
|
|
406
|
+
const body = { name, slug };
|
|
407
|
+
if (repo_url) body.repo_url = repo_url;
|
|
408
|
+
if (description) body.description = description;
|
|
409
|
+
if (tech_stack) body.tech_stack = tech_stack;
|
|
410
|
+
// Uses the AGENT key (not ORCH): a KB scope is agent-createable on the KB tier — that is
|
|
411
|
+
// the whole point. The server forces kind: :kb; a body-supplied kind is ignored.
|
|
412
|
+
const result = await apiCall("POST", "/api/v1/kb-scopes", body, process.env.LOOPCTL_AGENT_KEY);
|
|
413
|
+
return toContent(result);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
async function archiveKbScope({ project_id }) {
|
|
417
|
+
// Reversible soft-delete of an agent-owned :kb scope on the AGENT key; frees its
|
|
418
|
+
// max_projects slot. The server rejects a :work project (422). Reverse with restore_kb_scope.
|
|
419
|
+
const result = await apiCall(
|
|
420
|
+
"DELETE",
|
|
421
|
+
`/api/v1/kb-scopes/${project_id}`,
|
|
422
|
+
null,
|
|
423
|
+
process.env.LOOPCTL_AGENT_KEY,
|
|
424
|
+
);
|
|
425
|
+
return toContent(result);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
async function restoreKbScope({ project_id }) {
|
|
429
|
+
// Re-activate an archived :kb scope on the AGENT key (re-consumes a max_projects slot;
|
|
430
|
+
// 422 if at the cap). The server rejects a :work project (422).
|
|
431
|
+
const result = await apiCall(
|
|
432
|
+
"POST",
|
|
433
|
+
`/api/v1/kb-scopes/${project_id}/restore`,
|
|
434
|
+
{},
|
|
435
|
+
process.env.LOOPCTL_AGENT_KEY,
|
|
436
|
+
);
|
|
437
|
+
return toContent(result);
|
|
438
|
+
}
|
|
439
|
+
|
|
405
440
|
async function deleteProject({ project_id }) {
|
|
406
441
|
const result = await apiCall(
|
|
407
442
|
"DELETE",
|
|
@@ -2100,6 +2135,49 @@ const TOOLS = [
|
|
|
2100
2135
|
required: ["name", "slug"],
|
|
2101
2136
|
},
|
|
2102
2137
|
},
|
|
2138
|
+
{
|
|
2139
|
+
name: "create_kb_scope",
|
|
2140
|
+
description:
|
|
2141
|
+
"Create a knowledge-only project scope (kind: kb) for the current tenant. Unlike create_project (work project, orchestrator+ / human-anchored), this is available to an agent-rooted (KB-tier) tenant with an agent key: a kb scope carries NO chain-of-custody / work-breakdown surface (it cannot host epics/stories/dispatch/ui-tests), it exists only to partition knowledge articles by repo so captured/created articles can be project-scoped. Then resolve_project by its repo_url/slug and pass the returned id as project_id on article/knowledge writes. Counts toward the tenant's max_projects budget.",
|
|
2142
|
+
inputSchema: {
|
|
2143
|
+
type: "object",
|
|
2144
|
+
properties: {
|
|
2145
|
+
name: { type: "string", description: "Scope name (often the repo name)." },
|
|
2146
|
+
slug: { type: "string", description: "URL-safe slug (often the repo basename)." },
|
|
2147
|
+
repo_url: {
|
|
2148
|
+
type: "string",
|
|
2149
|
+
description: "Repo URL, so resolve_project can map a repo to this scope.",
|
|
2150
|
+
},
|
|
2151
|
+
description: { type: "string", description: "Scope description." },
|
|
2152
|
+
tech_stack: { type: "string", description: "Tech stack summary." },
|
|
2153
|
+
},
|
|
2154
|
+
required: ["name", "slug"],
|
|
2155
|
+
},
|
|
2156
|
+
},
|
|
2157
|
+
{
|
|
2158
|
+
name: "archive_kb_scope",
|
|
2159
|
+
description:
|
|
2160
|
+
"Archive (reversible soft-delete) a knowledge-only project scope (kind: kb) you own, on the agent key. Frees the scope's slot in the tenant's max_projects budget so you can reclaim KB-scope capacity — the reverse of create_kb_scope. Its articles remain readable/writable; restore_kb_scope re-activates it. Rejects a kind: work project (422) — archiving a work project stays human-anchored. Idempotent on an already-archived scope.",
|
|
2161
|
+
inputSchema: {
|
|
2162
|
+
type: "object",
|
|
2163
|
+
properties: {
|
|
2164
|
+
project_id: { type: "string", description: "UUID of the :kb scope to archive." },
|
|
2165
|
+
},
|
|
2166
|
+
required: ["project_id"],
|
|
2167
|
+
},
|
|
2168
|
+
},
|
|
2169
|
+
{
|
|
2170
|
+
name: "restore_kb_scope",
|
|
2171
|
+
description:
|
|
2172
|
+
"Restore (re-activate) an archived knowledge-only project scope (kind: kb) you own, on the agent key — the reverse of archive_kb_scope. Re-activating consumes an active max_projects slot, so it is rejected (422) when the tenant is at its cap. Rejects a kind: work project (422).",
|
|
2173
|
+
inputSchema: {
|
|
2174
|
+
type: "object",
|
|
2175
|
+
properties: {
|
|
2176
|
+
project_id: { type: "string", description: "UUID of the archived :kb scope to restore." },
|
|
2177
|
+
},
|
|
2178
|
+
required: ["project_id"],
|
|
2179
|
+
},
|
|
2180
|
+
},
|
|
2103
2181
|
{
|
|
2104
2182
|
name: "delete_project",
|
|
2105
2183
|
description:
|
|
@@ -4860,6 +4938,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
4860
4938
|
case "create_project":
|
|
4861
4939
|
return await createProject(args);
|
|
4862
4940
|
|
|
4941
|
+
case "create_kb_scope":
|
|
4942
|
+
return await createKbScope(args);
|
|
4943
|
+
|
|
4944
|
+
case "archive_kb_scope":
|
|
4945
|
+
return await archiveKbScope(args);
|
|
4946
|
+
|
|
4947
|
+
case "restore_kb_scope":
|
|
4948
|
+
return await restoreKbScope(args);
|
|
4949
|
+
|
|
4863
4950
|
case "delete_project":
|
|
4864
4951
|
return await deleteProject(args);
|
|
4865
4952
|
|