@wowok/skills 1.0.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.
Files changed (70) hide show
  1. package/README.md +156 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +177 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +19 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/skills.d.ts +5 -0
  11. package/dist/skills.d.ts.map +1 -0
  12. package/dist/skills.js +46 -0
  13. package/dist/skills.js.map +1 -0
  14. package/dist/types.d.ts +9 -0
  15. package/dist/types.d.ts.map +1 -0
  16. package/dist/types.js +3 -0
  17. package/dist/types.js.map +1 -0
  18. package/examples/Insurance/Insurance.md +594 -0
  19. package/examples/Insurance/Insurance_TestResults.md +481 -0
  20. package/examples/Insurance/insurance_complete_guard_v1.json +50 -0
  21. package/examples/MyShop/MyShop.md +1353 -0
  22. package/examples/MyShop/MyShop_TestResults.md +1003 -0
  23. package/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
  24. package/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
  25. package/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
  26. package/examples/MyShop_Advanced/machine_nodes.json +222 -0
  27. package/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
  28. package/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
  29. package/examples/Travel/Travel.md +1157 -0
  30. package/examples/Travel/Travel_TestResults.md +743 -0
  31. package/examples/Travel/calc-weather-timestamps.js +8 -0
  32. package/examples/Travel/travel_machine_v2_export.json +104 -0
  33. package/examples/Travel/weather_check_guard_v1.json +51 -0
  34. package/package.json +56 -0
  35. package/schemas/onchain_operations/_common.md +236 -0
  36. package/schemas/onchain_operations/_index.md +22 -0
  37. package/schemas/onchain_operations/allocation.md +50 -0
  38. package/schemas/onchain_operations/arbitration.md +95 -0
  39. package/schemas/onchain_operations/contact.md +36 -0
  40. package/schemas/onchain_operations/demand.md +52 -0
  41. package/schemas/onchain_operations/gen_passport.md +43 -0
  42. package/schemas/onchain_operations/guard.md +136 -0
  43. package/schemas/onchain_operations/machine.md +70 -0
  44. package/schemas/onchain_operations/order.md +57 -0
  45. package/schemas/onchain_operations/payment.md +32 -0
  46. package/schemas/onchain_operations/permission.md +57 -0
  47. package/schemas/onchain_operations/personal.md +59 -0
  48. package/schemas/onchain_operations/progress.md +35 -0
  49. package/schemas/onchain_operations/repository.md +81 -0
  50. package/schemas/onchain_operations/reward.md +40 -0
  51. package/schemas/onchain_operations/service.md +104 -0
  52. package/schemas/onchain_operations/treasury.md +74 -0
  53. package/schemas/schema-account_operation.md +402 -0
  54. package/schemas/schema-guard2file.md +153 -0
  55. package/schemas/schema-local_info_operation.md +160 -0
  56. package/schemas/schema-local_mark_operation.md +148 -0
  57. package/schemas/schema-machineNode2file.md +155 -0
  58. package/schemas/schema-messenger_operation.md +547 -0
  59. package/schemas/schema-onchain_events.md +201 -0
  60. package/schemas/schema-onchain_table_data.md +334 -0
  61. package/schemas/schema-query_toolkit.md +375 -0
  62. package/schemas/schema-wip_file.md +240 -0
  63. package/schemas/schema-wowok_buildin_info.md +296 -0
  64. package/scripts/install.js +113 -0
  65. package/wowok-build/SKILL.md +606 -0
  66. package/wowok-guard/SKILL.md +374 -0
  67. package/wowok-machine/SKILL.md +512 -0
  68. package/wowok-order/SKILL.md +499 -0
  69. package/wowok-safety/SKILL.md +381 -0
  70. package/wowok-tools/SKILL.md +635 -0
@@ -0,0 +1,104 @@
1
+ # onchain_operations / service
2
+
3
+ Create and manage product/service listings with transparent promises, bind workflow templates, set pricing, issue discount coupons.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallService_Data {
9
+ // Object reference - string (existing) or object (create new)
10
+ object: TypedPermissionObject;
11
+
12
+ // Create new order (customer purchase)
13
+ order_new?: {
14
+ buy: {
15
+ items: {
16
+ name: string; // Product name
17
+ stock: number; // Quantity
18
+ wip_hash: string; // WIP file hash
19
+ }[];
20
+ total_pay: CoinParam; // Payment amount
21
+ discount?: string; // Discount object ID
22
+ payment_remark?: string;
23
+ payment_index?: number;
24
+ };
25
+ agents?: ManyAccountOrMark_Address; // Order agents
26
+ order_required_info?: string; // Contact or WTS proof
27
+ transfer?: AccountOrMark_Address; // New order owner
28
+ namedNewOrder?: NamedObject; // Name for new Order
29
+ namedNewAllocation?: NamedObject; // Name for new Allocation
30
+ namedNewProgress?: NamedObject; // Name for new Progress
31
+ };
32
+
33
+ description?: string; // Service description
34
+ location?: string; // Service location
35
+
36
+ // Sales operations (discriminated union)
37
+ sales?: {
38
+ op: "add" | "set";
39
+ sales: { // Array of sale items (REQUIRED)
40
+ name: string; // Product name
41
+ price: number; // Price
42
+ stock: number; // Stock quantity
43
+ suspension: boolean; // Whether suspended
44
+ wip: string; // WIP file URL
45
+ wip_hash: string; // WIP hash
46
+ }[];
47
+ } | {
48
+ op: "remove";
49
+ sales_name: string[]; // Sale names to remove (REQUIRED)
50
+ } | {
51
+ op: "clear";
52
+ };
53
+
54
+ repositories?: ObjectsOp; // Repository operations
55
+ rewards?: ObjectsOp; // Reward operations
56
+ arbitrations?: ObjectsOp; // Arbitration operations
57
+ machine?: string | null; // Machine object ID
58
+
59
+ // Discount coupon
60
+ discount?: {
61
+ name: string;
62
+ discount_type: 0 | 1; // 0 = RATES (percentage), 1 = FIXED (fixed amount)
63
+ discount_value: number;
64
+ benchmark?: number;
65
+ time_ms_start?: number;
66
+ time_ms_end?: number;
67
+ count?: number;
68
+ recipient: ManyAccountOrMark_Address;
69
+ transferable?: boolean;
70
+ };
71
+
72
+ discount_destroy?: string[]; // Discount IDs to destroy
73
+ customer_required?: string[]; // Required info (phone, email, etc.)
74
+
75
+ // Order fund allocators
76
+ order_allocators?: {
77
+ description: string;
78
+ threshold: number;
79
+ allocators: {
80
+ guard: string; // Guard object ID
81
+ sharing: {
82
+ who: Recipient; // Recipient specification
83
+ sharing: number; // Amount or rate
84
+ mode: "Amount" | "Rate" | "Surplus";
85
+ }[];
86
+ fix?: number; // Fixed amount
87
+ max?: number; // Maximum amount
88
+ }[];
89
+ } | null;
90
+
91
+ buy_guard?: string | null; // Purchase Guard
92
+ compensation_fund_add?: CoinParam;
93
+ setting_locked_time_add?: number;
94
+ compensation_fund_receive?: ReceivedBalanceOrRecently;
95
+ owner_receive?: ReceivedObjectsOrRecently;
96
+ um?: string | null; // Contact object
97
+ pause?: boolean; // Pause new orders
98
+ publish?: boolean; // Publish service (immutable)
99
+ }
100
+ ```
101
+
102
+ ---
103
+
104
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, ObjectsOp, CoinParam, NamedObject, AccountOrMark_Address, ManyAccountOrMark_Address, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently, Recipient.
@@ -0,0 +1,74 @@
1
+ # onchain_operations / treasury
2
+
3
+ Create and manage treasury for team funds with deposit/withdrawal rules.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallTreasury_Data {
9
+ // Object reference - string (existing) or object (create new)
10
+ object: TypedPermissionObject;
11
+
12
+ description?: string; // Treasury description
13
+ receive?: ReceivedBalanceOrRecently; // Receive CoinWrapper
14
+
15
+ // Deposit funds
16
+ deposit?: {
17
+ coin: CoinParam;
18
+ by_external_deposit_guard?: string;
19
+ payment_info: {
20
+ remark?: string;
21
+ index?: number;
22
+ };
23
+ namedNewPayment?: NamedObject;
24
+ };
25
+
26
+ // Withdraw funds
27
+ withdraw?: {
28
+ amount: { fixed: number } | { by_external_withdraw_guard: string };
29
+ recipient: AccountOrMark_Address;
30
+ payment_info: {
31
+ remark?: string;
32
+ index?: number;
33
+ };
34
+ namedNewPayment?: NamedObject;
35
+ };
36
+
37
+ // External deposit Guards (discriminated union)
38
+ external_deposit_guard?: {
39
+ op: "add" | "set";
40
+ guards: { // Array of Guard configs (REQUIRED for add/set)
41
+ guard: string; // Guard object ID or name
42
+ identifier?: number | null; // Guard table index for deposit amount limit (null = unlimited)
43
+ store_from_id?: number | null; // Guard table index for record storage
44
+ }[];
45
+ } | {
46
+ op: "remove";
47
+ guards: string[]; // Guard IDs/names to remove (REQUIRED)
48
+ } | {
49
+ op: "clear";
50
+ };
51
+
52
+ // External withdraw Guards (discriminated union)
53
+ external_withdraw_guard?: {
54
+ op: "add" | "set";
55
+ guards: { // Array of Guard configs (REQUIRED for add/set)
56
+ guard: string; // Guard object ID or name
57
+ identifier?: number | null; // Guard table index for withdrawal amount limit (null = unlimited)
58
+ store_from_id?: number | null; // Guard table index for record storage
59
+ }[];
60
+ } | {
61
+ op: "remove";
62
+ guards: string[]; // Guard IDs/names to remove (REQUIRED)
63
+ } | {
64
+ op: "clear";
65
+ };
66
+
67
+ owner_receive?: ReceivedObjectsOrRecently;
68
+ um?: string | null; // Contact object
69
+ }
70
+ ```
71
+
72
+ ---
73
+
74
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, CoinParam, NamedObject, AccountOrMark_Address, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently.
@@ -0,0 +1,402 @@
1
+ # Schema: account_operation
2
+
3
+ > 100% LOCAL, NEVER ON-CHAIN - Manage WoWok accounts locally on device: generate, suspend, resume, faucet-test, operate assets, sign data, etc.
4
+
5
+ ---
6
+
7
+ ## Top-Level Structure
8
+
9
+ ```typescript
10
+ AccountOperation {
11
+ // Exactly ONE operation type must be specified
12
+ gen?: GenOperation;
13
+ faucet?: FaucetOperation;
14
+ suspend?: SuspendOperation;
15
+ resume?: ResumeOperation;
16
+ rename?: RenameOperation;
17
+ swap_name?: SwapNameOperation;
18
+ transfer?: TransferOperation;
19
+ get?: GetOperation;
20
+ signData?: SignDataOperation;
21
+ messenger?: MessengerOperation;
22
+ }
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Operation Types
28
+
29
+ ### gen
30
+
31
+ Generate a new account.
32
+
33
+ ```typescript
34
+ GenOperation {
35
+ name?: string; // Account name (max 64 chars). Empty = default account
36
+ replaceExistName?: boolean; // Force claim existing name
37
+ m?: string | null; // Messenger name to enable. Null = disable
38
+ }
39
+ ```
40
+
41
+ **Result**:
42
+
43
+ ```typescript
44
+ GenResult {
45
+ address: string; // New account ID
46
+ name?: string; // Account name
47
+ m?: string | null; // Messenger name if enabled
48
+ }
49
+ ```
50
+
51
+ ---
52
+
53
+ ### faucet
54
+
55
+ Distribute test coins from faucet.
56
+
57
+ ```typescript
58
+ FaucetOperation {
59
+ name_or_address?: string; // Account name or address. Empty = default
60
+ network: "localnet" | "testnet";
61
+ }
62
+ ```
63
+
64
+ **Result**:
65
+
66
+ ```typescript
67
+ FaucetResult {
68
+ name_or_address?: string;
69
+ result: {
70
+ amount: number;
71
+ id: string;
72
+ transferTxDigest: string;
73
+ }[];
74
+ network: "localnet" | "testnet";
75
+ }
76
+ ```
77
+
78
+ ---
79
+
80
+ ### suspend
81
+
82
+ Remove account from active list (cannot sign transactions).
83
+
84
+ ```typescript
85
+ SuspendOperation {
86
+ name_or_address?: string; // Account name or address. Empty = default
87
+ }
88
+ ```
89
+
90
+ **Result**:
91
+
92
+ ```typescript
93
+ SuspendResult {
94
+ name_or_address?: string;
95
+ success: boolean;
96
+ }
97
+ ```
98
+
99
+ ---
100
+
101
+ ### resume
102
+
103
+ Add account back to active list.
104
+
105
+ ```typescript
106
+ ResumeOperation {
107
+ address: string; // Account ID (0x + 64 hex chars)
108
+ name?: string; // New name for resumed account
109
+ }
110
+ ```
111
+
112
+ **Result**:
113
+
114
+ ```typescript
115
+ ResumeResult {
116
+ address: string;
117
+ name?: string;
118
+ success: boolean;
119
+ }
120
+ ```
121
+
122
+ ---
123
+
124
+ ### rename
125
+
126
+ Rename an account.
127
+
128
+ ```typescript
129
+ RenameOperation {
130
+ name_or_address?: string; // Source account. Empty = default
131
+ new_name: string; // New account name (max 64 chars)
132
+ }
133
+ ```
134
+
135
+ **Result**:
136
+
137
+ ```typescript
138
+ RenameResult {
139
+ name_or_address?: string;
140
+ new_name: string;
141
+ success: boolean;
142
+ }
143
+ ```
144
+
145
+ ---
146
+
147
+ ### swap_name
148
+
149
+ Swap names between two accounts.
150
+
151
+ ```typescript
152
+ SwapNameOperation {
153
+ name1?: string; // First account name. Empty = default
154
+ name2?: string; // Second account name. Empty = default
155
+ }
156
+ ```
157
+
158
+ **Result**:
159
+
160
+ ```typescript
161
+ SwapNameResult {
162
+ name1?: string;
163
+ name2?: string;
164
+ success: boolean;
165
+ }
166
+ ```
167
+
168
+ ---
169
+
170
+ ### transfer
171
+
172
+ Transfer tokens between accounts.
173
+
174
+ ```typescript
175
+ TransferOperation {
176
+ name_or_address_from?: string; // Sender. Empty = default
177
+ name_or_address_to?: string; // Recipient. Empty = default
178
+ amount: number | string; // Amount to transfer
179
+ token_type?: string; // Default: 0x2::wow::WOW
180
+ network?: "localnet" | "testnet";
181
+ }
182
+ ```
183
+
184
+ **Result**: `WowTransactionBlockResponse` (see Transaction Response Schema)
185
+
186
+ ---
187
+
188
+ ### get
189
+
190
+ Generate new coin object by required amount.
191
+
192
+ ```typescript
193
+ GetOperation {
194
+ name_or_address?: string; // Account. Empty = default
195
+ balance_required: number | string;
196
+ token_type?: string; // Default: 0x2::wow::WOW
197
+ network?: "localnet" | "testnet";
198
+ }
199
+ ```
200
+
201
+ **Result**:
202
+
203
+ ```typescript
204
+ GetResult {
205
+ coin_address?: string; // New coin object ID
206
+ name_or_address?: string;
207
+ balance_required: number | string;
208
+ token_type?: string;
209
+ network?: "localnet" | "testnet";
210
+ }
211
+ ```
212
+
213
+ ---
214
+
215
+ ### signData
216
+
217
+ Sign data with account's private key.
218
+
219
+ ```typescript
220
+ SignDataOperation {
221
+ name_or_address?: string; // Account. Empty = default
222
+ data: string; // Data to sign
223
+ data_encoding?: "utf8" | "base64" | "hex"; // Default: utf8
224
+ }
225
+ ```
226
+
227
+ **Result**:
228
+
229
+ ```typescript
230
+ SignDataResult {
231
+ name_or_address?: string;
232
+ signature: string; // Signature in hex
233
+ publicKey: string; // Public key in hex
234
+ address: string; // Account address
235
+ }
236
+ ```
237
+
238
+ ---
239
+
240
+ ### messenger
241
+
242
+ Enable or disable messenger for an account.
243
+
244
+ ```typescript
245
+ MessengerOperation {
246
+ name_or_account?: string; // Account. Empty = default
247
+ m: string | null; // Messenger name. Null = disable
248
+ }
249
+ ```
250
+
251
+ **Result**:
252
+
253
+ ```typescript
254
+ MessengerResult {
255
+ name_or_account?: string;
256
+ m: string | null;
257
+ }
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Common Sub-Schemas
263
+
264
+ ### WowTransactionBlockResponse
265
+
266
+ ```typescript
267
+ WowTransactionBlockResponse {
268
+ digest: string;
269
+ effects?: TransactionEffects;
270
+ events?: WowEvent[];
271
+ balanceChanges?: BalanceChange[];
272
+ objectChanges?: WowObjectChange[];
273
+ errors?: string[];
274
+ // ... additional fields
275
+ }
276
+ ```
277
+
278
+ ### TransactionEffects
279
+
280
+ ```typescript
281
+ TransactionEffects {
282
+ status: {
283
+ status: "success" | "failure";
284
+ error?: string;
285
+ };
286
+ gasUsed: {
287
+ computationCost: string;
288
+ storageCost: string;
289
+ storageRebate: string;
290
+ nonRefundableStorageFee: string;
291
+ };
292
+ gasObject: OwnedObjectRef;
293
+ created?: OwnedObjectRef[];
294
+ mutated?: OwnedObjectRef[];
295
+ deleted?: WowObjectRef[];
296
+ // ... additional fields
297
+ }
298
+ ```
299
+
300
+ ### WowEvent
301
+
302
+ ```typescript
303
+ WowEvent {
304
+ id: {
305
+ eventSeq: string;
306
+ txDigest: string;
307
+ };
308
+ packageId: string;
309
+ transactionModule: string;
310
+ sender: string;
311
+ type: string;
312
+ parsedJson: Record<string, string | number | boolean>;
313
+ bcs: string;
314
+ bcsEncoding: "base64" | "base58";
315
+ timestampMs?: string;
316
+ }
317
+ ```
318
+
319
+ ### BalanceChange
320
+
321
+ ```typescript
322
+ BalanceChange {
323
+ amount: string; // Negative for spending, positive for receiving
324
+ coinType: string;
325
+ owner: ObjectOwner;
326
+ }
327
+ ```
328
+
329
+ ### WowObjectChange
330
+
331
+ ```typescript
332
+ WowObjectChange =
333
+ | { type: "created"; objectId: string; objectType: string; owner: ObjectOwner; sender: string; version: string | number; digest: string }
334
+ | { type: "mutated"; objectId: string; objectType: string; owner: ObjectOwner | null; sender: string; version: string | number; digest: string; previousVersion: string | number }
335
+ | { type: "deleted"; objectId: string; objectType: string; sender: string; version: string | number }
336
+ | { type: "transferred"; objectId: string; objectType: string; recipient: ObjectOwner; sender: string; version: string | number; digest: string }
337
+ | { type: "wrapped"; objectId: string; objectType: string; sender: string; version: string | number }
338
+ | { type: "published"; packageId: string; version: string | number; digest: string; modules: string[] };
339
+ ```
340
+
341
+ ### ObjectOwner
342
+
343
+ ```typescript
344
+ ObjectOwner =
345
+ | { AddressOwner: string }
346
+ | { ObjectOwner: string }
347
+ | { Shared: { initial_shared_version: number } }
348
+ | "Immutable";
349
+ ```
350
+
351
+ ### WowObjectRef
352
+
353
+ ```typescript
354
+ WowObjectRef {
355
+ objectId: string;
356
+ version: string | number;
357
+ digest: string;
358
+ }
359
+ ```
360
+
361
+ ### OwnedObjectRef
362
+
363
+ ```typescript
364
+ OwnedObjectRef {
365
+ owner: ObjectOwner;
366
+ reference: WowObjectRef;
367
+ }
368
+ ```
369
+
370
+ ---
371
+
372
+ ## Output Structure
373
+
374
+ ```typescript
375
+ AccountOperationOutput {
376
+ status: "success" | "error";
377
+ data?: AccountOperationResult; // Present when status = "success"
378
+ error?: string; // Present when status = "error"
379
+ }
380
+
381
+ // Wrapped format
382
+ {
383
+ result: AccountOperationOutput;
384
+ }
385
+ ```
386
+
387
+ ### AccountOperationResult
388
+
389
+ ```typescript
390
+ AccountOperationResult {
391
+ gen?: GenResult;
392
+ faucet?: FaucetResult;
393
+ suspend?: SuspendResult;
394
+ resume?: ResumeResult;
395
+ rename?: RenameResult;
396
+ swap_name?: SwapNameResult;
397
+ transfer?: WowTransactionBlockResponse;
398
+ get?: GetResult;
399
+ signData?: SignDataResult;
400
+ messenger?: MessengerResult;
401
+ }
402
+ ```