@taiga-ai/mcp-server 0.2.3-dev.224 → 0.2.3-dev.226
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -4,22 +4,237 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region ../../packages/feature-flags/dist/index.js
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Feature flags shared across web, api, mcp-server, and the documentation site.
|
|
8
|
+
*
|
|
9
|
+
* {@link featureFlagDefinitions} is the single source of truth for WHICH flags
|
|
10
|
+
* exist, HOW each one resolves per environment, and what it is for; the
|
|
11
|
+
* {@link FeatureFlags} type is derived from it. Every app calls
|
|
12
|
+
* {@link resolveFeatureFlags} with its own environment identifier so a feature
|
|
13
|
+
* is shown or hidden consistently everywhere from one rule set:
|
|
14
|
+
* - web: `resolveFeatureFlags(config.VITE_APP_ENV)` (baked at build time)
|
|
15
|
+
* - api: a fail-safe wrapper (`apps/api/src/shared/config/feature-flags.ts`)
|
|
16
|
+
* that resolves `ENVIRONMENT` and defaults to `prod` for any unrecognized
|
|
17
|
+
* value when deployed, so a WIP feature is never leaked
|
|
18
|
+
* - docs: `apps/docs/src/content.config.ts` resolves flags for the
|
|
19
|
+
* environment being built and DROPS pages carrying `flag: <name>` where
|
|
20
|
+
* that flag is off, so docs.tai.ga never describes a feature customers
|
|
21
|
+
* cannot see (PRO-1033)
|
|
22
|
+
*
|
|
23
|
+
* Flags are boot-time constants — no remote source. Changing a rule here
|
|
24
|
+
* re-derives the flag everywhere.
|
|
25
|
+
*
|
|
26
|
+
* ## Adding a flag
|
|
27
|
+
*
|
|
28
|
+
* One entry in {@link featureFlagDefinitions}: its `availability`, a one-line
|
|
29
|
+
* `description` for the web dev panel, and the full account of what it gates
|
|
30
|
+
* and why as the JSDoc above the entry. If the flag is OFF in prod, two more
|
|
31
|
+
* things follow, and the first will stop you:
|
|
32
|
+
*
|
|
33
|
+
* 1. **`make docs-check-claims` fails until the flag is registered** in
|
|
34
|
+
* `FLAG_PHRASES` (`apps/docs/scripts/check-claims.py`). That is deliberate:
|
|
35
|
+
* the check used to iterate its own dict, so an unregistered flag was never
|
|
36
|
+
* examined and a page could describe an invisible feature. Register the
|
|
37
|
+
* words a page would use for the feature, or `[]` if it has a page of its
|
|
38
|
+
* own that declares the flag.
|
|
39
|
+
* 2. **A page for the feature can be written now**, carrying `flag: <name>` in
|
|
40
|
+
* its frontmatter. It is published on dev and staging and excluded from
|
|
41
|
+
* prod, and it publishes by itself when the flag graduates — no docs change.
|
|
42
|
+
* See the `flag:` section in `apps/docs/AGENTS.md`, which also covers the
|
|
43
|
+
* one constraint: nothing published may link to a flagged page.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* THE registry: one entry per flag. Adding a flag is adding an entry here;
|
|
47
|
+
* {@link FeatureFlags} and {@link resolveFeatureFlags} derive from it.
|
|
48
|
+
*/
|
|
49
|
+
const featureFlagDefinitions = Object.freeze({
|
|
50
|
+
/**
|
|
51
|
+
* Skills feature. When `false` the feature is fully dormant:
|
|
52
|
+
* - web: nav groups, dashboard governance row, and skills routes are hidden
|
|
53
|
+
* - api: the `/v1/agent-skills*` endpoints are not registered
|
|
54
|
+
* - mcp: the skill tools, their instruction mentions, and the
|
|
55
|
+
* `getProjectContext` skills summary are omitted
|
|
56
|
+
* - agent runtime: no skills are injected into agent prompts
|
|
57
|
+
* - seeding: no default skills are created for new tenants/teams/projects
|
|
58
|
+
*
|
|
59
|
+
* Hidden for now (not needed in the product yet; may return later).
|
|
60
|
+
*/
|
|
61
|
+
skills: {
|
|
62
|
+
description: "Agent skills: the skills routes and pages, the MCP skill tools, and skills injected into agent prompts. Hidden in every environment for now.",
|
|
63
|
+
availability: "nowhere"
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Insights surface (Learn loop) — production feedback and customer signals
|
|
67
|
+
* feeding the next iteration.
|
|
68
|
+
*
|
|
69
|
+
* Release toggle: ON in local/dev/staging, OFF in prod. Surfaces the
|
|
70
|
+
* scaffold page in lower environments only while the feature is designed.
|
|
71
|
+
* **Remove this flag (and its gates) at GA.**
|
|
72
|
+
*/
|
|
73
|
+
insights: {
|
|
74
|
+
description: "Insights section of the Learn loop: production feedback and customer signals feeding the next iteration.",
|
|
75
|
+
availability: "non-prod"
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* UI Sparring (PRO-630) — AI-generated UI concepts for the CUSTOMER's app,
|
|
79
|
+
* rendered client-side in a sandboxed iframe styled with the tenant's
|
|
80
|
+
* design_standards tokens. When `false` the feature is fully dormant:
|
|
81
|
+
* - web: the concept gallery, the Studio and the `/dev/ui-artifact-test`
|
|
82
|
+
* route are not registered
|
|
83
|
+
* - api: the `/v1/projects/:projectId/ui-artifacts/*` endpoints are not
|
|
84
|
+
* registered
|
|
85
|
+
*
|
|
86
|
+
* The flow surface moved out from under this flag in PRO-1029 — see
|
|
87
|
+
* {@link FeatureFlags.flowStudio}.
|
|
88
|
+
*
|
|
89
|
+
* Release toggle: ON in local/dev/staging, OFF in prod while the feature is
|
|
90
|
+
* built out (foundation slice → workshop → binding).
|
|
91
|
+
* **Remove this flag (and its gates) at GA.**
|
|
92
|
+
*/
|
|
93
|
+
uiSparring: {
|
|
94
|
+
description: "UI Sparring: AI-generated UI concepts for the customer's application, the concept gallery and the UI Studio, with their API endpoints.",
|
|
95
|
+
availability: "non-prod"
|
|
96
|
+
},
|
|
97
|
+
/**
|
|
98
|
+
* User Flow Studio (PRO-1029) — the conversational surface for the
|
|
99
|
+
* `user_flow` document: talk the flows into shape, the ux-planning agent
|
|
100
|
+
* drafts and revises them, every agreed change lands in the document.
|
|
101
|
+
*
|
|
102
|
+
* Split out of {@link FeatureFlags.uiSparring} because working out user flows
|
|
103
|
+
* is Discovery work that stands on its own: it happens before anyone asks
|
|
104
|
+
* what a screen looks like, and it is useful to a customer who never opens
|
|
105
|
+
* the UI Studio. Sharing one flag meant flows could not ship without shipping
|
|
106
|
+
* concept generation and the sparring chat with them.
|
|
107
|
+
*
|
|
108
|
+
* Gates the web surface only — the route and the Edit control on the user
|
|
109
|
+
* flows document. The streaming endpoint (`POST
|
|
110
|
+
* /v1/conversations/:id/workshop-stream`) is deliberately NOT gated: it
|
|
111
|
+
* carries a conversation, the same as the spec-chat route beside it, and
|
|
112
|
+
* hiding a page is not a reason to make an authenticated, capability-checked
|
|
113
|
+
* endpoint conditional.
|
|
114
|
+
*
|
|
115
|
+
* Release toggle: ON in local/dev/staging, OFF in prod until the surface has
|
|
116
|
+
* proven itself there. **Remove this flag (and its gates) at GA.**
|
|
117
|
+
*/
|
|
118
|
+
flowStudio: {
|
|
119
|
+
description: "User Flow Studio: the conversational surface where the ux-planning agent drafts and revises the user flows document.",
|
|
120
|
+
availability: "non-prod"
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* Customer-definable check-and-stamp checklists (PRO-946..948, design
|
|
124
|
+
* PRO-933). When `false` the feature is fully dormant:
|
|
125
|
+
* - api: the `/v1/checklist-*` endpoints are not registered
|
|
126
|
+
* - api: no checklist instances are created on project creation (PR 2/3)
|
|
127
|
+
* - web: no discovery-pipeline checklist step, no org-settings editor
|
|
128
|
+
*
|
|
129
|
+
* Release toggle: ON in local/dev/staging, OFF in prod while the three
|
|
130
|
+
* slices (schema/API → gate + project surface → template editor) land.
|
|
131
|
+
* **Remove this flag (and its gates) at GA.**
|
|
132
|
+
*/
|
|
133
|
+
checklists: {
|
|
134
|
+
description: "Customer-defined check-and-stamp checklists: the discovery pipeline step, the organization settings editor and their API endpoints.",
|
|
135
|
+
availability: "non-prod"
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Factory v2 engineer pod (PRO-1313..1315): the admin-only `/v1/engineer/*`
|
|
139
|
+
* endpoints that trigger the EC2-backed Runtime Instances probe runtime.
|
|
140
|
+
* When `false` the routes are not registered, so nothing in the product can
|
|
141
|
+
* reach that runtime. This flag NEVER re-routes real work: the existing
|
|
142
|
+
* planning and coding agents remain the only dispatch path in every
|
|
143
|
+
* environment. OFF in prod until the real engineer pod ships behind its
|
|
144
|
+
* own, separate rollout decision.
|
|
145
|
+
*/
|
|
146
|
+
engineerPod: {
|
|
147
|
+
description: "Factory v2 engineer pod: the admin-only /v1/engineer endpoints that trigger the Runtime Instances probe runtime (dev/staging only).",
|
|
148
|
+
availability: "non-prod"
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* Questionnaire filling (PRO-932) — a customer uploads their own requirement
|
|
152
|
+
* spreadsheet, Taiga answers what the project's evidence supports with
|
|
153
|
+
* `document@version` citations, a human attests, and the answers are written
|
|
154
|
+
* back into that same workbook. ASTORI's THL Liite 4 is the first named
|
|
155
|
+
* preset, not a modelled regulation.
|
|
156
|
+
*
|
|
157
|
+
* When `false` the feature is fully dormant:
|
|
158
|
+
* - api: the `/v1/questionnaires*` and `/v1/projects/:id/questionnaires`
|
|
159
|
+
* endpoints are not registered
|
|
160
|
+
*
|
|
161
|
+
* Release toggle: ON in local/dev/staging, OFF in prod while the slices
|
|
162
|
+
* (import → fill → attest + export) land.
|
|
163
|
+
* **Remove this flag (and its gates) at GA.**
|
|
164
|
+
*/
|
|
165
|
+
questionnaires: {
|
|
166
|
+
description: "Questionnaire filling: answer an uploaded requirement spreadsheet from project evidence with citations, attest, and write the answers back.",
|
|
167
|
+
availability: "non-prod"
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* UI Studio Wizard (PRO-1030) — the guided three-choice route through the UI
|
|
171
|
+
* decisions, for the person finishing Discovery who does not want a
|
|
172
|
+
* workbench. When `false` the feature is fully dormant:
|
|
173
|
+
* - web: the `/ui-wizard` route is not registered, and Discovery's UI
|
|
174
|
+
* Studio card offers only the studio itself
|
|
175
|
+
*
|
|
176
|
+
* Split out of {@link FeatureFlags.uiSparring} rather than riding it, for the
|
|
177
|
+
* reason {@link FeatureFlags.flowStudio} was: the wizard and the studio are
|
|
178
|
+
* two front doors onto the same concepts, and they will not graduate on the
|
|
179
|
+
* same day. Everything the wizard reaches is gated on `uiSparring` server-side
|
|
180
|
+
* (the concept job's own assembler throws without it), so every gate on this
|
|
181
|
+
* flag ANDs the two — a wizard released alone would offer a button that 500s.
|
|
182
|
+
*
|
|
183
|
+
* Release toggle: ON in local/dev/staging, OFF in prod.
|
|
184
|
+
* **Remove this flag (and its gates) at GA.**
|
|
185
|
+
*/
|
|
186
|
+
uiStudioWizard: {
|
|
187
|
+
description: "UI Studio Wizard: the guided three-choice route through the UI decisions. Only works when uiSparring is also on, including on the API.",
|
|
188
|
+
availability: "non-prod"
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* Design-system emitter (PRO-887): materialise an organisation's INTERNAL
|
|
192
|
+
* Design Standards into `src/styles/design-tokens.css` + `DESIGN.md` in the
|
|
193
|
+
* generated application at build bootstrap. Never active for a tenant with a
|
|
194
|
+
* linked design-system repository (that repo is the source of truth).
|
|
195
|
+
*
|
|
196
|
+
* Release toggle: ON in local/dev/staging, OFF in prod until the first
|
|
197
|
+
* internal-DS build has been verified end to end.
|
|
198
|
+
*/
|
|
199
|
+
designEmitter: {
|
|
200
|
+
description: "Design-system emitter: writes an organization's internal design standards into design-tokens.css and DESIGN.md in the generated application at build bootstrap.",
|
|
201
|
+
availability: "non-prod"
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* Autonomous merge (project "Autonomous Merge") -- Taiga decides when an
|
|
205
|
+
* agent-authored pull request merges, under a customer-set autonomy policy,
|
|
206
|
+
* instead of parking every green PR at `needs_review` for a person.
|
|
207
|
+
*
|
|
208
|
+
* NOT the customer's switch, and the distinction is the whole reason this
|
|
209
|
+
* comment is long. THIS flag is a per-ENVIRONMENT constant answering "does
|
|
210
|
+
* the capability exist in this build at all". The customer's consent is a
|
|
211
|
+
* separate per-TENANT policy resolved across org -> team -> project ->
|
|
212
|
+
* initiative, where org defaults to off. Reading this flag as "the tenant
|
|
213
|
+
* enabled auto-merge" would merge into a repository whose owner never asked
|
|
214
|
+
* for it. One is the kill switch, the other is the consent; they are never
|
|
215
|
+
* interchangeable.
|
|
216
|
+
*
|
|
217
|
+
* Release toggle: ON in local/dev/staging, OFF in prod while the policy core,
|
|
218
|
+
* forge preflight, executor and safety net land.
|
|
219
|
+
* **Remove this flag (and its gates) at GA.**
|
|
220
|
+
*/
|
|
221
|
+
autoMerge: {
|
|
222
|
+
description: "Autonomous merge: Taiga merges green agent-authored pull requests under the customer's autonomy policy. This is the capability kill switch, not the tenant's consent.",
|
|
223
|
+
availability: "everywhere"
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
/** Every flag name, in registry order. */
|
|
227
|
+
const featureFlagNames = Object.keys(featureFlagDefinitions);
|
|
228
|
+
/**
|
|
229
|
+
* Resolve the full flag set for an environment from the registry. Frozen so a
|
|
230
|
+
* resolved set cannot be mutated at runtime — changing a flag is a source edit
|
|
231
|
+
* in {@link featureFlagDefinitions}, not an assignment in an app.
|
|
10
232
|
*/
|
|
11
233
|
function resolveFeatureFlags(env) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
flowStudio: env !== "prod",
|
|
17
|
-
checklists: env !== "prod",
|
|
18
|
-
questionnaires: env !== "prod",
|
|
19
|
-
uiStudioWizard: env !== "prod",
|
|
20
|
-
designEmitter: env !== "prod",
|
|
21
|
-
autoMerge: true
|
|
22
|
-
});
|
|
234
|
+
const isOn = (availability) => availability === "everywhere" || availability === "non-prod" && env !== "prod";
|
|
235
|
+
const resolved = {};
|
|
236
|
+
for (const name of featureFlagNames) resolved[name] = isOn(featureFlagDefinitions[name].availability);
|
|
237
|
+
return Object.freeze(resolved);
|
|
23
238
|
}
|
|
24
239
|
/**
|
|
25
240
|
* Safe-default snapshot, resolved as `prod`: every still-gated release toggle
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|