@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.
Files changed (186) hide show
  1. package/README.md +5 -3
  2. package/dist/customer/info-puzzle.d.ts +1 -1
  3. package/dist/customer/info-puzzle.js +4 -2
  4. package/dist/customer/risk-assessment.js +26 -4
  5. package/dist/customer/types.d.ts +2 -0
  6. package/dist/examples/guard-template-balance-check.json +38 -0
  7. package/dist/examples/guard-template-time-lock.json +39 -0
  8. package/dist/examples/machine-template-7node-rental.json +114 -0
  9. package/dist/examples/rental-ziroom-machine-create.json +137 -0
  10. package/dist/examples/rental-ziroom-permission-create.json +35 -0
  11. package/dist/examples/rental-ziroom-service-create.json +80 -0
  12. package/dist/examples/retail-myshop-service-create.json +88 -0
  13. package/dist/extensions/capability-manifest.d.ts +125 -0
  14. package/dist/extensions/capability-manifest.js +594 -0
  15. package/dist/extensions/constraint-registry.d.ts +24 -0
  16. package/dist/extensions/constraint-registry.js +196 -0
  17. package/dist/extensions/index.d.ts +12 -0
  18. package/dist/extensions/index.js +6 -0
  19. package/dist/extensions/metric-registry.d.ts +26 -0
  20. package/dist/extensions/metric-registry.js +257 -0
  21. package/dist/extensions/mode-evaluator.d.ts +15 -0
  22. package/dist/extensions/mode-evaluator.js +170 -0
  23. package/dist/extensions/modes.d.ts +2 -0
  24. package/dist/extensions/modes.js +493 -0
  25. package/dist/extensions/registry.d.ts +50 -0
  26. package/dist/extensions/registry.js +662 -0
  27. package/dist/extensions/types.d.ts +219 -0
  28. package/dist/extensions/types.js +1 -0
  29. package/dist/index.js +50 -0
  30. package/dist/knowledge/deployment-scanner.d.ts +3 -0
  31. package/dist/knowledge/deployment-scanner.js +64 -3
  32. package/dist/knowledge/fund-layer.d.ts +72 -0
  33. package/dist/knowledge/fund-layer.js +420 -0
  34. package/dist/knowledge/guard-render.d.ts +57 -0
  35. package/dist/knowledge/guard-render.js +700 -0
  36. package/dist/knowledge/guard-risk.d.ts +13 -0
  37. package/dist/knowledge/guard-risk.js +57 -0
  38. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  39. package/dist/knowledge/guard-submission-prompt.js +171 -0
  40. package/dist/knowledge/guard-templates.js +278 -0
  41. package/dist/knowledge/machine-ledger.js +1 -1
  42. package/dist/knowledge/machine-render.d.ts +41 -0
  43. package/dist/knowledge/machine-render.js +565 -0
  44. package/dist/knowledge/machine-templates.js +24 -5
  45. package/dist/knowledge/reward-confirm.js +2 -2
  46. package/dist/knowledge/reward-puzzle.js +1 -1
  47. package/dist/knowledge/reward-risk.js +9 -9
  48. package/dist/knowledge/reward-templates.js +2 -2
  49. package/dist/knowledge/service-confirm.d.ts +15 -6
  50. package/dist/knowledge/service-confirm.js +119 -11
  51. package/dist/knowledge/service-context.js +1 -1
  52. package/dist/knowledge/service-ledger.js +1 -1
  53. package/dist/knowledge/service-risk.d.ts +1 -1
  54. package/dist/knowledge/service-risk.js +3 -3
  55. package/dist/knowledge/service-templates.js +2 -2
  56. package/dist/knowledge/service-translation.d.ts +1 -1
  57. package/dist/knowledge/service-translation.js +7 -7
  58. package/dist/knowledge/tool-constraints.js +6 -2
  59. package/dist/project/deployment-bridge.d.ts +1 -1
  60. package/dist/project/deployment-bridge.js +31 -7
  61. package/dist/project/deployment-doc.d.ts +3 -0
  62. package/dist/project/deployment-doc.js +76 -14
  63. package/dist/project/edit-planner.d.ts +123 -0
  64. package/dist/project/edit-planner.js +1371 -0
  65. package/dist/project/evaluation.d.ts +2 -0
  66. package/dist/project/evaluation.js +873 -88
  67. package/dist/project/graph-builder.d.ts +4 -1
  68. package/dist/project/graph-builder.js +132 -62
  69. package/dist/project/graph.d.ts +1 -0
  70. package/dist/project/handlers.d.ts +317 -6
  71. package/dist/project/handlers.js +1171 -19
  72. package/dist/project/stage-gate.d.ts +4 -0
  73. package/dist/project/stage-gate.js +64 -5
  74. package/dist/project/task-tracker.d.ts +26 -0
  75. package/dist/project/task-tracker.js +78 -0
  76. package/dist/safety/preview.js +16 -0
  77. package/dist/schema/call/allocation.d.ts +16 -16
  78. package/dist/schema/call/allocation.js +2 -2
  79. package/dist/schema/call/arbitration.js +19 -6
  80. package/dist/schema/call/base.d.ts +21 -13
  81. package/dist/schema/call/base.js +27 -6
  82. package/dist/schema/call/bridge.d.ts +5 -5
  83. package/dist/schema/call/bridge.js +3 -1
  84. package/dist/schema/call/contact.js +2 -2
  85. package/dist/schema/call/demand.d.ts +23 -31
  86. package/dist/schema/call/demand.js +2 -2
  87. package/dist/schema/call/guard.js +2 -2
  88. package/dist/schema/call/machine.d.ts +1976 -752
  89. package/dist/schema/call/machine.js +50 -4
  90. package/dist/schema/call/order.d.ts +149 -228
  91. package/dist/schema/call/order.js +4 -3
  92. package/dist/schema/call/payment.d.ts +183 -3
  93. package/dist/schema/call/payment.js +21 -3
  94. package/dist/schema/call/permission.js +2 -2
  95. package/dist/schema/call/personal.d.ts +241 -52
  96. package/dist/schema/call/progress.d.ts +53 -61
  97. package/dist/schema/call/progress.js +18 -4
  98. package/dist/schema/call/repository.d.ts +23 -31
  99. package/dist/schema/call/repository.js +2 -2
  100. package/dist/schema/call/reward.js +3 -3
  101. package/dist/schema/call/semantic.d.ts +1 -1
  102. package/dist/schema/call/semantic.js +37 -2
  103. package/dist/schema/call/service.d.ts +275 -127
  104. package/dist/schema/call/service.js +89 -13
  105. package/dist/schema/call/treasury.js +3 -3
  106. package/dist/schema/common/index.d.ts +13 -2
  107. package/dist/schema/common/index.js +80 -15
  108. package/dist/schema/local/index.d.ts +32 -35
  109. package/dist/schema/local/index.js +28 -6
  110. package/dist/schema/messenger/index.d.ts +274 -46
  111. package/dist/schema/operations.d.ts +1264 -544
  112. package/dist/schema/operations.js +65 -7
  113. package/dist/schema/project/index.d.ts +2846 -167
  114. package/dist/schema/project/index.js +570 -16
  115. package/dist/schema/query/index.d.ts +922 -349
  116. package/dist/schema/query/index.js +205 -42
  117. package/dist/schema/schema-query/index.d.ts +65 -3
  118. package/dist/schema/schema-query/index.js +38 -5
  119. package/dist/schema/utils/node-parser.js +20 -4
  120. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  121. package/dist/schema/utils/object-type-utils.js +35 -0
  122. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  123. package/dist/schema/utils/permission-machine-check.js +121 -0
  124. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  125. package/dist/schema/utils/skills-recommendation.js +76 -0
  126. package/dist/schema-query/index.d.ts +20 -1
  127. package/dist/schema-query/index.js +306 -4
  128. package/dist/schemas/account_operation.output.json +7 -1
  129. package/dist/schemas/account_operation.schema.json +3 -3
  130. package/dist/schemas/bridge_operation.output.json +6 -0
  131. package/dist/schemas/bridge_operation.schema.json +1 -1
  132. package/dist/schemas/guard-templates.json +379 -0
  133. package/dist/schemas/guard2file.schema.json +1 -1
  134. package/dist/schemas/index.json +1 -1
  135. package/dist/schemas/local_info_operation.output.json +6 -0
  136. package/dist/schemas/local_mark_operation.output.json +7 -1
  137. package/dist/schemas/local_mark_operation.schema.json +1 -1
  138. package/dist/schemas/machineNode2file.schema.json +1 -1
  139. package/dist/schemas/messenger_operation.schema.json +4 -4
  140. package/dist/schemas/onchain_events.output.json +1 -1
  141. package/dist/schemas/onchain_operations.output.json +2820 -0
  142. package/dist/schemas/onchain_operations.schema.json +444 -330
  143. package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
  144. package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
  145. package/dist/schemas/onchain_operations_contact.schema.json +10 -10
  146. package/dist/schemas/onchain_operations_demand.schema.json +10 -10
  147. package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
  148. package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
  149. package/dist/schemas/onchain_operations_guard.schema.json +2 -2
  150. package/dist/schemas/onchain_operations_machine.schema.json +43 -35
  151. package/dist/schemas/onchain_operations_order.schema.json +72 -78
  152. package/dist/schemas/onchain_operations_payment.schema.json +141 -111
  153. package/dist/schemas/onchain_operations_permission.schema.json +3 -3
  154. package/dist/schemas/onchain_operations_personal.schema.json +7 -7
  155. package/dist/schemas/onchain_operations_progress.schema.json +9 -9
  156. package/dist/schemas/onchain_operations_proof.schema.json +8 -8
  157. package/dist/schemas/onchain_operations_repository.schema.json +10 -10
  158. package/dist/schemas/onchain_operations_reward.schema.json +14 -14
  159. package/dist/schemas/onchain_operations_service.schema.json +119 -48
  160. package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
  161. package/dist/schemas/onchain_table_data.output.json +33 -25
  162. package/dist/schemas/onchain_table_data.schema.json +22 -21
  163. package/dist/schemas/project_operation.output.json +2194 -23
  164. package/dist/schemas/project_operation.schema.json +84 -6
  165. package/dist/schemas/query_toolkit.output.json +108 -80
  166. package/dist/schemas/query_toolkit.schema.json +12 -12
  167. package/dist/schemas/schema_query.output.json +70 -3
  168. package/dist/schemas/schema_query.schema.json +18 -3
  169. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  170. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  171. package/dist/tools/handlers/local.js +20 -5
  172. package/dist/tools/handlers/onchain.js +594 -6
  173. package/dist/tools/handlers/project.js +76 -4
  174. package/dist/tools/handlers/query.js +27 -0
  175. package/dist/tools/handlers/schema-query.js +43 -1
  176. package/dist/tools/handlers/task-status.d.ts +170 -0
  177. package/dist/tools/handlers/task-status.js +55 -0
  178. package/dist/tools/handlers/wip.js +47 -1
  179. package/dist/tools/index.d.ts +8 -0
  180. package/dist/tools/index.js +387 -12
  181. package/dist/tools/retry.d.ts +8 -0
  182. package/dist/tools/retry.js +85 -0
  183. package/dist/tools/wip-deploy-assist.d.ts +28 -0
  184. package/dist/tools/wip-deploy-assist.js +278 -0
  185. package/package.json +2 -2
  186. package/dist/schemas/guard-node-examples.md +0 -199
@@ -1,9 +1,20 @@
1
- import { readFileSync, existsSync } from "fs";
2
- import { resolve, join } from "path";
1
+ import { readFileSync, existsSync, writeFileSync, mkdirSync, readdirSync } from "fs";
2
+ import { resolve, join, dirname } from "path";
3
3
  import { fileURLToPath } from "url";
4
4
  const __filename = fileURLToPath(import.meta.url);
5
5
  const __dirname = fileURLToPath(new URL(".", import.meta.url));
6
6
  const SCHEMAS_DIR = resolve(__dirname, "../../dist/schemas");
7
+ const GUARD_TEMPLATES_PATH_SCRIPTS = resolve(__dirname, "../../scripts/guard-templates.json");
8
+ const GUARD_TEMPLATES_PATH_DIST = resolve(__dirname, "../../dist/schemas/guard-templates.json");
9
+ const GUARD_TEMPLATES_PATH = existsSync(GUARD_TEMPLATES_PATH_SCRIPTS)
10
+ ? GUARD_TEMPLATES_PATH_SCRIPTS
11
+ : GUARD_TEMPLATES_PATH_DIST;
12
+ const EXAMPLES_DIR_SCRIPTS = resolve(__dirname, "../../scripts/examples");
13
+ const EXAMPLES_DIR_DIST = resolve(__dirname, "../examples");
14
+ export const EXAMPLES_DIR = existsSync(EXAMPLES_DIR_SCRIPTS)
15
+ ? EXAMPLES_DIR_SCRIPTS
16
+ : EXAMPLES_DIR_DIST;
17
+ const WORKSPACE_TMP_DIR = resolve(process.cwd(), ".trae", "tmp");
7
18
  export function areSchemasAvailable() {
8
19
  return existsSync(SCHEMAS_DIR) && existsSync(join(SCHEMAS_DIR, "index.json"));
9
20
  }
@@ -59,6 +70,147 @@ export function getOutputSchema(name) {
59
70
  return null;
60
71
  }
61
72
  }
73
+ export function getGuardTemplates(templateName) {
74
+ try {
75
+ if (!existsSync(GUARD_TEMPLATES_PATH)) {
76
+ return null;
77
+ }
78
+ const content = readFileSync(GUARD_TEMPLATES_PATH, "utf-8");
79
+ const catalog = JSON.parse(content);
80
+ if (!templateName) {
81
+ return {
82
+ version: catalog.version,
83
+ description: catalog.description,
84
+ templates: (catalog.templates || []).map((t) => ({
85
+ name: t.name,
86
+ title: t.title,
87
+ description: t.description,
88
+ use_case: t.use_case,
89
+ })),
90
+ query_reference: catalog.query_reference,
91
+ node_return_types: catalog.node_return_types,
92
+ };
93
+ }
94
+ const template = (catalog.templates || []).find((t) => t.name === templateName);
95
+ if (!template) {
96
+ return null;
97
+ }
98
+ return template;
99
+ }
100
+ catch {
101
+ return null;
102
+ }
103
+ }
104
+ export function searchExamples(query) {
105
+ if (!existsSync(EXAMPLES_DIR)) {
106
+ return [];
107
+ }
108
+ let files;
109
+ try {
110
+ files = readdirSync(EXAMPLES_DIR);
111
+ }
112
+ catch {
113
+ return [];
114
+ }
115
+ const lowerQuery = query.toLowerCase().trim();
116
+ if (!lowerQuery) {
117
+ return [];
118
+ }
119
+ const results = [];
120
+ for (const file of files) {
121
+ if (!file.endsWith(".json"))
122
+ continue;
123
+ const filePath = join(EXAMPLES_DIR, file);
124
+ try {
125
+ const content = readFileSync(filePath, "utf-8");
126
+ const example = JSON.parse(content);
127
+ const title = String(example.title ?? "");
128
+ const description = String(example.description ?? "");
129
+ const tags = Array.isArray(example.tags) ? example.tags.map((t) => String(t)) : [];
130
+ const operationType = String(example.operation_type ?? "");
131
+ const industry = String(example.industry ?? "");
132
+ const matchedFields = [];
133
+ if (title.toLowerCase().includes(lowerQuery)) {
134
+ matchedFields.push("title");
135
+ }
136
+ if (description.toLowerCase().includes(lowerQuery)) {
137
+ matchedFields.push("description");
138
+ }
139
+ if (tags.some((t) => t.toLowerCase() === lowerQuery)) {
140
+ matchedFields.push("tags");
141
+ }
142
+ if (operationType && operationType.toLowerCase() === lowerQuery) {
143
+ matchedFields.push("operation_type");
144
+ }
145
+ if (industry && industry.toLowerCase() === lowerQuery) {
146
+ matchedFields.push("industry");
147
+ }
148
+ if (matchedFields.length > 0) {
149
+ results.push({
150
+ file,
151
+ title,
152
+ description,
153
+ tags,
154
+ industry,
155
+ operation_type: operationType,
156
+ verified: example.verified === true,
157
+ score: matchedFields.length,
158
+ matched_fields: matchedFields,
159
+ });
160
+ }
161
+ }
162
+ catch {
163
+ continue;
164
+ }
165
+ }
166
+ results.sort((a, b) => {
167
+ if (b.score !== a.score)
168
+ return b.score - a.score;
169
+ return a.file.localeCompare(b.file);
170
+ });
171
+ return results;
172
+ }
173
+ export function getSchemaField(name, fieldPath) {
174
+ const schema = getSchema(name);
175
+ if (!schema)
176
+ return null;
177
+ const parts = fieldPath.split(".").filter(Boolean);
178
+ let current = schema;
179
+ for (const part of parts) {
180
+ if (!current || typeof current !== "object")
181
+ return null;
182
+ if (current.properties && part in current.properties) {
183
+ current = current.properties[part];
184
+ continue;
185
+ }
186
+ if (current.items && typeof current.items === "object") {
187
+ if (/^\d+$/.test(part)) {
188
+ current = current.items;
189
+ continue;
190
+ }
191
+ if (current.items.properties && part in current.items.properties) {
192
+ current = current.items.properties[part];
193
+ continue;
194
+ }
195
+ }
196
+ if (Array.isArray(current.oneOf) || Array.isArray(current.anyOf)) {
197
+ const variants = current.oneOf ?? current.anyOf;
198
+ for (const v of variants) {
199
+ if (v && typeof v === "object" && v.properties && part in v.properties) {
200
+ current = v.properties[part];
201
+ break;
202
+ }
203
+ }
204
+ continue;
205
+ }
206
+ if (part in current) {
207
+ current = current[part];
208
+ continue;
209
+ }
210
+ return null;
211
+ }
212
+ return current;
213
+ }
62
214
  function resolveSchemaRefs(schema, visited = new Set()) {
63
215
  if (!schema || typeof schema !== "object") {
64
216
  return schema;
@@ -124,8 +276,99 @@ export function listOperations() {
124
276
  return [];
125
277
  return (index.operations || []).filter(op => op.name.startsWith("onchain_operations_"));
126
278
  }
279
+ function writeResponseToFile(data, preferredPath) {
280
+ try {
281
+ let targetPath;
282
+ if (preferredPath) {
283
+ targetPath = resolve(process.cwd(), preferredPath);
284
+ }
285
+ else {
286
+ if (!existsSync(WORKSPACE_TMP_DIR)) {
287
+ mkdirSync(WORKSPACE_TMP_DIR, { recursive: true });
288
+ }
289
+ const timestamp = Date.now();
290
+ targetPath = join(WORKSPACE_TMP_DIR, `schema-${timestamp}.json`);
291
+ }
292
+ const parentDir = dirname(targetPath);
293
+ if (!existsSync(parentDir)) {
294
+ mkdirSync(parentDir, { recursive: true });
295
+ }
296
+ const jsonStr = typeof data === "string" ? data : JSON.stringify(data, null, 2);
297
+ writeFileSync(targetPath, jsonStr, "utf-8");
298
+ return targetPath;
299
+ }
300
+ catch (e) {
301
+ return null;
302
+ }
303
+ }
127
304
  export function processSchemaQuery(request) {
128
- const { action, name, query } = request;
305
+ const { action, name, query, field_path, template, output_file } = request;
306
+ if (action === "get_guard_templates") {
307
+ const templates = getGuardTemplates(template);
308
+ if (!templates) {
309
+ return {
310
+ success: false,
311
+ action,
312
+ data: null,
313
+ message: template
314
+ ? `Guard template '${template}' not found. Omit 'template' to list all available templates.`
315
+ : "Guard templates file not found. Ensure scripts/guard-templates.json exists.",
316
+ suggestions: [
317
+ "Omit 'template' to list all available templates.",
318
+ "Available template names: signer_verification, progress_node_check, order_owner_verification, service_belonging_check, reward_not_claimed, combined_reward_guard",
319
+ ],
320
+ };
321
+ }
322
+ if (output_file) {
323
+ const filePath = writeResponseToFile(templates, output_file);
324
+ if (filePath) {
325
+ return {
326
+ success: true,
327
+ action,
328
+ data: null,
329
+ message: `Guard template${template ? ` '${template}'` : "s"} written to file: ${filePath}`,
330
+ output_file_path: filePath,
331
+ suggestions: [`Use Read tool to open ${filePath}`],
332
+ };
333
+ }
334
+ }
335
+ return {
336
+ success: true,
337
+ action,
338
+ data: templates,
339
+ message: template
340
+ ? `Retrieved Guard template: ${template}`
341
+ : `Retrieved ${Array.isArray(templates.templates) ? templates.templates.length : 0} Guard templates`,
342
+ };
343
+ }
344
+ if (action === "search_examples") {
345
+ if (!query) {
346
+ return {
347
+ success: false,
348
+ action,
349
+ data: null,
350
+ message: "Search query is required for 'search_examples' action",
351
+ suggestions: [
352
+ "Provide a 'query' string (e.g. 'rental', 'guard', 'service', 'machine')",
353
+ "Searchable fields: title, description, tags, operation_type, industry",
354
+ ],
355
+ };
356
+ }
357
+ const results = searchExamples(query);
358
+ return {
359
+ success: true,
360
+ action,
361
+ data: results,
362
+ message: `Found ${results.length} example(s) matching '${query}'`,
363
+ suggestions: results.length === 0
364
+ ? [
365
+ "Try broader terms like 'service', 'machine', 'guard', 'permission'",
366
+ "Try an industry name: 'rental', 'retail', 'general'",
367
+ "Use 'get' action with a schema name to see the full JSON Schema",
368
+ ]
369
+ : undefined,
370
+ };
371
+ }
129
372
  if (!areSchemasAvailable()) {
130
373
  return {
131
374
  success: false,
@@ -168,6 +411,19 @@ export function processSchemaQuery(request) {
168
411
  : ["Use 'list' action to see available schemas"],
169
412
  };
170
413
  }
414
+ if (output_file) {
415
+ const filePath = writeResponseToFile(schema, output_file);
416
+ if (filePath) {
417
+ return {
418
+ success: true,
419
+ action,
420
+ data: null,
421
+ message: `Schema '${name}' written to file: ${filePath}`,
422
+ output_file_path: filePath,
423
+ suggestions: [`Use Read tool to open ${filePath}`],
424
+ };
425
+ }
426
+ }
171
427
  return {
172
428
  success: true,
173
429
  action,
@@ -175,6 +431,39 @@ export function processSchemaQuery(request) {
175
431
  message: `Retrieved schema: ${name}`,
176
432
  };
177
433
  }
434
+ case "get_field": {
435
+ if (!name || !field_path) {
436
+ return {
437
+ success: false,
438
+ action,
439
+ data: null,
440
+ message: "Both 'name' and 'field_path' are required for 'get_field' action",
441
+ suggestions: [
442
+ "Example: {action: 'get_field', name: 'onchain_operations_machine', field_path: 'data.node'}",
443
+ "Use 'get' action to retrieve the full schema",
444
+ ],
445
+ };
446
+ }
447
+ const fieldSchema = getSchemaField(name, field_path);
448
+ if (!fieldSchema) {
449
+ return {
450
+ success: false,
451
+ action,
452
+ data: null,
453
+ message: `Field path '${field_path}' not found in schema '${name}'`,
454
+ suggestions: [
455
+ "Check the field path (dot-separated, e.g. 'data.node')",
456
+ "Use 'get' action to see the full schema structure",
457
+ ],
458
+ };
459
+ }
460
+ return {
461
+ success: true,
462
+ action,
463
+ data: fieldSchema,
464
+ message: `Retrieved field '${field_path}' from schema '${name}'`,
465
+ };
466
+ }
178
467
  case "search": {
179
468
  if (!query) {
180
469
  return {
@@ -235,6 +524,19 @@ export function processSchemaQuery(request) {
235
524
  : ["Use 'list' action to see available tools"],
236
525
  };
237
526
  }
527
+ if (output_file) {
528
+ const filePath = writeResponseToFile(schema, output_file);
529
+ if (filePath) {
530
+ return {
531
+ success: true,
532
+ action,
533
+ data: null,
534
+ message: `Output schema '${name}' written to file: ${filePath}`,
535
+ output_file_path: filePath,
536
+ suggestions: [`Use Read tool to open ${filePath}`],
537
+ };
538
+ }
539
+ }
238
540
  return {
239
541
  success: true,
240
542
  action,
@@ -248,7 +550,7 @@ export function processSchemaQuery(request) {
248
550
  action,
249
551
  data: null,
250
552
  message: `Unknown action: ${action}`,
251
- suggestions: ["Use 'list', 'get', 'search', or 'list_operations'"],
553
+ suggestions: ["Use 'list', 'get', 'get_field', 'get_output', 'search', 'list_operations', 'get_guard_templates', or 'search_examples'"],
252
554
  };
253
555
  }
254
556
  }
@@ -1271,7 +1271,7 @@
1271
1271
  "testnet",
1272
1272
  "mainnet"
1273
1273
  ],
1274
- "description": "Network entrypoint: Specifies which network the operation occurs on"
1274
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
1275
1275
  }
1276
1276
  },
1277
1277
  "required": [
@@ -1359,6 +1359,12 @@
1359
1359
  "permission_denied",
1360
1360
  "immutable_violation",
1361
1361
  "network_error",
1362
+ "rate_limit",
1363
+ "gas_exceeded",
1364
+ "bcs_error",
1365
+ "signature_error",
1366
+ "config_error",
1367
+ "wip_verification_failed",
1362
1368
  "unknown"
1363
1369
  ],
1364
1370
  "description": "Error classification for programmatic recovery"
@@ -140,7 +140,7 @@
140
140
  "testnet",
141
141
  "mainnet"
142
142
  ],
143
- "description": "Network entrypoint: Specifies which network the operation occurs on"
143
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
144
144
  }
145
145
  },
146
146
  "required": [
@@ -169,7 +169,7 @@
169
169
  },
170
170
  "network": {
171
171
  "$ref": "#/definitions/account_operation/properties/transfer/properties/network",
172
- "description": "Network entrypoint: Specifies which network the operation occurs on"
172
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
173
173
  }
174
174
  },
175
175
  "required": [
@@ -236,7 +236,7 @@
236
236
  }
237
237
  },
238
238
  "additionalProperties": false,
239
- "description": "Account operations. Parameters MUST be wrapped in the operation type property (e.g. {transfer: {...}}, NOT {amount: ...}). Unwrapped parameters are rejected."
239
+ "description": "Account operations (mutations only: gen/faucet/suspend/resume/rename/swap_name/transfer/get/signData/messenger). Parameters MUST be wrapped in the operation type property (e.g. {transfer: {...}}, NOT {amount: ...}). Unwrapped parameters are rejected. TO LIST ALL ACCOUNTS: use the query_toolkit tool with query_type='account_list' (returns name, address, suspended status, messenger status for all local accounts). This separation follows CQRS: account_operation = mutations, query_toolkit = queries. Common workflow after MCP restart: (1) query_toolkit query_type='account_list' to see all accounts, (2) account_operation with the appropriate mutation."
240
240
  }
241
241
  }
242
242
  }
@@ -53,6 +53,12 @@
53
53
  "permission_denied",
54
54
  "immutable_violation",
55
55
  "network_error",
56
+ "rate_limit",
57
+ "gas_exceeded",
58
+ "bcs_error",
59
+ "signature_error",
60
+ "config_error",
61
+ "wip_verification_failed",
56
62
  "unknown"
57
63
  ],
58
64
  "description": "Error classification for programmatic recovery"
@@ -81,7 +81,7 @@
81
81
  "testnet",
82
82
  "mainnet"
83
83
  ],
84
- "description": "Network entrypoint: Specifies which network the operation occurs on"
84
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
85
85
  },
86
86
  "referrer": {
87
87
  "$ref": "#/definitions/bridge_operation/anyOf/0/properties/env/properties/account",