@wowok/agent-mcp 2.6.1 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/customer/customer-advice.d.ts +31 -0
- package/dist/customer/customer-advice.js +129 -0
- package/dist/customer/index.d.ts +2 -0
- package/dist/customer/index.js +2 -0
- package/dist/customer/info-puzzle.d.ts +9 -2
- package/dist/customer/info-puzzle.js +34 -7
- package/dist/customer/order-monitor.d.ts +2 -0
- package/dist/customer/order-monitor.js +3 -2
- package/dist/customer/post-purchase.d.ts +2 -0
- package/dist/customer/post-purchase.js +6 -5
- package/dist/customer/preorder-compare.d.ts +24 -0
- package/dist/customer/preorder-compare.js +34 -0
- package/dist/customer/reminder-system.d.ts +2 -0
- package/dist/customer/reminder-system.js +2 -1
- package/dist/customer/risk-assessment.js +30 -7
- package/dist/customer/types.d.ts +7 -0
- package/dist/examples/arbitration-dispute-create.json +41 -0
- package/dist/examples/arbitration-vote-weighted.json +35 -0
- package/dist/examples/arbitration-voting-guard-add.json +38 -0
- package/dist/examples/demand-present-service.json +33 -0
- package/dist/examples/gen-passport-verify-guard.json +48 -0
- package/dist/examples/guard-template-balance-check.json +59 -0
- package/dist/examples/guard-template-time-lock.json +60 -0
- package/dist/examples/insurance-guard-claim-timelock.json +75 -0
- package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
- package/dist/examples/insurance-machine-create-publish.json +75 -0
- package/dist/examples/insurance-service-allocators-publish.json +56 -0
- package/dist/examples/machine-multisig-threshold.json +86 -0
- package/dist/examples/machine-template-7node-rental.json +119 -0
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +149 -0
- package/dist/examples/rental-ziroom-permission-create.json +42 -0
- package/dist/examples/rental-ziroom-service-create.json +89 -0
- package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
- package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
- package/dist/examples/retail-adv-reward-guard-add.json +51 -0
- package/dist/examples/retail-myshop-allocation-activate.json +55 -0
- package/dist/examples/retail-myshop-arbitration-create.json +40 -0
- package/dist/examples/retail-myshop-contact-create.json +43 -0
- package/dist/examples/retail-myshop-order-create.json +56 -0
- package/dist/examples/retail-myshop-progress-operate.json +38 -0
- package/dist/examples/retail-myshop-reward-create.json +35 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/examples/service-discount-issue.json +46 -0
- package/dist/examples/threebody-guard-create.json +56 -0
- package/dist/examples/threebody-machine-create.json +72 -0
- package/dist/examples/threebody-permission-create.json +38 -0
- package/dist/examples/threebody-service-allocators.json +49 -0
- package/dist/examples/travel-guard-time-lock.json +69 -0
- package/dist/examples/travel-guard-weather-oracle.json +70 -0
- package/dist/examples/travel-machine-create.json +136 -0
- package/dist/examples/travel-repository-create.json +47 -0
- package/dist/examples/travel-service-create.json +102 -0
- package/dist/examples/travel-treasury-create.json +34 -0
- package/dist/examples/treasury-deposit.json +37 -0
- package/dist/examples/treasury-withdraw.json +38 -0
- package/dist/extensions/business-modules.d.ts +49 -0
- package/dist/extensions/business-modules.js +287 -0
- package/dist/extensions/capability-manifest.js +216 -29
- package/dist/extensions/constraint-registry.js +21 -19
- package/dist/extensions/metric-registry.js +14 -14
- package/dist/extensions/mode-evaluator.js +16 -16
- package/dist/extensions/modes.js +141 -49
- package/dist/extensions/registry.d.ts +16 -9
- package/dist/extensions/registry.js +132 -44
- package/dist/extensions/types.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +138 -0
- package/dist/knowledge/fund-layer.js +969 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/guard-templates.d.ts +10 -0
- package/dist/knowledge/guard-templates.js +50 -0
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +2 -2
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-risk.js +4 -1
- package/dist/knowledge/machine-templates.js +4 -4
- package/dist/knowledge/progress-context.js +1 -1
- package/dist/knowledge/progress-ledger.js +3 -3
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/progress-translation.js +1 -1
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/safety-rules.d.ts +83 -1
- package/dist/knowledge/safety-rules.js +166 -2
- package/dist/knowledge/scenario-modes.d.ts +1 -1
- package/dist/knowledge/scenario-modes.js +13 -11
- package/dist/knowledge/service-confirm.d.ts +1 -1
- package/dist/knowledge/service-confirm.js +3 -3
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/knowledge/template-registry.d.ts +48 -0
- package/dist/knowledge/template-registry.js +341 -0
- package/dist/knowledge/tool-constraints.js +6 -6
- package/dist/knowledge/tools-reference.js +11 -8
- package/dist/participation/merchant-interest.d.ts +32 -0
- package/dist/participation/merchant-interest.js +100 -0
- package/dist/participation/radar-core.d.ts +104 -0
- package/dist/participation/radar-core.js +269 -0
- package/dist/project/context-assembly.js +8 -0
- package/dist/project/deployment-bridge.js +6 -5
- package/dist/project/deployment-doc.js +5 -5
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1342 -0
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +734 -68
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +7 -1
- package/dist/project/handlers.d.ts +137 -2
- package/dist/project/handlers.js +423 -51
- package/dist/project/intent-analyzer.d.ts +71 -0
- package/dist/project/intent-analyzer.js +149 -0
- package/dist/project/machine-nodes.d.ts +2 -0
- package/dist/project/machine-nodes.js +36 -0
- package/dist/project/merchant-guide.d.ts +165 -0
- package/dist/project/merchant-guide.js +264 -0
- package/dist/project/mode-actions.d.ts +199 -0
- package/dist/project/mode-actions.js +309 -0
- package/dist/project/participation-radar.d.ts +18 -0
- package/dist/project/participation-radar.js +428 -0
- package/dist/project/pipeline-actions.d.ts +101 -0
- package/dist/project/pipeline-actions.js +109 -0
- package/dist/project/semantic-graph.d.ts +95 -0
- package/dist/project/semantic-graph.js +245 -0
- package/dist/project/stage-gate.js +4 -4
- package/dist/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +13 -3
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +30 -9
- package/dist/schema/call/base.d.ts +2 -2
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +127 -127
- package/dist/schema/call/bridge.js +12 -12
- package/dist/schema/call/contact.d.ts +3 -3
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +3 -3
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +2072 -679
- package/dist/schema/call/machine.js +51 -5
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/order.js +3 -6
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/personal.d.ts +337 -3
- package/dist/schema/call/personal.js +10 -0
- package/dist/schema/call/progress.d.ts +177 -9
- package/dist/schema/call/progress.js +7 -3
- package/dist/schema/call/proof.d.ts +6 -6
- package/dist/schema/call/repository.d.ts +3 -3
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.d.ts +57 -57
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.js +48 -2
- package/dist/schema/call/service.d.ts +285 -113
- package/dist/schema/call/service.js +92 -28
- package/dist/schema/call/treasury.d.ts +57 -57
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +2 -0
- package/dist/schema/common/index.js +46 -10
- package/dist/schema/local/index.js +5 -1
- package/dist/schema/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +1318 -317
- package/dist/schema/operations.js +76 -7
- package/dist/schema/project/index.d.ts +5662 -164
- package/dist/schema/project/index.js +1136 -5
- package/dist/schema/query/index.d.ts +580 -19
- package/dist/schema/query/index.js +88 -36
- package/dist/schema/schema-query/index.d.ts +59 -3
- package/dist/schema/schema-query/index.js +45 -6
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- package/dist/schema/utils/node-parser.js +13 -0
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +77 -0
- package/dist/schema-query/index.d.ts +17 -1
- package/dist/schema-query/index.js +359 -3
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/bridge_operation.schema.json +14 -7
- package/dist/schemas/guard2file.schema.json +2 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +2 -0
- package/dist/schemas/messenger_operation.schema.json +1 -1
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +255 -65
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +14 -10
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -2
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +579 -1
- package/dist/schemas/onchain_operations_machine.schema.json +5 -4
- package/dist/schemas/onchain_operations_order.schema.json +7 -6
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +3 -2
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +91 -4
- package/dist/schemas/onchain_operations_proof.schema.json +2 -1
- package/dist/schemas/onchain_operations_repository.schema.json +4 -3
- package/dist/schemas/onchain_operations_reward.schema.json +7 -6
- package/dist/schemas/onchain_operations_service.schema.json +80 -19
- package/dist/schemas/onchain_operations_treasury.schema.json +5 -4
- package/dist/schemas/onchain_table_data.output.json +1 -1
- package/dist/schemas/onchain_table_data.schema.json +10 -9
- package/dist/schemas/project_operation.output.json +3318 -57
- package/dist/schemas/project_operation.schema.json +728 -4
- package/dist/schemas/query_toolkit.output.json +16 -16
- package/dist/schemas/query_toolkit.schema.json +40 -3
- package/dist/schemas/schema_query.output.json +65 -2
- package/dist/schemas/schema_query.schema.json +31 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/onchain.js +636 -6
- package/dist/tools/handlers/project.js +71 -2
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +65 -1
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +229 -15
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { TypedPermissionObjectSchema, CoinParamSchema, NamedObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js";
|
|
3
|
-
import { AllocatorsSchema, DiscountTypeSchema, ServiceSaleSchema } from "../query/index.js";
|
|
4
|
-
import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema, NotEmptyNameSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema } from "../common/index.js";
|
|
3
|
+
import { AllocatorsSchema, DiscountTypeSchema, ServiceSaleSchema, PaymentInfoSchema } from "../query/index.js";
|
|
4
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema, NotEmptyNameSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema, RECEIVE_FORMAT_BLOCK_OBJECTS, RECEIVE_FORMAT_BLOCK_BALANCE } from "../common/index.js";
|
|
5
5
|
import { BalanceTypeSchema } from "../common/index.js";
|
|
6
6
|
export const ServiceBuyItemSchema = z.object({
|
|
7
7
|
name: LongNameSchema.describe("Name of the product or service to purchase"),
|
|
@@ -10,7 +10,9 @@ export const ServiceBuyItemSchema = z.object({
|
|
|
10
10
|
}).strict();
|
|
11
11
|
export const BuySchema = z.object({
|
|
12
12
|
items: z.array(ServiceBuyItemSchema).describe("List of products or services to purchase"),
|
|
13
|
-
total_pay: CoinParamSchema.describe("Actual payment amount"
|
|
13
|
+
total_pay: CoinParamSchema.describe("Actual payment amount. FORMAT: {balance: <amount_in_smallest_unit>} or {coin: <coin_object_id>}. " +
|
|
14
|
+
"The token type and precision are determined by the Service object's type_parameter (the generic type set when the Service was created). " +
|
|
15
|
+
"For WOW (9 decimals): {balance: 1000000000} = 1 WOW. For SUI (9 decimals): {balance: 1000000000} = 1 SUI."),
|
|
14
16
|
discount: z.string().optional().describe("Discount object ID or name"),
|
|
15
17
|
payment_remark: z.string().optional().describe("Payment remark"),
|
|
16
18
|
payment_index: z.number().optional().describe("Payment index"),
|
|
@@ -31,9 +33,15 @@ export const OrderNewSchema = z.object({
|
|
|
31
33
|
agents: ManyAccountOrMark_AddressSchema.optional().describe("Order agents. Agents can operate the order, such as canceling the order, modifying the order status, etc.; but cannot receive the funds received by the order."),
|
|
32
34
|
order_required_info: z.string().optional().describe("Contact object ID or WTS Proof object"),
|
|
33
35
|
transfer: AccountOrMark_AddressSchema.optional().describe("Set the new owner of the order. Requires order owner permission to set."),
|
|
34
|
-
namedNewOrder: NamedObjectSchema.optional().describe("Set
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
namedNewOrder: NamedObjectSchema.optional().describe("RECOMMENDED: Set a local name for the newly created Order object. " +
|
|
37
|
+
"Without this, the Order is only referenceable by its on-chain address. " +
|
|
38
|
+
"Example: {name: 'my_order_v1'} allows subsequent operations to use 'my_order_v1' instead of the address."),
|
|
39
|
+
namedNewAllocation: NamedObjectSchema.optional().describe("RECOMMENDED: Set a local name for the order's Allocation object. " +
|
|
40
|
+
"Without this, the Allocation is only referenceable by its address. " +
|
|
41
|
+
"Example: {name: 'my_allocation_v1'} allows alloc_by_guard to reference 'my_allocation_v1'."),
|
|
42
|
+
namedNewProgress: NamedObjectSchema.optional().describe("RECOMMENDED: Set a local name for the order's Progress object. " +
|
|
43
|
+
"Without this, the Progress is only referenceable by its address. " +
|
|
44
|
+
"Example: {name: 'my_progress_v1'} allows progress operations to use 'my_progress_v1'."),
|
|
37
45
|
}).strict();
|
|
38
46
|
export const SalesSchema = z.discriminatedUnion("op", [
|
|
39
47
|
z.object({
|
|
@@ -59,42 +67,98 @@ export const CallService_DataSchema = z.object({
|
|
|
59
67
|
location: LongNameSchema.optional().describe("Location of the Service"),
|
|
60
68
|
sales: SalesSchema.optional().describe("Service sales products or services list."),
|
|
61
69
|
repositories: ObjectsSchema.optional().describe("Service Repository object list."),
|
|
62
|
-
rewards: ObjectsSchema.optional().describe("Service Reward object list."
|
|
63
|
-
|
|
70
|
+
rewards: ObjectsSchema.optional().describe("Service Reward object list. " +
|
|
71
|
+
"May share the Service's Permission (no conflict check — intentional: rewards are the provider's own " +
|
|
72
|
+
"incentive tool; only Arbitration requires a different Permission for neutrality)."),
|
|
73
|
+
arbitrations: ObjectsSchema.optional().describe("Service Arbitration object list. " +
|
|
74
|
+
"FORMAT: same as repositories — use the `objects` field name inside the operation data. " +
|
|
75
|
+
"Example: {arbitrations: [{name: 'my_arb_1'}, {name: 'my_arb_2'}]}. " +
|
|
76
|
+
"Each item is a NameOrAddress (object ID or local mark name). " +
|
|
77
|
+
"⚠️ PERMISSION RULE (contract-enforced, service.move arbitration_add_imp): every Arbitration bound here " +
|
|
78
|
+
"MUST use a Permission object DIFFERENT from THIS Service's permission — binding an Arbitration that shares " +
|
|
79
|
+
"the Service's Permission aborts with E_ARBITRATION_PERMISSION_CONFLICT (error 33). " +
|
|
80
|
+
"Create a dedicated Permission for each Arbitration BEFORE binding. " +
|
|
81
|
+
"DESIGN RATIONALE (confirmed intentional): dispute resolution requires NEUTRALITY — an Arbitration controlled " +
|
|
82
|
+
"by the same Permission admins as the Service it judges would be a conflict of interest. ONLY Arbitration has " +
|
|
83
|
+
"this check: Reward and Treasury objects MAY share the Service's Permission (they are the provider's own tools)."),
|
|
64
84
|
machine: z.union([NameOrAddressSchema, z.null()]).optional().describe("Service Machine object ID or name. The Machine object must be in published state."),
|
|
65
85
|
discount: DiscountSchema.optional().describe("Issue discount."),
|
|
66
86
|
discount_destroy: z.array(NameOrAddressSchema).optional().describe("Destroy existing discount object ID list."),
|
|
67
87
|
customer_required: z.array(NotEmptyNameSchema).optional().describe("Customer required information. Such as phone, email, etc."),
|
|
68
|
-
order_allocators: z.union([AllocatorsSchema, z.null()]).optional().describe("Order fund allocator."
|
|
88
|
+
order_allocators: z.union([AllocatorsSchema, z.null()]).optional().describe("Order fund allocator. Max 100 allocators (MAX_ALLOCATOR_COUNT). " +
|
|
89
|
+
"Each allocator has a guard (first matching guard wins) and a sharing list. " +
|
|
90
|
+
"Set to null to clear. " +
|
|
91
|
+
"⚠️ PERMANENTLY IMMUTABLE after publish: order_allocators can ONLY be set BEFORE publish=true " +
|
|
92
|
+
"(Move service.move:503: assert!(!self.bPublished, E_ALREADY_PUBLISHED)). " +
|
|
93
|
+
"After publish, the ONLY way to change allocation rules is to create a NEW Service object. " +
|
|
94
|
+
"There is NO pause+lock exception for order_allocators (unlike arbitrations/rewards which have time-lock removal). " +
|
|
95
|
+
"PRE-PUBLISH CHECKLIST: verify all guard names resolve, all sharing amounts are correct, " +
|
|
96
|
+
"threshold is set, and recipient types (Entity/Signer/GuardIdentifier) are intended before calling publish=true. " +
|
|
97
|
+
"GuardIdentifier sharing mode: {who: {GuardIdentifier: <u8>}, sharing: <rate>, mode: 'Rate'} — " +
|
|
98
|
+
"resolves recipient from Guard table submission at allocation time (e.g., refund to customer). " +
|
|
99
|
+
"MULTI-CALL ALLOCATION: Allocation.alloc() can be called MULTIPLE times (no consumed flag in contract). " +
|
|
100
|
+
"Use Amount mode (not Surplus) for recurring allocations — Surplus calls balance::withdraw_all which drains the balance. " +
|
|
101
|
+
"For monthly payment scenarios, create multiple Allocators with time-based Guards + Amount mode sharing items."),
|
|
69
102
|
buy_guard: z.union([NameOrAddressSchema, z.null()]).optional().describe("Buy guard object ID or name."),
|
|
70
|
-
compensation_fund_add: CoinParamSchema.optional().describe("
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
103
|
+
compensation_fund_add: CoinParamSchema.optional().describe("Deposit funds into the Service compensation_fund. Used to pay indemnity when arbitration resolves in customer's favor. " +
|
|
104
|
+
"FORMAT: {balance: <amount_in_smallest_unit>} — the field name is 'balance' (NOT 'amount'). " +
|
|
105
|
+
"The token type and precision are determined by the Service object's type_parameter (the generic type set when the Service was created). " +
|
|
106
|
+
"For WOW (9 decimals): {balance: 1000000000} = 1 WOW. For SUI (9 decimals): {balance: 1000000000} = 1 SUI. " +
|
|
107
|
+
"For tokens with different decimals, adjust accordingly (e.g. USDC has 6 decimals, so {balance: 1000000} = 1 USDC). " +
|
|
108
|
+
"REQUIRES: Permission index 315 (SERVICE_COMPENSATION_FUND_DEPOSIT) must be granted to the calling account first. " +
|
|
109
|
+
"COMMON MISTAKE: using {amount: ...} or {amount: ..., type: 'WOW'} — these will fail. The correct field is 'balance'."),
|
|
110
|
+
compensation_fund_withdraw: z.object({
|
|
111
|
+
receipt: AccountOrMark_AddressSchema.describe("Receipt address that will receive the withdrawn funds (as a new Payment object)"),
|
|
112
|
+
payment_info: PaymentInfoSchema.describe("Payment info for the new Payment object created to hold the withdrawn funds"),
|
|
113
|
+
}).strict().optional().describe("Withdraw ALL funds from the compensation_fund to a new Payment object owned by `receipt`. " +
|
|
114
|
+
"Move layer: service::compensation_fund_withdraw (service.move L383-390). " +
|
|
115
|
+
"REQUIRES: Service must be paused AND setting_lock_duration must have elapsed since pause (assert_not_published at L384-385). " +
|
|
116
|
+
"Withdraws the ENTIRE compensation_fund balance via balance::withdraw_all. " +
|
|
117
|
+
"DIFFERENT from compensation_claim (order-side, for arbitration-winning users, no pause+lock required)."),
|
|
118
|
+
setting_lock_duration_add: z.number().optional().describe("Additional lock duration to ADD to 'setting_lock_duration' (Move field name). " +
|
|
119
|
+
"UNIT: milliseconds (ms). Example: 2592000000 = 30 days, 7776000000 = 90 days, 86400000 = 1 day. " +
|
|
120
|
+
"DEFAULT: 2592000000 (30 days, DEFAULT_LOCK_DURATION). This is the initial value when a Service is created. " +
|
|
121
|
+
"Behavior: additive (safe_add) — only increases, never decreases. " +
|
|
122
|
+
"Move entry: service::setting_lock_duration_add / setting_lock_duration_add_with_passport. " +
|
|
123
|
+
"Can be called BEFORE or AFTER publish (no publish check). " +
|
|
124
|
+
"Affects the waiting time required by: compensation_fund_withdraw, arbitrations remove/clear, rewards remove/clear " +
|
|
125
|
+
"(all require pause + setting_lock_duration elapsed since pause)."),
|
|
126
|
+
compensation_fund_receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive order compensation funds from this Service object." + RECEIVE_FORMAT_BLOCK_BALANCE),
|
|
127
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this Service object and send them to the owner of its Permission object." + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
74
128
|
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name."),
|
|
75
129
|
pause: z.boolean().optional().describe("Whether to pause accepting new orders."),
|
|
76
130
|
publish: z.boolean().optional().describe("Whether to publish the Service. After publishing, customers can place orders. " +
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
" • machine (
|
|
80
|
-
" • order_allocators (
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
" • rewards remove/clear
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
" •
|
|
87
|
-
" • sales, discount, description, location, pause, repositories,\n" +
|
|
88
|
-
" • compensation_fund_add, customer_required, um (Contact)
|
|
89
|
-
"These
|
|
131
|
+
"VERIFIED against Move source service.move + SDK service.ts (4-level immutability matrix):\n" +
|
|
132
|
+
" L1 — PERMANENTLY LOCKED after publish (assert!(!bPublished), no pause+lock exception):\n" +
|
|
133
|
+
" • machine (service.move L633/L653 — workflow template)\n" +
|
|
134
|
+
" • order_allocators (service.move L503 — fund distribution rules)\n" +
|
|
135
|
+
" L2 — TIME-LOCKED after publish (assert_not_published — requires pause + setting_lock_duration elapsed):\n" +
|
|
136
|
+
" • arbitrations remove/clear (service.move L433/L445 — dispute resolution objects)\n" +
|
|
137
|
+
" • rewards remove/clear (service.move L402/L414 — reward objects)\n" +
|
|
138
|
+
" • compensation_fund_withdraw (service.move L384-385 — withdraw ALL funds)\n" +
|
|
139
|
+
" L3 — REMAIN MUTABLE after publish (no SDK check, no Move check):\n" +
|
|
140
|
+
" • arbitrations add, rewards add (no assert — can add after publish)\n" +
|
|
141
|
+
" • buy_guard, sales, discount, description, location, pause, repositories,\n" +
|
|
142
|
+
" • compensation_fund_add, setting_lock_duration_add, customer_required, um (Contact)\n" +
|
|
143
|
+
"These 2 L1-LOCKED fields (machine/order_allocators) MUST be set BEFORE publish=true.\n" +
|
|
144
|
+
"arbitrations/rewards can be ADDED after publish but remove/clear requires pause+lock.\n" +
|
|
145
|
+
"\n" +
|
|
146
|
+
"⚠️ COMPENSATION_FUND + ARBITRATION LINKAGE (service.move:494-499):\n" +
|
|
147
|
+
" At publish time, if compensation_fund > 0, Arbitration MUST be bound:\n" +
|
|
148
|
+
" if (balance::value(&self.compensation_fund) > 0) {\n" +
|
|
149
|
+
" assert!(arbitration_count > 0, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND);\n" +
|
|
150
|
+
" }\n" +
|
|
151
|
+
" The MCP handler enforces this as a HARD PRE-CHECK: if publish=true AND compensation_fund_add " +
|
|
152
|
+
" is set in the same call AND arbitrations is empty, the call is REJECTED before submission. " +
|
|
153
|
+
" If compensation_fund was deposited in a prior call, a SOFT WARNING is issued.\n" +
|
|
90
154
|
"\n" +
|
|
91
155
|
"SCHEMA-03 / P0-01 fix — DEPLOYMENT WORKFLOW (two-phase, avoids circular dependency):\n" +
|
|
92
156
|
" Phase 1 — CREATE (no publish): object={name:'my-service', type_parameter, permission} + machine + order_allocators + arbitrations.\n" +
|
|
93
157
|
" NOTE: buy_guard can use a LocalMark NAME (not address) to break the Guard→Service circular dependency.\n" +
|
|
94
158
|
" The name is resolved to an address at transaction build time.\n" +
|
|
95
159
|
" Phase 2 — PUBLISH: object='my-service' (string ref) + publish=true.\n" +
|
|
96
|
-
" All
|
|
97
|
-
" Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), etc."),
|
|
160
|
+
" All L1-LOCKED fields must be set in Phase 1; Phase 2 only flips the publish flag.\n" +
|
|
161
|
+
" Post-publish updates: buy_guard, sales, description, repositories (add), rewards (add), arbitrations (add), etc."),
|
|
98
162
|
}).strict().describe("On-chain Service operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, type_parameter, permission, ...} to create a Service. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
|
|
99
163
|
export const CallService_InputSchema = z.object({
|
|
100
164
|
data: CallService_DataSchema,
|
|
@@ -841,6 +841,15 @@ export declare const CallTreasury_DataSchema: z.ZodObject<{
|
|
|
841
841
|
onChain?: boolean | undefined;
|
|
842
842
|
} | undefined;
|
|
843
843
|
} | undefined;
|
|
844
|
+
receive?: {
|
|
845
|
+
received: {
|
|
846
|
+
id: string;
|
|
847
|
+
balance: string | number;
|
|
848
|
+
payment: string;
|
|
849
|
+
}[];
|
|
850
|
+
balance: string | number;
|
|
851
|
+
token_type: string;
|
|
852
|
+
} | "recently" | undefined;
|
|
844
853
|
um?: string | null | undefined;
|
|
845
854
|
withdraw?: {
|
|
846
855
|
amount: {
|
|
@@ -878,15 +887,6 @@ export declare const CallTreasury_DataSchema: z.ZodObject<{
|
|
|
878
887
|
id: string;
|
|
879
888
|
content_raw?: any;
|
|
880
889
|
}[] | undefined;
|
|
881
|
-
receive?: {
|
|
882
|
-
received: {
|
|
883
|
-
id: string;
|
|
884
|
-
balance: string | number;
|
|
885
|
-
payment: string;
|
|
886
|
-
}[];
|
|
887
|
-
balance: string | number;
|
|
888
|
-
token_type: string;
|
|
889
|
-
} | "recently" | undefined;
|
|
890
890
|
external_deposit_guard?: {
|
|
891
891
|
op: "add";
|
|
892
892
|
guards: {
|
|
@@ -963,6 +963,15 @@ export declare const CallTreasury_DataSchema: z.ZodObject<{
|
|
|
963
963
|
onChain?: boolean | undefined;
|
|
964
964
|
} | undefined;
|
|
965
965
|
} | undefined;
|
|
966
|
+
receive?: {
|
|
967
|
+
received: {
|
|
968
|
+
id: string;
|
|
969
|
+
balance: string | number;
|
|
970
|
+
payment: string;
|
|
971
|
+
}[];
|
|
972
|
+
balance: string | number;
|
|
973
|
+
token_type: string;
|
|
974
|
+
} | "recently" | undefined;
|
|
966
975
|
um?: string | null | undefined;
|
|
967
976
|
withdraw?: {
|
|
968
977
|
amount: {
|
|
@@ -1000,15 +1009,6 @@ export declare const CallTreasury_DataSchema: z.ZodObject<{
|
|
|
1000
1009
|
id: string;
|
|
1001
1010
|
content_raw?: any;
|
|
1002
1011
|
}[] | undefined;
|
|
1003
|
-
receive?: {
|
|
1004
|
-
received: {
|
|
1005
|
-
id: string;
|
|
1006
|
-
balance: string | number;
|
|
1007
|
-
payment: string;
|
|
1008
|
-
}[];
|
|
1009
|
-
balance: string | number;
|
|
1010
|
-
token_type: string;
|
|
1011
|
-
} | "recently" | undefined;
|
|
1012
1012
|
external_deposit_guard?: {
|
|
1013
1013
|
op: "add";
|
|
1014
1014
|
guards: {
|
|
@@ -1558,6 +1558,15 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
1558
1558
|
onChain?: boolean | undefined;
|
|
1559
1559
|
} | undefined;
|
|
1560
1560
|
} | undefined;
|
|
1561
|
+
receive?: {
|
|
1562
|
+
received: {
|
|
1563
|
+
id: string;
|
|
1564
|
+
balance: string | number;
|
|
1565
|
+
payment: string;
|
|
1566
|
+
}[];
|
|
1567
|
+
balance: string | number;
|
|
1568
|
+
token_type: string;
|
|
1569
|
+
} | "recently" | undefined;
|
|
1561
1570
|
um?: string | null | undefined;
|
|
1562
1571
|
withdraw?: {
|
|
1563
1572
|
amount: {
|
|
@@ -1595,15 +1604,6 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
1595
1604
|
id: string;
|
|
1596
1605
|
content_raw?: any;
|
|
1597
1606
|
}[] | undefined;
|
|
1598
|
-
receive?: {
|
|
1599
|
-
received: {
|
|
1600
|
-
id: string;
|
|
1601
|
-
balance: string | number;
|
|
1602
|
-
payment: string;
|
|
1603
|
-
}[];
|
|
1604
|
-
balance: string | number;
|
|
1605
|
-
token_type: string;
|
|
1606
|
-
} | "recently" | undefined;
|
|
1607
1607
|
external_deposit_guard?: {
|
|
1608
1608
|
op: "add";
|
|
1609
1609
|
guards: {
|
|
@@ -1680,6 +1680,15 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
1680
1680
|
onChain?: boolean | undefined;
|
|
1681
1681
|
} | undefined;
|
|
1682
1682
|
} | undefined;
|
|
1683
|
+
receive?: {
|
|
1684
|
+
received: {
|
|
1685
|
+
id: string;
|
|
1686
|
+
balance: string | number;
|
|
1687
|
+
payment: string;
|
|
1688
|
+
}[];
|
|
1689
|
+
balance: string | number;
|
|
1690
|
+
token_type: string;
|
|
1691
|
+
} | "recently" | undefined;
|
|
1683
1692
|
um?: string | null | undefined;
|
|
1684
1693
|
withdraw?: {
|
|
1685
1694
|
amount: {
|
|
@@ -1717,15 +1726,6 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
1717
1726
|
id: string;
|
|
1718
1727
|
content_raw?: any;
|
|
1719
1728
|
}[] | undefined;
|
|
1720
|
-
receive?: {
|
|
1721
|
-
received: {
|
|
1722
|
-
id: string;
|
|
1723
|
-
balance: string | number;
|
|
1724
|
-
payment: string;
|
|
1725
|
-
}[];
|
|
1726
|
-
balance: string | number;
|
|
1727
|
-
token_type: string;
|
|
1728
|
-
} | "recently" | undefined;
|
|
1729
1729
|
external_deposit_guard?: {
|
|
1730
1730
|
op: "add";
|
|
1731
1731
|
guards: {
|
|
@@ -1777,10 +1777,11 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
1777
1777
|
user_intent_phrases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1778
1778
|
project: z.ZodOptional<z.ZodString>;
|
|
1779
1779
|
client_schema_version: z.ZodOptional<z.ZodString>;
|
|
1780
|
-
schema_strict_mode: z.ZodOptional<z.ZodBoolean
|
|
1780
|
+
schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1781
1781
|
dry_run: z.ZodOptional<z.ZodBoolean>;
|
|
1782
1782
|
}, "strict", z.ZodTypeAny, {
|
|
1783
1783
|
account: string;
|
|
1784
|
+
schema_strict_mode: boolean;
|
|
1784
1785
|
no_cache?: boolean | undefined;
|
|
1785
1786
|
network?: import("@wowok/wowok").ENTRYPOINT | undefined;
|
|
1786
1787
|
permission_guard?: string[] | undefined;
|
|
@@ -1789,7 +1790,6 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
1789
1790
|
user_intent_phrases?: string[] | undefined;
|
|
1790
1791
|
project?: string | undefined;
|
|
1791
1792
|
client_schema_version?: string | undefined;
|
|
1792
|
-
schema_strict_mode?: boolean | undefined;
|
|
1793
1793
|
dry_run?: boolean | undefined;
|
|
1794
1794
|
}, {
|
|
1795
1795
|
no_cache?: boolean | undefined;
|
|
@@ -2021,6 +2021,15 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
2021
2021
|
onChain?: boolean | undefined;
|
|
2022
2022
|
} | undefined;
|
|
2023
2023
|
} | undefined;
|
|
2024
|
+
receive?: {
|
|
2025
|
+
received: {
|
|
2026
|
+
id: string;
|
|
2027
|
+
balance: string | number;
|
|
2028
|
+
payment: string;
|
|
2029
|
+
}[];
|
|
2030
|
+
balance: string | number;
|
|
2031
|
+
token_type: string;
|
|
2032
|
+
} | "recently" | undefined;
|
|
2024
2033
|
um?: string | null | undefined;
|
|
2025
2034
|
withdraw?: {
|
|
2026
2035
|
amount: {
|
|
@@ -2058,15 +2067,6 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
2058
2067
|
id: string;
|
|
2059
2068
|
content_raw?: any;
|
|
2060
2069
|
}[] | undefined;
|
|
2061
|
-
receive?: {
|
|
2062
|
-
received: {
|
|
2063
|
-
id: string;
|
|
2064
|
-
balance: string | number;
|
|
2065
|
-
payment: string;
|
|
2066
|
-
}[];
|
|
2067
|
-
balance: string | number;
|
|
2068
|
-
token_type: string;
|
|
2069
|
-
} | "recently" | undefined;
|
|
2070
2070
|
external_deposit_guard?: {
|
|
2071
2071
|
op: "add";
|
|
2072
2072
|
guards: {
|
|
@@ -2137,6 +2137,7 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
2137
2137
|
} | undefined;
|
|
2138
2138
|
env?: {
|
|
2139
2139
|
account: string;
|
|
2140
|
+
schema_strict_mode: boolean;
|
|
2140
2141
|
no_cache?: boolean | undefined;
|
|
2141
2142
|
network?: import("@wowok/wowok").ENTRYPOINT | undefined;
|
|
2142
2143
|
permission_guard?: string[] | undefined;
|
|
@@ -2145,7 +2146,6 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
2145
2146
|
user_intent_phrases?: string[] | undefined;
|
|
2146
2147
|
project?: string | undefined;
|
|
2147
2148
|
client_schema_version?: string | undefined;
|
|
2148
|
-
schema_strict_mode?: boolean | undefined;
|
|
2149
2149
|
dry_run?: boolean | undefined;
|
|
2150
2150
|
} | undefined;
|
|
2151
2151
|
}, {
|
|
@@ -2185,6 +2185,15 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
2185
2185
|
onChain?: boolean | undefined;
|
|
2186
2186
|
} | undefined;
|
|
2187
2187
|
} | undefined;
|
|
2188
|
+
receive?: {
|
|
2189
|
+
received: {
|
|
2190
|
+
id: string;
|
|
2191
|
+
balance: string | number;
|
|
2192
|
+
payment: string;
|
|
2193
|
+
}[];
|
|
2194
|
+
balance: string | number;
|
|
2195
|
+
token_type: string;
|
|
2196
|
+
} | "recently" | undefined;
|
|
2188
2197
|
um?: string | null | undefined;
|
|
2189
2198
|
withdraw?: {
|
|
2190
2199
|
amount: {
|
|
@@ -2222,15 +2231,6 @@ export declare const CallTreasury_InputSchema: z.ZodObject<{
|
|
|
2222
2231
|
id: string;
|
|
2223
2232
|
content_raw?: any;
|
|
2224
2233
|
}[] | undefined;
|
|
2225
|
-
receive?: {
|
|
2226
|
-
received: {
|
|
2227
|
-
id: string;
|
|
2228
|
-
balance: string | number;
|
|
2229
|
-
payment: string;
|
|
2230
|
-
}[];
|
|
2231
|
-
balance: string | number;
|
|
2232
|
-
token_type: string;
|
|
2233
|
-
} | "recently" | undefined;
|
|
2234
2234
|
external_deposit_guard?: {
|
|
2235
2235
|
op: "add";
|
|
2236
2236
|
guards: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { TypedPermissionObjectSchema, CoinParamSchema, NamedObjectSchema, SubmissionCallSchema, CallEnvSchema } from "./base.js";
|
|
3
3
|
import { AmountFromDepositGuardSchema, AmountFromWithdrawGuardSchema, PaymentInfoSchema } from "../query/index.js";
|
|
4
|
-
import { AccountOrMark_AddressSchema, DescriptionSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema, NameOrAddressSchema } from "../common/index.js";
|
|
4
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema, NameOrAddressSchema, RECEIVE_FORMAT_BLOCK_OBJECTS, RECEIVE_FORMAT_BLOCK_BALANCE } from "../common/index.js";
|
|
5
5
|
import { BalanceTypeSchema } from "../common/index.js";
|
|
6
6
|
export const DepositSchema = z.object({
|
|
7
7
|
coin: CoinParamSchema.describe("Asset to deposit"),
|
|
@@ -56,12 +56,12 @@ export const ExternalWithdrawGuardSchema = z.discriminatedUnion("op", [
|
|
|
56
56
|
export const CallTreasury_DataSchema = z.object({
|
|
57
57
|
object: TypedPermissionObjectSchema,
|
|
58
58
|
description: DescriptionSchema.optional(),
|
|
59
|
-
receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive CoinWrapper objects received by
|
|
59
|
+
receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive CoinWrapper objects received by this Treasury object and deposit them into its balance." + RECEIVE_FORMAT_BLOCK_BALANCE),
|
|
60
60
|
deposit: DepositSchema.optional().describe("Deposit to Treasury object"),
|
|
61
61
|
withdraw: WithdrawSchema.optional().describe("Withdraw from Treasury object"),
|
|
62
62
|
external_deposit_guard: ExternalDepositGuardSchema.optional().describe("Set external deposit Guard for Treasury object"),
|
|
63
63
|
external_withdraw_guard: ExternalWithdrawGuardSchema.optional().describe("Set external withdrawal Guard for Treasury object"),
|
|
64
|
-
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."),
|
|
64
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this Treasury object and send them to the owner of its Permission object." + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
65
65
|
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name."),
|
|
66
66
|
}).strict().describe("On-chain Treasury operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, type_parameter, permission, ...} to create a Treasury. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
|
|
67
67
|
export const CallTreasury_InputSchema = z.object({
|
|
@@ -715,6 +715,8 @@ export declare const ReceivedObjectsOrRecentlySchema: z.ZodUnion<[z.ZodArray<z.Z
|
|
|
715
715
|
balance: string | number;
|
|
716
716
|
token_type: string;
|
|
717
717
|
}>, z.ZodLiteral<"recently">]>;
|
|
718
|
+
export declare const RECEIVE_FORMAT_BLOCK_OBJECTS: string;
|
|
719
|
+
export declare const RECEIVE_FORMAT_BLOCK_BALANCE: string;
|
|
718
720
|
export declare const QueryReceivedResultSchema: z.ZodObject<{
|
|
719
721
|
result: z.ZodUnion<[z.ZodObject<{
|
|
720
722
|
balance: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
@@ -222,15 +222,18 @@ export const ObjectTypeSchema = z.enum([
|
|
|
222
222
|
WowObjectType.TableItem_AddressMark,
|
|
223
223
|
WowObjectType.TableItem_EntityRegistrar,
|
|
224
224
|
]).describe("Wowok object type");
|
|
225
|
-
export const BalanceTypeSchema = z.union([z.number(), z.string()]).describe("A coin/balance amount
|
|
226
|
-
"
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
"UNIT:
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
225
|
+
export const BalanceTypeSchema = z.union([z.number(), z.string()]).describe("A coin/balance amount. Accepts three formats: " +
|
|
226
|
+
"(1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — " +
|
|
227
|
+
"auto-converted to smallest units via the Fund Processing Layer (token precision resolved " +
|
|
228
|
+
"from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. " +
|
|
229
|
+
"(2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. " +
|
|
230
|
+
"(3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). " +
|
|
231
|
+
"PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. " +
|
|
232
|
+
"Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). " +
|
|
233
|
+
"For custom tokens: use display format with the token's symbol, or pass smallest units directly. " +
|
|
234
|
+
"MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. " +
|
|
235
|
+
"If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. " +
|
|
236
|
+
"Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). " +
|
|
234
237
|
"Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities.");
|
|
235
238
|
export const QueryIdSchema = z.number().int().min(0).describe("Query ID");
|
|
236
239
|
export const CacheExpireTypeSchema = z.union([z.number(), z.literal("INFINITE")]).describe("Cache expiration time type");
|
|
@@ -253,7 +256,18 @@ export const SupportedValueSchema = SupportedValueUserSchema.or(ValueContainerSc
|
|
|
253
256
|
export const GuardIdentifierSchema = z.number().int().min(0).max(255).describe("Identifier (0-255) for data lookup in Guard table.");
|
|
254
257
|
export const GuardTableItemBaseSchema = z.object({
|
|
255
258
|
identifier: GuardIdentifierSchema,
|
|
256
|
-
b_submission: z.boolean().describe("Whether
|
|
259
|
+
b_submission: z.boolean().describe("Whether this table item's value is submitted dynamically at Guard trigger time (alloc_by_guard call). " +
|
|
260
|
+
"\n\n" +
|
|
261
|
+
"true = value is submitted by the caller when triggering the Guard. " +
|
|
262
|
+
"Use for runtime-context-dependent values like order address, user address. " +
|
|
263
|
+
"The 'value' field is ignored when b_submission=true; the caller must provide it via submissions[]. " +
|
|
264
|
+
"\n\n" +
|
|
265
|
+
"false = value is static, set at Guard creation time. " +
|
|
266
|
+
"Use for values known when the Guard is created: expected node names, expected merchant address, expected service address. " +
|
|
267
|
+
"The 'value' field must be populated and will be stored on-chain permanently. " +
|
|
268
|
+
"\n\n" +
|
|
269
|
+
"Rule of thumb: if the value is the SAME for all future Guard triggers, use false. " +
|
|
270
|
+
"If the value DIFFERS per trigger (e.g., which order to release funds for), use true."),
|
|
257
271
|
value_type: ValueTypeUserSchema.describe("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). " +
|
|
258
272
|
"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."),
|
|
259
273
|
value: SupportedValueUserSchema.optional().describe("The actual value data. Format depends on `value_type`:\n" +
|
|
@@ -363,6 +377,28 @@ export const ReceivedObjectsOrRecentlySchema = z.union([
|
|
|
363
377
|
ReceivedBalanceSchema,
|
|
364
378
|
z.literal("recently"),
|
|
365
379
|
]).describe("Specified received object records or all recently received object records");
|
|
380
|
+
export const RECEIVE_FORMAT_BLOCK_OBJECTS = "\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n" +
|
|
381
|
+
"• 'recently' (string literal) — auto-query and receive ALL recently received objects.\n" +
|
|
382
|
+
" Use this for the common case: \"withdraw everything the object has received.\"\n" +
|
|
383
|
+
" Example: receive: 'recently'\n" +
|
|
384
|
+
"• ReceivedNormal[] (array) — explicit list of received objects to unwrap.\n" +
|
|
385
|
+
" Use this when you want to receive specific objects only (not all).\n" +
|
|
386
|
+
" Example: receive: [{id: '0xobj1', type: '0x2::coin::Coin<0x2::sui::SUI>'}]\n" +
|
|
387
|
+
"• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n" +
|
|
388
|
+
" receive a balance record from a specific Payment/payer.\n" +
|
|
389
|
+
" Use this for precise balance targeting (advanced — usually after querying\n" +
|
|
390
|
+
" the object's received history via query_received).\n" +
|
|
391
|
+
" Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\n" +
|
|
392
|
+
"ANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly.";
|
|
393
|
+
export const RECEIVE_FORMAT_BLOCK_BALANCE = "\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n" +
|
|
394
|
+
"• 'recently' (string literal) — auto-query and receive ALL recently received balance.\n" +
|
|
395
|
+
" Use this for the common case: \"deposit all recently received coins into pending balance.\"\n" +
|
|
396
|
+
" Example: receive: 'recently'\n" +
|
|
397
|
+
"• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n" +
|
|
398
|
+
" receive a specific balance record from a Payment/payer.\n" +
|
|
399
|
+
" Use this when targeting a specific received balance (advanced).\n" +
|
|
400
|
+
" Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\n" +
|
|
401
|
+
"ANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly.";
|
|
366
402
|
export const QueryReceivedResultSchema = z.object({
|
|
367
403
|
result: z.union([
|
|
368
404
|
ReceivedBalanceSchema,
|
|
@@ -568,7 +568,11 @@ export const AccountOperationSchema = z
|
|
|
568
568
|
})
|
|
569
569
|
.strict()
|
|
570
570
|
.refine((data) => Object.keys(data).length > 0, "At least one operation (gen/faucet/suspend/resume/rename/swap_name/transfer/get/signData/messenger) must be specified")
|
|
571
|
-
.describe("Account operations
|
|
571
|
+
.describe("Account operations (mutations only: gen/faucet/suspend/resume/rename/swap_name/transfer/get/signData/messenger). " +
|
|
572
|
+
"Parameters MUST be wrapped in the operation type property (e.g. {transfer: {...}}, NOT {amount: ...}). Unwrapped parameters are rejected. " +
|
|
573
|
+
"TO LIST ALL ACCOUNTS: use the query_toolkit tool with query_type='account_list' (returns name, address, suspended status, messenger status for all local accounts). " +
|
|
574
|
+
"This separation follows CQRS: account_operation = mutations, query_toolkit = queries. " +
|
|
575
|
+
"Common workflow after MCP restart: (1) query_toolkit query_type='account_list' to see all accounts, (2) account_operation with the appropriate mutation.");
|
|
572
576
|
export const AccountOperationResultSchema = z
|
|
573
577
|
.object({
|
|
574
578
|
gen: z
|
|
@@ -378,7 +378,10 @@ export const MessengerOperationInputSchema = z.discriminatedUnion("operation", [
|
|
|
378
378
|
account: NameOrAddressSchema.optional().describe("Account name or address. If not specified, uses default account"),
|
|
379
379
|
limit: z.number().optional().describe("Maximum number of messages to pull from server"),
|
|
380
380
|
}).strict(),
|
|
381
|
-
]).describe("Messenger operation input schema"
|
|
381
|
+
]).describe("Messenger operation input schema. PREREQUISITE: an account must ENABLE messenger before sending/receiving. " +
|
|
382
|
+
"There is NO 'enable' operation in this tool — enable via account_operation {messenger: {enabled: true, name_or_account: '<account>'}}, " +
|
|
383
|
+
"or implicitly via send_message/send_file with options.enable_messenger: true. " +
|
|
384
|
+
"Use proof_message to anchor a message's WTS proof on-chain (creates a Proof object consumable by Guards via proof.signer/proof.time queries).");
|
|
382
385
|
export const MessengerOperationOutputSchema = z.object({
|
|
383
386
|
result: z.discriminatedUnion("operation", [
|
|
384
387
|
z.object({
|