@stackwright-pro/mcp 0.2.0-alpha.72 → 0.2.0-alpha.77
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/integrity.js +5 -5
- package/dist/integrity.js.map +1 -1
- package/dist/integrity.mjs +5 -5
- package/dist/integrity.mjs.map +1 -1
- package/dist/server.js +38 -21
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +38 -21
- package/dist/server.mjs.map +1 -1
- package/package.json +2 -2
package/dist/server.mjs
CHANGED
|
@@ -3036,6 +3036,9 @@ var PHASE_ARTIFACT_SCHEMA = {
|
|
|
3036
3036
|
reason: "AsyncAPI spec \u2014 WebSocket/event integration required (no REST endpoints)"
|
|
3037
3037
|
}
|
|
3038
3038
|
],
|
|
3039
|
+
warnings: [
|
|
3040
|
+
"Spec contains external $ref URLs \u2014 recommend bundle: true in stackwright.yml integration config"
|
|
3041
|
+
],
|
|
3039
3042
|
auth: { type: "bearer", header: "Authorization", envVar: "API_TOKEN" },
|
|
3040
3043
|
baseUrl: "https://api.example.mil/v2",
|
|
3041
3044
|
specPath: "./specs/api.yaml"
|
|
@@ -3907,6 +3910,19 @@ function routesToYaml(routes, defaultRole, indent) {
|
|
|
3907
3910
|
return routes.map((r) => `${indent}- pattern: ${r}
|
|
3908
3911
|
${indent} requiredRole: ${defaultRole}`).join("\n");
|
|
3909
3912
|
}
|
|
3913
|
+
function detectNextMajorVersion(cwd) {
|
|
3914
|
+
try {
|
|
3915
|
+
const pkgPath = join6(cwd, "package.json");
|
|
3916
|
+
if (!existsSync7(pkgPath)) return null;
|
|
3917
|
+
const pkg = JSON.parse(readFileSync6(pkgPath, "utf8"));
|
|
3918
|
+
const nextVersion = pkg.dependencies?.next ?? pkg.devDependencies?.next;
|
|
3919
|
+
if (!nextVersion) return null;
|
|
3920
|
+
const match = nextVersion.match(/(\d+)/);
|
|
3921
|
+
return match ? parseInt(match[1], 10) : null;
|
|
3922
|
+
} catch {
|
|
3923
|
+
return null;
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3910
3926
|
function upsertAuthBlock(existing, authYaml) {
|
|
3911
3927
|
const lines = existing.split("\n");
|
|
3912
3928
|
let authStart = -1;
|
|
@@ -3949,7 +3965,7 @@ function generateMiddlewareContent(method, params, roles, defaultRole, hierarchy
|
|
|
3949
3965
|
// \u26A0\uFE0F SECURITY REVIEW REQUIRED \u2014 CAC/PKI certificate validation
|
|
3950
3966
|
// DoD security officer review required before production deployment.
|
|
3951
3967
|
// Verify: CA bundle completeness, EDIPI lookup endpoint, OCSP accessibility.
|
|
3952
|
-
import { createProMiddleware } from '@stackwright-pro/auth-nextjs';
|
|
3968
|
+
import { createProMiddleware } from '@stackwright-pro/auth-nextjs/edge';
|
|
3953
3969
|
|
|
3954
3970
|
export const middleware = createProMiddleware({
|
|
3955
3971
|
method: 'cac',
|
|
@@ -3971,7 +3987,7 @@ ${configBlock}
|
|
|
3971
3987
|
const scopes2 = params.oidcScopes ?? "openid profile email";
|
|
3972
3988
|
const roleClaim = params.oidcRoleClaim ?? "roles";
|
|
3973
3989
|
return `// middleware.ts \u2014 generated by @stackwright-pro/auth-nextjs
|
|
3974
|
-
import { createProMiddleware } from '@stackwright-pro/auth-nextjs';
|
|
3990
|
+
import { createProMiddleware } from '@stackwright-pro/auth-nextjs/edge';
|
|
3975
3991
|
|
|
3976
3992
|
export const middleware = createProMiddleware({
|
|
3977
3993
|
method: 'oidc',
|
|
@@ -3992,7 +4008,7 @@ ${configBlock}
|
|
|
3992
4008
|
}
|
|
3993
4009
|
const scopes = params.oauth2Scopes ?? "read write";
|
|
3994
4010
|
return `// middleware.ts \u2014 generated by @stackwright-pro/auth-nextjs
|
|
3995
|
-
import { createProMiddleware } from '@stackwright-pro/auth-nextjs';
|
|
4011
|
+
import { createProMiddleware } from '@stackwright-pro/auth-nextjs/edge';
|
|
3996
4012
|
|
|
3997
4013
|
export const middleware = createProMiddleware({
|
|
3998
4014
|
method: 'oauth2',
|
|
@@ -4034,9 +4050,9 @@ function generateProxyContent(method, params, roles, defaultRole, hierarchy, aud
|
|
|
4034
4050
|
// SECURITY REVIEW REQUIRED \u2014 CAC/PKI certificate validation
|
|
4035
4051
|
// DoD security officer review required before production deployment.
|
|
4036
4052
|
// Verify: CA bundle completeness, EDIPI lookup endpoint, OCSP accessibility.
|
|
4037
|
-
import {
|
|
4053
|
+
import { createProProxy } from '@stackwright-pro/auth-nextjs/edge';
|
|
4038
4054
|
|
|
4039
|
-
export const proxy =
|
|
4055
|
+
export const proxy = createProProxy({
|
|
4040
4056
|
method: 'cac',
|
|
4041
4057
|
cac: {
|
|
4042
4058
|
caBundle: process.env.CAC_CA_BUNDLE ?? '${caBundle}',
|
|
@@ -4056,9 +4072,9 @@ ${configBlock}
|
|
|
4056
4072
|
const scopes2 = params.oidcScopes ?? "openid profile email";
|
|
4057
4073
|
const roleClaim = params.oidcRoleClaim ?? "roles";
|
|
4058
4074
|
return `// proxy.ts \u2014 generated by @stackwright-pro/auth (Next.js >=16)
|
|
4059
|
-
import {
|
|
4075
|
+
import { createProProxy } from '@stackwright-pro/auth-nextjs/edge';
|
|
4060
4076
|
|
|
4061
|
-
export const proxy =
|
|
4077
|
+
export const proxy = createProProxy({
|
|
4062
4078
|
method: 'oidc',
|
|
4063
4079
|
oidc: {
|
|
4064
4080
|
discoveryUrl: process.env.OIDC_DISCOVERY_URL!,
|
|
@@ -4077,9 +4093,9 @@ ${configBlock}
|
|
|
4077
4093
|
}
|
|
4078
4094
|
const scopes = params.oauth2Scopes ?? "read write";
|
|
4079
4095
|
return `// proxy.ts \u2014 generated by @stackwright-pro/auth (Next.js >=16)
|
|
4080
|
-
import {
|
|
4096
|
+
import { createProProxy } from '@stackwright-pro/auth-nextjs/edge';
|
|
4081
4097
|
|
|
4082
|
-
export const proxy =
|
|
4098
|
+
export const proxy = createProProxy({
|
|
4083
4099
|
method: 'oauth2',
|
|
4084
4100
|
oauth2: {
|
|
4085
4101
|
authorizationUrl: process.env.OAUTH2_AUTH_URL!,
|
|
@@ -4209,7 +4225,7 @@ function generateDevOnlyMiddlewareContent(method, params, roles, defaultRole, hi
|
|
|
4209
4225
|
"// middleware.ts \u2014 generated by @stackwright-pro/auth-nextjs (dev-only mock)",
|
|
4210
4226
|
"// DEV ONLY \u2014 uses mock authentication from lib/mock-auth.ts",
|
|
4211
4227
|
"// Do NOT deploy to production.",
|
|
4212
|
-
"import { createProMiddleware } from '@stackwright-pro/auth-nextjs';",
|
|
4228
|
+
"import { createProMiddleware } from '@stackwright-pro/auth-nextjs/edge';",
|
|
4213
4229
|
"import { mockAuthProvider } from './lib/mock-auth';"
|
|
4214
4230
|
].join("\n");
|
|
4215
4231
|
if (method === "cac") {
|
|
@@ -4298,7 +4314,7 @@ function generateDevOnlyProxyContent(method, params, roles, defaultRole, hierarc
|
|
|
4298
4314
|
"// proxy.ts -- generated by @stackwright-pro/auth (Next.js >=16, dev-only mock)",
|
|
4299
4315
|
"// DEV ONLY -- uses mock authentication from lib/mock-auth.ts",
|
|
4300
4316
|
"// Do NOT deploy to production.",
|
|
4301
|
-
"import {
|
|
4317
|
+
"import { createProProxy } from '@stackwright-pro/auth-nextjs/edge';",
|
|
4302
4318
|
"import { mockAuthProvider } from './lib/mock-auth';"
|
|
4303
4319
|
].join("\n");
|
|
4304
4320
|
if (method === "cac") {
|
|
@@ -4308,7 +4324,7 @@ function generateDevOnlyProxyContent(method, params, roles, defaultRole, hierarc
|
|
|
4308
4324
|
const certHeader = params.cacCertHeader ?? "X-SSL-Client-Cert";
|
|
4309
4325
|
return `${devHeader}
|
|
4310
4326
|
|
|
4311
|
-
export const proxy =
|
|
4327
|
+
export const proxy = createProProxy({
|
|
4312
4328
|
method: 'cac',
|
|
4313
4329
|
cac: {
|
|
4314
4330
|
caBundle: '${caBundle}',
|
|
@@ -4330,7 +4346,7 @@ ${configBlock}
|
|
|
4330
4346
|
const roleClaim = params.oidcRoleClaim ?? "roles";
|
|
4331
4347
|
return `${devHeader}
|
|
4332
4348
|
|
|
4333
|
-
export const proxy =
|
|
4349
|
+
export const proxy = createProProxy({
|
|
4334
4350
|
method: 'oidc',
|
|
4335
4351
|
oidc: {
|
|
4336
4352
|
discoveryUrl: 'https://dev-mock-oidc/.well-known/openid-configuration',
|
|
@@ -4351,7 +4367,7 @@ ${configBlock}
|
|
|
4351
4367
|
const scopes = params.oauth2Scopes ?? "read write";
|
|
4352
4368
|
return `${devHeader}
|
|
4353
4369
|
|
|
4354
|
-
export const proxy =
|
|
4370
|
+
export const proxy = createProProxy({
|
|
4355
4371
|
method: 'oauth2',
|
|
4356
4372
|
oauth2: {
|
|
4357
4373
|
authorizationUrl: 'https://dev-mock-oauth2/authorize',
|
|
@@ -4514,7 +4530,8 @@ async function configureAuthHandler(params, cwd) {
|
|
|
4514
4530
|
const roles = rbacRoles;
|
|
4515
4531
|
const defaultRole = params.rbacDefaultRole ?? roles[roles.length - 1];
|
|
4516
4532
|
const hierarchy = buildHierarchy(roles);
|
|
4517
|
-
const
|
|
4533
|
+
const detectedVersion = params.nextMajorVersion ?? detectNextMajorVersion(cwd);
|
|
4534
|
+
const useProxy = (detectedVersion ?? 0) >= 16;
|
|
4518
4535
|
const conventionFile = useProxy ? "proxy.ts" : "middleware.ts";
|
|
4519
4536
|
if (method === "none") {
|
|
4520
4537
|
return {
|
|
@@ -4790,11 +4807,11 @@ import { join as join7, basename } from "path";
|
|
|
4790
4807
|
var _checksums = /* @__PURE__ */ new Map([
|
|
4791
4808
|
[
|
|
4792
4809
|
"stackwright-pro-api-otter.json",
|
|
4793
|
-
"
|
|
4810
|
+
"1b9fea59a3e5b1e1015229a4e8d1231b6b87e1d12f23a81ecbbd79fe8657a2e0"
|
|
4794
4811
|
],
|
|
4795
4812
|
[
|
|
4796
4813
|
"stackwright-pro-auth-otter.json",
|
|
4797
|
-
"
|
|
4814
|
+
"f91f82468da9c273fbe6481a3a40957d4c7aa3fa72528c492b6ac5d8e06a563a"
|
|
4798
4815
|
],
|
|
4799
4816
|
[
|
|
4800
4817
|
"stackwright-pro-dashboard-otter.json",
|
|
@@ -4802,7 +4819,7 @@ var _checksums = /* @__PURE__ */ new Map([
|
|
|
4802
4819
|
],
|
|
4803
4820
|
[
|
|
4804
4821
|
"stackwright-pro-data-otter.json",
|
|
4805
|
-
"
|
|
4822
|
+
"f39061981caf0bd14e4eb83e74ac200450425536d14b8c00d60be94759a1ca9d"
|
|
4806
4823
|
],
|
|
4807
4824
|
[
|
|
4808
4825
|
"stackwright-pro-designer-otter.json",
|
|
@@ -4814,7 +4831,7 @@ var _checksums = /* @__PURE__ */ new Map([
|
|
|
4814
4831
|
],
|
|
4815
4832
|
[
|
|
4816
4833
|
"stackwright-pro-foreman-otter.json",
|
|
4817
|
-
"
|
|
4834
|
+
"4948b8189223e4ced81b632cca7d14b79fde85f204483ab8e847182692c4ee57"
|
|
4818
4835
|
],
|
|
4819
4836
|
[
|
|
4820
4837
|
"stackwright-pro-geo-otter.json",
|
|
@@ -4834,7 +4851,7 @@ var _checksums = /* @__PURE__ */ new Map([
|
|
|
4834
4851
|
],
|
|
4835
4852
|
[
|
|
4836
4853
|
"stackwright-pro-workflow-otter.json",
|
|
4837
|
-
"
|
|
4854
|
+
"40fc897c01aadc688159e1837c7e34d6cfae1f0be55a5bc8d36d540475c9ded0"
|
|
4838
4855
|
],
|
|
4839
4856
|
[
|
|
4840
4857
|
"stackwright-services-otter.json",
|
|
@@ -5995,7 +6012,7 @@ var package_default = {
|
|
|
5995
6012
|
"test:coverage": "vitest run --coverage"
|
|
5996
6013
|
},
|
|
5997
6014
|
name: "@stackwright-pro/mcp",
|
|
5998
|
-
version: "0.2.0-alpha.
|
|
6015
|
+
version: "0.2.0-alpha.77",
|
|
5999
6016
|
description: "MCP tools for Stackwright Pro - Data Explorer, Security, ISR, and Dashboard generation",
|
|
6000
6017
|
license: "SEE LICENSE IN LICENSE",
|
|
6001
6018
|
main: "./dist/server.js",
|