@wowok/skills 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +34 -16
  2. package/dist/cli.js +6 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/skills.d.ts +32 -1
  5. package/dist/skills.d.ts.map +1 -1
  6. package/dist/skills.js +63 -0
  7. package/dist/skills.js.map +1 -1
  8. package/dist/types.d.ts +8 -0
  9. package/dist/types.d.ts.map +1 -1
  10. package/examples/Insurance/Insurance.md +543 -475
  11. package/examples/MyShop/MyShop.md +865 -746
  12. package/examples/MyShop_Advanced/MyShop_Advanced.md +1520 -1376
  13. package/examples/ThreeBody_Signature/ThreeBody_Signature.md +891 -651
  14. package/examples/Travel/Travel.md +952 -848
  15. package/package.json +2 -2
  16. package/scripts/install.js +3 -17
  17. package/wowok-arbitrator/SKILL.md +18 -57
  18. package/wowok-auditor/SKILL.md +16 -12
  19. package/wowok-distill/SKILL.md +237 -0
  20. package/wowok-guard/SKILL.md +40 -354
  21. package/wowok-machine/SKILL.md +21 -127
  22. package/wowok-messenger/SKILL.md +14 -59
  23. package/wowok-onboard/SKILL.md +42 -12
  24. package/wowok-order/SKILL.md +20 -169
  25. package/wowok-output/SKILL.md +0 -10
  26. package/wowok-planner/SKILL.md +28 -9
  27. package/wowok-provider/SKILL.md +91 -49
  28. package/wowok-safety/SKILL.md +8 -80
  29. package/wowok-scenario/SKILL.md +63 -98
  30. package/wowok-tools/SKILL.md +111 -122
  31. package/references/glossary.ts +0 -297
  32. package/references/guard-scenario-ledger.md +0 -353
  33. package/references/guard-template-library.md +0 -481
  34. package/references/machine-design-reference.md +0 -398
  35. package/references/machine-scenario-ledger.md +0 -227
  36. package/references/machine-template-library.md +0 -522
  37. package/references/merchant-scenario-coordination.md +0 -383
  38. package/references/object-collaboration.md +0 -362
  39. package/references/onchain-constants.md +0 -81
  40. package/wowok-arbitrator/APPENDIX.md +0 -545
  41. package/wowok-auditor/APPENDIX.md +0 -487
  42. package/wowok-guard/APPENDIX.md +0 -428
  43. package/wowok-machine/APPENDIX.md +0 -407
  44. package/wowok-messenger/APPENDIX.md +0 -550
  45. package/wowok-onboard/APPENDIX.md +0 -500
  46. package/wowok-order/APPENDIX.md +0 -777
  47. package/wowok-output/APPENDIX.md +0 -575
  48. package/wowok-planner/APPENDIX.md +0 -724
  49. package/wowok-provider/APPENDIX.md +0 -453
  50. package/wowok-safety/APPENDIX.md +0 -561
  51. package/wowok-scenario/APPENDIX.md +0 -97
  52. package/wowok-scenario/MODE-DETAILS.md +0 -275
  53. package/wowok-tools/APPENDIX.md +0 -388
@@ -70,20 +70,7 @@ Empty string `""` means the default account. Always use `""` when the user does
70
70
 
71
71
  ### 2.1 Confirmation Template
72
72
 
73
- ```
74
- 📋 **Operation Preview**
75
-
76
- | Field | Value |
77
- |-------|-------|
78
- | Operation | {operation_type} — {op} |
79
- | Object | {object_name} |
80
- | Network | {network} |
81
- | Account | {account} |
82
-
83
- ⚠️ **This will {describe_what_will_happen}**
84
-
85
- Proceed with execution?
86
- ```
73
+ Present a preview table (Operation, Object, Network, Account) with a warning describing what will happen, then ask: "Proceed with execution?"
87
74
 
88
75
  ### 2.2 Amount Verification
89
76
 
@@ -98,26 +85,7 @@ Proceed with execution?
98
85
 
99
86
  ### 2.3 Publish Confirmation
100
87
 
101
- Before publishing a Service or Machine:
102
-
103
- 1. **Export and review**:
104
- - Use `guard2file` to export Guard definitions
105
- - Use `machineNode2file` to export Machine nodes
106
-
107
- 2. **Verify logic**: Confirm Guards and Machine nodes match user intent
108
-
109
- 3. **Warn about immutability**: Once published, many fields become locked
110
-
111
- ```
112
- ⚠️ PUBLISH CONFIRMATION REQUIRED
113
-
114
- You are about to publish:
115
- - {Service|Machine}: {name}
116
- - This will make it publicly accessible on-chain
117
- - After publish: {list what becomes immutable}
118
-
119
- This action cannot be easily undone. Proceed?
120
- ```
88
+ Before publishing a Service or Machine: (1) Export and review — use `guard2file` to export Guard definitions, `machineNode2file` to export Machine nodes; (2) Verify logic — confirm Guards and Machine nodes match user intent; (3) Warn about immutability — once published, many fields become locked. Present a publish confirmation warning listing what becomes immutable, then ask: "This action cannot be easily undone. Proceed?"
121
89
 
122
90
  ---
123
91
 
@@ -209,32 +177,15 @@ Use `Payment` objects for commercial transfers when possible — they offer Guar
209
177
 
210
178
  ## 8. Testing & Validation Workflow
211
179
 
212
- 1. **Design Phase**: Use `wowok_buildin_info` to discover available permissions, Guard instructions, and value types
213
-
214
- **Tool**: `wowok_buildin_info` with `info: "built-in permissions"`, `info: "guard instructions"`, or `info: "value types"`.
180
+ 1. **Design Phase**: Discover available permissions, Guard instructions, and value types via `wowok_buildin_info` (`info: "built-in permissions"` / `"guard instructions"` / `"value types"`).
181
+ 2. **Export & Review**: Before publishing, use `guard2file` and `machineNode2file` to export and review definitions.
182
+ 3. **Incremental Testing**: Build objects step-by-step, verifying each step.
183
+ 4. **Final Validation**: Test all Guard conditions and Machine transitions before publishing.
184
+ 5. **Publish**: Only after thorough testing, publish Service and Machine.
215
185
 
216
186
  ### 8.1 Value Types — Built-in Type Annotation System
217
187
 
218
- WoWok's value type system is the foundation for type-safe data declarations used across Guards, records, and query instructions. Every data field in a Guard table or Guard submission carries a `value_type` annotation, ensuring the protocol can validate and process data correctly.
219
-
220
- **When value types matter:**
221
- - Defining Guard table columns: each Identifier in a Guard's `table` block requires a `value_type`
222
- - Submitting data to Guards: `GuardSubmission` entries must match their declared `value_type`
223
- - Reading Guard exports: `guard2file` output shows `value_type` for every Identifier
224
- - Designing query instructions: both parameters and return values carry `value_type` annotations
225
-
226
- - **String format is recommended** (e.g., `"U64"`, `"Address"`, `"VecString"`) for readability in Guard tables and submissions.
227
- - Numeric codes (0–18) are accepted but obscure — prefer string names in all user-facing contexts.
228
- - `Value` (19) is a protocol-internal type for dynamic value handling. It must **never** be used directly in user-defined Guards or submissions.
229
- **Available value types** (queried via `wowok_buildin_info` with `info: "value types"`)
230
-
231
- 2. **Export & Review**: Before publishing, use `guard2file` and `machineNode2file` to export and review definitions
232
-
233
- 3. **Incremental Testing**: Build objects step-by-step, verifying each step
234
-
235
- 4. **Final Validation**: Test all Guard conditions and Machine transitions before publishing
236
-
237
- 5. **Publish**: Only after thorough testing, publish Service and Machine
188
+ Every data field in a Guard table or submission carries a `value_type` annotation. Value types matter when: defining Guard table columns, submitting data to Guards, reading `guard2file` exports, and designing query instructions. **String format is recommended** (`"U64"`, `"Address"`, `"VecString"`) for readability; numeric codes (0–18) are accepted but obscure. `Value` (19) is protocol-internal never use in user-defined Guards. Available types are queried via `wowok_buildin_info` with `info: "value types"`.
238
189
 
239
190
  ---
240
191
 
@@ -251,29 +202,6 @@ For complex objects with many fields (Service, Machine), use **incremental build
251
202
 
252
203
  ## Schema Reference
253
204
 
254
- | Purpose | Schema Name |
255
- |---------|-------------|
256
- | Query toolkit | `query_toolkit` |
257
- | Token list | `query_toolkit` with `query_type: "token_list"` |
258
- | Guard export | `guard2file` |
259
- | Machine export | `machineNode2file` |
260
- | Build-in info | `wowok_buildin_info` |
261
- | Built-in permissions | `wowok_buildin_info` with `info: "built-in permissions"` |
262
- | Guard instructions | `wowok_buildin_info` with `info: "guard instructions"` |
263
- | Value types | `wowok_buildin_info` with `info: "value types"` |
264
-
265
- **Query Schema**: `schema_query({ action: "get", name: "<schema_name>" })`
266
-
267
205
  **Related Skills**: [wowok-tools](../wowok-tools/SKILL.md) | [wowok-guard](../wowok-guard/SKILL.md) | [wowok-machine](../wowok-machine/SKILL.md) | [wowok-order](../wowok-order/SKILL.md) | [wowok-provider](../wowok-provider/SKILL.md) | [wowok-arbitrator](../wowok-arbitrator/SKILL.md) | [wowok-messenger](../wowok-messenger/SKILL.md)
268
206
 
269
207
  ---
270
-
271
- ## Appendices (Progressive Disclosure)
272
-
273
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
274
- > - Dialogue Scripts (R1-R10) — guided conversation scripts
275
- > - Decision Trees — branching logic reference
276
- > - Failure Playbooks — recovery scenarios
277
- > - Tier Layering — expertise-tier based guidance
278
- >
279
- > Load APPENDIX.md when the user needs guided dialogue, recovery help, or tier-specific guidance.
@@ -31,15 +31,29 @@ when_to_use:
31
31
 
32
32
  A **driving mode** is a curated bundle of: industry traits, default Permission indexes, default Machine node graph, default Guard templates, default Allocator strategy, a 10-round build script, an audit checklist, and a failure playbook. Modes are **presets, not constraints** — every underlying MCP operation remains available. Users can override any default or switch to `general` (free) mode at any time.
33
33
 
34
- > **Authoritative cross-reference**: This skill's mode definitions are aligned with the following internal references:
35
- > - [Guard Template Library](../references/guard-template-library.md) — Guard templates referenced by mode `Guards` column
36
- > - [Machine Template Library](../references/machine-template-library.md) Machine shapes referenced by mode `Machine Shape` column
37
- > - [Machine Scenario Ledger](../references/machine-scenario-ledger.md) — 10 business scenarios per mode
38
- > - [Guard Scenario Ledger](../references/guard-scenario-ledger.md) Guard usage scenarios per mode
39
- > - [Merchant Scenario Coordination §5](../references/merchant-scenario-coordination.md) — 6 industry modes × merchant perspective
40
- > - [On-chain Constants](../references/onchain-constants.md) Permission index ranges and capacity limits
41
- >
42
- > When a mode's defaults disagree with these references, the **design references** in this directory are authoritative (P15 decision: bidirectional cross-reference, with design references as single source of truth for object semantics).
34
+ ### On-Chain Capacity Limits (Inline Reference)
35
+
36
+ Mode defaults respect these on-chain constants. When a mode's suggested count exceeds a limit, the SDK will reject the operation.
37
+
38
+ | Constant | Value | Scope |
39
+ |----------|-------|-------|
40
+ | `MAX_NODE_COUNT_SDK` | 100 | Max nodes per Machine (SDK limit; on-chain allows 200) |
41
+ | `MAX_FORWARD_COUNT` | 20 | Max global forwards per Machine |
42
+ | `MAX_FORWARD_ORDER_COUNT` | 20 | Max forwards per node pair |
43
+ | `MAX_NODE_PAIR_COUNT` | 40 | Max pairs per node |
44
+ | `USER_DEFINED_PERM_INDEX_START` | 1000 | Custom permission_index start (0-999 reserved for built-in) |
45
+ | `MAX_PERM_FOR_ENTITY` | 1000 | Max permissions per Entity |
46
+ | `MAX_ADMIN_COUNT` | 500 | Max admins per Permission object |
47
+ | `MAX_AGENT_COUNT` | 10 | Max agents per Order |
48
+ | `MAX_DISPUTE_COUNT` | 10 | Max concurrent disputes per Order |
49
+ | `MAX_SHARING_COUNT` | 100 | Max sharing entries per allocator |
50
+ | `MAX_VOTING_GUARD_COUNT` | 50 | Max voting guards per Arbitration |
51
+ | `MAX_POLICY_COUNT` | 50 | Max policies per Repository |
52
+ | `MAX_ID_COUNT_ONCE` | 100 | Max IDs per Repository operation |
53
+ | `MAX_REWARD_COUNT` | 20 | Max rewards per Demand/Repository |
54
+ | `MAX_CONTEXT_REPOSITORY_COUNT` | 30 | Max context repositories per Progress |
55
+ | `MAX_NAMED_OPERATOR_COUNT` | 60 | Max named operators per Forward |
56
+ | `MAX_NAMED_OPERATOR_ADDRESS_COUNT` | 80 | Max addresses per named operator |
43
57
 
44
58
  ### What Driving Modes Solve
45
59
 
@@ -64,16 +78,7 @@ The selection algorithm maps the user's business description to industry traits,
64
78
 
65
79
  ### Trait Extraction
66
80
 
67
- ```typescript
68
- type IndustryTraits = {
69
- has_logistics: boolean; // physical goods to ship?
70
- communication_heavy: boolean; // lots of back-and-forth before delivery?
71
- pure_digital: boolean; // deliverable is a file / digital artifact?
72
- long_cycle: boolean; // multi-week or multi-month engagement?
73
- deposit_required: boolean; // collect refundable deposit?
74
- multi_tier_allocation: boolean; // pay multiple parties per segment?
75
- };
76
- ```
81
+ Industry traits used for mode selection: `has_logistics` (physical goods to ship?), `communication_heavy` (lots of back-and-forth before delivery?), `pure_digital` (deliverable is a file/digital artifact?), `long_cycle` (multi-week or multi-month engagement?), `deposit_required` (collect refundable deposit?), `multi_tier_allocation` (pay multiple parties per segment?).
77
82
 
78
83
  ### Selection Matrix
79
84
 
@@ -102,13 +107,7 @@ When two modes specify different Permission indexes for the same role, user deci
102
107
 
103
108
  ## Phase 1 Mode Details (Freelance & Rental)
104
109
 
105
- > The full detail for Phase 1 priority modes (Freelance & Rental) including industry traits, Machine templates, Guard templates, Allocator strategies, 10-round build scripts, audit checklists, and failure playbooks has been extracted to [MODE-DETAILS.md](./MODE-DETAILS.md) for on-demand loading.
106
- >
107
- > **Load MODE-DETAILS.md when:**
108
- > - User selects `freelance` or `rental` mode
109
- > - wowok-onboard R3-R8 needs Machine/Guard/Allocator defaults
110
- > - User asks "what does the freelance/rental mode include?"
111
- > - Pre-publish audit needs mode-specific checklist
110
+ > **Mode defaults** (traits, machine_shape, guards, allocator, key_risk, build_notes) are provided by MCP `project_operation` action `analyze_intent` pass `industry` parameter and the MCP auto-fills scenario defaults from `knowledge/scenario-modes.ts`. The AI does NOT need to look up per-industry presets manually.
112
111
 
113
112
  ### Quick Reference (mode summaries)
114
113
 
@@ -117,22 +116,41 @@ When two modes specify different Permission indexes for the same role, user deci
117
116
  | `freelance` | 7 nodes (ordered→...→completed/refunded) | 5 (buy/deliver/accept/withdraw/refund) | 2 (100% provider / 100% refund) | Customer never accepts delivery |
118
117
  | `rental` | 10 nodes (reserved→...→deposit_refunded/deducted) | 5 (deposit/return/inspect/refund/damage) | 3 (rent / refund / deduct) | Owner claims damage without pre-rental WIP |
119
118
 
119
+ ### Freelance Audit Checklist (pre-publish BLOCKERS)
120
+
121
+ - `accept_guard` exists + `gen_passport` tested — BLOCKER (no acceptance = funds stuck)
122
+ - `refund_guard` + 100% refund Allocator — BLOCKER (no refund = dispute deadlock)
123
+ - Machine has terminal nodes for both `completed` and `refunded` — BLOCKER (dead-end = stuck funds)
124
+ - `withdraw_guard` only triggers at `Progress.current=completed` — BLOCKER (prevents premature payout)
125
+ - `deliver_guard` validates WIP hash — recommended
126
+
127
+ ### Freelance Failure Playbooks
128
+
129
+ - Customer never accepts: `accept_guard` includes timeout auto-accept forward (threshold met by `namedOperator:""` after N days)
130
+ - Wrong deliverable hash: `deliver_guard` enforces WIP match → re-generate WIP, re-submit via `progress.hold:false`
131
+ - No arbiter assigned: Permission must include `permissionIndex:1500`, bind Arbitration via `service.arbitrations.list` before publish
132
+
133
+ ### Rental Audit Checklist (pre-publish BLOCKERS)
134
+
135
+ - `deposit_guard` validates `Order.balance ≥ deposit_amount` — BLOCKER (renter runs off with item)
136
+ - `refund_guard` + 100% refund Allocator — BLOCKER (no refund = deposit theft)
137
+ - `damage_guard` requires pre+post WIP hash diff — BLOCKER (no evidence = arbitrary deduction)
138
+ - Machine has both `deposit_refunded` and `deposit_deducted` terminals — BLOCKER
139
+ - Pre-rental WIP generated + hash stored — BLOCKER (can't prove damage without pre-hash)
140
+ - Rental period timeout forward on `in_use` node — recommended
141
+
142
+ ### Rental Failure Playbooks
143
+
144
+ - Renter never returns: timeout forward to `damage_confirmed`, `deposit_deduct` Allocator fires
145
+ - No pre-rental WIP: impossible post-publish — audit checklist blocks this at publish time
146
+ - Owner refuses inspect: timeout forward auto-passes `inspect_guard`, `refund_guard` fires, deposit returns
147
+ - Double-spend dispute: Machine topology ensures mutually exclusive forwards (first-Pair-wins), `escalate_arbiter` routes to Arbitration
148
+
120
149
  ---
121
150
 
122
151
  ## Education Mode (Phase 2 — Outline)
123
152
 
124
- ### Industry Traits
125
-
126
- ```typescript
127
- const educationTraits: IndustryTraits = {
128
- has_logistics: false,
129
- communication_heavy: true,
130
- pure_digital: false,
131
- long_cycle: true,
132
- deposit_required: true, // tuition pre-pay
133
- multi_tier_allocation: false,
134
- };
135
- ```
153
+ **Traits**: communication_heavy, long_cycle, deposit_required (tuition pre-pay), not pure_digital.
136
154
 
137
155
  ### Mode Outline
138
156
 
@@ -142,29 +160,11 @@ const educationTraits: IndustryTraits = {
142
160
  - **Key trait**: `setting_locked_time` on Service prevents institution from changing rules mid-semester (regulatory compliance)
143
161
  - **GTM angle**: targets "tutoring institutions run away with prepaid tuition" pain point; policy-driven adoption
144
162
 
145
- ### Phase 2 Build Status
146
-
147
- - Machine template: drafted, needs 1 pilot institution test
148
- - Guards: `attendance_guard` needs WIP hash for session content commitment
149
- - Allocator: per-session release needs threshold-based trigger
150
- - Audit checklist: pending real-world pilot
151
-
152
163
  ---
153
164
 
154
165
  ## Travel Mode (Phase 2 — Outline)
155
166
 
156
- ### Industry Traits
157
-
158
- ```typescript
159
- const travelTraits: IndustryTraits = {
160
- has_logistics: false,
161
- communication_heavy: true,
162
- pure_digital: false,
163
- long_cycle: true,
164
- deposit_required: true, // deposit + final payment
165
- multi_tier_allocation: true, // agency → hotel → guide → driver
166
- };
167
- ```
167
+ **Traits**: communication_heavy, long_cycle, deposit_required (deposit + final payment), multi_tier_allocation (agency → hotel → guide → driver).
168
168
 
169
169
  ### Mode Outline
170
170
 
@@ -174,29 +174,11 @@ const travelTraits: IndustryTraits = {
174
174
  - **Key trait**: multi-tier Allocation is WoWok's unique advantage over traditional travel platforms
175
175
  - **GTM angle**: targets "paid in full then service shrinks" pain point
176
176
 
177
- ### Phase 2 Build Status
178
-
179
- - Machine template: drafted, needs multi-tier Allocation pilot
180
- - Guards: `segment_guard` needs standardized WIP templates per segment type (hotel, transport, activity)
181
- - Allocator: multi-tier waterfall needs guard chaining validation
182
- - Audit checklist: pending real-world pilot
183
-
184
177
  ---
185
178
 
186
179
  ## Subscription Mode (Phase 3 — Outline)
187
180
 
188
- ### Industry Traits
189
-
190
- ```typescript
191
- const subscriptionTraits: IndustryTraits = {
192
- has_logistics: false,
193
- communication_heavy: false,
194
- pure_digital: true,
195
- long_cycle: true,
196
- deposit_required: false,
197
- multi_tier_allocation: false,
198
- };
199
- ```
181
+ **Traits**: pure_digital, long_cycle, not deposit_required, not communication_heavy.
200
182
 
201
183
  ### Mode Outline
202
184
 
@@ -206,13 +188,6 @@ const subscriptionTraits: IndustryTraits = {
206
188
  - **Key trait**: pure digital, native WoWok soil; directly attacks "auto-renew trap" and "platform takes 30%" pain points
207
189
  - **GTM angle**: independent creators (Indie Hackers, niche SaaS, paid newsletters)
208
190
 
209
- ### Phase 3 Build Status
210
-
211
- - Machine template: planned
212
- - Guards: `charge_guard` needs periodic trigger mechanism (off-chain scheduler + on-chain Guard)
213
- - Allocator: per-period release straightforward
214
- - Audit checklist: pending design review
215
-
216
191
  ---
217
192
 
218
193
  ## Escape Hatch
@@ -228,14 +203,7 @@ Any user can switch from a driving mode to `general` (free) mode at any time. Th
228
203
 
229
204
  ### How to Switch
230
205
 
231
- ```
232
- User says: "switch to general mode" or "configure manually"
233
- ├── Stop applying mode defaults to remaining rounds
234
- ├── Surface the IndustryModeSchema shape as a blank template
235
- ├── User provides: Permission indexes, Machine nodes, Guards, Allocators manually
236
- ├── wowok-onboard R3-R8 still execute, but with empty defaults
237
- └── wowok-machine / wowok-guard / wowok-provider become primary references
238
- ```
206
+ When user says "switch to general mode" or "configure manually": stop applying mode defaults to remaining rounds, surface the `IndustryModeSchema` shape as a blank template, let user provide Permission indexes/Machine nodes/Guards/Allocators manually. wowok-onboard R3-R8 still execute with empty defaults; wowok-machine / wowok-guard / wowok-provider become primary references.
239
207
 
240
208
  ### Warning
241
209
 
@@ -252,11 +220,8 @@ User can switch back to a driving mode after using general mode:
252
220
 
253
221
  ---
254
222
 
255
- ## Appendices (Progressive Disclosure)
223
+ ## Tier Layering
256
224
 
257
- > The following sections have been extracted to [APPENDIX.md](./APPENDIX.md) for on-demand loading:
258
- > - Tier Layeringexpertise-tier based guidance
259
- > - IndustryModeSchemaschema reference
260
- > - Quick Reference — lookup table
261
- >
262
- > Load APPENDIX.md when the user needs tier-specific guidance, schema reference, or quick lookup.
225
+ - **Novice**: Full driving mode mode defaults fill all rounds, user only confirms
226
+ - **Advanced**: Customize defaults user overrides specific fields (e.g., Allocator split), audit checklist still runs
227
+ - **Expert**: General mode no defaults, raw MCP operations, wowok-machine/guard/provider become primary references