@taiga-ai/mcp-server 0.51.0-dev.1263 → 0.51.0-dev.1265

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