@taiga-ai/mcp-server 0.34.0-dev.719 → 0.34.0-dev.722
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 +93 -66
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26712,6 +26712,84 @@ function sectionReadResult(doc, asked, label, options = {}) {
|
|
|
26712
26712
|
});
|
|
26713
26713
|
}
|
|
26714
26714
|
//#endregion
|
|
26715
|
+
//#region src/tools/autonomy.ts
|
|
26716
|
+
/**
|
|
26717
|
+
* Autonomy (docs.tai.ga, Deliver: Initiatives, Auto-merge): whether a landed
|
|
26718
|
+
* plan is built without a review, and whether a pull request merges on its
|
|
26719
|
+
* own. The organization and its factories are ceilings for merging, set by
|
|
26720
|
+
* an administrator in the web; a product sets defaults; an initiative's own
|
|
26721
|
+
* switch is the final word within the ceilings. The initiative's build gate
|
|
26722
|
+
* is taiga_set_auto_build.
|
|
26723
|
+
*/
|
|
26724
|
+
function registerAutonomyTools(server, client) {
|
|
26725
|
+
if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
|
|
26726
|
+
title: "Set a product's autonomy defaults",
|
|
26727
|
+
description: "Set a product's defaults: whether plans are built at once or wait for approval (autoBuild), whether pull requests merge themselves (autoMerge), and how far Taiga goes on its own for each kind of finding it notices (signalAutonomy), and how many fixes it may raise on its own per day (dailyFixLimit). autoMerge and a merge level only take effect where the organization and factory allow autonomous merge; neither is changed here. The answer says what each kind resolves to and what decided it, and the daily limit in force.",
|
|
26728
|
+
inputSchema: object({
|
|
26729
|
+
productId,
|
|
26730
|
+
autoBuild: boolean().optional().describe("Build landed plans without a review by default"),
|
|
26731
|
+
autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
|
|
26732
|
+
signalAutonomy: partialRecord(_enum(SIGNAL_KINDS), _enum(AUTONOMY_LEVELS).nullable()).optional().describe("Per kind of finding: off (record only), notify (surface it), propose (plan waits for a person), build (pull request waits for a person), merge (merges itself under auto-merge consent); null follows Taiga's default for the kind. A level above the kind's cap is refused."),
|
|
26733
|
+
dailyFixLimit: number$1().int().min(1).max(100).nullable().optional().describe(`Fixes Taiga may raise on its own for this product per day, across every kind (1-100); null follows Taiga's default`)
|
|
26734
|
+
}),
|
|
26735
|
+
annotations: OPERATE_SETTING
|
|
26736
|
+
}, (params) => runTool(async () => {
|
|
26737
|
+
if (params.autoBuild === void 0 && params.autoMerge === void 0 && params.signalAutonomy === void 0 && params.dailyFixLimit === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge, signalAutonomy, dailyFixLimit or several.");
|
|
26738
|
+
const autoMerge = params.autoMerge === true ? null : params.autoMerge;
|
|
26739
|
+
const product = (await client.updateProduct(params.productId, {
|
|
26740
|
+
...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
|
|
26741
|
+
...autoMerge !== void 0 ? { autoMerge } : {},
|
|
26742
|
+
...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {},
|
|
26743
|
+
...params.dailyFixLimit !== void 0 ? { dailyFixLimit: params.dailyFixLimit } : {}
|
|
26744
|
+
})).data;
|
|
26745
|
+
const dailyFixLimit = dailyFixLimitOf(product);
|
|
26746
|
+
return toolResult({
|
|
26747
|
+
...pickFields([product], [
|
|
26748
|
+
"id",
|
|
26749
|
+
"name",
|
|
26750
|
+
"slug",
|
|
26751
|
+
"autoBuild",
|
|
26752
|
+
"autoMerge"
|
|
26753
|
+
])[0],
|
|
26754
|
+
...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
|
|
26755
|
+
...dailyFixLimit ? { dailyFixLimit } : {}
|
|
26756
|
+
});
|
|
26757
|
+
}));
|
|
26758
|
+
if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
|
|
26759
|
+
title: "Set whether an initiative's pull request merges on its own",
|
|
26760
|
+
description: "Set whether an initiative's pull request merges itself once the repository's checks pass (true), waits for a person (false), or follows the product (null). Where the organization or factory has turned autonomous merge off, true changes nothing.",
|
|
26761
|
+
inputSchema: object({
|
|
26762
|
+
initiativeId: idInput("initiative", "taiga_list_initiatives (query finds one by title) gives it"),
|
|
26763
|
+
autoMerge: boolean().nullable().describe("true merges on its own, false waits for a person, null follows the product")
|
|
26764
|
+
}),
|
|
26765
|
+
annotations: OPERATE_SETTING
|
|
26766
|
+
}, (params) => runTool(async () => {
|
|
26767
|
+
const item = (await client.updateBacklogItem(params.initiativeId, { autoMerge: params.autoMerge })).data;
|
|
26768
|
+
return toolResult(pickFields([item], [
|
|
26769
|
+
"id",
|
|
26770
|
+
"title",
|
|
26771
|
+
"state",
|
|
26772
|
+
"autoMerge",
|
|
26773
|
+
"autoBuild"
|
|
26774
|
+
])[0]);
|
|
26775
|
+
}));
|
|
26776
|
+
}
|
|
26777
|
+
/**
|
|
26778
|
+
* The daily limit on fixes Taiga raises on its own in force for a product
|
|
26779
|
+
* (PRO-3627), and whether the product set it or it is Taiga's default.
|
|
26780
|
+
* Undefined from a response that does not carry the default (a list row).
|
|
26781
|
+
*/
|
|
26782
|
+
function dailyFixLimitOf(product) {
|
|
26783
|
+
if (product.dailyFixLimit != null) return {
|
|
26784
|
+
limit: product.dailyFixLimit,
|
|
26785
|
+
setBy: "product"
|
|
26786
|
+
};
|
|
26787
|
+
return product.defaultDailyFixLimit != null ? {
|
|
26788
|
+
limit: product.defaultDailyFixLimit,
|
|
26789
|
+
setBy: "default"
|
|
26790
|
+
} : void 0;
|
|
26791
|
+
}
|
|
26792
|
+
//#endregion
|
|
26715
26793
|
//#region src/tools/readiness.ts
|
|
26716
26794
|
const IMPORT_STATE = {
|
|
26717
26795
|
pending: "not started",
|
|
@@ -26832,7 +26910,7 @@ const PRODUCT_VIEW_FIELDS = [
|
|
|
26832
26910
|
"createdAt",
|
|
26833
26911
|
"updatedAt"
|
|
26834
26912
|
];
|
|
26835
|
-
const UNSET_MEANS = "A null setting is unset: kind reads as application; autoMerge follows the factory, then the organization; ownsInfrastructure and ownsDeployment follow the organization default (yes when it has none); ownsApplication is yes; emitDesignStandards follows how the product started; networkAccess is allowlist. signalAutonomy is what each kind of finding resolves to (off, notify, propose, build, merge) and what decided it: the product, the kind default or cap, or auto-merge consent.";
|
|
26913
|
+
const UNSET_MEANS = "A null setting is unset: kind reads as application; autoMerge follows the factory, then the organization; ownsInfrastructure and ownsDeployment follow the organization default (yes when it has none); ownsApplication is yes; emitDesignStandards follows how the product started; networkAccess is allowlist. signalAutonomy is what each kind of finding resolves to (off, notify, propose, build, merge) and what decided it: the product, the kind default or cap, or auto-merge consent. dailyFixLimit is how many fixes Taiga may raise on its own per day, set by the product or Taiga's default.";
|
|
26836
26914
|
/**
|
|
26837
26915
|
* Each product's policy standing beside its row: the counts the standing read opens with. A product still in setup
|
|
26838
26916
|
* has none to read; a read the API refuses or fails says so on its row rather than failing the list.
|
|
@@ -26882,6 +26960,7 @@ function productView(product) {
|
|
|
26882
26960
|
...typeof settings.importStatus === "string" ? { importStatus: settings.importStatus } : {},
|
|
26883
26961
|
linePaused: stoppedAt ? { since: stoppedAt } : false,
|
|
26884
26962
|
...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {},
|
|
26963
|
+
...dailyFixLimitOf(product) ? { dailyFixLimit: dailyFixLimitOf(product) } : {},
|
|
26885
26964
|
unsetMeans: UNSET_MEANS
|
|
26886
26965
|
};
|
|
26887
26966
|
}
|
|
@@ -27691,9 +27770,12 @@ function forgeOf(row) {
|
|
|
27691
27770
|
}
|
|
27692
27771
|
/** A run's change request in its forge's words: `PR #12`, `MR !12`, or the noun when it has no number. */
|
|
27693
27772
|
function changeRequestOf(row) {
|
|
27694
|
-
|
|
27695
|
-
|
|
27696
|
-
|
|
27773
|
+
return typeof row["prNumber"] === "number" ? changeRequestRef(row["provider"], row["prNumber"]) : `its ${FORGE_TERMS[forgeOf(row) ?? "github"].changeRequest}`;
|
|
27774
|
+
}
|
|
27775
|
+
/** A change request's number in its forge's words: `PR #12`, `MR !12`; a row without a forge reads as GitHub. */
|
|
27776
|
+
function changeRequestRef(provider, number) {
|
|
27777
|
+
const forge = forgeOf({ provider }) ?? "github";
|
|
27778
|
+
return `${FORGE_TERMS[forge].changeRequestShort} ${formatChangeRequestRef(forge, number)}`;
|
|
27697
27779
|
}
|
|
27698
27780
|
/** What a person does about a handback, by its reason, as the web's handback detail says it, on the run's forge. */
|
|
27699
27781
|
function handbackNextStep(escalation, provider = null) {
|
|
@@ -28509,7 +28591,7 @@ function situationOf(item) {
|
|
|
28509
28591
|
if (stalled) stage = requeued ? "Queued" : offTheLine ? "Off the line" : column === null ? "Its build stopped" : "On the line, but its build stopped";
|
|
28510
28592
|
const build = life.latestBuild;
|
|
28511
28593
|
if (build && typeof build.status === "string" && life.stage !== "done" && life.stage !== "canceled") {
|
|
28512
|
-
const pr = typeof build.prNumber === "number" ? ` (
|
|
28594
|
+
const pr = typeof build.prNumber === "number" ? ` (${changeRequestRef(build.provider, build.prNumber)})` : "";
|
|
28513
28595
|
const said = BUILD_RUN_STATUSES.includes(build.status) ? RUN_STANDS[landedDisposition(build.status, build.prMerged === true)] : build.status;
|
|
28514
28596
|
stage += `; its latest run ${said}${pr}`;
|
|
28515
28597
|
const handback = handbackSaid(build.reviewEscalation);
|
|
@@ -28544,7 +28626,8 @@ function endingSaid(item) {
|
|
|
28544
28626
|
const ending = item["ending"];
|
|
28545
28627
|
const merged = typeof ending?.landedPr?.number === "number" ? ending.landedPr.number : null;
|
|
28546
28628
|
const said = [];
|
|
28547
|
-
|
|
28629
|
+
const lifecycle = item["lifecycle"];
|
|
28630
|
+
if (merged !== null) said.push(`: ${changeRequestRef(lifecycle?.latestBuild?.provider, merged)} merged`);
|
|
28548
28631
|
else if (ending && (ending.via === "moved" || ending.via === "off_the_line")) {
|
|
28549
28632
|
const who = typeof ending.by?.name === "string" ? ending.by.name : ending.by?.type === "system" ? "Taiga" : "someone";
|
|
28550
28633
|
const when = typeof ending.at === "string" ? ` on ${ending.at.slice(0, 10)}` : "";
|
|
@@ -29898,12 +29981,15 @@ async function productContext(client, product, options) {
|
|
|
29898
29981
|
};
|
|
29899
29982
|
const parts = Object.keys(fetchers).filter(granted);
|
|
29900
29983
|
const [settled, readiness] = await Promise.all([Promise.allSettled(parts.map((part) => fetchers[part]())), setupReadiness(client, product, links)]);
|
|
29901
|
-
const
|
|
29984
|
+
const detail = product.effectiveSignalAutonomy ? product : (await client.getProduct(productId)).data;
|
|
29985
|
+
const signalAutonomy = detail.effectiveSignalAutonomy;
|
|
29986
|
+
const dailyFixLimit = dailyFixLimitOf(detail);
|
|
29902
29987
|
const bundle = { product: {
|
|
29903
29988
|
...pickFields([product], PRODUCT_SUMMARY_FIELDS)[0],
|
|
29904
29989
|
projectType: isImportedProduct(product) ? "brownfield" : "greenfield",
|
|
29905
29990
|
defaultOrigin: defaultOriginFor(product),
|
|
29906
29991
|
...signalAutonomy ? { signalAutonomy } : {},
|
|
29992
|
+
...dailyFixLimit ? { dailyFixLimit } : {},
|
|
29907
29993
|
...readiness ? { readiness } : {}
|
|
29908
29994
|
} };
|
|
29909
29995
|
const unavailable = {};
|
|
@@ -29955,65 +30041,6 @@ function registerContextTools(server, client) {
|
|
|
29955
30041
|
}));
|
|
29956
30042
|
}
|
|
29957
30043
|
//#endregion
|
|
29958
|
-
//#region src/tools/autonomy.ts
|
|
29959
|
-
/**
|
|
29960
|
-
* Autonomy (docs.tai.ga, Deliver: Initiatives, Auto-merge): whether a landed
|
|
29961
|
-
* plan is built without a review, and whether a pull request merges on its
|
|
29962
|
-
* own. The organization and its factories are ceilings for merging, set by
|
|
29963
|
-
* an administrator in the web; a product sets defaults; an initiative's own
|
|
29964
|
-
* switch is the final word within the ceilings. The initiative's build gate
|
|
29965
|
-
* is taiga_set_auto_build.
|
|
29966
|
-
*/
|
|
29967
|
-
function registerAutonomyTools(server, client) {
|
|
29968
|
-
if (client.hasCapability("products:write")) server.registerTool("taiga_set_product_autonomy", {
|
|
29969
|
-
title: "Set a product's autonomy defaults",
|
|
29970
|
-
description: "Set a product's defaults: whether plans are built at once or wait for approval (autoBuild), whether pull requests merge themselves (autoMerge), and how far Taiga goes on its own for each kind of finding it notices (signalAutonomy). autoMerge and a merge level only take effect where the organization and factory allow autonomous merge; neither is changed here. The answer says what each kind resolves to and what decided it.",
|
|
29971
|
-
inputSchema: object({
|
|
29972
|
-
productId,
|
|
29973
|
-
autoBuild: boolean().optional().describe("Build landed plans without a review by default"),
|
|
29974
|
-
autoMerge: boolean().nullable().optional().describe("false: pull requests wait for a person by default; null: follow the organization and factory"),
|
|
29975
|
-
signalAutonomy: partialRecord(_enum(SIGNAL_KINDS), _enum(AUTONOMY_LEVELS).nullable()).optional().describe("Per kind of finding: off (record only), notify (surface it), propose (plan waits for a person), build (pull request waits for a person), merge (merges itself under auto-merge consent); null follows Taiga's default for the kind. A level above the kind's cap is refused.")
|
|
29976
|
-
}),
|
|
29977
|
-
annotations: OPERATE_SETTING
|
|
29978
|
-
}, (params) => runTool(async () => {
|
|
29979
|
-
if (params.autoBuild === void 0 && params.autoMerge === void 0 && params.signalAutonomy === void 0) return toolError("VALIDATION_ERROR", "Set autoBuild, autoMerge, signalAutonomy or several.");
|
|
29980
|
-
const autoMerge = params.autoMerge === true ? null : params.autoMerge;
|
|
29981
|
-
const product = (await client.updateProduct(params.productId, {
|
|
29982
|
-
...params.autoBuild !== void 0 ? { autoBuild: params.autoBuild } : {},
|
|
29983
|
-
...autoMerge !== void 0 ? { autoMerge } : {},
|
|
29984
|
-
...params.signalAutonomy !== void 0 ? { signalAutonomy: params.signalAutonomy } : {}
|
|
29985
|
-
})).data;
|
|
29986
|
-
return toolResult({
|
|
29987
|
-
...pickFields([product], [
|
|
29988
|
-
"id",
|
|
29989
|
-
"name",
|
|
29990
|
-
"slug",
|
|
29991
|
-
"autoBuild",
|
|
29992
|
-
"autoMerge"
|
|
29993
|
-
])[0],
|
|
29994
|
-
...product.effectiveSignalAutonomy ? { signalAutonomy: product.effectiveSignalAutonomy } : {}
|
|
29995
|
-
});
|
|
29996
|
-
}));
|
|
29997
|
-
if (client.hasCapability("backlog:write")) server.registerTool("taiga_set_auto_merge", {
|
|
29998
|
-
title: "Set whether an initiative's pull request merges on its own",
|
|
29999
|
-
description: "Set whether an initiative's pull request merges itself once the repository's checks pass (true), waits for a person (false), or follows the product (null). Where the organization or factory has turned autonomous merge off, true changes nothing.",
|
|
30000
|
-
inputSchema: object({
|
|
30001
|
-
initiativeId: idInput("initiative", "taiga_list_initiatives (query finds one by title) gives it"),
|
|
30002
|
-
autoMerge: boolean().nullable().describe("true merges on its own, false waits for a person, null follows the product")
|
|
30003
|
-
}),
|
|
30004
|
-
annotations: OPERATE_SETTING
|
|
30005
|
-
}, (params) => runTool(async () => {
|
|
30006
|
-
const item = (await client.updateBacklogItem(params.initiativeId, { autoMerge: params.autoMerge })).data;
|
|
30007
|
-
return toolResult(pickFields([item], [
|
|
30008
|
-
"id",
|
|
30009
|
-
"title",
|
|
30010
|
-
"state",
|
|
30011
|
-
"autoMerge",
|
|
30012
|
-
"autoBuild"
|
|
30013
|
-
])[0]);
|
|
30014
|
-
}));
|
|
30015
|
-
}
|
|
30016
|
-
//#endregion
|
|
30017
30044
|
//#region src/tools/knowledge.ts
|
|
30018
30045
|
/**
|
|
30019
30046
|
* Knowledge (docs.tai.ga, Context): reference material agents search when
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ai/mcp-server",
|
|
3
|
-
"version": "0.34.0-dev.
|
|
3
|
+
"version": "0.34.0-dev.722",
|
|
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",
|