loopctl-mcp-server 3.11.1 → 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 +2 -1
- package/index.js +31 -5
- 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
|
|
|
@@ -543,7 +544,7 @@ The order to wire it up, the stage machine these tools move a story through, and
|
|
|
543
544
|
| `escalation_playbook` | **What to do with a stuck story**, from finding it to closing it: what each `reason_class` means, which `resolve_escalation` target fits (`queued` run again, `detected` triage again, `done` accept, `failed` drop), and the steps to take a story over in this session: leave it escalated, do not `claim_story`, salvage the runner's branch when `run.work_left_behind` is `"true"`, fix it through the normal delivery loop with a PR that says `Fixes #<issue>`, then `resolve_escalation` `to: "done"` citing the PR. Optional: `reason_class`. Local: sends nothing, needs no key. Same text as the `stuck_story` prompt. |
|
|
544
545
|
| `force_unclaim_story` | **Take a story back from the agent holding it** (`POST /api/v1/stories/:id/force-unclaim`). Resets it to `agent_status: pending` with `assigned_agent_id` cleared AND makes the delivery stage row follow the release back to `queued`. **A delivery story then goes to `escalated`, not back to the queue** (loopctl US-44.4): an operator taking a story back is a human decision, so a release that leaves the stage row at `queued` escalates it over `operator_released` in the same transaction, spending no attempt against the retry ceiling — it is not left in the queue behind the human's back. Put it back to work with `resolve_escalation` `to: queued`, which releases (a no-op by then) AND re-contracts. A story with no delivery stage row is simply left `pending`. A story parked at `claimed` with nobody on it is the residue of a compensation that did not complete, not what a refused dispatch normally leaves: placement releases the claim inline when a runner refuses, and the claim lease releases it unattended once `claimed_until` passes — reach for this to get it back now, or when both of those left it held. Requeues from any stage a claim holds; a stage no claim holds keeps its stage and is rebound to the new epoch; `done` and `failed` are untouched. For an ESCALATED story use `resolve_escalation` instead — that one releases AND re-contracts, so its `queued` really is placeable. Requires an orchestrator-ROLE key: the action is `exact_role: :orchestrator`, so a user or superadmin key is 403'd like any other non-member. Put it in `LOOPCTL_ORCH_KEY` (which is then the key sent, and a global `LOOPCTL_API_KEY` does not displace it) or, with no orchestrator key set, in `LOOPCTL_API_KEY`. The orchestrator key must be linked to a registered agent (400 otherwise) and the tenant must be human-anchored (403 `custody_tier_required` otherwise). Does not touch `verified_status`. Run again on an already-pending story it is still an operator's release: a row stranded behind the story's claim epoch is rebound, an in-flight row is requeued, and a row then at `queued` — including one already sitting there — is escalated over `operator_released`, as on the first run; a row already escalated, or anywhere else at that epoch, is left alone. Every 500 means the whole release rolled back and the story is still claimed: `audit_chain_append_failed` (the escalation's chain entry was refused) is a server-side condition a re-run meets again until an operator acts; `force_unclaim_failed` (the server log names the step) — call it again. A 422 means the release write itself was rejected. No request body. Required: `story_id` (refused locally if it is not a UUID). |
|
|
545
546
|
| `merge_precondition` | **Run the merge gate over a story's real pull request** (`POST /api/v1/stories/:id/merge-precondition`). Both delivery gates run again over the diff that exists, plus custody, the 12-file / 1000-line hard bound, the head-has-not-moved check and the self-deploy exclusion; the story must be at stage `ci`. **Gate A reads what triage persisted, never the caller**: the lens verdicts recorded with the story's most recent triage, or a human's re-queue of a Gate A escalation — `gate_a_inputs` on the answer says which, and `missing` refuses with `gate_a_inputs_missing`. This tool sends no trio. Decisions: `allow` (recorded against the head; the only thing that licenses a merge), `refuse` (the story is escalated before this returns), `already_merged`, `head_moved`, `unevaluated` (503 with `Retry-After`). Requires an orchestrator- or user-ROLE key (`exact_role: [:orchestrator, :user]`, so an agent key is 403'd); `LOOPCTL_ORCH_KEY` is sent when set, else `LOOPCTL_API_KEY`. 403 `custody_tier_required` without a human anchor, 404 for an unknown story, 409 `change_protocol_enrolled` when the story's intake source is in mode `chg` (the PR route is closed; land with `chg submit` — decided before any GitHub read, nothing escalated), 422 when the story is not at `ci`. Required: `story_id` (refused locally if not a UUID) and `claim_epoch` (a non-negative integer, refused locally otherwise); optional `effect_proof`. |
|
|
546
|
-
| `intake_source_enroll` | **Bind a GitHub repository to a work project and mint its webhook secret** (`POST /api/v1/intake/sources`) — the step that gives the delivery loop an input, and the row `place_dispatch` reads `repo` and `base_branch` from (its 409 `no_intake_source` means this has not been done; 409 `ambiguous_intake_source` means it has been done twice). **The secret is returned ONCE and can never be read again** — the column is encrypted at rest and redacted on the schema, so no other tool carries it and losing it costs a revoke, a re-enrolment and a reconfigured GitHub webhook. **This tool does not return it either:** a tool result lands in the transcript and the audit log, so it is written to the required `secret_file` with mode 0600 (the handling `runner_enroll` gives a runner credential) and the result carries the source row, the `webhook_url` and that path. The path is reserved before the request, so an existing file or an unwritable directory is refused with nothing enrolled, and any outcome that is not a clean creation withholds the response body — an unparsed 2xx body IS the secret. A 2xx carrying the source and the secret but no webhook path is RECOVERED rather than discarded (the path is derived from the source id, flagged `webhook_url_derived`), and an outcome that proves a source id but no usable secret REVOKES that source rather than leaving it holding the repository's unique slot. Then configure GitHub: Payload URL = the returned `webhook_url`, content type `application/json`, Secret = the contents of the file, and the **Issues** event only — `gh api repos/OWNER/REPO/hooks -f name=web -f config[url]=<webhook_url> -f config[content_type]=json -f config[secret]="$(cat <secret_file>)" -f 'events[]=issues'`. Every later delivery failure is the SAME 401 `invalid_signature` — unknown or revoked source, suspended tenant, missing or wrong signature, or a payload whose `repository.full_name` does not match — so the webhook's Recent Deliveries tab cannot tell you which. `base_branch` is set HERE: it defaults to `master` when the body does not name it, so name `main` for a repository created on GitHub since 2020 or every dispatch is cut from a trunk that does not exist. It is not nullable (a dispatch must name a branch), so null or blank is refused rather than falling back to the default, and `intake_source_update` changes it afterwards. Refusals: 403 `api_key_mint_forbidden` if your key was minted by a dispatch (this mints a credential belonging to no lineage, so only an unlineaged operator key may), 403 `custody_tier_required` on an agent-rooted tenant, 422 for a repository that is not `owner/name`, an ACTIVE source already binding it, a project that is missing / archived / not a work project, or a `target_epic_id` outside that project. `mode` is the merge route: `pr` (the default when omitted; the merge gate reads a pull request) or `chg` (Epic 47: the change protocol lands the repository's changes with `chg submit`, and `merge_precondition` refuses every story on the source with 409 `change_protocol_enrolled`); any other value, null included, is refused. A `chg` enrolment needs `change_events_secret` (or, preferred, `change_events_secret_file`, a path the tool reads so the value never enters the transcript) AND `chg_root_dispatch_id` in the same call — refused locally and 422 at the server without them — and a root that is not a parentless, unrevoked, orchestrator-role dispatch of this tenant is 422 `chg_root_invalid` (a child, a revoked or agent-role dispatch, another tenant's and an unknown id all alike). The change-events secret is write-only: no response and no tool result ever carries it. `required_checks` are the CI checks story verification judges a story's commit by, GitHub Actions job names, bounded in number and length by the server; `local-gate` is refused because whoever pushed posts it. Story verification judges a story's commit against the same `required_checks` in EITHER mode, satisfied only by a job of a push run of the story's branch; it first needs a GitHub credential for this tenant, its own token (`set_github_credential`) or an entry in the operator's `VERIFICATION_OPERATOR_TOKEN_TENANTS` (`credential_unavailable` otherwise, whatever the list holds); then a `pr` source that names none records `no_required_checks` and reads nothing, so naming them is how a pr source opts in, and a source that names some has its (tenant, repository) credential resolved before any GitHub read (`credential_unavailable` if there is none). Required: `repo_full_name`, `project_id`, `secret_file`. `triage_requires_ticket` decides which issues are triaged at all: false (the default), every issue the webhook delivers; true, only an issue HomeCareBilling filed from a support ticket (its single `#HCB-xxxxxxxx` Ticket line confirmed by the HomeCareBilling footer, which intake records as `ticket_id`), and every other issue stays
|
|
547
|
+
| `intake_source_enroll` | **Bind a GitHub repository to a work project and mint its webhook secret** (`POST /api/v1/intake/sources`) — the step that gives the delivery loop an input, and the row `place_dispatch` reads `repo` and `base_branch` from (its 409 `no_intake_source` means this has not been done; 409 `ambiguous_intake_source` means it has been done twice). **The secret is returned ONCE and can never be read again** — the column is encrypted at rest and redacted on the schema, so no other tool carries it and losing it costs a revoke, a re-enrolment and a reconfigured GitHub webhook. **This tool does not return it either:** a tool result lands in the transcript and the audit log, so it is written to the required `secret_file` with mode 0600 (the handling `runner_enroll` gives a runner credential) and the result carries the source row, the `webhook_url` and that path. The path is reserved before the request, so an existing file or an unwritable directory is refused with nothing enrolled, and any outcome that is not a clean creation withholds the response body — an unparsed 2xx body IS the secret. A 2xx carrying the source and the secret but no webhook path is RECOVERED rather than discarded (the path is derived from the source id, flagged `webhook_url_derived`), and an outcome that proves a source id but no usable secret REVOKES that source rather than leaving it holding the repository's unique slot. Then configure GitHub: Payload URL = the returned `webhook_url`, content type `application/json`, Secret = the contents of the file, and the **Issues** event only — `gh api repos/OWNER/REPO/hooks -f name=web -f config[url]=<webhook_url> -f config[content_type]=json -f config[secret]="$(cat <secret_file>)" -f 'events[]=issues'`. Every later delivery failure is the SAME 401 `invalid_signature` — unknown or revoked source, suspended tenant, missing or wrong signature, or a payload whose `repository.full_name` does not match — so the webhook's Recent Deliveries tab cannot tell you which. `base_branch` is set HERE: it defaults to `master` when the body does not name it, so name `main` for a repository created on GitHub since 2020 or every dispatch is cut from a trunk that does not exist. It is not nullable (a dispatch must name a branch), so null or blank is refused rather than falling back to the default, and `intake_source_update` changes it afterwards. Refusals: 403 `api_key_mint_forbidden` if your key was minted by a dispatch (this mints a credential belonging to no lineage, so only an unlineaged operator key may), 403 `custody_tier_required` on an agent-rooted tenant, 422 for a repository that is not `owner/name`, an ACTIVE source already binding it, a project that is missing / archived / not a work project, or a `target_epic_id` outside that project. `mode` is the merge route: `pr` (the default when omitted; the merge gate reads a pull request) or `chg` (Epic 47: the change protocol lands the repository's changes with `chg submit`, and `merge_precondition` refuses every story on the source with 409 `change_protocol_enrolled`); any other value, null included, is refused. A `chg` enrolment needs `change_events_secret` (or, preferred, `change_events_secret_file`, a path the tool reads so the value never enters the transcript) AND `chg_root_dispatch_id` in the same call — refused locally and 422 at the server without them — and a root that is not a parentless, unrevoked, orchestrator-role dispatch of this tenant is 422 `chg_root_invalid` (a child, a revoked or agent-role dispatch, another tenant's and an unknown id all alike). The change-events secret is write-only: no response and no tool result ever carries it. `required_checks` are the CI checks story verification judges a story's commit by, GitHub Actions job names, bounded in number and length by the server; `local-gate` is refused because whoever pushed posts it. Story verification judges a story's commit against the same `required_checks` in EITHER mode, satisfied only by a job of a push run of the story's branch; it first needs a GitHub credential for this tenant, its own token (`set_github_credential`) or an entry in the operator's `VERIFICATION_OPERATOR_TOKEN_TENANTS` (`credential_unavailable` otherwise, whatever the list holds); then a `pr` source that names none records `no_required_checks` and reads nothing, so naming them is how a pr source opts in, and a source that names some has its (tenant, repository) credential resolved before any GitHub read (`credential_unavailable` if there is none). Required: `repo_full_name`, `project_id`, `secret_file`. `triage_requires_ticket` decides which issues are triaged at all: false (the default), every issue the webhook delivers; true, only an issue HomeCareBilling filed from a support ticket (its single `#HCB-xxxxxxxx` Ticket line confirmed by the HomeCareBilling footer, which intake records as `ticket_id`), and every other issue stays an intake record with no story until it gains a ticket; anything but a boolean is refused. It filters on the format, it does not authenticate: anyone who can open an issue can type it. Optional: `base_branch`, `mode`, `required_checks`, `triage_requires_ticket`, `change_events_secret` / `change_events_secret_file`, `chg_root_dispatch_id`, and `target_epic_id` — **omitting the epic is not a neutral default**: with no epic every triaged report is escalated to a human and every record stays `pending_triage` until `intake_source_update` names one. Requires `LOOPCTL_USER_KEY`. |
|
|
547
548
|
| `intake_source_list` | List the tenant's intake sources (`GET /api/v1/intake/sources`): `id` (the webhook URL is `/api/v1/intake/github/<id>`), `project_id`, `repo_full_name`, `base_branch`, `mode` (`pr` or `chg`), `required_checks`, `triage_requires_ticket`, `chg_root_dispatch_id`, `target_epic_id`, `revoked_at`, timestamps. **The webhook secret is not here and is not anywhere**, and neither is a `chg` source's change-events secret — it is returned once by `intake_source_enroll`, so this is not how to recover one. Use it to find the source behind a 409 `no_intake_source` or `ambiguous_intake_source`, to check a repository's `base_branch` before placing work, and to identify a source left behind by an enrolment whose outcome was unknown. Optional: `include_revoked`. Requires `LOOPCTL_USER_KEY`; the only one of the four that does not also need a human-anchored tenant. |
|
|
548
549
|
| `intake_source_update` | **Set where a source's work lands** (`PATCH /api/v1/intake/sources/:id`): `target_epic_id`, the epic triaged stories are created in, `base_branch`, the branch every dispatch for this repository is cut from, `mode` (`pr` or `chg`), a `chg` source's `change_events_secret` / `change_events_secret_file` and `chg_root_dispatch_id`, and `required_checks`, the checks story verification judges a story's commit by — once the tenant has a GitHub credential, its own token (`set_github_credential`) or an entry in the operator's `VERIFICATION_OPERATOR_TOKEN_TENANTS` (`credential_unavailable` otherwise), a source naming none records `no_required_checks` and reads nothing, and one naming some has its (tenant, repository) credential resolved before any GitHub read (`local-gate` is refused), and `triage_requires_ticket`, which issues are triaged at all (true: only issues HomeCareBilling filed from a support ticket; read at dispatch time, so it reaches stories already waiting at `detected`; null is refused). Presence decides — a field you do not name is left exactly as it was, and naming none of them is 422 `nothing_to_update`. `mode` has no cleared state either, and a null or unknown value is refused locally. Each implement dispatch records the base branch it was placed under, and the merge gate reads that; `mode` is not bound that way — the gate reads the source's current mode. **Switching to `chg` closes the PR route for every story on the source at once** (409 `change_protocol_enrolled`; land with `chg submit`), and the switch itself is 409 `pr_route_in_flight`, naming `story_ids`, while a story of the project sits at `ci` holding a merge allow it has not merged on. The resulting source must carry both credentials, named here or kept from an earlier `chg` stint (422 naming the missing one), and the root is re-checked on every write that leaves the source `chg`, a secret rotation or a base-branch edit included (422 `chg_root_invalid`; switching to `pr` is never blocked by it). Switching to `pr` KEEPS both and ignores them; on a `pr` source an explicit null clears either, on a `chg` source it is a 422. Naming either credential, or setting `mode` to `chg` (which re-activates the kept ones), needs the tenant's operator key, one no dispatch minted (403 `chg_registration_forbidden` otherwise — a key minted by a dispatch beneath yours is refused the same way), and the secret never comes back. **Do not send `target_epic_id: null` to mean "not changing this":** an explicit null is the only way to CLEAR the epic, which returns the source to escalating every report instead of filing a story. `base_branch` has no cleared state and a null there is refused locally. This is how a source already pointed at the wrong trunk is corrected — `intake_source_enroll` takes `base_branch` itself, so a `main` repository no longer needs a second call — and the remedy for a source with no epic — every record from it stays `pending_triage` and is retried until one is named, then they promote on the next run with nothing lost. Revoked sources are 404, not a no-op: revoking clears the target so the epic can be deleted, and repointing one would put that block back. 422 when the epic is not in this source's project. Required: `source_id` (refused locally if it is not a UUID — the server answers the same 404 for malformed and unknown). Requires `LOOPCTL_USER_KEY` and a human-anchored tenant. |
|
|
549
550
|
| `intake_source_revoke` | **Revoke an intake source** (`DELETE /api/v1/intake/sources/:id`). The verb is DELETE and the action is a revoke: `revoked_at` is stamped, the row is kept, and `intake_source_list` still returns it with `include_revoked`; nothing already received is discarded. Afterwards every delivery to that URL is refused 401 `invalid_signature` exactly as a wrong secret is, so the GitHub webhook does not know it has been cut off and should be deleted on the repository too. Idempotent — a second revoke answers 200 with the original `revoked_at`. It frees the repository's uniqueness slot (the index is partial on not-yet-revoked), so a source with a lost secret, a wrong project or a typo'd repository is corrected by revoking and enrolling again; and it clears `target_epic_id`, which is what makes that epic deletable and is the remedy an epic-delete refusal names. Required: `source_id` (refused locally if it is not a UUID). Requires `LOOPCTL_USER_KEY` and a human-anchored tenant. |
|
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.",
|
|
@@ -9327,8 +9350,8 @@ const TOOLS = [
|
|
|
9327
9350
|
"Optional, false when omitted. WHICH ISSUES ARE TRIAGED. False: every issue the " +
|
|
9328
9351
|
"webhook delivers. True: only an issue HomeCareBilling filed from a support " +
|
|
9329
9352
|
"ticket (its single `#HCB-xxxxxxxx` Ticket line confirmed by the HomeCareBilling " +
|
|
9330
|
-
"footer, recorded as `ticket_id`); every other issue stays
|
|
9331
|
-
"
|
|
9353
|
+
"footer, recorded as `ticket_id`); every other issue stays an intake record with " +
|
|
9354
|
+
"no story until it gains a ticket. A format filter, not authentication. Anything but a boolean is refused " +
|
|
9332
9355
|
"(422). Changed " +
|
|
9333
9356
|
"later with intake_source_update.",
|
|
9334
9357
|
},
|
|
@@ -9491,9 +9514,10 @@ const TOOLS = [
|
|
|
9491
9514
|
"WHICH ISSUES ARE TRIAGED. True: only an issue HomeCareBilling filed from a " +
|
|
9492
9515
|
"support ticket (its single `#HCB-xxxxxxxx` Ticket line confirmed by the " +
|
|
9493
9516
|
"HomeCareBilling footer, recorded as `ticket_id`) is sent to triage; a format " +
|
|
9494
|
-
"filter, not authentication. Every other issue stays
|
|
9495
|
-
"
|
|
9496
|
-
"
|
|
9517
|
+
"filter, not authentication. Every other issue stays an intake record with no " +
|
|
9518
|
+
"story until it gains a ticket. False: every issue is promoted and triaged. Read " +
|
|
9519
|
+
"on every pass, so it reaches the stories and records already waiting. Null is " +
|
|
9520
|
+
"refused; omit the field to leave it alone.",
|
|
9497
9521
|
},
|
|
9498
9522
|
},
|
|
9499
9523
|
required: ["source_id"],
|
|
@@ -10258,6 +10282,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
10258
10282
|
case "delete_project":
|
|
10259
10283
|
return await deleteProject(args);
|
|
10260
10284
|
|
|
10285
|
+
case "update_project":
|
|
10286
|
+
return await updateProject(args);
|
|
10261
10287
|
case "restore_project":
|
|
10262
10288
|
return await restoreProject(args);
|
|
10263
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
|
+
}
|