@wowok/agent-mcp 2.5.3 → 2.5.5
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 +33 -26
- package/dist/customer/index.d.ts +2 -2
- package/dist/customer/index.js +1 -1
- package/dist/customer/info-puzzle.d.ts +39 -2
- package/dist/customer/info-puzzle.js +370 -29
- package/dist/customer/risk-assessment.js +51 -14
- package/dist/customer/types.d.ts +85 -0
- package/dist/knowledge/machine-ledger.js +32 -29
- package/dist/knowledge/machine-risk.js +23 -0
- package/dist/knowledge/machine-templates.js +118 -86
- package/dist/knowledge/reward-confirm.d.ts +3 -0
- package/dist/knowledge/reward-confirm.js +30 -0
- package/dist/knowledge/reward-puzzle.d.ts +1 -0
- package/dist/knowledge/reward-puzzle.js +12 -0
- package/dist/knowledge/reward-risk.d.ts +4 -1
- package/dist/knowledge/reward-risk.js +85 -3
- package/dist/knowledge/reward-templates.d.ts +1 -1
- package/dist/knowledge/reward-templates.js +77 -5
- package/dist/knowledge/tools-reference.js +5 -4
- package/dist/knowledge/trust-metrics.d.ts +4 -0
- package/dist/knowledge/trust-metrics.js +67 -7
- package/dist/project/evaluation.d.ts +53 -0
- package/dist/project/evaluation.js +853 -0
- package/dist/project/graph-builder.d.ts +43 -0
- package/dist/project/graph-builder.js +572 -0
- package/dist/project/handlers.d.ts +152 -0
- package/dist/project/handlers.js +458 -0
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +24 -1
- package/dist/project/query.d.ts +1 -0
- package/dist/project/query.js +2 -0
- package/dist/project/semantic-assembler.d.ts +93 -0
- package/dist/project/semantic-assembler.js +345 -0
- package/dist/schema/call/arbitration.d.ts +54 -54
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/demand.d.ts +48 -48
- package/dist/schema/operations.d.ts +76 -76
- package/dist/schema/project/index.d.ts +1558 -3885
- package/dist/schema/project/index.js +357 -961
- package/dist/schema/trust/index.d.ts +24 -24
- package/dist/schemas/bridge_operation.schema.json +1 -1
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +2 -2
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/onchain_operations.schema.json +5 -5
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
- package/dist/schemas/onchain_operations_contact.schema.json +1 -1
- package/dist/schemas/onchain_operations_demand.schema.json +1 -1
- package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +1 -1
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_permission.schema.json +1 -1
- package/dist/schemas/onchain_operations_personal.schema.json +1 -1
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1
- package/dist/schemas/onchain_operations_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_repository.schema.json +1 -1
- package/dist/schemas/onchain_operations_reward.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +1 -1
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
- package/dist/schemas/project_operation.output.json +975 -2471
- package/dist/schemas/project_operation.schema.json +207 -534
- package/dist/tools/handlers/onchain.js +97 -19
- package/dist/tools/handlers/project.js +34 -1046
- package/dist/tools/index.js +84 -55
- package/package.json +2 -2
package/dist/tools/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export const TOOL_REGISTRY = [
|
|
|
32
32
|
handler: handleOnchainOperations,
|
|
33
33
|
config: {
|
|
34
34
|
title: "⛓️ On-chain Operations",
|
|
35
|
-
description: "On-chain operations for WoWok object: service (marketplace listings), machine (workflow templates), progress (order tracking), repository (on-chain database), arbitration (dispute resolution), contact (IM management), treasury (team funds), reward (incentive pools), allocation (auto-distribution), permission (access control), guard (programmable trust rules), personal (public profile), payment (direct coin transfers), demand (service requests), order (order management), gen_passport (verified credentials), proof (on-chain proof objects), gen_proof (generate proof shortcut).\n\n💡 Schema hint: Use schema_query with action='get' and name='onchain_operations' to retrieve the complete parameter schema. For individual operation schemas (e.g., 'onchain_operations_permission'), use schema_query with action='list_operations' to see all available operation schemas.",
|
|
35
|
+
description: "On-chain operations for WoWok object: service (marketplace listings), machine (workflow templates), progress (order tracking), repository (on-chain database), arbitration (dispute resolution), contact (IM management), treasury (team funds), reward (incentive pools), allocation (auto-distribution), permission (access control), guard (programmable trust rules), personal (public profile), payment (direct coin transfers), demand (service requests), order (order management), gen_passport (verified credentials), proof (on-chain proof objects), gen_proof (generate proof shortcut).\n\n📌 Project association: Pass env.project='<prefix>' to auto-tag the object on-chain AND auto-associate it to the SQLite project (created objects are automatically added). For complex builds, create a project first (project_operation action='create_project'). For single objects, just pass env.project. See PROJECT ASSOCIATION POLICY in system prompt.\n\n💡 Schema hint: Use schema_query with action='get' and name='onchain_operations' to retrieve the complete parameter schema. For individual operation schemas (e.g., 'onchain_operations_permission'), use schema_query with action='list_operations' to see all available operation schemas.",
|
|
36
36
|
inputSchema: OnchainOperationsSchema,
|
|
37
37
|
outputSchema: CallOutputSchema,
|
|
38
38
|
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
@@ -259,57 +259,43 @@ export const TOOL_REGISTRY = [
|
|
|
259
259
|
name: "project_operation",
|
|
260
260
|
handler: handleProjectOperation,
|
|
261
261
|
config: {
|
|
262
|
-
title: "🗂️ Project -
|
|
263
|
-
description: "Project
|
|
264
|
-
"
|
|
265
|
-
"
|
|
262
|
+
title: "🗂️ Project - Entity Management & Evaluation",
|
|
263
|
+
description: "Project management service — manage projects as first-class entities with SQLite persistence, " +
|
|
264
|
+
"rigid project-object relationships, three-pathway graph construction, and a dual rule-based + " +
|
|
265
|
+
"LLM-assisted evaluation engine.\n\n" +
|
|
266
|
+
"📌 Project policy: Complex builds → auto-create project first + check for similar projects. " +
|
|
267
|
+
"Single object → remind user to add to a project. " +
|
|
268
|
+
"Consumer → create_project_from_onchain + evaluate before buying.\n\n" +
|
|
266
269
|
"═══════════════════════════════════════════════════════════════\n" +
|
|
267
|
-
" PROJECT
|
|
270
|
+
" PROJECT ENTITY + EVALUATION (15 actions, GLM6)\n" +
|
|
268
271
|
"═══════════════════════════════════════════════════════════════\n" +
|
|
269
|
-
"
|
|
270
|
-
"
|
|
271
|
-
"
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
"
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
" → 0 D-errors required before Stage 5.\n" +
|
|
285
|
-
" Stage 5: Substep Trace (action='trace_substeps')\n" +
|
|
286
|
-
" → Input: substeps (from deployment doc), network (testnet/mainnet).\n" +
|
|
287
|
-
" → Output: coherence check, D-10 substep linkage, can_proceed.\n" +
|
|
288
|
-
" → Execute each substep via onchain_operations, record outcomes.\n\n" +
|
|
289
|
-
" Status Query (action='get_project_status')\n" +
|
|
290
|
-
" → Input: project, version.\n" +
|
|
291
|
-
" → Output: current stage (1-5), stage_name, next_action, can_proceed.\n" +
|
|
292
|
-
" → Call anytime to check which stage the project is in and what to do next.\n\n" +
|
|
293
|
-
"Correct object creation order (topological): Permission → Allocation → Guard → Machine → Service.\n" +
|
|
294
|
-
"All objects created as draft (publish=false) first; publish Machine before Service (last).\n\n" +
|
|
272
|
+
" • list_projects — List all projects (with object count + types). Supports filter_status, filter_perspective, filter_network.\n" +
|
|
273
|
+
" • create_project — Create a new project (producer/consumer/both, bound to a network).\n" +
|
|
274
|
+
" • create_project_from_onchain — Create a consumer project from an on-chain Service address (auto-discovers objects + graph).\n" +
|
|
275
|
+
" • update_project — Update project metadata, status, labels, service address, etc.\n" +
|
|
276
|
+
" • get_project_detail — Get full project detail (objects, graph edges, evaluations, versions).\n" +
|
|
277
|
+
" • add_object — Add an on-chain object to a project (by address or LocalMark name).\n" +
|
|
278
|
+
" • remove_object — Remove an object from a project.\n" +
|
|
279
|
+
" • create_version — Create a project version (e.g. 'v2') with optional fork from a source version.\n" +
|
|
280
|
+
" • build_graph — Build relationship graph via 3 pathways (internal refs, Registrar, potential). Configurable depth.\n" +
|
|
281
|
+
" • get_graph — Get persisted graph edges.\n" +
|
|
282
|
+
" • evaluate_project — Evaluate project (risk/trust/completeness = rule-based; value/worth_buying = LLM-assisted with prompt).\n" +
|
|
283
|
+
" • save_evaluation — Save an LLM-produced evaluation result.\n" +
|
|
284
|
+
" • compare_projects — Compare multiple projects by evaluation type.\n" +
|
|
285
|
+
" • refresh_objects — Refresh object cache from chain (batch query, rate-limited).\n" +
|
|
286
|
+
" • get_object_diff — Get field-level diff of an object between two timestamps.\n\n" +
|
|
295
287
|
"═══════════════════════════════════════════════════════════════\n" +
|
|
296
|
-
"
|
|
288
|
+
" CONTEXT ASSEMBLY (1 action)\n" +
|
|
297
289
|
"═══════════════════════════════════════════════════════════════\n" +
|
|
298
|
-
" •
|
|
299
|
-
"
|
|
300
|
-
"
|
|
301
|
-
"
|
|
302
|
-
" • referenced_by — Reverse query: who references this object?\n" +
|
|
303
|
-
" • pre_publish_check — Pre-publish sanity check (dangling deps + cycles).\n" +
|
|
304
|
-
" • cross_project_refs — Find edges crossing project boundaries.\n" +
|
|
305
|
-
" • graph_stats — Graph statistics (node/edge counts, cycles, dangling deps).\n" +
|
|
306
|
-
" • save_graph — Save graph to ~/.wowok/project-graph.json.\n" +
|
|
307
|
-
" • load_graph — Load graph from file (restore after restart).\n\n" +
|
|
290
|
+
" • assemble_context — Query on-chain object states + extract embedded history + optional events, " +
|
|
291
|
+
"and assemble a structured semantic context for LLM consumption. Required: context_objects (array of IDs/names).\n\n" +
|
|
292
|
+
"Correct object creation order (topological): Permission → Allocation → Guard → Machine → Service.\n" +
|
|
293
|
+
"All objects created as draft (publish=false) first; publish Machine before Service (last).\n\n" +
|
|
308
294
|
"💡 Schema hint: Use schema_query with action='get' and name='project_operation' for exact field definitions.",
|
|
309
295
|
inputSchema: ProjectOperationInputSchema,
|
|
310
296
|
outputSchema: ProjectOperationOutputSchema,
|
|
311
297
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
312
|
-
_meta: createToolMeta("project", ["project", "
|
|
298
|
+
_meta: createToolMeta("project", ["project", "entity", "sqlite", "graph", "evaluation", "risk", "trust", "completeness", "worth_buying", "registrar", "diff", "version", "context", "assembly"]),
|
|
313
299
|
},
|
|
314
300
|
},
|
|
315
301
|
{
|
|
@@ -329,7 +315,7 @@ export const TOOL_REGISTRY = [
|
|
|
329
315
|
" • info — Get detailed info about a service (requires `service` param).\n\n" +
|
|
330
316
|
"Services:\n" +
|
|
331
317
|
" • confirm_gate — Safety Confirmation Gate (default ON)\n" +
|
|
332
|
-
" • project_service —
|
|
318
|
+
" • project_service — On-chain project tag auto-injection (default ON). When ON, objects created via onchain_operations are auto-tagged with project:<prefix> for on-chain grouping. Use project_operation for SQLite-based project management (evaluation, graph, versioning).\n" +
|
|
333
319
|
" • harness — L4 Verify/Recover Loop (default OFF)\n" +
|
|
334
320
|
" • graph_persist — Graph Persistence to File (default OFF)\n" +
|
|
335
321
|
" • semantic_rich — Semantic Layer Enrichment Reminder (default ON)\n" +
|
|
@@ -417,7 +403,7 @@ const WOWOK_TOOL_DESCRIPTION = [
|
|
|
417
403
|
" wowok_buildin_info — Protocol constants, built-in permissions, bridge tokens.",
|
|
418
404
|
" schema_query — Query JSON schemas for any sub-tool (action: list/get/get_output/search).",
|
|
419
405
|
" bridge_operation — Cross-chain bridge between WOW and EVM (mainnet only).",
|
|
420
|
-
" project_operation —
|
|
406
|
+
" project_operation — Project entity management (SQLite) + 3-pathway graph + evaluation engine.",
|
|
421
407
|
" config_operation — Runtime service toggles (confirm_gate, harness, etc.).",
|
|
422
408
|
" trust_score — Service trust/risk assessment (0-100 score, 5 dimensions).",
|
|
423
409
|
"",
|
|
@@ -438,16 +424,59 @@ const WOWOK_TOOL_DESCRIPTION = [
|
|
|
438
424
|
" 4. CACHE the schema in your context for future calls to the SAME sub-tool",
|
|
439
425
|
" You should only need to see each sub-tool's schema once per conversation.",
|
|
440
426
|
"",
|
|
441
|
-
"PROJECT
|
|
442
|
-
"
|
|
443
|
-
"
|
|
444
|
-
"
|
|
445
|
-
"
|
|
446
|
-
"
|
|
447
|
-
"
|
|
427
|
+
"PROJECT MANAGEMENT (SQLite-based):",
|
|
428
|
+
" project_operation action='list_projects' → list all projects with object counts",
|
|
429
|
+
" project_operation action='create_project' → create a new project (producer/consumer/both)",
|
|
430
|
+
" project_operation action='get_project_detail' → full project info (objects, graph, evaluations, versions)",
|
|
431
|
+
" project_operation action='build_graph' → build 3-pathway relationship graph",
|
|
432
|
+
" project_operation action='evaluate_project' → rule-based (risk/trust/completeness) or LLM-assisted (value/worth_buying)",
|
|
433
|
+
" project_operation action='assemble_context' → assemble semantic context for LLM consumption",
|
|
434
|
+
"",
|
|
435
|
+
"═══════════════════════════════════════════════════════════════",
|
|
436
|
+
"PROJECT ASSOCIATION POLICY (context-aware, read before build/buy):",
|
|
437
|
+
"═══════════════════════════════════════════════════════════════",
|
|
438
|
+
"",
|
|
439
|
+
"Projects are the core organizing unit for all WoWok workflows. The policy is context-aware:",
|
|
440
|
+
"",
|
|
441
|
+
"CASE 1 — COMPLEX REQUIREMENT (user wants to build/deploy a full service):",
|
|
442
|
+
" Examples: '搭建旅行地陪服务', '开一个玩具店', '创建租赁服务'",
|
|
443
|
+
" → You MUST auto-create a project FIRST, then create objects.",
|
|
444
|
+
" → Check for similar existing projects first: project_operation action='list_projects'",
|
|
445
|
+
" If similar projects exist (same industry), remind the user: '发现类似项目 X, 是否复用或新建?'",
|
|
446
|
+
" → Workflow:",
|
|
447
|
+
" 1. project_operation action='create_project' (perspective='producer', project_industry=<best match>)",
|
|
448
|
+
" 2. Create on-chain objects via onchain_operations with env.project='<prefix>' (auto-tags + auto-associates to SQLite project)",
|
|
449
|
+
" 3. After EACH creation, objects are auto-added to the project (via env.project)",
|
|
450
|
+
" 4. project_operation action='build_graph' — build 3-pathway relationship graph",
|
|
451
|
+
" 5. project_operation action='evaluate_project' (completeness → R1-R12 check, then risk)",
|
|
452
|
+
" 6. Report results, fix critical findings, then publish Service",
|
|
453
|
+
"",
|
|
454
|
+
"CASE 2 — SINGLE OBJECT CREATION (user wants one specific object):",
|
|
455
|
+
" Examples: '创建一个Permission', '添加一个Contact', '建一个Guard'",
|
|
456
|
+
" → Do NOT auto-create a project. If the user has an existing project, create with env.project='<prefix>' to auto-associate.",
|
|
457
|
+
" → If no existing project, after creation, REMIND the user:",
|
|
458
|
+
" '此对象已创建。建议将其加入一个项目以便管理: project_operation action=\"add_object\"",
|
|
459
|
+
" 如还没有项目, 可用 action=\"create_project\" 新建。现有项目: [list projects if any]'",
|
|
460
|
+
" → If the user then says 'yes, create a project' or 'add to project X', proceed accordingly.",
|
|
461
|
+
"",
|
|
462
|
+
"CASE 3 — CONSUMER FLOW (user wants to buy/evaluate a service):",
|
|
463
|
+
" → Suggest: project_operation action='create_project_from_onchain' (auto-discovers objects + graph)",
|
|
464
|
+
" → Then: project_operation action='evaluate_project' (risk → trust → worth_buying)",
|
|
465
|
+
" → Report findings, let user decide whether to proceed with onchain_operations service_buy",
|
|
466
|
+
"",
|
|
467
|
+
"CASE 4 — SIMPLE QUERY (user wants to check object info, balance, etc.):",
|
|
468
|
+
" → No project needed. Proceed directly with the query.",
|
|
448
469
|
"",
|
|
449
|
-
"
|
|
450
|
-
"
|
|
470
|
+
"INDUSTRY MATCHING (for create_project project_industry param):",
|
|
471
|
+
" travel → tour guides, transportation, accommodation, sightseeing",
|
|
472
|
+
" retail → shops, e-commerce, physical goods",
|
|
473
|
+
" service → professional services, consulting, design",
|
|
474
|
+
" rental → equipment rental, property rental",
|
|
475
|
+
" freelance → freelance work, gig economy",
|
|
476
|
+
" education → courses, training, tutoring",
|
|
477
|
+
" subscription → subscription services, memberships",
|
|
478
|
+
" general → fallback for unclear industry",
|
|
479
|
+
"═══════════════════════════════════════════════════════════════",
|
|
451
480
|
].join("\n");
|
|
452
481
|
function formatZodErrors(error) {
|
|
453
482
|
return error.issues.map(issue => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wowok/agent-mcp",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5",
|
|
4
4
|
"description": "Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"license": "Apache-2.0",
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
53
|
-
"@wowok/wowok": "2.5.
|
|
53
|
+
"@wowok/wowok": "2.5.5",
|
|
54
54
|
"lodash": "^4.18.1",
|
|
55
55
|
"zod": "^3.25.76",
|
|
56
56
|
"zod-to-json-schema": "^3.25.2"
|