@taiga-ai/mcp-server 0.37.0-dev.1095 → 0.37.0-dev.1097

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 +177 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -24364,6 +24364,54 @@ const optionalLineAnchor = number$1().int().min(0).optional().transform((v) => v
24364
24364
  */
24365
24365
  const AGENT_RUNTIMES = ["legacy", "engineer"];
24366
24366
  //#endregion
24367
+ //#region ../../packages/types/dist/auroras.js
24368
+ /**
24369
+ * Where a deposit in the Aurora bank came from (PRO-4361), with its
24370
+ * `externalRef` unique per source: `included` (a plan's month, the month as the
24371
+ * ref), `ops` (ops-auroras.sh grant-auroras, a person's reason as the ref),
24372
+ * `stripe` (a purchase, its payment as the ref) and `subscription` (a month
24373
+ * of an Aurora subscription, PRO-4367, its invoice as the ref).
24374
+ */
24375
+ const AURORA_DEPOSIT_SOURCES = [
24376
+ "included",
24377
+ "ops",
24378
+ "stripe",
24379
+ "subscription"
24380
+ ];
24381
+ //#endregion
24382
+ //#region ../../packages/types/dist/billing.js
24383
+ /**
24384
+ * The billing seam (PRO-3997): what Taiga holds about a tenant's paid
24385
+ * subscription, whichever billing engine sells it. Taiga owns what an
24386
+ * organization may do (its plan, entitlements, Auroras); the engine owns
24387
+ * money. A provider adapter turns the engine's webhooks into the neutral
24388
+ * subscription state below, and that state moves the plan; nothing else in
24389
+ * the app names a provider.
24390
+ */
24391
+ /**
24392
+ * A subscription's state as Taiga applies it: `active` and `past_due` hold
24393
+ * the plan (what a failed payment leads to is PRO-57's), `ended` returns the
24394
+ * organization to the plan it was on before. A cancellation booked for the
24395
+ * period end is `cancelAtPeriodEnd`, not a status: the plan holds until then.
24396
+ */
24397
+ const BILLING_SUBSCRIPTION_STATUSES = [
24398
+ "active",
24399
+ "past_due",
24400
+ "ended"
24401
+ ];
24402
+ /** Why the last automatic top-up did not happen: the card was refused, or the month's limit was reached. */
24403
+ const AURORA_AUTO_TOP_UP_FAILURES = [
24404
+ "card_declined",
24405
+ "authentication_required",
24406
+ "monthly_max",
24407
+ "failed"
24408
+ ];
24409
+ /** The bounds on an automatic top-up rule (PRO-4390). */
24410
+ const AUTO_TOP_UP_LIMITS = {
24411
+ maxBelow: 2e4,
24412
+ maxMonthly: 4e4
24413
+ };
24414
+ //#endregion
24367
24415
  //#region ../../packages/types/dist/iso-countries.js
24368
24416
  /**
24369
24417
  * Every country in ISO 3166-1 (PRO-4404): the alpha-2 code and an English
@@ -26819,6 +26867,7 @@ discriminatedUnion("kind", [
26819
26867
  what: string$2().min(1).max(2e3),
26820
26868
  currently_handling: string$2().min(1).max(2e3),
26821
26869
  hosts: array(string$2().min(1).max(253)).max(20).optional(),
26870
+ bigger_machine: boolean().optional(),
26822
26871
  stepId: optionalUuid
26823
26872
  }),
26824
26873
  object({
@@ -28936,7 +28985,7 @@ const answerValue = string$2().trim().min(1).max(64);
28936
28985
  const justification = string$2().trim().max(2e3);
28937
28986
  const notApplicableReason = string$2().trim().min(1).max(1200);
28938
28987
  strictObject({ comment: string$2().trim().min(1).max(PLAN_REJECTION_COMMENT_MAX_CHARS) });
28939
- strictObject({ expectedRunId: uuid.optional() }), strictObject({ force: boolean().optional() });
28988
+ object({ auroras: number$1().nullable() }), strictObject({ expectedRunId: uuid.optional() }), strictObject({ force: boolean().optional() });
28940
28989
  object({
28941
28990
  status: _enum(BUILD_OVERVIEW_STATUSES),
28942
28991
  document: string$2().nullable(),
@@ -28986,7 +29035,8 @@ strictObject({
28986
29035
  });
28987
29036
  /** A regulation's id in the catalogue, as its routes take it (PRO-3420). */
28988
29037
  const regulationId = string$2().min(1).max(100).regex(/^[a-z0-9-]+$/);
28989
- object({
29038
+ /** A plan the organization can move to, as Change plan offers it. */
29039
+ const planCatalogueSchema = array(object({
28990
29040
  key: string$2(),
28991
29041
  name: string$2(),
28992
29042
  aurorasPayForBuilding: boolean(),
@@ -28995,6 +29045,106 @@ object({
28995
29045
  countsImports: boolean(),
28996
29046
  repoLimit: number$1().int().nullable(),
28997
29047
  includedAurorasPerMonth: number$1().int().nullable()
29048
+ }));
29049
+ /** A path on the web app to come back to: one leading slash, never two (another origin). */
29050
+ const billingReturnPath = string$2().max(500).regex(/^\/(?![/\\])[^\s\\]*$/, "A path on the web app");
29051
+ /** A checkout session id the browser came back with. */
29052
+ const billingSessionId = string$2().min(1).max(255).regex(/^cs_[A-Za-z0-9_]+$/, "A checkout session");
29053
+ /** Why the provider's side of a command was refused, as its route would have answered. */
29054
+ const billingRefusalSchema = object({
29055
+ status: number$1().int(),
29056
+ code: string$2().optional(),
29057
+ message: string$2()
29058
+ });
29059
+ /**
29060
+ * What a billing command answers once its work with the provider, which runs
29061
+ * after the push commits, is done: its answer or the refusal. Neither when
29062
+ * that work failed some other way.
29063
+ */
29064
+ const settledBilling = (answer) => object({
29065
+ answer: answer.optional(),
29066
+ refused: billingRefusalSchema.optional()
29067
+ });
29068
+ const billingRedirect = object({ url: url() });
29069
+ /** The organization's billing as Plan & usage reads it. */
29070
+ const tenantBillingSchema = object({
29071
+ checkoutPlans: planCatalogueSchema,
29072
+ auroraTopUp: object({
29073
+ min: number$1().int(),
29074
+ max: number$1().int(),
29075
+ presets: array(number$1().int()),
29076
+ unitPrice: object({
29077
+ amount: number$1().int(),
29078
+ currency: string$2()
29079
+ }).nullable()
29080
+ }).nullable(),
29081
+ autoTopUp: object({
29082
+ enabled: boolean(),
29083
+ below: number$1().int(),
29084
+ add: number$1().int(),
29085
+ monthlyMax: number$1().int(),
29086
+ card: object({ label: string$2() }).nullable(),
29087
+ boughtThisMonth: number$1(),
29088
+ lastFailure: object({
29089
+ at: string$2(),
29090
+ reason: _enum(AURORA_AUTO_TOP_UP_FAILURES)
29091
+ }).nullable(),
29092
+ limits: object({
29093
+ maxBelow: number$1().int(),
29094
+ maxMonthly: number$1().int()
29095
+ })
29096
+ }).nullable(),
29097
+ terms: object({
29098
+ url: string$2(),
29099
+ version: string$2()
29100
+ }).nullable(),
29101
+ subscription: object({
29102
+ provider: string$2(),
29103
+ planKey: string$2(),
29104
+ status: _enum(BILLING_SUBSCRIPTION_STATUSES),
29105
+ currentPeriodEnd: string$2().nullable(),
29106
+ cancelAtPeriodEnd: boolean(),
29107
+ manageable: boolean(),
29108
+ quantity: number$1().int()
29109
+ }).nullable(),
29110
+ repositories: object({
29111
+ price: object({
29112
+ currency: string$2(),
29113
+ mode: _enum(["volume", "graduated"]),
29114
+ tiers: array(object({
29115
+ upTo: number$1().int().nullable(),
29116
+ unitAmount: number$1().int(),
29117
+ flatAmount: number$1().int()
29118
+ }))
29119
+ }).nullable(),
29120
+ subscribed: object({
29121
+ count: number$1().int(),
29122
+ renews: string$2().nullable(),
29123
+ scheduled: object({
29124
+ count: number$1().int(),
29125
+ from: string$2()
29126
+ }).nullable()
29127
+ }).nullable()
29128
+ }).nullable()
29129
+ });
29130
+ object({
29131
+ left: number$1(),
29132
+ lasting: number$1(),
29133
+ monthly: object({
29134
+ left: number$1(),
29135
+ amount: number$1(),
29136
+ expiresAt: string$2()
29137
+ }).nullable(),
29138
+ usedThisMonth: number$1(),
29139
+ entries: array(object({
29140
+ source: _enum(AURORA_DEPOSIT_SOURCES),
29141
+ at: string$2(),
29142
+ amount: number$1(),
29143
+ withdrawn: number$1(),
29144
+ left: number$1(),
29145
+ expiresAt: string$2().nullable(),
29146
+ automatic: boolean()
29147
+ }))
28998
29148
  });
28999
29149
  object({
29000
29150
  context: object({
@@ -29403,7 +29553,28 @@ const deriveSource = discriminatedUnion("kind", [
29403
29553
  uploadId: uuid
29404
29554
  })
29405
29555
  ]);
29406
- strictObject({ regulationId }), strictObject({ regulationId }), strictObject({
29556
+ strictObject({ regulationId }), strictObject({ regulationId }), settledBilling(tenantBillingSchema), strictObject({
29557
+ repositories: number$1().int().min(1).max(50),
29558
+ returnPath: billingReturnPath,
29559
+ termsVersion: string$2().min(1).max(100).optional()
29560
+ }), settledBilling(object({ url: url().nullable() })), strictObject({ sessionId: billingSessionId.optional() }), settledBilling(object({ applied: boolean() })), strictObject({ returnPath: billingReturnPath }), settledBilling(billingRedirect), strictObject({
29561
+ auroras: number$1().int().positive().max(1e6),
29562
+ returnPath: billingReturnPath,
29563
+ termsVersion: string$2().min(1).max(100),
29564
+ termsAccepted: literal(true)
29565
+ }), settledBilling(billingRedirect), strictObject({ sessionId: billingSessionId }), settledBilling(object({
29566
+ deposited: boolean(),
29567
+ writeAccessNeeded: number$1().int().min(0)
29568
+ })), strictObject({
29569
+ enabled: boolean(),
29570
+ below: number$1().int().min(0).max(AUTO_TOP_UP_LIMITS.maxBelow),
29571
+ add: number$1().int().positive(),
29572
+ monthlyMax: number$1().int().positive().max(AUTO_TOP_UP_LIMITS.maxMonthly),
29573
+ termsVersion: string$2().min(1).max(100).optional()
29574
+ }), settledBilling(object({ done: literal(true) })), strictObject({ returnPath: billingReturnPath }), settledBilling(billingRedirect), strictObject({
29575
+ sessionId: billingSessionId,
29576
+ turnOn: strictObject({ termsVersion: string$2().min(1).max(100) }).optional()
29577
+ }), settledBilling(object({ done: literal(true) })), strictObject({
29407
29578
  planKey: string$2().min(1).max(40),
29408
29579
  reason: string$2().min(1).max(500)
29409
29580
  }), object({ assigned: boolean() }), strictObject({ note: string$2().trim().max(1e3).optional() }), strictObject({
@@ -38625,10 +38796,11 @@ function runOutcome(run) {
38625
38796
  const handback = handbackSaid(run["reviewEscalation"]);
38626
38797
  const draft = run["prDraft"] === true ? `, still a draft` : "";
38627
38798
  const blocked = reasonOnOneLine(run["factoryBlockedBecause"]);
38799
+ const waiting = reasonOnOneLine(run["runWaitingFor"]);
38628
38800
  return {
38629
38801
  disposition,
38630
38802
  outcome: {
38631
- in_flight: blocked ? `Blocked: the factory has stopped working on this run${progress}. ${blocked}` : status === "pending" ? "Queued: waiting to start." : status === "replanning" ? steerPaused(run["failedReason"], progress) : `Running: ${RUNNING[status] ?? status}${progress}.`,
38803
+ in_flight: blocked ? `Blocked: the factory has stopped working on this run${progress}. ${blocked}` : waiting ? `Waiting to start: ${waiting}` : status === "pending" ? "Queued: waiting to start." : status === "replanning" ? steerPaused(run["failedReason"], progress) : `Running: ${RUNNING[status] ?? status}${progress}.`,
38632
38804
  gated: handback ? `Handed back to a person: ${handback}. ${pr}${draft ? `${draft},` : ""} waits for them to ${handbackNextStep(run["reviewEscalation"], run["provider"])}.` : `Waiting for a person to review and merge ${pr}${draft}.`,
38633
38805
  succeeded: `Merged: ${pr} is in ${typeof run["baseBranch"] === "string" ? run["baseBranch"] : "the base branch"}.`,
38634
38806
  unmerged: typeof run["prNumber"] === "number" || run["prUrl"] ? `Settled without merging: ${pr} was left unmerged.` : "Settled without a merged pull request.",
@@ -38743,7 +38915,7 @@ const FAILED_REASON_MEANS = {
38743
38915
  * text out: its first sentence is in the outcome, and taiga_get_run has it all.
38744
38916
  */
38745
38917
  function readableRun(run, opts = {}) {
38746
- const { prDraft, error, reviewEscalation, runtime: _runtime, origin, factoryBlockedBecause: _inTheOutcome, ...rest } = run;
38918
+ const { prDraft, error, reviewEscalation, runtime: _runtime, origin, factoryBlockedBecause: _inTheOutcome, runWaitingFor: _waitInTheOutcome, ...rest } = run;
38747
38919
  const said = runOutcome(run);
38748
38920
  const means = FAILED_REASON_MEANS[String(run["failedReason"])];
38749
38921
  const hardening = run["hardeningResult"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.37.0-dev.1095",
3
+ "version": "0.37.0-dev.1097",
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",