@stackwright-pro/mcp 0.2.0-alpha.95 → 0.2.0-alpha.98

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.
@@ -0,0 +1,429 @@
1
+ // src/tools/pipeline.ts
2
+ import { z as z5 } from "zod";
3
+
4
+ // src/coerce.ts
5
+ import { z } from "zod";
6
+
7
+ // src/artifact-signing.ts
8
+ import { z as z2 } from "zod";
9
+
10
+ // src/tools/pipeline.ts
11
+ import { WorkflowFileSchema, authConfigSchema as authConfigSchema3 } from "@stackwright-pro/types";
12
+
13
+ // src/tools/get-schema.ts
14
+ import { z as z4 } from "zod";
15
+ import {
16
+ WorkflowStepSchema as WorkflowStepSchema2,
17
+ WorkflowDefinitionSchema as WorkflowDefinitionSchema2,
18
+ WorkflowFieldSchema as WorkflowFieldSchema2,
19
+ WorkflowActionSchema as WorkflowActionSchema2,
20
+ authConfigSchema as authConfigSchema2
21
+ } from "@stackwright-pro/types";
22
+
23
+ // src/tools/validate-yaml-fragment.ts
24
+ import { z as z3 } from "zod";
25
+ import { load as yamlLoad } from "js-yaml";
26
+ import {
27
+ WorkflowStepSchema,
28
+ WorkflowDefinitionSchema,
29
+ WorkflowFieldSchema,
30
+ WorkflowActionSchema,
31
+ authConfigSchema
32
+ } from "@stackwright-pro/types";
33
+ var NavigationLinkSchema = z3.lazy(
34
+ () => z3.object({
35
+ label: z3.string().min(1),
36
+ href: z3.string().min(1),
37
+ children: z3.array(NavigationLinkSchema).optional()
38
+ })
39
+ );
40
+ var NavigationSectionSchema = z3.object({
41
+ section: z3.string().min(1),
42
+ items: z3.array(NavigationLinkSchema)
43
+ });
44
+ var NavigationItemSchema = z3.union([
45
+ NavigationLinkSchema,
46
+ NavigationSectionSchema
47
+ ]);
48
+
49
+ // src/tools/get-schema.ts
50
+ var NavigationLinkSchema2 = z4.lazy(
51
+ () => z4.object({
52
+ label: z4.string().min(1),
53
+ href: z4.string().min(1),
54
+ children: z4.array(NavigationLinkSchema2).optional()
55
+ })
56
+ );
57
+ var NavigationSectionSchema2 = z4.object({
58
+ section: z4.string().min(1),
59
+ items: z4.array(NavigationLinkSchema2)
60
+ });
61
+ var NavigationItemSchema2 = z4.union([
62
+ NavigationLinkSchema2,
63
+ NavigationSectionSchema2
64
+ ]);
65
+
66
+ // src/tools/pipeline.ts
67
+ import { emit } from "@stackwright-pro/telemetry";
68
+ var PHASE_ORDER = [
69
+ "designer",
70
+ "theme",
71
+ "scaffold",
72
+ // generates app/ directory from config
73
+ "api",
74
+ "data",
75
+ "auth",
76
+ // moved earlier — only depends on design-language.json (designer)
77
+ "geo",
78
+ "workflow",
79
+ "services",
80
+ "pages",
81
+ "dashboard",
82
+ "polish",
83
+ "qa"
84
+ ];
85
+ var PHASE_ARTIFACT = {
86
+ designer: "design-language.json",
87
+ theme: "theme-tokens.json",
88
+ scaffold: "scaffold-manifest.json",
89
+ api: "api-config.json",
90
+ auth: "auth-config.json",
91
+ data: "data-config.json",
92
+ pages: "pages-manifest.json",
93
+ dashboard: "dashboard-manifest.json",
94
+ workflow: "workflow-config.json",
95
+ services: "services-config.json",
96
+ polish: "polish-manifest.json",
97
+ geo: "geo-manifest.json",
98
+ qa: "qa-findings.json"
99
+ };
100
+ var PHASE_ARTIFACT_SCHEMA = {
101
+ designer: JSON.stringify(
102
+ {
103
+ version: "1.0",
104
+ generatedBy: "stackwright-pro-designer-otter",
105
+ application: {
106
+ type: "<operational|data-explorer|admin|logistics|general>",
107
+ environment: "<workstation|field|control-room|mixed>",
108
+ density: "<compact|balanced|spacious>",
109
+ accessibility: "<wcag-aa|section-508|none>",
110
+ colorScheme: "<light|dark|both>"
111
+ },
112
+ designLanguage: {
113
+ rationale: "<design rationale>",
114
+ spacingScale: { base: 8, scale: [0, 4, 8, 16, 24, 32, 48, 64] },
115
+ colorSemantics: { primary: "#1a365d", accent: "#e53e3e" },
116
+ typography: {
117
+ dataFont: "Inter",
118
+ headingFont: "Inter",
119
+ monoFont: "monospace",
120
+ dataSizePx: 12,
121
+ bodySizePx: 14
122
+ },
123
+ contrastRatio: "4.5",
124
+ borderRadius: "4",
125
+ shadowElevation: "standard"
126
+ },
127
+ themeTokenSeeds: {
128
+ light: {
129
+ background: "#ffffff",
130
+ foreground: "#1a1a1a",
131
+ primary: "#1a365d",
132
+ surface: "#f7f7f7",
133
+ border: "#e2e8f0"
134
+ },
135
+ dark: {
136
+ background: "#1a1a1a",
137
+ foreground: "#ffffff",
138
+ primary: "#90cdf4",
139
+ surface: "#2d2d2d",
140
+ border: "#4a5568"
141
+ }
142
+ },
143
+ conformsTo: null,
144
+ operationalNotes: []
145
+ },
146
+ null,
147
+ 2
148
+ ),
149
+ theme: JSON.stringify(
150
+ {
151
+ version: "1.0",
152
+ generatedBy: "stackwright-pro-theme-otter",
153
+ componentLibrary: "shadcn",
154
+ colorScheme: "<light|dark|both>",
155
+ tokens: {
156
+ colors: { "primary-500": "#1a365d", background: "#ffffff" },
157
+ spacing: { "spacing-1": "8px", "spacing-2": "16px" },
158
+ typography: { "font-data": "Inter", "text-sm": "12px" },
159
+ shape: { "radius-sm": "4px", "radius-md": "8px" },
160
+ shadows: { "shadow-sm": "0 1px 2px rgba(0,0,0,0.08)" }
161
+ },
162
+ cssVariables: {
163
+ "--background": "0 0% 100%",
164
+ "--foreground": "222.2 84% 4.9%",
165
+ "--primary": "222.2 47.4% 11.2%",
166
+ "--primary-foreground": "210 40% 98%",
167
+ "--surface": "210 40% 98%",
168
+ "--border": "214.3 31.8% 91.4%"
169
+ },
170
+ dark: { "--background": "222.2 84% 4.9%", "--foreground": "210 40% 98%" }
171
+ },
172
+ null,
173
+ 2
174
+ ),
175
+ scaffold: JSON.stringify(
176
+ {
177
+ version: "1.0",
178
+ generatedBy: "stackwright-pro-scaffold-otter",
179
+ // REQUIRED: appRouterFiles is a required key — NOT 'files' (see swp-k3mb)
180
+ appRouterFiles: [
181
+ "app/layout.tsx",
182
+ "app/_components/page-client.tsx",
183
+ "app/page.tsx",
184
+ "app/[...slug]/page.tsx",
185
+ "app/_components/providers.tsx",
186
+ "app/not-found.tsx"
187
+ ],
188
+ title: "<title from stackwright.yml>",
189
+ hasCollectionEndpoints: false,
190
+ hasAuthConfig: true
191
+ },
192
+ null,
193
+ 2
194
+ ),
195
+ api: JSON.stringify(
196
+ {
197
+ version: "1.0",
198
+ generatedBy: "stackwright-pro-api-otter",
199
+ entities: [
200
+ {
201
+ name: "Shipment",
202
+ endpoint: "/shipments",
203
+ method: "GET",
204
+ revalidate: 60,
205
+ mutationType: null
206
+ }
207
+ ],
208
+ skipped: [
209
+ {
210
+ spec: "ais-message-models.yaml",
211
+ format: "asyncapi",
212
+ reason: "AsyncAPI spec \u2014 WebSocket/event integration required (no REST endpoints)"
213
+ }
214
+ ],
215
+ warnings: [
216
+ "Spec contains external $ref URLs \u2014 recommend bundle: true in stackwright.yml integration config"
217
+ ],
218
+ auth: { type: "bearer", header: "Authorization", envVar: "API_TOKEN" },
219
+ baseUrl: "https://api.example.mil/v2",
220
+ specPath: "./specs/api.yaml"
221
+ },
222
+ null,
223
+ 2
224
+ ),
225
+ data: JSON.stringify(
226
+ {
227
+ version: "1.0",
228
+ generatedBy: "stackwright-pro-data-otter",
229
+ strategy: "<pulse-fast|isr-fast|isr-standard|isr-slow>",
230
+ pulseMode: false,
231
+ collections: [{ name: "equipment", revalidate: 60, pulse: false }],
232
+ endpoints: { included: ["/equipment/**"], excluded: ["/admin/**"] },
233
+ requiredPackages: { dependencies: {}, devPackages: {} }
234
+ },
235
+ null,
236
+ 2
237
+ ),
238
+ geo: JSON.stringify(
239
+ {
240
+ version: "1.0",
241
+ generatedBy: "stackwright-pro-geo-otter",
242
+ geoCollections: [
243
+ {
244
+ collection: "vessels",
245
+ latField: "latitude",
246
+ lngField: "longitude",
247
+ labelField: "vesselName",
248
+ colorField: "navigationStatus"
249
+ }
250
+ ],
251
+ pages: [
252
+ {
253
+ slug: "fleet-tracker",
254
+ type: "<tracker|zone|route|combined>",
255
+ collections: ["vessels"],
256
+ hasLayers: false
257
+ }
258
+ ]
259
+ },
260
+ null,
261
+ 2
262
+ ),
263
+ workflow: JSON.stringify(
264
+ {
265
+ version: "1.0",
266
+ generatedBy: "stackwright-pro-form-wizard-otter",
267
+ // Root key is `workflow` — NOT `workflowConfig` (see swp-k7cl)
268
+ workflow: {
269
+ id: "procurement-approval",
270
+ route: "/procurement",
271
+ files: ["workflows/procurement-approval.yml"],
272
+ serviceDependencies: ["service:workflow-state"],
273
+ warnings: []
274
+ }
275
+ },
276
+ null,
277
+ 2
278
+ ),
279
+ services: JSON.stringify(
280
+ {
281
+ version: "1.0",
282
+ generatedBy: "stackwright-services-otter",
283
+ flows: [
284
+ {
285
+ name: "at-risk-patients",
286
+ trigger: "<http|event|schedule|queue>",
287
+ steps: 3,
288
+ outputSpec: "at-risk-patients.openapi.json"
289
+ }
290
+ ],
291
+ workflows: [
292
+ {
293
+ name: "evacuation-coordination",
294
+ states: 4,
295
+ transitions: 5
296
+ }
297
+ ],
298
+ openApiSpecs: ["at-risk-patients.openapi.json"],
299
+ capabilitiesUsed: ["service.call", "collection.join", "collection.filter"]
300
+ },
301
+ null,
302
+ 2
303
+ ),
304
+ pages: JSON.stringify(
305
+ {
306
+ version: "1.0",
307
+ generatedBy: "stackwright-pro-page-otter",
308
+ pages: [
309
+ {
310
+ slug: "catalog",
311
+ type: "collection_listing",
312
+ collection: "products",
313
+ themeApplied: true,
314
+ authRequired: false
315
+ },
316
+ {
317
+ slug: "admin",
318
+ type: "protected",
319
+ collection: null,
320
+ themeApplied: true,
321
+ authRequired: true
322
+ }
323
+ ]
324
+ },
325
+ null,
326
+ 2
327
+ ),
328
+ dashboard: JSON.stringify(
329
+ {
330
+ version: "1.0",
331
+ generatedBy: "stackwright-pro-dashboard-otter",
332
+ pages: [
333
+ {
334
+ slug: "dashboard",
335
+ layout: "<grid|table|mixed>",
336
+ collections: ["equipment", "supplies"],
337
+ mode: "<ISR|Pulse>"
338
+ }
339
+ ]
340
+ },
341
+ null,
342
+ 2
343
+ ),
344
+ // type: 'pki' = CAC/DoD certificate auth | 'oidc' = enterprise SSO
345
+ // For dev-only mock auth: use type: 'oidc' with devOnly: true (Zod strips devOnly — it's a convention only)
346
+ auth: JSON.stringify(
347
+ {
348
+ version: "1.0",
349
+ generatedBy: "stackwright-pro-auth-otter",
350
+ authConfig: {
351
+ type: "<pki|oidc>",
352
+ // OIDC-only fields (omit for pki):
353
+ provider: "<azure_ad|okta|cognito|auth0|authentik|keycloak|custom>",
354
+ discoveryUrl: "<IdP OIDC discovery URL>",
355
+ clientId: "<OIDC client ID>",
356
+ clientSecret: "<OIDC client secret>",
357
+ rbacRoles: ["ADMIN", "ANALYST"],
358
+ rbacDefaultRole: "ANALYST",
359
+ protectedRoutes: ["/dashboard/:path*", "/procurement/:path*"],
360
+ auditEnabled: true,
361
+ auditRetentionDays: 90
362
+ },
363
+ // devScripts is OPTIONAL — only present when devOnly: true was used
364
+ // Polish otter and foreman MUST check devScripts.written before referencing scripts
365
+ devScripts: {
366
+ written: true,
367
+ scripts: { "dev:admin": "MOCK_USER=admin next dev" }
368
+ }
369
+ },
370
+ null,
371
+ 2
372
+ ),
373
+ polish: JSON.stringify(
374
+ {
375
+ version: "1.0",
376
+ generatedBy: "stackwright-pro-polish-otter",
377
+ landingPage: { slug: "", rewritten: true },
378
+ navigation: { itemCount: 5, items: ["/dashboard", "/equipment", "/workflows"] },
379
+ gettingStarted: "<rewritten|redirected|not-found>",
380
+ scaffoldCleanup: {
381
+ deleted: ["content/posts/getting-started.yaml"],
382
+ rewritten: ["app/not-found.tsx"],
383
+ skipped: []
384
+ }
385
+ },
386
+ null,
387
+ 2
388
+ ),
389
+ qa: JSON.stringify(
390
+ {
391
+ version: "1.0",
392
+ generatedBy: "stackwright-pro-qa-otter",
393
+ // skipped: true path — when dev server is unreachable at audit time
394
+ // skipped: false path — full audit completed
395
+ skipped: false,
396
+ skipReason: null,
397
+ wcagLevel: "<AA|AAA>",
398
+ summary: {
399
+ routesAudited: 3,
400
+ serious: 0,
401
+ moderate: 1,
402
+ minor: 0
403
+ },
404
+ findings: [
405
+ {
406
+ id: "qa-001",
407
+ route: "/dashboard",
408
+ severity: "<serious|moderate|minor>",
409
+ category: "<visual|a11y|design-contract|runtime>",
410
+ finding: "Human-readable description of what was observed",
411
+ evidence: {
412
+ screenshot: ".stackwright/qa/screenshots/dashboard-light.png",
413
+ consoleErrors: [],
414
+ axeViolations: []
415
+ },
416
+ suggested_otters: ["stackwright-pro-theme-otter"],
417
+ suggested_fix: "Specific, concrete next step the repair otter should take"
418
+ }
419
+ ]
420
+ },
421
+ null,
422
+ 2
423
+ )
424
+ };
425
+ export {
426
+ PHASE_ARTIFACT,
427
+ PHASE_ORDER
428
+ };
429
+ //# sourceMappingURL=pipeline-constants.mjs.map