@taiga-ai/mcp-server 0.36.0-dev.811 → 0.36.0-dev.812
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/dist/index.js +69 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23899,6 +23899,18 @@ var TaigaClient = class {
|
|
|
23899
23899
|
async getLicenseSummary(productId) {
|
|
23900
23900
|
return this.request("GET", `/products/${seg(productId)}/maintenance/licenses`);
|
|
23901
23901
|
}
|
|
23902
|
+
/** One licence across a product's inventory (PRO-3251): what it asks, when to allow it, what brings it in. */
|
|
23903
|
+
async getProductLicense(productId, license) {
|
|
23904
|
+
return this.request("GET", `/products/${seg(productId)}/maintenance/licenses/detail?license=${encodeURIComponent(license)}`);
|
|
23905
|
+
}
|
|
23906
|
+
/** Allow a licence in one product: every licence finding in force for it there ignored (PRO-3727). */
|
|
23907
|
+
async allowProductLicense(productId, body) {
|
|
23908
|
+
return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/ignore`, body);
|
|
23909
|
+
}
|
|
23910
|
+
/** Allow a licence in one product no longer: every one of its ignored licence findings there open again. */
|
|
23911
|
+
async reopenProductLicense(productId, license) {
|
|
23912
|
+
return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/reopen`, { license });
|
|
23913
|
+
}
|
|
23902
23914
|
/** The organization's approved list and every licence in use across its products (PRO-3311). */
|
|
23903
23915
|
async getOrganizationLicenses() {
|
|
23904
23916
|
return this.request("GET", "/tenants/current/licenses");
|
|
@@ -27325,6 +27337,7 @@ const TOOLSET_OF = {
|
|
|
27325
27337
|
taiga_fix_finding: "operate",
|
|
27326
27338
|
taiga_fix_policy_violation: "operate",
|
|
27327
27339
|
taiga_ignore_finding: "operate",
|
|
27340
|
+
taiga_allow_license: "operate",
|
|
27328
27341
|
taiga_resolve_action: "operate",
|
|
27329
27342
|
taiga_create_factory: "setup",
|
|
27330
27343
|
taiga_rename_factory: "setup",
|
|
@@ -27677,8 +27690,16 @@ const BY_ARGUMENT = {
|
|
|
27677
27690
|
knowledgeId: "taiga_list_knowledge lists the knowledge files.",
|
|
27678
27691
|
productId: "taiga_list_products lists the products the key can see; a name is not an ID (taiga_get_product takes a slug)."
|
|
27679
27692
|
};
|
|
27693
|
+
/**
|
|
27694
|
+
* A licence a product does not hold, as against a product the key cannot see
|
|
27695
|
+
* (PRO-3879). Any other 404 (the routes do not exist where the licenses
|
|
27696
|
+
* feature is off) blames neither.
|
|
27697
|
+
*/
|
|
27698
|
+
const licenseMiss = (hint) => (said) => /\blicen[cs]e\b/i.test(said) ? hint : /\b(product|project) not found/i.test(said) ? BY_ARGUMENT["productId"] : void 0;
|
|
27680
27699
|
/** Where an argument means something else on one tool, or the tool's 404 needs its own word. */
|
|
27681
27700
|
const BY_TOOL = {
|
|
27701
|
+
taiga_allow_license: licenseMiss("taiga_list_packages (productId) summarizes the product's licenses as its findings name them; a license with no finding there has nothing to allow or reopen."),
|
|
27702
|
+
taiga_list_licenses: licenseMiss("taiga_list_licenses without license lists the licenses in use, and taiga_list_packages (productId) one product's, spelled as their findings spell them."),
|
|
27682
27703
|
taiga_resolve_action: () => "taiga_list_action_required lists the items with their IDs.",
|
|
27683
27704
|
taiga_get_sbom: () => "An SBOM exists once a sweep has inventoried that repository, where the licenses feature is enabled; taiga_list_packages (linkId) says whether it has packages, and taiga_list_product_repositories lists the links.",
|
|
27684
27705
|
taiga_get_notices: () => "Notices exist once a sweep has inventoried that repository, where the licenses feature is enabled; taiga_list_product_repositories lists the links.",
|
|
@@ -28519,6 +28540,20 @@ async function sweepOverview(client, productId) {
|
|
|
28519
28540
|
...latest.length === 0 ? { note: "This product has never been swept: no findings is not an all-clear." } : {}
|
|
28520
28541
|
};
|
|
28521
28542
|
}
|
|
28543
|
+
/** The organization's licence read takes an id this long at most, as `organizationLicenseQuery` does. */
|
|
28544
|
+
const ORGANIZATION_LICENSE_MAX = 200;
|
|
28545
|
+
/**
|
|
28546
|
+
* Why a license is allowed in a product, in a license's words, as the web's
|
|
28547
|
+
* Allow dialog offers them (PRO-3727); each is stored as the ignore reason
|
|
28548
|
+
* beside it.
|
|
28549
|
+
*/
|
|
28550
|
+
const LICENSE_ALLOW_REASON_TO_IGNORE = {
|
|
28551
|
+
accepted: "accepted_risk",
|
|
28552
|
+
not_handed_out: "not_reachable",
|
|
28553
|
+
no_alternative: "wont_fix",
|
|
28554
|
+
read_wrong: "false_positive"
|
|
28555
|
+
};
|
|
28556
|
+
const LICENSE_ALLOW_REASONS = Object.keys(LICENSE_ALLOW_REASON_TO_IGNORE);
|
|
28522
28557
|
function registerMaintenanceTools(server, client) {
|
|
28523
28558
|
if (client.hasCapability("tenant:settings")) server.registerTool("taiga_change_license", {
|
|
28524
28559
|
title: "Approve or remove a license",
|
|
@@ -28606,10 +28641,18 @@ function registerMaintenanceTools(server, client) {
|
|
|
28606
28641
|
}));
|
|
28607
28642
|
server.registerTool("taiga_list_licenses", {
|
|
28608
28643
|
title: "List the organization's licenses",
|
|
28609
|
-
description: "List the organization's approved license list and every license in use across its products, approved or not, with packages, products and repositories. With license, where that one is used: products, repositories
|
|
28610
|
-
inputSchema: object({
|
|
28644
|
+
description: "List the organization's approved license list and every license in use across its products, approved or not, with packages, products and repositories. With license, where that one is used: products, repositories, what brings its packages in, and its approved-list history. With license and productId, that license in one product: its standing against the list, what it asks, when to allow it there, how many packages ship, and what brings them in. Decide it there with taiga_allow_license. NOT_FOUND where the licenses feature is off.",
|
|
28645
|
+
inputSchema: object({
|
|
28646
|
+
license: string$2().trim().min(1).max(MAINTENANCE_LICENSE_FILTER_MAX).optional().describe("An SPDX license id or expression: where it is used, instead of the list"),
|
|
28647
|
+
productId: productId.optional().describe("With license: that license in this product only (taiga_list_products gives it)")
|
|
28648
|
+
}),
|
|
28611
28649
|
annotations: READ_ONLY
|
|
28612
|
-
}, (params) => runTool(async () =>
|
|
28650
|
+
}, (params) => runTool(async () => {
|
|
28651
|
+
if (params.productId !== void 0 && params.license === void 0) return toolError("VALIDATION_ERROR", "Name the license to read in this product (license).");
|
|
28652
|
+
if (params.license === void 0) return toolResult((await client.getOrganizationLicenses()).data);
|
|
28653
|
+
if (params.productId === void 0 && params.license.length > ORGANIZATION_LICENSE_MAX) return toolError("VALIDATION_ERROR", `A license id is at most ${ORGANIZATION_LICENSE_MAX} characters; name a product (productId) to read a longer expression.`);
|
|
28654
|
+
return toolResult(params.productId !== void 0 ? (await client.getProductLicense(params.productId, params.license)).data : (await client.getOrganizationLicense(params.license)).data);
|
|
28655
|
+
}));
|
|
28613
28656
|
server.registerTool("taiga_get_sbom", {
|
|
28614
28657
|
title: "Download a repository SBOM",
|
|
28615
28658
|
description: "Download one repository's software bill of materials (CycloneDX 1.6). Large; taiga_list_packages summarizes. NOT_FOUND where the licenses feature is off, or before a sweep has read the repository.",
|
|
@@ -28748,6 +28791,28 @@ function registerMaintenanceTools(server, client) {
|
|
|
28748
28791
|
const finding = (await client.updateFinding(params.findingId, body)).data;
|
|
28749
28792
|
return toolResult(findingRows([finding], ["ignoreNote"])[0]);
|
|
28750
28793
|
}));
|
|
28794
|
+
server.registerTool("taiga_allow_license", {
|
|
28795
|
+
title: "Allow or reopen a license in a product",
|
|
28796
|
+
description: "Allow a license in one product without approving it for the organization: every license finding of it there that is open, or whose ignore lapsed, is ignored with one reason, as the web's Allow in this product does; one already ignored keeps its reason and expiry, so reopen first to change them. allowed: false reopens them. Another product using the license still raises its finding; to approve it everywhere, use taiga_change_license. Allowing a license is the person's decision. NOT_FOUND when the product has no license finding for it.",
|
|
28797
|
+
inputSchema: object({
|
|
28798
|
+
productId,
|
|
28799
|
+
license: string$2().trim().min(1).max(MAINTENANCE_LICENSE_FILTER_MAX).describe("The license as the product's license findings or taiga_list_packages name it, such as MPL-2.0"),
|
|
28800
|
+
allowed: boolean().describe("true allows the license in this product, false reopens its findings"),
|
|
28801
|
+
reason: _enum(LICENSE_ALLOW_REASONS).optional().describe("Why it is allowed; required when allowing. accepted: reviewed and allowed here, usually for a limited time; not_handed_out: the product runs only internally or on your own servers, its code is never given to anyone; no_alternative: no package under an approved license does the job yet; read_wrong: the packages are not actually under this license"),
|
|
28802
|
+
note: string$2().trim().max(280).optional().describe("A short justification, kept for audit"),
|
|
28803
|
+
expiresAt: string$2().datetime({ offset: true }).meta({ pattern: void 0 }).optional().describe("When the allowance lapses and the findings come back if still there (ISO 8601, in the future)")
|
|
28804
|
+
}),
|
|
28805
|
+
annotations: OPERATE_SETTING
|
|
28806
|
+
}, (params) => runTool(async () => {
|
|
28807
|
+
if (!params.allowed) return toolResult((await client.reopenProductLicense(params.productId, params.license)).data);
|
|
28808
|
+
if (params.reason === void 0) return toolError("VALIDATION_ERROR", "Say why the license is allowed (reason).");
|
|
28809
|
+
return toolResult((await client.allowProductLicense(params.productId, {
|
|
28810
|
+
license: params.license,
|
|
28811
|
+
ignoreReason: LICENSE_ALLOW_REASON_TO_IGNORE[params.reason],
|
|
28812
|
+
...params.note !== void 0 ? { ignoreNote: params.note } : {},
|
|
28813
|
+
...params.expiresAt !== void 0 ? { ignoreExpiresAt: params.expiresAt } : {}
|
|
28814
|
+
})).data);
|
|
28815
|
+
}));
|
|
28751
28816
|
server.registerTool("taiga_fix_finding", {
|
|
28752
28817
|
title: "Fix a finding",
|
|
28753
28818
|
description: "Raise an initiative that fixes a finding; it ends in a pull request, which merges on its own only where the product's auto-merge allows it. wholeGroup: true fixes, in that repository, every open advisory on that package version in one bump, or every place the rule flagged. A malicious package is removed, with every advisory on that version, whatever wholeGroup says. A language runtime moves every file declaring it together, in a container image only to a tag the image has published. Refused when there is no version to move to (fixable: false; for a runtime, also while its image has not published the fix), the code is in a submodule, or a secret is only in history (rotate it outside Taiga).",
|
|
@@ -32283,7 +32348,7 @@ async function licenseReviews(client, productId, now) {
|
|
|
32283
32348
|
packages: data["packages"],
|
|
32284
32349
|
...Number.isNaN(created) ? {} : { waitingDays: Math.floor((now - created) / DAY_MS) },
|
|
32285
32350
|
readWith: "taiga_list_licenses (license)",
|
|
32286
|
-
decideWith: "taiga_change_license (license, action: 'approve'); dismissing it is only in the web"
|
|
32351
|
+
decideWith: "taiga_change_license (license, action: 'approve') for every product" + (client.hasCapability("products:write") ? ", or taiga_allow_license (productId, license) for this one" : "") + "; dismissing it is only in the web"
|
|
32287
32352
|
};
|
|
32288
32353
|
}).filter((r) => productId === void 0 || r.productId === productId),
|
|
32289
32354
|
truncated: result.truncated === true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ai/mcp-server",
|
|
3
|
-
"version": "0.36.0-dev.
|
|
3
|
+
"version": "0.36.0-dev.812",
|
|
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",
|