@taiga-ai/mcp-server 0.39.0-dev.1230 → 0.39.0-dev.1232

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 +58 -39
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25191,6 +25191,21 @@ const optionalUuid = string$2().uuid().optional();
25191
25191
  */
25192
25192
  const optionalLineAnchor = number$1().int().min(0).optional().transform((v) => v ? v : void 0);
25193
25193
  //#endregion
25194
+ //#region ../../packages/types/dist/iam.js
25195
+ const JOB_FUNCTIONS = [
25196
+ "product",
25197
+ "engineering",
25198
+ "design",
25199
+ "leadership",
25200
+ "operations",
25201
+ "other"
25202
+ ];
25203
+ const TECHNICAL_PROFICIENCIES = [
25204
+ "non_technical",
25205
+ "semi_technical",
25206
+ "technical"
25207
+ ];
25208
+ //#endregion
25194
25209
  //#region ../../packages/types/dist/entitlements.js
25195
25210
  /**
25196
25211
  * Which agent implementation serves a planning job or build run (PRO-1331).
@@ -30860,6 +30875,10 @@ strictObject({
30860
30875
  */
30861
30876
  const mcpToolsets = array(_enum(MCP_TOOLSETS)).min(1).refine((sets) => new Set(sets).size === sets.length, "Name each toolset once").nullable();
30862
30877
  strictObject({
30878
+ name: string$2().min(1).max(255).optional(),
30879
+ jobFunction: _enum(JOB_FUNCTIONS).nullable().optional(),
30880
+ technicalProficiency: _enum(TECHNICAL_PROFICIENCIES).nullable().optional()
30881
+ }).refine((fields) => Object.values(fields).some((value) => value !== void 0), { message: "A correction must change a field" }), strictObject({
30863
30882
  key: string$2().regex(new RegExp(`^${API_KEY_PREFIX}[0-9a-f]{64}$`)),
30864
30883
  name: string$2().min(1).max(255),
30865
30884
  scopes: array(_enum(API_KEY_SCOPES)).optional(),
@@ -38423,7 +38442,7 @@ function withFixability(row) {
38423
38442
  fixNote: baseImageWaitNote(base)
38424
38443
  };
38425
38444
  }
38426
- if (typeof row["baseMove"] === "boolean" && isAgentRemediable({ remediableBy: remediableByOf(row) })) return row["baseMove"] === true && row["status"] === "open" ? {
38445
+ if (typeof row["baseMove"] === "boolean" && isAgentRemediable({ remediableBy: remediableByOf(row) })) return row["baseMove"] && row["status"] === "open" ? {
38427
38446
  ...row,
38428
38447
  fixable: true,
38429
38448
  fixNote: "taiga_fix_finding moves the base images it is in to the builds their tags name now, the FROM line alone, with every other advisory that move removes."
@@ -38944,17 +38963,17 @@ function registerMaintenanceTools(server, client) {
38944
38963
  const standing = (await client.getPolicyStanding(params.productId)).data;
38945
38964
  const controls = Array.isArray(standing.controls) ? standing.controls : [];
38946
38965
  const violations = Array.isArray(standing.divergences) ? standing.divergences : [];
38947
- const listed = controls.filter((c) => Number(c.divergenceCount ?? 0) > 0 || Number(c.findingCount ?? 0) > 0);
38966
+ const listed = controls.filter((c) => (c.divergenceCount ?? 0) > 0 || (c.findingCount ?? 0) > 0);
38948
38967
  const summary = standingSummary(standing);
38949
38968
  const assessment = standing.assessment;
38950
38969
  const assessedAt = typeof assessment?.assessedAt === "string" ? assessment.assessedAt : null;
38951
- const note = assessment?.state === "never" ? "Never assessed: the documents have not been checked against the policies yet, so nothing here is an all-clear. " + (standing.canAssess === false && standing.hasPolicies !== false ? "It has no reality documents to assess yet: an import derives them (taiga_start_import for a product set up from its code, paid work: ask first), and the assessment follows." : "An assessment runs when the reality documents are derived or refreshed (taiga_refresh_reality_documents, paid work: ask first).") : summary.controlsMet + summary.controlsNotApplicable === 0 && assessedAt ? `No control is recorded as met or not applicable: the last assessment (${assessedAt}) either ran before assessments recorded those verdicts, or found none. Until the next one, only violations are known; the rest are not assessed, which is no pass.` : null;
38970
+ const note = assessment?.state === "never" ? "Never assessed: the documents have not been checked against the policies yet, so nothing here is an all-clear. " + (!standing.canAssess && standing.hasPolicies ? "It has no reality documents to assess yet: an import derives them (taiga_start_import for a product set up from its code, paid work: ask first), and the assessment follows." : "An assessment runs when the reality documents are derived or refreshed (taiga_refresh_reality_documents, paid work: ask first).") : summary.controlsMet + summary.controlsNotApplicable === 0 && assessedAt ? `No control is recorded as met or not applicable: the last assessment (${assessedAt}) either ran before assessments recorded those verdicts, or found none. Until the next one, only violations are known; the rest are not assessed, which is no pass.` : null;
38952
38971
  const resolvedAny = Array.isArray(standing.resolvedDivergences) && standing.resolvedDivergences.length > 0;
38953
38972
  const wording = violations.length > 0 || resolvedAny ? { wordingNote: "A violation's evidence is from its assessedAt; its title and summary may be from when it was first recorded. Where they disagree, the evidence is current." } : {};
38954
38973
  if (params.controlId && params.violationId) return toolError("VALIDATION_ERROR", "Name either a control (controlId) or one violation (violationId), not both.");
38955
38974
  if (params.controlId) {
38956
38975
  const wanted = params.controlId.toUpperCase();
38957
- const control = controls.find((c) => String(c.controlId).toUpperCase() === wanted);
38976
+ const control = controls.find((c) => c.controlId.toUpperCase() === wanted);
38958
38977
  if (!control) return toolError("NOT_FOUND", "No control with that id in this product's policies; taiga_get_organization_document (type, sections: []) lists a policy's controls.");
38959
38978
  const own = violations.filter((violation) => String(violation["controlId"]).toUpperCase() === wanted);
38960
38979
  return toolResult({
@@ -38962,7 +38981,7 @@ function registerMaintenanceTools(server, client) {
38962
38981
  ...control.state === "no_evidence" ? { meaning: (control.coverage && plannedFor(control.coverage) === "later" ? `Planned later: the backlog deferred it (${String(control.coverage.deferredReason).replace(/\.$/, "")}). ` : "") + "Not assessed: no finding or violation is recorded against it, and the documents were not found to show it met. That is no evidence either way, not a pass." } : {},
38963
38982
  ...control.coverage ? { coverageNote: "coverage is how the backlog plans for it: the live initiatives that build it, or why it is deferred. It says what is planned, not that the control is met." } : {},
38964
38983
  ...control.assessment == null && (control.state === "breached" || control.state === "diverged") ? { assessmentNote: "No met or not-applicable verdict is shown: an open finding or violation against the control outranks one." } : {},
38965
- ...Number(control.findingCount ?? 0) > 0 ? { findingsNote: `${String(control.findingCount)} open scanner finding${control.findingCount === 1 ? "" : "s"} breach it; taiga_list_findings (productId) lists them with the controls each breaches. violations below are the documents' only.` } : {},
38984
+ ...(control.findingCount ?? 0) > 0 ? { findingsNote: `${String(control.findingCount)} open scanner finding${control.findingCount === 1 ? "" : "s"} breach it; taiga_list_findings (productId) lists them with the controls each breaches. violations below are the documents' only.` } : {},
38966
38985
  violations: pickFields(own, VIOLATION_FIELDS),
38967
38986
  ...own.length > 0 ? wording : {}
38968
38987
  });
@@ -39091,8 +39110,8 @@ function registerMaintenanceTools(server, client) {
39091
39110
  const finding = (await client.getFinding(params.findingId)).data;
39092
39111
  if (finding.productId !== params.productId) return toolError("NOT_FOUND", "No such finding in this product.");
39093
39112
  return toolResult((await client.remediatePackage(params.productId, {
39094
- ecosystem: String(finding.ecosystem),
39095
- packageName: String(finding.packageName),
39113
+ ecosystem: finding.ecosystem,
39114
+ packageName: finding.packageName,
39096
39115
  currentVersion: typeof finding.currentVersion === "string" ? finding.currentVersion : null,
39097
39116
  productRepositoryId: typeof finding.productRepositoryId === "string" ? finding.productRepositoryId : null
39098
39117
  })).data);
@@ -40018,7 +40037,7 @@ function failedLookup(what, reason) {
40018
40037
  }
40019
40038
  /** `a (v3), b (v1)` for a not-found message. */
40020
40039
  function publishedList(rows) {
40021
- return rows.filter((row) => row.isDraft === false).map((row) => `${row.type} (v${String(row.version)})`).join(", ");
40040
+ return rows.filter((row) => !row.isDraft).map((row) => `${row.type} (v${String(row.version)})`).join(", ");
40022
40041
  }
40023
40042
  const DRAFT_WRITE$1 = {
40024
40043
  readOnlyHint: false,
@@ -40249,7 +40268,7 @@ function registerDocumentTools(server, client) {
40249
40268
  const doc = stripProvenance((await client.getTenantDocument(type)).data);
40250
40269
  const read = args.sections ? sectionReadResult(doc, args.sections, type, { controlIds: POLICY_TYPES.includes(type) }) : toolResult(doc);
40251
40270
  if (type !== DESIGN_STANDARDS) return read;
40252
- const tokens = isRecord$1(doc.data) ? doc.data["tokens"] : void 0;
40271
+ const tokens = isRecord$1(doc.data) ? doc.data.tokens : void 0;
40253
40272
  const shown = (() => {
40254
40273
  const first = read.content[0];
40255
40274
  const parsed = first?.type === "text" ? JSON.parse(first.text) : {};
@@ -40532,10 +40551,10 @@ function failureCause(steps) {
40532
40551
  return `step ${String(failed["stepOrder"])}: ${said}`;
40533
40552
  }
40534
40553
  function stoppedIn(run, steps) {
40535
- if (run.prMerged === true || run.status !== "failed" && run.status !== "stopped") return null;
40554
+ if (run.prMerged || run.status !== "failed" && run.status !== "stopped") return null;
40536
40555
  if (!steps.some((step) => step.status !== "planned")) return "before the first step started, while setting up the run (cloning, preparing the workspace)";
40537
40556
  const open = steps.find((step) => step.status !== "completed" && step.status !== "skipped");
40538
- if (open) return open.status === "planned" ? `before step ${String(open.stepOrder)}, ${String(open.title)}, started (the ones before it completed)` : `step ${String(open.stepOrder)}, ${String(open.title)} (${String(open.status)})`;
40557
+ if (open) return open.status === "planned" ? `before step ${String(open.stepOrder)}, ${open.title}, started (the ones before it completed)` : `step ${String(open.stepOrder)}, ${open.title} (${open.status})`;
40539
40558
  if (run.hardeningResult == null) return "after the last step, in hardening: the security scanners and their fixes the agent runs before the pull request is ready. A retry continues from there; the steps stay.";
40540
40559
  return "after the steps and hardening, at the pull request";
40541
40560
  }
@@ -41329,7 +41348,7 @@ function waitingOn(rows, station) {
41329
41348
  return station ? "Nothing holds the station: the first queued initiative is next to start." : "Nothing in the queue is running; the first queued initiative starts when no initiative is left in Plan or Build.";
41330
41349
  }
41331
41350
  const head = rows[at];
41332
- const name = typeof head.title === "string" ? `"${head.title}"` : `Initiative ${String(head.backlogItemId)}`;
41351
+ const name = typeof head.title === "string" ? `"${head.title}"` : `Initiative ${head.backlogItemId}`;
41333
41352
  if (head.entryState === "halted") {
41334
41353
  const halt = head.halt;
41335
41354
  const ahead = at > 0 ? " Entries ahead of it are not held by it." : "";
@@ -41341,8 +41360,8 @@ function waitingOn(rows, station) {
41341
41360
  const pr = typeof head.prUrl === "string" ? ` (${head.prUrl})` : "";
41342
41361
  if (lifecycle.cta === "start_build") return `${name} has its plan and waits for the Build slot; ${held}`;
41343
41362
  if (head.handedBack) return `${name} was handed back to a person: ${head.handedBack}${pr}; ${held}`;
41344
- if (lifecycle.turn === "you") return `${name} is waiting on a person (${String(lifecycle.cta ?? lifecycle.stage)})${pr}; ${held}`;
41345
- return `${name} is ${String(lifecycle.stage)}${pr}; ${held}`;
41363
+ if (lifecycle.turn === "you") return `${name} is waiting on a person (${lifecycle.cta ?? lifecycle.stage})${pr}; ${held}`;
41364
+ return `${name} is ${lifecycle.stage}${pr}; ${held}`;
41346
41365
  }
41347
41366
  const STATION_NAMED = 3;
41348
41367
  /** Who holds the station, or null when the key cannot read the backlog or the read failed. */
@@ -41359,7 +41378,7 @@ async function stationHolders(client, product, except) {
41359
41378
  return {
41360
41379
  count: rows.length,
41361
41380
  atLeast: capped,
41362
- titles: rows.slice(0, STATION_NAMED).map((row) => String(row.title))
41381
+ titles: rows.slice(0, STATION_NAMED).map((row) => row.title)
41363
41382
  };
41364
41383
  } catch (error) {
41365
41384
  if (error instanceof TaigaApiError || isNetworkFailure(error)) return null;
@@ -41850,7 +41869,7 @@ function registerBacklogReads(server, client) {
41850
41869
  if (column !== "open" || !["done", "canceled"].includes(String(row.state))) return true;
41851
41870
  if (searchedText(row).some((value) => typeof value === "string" && searchable(value).includes(needle))) closedSeen += 1;
41852
41871
  return false;
41853
- }, (row) => String(row.title));
41872
+ }, (row) => row.title);
41854
41873
  const hidden = column === "open" && !found.more ? closedSeen : 0;
41855
41874
  return toolResult({
41856
41875
  ...page(situatedRows(found.rows), null),
@@ -42182,7 +42201,7 @@ function registerEdit(server, client) {
42182
42201
  ...links && linksChange ? { documentIds: links.send } : {}
42183
42202
  })).data;
42184
42203
  } catch (error) {
42185
- if (links && error instanceof TaigaApiError && error.status === 400 && /Referenced documents/.test(error.apiMessage ?? "")) return toolError("VALIDATION_ERROR", `${error.apiMessage} Leave them out of documentIds to unlink them.`);
42204
+ if (links && error instanceof TaigaApiError && error.status === 400 && (error.apiMessage ?? "").includes("Referenced documents")) return toolError("VALIDATION_ERROR", `${error.apiMessage} Leave them out of documentIds to unlink them.`);
42186
42205
  throw error;
42187
42206
  }
42188
42207
  const assigned = fields.assigneeId !== void 0 ? { assigneeId: fields.assigneeId } : {};
@@ -42650,7 +42669,7 @@ const SETTLED_RUN = new Set(BUILD_RUN_TERMINAL_STATUSES);
42650
42669
  * state (null, just opened) counts as open.
42651
42670
  */
42652
42671
  function prIsOpen(run) {
42653
- return typeof run.prUrl === "string" && run.prUrl !== "" && run.prMerged !== true && run.prState !== "closed";
42672
+ return typeof run.prUrl === "string" && run.prUrl !== "" && !run.prMerged && run.prState !== "closed";
42654
42673
  }
42655
42674
  const ITEM_CONDITIONS = [
42656
42675
  "changed",
@@ -42710,7 +42729,7 @@ function itemHolds(until, item, first, gate) {
42710
42729
  case "planned": return item.planningStatus === "planned";
42711
42730
  case "your_turn": return personTurn(item, gate) === "yes";
42712
42731
  case "pr_open": return run !== null && prIsOpen(run);
42713
- case "run_settled": return run !== null && SETTLED_RUN.has(String(run.status));
42732
+ case "run_settled": return run !== null && SETTLED_RUN.has(run.status);
42714
42733
  case "done": return lifecycle.stage === "done";
42715
42734
  }
42716
42735
  }
@@ -42739,7 +42758,7 @@ function judgeItem(until, gate) {
42739
42758
  const stage = lifecycleOf(item).stage;
42740
42759
  if (stage === "canceled" || until !== "done" && stage === "done") return {
42741
42760
  reached: false,
42742
- stoppedBecause: `the initiative is ${String(stage)}`
42761
+ stoppedBecause: `the initiative is ${stage}`
42743
42762
  };
42744
42763
  return null;
42745
42764
  };
@@ -42803,10 +42822,10 @@ const runSignature = (run) => JSON.stringify([
42803
42822
  ]);
42804
42823
  function judgeBuild(until) {
42805
42824
  return (run, first) => {
42806
- if (until === "changed" ? runSignature(run) !== runSignature(first) : until === "step_done" ? Number(run.completedSteps ?? 0) > Number(first.completedSteps ?? 0) : until === "pr_open" ? prIsOpen(run) : SETTLED_RUN.has(String(run.status))) return { reached: true };
42807
- if (until !== "changed" && SETTLED_RUN.has(String(run.status))) return {
42825
+ if (until === "changed" ? runSignature(run) !== runSignature(first) : until === "step_done" ? (run.completedSteps ?? 0) > (first.completedSteps ?? 0) : until === "pr_open" ? prIsOpen(run) : SETTLED_RUN.has(run.status)) return { reached: true };
42826
+ if (until !== "changed" && SETTLED_RUN.has(run.status)) return {
42808
42827
  reached: false,
42809
- stoppedBecause: `the run is ${String(run.status)}`
42828
+ stoppedBecause: `the run is ${run.status}`
42810
42829
  };
42811
42830
  if (until !== "changed" && run.status === "replanning" && run.failedReason === "steer_review") return {
42812
42831
  reached: false,
@@ -42835,7 +42854,7 @@ function registerWaitTools(server, client, options) {
42835
42854
  const gate = { product: void 0 };
42836
42855
  const read = async (signal) => {
42837
42856
  const item = (await client.getBacklogItem(target, signal)).data;
42838
- if (gate.product === void 0 && typeof item.autoBuild !== "boolean") gate.product = client.hasCapability("products:read") ? await client.getProduct(String(item.productId), signal).then((p) => {
42857
+ if (gate.product === void 0 && typeof item.autoBuild !== "boolean") gate.product = client.hasCapability("products:read") ? await client.getProduct(item.productId, signal).then((p) => {
42839
42858
  const value = p.data.autoBuild;
42840
42859
  return typeof value === "boolean" ? value : true;
42841
42860
  }).catch((error) => {
@@ -42868,7 +42887,7 @@ function registerWaitTools(server, client, options) {
42868
42887
  });
42869
42888
  };
42870
42889
  const waitJob = async (target, params, ctx) => {
42871
- const { now, deadline: _deadline, ...outcome } = await waitFor(async (signal) => (await client.getAgentJob(target, signal)).data, (job) => SETTLED_JOB_STATUSES.has(String(job.status)) ? { reached: true } : null, (params.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS$1) * 1e3, options, {
42890
+ const { now, deadline: _deadline, ...outcome } = await waitFor(async (signal) => (await client.getAgentJob(target, signal)).data, (job) => SETTLED_JOB_STATUSES.has(job.status) ? { reached: true } : null, (params.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS$1) * 1e3, options, {
42872
42891
  progressToken: ctx.mcpReq._meta?.progressToken,
42873
42892
  notify: ctx.mcpReq.notify,
42874
42893
  signal: ctx.mcpReq.signal
@@ -42937,7 +42956,7 @@ function judgeSync(job) {
42937
42956
  reached: false,
42938
42957
  stoppedBecause: NOT_A_SYNC
42939
42958
  };
42940
- return SETTLED_JOB_STATUSES.has(String(job.status)) ? { reached: true } : null;
42959
+ return SETTLED_JOB_STATUSES.has(job.status) ? { reached: true } : null;
42941
42960
  }
42942
42961
  /** A read that cannot take a signal, given up on when the signal fires; the read itself is left to finish unobserved. */
42943
42962
  function within(read, signal) {
@@ -43079,7 +43098,7 @@ function registerDesignTokenTools(server, client, wait) {
43079
43098
  jobId: params.jobId,
43080
43099
  note: STILL_WAITING
43081
43100
  });
43082
- if (!result.reached && result.stoppedBecause === NOT_A_SYNC) return toolError("VALIDATION_ERROR", `Job ${params.jobId} is not a design token sync (it is ${String(job.type)}). taiga_wait follows other jobs.`);
43101
+ if (!result.reached && result.stoppedBecause === NOT_A_SYNC) return toolError("VALIDATION_ERROR", `Job ${params.jobId} is not a design token sync (it is ${job.type}). taiga_wait follows other jobs.`);
43083
43102
  const report = jobReport(job);
43084
43103
  if (job.status === "completed") {
43085
43104
  const bound = AbortSignal.timeout(Math.max(result.deadline - Date.now(), 0));
@@ -43759,7 +43778,7 @@ async function productContext(client, product, options) {
43759
43778
  let linksRead;
43760
43779
  const links = () => linksRead ??= client.listProductRepositories(productId);
43761
43780
  const fetchers = {
43762
- factory: () => factoryPart(client, String(product.factoryId)),
43781
+ factory: () => factoryPart(client, product.factoryId),
43763
43782
  documents: () => documentsPart(client, product, options.documents),
43764
43783
  policies: () => policiesPart(client),
43765
43784
  initiatives: () => backlogPart(client, productId),
@@ -43990,7 +44009,7 @@ function registerKnowledgeTools(server, client) {
43990
44009
  });
43991
44010
  return toolResult({
43992
44011
  ...pickFields([result.data], KNOWLEDGE_FIELDS)[0],
43993
- deduplicated: result.deduplicated === true
44012
+ deduplicated: result.deduplicated
43994
44013
  });
43995
44014
  }));
43996
44015
  server.registerTool("taiga_retry_knowledge", {
@@ -58982,17 +59001,17 @@ function registerPrompts(server, client) {
58982
59001
  argsSchema: object({ initiativeId: idInput("initiative", "taiga_list_initiatives (query finds one by title) gives it") })
58983
59002
  }, async (args) => {
58984
59003
  const item = (await served$1(client.getBacklogItem(args.initiativeId), "No initiative with that ID the key can see; taiga_list_initiatives shows what exists")).data;
58985
- const productId = String(item.productId);
59004
+ const productId = item.productId;
58986
59005
  const product = (await served$1(client.getProduct(productId), "The product of that item is not visible to the key")).data;
58987
59006
  const origin = defaultOriginFor(product, "architecture");
58988
59007
  const [architecture, instructions, policies] = await Promise.allSettled([
58989
59008
  client.getProductDocument(productId, "architecture", origin),
58990
- client.hasCapability("factories:read") ? client.getFactoryDocument(String(product.factoryId), "factory_instructions") : Promise.reject(new NotGranted("factories:read")),
59009
+ client.hasCapability("factories:read") ? client.getFactoryDocument(product.factoryId, "factory_instructions") : Promise.reject(new NotGranted("factories:read")),
58991
59010
  client.hasCapability("tenant:documents:read") ? client.listTenantDocuments({ limit: 100 }) : Promise.reject(new NotGranted("tenant:documents:read"))
58992
59011
  ]);
58993
59012
  const architectureText = architecture.status === "fulfilled" ? fence("markdown", renderDocument(stripProvenance(architecture.value.data)).text) : isNotFound(architecture.reason) ? `(No published ${origin} architecture; taiga_get_product_document without type shows what exists.)` : unreadable("The architecture", architecture.reason);
58994
59013
  const instructionsText_ = instructions.status === "fulfilled" ? fence("markdown", instructionsText(sectionsOf(instructions.value.data.data) ?? {}) ?? "(The factory instructions are empty.)") : instructions.reason instanceof NotGranted ? instructions.reason.line("The factory instructions") : isNotFound(instructions.reason) ? "(This factory has not published instructions.)" : unreadable("The factory instructions", instructions.reason);
58995
- const policiesText = policies.status === "fulfilled" ? fence("text", policies.value.data.filter((row) => POLICY_TYPES.includes(String(row.type)) && row.isDraft === false).map((row) => `- ${String(row.type)}: ${Object.keys(sectionsOf(row.data ?? {}) ?? {}).join(", ")}`).join("\n") || "(No policy is published.)") : policies.reason instanceof NotGranted ? policies.reason.line("The policies") : unreadable("The policies", policies.reason);
59014
+ const policiesText = policies.status === "fulfilled" ? fence("text", policies.value.data.filter((row) => POLICY_TYPES.includes(row.type) && !row.isDraft).map((row) => `- ${row.type}: ${Object.keys(sectionsOf(row.data ?? {}) ?? {}).join(", ")}`).join("\n") || "(No policy is published.)") : policies.reason instanceof NotGranted ? policies.reason.line("The policies") : unreadable("The policies", policies.reason);
58996
59015
  return message([
58997
59016
  `Implement the following initiative of product ${productId} (named in the fenced initiative). Every acceptance`,
58998
59017
  "criterion below must hold when you are done; say which ones you could not verify. Follow the factory",
@@ -59141,7 +59160,7 @@ function forgesOf(rows) {
59141
59160
  })) };
59142
59161
  }
59143
59162
  function githubSource(client, installation) {
59144
- const id = String(installation.id);
59163
+ const id = installation.id;
59145
59164
  return {
59146
59165
  id,
59147
59166
  row: githubAccount(installation),
@@ -59364,7 +59383,7 @@ function registerRepositoryTools(server, client) {
59364
59383
  if (accounts.length === 0) return toolError("NOT_CONNECTED", "No GitHub, GitLab or Azure DevOps connection exists for this organization. A forge is connected once, in the web; then link.");
59365
59384
  const login = params.account?.split("/")[0].toLowerCase();
59366
59385
  const chosen = [
59367
- ...installations.filter((i) => (!params.installationId || i.id === params.installationId) && (!login || String(i.accountLogin ?? "").toLowerCase() === login)).map((i) => githubSource(client, i)),
59386
+ ...installations.filter((i) => (!params.installationId || i.id === params.installationId) && (!login || (i.accountLogin ?? "").toLowerCase() === login)).map((i) => githubSource(client, i)),
59368
59387
  ...gitlab.filter((c) => (!params.installationId || c.id === params.installationId) && (!params.account || connectionNames(c).includes(params.account.toLowerCase())) && (c.status !== "auth_failed" || Boolean(params.installationId || params.account))).map((c) => gitlabSource(client, c)),
59369
59388
  ...azure.filter((c) => (!params.installationId || c.id === params.installationId) && (!params.account || connectionNames(c).includes(params.account.toLowerCase())) && (c.status !== "auth_failed" || Boolean(params.installationId || params.account))).map((c) => azureSource(client, c))
59370
59389
  ];
@@ -59513,10 +59532,10 @@ async function served(read, miss) {
59513
59532
  }
59514
59533
  function registerResources(server, client) {
59515
59534
  if (client.hasCapability("tenant:documents:read")) {
59516
- const published = async () => (await client.listTenantDocuments({ limit: 100 })).data.filter((row) => row.isDraft === false);
59535
+ const published = async () => (await client.listTenantDocuments({ limit: 100 })).data.filter((row) => !row.isDraft);
59517
59536
  server.registerResource("organization-document", new ResourceTemplate("taiga://documents/{type}", { list: async () => ({ resources: (await published().catch(() => [])).map((row) => ({
59518
- uri: `taiga://documents/${String(row.type)}`,
59519
- name: String(row.name ?? row.type),
59537
+ uri: `taiga://documents/${row.type}`,
59538
+ name: row.name ?? row.type,
59520
59539
  description: typeof row.description === "string" ? row.description : void 0,
59521
59540
  mimeType: mimeTypeOf(row)
59522
59541
  })) }) }), {
@@ -59529,7 +59548,7 @@ function registerResources(server, client) {
59529
59548
  } catch (error) {
59530
59549
  if (!isMissOrRefusal(error)) throw error;
59531
59550
  const rest = await published().then((rows) => {
59532
- const names = rows.map((row) => String(row.type));
59551
+ const names = rows.map((row) => row.type);
59533
59552
  return names.length > 0 ? `Published documents: ${names.join(", ")}.` : "Nothing is published yet.";
59534
59553
  }, (reason) => `The published list could not be read (${reason instanceof TaigaApiError ? apiFailureText(reason) : "the request failed"}).`);
59535
59554
  return invalid(`No published ${type} the key can read (${apiFailureText(error)}). ${rest}`);
@@ -60072,7 +60091,7 @@ function withRecoveryHints(tool, schema, inputs, isRead) {
60072
60091
  };
60073
60092
  const argument = issue.path?.length === 1 ? String(issue.path[0]) : void 0;
60074
60093
  const source = argument ? idSource(argument) : void 0;
60075
- if (source && /received undefined/.test(issue.message)) return {
60094
+ if (source && issue.message.includes("received undefined")) return {
60076
60095
  ...issue,
60077
60096
  message: `required. ${source}`
60078
60097
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ai/mcp-server",
3
- "version": "0.39.0-dev.1230",
3
+ "version": "0.39.0-dev.1232",
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",