@stackwright-pro/mcp 0.2.0-alpha.53 → 0.2.0-alpha.58
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 +17 -5
- package/dist/integrity.js.map +1 -1
- package/dist/integrity.mjs +17 -5
- package/dist/integrity.mjs.map +1 -1
- package/dist/server.js +161 -18
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +161 -18
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
package/dist/server.mjs
CHANGED
|
@@ -1590,7 +1590,9 @@ var OTTER_NAME_TO_PHASE = [
|
|
|
1590
1590
|
["dashboard", "dashboard"],
|
|
1591
1591
|
["data", "data"],
|
|
1592
1592
|
["page", "pages"],
|
|
1593
|
-
["workflow", "workflow"]
|
|
1593
|
+
["workflow", "workflow"],
|
|
1594
|
+
["polish", "polish"],
|
|
1595
|
+
["geo", "geo"]
|
|
1594
1596
|
];
|
|
1595
1597
|
var PHASE_TO_OTTER = {
|
|
1596
1598
|
designer: "stackwright-pro-designer-otter",
|
|
@@ -1600,7 +1602,9 @@ var PHASE_TO_OTTER = {
|
|
|
1600
1602
|
pages: "stackwright-pro-page-otter",
|
|
1601
1603
|
dashboard: "stackwright-pro-dashboard-otter",
|
|
1602
1604
|
data: "stackwright-pro-data-otter",
|
|
1603
|
-
workflow: "stackwright-pro-workflow-otter"
|
|
1605
|
+
workflow: "stackwright-pro-workflow-otter",
|
|
1606
|
+
polish: "stackwright-pro-polish-otter",
|
|
1607
|
+
geo: "stackwright-pro-geo-otter"
|
|
1604
1608
|
};
|
|
1605
1609
|
function detectPhase(otterName) {
|
|
1606
1610
|
const lower = otterName.toLowerCase();
|
|
@@ -2252,26 +2256,41 @@ var PHASE_ORDER = [
|
|
|
2252
2256
|
"theme",
|
|
2253
2257
|
"api",
|
|
2254
2258
|
"data",
|
|
2259
|
+
"geo",
|
|
2255
2260
|
"workflow",
|
|
2261
|
+
"services",
|
|
2256
2262
|
"pages",
|
|
2257
2263
|
"dashboard",
|
|
2258
|
-
"auth"
|
|
2264
|
+
"auth",
|
|
2265
|
+
"polish"
|
|
2259
2266
|
];
|
|
2260
2267
|
var PHASE_DEPENDENCIES = {
|
|
2261
2268
|
designer: [],
|
|
2262
2269
|
theme: ["designer"],
|
|
2263
2270
|
api: [],
|
|
2264
2271
|
data: ["api"],
|
|
2272
|
+
geo: ["data"],
|
|
2265
2273
|
// workflow: no hard deps — uses service: references with Prism mock fallback
|
|
2266
2274
|
// when API artifacts aren't available; roles come from user answers
|
|
2267
2275
|
workflow: [],
|
|
2268
|
-
//
|
|
2276
|
+
// services: needs API endpoints to know what to wire, and optionally
|
|
2277
|
+
// workflow states as trigger sources. Produces OpenAPI specs consumed
|
|
2278
|
+
// by pages and dashboard for typed data wiring.
|
|
2279
|
+
services: ["api", "workflow"],
|
|
2280
|
+
// pages/dashboard: now also depend on services for typed endpoint wiring
|
|
2281
|
+
// via the OpenAPI specs that services produces.
|
|
2282
|
+
// 'api' is still transitive through 'data'; auth removed — page-otter has
|
|
2269
2283
|
// graceful fallback and reads role names from workflow artifacts instead
|
|
2270
|
-
pages: ["designer", "theme", "data"],
|
|
2271
|
-
dashboard: ["designer", "theme", "data"],
|
|
2272
|
-
// auth is the
|
|
2273
|
-
//
|
|
2274
|
-
|
|
2284
|
+
pages: ["designer", "theme", "data", "services"],
|
|
2285
|
+
dashboard: ["designer", "theme", "data", "services"],
|
|
2286
|
+
// auth is the penultimate phase — runs after all content-producing phases
|
|
2287
|
+
// so it can read pages, dashboard, workflow, and geo artifacts for route
|
|
2288
|
+
// protection and RBAC wiring. Skipped upstream phases still satisfy deps
|
|
2289
|
+
// (the foreman marks them executed=true), so auth always runs.
|
|
2290
|
+
auth: ["pages", "dashboard", "workflow", "geo"],
|
|
2291
|
+
// polish is the terminal phase — runs after auth so the landing page and
|
|
2292
|
+
// nav reflect the final set of protected routes and all generated pages.
|
|
2293
|
+
polish: ["auth"]
|
|
2275
2294
|
};
|
|
2276
2295
|
var PHASE_ARTIFACT = {
|
|
2277
2296
|
designer: "design-language.json",
|
|
@@ -2281,7 +2300,10 @@ var PHASE_ARTIFACT = {
|
|
|
2281
2300
|
data: "data-config.json",
|
|
2282
2301
|
pages: "pages-manifest.json",
|
|
2283
2302
|
dashboard: "dashboard-manifest.json",
|
|
2284
|
-
workflow: "workflow-config.json"
|
|
2303
|
+
workflow: "workflow-config.json",
|
|
2304
|
+
services: "services-config.json",
|
|
2305
|
+
polish: "polish-manifest.json",
|
|
2306
|
+
geo: "geo-manifest.json"
|
|
2285
2307
|
};
|
|
2286
2308
|
var PHASE_TO_OTTER2 = {
|
|
2287
2309
|
designer: "stackwright-pro-designer-otter",
|
|
@@ -2291,7 +2313,10 @@ var PHASE_TO_OTTER2 = {
|
|
|
2291
2313
|
data: "stackwright-pro-data-otter",
|
|
2292
2314
|
pages: "stackwright-pro-page-otter",
|
|
2293
2315
|
dashboard: "stackwright-pro-dashboard-otter",
|
|
2294
|
-
workflow: "stackwright-pro-workflow-otter"
|
|
2316
|
+
workflow: "stackwright-pro-workflow-otter",
|
|
2317
|
+
services: "stackwright-services-otter",
|
|
2318
|
+
polish: "stackwright-pro-polish-otter",
|
|
2319
|
+
geo: "stackwright-pro-geo-otter"
|
|
2295
2320
|
};
|
|
2296
2321
|
function isValidPhase(phase) {
|
|
2297
2322
|
return PHASE_ORDER.includes(phase);
|
|
@@ -2504,6 +2529,42 @@ function handleCheckExecutionReady(_cwd, phase) {
|
|
|
2504
2529
|
return { text: JSON.stringify({ error: true, message: String(err) }), isError: true };
|
|
2505
2530
|
}
|
|
2506
2531
|
}
|
|
2532
|
+
function handleGetReadyPhases(_cwd) {
|
|
2533
|
+
const cwd = _cwd ?? process.cwd();
|
|
2534
|
+
try {
|
|
2535
|
+
const state = readState(cwd);
|
|
2536
|
+
const completed = [];
|
|
2537
|
+
const ready = [];
|
|
2538
|
+
const blocked = [];
|
|
2539
|
+
for (const phase of PHASE_ORDER) {
|
|
2540
|
+
const ps = state.phases[phase];
|
|
2541
|
+
if (ps?.executed) {
|
|
2542
|
+
completed.push(phase);
|
|
2543
|
+
continue;
|
|
2544
|
+
}
|
|
2545
|
+
const deps = PHASE_DEPENDENCIES[phase];
|
|
2546
|
+
const unmetDeps = deps.filter((dep) => !state.phases[dep]?.executed);
|
|
2547
|
+
if (unmetDeps.length === 0) {
|
|
2548
|
+
ready.push(phase);
|
|
2549
|
+
} else {
|
|
2550
|
+
blocked.push(phase);
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
return {
|
|
2554
|
+
text: JSON.stringify({
|
|
2555
|
+
readyPhases: ready,
|
|
2556
|
+
completedPhases: completed,
|
|
2557
|
+
blockedPhases: blocked,
|
|
2558
|
+
waveSize: ready.length,
|
|
2559
|
+
allComplete: ready.length === 0 && blocked.length === 0
|
|
2560
|
+
}),
|
|
2561
|
+
isError: false
|
|
2562
|
+
};
|
|
2563
|
+
} catch (err) {
|
|
2564
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
2565
|
+
return { text: JSON.stringify({ error: true, message }), isError: true };
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2507
2568
|
function handleListArtifacts(_cwd) {
|
|
2508
2569
|
const cwd = _cwd ?? process.cwd();
|
|
2509
2570
|
try {
|
|
@@ -2745,7 +2806,10 @@ var PHASE_REQUIRED_KEYS = {
|
|
|
2745
2806
|
data: ["version", "generatedBy", "strategy", "collections"],
|
|
2746
2807
|
pages: ["version", "generatedBy"],
|
|
2747
2808
|
dashboard: ["version", "generatedBy"],
|
|
2748
|
-
workflow: ["version", "generatedBy"]
|
|
2809
|
+
workflow: ["version", "generatedBy"],
|
|
2810
|
+
services: ["version", "generatedBy", "flows"],
|
|
2811
|
+
polish: ["version", "generatedBy"],
|
|
2812
|
+
geo: ["version", "generatedBy", "geoCollections"]
|
|
2749
2813
|
};
|
|
2750
2814
|
var PHASE_ARTIFACT_SCHEMA = {
|
|
2751
2815
|
designer: JSON.stringify(
|
|
@@ -2855,6 +2919,31 @@ var PHASE_ARTIFACT_SCHEMA = {
|
|
|
2855
2919
|
null,
|
|
2856
2920
|
2
|
|
2857
2921
|
),
|
|
2922
|
+
geo: JSON.stringify(
|
|
2923
|
+
{
|
|
2924
|
+
version: "1.0",
|
|
2925
|
+
generatedBy: "stackwright-pro-geo-otter",
|
|
2926
|
+
geoCollections: [
|
|
2927
|
+
{
|
|
2928
|
+
collection: "vessels",
|
|
2929
|
+
latField: "latitude",
|
|
2930
|
+
lngField: "longitude",
|
|
2931
|
+
labelField: "vesselName",
|
|
2932
|
+
colorField: "navigationStatus"
|
|
2933
|
+
}
|
|
2934
|
+
],
|
|
2935
|
+
pages: [
|
|
2936
|
+
{
|
|
2937
|
+
slug: "fleet-tracker",
|
|
2938
|
+
type: "<tracker|zone|route|combined>",
|
|
2939
|
+
collections: ["vessels"],
|
|
2940
|
+
hasLayers: false
|
|
2941
|
+
}
|
|
2942
|
+
]
|
|
2943
|
+
},
|
|
2944
|
+
null,
|
|
2945
|
+
2
|
|
2946
|
+
),
|
|
2858
2947
|
workflow: JSON.stringify(
|
|
2859
2948
|
{
|
|
2860
2949
|
version: "1.0",
|
|
@@ -2870,6 +2959,31 @@ var PHASE_ARTIFACT_SCHEMA = {
|
|
|
2870
2959
|
null,
|
|
2871
2960
|
2
|
|
2872
2961
|
),
|
|
2962
|
+
services: JSON.stringify(
|
|
2963
|
+
{
|
|
2964
|
+
version: "1.0",
|
|
2965
|
+
generatedBy: "stackwright-services-otter",
|
|
2966
|
+
flows: [
|
|
2967
|
+
{
|
|
2968
|
+
name: "at-risk-patients",
|
|
2969
|
+
trigger: "<http|event|schedule|queue>",
|
|
2970
|
+
steps: 3,
|
|
2971
|
+
outputSpec: "at-risk-patients.openapi.json"
|
|
2972
|
+
}
|
|
2973
|
+
],
|
|
2974
|
+
workflows: [
|
|
2975
|
+
{
|
|
2976
|
+
name: "evacuation-coordination",
|
|
2977
|
+
states: 4,
|
|
2978
|
+
transitions: 5
|
|
2979
|
+
}
|
|
2980
|
+
],
|
|
2981
|
+
openApiSpecs: ["at-risk-patients.openapi.json"],
|
|
2982
|
+
capabilitiesUsed: ["service.call", "collection.join", "collection.filter"]
|
|
2983
|
+
},
|
|
2984
|
+
null,
|
|
2985
|
+
2
|
|
2986
|
+
),
|
|
2873
2987
|
pages: JSON.stringify(
|
|
2874
2988
|
{
|
|
2875
2989
|
version: "1.0",
|
|
@@ -2926,6 +3040,17 @@ var PHASE_ARTIFACT_SCHEMA = {
|
|
|
2926
3040
|
},
|
|
2927
3041
|
null,
|
|
2928
3042
|
2
|
|
3043
|
+
),
|
|
3044
|
+
polish: JSON.stringify(
|
|
3045
|
+
{
|
|
3046
|
+
version: "1.0",
|
|
3047
|
+
generatedBy: "stackwright-pro-polish-otter",
|
|
3048
|
+
landingPage: { slug: "", rewritten: true },
|
|
3049
|
+
navigation: { itemCount: 5, items: ["/dashboard", "/equipment", "/workflows"] },
|
|
3050
|
+
gettingStarted: "<rewritten|redirected|not-found>"
|
|
3051
|
+
},
|
|
3052
|
+
null,
|
|
3053
|
+
2
|
|
2929
3054
|
)
|
|
2930
3055
|
};
|
|
2931
3056
|
function handleValidateArtifact(input) {
|
|
@@ -3099,6 +3224,12 @@ function registerPipelineTools(server2) {
|
|
|
3099
3224
|
},
|
|
3100
3225
|
async ({ phase }) => res(handleCheckExecutionReady(void 0, phase))
|
|
3101
3226
|
);
|
|
3227
|
+
server2.tool(
|
|
3228
|
+
"stackwright_pro_get_ready_phases",
|
|
3229
|
+
`Return phases whose dependencies are all satisfied (executed=true). Use to determine which phases can run next \u2014 enables wave-based execution. ${DESC}`,
|
|
3230
|
+
{},
|
|
3231
|
+
async () => res(handleGetReadyPhases())
|
|
3232
|
+
);
|
|
3102
3233
|
server2.tool(
|
|
3103
3234
|
"stackwright_pro_list_artifacts",
|
|
3104
3235
|
`List phase artifacts in .stackwright/artifacts/ with completedCount/totalCount. ${DESC}`,
|
|
@@ -3866,11 +3997,11 @@ var _checksums = /* @__PURE__ */ new Map([
|
|
|
3866
3997
|
],
|
|
3867
3998
|
[
|
|
3868
3999
|
"stackwright-pro-dashboard-otter.json",
|
|
3869
|
-
"
|
|
4000
|
+
"f5a83b74ad7c44edc6f39b45a568fa122d82aa4788f741ce14614da56d4e29a4"
|
|
3870
4001
|
],
|
|
3871
4002
|
[
|
|
3872
4003
|
"stackwright-pro-data-otter.json",
|
|
3873
|
-
"
|
|
4004
|
+
"c406e1c775bcb1f2b038b40a92d9bd23172b40d774fc0fa50bad4c9714f53445"
|
|
3874
4005
|
],
|
|
3875
4006
|
[
|
|
3876
4007
|
"stackwright-pro-designer-otter.json",
|
|
@@ -3878,19 +4009,31 @@ var _checksums = /* @__PURE__ */ new Map([
|
|
|
3878
4009
|
],
|
|
3879
4010
|
[
|
|
3880
4011
|
"stackwright-pro-foreman-otter.json",
|
|
3881
|
-
"
|
|
4012
|
+
"247765094c110aa342a6d7312e49fc189089bdd2b013af98cfef43a0816ac7bf"
|
|
4013
|
+
],
|
|
4014
|
+
[
|
|
4015
|
+
"stackwright-pro-geo-otter.json",
|
|
4016
|
+
"6eb7ecf97254dbd79c09ad24348bf16001423cce9585c14bef81afd67b7b901b"
|
|
3882
4017
|
],
|
|
3883
4018
|
[
|
|
3884
4019
|
"stackwright-pro-page-otter.json",
|
|
3885
|
-
"
|
|
4020
|
+
"9a5672f0758c81539337d86955e2892cd412547b4f111c2aa098eed1e62d7626"
|
|
4021
|
+
],
|
|
4022
|
+
[
|
|
4023
|
+
"stackwright-pro-polish-otter.json",
|
|
4024
|
+
"d31116995fdb417798af6056efd03bb1c71e0891371aba1774d283c03c9d77e8"
|
|
3886
4025
|
],
|
|
3887
4026
|
[
|
|
3888
4027
|
"stackwright-pro-theme-otter.json",
|
|
3889
|
-
"
|
|
4028
|
+
"08bb04009fdfb8743b10ac4d503cbaddaf8d7c804ba9b606aaed9cc516fd8e93"
|
|
3890
4029
|
],
|
|
3891
4030
|
[
|
|
3892
4031
|
"stackwright-pro-workflow-otter.json",
|
|
3893
4032
|
"c90d6773b2287aa9a640c2715ca0e75f44c13e99fddcfb89ced36603f38930ce"
|
|
4033
|
+
],
|
|
4034
|
+
[
|
|
4035
|
+
"stackwright-services-otter.json",
|
|
4036
|
+
"2a99df3e50415d027c0bc2a57f509882928bb1ae516e61dda667641ce1652ac3"
|
|
3894
4037
|
]
|
|
3895
4038
|
]);
|
|
3896
4039
|
Object.freeze(_checksums);
|
|
@@ -4623,7 +4766,7 @@ var package_default = {
|
|
|
4623
4766
|
"test:coverage": "vitest run --coverage"
|
|
4624
4767
|
},
|
|
4625
4768
|
name: "@stackwright-pro/mcp",
|
|
4626
|
-
version: "0.2.0-alpha.
|
|
4769
|
+
version: "0.2.0-alpha.58",
|
|
4627
4770
|
description: "MCP tools for Stackwright Pro - Data Explorer, Security, ISR, and Dashboard generation",
|
|
4628
4771
|
license: "SEE LICENSE IN LICENSE",
|
|
4629
4772
|
main: "./dist/server.js",
|