@wowok/skills 2.2.1 → 2.2.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/README.md +2 -2
- package/dist/skills.d.ts +3 -3
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +182 -10
- package/dist/skills.js.map +1 -1
- package/examples/MyShop/MyShop.md +68 -35
- package/examples/ThreeBody_Signature/ThreeBody_Signature.md +91 -18
- package/examples/Travel/Travel.md +17 -25
- package/package.json +1 -1
- package/scripts/install.js +2 -2
- package/wowok-arbitrator/SKILL.md +3 -3
- package/wowok-auditor/SKILL.md +3 -3
- package/wowok-collaborator/SKILL.md +2 -2
- package/wowok-machine/SKILL.md +9 -9
- package/wowok-messenger/SKILL.md +1 -1
- package/wowok-onboard/SKILL.md +10 -10
- package/wowok-order/SKILL.md +1 -1
- package/wowok-output/SKILL.md +31 -23
- package/wowok-planner/SKILL.md +2 -2
- package/wowok-provider/SKILL.md +20 -20
- package/wowok-supplier/SKILL.md +3 -3
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ npm install -g @wowok/skills
|
|
|
43
43
|
| **Always** | `wowok-output` | Metadata always in prompt (~100 tokens). AI auto-loads full content when needed. |
|
|
44
44
|
| **On-demand** | All others | AI matches description to task. Only loaded when relevant. |
|
|
45
45
|
|
|
46
|
-
> **v2.0 migration**: The 4 rule-reference skills (`wowok-tools`, `wowok-safety`, `wowok-scenario`, `wowok-guard`) were sunk into the MCP knowledge layer and are no longer installed. Their content is served by the MCP server itself — `schema_query` actions `get_tool_reference` / `get_safety_rules` / `get_guard_design_patterns`, and `
|
|
46
|
+
> **v2.0 migration**: The 4 rule-reference skills (`wowok-tools`, `wowok-safety`, `wowok-scenario`, `wowok-guard`) were sunk into the MCP knowledge layer and are no longer installed. Their content is served by the MCP server itself — `schema_query` actions `get_tool_reference` / `get_safety_rules` / `get_guard_design_patterns`, and `industry_pack_operation` actions.
|
|
47
47
|
|
|
48
48
|
## Quick Start
|
|
49
49
|
|
|
@@ -183,7 +183,7 @@ const providerSkill = getSkillByName('wowok-provider');
|
|
|
183
183
|
|--------------|---------------|
|
|
184
184
|
| `wowok-tools` | MCP `schema_query` action='get_tool_reference' |
|
|
185
185
|
| `wowok-safety` | MCP `schema_query` action='get_safety_rules' + runtime confirm-gate on every write |
|
|
186
|
-
| `wowok-scenario` | MCP `
|
|
186
|
+
| `wowok-scenario` | MCP `industry_pack_operation` actions 'recommend_industry' / 'list_modes' |
|
|
187
187
|
| `wowok-guard` | MCP `schema_query` actions 'get_guard_design_patterns' / 'get_guard_templates' |
|
|
188
188
|
|
|
189
189
|
## Related Projects
|
package/dist/skills.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Skill, SkillConfig, SkillRole, RoleSkills, SkillMode } from './types';
|
|
|
8
8
|
* - wowok-tools → MCP tools-reference
|
|
9
9
|
* (schema_query action='get_tool_reference')
|
|
10
10
|
* - wowok-scenario → MCP scenario-modes
|
|
11
|
-
* (
|
|
11
|
+
* (industry_pack_operation recommend_industry / list_modes,
|
|
12
12
|
* industry mode registry)
|
|
13
13
|
* - wowok-guard → MCP guard-design-patterns
|
|
14
14
|
* (schema_query action='get_guard_design_patterns')
|
|
@@ -47,7 +47,7 @@ import { Skill, SkillConfig, SkillRole, RoleSkills, SkillMode } from './types';
|
|
|
47
47
|
*/
|
|
48
48
|
/**
|
|
49
49
|
* Skills removed in the GLM5-31 sink refactor. Their content lives in the MCP
|
|
50
|
-
* knowledge layer and is served via schema_query /
|
|
50
|
+
* knowledge layer and is served via schema_query / industry_pack_operation — no skill
|
|
51
51
|
* installation required. Kept here for migration detection (checkSkillMigration).
|
|
52
52
|
*/
|
|
53
53
|
export declare const DEPRECATED_SKILLS: readonly ["wowok-safety", "wowok-tools", "wowok-scenario", "wowok-guard"];
|
|
@@ -82,7 +82,7 @@ export declare function getRoleSkills(): RoleSkills[];
|
|
|
82
82
|
* Note: Guard design / tool usage / safety / industry-mode questions are now
|
|
83
83
|
* served directly by the MCP knowledge layer (schema_query actions
|
|
84
84
|
* get_guard_design_patterns / get_tool_reference / get_safety_rules, and
|
|
85
|
-
*
|
|
85
|
+
* industry_pack_operation recommend_industry) — no skill installation required.
|
|
86
86
|
*/
|
|
87
87
|
export declare function recommendSkills(intent: string): Skill[];
|
|
88
88
|
/**
|
package/dist/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2EAKpB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAK/D,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAgHzB,CAAC;AA2IF;;GAEG;AACH,wBAAgB,SAAS,IAAI,KAAK,EAAE,CAEnC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAE9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,EAAE,CAExD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,EAAE,CAExE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,EAAE,CAsC5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CA0CvD;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS,CAYtF;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC,CAMD;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG;IAC9D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB,CAqBA"}
|
package/dist/skills.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.wowokSkills = exports.SKILL_MIGRATION_MAP = exports.DEPRECATED_SKILLS = void 0;
|
|
4
37
|
exports.getSkills = getSkills;
|
|
@@ -10,6 +43,8 @@ exports.recommendSkills = recommendSkills;
|
|
|
10
43
|
exports.negotiateSkillMode = negotiateSkillMode;
|
|
11
44
|
exports.negotiateAllSkills = negotiateAllSkills;
|
|
12
45
|
exports.checkSkillMigration = checkSkillMigration;
|
|
46
|
+
const fs = __importStar(require("fs"));
|
|
47
|
+
const path = __importStar(require("path"));
|
|
13
48
|
/**
|
|
14
49
|
* WoWok Skills organized by role (post GLM5-31 sink refactor)
|
|
15
50
|
*
|
|
@@ -19,7 +54,7 @@ exports.checkSkillMigration = checkSkillMigration;
|
|
|
19
54
|
* - wowok-tools → MCP tools-reference
|
|
20
55
|
* (schema_query action='get_tool_reference')
|
|
21
56
|
* - wowok-scenario → MCP scenario-modes
|
|
22
|
-
* (
|
|
57
|
+
* (industry_pack_operation recommend_industry / list_modes,
|
|
23
58
|
* industry mode registry)
|
|
24
59
|
* - wowok-guard → MCP guard-design-patterns
|
|
25
60
|
* (schema_query action='get_guard_design_patterns')
|
|
@@ -58,7 +93,7 @@ exports.checkSkillMigration = checkSkillMigration;
|
|
|
58
93
|
*/
|
|
59
94
|
/**
|
|
60
95
|
* Skills removed in the GLM5-31 sink refactor. Their content lives in the MCP
|
|
61
|
-
* knowledge layer and is served via schema_query /
|
|
96
|
+
* knowledge layer and is served via schema_query / industry_pack_operation — no skill
|
|
62
97
|
* installation required. Kept here for migration detection (checkSkillMigration).
|
|
63
98
|
*/
|
|
64
99
|
exports.DEPRECATED_SKILLS = [
|
|
@@ -71,7 +106,7 @@ exports.DEPRECATED_SKILLS = [
|
|
|
71
106
|
exports.SKILL_MIGRATION_MAP = {
|
|
72
107
|
'wowok-safety': "MCP schema_query action='get_safety_rules' (+ runtime confirm-gate on every on-chain write)",
|
|
73
108
|
'wowok-tools': "MCP schema_query action='get_tool_reference'",
|
|
74
|
-
'wowok-scenario': "MCP
|
|
109
|
+
'wowok-scenario': "MCP industry_pack_operation action='recommend_industry' / 'list_modes' (industry mode registry)",
|
|
75
110
|
'wowok-guard': "MCP schema_query action='get_guard_design_patterns' (+ action='get_guard_templates')",
|
|
76
111
|
};
|
|
77
112
|
exports.wowokSkills = {
|
|
@@ -149,7 +184,7 @@ exports.wowokSkills = {
|
|
|
149
184
|
// === ONBOARDING / PLANNING / AUDIT (L3+L4 BRIDGE) ===
|
|
150
185
|
{
|
|
151
186
|
name: 'wowok-onboard',
|
|
152
|
-
description: 'First-touch onboarding — guides a new user from zero to their first published Service through a Review opening + 12-round user-driven dialogue. Industry mode defaults (freelance/rental/education/travel/...) are served by MCP
|
|
187
|
+
description: 'First-touch onboarding — guides a new user from zero to their first published Service through a Review opening + 12-round user-driven dialogue. Industry mode defaults (freelance/rental/education/travel/...) are served by MCP industry_pack_operation recommend_industry. Use when a new user says "I want to open a shop" or has no published Service yet.',
|
|
153
188
|
version: '2.0.0',
|
|
154
189
|
role: 'shared',
|
|
155
190
|
loading: 'on-demand',
|
|
@@ -181,29 +216,166 @@ exports.wowokSkills = {
|
|
|
181
216
|
}
|
|
182
217
|
]
|
|
183
218
|
};
|
|
219
|
+
// ============================================================
|
|
220
|
+
// Runtime registry — disk is the source of truth
|
|
221
|
+
// ============================================================
|
|
222
|
+
//
|
|
223
|
+
// Every accessor resolves the skill list from the PACKAGE DIRECTORY AT
|
|
224
|
+
// RUNTIME (each `<name>/SKILL.md` frontmatter merged over the compiled
|
|
225
|
+
// `wowokSkills` metadata). Because consumers (the agent sidecar via the
|
|
226
|
+
// `@wowok/skills` dependency) reach this package through a junction to the
|
|
227
|
+
// repo working tree, edits to SKILL.md files — content, description, or a
|
|
228
|
+
// brand-new skill folder — take effect within the cache TTL WITHOUT any
|
|
229
|
+
// rebuild.
|
|
230
|
+
const RUNTIME_SCAN_TTL_MS = 3000;
|
|
231
|
+
let runtimeCache = null;
|
|
232
|
+
let runtimeAt = 0;
|
|
233
|
+
/** Resolve the skills package root from the compiled output (dist → root). */
|
|
234
|
+
function packageRoot() {
|
|
235
|
+
return path.resolve(__dirname, '..');
|
|
236
|
+
}
|
|
237
|
+
const VALID_ROLES = [
|
|
238
|
+
'customer', 'provider', 'supplier', 'collaborator', 'arbitrator', 'shared',
|
|
239
|
+
];
|
|
240
|
+
/**
|
|
241
|
+
* Minimal YAML frontmatter reader — supports the fields this registry needs
|
|
242
|
+
* (`name`, `description` incl. `|` block scalars, `version`, `role`,
|
|
243
|
+
* `loading`, `related`, `always`). No external YAML dependency.
|
|
244
|
+
*/
|
|
245
|
+
function parseFrontmatter(raw) {
|
|
246
|
+
const m = raw.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
247
|
+
if (!m)
|
|
248
|
+
return {};
|
|
249
|
+
const out = {};
|
|
250
|
+
const lines = m[1].split(/\r?\n/);
|
|
251
|
+
let key = null;
|
|
252
|
+
let block = null;
|
|
253
|
+
const flush = () => {
|
|
254
|
+
if (key && block)
|
|
255
|
+
out[key] = block.join('\n').trim();
|
|
256
|
+
key = null;
|
|
257
|
+
block = null;
|
|
258
|
+
};
|
|
259
|
+
for (const line of lines) {
|
|
260
|
+
const listItem = line.match(/^\s+-\s+(.*)$/);
|
|
261
|
+
if (key && block && listItem) {
|
|
262
|
+
block.push(listItem[1].trim());
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
const kv = line.match(/^([A-Za-z_][\w-]*):\s*(.*)$/);
|
|
266
|
+
if (!kv) {
|
|
267
|
+
// Continuation of a `|` block scalar.
|
|
268
|
+
if (key && block && line.startsWith(' '))
|
|
269
|
+
block.push(line.trim());
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
flush();
|
|
273
|
+
key = kv[1];
|
|
274
|
+
const val = kv[2].trim();
|
|
275
|
+
if (val === '|' || val === '|-' || val === '') {
|
|
276
|
+
block = [];
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
out[key] = val;
|
|
280
|
+
key = null;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
flush();
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
function coerceRelated(v) {
|
|
287
|
+
if (Array.isArray(v))
|
|
288
|
+
return v.map(String);
|
|
289
|
+
if (typeof v === 'string') {
|
|
290
|
+
const stripped = v.replace(/^\[[\s\S]*\]$/, (m) => m.slice(1, -1));
|
|
291
|
+
const parts = stripped.split(/[\s,]+/).filter(Boolean);
|
|
292
|
+
return parts.length ? parts : undefined;
|
|
293
|
+
}
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
/** Scan each `NAME/SKILL.md` under the package root; frontmatter wins over compiled metadata. */
|
|
297
|
+
function scanSkillDirectories() {
|
|
298
|
+
const root = packageRoot();
|
|
299
|
+
const compiled = new Map(exports.wowokSkills.skills.map((s) => [s.name, s]));
|
|
300
|
+
const merged = [];
|
|
301
|
+
let entries;
|
|
302
|
+
try {
|
|
303
|
+
entries = fs.readdirSync(root, { withFileTypes: true })
|
|
304
|
+
.filter((e) => e.isDirectory() && e.name !== 'dist' && e.name !== 'scripts' && e.name !== 'node_modules' && !e.name.startsWith('.'))
|
|
305
|
+
.map((e) => e.name);
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
return exports.wowokSkills.skills;
|
|
309
|
+
}
|
|
310
|
+
for (const name of entries) {
|
|
311
|
+
const file = path.join(root, name, 'SKILL.md');
|
|
312
|
+
if (!fs.existsSync(file))
|
|
313
|
+
continue;
|
|
314
|
+
const compiledEntry = compiled.get(name);
|
|
315
|
+
let fm = {};
|
|
316
|
+
try {
|
|
317
|
+
fm = parseFrontmatter(fs.readFileSync(file, 'utf-8'));
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
fm = {};
|
|
321
|
+
}
|
|
322
|
+
const role = VALID_ROLES.includes(fm.role)
|
|
323
|
+
? fm.role
|
|
324
|
+
: compiledEntry?.role ?? 'shared';
|
|
325
|
+
const loading = fm.always === true || fm.always === 'true' || fm.loading === 'always'
|
|
326
|
+
? 'always'
|
|
327
|
+
: compiledEntry?.loading ?? 'on-demand';
|
|
328
|
+
merged.push({
|
|
329
|
+
name,
|
|
330
|
+
description: typeof fm.description === 'string' && fm.description.trim()
|
|
331
|
+
? fm.description.trim().replace(/\s+/g, ' ')
|
|
332
|
+
: compiledEntry?.description ?? '',
|
|
333
|
+
version: typeof fm.version === 'string' ? fm.version : compiledEntry?.version ?? '1.0.0',
|
|
334
|
+
role,
|
|
335
|
+
loading,
|
|
336
|
+
related: coerceRelated(fm.related) ?? compiledEntry?.related ?? [],
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
// Keep compiled-only entries that have no folder (defensive; normally all
|
|
340
|
+
// compiled skills have folders).
|
|
341
|
+
for (const s of exports.wowokSkills.skills) {
|
|
342
|
+
if (!merged.some((m) => m.name === s.name))
|
|
343
|
+
merged.push(s);
|
|
344
|
+
}
|
|
345
|
+
return merged;
|
|
346
|
+
}
|
|
347
|
+
/** Runtime skill list — fresh within the TTL (default 3s), disk-authoritative. */
|
|
348
|
+
function runtimeSkills() {
|
|
349
|
+
const now = Date.now();
|
|
350
|
+
if (!runtimeCache || now - runtimeAt > RUNTIME_SCAN_TTL_MS) {
|
|
351
|
+
runtimeCache = scanSkillDirectories();
|
|
352
|
+
runtimeAt = now;
|
|
353
|
+
}
|
|
354
|
+
return runtimeCache;
|
|
355
|
+
}
|
|
184
356
|
/**
|
|
185
357
|
* Get all skills
|
|
186
358
|
*/
|
|
187
359
|
function getSkills() {
|
|
188
|
-
return
|
|
360
|
+
return runtimeSkills();
|
|
189
361
|
}
|
|
190
362
|
/**
|
|
191
363
|
* Get skill by name
|
|
192
364
|
*/
|
|
193
365
|
function getSkillByName(name) {
|
|
194
|
-
return
|
|
366
|
+
return runtimeSkills().find(skill => skill.name === name);
|
|
195
367
|
}
|
|
196
368
|
/**
|
|
197
369
|
* Get skills by role
|
|
198
370
|
*/
|
|
199
371
|
function getSkillsByRole(role) {
|
|
200
|
-
return
|
|
372
|
+
return runtimeSkills().filter(skill => skill.role === role);
|
|
201
373
|
}
|
|
202
374
|
/**
|
|
203
375
|
* Get skills by loading mode
|
|
204
376
|
*/
|
|
205
377
|
function getSkillsByLoading(mode) {
|
|
206
|
-
return
|
|
378
|
+
return runtimeSkills().filter(skill => skill.loading === mode);
|
|
207
379
|
}
|
|
208
380
|
/**
|
|
209
381
|
* Get role-based skill groupings for AI guidance
|
|
@@ -253,7 +425,7 @@ function getRoleSkills() {
|
|
|
253
425
|
* Note: Guard design / tool usage / safety / industry-mode questions are now
|
|
254
426
|
* served directly by the MCP knowledge layer (schema_query actions
|
|
255
427
|
* get_guard_design_patterns / get_tool_reference / get_safety_rules, and
|
|
256
|
-
*
|
|
428
|
+
* industry_pack_operation recommend_industry) — no skill installation required.
|
|
257
429
|
*/
|
|
258
430
|
function recommendSkills(intent) {
|
|
259
431
|
const lower = intent.toLowerCase();
|
|
@@ -332,7 +504,7 @@ function negotiateSkillMode(mcpVersion, skillVersion) {
|
|
|
332
504
|
* @returns array of { skill, version, mode } for all skills
|
|
333
505
|
*/
|
|
334
506
|
function negotiateAllSkills(mcpVersion) {
|
|
335
|
-
return
|
|
507
|
+
return runtimeSkills().map((s) => ({
|
|
336
508
|
skill: s.name,
|
|
337
509
|
version: s.version,
|
|
338
510
|
mode: negotiateSkillMode(mcpVersion, s.version),
|
package/dist/skills.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":";;;AA4LA,8BAEC;AAKD,wCAEC;AAKD,0CAEC;AAKD,gDAEC;AAKD,sCAsCC;AAWD,0CA0CC;AAsBD,gDAYC;AAWD,gDAUC;AAkBD,kDAyBC;AAnZD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;GAIG;AACU,QAAA,iBAAiB,GAAG;IAC/B,cAAc;IACd,aAAa;IACb,gBAAgB;IAChB,aAAa;CACL,CAAC;AAIX,gFAAgF;AACnE,QAAA,mBAAmB,GAAoC;IAClE,cAAc,EAAE,6FAA6F;IAC7G,aAAa,EAAE,8CAA8C;IAC7D,gBAAgB,EAAE,8GAA8G;IAChI,aAAa,EAAE,sFAAsF;CACtG,CAAC;AAEW,QAAA,WAAW,GAAgB;IACtC,MAAM,EAAE;QACN,wBAAwB;QACxB;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,sKAAsK;YACnL,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;SACnE;QAED,wBAAwB;QACxB;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,kRAAkR;YAC/R,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC;SAC9C;QACD;YACE,I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yB;IAK3D,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC7C,yBAAuC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACrD,CAAC;IAEF,MAAM,iBAAiB,GAA2B,EAAE,CAAC;IACrD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,iBAAiB,CAAC,CAAC,CAAC,GAAG,2BAAmB,CAAC,CAAoB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,UAAU;QACV,iBAAiB;QACjB,OAAO,EACL,UAAU,CAAC,MAAM,GAAG,CAAC;YACnB,CAAC,CAAC,WAAW,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,kDAAkD;gBAClF,oFAAoF;gBACpF,kCAAkC;gBAClC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,2BAAmB,CAAC,CAAoB,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC7F,CAAC,CAAC,EAAE;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -8,7 +8,7 @@ A complete e-commerce example demonstrating how to build an online store using W
|
|
|
8
8
|
|
|
9
9
|
> **Run the example in full every time (repeatable).** This example uses `replaceExistName: true` on all object creations — each run generates new objects with new addresses. If you skip build steps, operations may silently act on orphaned objects from previous runs, producing incorrect results. Old objects' configurations do not reflect the current document version.
|
|
10
10
|
|
|
11
|
-
- **Execution order**: Part 1 (Merchant Setup, Steps 1–
|
|
11
|
+
- **Execution order**: Part 1 (Merchant Setup, Steps 1–8) → Part 2 (Customer Flow, Steps 1–9). Run all build steps in sequence before testing any customer flow. Do not skip steps — each depends on objects created by prior steps.
|
|
12
12
|
- **Prerequisites**: `myshop_merchant` with sufficient WOW for gas and order operations. All on-chain operations require `env.confirmed: true`.
|
|
13
13
|
|
|
14
14
|
> **💡 Call Format**: All WoWok operations go through a single unified `wowok` tool. The AI calls `wowok({ tool: "<sub-tool>", data: {<params>} })`. If parameters don't match the schema, the response includes the correct schema for self-correction. See [Response Format](../../docs/response-format.md) for details.
|
|
@@ -465,11 +465,53 @@ Create a Contact object to enable encrypted communication between customers and
|
|
|
465
465
|
|
|
466
466
|
---
|
|
467
467
|
|
|
468
|
-
### Step 5: Create
|
|
468
|
+
### Step 5: Create Service (Store) DRAFT
|
|
469
469
|
|
|
470
|
-
|
|
470
|
+
> **⚠️ Order matters — Service DRAFT must be created BEFORE the Guards.** The Guards in Step 6 reference the Service by name (`myshop_service_v2` as an Address table value). The SDK resolves the name to the on-chain address AT Guard creation time. If the Service does not exist yet, Guard creation aborts with:
|
|
471
|
+
> ```
|
|
472
|
+
> Error: invalid parameter:BCS serialization failed: ... failed to resolve string: myshop_service_v2. Address may not exist in local accounts or marks.
|
|
473
|
+
> ```
|
|
474
|
+
> Create the Service as an unpublished DRAFT here so the name resolves, then bind machine/allocators/sales and publish it in Step 7.
|
|
471
475
|
|
|
472
|
-
|
|
476
|
+
**Prompt**: Create an unpublished Service DRAFT named "myshop_service_v2" (no `publish` field — it stays a DRAFT so Guards can reference it and the mutable fields can still be configured).
|
|
477
|
+
|
|
478
|
+
```json
|
|
479
|
+
{
|
|
480
|
+
"tool": "onchain_operations",
|
|
481
|
+
"data": {
|
|
482
|
+
"operation_type": "service",
|
|
483
|
+
"data": {
|
|
484
|
+
"object": {
|
|
485
|
+
"name": "myshop_service_v2",
|
|
486
|
+
"type_parameter": "0x2::wow::WOW",
|
|
487
|
+
"permission": "myshop_permission_v2",
|
|
488
|
+
"tags": ["ecommerce", "toys", "store"],
|
|
489
|
+
"onChain": false,
|
|
490
|
+
"replaceExistName": true
|
|
491
|
+
},
|
|
492
|
+
"description": "MyShop - Top quality toys for children",
|
|
493
|
+
"location": "Online Store"
|
|
494
|
+
},
|
|
495
|
+
"env": {
|
|
496
|
+
"account": "myshop_merchant",
|
|
497
|
+
"network": "mainnet",
|
|
498
|
+
"confirmed": true
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
> **Note**: After publishing, `machine`, `order_allocators`, and `arbitrations` become **immutable**. Creating the draft first lets the Guards resolve the Service name while the Service is still configurable.
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
508
|
+
### Step 6: Create Guards for Fund Allocation
|
|
509
|
+
|
|
510
|
+
Before publishing the Service, create Guards that validate fund allocation conditions. These Guards ensure funds are only released when specific conditions are met. The Guards reference the Service DRAFT by name (`myshop_service_v2`), which now resolves to the draft's on-chain address (the address does NOT change when the draft is later published).
|
|
511
|
+
|
|
512
|
+
> **Note**: Guard table item `name` must be ≤ 64 characters (`MAX_NAME_LENGTH`) and must NOT start with `0x`. Descriptive names with spaces/parentheses (e.g. `order_address (Order object submitted at runtime)`) exceed the limit and abort with `invalid parameter:table.name`. Use short identifiers like `order_address`.
|
|
513
|
+
|
|
514
|
+
#### 6.1 Create Withdraw Guard (Merchant Withdrawal)
|
|
473
515
|
|
|
474
516
|
Create a Guard that validates the order's Progress has reached the "Completed" node. This Guard uses `convert_witness: "OrderProgress"` (TypeOrderProgress) to query the Order's associated Progress object.
|
|
475
517
|
|
|
@@ -493,28 +535,28 @@ Create a Guard that validates the order's Progress has reached the "Completed" n
|
|
|
493
535
|
"identifier": 0,
|
|
494
536
|
"b_submission": true,
|
|
495
537
|
"value_type": "Address",
|
|
496
|
-
"name": "order_address
|
|
538
|
+
"name": "order_address"
|
|
497
539
|
},
|
|
498
540
|
{
|
|
499
541
|
"identifier": 1,
|
|
500
542
|
"b_submission": false,
|
|
501
543
|
"value_type": "String",
|
|
502
544
|
"value": "Completed",
|
|
503
|
-
"name": "
|
|
545
|
+
"name": "expected_node"
|
|
504
546
|
},
|
|
505
547
|
{
|
|
506
548
|
"identifier": 2,
|
|
507
549
|
"b_submission": false,
|
|
508
550
|
"value_type": "Address",
|
|
509
551
|
"value": "myshop_merchant",
|
|
510
|
-
"name": "
|
|
552
|
+
"name": "merchant_address"
|
|
511
553
|
},
|
|
512
554
|
{
|
|
513
555
|
"identifier": 3,
|
|
514
556
|
"b_submission": false,
|
|
515
557
|
"value_type": "Address",
|
|
516
558
|
"value": "myshop_service_v2",
|
|
517
|
-
"name": "
|
|
559
|
+
"name": "service_address"
|
|
518
560
|
}
|
|
519
561
|
],
|
|
520
562
|
"root": {
|
|
@@ -594,7 +636,7 @@ Create a Guard that validates the order's Progress has reached the "Completed" n
|
|
|
594
636
|
>
|
|
595
637
|
> **Note**: The Guard `root` field directly specifies the GuardNode (e.g., `type: "logic_and"`), not wrapped in a `type: "node"` object.
|
|
596
638
|
|
|
597
|
-
####
|
|
639
|
+
#### 6.2 Create Refund Guard (Customer Refund)
|
|
598
640
|
|
|
599
641
|
Create a Guard for customer refunds when order is cancelled.
|
|
600
642
|
|
|
@@ -618,21 +660,21 @@ Create a Guard for customer refunds when order is cancelled.
|
|
|
618
660
|
"identifier": 0,
|
|
619
661
|
"b_submission": true,
|
|
620
662
|
"value_type": "Address",
|
|
621
|
-
"name": "order_address
|
|
663
|
+
"name": "order_address"
|
|
622
664
|
},
|
|
623
665
|
{
|
|
624
666
|
"identifier": 1,
|
|
625
667
|
"b_submission": false,
|
|
626
668
|
"value_type": "String",
|
|
627
669
|
"value": "Cancelled",
|
|
628
|
-
"name": "
|
|
670
|
+
"name": "expected_node"
|
|
629
671
|
},
|
|
630
672
|
{
|
|
631
673
|
"identifier": 2,
|
|
632
674
|
"b_submission": false,
|
|
633
675
|
"value_type": "Address",
|
|
634
676
|
"value": "myshop_service_v2",
|
|
635
|
-
"name": "
|
|
677
|
+
"name": "service_address"
|
|
636
678
|
}
|
|
637
679
|
],
|
|
638
680
|
"root": {
|
|
@@ -717,13 +759,13 @@ Create a Guard for customer refunds when order is cancelled.
|
|
|
717
759
|
|
|
718
760
|
---
|
|
719
761
|
|
|
720
|
-
### Step
|
|
762
|
+
### Step 7: Publish Service (Store)
|
|
721
763
|
|
|
722
|
-
|
|
764
|
+
Bind all previously created components (machine, Guards, products, after-sales contact) to the Service DRAFT created in Step 5, then publish it. The Service address stays the same as the DRAFT, so the Guards' `service_address` table values remain valid.
|
|
723
765
|
|
|
724
|
-
> **Important**:
|
|
766
|
+
> **Important**: Provide a complete configuration including machine, order_allocators with Guards, and products. The Service is published in a single transaction. After publish, `machine`, `order_allocators`, and `arbitrations` become immutable.
|
|
725
767
|
|
|
726
|
-
####
|
|
768
|
+
#### 7.1 Understanding Order Allocators
|
|
727
769
|
|
|
728
770
|
The `order_allocators` configuration defines how order payments are distributed:
|
|
729
771
|
|
|
@@ -747,9 +789,9 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
747
789
|
|
|
748
790
|
> **Design Decision — Refund Recipient**: When using `{ "GuardIdentifier": 0 }` in the refund allocation, the refund is sent to the **Order object's on-chain address** (not the customer's wallet address). This is by design: the Order object acts as an escrow holding the refunded payment at its own address. The customer subsequently claims the refund from the Order object via a separate withdraw operation. This two-step design ensures the refund is traceable on-chain and tied to the specific order, providing better dispute resolution and audit trail.
|
|
749
791
|
|
|
750
|
-
####
|
|
792
|
+
#### 7.2 Publish Service (bind machine + allocators + sales + um)
|
|
751
793
|
|
|
752
|
-
**Prompt**:
|
|
794
|
+
**Prompt**: Publish the Service DRAFT "myshop_service_v2" (created in Step 5) by binding machine "myshop_machine_v2", order allocation using the Guards, after-sales contact, and toy products. Note `object` is now a STRING reference to the existing draft, and `publish: true` is set.
|
|
753
795
|
|
|
754
796
|
```json
|
|
755
797
|
{
|
|
@@ -757,16 +799,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
757
799
|
"data": {
|
|
758
800
|
"operation_type": "service",
|
|
759
801
|
"data": {
|
|
760
|
-
"object":
|
|
761
|
-
"name": "myshop_service_v2",
|
|
762
|
-
"type_parameter": "0x2::wow::WOW",
|
|
763
|
-
"permission": "myshop_permission_v2",
|
|
764
|
-
"tags": ["ecommerce", "toys", "store"],
|
|
765
|
-
"onChain": false,
|
|
766
|
-
"replaceExistName": true
|
|
767
|
-
},
|
|
768
|
-
"description": "MyShop - Top quality toys for children",
|
|
769
|
-
"location": "Online Store",
|
|
802
|
+
"object": "myshop_service_v2",
|
|
770
803
|
"machine": "myshop_machine_v2",
|
|
771
804
|
"order_allocators": {
|
|
772
805
|
"description": "Order revenue allocation - merchant withdraw after completion",
|
|
@@ -802,7 +835,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
802
835
|
"price": 50000000,
|
|
803
836
|
"stock": 100,
|
|
804
837
|
"suspension": false,
|
|
805
|
-
"wip": "https://
|
|
838
|
+
"wip": "https://raw.githubusercontent.com/wowok-ai/docs/main/wip-examples/three_body.wip",
|
|
806
839
|
"wip_hash": ""
|
|
807
840
|
},
|
|
808
841
|
{
|
|
@@ -810,7 +843,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
810
843
|
"price": 50000000,
|
|
811
844
|
"stock": 50,
|
|
812
845
|
"suspension": false,
|
|
813
|
-
"wip": "https://
|
|
846
|
+
"wip": "https://raw.githubusercontent.com/wowok-ai/docs/main/wip-examples/three_body.wip",
|
|
814
847
|
"wip_hash": ""
|
|
815
848
|
},
|
|
816
849
|
{
|
|
@@ -818,7 +851,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
818
851
|
"price": 30000000,
|
|
819
852
|
"stock": 75,
|
|
820
853
|
"suspension": false,
|
|
821
|
-
"wip": "https://
|
|
854
|
+
"wip": "https://raw.githubusercontent.com/wowok-ai/docs/main/wip-examples/three_body.wip",
|
|
822
855
|
"wip_hash": ""
|
|
823
856
|
}
|
|
824
857
|
]
|
|
@@ -842,7 +875,7 @@ The `order_allocators` configuration defines how order payments are distributed:
|
|
|
842
875
|
|
|
843
876
|
---
|
|
844
877
|
|
|
845
|
-
### Step
|
|
878
|
+
### Step 8: Update Product Pricing (Optional)
|
|
846
879
|
|
|
847
880
|
To offer promotional pricing, update product prices using the `sales` operation with `op: "set"`:
|
|
848
881
|
|
|
@@ -863,7 +896,7 @@ To offer promotional pricing, update product prices using the `sales` operation
|
|
|
863
896
|
"price": 40000000,
|
|
864
897
|
"stock": 100,
|
|
865
898
|
"suspension": false,
|
|
866
|
-
"wip": "https://
|
|
899
|
+
"wip": "https://raw.githubusercontent.com/wowok-ai/docs/main/wip-examples/three_body.wip",
|
|
867
900
|
"wip_hash": ""
|
|
868
901
|
}
|
|
869
902
|
]
|
|
@@ -963,7 +996,7 @@ Customer creates an order by purchasing products from the Service.
|
|
|
963
996
|
{
|
|
964
997
|
"name": "Play Purse Set 35PCS",
|
|
965
998
|
"stock": 1,
|
|
966
|
-
"wip_hash": "
|
|
999
|
+
"wip_hash": "<wip_hash captured from Step 1 query>"
|
|
967
1000
|
}
|
|
968
1001
|
],
|
|
969
1002
|
"total_pay": {
|
|
@@ -1691,7 +1724,7 @@ Create a new order for testing the arbitration flow (if you don't have one alrea
|
|
|
1691
1724
|
{
|
|
1692
1725
|
"name": "Tree House Building Set",
|
|
1693
1726
|
"stock": 1,
|
|
1694
|
-
"wip_hash": "
|
|
1727
|
+
"wip_hash": "<wip_hash captured from Step 1 query>"
|
|
1695
1728
|
}
|
|
1696
1729
|
],
|
|
1697
1730
|
"total_pay": {"balance": 30000000}
|