@wowok/agent-mcp 2.6.0 → 2.6.3
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/README.md +5 -3
- package/dist/customer/info-puzzle.d.ts +1 -1
- package/dist/customer/info-puzzle.js +4 -2
- package/dist/customer/risk-assessment.js +26 -4
- package/dist/customer/types.d.ts +2 -0
- package/dist/examples/guard-template-balance-check.json +38 -0
- package/dist/examples/guard-template-time-lock.json +39 -0
- package/dist/examples/machine-template-7node-rental.json +114 -0
- package/dist/examples/rental-ziroom-machine-create.json +137 -0
- package/dist/examples/rental-ziroom-permission-create.json +35 -0
- package/dist/examples/rental-ziroom-service-create.json +80 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/extensions/capability-manifest.d.ts +125 -0
- package/dist/extensions/capability-manifest.js +594 -0
- package/dist/extensions/constraint-registry.d.ts +24 -0
- package/dist/extensions/constraint-registry.js +196 -0
- package/dist/extensions/index.d.ts +12 -0
- package/dist/extensions/index.js +6 -0
- package/dist/extensions/metric-registry.d.ts +26 -0
- package/dist/extensions/metric-registry.js +257 -0
- package/dist/extensions/mode-evaluator.d.ts +15 -0
- package/dist/extensions/mode-evaluator.js +170 -0
- package/dist/extensions/modes.d.ts +2 -0
- package/dist/extensions/modes.js +493 -0
- package/dist/extensions/registry.d.ts +50 -0
- package/dist/extensions/registry.js +662 -0
- package/dist/extensions/types.d.ts +219 -0
- package/dist/extensions/types.js +1 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.d.ts +3 -0
- package/dist/knowledge/deployment-scanner.js +64 -3
- package/dist/knowledge/fund-layer.d.ts +72 -0
- package/dist/knowledge/fund-layer.js +420 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-risk.d.ts +13 -0
- package/dist/knowledge/guard-risk.js +57 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/guard-templates.js +278 -0
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-templates.js +24 -5
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/service-confirm.d.ts +15 -6
- package/dist/knowledge/service-confirm.js +119 -11
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/knowledge/tool-constraints.js +6 -2
- package/dist/project/deployment-bridge.d.ts +1 -1
- package/dist/project/deployment-bridge.js +31 -7
- package/dist/project/deployment-doc.d.ts +3 -0
- package/dist/project/deployment-doc.js +76 -14
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1371 -0
- package/dist/project/evaluation.d.ts +2 -0
- package/dist/project/evaluation.js +873 -88
- package/dist/project/graph-builder.d.ts +4 -1
- package/dist/project/graph-builder.js +132 -62
- package/dist/project/graph.d.ts +1 -0
- package/dist/project/handlers.d.ts +317 -6
- package/dist/project/handlers.js +1171 -19
- package/dist/project/stage-gate.d.ts +4 -0
- package/dist/project/stage-gate.js +64 -5
- package/dist/project/task-tracker.d.ts +26 -0
- package/dist/project/task-tracker.js +78 -0
- package/dist/safety/preview.js +16 -0
- package/dist/schema/call/allocation.d.ts +16 -16
- package/dist/schema/call/allocation.js +2 -2
- package/dist/schema/call/arbitration.js +19 -6
- package/dist/schema/call/base.d.ts +21 -13
- package/dist/schema/call/base.js +27 -6
- package/dist/schema/call/bridge.d.ts +5 -5
- package/dist/schema/call/bridge.js +3 -1
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +23 -31
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +1976 -752
- package/dist/schema/call/machine.js +50 -4
- package/dist/schema/call/order.d.ts +149 -228
- package/dist/schema/call/order.js +4 -3
- package/dist/schema/call/payment.d.ts +183 -3
- package/dist/schema/call/payment.js +21 -3
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/personal.d.ts +241 -52
- package/dist/schema/call/progress.d.ts +53 -61
- package/dist/schema/call/progress.js +18 -4
- package/dist/schema/call/repository.d.ts +23 -31
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.d.ts +1 -1
- package/dist/schema/call/semantic.js +37 -2
- package/dist/schema/call/service.d.ts +275 -127
- package/dist/schema/call/service.js +89 -13
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +13 -2
- package/dist/schema/common/index.js +80 -15
- package/dist/schema/local/index.d.ts +32 -35
- package/dist/schema/local/index.js +28 -6
- package/dist/schema/messenger/index.d.ts +274 -46
- package/dist/schema/operations.d.ts +1264 -544
- package/dist/schema/operations.js +65 -7
- package/dist/schema/project/index.d.ts +2846 -167
- package/dist/schema/project/index.js +570 -16
- package/dist/schema/query/index.d.ts +922 -349
- package/dist/schema/query/index.js +205 -42
- package/dist/schema/schema-query/index.d.ts +65 -3
- package/dist/schema/schema-query/index.js +38 -5
- package/dist/schema/utils/node-parser.js +20 -4
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +76 -0
- package/dist/schema-query/index.d.ts +20 -1
- package/dist/schema-query/index.js +306 -4
- package/dist/schemas/account_operation.output.json +7 -1
- package/dist/schemas/account_operation.schema.json +3 -3
- package/dist/schemas/bridge_operation.output.json +6 -0
- package/dist/schemas/bridge_operation.schema.json +1 -1
- package/dist/schemas/guard-templates.json +379 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/local_info_operation.output.json +6 -0
- package/dist/schemas/local_mark_operation.output.json +7 -1
- package/dist/schemas/local_mark_operation.schema.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +4 -4
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +444 -330
- package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
- package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
- package/dist/schemas/onchain_operations_contact.schema.json +10 -10
- package/dist/schemas/onchain_operations_demand.schema.json +10 -10
- package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +43 -35
- package/dist/schemas/onchain_operations_order.schema.json +72 -78
- package/dist/schemas/onchain_operations_payment.schema.json +141 -111
- package/dist/schemas/onchain_operations_permission.schema.json +3 -3
- package/dist/schemas/onchain_operations_personal.schema.json +7 -7
- package/dist/schemas/onchain_operations_progress.schema.json +9 -9
- package/dist/schemas/onchain_operations_proof.schema.json +8 -8
- package/dist/schemas/onchain_operations_repository.schema.json +10 -10
- package/dist/schemas/onchain_operations_reward.schema.json +14 -14
- package/dist/schemas/onchain_operations_service.schema.json +119 -48
- package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
- package/dist/schemas/onchain_table_data.output.json +33 -25
- package/dist/schemas/onchain_table_data.schema.json +22 -21
- package/dist/schemas/project_operation.output.json +2194 -23
- package/dist/schemas/project_operation.schema.json +84 -6
- package/dist/schemas/query_toolkit.output.json +108 -80
- package/dist/schemas/query_toolkit.schema.json +12 -12
- package/dist/schemas/schema_query.output.json +70 -3
- package/dist/schemas/schema_query.schema.json +18 -3
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/local.js +20 -5
- package/dist/tools/handlers/onchain.js +594 -6
- package/dist/tools/handlers/project.js +76 -4
- package/dist/tools/handlers/query.js +27 -0
- package/dist/tools/handlers/schema-query.js +43 -1
- package/dist/tools/handlers/task-status.d.ts +170 -0
- package/dist/tools/handlers/task-status.js +55 -0
- package/dist/tools/handlers/wip.js +47 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +387 -12
- package/dist/tools/retry.d.ts +8 -0
- package/dist/tools/retry.js +85 -0
- package/dist/tools/wip-deploy-assist.d.ts +28 -0
- package/dist/tools/wip-deploy-assist.js +278 -0
- package/package.json +2 -2
- package/dist/schemas/guard-node-examples.md +0 -199
|
@@ -43,17 +43,80 @@
|
|
|
43
43
|
},
|
|
44
44
|
"description": "List of schema summaries (list/search/list_operations)."
|
|
45
45
|
},
|
|
46
|
+
{
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"file": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "Example file name (e.g. 'rental-ziroom-service-create.json')."
|
|
54
|
+
},
|
|
55
|
+
"title": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "Human-readable title from the example metadata."
|
|
58
|
+
},
|
|
59
|
+
"description": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "Longer description from the example metadata."
|
|
62
|
+
},
|
|
63
|
+
"tags": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
},
|
|
68
|
+
"description": "Tags from the example metadata."
|
|
69
|
+
},
|
|
70
|
+
"industry": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "Industry category (e.g. 'rental', 'retail', 'general')."
|
|
73
|
+
},
|
|
74
|
+
"operation_type": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Operation type (e.g. 'service', 'machine', 'guard', 'permission')."
|
|
77
|
+
},
|
|
78
|
+
"verified": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"description": "Whether the example is marked as verified."
|
|
81
|
+
},
|
|
82
|
+
"score": {
|
|
83
|
+
"type": "number",
|
|
84
|
+
"description": "Relevance score — number of fields that matched the query (0-5)."
|
|
85
|
+
},
|
|
86
|
+
"matched_fields": {
|
|
87
|
+
"type": "array",
|
|
88
|
+
"items": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"description": "List of fields that matched the query."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"required": [
|
|
95
|
+
"file",
|
|
96
|
+
"title",
|
|
97
|
+
"description",
|
|
98
|
+
"tags",
|
|
99
|
+
"industry",
|
|
100
|
+
"operation_type",
|
|
101
|
+
"verified",
|
|
102
|
+
"score",
|
|
103
|
+
"matched_fields"
|
|
104
|
+
],
|
|
105
|
+
"additionalProperties": false
|
|
106
|
+
},
|
|
107
|
+
"description": "List of matching examples (search_examples)."
|
|
108
|
+
},
|
|
46
109
|
{
|
|
47
110
|
"type": "object",
|
|
48
111
|
"additionalProperties": {},
|
|
49
|
-
"description": "JSON Schema object (get/get_output)."
|
|
112
|
+
"description": "JSON Schema object (get/get_output/get_field) or Guard template data."
|
|
50
113
|
},
|
|
51
114
|
{
|
|
52
115
|
"type": "null",
|
|
53
|
-
"description": "No data — lookup failed or returned nothing."
|
|
116
|
+
"description": "No data — lookup failed or returned nothing, or data was written to output_file."
|
|
54
117
|
}
|
|
55
118
|
],
|
|
56
|
-
"description": "Response data — array of schema summaries for list-like actions, JSON Schema object for get/get_output, null on failure."
|
|
119
|
+
"description": "Response data — array of schema summaries for list-like actions, array of example results for search_examples, JSON Schema object for get/get_output/get_field, Guard template data for get_guard_templates, null on failure or when output_file is used."
|
|
57
120
|
},
|
|
58
121
|
"message": {
|
|
59
122
|
"type": "string",
|
|
@@ -65,6 +128,10 @@
|
|
|
65
128
|
"type": "string"
|
|
66
129
|
},
|
|
67
130
|
"description": "Suggested next steps or alternatives"
|
|
131
|
+
},
|
|
132
|
+
"output_file_path": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "When output_file is used, contains the absolute file path where data was written."
|
|
68
135
|
}
|
|
69
136
|
},
|
|
70
137
|
"required": [
|
|
@@ -15,17 +15,32 @@
|
|
|
15
15
|
"get",
|
|
16
16
|
"get_output",
|
|
17
17
|
"search",
|
|
18
|
-
"list_operations"
|
|
18
|
+
"list_operations",
|
|
19
|
+
"get_guard_templates",
|
|
20
|
+
"get_field",
|
|
21
|
+
"search_examples"
|
|
19
22
|
],
|
|
20
|
-
"description": "Action to perform: 'list'
|
|
23
|
+
"description": "Action to perform: 'list' (all schemas), 'get' (specific input schema), 'get_output' (tool output schema), 'get_field' (field-path query e.g. field_path='data.node'), 'search' (by keyword), 'list_operations' (on-chain operations), 'get_guard_templates' (Guard creation templates + best practices), 'search_examples' (search verified example files by keyword — matches title, description, tags, operation_type, industry)."
|
|
21
24
|
},
|
|
22
25
|
"name": {
|
|
23
26
|
"type": "string",
|
|
24
|
-
"description": "Schema/tool name for 'get'/'get_output' action (e.g., 'onchain_operations', '
|
|
27
|
+
"description": "Schema/tool name for 'get'/'get_output'/'get_field' action (e.g., 'onchain_operations', 'onchain_operations_machine')."
|
|
25
28
|
},
|
|
26
29
|
"query": {
|
|
27
30
|
"type": "string",
|
|
28
31
|
"description": "Search query for 'search' action"
|
|
32
|
+
},
|
|
33
|
+
"field_path": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Dot-separated field path for 'get_field' action (e.g. 'data.node', 'data.node.nodes.0.pairs'). Navigates schema.properties.* and schema.items.*."
|
|
36
|
+
},
|
|
37
|
+
"template": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Guard template name for 'get_guard_templates' action. Omit to list all available templates. Available: signer_verification, progress_node_check, order_owner_verification, service_belonging_check, reward_not_claimed, combined_reward_guard."
|
|
40
|
+
},
|
|
41
|
+
"output_file": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "When set, writes the response data to this file path (relative to cwd) and returns the path instead of inline data. Use for large schemas that would be truncated. Prefer workspace paths like '.trae/tmp/schema.json' so the Read tool can access them."
|
|
29
44
|
}
|
|
30
45
|
},
|
|
31
46
|
"required": [
|
|
@@ -69,19 +69,23 @@
|
|
|
69
69
|
"properties": {
|
|
70
70
|
"index": {
|
|
71
71
|
"type": "number",
|
|
72
|
-
"description": "Permission index"
|
|
72
|
+
"description": "Permission index (e.g. 315 for service.compensation_fund_deposit)"
|
|
73
73
|
},
|
|
74
74
|
"name": {
|
|
75
75
|
"type": "string",
|
|
76
|
-
"description": "
|
|
76
|
+
"description": "Permission name (e.g. \"service.compensation_fund_deposit\")"
|
|
77
77
|
},
|
|
78
78
|
"description": {
|
|
79
79
|
"type": "string",
|
|
80
|
-
"description": "Description"
|
|
80
|
+
"description": "Description of what this permission allows"
|
|
81
81
|
},
|
|
82
82
|
"object_type": {
|
|
83
83
|
"type": "string",
|
|
84
|
-
"description": "Object type"
|
|
84
|
+
"description": "Object type this permission belongs to (e.g. \"Service\", \"Arbitration\")"
|
|
85
|
+
},
|
|
86
|
+
"operation": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "The SDK/MCP operation field name that triggers this permission check (e.g. \"compensation_fund_add\", \"publish\", \"pause\"). Undefined for permissions with no direct Call*_Data field (e.g. \"*.new\" permissions). Use this to answer: \"What permission does operation X require?\" by filtering with {operation: \"compensation_fund_add\"}."
|
|
85
89
|
}
|
|
86
90
|
},
|
|
87
91
|
"required": [
|
|
@@ -91,9 +95,78 @@
|
|
|
91
95
|
"object_type"
|
|
92
96
|
],
|
|
93
97
|
"additionalProperties": false,
|
|
94
|
-
"description": "Permission info type"
|
|
98
|
+
"description": "Permission info type — includes the operation field name that maps to this permission, so AI can look up required permissions by operation name."
|
|
99
|
+
},
|
|
100
|
+
"description": "Built-in permissions result. Each item includes an optional \"operation\" field mapping to the SDK/MCP field name that triggers this permission."
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"required": [
|
|
104
|
+
"info",
|
|
105
|
+
"result"
|
|
106
|
+
],
|
|
107
|
+
"additionalProperties": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"info": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"const": "common mistakes"
|
|
115
|
+
},
|
|
116
|
+
"result": {
|
|
117
|
+
"type": "array",
|
|
118
|
+
"items": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
121
|
+
"object_type": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"description": "The object type this mistake applies to (e.g. \"Service\", \"Arbitration\")"
|
|
124
|
+
},
|
|
125
|
+
"operation": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "The operation field name this mistake applies to (e.g. \"compensation_fund_add\", \"voting_deadline\")"
|
|
128
|
+
},
|
|
129
|
+
"category": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"enum": [
|
|
132
|
+
"field_name",
|
|
133
|
+
"unit",
|
|
134
|
+
"value_range",
|
|
135
|
+
"workflow",
|
|
136
|
+
"timing"
|
|
137
|
+
],
|
|
138
|
+
"description": "Category of the mistake: field_name (wrong field name), unit (wrong unit like seconds vs ms), value_range (wrong expected value), workflow (wrong operation order), timing (wrong time constraint)"
|
|
139
|
+
},
|
|
140
|
+
"mistake": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "Short description of the mistake"
|
|
143
|
+
},
|
|
144
|
+
"correct_usage": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "The correct usage pattern"
|
|
147
|
+
},
|
|
148
|
+
"wrong_example": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"description": "Example of the wrong usage"
|
|
151
|
+
},
|
|
152
|
+
"correct_example": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "Example of the correct usage"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"required": [
|
|
158
|
+
"object_type",
|
|
159
|
+
"operation",
|
|
160
|
+
"category",
|
|
161
|
+
"mistake",
|
|
162
|
+
"correct_usage",
|
|
163
|
+
"wrong_example",
|
|
164
|
+
"correct_example"
|
|
165
|
+
],
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"description": "A known common mistake for an on-chain operation. Use this to proactively warn users before they submit a transaction."
|
|
95
168
|
},
|
|
96
|
-
"description": "
|
|
169
|
+
"description": "Common mistakes result. Each item documents a known pitfall (wrong field name, wrong unit, wrong workflow order, etc.) with wrong/correct examples."
|
|
97
170
|
}
|
|
98
171
|
},
|
|
99
172
|
"required": [
|
|
@@ -486,12 +559,12 @@
|
|
|
486
559
|
"parameters": {
|
|
487
560
|
"type": "array",
|
|
488
561
|
"items": {
|
|
489
|
-
"$ref": "#/definitions/wowok_buildin_info/properties/result/anyOf/
|
|
562
|
+
"$ref": "#/definitions/wowok_buildin_info/properties/result/anyOf/3/properties/result/items/properties/returnType"
|
|
490
563
|
},
|
|
491
564
|
"description": "Parameters for guard query"
|
|
492
565
|
},
|
|
493
566
|
"return": {
|
|
494
|
-
"$ref": "#/definitions/wowok_buildin_info/properties/result/anyOf/
|
|
567
|
+
"$ref": "#/definitions/wowok_buildin_info/properties/result/anyOf/3/properties/result/items/properties/returnType",
|
|
495
568
|
"description": "Return type for guard query"
|
|
496
569
|
},
|
|
497
570
|
"parameters_description": {
|
|
@@ -80,17 +80,61 @@
|
|
|
80
80
|
"description": {
|
|
81
81
|
"type": "string",
|
|
82
82
|
"description": "Description filter"
|
|
83
|
+
},
|
|
84
|
+
"operation": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"description": "Filter by SDK/MCP operation field name (e.g. \"compensation_fund_add\"). Returns only permissions triggered by this operation. Use this to answer: \"What permission does operation X require?\""
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"description": "Filter for built-in permissions. Use operation:\"compensation_fund_add\" to find which permission a specific operation requires."
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": [
|
|
94
|
+
"info"
|
|
95
|
+
],
|
|
96
|
+
"additionalProperties": false,
|
|
97
|
+
"description": "Built-in permissions query. Each permission includes an optional \"operation\" field that maps to the SDK/MCP Call*_Data field name triggering it. Use this to answer: \"What permission does operation X require?\" — e.g. filter operation:\"compensation_fund_add\" returns permission index 315 (service.compensation_fund_deposit)."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "object",
|
|
101
|
+
"properties": {
|
|
102
|
+
"info": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"const": "common mistakes"
|
|
105
|
+
},
|
|
106
|
+
"filter": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"properties": {
|
|
109
|
+
"object_type": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "Filter by object type (e.g. \"Service\")"
|
|
112
|
+
},
|
|
113
|
+
"operation": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "Filter by operation field name (e.g. \"compensation_fund_add\")"
|
|
116
|
+
},
|
|
117
|
+
"category": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"enum": [
|
|
120
|
+
"field_name",
|
|
121
|
+
"unit",
|
|
122
|
+
"value_range",
|
|
123
|
+
"workflow",
|
|
124
|
+
"timing"
|
|
125
|
+
],
|
|
126
|
+
"description": "Filter by category (e.g. \"field_name\" for field-name mistakes, \"unit\" for unit mistakes)"
|
|
83
127
|
}
|
|
84
128
|
},
|
|
85
129
|
"additionalProperties": false,
|
|
86
|
-
"description": "Filter for
|
|
130
|
+
"description": "Filter for common mistakes. Use operation:\"compensation_fund_add\" to find mistakes for a specific operation, or category:\"field_name\" for all field-name mistakes."
|
|
87
131
|
}
|
|
88
132
|
},
|
|
89
133
|
"required": [
|
|
90
134
|
"info"
|
|
91
135
|
],
|
|
92
136
|
"additionalProperties": false,
|
|
93
|
-
"description": "
|
|
137
|
+
"description": "Common mistakes query. Returns known field-name, unit, value-range, workflow, and timing pitfalls for on-chain operations. Use this to proactively warn users before submitting a transaction. Example: query operation:\"compensation_fund_add\" to learn about the {amount} vs {balance} field name mistake."
|
|
94
138
|
},
|
|
95
139
|
{
|
|
96
140
|
"type": "object",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { wrapLocalHandler } from "../shared.js";
|
|
2
|
+
import { withFaucetRetry } from "../retry.js";
|
|
2
3
|
import { AccountOperationSchema, LocalMarkOperationSchema, LocalInfoOperationSchema, } from "../../schema/index.js";
|
|
3
4
|
import { account_operation, local_mark_operation, local_info_operation, } from "@wowok/wowok";
|
|
4
5
|
function deriveOpType(prefix, validated) {
|
|
@@ -11,7 +12,7 @@ function deriveOpType(prefix, validated) {
|
|
|
11
12
|
}
|
|
12
13
|
export const handleAccountOperation = wrapLocalHandler({
|
|
13
14
|
schema: AccountOperationSchema,
|
|
14
|
-
operationFn: account_operation,
|
|
15
|
+
operationFn: withFaucetRetry(account_operation),
|
|
15
16
|
parseLabel: "account_operation input",
|
|
16
17
|
buildContext: (validated) => ({
|
|
17
18
|
operation_type: deriveOpType("account", validated),
|
|
@@ -22,10 +23,24 @@ export const handleMarkOperation = wrapLocalHandler({
|
|
|
22
23
|
schema: LocalMarkOperationSchema,
|
|
23
24
|
operationFn: local_mark_operation,
|
|
24
25
|
parseLabel: "local_mark_operation input",
|
|
25
|
-
buildContext: (validated) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
buildContext: (validated) => {
|
|
27
|
+
const ctx = {
|
|
28
|
+
operation_type: deriveOpType("mark", validated),
|
|
29
|
+
data: validated,
|
|
30
|
+
};
|
|
31
|
+
const v = validated;
|
|
32
|
+
if (v.add && Array.isArray(v.add.data) && v.add.data.length > 0) {
|
|
33
|
+
ctx.pre_warnings = [
|
|
34
|
+
"Cross-network consistency (FIX-011): LocalMark names are scoped per network. " +
|
|
35
|
+
"When creating marks for the same logical object on different networks " +
|
|
36
|
+
"(e.g. testnet and mainnet), use the SAME name value to keep name-based " +
|
|
37
|
+
"references portable. Before creating a mark on mainnet, consider querying " +
|
|
38
|
+
"testnet via query_local with network='testnet' to check for an existing " +
|
|
39
|
+
"same-named mark and replicate it.",
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
return ctx;
|
|
43
|
+
},
|
|
29
44
|
});
|
|
30
45
|
export const handleInfoOperation = wrapLocalHandler({
|
|
31
46
|
schema: LocalInfoOperationSchema,
|