@taiga-ai/mcp-server 0.37.0-dev.1132 → 0.37.0-dev.1133

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 (2) hide show
  1. package/dist/index.js +349 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -27085,6 +27085,355 @@ object({
27085
27085
  });
27086
27086
  }
27087
27087
  });
27088
+ //#endregion
27089
+ //#region ../../packages/types/dist/auto-merge.js
27090
+ /**
27091
+ * Canonical merge-readiness, provider-agnostic. Each VCS adapter translates
27092
+ * its native vocabulary into exactly one of these.
27093
+ *
27094
+ * Native mappings, for orientation (the adapters own the real ones):
27095
+ *
27096
+ * | Canonical | GitHub `mergeable_state` | GitLab `detailed_merge_status` |
27097
+ * |----------------------|--------------------------|----------------------------------|
27098
+ * | `ready` | `clean`, `has_hooks` | `mergeable` |
27099
+ * | `conflict` | `dirty` | `conflict` |
27100
+ * | `checks_pending` | `unstable` | `ci_still_running` |
27101
+ * | `checks_failed` | `blocked` (disambiguated)| `ci_must_pass` |
27102
+ * | `review_required` | `blocked` (disambiguated)| `not_approved` |
27103
+ * | `draft` | `draft` | `draft_status` |
27104
+ * | `behind_base` | `behind` | `need_rebase` |
27105
+ * | `blocked_by_policy` | (none -- see below) | `policies_denied` |
27106
+ * | `pr_not_open` | closed / merged | `not_open` |
27107
+ * | `unknown_retry` | `unknown` | `checking` |
27108
+ */
27109
+ const MERGE_READINESS_STATES = [
27110
+ "ready",
27111
+ "conflict",
27112
+ "checks_pending",
27113
+ "checks_failed",
27114
+ "required_check_missing",
27115
+ "review_required",
27116
+ "draft",
27117
+ "behind_base",
27118
+ "blocked_by_policy",
27119
+ "pr_not_open",
27120
+ "unknown_retry"
27121
+ ];
27122
+ const BLOCKED_REASONS = {
27123
+ conflict: {
27124
+ message: "The branch conflicts with its base, so it cannot merge. Taiga merges the base in and resolves the conflict; if it cannot, it says so on the pull request.",
27125
+ transient: false,
27126
+ clearedWhen: "Taiga resolves the conflict and pushes the result"
27127
+ },
27128
+ checks_pending: {
27129
+ message: "Checks are still running.",
27130
+ transient: true,
27131
+ clearedWhen: "every required check reports"
27132
+ },
27133
+ /**
27134
+ * A required check exists in the repository's rules but has NEVER reported
27135
+ * on this pull request (PRO-1259). Not `checks_pending`: that says a check
27136
+ * is running, and this one has not started -- usually a check the rules
27137
+ * require but nothing is configured to produce (the staging case: a ruleset
27138
+ * demanding CodeQL on a repository with no CodeQL workflow).
27139
+ *
27140
+ * TRANSIENT, deliberately, per this file's own principle: a wrongly-terminal
27141
+ * reason parks a pull request that would have merged, and a slow workflow
27142
+ * can legitimately report late. The honest part is the MESSAGE -- it says
27143
+ * "has not reported at all", and the detail names the check, so a person
27144
+ * can tell a slow start from a rule nothing will ever satisfy.
27145
+ */
27146
+ required_check_missing: {
27147
+ message: "A required check has not reported on this pull request at all.",
27148
+ transient: true,
27149
+ clearedWhen: "the check reports, or the rule requiring it is changed"
27150
+ },
27151
+ checks_failed: {
27152
+ message: "A check is failing.",
27153
+ transient: true,
27154
+ clearedWhen: "the failing check passes on a new commit"
27155
+ },
27156
+ /**
27157
+ * Somebody, or something, still owes a review. This is also how a customer's
27158
+ * OWN reviewer bot blocks us: if they made it a required check, the provider
27159
+ * reports the pull request as blocked and we wait. That is the whole of our
27160
+ * third-party-reviewer handling, and it is deliberately theirs to declare
27161
+ * rather than ours to infer.
27162
+ */
27163
+ review_required: {
27164
+ message: "The pull request still needs a review.",
27165
+ transient: true,
27166
+ clearedWhen: "the outstanding review is submitted"
27167
+ },
27168
+ draft: {
27169
+ message: "The pull request is still a draft.",
27170
+ transient: true,
27171
+ clearedWhen: "the pull request is marked ready for review"
27172
+ },
27173
+ behind_base: {
27174
+ message: "The branch is behind its base and the repository requires it to be up to date.",
27175
+ transient: true,
27176
+ clearedWhen: "the branch is updated from its base"
27177
+ },
27178
+ /**
27179
+ * The provider refused for a rule we cannot see into -- GitLab push rules,
27180
+ * an org policy. Terminal from our side: we have no way to satisfy it and no
27181
+ * way to observe it changing.
27182
+ *
27183
+ * GitHub does NOT produce this. Its `has_hooks` looks like a policy block
27184
+ * and is not one: it means "mergeable, and this repository has pre-receive
27185
+ * hooks", so it maps to `ready`. A hook that actually rejects does so at
27186
+ * merge time and arrives as `merge_refused`. Reading `has_hooks` as a block
27187
+ * would permanently park every pull request on a hook-enabled GitHub
27188
+ * Enterprise repository -- which is Taiga's own forge.
27189
+ */
27190
+ blocked_by_policy: {
27191
+ message: "A repository policy blocks this merge.",
27192
+ transient: false,
27193
+ clearedWhen: "the repository policy that refused the merge is changed or satisfied"
27194
+ },
27195
+ /**
27196
+ * The provider has not finished computing mergeability. NOT a refusal, and
27197
+ * treating it as one would stall every fast-moving pull request -- GitHub
27198
+ * computes this asynchronously and returns null on a cold read.
27199
+ */
27200
+ unknown_retry: {
27201
+ message: "The provider has not finished working out whether this can merge.",
27202
+ transient: true,
27203
+ clearedWhen: "the provider finishes computing mergeability, usually within seconds"
27204
+ },
27205
+ /**
27206
+ * The pull request is closed, or already merged. Terminal: a closed pull
27207
+ * request does not reopen itself, and an already-merged one is the observed
27208
+ * merge path's business rather than ours.
27209
+ *
27210
+ * The executor should not normally ask about a pull request in this state,
27211
+ * so reaching this reason means something upstream is stale. It exists so
27212
+ * that case surfaces as itself instead of being forced into a wrong mapping.
27213
+ */
27214
+ pr_not_open: {
27215
+ message: "The pull request is no longer open.",
27216
+ transient: false,
27217
+ clearedWhen: "never on its own; a closed pull request has to be reopened by a person"
27218
+ },
27219
+ /**
27220
+ * The repository's provider has no merge adapter, or its adapter declares it
27221
+ * cannot merge. The core must check the capability rather than assume it,
27222
+ * so this is a real outcome and not a theoretical one.
27223
+ */
27224
+ provider_unsupported: {
27225
+ message: "Taiga cannot merge automatically on this source-control provider yet.",
27226
+ transient: false,
27227
+ clearedWhen: "a merge adapter ships for this provider"
27228
+ },
27229
+ /**
27230
+ * The repository allows none of the three merge methods Taiga can use.
27231
+ * Terminal, and detected at SELECTION time from a fresh capability read --
27232
+ * which is what licenses the terminality. A stale-cache method refusal at
27233
+ * merge time is `merge_refused` instead (transient, cache busted), because
27234
+ * the next attempt re-reads and self-corrects; this reason is reserved for
27235
+ * the case a fresh read just proved cannot.
27236
+ */
27237
+ merge_method_unavailable: {
27238
+ message: "The repository does not allow any merge method Taiga can use.",
27239
+ transient: false,
27240
+ clearedWhen: "merge commits, rebase merging or squash merging is enabled on the repository"
27241
+ },
27242
+ /**
27243
+ * A transient block never cleared within the attempt budget (PRO-1166).
27244
+ *
27245
+ * The provider has no timeout of its own -- a required check that never
27246
+ * reports blocks with "waiting" forever, and only a human can clear it. Our
27247
+ * attempt budget is the only bound, so when its last attempt is spent on a
27248
+ * reason that was supposed to clear on its own, the run parks under THIS
27249
+ * reason rather than staying frozen on one that still promises "Taiga will
27250
+ * merge as soon as that clears" -- a promise the spent budget just broke.
27251
+ * Written by the repository layer, never by an adapter.
27252
+ */
27253
+ attempts_exhausted: {
27254
+ message: "Auto-merge retried for its full window and the block never cleared.",
27255
+ transient: false,
27256
+ clearedWhen: "never on its own; the pull request is yours to merge by hand"
27257
+ },
27258
+ /**
27259
+ * We asked the provider to merge and it declined. Distinct from the
27260
+ * readiness states above: those are answers to "may this merge", this is an
27261
+ * answer to "merge it". A race (someone pushed between the two calls) is the
27262
+ * usual cause, which is why it is transient. Also covers a merge-method
27263
+ * refusal from a stale capability cache: the adapter busts its cache on that
27264
+ * answer, so the next attempt re-reads and picks a method the repository
27265
+ * allows.
27266
+ */
27267
+ merge_refused: {
27268
+ message: "The provider declined the merge.",
27269
+ transient: true,
27270
+ clearedWhen: "the condition the provider objected to changes, or the next attempt races differently"
27271
+ },
27272
+ /**
27273
+ * The run did not finish its plan. A run with some steps failed and a pull
27274
+ * request open settles `needs_review` (the mixed-outcome rule, PRO-409) so
27275
+ * a person can triage the passing work -- which also made it claimable by
27276
+ * auto-merge, and a green CI on half a plan is not consent to ship half a
27277
+ * plan. Terminal: no retry changes how many steps completed, and the
27278
+ * decision is the customer's. The detail carries the count.
27279
+ */
27280
+ /**
27281
+ * A fix for maintenance findings whose independent re-scan has not reported
27282
+ * yet (PRO-3559). A dependency fix may merge itself only on the re-scan's
27283
+ * word that the vulnerability is gone -- that verdict is what makes merging
27284
+ * it unread defensible at all -- so it waits for the verdict like a pending
27285
+ * check. TRANSIENT: the re-scan runs when the pull request is ready.
27286
+ */
27287
+ remediation_unverified: {
27288
+ message: "The fix has not been re-scanned yet, so it waits before merging on its own.",
27289
+ transient: true,
27290
+ clearedWhen: "the independent re-scan of the fix branch reports the vulnerability gone"
27291
+ },
27292
+ /**
27293
+ * The re-scan found the vulnerability still there, or could not tell
27294
+ * (PRO-3559). TERMINAL: the verdict is settled for this branch, and a fix
27295
+ * that did not verifiably fix is a person's to merge or not. The detail
27296
+ * names the verdict.
27297
+ */
27298
+ /**
27299
+ * The fix resolves to a release younger than the minimum age, or one whose
27300
+ * age is unknown (PRO-3568): a fresh release is when a hijacked or broken
27301
+ * version is still being noticed. TERMINAL: the pull request is a person's.
27302
+ */
27303
+ remediation_release_too_new: {
27304
+ message: "The fix installs a release too new to merge on its own, so this pull request waits for a person.",
27305
+ transient: false,
27306
+ clearedWhen: "never on its own; merge it by hand if the change is sound"
27307
+ },
27308
+ remediation_not_fixed: {
27309
+ message: "The re-scan did not confirm the fix, so this pull request waits for a person.",
27310
+ transient: false,
27311
+ clearedWhen: "never on its own; merge it by hand if the change is sound"
27312
+ },
27313
+ /**
27314
+ * The build brought in a package under a licence the organization has not
27315
+ * approved (PRO-2947), and hardening could not replace it. TERMINAL:
27316
+ * re-asking does not change what the branch installs, and accepting a
27317
+ * licence is the organization's decision. The detail names each package and
27318
+ * its licence.
27319
+ */
27320
+ license_not_approved: {
27321
+ message: "A package this change adds has a licence your organization has not approved, so this pull request waits for a person.",
27322
+ transient: false,
27323
+ clearedWhen: "never on its own; replace the package, or approve the licence in Policies > Licenses and merge by hand"
27324
+ },
27325
+ plan_incomplete: {
27326
+ message: "Not every planned step completed, so this pull request waits for a person to decide.",
27327
+ transient: false,
27328
+ clearedWhen: "never on its own; the pull request is yours to merge by hand if the partial work is wanted"
27329
+ },
27330
+ /**
27331
+ * An earlier pull request of the same change has not merged (PRO-2526). A
27332
+ * plan across repositories merges its pull requests in the order it states
27333
+ * -- the service before the client that calls it -- so this one waits for
27334
+ * every one before it. The detail names the repositories it waits for.
27335
+ *
27336
+ * TRANSIENT, and recording it spends none of the attempt budget: the wait
27337
+ * is on another pull request, which can take days, and the earlier one's
27338
+ * merge re-arms this one.
27339
+ */
27340
+ awaiting_earlier_merge: {
27341
+ message: "An earlier pull request of this change has to merge first.",
27342
+ transient: true,
27343
+ clearedWhen: "every pull request before it in the merge order has merged"
27344
+ },
27345
+ /**
27346
+ * Nothing ever reported on the pull request head, and the auto-merge window
27347
+ * ran out waiting (PRO-1836).
27348
+ *
27349
+ * The CI-convergence poll settles a head that nothing reports on, once it has
27350
+ * positively established that (every read succeeded, no check-run, check
27351
+ * suite, commit status or workflow run exists, no CI-skip marker, a grace
27352
+ * period elapsed). This reason is for the case that never resolved: a read
27353
+ * that kept failing, a suppressed-CI head nobody re-pushed, a check that
27354
+ * stayed pending for a day. The run then aged out of the poll silently, and
27355
+ * the initiative went on rendering "Merging on its own" forever, because the
27356
+ * absence of a reason is what that reading is derived from.
27357
+ *
27358
+ * TERMINAL, and it is a statement about US rather than about the pull
27359
+ * request: we stopped watching. The window is the only bound we have, and
27360
+ * nothing about the pull request changed when it expired, so re-asking on
27361
+ * the same schedule would re-ask forever. Same shape as
27362
+ * `attempts_exhausted`, which is why a submitted review earns a fresh budget
27363
+ * here too -- see `reviewEarnsFreshBudget`. That reset also re-arms the CI
27364
+ * poll, so the next window gets a genuine second look rather than a retry of
27365
+ * the same silence.
27366
+ */
27367
+ ci_never_settled: {
27368
+ message: "Checks never finished within the auto-merge window, so this pull request is yours to merge.",
27369
+ transient: false,
27370
+ clearedWhen: "never on its own; a submitted review starts a fresh window, otherwise merge it by hand"
27371
+ },
27372
+ /**
27373
+ * CI went green, but it went green on commits the CI-fix loop wrote, and
27374
+ * those commits touched something that decides whether CI passes -- a
27375
+ * workflow file, or a deleted test. A green reached that way is not evidence
27376
+ * the code works, so the run stops and a person decides (PRO-584, PRO-898).
27377
+ *
27378
+ * TERMINAL, and unusually so among these: the others describe a condition
27379
+ * that might change. This one describes what a diff CONTAINS, and no amount
27380
+ * of re-asking alters that. It is also why a submitted review does not earn
27381
+ * a fresh budget here -- `reviewEarnsFreshBudget` reads exactly this
27382
+ * transient flag, and clicking Review PR asks for another agent pass rather
27383
+ * than saying "I read the change and I accept it". Until an affordance means
27384
+ * the second thing, merging this is a person's act.
27385
+ *
27386
+ * The detail names the file, because "Taiga will not merge this" is only
27387
+ * actionable if you know what it objected to (the PRO-1564 incident: a
27388
+ * one-line `await` added to a workflow, blocked silently for an hour).
27389
+ */
27390
+ check_weakening_suspected: {
27391
+ message: "CI turned green on commits that changed how CI itself runs, so this pull request waits for a person.",
27392
+ transient: false,
27393
+ clearedWhen: "never on its own; review the change to the checks and merge by hand if it is sound"
27394
+ }
27395
+ };
27396
+ Object.keys(BLOCKED_REASONS);
27397
+ //#endregion
27398
+ //#region ../../packages/types/dist/run-pull-request.js
27399
+ /**
27400
+ * A run's pull request as its page reads it from the forge (PRO-4667, PRO-4668):
27401
+ * whether it may merge and why not, how much it changes, and how many approvals
27402
+ * it has. Read on request, never synced: the forge's answer moves with every
27403
+ * push, review and check.
27404
+ */
27405
+ /**
27406
+ * How many files and lines a pull request changes. `additions` and `deletions`
27407
+ * are null where the forge does not count lines (an Azure DevOps pull request).
27408
+ * `source` says who counted: the factory, from its checkout, or the forge.
27409
+ */
27410
+ const runDiffStatSchema = object({
27411
+ files: number$1().int().nonnegative(),
27412
+ additions: number$1().int().nonnegative().nullable(),
27413
+ deletions: number$1().int().nonnegative().nullable(),
27414
+ source: _enum(["factory", "forge"])
27415
+ });
27416
+ const blockedReasons = Object.keys(BLOCKED_REASONS);
27417
+ object({
27418
+ /**
27419
+ * Whether it may merge, as the forge answers: `ready`, or the state that
27420
+ * keeps it, with the reason the page says. `unsupported` where Taiga cannot
27421
+ * merge on the run's forge, or reach it.
27422
+ */
27423
+ mergeability: object({
27424
+ state: union([_enum(MERGE_READINESS_STATES), literal("unsupported")]),
27425
+ reason: _enum(blockedReasons).nullable(),
27426
+ detail: string$2().nullable()
27427
+ }),
27428
+ diff: runDiffStatSchema.nullable(),
27429
+ /** People whose newest review approves it; null where the forge's reviews could not be read. */
27430
+ approvals: number$1().int().nonnegative().nullable()
27431
+ });
27432
+ object({
27433
+ merged: boolean(),
27434
+ reason: _enum(blockedReasons).nullable(),
27435
+ detail: string$2().nullable()
27436
+ });
27088
27437
  [...BUILD_RUN_ACTIVE_STATUSES.filter((s) => s !== "reviewing")];
27089
27438
  //#endregion
27090
27439
  //#region ../../packages/types/dist/agents.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.37.0-dev.1132",
3
+ "version": "0.37.0-dev.1133",
4
4
  "description": "Taiga for AI coding assistants: read products, policies, initiatives and runs, and operate the line, over MCP",
5
5
  "mcpName": "ga.tai/mcp-server",
6
6
  "license": "UNLICENSED",