@taiga-ai/mcp-server 0.51.0-rc.1259 → 0.51.0

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 +1964 -1900
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -23501,1563 +23501,804 @@ function serveStdio(factory, options = {}) {
23501
23501
  function toError(value) {
23502
23502
  return value instanceof Error ? value : new Error(String(value));
23503
23503
  }
23504
- const SERVER_VERSION = createRequire(import.meta.url)("../package.json").version;
23505
23504
  //#endregion
23506
- //#region src/client.ts
23505
+ //#region ../../packages/types/dist/clouds.js
23507
23506
  /**
23508
- * The same value without any `tenantId` or `prTitle`, at any depth. A pull
23509
- * request's title is text anyone with write access on the forge can set, so no
23510
- * model reads it through this server. Build run and step
23511
- * rows carry one; the key is scoped to one tenant already, so the id is
23512
- * never something the model acts on. Applied to every response here, once,
23513
- * so no tool, resource or prompt can hand it over by forgetting to; only
23514
- * the key's own introspection keeps it, typed and never handed over.
23507
+ * Cloud provider platforms that Taiga can connect to.
23515
23508
  *
23516
- * An explicit stack rather than recursion: a document body a person stored
23517
- * can nest as deep as JSON.parse allows, and a walk must not overflow where
23518
- * the parse did not. Every key is defined as a data property, so an own
23519
- * "__proto__" key stays a key instead of becoming the copy's prototype.
23520
- */
23521
- function withoutTenant(value) {
23522
- const root = {};
23523
- const pending = [{
23524
- source: value,
23525
- target: root,
23526
- key: "out"
23527
- }];
23528
- while (pending.length > 0) {
23529
- const { source, target, key } = pending.pop();
23530
- let copy = source;
23531
- if (Array.isArray(source)) {
23532
- copy = new Array(source.length);
23533
- for (let index = source.length - 1; index >= 0; index -= 1) pending.push({
23534
- source: source[index],
23535
- target: copy,
23536
- key: index
23537
- });
23538
- } else if (source !== null && typeof source === "object") {
23539
- copy = {};
23540
- const entries = Object.entries(source).filter(([inner]) => inner !== "tenantId" && inner !== "prTitle");
23541
- for (let index = entries.length - 1; index >= 0; index -= 1) pending.push({
23542
- source: entries[index][1],
23543
- target: copy,
23544
- key: entries[index][0]
23545
- });
23546
- }
23547
- Object.defineProperty(target, key, {
23548
- value: copy,
23549
- enumerable: true,
23550
- writable: true,
23551
- configurable: true
23552
- });
23553
- }
23554
- return root.out;
23555
- }
23556
- var TaigaApiError = class extends Error {
23557
- status;
23558
- code;
23559
- apiMessage;
23560
- /** A refusal's structured reason, when the API sent one: `{ reason, ... }` (a 409's discriminator and its data). */
23561
- details;
23562
- constructor(method, path, status, body) {
23563
- const parsed = parseErrorBody(body);
23564
- super(`Taiga API ${method} ${path} failed (${status}): ${parsed.message ?? body}`);
23565
- this.name = "TaigaApiError";
23566
- this.status = status;
23567
- this.code = parsed.code;
23568
- this.apiMessage = parsed.message;
23569
- this.details = parsed.details;
23570
- }
23571
- };
23572
- /**
23573
- * One path segment. Every id and type a tool passes is validated at the
23574
- * tool boundary; this is the second wall. Encoding keeps a slash inside the
23575
- * segment, and the dot segments are refused outright: encodeURIComponent
23576
- * leaves "." and ".." as they are, and the URL parser in fetch would then
23577
- * collapse `/documents/../publish` into a different route.
23509
+ * `salesforce` is the Salesforce Platform (PRO-4337): where Apex and Lightning
23510
+ * Web Components run. Not a cloud Taiga connects to or deploys into -- the
23511
+ * customer's pipeline deploys to the org -- but the answer to "where does this
23512
+ * software run", which is what this list drives in the seeded policies.
23578
23513
  */
23579
- function seg(value) {
23580
- if (value === "" || value === "." || value === "..") throw new TypeError(`Invalid path segment: ${JSON.stringify(value)}`);
23581
- return encodeURIComponent(value);
23582
- }
23514
+ const CLOUD_PROVIDERS = [
23515
+ "aws",
23516
+ "gcp",
23517
+ "azure",
23518
+ "upcloud",
23519
+ "salesforce",
23520
+ "kubernetes",
23521
+ "digitalocean",
23522
+ "vercel",
23523
+ "railway",
23524
+ "render",
23525
+ "fly",
23526
+ "on_prem",
23527
+ "other"
23528
+ ];
23529
+ //#endregion
23530
+ //#region ../../packages/types/dist/ecosystems.js
23583
23531
  /**
23584
- * A query string from the defined values only, prefixed with "?" when there
23585
- * is one. Every value goes through URLSearchParams, so nothing a tool passes
23586
- * can add a parameter of its own.
23532
+ * Engineering ecosystems a tenant builds in.
23533
+ *
23534
+ * The structural twin of CLOUD_PROVIDERS: a discrete onboarding choice that
23535
+ * drives seeded policy content. Clouds say where the software runs; ecosystems
23536
+ * say what it is written in.
23537
+ *
23538
+ * Deliberately scoped to the runtimes the coding agent actually ships skills
23539
+ * for (`apps/agents/coding/src/coding/skills/loader.py`, `_RUNTIME_SKILLS`).
23540
+ * Offering a choice the agent cannot honour would be worse than not asking.
23541
+ * JVM was absent for that reason until the coding image gained the JDK, Maven,
23542
+ * Gradle, Ruby and PHP toolchains (PRO-1745) and the agent its `java`,
23543
+ * `ruby-rails` and `php-laravel` skills (PRO-2914); see the three entries
23544
+ * below.
23545
+ *
23546
+ * Frontend is its own entry rather than being bundled into `node`, because a
23547
+ * stack has tiers and a runtime list cannot express them. React-with-a-Python-
23548
+ * backend is one of the most common shapes there is; folding React into `node`
23549
+ * would force those tenants to declare a Node backend they do not run, and the
23550
+ * seeded policy would then approve Fastify for a Python shop. It also matches
23551
+ * the coding agent more closely, which already keeps `node-typescript` and
23552
+ * `react-nextjs` as separate skills under one runtime key.
23553
+ *
23554
+ * `nextjs` is the case that broke the tier model, and the reason it is its own
23555
+ * entry rather than react+node (PRO-809). Next.js occupies BOTH tiers: route
23556
+ * handlers and Server Actions are a backend, so `react` alone leaves a real
23557
+ * backend undeclared, while `react` + `node` approves Fastify and Drizzle at a
23558
+ * shop running neither. It also builds with its own bundler, so the react
23559
+ * preset's Vite row is wrong for it. One framework spanning two tiers is not
23560
+ * something hedged wording can fix; it needs its own entry.
23561
+ *
23562
+ * `other` is the escape hatch, and exists because its absence was a trap.
23563
+ * `CLOUD_PROVIDERS` has always had one; ecosystems did not, so a Vue, Angular
23564
+ * or Svelte shop had no true answer: declaring `react` is wrong, and declaring
23565
+ * nothing falls to `UNDECLARED_STACK_ROWS`, which opens with
23566
+ * "Frontend: React, TypeScript". Both paths asserted React at them. `other`
23567
+ * contributes no rows at all, so their approved-technology table is silent
23568
+ * about language rather than wrong about it.
23569
+ *
23570
+ * Note what `other` is NOT: an invitation to add Vue and friends as options.
23571
+ * The agent ships no skill for any of them, and the rule above still stands --
23572
+ * a skill first, then the option, never the reverse.
23573
+ *
23574
+ * `angular` is the first entry outside the React family, and it is its own
23575
+ * entry for the same reason `nextjs` is: the toolchain, not the language.
23576
+ * Angular builds with the Angular CLI's own esbuild-based builder rather than
23577
+ * Vite, lints with angular-eslint rather than oxlint, and (since v21) tests
23578
+ * with the CLI's Vitest builder rather than a bare Vitest config. Declaring
23579
+ * `react` at an Angular shop would seed every one of those rows wrong.
23580
+ *
23581
+ * It also retires the specific trap `other` was documented with: an Angular
23582
+ * shop previously had no true answer. Vue and Svelte still do not, and the
23583
+ * rule below is why -- Angular earned the entry by having a coding-agent
23584
+ * skill written for it first (PRO-1401), not the reverse.
23585
+ *
23586
+ * `nestjs` is the backend counterpart of that same rule, and its own entry
23587
+ * rather than folding into `node` for the same reason: the toolchain, not the
23588
+ * language. `node` approves Fastify, Zod and Drizzle and builds with Vite; a
23589
+ * NestJS service runs its own framework on the Express or Fastify adapter,
23590
+ * validates with class-validator DTOs, persists through Prisma or TypeORM, and
23591
+ * builds with the Nest CLI or Nx. Declaring `node` at a Nest shop would seed
23592
+ * every one of those rows wrong. Like Angular, it earned the entry by having
23593
+ * its coding-agent skill shipped first (PRO-1901), not the reverse.
23594
+ *
23595
+ * `react-native` is the mobile client tier, and a separate entry from `react`
23596
+ * for the same reason `nextjs` is (PRO-936). `react` is a web SPA that builds
23597
+ * with Vite and tests with Vitest/Playwright; React Native is an Expo-managed
23598
+ * mobile app that builds with the Expo/EAS toolchain and tests with jest-expo,
23599
+ * so declaring `react` would seed a web tenant's Vite/Vitest rows at a mobile
23600
+ * shop. Expo-managed is the default and the only variant here: a bare-workflow
23601
+ * React Native app is the same source with a different native build pipeline,
23602
+ * not a different approved-technology table, so it does not warrant its own id.
23603
+ *
23604
+ * `java`, `rails` and `laravel` are the server-rendered and API backends
23605
+ * outside JavaScript, Python and .NET (PRO-2915). `java` approves Spring Boot as
23606
+ * its framework the way `python` approves FastAPI or Django and `go` approves
23607
+ * chi: the table names what new work should use, and the picker's sublabel
23608
+ * says so ("Spring Boot, Maven or Gradle"). A JVM shop on another framework
23609
+ * picks `other` rather than being approved one it does not run. `rails` and
23610
+ * `laravel` are named by framework rather than language for the same reason:
23611
+ * a Ruby or PHP shop that runs neither has no table we could write for it.
23612
+ * Each followed the rule below -- its coding-agent skill shipped first.
23613
+ *
23614
+ * `salesforce` is Salesforce DX: Apex and Lightning Web Components kept as
23615
+ * source-format metadata in Git (`sfdx-project.json`, `force-app/`), PRO-4337.
23616
+ * It is a platform rather than a language, and its own entry for the toolchain
23617
+ * reason the others are: an LWC is JavaScript, but declaring `node` would
23618
+ * approve Fastify, Drizzle and a Vite build at a team whose code runs inside a
23619
+ * Salesforce org and deploys with the Salesforce CLI. Like the others it
23620
+ * followed the rule below: the import recognises Salesforce DX, the coding
23621
+ * agent runs the repository's own checks, and its `salesforce` skill shipped
23622
+ * first (PRO-4337). Apex compiles and its tests run only inside an org, so the
23623
+ * customer's pipeline stays the gate that runs them.
23587
23624
  */
23588
- function query$1(params) {
23589
- const search = new URLSearchParams();
23590
- for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null && value !== "") search.set(key, String(value));
23591
- const text = search.toString();
23592
- return text ? `?${text}` : "";
23593
- }
23594
- function parseErrorBody(body) {
23595
- try {
23596
- const json = JSON.parse(body);
23597
- const message = typeof json.message === "string" ? json.message : void 0;
23598
- const details = Array.isArray(json.details) ? json.details.map((d) => [d.instancePath, d.message].filter((x) => typeof x === "string" && x).join(" ")).filter(Boolean) : [];
23599
- const structured = typeof json.details === "object" && json.details !== null && !Array.isArray(json.details) ? json.details : void 0;
23600
- return {
23601
- ...typeof json.code === "string" ? { code: json.code } : {},
23602
- ...message ? { message: details.length ? `${message}: ${details.join("; ")}` : message } : {},
23603
- ...structured ? { details: structured } : {}
23604
- };
23605
- } catch {
23606
- return {};
23607
- }
23608
- }
23625
+ const ECOSYSTEMS = [
23626
+ "react",
23627
+ "react-native",
23628
+ "angular",
23629
+ "nextjs",
23630
+ "node",
23631
+ "nestjs",
23632
+ "python",
23633
+ "dotnet",
23634
+ "go",
23635
+ "rust",
23636
+ "java",
23637
+ "rails",
23638
+ "laravel",
23639
+ "salesforce",
23640
+ "other"
23641
+ ];
23642
+ //#endregion
23643
+ //#region ../../packages/types/dist/stack-catalogue.js
23609
23644
  /**
23610
- * HTTP client for the Taiga API.
23611
- * Used by the MCP server to proxy tool calls to the backend.
23645
+ * The stack catalogue (PRO-4618, P-PRO-219): one typed list of what an
23646
+ * organization builds with, read by web, API, MCP and agents.
23647
+ *
23648
+ * It replaces the flat `ECOSYSTEMS` list as the vocabulary of the stack. That
23649
+ * list mixed tiers (a framework, a language and a platform were all one kind
23650
+ * of answer), so a team writing plain PHP, PowerShell scripts or Bicep had
23651
+ * nothing true to tick. Here every entry has a facet, and a framework sits
23652
+ * under the language or languages it is written in.
23653
+ *
23654
+ * What it offers is what the Factory can actually build and test, checked
23655
+ * against its build image (factory-vm `Dockerfile`, `image/toolchain-check.sh`)
23656
+ * on 2026-11-12, plus the existing Salesforce choice: Apex compiles only
23657
+ * inside an org, so the customer's pipeline stays the gate that runs it
23658
+ * (PRO-4690). Swift is absent because the Factory runs on Linux and iOS never
23659
+ * will; Dart comes only with Flutter (PRO-4689). Anything else is declared as
23660
+ * "not listed" in its facet: named in the policy, promising no builds.
23661
+ *
23662
+ * Version control is not a facet: the connected forge already says it. CI/CD
23663
+ * is, because a GitHub repository can be built by Jenkins (`CI_SYSTEMS`).
23664
+ *
23665
+ * Stored `ECOSYSTEMS` values keep working: `ecosystemCatalogueEntries` maps
23666
+ * each onto the entries it always meant. Until the policy composes from the
23667
+ * catalogue (PRO-4619) nothing a customer sees reads this list.
23612
23668
  */
23613
- var TaigaClient = class {
23614
- baseUrl;
23615
- /** The API this client talks to, as its host: the environment a reader is in (PRO-2823). */
23616
- get apiHost() {
23617
- try {
23618
- return new URL(this.baseUrl).host;
23619
- } catch {
23620
- return this.baseUrl;
23669
+ const STACK_FACETS = [
23670
+ "language",
23671
+ "framework",
23672
+ "iac",
23673
+ "scripting",
23674
+ "data_store",
23675
+ "ci_cd",
23676
+ "iac_state"
23677
+ ];
23678
+ const LANGUAGES = {
23679
+ typescript: {
23680
+ label: "TypeScript / JavaScript",
23681
+ sublabel: "Node.js",
23682
+ detectors: {
23683
+ linguist: ["TypeScript", "JavaScript"],
23684
+ topics: [
23685
+ "typescript",
23686
+ "javascript",
23687
+ "nodejs",
23688
+ "node"
23689
+ ],
23690
+ files: ["package.json", "tsconfig.json"]
23621
23691
  }
23622
- }
23623
- apiKey;
23624
- introspection = null;
23625
- constructor(opts) {
23626
- this.baseUrl = opts.baseUrl.replace(/\/+$/, "");
23627
- this.apiKey = opts.apiKey;
23628
- }
23629
- async request(method, path, body, options = {}) {
23630
- const url = `${this.baseUrl}/v1${path}`;
23631
- const headers = {
23632
- Authorization: `Bearer ${this.apiKey}`,
23633
- "User-Agent": `taiga-ai-mcp-server/${SERVER_VERSION}`
23634
- };
23635
- const form = body instanceof FormData;
23636
- if (body !== void 0 && !form) headers["Content-Type"] = "application/json";
23637
- const response = await fetch(url, {
23638
- method,
23639
- headers,
23640
- redirect: "error",
23641
- body: body === void 0 ? null : form ? body : JSON.stringify(body),
23642
- ...options.signal ? { signal: options.signal } : {}
23643
- });
23644
- if (!response.ok) {
23645
- const text = await response.text().catch(() => "");
23646
- throw new TaigaApiError(method, path, response.status, text);
23692
+ },
23693
+ python: {
23694
+ label: "Python",
23695
+ detectors: {
23696
+ linguist: ["Python"],
23697
+ topics: ["python"],
23698
+ files: [
23699
+ "pyproject.toml",
23700
+ "requirements.txt",
23701
+ "setup.py",
23702
+ "Pipfile"
23703
+ ]
23647
23704
  }
23648
- if (response.status === 204) return null;
23649
- const parsed = await response.json();
23650
- return options.keepTenant ? parsed : withoutTenant(parsed);
23651
- }
23652
- /** A GET whose answer is plain text, not JSON (the third-party notices, PRO-3054). */
23653
- async requestText(path) {
23654
- const response = await fetch(`${this.baseUrl}/v1${path}`, {
23655
- method: "GET",
23656
- headers: {
23657
- Authorization: `Bearer ${this.apiKey}`,
23658
- "User-Agent": `taiga-ai-mcp-server/${SERVER_VERSION}`
23659
- },
23660
- redirect: "error"
23661
- });
23662
- if (!response.ok) {
23663
- const text = await response.text().catch(() => "");
23664
- throw new TaigaApiError("GET", path, response.status, text);
23705
+ },
23706
+ java: {
23707
+ label: "Java",
23708
+ detectors: {
23709
+ linguist: ["Java"],
23710
+ topics: ["java"],
23711
+ files: [
23712
+ "pom.xml",
23713
+ "build.gradle",
23714
+ "build.gradle.kts"
23715
+ ]
23665
23716
  }
23666
- return response.text();
23667
- }
23668
- async introspect() {
23669
- const result = await this.request("GET", "/auth/introspect", void 0, { keepTenant: true });
23670
- this.introspection = result.data;
23671
- return result.data;
23672
- }
23673
- getIntrospection() {
23674
- return this.introspection;
23675
- }
23676
- hasCapability(capability) {
23677
- if (!this.introspection) return false;
23678
- return this.introspection.capabilities.includes(capability);
23679
- }
23680
- async listProducts(opts) {
23681
- const params = new URLSearchParams();
23682
- if (opts?.factoryId) params.set("factoryId", opts.factoryId);
23683
- if (opts?.status) params.set("status", opts.status);
23684
- if (opts?.slug) params.set("slug", opts.slug);
23685
- if (opts?.address) params.set("address", opts.address);
23686
- if (opts?.repository) params.set("repository", opts.repository);
23687
- if (opts?.repositoryHost) params.set("repositoryHost", opts.repositoryHost);
23688
- if (opts?.limit) params.set("limit", String(opts.limit));
23689
- if (opts?.cursor) params.set("cursor", opts.cursor);
23690
- const qs = params.toString();
23691
- return this.request("GET", `/products${qs ? `?${qs}` : ""}`);
23692
- }
23693
- async getProduct(id, signal) {
23694
- return this.request("GET", `/products/${seg(id)}`, void 0, { signal });
23695
- }
23696
- async listProductRepositories(productId) {
23697
- return this.request("GET", `/products/${seg(productId)}/repositories`);
23698
- }
23699
- async listTenantDocuments(opts) {
23700
- const params = new URLSearchParams();
23701
- if (opts?.limit) params.set("limit", String(opts.limit));
23702
- if (opts?.cursor) params.set("cursor", opts.cursor);
23703
- const qs = params.toString();
23704
- return this.request("GET", `/tenants/current/documents${qs ? `?${qs}` : ""}`);
23705
- }
23706
- async getTenantDocument(type) {
23707
- return this.request("GET", `/tenants/current/documents/${seg(type)}`);
23708
- }
23709
- /** The shared draft for a document type, or `{ data: null }` when none exists. */
23710
- async getTenantDocumentDraft(type) {
23711
- return this.request("GET", `/tenants/current/documents/${seg(type)}/draft`);
23712
- }
23713
- /**
23714
- * Save the draft. `expectedRevision` (design_standards only) is the `revision` the edit was built on, or null when
23715
- * it was built on the published version because no draft existed; the API refuses with 409 `draft_changed` when
23716
- * the draft is no longer that. With no draft, `expectedPublishedVersion` (the published version the edit was built
23717
- * on, null when none) is checked the same way. Omitted means no check.
23718
- */
23719
- async saveTenantDocumentDraft(type, body) {
23720
- return this.request("PUT", `/tenants/current/documents/${seg(type)}/draft`, body);
23721
- }
23722
- /**
23723
- * One section of an organization document's draft (PRO-5087); 409 `draft_changed` when it changed since
23724
- * `expectedContent`. Not the design standards, which are saved whole.
23725
- */
23726
- async saveTenantDocumentSection(type, sectionId, body) {
23727
- return this.request("PUT", `/tenants/current/documents/${seg(type)}/draft/sections/${seg(sectionId)}`, body);
23717
+ },
23718
+ kotlin: {
23719
+ label: "Kotlin",
23720
+ detectors: {
23721
+ linguist: ["Kotlin"],
23722
+ topics: ["kotlin"]
23723
+ }
23724
+ },
23725
+ scala: {
23726
+ label: "Scala",
23727
+ detectors: {
23728
+ linguist: ["Scala"],
23729
+ topics: ["scala"],
23730
+ files: ["build.sbt"]
23731
+ }
23732
+ },
23733
+ csharp: {
23734
+ label: "C# / .NET",
23735
+ detectors: {
23736
+ linguist: ["C#", "F#"],
23737
+ topics: ["dotnet", "csharp"],
23738
+ files: [
23739
+ "*.csproj",
23740
+ "*.sln",
23741
+ "*.fsproj",
23742
+ "global.json"
23743
+ ]
23744
+ }
23745
+ },
23746
+ go: {
23747
+ label: "Go",
23748
+ detectors: {
23749
+ linguist: ["Go"],
23750
+ topics: ["go", "golang"],
23751
+ files: ["go.mod"]
23752
+ }
23753
+ },
23754
+ rust: {
23755
+ label: "Rust",
23756
+ detectors: {
23757
+ linguist: ["Rust"],
23758
+ topics: ["rust"],
23759
+ files: ["Cargo.toml"]
23760
+ }
23761
+ },
23762
+ php: {
23763
+ label: "PHP",
23764
+ detectors: {
23765
+ linguist: ["PHP"],
23766
+ topics: ["php"],
23767
+ files: ["composer.json"]
23768
+ }
23769
+ },
23770
+ ruby: {
23771
+ label: "Ruby",
23772
+ detectors: {
23773
+ linguist: ["Ruby"],
23774
+ topics: ["ruby"],
23775
+ files: ["Gemfile"]
23776
+ }
23777
+ },
23778
+ cpp: {
23779
+ label: "C / C++",
23780
+ detectors: {
23781
+ linguist: ["C", "C++"],
23782
+ topics: ["cpp", "c"],
23783
+ files: ["CMakeLists.txt", "meson.build"]
23784
+ }
23785
+ },
23786
+ elixir: {
23787
+ label: "Elixir",
23788
+ detectors: {
23789
+ linguist: ["Elixir"],
23790
+ topics: ["elixir"],
23791
+ files: ["mix.exs"]
23792
+ }
23793
+ },
23794
+ dart: {
23795
+ label: "Dart",
23796
+ sublabel: "Flutter",
23797
+ detectors: {
23798
+ linguist: ["Dart"],
23799
+ topics: ["dart", "flutter"],
23800
+ files: ["pubspec.yaml"]
23801
+ }
23802
+ },
23803
+ apex: {
23804
+ label: "Apex",
23805
+ sublabel: "Salesforce",
23806
+ detectors: {
23807
+ linguist: ["Apex"],
23808
+ topics: [
23809
+ "salesforce",
23810
+ "sfdx",
23811
+ "salesforce-dx",
23812
+ "apex"
23813
+ ],
23814
+ files: ["sfdx-project.json"]
23815
+ },
23816
+ clouds: ["salesforce"]
23728
23817
  }
23729
- /**
23730
- * Publish the draft. With `requireTokensAligned` the API checks, in the same transaction as the publish, that a
23731
- * design standards draft's text and tokens agree, and answers 409 `tokens_out_of_line` without publishing when
23732
- * they do not. The POST stays bodiless.
23733
- */
23734
- async publishTenantDocument(type, options) {
23735
- return this.request("POST", `/tenants/current/documents/${seg(type)}/publish${query$1({ requireTokensAligned: options?.requireTokensAligned ? true : void 0 })}`);
23736
- }
23737
- /** Whether the design standards draft's (or published version's) text and tokens were last brought into line. */
23738
- async getDesignTokenAlignment(version) {
23739
- return this.request("GET", `/tenants/current/documents/design_standards/token-alignment${query$1({ version })}`);
23740
- }
23741
- /** Edit existing tokens in the design standards draft, all or nothing. */
23742
- async updateDesignTokens(changes) {
23743
- return this.request("PATCH", "/tenants/current/documents/design_standards/draft/tokens", { changes });
23744
- }
23745
- /** Start the agent job that rewrites the draft's tokens to match its text; answers 202 with the job. */
23746
- async syncDesignTokens() {
23747
- return this.request("POST", "/tenants/current/documents/design_standards/sync-tokens");
23818
+ };
23819
+ const FRAMEWORKS = {
23820
+ react: {
23821
+ label: "React",
23822
+ languages: ["typescript"],
23823
+ role: "frontend",
23824
+ detectors: { topics: ["react", "reactjs"] }
23825
+ },
23826
+ nextjs: {
23827
+ label: "Next.js",
23828
+ languages: ["typescript"],
23829
+ role: "frontend",
23830
+ detectors: {
23831
+ topics: ["nextjs"],
23832
+ files: [
23833
+ "next.config.js",
23834
+ "next.config.mjs",
23835
+ "next.config.ts"
23836
+ ]
23837
+ }
23838
+ },
23839
+ angular: {
23840
+ label: "Angular",
23841
+ languages: ["typescript"],
23842
+ role: "frontend",
23843
+ detectors: {
23844
+ topics: ["angular"],
23845
+ files: ["angular.json"]
23846
+ }
23847
+ },
23848
+ vue: {
23849
+ label: "Vue",
23850
+ languages: ["typescript"],
23851
+ role: "frontend",
23852
+ detectors: {
23853
+ linguist: ["Vue"],
23854
+ topics: ["vue", "vuejs"]
23855
+ }
23856
+ },
23857
+ nuxt: {
23858
+ label: "Nuxt",
23859
+ languages: ["typescript"],
23860
+ role: "frontend",
23861
+ detectors: {
23862
+ topics: ["nuxt", "nuxtjs"],
23863
+ files: ["nuxt.config.ts", "nuxt.config.js"]
23864
+ }
23865
+ },
23866
+ sveltekit: {
23867
+ label: "SvelteKit",
23868
+ languages: ["typescript"],
23869
+ role: "frontend",
23870
+ detectors: {
23871
+ linguist: ["Svelte"],
23872
+ topics: ["svelte", "sveltekit"],
23873
+ files: ["svelte.config.js"]
23874
+ }
23875
+ },
23876
+ react_native: {
23877
+ label: "React Native",
23878
+ languages: ["typescript"],
23879
+ role: "mobile",
23880
+ detectors: {
23881
+ topics: ["react-native", "expo"],
23882
+ files: ["eas.json"]
23883
+ }
23884
+ },
23885
+ nestjs: {
23886
+ label: "NestJS",
23887
+ languages: ["typescript"],
23888
+ role: "backend",
23889
+ detectors: {
23890
+ topics: ["nestjs"],
23891
+ files: ["nest-cli.json"]
23892
+ }
23893
+ },
23894
+ fastify: {
23895
+ label: "Fastify",
23896
+ languages: ["typescript"],
23897
+ role: "backend",
23898
+ detectors: { topics: ["fastify"] }
23899
+ },
23900
+ express: {
23901
+ label: "Express",
23902
+ languages: ["typescript"],
23903
+ role: "backend",
23904
+ detectors: { topics: ["express", "expressjs"] }
23905
+ },
23906
+ django: {
23907
+ label: "Django",
23908
+ languages: ["python"],
23909
+ role: "backend",
23910
+ detectors: {
23911
+ topics: ["django"],
23912
+ files: ["manage.py"]
23913
+ }
23914
+ },
23915
+ fastapi: {
23916
+ label: "FastAPI",
23917
+ languages: ["python"],
23918
+ role: "backend",
23919
+ detectors: { topics: ["fastapi"] }
23920
+ },
23921
+ flask: {
23922
+ label: "Flask",
23923
+ languages: ["python"],
23924
+ role: "backend",
23925
+ detectors: { topics: ["flask"] }
23926
+ },
23927
+ spring_boot: {
23928
+ label: "Spring Boot",
23929
+ languages: ["java", "kotlin"],
23930
+ role: "backend",
23931
+ detectors: { topics: ["spring-boot", "spring"] }
23932
+ },
23933
+ quarkus: {
23934
+ label: "Quarkus",
23935
+ languages: ["java", "kotlin"],
23936
+ role: "backend",
23937
+ detectors: { topics: ["quarkus"] }
23938
+ },
23939
+ micronaut: {
23940
+ label: "Micronaut",
23941
+ languages: ["java", "kotlin"],
23942
+ role: "backend",
23943
+ detectors: { topics: ["micronaut"] }
23944
+ },
23945
+ ktor: {
23946
+ label: "Ktor",
23947
+ languages: ["kotlin"],
23948
+ role: "backend",
23949
+ detectors: { topics: ["ktor"] }
23950
+ },
23951
+ aspnet_core: {
23952
+ label: "ASP.NET Core",
23953
+ languages: ["csharp"],
23954
+ role: "backend",
23955
+ detectors: { topics: [
23956
+ "aspnetcore",
23957
+ "asp-net-core",
23958
+ "aspnet-core"
23959
+ ] }
23960
+ },
23961
+ blazor: {
23962
+ label: "Blazor",
23963
+ languages: ["csharp"],
23964
+ role: "frontend",
23965
+ detectors: {
23966
+ topics: ["blazor"],
23967
+ files: ["*.razor"]
23968
+ }
23969
+ },
23970
+ laravel: {
23971
+ label: "Laravel",
23972
+ languages: ["php"],
23973
+ role: "backend",
23974
+ detectors: {
23975
+ topics: ["laravel"],
23976
+ files: ["artisan"]
23977
+ }
23978
+ },
23979
+ symfony: {
23980
+ label: "Symfony",
23981
+ languages: ["php"],
23982
+ role: "backend",
23983
+ detectors: {
23984
+ topics: ["symfony"],
23985
+ files: ["symfony.lock"]
23986
+ }
23987
+ },
23988
+ drupal: {
23989
+ label: "Drupal",
23990
+ languages: ["php"],
23991
+ role: "backend",
23992
+ detectors: { topics: ["drupal"] }
23993
+ },
23994
+ rails: {
23995
+ label: "Rails",
23996
+ languages: ["ruby"],
23997
+ role: "backend",
23998
+ detectors: {
23999
+ topics: ["rails", "ruby-on-rails"],
24000
+ files: ["bin/rails", "config/routes.rb"]
24001
+ }
24002
+ },
24003
+ phoenix: {
24004
+ label: "Phoenix",
24005
+ languages: ["elixir"],
24006
+ role: "backend",
24007
+ detectors: { topics: ["phoenix", "phoenix-framework"] }
24008
+ },
24009
+ flutter: {
24010
+ label: "Flutter",
24011
+ languages: ["dart"],
24012
+ role: "mobile",
24013
+ detectors: { topics: ["flutter"] }
24014
+ },
24015
+ lwc: {
24016
+ label: "Lightning Web Components",
24017
+ languages: ["apex"],
24018
+ role: "frontend",
24019
+ detectors: {
24020
+ topics: ["lightning-web-components", "lwc"],
24021
+ files: ["force-app/main/default/lwc"]
24022
+ },
24023
+ clouds: ["salesforce"]
23748
24024
  }
23749
- async getFactoryDocument(factoryId, type) {
23750
- return this.request("GET", `/factories/${seg(factoryId)}/documents/${seg(type)}`);
24025
+ };
24026
+ const IAC = {
24027
+ terraform: {
24028
+ label: "Terraform / OpenTofu",
24029
+ detectors: {
24030
+ linguist: ["HCL"],
24031
+ topics: ["terraform", "opentofu"],
24032
+ files: ["*.tf", "*.tofu"]
24033
+ }
24034
+ },
24035
+ bicep: {
24036
+ label: "Bicep / ARM",
24037
+ detectors: {
24038
+ linguist: ["Bicep"],
24039
+ topics: ["bicep", "arm-templates"],
24040
+ files: ["*.bicep", "azuredeploy.json"]
24041
+ },
24042
+ clouds: ["azure"]
24043
+ },
24044
+ cloudformation: {
24045
+ label: "CloudFormation / SAM",
24046
+ detectors: {
24047
+ topics: ["cloudformation", "aws-sam"],
24048
+ files: ["template.yaml", "samconfig.toml"]
24049
+ },
24050
+ clouds: ["aws"]
24051
+ },
24052
+ aws_cdk: {
24053
+ label: "AWS CDK",
24054
+ detectors: {
24055
+ topics: ["aws-cdk", "cdk"],
24056
+ files: ["cdk.json"]
24057
+ },
24058
+ clouds: ["aws"]
24059
+ },
24060
+ pulumi: {
24061
+ label: "Pulumi",
24062
+ detectors: {
24063
+ topics: ["pulumi"],
24064
+ files: ["Pulumi.yaml"]
24065
+ }
24066
+ },
24067
+ kubernetes: {
24068
+ label: "Kubernetes manifests",
24069
+ detectors: { topics: ["kubernetes", "k8s"] }
24070
+ },
24071
+ helm: {
24072
+ label: "Helm / Kustomize",
24073
+ detectors: {
24074
+ topics: ["helm", "kustomize"],
24075
+ files: ["Chart.yaml", "kustomization.yaml"]
24076
+ }
24077
+ },
24078
+ ansible: {
24079
+ label: "Ansible",
24080
+ detectors: {
24081
+ topics: ["ansible"],
24082
+ files: ["ansible.cfg", "playbook.yml"]
24083
+ }
24084
+ },
24085
+ docker: {
24086
+ label: "Dockerfile / Compose",
24087
+ detectors: {
24088
+ linguist: ["Dockerfile"],
24089
+ topics: ["docker", "docker-compose"],
24090
+ files: [
24091
+ "Dockerfile",
24092
+ "compose.yaml",
24093
+ "docker-compose.yml"
24094
+ ]
24095
+ }
23751
24096
  }
23752
- /** The shared draft for a factory document type, or `{ data: null }` when none exists. */
23753
- async getFactoryDocumentDraft(factoryId, type) {
23754
- return this.request("GET", `/factories/${seg(factoryId)}/documents/${seg(type)}/draft`);
24097
+ };
24098
+ const SCRIPTING = {
24099
+ powershell: {
24100
+ label: "PowerShell",
24101
+ detectors: {
24102
+ linguist: ["PowerShell"],
24103
+ topics: ["powershell"],
24104
+ files: ["*.ps1", "*.psm1"]
24105
+ }
24106
+ },
24107
+ bash: {
24108
+ label: "Bash / POSIX shell",
24109
+ detectors: {
24110
+ linguist: ["Shell"],
24111
+ topics: ["bash", "shell"],
24112
+ files: ["*.sh"]
24113
+ }
24114
+ },
24115
+ python_scripts: {
24116
+ label: "Python scripts",
24117
+ detectors: {}
24118
+ },
24119
+ make: {
24120
+ label: "Make",
24121
+ detectors: {
24122
+ linguist: ["Makefile"],
24123
+ files: ["Makefile"]
24124
+ }
23755
24125
  }
23756
- async saveFactoryDocumentDraft(factoryId, type, body) {
23757
- return this.request("PUT", `/factories/${seg(factoryId)}/documents/${seg(type)}/draft`, body);
24126
+ };
24127
+ const DATA_STORES = {
24128
+ postgresql: {
24129
+ label: "PostgreSQL",
24130
+ detectors: { topics: ["postgresql", "postgres"] }
24131
+ },
24132
+ mysql: {
24133
+ label: "MySQL / MariaDB",
24134
+ detectors: { topics: ["mysql", "mariadb"] }
24135
+ },
24136
+ sql_server: {
24137
+ label: "SQL Server",
24138
+ detectors: {
24139
+ linguist: ["TSQL"],
24140
+ topics: ["sql-server", "mssql"]
24141
+ }
24142
+ },
24143
+ oracle: {
24144
+ label: "Oracle",
24145
+ detectors: {
24146
+ linguist: ["PLSQL"],
24147
+ topics: ["oracle", "oracle-database"]
24148
+ }
24149
+ },
24150
+ mongodb: {
24151
+ label: "MongoDB",
24152
+ detectors: { topics: ["mongodb"] }
24153
+ },
24154
+ redis: {
24155
+ label: "Redis / Valkey",
24156
+ detectors: { topics: ["redis", "valkey"] }
24157
+ },
24158
+ dynamodb: {
24159
+ label: "DynamoDB",
24160
+ detectors: { topics: ["dynamodb"] },
24161
+ clouds: ["aws"]
24162
+ },
24163
+ cosmos_db: {
24164
+ label: "Cosmos DB",
24165
+ detectors: { topics: ["cosmosdb", "azure-cosmos-db"] },
24166
+ clouds: ["azure"]
23758
24167
  }
23759
- /** One section of a factory document's draft (PRO-5087); 409 `draft_changed` when it changed since `expectedContent`. */
23760
- async saveFactoryDocumentSection(factoryId, type, sectionId, body) {
23761
- return this.request("PUT", `/factories/${seg(factoryId)}/documents/${seg(type)}/draft/sections/${seg(sectionId)}`, body);
24168
+ };
24169
+ const CI_CD = {
24170
+ github_actions: {
24171
+ label: "GitHub Actions",
24172
+ ciSystem: "github_actions",
24173
+ detectors: { files: [".github/workflows/*.yml", ".github/workflows/*.yaml"] }
24174
+ },
24175
+ gitlab_ci: {
24176
+ label: "GitLab CI",
24177
+ ciSystem: "gitlab_ci",
24178
+ detectors: { files: [".gitlab-ci.yml"] }
24179
+ },
24180
+ azure_pipelines: {
24181
+ label: "Azure Pipelines",
24182
+ ciSystem: "azure_pipelines",
24183
+ detectors: { files: ["azure-pipelines.yml", "azure-pipelines.yaml"] }
24184
+ },
24185
+ jenkins: {
24186
+ label: "Jenkins",
24187
+ ciSystem: "jenkins",
24188
+ detectors: { files: ["Jenkinsfile"] }
24189
+ },
24190
+ circleci: {
24191
+ label: "CircleCI",
24192
+ ciSystem: "circleci",
24193
+ detectors: { files: [".circleci/config.yml"] }
24194
+ },
24195
+ buildkite: {
24196
+ label: "Buildkite",
24197
+ ciSystem: "buildkite",
24198
+ detectors: { files: [".buildkite/pipeline.yml"] }
24199
+ },
24200
+ bitbucket_pipelines: {
24201
+ label: "Bitbucket Pipelines",
24202
+ ciSystem: "bitbucket_pipelines",
24203
+ detectors: { files: ["bitbucket-pipelines.yml"] }
24204
+ },
24205
+ teamcity: {
24206
+ label: "TeamCity",
24207
+ ciSystem: "external",
24208
+ detectors: { files: [".teamcity/settings.kts"] }
24209
+ },
24210
+ aws_codebuild: {
24211
+ label: "AWS CodeBuild / CodePipeline",
24212
+ ciSystem: "external",
24213
+ detectors: { files: ["buildspec.yml"] },
24214
+ clouds: ["aws"]
24215
+ },
24216
+ google_cloud_build: {
24217
+ label: "Google Cloud Build",
24218
+ ciSystem: "external",
24219
+ detectors: { files: ["cloudbuild.yaml", "cloudbuild.yml"] },
24220
+ clouds: ["gcp"]
23762
24221
  }
23763
- async publishFactoryDocument(factoryId, type) {
23764
- return this.request("POST", `/factories/${seg(factoryId)}/documents/${seg(type)}/publish`);
23765
- }
23766
- async listProductDocuments(productId, opts) {
23767
- const params = new URLSearchParams();
23768
- if (opts?.origin) params.set("origin", opts.origin);
23769
- if (opts?.limit) params.set("limit", String(opts.limit));
23770
- const qs = params.toString();
23771
- return this.request("GET", `/products/${seg(productId)}/documents${qs ? `?${qs}` : ""}`);
23772
- }
23773
- /**
23774
- * Stop or start the product's line. Stopping halts pulls and builds and
23775
- * stops the plan and build in flight; starting picks the interrupted work
23776
- * back up.
23777
- */
23778
- async setLineStopped(productId, stopped) {
23779
- return this.request("PUT", `/products/${seg(productId)}/line`, { stopped });
23780
- }
23781
- /** Ask an agent for work: the job is queued and runs in the background. */
23782
- async createAgentJob(body) {
23783
- return this.request("POST", "/agent-jobs", body);
23784
- }
23785
- async getAgentJob(id, signal) {
23786
- return this.request("GET", `/agent-jobs/${seg(id)}`, void 0, { signal });
23787
- }
23788
- /** The plan-side draft of a product document, or `{ data: null }` when none exists. */
23789
- async getProductDocumentDraft(productId, type) {
23790
- return this.request("GET", `/products/${seg(productId)}/documents/${seg(type)}/draft`);
23791
- }
23792
- async saveProductDocumentDraft(productId, type, body) {
23793
- return this.request("PUT", `/products/${seg(productId)}/documents/${seg(type)}/draft`, body);
23794
- }
23795
- /** One section of a product document's draft (PRO-5087); 409 `draft_changed` when it changed since `expectedContent`. */
23796
- async saveProductDocumentSection(productId, type, sectionId, body) {
23797
- return this.request("PUT", `/products/${seg(productId)}/documents/${seg(type)}/draft/sections/${seg(sectionId)}`, body);
23798
- }
23799
- async publishProductDocument(productId, type) {
23800
- return this.request("POST", `/products/${seg(productId)}/documents/${seg(type)}/publish`);
23801
- }
23802
- /** Mark the published version reviewed by the caller, as the Documents page shows it. */
23803
- async markProductDocumentReviewed(productId, type) {
23804
- return this.request("POST", `/products/${seg(productId)}/documents/${seg(type)}/review`);
23805
- }
23806
- /** Generate remaining: every missing and outdated document, in chain order. */
23807
- async generateRemainingDocuments(productId) {
23808
- return this.request("POST", `/products/${seg(productId)}/documents/generate-all`);
23809
- }
23810
- /** Cancel a Generate remaining run still in flight. */
23811
- async stopGeneratingDocuments(productId) {
23812
- return this.request("POST", `/products/${seg(productId)}/documents/generate-all/stop`);
23813
- }
23814
- async getProductDocument(productId, type, origin) {
23815
- const qs = origin ? `?${new URLSearchParams({ origin })}` : "";
23816
- return this.request("GET", `/products/${seg(productId)}/documents/${seg(type)}${qs}`);
23817
- }
23818
- /** One tool call, for usage telemetry (PRO-2845): 204, and nothing is read back. */
23819
- async reportToolCall(report) {
23820
- await this.request("POST", "/mcp/tool-calls", report);
23821
- }
23822
- /** Every published version of a product document type, newest first, each with its content (PRO-5088). */
23823
- async listProductDocumentVersions(productId, type, origin) {
23824
- const qs = origin ? `?${new URLSearchParams({ origin })}` : "";
23825
- return this.request("GET", `/products/${seg(productId)}/documents/${seg(type)}/versions${qs}`);
23826
- }
23827
- /** Every version of a product document type on the plan timeline, its draft too (PRO-5088): 204. */
23828
- async deleteProductDocuments(productId, type) {
23829
- await this.request("DELETE", `/products/${seg(productId)}/documents/${seg(type)}`);
23830
- }
23831
- /** The countries a product is offered in beyond the organization's own, and the ones that may be chosen. */
23832
- async getProductMarketCountries(productId) {
23833
- return this.request("GET", `/products/${seg(productId)}/market-countries`);
23834
- }
23835
- /**
23836
- * What changing a product's market countries would do to the organization's policies, without doing it: the
23837
- * organization-context preview the web's Markets card shows (PRO-5088).
23838
- */
23839
- async previewProductMarkets(markets) {
23840
- return this.request("POST", "/tenants/current/context/preview", { productMarkets: markets });
23841
- }
23842
- /** Change a product's market countries; the organization's policies are brought in line in the same write. */
23843
- async setProductMarkets(markets) {
23844
- return this.request("PATCH", "/tenants/current/context", { productMarkets: markets });
23845
- }
23846
- async listBacklogItems(productId, opts) {
23847
- const params = new URLSearchParams();
23848
- if (opts?.status) params.set("status", opts.status);
23849
- if (opts?.planningStatus) params.set("planningStatus", opts.planningStatus);
23850
- if (opts?.category) params.set("category", opts.category);
23851
- if (opts?.state) params.set("state", opts.state);
23852
- if (opts?.open) params.set("open", "true");
23853
- if (opts?.order) params.set("order", opts.order);
23854
- if (opts?.includeArchived) params.set("includeArchived", "true");
23855
- if (opts?.limit) params.set("limit", String(opts.limit));
23856
- if (opts?.cursor) params.set("cursor", opts.cursor);
23857
- const qs = params.toString();
23858
- return this.request("GET", `/products/${seg(productId)}/backlog${qs ? `?${qs}` : ""}`);
23859
- }
23860
- async getBacklogItem(itemId, signal) {
23861
- return this.request("GET", `/backlog/${seg(itemId)}`, void 0, { signal });
23862
- }
23863
- /** The initiative's history, oldest first: every turn event and audited move, each with who did it. */
23864
- async listBacklogItemActivity(itemId) {
23865
- return this.request("GET", `/backlog/${seg(itemId)}/activity`);
23866
- }
23867
- /** A person's move on the line board: the column dropped into, and what to follow there. */
23868
- async transitionInitiative(itemId, body) {
23869
- return this.request("PUT", `/backlog/${seg(itemId)}/state`, body);
23870
- }
23871
- /** Answer the needs-human flag: plan again, resume the run, or clear a refused start. */
23872
- async resumeInitiative(itemId) {
23873
- return this.request("POST", `/backlog/${seg(itemId)}/resume`);
23874
- }
23875
- /** The initiative's own review gate: true builds a landed plan at once, false stops for a person, null follows the product. */
23876
- async setAutoBuild(itemId, autoBuild) {
23877
- return this.request("PUT", `/backlog/${seg(itemId)}/auto-build`, { autoBuild });
23878
- }
23879
- /** The product's live queue, in order. */
23880
- async listQueue(productId) {
23881
- return this.request("GET", `/products/${seg(productId)}/queue`);
23882
- }
23883
- /** Start now: plan and build a queued entry's initiative without waiting for its turn (it leaves the queue). */
23884
- async startQueueEntryNow(entryId) {
23885
- return this.request("POST", `/queue/${seg(entryId)}/start-now`);
23886
- }
23887
- async getActivePlan(itemId) {
23888
- return this.request("GET", `/backlog/${seg(itemId)}/plans/active`);
23889
- }
23890
- async approvePlan(planId) {
23891
- return this.request("POST", `/plans/${seg(planId)}/approve`);
23892
- }
23893
- async rejectPlan(planId, body) {
23894
- return this.request("POST", `/plans/${seg(planId)}/reject`, body);
23895
- }
23896
- async listBuildRuns(productId, opts) {
23897
- const params = new URLSearchParams();
23898
- if (opts?.backlogItemId) params.set("backlogItemId", opts.backlogItemId);
23899
- if (opts?.status?.length) params.set("status", opts.status.join(","));
23900
- if (opts?.limit) params.set("limit", String(opts.limit));
23901
- if (opts?.cursor) params.set("cursor", opts.cursor);
23902
- const qs = params.toString();
23903
- return this.request("GET", `/products/${seg(productId)}/builds${qs ? `?${qs}` : ""}`);
23904
- }
23905
- /** The runs of every product the key can see, newest first; `active` narrows to the ones executing now. */
23906
- async listBuildRunActivity(opts) {
23907
- const params = new URLSearchParams();
23908
- if (opts?.active) params.set("active", "true");
23909
- if (opts?.status?.length) params.set("status", opts.status.join(","));
23910
- if (opts?.limit) params.set("limit", String(opts.limit));
23911
- if (opts?.cursor) params.set("cursor", opts.cursor);
23912
- const qs = params.toString();
23913
- return this.request("GET", `/builds${qs ? `?${qs}` : ""}`);
23914
- }
23915
- async getBuildRun(id, signal) {
23916
- return this.request("GET", `/builds/${seg(id)}`, void 0, { signal });
23917
- }
23918
- /** The run's own pull request as its forge answers now: whether it may merge, and why not (PRO-4981). */
23919
- async getBuildRunPullRequest(id) {
23920
- return this.request("GET", `/builds/${seg(id)}/pull-request`);
23921
- }
23922
- /** Merges the run's own pull request through its forge, as the run page's Merge does (PRO-4981). */
23923
- async mergeBuildRun(id) {
23924
- return this.request("POST", `/builds/${seg(id)}/merge`);
23925
- }
23926
- async stopBuildRun(id) {
23927
- return this.request("POST", `/builds/${seg(id)}/stop`);
23928
- }
23929
- /** Ask the coding agent for changes to the run's pull request (PRO-3035). */
23930
- async requestBuildRunChanges(id, notes, opts = {}) {
23931
- return this.request("POST", `/builds/${seg(id)}/request-changes`, {
23932
- notes,
23933
- ...opts.reviewPlan !== void 0 ? { reviewPlan: opts.reviewPlan } : {}
23934
- });
23935
- }
23936
- async listBuildRunSteps(id) {
23937
- return this.request("GET", `/builds/${seg(id)}/steps`);
23938
- }
23939
- /** The public hosts the run reached through the egress gateway (PRO-4268). */
23940
- async listBuildRunEgressHosts(id) {
23941
- return this.request("GET", `/builds/${seg(id)}/hosts`);
23942
- }
23943
- /** The run's report as its page reads it, with its signals (PRO-4756); data is null before one came. */
23944
- async getBuildRunOverview(id) {
23945
- return this.request("GET", `/builds/${seg(id)}/overview`);
23946
- }
23947
- async getMaintenanceSummary(productId) {
23948
- return this.request("GET", `/products/${seg(productId)}/maintenance/summary`);
23949
- }
23950
- async listMaintenanceSweeps(productId, opts) {
23951
- return this.request("GET", `/products/${seg(productId)}/maintenance/runs${query$1({ limit: opts?.limit })}`);
23952
- }
23953
- async listFindings(productId, opts) {
23954
- return this.request("GET", `/products/${seg(productId)}/maintenance/findings${query$1({ ...opts })}`);
23955
- }
23956
- async getFinding(id) {
23957
- return this.request("GET", `/maintenance/findings/${seg(id)}`);
23958
- }
23959
- /** The package inventory (PRO-2862); 404 where the `licenses` feature is not enabled. */
23960
- async listPackages(productId, opts) {
23961
- return this.request("GET", `/products/${seg(productId)}/maintenance/packages${query$1({ ...opts })}`);
23962
- }
23963
- async getLicenseSummary(productId) {
23964
- return this.request("GET", `/products/${seg(productId)}/maintenance/licenses`);
23965
- }
23966
- /** One licence across a product's inventory (PRO-3251): what it asks, when to allow it, what brings it in. */
23967
- async getProductLicense(productId, license) {
23968
- return this.request("GET", `/products/${seg(productId)}/maintenance/licenses/detail?license=${encodeURIComponent(license)}`);
23969
- }
23970
- /** Allow a licence in one product: every licence finding in force for it there ignored (PRO-3727). */
23971
- async allowProductLicense(productId, body) {
23972
- return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/ignore`, body);
23973
- }
23974
- /** Allow a licence in one product no longer: every one of its ignored licence findings there open again. */
23975
- async reopenProductLicense(productId, license) {
23976
- return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/reopen`, { license });
23977
- }
23978
- /** The organization's approved list and every licence in use across its products (PRO-3311). */
23979
- async getOrganizationLicenses() {
23980
- return this.request("GET", "/tenants/current/licenses");
23981
- }
23982
- async listOrgFindings(opts) {
23983
- return this.request("GET", `/tenants/current/findings${query$1(opts)}`);
23984
- }
23985
- async listOrgPackages(opts) {
23986
- return this.request("GET", `/tenants/current/packages${query$1(opts)}`);
23987
- }
23988
- async listOrgStanding(factoryId) {
23989
- return this.request("GET", `/tenants/current/standing${query$1({ factoryId })}`);
23990
- }
23991
- async listOrgDelivery(factoryId) {
23992
- return this.request("GET", `/tenants/current/delivery${query$1({ factoryId })}`);
23993
- }
23994
- async listOrgInitiatives(opts) {
23995
- return this.request("GET", `/tenants/current/initiatives${query$1(opts)}`);
23996
- }
23997
- /** Where one licence is used across the organization (PRO-3311). */
23998
- async getOrganizationLicense(license) {
23999
- return this.request("GET", `/tenants/current/licenses/detail?license=${encodeURIComponent(license)}`);
24000
- }
24001
- /** What approving or removing one licence would do to the findings, without doing it (PRO-3312). */
24002
- async previewLicenseChange(change) {
24003
- const query = "approve" in change ? `approve=${encodeURIComponent(change.approve)}` : `remove=${encodeURIComponent(change.remove)}`;
24004
- return this.request("GET", `/tenants/current/license-allowlist/effect?${query}`);
24005
- }
24006
- /** Approve or remove licences on the approved list, effective at once (PRO-3312). */
24007
- /** The organization's own Claude (PRO-4579), without its key, and what a Bedrock role must trust. */
24008
- async getModelConnection() {
24009
- return this.request("GET", "/model-connection");
24010
- }
24011
- async setModelConnection(input) {
24012
- return this.request("PUT", "/model-connection", input);
24013
- }
24014
- async removeModelConnection() {
24015
- return this.request("DELETE", "/model-connection");
24016
- }
24017
- async changeLicenseAllowlist(change) {
24018
- return this.request("PATCH", "/tenants/current/license-allowlist", change);
24019
- }
24020
- /** A repository's CycloneDX 1.6 SBOM (PRO-2894), the document itself. */
24021
- async getSbom(productId, repositoryId) {
24022
- return this.request("GET", `/products/${seg(productId)}/maintenance/repositories/${seg(repositoryId)}/sbom`);
24023
- }
24024
- async getNotices(productId, repositoryId) {
24025
- return this.requestText(`/products/${seg(productId)}/maintenance/repositories/${seg(repositoryId)}/notices`);
24026
- }
24027
- async updateFinding(id, body) {
24028
- return this.request("PATCH", `/maintenance/findings/${seg(id)}`, body);
24029
- }
24030
- /** What people decided about single packages under a license (PRO-4236). */
24031
- async listLicensePackageDecisions(productId) {
24032
- return this.request("GET", `/products/${seg(productId)}/maintenance/licenses/package-decisions`);
24033
- }
24034
- /** Replace one package under a license (PRO-4236): an initiative for each repository holding it. */
24035
- async replaceLicensePackage(productId, ref) {
24036
- return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/packages/replace`, ref);
24037
- }
24038
- /** Allow one package under a license in this product, or undo that (PRO-4236). */
24039
- async decideLicensePackage(productId, action, body) {
24040
- return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/packages/${action}`, body);
24041
- }
24042
- /** Ship notices (PRO-4165): raise the initiative that builds the product's open-source notices, or get the open one. */
24043
- async shipNotices(productId) {
24044
- return this.request("POST", `/products/${seg(productId)}/maintenance/notices`, {});
24045
- }
24046
- /** Sweep one of a product's repositories (PRO-4276): its primary when none is named. */
24047
- async startSweep(productId, productRepositoryId) {
24048
- return this.request("POST", `/products/${seg(productId)}/maintenance/sweeps`, productRepositoryId ? { productRepositoryId } : {});
24049
- }
24050
- async remediateFinding(productId, findingId) {
24051
- return this.request("POST", `/products/${seg(productId)}/maintenance/findings/${seg(findingId)}/remediate`, {});
24052
- }
24053
- async remediatePackage(productId, body) {
24054
- return this.request("POST", `/products/${seg(productId)}/maintenance/packages/remediate`, body);
24055
- }
24056
- async getPolicyStanding(productId) {
24057
- return this.request("GET", `/products/${seg(productId)}/maintenance/policies`);
24058
- }
24059
- async remediatePolicyControl(productId, controlId, body = {}) {
24060
- return this.request("POST", `/products/${seg(productId)}/maintenance/policies/controls/${seg(controlId)}/remediate`, body);
24061
- }
24062
- async remediatePolicyViolation(productId, divergenceId, body = {}) {
24063
- return this.request("POST", `/products/${seg(productId)}/maintenance/policies/divergences/${seg(divergenceId)}/remediate`, body);
24064
- }
24065
- /**
24066
- * What waits on a person (GET /users/me/requests), up to the API's cap, with
24067
- * what is assigned to someone else: a key speaks for the team's work.
24068
- */
24069
- async listRequests(productId) {
24070
- return this.request("GET", `/users/me/requests${query$1({
24071
- everyone: "true",
24072
- productId
24073
- })}`);
24074
- }
24075
- /** What closed in the last two weeks (GET /users/me/requests/done), by the same rules. */
24076
- async listDoneRequests(productId) {
24077
- return this.request("GET", `/users/me/requests/done${query$1({
24078
- everyone: "true",
24079
- productId
24080
- })}`);
24081
- }
24082
- /** Answer a request with one of the answers it offers. */
24083
- async answerRequest(id, exit) {
24084
- return this.request("POST", `/requests/${seg(id)}/answer`, { exit });
24085
- }
24086
- async listSetupTasks(opts) {
24087
- const { productId, ...rest } = opts;
24088
- const path = productId ? `/products/${seg(productId)}/setup-tasks` : "/setup-tasks";
24089
- return this.request("GET", `${path}${query$1({ ...rest })}`);
24090
- }
24091
- async listEnvironments(productId, opts) {
24092
- return this.request("GET", `/products/${seg(productId)}/environments${query$1({ ...opts })}`);
24093
- }
24094
- async createEnvironment(productId, body) {
24095
- return this.request("POST", `/products/${seg(productId)}/environments`, body);
24096
- }
24097
- async updateEnvironment(id, body) {
24098
- return this.request("PATCH", `/environments/${seg(id)}`, body);
24099
- }
24100
- async getCurrentDeployments(productId) {
24101
- return this.request("GET", `/products/${seg(productId)}/deployments/current`);
24102
- }
24103
- async listDeployments(productId, opts) {
24104
- return this.request("GET", `/products/${seg(productId)}/deployments${query$1({ ...opts })}`);
24105
- }
24106
- async getDeploymentSyncStatus(productId) {
24107
- return this.request("GET", `/products/${seg(productId)}/deployments/sync-status`);
24108
- }
24109
- async getDeliveryMetrics(productId, environmentId, windowDays) {
24110
- return this.request("GET", `/products/${seg(productId)}/deployments/insights${query$1({
24111
- environmentId,
24112
- windowDays
24113
- })}`);
24114
- }
24115
- /** How much people steered the work, split by coding agent version (MCP_API_LEVEL 7). */
24116
- async getSteeringSignals(productId, windowDays) {
24117
- return this.request("GET", `/products/${seg(productId)}/delivery/steering-signals${query$1({ windowDays })}`);
24118
- }
24119
- async getMonitoringHealth(productId) {
24120
- return this.request("GET", `/products/${seg(productId)}/monitoring/health`);
24121
- }
24122
- async getMonitoringSignal(productId, signal, environmentId, windowDays) {
24123
- return this.request("GET", `/products/${seg(productId)}/monitoring/${signal}${query$1({
24124
- environmentId,
24125
- windowDays
24126
- })}`);
24127
- }
24128
- async listKnowledge(opts) {
24129
- const scope = (value) => value === null ? "null" : value;
24130
- return this.request("GET", `/custom-documents${query$1({
24131
- ...opts,
24132
- factoryId: scope(opts.factoryId),
24133
- productId: scope(opts.productId)
24134
- })}`);
24135
- }
24136
- async getKnowledge(id) {
24137
- return this.request("GET", `/custom-documents/${seg(id)}`);
24138
- }
24139
- async getKnowledgeDownload(id) {
24140
- return this.request("GET", `/custom-documents/${seg(id)}/download`);
24141
- }
24142
- /** A text file filed as knowledge at one level: the organization, a factory, or a product in its factory. */
24143
- async addKnowledge(file) {
24144
- const form = new FormData();
24145
- if (file.factoryId) form.set("factoryId", file.factoryId);
24146
- if (file.productId) form.set("productId", file.productId);
24147
- form.set("file", new Blob([file.content], { type: file.mime }), file.fileName);
24148
- return this.request("POST", "/custom-documents", form);
24149
- }
24150
- async retryKnowledge(id) {
24151
- return this.request("POST", `/custom-documents/${seg(id)}/retry`);
24152
- }
24153
- async deleteKnowledge(id) {
24154
- return this.request("DELETE", `/custom-documents/${seg(id)}`);
24155
- }
24156
- async updateProduct(productId, body) {
24157
- return this.request("PATCH", `/products/${seg(productId)}`, body);
24158
- }
24159
- async updateBacklogItem(itemId, body) {
24160
- return this.request("PATCH", `/backlog/${seg(itemId)}`, body);
24161
- }
24162
- /** Everyone who can open a product, the people an initiative there can be assigned to (PRO-4982). */
24163
- async listProductPeople(productId) {
24164
- return this.request("GET", `/products/${seg(productId)}/people`);
24165
- }
24166
- /** Follows an initiative, or stops following it, for the key's own person (PRO-4982). */
24167
- async setInitiativeFollowing(itemId, userId, subscribed) {
24168
- return this.request("PUT", `/backlog/${seg(itemId)}/subscribers/${seg(userId)}`, { subscribed });
24169
- }
24170
- /** Deletes an initiative as the web does: its runs stop and the pull request it waits on closes (PRO-4983). */
24171
- async deleteBacklogItem(itemId) {
24172
- return this.request("DELETE", `/backlog/${seg(itemId)}`);
24173
- }
24174
- async getFactory(id) {
24175
- return this.request("GET", `/factories/${seg(id)}`);
24176
- }
24177
- async listFactories(opts) {
24178
- const params = new URLSearchParams();
24179
- if (opts?.limit) params.set("limit", String(opts.limit));
24180
- if (opts?.cursor) params.set("cursor", opts.cursor);
24181
- const qs = params.toString();
24182
- return this.request("GET", `/factories${qs ? `?${qs}` : ""}`);
24183
- }
24184
- async createFactory(body) {
24185
- return this.request("POST", "/factories", body);
24186
- }
24187
- async updateFactory(factoryId, body) {
24188
- return this.request("PATCH", `/factories/${seg(factoryId)}`, body);
24189
- }
24190
- async createProduct(body) {
24191
- return this.request("POST", "/products", body);
24192
- }
24193
- async previewProductMove(productId, factoryId) {
24194
- return this.request("GET", `/products/${seg(productId)}/factory/preview${query$1({ factoryId })}`);
24195
- }
24196
- async moveProduct(productId, body) {
24197
- return this.request("PUT", `/products/${seg(productId)}/factory`, body);
24198
- }
24199
- async startImport(productId) {
24200
- return this.request("POST", `/products/${seg(productId)}/brownfield-import`);
24201
- }
24202
- async refreshRealityDocuments(productId, docTypes) {
24203
- return this.request("POST", `/products/${seg(productId)}/documents/refresh-reality`, docTypes ? { docTypes } : void 0);
24204
- }
24205
- /** What still blocks finishing setup: the required documents unpublished (PRO-2800). */
24206
- async getProductSetupBlockers(productId) {
24207
- return this.request("GET", `/products/${seg(productId)}/setup`);
24208
- }
24209
- /**
24210
- * Always with a body (PRO-4986): the route's body is optional, yet a POST with none was refused on staging
24211
- * ("expected object, received null") before the handler ran, while `{}` passes.
24212
- */
24213
- async completeSetup(productId, options = {}) {
24214
- return this.request("POST", `/products/${seg(productId)}/setup/complete`, options);
24215
- }
24216
- async reopenSetup(productId) {
24217
- return this.request("POST", `/products/${seg(productId)}/setup/reopen`);
24218
- }
24219
- /** Every connected GitHub account, page by page: a later account must be findable by its id too. */
24220
- async listGithubInstallations() {
24221
- const data = [];
24222
- let cursor;
24223
- do {
24224
- const result = await this.request("GET", `/github/installations${query$1({
24225
- limit: 100,
24226
- cursor
24227
- })}`);
24228
- data.push(...result.data);
24229
- cursor = result.nextCursor ?? void 0;
24230
- } while (cursor);
24231
- return { data };
24232
- }
24233
- async listInstallationRepositories(installationId, opts) {
24234
- return this.request("GET", `/github/installations/${seg(installationId)}/repositories${query$1({ ...opts })}`);
24235
- }
24236
- /** The organization's GitLab connections (P-PRO-150); the API lists them on one page. */
24237
- async listGitLabConnections() {
24238
- return this.request("GET", "/gitlab/connections");
24239
- }
24240
- /** One page of the projects a GitLab connection's bot can push to, read live from GitLab. */
24241
- async listGitLabProjects(connectionId, opts) {
24242
- return this.request("GET", `/gitlab/connections/${seg(connectionId)}/projects${query$1({ ...opts })}`);
24243
- }
24244
- async listAzureDevOpsConnections() {
24245
- return this.request("GET", "/azure-devops/connections");
24246
- }
24247
- async listAzureDevOpsRepositories(connectionId, opts) {
24248
- return this.request("GET", `/azure-devops/connections/${seg(connectionId)}/repositories${query$1({ ...opts })}`);
24249
- }
24250
- async linkRepository(productId, body) {
24251
- return this.request("POST", `/products/${seg(productId)}/repositories`, body);
24252
- }
24253
- async updateRepository(productId, repositoryId, body) {
24254
- return this.request("PATCH", `/products/${seg(productId)}/repositories/${seg(repositoryId)}`, body);
24255
- }
24256
- async listRepositoryBranches(productId, repositoryId) {
24257
- return this.request("GET", `/products/${seg(productId)}/repositories/${seg(repositoryId)}/branches`);
24258
- }
24259
- async unlinkRepository(productId, repositoryId) {
24260
- return this.request("DELETE", `/products/${seg(productId)}/repositories/${seg(repositoryId)}`);
24261
- }
24262
- };
24263
- //#endregion
24264
- //#region ../../packages/types/dist/clouds.js
24265
- /**
24266
- * Cloud provider platforms that Taiga can connect to.
24267
- *
24268
- * `salesforce` is the Salesforce Platform (PRO-4337): where Apex and Lightning
24269
- * Web Components run. Not a cloud Taiga connects to or deploys into -- the
24270
- * customer's pipeline deploys to the org -- but the answer to "where does this
24271
- * software run", which is what this list drives in the seeded policies.
24272
- */
24273
- const CLOUD_PROVIDERS = [
24274
- "aws",
24275
- "gcp",
24276
- "azure",
24277
- "upcloud",
24278
- "salesforce",
24279
- "kubernetes",
24280
- "digitalocean",
24281
- "vercel",
24282
- "railway",
24283
- "render",
24284
- "fly",
24285
- "on_prem",
24286
- "other"
24287
- ];
24288
- //#endregion
24289
- //#region ../../packages/types/dist/ecosystems.js
24290
- /**
24291
- * Engineering ecosystems a tenant builds in.
24292
- *
24293
- * The structural twin of CLOUD_PROVIDERS: a discrete onboarding choice that
24294
- * drives seeded policy content. Clouds say where the software runs; ecosystems
24295
- * say what it is written in.
24296
- *
24297
- * Deliberately scoped to the runtimes the coding agent actually ships skills
24298
- * for (`apps/agents/coding/src/coding/skills/loader.py`, `_RUNTIME_SKILLS`).
24299
- * Offering a choice the agent cannot honour would be worse than not asking.
24300
- * JVM was absent for that reason until the coding image gained the JDK, Maven,
24301
- * Gradle, Ruby and PHP toolchains (PRO-1745) and the agent its `java`,
24302
- * `ruby-rails` and `php-laravel` skills (PRO-2914); see the three entries
24303
- * below.
24304
- *
24305
- * Frontend is its own entry rather than being bundled into `node`, because a
24306
- * stack has tiers and a runtime list cannot express them. React-with-a-Python-
24307
- * backend is one of the most common shapes there is; folding React into `node`
24308
- * would force those tenants to declare a Node backend they do not run, and the
24309
- * seeded policy would then approve Fastify for a Python shop. It also matches
24310
- * the coding agent more closely, which already keeps `node-typescript` and
24311
- * `react-nextjs` as separate skills under one runtime key.
24312
- *
24313
- * `nextjs` is the case that broke the tier model, and the reason it is its own
24314
- * entry rather than react+node (PRO-809). Next.js occupies BOTH tiers: route
24315
- * handlers and Server Actions are a backend, so `react` alone leaves a real
24316
- * backend undeclared, while `react` + `node` approves Fastify and Drizzle at a
24317
- * shop running neither. It also builds with its own bundler, so the react
24318
- * preset's Vite row is wrong for it. One framework spanning two tiers is not
24319
- * something hedged wording can fix; it needs its own entry.
24320
- *
24321
- * `other` is the escape hatch, and exists because its absence was a trap.
24322
- * `CLOUD_PROVIDERS` has always had one; ecosystems did not, so a Vue, Angular
24323
- * or Svelte shop had no true answer: declaring `react` is wrong, and declaring
24324
- * nothing falls to `UNDECLARED_STACK_ROWS`, which opens with
24325
- * "Frontend: React, TypeScript". Both paths asserted React at them. `other`
24326
- * contributes no rows at all, so their approved-technology table is silent
24327
- * about language rather than wrong about it.
24328
- *
24329
- * Note what `other` is NOT: an invitation to add Vue and friends as options.
24330
- * The agent ships no skill for any of them, and the rule above still stands --
24331
- * a skill first, then the option, never the reverse.
24332
- *
24333
- * `angular` is the first entry outside the React family, and it is its own
24334
- * entry for the same reason `nextjs` is: the toolchain, not the language.
24335
- * Angular builds with the Angular CLI's own esbuild-based builder rather than
24336
- * Vite, lints with angular-eslint rather than oxlint, and (since v21) tests
24337
- * with the CLI's Vitest builder rather than a bare Vitest config. Declaring
24338
- * `react` at an Angular shop would seed every one of those rows wrong.
24339
- *
24340
- * It also retires the specific trap `other` was documented with: an Angular
24341
- * shop previously had no true answer. Vue and Svelte still do not, and the
24342
- * rule below is why -- Angular earned the entry by having a coding-agent
24343
- * skill written for it first (PRO-1401), not the reverse.
24344
- *
24345
- * `nestjs` is the backend counterpart of that same rule, and its own entry
24346
- * rather than folding into `node` for the same reason: the toolchain, not the
24347
- * language. `node` approves Fastify, Zod and Drizzle and builds with Vite; a
24348
- * NestJS service runs its own framework on the Express or Fastify adapter,
24349
- * validates with class-validator DTOs, persists through Prisma or TypeORM, and
24350
- * builds with the Nest CLI or Nx. Declaring `node` at a Nest shop would seed
24351
- * every one of those rows wrong. Like Angular, it earned the entry by having
24352
- * its coding-agent skill shipped first (PRO-1901), not the reverse.
24353
- *
24354
- * `react-native` is the mobile client tier, and a separate entry from `react`
24355
- * for the same reason `nextjs` is (PRO-936). `react` is a web SPA that builds
24356
- * with Vite and tests with Vitest/Playwright; React Native is an Expo-managed
24357
- * mobile app that builds with the Expo/EAS toolchain and tests with jest-expo,
24358
- * so declaring `react` would seed a web tenant's Vite/Vitest rows at a mobile
24359
- * shop. Expo-managed is the default and the only variant here: a bare-workflow
24360
- * React Native app is the same source with a different native build pipeline,
24361
- * not a different approved-technology table, so it does not warrant its own id.
24362
- *
24363
- * `java`, `rails` and `laravel` are the server-rendered and API backends
24364
- * outside JavaScript, Python and .NET (PRO-2915). `java` approves Spring Boot as
24365
- * its framework the way `python` approves FastAPI or Django and `go` approves
24366
- * chi: the table names what new work should use, and the picker's sublabel
24367
- * says so ("Spring Boot, Maven or Gradle"). A JVM shop on another framework
24368
- * picks `other` rather than being approved one it does not run. `rails` and
24369
- * `laravel` are named by framework rather than language for the same reason:
24370
- * a Ruby or PHP shop that runs neither has no table we could write for it.
24371
- * Each followed the rule below -- its coding-agent skill shipped first.
24372
- *
24373
- * `salesforce` is Salesforce DX: Apex and Lightning Web Components kept as
24374
- * source-format metadata in Git (`sfdx-project.json`, `force-app/`), PRO-4337.
24375
- * It is a platform rather than a language, and its own entry for the toolchain
24376
- * reason the others are: an LWC is JavaScript, but declaring `node` would
24377
- * approve Fastify, Drizzle and a Vite build at a team whose code runs inside a
24378
- * Salesforce org and deploys with the Salesforce CLI. Like the others it
24379
- * followed the rule below: the import recognises Salesforce DX, the coding
24380
- * agent runs the repository's own checks, and its `salesforce` skill shipped
24381
- * first (PRO-4337). Apex compiles and its tests run only inside an org, so the
24382
- * customer's pipeline stays the gate that runs them.
24383
- */
24384
- const ECOSYSTEMS = [
24385
- "react",
24386
- "react-native",
24387
- "angular",
24388
- "nextjs",
24389
- "node",
24390
- "nestjs",
24391
- "python",
24392
- "dotnet",
24393
- "go",
24394
- "rust",
24395
- "java",
24396
- "rails",
24397
- "laravel",
24398
- "salesforce",
24399
- "other"
24400
- ];
24401
- //#endregion
24402
- //#region ../../packages/types/dist/stack-catalogue.js
24403
- /**
24404
- * The stack catalogue (PRO-4618, P-PRO-219): one typed list of what an
24405
- * organization builds with, read by web, API, MCP and agents.
24406
- *
24407
- * It replaces the flat `ECOSYSTEMS` list as the vocabulary of the stack. That
24408
- * list mixed tiers (a framework, a language and a platform were all one kind
24409
- * of answer), so a team writing plain PHP, PowerShell scripts or Bicep had
24410
- * nothing true to tick. Here every entry has a facet, and a framework sits
24411
- * under the language or languages it is written in.
24412
- *
24413
- * What it offers is what the Factory can actually build and test, checked
24414
- * against its build image (factory-vm `Dockerfile`, `image/toolchain-check.sh`)
24415
- * on 2026-11-12, plus the existing Salesforce choice: Apex compiles only
24416
- * inside an org, so the customer's pipeline stays the gate that runs it
24417
- * (PRO-4690). Swift is absent because the Factory runs on Linux and iOS never
24418
- * will; Dart comes only with Flutter (PRO-4689). Anything else is declared as
24419
- * "not listed" in its facet: named in the policy, promising no builds.
24420
- *
24421
- * Version control is not a facet: the connected forge already says it. CI/CD
24422
- * is, because a GitHub repository can be built by Jenkins (`CI_SYSTEMS`).
24423
- *
24424
- * Stored `ECOSYSTEMS` values keep working: `ecosystemCatalogueEntries` maps
24425
- * each onto the entries it always meant. Until the policy composes from the
24426
- * catalogue (PRO-4619) nothing a customer sees reads this list.
24427
- */
24428
- const STACK_FACETS = [
24429
- "language",
24430
- "framework",
24431
- "iac",
24432
- "scripting",
24433
- "data_store",
24434
- "ci_cd",
24435
- "iac_state"
24436
- ];
24437
- const LANGUAGES = {
24438
- typescript: {
24439
- label: "TypeScript / JavaScript",
24440
- sublabel: "Node.js",
24441
- detectors: {
24442
- linguist: ["TypeScript", "JavaScript"],
24443
- topics: [
24444
- "typescript",
24445
- "javascript",
24446
- "nodejs",
24447
- "node"
24448
- ],
24449
- files: ["package.json", "tsconfig.json"]
24450
- }
24451
- },
24452
- python: {
24453
- label: "Python",
24454
- detectors: {
24455
- linguist: ["Python"],
24456
- topics: ["python"],
24457
- files: [
24458
- "pyproject.toml",
24459
- "requirements.txt",
24460
- "setup.py",
24461
- "Pipfile"
24462
- ]
24463
- }
24464
- },
24465
- java: {
24466
- label: "Java",
24467
- detectors: {
24468
- linguist: ["Java"],
24469
- topics: ["java"],
24470
- files: [
24471
- "pom.xml",
24472
- "build.gradle",
24473
- "build.gradle.kts"
24474
- ]
24475
- }
24476
- },
24477
- kotlin: {
24478
- label: "Kotlin",
24479
- detectors: {
24480
- linguist: ["Kotlin"],
24481
- topics: ["kotlin"]
24482
- }
24483
- },
24484
- scala: {
24485
- label: "Scala",
24486
- detectors: {
24487
- linguist: ["Scala"],
24488
- topics: ["scala"],
24489
- files: ["build.sbt"]
24490
- }
24491
- },
24492
- csharp: {
24493
- label: "C# / .NET",
24494
- detectors: {
24495
- linguist: ["C#", "F#"],
24496
- topics: ["dotnet", "csharp"],
24497
- files: [
24498
- "*.csproj",
24499
- "*.sln",
24500
- "*.fsproj",
24501
- "global.json"
24502
- ]
24503
- }
24504
- },
24505
- go: {
24506
- label: "Go",
24507
- detectors: {
24508
- linguist: ["Go"],
24509
- topics: ["go", "golang"],
24510
- files: ["go.mod"]
24511
- }
24512
- },
24513
- rust: {
24514
- label: "Rust",
24515
- detectors: {
24516
- linguist: ["Rust"],
24517
- topics: ["rust"],
24518
- files: ["Cargo.toml"]
24519
- }
24520
- },
24521
- php: {
24522
- label: "PHP",
24523
- detectors: {
24524
- linguist: ["PHP"],
24525
- topics: ["php"],
24526
- files: ["composer.json"]
24527
- }
24528
- },
24529
- ruby: {
24530
- label: "Ruby",
24531
- detectors: {
24532
- linguist: ["Ruby"],
24533
- topics: ["ruby"],
24534
- files: ["Gemfile"]
24535
- }
24536
- },
24537
- cpp: {
24538
- label: "C / C++",
24539
- detectors: {
24540
- linguist: ["C", "C++"],
24541
- topics: ["cpp", "c"],
24542
- files: ["CMakeLists.txt", "meson.build"]
24543
- }
24544
- },
24545
- elixir: {
24546
- label: "Elixir",
24547
- detectors: {
24548
- linguist: ["Elixir"],
24549
- topics: ["elixir"],
24550
- files: ["mix.exs"]
24551
- }
24552
- },
24553
- dart: {
24554
- label: "Dart",
24555
- sublabel: "Flutter",
24556
- detectors: {
24557
- linguist: ["Dart"],
24558
- topics: ["dart", "flutter"],
24559
- files: ["pubspec.yaml"]
24560
- }
24561
- },
24562
- apex: {
24563
- label: "Apex",
24564
- sublabel: "Salesforce",
24565
- detectors: {
24566
- linguist: ["Apex"],
24567
- topics: [
24568
- "salesforce",
24569
- "sfdx",
24570
- "salesforce-dx",
24571
- "apex"
24572
- ],
24573
- files: ["sfdx-project.json"]
24574
- },
24575
- clouds: ["salesforce"]
24576
- }
24577
- };
24578
- const FRAMEWORKS = {
24579
- react: {
24580
- label: "React",
24581
- languages: ["typescript"],
24582
- role: "frontend",
24583
- detectors: { topics: ["react", "reactjs"] }
24584
- },
24585
- nextjs: {
24586
- label: "Next.js",
24587
- languages: ["typescript"],
24588
- role: "frontend",
24589
- detectors: {
24590
- topics: ["nextjs"],
24591
- files: [
24592
- "next.config.js",
24593
- "next.config.mjs",
24594
- "next.config.ts"
24595
- ]
24596
- }
24597
- },
24598
- angular: {
24599
- label: "Angular",
24600
- languages: ["typescript"],
24601
- role: "frontend",
24602
- detectors: {
24603
- topics: ["angular"],
24604
- files: ["angular.json"]
24605
- }
24606
- },
24607
- vue: {
24608
- label: "Vue",
24609
- languages: ["typescript"],
24610
- role: "frontend",
24611
- detectors: {
24612
- linguist: ["Vue"],
24613
- topics: ["vue", "vuejs"]
24614
- }
24615
- },
24616
- nuxt: {
24617
- label: "Nuxt",
24618
- languages: ["typescript"],
24619
- role: "frontend",
24620
- detectors: {
24621
- topics: ["nuxt", "nuxtjs"],
24622
- files: ["nuxt.config.ts", "nuxt.config.js"]
24623
- }
24624
- },
24625
- sveltekit: {
24626
- label: "SvelteKit",
24627
- languages: ["typescript"],
24628
- role: "frontend",
24629
- detectors: {
24630
- linguist: ["Svelte"],
24631
- topics: ["svelte", "sveltekit"],
24632
- files: ["svelte.config.js"]
24633
- }
24634
- },
24635
- react_native: {
24636
- label: "React Native",
24637
- languages: ["typescript"],
24638
- role: "mobile",
24639
- detectors: {
24640
- topics: ["react-native", "expo"],
24641
- files: ["eas.json"]
24642
- }
24643
- },
24644
- nestjs: {
24645
- label: "NestJS",
24646
- languages: ["typescript"],
24647
- role: "backend",
24648
- detectors: {
24649
- topics: ["nestjs"],
24650
- files: ["nest-cli.json"]
24651
- }
24652
- },
24653
- fastify: {
24654
- label: "Fastify",
24655
- languages: ["typescript"],
24656
- role: "backend",
24657
- detectors: { topics: ["fastify"] }
24658
- },
24659
- express: {
24660
- label: "Express",
24661
- languages: ["typescript"],
24662
- role: "backend",
24663
- detectors: { topics: ["express", "expressjs"] }
24664
- },
24665
- django: {
24666
- label: "Django",
24667
- languages: ["python"],
24668
- role: "backend",
24669
- detectors: {
24670
- topics: ["django"],
24671
- files: ["manage.py"]
24672
- }
24673
- },
24674
- fastapi: {
24675
- label: "FastAPI",
24676
- languages: ["python"],
24677
- role: "backend",
24678
- detectors: { topics: ["fastapi"] }
24679
- },
24680
- flask: {
24681
- label: "Flask",
24682
- languages: ["python"],
24683
- role: "backend",
24684
- detectors: { topics: ["flask"] }
24685
- },
24686
- spring_boot: {
24687
- label: "Spring Boot",
24688
- languages: ["java", "kotlin"],
24689
- role: "backend",
24690
- detectors: { topics: ["spring-boot", "spring"] }
24691
- },
24692
- quarkus: {
24693
- label: "Quarkus",
24694
- languages: ["java", "kotlin"],
24695
- role: "backend",
24696
- detectors: { topics: ["quarkus"] }
24697
- },
24698
- micronaut: {
24699
- label: "Micronaut",
24700
- languages: ["java", "kotlin"],
24701
- role: "backend",
24702
- detectors: { topics: ["micronaut"] }
24703
- },
24704
- ktor: {
24705
- label: "Ktor",
24706
- languages: ["kotlin"],
24707
- role: "backend",
24708
- detectors: { topics: ["ktor"] }
24709
- },
24710
- aspnet_core: {
24711
- label: "ASP.NET Core",
24712
- languages: ["csharp"],
24713
- role: "backend",
24714
- detectors: { topics: [
24715
- "aspnetcore",
24716
- "asp-net-core",
24717
- "aspnet-core"
24718
- ] }
24719
- },
24720
- blazor: {
24721
- label: "Blazor",
24722
- languages: ["csharp"],
24723
- role: "frontend",
24724
- detectors: {
24725
- topics: ["blazor"],
24726
- files: ["*.razor"]
24727
- }
24728
- },
24729
- laravel: {
24730
- label: "Laravel",
24731
- languages: ["php"],
24732
- role: "backend",
24733
- detectors: {
24734
- topics: ["laravel"],
24735
- files: ["artisan"]
24736
- }
24737
- },
24738
- symfony: {
24739
- label: "Symfony",
24740
- languages: ["php"],
24741
- role: "backend",
24742
- detectors: {
24743
- topics: ["symfony"],
24744
- files: ["symfony.lock"]
24745
- }
24746
- },
24747
- drupal: {
24748
- label: "Drupal",
24749
- languages: ["php"],
24750
- role: "backend",
24751
- detectors: { topics: ["drupal"] }
24752
- },
24753
- rails: {
24754
- label: "Rails",
24755
- languages: ["ruby"],
24756
- role: "backend",
24757
- detectors: {
24758
- topics: ["rails", "ruby-on-rails"],
24759
- files: ["bin/rails", "config/routes.rb"]
24760
- }
24761
- },
24762
- phoenix: {
24763
- label: "Phoenix",
24764
- languages: ["elixir"],
24765
- role: "backend",
24766
- detectors: { topics: ["phoenix", "phoenix-framework"] }
24767
- },
24768
- flutter: {
24769
- label: "Flutter",
24770
- languages: ["dart"],
24771
- role: "mobile",
24772
- detectors: { topics: ["flutter"] }
24773
- },
24774
- lwc: {
24775
- label: "Lightning Web Components",
24776
- languages: ["apex"],
24777
- role: "frontend",
24778
- detectors: {
24779
- topics: ["lightning-web-components", "lwc"],
24780
- files: ["force-app/main/default/lwc"]
24781
- },
24782
- clouds: ["salesforce"]
24783
- }
24784
- };
24785
- const IAC = {
24786
- terraform: {
24787
- label: "Terraform / OpenTofu",
24788
- detectors: {
24789
- linguist: ["HCL"],
24790
- topics: ["terraform", "opentofu"],
24791
- files: ["*.tf", "*.tofu"]
24792
- }
24793
- },
24794
- bicep: {
24795
- label: "Bicep / ARM",
24796
- detectors: {
24797
- linguist: ["Bicep"],
24798
- topics: ["bicep", "arm-templates"],
24799
- files: ["*.bicep", "azuredeploy.json"]
24800
- },
24801
- clouds: ["azure"]
24802
- },
24803
- cloudformation: {
24804
- label: "CloudFormation / SAM",
24805
- detectors: {
24806
- topics: ["cloudformation", "aws-sam"],
24807
- files: ["template.yaml", "samconfig.toml"]
24808
- },
24809
- clouds: ["aws"]
24810
- },
24811
- aws_cdk: {
24812
- label: "AWS CDK",
24813
- detectors: {
24814
- topics: ["aws-cdk", "cdk"],
24815
- files: ["cdk.json"]
24816
- },
24817
- clouds: ["aws"]
24818
- },
24819
- pulumi: {
24820
- label: "Pulumi",
24821
- detectors: {
24822
- topics: ["pulumi"],
24823
- files: ["Pulumi.yaml"]
24824
- }
24825
- },
24826
- kubernetes: {
24827
- label: "Kubernetes manifests",
24828
- detectors: { topics: ["kubernetes", "k8s"] }
24829
- },
24830
- helm: {
24831
- label: "Helm / Kustomize",
24832
- detectors: {
24833
- topics: ["helm", "kustomize"],
24834
- files: ["Chart.yaml", "kustomization.yaml"]
24835
- }
24836
- },
24837
- ansible: {
24838
- label: "Ansible",
24839
- detectors: {
24840
- topics: ["ansible"],
24841
- files: ["ansible.cfg", "playbook.yml"]
24842
- }
24843
- },
24844
- docker: {
24845
- label: "Dockerfile / Compose",
24846
- detectors: {
24847
- linguist: ["Dockerfile"],
24848
- topics: ["docker", "docker-compose"],
24849
- files: [
24850
- "Dockerfile",
24851
- "compose.yaml",
24852
- "docker-compose.yml"
24853
- ]
24854
- }
24855
- }
24856
- };
24857
- const SCRIPTING = {
24858
- powershell: {
24859
- label: "PowerShell",
24860
- detectors: {
24861
- linguist: ["PowerShell"],
24862
- topics: ["powershell"],
24863
- files: ["*.ps1", "*.psm1"]
24864
- }
24865
- },
24866
- bash: {
24867
- label: "Bash / POSIX shell",
24868
- detectors: {
24869
- linguist: ["Shell"],
24870
- topics: ["bash", "shell"],
24871
- files: ["*.sh"]
24872
- }
24873
- },
24874
- python_scripts: {
24875
- label: "Python scripts",
24876
- detectors: {}
24877
- },
24878
- make: {
24879
- label: "Make",
24880
- detectors: {
24881
- linguist: ["Makefile"],
24882
- files: ["Makefile"]
24883
- }
24884
- }
24885
- };
24886
- const DATA_STORES = {
24887
- postgresql: {
24888
- label: "PostgreSQL",
24889
- detectors: { topics: ["postgresql", "postgres"] }
24890
- },
24891
- mysql: {
24892
- label: "MySQL / MariaDB",
24893
- detectors: { topics: ["mysql", "mariadb"] }
24894
- },
24895
- sql_server: {
24896
- label: "SQL Server",
24897
- detectors: {
24898
- linguist: ["TSQL"],
24899
- topics: ["sql-server", "mssql"]
24900
- }
24901
- },
24902
- oracle: {
24903
- label: "Oracle",
24904
- detectors: {
24905
- linguist: ["PLSQL"],
24906
- topics: ["oracle", "oracle-database"]
24907
- }
24908
- },
24909
- mongodb: {
24910
- label: "MongoDB",
24911
- detectors: { topics: ["mongodb"] }
24912
- },
24913
- redis: {
24914
- label: "Redis / Valkey",
24915
- detectors: { topics: ["redis", "valkey"] }
24916
- },
24917
- dynamodb: {
24918
- label: "DynamoDB",
24919
- detectors: { topics: ["dynamodb"] },
24920
- clouds: ["aws"]
24921
- },
24922
- cosmos_db: {
24923
- label: "Cosmos DB",
24924
- detectors: { topics: ["cosmosdb", "azure-cosmos-db"] },
24925
- clouds: ["azure"]
24926
- }
24927
- };
24928
- const CI_CD = {
24929
- github_actions: {
24930
- label: "GitHub Actions",
24931
- ciSystem: "github_actions",
24932
- detectors: { files: [".github/workflows/*.yml", ".github/workflows/*.yaml"] }
24933
- },
24934
- gitlab_ci: {
24935
- label: "GitLab CI",
24936
- ciSystem: "gitlab_ci",
24937
- detectors: { files: [".gitlab-ci.yml"] }
24938
- },
24939
- azure_pipelines: {
24940
- label: "Azure Pipelines",
24941
- ciSystem: "azure_pipelines",
24942
- detectors: { files: ["azure-pipelines.yml", "azure-pipelines.yaml"] }
24943
- },
24944
- jenkins: {
24945
- label: "Jenkins",
24946
- ciSystem: "jenkins",
24947
- detectors: { files: ["Jenkinsfile"] }
24948
- },
24949
- circleci: {
24950
- label: "CircleCI",
24951
- ciSystem: "circleci",
24952
- detectors: { files: [".circleci/config.yml"] }
24953
- },
24954
- buildkite: {
24955
- label: "Buildkite",
24956
- ciSystem: "buildkite",
24957
- detectors: { files: [".buildkite/pipeline.yml"] }
24958
- },
24959
- bitbucket_pipelines: {
24960
- label: "Bitbucket Pipelines",
24961
- ciSystem: "bitbucket_pipelines",
24962
- detectors: { files: ["bitbucket-pipelines.yml"] }
24963
- },
24964
- teamcity: {
24965
- label: "TeamCity",
24966
- ciSystem: "external",
24967
- detectors: { files: [".teamcity/settings.kts"] }
24968
- },
24969
- aws_codebuild: {
24970
- label: "AWS CodeBuild / CodePipeline",
24971
- ciSystem: "external",
24972
- detectors: { files: ["buildspec.yml"] },
24973
- clouds: ["aws"]
24974
- },
24975
- google_cloud_build: {
24976
- label: "Google Cloud Build",
24977
- ciSystem: "external",
24978
- detectors: { files: ["cloudbuild.yaml", "cloudbuild.yml"] },
24979
- clouds: ["gcp"]
24980
- }
24981
- };
24982
- /**
24983
- * Where Terraform / OpenTofu or Pulumi keeps its state: a bucket in the
24984
- * organization's own cloud, or a service that holds it. CloudFormation, CDK
24985
- * and Bicep have no state file of their own (the cloud keeps it), and Ansible
24986
- * keeps none, so they have no entry here.
24987
- */
24988
- const IAC_STATE = {
24989
- s3: {
24990
- label: "S3",
24991
- sublabel: "AWS",
24992
- iacTools: ["terraform", "pulumi"],
24993
- detectors: {},
24994
- clouds: ["aws"]
24995
- },
24996
- azure_blob: {
24997
- label: "Azure Blob Storage",
24998
- iacTools: ["terraform", "pulumi"],
24999
- detectors: {},
25000
- clouds: ["azure"]
25001
- },
25002
- gcs: {
25003
- label: "Cloud Storage",
25004
- sublabel: "Google Cloud",
25005
- iacTools: ["terraform", "pulumi"],
25006
- detectors: {},
25007
- clouds: ["gcp"]
25008
- },
25009
- upcloud_object_storage: {
25010
- label: "UpCloud Object Storage",
25011
- iacTools: ["terraform", "pulumi"],
25012
- detectors: {},
25013
- clouds: ["upcloud"]
25014
- },
25015
- hcp_terraform: {
25016
- label: "HCP Terraform",
25017
- sublabel: "Terraform Cloud",
25018
- iacTools: ["terraform"],
25019
- detectors: { topics: ["terraform-cloud", "hcp-terraform"] }
25020
- },
25021
- terraform_enterprise: {
25022
- label: "Terraform Enterprise",
25023
- iacTools: ["terraform"],
25024
- detectors: { topics: ["terraform-enterprise"] }
25025
- },
25026
- spacelift: {
25027
- label: "Spacelift",
25028
- iacTools: ["terraform"],
25029
- detectors: {
25030
- topics: ["spacelift"],
25031
- files: [".spacelift/config.yml"]
25032
- }
25033
- },
25034
- env0: {
25035
- label: "env0",
25036
- iacTools: ["terraform"],
25037
- detectors: {
25038
- topics: ["env0"],
25039
- files: ["env0.yml"]
25040
- }
25041
- },
25042
- scalr: {
25043
- label: "Scalr",
25044
- iacTools: ["terraform"],
25045
- detectors: { topics: ["scalr"] }
25046
- },
25047
- gitlab_terraform_state: {
25048
- label: "GitLab-managed state",
25049
- iacTools: ["terraform"],
25050
- detectors: {}
25051
- },
25052
- pulumi_cloud: {
25053
- label: "Pulumi Cloud",
25054
- iacTools: ["pulumi"],
25055
- detectors: {}
25056
- },
25057
- pulumi_self_hosted: {
25058
- label: "Pulumi self-hosted",
25059
- iacTools: ["pulumi"],
25060
- detectors: {}
24222
+ };
24223
+ /**
24224
+ * Where Terraform / OpenTofu or Pulumi keeps its state: a bucket in the
24225
+ * organization's own cloud, or a service that holds it. CloudFormation, CDK
24226
+ * and Bicep have no state file of their own (the cloud keeps it), and Ansible
24227
+ * keeps none, so they have no entry here.
24228
+ */
24229
+ const IAC_STATE = {
24230
+ s3: {
24231
+ label: "S3",
24232
+ sublabel: "AWS",
24233
+ iacTools: ["terraform", "pulumi"],
24234
+ detectors: {},
24235
+ clouds: ["aws"]
24236
+ },
24237
+ azure_blob: {
24238
+ label: "Azure Blob Storage",
24239
+ iacTools: ["terraform", "pulumi"],
24240
+ detectors: {},
24241
+ clouds: ["azure"]
24242
+ },
24243
+ gcs: {
24244
+ label: "Cloud Storage",
24245
+ sublabel: "Google Cloud",
24246
+ iacTools: ["terraform", "pulumi"],
24247
+ detectors: {},
24248
+ clouds: ["gcp"]
24249
+ },
24250
+ upcloud_object_storage: {
24251
+ label: "UpCloud Object Storage",
24252
+ iacTools: ["terraform", "pulumi"],
24253
+ detectors: {},
24254
+ clouds: ["upcloud"]
24255
+ },
24256
+ hcp_terraform: {
24257
+ label: "HCP Terraform",
24258
+ sublabel: "Terraform Cloud",
24259
+ iacTools: ["terraform"],
24260
+ detectors: { topics: ["terraform-cloud", "hcp-terraform"] }
24261
+ },
24262
+ terraform_enterprise: {
24263
+ label: "Terraform Enterprise",
24264
+ iacTools: ["terraform"],
24265
+ detectors: { topics: ["terraform-enterprise"] }
24266
+ },
24267
+ spacelift: {
24268
+ label: "Spacelift",
24269
+ iacTools: ["terraform"],
24270
+ detectors: {
24271
+ topics: ["spacelift"],
24272
+ files: [".spacelift/config.yml"]
24273
+ }
24274
+ },
24275
+ env0: {
24276
+ label: "env0",
24277
+ iacTools: ["terraform"],
24278
+ detectors: {
24279
+ topics: ["env0"],
24280
+ files: ["env0.yml"]
24281
+ }
24282
+ },
24283
+ scalr: {
24284
+ label: "Scalr",
24285
+ iacTools: ["terraform"],
24286
+ detectors: { topics: ["scalr"] }
24287
+ },
24288
+ gitlab_terraform_state: {
24289
+ label: "GitLab-managed state",
24290
+ iacTools: ["terraform"],
24291
+ detectors: {}
24292
+ },
24293
+ pulumi_cloud: {
24294
+ label: "Pulumi Cloud",
24295
+ iacTools: ["pulumi"],
24296
+ detectors: {}
24297
+ },
24298
+ pulumi_self_hosted: {
24299
+ label: "Pulumi self-hosted",
24300
+ iacTools: ["pulumi"],
24301
+ detectors: {}
25061
24302
  }
25062
24303
  };
25063
24304
  function entries(facet, group) {
@@ -27275,6 +26516,8 @@ const TURN_EVENT_TRIGGERS = [
27275
26516
  "changes_answered",
27276
26517
  "run_replanned"
27277
26518
  ];
26519
+ /** Longest request a change carries: what the person asked for, in a paragraph or two. */
26520
+ const CHANGE_ASK_MAX_CHARS = 2e3;
27278
26521
  /**
27279
26522
  * The events the feed reads beside the turn log (PRO-3156): a board move, a
27280
26523
  * stop cleared, and a person's Start now press. They carry no possession (`turn` is null), so they are not
@@ -28595,7 +27838,7 @@ const AGENT_JOB_TYPES = [
28595
27838
  "replan_run",
28596
27839
  "compliance_check",
28597
27840
  "engineering_review",
28598
- "assess_tickets"
27841
+ "assess_issues"
28599
27842
  ];
28600
27843
  /**
28601
27844
  * Why a PROMPTED `generate_backlog` job planned nothing.
@@ -29185,18 +28428,18 @@ const TRACKER_CONNECTION_STATUSES = [
29185
28428
  "auth_failed",
29186
28429
  "unreachable"
29187
28430
  ];
29188
- /** What kind of place a provider files tickets in, in its own word. */
28431
+ /** What kind of place a provider files issues in, in its own word. */
29189
28432
  const TRACKER_PLACE_KINDS = [
29190
28433
  "project",
29191
28434
  "table",
29192
28435
  "team"
29193
28436
  ];
29194
- const TICKET_IMPORT_STATES = ["open", "in_progress"];
28437
+ const ISSUE_IMPORT_STATES = ["open", "in_progress"];
29195
28438
  /**
29196
28439
  * What a refresh of one source answers. `busy` is another refresh of the
29197
28440
  * same source still running: nothing was read, and its result will arrive.
29198
28441
  */
29199
- const TICKET_REFRESH_OUTCOMES = [...[
28442
+ const ISSUE_REFRESH_OUTCOMES = [...[
29200
28443
  "read",
29201
28444
  "unreachable",
29202
28445
  "refused",
@@ -29818,7 +29061,9 @@ const SCOPE_TRIGGERS = [
29818
29061
  "defense",
29819
29062
  "ai_system",
29820
29063
  "ai_high_risk",
29821
- "consumer_facing"
29064
+ "consumer_facing",
29065
+ "financial_entity",
29066
+ "nis2_entity"
29822
29067
  ];
29823
29068
  /**
29824
29069
  * Every trigger an industry's content rests on (PRO-4424): its default, and
@@ -30006,6 +29251,24 @@ const IAC_PHRASES = [
30006
29251
  new RegExp(`^\\|\\s*(${CONTROL_ID_SOURCE})\\s*\\|\\s*(.*?)\\s*(?:\\||$)`);
30007
29252
  REALITY_DERIVED_DOCUMENT_TYPES.filter((t) => t !== "codebase_snapshot");
30008
29253
  //#endregion
29254
+ //#region ../../packages/types/dist/interpretation.js
29255
+ /**
29256
+ * The organization's position on an open point of law (PRO-5051).
29257
+ *
29258
+ * Where an official text can reasonably be read more than one way, the
29259
+ * content says so in one sentence at the end of the control (the
29260
+ * interpretation rule in `regulations/README.md`): "Interpretation: <what
29261
+ * the text leaves open>; the organisation decides how it applies to its
29262
+ * service." This is where the organization's decision is kept: it takes the
29263
+ * reading the control is written to, or states its own. One position per
29264
+ * control and per organization, the latest standing; each act is audited.
29265
+ */
29266
+ /** How the organization answers an open point: the control as written, or its own reading. */
29267
+ const INTERPRETATION_POSITIONS = ["accepted", "own"];
29268
+ /** The longest statement of the organization's own reading. */
29269
+ const INTERPRETATION_STATEMENT_MAX_LENGTH = 2e3;
29270
+ new RegExp(`^\\|\\s*(${CONTROL_ID_SOURCE})\\s*\\|`);
29271
+ //#endregion
30009
29272
  //#region ../../packages/types/dist/product-requirements.js
30010
29273
  /**
30011
29274
  * Where a product's requirements are stored (PRO-5046, PRO-5048): the
@@ -30465,7 +29728,7 @@ const trackerFilterField = string$2().trim().min(1).max(64).regex(/^[a-z][a-z0-9
30465
29728
  * value's name is read from the tracker where the tracker gives values ids of
30466
29729
  * their own; a free-text value, such as a label, is its own name.
30467
29730
  */
30468
- const ticketSourceFilter = strictObject({
29731
+ const issueSourceFilter = strictObject({
30469
29732
  field: trackerFilterField,
30470
29733
  valueIds: array(string$2().trim().min(1).max(255)).min(1).max(50)
30471
29734
  });
@@ -30831,6 +30094,14 @@ object({
30831
30094
  })).optional()
30832
30095
  }))
30833
30096
  });
30097
+ object({ positions: array(object({
30098
+ controlId: string$2(),
30099
+ position: _enum(INTERPRETATION_POSITIONS),
30100
+ statement: string$2().nullable(),
30101
+ open: string$2(),
30102
+ decidedAt: string$2(),
30103
+ decidedByName: string$2().nullable()
30104
+ })) });
30834
30105
  object({
30835
30106
  regulationId: string$2(),
30836
30107
  acknowledgements: array(object({
@@ -31096,20 +30367,20 @@ strictObject({
31096
30367
  answer: _enum(SCOPE_ANSWER_VALUES),
31097
30368
  note: string$2().trim().max(SCOPE_ANSWER_NOTE_MAX_LENGTH).optional()
31098
30369
  }), strictObject({ environments: array(string$2()).default(["development"]) }), object({ id: string$2().uuid() }), strictObject({
31099
- ticketId: uuid,
31100
- /** For a ticket Taiga read as too large: one initiative per piece of its split, all with the ticket's key. */
30370
+ issueId: uuid,
30371
+ /** For an issue Taiga read as too large: one initiative per piece of its split, all with the issue's key. */
31101
30372
  asSplit: boolean().optional(),
31102
30373
  /**
31103
30374
  * With `asSplit`: when the assessment whose split the person was shown
31104
- * was made. Refused when the ticket was assessed again since, so the
30375
+ * was made. Refused when the issue was assessed again since, so the
31105
30376
  * pieces written are the ones confirmed. Optional for a tab of a build
31106
30377
  * that sends none; the server then holds the job to the split it reads.
31107
30378
  */
31108
30379
  splitAssessedAt: string$2().datetime({ offset: true }).optional()
31109
- }), strictObject({ ticketIds: array(uuid).min(1).max(25) }), strictObject({
30380
+ }), strictObject({ issueIds: array(uuid).min(1).max(25) }), strictObject({ on: boolean() }), object({ on: boolean() }), strictObject({
31110
30381
  connectionId: uuid,
31111
30382
  placeId: trackerPlaceId,
31112
- filter: ticketSourceFilter.nullable().optional()
30383
+ filter: issueSourceFilter.nullable().optional()
31113
30384
  }), object({ sourceId: uuid }), strictObject({
31114
30385
  connection: newCloudConnection,
31115
30386
  environment: object({
@@ -31221,14 +30492,14 @@ object({
31221
30492
  });
31222
30493
  /** A source's import rules (PRO-5082): each list trimmed, distinct and bounded. */
31223
30494
  const ruleValues = array(string$2().trim().min(1).max(255)).max(50).refine((values) => new Set(values.map((v) => v.toLowerCase())).size === values.length, "A value is listed twice");
31224
- const ticketImportRules = strictObject({
30495
+ const issueImportRules = strictObject({
31225
30496
  types: ruleValues,
31226
- states: array(_enum(TICKET_IMPORT_STATES)).max(TICKET_IMPORT_STATES.length),
30497
+ states: array(_enum(ISSUE_IMPORT_STATES)).max(ISSUE_IMPORT_STATES.length),
31227
30498
  labels: ruleValues
31228
30499
  });
31229
- strictObject({ filter: ticketSourceFilter.nullable() }), strictObject({ rules: ticketImportRules.nullable() }), object({
31230
- outcome: _enum(TICKET_REFRESH_OUTCOMES),
31231
- tickets: number$1().int().nullable(),
30500
+ strictObject({ filter: issueSourceFilter.nullable() }), strictObject({ rules: issueImportRules.nullable() }), object({
30501
+ outcome: _enum(ISSUE_REFRESH_OUTCOMES),
30502
+ issues: number$1().int().nullable(),
31232
30503
  truncated: boolean()
31233
30504
  });
31234
30505
  strictObject({
@@ -31535,6 +30806,11 @@ strictObject({
31535
30806
  acknowledge: boolean(),
31536
30807
  immediate: boolean().optional()
31537
30808
  }), strictObject({ regulationId }), strictObject({ regulationId }), strictObject({
30809
+ controlId: string$2().min(1).max(40),
30810
+ position: _enum(INTERPRETATION_POSITIONS),
30811
+ statement: string$2().max(INTERPRETATION_STATEMENT_MAX_LENGTH).optional(),
30812
+ open: string$2().min(1).max(4e3)
30813
+ }), strictObject({
31538
30814
  documentType: string$2().min(1).max(100),
31539
30815
  sections: record(string$2(), unknown$1())
31540
30816
  }), object({ jobId: uuid }), settledBilling(tenantBillingSchema), strictObject({
@@ -31758,7 +31034,13 @@ discriminatedUnion("kind", [strictObject({
31758
31034
  factoryId: string$2().uuid().nullable(),
31759
31035
  factoryIds: array(string$2().uuid()).max(20).optional(),
31760
31036
  productIds: array(string$2().uuid()).max(20).optional()
31761
- }).refine((input) => input.factoryIds === void 0 && input.productIds === void 0 || input.factoryId === null, { message: "A set names its factories in factoryIds" });
31037
+ }).refine((input) => input.factoryIds === void 0 && input.productIds === void 0 || input.factoryId === null, { message: "A set names its factories in factoryIds" }), strictObject({
31038
+ factoryIds: array(string$2().uuid()).max(20),
31039
+ productIds: array(string$2().uuid()).max(20)
31040
+ }).refine((input) => input.factoryIds.length + input.productIds.length > 0, { message: "A narrow names what to leave out" }), strictObject({
31041
+ factoryIds: array(string$2().uuid()).max(20),
31042
+ productIds: array(string$2().uuid()).max(20)
31043
+ }).refine((input) => input.factoryIds.length + input.productIds.length > 0, { message: "A focus names what the thread is about" });
31762
31044
  strictObject({ kind: _enum(["sbom", "notices"]) }), object({
31763
31045
  url: string$2().url().nullable(),
31764
31046
  expiresAt: string$2().nullable()
@@ -37179,340 +36461,1104 @@ function parseSpdxExpression(text) {
37179
36461
  function licenseOperands(tree) {
37180
36462
  return tree.kind === "license" ? [tree] : tree.operands.flatMap(licenseOperands);
37181
36463
  }
37182
- //#endregion
37183
- //#region ../../packages/types/dist/licenses/license-normalise.js
36464
+ //#endregion
36465
+ //#region ../../packages/types/dist/licenses/license-normalise.js
36466
+ /**
36467
+ * One reading of licence text as SPDX (milestone 2j, design 5.2).
36468
+ *
36469
+ * Registries and scanners declare licences in every shape: SPDX expressions
36470
+ * (`MIT OR Apache-2.0`), deprecated ids (`GPL-2.0-with-classpath-exception`),
36471
+ * names (`The Apache Software License, Version 2.0`, `MPL 2.0`), abbreviations
36472
+ * (`GPL2 w/ CPE`), URLs, and words that are no licence at all (`Nonstandard`,
36473
+ * `SEE LICENSE IN README.md`). deps.dev reduces the hard ones to
36474
+ * `non-standard`, and until now that reduction was final, so h2 (`MPL 2.0`,
36475
+ * `EPL 1.0`) and mysql-connector-j read as non-standard. This reads the raw
36476
+ * text once, the same way for every source:
36477
+ *
36478
+ * 1. an SPDX expression of listed ids is that expression, in the list's
36479
+ * spelling (a deprecated id stays itself; `currentSpelling` compares it
36480
+ * with its current form);
36481
+ * 2. a name the alias table knows (`ALIASES`: what registries actually
36482
+ * write, checked by hand), then the SPDX list's own names and ids compared
36483
+ * without punctuation or filler words, then the licence's reference URL;
36484
+ * 3. anything else is a licence that is not a standard one, kept with its
36485
+ * text and link so a person can read it.
36486
+ *
36487
+ * A declaration of several licences is a choice in the ecosystems whose
36488
+ * manifests say so (a POM's `<licenses>`, a gemspec's `licenses`,
36489
+ * composer.json's `license` array): `normaliseDeclared` joins them with OR,
36490
+ * a non-standard one as a `LicenseRef-` operand, so `GPL-2.0-only OR
36491
+ * GPL-3.0-only OR LicenseRef-nonstandard` still offers the GPLs. Elsewhere
36492
+ * several licences all apply (AND).
36493
+ */
36494
+ const DEPRECATED = {
36495
+ "AGPL-1.0": "AGPL-1.0-only",
36496
+ "AGPL-3.0": "AGPL-3.0-only",
36497
+ "GFDL-1.1": "GFDL-1.1-only",
36498
+ "GFDL-1.2": "GFDL-1.2-only",
36499
+ "GFDL-1.3": "GFDL-1.3-only",
36500
+ "GPL-1.0": "GPL-1.0-only",
36501
+ "GPL-1.0+": "GPL-1.0-or-later",
36502
+ "GPL-2.0": "GPL-2.0-only",
36503
+ "GPL-2.0+": "GPL-2.0-or-later",
36504
+ "GPL-3.0": "GPL-3.0-only",
36505
+ "GPL-3.0+": "GPL-3.0-or-later",
36506
+ "LGPL-2.0": "LGPL-2.0-only",
36507
+ "LGPL-2.0+": "LGPL-2.0-or-later",
36508
+ "LGPL-2.1": "LGPL-2.1-only",
36509
+ "LGPL-2.1+": "LGPL-2.1-or-later",
36510
+ "LGPL-3.0": "LGPL-3.0-only",
36511
+ "LGPL-3.0+": "LGPL-3.0-or-later",
36512
+ "GPL-2.0-with-classpath-exception": "GPL-2.0-only WITH Classpath-exception-2.0",
36513
+ "GPL-2.0-with-GCC-exception": "GPL-2.0-only WITH GCC-exception-2.0",
36514
+ "GPL-2.0-with-autoconf-exception": "GPL-2.0-only WITH Autoconf-exception-2.0",
36515
+ "GPL-2.0-with-bison-exception": "GPL-2.0-only WITH Bison-exception-2.2",
36516
+ "GPL-2.0-with-font-exception": "GPL-2.0-only WITH Font-exception-2.0",
36517
+ "GPL-3.0-with-GCC-exception": "GPL-3.0-only WITH GCC-exception-3.1",
36518
+ "GPL-3.0-with-autoconf-exception": "GPL-3.0-only WITH Autoconf-exception-3.0",
36519
+ "eCos-2.0": "GPL-2.0-or-later WITH eCos-exception-2.0",
36520
+ wxWindows: "GPL-2.0-or-later WITH WxWindows-exception-3.1",
36521
+ "BSD-2-Clause-FreeBSD": "BSD-2-Clause",
36522
+ "BSD-2-Clause-NetBSD": "BSD-2-Clause",
36523
+ "StandardML-NJ": "SMLNJ",
36524
+ Nunit: "zlib-acknowledgement",
36525
+ "bzip2-1.0.5": "bzip2-1.0.6"
36526
+ };
36527
+ /** Words a licence name carries that do not tell two licences apart. */
36528
+ const FILLER = /* @__PURE__ */ new Set([
36529
+ "the",
36530
+ "license",
36531
+ "licence",
36532
+ "licensed",
36533
+ "version",
36534
+ "v",
36535
+ "software",
36536
+ "under",
36537
+ "terms",
36538
+ "of"
36539
+ ]);
36540
+ /** A name reduced to what distinguishes it: `The Apache Software License, Version 2.0` -> `apache20`. */
36541
+ function nameKey(text) {
36542
+ return text.toLowerCase().replace(/licence/g, "license").replace(/[^a-z0-9.+]+/g, " ").split(" ").filter((word) => word !== "" && !FILLER.has(word)).join("").replace(/\./g, "");
36543
+ }
36544
+ let index$1 = null;
36545
+ function buildIndex() {
36546
+ const ids = /* @__PURE__ */ new Map();
36547
+ const currentForms = /* @__PURE__ */ new Map();
36548
+ const exceptions = /* @__PURE__ */ new Map();
36549
+ const names = /* @__PURE__ */ new Map();
36550
+ const urls = /* @__PURE__ */ new Map();
36551
+ const add = (map, key, id) => {
36552
+ if (key === "") return;
36553
+ const held = map.get(key);
36554
+ if (held === void 0) map.set(key, id);
36555
+ else if (held !== id) map.set(key, null);
36556
+ };
36557
+ for (const [id, name, deprecated, references] of SPDX_LICENSES) {
36558
+ const current = deprecated ? DEPRECATED[id] : id;
36559
+ ids.set(id.toLowerCase(), id);
36560
+ currentForms.set(id.toLowerCase(), current ?? id);
36561
+ if (!current) continue;
36562
+ add(names, nameKey(id), current);
36563
+ add(names, nameKey(name), current);
36564
+ if (/ only$/i.test(name)) add(names, nameKey(name.replace(/ only$/i, "")), current);
36565
+ for (const reference of references) add(urls, reference, current);
36566
+ }
36567
+ for (const [id, , deprecated] of SPDX_EXCEPTIONS) if (!deprecated) exceptions.set(id.toLowerCase(), id);
36568
+ const definite = (map) => new Map([...map].filter((entry) => entry[1] !== null));
36569
+ return {
36570
+ ids,
36571
+ current: currentForms,
36572
+ exceptions,
36573
+ names: definite(names),
36574
+ urls: definite(urls)
36575
+ };
36576
+ }
36577
+ function lists() {
36578
+ index$1 ??= buildIndex();
36579
+ return index$1;
36580
+ }
36581
+ /**
36582
+ * `text` as an SPDX expression of listed licences and exceptions, in the
36583
+ * list's spelling (a deprecated id kept as itself); null when it is not one.
36584
+ * `LicenseRef-` operands are kept as written.
36585
+ */
36586
+ function spdxExpression(text) {
36587
+ const trimmed = text.trim();
36588
+ const tree = parseSpdxExpression(/^[^\s()/]+(\/[^\s()/]+)+$/.test(trimmed) ? trimmed.split("/").join(" OR ") : trimmed);
36589
+ if (tree === null) return null;
36590
+ const { ids, exceptions } = lists();
36591
+ const spelled = /* @__PURE__ */ new Map();
36592
+ for (const operand of licenseOperands(tree)) {
36593
+ let current;
36594
+ if (/^licenseref-/i.test(operand.license)) current = operand.license;
36595
+ else current = ids.get(operand.license.toLowerCase());
36596
+ if (current === void 0) return null;
36597
+ if (operand.exception !== null) {
36598
+ const exception = exceptions.get(operand.exception.toLowerCase());
36599
+ if (exception === void 0 || current.includes(" WITH ")) return null;
36600
+ spelled.set(operand.exception, exception);
36601
+ }
36602
+ spelled.set(operand.license, / (AND|OR) /.test(current) ? `(${current})` : current);
36603
+ }
36604
+ return render$1(tree, spelled);
36605
+ }
36606
+ /**
36607
+ * One licence, with or without its exception, in the list's spelling (a
36608
+ * deprecated id as itself); null for anything else (an expression of
36609
+ * several licences, a LicenseRef, an exception alone).
36610
+ */
36611
+ function spdxLicenseEntry(text) {
36612
+ const expression = spdxExpression(text);
36613
+ if (expression === null) return null;
36614
+ const plain = unwrap(expression);
36615
+ const tree = parseSpdxExpression(plain);
36616
+ return tree?.kind === "license" && !/^licenseref-/i.test(tree.license) ? plain : null;
36617
+ }
36618
+ /**
36619
+ * One licence (or licence WITH exception) as the list and the licences are
36620
+ * compared (milestone 2j): its current SPDX form, lower-cased, so a list
36621
+ * written with `GPL-2.0` allows a package read as `GPL-2.0-only`, and one with
36622
+ * `GPL-2.0-with-classpath-exception` the same licence in its current spelling.
36623
+ */
36624
+ function currentSpelling(text) {
36625
+ const held = spellings.get(text);
36626
+ if (held !== void 0) return held;
36627
+ const spelled = (currentForm(text) ?? text.trim()).toLowerCase();
36628
+ if (spellings.size >= SPELLINGS_MAX) spellings.clear();
36629
+ spellings.set(text, spelled);
36630
+ return spelled;
36631
+ }
36632
+ /**
36633
+ * `currentSpelling` by its text. A judgement compares every licence of every
36634
+ * package against every list entry, and each spelling parses the text three
36635
+ * times: an organization's change of its list, over a few thousand packages,
36636
+ * spent seconds parsing the same few dozen strings.
36637
+ */
36638
+ const spellings = /* @__PURE__ */ new Map();
36639
+ const SPELLINGS_MAX = 1e4;
36640
+ /** One list entry in its current form, cased as the list spells it; null for what is no entry. */
36641
+ function currentForm(text) {
36642
+ const entry = spdxLicenseEntry(text);
36643
+ const tree = entry === null ? null : parseSpdxExpression(entry);
36644
+ if (tree === null || tree.kind !== "license") return null;
36645
+ const base = lists().current.get(tree.license.toLowerCase()) ?? tree.license;
36646
+ return tree.exception === null ? base : `${base} WITH ${tree.exception}`;
36647
+ }
36648
+ function render$1(tree, spelled) {
36649
+ if (tree.kind === "license") {
36650
+ const id = spelled.get(tree.license) ?? tree.license;
36651
+ if (tree.exception === null) return id;
36652
+ return `${id} WITH ${spelled.get(tree.exception) ?? tree.exception}`;
36653
+ }
36654
+ return tree.operands.map((operand) => operand.kind === "license" ? render$1(operand, spelled) : `(${render$1(operand, spelled)})`).join(tree.kind === "and" ? " AND " : " OR ");
36655
+ }
36656
+ function unwrap(expression) {
36657
+ return expression.startsWith("(") && expression.endsWith(")") && parseSpdxExpression(expression.slice(1, -1)) ? expression.slice(1, -1) : expression;
36658
+ }
36659
+ //#endregion
36660
+ //#region ../../packages/types/dist/licenses/pypi-classifiers.js
36661
+ /**
36662
+ * A licence family without its version or variant, by the name the inventory
36663
+ * keeps for it (the classifier's last segment), with every id it can stand
36664
+ * for. The PEP 639 list, plus the classifiers PyPI lists that name a licence
36665
+ * with several published versions and none given (EFL, NPL, Zope).
36666
+ */
36667
+ const AMBIGUOUS = {
36668
+ "Academic Free License (AFL)": [
36669
+ "AFL-1.1",
36670
+ "AFL-1.2",
36671
+ "AFL-2.0",
36672
+ "AFL-2.1",
36673
+ "AFL-3.0"
36674
+ ],
36675
+ "Apache Software License": [
36676
+ "Apache-1.0",
36677
+ "Apache-1.1",
36678
+ "Apache-2.0"
36679
+ ],
36680
+ "Apple Public Source License": [
36681
+ "APSL-1.0",
36682
+ "APSL-1.1",
36683
+ "APSL-1.2",
36684
+ "APSL-2.0"
36685
+ ],
36686
+ "Artistic License": ["Artistic-1.0", "Artistic-2.0"],
36687
+ "BSD License": [
36688
+ "BSD-2-Clause",
36689
+ "BSD-2-Clause-Patent",
36690
+ "BSD-3-Clause"
36691
+ ],
36692
+ "GNU Affero General Public License v3": ["AGPL-3.0-only", "AGPL-3.0-or-later"],
36693
+ "GNU Free Documentation License (FDL)": [
36694
+ "GFDL-1.1-only",
36695
+ "GFDL-1.1-or-later",
36696
+ "GFDL-1.2-only",
36697
+ "GFDL-1.2-or-later",
36698
+ "GFDL-1.3-only",
36699
+ "GFDL-1.3-or-later"
36700
+ ],
36701
+ "GNU General Public License (GPL)": [
36702
+ "GPL-1.0-only",
36703
+ "GPL-1.0-or-later",
36704
+ "GPL-2.0-only",
36705
+ "GPL-2.0-or-later",
36706
+ "GPL-3.0-only",
36707
+ "GPL-3.0-or-later"
36708
+ ],
36709
+ "GNU General Public License v2 (GPLv2)": ["GPL-2.0-only", "GPL-2.0-or-later"],
36710
+ "GNU General Public License v3 (GPLv3)": ["GPL-3.0-only", "GPL-3.0-or-later"],
36711
+ "GNU Lesser General Public License v2 (LGPLv2)": ["LGPL-2.0-only", "LGPL-2.1-only"],
36712
+ "GNU Lesser General Public License v2 or later (LGPLv2+)": ["LGPL-2.0-or-later", "LGPL-2.1-or-later"],
36713
+ "GNU Lesser General Public License v3 (LGPLv3)": ["LGPL-3.0-only", "LGPL-3.0-or-later"],
36714
+ "GNU Library or Lesser General Public License (LGPL)": [
36715
+ "LGPL-2.0-only",
36716
+ "LGPL-2.0-or-later",
36717
+ "LGPL-2.1-only",
36718
+ "LGPL-2.1-or-later",
36719
+ "LGPL-3.0-only",
36720
+ "LGPL-3.0-or-later"
36721
+ ],
36722
+ "Eiffel Forum License (EFL)": ["EFL-1.0", "EFL-2.0"],
36723
+ "Netscape Public License (NPL)": ["NPL-1.0", "NPL-1.1"],
36724
+ "Zope Public License": [
36725
+ "ZPL-1.1",
36726
+ "ZPL-2.0",
36727
+ "ZPL-2.1"
36728
+ ],
36729
+ "Public Domain": [],
36730
+ "Free For Educational Use": [],
36731
+ "Free For Home Use": [],
36732
+ "Free for non-commercial use": [],
36733
+ "Freely Distributable": [],
36734
+ "Free To Use But Restricted": [],
36735
+ Freeware: [],
36736
+ "Other/Proprietary License": [],
36737
+ "Repoze Public License": [],
36738
+ "GUST Font License 1.0": [],
36739
+ "GUST Font License 2006-09-30": []
36740
+ };
36741
+ /**
36742
+ * The ids a licence string the inventory holds can stand for, when it is an
36743
+ * ambiguous classifier's name; undefined for anything else.
36744
+ */
36745
+ function classifierCandidates(license) {
36746
+ return Object.prototype.hasOwnProperty.call(AMBIGUOUS, license) ? AMBIGUOUS[license] : void 0;
36747
+ }
36748
+ //#endregion
36749
+ //#region ../../packages/types/dist/licenses/license-category.js
36750
+ const operandText = (o) => o.exception === null ? o.license : `${o.license} WITH ${o.exception}`;
36751
+ /**
36752
+ * Canonical text of a tree: operands sorted, and parentheses only where they
36753
+ * change the meaning (an OR inside an AND), so one decision always reads the
36754
+ * same however it was written.
36755
+ */
36756
+ function canonicalText(node, insideAnd = false) {
36757
+ if (node.kind === "license") return operandText(node);
36758
+ const flat = (n) => n.kind === node.kind ? n.operands.flatMap(flat) : [n];
36759
+ const joined = node.operands.flatMap(flat).map((o) => canonicalText(o, node.kind === "and")).sort().join(node.kind === "and" ? " AND " : " OR ");
36760
+ return node.kind === "or" && insideAnd ? `(${joined})` : joined;
36761
+ }
36762
+ /**
36763
+ * The part of an expression that is outside the allowlist (PRO-2944): what a
36764
+ * reviewer actually decides on. `Apache-2.0 AND LGPL-3.0-or-later` is outside
36765
+ * only through `LGPL-3.0-or-later`; `GPL-2.0-only OR LGPL-2.1-only`, with
36766
+ * neither allowed, through both choices. An AND keeps its sides that are not
36767
+ * allowed, an OR none when any side is allowed and all of them otherwise, and
36768
+ * an operand reads like the finding's (compared whole, `WITH` included). The
36769
+ * text is canonical (operands sorted, runs of one operator flattened,
36770
+ * parentheses only around an OR inside an AND), so one decision always reads
36771
+ * the same and groups as one. Null
36772
+ * when nothing reads outside, or the string is no expression: the caller then
36773
+ * falls back to the whole licence.
36774
+ */
36775
+ function outsideAllowlist(expression, allowlist) {
36776
+ const tree = parseSpdxExpression(expression);
36777
+ if (tree === null) return null;
36778
+ const allowed = new Set(allowlist.map(currentSpelling));
36779
+ const isAllowed = (node) => node.kind === "license" ? allowed.has(currentSpelling(operandText(node))) : node.kind === "and" ? node.operands.every(isAllowed) : node.operands.some(isAllowed);
36780
+ const prune = (node) => {
36781
+ if (node.kind === "license") {
36782
+ if (node.exception === null && UNKNOWN_LICENSES.includes(node.license)) return null;
36783
+ return isAllowed(node) ? null : node;
36784
+ }
36785
+ if (node.kind === "or" && node.operands.some(isAllowed)) return null;
36786
+ const kept = node.operands.map(prune).filter((n) => n !== null);
36787
+ if (kept.length === 0) return null;
36788
+ if (kept.length === 1) return kept[0];
36789
+ const operands = kept.flatMap((n) => n.kind === node.kind ? n.operands : [n]);
36790
+ return {
36791
+ kind: node.kind,
36792
+ operands
36793
+ };
36794
+ };
36795
+ const pruned = prune(tree);
36796
+ return pruned === null ? null : canonicalText(pruned);
36797
+ }
36798
+ const SERVER_VERSION = createRequire(import.meta.url)("../package.json").version;
36799
+ //#endregion
36800
+ //#region src/client.ts
36801
+ /**
36802
+ * The same value without any `tenantId` or `prTitle`, at any depth. A pull
36803
+ * request's title is text anyone with write access on the forge can set, so no
36804
+ * model reads it through this server. Build run and step
36805
+ * rows carry one; the key is scoped to one tenant already, so the id is
36806
+ * never something the model acts on. Applied to every response here, once,
36807
+ * so no tool, resource or prompt can hand it over by forgetting to; only
36808
+ * the key's own introspection keeps it, typed and never handed over.
36809
+ *
36810
+ * An explicit stack rather than recursion: a document body a person stored
36811
+ * can nest as deep as JSON.parse allows, and a walk must not overflow where
36812
+ * the parse did not. Every key is defined as a data property, so an own
36813
+ * "__proto__" key stays a key instead of becoming the copy's prototype.
36814
+ */
36815
+ function withoutTenant(value) {
36816
+ const root = {};
36817
+ const pending = [{
36818
+ source: value,
36819
+ target: root,
36820
+ key: "out"
36821
+ }];
36822
+ while (pending.length > 0) {
36823
+ const { source, target, key } = pending.pop();
36824
+ let copy = source;
36825
+ if (Array.isArray(source)) {
36826
+ copy = new Array(source.length);
36827
+ for (let index = source.length - 1; index >= 0; index -= 1) pending.push({
36828
+ source: source[index],
36829
+ target: copy,
36830
+ key: index
36831
+ });
36832
+ } else if (source !== null && typeof source === "object") {
36833
+ copy = {};
36834
+ const entries = Object.entries(source).filter(([inner]) => inner !== "tenantId" && inner !== "prTitle");
36835
+ for (let index = entries.length - 1; index >= 0; index -= 1) pending.push({
36836
+ source: entries[index][1],
36837
+ target: copy,
36838
+ key: entries[index][0]
36839
+ });
36840
+ }
36841
+ Object.defineProperty(target, key, {
36842
+ value: copy,
36843
+ enumerable: true,
36844
+ writable: true,
36845
+ configurable: true
36846
+ });
36847
+ }
36848
+ return root.out;
36849
+ }
36850
+ var TaigaApiError = class extends Error {
36851
+ status;
36852
+ code;
36853
+ apiMessage;
36854
+ /** A refusal's structured reason, when the API sent one: `{ reason, ... }` (a 409's discriminator and its data). */
36855
+ details;
36856
+ constructor(method, path, status, body) {
36857
+ const parsed = parseErrorBody(body);
36858
+ super(`Taiga API ${method} ${path} failed (${status}): ${parsed.message ?? body}`);
36859
+ this.name = "TaigaApiError";
36860
+ this.status = status;
36861
+ this.code = parsed.code;
36862
+ this.apiMessage = parsed.message;
36863
+ this.details = parsed.details;
36864
+ }
36865
+ };
37184
36866
  /**
37185
- * One reading of licence text as SPDX (milestone 2j, design 5.2).
37186
- *
37187
- * Registries and scanners declare licences in every shape: SPDX expressions
37188
- * (`MIT OR Apache-2.0`), deprecated ids (`GPL-2.0-with-classpath-exception`),
37189
- * names (`The Apache Software License, Version 2.0`, `MPL 2.0`), abbreviations
37190
- * (`GPL2 w/ CPE`), URLs, and words that are no licence at all (`Nonstandard`,
37191
- * `SEE LICENSE IN README.md`). deps.dev reduces the hard ones to
37192
- * `non-standard`, and until now that reduction was final, so h2 (`MPL 2.0`,
37193
- * `EPL 1.0`) and mysql-connector-j read as non-standard. This reads the raw
37194
- * text once, the same way for every source:
37195
- *
37196
- * 1. an SPDX expression of listed ids is that expression, in the list's
37197
- * spelling (a deprecated id stays itself; `currentSpelling` compares it
37198
- * with its current form);
37199
- * 2. a name the alias table knows (`ALIASES`: what registries actually
37200
- * write, checked by hand), then the SPDX list's own names and ids compared
37201
- * without punctuation or filler words, then the licence's reference URL;
37202
- * 3. anything else is a licence that is not a standard one, kept with its
37203
- * text and link so a person can read it.
37204
- *
37205
- * A declaration of several licences is a choice in the ecosystems whose
37206
- * manifests say so (a POM's `<licenses>`, a gemspec's `licenses`,
37207
- * composer.json's `license` array): `normaliseDeclared` joins them with OR,
37208
- * a non-standard one as a `LicenseRef-` operand, so `GPL-2.0-only OR
37209
- * GPL-3.0-only OR LicenseRef-nonstandard` still offers the GPLs. Elsewhere
37210
- * several licences all apply (AND).
36867
+ * One path segment. Every id and type a tool passes is validated at the
36868
+ * tool boundary; this is the second wall. Encoding keeps a slash inside the
36869
+ * segment, and the dot segments are refused outright: encodeURIComponent
36870
+ * leaves "." and ".." as they are, and the URL parser in fetch would then
36871
+ * collapse `/documents/../publish` into a different route.
37211
36872
  */
37212
- const DEPRECATED = {
37213
- "AGPL-1.0": "AGPL-1.0-only",
37214
- "AGPL-3.0": "AGPL-3.0-only",
37215
- "GFDL-1.1": "GFDL-1.1-only",
37216
- "GFDL-1.2": "GFDL-1.2-only",
37217
- "GFDL-1.3": "GFDL-1.3-only",
37218
- "GPL-1.0": "GPL-1.0-only",
37219
- "GPL-1.0+": "GPL-1.0-or-later",
37220
- "GPL-2.0": "GPL-2.0-only",
37221
- "GPL-2.0+": "GPL-2.0-or-later",
37222
- "GPL-3.0": "GPL-3.0-only",
37223
- "GPL-3.0+": "GPL-3.0-or-later",
37224
- "LGPL-2.0": "LGPL-2.0-only",
37225
- "LGPL-2.0+": "LGPL-2.0-or-later",
37226
- "LGPL-2.1": "LGPL-2.1-only",
37227
- "LGPL-2.1+": "LGPL-2.1-or-later",
37228
- "LGPL-3.0": "LGPL-3.0-only",
37229
- "LGPL-3.0+": "LGPL-3.0-or-later",
37230
- "GPL-2.0-with-classpath-exception": "GPL-2.0-only WITH Classpath-exception-2.0",
37231
- "GPL-2.0-with-GCC-exception": "GPL-2.0-only WITH GCC-exception-2.0",
37232
- "GPL-2.0-with-autoconf-exception": "GPL-2.0-only WITH Autoconf-exception-2.0",
37233
- "GPL-2.0-with-bison-exception": "GPL-2.0-only WITH Bison-exception-2.2",
37234
- "GPL-2.0-with-font-exception": "GPL-2.0-only WITH Font-exception-2.0",
37235
- "GPL-3.0-with-GCC-exception": "GPL-3.0-only WITH GCC-exception-3.1",
37236
- "GPL-3.0-with-autoconf-exception": "GPL-3.0-only WITH Autoconf-exception-3.0",
37237
- "eCos-2.0": "GPL-2.0-or-later WITH eCos-exception-2.0",
37238
- wxWindows: "GPL-2.0-or-later WITH WxWindows-exception-3.1",
37239
- "BSD-2-Clause-FreeBSD": "BSD-2-Clause",
37240
- "BSD-2-Clause-NetBSD": "BSD-2-Clause",
37241
- "StandardML-NJ": "SMLNJ",
37242
- Nunit: "zlib-acknowledgement",
37243
- "bzip2-1.0.5": "bzip2-1.0.6"
37244
- };
37245
- /** Words a licence name carries that do not tell two licences apart. */
37246
- const FILLER = /* @__PURE__ */ new Set([
37247
- "the",
37248
- "license",
37249
- "licence",
37250
- "licensed",
37251
- "version",
37252
- "v",
37253
- "software",
37254
- "under",
37255
- "terms",
37256
- "of"
37257
- ]);
37258
- /** A name reduced to what distinguishes it: `The Apache Software License, Version 2.0` -> `apache20`. */
37259
- function nameKey(text) {
37260
- return text.toLowerCase().replace(/licence/g, "license").replace(/[^a-z0-9.+]+/g, " ").split(" ").filter((word) => word !== "" && !FILLER.has(word)).join("").replace(/\./g, "");
36873
+ function seg(value) {
36874
+ if (value === "" || value === "." || value === "..") throw new TypeError(`Invalid path segment: ${JSON.stringify(value)}`);
36875
+ return encodeURIComponent(value);
37261
36876
  }
37262
- let index$1 = null;
37263
- function buildIndex() {
37264
- const ids = /* @__PURE__ */ new Map();
37265
- const currentForms = /* @__PURE__ */ new Map();
37266
- const exceptions = /* @__PURE__ */ new Map();
37267
- const names = /* @__PURE__ */ new Map();
37268
- const urls = /* @__PURE__ */ new Map();
37269
- const add = (map, key, id) => {
37270
- if (key === "") return;
37271
- const held = map.get(key);
37272
- if (held === void 0) map.set(key, id);
37273
- else if (held !== id) map.set(key, null);
37274
- };
37275
- for (const [id, name, deprecated, references] of SPDX_LICENSES) {
37276
- const current = deprecated ? DEPRECATED[id] : id;
37277
- ids.set(id.toLowerCase(), id);
37278
- currentForms.set(id.toLowerCase(), current ?? id);
37279
- if (!current) continue;
37280
- add(names, nameKey(id), current);
37281
- add(names, nameKey(name), current);
37282
- if (/ only$/i.test(name)) add(names, nameKey(name.replace(/ only$/i, "")), current);
37283
- for (const reference of references) add(urls, reference, current);
36877
+ /**
36878
+ * A query string from the defined values only, prefixed with "?" when there
36879
+ * is one. Every value goes through URLSearchParams, so nothing a tool passes
36880
+ * can add a parameter of its own.
36881
+ */
36882
+ function query$1(params) {
36883
+ const search = new URLSearchParams();
36884
+ for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null && value !== "") search.set(key, String(value));
36885
+ const text = search.toString();
36886
+ return text ? `?${text}` : "";
36887
+ }
36888
+ function parseErrorBody(body) {
36889
+ try {
36890
+ const json = JSON.parse(body);
36891
+ const message = typeof json.message === "string" ? json.message : void 0;
36892
+ const details = Array.isArray(json.details) ? json.details.map((d) => [d.instancePath, d.message].filter((x) => typeof x === "string" && x).join(" ")).filter(Boolean) : [];
36893
+ const structured = typeof json.details === "object" && json.details !== null && !Array.isArray(json.details) ? json.details : void 0;
36894
+ return {
36895
+ ...typeof json.code === "string" ? { code: json.code } : {},
36896
+ ...message ? { message: details.length ? `${message}: ${details.join("; ")}` : message } : {},
36897
+ ...structured ? { details: structured } : {}
36898
+ };
36899
+ } catch {
36900
+ return {};
36901
+ }
36902
+ }
36903
+ var TaigaClient = class {
36904
+ baseUrl;
36905
+ /** The API this client talks to, as its host: the environment a reader is in (PRO-2823). */
36906
+ get apiHost() {
36907
+ try {
36908
+ return new URL(this.baseUrl).host;
36909
+ } catch {
36910
+ return this.baseUrl;
36911
+ }
36912
+ }
36913
+ apiKey;
36914
+ introspection = null;
36915
+ /** The MCP client this server serves, as it named itself; read on every request (it may connect after this was made). */
36916
+ clientName = () => void 0;
36917
+ /** Says on every request from now on which client the server serves: `X-Taiga-Client`. */
36918
+ nameClientBy(name) {
36919
+ this.clientName = name;
36920
+ }
36921
+ /** The request's headers: the key, this server, and the client it serves when it named itself. */
36922
+ headers() {
36923
+ const name = this.clientName()?.trim();
36924
+ return {
36925
+ Authorization: `Bearer ${this.apiKey}`,
36926
+ "User-Agent": `taiga-ai-mcp-server/${SERVER_VERSION}`,
36927
+ ...name && /^[\x20-\x7E]+$/.test(name) ? { "X-Taiga-Client": name.slice(0, 64) } : {}
36928
+ };
36929
+ }
36930
+ constructor(opts) {
36931
+ this.baseUrl = opts.baseUrl.replace(/\/+$/, "");
36932
+ this.apiKey = opts.apiKey;
36933
+ }
36934
+ async request(method, path, body, options = {}) {
36935
+ const url = `${this.baseUrl}/v1${path}`;
36936
+ const headers = this.headers();
36937
+ const form = body instanceof FormData;
36938
+ if (body !== void 0 && !form) headers["Content-Type"] = "application/json";
36939
+ const response = await fetch(url, {
36940
+ method,
36941
+ headers,
36942
+ redirect: "error",
36943
+ body: body === void 0 ? null : form ? body : JSON.stringify(body),
36944
+ ...options.signal ? { signal: options.signal } : {}
36945
+ });
36946
+ if (!response.ok) {
36947
+ const text = await response.text().catch(() => "");
36948
+ throw new TaigaApiError(method, path, response.status, text);
36949
+ }
36950
+ if (response.status === 204) return null;
36951
+ const parsed = await response.json();
36952
+ return options.keepTenant ? parsed : withoutTenant(parsed);
36953
+ }
36954
+ /** A GET whose answer is plain text, not JSON (the third-party notices, PRO-3054). */
36955
+ async requestText(path) {
36956
+ const response = await fetch(`${this.baseUrl}/v1${path}`, {
36957
+ method: "GET",
36958
+ headers: this.headers(),
36959
+ redirect: "error"
36960
+ });
36961
+ if (!response.ok) {
36962
+ const text = await response.text().catch(() => "");
36963
+ throw new TaigaApiError("GET", path, response.status, text);
36964
+ }
36965
+ return response.text();
36966
+ }
36967
+ async introspect() {
36968
+ const result = await this.request("GET", "/auth/introspect", void 0, { keepTenant: true });
36969
+ this.introspection = result.data;
36970
+ return result.data;
36971
+ }
36972
+ getIntrospection() {
36973
+ return this.introspection;
36974
+ }
36975
+ hasCapability(capability) {
36976
+ if (!this.introspection) return false;
36977
+ return this.introspection.capabilities.includes(capability);
36978
+ }
36979
+ async listProducts(opts) {
36980
+ const params = new URLSearchParams();
36981
+ if (opts?.factoryId) params.set("factoryId", opts.factoryId);
36982
+ if (opts?.status) params.set("status", opts.status);
36983
+ if (opts?.slug) params.set("slug", opts.slug);
36984
+ if (opts?.address) params.set("address", opts.address);
36985
+ if (opts?.repository) params.set("repository", opts.repository);
36986
+ if (opts?.repositoryHost) params.set("repositoryHost", opts.repositoryHost);
36987
+ if (opts?.limit) params.set("limit", String(opts.limit));
36988
+ if (opts?.cursor) params.set("cursor", opts.cursor);
36989
+ const qs = params.toString();
36990
+ return this.request("GET", `/products${qs ? `?${qs}` : ""}`);
36991
+ }
36992
+ async getProduct(id, signal) {
36993
+ return this.request("GET", `/products/${seg(id)}`, void 0, { signal });
36994
+ }
36995
+ async listProductRepositories(productId) {
36996
+ return this.request("GET", `/products/${seg(productId)}/repositories`);
36997
+ }
36998
+ async listTenantDocuments(opts) {
36999
+ const params = new URLSearchParams();
37000
+ if (opts?.limit) params.set("limit", String(opts.limit));
37001
+ if (opts?.cursor) params.set("cursor", opts.cursor);
37002
+ const qs = params.toString();
37003
+ return this.request("GET", `/tenants/current/documents${qs ? `?${qs}` : ""}`);
37004
+ }
37005
+ async getTenantDocument(type) {
37006
+ return this.request("GET", `/tenants/current/documents/${seg(type)}`);
37007
+ }
37008
+ /** The shared draft for a document type, or `{ data: null }` when none exists. */
37009
+ async getTenantDocumentDraft(type) {
37010
+ return this.request("GET", `/tenants/current/documents/${seg(type)}/draft`);
37011
+ }
37012
+ /**
37013
+ * Save the draft. `expectedRevision` (design_standards only) is the `revision` the edit was built on, or null when
37014
+ * it was built on the published version because no draft existed; the API refuses with 409 `draft_changed` when
37015
+ * the draft is no longer that. With no draft, `expectedPublishedVersion` (the published version the edit was built
37016
+ * on, null when none) is checked the same way. Omitted means no check.
37017
+ */
37018
+ async saveTenantDocumentDraft(type, body) {
37019
+ return this.request("PUT", `/tenants/current/documents/${seg(type)}/draft`, body);
37020
+ }
37021
+ /**
37022
+ * One section of an organization document's draft (PRO-5087); 409 `draft_changed` when it changed since
37023
+ * `expectedContent`. Not the design standards, which are saved whole.
37024
+ */
37025
+ async saveTenantDocumentSection(type, sectionId, body) {
37026
+ return this.request("PUT", `/tenants/current/documents/${seg(type)}/draft/sections/${seg(sectionId)}`, body);
37027
+ }
37028
+ /**
37029
+ * Publish the draft. With `requireTokensAligned` the API checks, in the same transaction as the publish, that a
37030
+ * design standards draft's text and tokens agree, and answers 409 `tokens_out_of_line` without publishing when
37031
+ * they do not. The POST stays bodiless.
37032
+ */
37033
+ async publishTenantDocument(type, options) {
37034
+ return this.request("POST", `/tenants/current/documents/${seg(type)}/publish${query$1({ requireTokensAligned: options?.requireTokensAligned ? true : void 0 })}`);
37035
+ }
37036
+ /** Whether the design standards draft's (or published version's) text and tokens were last brought into line. */
37037
+ async getDesignTokenAlignment(version) {
37038
+ return this.request("GET", `/tenants/current/documents/design_standards/token-alignment${query$1({ version })}`);
37039
+ }
37040
+ /** Edit existing tokens in the design standards draft, all or nothing. */
37041
+ async updateDesignTokens(changes) {
37042
+ return this.request("PATCH", "/tenants/current/documents/design_standards/draft/tokens", { changes });
37043
+ }
37044
+ /** Start the agent job that rewrites the draft's tokens to match its text; answers 202 with the job. */
37045
+ async syncDesignTokens() {
37046
+ return this.request("POST", "/tenants/current/documents/design_standards/sync-tokens");
37047
+ }
37048
+ async getFactoryDocument(factoryId, type) {
37049
+ return this.request("GET", `/factories/${seg(factoryId)}/documents/${seg(type)}`);
37050
+ }
37051
+ /** The shared draft for a factory document type, or `{ data: null }` when none exists. */
37052
+ async getFactoryDocumentDraft(factoryId, type) {
37053
+ return this.request("GET", `/factories/${seg(factoryId)}/documents/${seg(type)}/draft`);
37054
+ }
37055
+ async saveFactoryDocumentDraft(factoryId, type, body) {
37056
+ return this.request("PUT", `/factories/${seg(factoryId)}/documents/${seg(type)}/draft`, body);
37057
+ }
37058
+ /** One section of a factory document's draft (PRO-5087); 409 `draft_changed` when it changed since `expectedContent`. */
37059
+ async saveFactoryDocumentSection(factoryId, type, sectionId, body) {
37060
+ return this.request("PUT", `/factories/${seg(factoryId)}/documents/${seg(type)}/draft/sections/${seg(sectionId)}`, body);
37061
+ }
37062
+ async publishFactoryDocument(factoryId, type) {
37063
+ return this.request("POST", `/factories/${seg(factoryId)}/documents/${seg(type)}/publish`);
37064
+ }
37065
+ async listProductDocuments(productId, opts) {
37066
+ const params = new URLSearchParams();
37067
+ if (opts?.origin) params.set("origin", opts.origin);
37068
+ if (opts?.limit) params.set("limit", String(opts.limit));
37069
+ const qs = params.toString();
37070
+ return this.request("GET", `/products/${seg(productId)}/documents${qs ? `?${qs}` : ""}`);
37071
+ }
37072
+ /**
37073
+ * Stop or start the product's line. Stopping halts pulls and builds and
37074
+ * stops the plan and build in flight; starting picks the interrupted work
37075
+ * back up.
37076
+ */
37077
+ async setLineStopped(productId, stopped) {
37078
+ return this.request("PUT", `/products/${seg(productId)}/line`, { stopped });
37079
+ }
37080
+ /** Ask an agent for work: the job is queued and runs in the background. */
37081
+ async createAgentJob(body) {
37082
+ return this.request("POST", "/agent-jobs", body);
37083
+ }
37084
+ async getAgentJob(id, signal) {
37085
+ return this.request("GET", `/agent-jobs/${seg(id)}`, void 0, { signal });
37086
+ }
37087
+ /** The plan-side draft of a product document, or `{ data: null }` when none exists. */
37088
+ async getProductDocumentDraft(productId, type) {
37089
+ return this.request("GET", `/products/${seg(productId)}/documents/${seg(type)}/draft`);
37090
+ }
37091
+ async saveProductDocumentDraft(productId, type, body) {
37092
+ return this.request("PUT", `/products/${seg(productId)}/documents/${seg(type)}/draft`, body);
37093
+ }
37094
+ /** One section of a product document's draft (PRO-5087); 409 `draft_changed` when it changed since `expectedContent`. */
37095
+ async saveProductDocumentSection(productId, type, sectionId, body) {
37096
+ return this.request("PUT", `/products/${seg(productId)}/documents/${seg(type)}/draft/sections/${seg(sectionId)}`, body);
37097
+ }
37098
+ async publishProductDocument(productId, type) {
37099
+ return this.request("POST", `/products/${seg(productId)}/documents/${seg(type)}/publish`);
37100
+ }
37101
+ /** Mark the published version reviewed by the caller, as the Documents page shows it. */
37102
+ async markProductDocumentReviewed(productId, type) {
37103
+ return this.request("POST", `/products/${seg(productId)}/documents/${seg(type)}/review`);
37104
+ }
37105
+ /** Generate remaining: every missing and outdated document, in chain order. */
37106
+ async generateRemainingDocuments(productId) {
37107
+ return this.request("POST", `/products/${seg(productId)}/documents/generate-all`);
37108
+ }
37109
+ /** Cancel a Generate remaining run still in flight. */
37110
+ async stopGeneratingDocuments(productId) {
37111
+ return this.request("POST", `/products/${seg(productId)}/documents/generate-all/stop`);
37112
+ }
37113
+ async getProductDocument(productId, type, origin) {
37114
+ const qs = origin ? `?${new URLSearchParams({ origin })}` : "";
37115
+ return this.request("GET", `/products/${seg(productId)}/documents/${seg(type)}${qs}`);
37116
+ }
37117
+ /** One tool call, for usage telemetry (PRO-2845): 204, and nothing is read back. */
37118
+ async reportToolCall(report) {
37119
+ await this.request("POST", "/mcp/tool-calls", report);
37120
+ }
37121
+ /** Every published version of a product document type, newest first, each with its content (PRO-5088). */
37122
+ async listProductDocumentVersions(productId, type, origin) {
37123
+ const qs = origin ? `?${new URLSearchParams({ origin })}` : "";
37124
+ return this.request("GET", `/products/${seg(productId)}/documents/${seg(type)}/versions${qs}`);
37125
+ }
37126
+ /** Every version of a product document type on the plan timeline, its draft too (PRO-5088): 204. */
37127
+ async deleteProductDocuments(productId, type) {
37128
+ await this.request("DELETE", `/products/${seg(productId)}/documents/${seg(type)}`);
37129
+ }
37130
+ /** The countries a product is offered in beyond the organization's own, and the ones that may be chosen. */
37131
+ async getProductMarketCountries(productId) {
37132
+ return this.request("GET", `/products/${seg(productId)}/market-countries`);
37133
+ }
37134
+ /**
37135
+ * What changing a product's market countries would do to the organization's policies, without doing it: the
37136
+ * organization-context preview the web's Markets card shows (PRO-5088).
37137
+ */
37138
+ async previewProductMarkets(markets) {
37139
+ return this.request("POST", "/tenants/current/context/preview", { productMarkets: markets });
37140
+ }
37141
+ /** Change a product's market countries; the organization's policies are brought in line in the same write. */
37142
+ async setProductMarkets(markets) {
37143
+ return this.request("PATCH", "/tenants/current/context", { productMarkets: markets });
37144
+ }
37145
+ async listBacklogItems(productId, opts) {
37146
+ const params = new URLSearchParams();
37147
+ if (opts?.status) params.set("status", opts.status);
37148
+ if (opts?.planningStatus) params.set("planningStatus", opts.planningStatus);
37149
+ if (opts?.category) params.set("category", opts.category);
37150
+ if (opts?.state) params.set("state", opts.state);
37151
+ if (opts?.open) params.set("open", "true");
37152
+ if (opts?.order) params.set("order", opts.order);
37153
+ if (opts?.includeArchived) params.set("includeArchived", "true");
37154
+ if (opts?.limit) params.set("limit", String(opts.limit));
37155
+ if (opts?.cursor) params.set("cursor", opts.cursor);
37156
+ const qs = params.toString();
37157
+ return this.request("GET", `/products/${seg(productId)}/backlog${qs ? `?${qs}` : ""}`);
37158
+ }
37159
+ async getBacklogItem(itemId, signal) {
37160
+ return this.request("GET", `/backlog/${seg(itemId)}`, void 0, { signal });
37161
+ }
37162
+ /** The initiative's history, oldest first: every turn event and audited move, each with who did it. */
37163
+ async listBacklogItemActivity(itemId) {
37164
+ return this.request("GET", `/backlog/${seg(itemId)}/activity`);
37165
+ }
37166
+ /** A person's move on the line board: the column dropped into, and what to follow there. */
37167
+ async transitionInitiative(itemId, body) {
37168
+ return this.request("PUT", `/backlog/${seg(itemId)}/state`, body);
37169
+ }
37170
+ /** Answer the needs-human flag: plan again, resume the run, or clear a refused start. */
37171
+ async resumeInitiative(itemId) {
37172
+ return this.request("POST", `/backlog/${seg(itemId)}/resume`);
37173
+ }
37174
+ /** The initiative's own review gate: true builds a landed plan at once, false stops for a person, null follows the product. */
37175
+ async setAutoBuild(itemId, autoBuild) {
37176
+ return this.request("PUT", `/backlog/${seg(itemId)}/auto-build`, { autoBuild });
37177
+ }
37178
+ /** The product's live queue, in order. */
37179
+ async listQueue(productId) {
37180
+ return this.request("GET", `/products/${seg(productId)}/queue`);
37181
+ }
37182
+ /** Start now: plan and build a queued entry's initiative without waiting for its turn (it leaves the queue). */
37183
+ async startQueueEntryNow(entryId) {
37184
+ return this.request("POST", `/queue/${seg(entryId)}/start-now`);
37185
+ }
37186
+ async getActivePlan(itemId) {
37187
+ return this.request("GET", `/backlog/${seg(itemId)}/plans/active`);
37188
+ }
37189
+ async approvePlan(planId) {
37190
+ return this.request("POST", `/plans/${seg(planId)}/approve`);
37191
+ }
37192
+ async rejectPlan(planId, body) {
37193
+ return this.request("POST", `/plans/${seg(planId)}/reject`, body);
37194
+ }
37195
+ async listBuildRuns(productId, opts) {
37196
+ const params = new URLSearchParams();
37197
+ if (opts?.backlogItemId) params.set("backlogItemId", opts.backlogItemId);
37198
+ if (opts?.status?.length) params.set("status", opts.status.join(","));
37199
+ if (opts?.limit) params.set("limit", String(opts.limit));
37200
+ if (opts?.cursor) params.set("cursor", opts.cursor);
37201
+ const qs = params.toString();
37202
+ return this.request("GET", `/products/${seg(productId)}/builds${qs ? `?${qs}` : ""}`);
37203
+ }
37204
+ /** The runs of every product the key can see, newest first; `active` narrows to the ones executing now. */
37205
+ async listBuildRunActivity(opts) {
37206
+ const params = new URLSearchParams();
37207
+ if (opts?.active) params.set("active", "true");
37208
+ if (opts?.status?.length) params.set("status", opts.status.join(","));
37209
+ if (opts?.limit) params.set("limit", String(opts.limit));
37210
+ if (opts?.cursor) params.set("cursor", opts.cursor);
37211
+ const qs = params.toString();
37212
+ return this.request("GET", `/builds${qs ? `?${qs}` : ""}`);
37213
+ }
37214
+ async getBuildRun(id, signal) {
37215
+ return this.request("GET", `/builds/${seg(id)}`, void 0, { signal });
37216
+ }
37217
+ /** The run's own pull request as its forge answers now: whether it may merge, and why not (PRO-4981). */
37218
+ async getBuildRunPullRequest(id) {
37219
+ return this.request("GET", `/builds/${seg(id)}/pull-request`);
37220
+ }
37221
+ /** Merges the run's own pull request through its forge, as the run page's Merge does (PRO-4981). */
37222
+ async mergeBuildRun(id) {
37223
+ return this.request("POST", `/builds/${seg(id)}/merge`);
37224
+ }
37225
+ async stopBuildRun(id) {
37226
+ return this.request("POST", `/builds/${seg(id)}/stop`);
37227
+ }
37228
+ /** Ask the coding agent for changes to the run's pull request (PRO-3035). */
37229
+ async requestBuildRunChanges(id, notes, opts = {}) {
37230
+ return this.request("POST", `/builds/${seg(id)}/request-changes`, {
37231
+ notes,
37232
+ ...opts.reviewPlan !== void 0 ? { reviewPlan: opts.reviewPlan } : {}
37233
+ });
37234
+ }
37235
+ async listBuildRunSteps(id) {
37236
+ return this.request("GET", `/builds/${seg(id)}/steps`);
37237
+ }
37238
+ /** The public hosts the run reached through the egress gateway (PRO-4268). */
37239
+ async listBuildRunEgressHosts(id) {
37240
+ return this.request("GET", `/builds/${seg(id)}/hosts`);
37241
+ }
37242
+ /** The run's report as its page reads it, with its signals (PRO-4756); data is null before one came. */
37243
+ async getBuildRunOverview(id) {
37244
+ return this.request("GET", `/builds/${seg(id)}/overview`);
37245
+ }
37246
+ async getMaintenanceSummary(productId) {
37247
+ return this.request("GET", `/products/${seg(productId)}/maintenance/summary`);
37248
+ }
37249
+ async listMaintenanceSweeps(productId, opts) {
37250
+ return this.request("GET", `/products/${seg(productId)}/maintenance/runs${query$1({ limit: opts?.limit })}`);
37251
+ }
37252
+ async listFindings(productId, opts) {
37253
+ return this.request("GET", `/products/${seg(productId)}/maintenance/findings${query$1({ ...opts })}`);
37254
+ }
37255
+ async getFinding(id) {
37256
+ return this.request("GET", `/maintenance/findings/${seg(id)}`);
37257
+ }
37258
+ /** The package inventory (PRO-2862); 404 where the `licenses` feature is not enabled. */
37259
+ async listPackages(productId, opts) {
37260
+ return this.request("GET", `/products/${seg(productId)}/maintenance/packages${query$1({ ...opts })}`);
37261
+ }
37262
+ async getLicenseSummary(productId) {
37263
+ return this.request("GET", `/products/${seg(productId)}/maintenance/licenses`);
37264
+ }
37265
+ /** One licence across a product's inventory (PRO-3251): what it asks, when to allow it, what brings it in. */
37266
+ async getProductLicense(productId, license) {
37267
+ return this.request("GET", `/products/${seg(productId)}/maintenance/licenses/detail?license=${encodeURIComponent(license)}`);
37268
+ }
37269
+ /** Allow a licence in one product: every licence finding in force for it there ignored (PRO-3727). */
37270
+ async allowProductLicense(productId, body) {
37271
+ return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/ignore`, body);
37272
+ }
37273
+ /** Allow a licence in one product no longer: every one of its ignored licence findings there open again. */
37274
+ async reopenProductLicense(productId, license) {
37275
+ return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/reopen`, { license });
37276
+ }
37277
+ /** The organization's approved list and every licence in use across its products (PRO-3311). */
37278
+ async getOrganizationLicenses() {
37279
+ return this.request("GET", "/tenants/current/licenses");
37284
37280
  }
37285
- for (const [id, , deprecated] of SPDX_EXCEPTIONS) if (!deprecated) exceptions.set(id.toLowerCase(), id);
37286
- const definite = (map) => new Map([...map].filter((entry) => entry[1] !== null));
37287
- return {
37288
- ids,
37289
- current: currentForms,
37290
- exceptions,
37291
- names: definite(names),
37292
- urls: definite(urls)
37293
- };
37294
- }
37295
- function lists() {
37296
- index$1 ??= buildIndex();
37297
- return index$1;
37298
- }
37299
- /**
37300
- * `text` as an SPDX expression of listed licences and exceptions, in the
37301
- * list's spelling (a deprecated id kept as itself); null when it is not one.
37302
- * `LicenseRef-` operands are kept as written.
37303
- */
37304
- function spdxExpression(text) {
37305
- const trimmed = text.trim();
37306
- const tree = parseSpdxExpression(/^[^\s()/]+(\/[^\s()/]+)+$/.test(trimmed) ? trimmed.split("/").join(" OR ") : trimmed);
37307
- if (tree === null) return null;
37308
- const { ids, exceptions } = lists();
37309
- const spelled = /* @__PURE__ */ new Map();
37310
- for (const operand of licenseOperands(tree)) {
37311
- let current;
37312
- if (/^licenseref-/i.test(operand.license)) current = operand.license;
37313
- else current = ids.get(operand.license.toLowerCase());
37314
- if (current === void 0) return null;
37315
- if (operand.exception !== null) {
37316
- const exception = exceptions.get(operand.exception.toLowerCase());
37317
- if (exception === void 0 || current.includes(" WITH ")) return null;
37318
- spelled.set(operand.exception, exception);
37319
- }
37320
- spelled.set(operand.license, / (AND|OR) /.test(current) ? `(${current})` : current);
37281
+ async listOrgFindings(opts) {
37282
+ return this.request("GET", `/tenants/current/findings${query$1(opts)}`);
37321
37283
  }
37322
- return render$1(tree, spelled);
37323
- }
37324
- /**
37325
- * One licence, with or without its exception, in the list's spelling (a
37326
- * deprecated id as itself); null for anything else (an expression of
37327
- * several licences, a LicenseRef, an exception alone).
37328
- */
37329
- function spdxLicenseEntry(text) {
37330
- const expression = spdxExpression(text);
37331
- if (expression === null) return null;
37332
- const plain = unwrap(expression);
37333
- const tree = parseSpdxExpression(plain);
37334
- return tree?.kind === "license" && !/^licenseref-/i.test(tree.license) ? plain : null;
37335
- }
37336
- /**
37337
- * One licence (or licence WITH exception) as the list and the licences are
37338
- * compared (milestone 2j): its current SPDX form, lower-cased, so a list
37339
- * written with `GPL-2.0` allows a package read as `GPL-2.0-only`, and one with
37340
- * `GPL-2.0-with-classpath-exception` the same licence in its current spelling.
37341
- */
37342
- function currentSpelling(text) {
37343
- const held = spellings.get(text);
37344
- if (held !== void 0) return held;
37345
- const spelled = (currentForm(text) ?? text.trim()).toLowerCase();
37346
- if (spellings.size >= SPELLINGS_MAX) spellings.clear();
37347
- spellings.set(text, spelled);
37348
- return spelled;
37349
- }
37350
- /**
37351
- * `currentSpelling` by its text. A judgement compares every licence of every
37352
- * package against every list entry, and each spelling parses the text three
37353
- * times: an organization's change of its list, over a few thousand packages,
37354
- * spent seconds parsing the same few dozen strings.
37355
- */
37356
- const spellings = /* @__PURE__ */ new Map();
37357
- const SPELLINGS_MAX = 1e4;
37358
- /** One list entry in its current form, cased as the list spells it; null for what is no entry. */
37359
- function currentForm(text) {
37360
- const entry = spdxLicenseEntry(text);
37361
- const tree = entry === null ? null : parseSpdxExpression(entry);
37362
- if (tree === null || tree.kind !== "license") return null;
37363
- const base = lists().current.get(tree.license.toLowerCase()) ?? tree.license;
37364
- return tree.exception === null ? base : `${base} WITH ${tree.exception}`;
37365
- }
37366
- function render$1(tree, spelled) {
37367
- if (tree.kind === "license") {
37368
- const id = spelled.get(tree.license) ?? tree.license;
37369
- if (tree.exception === null) return id;
37370
- return `${id} WITH ${spelled.get(tree.exception) ?? tree.exception}`;
37284
+ async listOrgPackages(opts) {
37285
+ return this.request("GET", `/tenants/current/packages${query$1(opts)}`);
37286
+ }
37287
+ async listOrgStanding(factoryId) {
37288
+ return this.request("GET", `/tenants/current/standing${query$1({ factoryId })}`);
37289
+ }
37290
+ async listOrgDelivery(factoryId) {
37291
+ return this.request("GET", `/tenants/current/delivery${query$1({ factoryId })}`);
37292
+ }
37293
+ async listOrgInitiatives(opts) {
37294
+ return this.request("GET", `/tenants/current/initiatives${query$1(opts)}`);
37295
+ }
37296
+ /** Where one licence is used across the organization (PRO-3311). */
37297
+ async getOrganizationLicense(license) {
37298
+ return this.request("GET", `/tenants/current/licenses/detail?license=${encodeURIComponent(license)}`);
37299
+ }
37300
+ /** What approving or removing one licence would do to the findings, without doing it (PRO-3312). */
37301
+ async previewLicenseChange(change) {
37302
+ const query = "approve" in change ? `approve=${encodeURIComponent(change.approve)}` : `remove=${encodeURIComponent(change.remove)}`;
37303
+ return this.request("GET", `/tenants/current/license-allowlist/effect?${query}`);
37304
+ }
37305
+ /** Approve or remove licences on the approved list, effective at once (PRO-3312). */
37306
+ /** The organization's own Claude (PRO-4579), without its key, and what a Bedrock role must trust. */
37307
+ async getModelConnection() {
37308
+ return this.request("GET", "/model-connection");
37309
+ }
37310
+ async setModelConnection(input) {
37311
+ return this.request("PUT", "/model-connection", input);
37312
+ }
37313
+ async removeModelConnection() {
37314
+ return this.request("DELETE", "/model-connection");
37315
+ }
37316
+ async changeLicenseAllowlist(change) {
37317
+ return this.request("PATCH", "/tenants/current/license-allowlist", change);
37318
+ }
37319
+ /** A repository's CycloneDX 1.6 SBOM (PRO-2894), the document itself. */
37320
+ async getSbom(productId, repositoryId) {
37321
+ return this.request("GET", `/products/${seg(productId)}/maintenance/repositories/${seg(repositoryId)}/sbom`);
37322
+ }
37323
+ async getNotices(productId, repositoryId) {
37324
+ return this.requestText(`/products/${seg(productId)}/maintenance/repositories/${seg(repositoryId)}/notices`);
37325
+ }
37326
+ async updateFinding(id, body) {
37327
+ return this.request("PATCH", `/maintenance/findings/${seg(id)}`, body);
37328
+ }
37329
+ /** What people decided about single packages under a license (PRO-4236). */
37330
+ async listLicensePackageDecisions(productId) {
37331
+ return this.request("GET", `/products/${seg(productId)}/maintenance/licenses/package-decisions`);
37332
+ }
37333
+ /** Replace one package under a license (PRO-4236): an initiative for each repository holding it. */
37334
+ async replaceLicensePackage(productId, ref) {
37335
+ return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/packages/replace`, ref);
37336
+ }
37337
+ /** Allow one package under a license in this product, or undo that (PRO-4236). */
37338
+ async decideLicensePackage(productId, action, body) {
37339
+ return this.request("POST", `/products/${seg(productId)}/maintenance/licenses/packages/${action}`, body);
37340
+ }
37341
+ /** Ship notices (PRO-4165): raise the initiative that builds the product's open-source notices, or get the open one. */
37342
+ async shipNotices(productId) {
37343
+ return this.request("POST", `/products/${seg(productId)}/maintenance/notices`, {});
37344
+ }
37345
+ /** Sweep one of a product's repositories (PRO-4276): its primary when none is named. */
37346
+ async startSweep(productId, productRepositoryId) {
37347
+ return this.request("POST", `/products/${seg(productId)}/maintenance/sweeps`, productRepositoryId ? { productRepositoryId } : {});
37348
+ }
37349
+ async remediateFinding(productId, findingId) {
37350
+ return this.request("POST", `/products/${seg(productId)}/maintenance/findings/${seg(findingId)}/remediate`, {});
37351
+ }
37352
+ async remediatePackage(productId, body) {
37353
+ return this.request("POST", `/products/${seg(productId)}/maintenance/packages/remediate`, body);
37354
+ }
37355
+ async getPolicyStanding(productId) {
37356
+ return this.request("GET", `/products/${seg(productId)}/maintenance/policies`);
37357
+ }
37358
+ async remediatePolicyControl(productId, controlId, body = {}) {
37359
+ return this.request("POST", `/products/${seg(productId)}/maintenance/policies/controls/${seg(controlId)}/remediate`, body);
37360
+ }
37361
+ async remediatePolicyViolation(productId, divergenceId, body = {}) {
37362
+ return this.request("POST", `/products/${seg(productId)}/maintenance/policies/divergences/${seg(divergenceId)}/remediate`, body);
37363
+ }
37364
+ /**
37365
+ * What waits on a person (GET /users/me/requests), up to the API's cap, with
37366
+ * what is assigned to someone else: a key speaks for the team's work.
37367
+ */
37368
+ async listRequests(productId) {
37369
+ return this.request("GET", `/users/me/requests${query$1({
37370
+ everyone: "true",
37371
+ productId
37372
+ })}`);
37373
+ }
37374
+ /** What closed in the last two weeks (GET /users/me/requests/done), by the same rules. */
37375
+ async listDoneRequests(productId) {
37376
+ return this.request("GET", `/users/me/requests/done${query$1({
37377
+ everyone: "true",
37378
+ productId
37379
+ })}`);
37380
+ }
37381
+ /** Answer a request with one of the answers it offers. */
37382
+ async answerRequest(id, exit) {
37383
+ return this.request("POST", `/requests/${seg(id)}/answer`, { exit });
37384
+ }
37385
+ async listSetupTasks(opts) {
37386
+ const { productId, ...rest } = opts;
37387
+ const path = productId ? `/products/${seg(productId)}/setup-tasks` : "/setup-tasks";
37388
+ return this.request("GET", `${path}${query$1({ ...rest })}`);
37389
+ }
37390
+ async listEnvironments(productId, opts) {
37391
+ return this.request("GET", `/products/${seg(productId)}/environments${query$1({ ...opts })}`);
37392
+ }
37393
+ async createEnvironment(productId, body) {
37394
+ return this.request("POST", `/products/${seg(productId)}/environments`, body);
37395
+ }
37396
+ async updateEnvironment(id, body) {
37397
+ return this.request("PATCH", `/environments/${seg(id)}`, body);
37398
+ }
37399
+ async getCurrentDeployments(productId) {
37400
+ return this.request("GET", `/products/${seg(productId)}/deployments/current`);
37401
+ }
37402
+ async listDeployments(productId, opts) {
37403
+ return this.request("GET", `/products/${seg(productId)}/deployments${query$1({ ...opts })}`);
37404
+ }
37405
+ async getDeploymentSyncStatus(productId) {
37406
+ return this.request("GET", `/products/${seg(productId)}/deployments/sync-status`);
37407
+ }
37408
+ async getDeliveryMetrics(productId, environmentId, windowDays) {
37409
+ return this.request("GET", `/products/${seg(productId)}/deployments/insights${query$1({
37410
+ environmentId,
37411
+ windowDays
37412
+ })}`);
37413
+ }
37414
+ /** How much people steered the work, split by coding agent version (MCP_API_LEVEL 7). */
37415
+ async getSteeringSignals(productId, windowDays) {
37416
+ return this.request("GET", `/products/${seg(productId)}/delivery/steering-signals${query$1({ windowDays })}`);
37417
+ }
37418
+ async getMonitoringHealth(productId) {
37419
+ return this.request("GET", `/products/${seg(productId)}/monitoring/health`);
37420
+ }
37421
+ async getMonitoringSignal(productId, signal, environmentId, windowDays) {
37422
+ return this.request("GET", `/products/${seg(productId)}/monitoring/${signal}${query$1({
37423
+ environmentId,
37424
+ windowDays
37425
+ })}`);
37426
+ }
37427
+ async listKnowledge(opts) {
37428
+ const scope = (value) => value === null ? "null" : value;
37429
+ return this.request("GET", `/custom-documents${query$1({
37430
+ ...opts,
37431
+ factoryId: scope(opts.factoryId),
37432
+ productId: scope(opts.productId)
37433
+ })}`);
37434
+ }
37435
+ async getKnowledge(id) {
37436
+ return this.request("GET", `/custom-documents/${seg(id)}`);
37437
+ }
37438
+ async getKnowledgeDownload(id) {
37439
+ return this.request("GET", `/custom-documents/${seg(id)}/download`);
37440
+ }
37441
+ /** A text file filed as knowledge at one level: the organization, a factory, or a product in its factory. */
37442
+ async addKnowledge(file) {
37443
+ const form = new FormData();
37444
+ if (file.factoryId) form.set("factoryId", file.factoryId);
37445
+ if (file.productId) form.set("productId", file.productId);
37446
+ form.set("file", new Blob([file.content], { type: file.mime }), file.fileName);
37447
+ return this.request("POST", "/custom-documents", form);
37448
+ }
37449
+ async retryKnowledge(id) {
37450
+ return this.request("POST", `/custom-documents/${seg(id)}/retry`);
37451
+ }
37452
+ async deleteKnowledge(id) {
37453
+ return this.request("DELETE", `/custom-documents/${seg(id)}`);
37454
+ }
37455
+ async updateProduct(productId, body) {
37456
+ return this.request("PATCH", `/products/${seg(productId)}`, body);
37457
+ }
37458
+ async updateBacklogItem(itemId, body) {
37459
+ return this.request("PATCH", `/backlog/${seg(itemId)}`, body);
37460
+ }
37461
+ /** Everyone who can open a product, the people an initiative there can be assigned to (PRO-4982). */
37462
+ async listProductPeople(productId) {
37463
+ return this.request("GET", `/products/${seg(productId)}/people`);
37464
+ }
37465
+ /** Follows an initiative, or stops following it, for the key's own person (PRO-4982). */
37466
+ async setInitiativeFollowing(itemId, userId, subscribed) {
37467
+ return this.request("PUT", `/backlog/${seg(itemId)}/subscribers/${seg(userId)}`, { subscribed });
37468
+ }
37469
+ /** Deletes an initiative as the web does: its runs stop and the pull request it waits on closes (PRO-4983). */
37470
+ async deleteBacklogItem(itemId) {
37471
+ return this.request("DELETE", `/backlog/${seg(itemId)}`);
37472
+ }
37473
+ async getFactory(id) {
37474
+ return this.request("GET", `/factories/${seg(id)}`);
37475
+ }
37476
+ async listFactories(opts) {
37477
+ const params = new URLSearchParams();
37478
+ if (opts?.limit) params.set("limit", String(opts.limit));
37479
+ if (opts?.cursor) params.set("cursor", opts.cursor);
37480
+ const qs = params.toString();
37481
+ return this.request("GET", `/factories${qs ? `?${qs}` : ""}`);
37482
+ }
37483
+ async createFactory(body) {
37484
+ return this.request("POST", "/factories", body);
37485
+ }
37486
+ async updateFactory(factoryId, body) {
37487
+ return this.request("PATCH", `/factories/${seg(factoryId)}`, body);
37488
+ }
37489
+ async createProduct(body) {
37490
+ return this.request("POST", "/products", body);
37491
+ }
37492
+ async previewProductMove(productId, factoryId) {
37493
+ return this.request("GET", `/products/${seg(productId)}/factory/preview${query$1({ factoryId })}`);
37494
+ }
37495
+ async moveProduct(productId, body) {
37496
+ return this.request("PUT", `/products/${seg(productId)}/factory`, body);
37497
+ }
37498
+ async startImport(productId) {
37499
+ return this.request("POST", `/products/${seg(productId)}/brownfield-import`);
37500
+ }
37501
+ async refreshRealityDocuments(productId, docTypes) {
37502
+ return this.request("POST", `/products/${seg(productId)}/documents/refresh-reality`, docTypes ? { docTypes } : void 0);
37503
+ }
37504
+ /** What still blocks finishing setup: the required documents unpublished (PRO-2800). */
37505
+ async getProductSetupBlockers(productId) {
37506
+ return this.request("GET", `/products/${seg(productId)}/setup`);
37507
+ }
37508
+ /**
37509
+ * Always with a body (PRO-4986): the route's body is optional, yet a POST with none was refused on staging
37510
+ * ("expected object, received null") before the handler ran, while `{}` passes.
37511
+ */
37512
+ async completeSetup(productId, options = {}) {
37513
+ return this.request("POST", `/products/${seg(productId)}/setup/complete`, options);
37514
+ }
37515
+ async reopenSetup(productId) {
37516
+ return this.request("POST", `/products/${seg(productId)}/setup/reopen`);
37517
+ }
37518
+ /** Every connected GitHub account, page by page: a later account must be findable by its id too. */
37519
+ async listGithubInstallations() {
37520
+ const data = [];
37521
+ let cursor;
37522
+ do {
37523
+ const result = await this.request("GET", `/github/installations${query$1({
37524
+ limit: 100,
37525
+ cursor
37526
+ })}`);
37527
+ data.push(...result.data);
37528
+ cursor = result.nextCursor ?? void 0;
37529
+ } while (cursor);
37530
+ return { data };
37531
+ }
37532
+ async listInstallationRepositories(installationId, opts) {
37533
+ return this.request("GET", `/github/installations/${seg(installationId)}/repositories${query$1({ ...opts })}`);
37534
+ }
37535
+ /** The organization's GitLab connections (P-PRO-150); the API lists them on one page. */
37536
+ async listGitLabConnections() {
37537
+ return this.request("GET", "/gitlab/connections");
37538
+ }
37539
+ /** One page of the projects a GitLab connection's bot can push to, read live from GitLab. */
37540
+ async listGitLabProjects(connectionId, opts) {
37541
+ return this.request("GET", `/gitlab/connections/${seg(connectionId)}/projects${query$1({ ...opts })}`);
37542
+ }
37543
+ async listAzureDevOpsConnections() {
37544
+ return this.request("GET", "/azure-devops/connections");
37545
+ }
37546
+ async listAzureDevOpsRepositories(connectionId, opts) {
37547
+ return this.request("GET", `/azure-devops/connections/${seg(connectionId)}/repositories${query$1({ ...opts })}`);
37548
+ }
37549
+ async linkRepository(productId, body) {
37550
+ return this.request("POST", `/products/${seg(productId)}/repositories`, body);
37551
+ }
37552
+ async updateRepository(productId, repositoryId, body) {
37553
+ return this.request("PATCH", `/products/${seg(productId)}/repositories/${seg(repositoryId)}`, body);
37554
+ }
37555
+ async listRepositoryBranches(productId, repositoryId) {
37556
+ return this.request("GET", `/products/${seg(productId)}/repositories/${seg(repositoryId)}/branches`);
37557
+ }
37558
+ async unlinkRepository(productId, repositoryId) {
37559
+ return this.request("DELETE", `/products/${seg(productId)}/repositories/${seg(repositoryId)}`);
37371
37560
  }
37372
- return tree.operands.map((operand) => operand.kind === "license" ? render$1(operand, spelled) : `(${render$1(operand, spelled)})`).join(tree.kind === "and" ? " AND " : " OR ");
37373
- }
37374
- function unwrap(expression) {
37375
- return expression.startsWith("(") && expression.endsWith(")") && parseSpdxExpression(expression.slice(1, -1)) ? expression.slice(1, -1) : expression;
37376
- }
37377
- //#endregion
37378
- //#region ../../packages/types/dist/licenses/pypi-classifiers.js
37379
- /**
37380
- * A licence family without its version or variant, by the name the inventory
37381
- * keeps for it (the classifier's last segment), with every id it can stand
37382
- * for. The PEP 639 list, plus the classifiers PyPI lists that name a licence
37383
- * with several published versions and none given (EFL, NPL, Zope).
37384
- */
37385
- const AMBIGUOUS = {
37386
- "Academic Free License (AFL)": [
37387
- "AFL-1.1",
37388
- "AFL-1.2",
37389
- "AFL-2.0",
37390
- "AFL-2.1",
37391
- "AFL-3.0"
37392
- ],
37393
- "Apache Software License": [
37394
- "Apache-1.0",
37395
- "Apache-1.1",
37396
- "Apache-2.0"
37397
- ],
37398
- "Apple Public Source License": [
37399
- "APSL-1.0",
37400
- "APSL-1.1",
37401
- "APSL-1.2",
37402
- "APSL-2.0"
37403
- ],
37404
- "Artistic License": ["Artistic-1.0", "Artistic-2.0"],
37405
- "BSD License": [
37406
- "BSD-2-Clause",
37407
- "BSD-2-Clause-Patent",
37408
- "BSD-3-Clause"
37409
- ],
37410
- "GNU Affero General Public License v3": ["AGPL-3.0-only", "AGPL-3.0-or-later"],
37411
- "GNU Free Documentation License (FDL)": [
37412
- "GFDL-1.1-only",
37413
- "GFDL-1.1-or-later",
37414
- "GFDL-1.2-only",
37415
- "GFDL-1.2-or-later",
37416
- "GFDL-1.3-only",
37417
- "GFDL-1.3-or-later"
37418
- ],
37419
- "GNU General Public License (GPL)": [
37420
- "GPL-1.0-only",
37421
- "GPL-1.0-or-later",
37422
- "GPL-2.0-only",
37423
- "GPL-2.0-or-later",
37424
- "GPL-3.0-only",
37425
- "GPL-3.0-or-later"
37426
- ],
37427
- "GNU General Public License v2 (GPLv2)": ["GPL-2.0-only", "GPL-2.0-or-later"],
37428
- "GNU General Public License v3 (GPLv3)": ["GPL-3.0-only", "GPL-3.0-or-later"],
37429
- "GNU Lesser General Public License v2 (LGPLv2)": ["LGPL-2.0-only", "LGPL-2.1-only"],
37430
- "GNU Lesser General Public License v2 or later (LGPLv2+)": ["LGPL-2.0-or-later", "LGPL-2.1-or-later"],
37431
- "GNU Lesser General Public License v3 (LGPLv3)": ["LGPL-3.0-only", "LGPL-3.0-or-later"],
37432
- "GNU Library or Lesser General Public License (LGPL)": [
37433
- "LGPL-2.0-only",
37434
- "LGPL-2.0-or-later",
37435
- "LGPL-2.1-only",
37436
- "LGPL-2.1-or-later",
37437
- "LGPL-3.0-only",
37438
- "LGPL-3.0-or-later"
37439
- ],
37440
- "Eiffel Forum License (EFL)": ["EFL-1.0", "EFL-2.0"],
37441
- "Netscape Public License (NPL)": ["NPL-1.0", "NPL-1.1"],
37442
- "Zope Public License": [
37443
- "ZPL-1.1",
37444
- "ZPL-2.0",
37445
- "ZPL-2.1"
37446
- ],
37447
- "Public Domain": [],
37448
- "Free For Educational Use": [],
37449
- "Free For Home Use": [],
37450
- "Free for non-commercial use": [],
37451
- "Freely Distributable": [],
37452
- "Free To Use But Restricted": [],
37453
- Freeware: [],
37454
- "Other/Proprietary License": [],
37455
- "Repoze Public License": [],
37456
- "GUST Font License 1.0": [],
37457
- "GUST Font License 2006-09-30": []
37458
37561
  };
37459
- /**
37460
- * The ids a licence string the inventory holds can stand for, when it is an
37461
- * ambiguous classifier's name; undefined for anything else.
37462
- */
37463
- function classifierCandidates(license) {
37464
- return Object.prototype.hasOwnProperty.call(AMBIGUOUS, license) ? AMBIGUOUS[license] : void 0;
37465
- }
37466
- //#endregion
37467
- //#region ../../packages/types/dist/licenses/license-category.js
37468
- const operandText = (o) => o.exception === null ? o.license : `${o.license} WITH ${o.exception}`;
37469
- /**
37470
- * Canonical text of a tree: operands sorted, and parentheses only where they
37471
- * change the meaning (an OR inside an AND), so one decision always reads the
37472
- * same however it was written.
37473
- */
37474
- function canonicalText(node, insideAnd = false) {
37475
- if (node.kind === "license") return operandText(node);
37476
- const flat = (n) => n.kind === node.kind ? n.operands.flatMap(flat) : [n];
37477
- const joined = node.operands.flatMap(flat).map((o) => canonicalText(o, node.kind === "and")).sort().join(node.kind === "and" ? " AND " : " OR ");
37478
- return node.kind === "or" && insideAnd ? `(${joined})` : joined;
37479
- }
37480
- /**
37481
- * The part of an expression that is outside the allowlist (PRO-2944): what a
37482
- * reviewer actually decides on. `Apache-2.0 AND LGPL-3.0-or-later` is outside
37483
- * only through `LGPL-3.0-or-later`; `GPL-2.0-only OR LGPL-2.1-only`, with
37484
- * neither allowed, through both choices. An AND keeps its sides that are not
37485
- * allowed, an OR none when any side is allowed and all of them otherwise, and
37486
- * an operand reads like the finding's (compared whole, `WITH` included). The
37487
- * text is canonical (operands sorted, runs of one operator flattened,
37488
- * parentheses only around an OR inside an AND), so one decision always reads
37489
- * the same and groups as one. Null
37490
- * when nothing reads outside, or the string is no expression: the caller then
37491
- * falls back to the whole licence.
37492
- */
37493
- function outsideAllowlist(expression, allowlist) {
37494
- const tree = parseSpdxExpression(expression);
37495
- if (tree === null) return null;
37496
- const allowed = new Set(allowlist.map(currentSpelling));
37497
- const isAllowed = (node) => node.kind === "license" ? allowed.has(currentSpelling(operandText(node))) : node.kind === "and" ? node.operands.every(isAllowed) : node.operands.some(isAllowed);
37498
- const prune = (node) => {
37499
- if (node.kind === "license") {
37500
- if (node.exception === null && UNKNOWN_LICENSES.includes(node.license)) return null;
37501
- return isAllowed(node) ? null : node;
37502
- }
37503
- if (node.kind === "or" && node.operands.some(isAllowed)) return null;
37504
- const kept = node.operands.map(prune).filter((n) => n !== null);
37505
- if (kept.length === 0) return null;
37506
- if (kept.length === 1) return kept[0];
37507
- const operands = kept.flatMap((n) => n.kind === node.kind ? n.operands : [n]);
37508
- return {
37509
- kind: node.kind,
37510
- operands
37511
- };
37512
- };
37513
- const pruned = prune(tree);
37514
- return pruned === null ? null : canonicalText(pruned);
37515
- }
37516
37562
  //#endregion
37517
37563
  //#region src/compat.ts
37518
37564
  /**
@@ -43719,8 +43765,8 @@ const BACKLOG_SUMMARY_FIELDS = [
43719
43765
  ];
43720
43766
  /**
43721
43767
  * What a search of a product's initiatives reads: the title, and the key of
43722
- * the ticket it came from in another tracker (PRO-4943). The agent names an
43723
- * initiative in its own words, so someone holding the ticket has only the key.
43768
+ * the issue it came from in another tracker (PRO-4943). The agent names an
43769
+ * initiative in its own words, so someone holding the issue has only the key.
43724
43770
  */
43725
43771
  const searchedText = (row) => [row["title"], row["externalRefKey"]];
43726
43772
  /**
@@ -44008,11 +44054,11 @@ function registerBacklogTools(server, client) {
44008
44054
  function registerBacklogReads(server, client) {
44009
44055
  server.registerTool("taiga_list_initiatives", {
44010
44056
  title: "List initiatives",
44011
- description: "List a product's initiatives (units of work), newest first: open ones unless column says otherwise. Each row says its board column, whose turn it is (you, agent or idle), one sentence on where it stands, its latest run and how many acceptance criteria are met. query finds one by title, or by the key of the ticket it came from in another tracker (externalRefKey, such as KAN-1)." + (offersOrgReads(client) ? " Without productId, the initiatives across every product you can see, newest first, each naming its product, by column and query (factoryId narrows to one factory; category and includeArchived need a product)." : ""),
44057
+ description: "List a product's initiatives (units of work), newest first: open ones unless column says otherwise. Each row says its board column, whose turn it is (you, agent or idle), one sentence on where it stands, its latest run and how many acceptance criteria are met. query finds one by title, or by the key of the issue it came from in another tracker (externalRefKey, such as KAN-1)." + (offersOrgReads(client) ? " Without productId, the initiatives across every product you can see, newest first, each naming its product, by column and query (factoryId narrows to one factory; category and includeArchived need a product)." : ""),
44012
44058
  inputSchema: object({
44013
44059
  productId: offersOrgReads(client) ? productId.optional().describe(ACROSS_PRODUCTS) : productId,
44014
44060
  ...offersOrgReads(client) ? { factoryId: factoryId$1 } : {},
44015
- query: string$2().trim().min(1).max(200).optional().describe("Part of the title, or of the key of the ticket it came from (KAN-1), any case: only the items that contain it"),
44061
+ query: string$2().trim().min(1).max(200).optional().describe("Part of the title, or of the key of the issue it came from (KAN-1), any case: only the items that contain it"),
44016
44062
  column: _enum([
44017
44063
  "open",
44018
44064
  "all",
@@ -44076,7 +44122,7 @@ function registerBacklogReads(server, client) {
44076
44122
  }));
44077
44123
  server.registerTool("taiga_get_initiative", {
44078
44124
  title: "Get initiative",
44079
- description: "Read one initiative: where it stands (column, turn, a sentence naming the next step), its latest run, and the start of its description. full: true gives the whole description, every acceptance criterion with whether it is met, and its technical context: read it that way before implementing. A failed plan carries planFailure. assignee is the one person accountable for it. webUrl is where a person opens it in Taiga (null when this Taiga has no web address set); externalRefKey and externalRefUrl name the ticket it came from in another tracker.",
44125
+ description: "Read one initiative: where it stands (column, turn, a sentence naming the next step), its latest run, and the start of its description. full: true gives the whole description, every acceptance criterion with whether it is met, and its technical context: read it that way before implementing. A failed plan carries planFailure. assignee is the one person accountable for it. webUrl is where a person opens it in Taiga (null when this Taiga has no web address set); externalRefKey and externalRefUrl name the issue it came from in another tracker.",
44080
44126
  inputSchema: object({
44081
44127
  initiativeId,
44082
44128
  full: boolean().optional().describe("Read it whole: every criterion, technical context and the raw state fields (default false)")
@@ -44132,20 +44178,20 @@ function registerBacklogReads(server, client) {
44132
44178
  function registerRequest(server, client) {
44133
44179
  server.registerTool("taiga_request_initiatives", {
44134
44180
  title: "Request new initiatives",
44135
- description: "Turn described work into initiatives in a product's backlog: an agent writes them and returns a job (taiga_wait follows it). Without a title and description it adds the one initiative the product most needs. It may add none and say why. One request per product at a time (CONFLICT). Nothing starts on its own. reference names the ticket the work came from in another tracker (Jira, ServiceNow, Azure DevOps): every initiative the request creates keeps it as given, and taiga_list_initiatives finds them by its key.",
44181
+ description: "Turn described work into initiatives in a product's backlog: an agent writes them and returns a job (taiga_wait follows it). Without a title and description it adds the one initiative the product most needs. It may add none and say why. One request per product at a time (CONFLICT). Nothing starts on its own. reference names the issue the work came from in another tracker (Jira, ServiceNow, Azure DevOps): every initiative the request creates keeps it as given, and taiga_list_initiatives finds them by its key.",
44136
44182
  inputSchema: object({
44137
44183
  productId,
44138
44184
  title: string$2().max(500).optional().describe("What the work is, in a line"),
44139
44185
  description: string$2().max(2e4).optional().describe("The request in Markdown: the problem, what it should look like, what it covers and leaves alone"),
44140
44186
  reference: strictObject({
44141
- key: string$2().trim().min(1).max(100).refine((value) => readExternalReference({ key: value }) !== null, { message: "A key with no line breaks, tabs or invisible characters in it" }).describe("The ticket key as its tracker shows it, such as KAN-1"),
44142
- url: string$2().trim().max(EXTERNAL_REFERENCE_URL_MAX_LENGTH).refine((value) => readExternalReferenceUrl(value) !== null, { message: "An http or https address, without a username or password in it" }).optional().describe("The ticket's address, http or https")
44143
- }).optional().describe("The ticket this work came from in another tracker. Stored as given, never rewritten; needs a title or a description")
44187
+ key: string$2().trim().min(1).max(100).refine((value) => readExternalReference({ key: value }) !== null, { message: "A key with no line breaks, tabs or invisible characters in it" }).describe("The issue key as its tracker shows it, such as KAN-1"),
44188
+ url: string$2().trim().max(EXTERNAL_REFERENCE_URL_MAX_LENGTH).refine((value) => readExternalReferenceUrl(value) !== null, { message: "An http or https address, without a username or password in it" }).optional().describe("The issue's address, http or https")
44189
+ }).optional().describe("The issue this work came from in another tracker. Stored as given, never rewritten; needs a title or a description")
44144
44190
  }),
44145
44191
  annotations: OPERATE
44146
44192
  }, (params) => runTool(async () => {
44147
44193
  const userPrompt = requestPrompt(params.title, params.description);
44148
- if (params.reference && !userPrompt) return toolError("VALIDATION_ERROR", "reference names the ticket a request came from: give the request too (title or description).");
44194
+ if (params.reference && !userPrompt) return toolError("VALIDATION_ERROR", "reference names the issue a request came from: give the request too (title or description).");
44149
44195
  const externalReference = readExternalReference(params.reference);
44150
44196
  const metadata = {
44151
44197
  ...userPrompt ? { userPrompt } : {},
@@ -44364,6 +44410,19 @@ function carriedCriteria(current, next) {
44364
44410
  const criteriaSpec = (list) => JSON.stringify((list ?? []).map((c) => [c.criterion, c.endToEnd === true]));
44365
44411
  /** The largest value the priority and estimate columns hold (Postgres integer); the route has no bound of its own. */
44366
44412
  const MAX_INT = 2147483647;
44413
+ /**
44414
+ * What the person asked for, as the initiative's history keeps it beside the change (the timeline quotes it): an
44415
+ * agent's change shows whose words it answered, not only what it changed.
44416
+ */
44417
+ const askInput = string$2().trim().min(1).max(CHANGE_ASK_MAX_CHARS).describe("What the person asked you for that this answers, in their own words: quote them where you can, in a sentence or two. Shown on the initiative's timeline with the change, so a reader sees why it was made. Not an instruction to anyone");
44418
+ /** The request and the client that sent it, as the API records them with the change. */
44419
+ function askOf(server, request) {
44420
+ const name = server.server.getClientVersion()?.name?.trim();
44421
+ return {
44422
+ request,
44423
+ ...name ? { client: name.slice(0, 64) } : {}
44424
+ };
44425
+ }
44367
44426
  function registerEdit(server, client) {
44368
44427
  server.registerTool("taiga_update_initiative", {
44369
44428
  title: "Edit initiative",
@@ -44378,11 +44437,12 @@ function registerEdit(server, client) {
44378
44437
  dependencies: array(idInput("initiative", "taiga_list_initiatives gives it")).optional().describe("Every initiative it waits for, replacing the list; [] clears it"),
44379
44438
  acceptanceCriteria: array(criterionInput).optional().describe("Every criterion, in order, replacing the list"),
44380
44439
  assigneeId: idInput("person", "taiga_list_product_people gives it").nullable().optional().describe("The one person accountable for it, someone who can open the product; null unassigns it"),
44381
- documentIds: array(idInput("knowledge file", "taiga_list_knowledge gives it")).optional().describe(`Every knowledge file it links, at most 25, replacing the list; [] clears it. Images in its description stay linked whatever is sent`)
44440
+ documentIds: array(idInput("knowledge file", "taiga_list_knowledge gives it")).optional().describe(`Every knowledge file it links, at most 25, replacing the list; [] clears it. Images in its description stay linked whatever is sent`),
44441
+ request: askInput
44382
44442
  }),
44383
44443
  annotations: WRITE
44384
44444
  }, (params) => runTool(async () => {
44385
- const { initiativeId: id, acceptanceCriteria, documentIds, ...fields } = params;
44445
+ const { initiativeId: id, acceptanceCriteria, documentIds, request, ...fields } = params;
44386
44446
  if (fields.dependencies?.includes(id)) return toolError("VALIDATION_ERROR", "An initiative cannot depend on itself.");
44387
44447
  if (acceptanceCriteria === void 0 && documentIds === void 0 && Object.values(fields).every((value) => value === void 0)) return toolError("VALIDATION_ERROR", "Give at least one of title, description, priority, estimate, category, dependencies, acceptanceCriteria, assigneeId or documentIds.");
44388
44448
  if (documentIds !== void 0) {
@@ -44420,7 +44480,8 @@ function registerEdit(server, client) {
44420
44480
  ...fields.dependencies !== void 0 ? { dependencies: fields.dependencies } : {},
44421
44481
  ...fields.assigneeId !== void 0 ? { assigneeId: fields.assigneeId } : {},
44422
44482
  ...criteria !== void 0 ? { acceptanceCriteria: criteria } : {},
44423
- ...links && linksChange ? { documentIds: links.send } : {}
44483
+ ...links && linksChange ? { documentIds: links.send } : {},
44484
+ ...askOf(server, request)
44424
44485
  })).data;
44425
44486
  } catch (error) {
44426
44487
  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.`);
@@ -44556,10 +44617,11 @@ const BUILD_STATION = /* @__PURE__ */ new Set(["plan", "build"]);
44556
44617
  function registerPlanAgain(server, client) {
44557
44618
  server.registerTool("taiga_plan_again", {
44558
44619
  title: "Plan an initiative again",
44559
- description: "Replace the plan of an initiative in Build with a new one: after a failed plan, or a plan or run you do not want. The old plan is kept and an open pull request stays open. Refused while an agent holds the turn, and while a dependency is in flight or a UI direction has no chosen concept unless force: true (the person decides). Off Build, queue it instead.",
44620
+ description: "Replace the plan of an initiative in Build with a new one: after a failed plan, or a plan or run you do not want. The old plan is kept and an open pull request stays open. Refused while an agent holds the turn, and while a dependency is in flight or a UI direction has no chosen concept unless force: true (the person decides). Off Build, queue it instead. request is kept on its timeline, not handed to the planner: to steer the next plan, reject the one waiting with a comment (taiga_review_plan).",
44560
44621
  inputSchema: object({
44561
44622
  initiativeId,
44562
- force: boolean().optional().describe("Plan anyway past an unsettled dependency or an unchosen UI direction; only when the person says so")
44623
+ force: boolean().optional().describe("Plan anyway past an unsettled dependency or an unchosen UI direction; only when the person says so"),
44624
+ request: askInput
44563
44625
  }),
44564
44626
  annotations: OPERATE
44565
44627
  }, (params) => runTool(async () => {
@@ -44567,7 +44629,8 @@ function registerPlanAgain(server, client) {
44567
44629
  if (!BUILD_STATION.has(String(item.state))) return toolError("CONFLICT", `This initiative is in ${String(item.state)}, not at the Build station. The queue is the only way to start work: put it in the queue with taiga_queue_initiative and it is planned when its turn comes.`);
44568
44630
  const body = {
44569
44631
  state: "plan",
44570
- ...params.force ? { force: true } : {}
44632
+ ...params.force ? { force: true } : {},
44633
+ ...askOf(server, params.request)
44571
44634
  };
44572
44635
  return outcome((await client.transitionInitiative(params.initiativeId, body)).data);
44573
44636
  }));
@@ -62792,6 +62855,7 @@ function createServer(client, options = {}) {
62792
62855
  version: SERVER_VERSION
62793
62856
  }, { instructions: SERVER_INSTRUCTIONS });
62794
62857
  registerAllTools(server, client, options);
62858
+ client.nameClientBy(() => server.server.getClientVersion()?.name);
62795
62859
  return server;
62796
62860
  }
62797
62861
  //#endregion