@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
@@ -147,7 +147,7 @@
147
147
  "number",
148
148
  "string"
149
149
  ],
150
- "description": "Balance type"
150
+ "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."
151
151
  }
152
152
  },
153
153
  "required": [
@@ -170,7 +170,7 @@
170
170
  "additionalProperties": false
171
171
  }
172
172
  ],
173
- "description": "Actual payment amount"
173
+ "description": "Actual payment amount. FORMAT: {balance: <amount_in_smallest_unit>} or {coin: <coin_object_id>}. The token type and precision are determined by the Service object's type_parameter (the generic type set when the Service was created). For WOW (9 decimals): {balance: 1000000000} = 1 WOW. For SUI (9 decimals): {balance: 1000000000} = 1 SUI."
174
174
  },
175
175
  "discount": {
176
176
  "type": "string",
@@ -248,15 +248,15 @@
248
248
  }
249
249
  },
250
250
  "additionalProperties": false,
251
- "description": "Set the local name of the order object."
251
+ "description": "RECOMMENDED: Set a local name for the newly created Order object. Without this, the Order is only referenceable by its on-chain address. Example: {name: 'my_order_v1'} allows subsequent operations to use 'my_order_v1' instead of the address."
252
252
  },
253
253
  "namedNewAllocation": {
254
254
  "$ref": "#/definitions/data/properties/order_new/properties/namedNewOrder",
255
- "description": "Set the local name of the order's Allocation object."
255
+ "description": "RECOMMENDED: Set a local name for the order's Allocation object. Without this, the Allocation is only referenceable by its address. Example: {name: 'my_allocation_v1'} allows alloc_by_guard to reference 'my_allocation_v1'."
256
256
  },
257
257
  "namedNewProgress": {
258
258
  "$ref": "#/definitions/data/properties/order_new/properties/namedNewOrder",
259
- "description": "Set the local name of the order's Progress object."
259
+ "description": "RECOMMENDED: Set a local name for the order's Progress object. Without this, the Progress is only referenceable by its address. Example: {name: 'my_progress_v1'} allows progress operations to use 'my_progress_v1'."
260
260
  }
261
261
  },
262
262
  "required": [
@@ -311,11 +311,11 @@
311
311
  },
312
312
  "wip": {
313
313
  "type": "string",
314
- "description": "HTTP URL of wip file"
314
+ "description": "WIP file URL. EMPTY string \"\" skips verification (TESTING ONLY). Production MUST use a real HTTP URL pointing to a .wip file generated by the wip_file tool. Example: \"https://cdn.example.com/products/phone_v1.wip\""
315
315
  },
316
316
  "wip_hash": {
317
317
  "type": "string",
318
- "description": "Hash of WIP. If EMPTY string, the hash within wip will be automatically used; else, the consistency of the hash within wip will be verified with the provided hash."
318
+ "description": "WIP file hash (hex string). EMPTY string \"\" skips hash comparison (TESTING ONLY). Production: fill with the hash you saw when viewing the product, to prevent merchant replacing the WIP file before order."
319
319
  }
320
320
  },
321
321
  "required": [
@@ -467,7 +467,7 @@
467
467
  },
468
468
  "arbitrations": {
469
469
  "$ref": "#/definitions/data/properties/repositories",
470
- "description": "Service Arbitration object list."
470
+ "description": "Service Arbitration object list. FORMAT: same as repositories — use the `objects` field name inside the operation data. Example: {arbitrations: [{name: 'my_arb_1'}, {name: 'my_arb_2'}]}. Each item is a NameOrAddress (object ID or local mark name)."
471
471
  },
472
472
  "machine": {
473
473
  "anyOf": [
@@ -490,14 +490,16 @@
490
490
  "discount_type": {
491
491
  "anyOf": [
492
492
  {
493
- "type": "number",
494
- "const": 0,
495
- "description": "Rate discount type"
493
+ "type": "string",
494
+ "enum": [
495
+ "RATES",
496
+ "FIXED"
497
+ ]
496
498
  },
497
499
  {
498
- "type": "number",
499
- "const": 1,
500
- "description": "Fixed discount type"
500
+ "type": "integer",
501
+ "minimum": 0,
502
+ "maximum": 1
501
503
  }
502
504
  ],
503
505
  "description": "Discount type"
@@ -588,7 +590,7 @@
588
590
  "threshold": {
589
591
  "$ref": "#/definitions/data/properties/order_new/properties/buy/properties/total_pay/anyOf/0/properties/balance",
590
592
  "default": 0,
591
- "description": "Threshold. If defined, fund allocation will be triggered when amount in Allocation object reaches this threshold."
593
+ "description": "Minimum balance required for allocation to fire. When the Allocation object's balance < threshold, allocation aborts with EINSUFFICIENT_BALANCE=7. Also: when an Allocator has only Amount items (no Rate, no Surplus), the sum of Amount items must be >= threshold (EAMOUNT_BELOW_THRESHOLD=12). Set to 0 (default) to allow any balance."
592
594
  },
593
595
  "allocators": {
594
596
  "type": "array",
@@ -597,7 +599,7 @@
597
599
  "properties": {
598
600
  "guard": {
599
601
  "$ref": "#/definitions/data/properties/object/anyOf/0",
600
- "description": "Guard object ID. If Guard verification passes, fund allocation will start automatically."
602
+ "description": "Guard object ID or name. If Guard verification passes (via Passport), fund allocation for THIS Allocator fires. Each Allocator in an Allocators list can have a different Guard — the first Allocator whose Guard returns true wins. This enables mutually exclusive allocation paths (e.g., refund Guard on 'return_approved' node vs damage Guard on 'damage_confirmed' node)."
601
603
  },
602
604
  "sharing": {
603
605
  "type": "array",
@@ -633,7 +635,7 @@
633
635
  "Entity"
634
636
  ],
635
637
  "additionalProperties": false,
636
- "description": "Determined ID"
638
+ "description": "Static address resolved via LocalMark. Format: {Entity: {name_or_address: 'mark_name'}} — NOTE: Entity is an OBJECT with name_or_address field, NOT a bare string."
637
639
  },
638
640
  {
639
641
  "type": "object",
@@ -647,26 +649,35 @@
647
649
  "Signer"
648
650
  ],
649
651
  "additionalProperties": false,
650
- "description": "Current transaction signer ID"
652
+ "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."
651
653
  }
652
654
  ],
653
- "description": "Recipient ID"
655
+ "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)."
654
656
  },
655
657
  "sharing": {
656
658
  "type": [
657
659
  "number",
658
660
  "string"
659
661
  ],
660
- "description": "Reward allocation value"
662
+ "description": "Allocation value. SEMANTICS DEPEND ON `mode`:\n• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). Allocated first; sum of Amount items cached as `fix`.\n• mode='Rate': basis-points rate, 10000 = 100% (e.g., '7500' for 75%, '2500' for 25%). When no Surplus in same Allocator, sum MUST == 10000; when Surplus present, sum MUST <= 10000.\n• mode='Surplus': IGNORED (contract forces to 0). Set to '0' for clarity. Receives remaining balance after Amount + Rate allocations."
661
663
  },
662
664
  "mode": {
663
- "type": "string",
664
- "enum": [
665
- "Amount",
666
- "Rate",
667
- "Surplus"
665
+ "anyOf": [
666
+ {
667
+ "type": "string",
668
+ "enum": [
669
+ "Amount",
670
+ "Rate",
671
+ "Surplus"
672
+ ]
673
+ },
674
+ {
675
+ "type": "integer",
676
+ "minimum": 0,
677
+ "maximum": 2
678
+ }
668
679
  ],
669
- "description": "Reward allocation mode"
680
+ "description": "Allocation mode — determines how the `sharing` field is interpreted. Three modes can be used individually OR combined within a single Allocator; when combined, allocation order is strictly: Amount first, then Rate, then Surplus. Understanding these modes allows modeling almost any fund distribution pattern.\n• Amount (0): `sharing` is a FIXED amount in smallest unit (e.g., '750000000' = 0.75 WOW). Allocated FIRST; sum of all Amount items is cached as `fix` by the contract. Validation: when no Rate and no Surplus items exist, sum of Amount items must be >= allocators.threshold (EAMOUNT_BELOW_THRESHOLD=12); when `max` is set, sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13).\n• Rate (1): `sharing` is a basis-points rate (10000 = 100%). Allocated AFTER Amount; formula: allocated = (sharing × total_rates) / 10000, where total_rates = balance - fix (or max - fix if `max` is set). Validation: when no Surplus items exist, sum of all Rate items must be EXACTLY 10000 (ERATE_NOT_10000=4); when Surplus items exist, sum of all Rate items must be <= 10000 (ERATE_EXCEEDS_10000=6).\n• Surplus (2): `sharing` is IGNORED (contract forces it to 0). Allocated LAST; receives the remaining balance after Amount + Rate allocations. Validation: MAX ONE Surplus item per Allocator (EMULTIPLE_SURPLUS=5). When Surplus exists, Rate sum constraint relaxes from == 10000 to <= 10000.\nALLOCATION ORDER (strict): Amount items (fixed, cached as fix) → Rate items (proportional to balance-fix) → Surplus item (remaining).\nRECOMMENDATION: Use Amount mode for known fixed amounts (clearer, no sum constraint). Use Rate mode for proportional splits (requires sum == 10000 unless Surplus present). Use Surplus to capture remainder (e.g., platform fee + host gets rest). Accepts string ('Amount'/'Rate'/'Surplus', recommended) or number (0/1/2)."
670
681
  }
671
682
  },
672
683
  "required": [
@@ -675,13 +686,13 @@
675
686
  "mode"
676
687
  ],
677
688
  "additionalProperties": false,
678
- "description": "Fund allocation item"
689
+ "description": "Fund allocation item — one recipient's share of the Allocation balance. The `sharing` value's meaning depends on `mode` (see AllocationModeSchema). Multiple items in the same Allocator are evaluated together: Amount items first, Rate items second, Surplus last."
679
690
  },
680
- "description": "Fund allocation item list. Each item represents a recipient and their corresponding reward allocation value."
691
+ "description": "Fund allocation item list. Each item specifies a recipient (who), a value (sharing), and a mode. Items can mix modes (Amount + Rate + Surplus) within the same Allocator. ALLOCATION ORDER: Amount items first (cached as fix) → Rate items (proportional to balance - fix) → Surplus item (remaining). CONSTRAINTS: max ONE Surplus item per Allocator; Rate sum must == 10000 (no Surplus) or <= 10000 (with Surplus); Amount sum must >= threshold (no Rate and no Surplus) and <= max (if max set)."
681
692
  },
682
693
  "fix": {
683
694
  "$ref": "#/definitions/data/properties/order_new/properties/buy/properties/total_pay/anyOf/0/properties/balance",
684
- "description": "Fixed allocation amount. If specified, all recipients will receive the fixed allocation amount."
695
+ "description": "OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. Computed by the contract during `allocator_add` — DO NOT set this field at creation. Used internally to compute `total_rates = balance - fix` for Rate allocation."
685
696
  },
686
697
  "max": {
687
698
  "anyOf": [
@@ -692,7 +703,7 @@
692
703
  "type": "null"
693
704
  }
694
705
  ],
695
- "description": "Maximum allocation amount. If specified, allocation amount cannot exceed maximum allocation amount."
706
+ "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."
696
707
  }
697
708
  },
698
709
  "required": [
@@ -700,9 +711,9 @@
700
711
  "sharing"
701
712
  ],
702
713
  "additionalProperties": false,
703
- "description": "Fund allocator"
714
+ "description": "Fund allocator — a complete allocation strategy triggered by a Guard. Contains a sharing[] array where items can mix Amount/Rate/Surplus modes. When the Guard passes, the contract allocates funds in strict order: Amount → Rate → Surplus."
704
715
  },
705
- "description": "Fund allocator list. Each fund allocator represents a fund allocation strategy."
716
+ "description": "Fund allocator list. Each allocator is evaluated in order; the FIRST allocator whose Guard passes wins. This enables mutually exclusive allocation paths (e.g., 3 allocators for 3 forward paths: refund / damage-deduct / arbitrate)."
706
717
  }
707
718
  },
708
719
  "required": [
@@ -710,13 +721,13 @@
710
721
  "allocators"
711
722
  ],
712
723
  "additionalProperties": false,
713
- "description": "Fund allocator list"
724
+ "description": "Fund allocator list — the top-level allocation configuration attached to an Order. Contains a threshold and a list of Allocators. When funds arrive at the Order, the first Allocator whose Guard passes executes its sharing[] in strict order: Amount → Rate → Surplus. MULTI-TIER ALLOCATION (DOC-04): Each Order binds ONE Allocators template (set on Service.order_allocators before publish). For multi-tier distribution (e.g., customer→agency→suppliers), use a two-phase approach: (1) Tier-1 Allocators on the customer's Order (allocates to agency + refund fund); (2) Tier-2 Allocators on a NEW Order created by the agency (allocates agency's received funds to suppliers). Each tier's Rate-mode sharing[] must independently sum to 10000 (or <= 10000 with Surplus)."
714
725
  },
715
726
  {
716
727
  "type": "null"
717
728
  }
718
729
  ],
719
- "description": "Order fund allocator."
730
+ "description": "Order fund allocator. Max 100 allocators (MAX_ALLOCATOR_COUNT). Each allocator has a guard (first matching guard wins) and a sharing list. Set to null to clear. ⚠️ PERMANENTLY IMMUTABLE after publish: order_allocators can ONLY be set BEFORE publish=true (Move service.move:503: assert!(!self.bPublished, E_ALREADY_PUBLISHED)). After publish, the ONLY way to change allocation rules is to create a NEW Service object. There is NO pause+lock exception for order_allocators (unlike arbitrations/rewards which have time-lock removal). PRE-PUBLISH CHECKLIST: verify all guard names resolve, all sharing amounts are correct, threshold is set, and recipient types (Entity/Signer/GuardIdentifier) are intended before calling publish=true. GuardIdentifier sharing mode: {who: {GuardIdentifier: <u8>}, sharing: <rate>, mode: 'Rate'} — resolves recipient from Guard table submission at allocation time (e.g., refund to customer). MULTI-CALL ALLOCATION: Allocation.alloc() can be called MULTIPLE times (no consumed flag in contract). Use Amount mode (not Surplus) for recurring allocations — Surplus calls balance::withdraw_all which drains the balance. For monthly payment scenarios, create multiple Allocators with time-based Guards + Amount mode sharing items."
720
731
  },
721
732
  "buy_guard": {
722
733
  "anyOf": [
@@ -738,11 +749,71 @@
738
749
  "$ref": "#/definitions/data/properties/order_new/properties/buy/properties/total_pay/anyOf/1"
739
750
  }
740
751
  ],
741
- "description": "Compensation fund. Used to claim compensation based on the arbitration result of the Arb object when resolving order disputes."
752
+ "description": "Deposit funds into the Service compensation_fund. Used to pay indemnity when arbitration resolves in customer's favor. FORMAT: {balance: <amount_in_smallest_unit>} — the field name is 'balance' (NOT 'amount'). The token type and precision are determined by the Service object's type_parameter (the generic type set when the Service was created). For WOW (9 decimals): {balance: 1000000000} = 1 WOW. For SUI (9 decimals): {balance: 1000000000} = 1 SUI. For tokens with different decimals, adjust accordingly (e.g. USDC has 6 decimals, so {balance: 1000000} = 1 USDC). REQUIRES: Permission index 315 (SERVICE_COMPENSATION_FUND_DEPOSIT) must be granted to the calling account first. COMMON MISTAKE: using {amount: ...} or {amount: ..., type: 'WOW'} — these will fail. The correct field is 'balance'."
753
+ },
754
+ "compensation_fund_withdraw": {
755
+ "type": "object",
756
+ "properties": {
757
+ "receipt": {
758
+ "type": "object",
759
+ "properties": {
760
+ "name_or_address": {
761
+ "$ref": "#/definitions/data/properties/order_new/properties/agents/properties/entities/items/properties/name_or_address"
762
+ },
763
+ "local_mark_first": {
764
+ "$ref": "#/definitions/data/properties/order_new/properties/agents/properties/entities/items/properties/local_mark_first"
765
+ }
766
+ },
767
+ "additionalProperties": false,
768
+ "description": "Receipt address that will receive the withdrawn funds (as a new Payment object)"
769
+ },
770
+ "payment_info": {
771
+ "type": "object",
772
+ "properties": {
773
+ "for_object": {
774
+ "type": [
775
+ "string",
776
+ "null"
777
+ ],
778
+ "description": "Payment for a specific object ID"
779
+ },
780
+ "for_guard": {
781
+ "type": [
782
+ "string",
783
+ "null"
784
+ ],
785
+ "description": "Payment to satisfy verification of a Guard object"
786
+ },
787
+ "remark": {
788
+ "type": "string",
789
+ "description": "Payment record remark"
790
+ },
791
+ "index": {
792
+ "type": [
793
+ "number",
794
+ "string"
795
+ ],
796
+ "description": "Payment record index"
797
+ }
798
+ },
799
+ "required": [
800
+ "remark",
801
+ "index"
802
+ ],
803
+ "additionalProperties": false,
804
+ "description": "Payment info for the new Payment object created to hold the withdrawn funds"
805
+ }
806
+ },
807
+ "required": [
808
+ "receipt",
809
+ "payment_info"
810
+ ],
811
+ "additionalProperties": false,
812
+ "description": "Withdraw ALL funds from the compensation_fund to a new Payment object owned by `receipt`. Move layer: service::compensation_fund_withdraw (service.move L383-390). REQUIRES: Service must be paused AND setting_lock_duration must have elapsed since pause (assert_not_published at L384-385). Withdraws the ENTIRE compensation_fund balance via balance::withdraw_all. DIFFERENT from compensation_claim (order-side, for arbitration-winning users, no pause+lock required)."
742
813
  },
743
- "setting_locked_time_add": {
814
+ "setting_lock_duration_add": {
744
815
  "type": "number",
745
- "description": "Additional lock duration (milliseconds) to extend the 'setting_lock_duration'. Initial value is 30 days, can only be increased, not decreased. Affects: rewards, arbitrations, and compensation_fund_receive."
816
+ "description": "Additional lock duration to ADD to 'setting_lock_duration' (Move field name). UNIT: milliseconds (ms). Example: 2592000000 = 30 days, 7776000000 = 90 days, 86400000 = 1 day. DEFAULT: 2592000000 (30 days, DEFAULT_LOCK_DURATION). This is the initial value when a Service is created. Behavior: additive (safe_add) — only increases, never decreases. Move entry: service::setting_lock_duration_add / setting_lock_duration_add_with_passport. Can be called BEFORE or AFTER publish (no publish check). Affects the waiting time required by: compensation_fund_withdraw, arbitrations remove/clear, rewards remove/clear (all require pause + setting_lock_duration elapsed since pause)."
746
817
  },
747
818
  "compensation_fund_receive": {
748
819
  "anyOf": [
@@ -797,7 +868,7 @@
797
868
  "const": "recently"
798
869
  }
799
870
  ],
800
- "description": "Receive order compensation funds."
871
+ "description": "Receive order compensation funds from this Service object.\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n• 'recently' (string literal) — auto-query and receive ALL recently received balance.\n Use this for the common case: \"deposit all recently received coins into pending balance.\"\n Example: receive: 'recently'\n• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n receive a specific balance record from a Payment/payer.\n Use this when targeting a specific received balance (advanced).\n Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\nANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly."
801
872
  },
802
873
  "owner_receive": {
803
874
  "anyOf": [
@@ -836,7 +907,7 @@
836
907
  "const": "recently"
837
908
  }
838
909
  ],
839
- "description": "Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."
910
+ "description": "Unwrap CoinWrapper objects and other objects received by this Service object and send them to the owner of its Permission object.\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n• 'recently' (string literal) — auto-query and receive ALL recently received objects.\n Use this for the common case: \"withdraw everything the object has received.\"\n Example: receive: 'recently'\n• ReceivedNormal[] (array) — explicit list of received objects to unwrap.\n Use this when you want to receive specific objects only (not all).\n Example: receive: [{id: '0xobj1', type: '0x2::coin::Coin<0x2::sui::SUI>'}]\n• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n receive a balance record from a specific Payment/payer.\n Use this for precise balance targeting (advanced — usually after querying\n the object's received history via query_received).\n Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\nANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly."
840
911
  },
841
912
  "um": {
842
913
  "anyOf": [
@@ -855,7 +926,7 @@
855
926
  },
856
927
  "publish": {
857
928
  "type": "boolean",
858
- "description": "Whether to publish the Service. After publishing, customers can place orders; at the same time, service commitments such as machine, order_allocators, arbitrations, etc. will be immutable."
929
+ "description": "Whether to publish the Service. After publishing, customers can place orders. VERIFIED against Move source service.move + SDK service.ts (4-level immutability matrix):\n L1 — PERMANENTLY LOCKED after publish (assert!(!bPublished), no pause+lock exception):\n • machine (service.move L633/L653 — workflow template)\n • order_allocators (service.move L503 — fund distribution rules)\n L2 — TIME-LOCKED after publish (assert_not_published — requires pause + setting_lock_duration elapsed):\n • arbitrations remove/clear (service.move L433/L445 — dispute resolution objects)\n • rewards remove/clear (service.move L402/L414 — reward objects)\n • compensation_fund_withdraw (service.move L384-385 — withdraw ALL funds)\n L3 — REMAIN MUTABLE after publish (no SDK check, no Move check):\n • arbitrations add, rewards add (no assert — can add after publish)\n • buy_guard, sales, discount, description, location, pause, repositories,\n • compensation_fund_add, setting_lock_duration_add, customer_required, um (Contact)\nThese 2 L1-LOCKED fields (machine/order_allocators) MUST be set BEFORE publish=true.\narbitrations/rewards can be ADDED after publish but remove/clear requires pause+lock.\n\n⚠️ COMPENSATION_FUND + ARBITRATION LINKAGE (service.move:494-499):\n At publish time, if compensation_fund > 0, Arbitration MUST be bound:\n if (balance::value(&self.compensation_fund) > 0) {\n assert!(arbitration_count > 0, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\n }\n The MCP handler enforces this as a HARD PRE-CHECK: if publish=true AND compensation_fund_add is set in the same call AND arbitrations is empty, the call is REJECTED before submission. If compensation_fund was deposited in a prior call, a SOFT WARNING is issued.\n\nSCHEMA-03 / P0-01 fix — DEPLOYMENT WORKFLOW (two-phase, avoids circular dependency):\n Phase 1 — CREATE (no publish): object={name:'my-service', type_parameter, permission} + machine + order_allocators + arbitrations.\n NOTE: buy_guard can use a LocalMark NAME (not address) to break the Guard→Service circular dependency.\n The name is resolved to an address at transaction build time.\n Phase 2 — PUBLISH: object='my-service' (string ref) + publish=true.\n All L1-LOCKED fields must be set in Phase 1; Phase 2 only flips the publish flag.\n Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), arbitrations (add), etc."
859
930
  }
860
931
  },
861
932
  "required": [
@@ -890,7 +961,7 @@
890
961
  "testnet",
891
962
  "mainnet"
892
963
  ],
893
- "description": "Network entrypoint: Specifies which network the operation occurs on"
964
+ "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."
894
965
  },
895
966
  "referrer": {
896
967
  "$ref": "#/definitions/env/properties/account",
@@ -980,7 +1051,7 @@
980
1051
  },
981
1052
  "b_submission": {
982
1053
  "type": "boolean",
983
- "description": "Whether user submission is required for this data"
1054
+ "description": "Whether this table item's value is submitted dynamically at Guard trigger time (alloc_by_guard call). \n\ntrue = value is submitted by the caller when triggering the Guard. Use for runtime-context-dependent values like order address, user address. The 'value' field is ignored when b_submission=true; the caller must provide it via submissions[]. \n\nfalse = value is static, set at Guard creation time. Use for values known when the Guard is created: expected node names, expected merchant address, expected service address. The 'value' field must be populated and will be stored on-chain permanently. \n\nRule of thumb: if the value is the SAME for all future Guard triggers, use false. If the value DIFFERS per trigger (e.g., which order to release funds for), use true."
984
1055
  },
985
1056
  "value_type": {
986
1057
  "anyOf": [
@@ -1270,7 +1341,7 @@
1270
1341
  "description": "vecvecu8"
1271
1342
  }
1272
1343
  ],
1273
- "description": "Type of the value"
1344
+ "description": "Type of the value stored in `value`. One of: Bool(0), Address(1), String(2), U8(3), U16(4), U32(5), U64(6), U128(7), U256(8), VecBool(9), VecAddress(10), VecString(11), VecU8(12), VecU16(13), VecU32(14), VecU64(15), VecU128(16), VecU256(17), VecVecU8(18). When value_type=Address (1), the `value` field accepts a hex address string, a LocalMark name, or an AccountOrMark_Address object — see `value` field description for details."
1274
1345
  },
1275
1346
  "value": {
1276
1347
  "anyOf": [
@@ -1363,12 +1434,12 @@
1363
1434
  }
1364
1435
  }
1365
1436
  ],
1366
- "description": "The actual value data"
1437
+ "description": "The actual value data. Format depends on `value_type`:\n• Bool: true/false (boolean)\n• Address (CRITICAL — string 'Address' is NOT a placeholder): a hex address (e.g. '0x1234...'), a LocalMark name (e.g. 'my-service' — resolved to address at evaluation time), an AccountOrMark_Address object (e.g. {name_or_address:'my-service'}), or system shorthand ('0xaaa' = EntityLinker, '0xaab' = EntityRegistrar). The literal string 'Address' itself is INVALID — it would be treated as a non-existent LocalMark name and fail. Example: value='0x2::wow::WOW<address>' or value='my-permission'.\n• String: any string\n• U8/U16/U32/U64/U128/U256: number or numeric string (e.g. 42 or '42')\n• Vec* types: arrays of the corresponding element type\nREQUIRED when b_submission=false. OPTIONAL when b_submission=true (value is supplied at evaluation time by user submission)."
1367
1438
  },
1368
1439
  "name": {
1369
1440
  "type": "string",
1370
1441
  "default": "",
1371
- "description": "Name or description of this data"
1442
+ "description": "Data name identifier. MAX 64 BCS characters (Chinese chars count as 3-4 BCS bytes each). Use short identifiers like 'order_id', 'delivery_node'. Put longer descriptions in the Guard's 'description' field, NOT here."
1372
1443
  },
1373
1444
  "object_type": {
1374
1445
  "type": "string",
@@ -1406,7 +1477,7 @@
1406
1477
  "TableItem_AddressMark",
1407
1478
  "TableItem_EntityRegistrar"
1408
1479
  ],
1409
- "description": "Object type when value_type is Address and represents a specific object"
1480
+ "description": "OUTPUT-ONLY (query side): Object type when value_type is Address and represents a specific object. Auto-derived by the system — DO NOT set this field at Guard creation."
1410
1481
  }
1411
1482
  },
1412
1483
  "required": [
@@ -1415,7 +1486,7 @@
1415
1486
  "value_type"
1416
1487
  ],
1417
1488
  "additionalProperties": false,
1418
- "description": "Guard table item"
1489
+ "description": "Guard table item (QUERY/OUTPUT form — includes auto-derived object_type field)"
1419
1490
  },
1420
1491
  "description": "User-submitted data matching the Guard's required fields. Relation: structure must match the Guard table's column definitions. Example: [{field:'delivery_proof', value:'Qm...'}]"
1421
1492
  }
@@ -1427,7 +1498,7 @@
1427
1498
  "additionalProperties": false,
1428
1499
  "description": "One Guard's submission data: the Guard to verify plus the user-provided data that satisfies its requirements."
1429
1500
  },
1430
- "description": "User-submitted data for each Guard. Relation: one entry per Guard in the guard array; fill submission fields and resubmit via call_with_submission."
1501
+ "description": "User-submitted data for each Guard. Relation: one entry per Guard in the guard array; fill submission fields and resubmit via call_with_submission. PLACEMENT: this `submission` field is at the SAME level as `data` and `env` in the operation input — NOT inside `data.data`. Example structure: {tool:'onchain_operations', data:{operation_type:'order', data:{object:'my_order', progress:{...}}}, submission:{type:'submission', guard:[...], submission:[...]}}"
1431
1502
  }
1432
1503
  },
1433
1504
  "required": [
@@ -115,7 +115,7 @@
115
115
  "number",
116
116
  "string"
117
117
  ],
118
- "description": "Balance type"
118
+ "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."
119
119
  },
120
120
  "token_type": {
121
121
  "type": "string",
@@ -162,7 +162,7 @@
162
162
  "const": "recently"
163
163
  }
164
164
  ],
165
- "description": "Receive CoinWrapper objects received by the object and deposit them into its balance."
165
+ "description": "Receive CoinWrapper objects received by this Treasury object and deposit them into its balance.\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n• 'recently' (string literal) — auto-query and receive ALL recently received balance.\n Use this for the common case: \"deposit all recently received coins into pending balance.\"\n Example: receive: 'recently'\n• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n receive a specific balance record from a Payment/payer.\n Use this when targeting a specific received balance (advanced).\n Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\nANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly."
166
166
  },
167
167
  "deposit": {
168
168
  "type": "object",
@@ -588,7 +588,7 @@
588
588
  "const": "recently"
589
589
  }
590
590
  ],
591
- "description": "Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."
591
+ "description": "Unwrap CoinWrapper objects and other objects received by this Treasury object and send them to the owner of its Permission object.\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n• 'recently' (string literal) — auto-query and receive ALL recently received objects.\n Use this for the common case: \"withdraw everything the object has received.\"\n Example: receive: 'recently'\n• ReceivedNormal[] (array) — explicit list of received objects to unwrap.\n Use this when you want to receive specific objects only (not all).\n Example: receive: [{id: '0xobj1', type: '0x2::coin::Coin<0x2::sui::SUI>'}]\n• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n receive a balance record from a specific Payment/payer.\n Use this for precise balance targeting (advanced — usually after querying\n the object's received history via query_received).\n Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\nANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly."
592
592
  },
593
593
  "um": {
594
594
  "anyOf": [
@@ -634,7 +634,7 @@
634
634
  "testnet",
635
635
  "mainnet"
636
636
  ],
637
- "description": "Network entrypoint: Specifies which network the operation occurs on"
637
+ "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."
638
638
  },
639
639
  "referrer": {
640
640
  "$ref": "#/definitions/env/properties/account",
@@ -724,7 +724,7 @@
724
724
  },
725
725
  "b_submission": {
726
726
  "type": "boolean",
727
- "description": "Whether user submission is required for this data"
727
+ "description": "Whether this table item's value is submitted dynamically at Guard trigger time (alloc_by_guard call). \n\ntrue = value is submitted by the caller when triggering the Guard. Use for runtime-context-dependent values like order address, user address. The 'value' field is ignored when b_submission=true; the caller must provide it via submissions[]. \n\nfalse = value is static, set at Guard creation time. Use for values known when the Guard is created: expected node names, expected merchant address, expected service address. The 'value' field must be populated and will be stored on-chain permanently. \n\nRule of thumb: if the value is the SAME for all future Guard triggers, use false. If the value DIFFERS per trigger (e.g., which order to release funds for), use true."
728
728
  },
729
729
  "value_type": {
730
730
  "anyOf": [
@@ -1014,7 +1014,7 @@
1014
1014
  "description": "vecvecu8"
1015
1015
  }
1016
1016
  ],
1017
- "description": "Type of the value"
1017
+ "description": "Type of the value stored in `value`. One of: Bool(0), Address(1), String(2), U8(3), U16(4), U32(5), U64(6), U128(7), U256(8), VecBool(9), VecAddress(10), VecString(11), VecU8(12), VecU16(13), VecU32(14), VecU64(15), VecU128(16), VecU256(17), VecVecU8(18). When value_type=Address (1), the `value` field accepts a hex address string, a LocalMark name, or an AccountOrMark_Address object — see `value` field description for details."
1018
1018
  },
1019
1019
  "value": {
1020
1020
  "anyOf": [
@@ -1107,12 +1107,12 @@
1107
1107
  }
1108
1108
  }
1109
1109
  ],
1110
- "description": "The actual value data"
1110
+ "description": "The actual value data. Format depends on `value_type`:\n• Bool: true/false (boolean)\n• Address (CRITICAL — string 'Address' is NOT a placeholder): a hex address (e.g. '0x1234...'), a LocalMark name (e.g. 'my-service' — resolved to address at evaluation time), an AccountOrMark_Address object (e.g. {name_or_address:'my-service'}), or system shorthand ('0xaaa' = EntityLinker, '0xaab' = EntityRegistrar). The literal string 'Address' itself is INVALID — it would be treated as a non-existent LocalMark name and fail. Example: value='0x2::wow::WOW<address>' or value='my-permission'.\n• String: any string\n• U8/U16/U32/U64/U128/U256: number or numeric string (e.g. 42 or '42')\n• Vec* types: arrays of the corresponding element type\nREQUIRED when b_submission=false. OPTIONAL when b_submission=true (value is supplied at evaluation time by user submission)."
1111
1111
  },
1112
1112
  "name": {
1113
1113
  "type": "string",
1114
1114
  "default": "",
1115
- "description": "Name or description of this data"
1115
+ "description": "Data name identifier. MAX 64 BCS characters (Chinese chars count as 3-4 BCS bytes each). Use short identifiers like 'order_id', 'delivery_node'. Put longer descriptions in the Guard's 'description' field, NOT here."
1116
1116
  },
1117
1117
  "object_type": {
1118
1118
  "type": "string",
@@ -1150,7 +1150,7 @@
1150
1150
  "TableItem_AddressMark",
1151
1151
  "TableItem_EntityRegistrar"
1152
1152
  ],
1153
- "description": "Object type when value_type is Address and represents a specific object"
1153
+ "description": "OUTPUT-ONLY (query side): Object type when value_type is Address and represents a specific object. Auto-derived by the system — DO NOT set this field at Guard creation."
1154
1154
  }
1155
1155
  },
1156
1156
  "required": [
@@ -1159,7 +1159,7 @@
1159
1159
  "value_type"
1160
1160
  ],
1161
1161
  "additionalProperties": false,
1162
- "description": "Guard table item"
1162
+ "description": "Guard table item (QUERY/OUTPUT form — includes auto-derived object_type field)"
1163
1163
  },
1164
1164
  "description": "User-submitted data matching the Guard's required fields. Relation: structure must match the Guard table's column definitions. Example: [{field:'delivery_proof', value:'Qm...'}]"
1165
1165
  }
@@ -1171,7 +1171,7 @@
1171
1171
  "additionalProperties": false,
1172
1172
  "description": "One Guard's submission data: the Guard to verify plus the user-provided data that satisfies its requirements."
1173
1173
  },
1174
- "description": "User-submitted data for each Guard. Relation: one entry per Guard in the guard array; fill submission fields and resubmit via call_with_submission."
1174
+ "description": "User-submitted data for each Guard. Relation: one entry per Guard in the guard array; fill submission fields and resubmit via call_with_submission. PLACEMENT: this `submission` field is at the SAME level as `data` and `env` in the operation input — NOT inside `data.data`. Example structure: {tool:'onchain_operations', data:{operation_type:'order', data:{object:'my_order', progress:{...}}}, submission:{type:'submission', guard:[...], submission:[...]}}"
1175
1175
  }
1176
1176
  },
1177
1177
  "required": [
@@ -1582,7 +1582,7 @@
1582
1582
  "properties": {
1583
1583
  "prev_node": {
1584
1584
  "type": "string",
1585
- "description": "Previous node name"
1585
+ "description": "Previous node name. Empty string '' means initial entry node (the first node in the workflow)."
1586
1586
  },
1587
1587
  "threshold": {
1588
1588
  "type": [
@@ -1642,38 +1642,46 @@
1642
1642
  "guard": {
1643
1643
  "anyOf": [
1644
1644
  {
1645
- "type": "object",
1646
- "properties": {
1647
- "guard": {
1648
- "type": "string",
1649
- "description": "Guard object ID"
1650
- },
1651
- "retained_submission": {
1652
- "anyOf": [
1653
- {
1654
- "type": "array",
1655
- "items": {
1656
- "$ref": "#/definitions/onchain_table_data/properties/result/anyOf/8/properties/result/anyOf/0/properties/value/items/properties/threshold"
1657
- }
1645
+ "anyOf": [
1646
+ {
1647
+ "type": "object",
1648
+ "properties": {
1649
+ "guard": {
1650
+ "type": "string",
1651
+ "description": "Guard object name or address (string). Example: 'my_attendance_guard' or '0x1234...'"
1658
1652
  },
1659
- {
1660
- "type": "null"
1653
+ "retained_submission": {
1654
+ "anyOf": [
1655
+ {
1656
+ "type": "array",
1657
+ "items": {
1658
+ "$ref": "#/definitions/onchain_table_data/properties/result/anyOf/8/properties/result/anyOf/0/properties/value/items/properties/threshold"
1659
+ }
1660
+ },
1661
+ {
1662
+ "type": "null"
1663
+ }
1664
+ ],
1665
+ "description": "Data submitted by user during Guard object verification"
1661
1666
  }
1667
+ },
1668
+ "required": [
1669
+ "guard"
1662
1670
  ],
1663
- "description": "Data submitted by user during Guard object verification"
1671
+ "additionalProperties": false,
1672
+ "description": "OBJECT form: {guard: '<guard_name_or_address>', retained_submission?: number[]}. Use this form when you need to pass retained_submission data alongside the Guard reference."
1673
+ },
1674
+ {
1675
+ "type": "string",
1676
+ "description": "STRING form (shorthand): the Guard object's name or address as a plain string. Auto-wrapped to {guard: <string>} at runtime. Use this when you only need to reference a Guard without retained_submission."
1664
1677
  }
1665
- },
1666
- "required": [
1667
- "guard"
1668
- ],
1669
- "additionalProperties": false,
1670
- "description": "Record of Guard object in MachineForwardGuard object"
1678
+ ]
1671
1679
  },
1672
1680
  {
1673
1681
  "type": "null"
1674
1682
  }
1675
1683
  ],
1676
- "description": "Guard object ID, if defined, Guard verification must also pass to complete Forward (e.g., completed promised supply chain sub-order)."
1684
+ "description": "Guard reference for this forward. Accepts TWO formats:\n• STRING (preferred): \"my_guard_name\" — the Guard's name or address as a plain string.\n• OBJECT (only when retained_submission is needed): {guard: \"my_guard_name\", retained_submission: [1,2,3]}.\nFOLLOW THE SCHEMA FIELD STRUCTURE: A Guard reference is fundamentally a STRING (the Guard object's name or address). Provide a string when you only need to reference a Guard — do NOT wrap a bare string in an object structure. The OBJECT form {guard: \"...\", retained_submission: [...]} exists ONLY to carry additional `retained_submission` data alongside the string reference; inside the object, the `guard` field is STILL a string. In short: string-in for a string reference, object-in only when you need to pass extra data.\nCOGNITIVE PRINCIPLE: Guard validation ALWAYS occurs BEFORE the forward operation. A Guard that queries state of the SAME Progress object this forward operates on (e.g. progress.current) will see the PRE-transition value (source node), NOT the target node. If the Guard checks progress.current == target_node, it will ALWAYS FAIL. Querying a DIFFERENT Progress object (cross-machine) is safe and reasonable — that progress is not modified by this forward. For target-node verification after transition, bind the Guard to the Allocator instead (allocation.alloc runs AFTER the state transition completes)."
1677
1685
  }
1678
1686
  },
1679
1687
  "required": [
@@ -1683,7 +1691,7 @@
1683
1691
  "additionalProperties": false,
1684
1692
  "description": "Forward in Machine object"
1685
1693
  },
1686
- "description": "Forward list"
1694
+ "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."
1687
1695
  }
1688
1696
  },
1689
1697
  "required": [