@wowok/skills 1.3.3 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wowok/skills",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "WoWok AI Skills for Claude and other AI assistants - Helping AI use WoWok MCP tools correctly",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -166,6 +166,59 @@ Controls name collision behavior. **DISCOURAGED** — prefer versioned names (`_
166
166
 
167
167
  Use `Payment` objects for commercial transfers when possible — they offer Guard validation and purpose tracking beyond a simple `account_operation (transfer)`.
168
168
 
169
+ ### 5.3 Cross-Network Switching (testnet → mainnet)
170
+
171
+ WoWok objects are network-specific — the same object name resolves to different addresses on testnet vs mainnet. The `local_mark` system manages this mapping automatically.
172
+
173
+ **Prerequisites**:
174
+ - testnet deployment verified (all objects created, order lifecycle tested)
175
+ - Record all object names (query `local_mark_list` for the full list)
176
+ - mainnet account has sufficient WOW balance (faucet is testnet-only; use `account_operation transfer` from a funded mainnet account)
177
+
178
+ **Switching Steps**:
179
+ 1. Change `env.network` from `"testnet"` to `"mainnet"` in all MCP calls
180
+ 2. Re-create all objects on mainnet with `replaceExistName: true` (names stay the same, addresses change)
181
+ 3. Order matters — follow the dependency chain: Permission → Machine → Guards → Contact → Service → (Order/Progress/Allocation are created at purchase time)
182
+ 4. Verify each object creation succeeds and `local_mark` is updated
183
+ 5. Test the critical path: place a test order → advance Progress → verify Allocation
184
+
185
+ **Key Mechanism**:
186
+ ```
187
+ testnet: local_mark["my_service"] = 0x867a... (testnet address)
188
+ mainnet: local_mark["my_service"] = 0xdef0... (mainnet address, auto-overwritten)
189
+ ```
190
+ - All object references in Guard tables, Service bindings, and Machine forwards use NAMES (not addresses)
191
+ - SDK's `GetObjectExisted()` resolves names to the current network's address at transaction build time
192
+ - `replaceExistName: true` ensures the name mapping is overwritten for the new network
193
+
194
+ **Important Notes**:
195
+ - testnet objects remain on testnet (they don't disappear) — mainnet is a completely fresh deployment
196
+ - Guard tables that reference other objects by NAME will auto-resolve to mainnet addresses
197
+ - Service.order_allocators and Machine nodes are immutable after publish — verify design before mainnet publish
198
+ - mainnet has no faucet — fund accounts via `account_operation` with `transfer` from an existing funded account
199
+
200
+ ### 5.4 Publish Pre-Check Checklist
201
+
202
+ Before calling `publish: true` on a Service or Machine, verify:
203
+
204
+ **Service Publish Checklist**:
205
+ - [ ] `order_allocators` is set and design is verified (PERMANENTLY immutable after publish)
206
+ - [ ] `machine` is bound and already published
207
+ - [ ] `buy_guard` is bound (if purchase validation is needed)
208
+ - [ ] `permission` is bound with all required indexes granted
209
+ - [ ] If `compensation_fund > 0`: `arbitrations` MUST be bound (contract enforces: `E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND`)
210
+ - [ ] All Guard names in `order_allocators` resolve correctly
211
+ - [ ] All sharing amounts and recipient types (Entity/Signer/GuardIdentifier) are intended
212
+ - [ ] Use `dry_run: true` first to simulate the publish transaction
213
+
214
+ **Machine Publish Checklist**:
215
+ - [ ] All nodes have at least one forward (except terminal nodes)
216
+ - [ ] Each forward has `namedOperator` or `permissionIndex` (or both = OR semantic)
217
+ - [ ] `namedOperator: ""` means OrderHolder (customer), NOT "anyone"
218
+ - [ ] All `permissionIndex` values are granted in the bound Permission object
219
+ - [ ] Entry node has `prev_node: ""` and `threshold: 0`
220
+ - [ ] Terminal nodes have empty `pairs: []`
221
+
169
222
  ---
170
223
 
171
224
  ## 6. Query-First Pattern