@wowok/skills 1.1.1 → 1.1.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/package.json +2 -5
- package/wowok-arbitrator/SKILL.md +192 -192
- package/wowok-guard/SKILL.md +189 -285
- package/wowok-machine/SKILL.md +167 -328
- package/wowok-order/SKILL.md +66 -6
- package/wowok-provider/SKILL.md +3 -1
- package/wowok-safety/SKILL.md +20 -2
- package/wowok-tools/SKILL.md +141 -536
package/wowok-order/SKILL.md
CHANGED
|
@@ -184,19 +184,79 @@ Once consensus is reached, create the order through Service operation.
|
|
|
184
184
|
|
|
185
185
|
When creating an order via the `buy` operation, you can apply a discount coupon by including the `discount` field with the coupon name/ID.
|
|
186
186
|
|
|
187
|
+
**Finding Available Discounts**:
|
|
188
|
+
|
|
189
|
+
Discount coupons are separate objects that you receive (usually transferred from Service marketing campaigns or other users). To find discounts applicable to the current Service:
|
|
190
|
+
|
|
191
|
+
**Step 1: Query all Discount objects you own**
|
|
192
|
+
|
|
193
|
+
Use `query_toolkit` with `onchain_received` query type to get all Discount objects:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"query_type": "onchain_received",
|
|
198
|
+
"name_or_address": "your_account_name",
|
|
199
|
+
"type": "0x2::service::Discount", // Discount type on-chain
|
|
200
|
+
"cursor": null,
|
|
201
|
+
"limit": 50
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
This returns `ReceivedNormal[]` where each item's `content_raw` contains Discount fields:
|
|
206
|
+
- `name`: Discount name
|
|
207
|
+
- `discount_type`: "rate" (percentage) or "fixed" (absolute amount)
|
|
208
|
+
- `benchmark`: Minimum order amount required
|
|
209
|
+
- `off`: Discount value (e.g., 1000 for 10% if rate, or 100 for 100 units if fixed)
|
|
210
|
+
- `time_start` / `time_end`: Validity period
|
|
211
|
+
- `service`: Parent Service object ID (which Service this discount belongs to)
|
|
212
|
+
- `transferable`: Whether it can be transferred to others
|
|
213
|
+
|
|
214
|
+
**Step 2: Filter discounts for the current Service**
|
|
215
|
+
|
|
216
|
+
Each Discount has a `service` field indicating which Service it can be used with. Filter the received Discount objects by comparing each Discount's `service` field with the target Service object ID you're purchasing from. Only Discounts where `service` matches the target Service can be applied to that Service.
|
|
217
|
+
|
|
218
|
+
**Step 3: Validate discount applicability**
|
|
219
|
+
|
|
220
|
+
Before using a discount, verify:
|
|
221
|
+
1. **Time validity**: `time_start` ≤ current_time ≤ `time_end`
|
|
222
|
+
2. **Minimum amount**: Order total ≥ `benchmark`
|
|
223
|
+
3. **Service match**: Discount's `service` field matches the Service being purchased
|
|
224
|
+
|
|
225
|
+
**Step 4: Apply discount in order creation**
|
|
226
|
+
|
|
227
|
+
Include the selected Discount object ID in the `buy.discount` field:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"operation_type": "service",
|
|
232
|
+
"data": {
|
|
233
|
+
"buy": {
|
|
234
|
+
"items": [...],
|
|
235
|
+
"total_pay": "10000",
|
|
236
|
+
"discount": "discount_object_id_here"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Discount Calculation**:
|
|
243
|
+
- If `discount_type` is "rate": Discount = `total_pay` × (`off` / 10000)
|
|
244
|
+
- If `discount_type` is "fixed": Discount = min(`off`, `total_pay`)
|
|
245
|
+
- Final payment = `total_pay` - Discount
|
|
246
|
+
|
|
187
247
|
| `namedNewOrder` | Local name for Order | Recommended for easy reference |
|
|
188
248
|
| `namedNewProgress` | Local name for Progress | Recommended |
|
|
189
249
|
| `namedNewAllocation` | Local name for Allocation | Recommended |
|
|
190
250
|
|
|
191
251
|
### 3.2 Private Information Handling
|
|
192
252
|
|
|
193
|
-
|
|
253
|
+
After order creation, the AI must check the Service's `customer_required` field to see what information the provider needs (e.g., phone, email, delivery address).
|
|
194
254
|
|
|
195
|
-
1. **
|
|
196
|
-
2.
|
|
197
|
-
3.
|
|
198
|
-
|
|
199
|
-
**
|
|
255
|
+
1. **Retrieve from local storage**: Use `query_toolkit` → `local_info_list` to retrieve your saved private information matching the `customer_required` fields. These are sensitive records stored only on your device.
|
|
256
|
+
2. **AI should prompt**: If the required info is not in `local_info`, ask if the user wants to save it there for future use. If it exists, present it for user confirmation before sending.
|
|
257
|
+
3. **Send via Messenger**: Use `messenger_operation` with `send_message` — **NEVER put private information on-chain**.
|
|
258
|
+
4. **Include order ID** in the message for traceability.
|
|
259
|
+
5. **Request explicit confirmation**: Unconfirmed delivery may stall order progress.
|
|
200
260
|
|
|
201
261
|
### 3.3 Post-Creation Notification
|
|
202
262
|
|
package/wowok-provider/SKILL.md
CHANGED
|
@@ -86,7 +86,7 @@ Design your service offering before building. This phase defines what customers
|
|
|
86
86
|
|
|
87
87
|
### 1.1 Product Promise (WIP Files)
|
|
88
88
|
|
|
89
|
-
WIP (Witness
|
|
89
|
+
WIP (Witness Immutable Promise) files are **immutable product commitments** — your on-chain promise to customers.
|
|
90
90
|
|
|
91
91
|
**Creating WIP Files**:
|
|
92
92
|
|
|
@@ -419,6 +419,8 @@ Contact.ims[] → Your customer service addresses
|
|
|
419
419
|
- Confirm understanding explicitly (ARK signature required for evidence)
|
|
420
420
|
- Proactively communicate delays
|
|
421
421
|
|
|
422
|
+
> **AI reminder**: When fulfilling an order, the AI should proactively check whether the Service's `customer_required` fields (phone, email, delivery address, etc.) have been provided by the customer. If any are missing, prompt the provider to request them from the customer via Messenger using `messenger_operation` with `send_message`.
|
|
423
|
+
|
|
422
424
|
> **Full Guide**: See [wowok-messenger](../wowok-messenger/SKILL.md) for messaging, WTS generation, and evidence management.
|
|
423
425
|
|
|
424
426
|
---
|
package/wowok-safety/SKILL.md
CHANGED
|
@@ -238,9 +238,24 @@ Use `Payment` objects for commercial transfers when possible — they offer Guar
|
|
|
238
238
|
|
|
239
239
|
## 9. Testing & Validation Workflow
|
|
240
240
|
|
|
241
|
-
1. **Design Phase**: Use `wowok_buildin_info` to discover available permissions and
|
|
241
|
+
1. **Design Phase**: Use `wowok_buildin_info` to discover available permissions, Guard instructions, and value types
|
|
242
242
|
|
|
243
|
-
**Tool**: `wowok_buildin_info` with `
|
|
243
|
+
**Tool**: `wowok_buildin_info` with `info: "permissions"`, `info: "guard_instructions"`, or `info: "value types"`.
|
|
244
|
+
|
|
245
|
+
### 9.1 Value Types — Built-in Type Annotation System
|
|
246
|
+
|
|
247
|
+
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.
|
|
248
|
+
|
|
249
|
+
**When value types matter:**
|
|
250
|
+
- Defining Guard table columns: each Identifier in a Guard's `table` block requires a `value_type`
|
|
251
|
+
- Submitting data to Guards: `GuardSubmission` entries must match their declared `value_type`
|
|
252
|
+
- Reading Guard exports: `guard2file` output shows `value_type` for every Identifier
|
|
253
|
+
- Designing query instructions: both parameters and return values carry `value_type` annotations
|
|
254
|
+
|
|
255
|
+
- **String format is recommended** (e.g., `"U64"`, `"Address"`, `"VecString"`) for readability in Guard tables and submissions.
|
|
256
|
+
- Numeric codes (0–18) are accepted but obscure — prefer string names in all user-facing contexts.
|
|
257
|
+
- `Value` (19) is a protocol-internal type for dynamic value handling. It must **never** be used directly in user-defined Guards or submissions.
|
|
258
|
+
**Available value types** (queried via `wowok_buildin_info` with `info: "value types"`)
|
|
244
259
|
|
|
245
260
|
2. **Export & Review**: Before publishing, use `guard2file` and `machineNode2file` to export and review definitions
|
|
246
261
|
|
|
@@ -272,6 +287,9 @@ For complex objects with many fields (Service, Machine), use **incremental build
|
|
|
272
287
|
| Guard export | `guard2file` |
|
|
273
288
|
| Machine export | `machineNode2file` |
|
|
274
289
|
| Build-in info | `wowok_buildin_info` |
|
|
290
|
+
| Built-in permissions | `wowok_buildin_info` with `info: "permissions"` |
|
|
291
|
+
| Guard instructions | `wowok_buildin_info` with `info: "guard_instructions"` |
|
|
292
|
+
| Value types | `wowok_buildin_info` with `info: "value types"` |
|
|
275
293
|
|
|
276
294
|
**Query Schema**: `schema_query({ action: "get", name: "<schema_name>" })`
|
|
277
295
|
|