@wowok/agent-mcp 2.5.0 → 2.5.2

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.
@@ -356,6 +356,21 @@
356
356
  "next_step": {
357
357
  "type": "string"
358
358
  },
359
+ "recommended_creation_order": {
360
+ "type": "array",
361
+ "items": {
362
+ "type": "string"
363
+ },
364
+ "description": "Recommended object creation order based on dependency topology (e.g. ['permission','progress','guard','allocation','machine','service'])."
365
+ },
366
+ "next_action": {
367
+ "type": "string",
368
+ "enum": [
369
+ "aggregate_risks",
370
+ "none"
371
+ ],
372
+ "description": "Next project_operation action to call. 'aggregate_risks' when puzzles are complete enough; 'none' if user must fill missing fields first."
373
+ },
359
374
  "warnings": {
360
375
  "type": "array",
361
376
  "items": {
@@ -369,6 +384,8 @@
369
384
  "puzzles",
370
385
  "overall_completeness",
371
386
  "next_step",
387
+ "recommended_creation_order",
388
+ "next_action",
372
389
  "warnings"
373
390
  ],
374
391
  "additionalProperties": false
@@ -521,6 +538,48 @@
521
538
  "additionalProperties": false
522
539
  }
523
540
  },
541
+ "fix_suggestions_grouped": {
542
+ "type": "object",
543
+ "additionalProperties": {
544
+ "type": "array",
545
+ "items": {
546
+ "type": "object",
547
+ "properties": {
548
+ "risk_rule_id": {
549
+ "type": "string"
550
+ },
551
+ "severity": {
552
+ "type": "string",
553
+ "enum": [
554
+ "CRITICAL",
555
+ "HIGH",
556
+ "MEDIUM",
557
+ "LOW",
558
+ "INFO"
559
+ ]
560
+ },
561
+ "message": {
562
+ "type": "string"
563
+ },
564
+ "fix_suggestion": {
565
+ "type": "string"
566
+ },
567
+ "entry_id": {
568
+ "type": "string"
569
+ }
570
+ },
571
+ "required": [
572
+ "risk_rule_id",
573
+ "severity",
574
+ "message",
575
+ "fix_suggestion",
576
+ "entry_id"
577
+ ],
578
+ "additionalProperties": false
579
+ }
580
+ },
581
+ "description": "Fix suggestions grouped by object_type for better readability."
582
+ },
524
583
  "calibrated_at": {
525
584
  "type": "integer"
526
585
  },
@@ -534,6 +593,15 @@
534
593
  "type": "boolean",
535
594
  "description": "Whether the user can proceed to the next stage. False only when CRITICAL risks exist."
536
595
  },
596
+ "next_action": {
597
+ "type": "string",
598
+ "enum": [
599
+ "generate_deployment_doc",
600
+ "fix_risks",
601
+ "none"
602
+ ],
603
+ "description": "Next project_operation action. 'generate_deployment_doc' when can_proceed=true; 'fix_risks' when CRITICAL risks exist; 'none' for other cases."
604
+ },
537
605
  "user_action_required": {
538
606
  "type": "string",
539
607
  "description": "Human-readable next-step guidance."
@@ -548,6 +616,7 @@
548
616
  "calibrated_at",
549
617
  "warnings",
550
618
  "can_proceed",
619
+ "next_action",
551
620
  "user_action_required"
552
621
  ],
553
622
  "additionalProperties": false
@@ -644,10 +713,66 @@
644
713
  "additionalProperties": false,
645
714
  "description": "Scanner validation result. Present when run_scanner=true."
646
715
  },
716
+ "estimated_gas": {
717
+ "type": "object",
718
+ "properties": {
719
+ "total_gas_mist": {
720
+ "type": "integer",
721
+ "description": "Estimated total gas in MIST (1 WOW = 10^9 MIST)."
722
+ },
723
+ "per_object": {
724
+ "type": "array",
725
+ "items": {
726
+ "type": "object",
727
+ "properties": {
728
+ "entry_id": {
729
+ "type": "string"
730
+ },
731
+ "object_type": {
732
+ "type": "string"
733
+ },
734
+ "create_gas_mist": {
735
+ "type": "integer"
736
+ },
737
+ "publish_gas_mist": {
738
+ "type": "integer"
739
+ }
740
+ },
741
+ "required": [
742
+ "entry_id",
743
+ "object_type",
744
+ "create_gas_mist",
745
+ "publish_gas_mist"
746
+ ],
747
+ "additionalProperties": false
748
+ }
749
+ },
750
+ "publish_gas_mist": {
751
+ "type": "integer",
752
+ "description": "Gas for publish operations only."
753
+ }
754
+ },
755
+ "required": [
756
+ "total_gas_mist",
757
+ "per_object",
758
+ "publish_gas_mist"
759
+ ],
760
+ "additionalProperties": false,
761
+ "description": "Gas cost estimate for deploying all objects."
762
+ },
647
763
  "can_proceed": {
648
764
  "type": "boolean",
649
765
  "description": "Whether the user can proceed to stage 5. False when D-errors exist."
650
766
  },
767
+ "next_action": {
768
+ "type": "string",
769
+ "enum": [
770
+ "trace_substeps",
771
+ "fix_doc_errors",
772
+ "none"
773
+ ],
774
+ "description": "Next project_operation action. 'trace_substeps' when can_proceed=true; 'fix_doc_errors' when D-errors exist; 'none' for other cases."
775
+ },
651
776
  "user_action_required": {
652
777
  "type": "string"
653
778
  }
@@ -657,6 +782,7 @@
657
782
  "markdown",
658
783
  "meta",
659
784
  "can_proceed",
785
+ "next_action",
660
786
  "user_action_required"
661
787
  ],
662
788
  "additionalProperties": false
@@ -863,6 +989,15 @@
863
989
  "type": "boolean",
864
990
  "description": "Whether deployment can complete. False when D-10 fails or substeps FAILED."
865
991
  },
992
+ "next_action": {
993
+ "type": "string",
994
+ "enum": [
995
+ "deploy",
996
+ "fix_substeps",
997
+ "none"
998
+ ],
999
+ "description": "Next action. 'deploy' when can_proceed=true (execute substeps via onchain_operations); 'fix_substeps' when issues exist; 'none' when done."
1000
+ },
866
1001
  "user_action_required": {
867
1002
  "type": "string"
868
1003
  }
@@ -880,9 +1015,70 @@
880
1015
  "topological_order",
881
1016
  "d10_check",
882
1017
  "can_proceed",
1018
+ "next_action",
883
1019
  "user_action_required"
884
1020
  ],
885
1021
  "additionalProperties": false
1022
+ },
1023
+ {
1024
+ "type": "object",
1025
+ "properties": {
1026
+ "action": {
1027
+ "type": "string",
1028
+ "const": "get_project_status"
1029
+ },
1030
+ "project": {
1031
+ "type": "string"
1032
+ },
1033
+ "version": {
1034
+ "type": "string"
1035
+ },
1036
+ "stage": {
1037
+ "type": "integer",
1038
+ "minimum": 1,
1039
+ "maximum": 5
1040
+ },
1041
+ "stage_name": {
1042
+ "type": "string"
1043
+ },
1044
+ "stage_description": {
1045
+ "type": "string"
1046
+ },
1047
+ "next_action": {
1048
+ "type": "string",
1049
+ "description": "The next project_operation action to call."
1050
+ },
1051
+ "can_proceed": {
1052
+ "type": "boolean"
1053
+ },
1054
+ "last_updated": {
1055
+ "type": "integer",
1056
+ "description": "Timestamp of last stage update (ms)."
1057
+ },
1058
+ "risk_status": {
1059
+ "type": "string"
1060
+ },
1061
+ "risk_can_proceed": {
1062
+ "type": "boolean"
1063
+ },
1064
+ "doc_generated": {
1065
+ "type": "boolean"
1066
+ },
1067
+ "trace_coherent": {
1068
+ "type": "boolean"
1069
+ }
1070
+ },
1071
+ "required": [
1072
+ "action",
1073
+ "project",
1074
+ "version",
1075
+ "stage",
1076
+ "stage_name",
1077
+ "stage_description",
1078
+ "next_action",
1079
+ "can_proceed"
1080
+ ],
1081
+ "additionalProperties": false
886
1082
  }
887
1083
  ],
888
1084
  "description": "Query result — shape depends on action"
@@ -24,9 +24,10 @@
24
24
  "analyze_intent",
25
25
  "aggregate_risks",
26
26
  "generate_deployment_doc",
27
- "trace_substeps"
27
+ "trace_substeps",
28
+ "get_project_status"
28
29
  ],
29
- "description": "Query/action to perform"
30
+ "description": "Action to perform. Two categories:\n1. Graph Query (10): list_projects, list_objects, shareable, dependencies, referenced_by, pre_publish_check, cross_project_refs, graph_stats, save_graph, load_graph.\n2. Project-Based Deployment 5-Stage (4): Call IN ORDER — analyze_intent (Stage 2) → aggregate_risks (Stage 3) → generate_deployment_doc (Stage 4) → trace_substeps (Stage 5). Each action's output includes `next_action` telling you which action to call next. Stage 1 (Project Naming) uses the `project` + `version` params."
30
31
  },
31
32
  "project": {
32
33
  "type": "string",
@@ -1,7 +1,7 @@
1
- import { queryProjects, queryProjectObjects, queryShareableObjects, queryDependencies, queryReferencedBy, queryPrePublishCheck, queryCrossProjectReferences, queryGraphStats, saveGraph, loadGraph, } from "../../project/index.js";
1
+ import { queryProjects, queryProjectObjects, queryShareableObjects, queryDependencies, queryReferencedBy, queryPrePublishCheck, queryCrossProjectReferences, queryGraphStats, saveGraph, loadGraph, updateStageCache, getProjectStatus, } from "../../project/index.js";
2
2
  import { analyzeBusinessIntent } from "../../project/business-puzzle.js";
3
3
  import { aggregateProjectRisks } from "../../project/risk-aggregator.js";
4
- import { generateDeploymentDoc, validateDeploymentDoc, } from "../../project/deployment-doc.js";
4
+ import { generateDeploymentDoc, validateDeploymentDoc, estimateDeploymentGas, } from "../../project/deployment-doc.js";
5
5
  import { traceSubsteps } from "../../project/substep-trace.js";
6
6
  import { strictParse } from "../../schema/index.js";
7
7
  import { ProjectOperationInputSchema } from "../../schema/project/index.js";
@@ -87,12 +87,20 @@ async function handleAnalyzeIntent(validated) {
87
87
  catch {
88
88
  experienceFeedback = undefined;
89
89
  }
90
+ updateStageCache(prefix, version, {
91
+ stage: 2,
92
+ puzzles: result.puzzles,
93
+ business_intent: userIntent,
94
+ industry,
95
+ });
90
96
  return {
91
97
  action: "analyze_intent",
92
98
  intent_parsed: result.intent_parsed,
93
99
  puzzles: result.puzzles,
94
100
  overall_completeness: result.overall_completeness,
95
101
  next_step: result.next_step,
102
+ recommended_creation_order: result.recommended_creation_order,
103
+ next_action: result.overall_completeness === "complete" ? "aggregate_risks" : "none",
96
104
  warnings: result.warnings,
97
105
  evolution_context: evolutionContext,
98
106
  experience_feedback: experienceFeedback,
@@ -111,6 +119,11 @@ async function handleAggregateRisks(validated) {
111
119
  });
112
120
  const hasCritical = result.severity_summary.CRITICAL > 0;
113
121
  const unconfirmedHigh = result.findings.filter((r) => r.severity === "HIGH").length;
122
+ updateStageCache(prefix, version, {
123
+ stage: 3,
124
+ risk_status: result.status,
125
+ risk_can_proceed: !hasCritical,
126
+ });
114
127
  return {
115
128
  action: "aggregate_risks",
116
129
  namespace: result.namespace,
@@ -118,9 +131,11 @@ async function handleAggregateRisks(validated) {
118
131
  severity_summary: result.severity_summary,
119
132
  status: result.status,
120
133
  pending_confirmations: result.pending_confirmations,
134
+ fix_suggestions_grouped: result.fix_suggestions_grouped,
121
135
  calibrated_at: result.calibrated_at,
122
136
  warnings: result.warnings,
123
137
  can_proceed: !hasCritical,
138
+ next_action: hasCritical ? "fix_risks" : "generate_deployment_doc",
124
139
  user_action_required: hasCritical
125
140
  ? `Fix ${result.severity_summary.CRITICAL} CRITICAL risk(s) before proceeding`
126
141
  : unconfirmedHigh > 0
@@ -163,6 +178,12 @@ async function handleGenerateDeploymentDoc(validated) {
163
178
  const warningCount = validationResult
164
179
  ? validationResult.checks.filter((c) => c.status === "WARN").length
165
180
  : 0;
181
+ const gasEstimate = estimateDeploymentGas({ objects: required.objects });
182
+ updateStageCache(prefix, version, {
183
+ stage: 4,
184
+ doc_generated: true,
185
+ doc_error_count: errorCount,
186
+ });
166
187
  return {
167
188
  action: "generate_deployment_doc",
168
189
  markdown,
@@ -174,7 +195,9 @@ async function handleGenerateDeploymentDoc(validated) {
174
195
  step_count: required.steps.length,
175
196
  },
176
197
  validation: validationResult,
198
+ estimated_gas: gasEstimate,
177
199
  can_proceed: errorCount === 0,
200
+ next_action: errorCount === 0 ? "trace_substeps" : "fix_doc_errors",
178
201
  user_action_required: errorCount > 0
179
202
  ? `Fix ${errorCount} D-error(s) before deploying`
180
203
  : warningCount > 0
@@ -193,6 +216,11 @@ async function handleTraceSubsteps(validated) {
193
216
  });
194
217
  const hasFailedSubstep = substeps.some((s) => s.status === "FAILED");
195
218
  const canProceed = result.coherent && !hasFailedSubstep;
219
+ updateStageCache(prefix, version, {
220
+ stage: 5,
221
+ trace_coherent: result.coherent,
222
+ trace_can_proceed: canProceed,
223
+ });
196
224
  const issueParts = [];
197
225
  if (result.dangling_inputs.length > 0) {
198
226
  issueParts.push(`${result.dangling_inputs.length} dangling inputs`);
@@ -223,6 +251,7 @@ async function handleTraceSubsteps(validated) {
223
251
  topological_order: result.topological_order,
224
252
  d10_check: result.d10_check,
225
253
  can_proceed: canProceed,
254
+ next_action: canProceed ? "deploy" : "fix_substeps",
226
255
  user_action_required: issueParts.length > 0
227
256
  ? `Fix: ${issueParts.join(", ")}`
228
257
  : "All substeps passed. Deployment complete.",
@@ -283,6 +312,26 @@ export async function handleProjectOperation(args) {
283
312
  case "trace_substeps":
284
313
  result = await handleTraceSubsteps(validated);
285
314
  break;
315
+ case "get_project_status": {
316
+ const { prefix: gpPrefix, version: gpVersion } = requireProject(validated);
317
+ const status = getProjectStatus(gpPrefix, gpVersion);
318
+ result = {
319
+ action: "get_project_status",
320
+ project: gpPrefix,
321
+ version: gpVersion,
322
+ stage: status.stage,
323
+ stage_name: status.stage_name,
324
+ stage_description: status.stage_description,
325
+ next_action: status.next_action,
326
+ can_proceed: status.can_proceed,
327
+ last_updated: status.details?.updated_at,
328
+ risk_status: status.details?.risk_status,
329
+ risk_can_proceed: status.details?.risk_can_proceed,
330
+ doc_generated: status.details?.doc_generated,
331
+ trace_coherent: status.details?.trace_coherent,
332
+ };
333
+ break;
334
+ }
286
335
  default:
287
336
  throw new Error(`Unknown project_operation action: ${String(action)}`);
288
337
  }