@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.
- package/README.md +156 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +177 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/skills.d.ts +5 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +46 -0
- package/dist/skills.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/examples/Insurance/Insurance.md +594 -0
- package/examples/Insurance/Insurance_TestResults.md +481 -0
- package/examples/Insurance/insurance_complete_guard_v1.json +50 -0
- package/examples/MyShop/MyShop.md +1353 -0
- package/examples/MyShop/MyShop_TestResults.md +1003 -0
- package/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
- package/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
- package/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
- package/examples/MyShop_Advanced/machine_nodes.json +222 -0
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
- package/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
- package/examples/Travel/Travel.md +1157 -0
- package/examples/Travel/Travel_TestResults.md +743 -0
- package/examples/Travel/calc-weather-timestamps.js +8 -0
- package/examples/Travel/travel_machine_v2_export.json +104 -0
- package/examples/Travel/weather_check_guard_v1.json +51 -0
- package/package.json +56 -0
- package/schemas/onchain_operations/_common.md +236 -0
- package/schemas/onchain_operations/_index.md +22 -0
- package/schemas/onchain_operations/allocation.md +50 -0
- package/schemas/onchain_operations/arbitration.md +95 -0
- package/schemas/onchain_operations/contact.md +36 -0
- package/schemas/onchain_operations/demand.md +52 -0
- package/schemas/onchain_operations/gen_passport.md +43 -0
- package/schemas/onchain_operations/guard.md +136 -0
- package/schemas/onchain_operations/machine.md +70 -0
- package/schemas/onchain_operations/order.md +57 -0
- package/schemas/onchain_operations/payment.md +32 -0
- package/schemas/onchain_operations/permission.md +57 -0
- package/schemas/onchain_operations/personal.md +59 -0
- package/schemas/onchain_operations/progress.md +35 -0
- package/schemas/onchain_operations/repository.md +81 -0
- package/schemas/onchain_operations/reward.md +40 -0
- package/schemas/onchain_operations/service.md +104 -0
- package/schemas/onchain_operations/treasury.md +74 -0
- package/schemas/schema-account_operation.md +402 -0
- package/schemas/schema-guard2file.md +153 -0
- package/schemas/schema-local_info_operation.md +160 -0
- package/schemas/schema-local_mark_operation.md +148 -0
- package/schemas/schema-machineNode2file.md +155 -0
- package/schemas/schema-messenger_operation.md +547 -0
- package/schemas/schema-onchain_events.md +201 -0
- package/schemas/schema-onchain_table_data.md +334 -0
- package/schemas/schema-query_toolkit.md +375 -0
- package/schemas/schema-wip_file.md +240 -0
- package/schemas/schema-wowok_buildin_info.md +296 -0
- package/scripts/install.js +113 -0
- package/wowok-build/SKILL.md +606 -0
- package/wowok-guard/SKILL.md +374 -0
- package/wowok-machine/SKILL.md +512 -0
- package/wowok-order/SKILL.md +499 -0
- package/wowok-safety/SKILL.md +381 -0
- package/wowok-tools/SKILL.md +635 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
# WoWok Built-in Info Tool Schema
|
|
2
|
+
|
|
3
|
+
> **Tool Name**: `wowok_buildin_info`
|
|
4
|
+
> **Description**: Query WoWok protocol information: 'constants', 'built-in permissions', 'guard instructions', 'current network', or 'value types'.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Tool Schema
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
wowok_buildin_info: ProtocolInfoQuery
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Input Schema
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
ProtocolInfoQuery =
|
|
20
|
+
| { info: "constants" }
|
|
21
|
+
| { info: "built-in permissions"; filter?: PermissionFilter }
|
|
22
|
+
| { info: "guard instructions"; filter?: GuardInstructFilterOptions }
|
|
23
|
+
| { info: "current network" }
|
|
24
|
+
| { info: "value types" }
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Sub Schemas
|
|
30
|
+
|
|
31
|
+
### PermissionFilter
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
PermissionFilter {
|
|
35
|
+
index?: number, // Filter by permission index
|
|
36
|
+
name?: string, // Filter by permission name (partial match, case-insensitive)
|
|
37
|
+
module?: string // Filter by module name (e.g., 'service', 'order', 'machine')
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### GuardInstructFilterOptions
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
GuardInstructFilterOptions {
|
|
45
|
+
id?: number, // Filter by instruction ID
|
|
46
|
+
name?: string, // Filter by instruction name (partial match, case-insensitive)
|
|
47
|
+
objectType?: string, // Filter by object type
|
|
48
|
+
returnType?: string // Filter by return value type
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Output Schema
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
ProtocolInfoResult {
|
|
58
|
+
result: ProtocolInfoResultWrapped
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ProtocolInfoResultWrapped =
|
|
62
|
+
| { info: "constants"; result: ConstantItem[] }
|
|
63
|
+
| { info: "built-in permissions"; result: PermissionInfoType[] }
|
|
64
|
+
| { info: "guard instructions"; result: GuardItem[] }
|
|
65
|
+
| { info: "current network"; result: Entrypoint }
|
|
66
|
+
| { info: "value types"; result: ConstantItem[] }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Result Type Schemas
|
|
72
|
+
|
|
73
|
+
### ConstantItem
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
ConstantItem {
|
|
77
|
+
name: string, // Constant name
|
|
78
|
+
value: string, // Constant value
|
|
79
|
+
description: string // Constant description
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### PermissionInfoType
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
PermissionInfoType {
|
|
87
|
+
index: number, // Permission index (0-65535)
|
|
88
|
+
name: string, // Permission name
|
|
89
|
+
module: string, // Module name
|
|
90
|
+
description: string // Permission description
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### GuardItem
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
GuardItem {
|
|
98
|
+
id: number, // Instruction ID
|
|
99
|
+
name: string, // Instruction name
|
|
100
|
+
objectType: string, // Object type this instruction operates on
|
|
101
|
+
parameters: ValueType[], // Parameter types
|
|
102
|
+
return: ValueType, // Return value type
|
|
103
|
+
description: string, // Instruction description
|
|
104
|
+
parameters_description: string[] // Parameter descriptions
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Entrypoint
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
Entrypoint = "localnet" | "testnet"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### ValueType
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
ValueType =
|
|
118
|
+
| "Bool" | "Address" | "String"
|
|
119
|
+
| "U8" | "U16" | "U32" | "U64" | "U128" | "U256"
|
|
120
|
+
| "VecBool" | "VecAddress" | "VecString"
|
|
121
|
+
| "VecU8" | "VecU16" | "VecU32" | "VecU64" | "VecU128" | "VecU256"
|
|
122
|
+
| "VecVecU8"
|
|
123
|
+
| number // Numeric representation (0-18)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Query Type Selection Guide
|
|
129
|
+
|
|
130
|
+
| Query Type | Description | Use Case |
|
|
131
|
+
|------------|-------------|----------|
|
|
132
|
+
| `constants` | Protocol constants | Get system-wide constant values |
|
|
133
|
+
| `built-in permissions` | Built-in permission definitions | Find permission indices for Permission objects |
|
|
134
|
+
| `guard instructions` | Guard query instructions | Find available data queries for Guard nodes |
|
|
135
|
+
| `current network` | Current network entrypoint | Verify which network is active |
|
|
136
|
+
| `value types` | Supported value types | Get type mappings for Guard/Repository data |
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Examples
|
|
141
|
+
|
|
142
|
+
### Query Constants
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
wowok_buildin_info: {
|
|
146
|
+
info: "constants"
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Query Built-in Permissions with Filter
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
wowok_buildin_info: {
|
|
154
|
+
info: "built-in permissions",
|
|
155
|
+
filter: {
|
|
156
|
+
module: "service" // Filter for service-related permissions
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Query Guard Instructions with Filter
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
wowok_buildin_info: {
|
|
165
|
+
info: "guard instructions",
|
|
166
|
+
filter: {
|
|
167
|
+
objectType: "Service", // Filter for Service object queries
|
|
168
|
+
returnType: "U64" // Filter for U64 return type
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Query Current Network
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
wowok_buildin_info: {
|
|
177
|
+
info: "current network"
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Query Value Types
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
wowok_buildin_info: {
|
|
185
|
+
info: "value types"
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Output Examples
|
|
192
|
+
|
|
193
|
+
### Constants Result
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"result": {
|
|
198
|
+
"info": "constants",
|
|
199
|
+
"result": [
|
|
200
|
+
{
|
|
201
|
+
"name": "MAX_GUARD_NODES",
|
|
202
|
+
"value": "64",
|
|
203
|
+
"description": "Maximum number of nodes in a Guard"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "MAX_MACHINE_NODES",
|
|
207
|
+
"value": "256",
|
|
208
|
+
"description": "Maximum number of nodes in a Machine"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Built-in Permissions Result
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"result": {
|
|
220
|
+
"info": "built-in permissions",
|
|
221
|
+
"result": [
|
|
222
|
+
{
|
|
223
|
+
"index": 0,
|
|
224
|
+
"name": "service.create",
|
|
225
|
+
"module": "service",
|
|
226
|
+
"description": "Create new service"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"index": 1,
|
|
230
|
+
"name": "service.update",
|
|
231
|
+
"module": "service",
|
|
232
|
+
"description": "Update service settings"
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Guard Instructions Result
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"result": {
|
|
244
|
+
"info": "guard instructions",
|
|
245
|
+
"result": [
|
|
246
|
+
{
|
|
247
|
+
"id": 1001,
|
|
248
|
+
"name": "service.description",
|
|
249
|
+
"objectType": "Service",
|
|
250
|
+
"parameters": [],
|
|
251
|
+
"return": "String",
|
|
252
|
+
"description": "Get service description",
|
|
253
|
+
"parameters_description": []
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Current Network Result
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"result": {
|
|
265
|
+
"info": "current network",
|
|
266
|
+
"result": "testnet"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Value Types Result
|
|
272
|
+
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"result": {
|
|
276
|
+
"info": "value types",
|
|
277
|
+
"result": [
|
|
278
|
+
{
|
|
279
|
+
"name": "Bool",
|
|
280
|
+
"value": "0",
|
|
281
|
+
"description": "Boolean type"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "Address",
|
|
285
|
+
"value": "1",
|
|
286
|
+
"description": "Address type"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"name": "String",
|
|
290
|
+
"value": "2",
|
|
291
|
+
"description": "String type"
|
|
292
|
+
}
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WoWok Skills installer
|
|
3
|
+
*
|
|
4
|
+
* npm lifecycle integration:
|
|
5
|
+
* postinstall → copy SKILL.md folders to ~/.claude/skills/
|
|
6
|
+
* preuninstall → remove SKILL.md folders from ~/.claude/skills/
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
|
|
13
|
+
const SKILL_DIRS = [
|
|
14
|
+
'wowok-build',
|
|
15
|
+
'wowok-guard',
|
|
16
|
+
'wowok-tools',
|
|
17
|
+
'wowok-safety',
|
|
18
|
+
'wowok-machine',
|
|
19
|
+
'wowok-order',
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const CLAUDE_SKILLS_DIR = path.join(os.homedir(), '.claude', 'skills');
|
|
23
|
+
|
|
24
|
+
function getPackageRoot() {
|
|
25
|
+
return path.resolve(__dirname, '..');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function copyDir(src, dest) {
|
|
29
|
+
if (!fs.existsSync(src)) return false;
|
|
30
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
31
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
32
|
+
for (const entry of entries) {
|
|
33
|
+
const srcPath = path.join(src, entry.name);
|
|
34
|
+
const destPath = path.join(dest, entry.name);
|
|
35
|
+
if (entry.isDirectory()) {
|
|
36
|
+
copyDir(srcPath, destPath);
|
|
37
|
+
} else {
|
|
38
|
+
fs.copyFileSync(srcPath, destPath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function removeDir(dir) {
|
|
45
|
+
if (!fs.existsSync(dir)) return;
|
|
46
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
47
|
+
for (const entry of entries) {
|
|
48
|
+
const fullPath = path.join(dir, entry.name);
|
|
49
|
+
if (entry.isDirectory()) {
|
|
50
|
+
removeDir(fullPath);
|
|
51
|
+
} else {
|
|
52
|
+
fs.unlinkSync(fullPath);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
fs.rmdirSync(dir);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function installSkills(targetDir) {
|
|
59
|
+
const pkgRoot = getPackageRoot();
|
|
60
|
+
let count = 0;
|
|
61
|
+
|
|
62
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
63
|
+
|
|
64
|
+
for (const dir of SKILL_DIRS) {
|
|
65
|
+
const src = path.join(pkgRoot, dir, 'SKILL.md');
|
|
66
|
+
const destDir = path.join(targetDir, dir);
|
|
67
|
+
const dest = path.join(destDir, 'SKILL.md');
|
|
68
|
+
|
|
69
|
+
if (!fs.existsSync(src)) {
|
|
70
|
+
console.warn(`[wowok-skills] WARN: SKILL.md not found for ${dir}`);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
75
|
+
fs.copyFileSync(src, dest);
|
|
76
|
+
count++;
|
|
77
|
+
console.log(`[wowok-skills] installed: ${dir} → ${destDir}`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return count;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function uninstallSkills(targetDir) {
|
|
84
|
+
let count = 0;
|
|
85
|
+
|
|
86
|
+
for (const dir of SKILL_DIRS) {
|
|
87
|
+
const dirPath = path.join(targetDir, dir);
|
|
88
|
+
if (fs.existsSync(dirPath)) {
|
|
89
|
+
removeDir(dirPath);
|
|
90
|
+
count++;
|
|
91
|
+
console.log(`[wowok-skills] removed: ${dirPath}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return count;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function main() {
|
|
99
|
+
const event = process.env.npm_lifecycle_event || '';
|
|
100
|
+
|
|
101
|
+
if (event === 'postinstall') {
|
|
102
|
+
console.log('[wowok-skills] Installing skills to ~/.claude/skills/ ...');
|
|
103
|
+
const count = installSkills(CLAUDE_SKILLS_DIR);
|
|
104
|
+
console.log(`[wowok-skills] Done — ${count} skills installed.`);
|
|
105
|
+
console.log('[wowok-skills] Skills will be available in your next Claude Code session.');
|
|
106
|
+
} else if (event === 'preuninstall') {
|
|
107
|
+
console.log('[wowok-skills] Removing skills from ~/.claude/skills/ ...');
|
|
108
|
+
const count = uninstallSkills(CLAUDE_SKILLS_DIR);
|
|
109
|
+
console.log(`[wowok-skills] Done — ${count} skills removed.`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
main();
|