@wowok/agent-mcp 2.5.1 → 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.
- package/dist/knowledge/mcp-schema-audit.js +3 -2
- package/dist/project/business-puzzle.d.ts +1 -0
- package/dist/project/business-puzzle.js +11 -0
- package/dist/project/deployment-doc.d.ts +11 -0
- package/dist/project/deployment-doc.js +37 -0
- package/dist/project/index.d.ts +25 -0
- package/dist/project/index.js +42 -0
- package/dist/project/risk-aggregator.d.ts +7 -0
- package/dist/project/risk-aggregator.js +15 -0
- package/dist/schema/call/base.js +2 -2
- package/dist/schema/project/index.d.ts +203 -3
- package/dist/schema/project/index.js +45 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +0 -577
- package/dist/schemas/project_operation.output.json +157 -0
- package/dist/schemas/project_operation.schema.json +2 -1
- package/dist/tools/handlers/project.js +47 -2
- package/dist/tools/index.js +346 -37
- package/dist/tools/wrap.js +61 -7
- package/package.json +1 -1
- package/dist/schemas/onchain_operations.output.json +0 -2819
|
@@ -356,6 +356,13 @@
|
|
|
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
|
+
},
|
|
359
366
|
"next_action": {
|
|
360
367
|
"type": "string",
|
|
361
368
|
"enum": [
|
|
@@ -377,6 +384,7 @@
|
|
|
377
384
|
"puzzles",
|
|
378
385
|
"overall_completeness",
|
|
379
386
|
"next_step",
|
|
387
|
+
"recommended_creation_order",
|
|
380
388
|
"next_action",
|
|
381
389
|
"warnings"
|
|
382
390
|
],
|
|
@@ -530,6 +538,48 @@
|
|
|
530
538
|
"additionalProperties": false
|
|
531
539
|
}
|
|
532
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
|
+
},
|
|
533
583
|
"calibrated_at": {
|
|
534
584
|
"type": "integer"
|
|
535
585
|
},
|
|
@@ -663,6 +713,53 @@
|
|
|
663
713
|
"additionalProperties": false,
|
|
664
714
|
"description": "Scanner validation result. Present when run_scanner=true."
|
|
665
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
|
+
},
|
|
666
763
|
"can_proceed": {
|
|
667
764
|
"type": "boolean",
|
|
668
765
|
"description": "Whether the user can proceed to stage 5. False when D-errors exist."
|
|
@@ -922,6 +1019,66 @@
|
|
|
922
1019
|
"user_action_required"
|
|
923
1020
|
],
|
|
924
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
|
|
925
1082
|
}
|
|
926
1083
|
],
|
|
927
1084
|
"description": "Query result — shape depends on action"
|
|
@@ -24,7 +24,8 @@
|
|
|
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
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
|
},
|
|
@@ -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,19 @@ 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,
|
|
96
103
|
next_action: result.overall_completeness === "complete" ? "aggregate_risks" : "none",
|
|
97
104
|
warnings: result.warnings,
|
|
98
105
|
evolution_context: evolutionContext,
|
|
@@ -112,6 +119,11 @@ async function handleAggregateRisks(validated) {
|
|
|
112
119
|
});
|
|
113
120
|
const hasCritical = result.severity_summary.CRITICAL > 0;
|
|
114
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
|
+
});
|
|
115
127
|
return {
|
|
116
128
|
action: "aggregate_risks",
|
|
117
129
|
namespace: result.namespace,
|
|
@@ -119,6 +131,7 @@ async function handleAggregateRisks(validated) {
|
|
|
119
131
|
severity_summary: result.severity_summary,
|
|
120
132
|
status: result.status,
|
|
121
133
|
pending_confirmations: result.pending_confirmations,
|
|
134
|
+
fix_suggestions_grouped: result.fix_suggestions_grouped,
|
|
122
135
|
calibrated_at: result.calibrated_at,
|
|
123
136
|
warnings: result.warnings,
|
|
124
137
|
can_proceed: !hasCritical,
|
|
@@ -165,6 +178,12 @@ async function handleGenerateDeploymentDoc(validated) {
|
|
|
165
178
|
const warningCount = validationResult
|
|
166
179
|
? validationResult.checks.filter((c) => c.status === "WARN").length
|
|
167
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
|
+
});
|
|
168
187
|
return {
|
|
169
188
|
action: "generate_deployment_doc",
|
|
170
189
|
markdown,
|
|
@@ -176,6 +195,7 @@ async function handleGenerateDeploymentDoc(validated) {
|
|
|
176
195
|
step_count: required.steps.length,
|
|
177
196
|
},
|
|
178
197
|
validation: validationResult,
|
|
198
|
+
estimated_gas: gasEstimate,
|
|
179
199
|
can_proceed: errorCount === 0,
|
|
180
200
|
next_action: errorCount === 0 ? "trace_substeps" : "fix_doc_errors",
|
|
181
201
|
user_action_required: errorCount > 0
|
|
@@ -196,6 +216,11 @@ async function handleTraceSubsteps(validated) {
|
|
|
196
216
|
});
|
|
197
217
|
const hasFailedSubstep = substeps.some((s) => s.status === "FAILED");
|
|
198
218
|
const canProceed = result.coherent && !hasFailedSubstep;
|
|
219
|
+
updateStageCache(prefix, version, {
|
|
220
|
+
stage: 5,
|
|
221
|
+
trace_coherent: result.coherent,
|
|
222
|
+
trace_can_proceed: canProceed,
|
|
223
|
+
});
|
|
199
224
|
const issueParts = [];
|
|
200
225
|
if (result.dangling_inputs.length > 0) {
|
|
201
226
|
issueParts.push(`${result.dangling_inputs.length} dangling inputs`);
|
|
@@ -287,6 +312,26 @@ export async function handleProjectOperation(args) {
|
|
|
287
312
|
case "trace_substeps":
|
|
288
313
|
result = await handleTraceSubsteps(validated);
|
|
289
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
|
+
}
|
|
290
335
|
default:
|
|
291
336
|
throw new Error(`Unknown project_operation action: ${String(action)}`);
|
|
292
337
|
}
|