@wowok/skills 1.2.4 → 1.2.6
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/README.md +34 -16
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/skills.d.ts +32 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +63 -0
- package/dist/skills.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/examples/Insurance/Insurance.md +543 -475
- package/examples/MyShop/MyShop.md +865 -746
- package/examples/MyShop_Advanced/MyShop_Advanced.md +1520 -1376
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +891 -651
- package/examples/Travel/Travel.md +952 -848
- package/package.json +2 -2
- package/scripts/install.js +3 -17
- package/wowok-arbitrator/SKILL.md +18 -57
- package/wowok-auditor/SKILL.md +16 -12
- package/wowok-distill/SKILL.md +237 -0
- package/wowok-guard/SKILL.md +40 -354
- package/wowok-machine/SKILL.md +21 -127
- package/wowok-messenger/SKILL.md +14 -59
- package/wowok-onboard/SKILL.md +42 -12
- package/wowok-order/SKILL.md +20 -169
- package/wowok-output/SKILL.md +0 -10
- package/wowok-planner/SKILL.md +29 -9
- package/wowok-provider/SKILL.md +72 -32
- package/wowok-safety/SKILL.md +8 -80
- package/wowok-scenario/SKILL.md +70 -102
- package/wowok-tools/SKILL.md +68 -107
- package/references/glossary.ts +0 -297
- package/references/guard-scenario-ledger.md +0 -353
- package/references/guard-template-library.md +0 -481
- package/references/machine-design-reference.md +0 -398
- package/references/machine-scenario-ledger.md +0 -227
- package/references/machine-template-library.md +0 -522
- package/references/merchant-scenario-coordination.md +0 -383
- package/references/object-collaboration.md +0 -362
- package/references/onchain-constants.md +0 -81
- package/wowok-arbitrator/APPENDIX.md +0 -545
- package/wowok-auditor/APPENDIX.md +0 -487
- package/wowok-guard/APPENDIX.md +0 -430
- package/wowok-machine/APPENDIX.md +0 -407
- package/wowok-messenger/APPENDIX.md +0 -550
- package/wowok-onboard/APPENDIX.md +0 -502
- package/wowok-order/APPENDIX.md +0 -777
- package/wowok-output/APPENDIX.md +0 -575
- package/wowok-planner/APPENDIX.md +0 -726
- package/wowok-provider/APPENDIX.md +0 -455
- package/wowok-safety/APPENDIX.md +0 -565
- package/wowok-scenario/APPENDIX.md +0 -97
- package/wowok-scenario/MODE-DETAILS.md +0 -275
- package/wowok-tools/APPENDIX.md +0 -394
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
# Mode Details — Freelance & Rental (Phase 1 Priority)
|
|
2
|
-
|
|
3
|
-
> This file contains the full detail for Phase 1 priority industry modes.
|
|
4
|
-
> Loaded on-demand when a user selects freelance or rental mode.
|
|
5
|
-
> Main skill: [SKILL.md](./SKILL.md)
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Freelance Mode (Phase 1 Priority)
|
|
10
|
-
|
|
11
|
-
### Industry Traits
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
const freelanceTraits: IndustryTraits = {
|
|
15
|
-
has_logistics: false,
|
|
16
|
-
communication_heavy: true,
|
|
17
|
-
pure_digital: true,
|
|
18
|
-
long_cycle: false,
|
|
19
|
-
deposit_required: false,
|
|
20
|
-
multi_tier_allocation: false,
|
|
21
|
-
};
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Applicable Scenarios
|
|
25
|
-
|
|
26
|
-
- Designer taking logo / UI / poster commissions
|
|
27
|
-
- Developer taking outsourced projects
|
|
28
|
-
- Consultant charging by hour or milestone
|
|
29
|
-
- Writer / translator / voice-over artist
|
|
30
|
-
|
|
31
|
-
### Default Permission Indexes
|
|
32
|
-
|
|
33
|
-
| Role | permissionIndex | Scope |
|
|
34
|
-
|------|-----------------|-------|
|
|
35
|
-
| Service Provider | 1000 | Create / advance / allocate / arbitration (user-defined, ≥1000) |
|
|
36
|
-
| Arbiter | 1500 | Arbitration operations only (user-defined, ≥1000) |
|
|
37
|
-
| Customer | n/a | Operates via `namedOperator: ""` on Forwards (order owner/agents) — no permissionIndex needed |
|
|
38
|
-
|
|
39
|
-
> **Note**: Indexes < 1000 are reserved for `BuiltinPermissionIndex` (e.g., 100 = `REPOSITORY_NEW`, 500 = unassigned). Customer actions use `namedOperator: ""` per wowok-machine §Forward Permission Model, not a permissionIndex.
|
|
40
|
-
|
|
41
|
-
### Default Machine Template
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
ordered → in_progress → delivered → accepted → completed
|
|
45
|
-
│
|
|
46
|
-
└→ disputed → refunded (terminal)
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
| Node | prev_node | threshold | Forwards |
|
|
50
|
-
|------|-----------|-----------|----------|
|
|
51
|
-
| `ordered` | `""` (entry) | 1 | `place_order` (weight 1, namedOperator: `""`, customer) |
|
|
52
|
-
| `in_progress` | `ordered` | 1 | `accept_order` (weight 1, permissionIndex 1000, provider) |
|
|
53
|
-
| `delivered` | `in_progress` | 1 | `submit_deliverable` (weight 1, permissionIndex 1000, provider, guard: `deliver_guard`) |
|
|
54
|
-
| `accepted` | `delivered` | 1 | `confirm_acceptance` (weight 1, namedOperator: `""`, customer, guard: `accept_guard`) |
|
|
55
|
-
| `completed` | `accepted` | 1 | `finalize` (weight 1, permissionIndex 1000, provider) |
|
|
56
|
-
| `disputed` | `delivered` | 1 | `open_dispute` (weight 1, namedOperator: `""`, customer) |
|
|
57
|
-
| `refunded` | `disputed` | 1 | `arbiter_rule_refund` (weight 1, permissionIndex 1500, arbiter) |
|
|
58
|
-
|
|
59
|
-
> `buy_guard` binds to `Service.buy_guard` (not a Machine Forward) — gates order placement at the Service level.
|
|
60
|
-
|
|
61
|
-
### Default Guard Templates
|
|
62
|
-
|
|
63
|
-
| Guard Name | Host / Trigger | Validation Logic |
|
|
64
|
-
|-----------|----------------|-------------------|
|
|
65
|
-
| `buy_guard` | Service.buy_guard (order placement) | Verify customer KYC (Personal.mark present) + amount ≤ cap |
|
|
66
|
-
| `deliver_guard` | Machine Forward `submit_deliverable` | Verify WIP hash matches submitted deliverable |
|
|
67
|
-
| `accept_guard` | Machine Forward `confirm_acceptance` | Customer signature OR timeout auto-accept (forward with threshold met by timeout) |
|
|
68
|
-
| `withdraw_guard` | Allocator trigger (fires at `completed` terminal) | Progress.current = `completed` (verify acceptance path completed before releasing funds) |
|
|
69
|
-
| `refund_guard` | Allocator trigger (fires at `refunded` terminal) | Progress.current = `refunded` (verify arbiter ruling or provider default confirmed) |
|
|
70
|
-
|
|
71
|
-
### Default Allocator Strategy
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
// Wrapped in AllocatorsSchema: { description, threshold, allocators: [...] }
|
|
75
|
-
const freelanceAllocators = [
|
|
76
|
-
{
|
|
77
|
-
guard: "withdraw_guard", // Allocator trigger guard (fires at completed terminal)
|
|
78
|
-
sharing: [
|
|
79
|
-
{ who: { Entity: { name_or_address: "<service_name>" } }, sharing: 10000, mode: "Rate" }, // 100% to provider
|
|
80
|
-
],
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
guard: "refund_guard", // Allocator trigger guard (fires at refunded terminal)
|
|
84
|
-
sharing: [
|
|
85
|
-
{ who: { GuardIdentifier: 0 }, sharing: 10000, mode: "Rate" }, // 100% to Order (customer withdraws)
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
// Platform: 0% in Phase 1 (zero take-rate to lower barrier)
|
|
89
|
-
];
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### 10-Round Build Script (Freelance)
|
|
93
|
-
|
|
94
|
-
| Round | Goal | MCP Operation | Mode Default Applied |
|
|
95
|
-
|-------|------|---------------|----------------------|
|
|
96
|
-
| R1 | Account setup | `account_operation.gen` + `faucet` | — |
|
|
97
|
-
| R2 | Industry confirm | (internal trait match) | freelance mode loaded |
|
|
98
|
-
| R3 | Service definition | `onchain_operations.service` CREATE | name="Freelance Service", type_parameter=`0x2::wow::WOW` |
|
|
99
|
-
| R4 | Permission | `onchain_operations.permission` CREATE or REUSE | indexes 1000/1500 (customer uses namedOperator: "") |
|
|
100
|
-
| R5 | Machine | `onchain_operations.machine` CREATE | 7-node template above, publish=false |
|
|
101
|
-
| R6 | Progress binding | `onchain_operations.progress` CREATE + `machine` MODIFY | mirror all nodes |
|
|
102
|
-
| R7 | Guards | `onchain_operations.guard` CREATE × 5 + `gen_passport` test | 5 Guard templates above |
|
|
103
|
-
| R8 | Allocation | `onchain_operations.allocation` CREATE × 2 + `service.order_allocators` MODIFY | 100% provider + 100% refund path |
|
|
104
|
-
| R9 | Test order | `order` CREATE + `progress` advance + `allocation.alloc_by_guard` | full flow dry run |
|
|
105
|
-
| R10 | Publish | `machine` publish + `service` publish | pre-publish audit must PASS |
|
|
106
|
-
|
|
107
|
-
### Audit Checklist (Freelance-Specific)
|
|
108
|
-
|
|
109
|
-
| # | Check | Blocker? |
|
|
110
|
-
|---|-------|----------|
|
|
111
|
-
| 1 | `accept_guard` exists and tests PASS | YES (no acceptance = funds stuck) |
|
|
112
|
-
| 2 | `refund_guard` exists and `customer_refund` Allocator covers 100% | YES (no refund = dispute deadlock) |
|
|
113
|
-
| 3 | `deliver_guard` validates WIP hash | Warning (recommended) |
|
|
114
|
-
| 4 | Machine has terminal nodes for both `completed` and `refunded` paths | YES (dead-end = stuck funds) |
|
|
115
|
-
| 5 | All Forwards reference valid permissionIndex (≥1000) OR `namedOperator` in R4 Permission | YES |
|
|
116
|
-
| 6 | `withdraw_guard` only triggers when `Progress.current = completed` | YES (prevents premature payout) |
|
|
117
|
-
| 7 | Service `description` includes deliverable scope (for arbitration evidence) | Warning |
|
|
118
|
-
|
|
119
|
-
### Failure Playbooks (Freelance-Specific)
|
|
120
|
-
|
|
121
|
-
**P1: Customer never accepts delivery**
|
|
122
|
-
- Mitigation: `accept_guard` includes timeout auto-accept forward (threshold met by `namedOperator: ""` after N days).
|
|
123
|
-
- Recovery: call `progress.hold: false` on the timeout forward to auto-advance.
|
|
124
|
-
|
|
125
|
-
**P2: Provider submits wrong deliverable hash**
|
|
126
|
-
- Mitigation: `deliver_guard` enforces WIP hash match.
|
|
127
|
-
- Recovery: provider re-generates WIP via `wip_file.generate`, re-submits via `progress.hold: false` with corrected hash.
|
|
128
|
-
|
|
129
|
-
**P3: Dispute opens but no arbiter assigned**
|
|
130
|
-
- Mitigation: R4 Permission must include `permissionIndex: 1500` for arbiter role; R8 must bind an existing Arbitration Service.
|
|
131
|
-
- Recovery: bind Arbitration via `service.arbitrations.list` MODIFY before publish.
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## Rental Mode (Phase 1 Priority)
|
|
136
|
-
|
|
137
|
-
### Industry Traits
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
const rentalTraits: IndustryTraits = {
|
|
141
|
-
has_logistics: true,
|
|
142
|
-
communication_heavy: false,
|
|
143
|
-
pure_digital: false,
|
|
144
|
-
long_cycle: false,
|
|
145
|
-
deposit_required: true,
|
|
146
|
-
multi_tier_allocation: false,
|
|
147
|
-
};
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Applicable Scenarios
|
|
151
|
-
|
|
152
|
-
- Photography equipment rental
|
|
153
|
-
- Vehicle rental
|
|
154
|
-
- Property short-let
|
|
155
|
-
- Power tools / luxury goods rental
|
|
156
|
-
|
|
157
|
-
### Default Permission Indexes
|
|
158
|
-
|
|
159
|
-
| Role | permissionIndex | Scope |
|
|
160
|
-
|------|-----------------|-------|
|
|
161
|
-
| Owner | 1000 | Publish / inspect / deduct deposit / refund (user-defined, ≥1000) |
|
|
162
|
-
| Arbiter | 1500 | Damage dispute resolution (user-defined, ≥1000) |
|
|
163
|
-
| Renter | n/a | Operates via `namedOperator: ""` on Forwards (order owner/agents) — no permissionIndex needed |
|
|
164
|
-
|
|
165
|
-
> **Note**: Indexes < 1000 are reserved for `BuiltinPermissionIndex` (e.g., 100 = `REPOSITORY_NEW`, 500 = unassigned). Renter actions use `namedOperator: ""` per wowok-machine §Forward Permission Model.
|
|
166
|
-
|
|
167
|
-
### Default Machine Template
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
reserved → paid_deposit → in_use → returned → inspected → deposit_refunded → completed
|
|
171
|
-
│
|
|
172
|
-
├→ damage_confirmed → deposit_deducted (terminal)
|
|
173
|
-
└→ arbiter_rule (terminal)
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
| Node | prev_node | threshold | Forwards |
|
|
177
|
-
|------|-----------|-----------|----------|
|
|
178
|
-
| `reserved` | `""` | 1 | `place_reservation` (weight 1, namedOperator: `""`, renter) |
|
|
179
|
-
| `paid_deposit` | `reserved` | 1 | `pay_deposit_and_rent` (weight 1, namedOperator: `""`, renter) |
|
|
180
|
-
| `in_use` | `paid_deposit` | 1 | `pickup` (weight 1, permissionIndex 1000, owner) — gated by `deposit_guard` |
|
|
181
|
-
| `returned` | `in_use` | 1 | `trigger_return` (weight 1, namedOperator: `""`, renter, guard: `return_guard`) OR timeout auto-return |
|
|
182
|
-
| `inspected` | `returned` | 1 | `inspect_item` (weight 1, permissionIndex 1000, owner) — gated by `inspect_guard` |
|
|
183
|
-
| `deposit_refunded` | `inspected` | 1 | `approve_return` (weight 1, permissionIndex 1000, owner) — gated by `refund_guard` |
|
|
184
|
-
| `completed` | `deposit_refunded` | 1 | `finalize` (weight 1, permissionIndex 1000, owner) |
|
|
185
|
-
| `damage_confirmed` | `inspected` | 1 | `claim_damage` (weight 1, permissionIndex 1000, owner) — gated by `damage_guard` |
|
|
186
|
-
| `deposit_deducted` | `damage_confirmed` | 1 | `deduct_deposit` (weight 1, permissionIndex 1000, owner) |
|
|
187
|
-
| `arbiter_rule` | `inspected` | 1 | `escalate_arbiter` (weight 1, namedOperator: `""` AND permissionIndex 1000, either party) |
|
|
188
|
-
|
|
189
|
-
> The `arbiter_rule` terminal has no Service-level Allocator — disputes filed via this path are resolved by the bound Arbitration object's compensation fund mechanism (see Audit Checklist #5).
|
|
190
|
-
|
|
191
|
-
### Default Guard Templates
|
|
192
|
-
|
|
193
|
-
| Guard Name | Host / Trigger | Validation Logic |
|
|
194
|
-
|-----------|----------------|-------------------|
|
|
195
|
-
| `deposit_guard` | Machine Forward `pickup` AND Allocator trigger (fires at `in_use`) | Order.balance ≥ deposit amount (deposit frozen in escrow) |
|
|
196
|
-
| `return_guard` | Machine Forward `trigger_return` | Renter signature OR rental period timeout |
|
|
197
|
-
| `inspect_guard` | Machine Forward `inspect_item` | Owner submission confirming item state (WIP hash of return condition) |
|
|
198
|
-
| `refund_guard` | Machine Forward `approve_return` AND Allocator trigger (fires at `deposit_refunded`) | Inspection passed (Progress history shows `inspect_item` accomplished) |
|
|
199
|
-
| `damage_guard` | Machine Forward `claim_damage` AND Allocator trigger (fires at `damage_confirmed`) | Owner submission + WIP hash diff (pre-rental vs post-rental) |
|
|
200
|
-
|
|
201
|
-
### Default Allocator Strategy
|
|
202
|
-
|
|
203
|
-
```typescript
|
|
204
|
-
// Wrapped in AllocatorsSchema: { description, threshold, allocators: [...] }
|
|
205
|
-
const rentalAllocators = [
|
|
206
|
-
{
|
|
207
|
-
guard: "deposit_guard", // Allocator trigger guard (fires at pickup)
|
|
208
|
-
sharing: [
|
|
209
|
-
{ who: { Entity: { name_or_address: "<service_name>" } }, sharing: 10000, mode: "Rate" }, // 100% rent to owner immediately
|
|
210
|
-
],
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
guard: "refund_guard", // Allocator trigger guard (fires on inspection pass)
|
|
214
|
-
sharing: [
|
|
215
|
-
{ who: { GuardIdentifier: 0 }, sharing: 10000, mode: "Rate" }, // 100% deposit back to renter (Order)
|
|
216
|
-
],
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
guard: "damage_guard", // Allocator trigger guard (fires on damage claim)
|
|
220
|
-
sharing: [
|
|
221
|
-
{ who: { Entity: { name_or_address: "<service_name>" } }, sharing: 10000, mode: "Rate" }, // 100% deposit to owner as compensation
|
|
222
|
-
],
|
|
223
|
-
},
|
|
224
|
-
];
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### 10-Round Build Script (Rental)
|
|
228
|
-
|
|
229
|
-
| Round | Goal | MCP Operation | Mode Default Applied |
|
|
230
|
-
|-------|------|---------------|----------------------|
|
|
231
|
-
| R1 | Account setup | `account_operation.gen` + `faucet` | — |
|
|
232
|
-
| R2 | Industry confirm | (internal trait match) | rental mode loaded |
|
|
233
|
-
| R3 | Service definition | `onchain_operations.service` CREATE | name includes item + deposit terms in description |
|
|
234
|
-
| R4 | Permission | `onchain_operations.permission` CREATE or REUSE | indexes 1000/1500 (renter uses namedOperator: "") |
|
|
235
|
-
| R5 | Machine | `onchain_operations.machine` CREATE | 10-node template above |
|
|
236
|
-
| R6 | Progress binding | `onchain_operations.progress` CREATE | mirror all nodes |
|
|
237
|
-
| R7 | Guards | `onchain_operations.guard` CREATE × 5 + `gen_passport` test | 5 Guard templates above |
|
|
238
|
-
| R8 | Allocation | `onchain_operations.allocation` CREATE × 3 + `service.order_allocators` MODIFY | rent + refund + deduct paths |
|
|
239
|
-
| R9 | Test order | `order` CREATE + `progress` advance × 10 + `allocation.alloc_by_guard` × 3 | full flow dry run including damage path |
|
|
240
|
-
| R10 | Publish | `machine` publish + `service` publish | pre-publish audit must PASS, deposit path verified |
|
|
241
|
-
|
|
242
|
-
### Audit Checklist (Rental-Specific)
|
|
243
|
-
|
|
244
|
-
| # | Check | Blocker? |
|
|
245
|
-
|---|-------|----------|
|
|
246
|
-
| 1 | `deposit_guard` validates `Order.balance ≥ deposit_amount` | YES (no deposit = renter can run off with item) |
|
|
247
|
-
| 2 | `refund_guard` + `deposit_refund_to_renter` Allocator covers 100% refund | YES (no refund path = deposit theft) |
|
|
248
|
-
| 3 | `damage_guard` requires WIP hash diff (pre vs post rental) | YES (no evidence = arbitrary deduction) |
|
|
249
|
-
| 4 | Machine includes both `deposit_refunded` and `deposit_deducted` terminal paths | YES |
|
|
250
|
-
| 5 | Arbitration bound to Service via `arbitrations.list` | Warning (recommended for damage disputes) |
|
|
251
|
-
| 6 | Rental period timeout forward exists on `in_use` node | Warning (prevents items never returned) |
|
|
252
|
-
| 7 | Deposit amount recorded in Service `description` for evidence | Warning |
|
|
253
|
-
| 8 | Pre-rental WIP generated and hash stored for post-rental comparison | YES (without pre-hash, damage cannot be proven) |
|
|
254
|
-
|
|
255
|
-
### Failure Playbooks (Rental-Specific)
|
|
256
|
-
|
|
257
|
-
**P1: Renter never returns item**
|
|
258
|
-
- Mitigation: `in_use` node has timeout forward to `returned` (auto-return) or directly to `damage_confirmed` (treat as non-return).
|
|
259
|
-
- Recovery: after timeout, owner calls `progress.hold: false` on the timeout forward; `damage_guard` validates non-return; `deposit_deduct_to_owner` Allocator fires.
|
|
260
|
-
|
|
261
|
-
**P2: Owner claims damage but no pre-rental WIP exists**
|
|
262
|
-
- Mitigation: R8 audit checklist #8 blocks publish without pre-rental WIP.
|
|
263
|
-
- Recovery: impossible post-publish — must create new Service with WIP. Surface this as a hard lesson; prevent with audit.
|
|
264
|
-
|
|
265
|
-
**P3: Deposit amount insufficient for damage**
|
|
266
|
-
- Mitigation: Service `description` records deposit amount; `deposit_guard` validates balance.
|
|
267
|
-
- Recovery: Arbitration can rule additional payment via `arbiter_rule` node, but only up to deposited amount. For excess, off-chain recovery.
|
|
268
|
-
|
|
269
|
-
**P4: Owner refuses to inspect (blocks refund)**
|
|
270
|
-
- Mitigation: `returned` node has timeout forward to `inspected` (auto-inspect pass) if owner doesn't act within N days.
|
|
271
|
-
- Recovery: renter calls timeout forward, `inspect_guard` auto-passes, `refund_guard` fires, deposit returns to renter.
|
|
272
|
-
|
|
273
|
-
**P5: Double-spend dispute (both parties claim deposit)**
|
|
274
|
-
- Mitigation: Machine topology ensures `inspected` has mutually exclusive forwards (`approve_return` vs `claim_damage`), first-Pair-wins rule.
|
|
275
|
-
- Recovery: if contested, `escalate_arbiter` forward routes to Arbitration.
|