@stackwright-pro/mcp 0.2.0-alpha.92 → 0.2.0-alpha.97

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