@featureflip/mcp 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,9 @@
1
1
  import { McpServer as e, fromJsonSchema as t } from "@modelcontextprotocol/server";
2
2
  import * as n from "zod/v4";
3
- //#endregion
4
- //#region src/version.ts
3
+ // src/version.ts
5
4
  var r = {
6
5
  name: "@featureflip/mcp",
7
- version: "0.2.0",
6
+ version: "0.4.0",
8
7
  mcpName: "io.github.canopy-labs/featureflip",
9
8
  description: "MCP server for managing Featureflip feature flags from AI agents and editors",
10
9
  keywords: [
@@ -44,17 +43,17 @@ var r = {
44
43
  "build:mcpb": "node scripts/build-mcpb.mjs"
45
44
  },
46
45
  dependencies: {
47
- "@modelcontextprotocol/server": "2.3.1",
48
- zod: "^4.6.5"
46
+ "@modelcontextprotocol/server": "2.4.0",
47
+ zod: "^4.6.7"
49
48
  },
50
49
  devDependencies: {
51
- "@modelcontextprotocol/client": "2.3.1",
50
+ "@modelcontextprotocol/client": "2.4.0",
52
51
  "@typescript/typescript6": "^6.0.2",
53
- "@types/node": "^26.6.4",
52
+ "@types/node": "^26.6.5",
54
53
  typescript: "^7.0.2",
55
- vite: "^8.3.4",
54
+ vite: "^8.3.5",
56
55
  "vite-plugin-dts": "^5.1.2",
57
- vitest: "^5.0.3"
56
+ vitest: "^5.0.5"
58
57
  },
59
58
  engines: { node: ">=20.19.0" }
60
59
  }.version, i = class extends Error {
@@ -137,8 +136,7 @@ var s = /* @__PURE__ */ new Set([
137
136
  };
138
137
  }
139
138
  };
140
- //#endregion
141
- //#region src/errors.ts
139
+ // src/errors.ts
142
140
  function d(e) {
143
141
  let t = [{
144
142
  type: "text",
@@ -185,6 +183,7 @@ var m = {
185
183
  "GET /api/v1/orgs/{org}/projects/{project}/flags/removal-candidates": "PublicFlagRemovalCandidatePagedResult",
186
184
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}": "PublicFlagResponse",
187
185
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}": "PublicFlagEnvConfigResponse",
186
+ "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/evaluations": "PublicFlagEvaluationsResponse",
188
187
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/targeting": "PublicTargetingConfigResponse",
189
188
  "POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/rules": "PublicTargetingRuleResponse",
190
189
  "GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/rules/{ruleId}": "PublicTargetingRuleResponse",
@@ -209,7 +208,7 @@ var m = {
209
208
  "POST /api/v1/orgs/{org}/webhooks/{id}/test": "PublicTestWebhookSubscriptionResponse",
210
209
  "GET /api/v1/orgs/{org}/webhooks/{id}/deliveries": "PublicWebhookDeliveryResponsePagedResult"
211
210
  },
212
- $defs: /* @__PURE__ */ JSON.parse("{\"ActionCapability\":{\"type\":[\"object\",\"null\"],\"properties\":{\"allowed\":{\"type\":[\"boolean\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One entry in a resource's `_actions` block: may the caller perform it, and if not, why.\"},\"MeResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"type\":{\"type\":[\"string\",\"null\"]},\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"emailVerified\":{\"type\":[\"boolean\",\"null\"]},\"organizationId\":{\"type\":[\"string\",\"null\"]},\"role\":{\"type\":[\"string\",\"null\"]},\"projectScope\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"The authenticated caller's identity, returned by `GET /api/v1/me`. The public API\\nauthenticates two kinds of principal, so this is a `type`-discriminated shape.\\nA `\\\"user\\\"` caller (a session/JWT user or a personal access token, `ffp_...`) carries\\n`email` + `emailVerified`. A `\\\"service_token\\\"` caller (`ffs_...`) has no\\nbacking user row, so it carries `organizationId` + `role` + `projectScope` (the\\ntoken's org, its role in that org, and its project allowlist) instead. The type-inapplicable\\nfields are omitted from the response body. `projectScope` is omitted for an unrestricted\\nservice token (access to every project), never an empty list.\"},\"NextAction\":{\"type\":[\"object\",\"null\"],\"properties\":{\"method\":{\"type\":[\"string\",\"null\"]},\"path\":{\"type\":[\"string\",\"null\"]}}},\"OrganizationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"slug\":{\"type\":[\"string\",\"null\"]},\"plan\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Solo, Team, Pro, Business, Enterprise.\"},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public representation of an organization, returned by both `GET /api/v1/orgs` (list) and\\n`GET /api/v1/orgs/{org}` (detail). Drops dashboard-only fields (`BillingEmail` is\\nbilling-contact PII, `UpdatedAt` is dashboard audit trivia) from the dashboard's\\nOrganizationDto/OrganizationListItemDto.\"},\"OrganizationResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/OrganizationResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"ProjectResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"defaultFlagLifetimeDays\":{\"type\":[\"integer\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a project, returned by `GET /api/v1/orgs/{org}/projects` (list),\\n`GET .../projects/{project}` (detail), and the body of a successful create/update. Drops\\nthe dashboard-only nested `Environments` collection from ProjectDto — the\\npublic API surfaces environments via their own endpoint (Task 6), not embedded here.\\nUpdatedAt is only populated from ProjectDto (the detail/create\\nshape); ProjectListItemDto doesn't carry it, so list rows leave it `null`.\\nDefaultFlagLifetimeDays is the project's default flag lifetime in days, or null (#3194).\"},\"ProjectResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/ProjectResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicAddVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations`. Named distinctly\\nfrom the dashboard's own `AddVariationRequest` —\\nsee PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicApiErrorEnvelope\":{\"type\":[\"object\",\"null\"],\"properties\":{\"error\":{\"type\":[\"string\",\"null\"]},\"message\":{\"type\":[\"string\",\"null\"]},\"docs_url\":{\"type\":[\"string\",\"null\"]},\"fields\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"retry_after\":{\"type\":[\"integer\",\"null\"]},\"did_you_mean\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"next_actions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/NextAction\"},{\"type\":\"null\"}]}},\"connection_id\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The frozen public-API error contract. `error` codes are stable snake_case strings. Wire keys\\nare frozen snake_case too (`error`, `message`, `docs_url`, `fields`,\\n`retry_after`) — the global camelCase naming policy would otherwise emit\\n`docsUrl`/`retryAfter`, breaking the published spec. !:JsonPropertyName\\nalways wins over the policy, so these are pinned explicitly rather than relying on the\\nproperty names already being lowercase for the single-word ones.\\n`did_you_mean`, `next_actions` and `connection_id` are ADDITIVE optional keys\\n(null → omitted via the global `DefaultIgnoreCondition = WhenWritingNull`), so\\npre-existing error bodies are byte-for-byte unchanged when they're absent.\\n\\n`connection_id` is present only on the `sso_required` error: the organization\\nrequires single sign-on, and this credential didn't come through its identity provider.\\n`connection_id` identifies which SSO connection to sign in with.\"},\"PublicConditionGroupRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request-side condition group, symmetric with PublicConditionGroupResponse.\"},\"PublicConditionGroupResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionResponse\"},{\"type\":\"null\"}]}}},\"description\":\"A condition group within a PublicTargetingRuleResponse. Maps 1:1 onto\\nConditionGroupDto. Operator is a bare wire string naming one of\\nthe `ConditionGroupOperator` members (`\\\"And\\\"`/`\\\"Or\\\"`) —\\ngroups are ANDed together at the rule level; within a group, its conditions combine using\\nthis operator.\"},\"PublicConditionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request-side condition, symmetric with PublicConditionResponse.\"},\"PublicConditionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"A single condition within a PublicConditionGroupResponse. Maps 1:1 onto\\nConditionDto. Operator is a bare wire string naming one of the\\n`OperatorType` members (e.g. `\\\"Equals\\\"`, `\\\"In\\\"`).\"},\"PublicCreateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments`. Named\\ndistinctly from the dashboard's own `CreateEnvironmentRequest`\\n— both controllers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"initialVariations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateVariationDto\"},{\"type\":\"null\"}]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"ownerEmail\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/flags`. Named distinctly\\nfrom the dashboard's own `CreateFeatureFlagRequest`\\n— see PublicCreateEnvironmentRequest for the\\nschemaId-collision rationale (both controllers share one Swagger document). Type\\nis passed through verbatim to Type, which itself takes a\\nbare string (Boolean/String/Number/Json) rather than the domain enum — invalid values surface\\nas the handler's own validation failure, not a controller-level 400. ExpiresAtUtc is\\noptional and advisory; a bare date (`2026-12-01`) means the end of that day in UTC, and a full\\ntimestamp is stored exactly. It must be in the future and requires the flag-expiration feature\\n(400 `EXPIRY_IN_PAST` / `FEATURE_NOT_ENABLED`). OwnerEmail optionally names\\nthe owner (an active member, matched case-insensitively; requires the flag-ownership feature —\\n400 `OWNER_NOT_MEMBER` / `FEATURE_NOT_ENABLED`). Omitted, the owner is the caller when\\nthe caller is a member, so a service token creates an unowned flag. IsPermanent marks\\nthe flag permanent (a kill switch, ops toggle or entitlement that is meant to stay; never reported for\\ncleanup). It requires the flag-permanence feature and can't be combined with ExpiresAtUtc\\n(400 `FEATURE_NOT_ENABLED` / `PERMANENT_FLAG_HAS_EXPIRY`).\"},\"PublicCreateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects`. Named distinctly from the\\ndashboard's own `CreateProjectRequest` — both\\ncontrollers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys`.\\nType is a bare string (\\\"ClientSide\\\" or \\\"ServerSide\\\") — the controller parses it\\nagainst a NAME allowlist (not a bare TryParse``1(ReadOnlySpan{Char},Boolean,``0@), which would\\nsilently accept a numeric string like `\\\"0\\\"`) before dispatching. Named distinctly from\\nthe dashboard's own `CreateSdkKeyRequest` — both\\ncontrollers share one Swagger document, and an identical type name in either namespace throws\\na schemaId collision at `--export-openapi` time.\"},\"PublicCreateSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"name\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Response body for a successful `POST .../sdk-keys`. The ONLY place the plaintext\\nKey is ever returned — PublicSdkKeyResponse (list/get) carries just\\n`LastFourCharacters`. Built directly from CreateSdkKeyResult rather than a\\nre-fetch (unlike `FeatureFlagsController.Create`'s re-fetch pattern) because the\\nplaintext key only ever exists on the create result — a subsequent\\nGetSdkKeyQuery can't recover it.\"},\"PublicCreateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/segments`. Named distinctly\\nfrom the dashboard's own `CreateUserSegmentRequest` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicCreateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `POST .../rules`. The Application-side\\n`CreateTargetingRuleDto`/`CreateConditionGroupDto`/`CreateConditionDto` all take\\ntheir `Operator` as a bare string, re-parsed CASE-SENSITIVELY inside\\n`CreateTargetingRuleCommandHandler` — `FlagTargetingController`'s mapping helpers\\nvalidate every operator against the enum's member-name allowlist AND canonicalize the casing\\n(e.g. `\\\"in\\\"` → `\\\"In\\\"`) before building the command DTO, so a valid\\ncase-insensitive match never trips the handler's strict re-parse.\"},\"PublicCreateVariationDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A variation supplied at flag-creation time. Maps 1:1 onto\\nCreateVariationDto.\"},\"PublicCreateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp.\"},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"Creates a webhook subscription. `provider` is `GenericHttp`. Omit `eventTypes`,\\n`projectIds` or `environmentIds` (or send an empty list) to receive every event,\\nproject or environment. A token restricted to specific projects must list at least one project,\\nall of them within its allowlist.\"},\"PublicCreateWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The created subscription's id and its signing secret. The secret is shown only here.\"},\"PublicDefaultFlagLifetimeImpact\":{\"type\":[\"object\",\"null\"],\"properties\":{\"newlyPastExpiry\":{\"type\":[\"integer\",\"null\"]},\"noLongerPastExpiry\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Response of `GET .../default-flag-lifetime/impact`: how many temporary flags with no expiry\\ndate of their own would newly be past expiry, and how many would stop being past it.\"},\"PublicEnvironmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an environment, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments` (list),\\n`GET .../environments/{env}` (detail), and the body of a successful create/update. Drops\\ninternal fields (e.g. `ProjectId` is implicit in the route) — mirrors\\n`ProjectResponse`'s minimal shape. Named `PublicEnvironmentResponse` rather than\\n`EnvironmentResponse` (unlike the sibling `ProjectResponse`, which didn't collide)\\nbecause the dashboard already has its own\\n`EnvironmentResponse` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale.\"},\"PublicEnvironmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEnvironmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicFlagEnvConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"environmentId\":{\"type\":[\"string\",\"null\"]},\"environmentKey\":{\"type\":[\"string\",\"null\"]},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a flag's config within a single environment, returned by\\n`GET .../flags/{flag}/environments` and `GET .../flags/{flag}/environments/{env}`.\\nDrops internal/dashboard-only fields present on FlagEnvironmentConfigurationDto\\n— Id (an internal row id, not part of the public\\ncontract; EnvironmentId is the addressable key), `FeatureFlagId` (implicit\\nin the route), the environment's name/color/sort-order (dashboard display fields — the public\\ncontract only needs the addressable EnvironmentKey), and `Staleness` (an\\ninternal analytics signal).\"},\"PublicFlagListItem\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public list-item representation of a feature flag, returned by\\n`GET .../flags`. Narrower than PublicFlagResponse — drops\\nVariations (a summary-only shape upstream) and\\nStaleness, matching the \\\"list is narrower than detail\\\"\\nsplit already present on the Application-layer DTOs.\\nEffectiveExpiresAtUtc is when the flag counts as past expiry, from its own ExpiresAtUtc\\nor its project's default lifetime; ExpirySource says which (`explicit` / `project-default`),\\nboth null when neither applies.\"},\"PublicFlagListItemPagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagListItem\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicFlagOwner\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A flag's owner as returned on flag reads. Null means the flag is unowned.\"},\"PublicFlagRemovalCandidate\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]},\"treatment\":{\"type\":[\"boolean\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"]},\"blockedBy\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"One dead flag the Featureflip Flag Cleanup Action should remove, returned by\\n`GET .../flags/removal-candidates`. `Treatment` is the kill decision: true → keep the\\nflag's on-branch, false → keep the off-branch. `Status` is the flag's staleness tier\\n(`\\\"Stale\\\"` or `\\\"Dead\\\"`, never `\\\"Active\\\"`) — lets a caller distinguish the two when\\n`?staleness=stale` widens the response to include both tiers. This is the ONLY public\\nprojection of staleness — PublicFlagResponse and PublicFlagListItem\\nstill omit it by design. `BlockedBy` names the live flags that still list this one as a\\nprerequisite, sorted by key; while it is non-empty the flag cannot be archived\\n(`FLAG_HAS_DEPENDENTS`), so a caller should remove those dependents first.\"},\"PublicFlagRemovalCandidatePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagRemovalCandidate\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicFlagResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicVariationResponse\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public detail representation of a feature flag, returned by\\n`GET .../flags/{flag}` and the body of a successful create. Drops internal/dashboard-only\\nfields present on FeatureFlagDto — notably `ProjectId` (implicit in the\\nroute) and `Staleness` (an internal analytics signal, not part of the public contract).\\nEffectiveExpiresAtUtc is when the flag counts as past expiry, from its own ExpiresAtUtc\\nor its project's default lifetime; ExpirySource says which (`explicit` / `project-default`),\\nboth null when neither applies.\"},\"PublicPrerequisiteDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"prerequisiteFlagKey\":{\"type\":[\"string\",\"null\"]},\"expectedVariationKey\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A single prerequisite entry on a flag's per-environment config. Maps 1:1 onto\\nPrerequisiteDto (read side) and PrerequisiteInput (write side).\"},\"PublicPutTargetingRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateTargetingRuleRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../targeting` — a declarative full replace of the environment's\\nordered targeting rule set. Rules are applied in array order (index = priority, so the array\\norder IS the evaluation order). Rules is nullable so that an OMITTED `rules`\\nfield (a body of `{}`) binds successfully instead of failing ASP.NET Core's implicit\\nrequired-property check on non-nullable reference types — both an omitted `rules` field\\nand an explicit empty list (`{ \\\"rules\\\": [] }`) clear all targeting rules for the\\nenvironment. Each element is a PublicCreateTargetingRuleRequest (identical to the\\n`POST .../rules` body), so `UserSegmentId` is supported — segment-scoped rules can be\\nsubmitted through this endpoint. The replace is atomic (all-or-nothing): the whole rule set is\\nswapped in one transaction, or nothing changes.\"},\"PublicReorderRulesRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"ruleIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"Request body for `PUT .../rules/reorder`. Must include every existing rule id exactly\\nonce — `ReorderTargetingRulesCommandHandler` rejects duplicate, omitted, or unknown rule\\nids with `BadRequestException`, surfaced as an HTTP 400 `bad_request` envelope\\ncarrying the handler's message.\"},\"PublicRotateWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"secretId\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A newly added signing secret. The secret is shown only here.\"},\"PublicSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"lastUsedAt\":{\"type\":[\"string\",\"null\"]},\"revokedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an SDK key, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys` (list) and\\n`GET .../sdk-keys/{sdkKey}` (detail). Deliberately narrower than\\nSdkKeyDto — drops `RevokedBy` (an internal user id) and\\n`EnvironmentId` (implicit in the route), and carries no plaintext key field: only\\nLastFourCharacters is ever exposed once the key has been created. The plaintext\\nkey is a one-time value that appears solely in PublicCreateSdkKeyResponse.\"},\"PublicSdkKeyResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSdkKeyResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicSegmentConditionDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"A single targeting condition on a segment, used both as input (create/update) and output\\n(Conditions). Operator is a bare string on\\nboth sides of the wire — on write it's parsed to\\nOperatorType by `SegmentsController` (an unknown\\nvalue fails closed with a 400, never silently dropped or defaulted); on read it's mapped\\nstraight through from Operator, which is already a string.\"},\"PublicSegmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a user segment, returned by `GET .../segments`,\\n`GET .../segments/{segment}`, and the body of a successful create.\"},\"PublicSegmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicSetDefaultFlagLifetimeRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"days\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/default-flag-lifetime`. `days`\\nis 1–3650, or an explicit null to remove the default. `days` is required: a body without it\\n(`{}`, or a misspelled field) is a `validation_failed` 400, never a removal, so a typo\\ncan't silently wipe the setting (#3788). A request with no body is rejected too.\"},\"PublicSetFlagExpiryRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/expiry`. Expiry is a\\ndedicated sub-resource, deliberately NOT a field on PublicUpdateFeatureFlagRequest: that\\nPUT is a full replace, so a new nullable field there would let any client that doesn't know about\\nexpiry (the Terraform provider included) wipe it on every update. A bare date means the end of that\\nUTC day; a full timestamp is stored exactly.\"},\"PublicSetFlagOwnerRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"email\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/owner`. A dedicated\\nsub-resource for the same reason as expiry: the main flag PUT is a full replace, so an owner field\\nthere would let every client that doesn't know about owners wipe one. `email` must belong\\nto an active member of the organization (case-insensitive).\"},\"PublicSetFlagRemovalPrRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"url\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/removal-pr`: the\\npull request that removes this flag from code, as opened by the Featureflip Flag Cleanup Action.\\nA dedicated sub-resource for the same reason as expiry and owner. `url` must be an https\\npull request URL (`https://{host}/{owner}/{repo}/pull/{number}`).\"},\"PublicTargetingConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicTargetingRuleResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"The full targeting configuration for a flag in a single environment, returned by\\n`GET .../targeting`. Maps 1:1 onto TargetingConfigurationDto — including\\nits IsEnabled field, which reflects the parent\\n`FlagEnvironmentConfiguration.IsEnabled` (whether the flag is on in this environment at\\nall), not anything specific to targeting itself.\"},\"PublicTargetingRuleResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"priority\":{\"type\":[\"integer\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single targeting rule, returned by `GET .../rules/{ruleId}`,\\n`POST .../rules` (201 body), and nested within PublicTargetingConfigResponse.\\nMaps 1:1 onto TargetingRuleDto, dropping nothing — every field on the\\nApplication DTO is part of the public contract.\"},\"PublicTestWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"webhookDeliveryId\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The queued test event and its delivery. Poll the delivery log for the outcome.\"},\"PublicToggleFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"enabled\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST .../flags/{flag}/environments/{env}/toggle`. Named distinctly from\\nthe dashboard's own `ToggleFlagInEnvironmentRequest`\\n(which uses `IsEnabled`) — the public field is named Enabled per the phase-3c\\ncontract. Enabled is a NULLABLE `bool?` deliberately: a non-nullable value\\ntype would bind an omitted/empty body to `false` with no validation error (ASP.NET's\\nimplicit-required only covers non-nullable reference types, not value types), silently disabling\\nthe flag. The controller rejects a null Enabled with a `validation_failed` 400\\nso the intent is never ambiguous (#1806).\"},\"PublicUpdateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}`. See\\nPublicCreateEnvironmentRequest for why this is named distinctly from the\\ndashboard's `UpdateEnvironmentRequest`.\"},\"PublicUpdateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}`. See\\nPublicCreateFeatureFlagRequest for why this is named distinctly from the\\ndashboard's `UpdateFeatureFlagRequest`. The flag's key and type are immutable via this\\nendpoint (mirrors `UpdateFeatureFlagCommand`, which has no `Key`/`Type`).\"},\"PublicUpdateFlagEnvConfigRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../flags/{flag}/environments/{env}`. Named distinctly from the\\ndashboard's own `UpdateFlagEnvironmentConfigurationRequest`\\n— see PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document). Strategy is passed through verbatim to\\nStrategy\\n— the existing command validator name-allowlists it (SingleVariation/PercentageRollout/\\nTargetedRollout or null), so an invalid value surfaces as the handler's own 400, not a\\ncontroller-level guard. A null Prerequisites leaves prerequisites untouched; a\\nnon-null list replaces them wholesale (mirrors UpdateFlagPrerequisitesCommand's\\nreplace-all semantics).\"},\"PublicUpdateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}`. See\\nPublicCreateProjectRequest for why this is named distinctly from the\\ndashboard's `UpdateProjectRequest`.\"},\"PublicUpdateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys/{sdkKey}`.\\nType and key material are immutable via this endpoint (mirrors\\nUpdateSdkKeyCommand, which\\ncarries no `Type`).\"},\"PublicUpdateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/segments/{segment}`. The\\nsegment's key is immutable via this endpoint (mirrors `UpdateUserSegmentCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../rules/{ruleId}`. Same shape as\\nPublicCreateTargetingRuleRequest — see its remarks on operator\\nvalidation/canonicalization, which applies identically here.\"},\"PublicUpdateVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations/{variationId}`. The\\nvariation's key is immutable via this endpoint (mirrors\\n`UpdateVariationCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Replaces a subscription's configuration (full replace — omitted lists become empty, meaning\\n\\\"all\\\"). `isEnabled` is required. The provider cannot be changed.\"},\"PublicVariationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single variation on a flag, as returned in Variations.\"},\"PublicWebhookDeliveryResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Pending, Succeeded, DeadLettered.\"},\"attemptCount\":{\"type\":[\"integer\",\"null\"]},\"nextAttemptAt\":{\"type\":[\"string\",\"null\"]},\"lastResponseStatusCode\":{\"type\":[\"integer\",\"null\"]},\"lastError\":{\"type\":[\"string\",\"null\"]},\"completedAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One delivery attempt record. `status` is `Pending` (awaiting its first attempt,\\nbacking off, or in flight), `Succeeded` or `DeadLettered`.\"},\"PublicWebhookDeliveryResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookDeliveryResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"retiredAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A signing secret's id and lifecycle. A secret with no `retiredAt` is active and signs every delivery.\"},\"PublicWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp.\"},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"consecutiveFailureCount\":{\"type\":[\"integer\",\"null\"]},\"autoDisabledAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"secrets\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSecretResponse\"},{\"type\":\"null\"}]}},\"overPlanLimit\":{\"type\":[\"boolean\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A webhook subscription. Never carries secret material: signing secrets are listed by id and\\nlifecycle only — the value itself is returned once, when it is created or rotated.\\n`overPlanLimit` is true when the organization has more subscriptions than its plan\\nallows, which happens after a downgrade. The oldest subscriptions up to the limit keep\\ndelivering. The rest receive nothing and cannot be re-enabled, tested or redelivered to until\\nthe plan is upgraded or older subscriptions are deleted.\"},\"PublicWebhookSubscriptionResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSubscriptionResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"}}")
211
+ $defs: /* @__PURE__ */ JSON.parse("{\"ActionCapability\":{\"type\":[\"object\",\"null\"],\"properties\":{\"allowed\":{\"type\":[\"boolean\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One entry in a resource's `_actions` block: may the caller perform it, and if not, why.\"},\"MeResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"type\":{\"type\":[\"string\",\"null\"]},\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"emailVerified\":{\"type\":[\"boolean\",\"null\"]},\"organizationId\":{\"type\":[\"string\",\"null\"]},\"role\":{\"type\":[\"string\",\"null\"]},\"projectScope\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"The authenticated caller's identity, returned by `GET /api/v1/me`. The public API\\nauthenticates two kinds of principal, so this is a `type`-discriminated shape.\\nA `\\\"user\\\"` caller (a session/JWT user or a personal access token, `ffp_...`) carries\\n`email` + `emailVerified`. A `\\\"service_token\\\"` caller (`ffs_...`) has no\\nbacking user row, so it carries `organizationId` + `role` + `projectScope` (the\\ntoken's org, its role in that org, and its project allowlist) instead. The type-inapplicable\\nfields are omitted from the response body. `projectScope` is omitted for an unrestricted\\nservice token (access to every project), never an empty list.\"},\"NextAction\":{\"type\":[\"object\",\"null\"],\"properties\":{\"method\":{\"type\":[\"string\",\"null\"]},\"path\":{\"type\":[\"string\",\"null\"]}}},\"OrganizationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"slug\":{\"type\":[\"string\",\"null\"]},\"plan\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Solo, Team, Pro, Business, Enterprise.\"},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public representation of an organization, returned by both `GET /api/v1/orgs` (list) and\\n`GET /api/v1/orgs/{org}` (detail). Drops dashboard-only fields (`BillingEmail` is\\nbilling-contact PII, `UpdatedAt` is dashboard audit trivia) from the dashboard's\\nOrganizationDto/OrganizationListItemDto.\"},\"OrganizationResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/OrganizationResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"ProjectResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"defaultFlagLifetimeDays\":{\"type\":[\"integer\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a project, returned by `GET /api/v1/orgs/{org}/projects` (list),\\n`GET .../projects/{project}` (detail), and the body of a successful create/update. Drops\\nthe dashboard-only nested `Environments` collection from ProjectDto — the\\npublic API surfaces environments via their own endpoint (Task 6), not embedded here.\\nUpdatedAt is only populated from ProjectDto (the detail/create\\nshape); ProjectListItemDto doesn't carry it, so list rows leave it `null`.\\nDefaultFlagLifetimeDays is the project's default flag lifetime in days, or null (#3194).\"},\"ProjectResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/ProjectResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicAddVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations`. Named distinctly\\nfrom the dashboard's own `AddVariationRequest` —\\nsee PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicApiErrorEnvelope\":{\"type\":[\"object\",\"null\"],\"properties\":{\"error\":{\"type\":[\"string\",\"null\"]},\"message\":{\"type\":[\"string\",\"null\"]},\"docs_url\":{\"type\":[\"string\",\"null\"]},\"fields\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"retry_after\":{\"type\":[\"integer\",\"null\"]},\"did_you_mean\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"next_actions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/NextAction\"},{\"type\":\"null\"}]}},\"connection_id\":{\"type\":[\"string\",\"null\"]},\"plan_limit\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPlanLimit\"},{\"type\":\"null\"}]}},\"description\":\"The frozen public-API error contract. `error` codes are stable snake_case strings. Wire keys\\nare frozen snake_case too (`error`, `message`, `docs_url`, `fields`,\\n`retry_after`) — the global camelCase naming policy would otherwise emit\\n`docsUrl`/`retryAfter`, breaking the published spec. !:JsonPropertyName\\nalways wins over the policy, so these are pinned explicitly rather than relying on the\\nproperty names already being lowercase for the single-word ones.\\n`did_you_mean`, `next_actions` and `connection_id` are ADDITIVE optional keys\\n(null → omitted via the global `DefaultIgnoreCondition = WhenWritingNull`), so\\npre-existing error bodies are byte-for-byte unchanged when they're absent.\\n\\n`connection_id` is present only on the `sso_required` error: the organization\\nrequires single sign-on, and this credential didn't come through its identity provider.\\n`connection_id` identifies which SSO connection to sign in with.\\n`plan_limit` is present only on the `plan_limit_reached` error: which plan cap the\\nrequest would have exceeded, so a client can branch on it without parsing `message`.\"},\"PublicConditionGroupRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request-side condition group, symmetric with PublicConditionGroupResponse.\"},\"PublicConditionGroupResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: And, Or.\"},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionResponse\"},{\"type\":\"null\"}]}}},\"description\":\"A condition group within a PublicTargetingRuleResponse. Maps 1:1 onto\\nConditionGroupDto. Operator is a bare wire string naming one of\\nthe `ConditionGroupOperator` members (`\\\"And\\\"`/`\\\"Or\\\"`) —\\ngroups are ANDed together at the rule level; within a group, its conditions combine using\\nthis operator.\"},\"PublicConditionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request-side condition, symmetric with PublicConditionResponse.\"},\"PublicConditionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"A single condition within a PublicConditionGroupResponse. Maps 1:1 onto\\nConditionDto. Operator is a bare wire string naming one of the\\n`OperatorType` members (e.g. `\\\"Equals\\\"`, `\\\"In\\\"`).\"},\"PublicConfiguredWeight\":{\"type\":[\"object\",\"null\"],\"properties\":{\"variationKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's key.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's name, or null when the key no longer matches one of the flag's variations.\"},\"weight\":{\"type\":[\"integer\",\"null\"],\"description\":\"Percent of the rule's traffic.\"}},\"description\":\"A variation's configured share of a rollout rule.\"},\"PublicCreateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments`. Named\\ndistinctly from the dashboard's own `CreateEnvironmentRequest`\\n— both controllers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"initialVariations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateVariationDto\"},{\"type\":\"null\"}]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"ownerEmail\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/flags`. Named distinctly\\nfrom the dashboard's own `CreateFeatureFlagRequest`\\n— see PublicCreateEnvironmentRequest for the\\nschemaId-collision rationale (both controllers share one Swagger document). Type\\nis passed through verbatim to Type, which itself takes a\\nbare string (Boolean/String/Number/Json) rather than the domain enum — invalid values surface\\nas the handler's own validation failure, not a controller-level 400. ExpiresAtUtc is\\noptional and advisory; a bare date (`2026-12-01`) means the end of that day in UTC, and a full\\ntimestamp is stored exactly. It must be in the future and requires the flag-expiration feature\\n(400 `EXPIRY_IN_PAST` / `FEATURE_NOT_ENABLED`). OwnerEmail optionally names\\nthe owner (an active member, matched case-insensitively; requires the flag-ownership feature —\\n400 `OWNER_NOT_MEMBER` / `FEATURE_NOT_ENABLED`). Omitted, the owner is the caller when\\nthe caller is a member, so a service token creates an unowned flag. IsPermanent marks\\nthe flag permanent (a kill switch, ops toggle or entitlement that is meant to stay; never reported for\\ncleanup). It requires the flag-permanence feature and can't be combined with ExpiresAtUtc\\n(400 `FEATURE_NOT_ENABLED` / `PERMANENT_FLAG_HAS_EXPIRY`).\"},\"PublicCreateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects`. Named distinctly from the\\ndashboard's own `CreateProjectRequest` — both\\ncontrollers share one Swagger document (see `Program.cs`'s `AddSwaggerGen``DocInclusionPredicate` override), and Swashbuckle's default schemaId is the bare type\\nname, so an identical name in either namespace throws a schemaId collision at\\n`--export-openapi` time.\"},\"PublicCreateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys`.\\nType is a bare string (\\\"ClientSide\\\" or \\\"ServerSide\\\") — the controller parses it\\nagainst a NAME allowlist (not a bare TryParse``1(ReadOnlySpan{Char},Boolean,``0@), which would\\nsilently accept a numeric string like `\\\"0\\\"`) before dispatching. Named distinctly from\\nthe dashboard's own `CreateSdkKeyRequest` — both\\ncontrollers share one Swagger document, and an identical type name in either namespace throws\\na schemaId collision at `--export-openapi` time.\"},\"PublicCreateSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"name\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Response body for a successful `POST .../sdk-keys`. The ONLY place the plaintext\\nKey is ever returned — PublicSdkKeyResponse (list/get) carries just\\n`LastFourCharacters`. Built directly from CreateSdkKeyResult rather than a\\nre-fetch (unlike `FeatureFlagsController.Create`'s re-fetch pattern) because the\\nplaintext key only ever exists on the create result — a subsequent\\nGetSdkKeyQuery can't recover it.\"},\"PublicCreateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `POST /api/v1/orgs/{org}/projects/{project}/segments`. Named distinctly\\nfrom the dashboard's own `CreateUserSegmentRequest` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document).\"},\"PublicCreateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `POST .../rules`. The Application-side\\n`CreateTargetingRuleDto`/`CreateConditionGroupDto`/`CreateConditionDto` all take\\ntheir `Operator` as a bare string, re-parsed CASE-SENSITIVELY inside\\n`CreateTargetingRuleCommandHandler` — `FlagTargetingController`'s mapping helpers\\nvalidate every operator against the enum's member-name allowlist AND canonicalize the casing\\n(e.g. `\\\"in\\\"` → `\\\"In\\\"`) before building the command DTO, so a valid\\ncase-insensitive match never trips the handler's strict re-parse.\"},\"PublicCreateVariationDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A variation supplied at flag-creation time. Maps 1:1 onto\\nCreateVariationDto.\"},\"PublicCreateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp.\"},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"Creates a webhook subscription. `provider` is `GenericHttp`. Omit `eventTypes`,\\n`projectIds` or `environmentIds` (or send an empty list) to receive every event,\\nproject or environment. A token restricted to specific projects must list at least one project,\\nall of them within its allowlist.\"},\"PublicCreateWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The created subscription's id and its signing secret. The secret is shown only here.\"},\"PublicDefaultFlagLifetimeImpact\":{\"type\":[\"object\",\"null\"],\"properties\":{\"newlyPastExpiry\":{\"type\":[\"integer\",\"null\"]},\"noLongerPastExpiry\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Response of `GET .../default-flag-lifetime/impact`: how many temporary flags with no expiry\\ndate of their own would newly be past expiry, and how many would stop being past it.\"},\"PublicEnvironmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an environment, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments` (list),\\n`GET .../environments/{env}` (detail), and the body of a successful create/update. Drops\\ninternal fields (e.g. `ProjectId` is implicit in the route) — mirrors\\n`ProjectResponse`'s minimal shape. Named `PublicEnvironmentResponse` rather than\\n`EnvironmentResponse` (unlike the sibling `ProjectResponse`, which didn't collide)\\nbecause the dashboard already has its own\\n`EnvironmentResponse` — see\\nPublicCreateEnvironmentRequest for the schemaId-collision rationale.\"},\"PublicEnvironmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEnvironmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicEvaluationSource\":{\"type\":[\"object\",\"null\"],\"properties\":{\"source\":{\"type\":[\"string\",\"null\"],\"description\":\"One of rule, fallthrough, off, prerequisite, error, notFound or unknown (an SDK that reports no reason, or evaluations recorded before sources were). Allowed values: rule, fallthrough, off, prerequisite, error, notFound, unknown.\"},\"ruleId\":{\"type\":[\"string\",\"null\"],\"description\":\"For a rule, its id (rules have no key). Null otherwise, or when the SDK didn't say which rule.\"},\"ruleLabel\":{\"type\":[\"string\",\"null\"],\"description\":\"For a live rule, its description or a generated label. Null otherwise.\"},\"ruleExists\":{\"type\":[\"boolean\",\"null\"],\"description\":\"False when the rule is no longer in the environment's targeting.\"},\"count\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations this source served.\"},\"share\":{\"type\":[\"number\",\"null\"],\"description\":\"Count as a fraction (0 to 1) of all sources' counts combined.\"},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationVariation\"},{\"type\":\"null\"}]},\"description\":\"What this source served, with shares of this source's count.\"},\"rollout\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicRolloutCheck\"},{\"type\":\"null\"}]}},\"description\":\"The evaluations one part of the targeting served.\"},\"PublicEvaluationVariation\":{\"type\":[\"object\",\"null\"],\"properties\":{\"variationKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation served, or null for evaluations recorded without one.\"},\"name\":{\"type\":[\"string\",\"null\"],\"description\":\"The variation's name, or null when the key no longer matches one of the flag's variations.\"},\"exists\":{\"type\":[\"boolean\",\"null\"],\"description\":\"False when the key no longer matches one of the flag's variations.\"},\"count\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations that served this variation.\"},\"share\":{\"type\":[\"number\",\"null\"],\"description\":\"Count as a fraction (0 to 1) of the parent total: the window's total, or for a source's variations that source's count. 0 when the parent total is 0.\"}},\"description\":\"One variation's evaluations.\"},\"PublicFlagEnvConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"environmentId\":{\"type\":[\"string\",\"null\"]},\"environmentKey\":{\"type\":[\"string\",\"null\"]},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a flag's config within a single environment, returned by\\n`GET .../flags/{flag}/environments` and `GET .../flags/{flag}/environments/{env}`.\\nDrops internal/dashboard-only fields present on FlagEnvironmentConfigurationDto\\n— Id (an internal row id, not part of the public\\ncontract; EnvironmentId is the addressable key), `FeatureFlagId` (implicit\\nin the route), the environment's name/color/sort-order (dashboard display fields — the public\\ncontract only needs the addressable EnvironmentKey), and `Staleness` (an\\ninternal analytics signal).\"},\"PublicFlagEvaluationsResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"environmentKey\":{\"type\":[\"string\",\"null\"],\"description\":\"The environment's key.\"},\"days\":{\"type\":[\"integer\",\"null\"],\"description\":\"The window requested: 7, 30 or 90.\"},\"fromUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"Start of the window: UTC midnight `days - 1` days ago, or the flag's creation day if later.\"},\"toUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"When the counts were read.\"},\"totalCount\":{\"type\":[\"integer\",\"null\"],\"description\":\"Evaluations in the window. Evaluation counts, not unique users.\"},\"lastEvaluatedAtUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"The last reported evaluation, or null if none was reported.\"},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationVariation\"},{\"type\":\"null\"}]},\"description\":\"Evaluations per variation over the window.\"},\"sources\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicEvaluationSource\"},{\"type\":\"null\"}]},\"description\":\"Evaluations per part of the targeting that served them: live rules in evaluation order, then deleted rules, then fallthrough, off, prerequisite, error, notFound and unknown.\"}},\"description\":\"What a flag served in one environment over the window, returned by\\n`GET .../flags/{flag}/environments/{env}/evaluations` (#4225). These are evaluation\\ncounts, not unique users. They come from SDK-reported events, so an environment whose SDKs\\nreport none reads zero: no evaluations reported, not necessarily no traffic. The public\\ncounterpart of FlagEvaluationAnalyticsDto, keyed by environment key instead of\\nid and without the dashboard's daily series.\"},\"PublicFlagListItem\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Public list-item representation of a feature flag, returned by\\n`GET .../flags`. Narrower than PublicFlagResponse — drops\\nVariations (a summary-only shape upstream) and\\nStaleness, matching the \\\"list is narrower than detail\\\"\\nsplit already present on the Application-layer DTOs.\\nEffectiveExpiresAtUtc is when the flag counts as past expiry, from its own ExpiresAtUtc\\nor its project's default lifetime; ExpirySource says which (`explicit` / `project-default`),\\nboth null when neither applies.\"},\"PublicFlagListItemPagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagListItem\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicFlagOwner\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"email\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A flag's owner as returned on flag reads. Null means the flag is unowned.\"},\"PublicFlagRemovalCandidate\":{\"type\":[\"object\",\"null\"],\"properties\":{\"key\":{\"type\":[\"string\",\"null\"]},\"reason\":{\"type\":[\"string\",\"null\"]},\"treatment\":{\"type\":[\"boolean\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"]},\"blockedBy\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"One dead flag the Featureflip Flag Cleanup Action should remove, returned by\\n`GET .../flags/removal-candidates`. `Treatment` is the kill decision: true → keep the\\nflag's on-branch, false → keep the off-branch. `Status` is the flag's staleness tier\\n(`\\\"Stale\\\"` or `\\\"Dead\\\"`, never `\\\"Active\\\"`) — lets a caller distinguish the two when\\n`?staleness=stale` widens the response to include both tiers. This is the ONLY public\\nprojection of staleness — PublicFlagResponse and PublicFlagListItem\\nstill omit it by design. `BlockedBy` names the live flags that still list this one as a\\nprerequisite, sorted by key; while it is non-empty the flag cannot be archived\\n(`FLAG_HAS_DEPENDENTS`), so a caller should remove those dependents first.\"},\"PublicFlagRemovalCandidatePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagRemovalCandidate\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicFlagResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Boolean, String, Number, Json.\"},\"isArchived\":{\"type\":[\"boolean\",\"null\"]},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"variations\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicVariationResponse\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"owner\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicFlagOwner\"},{\"type\":\"null\"}]},\"removalPrUrl\":{\"type\":[\"string\",\"null\"]},\"isPermanent\":{\"type\":[\"boolean\",\"null\"]},\"effectiveExpiresAtUtc\":{\"type\":[\"string\",\"null\"]},\"expirySource\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public detail representation of a feature flag, returned by\\n`GET .../flags/{flag}` and the body of a successful create. Drops internal/dashboard-only\\nfields present on FeatureFlagDto — notably `ProjectId` (implicit in the\\nroute) and `Staleness` (an internal analytics signal, not part of the public contract).\\nEffectiveExpiresAtUtc is when the flag counts as past expiry, from its own ExpiresAtUtc\\nor its project's default lifetime; ExpirySource says which (`explicit` / `project-default`),\\nboth null when neither applies.\"},\"PublicPlanLimit\":{\"type\":[\"object\",\"null\"],\"properties\":{\"resource\":{\"type\":[\"string\",\"null\"]},\"plan\":{\"type\":[\"string\",\"null\"]},\"max\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"The cap behind a `plan_limit_reached` error. `resource` is the capped collection\\n(`projects`, `environments`, `flags`, `webhooks`, `members`);\\n`plan` is the plan's wire name, as `GET /api/v1/orgs/{org}` returns it; `max` is\\nthe cap. The environment and flag caps are per project.\"},\"PublicPrerequisiteDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"prerequisiteFlagKey\":{\"type\":[\"string\",\"null\"]},\"expectedVariationKey\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A single prerequisite entry on a flag's per-environment config. Maps 1:1 onto\\nPrerequisiteDto (read side) and PrerequisiteInput (write side).\"},\"PublicPutTargetingRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicCreateTargetingRuleRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../targeting` — a declarative full replace of the environment's\\nordered targeting rule set. Rules are applied in array order (index = priority, so the array\\norder IS the evaluation order). Rules is nullable so that an OMITTED `rules`\\nfield (a body of `{}`) binds successfully instead of failing ASP.NET Core's implicit\\nrequired-property check on non-nullable reference types — both an omitted `rules` field\\nand an explicit empty list (`{ \\\"rules\\\": [] }`) clear all targeting rules for the\\nenvironment. Each element is a PublicCreateTargetingRuleRequest (identical to the\\n`POST .../rules` body), so `UserSegmentId` is supported — segment-scoped rules can be\\nsubmitted through this endpoint. The replace is atomic (all-or-nothing): the whole rule set is\\nswapped in one transaction, or nothing changes.\"},\"PublicReorderRulesRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"ruleIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}}},\"description\":\"Request body for `PUT .../rules/reorder`. Must include every existing rule id exactly\\nonce — `ReorderTargetingRulesCommandHandler` rejects duplicate, omitted, or unknown rule\\nids with `BadRequestException`, surfaced as an HTTP 400 `bad_request` envelope\\ncarrying the handler's message.\"},\"PublicRolloutCheck\":{\"type\":[\"object\",\"null\"],\"properties\":{\"configured\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConfiguredWeight\"},{\"type\":\"null\"}]},\"description\":\"The configured weights, in percent; they sum to 100.\"},\"splitChangedAtUtc\":{\"type\":[\"string\",\"null\"],\"description\":\"The last time the split may have changed (the rule was edited, or a variation was added), or null if it hasn't since the rule was created. A change inside the window mixes two splits.\"},\"evaluable\":{\"type\":[\"boolean\",\"null\"],\"description\":\"Whether the check could run. See NotEvaluableReason when false.\"},\"pValue\":{\"type\":[\"number\",\"null\"],\"description\":\"The sample-ratio test's p-value, or null when not evaluable.\"},\"flagged\":{\"type\":[\"boolean\",\"null\"],\"description\":\"True only when the served split is both unlikely under the configured weights (p < 0.001) and at least 2 percentage points off for some variation.\"},\"notEvaluableReason\":{\"type\":[\"string\",\"null\"],\"description\":\"too-little-traffic or unexpected-variation when the check couldn't run; null otherwise. Allowed values: too-little-traffic, unexpected-variation.\"}},\"description\":\"A percentage-rollout rule's configured split beside a sample-ratio check of what it served.\"},\"PublicRotateWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"secretId\":{\"type\":[\"string\",\"null\"]},\"secret\":{\"type\":[\"string\",\"null\"]},\"warning\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A newly added signing secret. The secret is shown only here.\"},\"PublicSdkKeyResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"type\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: ClientSide, ServerSide.\"},\"lastFourCharacters\":{\"type\":[\"string\",\"null\"]},\"isActive\":{\"type\":[\"boolean\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"lastUsedAt\":{\"type\":[\"string\",\"null\"]},\"revokedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of an SDK key, returned by\\n`GET /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys` (list) and\\n`GET .../sdk-keys/{sdkKey}` (detail). Deliberately narrower than\\nSdkKeyDto — drops `RevokedBy` (an internal user id) and\\n`EnvironmentId` (implicit in the route), and carries no plaintext key field: only\\nLastFourCharacters is ever exposed once the key has been created. The plaintext\\nkey is a one-time value that appears solely in PublicCreateSdkKeyResponse.\"},\"PublicSdkKeyResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSdkKeyResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicSegmentConditionDto\":{\"type\":[\"object\",\"null\"],\"properties\":{\"attribute\":{\"type\":[\"string\",\"null\"]},\"operator\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual.\"},\"values\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"negate\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"A single targeting condition on a segment, used both as input (create/update) and output\\n(Conditions). Operator is a bare string on\\nboth sides of the wire — on write it's parsed to\\nOperatorType by `SegmentsController` (an unknown\\nvalue fails closed with a 400, never silently dropped or defaulted); on read it's mapped\\nstraight through from Operator, which is already a string.\"},\"PublicSegmentResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"Public representation of a user segment, returned by `GET .../segments`,\\n`GET .../segments/{segment}`, and the body of a successful create.\"},\"PublicSegmentResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicSetDefaultFlagLifetimeRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"days\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/default-flag-lifetime`. `days`\\nis 1–3650, or an explicit null to remove the default. `days` is required: a body without it\\n(`{}`, or a misspelled field) is a `validation_failed` 400, never a removal, so a typo\\ncan't silently wipe the setting (#3788). A request with no body is rejected too.\"},\"PublicSetFlagExpiryRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"expiresAtUtc\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/expiry`. Expiry is a\\ndedicated sub-resource, deliberately NOT a field on PublicUpdateFeatureFlagRequest: that\\nPUT is a full replace, so a new nullable field there would let any client that doesn't know about\\nexpiry (the Terraform provider included) wipe it on every update. A bare date means the end of that\\nUTC day; a full timestamp is stored exactly.\"},\"PublicSetFlagOwnerRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"email\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/owner`. A dedicated\\nsub-resource for the same reason as expiry: the main flag PUT is a full replace, so an owner field\\nthere would let every client that doesn't know about owners wipe one. `email` must belong\\nto an active member of the organization (case-insensitive).\"},\"PublicSetFlagRemovalPrRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"url\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/removal-pr`: the\\npull request that removes this flag from code, as opened by the Featureflip Flag Cleanup Action.\\nA dedicated sub-resource for the same reason as expiry and owner. `url` must be an https\\npull request URL (`https://{host}/{owner}/{repo}/pull/{number}`).\"},\"PublicTargetingConfigResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"rules\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicTargetingRuleResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"The full targeting configuration for a flag in a single environment, returned by\\n`GET .../targeting`. Maps 1:1 onto TargetingConfigurationDto — including\\nits IsEnabled field, which reflects the parent\\n`FlagEnvironmentConfiguration.IsEnabled` (whether the flag is on in this environment at\\nall), not anything specific to targeting itself.\"},\"PublicTargetingRuleResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"priority\":{\"type\":[\"integer\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupResponse\"},{\"type\":\"null\"}]}},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single targeting rule, returned by `GET .../rules/{ruleId}`,\\n`POST .../rules` (201 body), and nested within PublicTargetingConfigResponse.\\nMaps 1:1 onto TargetingRuleDto, dropping nothing — every field on the\\nApplication DTO is part of the public contract.\"},\"PublicTestWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"webhookDeliveryId\":{\"type\":[\"string\",\"null\"]}},\"description\":\"The queued test event and its delivery. Poll the delivery log for the outcome.\"},\"PublicToggleFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"enabled\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `POST .../flags/{flag}/environments/{env}/toggle`. Named distinctly from\\nthe dashboard's own `ToggleFlagInEnvironmentRequest`\\n(which uses `IsEnabled`) — the public field is named Enabled per the phase-3c\\ncontract. Enabled is a NULLABLE `bool?` deliberately: a non-nullable value\\ntype would bind an omitted/empty body to `false` with no validation error (ASP.NET's\\nimplicit-required only covers non-nullable reference types, not value types), silently disabling\\nthe flag. The controller rejects a null Enabled with a `validation_failed` 400\\nso the intent is never ambiguous (#1806).\"},\"PublicUpdateEnvironmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"color\":{\"type\":[\"string\",\"null\"]},\"sortOrder\":{\"type\":[\"integer\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}`. See\\nPublicCreateEnvironmentRequest for why this is named distinctly from the\\ndashboard's `UpdateEnvironmentRequest`.\"},\"PublicUpdateFeatureFlagRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"tags\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"clientSideVisible\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}`. See\\nPublicCreateFeatureFlagRequest for why this is named distinctly from the\\ndashboard's `UpdateFeatureFlagRequest`. The flag's key and type are immutable via this\\nendpoint (mirrors `UpdateFeatureFlagCommand`, which has no `Key`/`Type`).\"},\"PublicUpdateFlagEnvConfigRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"defaultVariationId\":{\"type\":[\"string\",\"null\"]},\"strategy\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: SingleVariation, PercentageRollout, TargetedRollout.\"},\"prerequisites\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicPrerequisiteDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../flags/{flag}/environments/{env}`. Named distinctly from the\\ndashboard's own `UpdateFlagEnvironmentConfigurationRequest`\\n— see PublicCreateEnvironmentRequest for the schemaId-collision rationale (both\\ncontrollers share one Swagger document). Strategy is passed through verbatim to\\nStrategy\\n— the existing command validator name-allowlists it (SingleVariation/PercentageRollout/\\nTargetedRollout or null), so an invalid value surfaces as the handler's own 400, not a\\ncontroller-level guard. A null Prerequisites leaves prerequisites untouched; a\\nnon-null list replaces them wholesale (mirrors UpdateFlagPrerequisitesCommand's\\nreplace-all semantics).\"},\"PublicUpdateProjectRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}`. See\\nPublicCreateProjectRequest for why this is named distinctly from the\\ndashboard's `UpdateProjectRequest`.\"},\"PublicUpdateSdkKeyRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/environments/{env}/sdk-keys/{sdkKey}`.\\nType and key material are immutable via this endpoint (mirrors\\nUpdateSdkKeyCommand, which\\ncarries no `Type`).\"},\"PublicUpdateSegmentRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"conditions\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicSegmentConditionDto\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT /api/v1/orgs/{org}/projects/{project}/segments/{segment}`. The\\nsegment's key is immutable via this endpoint (mirrors `UpdateUserSegmentCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateTargetingRuleRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"description\":{\"type\":[\"string\",\"null\"]},\"variationId\":{\"type\":[\"string\",\"null\"]},\"rolloutPercentage\":{\"type\":[\"integer\",\"null\"]},\"userSegmentId\":{\"type\":[\"string\",\"null\"]},\"conditionGroups\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicConditionGroupRequest\"},{\"type\":\"null\"}]}}},\"description\":\"Request body for `PUT .../rules/{ruleId}`. Same shape as\\nPublicCreateTargetingRuleRequest — see its remarks on operator\\nvalidation/canonicalization, which applies identically here.\"},\"PublicUpdateVariationRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]}},\"description\":\"Request body for\\n`PUT /api/v1/orgs/{org}/projects/{project}/flags/{flag}/variations/{variationId}`. The\\nvariation's key is immutable via this endpoint (mirrors\\n`UpdateVariationCommand`, which\\ncarries no `Key`).\"},\"PublicUpdateWebhookSubscriptionRequest\":{\"type\":[\"object\",\"null\"],\"properties\":{\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]}},\"description\":\"Replaces a subscription's configuration (full replace — omitted lists become empty, meaning\\n\\\"all\\\"). `isEnabled` is required. The provider cannot be changed.\"},\"PublicVariationResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"key\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"value\":{\"type\":[\"string\",\"null\"]},\"description\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A single variation on a flag, as returned in Variations.\"},\"PublicWebhookDeliveryResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"webhookEventId\":{\"type\":[\"string\",\"null\"]},\"status\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: Pending, Succeeded, DeadLettered.\"},\"attemptCount\":{\"type\":[\"integer\",\"null\"]},\"nextAttemptAt\":{\"type\":[\"string\",\"null\"]},\"lastResponseStatusCode\":{\"type\":[\"integer\",\"null\"]},\"lastError\":{\"type\":[\"string\",\"null\"]},\"completedAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"One delivery attempt record. `status` is `Pending` (awaiting its first attempt,\\nbacking off, or in flight), `Succeeded` or `DeadLettered`.\"},\"PublicWebhookDeliveryResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookDeliveryResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"},\"PublicWebhookSecretResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"retiredAt\":{\"type\":[\"string\",\"null\"]}},\"description\":\"A signing secret's id and lifecycle. A secret with no `retiredAt` is active and signs every delivery.\"},\"PublicWebhookSubscriptionResponse\":{\"type\":[\"object\",\"null\"],\"properties\":{\"id\":{\"type\":[\"string\",\"null\"]},\"name\":{\"type\":[\"string\",\"null\"]},\"url\":{\"type\":[\"string\",\"null\"]},\"provider\":{\"type\":[\"string\",\"null\"],\"description\":\"Allowed values: GenericHttp.\"},\"isEnabled\":{\"type\":[\"boolean\",\"null\"]},\"eventTypes\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"projectIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"environmentIds\":{\"type\":[\"array\",\"null\"],\"items\":{\"type\":[\"string\",\"null\"]}},\"consecutiveFailureCount\":{\"type\":[\"integer\",\"null\"]},\"autoDisabledAt\":{\"type\":[\"string\",\"null\"]},\"createdAt\":{\"type\":[\"string\",\"null\"]},\"updatedAt\":{\"type\":[\"string\",\"null\"]},\"secrets\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSecretResponse\"},{\"type\":\"null\"}]}},\"overPlanLimit\":{\"type\":[\"boolean\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A webhook subscription. Never carries secret material: signing secrets are listed by id and\\nlifecycle only — the value itself is returned once, when it is created or rotated.\\n`overPlanLimit` is true when the organization has more subscriptions than its plan\\nallows, which happens after a downgrade. The oldest subscriptions up to the limit keep\\ndelivering. The rest receive nothing and cannot be re-enabled, tested or redelivered to until\\nthe plan is upgraded or older subscriptions are deleted.\"},\"PublicWebhookSubscriptionResponsePagedResult\":{\"type\":[\"object\",\"null\"],\"properties\":{\"items\":{\"type\":[\"array\",\"null\"],\"items\":{\"anyOf\":[{\"$ref\":\"#/$defs/PublicWebhookSubscriptionResponse\"},{\"type\":\"null\"}]}},\"next_cursor\":{\"type\":[\"string\",\"null\"]},\"_actions\":{\"type\":[\"object\",\"null\"],\"additionalProperties\":{\"anyOf\":[{\"$ref\":\"#/$defs/ActionCapability\"},{\"type\":\"null\"}]},\"description\":\"Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.\"}},\"description\":\"A page of results plus an opaque cursor for the next page, or null when this is the last\\npage. Wire keys are frozen: `items` (already lowercase under the camelCase policy) and\\n`next_cursor` (pinned explicitly — the policy alone would emit `nextCursor`).\"}}")
213
212
  }, h = m.$defs, g = m.endpoints, _ = (e) => ({ type: [e, "null"] });
214
213
  function v(e) {
215
214
  if (!h[e]) throw Error(`no API schema named ${e}`);
@@ -272,15 +271,13 @@ function E(e, t = []) {
272
271
  ...t.length ? { required: t } : {}
273
272
  };
274
273
  }
275
- //#endregion
276
- //#region src/tools/params.ts
274
+ // src/tools/params.ts
277
275
  var D = n.string().describe("Project key"), O = n.string().describe("Flag key or id"), k = n.string().describe("Environment key, e.g. production"), A = {
278
276
  limit: n.number().int().min(1).max(100).optional().describe("Page size (default 20)"),
279
277
  cursor: n.string().optional().describe("next_cursor from a previous response")
280
278
  };
281
- //#endregion
282
- //#region src/tools/projects.ts
283
- function j(e, t) {
279
+ // src/tools/projects.ts
280
+ function ee(e, t) {
284
281
  e.registerTool("list_projects", {
285
282
  title: "List projects",
286
283
  description: "List projects in the Featureflip organization. Paginated: pass cursor from next_cursor to continue.",
@@ -370,9 +367,8 @@ function j(e, t) {
370
367
  });
371
368
  }));
372
369
  }
373
- //#endregion
374
- //#region src/tools/environments.ts
375
- function ee(e, t) {
370
+ // src/tools/environments.ts
371
+ function j(e, t) {
376
372
  e.registerTool("list_environments", {
377
373
  title: "List environments",
378
374
  description: "List the environments of a project (e.g. development, staging, production).",
@@ -429,10 +425,9 @@ function ee(e, t) {
429
425
  });
430
426
  }));
431
427
  }
432
- //#endregion
433
- //#region src/tools/sdk-keys.ts
428
+ // src/tools/sdk-keys.ts
434
429
  var M = "This is the only time the full key is returned; it cannot be shown again. Store it in a secret or an untracked .env file, never in source control or a chat log.";
435
- function te(e, t) {
430
+ function N(e, t) {
436
431
  let r = (e, n) => `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/environments/${o(n)}/sdk-keys`;
437
432
  e.registerTool("list_sdk_keys", {
438
433
  title: "List SDK keys",
@@ -504,24 +499,25 @@ function te(e, t) {
504
499
  return await t.api.request("POST", `${p}/revoke`), d({ revoked: a });
505
500
  }));
506
501
  }
507
- //#endregion
508
- //#region src/tools/etag.ts
509
- var N = {
502
+ // src/tools/etag.ts
503
+ var P = {
510
504
  type: "string",
511
505
  description: "ETag of what was read. Pass it as ifMatch on the matching update so the write is refused (412) instead of overwriting a change made since."
506
+ }, F = {
507
+ type: "string",
508
+ description: "ETag of what this write left behind. Pass it as ifMatch on the next update to chain writes without re-reading. Absent when the API sent none; read the resource again before the next conditional write."
512
509
  };
513
- function P(e) {
510
+ function I(e) {
514
511
  return n.string().optional().describe(`etag from ${e}. The write is refused with 412 if the resource changed since that read; re-read and re-apply. Omit to write unconditionally.`);
515
512
  }
516
- function F({ data: e, etag: t }) {
513
+ function L({ data: e, etag: t }) {
517
514
  return t ? {
518
515
  ...e,
519
516
  etag: t
520
517
  } : e;
521
518
  }
522
- //#endregion
523
- //#region src/tools/segments.ts
524
- function ne(e, t) {
519
+ // src/tools/segments.ts
520
+ function te(e, t) {
525
521
  e.registerTool("list_segments", {
526
522
  title: "List user segments",
527
523
  description: "List reusable user segments in a project. Segments are referenced from targeting rules via userSegmentId.",
@@ -541,9 +537,9 @@ function ne(e, t) {
541
537
  project: n.string().describe("Project key"),
542
538
  segment: n.string().describe("Segment key or id")
543
539
  }),
544
- outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/segments/{segment}", { etag: N }),
540
+ outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/segments/{segment}", { etag: P }),
545
541
  annotations: { readOnlyHint: !0 }
546
- }, async ({ project: e, segment: n }) => p(async () => d(F(await t.api.requestWithEtag("GET", `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/segments/${o(n)}`)))));
542
+ }, async ({ project: e, segment: n }) => p(async () => d(L(await t.api.requestWithEtag("GET", `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/segments/${o(n)}`)))));
547
543
  let r = n.object({
548
544
  attribute: n.string().describe("Context attribute name, e.g. plan, country, user_id"),
549
545
  operator: n.string().describe("Case-sensitive: Equals, NotEquals, Contains, NotContains, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual, In, NotIn, MatchesRegex, StartsWith, EndsWith, Before, After, SemverEquals, SemverGreaterThan, SemverGreaterThanOrEqual, SemverLessThan, SemverLessThanOrEqual"),
@@ -570,7 +566,7 @@ function ne(e, t) {
570
566
  name: n.string().optional().describe("Display name; required for create"),
571
567
  description: n.string().optional().describe("What the segment means; \"\" clears it"),
572
568
  conditions: n.array(r).optional().describe("Conditions a user must match to be in the segment; on update, replaces the whole list"),
573
- ifMatch: P("get_segment")
569
+ ifMatch: I("get_segment")
574
570
  }),
575
571
  outputSchema: T(y("POST /api/v1/orgs/{org}/projects/{project}/segments"), E({
576
572
  segment: { type: "string" },
@@ -580,7 +576,8 @@ function ne(e, t) {
580
576
  conditions: {
581
577
  type: ["array", "null"],
582
578
  items: { type: "object" }
583
- }
579
+ },
580
+ etag: F
584
581
  }, ["segment", "updated"]), E({ deleted: { type: "string" } }, ["deleted"])),
585
582
  annotations: { destructiveHint: !0 }
586
583
  }, async ({ action: e, project: n, segment: r, key: a, name: s, description: c, conditions: l, ifMatch: u }) => p(async () => {
@@ -599,23 +596,25 @@ function ne(e, t) {
599
596
  name: s ?? e.name,
600
597
  description: c ?? e.description,
601
598
  conditions: l ?? (e.conditions ?? []).map(i)
602
- };
603
- return await t.api.request("PUT", m, {
599
+ }, { etag: o } = await t.api.requestWithEtag("PUT", m, {
604
600
  body: a,
605
601
  ifMatch: u ?? n
606
- }), d({
607
- segment: r,
608
- updated: !0,
609
- ...a
610
602
  });
603
+ return d(L({
604
+ data: {
605
+ segment: r,
606
+ updated: !0,
607
+ ...a
608
+ },
609
+ etag: o
610
+ }));
611
611
  }
612
612
  return await t.api.request("DELETE", m), d({ deleted: r });
613
613
  }));
614
614
  }
615
- //#endregion
616
- //#region src/tools/owner.ts
617
- var I = n.string().optional().describe("Only flags with this owner: an email, \"me\" for the token's own user, or \"none\" for unowned flags");
618
- async function L(e, t) {
615
+ // src/tools/owner.ts
616
+ var R = n.string().optional().describe("Only flags with this owner: an email, \"me\" for the token's own user, or \"none\" for unowned flags");
617
+ async function z(e, t) {
619
618
  let n = t?.trim();
620
619
  if (!n) return;
621
620
  if (n.toLowerCase() !== "me") return n;
@@ -623,15 +622,14 @@ async function L(e, t) {
623
622
  if (r.type !== "user" || !r.email) throw Error("owner \"me\" needs a personal access token (ffp_...). A service token has no user, so it owns no flags; pass an owner email instead.");
624
623
  return r.email;
625
624
  }
626
- //#endregion
627
- //#region src/tools/flags.ts
628
- var R = n.enum([
625
+ // src/tools/flags.ts
626
+ var B = n.enum([
629
627
  "Boolean",
630
628
  "String",
631
629
  "Number",
632
630
  "Json"
633
631
  ]);
634
- function z(e, t) {
632
+ function ne(e, t) {
635
633
  let r = (e) => `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags`;
636
634
  e.registerTool("list_flags", {
637
635
  title: "List feature flags",
@@ -640,16 +638,16 @@ function z(e, t) {
640
638
  project: D,
641
639
  search: n.string().optional().describe("Substring of the flag key or name"),
642
640
  tag: n.string().optional().describe("Only flags carrying this tag"),
643
- type: R.optional().describe("Only flags of this type"),
641
+ type: B.optional().describe("Only flags of this type"),
644
642
  archived: n.boolean().optional().describe("true = only archived, false = only active"),
645
- owner: I,
643
+ owner: R,
646
644
  ...A
647
645
  }),
648
646
  outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/flags"),
649
647
  annotations: { readOnlyHint: !0 }
650
648
  }, async ({ project: e, owner: n, ...i }) => p(async () => d(await t.api.request("GET", r(e), { query: {
651
649
  ...i,
652
- owner: await L(t, n)
650
+ owner: await z(t, n)
653
651
  } })))), e.registerTool("get_flag", {
654
652
  title: "Get feature flag",
655
653
  description: "Get one feature flag with its variations and metadata, including its owner (null when unowned). Address by flag key or id.",
@@ -657,16 +655,16 @@ function z(e, t) {
657
655
  project: D,
658
656
  flag: O
659
657
  }),
660
- outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}", { etag: N }),
658
+ outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}", { etag: P }),
661
659
  annotations: { readOnlyHint: !0 }
662
- }, async ({ project: e, flag: n }) => p(async () => d(F(await t.api.requestWithEtag("GET", `${r(e)}/${o(n)}`))))), e.registerTool("create_flag", {
660
+ }, async ({ project: e, flag: n }) => p(async () => d(L(await t.api.requestWithEtag("GET", `${r(e)}/${o(n)}`))))), e.registerTool("create_flag", {
663
661
  title: "Create feature flag",
664
662
  description: "Create a feature flag. type is one of Boolean|String|Number|Json. Boolean flags get true/false variations automatically; for other types pass initialVariations. The flag is created in every environment of the project (disabled).",
665
663
  inputSchema: n.object({
666
664
  project: D,
667
665
  key: n.string().describe("Unique flag key, e.g. checkout-v2"),
668
666
  name: n.string().describe("Display name"),
669
- type: R.describe("Value type; Boolean gets true/false variations automatically"),
667
+ type: B.describe("Value type; Boolean gets true/false variations automatically"),
670
668
  description: n.string().optional().describe("What the flag controls"),
671
669
  tags: n.array(n.string()).optional().describe("Tags for filtering, e.g. team or area"),
672
670
  clientSideVisible: n.boolean().optional().describe("Expose to client-side SDKs (browser/mobile)"),
@@ -696,12 +694,13 @@ function z(e, t) {
696
694
  description: n.string().optional().describe("New description; \"\" clears it"),
697
695
  tags: n.array(n.string()).optional().describe("Replaces the whole tag list"),
698
696
  clientSideVisible: n.boolean().optional().describe("Expose to client-side SDKs (browser/mobile); false hides the flag from them entirely"),
699
- ifMatch: P("get_flag")
697
+ ifMatch: I("get_flag")
700
698
  }),
701
699
  outputSchema: w({
702
700
  project: { type: "string" },
703
701
  flag: { type: "string" },
704
- updated: { type: "boolean" }
702
+ updated: { type: "boolean" },
703
+ etag: F
705
704
  }, [
706
705
  "project",
707
706
  "flag",
@@ -714,15 +713,18 @@ function z(e, t) {
714
713
  description: a ?? p?.description,
715
714
  tags: s,
716
715
  clientSideVisible: c
717
- };
718
- return await t.api.request("PUT", u, {
716
+ }, { etag: h } = await t.api.requestWithEtag("PUT", u, {
719
717
  body: m,
720
718
  ifMatch: l ?? f?.etag
721
- }), d({
722
- project: e,
723
- flag: n,
724
- updated: !0
725
719
  });
720
+ return d(L({
721
+ data: {
722
+ project: e,
723
+ flag: n,
724
+ updated: !0
725
+ },
726
+ etag: h
727
+ }));
726
728
  })), e.registerTool("set_flag_expiry", {
727
729
  title: "Set or clear flag expiry",
728
730
  description: "Set the date a flag is expected to be removed by, or pass expiresAtUtc: null to clear it. Expiry is advisory: evaluation never changes. Once the date passes, find_stale_flags reports the flag as expired. expiresAtUtc takes a date (2026-12-31), which means the end of that day in UTC, the same as picking it in the dashboard, or a full ISO-8601 timestamp, which is stored exactly. Refused with EXPIRY_IN_PAST for a time that has already passed (today's date is allowed), with FEATURE_NOT_ENABLED while flag expiration is not enabled for the organization, and with PERMANENT_FLAG_HAS_EXPIRY on a permanent flag (make it temporary first with set_flag_permanent). Clearing is always allowed.",
@@ -804,7 +806,7 @@ function z(e, t) {
804
806
  idempotentHint: !0
805
807
  }
806
808
  }, async ({ project: e, flag: n, owner: i }) => p(async () => {
807
- let a = `${r(e)}/${o(n)}/owner`, s = i?.trim().toLowerCase() === "none" ? void 0 : await L(t, i ?? void 0);
809
+ let a = `${r(e)}/${o(n)}/owner`, s = i?.trim().toLowerCase() === "none" ? void 0 : await z(t, i ?? void 0);
808
810
  return s === void 0 ? await t.api.request("DELETE", a) : await t.api.request("PUT", a, { body: { email: s } }), d({
809
811
  project: e,
810
812
  flag: n,
@@ -852,14 +854,13 @@ function z(e, t) {
852
854
  archived: !1
853
855
  }))));
854
856
  }
855
- //#endregion
856
- //#region src/tools/flag-environments.ts
857
- var B = n.enum([
857
+ // src/tools/flag-environments.ts
858
+ var re = n.enum([
858
859
  "SingleVariation",
859
860
  "PercentageRollout",
860
861
  "TargetedRollout"
861
862
  ]);
862
- function V(e, t) {
863
+ function ie(e, t) {
863
864
  let r = (e, n) => `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags/${o(n)}`;
864
865
  e.registerTool("toggle_flag", {
865
866
  title: "Toggle flag in environment",
@@ -895,7 +896,7 @@ function V(e, t) {
895
896
  flag: O,
896
897
  environment: k,
897
898
  defaultVariationId: n.string().describe("Variation id to serve on fallthrough — required by the API"),
898
- strategy: B.optional().describe("Serving strategy; only SingleVariation is currently supported here"),
899
+ strategy: re.optional().describe("Serving strategy; only SingleVariation is currently supported here"),
899
900
  prerequisites: n.array(n.object({
900
901
  prerequisiteFlagKey: n.string(),
901
902
  expectedVariationKey: n.string()
@@ -977,29 +978,43 @@ function V(e, t) {
977
978
  prerequisites: e.prerequisites ?? []
978
979
  }))
979
980
  });
980
- }));
981
+ })), e.registerTool("flag_evaluations", {
982
+ title: "Flag evaluations in environment",
983
+ description: "What a flag actually served in ONE environment over the last 7, 30 or 90 days: total evaluations, the split by variation, and which rule (or fallthrough, off, prerequisite, error) served what. Percentage-rollout rules include their configured weights and a sample-ratio check; rollout.flagged=true means the served split is statistically off the configured weights. These are evaluation counts, NOT unique users. Counts come from SDK-reported events, so zero means no evaluations were reported, not necessarily no traffic.",
984
+ inputSchema: n.object({
985
+ project: D,
986
+ flag: O,
987
+ environment: k,
988
+ days: n.union([
989
+ n.literal(7),
990
+ n.literal(30),
991
+ n.literal(90)
992
+ ]).optional().describe("Window in UTC days: 7 (default), 30 or 90")
993
+ }),
994
+ outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/evaluations"),
995
+ annotations: { readOnlyHint: !0 }
996
+ }, async ({ project: e, flag: n, environment: i, days: a }) => p(async () => d(await t.api.request("GET", `${r(e, n)}/environments/${o(i)}/evaluations`, { query: { days: a ?? 7 } }))));
981
997
  }
982
- //#endregion
983
- //#region src/tools/targeting.ts
984
- var H = n.object({
998
+ // src/tools/targeting.ts
999
+ var ae = n.object({
985
1000
  attribute: n.string().describe("Context attribute name, e.g. plan, country, user_id"),
986
1001
  operator: n.string().describe("OperatorType member name, case-sensitive — e.g. Equals, NotEquals, Contains, In, GreaterThan"),
987
1002
  values: n.array(n.string()),
988
1003
  negate: n.boolean().optional().default(!1)
989
- }), U = n.object({
1004
+ }), V = n.object({
990
1005
  description: n.string().optional(),
991
1006
  variationId: n.string().optional().describe("Variation served when the rule matches"),
992
1007
  rolloutPercentage: n.number().int().min(0).max(100).optional().describe("Percentage rollout for this rule"),
993
1008
  userSegmentId: n.string().optional().describe("Match users in this segment (see list_segments)"),
994
1009
  conditionGroups: n.array(n.object({
995
1010
  operator: n.enum(["And", "Or"]).describe("How conditions inside this group combine"),
996
- conditions: n.array(H)
1011
+ conditions: n.array(ae)
997
1012
  })).optional().describe("Groups are ANDed together; conditions inside a group use the group operator")
998
- }), W = (e) => ({
1013
+ }), H = (e) => ({
999
1014
  ...e,
1000
1015
  conditionGroups: e.conditionGroups ?? []
1001
1016
  });
1002
- function G(e, t) {
1017
+ function U(e, t) {
1003
1018
  let r = (e, n, r) => `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags/${o(n)}/environments/${o(r)}/targeting`;
1004
1019
  e.registerTool("get_targeting", {
1005
1020
  title: "Get targeting rules",
@@ -1009,23 +1024,24 @@ function G(e, t) {
1009
1024
  flag: O,
1010
1025
  environment: k
1011
1026
  }),
1012
- outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/targeting", { etag: N }),
1027
+ outputSchema: C("GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/targeting", { etag: P }),
1013
1028
  annotations: { readOnlyHint: !0 }
1014
- }, async ({ project: e, flag: n, environment: i }) => p(async () => d(F(await t.api.requestWithEtag("GET", r(e, n, i)))))), e.registerTool("update_targeting", {
1029
+ }, async ({ project: e, flag: n, environment: i }) => p(async () => d(L(await t.api.requestWithEtag("GET", r(e, n, i)))))), e.registerTool("update_targeting", {
1015
1030
  title: "Replace targeting rules",
1016
1031
  description: "REPLACE all targeting rules of a flag in one environment (full PUT — rules not included are removed). Rules are evaluated in order. Get the current rules first with get_targeting. Pass ifMatch (the etag from get_targeting) so rules someone else changed meanwhile are not overwritten.",
1017
1032
  inputSchema: n.object({
1018
1033
  project: D,
1019
1034
  flag: O,
1020
1035
  environment: k,
1021
- rules: n.array(U).describe("The complete ordered rule list; rules left out are deleted"),
1022
- ifMatch: P("get_targeting")
1036
+ rules: n.array(V).describe("The complete ordered rule list; rules left out are deleted"),
1037
+ ifMatch: I("get_targeting")
1023
1038
  }),
1024
1039
  outputSchema: w({
1025
1040
  project: { type: "string" },
1026
1041
  flag: { type: "string" },
1027
1042
  environment: { type: "string" },
1028
- rulesReplaced: { type: "integer" }
1043
+ rulesReplaced: { type: "integer" },
1044
+ etag: F
1029
1045
  }, [
1030
1046
  "project",
1031
1047
  "flag",
@@ -1033,15 +1049,21 @@ function G(e, t) {
1033
1049
  "rulesReplaced"
1034
1050
  ]),
1035
1051
  annotations: { destructiveHint: !0 }
1036
- }, async ({ project: e, flag: n, environment: i, rules: a, ifMatch: o }) => p(async () => (await t.api.request("PUT", r(e, n, i), {
1037
- body: { rules: a.map(W) },
1038
- ifMatch: o
1039
- }), d({
1040
- project: e,
1041
- flag: n,
1042
- environment: i,
1043
- rulesReplaced: a.length
1044
- })))), e.registerTool("manage_targeting_rule", {
1052
+ }, async ({ project: e, flag: n, environment: i, rules: a, ifMatch: o }) => p(async () => {
1053
+ let { etag: s } = await t.api.requestWithEtag("PUT", r(e, n, i), {
1054
+ body: { rules: a.map(H) },
1055
+ ifMatch: o
1056
+ });
1057
+ return d(L({
1058
+ data: {
1059
+ project: e,
1060
+ flag: n,
1061
+ environment: i,
1062
+ rulesReplaced: a.length
1063
+ },
1064
+ etag: s
1065
+ }));
1066
+ })), e.registerTool("manage_targeting_rule", {
1045
1067
  title: "Add, update, remove, or reorder one targeting rule",
1046
1068
  description: "Edit a single targeting rule instead of replacing them all with update_targeting. action=add needs rule (appended last); action=update needs ruleId + rule and changes only the fields you pass (conditionGroups replaces the rule's groups; to clear rolloutPercentage or userSegmentId use update_targeting); action=remove needs ruleId; action=reorder needs ruleIds, every existing rule id exactly once, in the new order. Rule ids come from get_targeting.",
1047
1069
  inputSchema: n.object({
@@ -1055,7 +1077,7 @@ function G(e, t) {
1055
1077
  flag: O,
1056
1078
  environment: k,
1057
1079
  ruleId: n.string().optional().describe("Rule id from get_targeting; required for update and remove"),
1058
- rule: U.optional().describe("Rule fields; required for add and update"),
1080
+ rule: V.optional().describe("Rule fields; required for add and update"),
1059
1081
  ruleIds: n.array(n.string()).optional().describe("Every rule id exactly once, in evaluation order; required for reorder")
1060
1082
  }),
1061
1083
  outputSchema: T(y("POST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/rules"), E({
@@ -1068,7 +1090,7 @@ function G(e, t) {
1068
1090
  annotations: { destructiveHint: !0 }
1069
1091
  }, async ({ action: e, project: n, flag: r, environment: i, ruleId: a, rule: s, ruleIds: c }) => p(async () => {
1070
1092
  let l = `/api/v1/orgs/${o(t.org)}/projects/${o(n)}/flags/${o(r)}/environments/${o(i)}/rules`;
1071
- if (e === "add") return s ? d(await t.api.request("POST", l, { body: W(s) })) : f(/* @__PURE__ */ Error("action=add requires rule"));
1093
+ if (e === "add") return s ? d(await t.api.request("POST", l, { body: H(s) })) : f(/* @__PURE__ */ Error("action=add requires rule"));
1072
1094
  if (e === "reorder") return c ? (await t.api.request("PUT", `${l}/reorder`, { body: { ruleIds: c } }), d({ reordered: c })) : f(/* @__PURE__ */ Error("action=reorder requires ruleIds (see get_targeting)"));
1073
1095
  if (!a) return f(/* @__PURE__ */ Error(`action=${e} requires ruleId (see get_targeting)`));
1074
1096
  let u = `${l}/${o(a)}`;
@@ -1081,7 +1103,7 @@ function G(e, t) {
1081
1103
  userSegmentId: s.userSegmentId ?? e.userSegmentId,
1082
1104
  conditionGroups: s.conditionGroups ?? (e.conditionGroups ?? []).map((e) => ({
1083
1105
  operator: e.operator,
1084
- conditions: e.conditions.map((e) => ({
1106
+ conditions: (e.conditions ?? []).map((e) => ({
1085
1107
  attribute: e.attribute,
1086
1108
  operator: e.operator,
1087
1109
  values: e.values,
@@ -1100,9 +1122,8 @@ function G(e, t) {
1100
1122
  return await t.api.request("DELETE", u), d({ removed: a });
1101
1123
  }));
1102
1124
  }
1103
- //#endregion
1104
- //#region src/tools/variations.ts
1105
- function K(e, t) {
1125
+ // src/tools/variations.ts
1126
+ function W(e, t) {
1106
1127
  e.registerTool("manage_variation", {
1107
1128
  title: "Add, update, or remove a variation",
1108
1129
  description: "Manage a flag's variations. action=add requires key + value; action=update/remove require variationId (get ids via get_flag). Removing a variation fails with VARIATION_HAS_DEPENDENTS if other flags depend on it.",
@@ -1142,15 +1163,14 @@ function K(e, t) {
1142
1163
  } }), d({ updated: i })) : (await t.api.request("DELETE", `${u}/${o(i)}`), d({ removed: i })) : f(/* @__PURE__ */ Error(`action=${r} requires variationId (see get_flag for ids)`));
1143
1164
  }));
1144
1165
  }
1145
- //#endregion
1146
- //#region src/tools/webhooks.ts
1147
- var q = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, J = "Requires an Admin token. A 404 on every webhook call means webhooks are not enabled for the organization.";
1148
- function re(e, t) {
1166
+ // src/tools/webhooks.ts
1167
+ var G = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, K = "Requires an Admin token. A 404 on every webhook call means webhooks are not enabled for the organization.";
1168
+ function q(e, t) {
1149
1169
  let r = `/api/v1/orgs/${o(t.org)}/webhooks`, i = (e) => `${r}/${o(e)}`;
1150
1170
  async function a(e) {
1151
1171
  let n = [];
1152
1172
  for (let r of e) {
1153
- if (q.test(r)) {
1173
+ if (G.test(r)) {
1154
1174
  n.push(r);
1155
1175
  continue;
1156
1176
  }
@@ -1162,7 +1182,7 @@ function re(e, t) {
1162
1182
  }
1163
1183
  async function s(e) {
1164
1184
  let n = e.map((e) => {
1165
- if (q.test(e)) return { id: e };
1185
+ if (G.test(e)) return { id: e };
1166
1186
  let t = e.indexOf("/"), n = e.slice(0, t), r = e.slice(t + 1);
1167
1187
  if (t < 0 || !n || !r) throw Error(`Environment "${e}" needs its project: pass "<project>/<environment>", e.g. "web/production", or the environment's id.`);
1168
1188
  return {
@@ -1183,7 +1203,7 @@ function re(e, t) {
1183
1203
  }
1184
1204
  e.registerTool("list_webhooks", {
1185
1205
  title: "List webhook subscriptions",
1186
- description: "List the organization's outbound webhook subscriptions (url, event/project/environment filters, enabled state, failure count, signing secret ids — never secret values), plus availableEventTypes: the event types a subscription can filter on. Empty filter lists mean \"all\". Paginated via cursor. " + J,
1206
+ description: "List the organization's outbound webhook subscriptions (url, event/project/environment filters, enabled state, failure count, signing secret ids — never secret values), plus availableEventTypes: the event types a subscription can filter on. Empty filter lists mean \"all\". Paginated via cursor. " + K,
1187
1207
  inputSchema: n.object({ ...A }),
1188
1208
  outputSchema: C("GET /api/v1/orgs/{org}/webhooks", { availableEventTypes: {
1189
1209
  type: "array",
@@ -1202,7 +1222,7 @@ function re(e, t) {
1202
1222
  });
1203
1223
  })), e.registerTool("list_webhook_deliveries", {
1204
1224
  title: "List webhook deliveries",
1205
- description: "List one subscription's delivery attempts, most recent first. status is Pending (awaiting an attempt, backing off, or in flight), Succeeded or DeadLettered; lastResponseStatusCode and lastError explain a failure. Paginated via cursor. " + J,
1225
+ description: "List one subscription's delivery attempts, most recent first. status is Pending (awaiting an attempt, backing off, or in flight), Succeeded or DeadLettered; lastResponseStatusCode and lastError explain a failure. Paginated via cursor. " + K,
1206
1226
  inputSchema: n.object({
1207
1227
  id: n.string().describe("Subscription id (from list_webhooks)"),
1208
1228
  ...A
@@ -1214,7 +1234,7 @@ function re(e, t) {
1214
1234
  cursor: r
1215
1235
  } })))), e.registerTool("manage_webhook", {
1216
1236
  title: "Create, update, or delete a webhook subscription, or rotate its secret",
1217
- description: "action=create requires name + url and returns the signing secret. action=update/delete/rotate_secret/retire_secret require id. update changes only the fields you pass and keeps the rest; pass an empty list to widen that filter back to \"all\". projects take project keys or ids; environments take \"<project>/<environment>\" keys (e.g. \"web/production\") or ids. eventTypes come from list_webhooks → availableEventTypes. create and rotate_secret return a secret that is NEVER shown again: relay it to the user verbatim so they can store it. rotate_secret adds a new active secret while the old one keeps signing; retire_secret (secretId from list_webhooks) removes one and is refused for the last active secret. A project-restricted service token must list at least one project, all in its scope. " + J,
1237
+ description: "action=create requires name + url and returns the signing secret. action=update/delete/rotate_secret/retire_secret require id. update changes only the fields you pass and keeps the rest; pass an empty list to widen that filter back to \"all\". projects take project keys or ids; environments take \"<project>/<environment>\" keys (e.g. \"web/production\") or ids. eventTypes come from list_webhooks → availableEventTypes. create and rotate_secret return a secret that is NEVER shown again: relay it to the user verbatim so they can store it. rotate_secret adds a new active secret while the old one keeps signing; retire_secret (secretId from list_webhooks) removes one and is refused for the last active secret. A project-restricted service token must list at least one project, all in its scope. " + K,
1218
1238
  inputSchema: n.object({
1219
1239
  action: n.enum([
1220
1240
  "create",
@@ -1297,7 +1317,7 @@ function re(e, t) {
1297
1317
  })) : f(/* @__PURE__ */ Error("action=retire_secret requires secretId (see list_webhooks)"));
1298
1318
  })), e.registerTool("deliver_webhook", {
1299
1319
  title: "Send a test event or redeliver",
1300
- description: "action=test queues one synthetic flag.toggled event to this subscription alone; action=redeliver (deliveryId from list_webhook_deliveries) re-sends a finished delivery, restarting its retry schedule. Delivery is asynchronous: read list_webhook_deliveries for the outcome. Both are refused for a disabled subscription, and redeliver for a delivery that is still Pending. " + J,
1320
+ description: "action=test queues one synthetic flag.toggled event to this subscription alone; action=redeliver (deliveryId from list_webhook_deliveries) re-sends a finished delivery, restarting its retry schedule. Delivery is asynchronous: read list_webhook_deliveries for the outcome. Both are refused for a disabled subscription, and redeliver for a delivery that is still Pending. " + K,
1301
1321
  inputSchema: n.object({
1302
1322
  action: n.enum(["test", "redeliver"]).describe("test sends a synthetic event; redeliver re-sends deliveryId"),
1303
1323
  id: n.string().describe("Subscription id (from list_webhooks)"),
@@ -1316,17 +1336,16 @@ function re(e, t) {
1316
1336
  redelivered: r
1317
1337
  })) : f(/* @__PURE__ */ Error("action=redeliver requires deliveryId (see list_webhook_deliveries)"))));
1318
1338
  }
1319
- //#endregion
1320
- //#region src/tools/workflows/stale-flags.ts
1321
- var ie = n.enum(["dead", "stale"]), Y = 50;
1322
- function ae(e, t) {
1339
+ // src/tools/workflows/stale-flags.ts
1340
+ var oe = n.enum(["dead", "stale"]), J = 50;
1341
+ function se(e, t) {
1323
1342
  e.registerTool("find_stale_flags", {
1324
1343
  title: "Find stale flags",
1325
- description: `Find flags that look ready for code cleanup: not updated in N days AND either enabled in every environment (verify rollout is complete before removing — per-rule percentage ramps are not inspected) or disabled in every environment (dead — remove flag and code path). A flag whose expiry date (set_flag_expiry) has passed is always a candidate, however recently it was edited; if it is on in some environments and off in others its reason is past-expiry, meaning the owner has to decide which way to fold it. A project can give its temporary flags a default lifetime, so a flag with no date of its own can still be past expiry. Every result carries expiresAtUtc (the date set on the flag), effectiveExpiresAtUtc (the date in effect, from the flag or its project default), expirySource (explicit, project-default, or null), expired and owner (null when unowned). Flags marked permanent (kill switches, ops toggles) are never listed. Pass owner to see one person's stale flags ("me" for your own) or "none" for the unowned ones. Every result also carries blockedBy: the live flags that still list it as a prerequisite, which have to be removed and archived before it ([] when none). blockedBy is null when the server did not classify the flag as a removal candidate, which means unknown, not unblocked. A flag that other live flags list as a prerequisite has to be removed LAST, dependents first: archiving it while a dependent still names it makes that dependent fail its prerequisite check and serve its off variation, so archive_flag refuses it with FLAG_HAS_DEPENDENTS. Checks at most ${Y} candidates per call, expired flags first.`,
1344
+ description: `Find flags that look ready for code cleanup: not updated in N days AND either enabled in every environment (verify rollout is complete before removing — per-rule percentage ramps are not inspected) or disabled in every environment (dead — remove flag and code path). A flag whose expiry date (set_flag_expiry) has passed is always a candidate, however recently it was edited; if it is on in some environments and off in others its reason is past-expiry, meaning the owner has to decide which way to fold it. A project can give its temporary flags a default lifetime, so a flag with no date of its own can still be past expiry. Every result carries expiresAtUtc (the date set on the flag), effectiveExpiresAtUtc (the date in effect, from the flag or its project default), expirySource (explicit, project-default, or null), expired and owner (null when unowned). Flags marked permanent (kill switches, ops toggles) are never listed. Pass owner to see one person's stale flags ("me" for your own) or "none" for the unowned ones. Every result also carries blockedBy: the live flags that still list it as a prerequisite, which have to be removed and archived before it ([] when none). blockedBy is null when the server did not classify the flag as a removal candidate, which means unknown, not unblocked. A flag that other live flags list as a prerequisite has to be removed LAST, dependents first: archiving it while a dependent still names it makes that dependent fail its prerequisite check and serve its off variation, so archive_flag refuses it with FLAG_HAS_DEPENDENTS. Checks at most ${J} candidates per call, expired flags first.`,
1326
1345
  inputSchema: n.object({
1327
1346
  project: D,
1328
1347
  days: n.number().int().min(1).optional().default(30).describe("Minimum age in days since last update"),
1329
- owner: I
1348
+ owner: R
1330
1349
  }),
1331
1350
  outputSchema: w({
1332
1351
  project: { type: "string" },
@@ -1371,7 +1390,7 @@ function ae(e, t) {
1371
1390
  ]),
1372
1391
  annotations: { readOnlyHint: !0 }
1373
1392
  }, async ({ project: e, days: n, owner: r }) => p(async () => {
1374
- let a = await L(t, r), s = `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags`, c = Date.now(), l = c - n * 24 * 60 * 60 * 1e3, u = (e) => e.effectiveExpiresAtUtc ?? e.expiresAtUtc ?? null, f = (e) => e.expirySource ?? (e.expiresAtUtc ? "explicit" : null), p = (e) => {
1393
+ let a = await z(t, r), s = `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags`, c = Date.now(), l = c - n * 24 * 60 * 60 * 1e3, u = (e) => e.effectiveExpiresAtUtc ?? e.expiresAtUtc ?? null, f = (e) => e.expirySource ?? (e.expiresAtUtc ? "explicit" : null), p = (e) => {
1375
1394
  let t = u(e);
1376
1395
  return !!t && new Date(t).getTime() <= c;
1377
1396
  }, m = [], h;
@@ -1386,7 +1405,7 @@ function ae(e, t) {
1386
1405
  m.push(...(e.items ?? []).filter((e) => !!e.key && !!e.name && !!e.updatedAt && (new Date(e.updatedAt).getTime() < l || p(e)))), h = e.next_cursor ?? void 0;
1387
1406
  } while (h);
1388
1407
  m.sort((e, t) => Number(p(t)) - Number(p(e)));
1389
- let g = m.length > Y, _ = m.slice(0, Y), v = [];
1408
+ let g = m.length > J, _ = m.slice(0, J), v = [];
1390
1409
  for (let e of _) {
1391
1410
  let n = await t.api.request("GET", `${s}/${o(e.key)}/environments`);
1392
1411
  if (n.length === 0) continue;
@@ -1428,7 +1447,7 @@ function ae(e, t) {
1428
1447
  ...a ? { owner: a } : {},
1429
1448
  checked: _.length,
1430
1449
  truncated: g,
1431
- ...g ? { note: `Only the first ${Y} of ${m.length} candidates were checked.` } : {},
1450
+ ...g ? { note: `Only the first ${J} of ${m.length} candidates were checked.` } : {},
1432
1451
  ...y ? { blockedByNote: y } : {},
1433
1452
  stale: v
1434
1453
  });
@@ -1437,16 +1456,15 @@ function ae(e, t) {
1437
1456
  description: "List the flags the server is confident can be removed from code, the same list the Featureflip flag cleanup GitHub Action works from. Each item has key, reason, status (Dead or Stale), treatment (true = keep the on-branch, false = keep the off-branch) and blockedBy: the live flags that still list it as a prerequisite. Only remove a flag whose blockedBy is empty. A flag that other live flags list as a prerequisite has to be removed LAST, dependents first: archiving it while a dependent still names it makes that dependent fail its prerequisite check and serve its off variation, so archive_flag refuses it with FLAG_HAS_DEPENDENTS. staleness \"dead\" (the default) returns only dead flags, \"stale\" adds stale ones. Paginated via cursor.",
1438
1457
  inputSchema: n.object({
1439
1458
  project: D,
1440
- staleness: ie.optional().describe("Minimum staleness tier: dead (default) or stale"),
1459
+ staleness: oe.optional().describe("Minimum staleness tier: dead (default) or stale"),
1441
1460
  ...A
1442
1461
  }),
1443
1462
  outputSchema: S("GET /api/v1/orgs/{org}/projects/{project}/flags/removal-candidates"),
1444
1463
  annotations: { readOnlyHint: !0 }
1445
1464
  }, async ({ project: e, ...n }) => p(async () => d(await t.api.request("GET", `/api/v1/orgs/${o(t.org)}/projects/${o(e)}/flags/removal-candidates`, { query: n }))));
1446
1465
  }
1447
- //#endregion
1448
- //#region src/tools/workflows/snippets.ts
1449
- var oe = [
1466
+ // src/tools/workflows/snippets.ts
1467
+ var ce = [
1450
1468
  "js",
1451
1469
  "node",
1452
1470
  "browser",
@@ -1458,16 +1476,16 @@ var oe = [
1458
1476
  "php",
1459
1477
  "ruby",
1460
1478
  "swift"
1461
- ], se = [
1479
+ ], le = [
1462
1480
  "browser",
1463
1481
  "react",
1464
1482
  "swift"
1465
1483
  ];
1466
- function ce(e) {
1467
- return se.includes(e);
1484
+ function ue(e) {
1485
+ return le.includes(e);
1468
1486
  }
1469
- var X = "Uses a SERVER-side SDK key (Featureflip dashboard → environment → SDK keys).", Z = "Uses a CLIENT-side SDK key (safe to ship to browsers/apps).";
1470
- function le(e, t) {
1487
+ var Y = "Uses a SERVER-side SDK key (Featureflip dashboard → environment → SDK keys).", X = "Uses a CLIENT-side SDK key (safe to ship to browsers/apps).";
1488
+ function de(e, t) {
1471
1489
  switch (e) {
1472
1490
  case "js": return {
1473
1491
  install: "npm install @featureflip/js",
@@ -1482,7 +1500,7 @@ const enabled = client.boolVariation('${t}', { user_id: userId }, false);
1482
1500
  if (enabled) {
1483
1501
  // new code path
1484
1502
  }`,
1485
- notes: X
1503
+ notes: Y
1486
1504
  };
1487
1505
  case "node": return {
1488
1506
  install: "npm install @featureflip/node",
@@ -1493,7 +1511,7 @@ const enabled = client.boolVariation('${t}', { user_id: userId }, false);
1493
1511
  if (enabled) {
1494
1512
  // new code path
1495
1513
  }`,
1496
- notes: X
1514
+ notes: Y
1497
1515
  };
1498
1516
  case "browser": return {
1499
1517
  install: "npm install @featureflip/browser",
@@ -1505,7 +1523,7 @@ const enabled = client.boolVariation('${t}', false);
1505
1523
  if (enabled) {
1506
1524
  // new code path
1507
1525
  }`,
1508
- notes: Z
1526
+ notes: X
1509
1527
  };
1510
1528
  case "react": return {
1511
1529
  install: "npm install @featureflip/react @featureflip/browser",
@@ -1518,7 +1536,7 @@ function MyComponent() {
1518
1536
  const enabled = useFeatureFlag('${t}', false);
1519
1537
  return enabled ? <NewExperience /> : <CurrentExperience />;
1520
1538
  }`,
1521
- notes: Z
1539
+ notes: X
1522
1540
  };
1523
1541
  case "python": return {
1524
1542
  install: "pip install featureflip",
@@ -1529,7 +1547,7 @@ enabled = client.variation("${t}", {"user_id": user_id}, default=False)
1529
1547
  if enabled:
1530
1548
  # new code path
1531
1549
  ...`,
1532
- notes: X
1550
+ notes: Y
1533
1551
  };
1534
1552
  case "csharp": return {
1535
1553
  install: "dotnet add package Featureflip.Client",
@@ -1542,7 +1560,7 @@ if (enabled)
1542
1560
  {
1543
1561
  // new code path
1544
1562
  }`,
1545
- notes: X
1563
+ notes: Y
1546
1564
  };
1547
1565
  case "java": return {
1548
1566
  install: "implementation 'io.featureflip:featureflip-java:2.0.0'",
@@ -1556,7 +1574,7 @@ boolean enabled = client.boolVariation("${t}",
1556
1574
  if (enabled) {
1557
1575
  // new code path
1558
1576
  }`,
1559
- notes: X
1577
+ notes: Y
1560
1578
  };
1561
1579
  case "go": return {
1562
1580
  install: "go get github.com/canopy-labs/featureflip-go/v2",
@@ -1572,7 +1590,7 @@ ctx := featureflip.EvaluationContext{UserID: userID}
1572
1590
  if client.BoolVariation("${t}", ctx, false) {
1573
1591
  // new code path
1574
1592
  }`,
1575
- notes: X
1593
+ notes: Y
1576
1594
  };
1577
1595
  case "php": return {
1578
1596
  install: "composer require featureflip/featureflip-php",
@@ -1587,7 +1605,7 @@ $enabled = $client->boolVariation('${t}', ['user_id' => $userId], false);
1587
1605
  if ($enabled) {
1588
1606
  // new code path
1589
1607
  }`,
1590
- notes: X + " Requires PSR-16 cache and PSR-18 HTTP implementations."
1608
+ notes: Y + " Requires PSR-16 cache and PSR-18 HTTP implementations."
1591
1609
  };
1592
1610
  case "ruby": return {
1593
1611
  install: "gem \"featureflip\"",
@@ -1598,7 +1616,7 @@ enabled = client.bool_variation("${t}", { "user_id" => user_id }, false)
1598
1616
  if enabled
1599
1617
  # new code path
1600
1618
  end`,
1601
- notes: X
1619
+ notes: Y
1602
1620
  };
1603
1621
  case "swift": return {
1604
1622
  install: ".package(url: \"https://github.com/canopy-labs/featureflip-swift\", from: \"2.0.0\")",
@@ -1611,13 +1629,12 @@ let enabled = client.boolVariation("${t}", default: false)
1611
1629
  if enabled {
1612
1630
  // new code path
1613
1631
  }`,
1614
- notes: Z
1632
+ notes: X
1615
1633
  };
1616
1634
  }
1617
1635
  }
1618
- //#endregion
1619
- //#region src/tools/workflows/wrap-feature.ts
1620
- function ue(e, t) {
1636
+ // src/tools/workflows/wrap-feature.ts
1637
+ function Z(e, t) {
1621
1638
  e.registerTool("wrap_feature", {
1622
1639
  title: "Wrap a feature in a new flag",
1623
1640
  description: "Create a Boolean feature flag and get back the SDK code snippet to guard the new code path with it. Returns the snippet only — apply the edit yourself. The flag starts DISABLED in every environment; enable it with toggle_flag when ready.",
@@ -1627,7 +1644,7 @@ function ue(e, t) {
1627
1644
  name: n.string().optional().describe("Display name; defaults to the key"),
1628
1645
  description: n.string().optional().describe("What this flag guards"),
1629
1646
  tags: n.array(n.string()).optional().describe("Tags for filtering, e.g. team or area"),
1630
- language: n.enum(oe).describe("SDK language of the codebase being edited"),
1647
+ language: n.enum(ce).describe("SDK language of the codebase being edited"),
1631
1648
  idempotency_key: n.string().optional().describe("Idempotency-Key header for safe retries")
1632
1649
  }),
1633
1650
  outputSchema: w({
@@ -1656,10 +1673,10 @@ function ue(e, t) {
1656
1673
  type: "Boolean",
1657
1674
  description: i,
1658
1675
  tags: a,
1659
- ...ce(s) ? { clientSideVisible: !0 } : {}
1676
+ ...ue(s) ? { clientSideVisible: !0 } : {}
1660
1677
  },
1661
1678
  idempotencyKey: c
1662
- }), u = le(s, n);
1679
+ }), u = de(s, n);
1663
1680
  return d({
1664
1681
  flag: l,
1665
1682
  integration: {
@@ -1676,17 +1693,15 @@ function ue(e, t) {
1676
1693
  });
1677
1694
  }));
1678
1695
  }
1679
- //#endregion
1680
- //#region src/server.ts
1681
- function de(t) {
1696
+ // src/server.ts
1697
+ function fe(t) {
1682
1698
  let n = new e({
1683
1699
  name: "featureflip",
1684
1700
  version: r
1685
1701
  });
1686
- return j(n, t), ee(n, t), te(n, t), ne(n, t), z(n, t), V(n, t), G(n, t), K(n, t), re(n, t), ae(n, t), ue(n, t), n;
1702
+ return ee(n, t), j(n, t), N(n, t), te(n, t), ne(n, t), ie(n, t), U(n, t), W(n, t), q(n, t), se(n, t), Z(n, t), n;
1687
1703
  }
1688
- //#endregion
1689
- //#region src/config.ts
1704
+ // src/config.ts
1690
1705
  var Q = "FEATUREFLIP_TOKEN is required. Create one in the Featureflip dashboard — Settings → API Tokens (personal token, ffp_...) or Organization Settings → Service Tokens (ffs_...) — and set it in your MCP client config.";
1691
1706
  function $(e = process.env) {
1692
1707
  let t = e.FEATUREFLIP_TOKEN?.trim();
@@ -1696,14 +1711,13 @@ function $(e = process.env) {
1696
1711
  org: e.FEATUREFLIP_ORG?.trim() || void 0
1697
1712
  } : null;
1698
1713
  }
1699
- function fe(e = process.env) {
1714
+ function pe(e = process.env) {
1700
1715
  let t = $(e);
1701
1716
  if (!t) throw Error(Q);
1702
1717
  return t;
1703
1718
  }
1704
- //#endregion
1705
- //#region src/org.ts
1706
- async function pe(e, t) {
1719
+ // src/org.ts
1720
+ async function me(e, t) {
1707
1721
  if (t) return t;
1708
1722
  let n = (await e.request("GET", "/api/v1/orgs", { query: { limit: 100 } })).items ?? [];
1709
1723
  if (n.length === 1) {
@@ -1713,5 +1727,4 @@ async function pe(e, t) {
1713
1727
  }
1714
1728
  throw n.length === 0 ? Error("The token can see no organizations. Check the token in the Featureflip dashboard.") : Error(`The token can see ${n.length} organizations — set FEATUREFLIP_ORG to one of: ` + n.map((e) => e.slug ?? "?").join(", "));
1715
1729
  }
1716
- //#endregion
1717
- export { de as a, r as c, $ as i, Q as n, i as o, fe as r, u as s, pe as t };
1730
+ export { fe as a, r as c, $ as i, Q as n, i as o, pe as r, u as s, me as t };