@wowok/agent-mcp 2.6.1 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/customer/info-puzzle.d.ts +1 -1
- package/dist/customer/info-puzzle.js +4 -2
- package/dist/customer/risk-assessment.js +26 -4
- package/dist/customer/types.d.ts +2 -0
- package/dist/examples/guard-template-balance-check.json +38 -0
- package/dist/examples/guard-template-time-lock.json +39 -0
- package/dist/examples/machine-template-7node-rental.json +114 -0
- package/dist/examples/rental-ziroom-machine-create.json +137 -0
- package/dist/examples/rental-ziroom-permission-create.json +35 -0
- package/dist/examples/rental-ziroom-service-create.json +80 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/extensions/capability-manifest.js +24 -24
- package/dist/extensions/constraint-registry.js +18 -18
- package/dist/extensions/metric-registry.js +14 -14
- package/dist/extensions/mode-evaluator.js +16 -16
- package/dist/extensions/modes.js +131 -45
- package/dist/extensions/registry.d.ts +2 -0
- package/dist/extensions/registry.js +63 -30
- package/dist/extensions/types.d.ts +1 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +72 -0
- package/dist/knowledge/fund-layer.js +420 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-templates.js +4 -4
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/service-confirm.d.ts +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/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 +1371 -0
- package/dist/project/evaluation.js +314 -14
- package/dist/project/graph-builder.js +6 -1
- package/dist/project/handlers.d.ts +99 -2
- package/dist/project/handlers.js +358 -16
- package/dist/project/stage-gate.js +4 -4
- package/dist/schema/call/allocation.js +2 -2
- package/dist/schema/call/arbitration.js +19 -6
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/machine.d.ts +1975 -777
- package/dist/schema/call/machine.js +50 -4
- package/dist/schema/call/order.js +3 -6
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.js +7 -1
- package/dist/schema/call/service.d.ts +180 -8
- package/dist/schema/call/service.js +82 -27
- 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/operations.d.ts +755 -176
- package/dist/schema/operations.js +43 -7
- package/dist/schema/project/index.d.ts +969 -6
- package/dist/schema/project/index.js +268 -4
- package/dist/schema/query/index.d.ts +217 -0
- package/dist/schema/query/index.js +63 -33
- package/dist/schema/schema-query/index.d.ts +53 -3
- package/dist/schema/schema-query/index.js +17 -2
- 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 +76 -0
- package/dist/schema-query/index.d.ts +14 -1
- package/dist/schema-query/index.js +104 -2
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/index.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 +115 -53
- package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -7
- package/dist/schemas/onchain_operations_contact.schema.json +3 -3
- package/dist/schemas/onchain_operations_demand.schema.json +3 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +4 -4
- package/dist/schemas/onchain_operations_order.schema.json +3 -3
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_permission.schema.json +2 -2
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1
- package/dist/schemas/onchain_operations_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_repository.schema.json +3 -3
- package/dist/schemas/onchain_operations_reward.schema.json +6 -6
- package/dist/schemas/onchain_operations_service.schema.json +77 -17
- package/dist/schemas/onchain_operations_treasury.schema.json +4 -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 +1026 -7
- package/dist/schemas/project_operation.schema.json +46 -4
- package/dist/schemas/query_toolkit.output.json +15 -15
- package/dist/schemas/query_toolkit.schema.json +3 -3
- package/dist/schemas/schema_query.output.json +64 -1
- package/dist/schemas/schema_query.schema.json +3 -2
- 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 +571 -6
- package/dist/tools/handlers/project.js +25 -2
- package/dist/tools/handlers/schema-query.js +24 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +177 -6
- package/package.json +2 -2
|
@@ -65,7 +65,7 @@ export declare function assembleFundSafety(raw: ServiceRawData, orderAmount: big
|
|
|
65
65
|
export declare function assembleTrustSignals(service: ServiceRawData, reviews: ReviewRaw[], trustScore: {
|
|
66
66
|
score: number;
|
|
67
67
|
level: string;
|
|
68
|
-
}, arbitrationOwner?: string, serviceOwner?: string): TrustSignals;
|
|
68
|
+
}, arbitrationOwner?: string, serviceOwner?: string, permissionShared?: boolean, permissionOverlap?: boolean): TrustSignals;
|
|
69
69
|
export declare function assembleMerchantBehavior(events: EventRaw[], orderHistory?: Array<{
|
|
70
70
|
status: string;
|
|
71
71
|
has_dispute: boolean;
|
|
@@ -33,7 +33,7 @@ export function assembleWorkflowAnalysis(nodes, isPublished, isPaused, serviceRa
|
|
|
33
33
|
let hasWonderNode = false;
|
|
34
34
|
let hasDisputeAntiPattern = false;
|
|
35
35
|
const antiPatternNodeRegex = /^(disputed|refunded|arb|arbitration|dispute|refund)$/i;
|
|
36
|
-
const wonderNodeRegex = /^(wonder|no_wonder|praise|complain|thumbs_up|thumbs_down
|
|
36
|
+
const wonderNodeRegex = /^(wonder|no_wonder|praise|complain|thumbs_up|thumbs_down|positive_review|negative_review)$/i;
|
|
37
37
|
const totalForwards = nodes.reduce((sum, n) => sum + (n.forwards?.length ?? 0), 0);
|
|
38
38
|
for (const node of nodes) {
|
|
39
39
|
if (antiPatternNodeRegex.test(node.name.trim())) {
|
|
@@ -146,7 +146,7 @@ export function assembleFundSafety(raw, orderAmount) {
|
|
|
146
146
|
price_anomaly: priceAnomaly,
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
export function assembleTrustSignals(service, reviews, trustScore, arbitrationOwner, serviceOwner) {
|
|
149
|
+
export function assembleTrustSignals(service, reviews, trustScore, arbitrationOwner, serviceOwner, permissionShared, permissionOverlap) {
|
|
150
150
|
const likes = reviews.filter((r) => r.rating === "like").length;
|
|
151
151
|
const dislikes = reviews.filter((r) => r.rating === "dislike").length;
|
|
152
152
|
const verified = reviews.filter((r) => r.verified || r.has_evidence).length;
|
|
@@ -168,6 +168,8 @@ export function assembleTrustSignals(service, reviews, trustScore, arbitrationOw
|
|
|
168
168
|
trust_level: trustScore.level,
|
|
169
169
|
has_contact: !!service.um,
|
|
170
170
|
has_messenger: !!service.um,
|
|
171
|
+
arbitration_permission_shared: permissionShared,
|
|
172
|
+
arbitration_permission_overlap: permissionOverlap,
|
|
171
173
|
};
|
|
172
174
|
}
|
|
173
175
|
export function assembleMerchantBehavior(events, orderHistory) {
|
|
@@ -134,13 +134,35 @@ function assessTrustRisk(puzzle) {
|
|
|
134
134
|
const trust = puzzle.trust_signals;
|
|
135
135
|
const checks = [];
|
|
136
136
|
const arbIndependent = trust?.arbitration_independent ?? true;
|
|
137
|
+
const permShared = trust?.arbitration_permission_shared === true;
|
|
138
|
+
const permOverlap = trust?.arbitration_permission_overlap === true;
|
|
139
|
+
let arbPassed = arbIndependent;
|
|
140
|
+
let arbAdvice;
|
|
141
|
+
let arbWeight = 6;
|
|
142
|
+
if (permShared) {
|
|
143
|
+
arbPassed = false;
|
|
144
|
+
arbAdvice = "🔴 CRITICAL: Arbitration and Service share the SAME Permission object. " +
|
|
145
|
+
"The merchant fully controls arbitration operations (vote, confirm, execute rulings). " +
|
|
146
|
+
"Dispute fairness cannot be guaranteed. Require the merchant to use a separate, " +
|
|
147
|
+
"independent Permission object for Arbitration before ordering.";
|
|
148
|
+
}
|
|
149
|
+
else if (permOverlap) {
|
|
150
|
+
arbPassed = false;
|
|
151
|
+
arbAdvice = "🔴 WARNING: Arbitration and Service have overlapping Permission control " +
|
|
152
|
+
"(shared owner or admin). Even with separate Permission objects, the merchant can " +
|
|
153
|
+
"influence dispute outcomes. For mainnet, require completely independent third-party " +
|
|
154
|
+
"Permission (different owner and admin list) for Arbitration.";
|
|
155
|
+
}
|
|
156
|
+
else if (!arbIndependent) {
|
|
157
|
+
arbAdvice = "🔴 Arbitrator and merchant are the same address: arbitration fairness cannot be guaranteed.";
|
|
158
|
+
}
|
|
137
159
|
checks.push({
|
|
138
160
|
id: "trust_arb_independent",
|
|
139
161
|
dimension: "trust",
|
|
140
|
-
description: "Arbitrator has no conflict of interest with the merchant",
|
|
141
|
-
weight:
|
|
142
|
-
passed:
|
|
143
|
-
advice:
|
|
162
|
+
description: "Arbitrator has no conflict of interest with the merchant (Permission isolation)",
|
|
163
|
+
weight: arbWeight,
|
|
164
|
+
passed: arbPassed,
|
|
165
|
+
advice: arbAdvice,
|
|
144
166
|
});
|
|
145
167
|
let reviewPassed = false;
|
|
146
168
|
let reviewAdvice;
|
package/dist/customer/types.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export interface TrustSignals {
|
|
|
61
61
|
trust_level: "high_risk" | "caution" | "moderate" | "trusted";
|
|
62
62
|
has_contact: boolean;
|
|
63
63
|
has_messenger: boolean;
|
|
64
|
+
arbitration_permission_shared?: boolean;
|
|
65
|
+
arbitration_permission_overlap?: boolean;
|
|
64
66
|
}
|
|
65
67
|
export interface MerchantBehavior {
|
|
66
68
|
total_orders: number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Guard Template: Balance Check Validation",
|
|
3
|
+
"description": "Guard that validates order balance >= threshold",
|
|
4
|
+
"tags": ["guard", "template", "balance", "validation"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "template",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"call": {
|
|
10
|
+
"tool": "onchain_operations",
|
|
11
|
+
"operation_type": "guard",
|
|
12
|
+
"data": {
|
|
13
|
+
"object": {
|
|
14
|
+
"name": "balance_check_guard"
|
|
15
|
+
},
|
|
16
|
+
"root": {
|
|
17
|
+
"type": "logic_greater_equal",
|
|
18
|
+
"left": {
|
|
19
|
+
"type": "query",
|
|
20
|
+
"name": "balance",
|
|
21
|
+
"parameters": [],
|
|
22
|
+
"objectType": "Order"
|
|
23
|
+
},
|
|
24
|
+
"right": {
|
|
25
|
+
"type": "identifier",
|
|
26
|
+
"value_type": "U64",
|
|
27
|
+
"index": 0
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"env": {
|
|
32
|
+
"network": "testnet"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"notes": [
|
|
36
|
+
"Use for minimum payment validation, deposit threshold checks"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Guard Template: Time-Lock Validation",
|
|
3
|
+
"description": "Guard that validates a time-based condition (e.g., rental period elapsed)",
|
|
4
|
+
"tags": ["guard", "template", "time-lock", "validation"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "template",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"call": {
|
|
10
|
+
"tool": "onchain_operations",
|
|
11
|
+
"operation_type": "guard",
|
|
12
|
+
"data": {
|
|
13
|
+
"object": {
|
|
14
|
+
"name": "time_lock_guard",
|
|
15
|
+
"tags": ["template", "time-lock"]
|
|
16
|
+
},
|
|
17
|
+
"root": {
|
|
18
|
+
"type": "logic_equal",
|
|
19
|
+
"left": {
|
|
20
|
+
"type": "query",
|
|
21
|
+
"name": "time_now",
|
|
22
|
+
"parameters": [],
|
|
23
|
+
"objectType": "Order"
|
|
24
|
+
},
|
|
25
|
+
"right": {
|
|
26
|
+
"type": "identifier",
|
|
27
|
+
"value_type": "U64",
|
|
28
|
+
"index": 0
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"env": {
|
|
33
|
+
"network": "testnet"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"notes": [
|
|
37
|
+
"Use for rental period expiry, escrow release timing, etc."
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Machine Template: 7-Node Rental Workflow (Simplified)",
|
|
3
|
+
"description": "Simplified rental workflow without damage/arbitration paths",
|
|
4
|
+
"tags": ["machine", "template", "rental", "simplified"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "machine",
|
|
7
|
+
"source": "template",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"call": {
|
|
10
|
+
"tool": "onchain_operations",
|
|
11
|
+
"operation_type": "machine",
|
|
12
|
+
"data": {
|
|
13
|
+
"object": {
|
|
14
|
+
"name": "rental_machine_simple"
|
|
15
|
+
},
|
|
16
|
+
"nodes": [
|
|
17
|
+
{
|
|
18
|
+
"name": "reserved",
|
|
19
|
+
"pairs": [
|
|
20
|
+
{
|
|
21
|
+
"prev_node": "",
|
|
22
|
+
"threshold": 0,
|
|
23
|
+
"forwards": [
|
|
24
|
+
{
|
|
25
|
+
"name": "Pay",
|
|
26
|
+
"weight": 1,
|
|
27
|
+
"namedOperator": "",
|
|
28
|
+
"permissionIndex": null
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "paid",
|
|
36
|
+
"pairs": [
|
|
37
|
+
{
|
|
38
|
+
"prev_node": "reserved",
|
|
39
|
+
"threshold": 1,
|
|
40
|
+
"forwards": [
|
|
41
|
+
{
|
|
42
|
+
"name": "Deliver",
|
|
43
|
+
"weight": 1,
|
|
44
|
+
"namedOperator": null,
|
|
45
|
+
"permissionIndex": 1000
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "in_use",
|
|
53
|
+
"pairs": [
|
|
54
|
+
{
|
|
55
|
+
"prev_node": "paid",
|
|
56
|
+
"threshold": 1,
|
|
57
|
+
"forwards": [
|
|
58
|
+
{
|
|
59
|
+
"name": "Return",
|
|
60
|
+
"weight": 1,
|
|
61
|
+
"namedOperator": "",
|
|
62
|
+
"permissionIndex": null
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "returned",
|
|
70
|
+
"pairs": [
|
|
71
|
+
{
|
|
72
|
+
"prev_node": "in_use",
|
|
73
|
+
"threshold": 1,
|
|
74
|
+
"forwards": [
|
|
75
|
+
{
|
|
76
|
+
"name": "Inspect",
|
|
77
|
+
"weight": 1,
|
|
78
|
+
"namedOperator": null,
|
|
79
|
+
"permissionIndex": 1001
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "inspected",
|
|
87
|
+
"pairs": [
|
|
88
|
+
{
|
|
89
|
+
"prev_node": "returned",
|
|
90
|
+
"threshold": 1,
|
|
91
|
+
"forwards": [
|
|
92
|
+
{
|
|
93
|
+
"name": "Refund",
|
|
94
|
+
"weight": 1,
|
|
95
|
+
"namedOperator": null,
|
|
96
|
+
"permissionIndex": 1002
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{ "name": "refunded", "pairs": [] },
|
|
103
|
+
{ "name": "completed", "pairs": [] }
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"env": {
|
|
107
|
+
"network": "testnet"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"notes": [
|
|
111
|
+
"Simplified version — no damage or arbitration paths",
|
|
112
|
+
"Use for short-term rentals without damage risk"
|
|
113
|
+
]
|
|
114
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create 10-node Machine for Rental Lifecycle (Ziroom)",
|
|
3
|
+
"description": "10-node workflow: reserved → paid_deposit → in_use → returned → inspected → deposit_refunded/damage_confirmed/arbiter_rule",
|
|
4
|
+
"tags": ["machine", "rental", "workflow", "nodes", "permission_index"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "machine",
|
|
7
|
+
"source": "ziroom testnet deployment 2026-07-29",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "machine",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "ziroom_machine_v1",
|
|
16
|
+
"tags": ["rental", "machine"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"permission": "ziroom_permission_v1",
|
|
20
|
+
"nodes": [
|
|
21
|
+
{
|
|
22
|
+
"name": "reserved",
|
|
23
|
+
"pairs": [
|
|
24
|
+
{
|
|
25
|
+
"prev_node": "",
|
|
26
|
+
"threshold": 0,
|
|
27
|
+
"forwards": [
|
|
28
|
+
{
|
|
29
|
+
"name": "Pay Deposit",
|
|
30
|
+
"weight": 1,
|
|
31
|
+
"namedOperator": "",
|
|
32
|
+
"permissionIndex": null
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "paid_deposit",
|
|
40
|
+
"pairs": [
|
|
41
|
+
{
|
|
42
|
+
"prev_node": "reserved",
|
|
43
|
+
"threshold": 1,
|
|
44
|
+
"forwards": [
|
|
45
|
+
{
|
|
46
|
+
"name": "Handover",
|
|
47
|
+
"weight": 1,
|
|
48
|
+
"namedOperator": null,
|
|
49
|
+
"permissionIndex": 1000
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "in_use",
|
|
57
|
+
"pairs": [
|
|
58
|
+
{
|
|
59
|
+
"prev_node": "paid_deposit",
|
|
60
|
+
"threshold": 1,
|
|
61
|
+
"forwards": [
|
|
62
|
+
{
|
|
63
|
+
"name": "Return Keys",
|
|
64
|
+
"weight": 1,
|
|
65
|
+
"namedOperator": "",
|
|
66
|
+
"permissionIndex": null
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "returned",
|
|
74
|
+
"pairs": [
|
|
75
|
+
{
|
|
76
|
+
"prev_node": "in_use",
|
|
77
|
+
"threshold": 1,
|
|
78
|
+
"forwards": [
|
|
79
|
+
{
|
|
80
|
+
"name": "Inspect",
|
|
81
|
+
"weight": 1,
|
|
82
|
+
"namedOperator": null,
|
|
83
|
+
"permissionIndex": 1001
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "inspected",
|
|
91
|
+
"pairs": [
|
|
92
|
+
{
|
|
93
|
+
"prev_node": "returned",
|
|
94
|
+
"threshold": 1,
|
|
95
|
+
"forwards": [
|
|
96
|
+
{ "name": "Refund Deposit", "weight": 1, "namedOperator": null, "permissionIndex": 1002 },
|
|
97
|
+
{ "name": "Confirm Damage", "weight": 1, "namedOperator": null, "permissionIndex": 1001 },
|
|
98
|
+
{ "name": "Escalate Arbitration", "weight": 1, "namedOperator": null, "permissionIndex": 1500 }
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{ "name": "deposit_refunded", "pairs": [] },
|
|
104
|
+
{ "name": "completed", "pairs": [] },
|
|
105
|
+
{
|
|
106
|
+
"name": "damage_confirmed",
|
|
107
|
+
"pairs": [
|
|
108
|
+
{
|
|
109
|
+
"prev_node": "inspected",
|
|
110
|
+
"threshold": 1,
|
|
111
|
+
"forwards": [
|
|
112
|
+
{
|
|
113
|
+
"name": "Deduct Deposit",
|
|
114
|
+
"weight": 1,
|
|
115
|
+
"namedOperator": null,
|
|
116
|
+
"permissionIndex": 1002
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{ "name": "deposit_deducted", "pairs": [] },
|
|
123
|
+
{ "name": "arbiter_rule", "pairs": [] }
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"env": {
|
|
127
|
+
"network": "testnet",
|
|
128
|
+
"no_cache": true,
|
|
129
|
+
"project": "ziroom"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"notes": [
|
|
133
|
+
"namedOperator='' means OrderHolder (customer), NOT 'anyone'",
|
|
134
|
+
"permissionIndex maps to Permission table entries (1000=operator, 1001=inspector, 1002=finance, 1500=arbiter)",
|
|
135
|
+
"Machine nodes are immutable after publish — create new Machine to change workflow"
|
|
136
|
+
]
|
|
137
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Permission with Role-Based Indexes (Ziroom Rental)",
|
|
3
|
+
"description": "Single Permission with indexes: 1000=operator, 1001=inspector, 1002=finance, 1500=arbiter",
|
|
4
|
+
"tags": ["permission", "rental", "role", "index"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "permission",
|
|
7
|
+
"source": "ziroom testnet deployment 2026-07-29",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"call": {
|
|
10
|
+
"tool": "onchain_operations",
|
|
11
|
+
"operation_type": "permission",
|
|
12
|
+
"data": {
|
|
13
|
+
"object": {
|
|
14
|
+
"name": "ziroom_permission_v1",
|
|
15
|
+
"tags": ["project:ziroom", "type:permission"],
|
|
16
|
+
"replaceExistName": true
|
|
17
|
+
},
|
|
18
|
+
"table": {
|
|
19
|
+
"op": "add perm by index",
|
|
20
|
+
"index": 1000,
|
|
21
|
+
"entity": ["0x51bd..."]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"env": {
|
|
25
|
+
"network": "testnet",
|
|
26
|
+
"no_cache": true,
|
|
27
|
+
"project": "ziroom"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"notes": [
|
|
31
|
+
"Custom indexes range 1000-65535 (0-999 are protocol-reserved)",
|
|
32
|
+
"Single Permission recommended for centralized control across all objects",
|
|
33
|
+
"Use 'add perm by index' to grant one permission to many entities"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Service with 3-path Allocation (Ziroom Rental)",
|
|
3
|
+
"description": "Create a Service with machine, buy_guard, contact, and 3-path order_allocators (rent/refund/damage)",
|
|
4
|
+
"tags": ["service", "allocation", "rental", "order_allocators", "guard"],
|
|
5
|
+
"industry": "rental",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "ziroom testnet deployment 2026-07-29",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "ziroom_service_v1",
|
|
16
|
+
"tags": ["project:ziroom", "type:service"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"permission": "ziroom_permission_v1",
|
|
20
|
+
"machine": "ziroom_machine_v1",
|
|
21
|
+
"buy_guard": "ziroom_buy_guard_v1",
|
|
22
|
+
"um": "ziroom_contact_v1",
|
|
23
|
+
"sales": [
|
|
24
|
+
{
|
|
25
|
+
"name": "ziroom_apartment_v1",
|
|
26
|
+
"price": 2000000000,
|
|
27
|
+
"stock": 1,
|
|
28
|
+
"suspension": false,
|
|
29
|
+
"wip_hash": ""
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"order_allocators": {
|
|
33
|
+
"description": "3-path allocation: rent to operator, refund to customer, damage deductions",
|
|
34
|
+
"threshold": 1000000000,
|
|
35
|
+
"allocators": [
|
|
36
|
+
{
|
|
37
|
+
"guard": "ziroom_buy_guard_v1",
|
|
38
|
+
"sharing": [
|
|
39
|
+
{
|
|
40
|
+
"who": { "Entity": { "name_or_address": "0x36cd..." } },
|
|
41
|
+
"sharing": 1000000000,
|
|
42
|
+
"mode": "Amount"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"guard": "ziroom_refund_guard_v1",
|
|
48
|
+
"sharing": [
|
|
49
|
+
{
|
|
50
|
+
"who": { "Signer": "signer" },
|
|
51
|
+
"sharing": 1000000000,
|
|
52
|
+
"mode": "Amount"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"guard": "ziroom_damage_guard_v1",
|
|
58
|
+
"sharing": [
|
|
59
|
+
{
|
|
60
|
+
"who": { "Entity": { "name_or_address": "0x36cd..." } },
|
|
61
|
+
"sharing": 1000000000,
|
|
62
|
+
"mode": "Amount"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"env": {
|
|
70
|
+
"network": "testnet",
|
|
71
|
+
"no_cache": true,
|
|
72
|
+
"project": "ziroom"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"notes": [
|
|
76
|
+
"order_allocators is PERMANENTLY IMMUTABLE after publish (service.move:503)",
|
|
77
|
+
"Signer recipient means the tx sender at alloc() time — customer must call alloc_by_guard themselves for refunds",
|
|
78
|
+
"Amount mode: fixed amount, not percentage. Use Rate mode (10000=100%) for proportional splits"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Retail Service with 2-path Allocation (MyShop E-Commerce)",
|
|
3
|
+
"description": "Simple e-commerce Service with machine, withdraw/refund guards, contact, and toy products. 2-path order_allocators: merchant withdraw after completion, customer refund after cancellation.",
|
|
4
|
+
"tags": ["service", "allocation", "retail", "ecommerce", "guard", "order_allocators"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "myshop mainnet deployment 2026-07-29",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "mainnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "myshop_service_v2",
|
|
16
|
+
"type_parameter": "0x2::wow::WOW",
|
|
17
|
+
"permission": "myshop_permission_v2",
|
|
18
|
+
"tags": ["ecommerce", "toys", "store"],
|
|
19
|
+
"onChain": false,
|
|
20
|
+
"replaceExistName": true
|
|
21
|
+
},
|
|
22
|
+
"description": "MyShop - Top quality toys for children",
|
|
23
|
+
"location": "Online Store",
|
|
24
|
+
"machine": "myshop_machine_v2",
|
|
25
|
+
"order_allocators": {
|
|
26
|
+
"description": "Order revenue allocation - merchant withdraw after completion",
|
|
27
|
+
"threshold": 0,
|
|
28
|
+
"allocators": [
|
|
29
|
+
{
|
|
30
|
+
"guard": "myshop_withdraw_guard_v2",
|
|
31
|
+
"sharing": [
|
|
32
|
+
{
|
|
33
|
+
"who": { "Signer": "signer" },
|
|
34
|
+
"sharing": 10000,
|
|
35
|
+
"mode": "Rate"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"guard": "myshop_refund_guard_v2",
|
|
41
|
+
"sharing": [
|
|
42
|
+
{
|
|
43
|
+
"who": { "GuardIdentifier": 0 },
|
|
44
|
+
"sharing": 10000,
|
|
45
|
+
"mode": "Rate"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"sales": {
|
|
52
|
+
"op": "add",
|
|
53
|
+
"sales": [
|
|
54
|
+
{
|
|
55
|
+
"name": "Play Purse Set 35PCS",
|
|
56
|
+
"price": 50000000,
|
|
57
|
+
"stock": 100,
|
|
58
|
+
"suspension": false,
|
|
59
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
60
|
+
"wip_hash": ""
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "Tree House Building Set",
|
|
64
|
+
"price": 30000000,
|
|
65
|
+
"stock": 75,
|
|
66
|
+
"suspension": false,
|
|
67
|
+
"wip": "https://wowok.net/test/three_body.wip",
|
|
68
|
+
"wip_hash": ""
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"um": "myshop_aftersales_contact_v2",
|
|
73
|
+
"publish": true
|
|
74
|
+
},
|
|
75
|
+
"env": {
|
|
76
|
+
"account": "myshop_merchant",
|
|
77
|
+
"network": "mainnet",
|
|
78
|
+
"confirmed": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"notes": [
|
|
82
|
+
"order_allocators is PERMANENTLY IMMUTABLE after publish (service.move:503)",
|
|
83
|
+
"Withdraw allocator uses Signer recipient — safe ONLY because withdraw_guard binds Signer to myshop_merchant",
|
|
84
|
+
"Refund allocator uses GuardIdentifier 0 (Order object address) as escrow — customer claims separately",
|
|
85
|
+
"Rate mode uses 0-10000 scale (10000 = 100%)",
|
|
86
|
+
"Machine, order_allocators, and arbitrations become immutable after publish"
|
|
87
|
+
]
|
|
88
|
+
}
|