@wowok/agent-mcp 2.6.1 → 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 (125) hide show
  1. package/dist/customer/info-puzzle.d.ts +1 -1
  2. package/dist/customer/info-puzzle.js +4 -2
  3. package/dist/customer/risk-assessment.js +26 -4
  4. package/dist/customer/types.d.ts +2 -0
  5. package/dist/examples/guard-template-balance-check.json +38 -0
  6. package/dist/examples/guard-template-time-lock.json +39 -0
  7. package/dist/examples/machine-template-7node-rental.json +114 -0
  8. package/dist/examples/rental-ziroom-machine-create.json +137 -0
  9. package/dist/examples/rental-ziroom-permission-create.json +35 -0
  10. package/dist/examples/rental-ziroom-service-create.json +80 -0
  11. package/dist/examples/retail-myshop-service-create.json +88 -0
  12. package/dist/extensions/capability-manifest.js +24 -24
  13. package/dist/extensions/constraint-registry.js +18 -18
  14. package/dist/extensions/metric-registry.js +14 -14
  15. package/dist/extensions/mode-evaluator.js +16 -16
  16. package/dist/extensions/modes.js +131 -45
  17. package/dist/extensions/registry.d.ts +2 -0
  18. package/dist/extensions/registry.js +63 -30
  19. package/dist/extensions/types.d.ts +1 -0
  20. package/dist/index.js +50 -0
  21. package/dist/knowledge/deployment-scanner.js +1 -1
  22. package/dist/knowledge/fund-layer.d.ts +72 -0
  23. package/dist/knowledge/fund-layer.js +420 -0
  24. package/dist/knowledge/guard-render.d.ts +57 -0
  25. package/dist/knowledge/guard-render.js +700 -0
  26. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  27. package/dist/knowledge/guard-submission-prompt.js +171 -0
  28. package/dist/knowledge/machine-ledger.js +1 -1
  29. package/dist/knowledge/machine-render.d.ts +41 -0
  30. package/dist/knowledge/machine-render.js +565 -0
  31. package/dist/knowledge/machine-templates.js +4 -4
  32. package/dist/knowledge/reward-confirm.js +2 -2
  33. package/dist/knowledge/reward-puzzle.js +1 -1
  34. package/dist/knowledge/reward-risk.js +9 -9
  35. package/dist/knowledge/reward-templates.js +2 -2
  36. package/dist/knowledge/service-confirm.d.ts +1 -1
  37. package/dist/knowledge/service-confirm.js +3 -3
  38. package/dist/knowledge/service-context.js +1 -1
  39. package/dist/knowledge/service-ledger.js +1 -1
  40. package/dist/knowledge/service-risk.d.ts +1 -1
  41. package/dist/knowledge/service-risk.js +3 -3
  42. package/dist/knowledge/service-templates.js +2 -2
  43. package/dist/knowledge/service-translation.d.ts +1 -1
  44. package/dist/knowledge/service-translation.js +7 -7
  45. package/dist/project/deployment-bridge.js +6 -5
  46. package/dist/project/deployment-doc.js +5 -5
  47. package/dist/project/edit-planner.d.ts +123 -0
  48. package/dist/project/edit-planner.js +1371 -0
  49. package/dist/project/evaluation.js +314 -14
  50. package/dist/project/graph-builder.js +6 -1
  51. package/dist/project/handlers.d.ts +99 -2
  52. package/dist/project/handlers.js +358 -16
  53. package/dist/project/stage-gate.js +4 -4
  54. package/dist/schema/call/allocation.js +2 -2
  55. package/dist/schema/call/arbitration.js +19 -6
  56. package/dist/schema/call/contact.js +2 -2
  57. package/dist/schema/call/demand.js +2 -2
  58. package/dist/schema/call/guard.js +1 -1
  59. package/dist/schema/call/machine.d.ts +1975 -777
  60. package/dist/schema/call/machine.js +50 -4
  61. package/dist/schema/call/order.js +3 -6
  62. package/dist/schema/call/permission.js +2 -2
  63. package/dist/schema/call/repository.js +2 -2
  64. package/dist/schema/call/reward.js +3 -3
  65. package/dist/schema/call/semantic.js +7 -1
  66. package/dist/schema/call/service.d.ts +180 -8
  67. package/dist/schema/call/service.js +82 -27
  68. package/dist/schema/call/treasury.js +3 -3
  69. package/dist/schema/common/index.d.ts +2 -0
  70. package/dist/schema/common/index.js +46 -10
  71. package/dist/schema/local/index.js +5 -1
  72. package/dist/schema/operations.d.ts +755 -176
  73. package/dist/schema/operations.js +43 -7
  74. package/dist/schema/project/index.d.ts +969 -6
  75. package/dist/schema/project/index.js +268 -4
  76. package/dist/schema/query/index.d.ts +217 -0
  77. package/dist/schema/query/index.js +63 -33
  78. package/dist/schema/schema-query/index.d.ts +53 -3
  79. package/dist/schema/schema-query/index.js +17 -2
  80. package/dist/schema/utils/node-parser.js +13 -0
  81. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  82. package/dist/schema/utils/object-type-utils.js +35 -0
  83. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  84. package/dist/schema/utils/permission-machine-check.js +121 -0
  85. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  86. package/dist/schema/utils/skills-recommendation.js +76 -0
  87. package/dist/schema-query/index.d.ts +14 -1
  88. package/dist/schema-query/index.js +104 -2
  89. package/dist/schemas/account_operation.schema.json +1 -1
  90. package/dist/schemas/index.json +1 -1
  91. package/dist/schemas/onchain_events.output.json +1 -1
  92. package/dist/schemas/onchain_operations.output.json +2820 -0
  93. package/dist/schemas/onchain_operations.schema.json +115 -53
  94. package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
  95. package/dist/schemas/onchain_operations_arbitration.schema.json +9 -7
  96. package/dist/schemas/onchain_operations_contact.schema.json +3 -3
  97. package/dist/schemas/onchain_operations_demand.schema.json +3 -3
  98. package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
  99. package/dist/schemas/onchain_operations_guard.schema.json +1 -1
  100. package/dist/schemas/onchain_operations_machine.schema.json +4 -4
  101. package/dist/schemas/onchain_operations_order.schema.json +3 -3
  102. package/dist/schemas/onchain_operations_payment.schema.json +1 -1
  103. package/dist/schemas/onchain_operations_permission.schema.json +2 -2
  104. package/dist/schemas/onchain_operations_progress.schema.json +1 -1
  105. package/dist/schemas/onchain_operations_proof.schema.json +1 -1
  106. package/dist/schemas/onchain_operations_repository.schema.json +3 -3
  107. package/dist/schemas/onchain_operations_reward.schema.json +6 -6
  108. package/dist/schemas/onchain_operations_service.schema.json +77 -17
  109. package/dist/schemas/onchain_operations_treasury.schema.json +4 -4
  110. package/dist/schemas/onchain_table_data.output.json +1 -1
  111. package/dist/schemas/onchain_table_data.schema.json +10 -9
  112. package/dist/schemas/project_operation.output.json +1026 -7
  113. package/dist/schemas/project_operation.schema.json +46 -4
  114. package/dist/schemas/query_toolkit.output.json +15 -15
  115. package/dist/schemas/query_toolkit.schema.json +3 -3
  116. package/dist/schemas/schema_query.output.json +64 -1
  117. package/dist/schemas/schema_query.schema.json +3 -2
  118. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  119. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  120. package/dist/tools/handlers/onchain.js +571 -6
  121. package/dist/tools/handlers/project.js +25 -2
  122. package/dist/tools/handlers/schema-query.js +24 -1
  123. package/dist/tools/index.d.ts +8 -0
  124. package/dist/tools/index.js +177 -6
  125. package/package.json +2 -2
@@ -30,17 +30,23 @@
30
30
  "delete_project",
31
31
  "assemble_context",
32
32
  "get_machine_graph",
33
+ "get_guard_graph",
33
34
  "generate_deployment_doc",
34
35
  "pre_evaluate_check",
35
36
  "verify_deployment",
36
37
  "clone_project_to_network",
37
- "migrate_network"
38
+ "migrate_network",
39
+ "migrate_to_mainnet",
40
+ "plan_object_edit",
41
+ "apply_object_edit",
42
+ "patch_machine_nodes",
43
+ "patch_guard_tree"
38
44
  ],
39
45
  "description": "Action to perform. Two categories:\n1. Project Entity + Evaluation (15, GLM6): list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff. Projects are first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine.\n2. Context Assembly (1): assemble_context (query on-chain object states + extract embedded history + optional events, and assemble a structured semantic context for LLM consumption). Required input: context_objects (array of object IDs/names). Optional: include_events (query recent state-transition events).\n3. Cross-Network Migration (FIX-012): clone_project_to_network (or its alias migrate_network) copies a source project's object metadata to a new project bound to target_network. The 5-step migration workflow: 1) call clone_project_to_network (or migrate_network) with target_network to copy metadata, 2) re-run onchain_operations with env.network=target_network to deploy objects on-chain, 3) re-register LocalMark names with the SAME names on the target network (FIX-011 cross-network consistency), 4) update_project to set service_address on the new project, 5) build_graph to construct the new project's relationship graph."
40
46
  },
41
47
  "project": {
42
48
  "type": "string",
43
- "description": "Project prefix (human-readable unique identifier). Used by create_version, build_graph, evaluate_project, etc. Takes precedence resolution: project_id > project (prefix)."
49
+ "description": "Project prefix (human-readable unique identifier). For create_project: OPTIONAL — if omitted, auto-derived from project_name (e.g. 'Twitch Service' → 'twitch_service'). For other actions (build_graph, evaluate_project, etc.): used to identify the project. Takes precedence resolution: project_id > project (prefix)."
44
50
  },
45
51
  "version": {
46
52
  "type": "string",
@@ -109,6 +115,7 @@
109
115
  "enum": [
110
116
  "general",
111
117
  "retail",
118
+ "retail_d2c",
112
119
  "service",
113
120
  "rental",
114
121
  "freelance",
@@ -117,7 +124,7 @@
117
124
  "subscription",
118
125
  "custom"
119
126
  ],
120
- "description": "Industry tag for create_project. Drives template defaults — when set (and not 'general'), the system auto-applies an industry blueprint with ~10 draft objects (Permission, Service, Machine, Guard, Treasury, Allocation, etc.) + graph edges, ready for deployment. Supported industries: 'general' (no template), 'retail', 'service', 'rental', 'freelance', 'education', 'travel', 'subscription', 'custom'. Each industry preset embeds risk constraints (e.g., 'freelance' does NOT require compensation_fund, while 'rental'/'travel' do). Example: project_industry='freelance' creates a freelance-style blueprint with setting_locked_time ≥ 7d. Set skip_templates=true to bypass template application."
127
+ "description": "Industry tag for create_project. Drives template defaults — when set (and not 'general'), the system auto-applies an industry blueprint with ~10 draft objects (Permission, Service, Machine, Guard, Treasury, Allocation, etc.) + graph edges, ready for deployment. Supported industries: 'general' (no template), 'retail', 'retail_d2c' (Direct-to-Consumer, e.g., Shopify — Allocation escrow + 2 Guards), 'service', 'rental', 'freelance', 'education', 'travel', 'subscription', 'custom'. Each industry preset embeds risk constraints (e.g., 'freelance' does NOT require compensation_fund, while 'rental'/'travel' do). Example: project_industry='freelance' creates a freelance-style blueprint with setting_locked_time ≥ 7d. Set skip_templates=true to bypass template application."
121
128
  },
122
129
  "project_perspective": {
123
130
  "type": "string",
@@ -297,7 +304,7 @@
297
304
  },
298
305
  "refresh_before_eval": {
299
306
  "type": "boolean",
300
- "description": "When true, evaluate_project refreshes object cache from chain before evaluating. Default false."
307
+ "description": "When true (DEFAULT), evaluate_project refreshes object cache from chain before evaluating. Set to false ONLY for read-only checks where staleness is acceptable (e.g., quick comparisons). BUG-P0-2 fix: previously defaulted to false, causing stale Machine node_count and other dynamic-field-derived fields to produce false findings (e.g., 'Machine has no nodes'). Now defaults to true — set refresh_before_eval=false explicitly to skip refresh."
301
308
  },
302
309
  "eval_score": {
303
310
  "type": "number",
@@ -355,6 +362,41 @@
355
362
  "full"
356
363
  ],
357
364
  "description": "P2-03: Deployment document detail level (only for generate_deployment_doc). 'summary' (default): object name + type + key bindings (machine, permission, buy_guard, order_allocators). 'detailed': adds sale list, arbitration list, reward list. 'full': complete fields including stock, price, wip_hash, all config. Use 'summary' for quick review; request 'detailed' or 'full' only when deeper inspection is needed."
365
+ },
366
+ "object_kind": {
367
+ "type": "string",
368
+ "enum": [
369
+ "machine",
370
+ "guard"
371
+ ],
372
+ "description": "Object kind for plan_object_edit. 'machine' = Machine workflow directed graph (cycles allowed), 'guard' = Guard computation tree. Required when action='plan_object_edit'. Inferred from action for patch_machine_nodes (always 'machine') and patch_guard_tree (always 'guard')."
373
+ },
374
+ "edit_format": {
375
+ "type": "string",
376
+ "enum": [
377
+ "tree_outline",
378
+ "json"
379
+ ],
380
+ "description": "Format of the edited content for plan_object_edit. 'tree_outline' (default): the indented Markdown outline produced by get_machine_graph / get_guard_graph (human-editable). 'json': raw JSON (machine-readable, for programmatic edits). Both formats are bidirectional with the parse functions in knowledge/machine-render.ts / guard-render.ts."
381
+ },
382
+ "edited_content": {
383
+ "type": "string",
384
+ "description": "Edited content for plan_object_edit. Must be in the format specified by edit_format. For 'tree_outline': the full tree_outline string from get_machine_graph/get_guard_graph with user edits. For 'json': a JSON string matching the Machine/Guard schema. The content is parsed + validated + diffed against the current on-chain state."
385
+ },
386
+ "plan_id": {
387
+ "type": "string",
388
+ "description": "Plan ID returned by plan_object_edit. Required for apply_object_edit. The plan is short-lived (10-minute TTL) and stored in-memory."
389
+ },
390
+ "expected_hash": {
391
+ "type": "string",
392
+ "description": "Expected hash returned by plan_object_edit. Required for apply_object_edit. Used for optimistic concurrency control: if the on-chain state changed between plan and apply, the hash will mismatch and apply will refuse to proceed (stale edit protection)."
393
+ },
394
+ "patch_operations": {
395
+ "type": "array",
396
+ "items": {
397
+ "type": "string"
398
+ },
399
+ "description": "Patch operations for patch_machine_nodes / patch_guard_tree. Each string is a single patch operation.\nMachine operations (13 total):\n 'add node <name>' | 'remove node <name>' | 'set description <node_name> <text...>'\n 'add edge <from> <to>' | 'remove edge <from> <to>' | 'set threshold <edge_from> <edge_to> <value>'\n 'add forward <edge_from> <edge_to> <forward_name>' | 'remove forward <edge_from> <edge_to> <forward_name>'\n 'set guard <edge_from> <edge_to> <forward_name> <guard_addr_or_name|none>'\n 'set permission <edge_from> <edge_to> <forward_name> <perm_index>'\n 'set operator <edge_from> <edge_to> <forward_name> <named_operator|none>'\n 'set weight <edge_from> <edge_to> <forward_name> <weight>'\n 'set retained_submission <edge_from> <edge_to> <forward_name> <comma_separated_indices|none>'\nGuard operations (8 total — see patch_guard_tree):\n 'add table <identifier> <name|none> <value_type> <b_submission> [json_value]'\n 'remove table <identifier>' | 'set table_value <identifier> [json_value|none]'\n 'set table_name <identifier> <name|none>' | 'set table_submission <identifier> <true|false>'\n 'set root <json_node>' | 'set rely <comma_separated_guard_addresses|none>'\nOperations are applied in order. Both patches are validated (validateMachine/validateGuard) before execution."
358
400
  }
359
401
  },
360
402
  "required": [
@@ -2819,10 +2819,10 @@
2819
2819
  "Signer"
2820
2820
  ],
2821
2821
  "additionalProperties": false,
2822
- "description": "Current transaction signer ID"
2822
+ "description": "Current transaction signer (tx_context::sender) at the time of the alloc() call. For refunds, the Order owner must call alloc_by_guard themselves to receive the funds."
2823
2823
  }
2824
2824
  ],
2825
- "description": "Recipient of this allocation. Three forms:\n• { GuardIdentifier: u8 } — resolved from Passport at allocation time. Use 0 for Order owner in Service-integrated mode (Customer who created the Order). The identifier must match a Guard table entry with b_submission=true. If Passport has no matching submission, contract aborts with E_VERIFY_FAILED.\n• { Entity: { name_or_address: '...' } } — static address resolved via LocalMark. Use for known recipients (e.g., 'turo_host', or a Treasury object address).\n• 'Signer' — the transaction sender (tx_context::sender). Use when the recipient is the current signer (e.g., self-refund scenarios)."
2825
+ "description": "Recipient of this allocation. Three forms — each resolves the address at a DIFFERENT time:\n• { GuardIdentifier: u8 } — DYNAMIC address resolved from Passport at alloc() time (contract calls passport::submission_get). Use 0 for Order owner in Service-integrated mode (Customer who created the Order). The identifier must match a Guard table entry with b_submission=true. If Passport has no matching submission, contract aborts with E_VERIFY_FAILED. Use when the recipient address is not known at config time and must be supplied via Guard submission data.\n• { Entity: { name_or_address: '...' } } — FIXED address resolved via LocalMark at SDK build time (passed to contract as a literal address). Use for known recipients (e.g., 'turo_host', or a Treasury object address). Use when the recipient is a stable, known address (e.g., operator receives rent, platform fee to treasury).\n• 'Signer' — the transaction sender at the time of the alloc() call (tx_context::sender). RESOLVED AT EXECUTION TIME, not at config time. For refunds: the customer (Order owner) must call alloc_by_guard THEMSELVES so that tx_context::sender resolves to THEIR address — if the operator calls alloc_by_guard, the operator becomes the recipient (Signer = operator), NOT the customer. Use when the recipient is whoever submits the allocation transaction (e.g., customer receives refund)."
2826
2826
  },
2827
2827
  "sharing": {
2828
2828
  "type": [
@@ -2873,7 +2873,7 @@
2873
2873
  "type": "null"
2874
2874
  }
2875
2875
  ],
2876
- "description": "Maximum allocation cap (optional). Has THREE effects:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: total_rates = max - fix (instead of balance - fix)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount)."
2876
+ "description": "Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). Passed through to the contract as Option<u64> via allocator_add(): when null/omitted the contract treats it as `none` (no cap); when set, the contract enforces it. Has THREE effects when set:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: total_rates = max - fix (instead of balance - fix)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort."
2877
2877
  }
2878
2878
  },
2879
2879
  "required": [
@@ -4950,10 +4950,10 @@
4950
4950
  "Signer"
4951
4951
  ],
4952
4952
  "additionalProperties": false,
4953
- "description": "Current transaction signer ID"
4953
+ "description": "Current transaction signer (tx_context::sender) at the time of the alloc() call. For refunds, the Order owner must call alloc_by_guard themselves to receive the funds."
4954
4954
  }
4955
4955
  ],
4956
- "description": "Recipient of this allocation. Three forms:\n• { GuardIdentifier: u8 } — resolved from Passport at allocation time. Use 0 for Order owner in Service-integrated mode (Customer who created the Order). The identifier must match a Guard table entry with b_submission=true. If Passport has no matching submission, contract aborts with E_VERIFY_FAILED.\n• { Entity: { name_or_address: '...' } } — static address resolved via LocalMark. Use for known recipients (e.g., 'turo_host', or a Treasury object address).\n• 'Signer' — the transaction sender (tx_context::sender). Use when the recipient is the current signer (e.g., self-refund scenarios)."
4956
+ "description": "Recipient of this allocation. Three forms — each resolves the address at a DIFFERENT time:\n• { GuardIdentifier: u8 } — DYNAMIC address resolved from Passport at alloc() time (contract calls passport::submission_get). Use 0 for Order owner in Service-integrated mode (Customer who created the Order). The identifier must match a Guard table entry with b_submission=true. If Passport has no matching submission, contract aborts with E_VERIFY_FAILED. Use when the recipient address is not known at config time and must be supplied via Guard submission data.\n• { Entity: { name_or_address: '...' } } — FIXED address resolved via LocalMark at SDK build time (passed to contract as a literal address). Use for known recipients (e.g., 'turo_host', or a Treasury object address). Use when the recipient is a stable, known address (e.g., operator receives rent, platform fee to treasury).\n• 'Signer' — the transaction sender at the time of the alloc() call (tx_context::sender). RESOLVED AT EXECUTION TIME, not at config time. For refunds: the customer (Order owner) must call alloc_by_guard THEMSELVES so that tx_context::sender resolves to THEIR address — if the operator calls alloc_by_guard, the operator becomes the recipient (Signer = operator), NOT the customer. Use when the recipient is whoever submits the allocation transaction (e.g., customer receives refund)."
4957
4957
  },
4958
4958
  "sharing": {
4959
4959
  "type": [
@@ -5007,7 +5007,7 @@
5007
5007
  "type": "null"
5008
5008
  }
5009
5009
  ],
5010
- "description": "Maximum allocation cap (optional). Has THREE effects:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: total_rates = max - fix (instead of balance - fix)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount)."
5010
+ "description": "Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). Passed through to the contract as Option<u64> via allocator_add(): when null/omitted the contract treats it as `none` (no cap); when set, the contract enforces it. Has THREE effects when set:\n1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n2. Rate execution: total_rates = max - fix (instead of balance - fix)\n3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\nUse when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort."
5011
5011
  }
5012
5012
  },
5013
5013
  "required": [
@@ -5347,10 +5347,10 @@
5347
5347
  "Signer"
5348
5348
  ],
5349
5349
  "additionalProperties": false,
5350
- "description": "Current transaction signer ID"
5350
+ "description": "Current transaction signer (tx_context::sender) at the time of the alloc() call. For refunds, the Order owner must call alloc_by_guard themselves to receive the funds."
5351
5351
  }
5352
5352
  ],
5353
- "description": "Recipient ID. Three forms:\n - {GuardIdentifier: u8} — resolved from Passport at allocation time\n - {Entity: {name_or_address: 'mark_name'}} — static address via LocalMark (recommended)\n - {Signer: 'signer'} — transaction sender (e.g. self-refund)"
5353
+ "description": "Recipient ID. Three forms:\n - {GuardIdentifier: u8} — DYNAMIC address resolved from Passport at alloc() time\n - {Entity: {name_or_address: 'mark_name'}} — FIXED static address via LocalMark (recommended)\n - {Signer: 'signer'} — transaction sender at alloc() time (e.g. self-refund; customer must call alloc_by_guard themselves)"
5354
5354
  },
5355
5355
  "amount": {
5356
5356
  "anyOf": [
@@ -5384,7 +5384,7 @@
5384
5384
  "number",
5385
5385
  "string"
5386
5386
  ],
5387
- "description": "A coin/balance amount in the smallest on-chain unit (u64). Accepts a JS number OR a numeric string. PRECISION RULE: for values exceeding 2^53 (e.g. token amounts with 18 decimals), ALWAYS pass a numeric STRING (e.g. \"1000000000000000000\") to preserve precision — JS numbers lose precision above 2^53. UNIT: this is the smallest unit, NOT the display unit. For SUI: 1 SUI = 10^9 MIST, so 10 SUI = 10000000000. For custom tokens: use the token's native smallest unit (decimals from coin metadata). Examples: 10000000000 (10 SUI), \"1000000000000000000\" (1 token with 18 decimals), 500 (500 units of a token with 0 decimals). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
5387
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
5388
5388
  }
5389
5389
  },
5390
5390
  "required": [
@@ -6384,17 +6384,17 @@
6384
6384
  "Signer"
6385
6385
  ],
6386
6386
  "additionalProperties": false,
6387
- "description": "Current transaction signer ID"
6387
+ "description": "Current transaction signer (tx_context::sender) at the time of the alloc() call. For refunds, the Order owner must call alloc_by_guard themselves to receive the funds."
6388
6388
  }
6389
6389
  ],
6390
- "description": "Recipient ID. Three forms:\n - {GuardIdentifier: u8} — resolved from Passport at allocation time\n - {Entity: {name_or_address: 'mark_name'}} — static address via LocalMark (recommended)\n - {Signer: 'signer'} — transaction sender (e.g. self-refund)"
6390
+ "description": "Recipient ID. Three forms:\n - {GuardIdentifier: u8} — DYNAMIC address resolved from Passport at alloc() time\n - {Entity: {name_or_address: 'mark_name'}} — FIXED static address via LocalMark (recommended)\n - {Signer: 'signer'} — transaction sender at alloc() time (e.g. self-refund; customer must call alloc_by_guard themselves)"
6391
6391
  },
6392
6392
  "amount": {
6393
6393
  "type": [
6394
6394
  "number",
6395
6395
  "string"
6396
6396
  ],
6397
- "description": "A coin/balance amount in the smallest on-chain unit (u64). Accepts a JS number OR a numeric string. PRECISION RULE: for values exceeding 2^53 (e.g. token amounts with 18 decimals), ALWAYS pass a numeric STRING (e.g. \"1000000000000000000\") to preserve precision — JS numbers lose precision above 2^53. UNIT: this is the smallest unit, NOT the display unit. For SUI: 1 SUI = 10^9 MIST, so 10 SUI = 10000000000. For custom tokens: use the token's native smallest unit (decimals from coin metadata). Examples: 10000000000 (10 SUI), \"1000000000000000000\" (1 token with 18 decimals), 500 (500 units of a token with 0 decimals). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
6397
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
6398
6398
  }
6399
6399
  },
6400
6400
  "required": [
@@ -8445,7 +8445,7 @@
8445
8445
  "number",
8446
8446
  "string"
8447
8447
  ],
8448
- "description": "A coin/balance amount in the smallest on-chain unit (u64). Accepts a JS number OR a numeric string. PRECISION RULE: for values exceeding 2^53 (e.g. token amounts with 18 decimals), ALWAYS pass a numeric STRING (e.g. \"1000000000000000000\") to preserve precision — JS numbers lose precision above 2^53. UNIT: this is the smallest unit, NOT the display unit. For SUI: 1 SUI = 10^9 MIST, so 10 SUI = 10000000000. For custom tokens: use the token's native smallest unit (decimals from coin metadata). Examples: 10000000000 (10 SUI), \"1000000000000000000\" (1 token with 18 decimals), 500 (500 units of a token with 0 decimals). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
8448
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
8449
8449
  },
8450
8450
  {
8451
8451
  "type": "null"
@@ -13142,7 +13142,7 @@
13142
13142
  "additionalProperties": false,
13143
13143
  "description": "Forward in Machine object"
13144
13144
  },
13145
- "description": "Forward list — operations to ENTER THIS NODE from prev_node. Example: pair {prev_node:'A', forwards:[{name:'Go'}]} means 'use Go to advance FROM A TO THIS NODE'. For initial node (prev_node=''), forwards are operations to enter this node from the start state. WARNING: forwards belong to the DESTINATION node's pair, NOT the source node. Placing a forward on the wrong pair will cause Progress to get stuck."
13145
+ "description": "Forward list — operations to ENTER THIS NODE from prev_node. SEMANTIC CLARIFICATION: forwards describe INCOMING transitions (how to ARRIVE at this node), NOT outgoing transitions. Think of each forward as an 'entry door' to this node. Example: pair {prev_node:'A', forwards:[{name:'Go'}]} means 'use Go to advance FROM A TO THIS NODE'. For initial node (prev_node=''), forwards are operations to enter this node from the start state. DIAGRAM: A --[Go]--> B means the pair belongs to node B (destination), with prev_node='A'. WARNING: forwards belong to the DESTINATION node's pair, NOT the source node. Placing a forward on the wrong pair will cause Progress to get stuck."
13146
13146
  }
13147
13147
  },
13148
13148
  "required": [
@@ -14201,7 +14201,7 @@
14201
14201
  "number",
14202
14202
  "string"
14203
14203
  ],
14204
- "description": "A coin/balance amount in the smallest on-chain unit (u64). Accepts a JS number OR a numeric string. PRECISION RULE: for values exceeding 2^53 (e.g. token amounts with 18 decimals), ALWAYS pass a numeric STRING (e.g. \"1000000000000000000\") to preserve precision — JS numbers lose precision above 2^53. UNIT: this is the smallest unit, NOT the display unit. For SUI: 1 SUI = 10^9 MIST, so 10 SUI = 10000000000. For custom tokens: use the token's native smallest unit (decimals from coin metadata). Examples: 10000000000 (10 SUI), \"1000000000000000000\" (1 token with 18 decimals), 500 (500 units of a token with 0 decimals). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
14204
+ "description": "A coin/balance amount. Accepts three formats: (1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — auto-converted to smallest units via the Fund Processing Layer (token precision resolved from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. (2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. (3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). For custom tokens: use display format with the token's symbol, or pass smallest units directly. MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities."
14205
14205
  },
14206
14206
  "token_type": {
14207
14207
  "type": "string",
@@ -252,7 +252,7 @@
252
252
  },
253
253
  "name_or_address": {
254
254
  "type": "string",
255
- "description": "Account name or address. Use empty string '' for the default account. Defaults to '' if omitted."
255
+ "description": "Account name or address to query. Examples: \"my_account\", \"0xabc123...\", or \"\" for the default account. NOTE: This field is NOT named 'filter' — use 'name_or_address' directly. Defaults to '' (default account) if omitted."
256
256
  },
257
257
  "balance": {
258
258
  "type": "boolean",
@@ -281,7 +281,7 @@
281
281
  },
282
282
  "token_type": {
283
283
  "type": "string",
284
- "description": "Token type to query; defaults to 0x2::wow::WOW (platform token)"
284
+ "description": "Token type in Move format: 0x<package>::<module>::<struct>. Examples: \"0x2::wow::WOW\" (default, 9 decimals), \"0x2::sui::SUI\" (9 decimals). For custom tokens, use the full type string from the token's coin metadata. The Fund Processing Layer resolves precision from the official registry → cache → on-chain."
285
285
  },
286
286
  "network": {
287
287
  "type": "string",
@@ -297,7 +297,7 @@
297
297
  "query_type"
298
298
  ],
299
299
  "additionalProperties": false,
300
- "description": "Query an account's coin balance OR paginated coin objects. Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. Returns: { address, balance? | coin? }"
300
+ "description": "Query an account's coin balance OR paginated coin objects. PARAMETERS: Use 'name_or_address' to specify the account (NOT 'filter'). Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. Use token_type to query non-default tokens (format: 0x<package>::<module>::<struct>). Returns: { address, balance? | coin? }"
301
301
  },
302
302
  {
303
303
  "type": "object",
@@ -43,6 +43,69 @@
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": {},
@@ -53,7 +116,7 @@
53
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/get_field, Guard template data for get_guard_templates, null on failure or when output_file is used."
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",
@@ -17,9 +17,10 @@
17
17
  "search",
18
18
  "list_operations",
19
19
  "get_guard_templates",
20
- "get_field"
20
+ "get_field",
21
+ "search_examples"
21
22
  ],
22
- "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)."
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)."
23
24
  },
24
25
  "name": {
25
26
  "type": "string",
@@ -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": "Name"
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": "Built-in permissions result"
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/2/properties/result/items/properties/returnType"
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/2/properties/result/items/properties/returnType",
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 built-in permissions"
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": "Built-in permissions query"
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",