@wowok/agent-mcp 2.2.11 → 2.2.13

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 (93) hide show
  1. package/dist/docs/index.d.ts +3 -0
  2. package/dist/docs/index.js +2 -0
  3. package/dist/docs/loader.d.ts +12 -0
  4. package/dist/docs/loader.js +177 -0
  5. package/dist/docs/search.d.ts +17 -0
  6. package/dist/docs/search.js +325 -0
  7. package/dist/docs/types.d.ts +55 -0
  8. package/dist/docs/types.js +1 -0
  9. package/dist/index.d.ts +12 -0
  10. package/dist/index.js +146 -39
  11. package/docs/README.md +249 -0
  12. package/docs/WIP.md +388 -0
  13. package/docs/WTS.md +536 -0
  14. package/docs/docs/account.md +914 -0
  15. package/docs/docs/allocation.md +635 -0
  16. package/docs/docs/arbitration.md +1804 -0
  17. package/docs/docs/arbitration_state_machine.md +270 -0
  18. package/docs/docs/contact.md +709 -0
  19. package/docs/docs/demand.md +948 -0
  20. package/docs/docs/guard.md +1465 -0
  21. package/docs/docs/localinfo.md +432 -0
  22. package/docs/docs/localmark.md +583 -0
  23. package/docs/docs/machine.md +2490 -0
  24. package/docs/docs/messenger.md +2098 -0
  25. package/docs/docs/onchain_events.md +267 -0
  26. package/docs/docs/order.md +1001 -0
  27. package/docs/docs/payment.md +512 -0
  28. package/docs/docs/permission.md +1438 -0
  29. package/docs/docs/personal.md +742 -0
  30. package/docs/docs/progress.md +1748 -0
  31. package/docs/docs/query.md +467 -0
  32. package/docs/docs/repository.md +1043 -0
  33. package/docs/docs/reward.md +833 -0
  34. package/docs/docs/service.md +2130 -0
  35. package/docs/docs/stage-01-introduction.md +243 -0
  36. package/docs/docs/stage-02-trust.md +302 -0
  37. package/docs/docs/stage-03-collaboration.md +337 -0
  38. package/docs/docs/stage-04-transaction.md +277 -0
  39. package/docs/docs/stage-05-business.md +151 -0
  40. package/docs/docs/stage-06-personal.md +203 -0
  41. package/docs/docs/stage-07-query.md +572 -0
  42. package/docs/docs/stage-08-examples.md +184 -0
  43. package/docs/docs/treasury.md +1149 -0
  44. package/docs/docs/wowok_buildin_info.md +740 -0
  45. package/docs/examples/Insurance/Insurance.md +594 -0
  46. package/docs/examples/Insurance/Insurance_TestResults.md +481 -0
  47. package/docs/examples/Insurance/insurance_complete_guard_v1.json +50 -0
  48. package/docs/examples/MyShop/MyShop.md +1353 -0
  49. package/docs/examples/MyShop/MyShop_TestResults.md +1003 -0
  50. package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
  51. package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
  52. package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
  53. package/docs/examples/MyShop_Advanced/machine_nodes.json +222 -0
  54. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
  55. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
  56. package/docs/examples/Travel/Travel.md +1157 -0
  57. package/docs/examples/Travel/Travel_TestResults.md +743 -0
  58. package/docs/examples/Travel/calc-weather-timestamps.js +8 -0
  59. package/docs/examples/Travel/travel_machine_v2_export.json +104 -0
  60. package/docs/examples/Travel/weather_check_guard_v1.json +51 -0
  61. package/docs/skills/WOWOK.md +650 -0
  62. package/docs/skills/onchain_operations/_common.md +406 -0
  63. package/docs/skills/onchain_operations/_index.md +196 -0
  64. package/docs/skills/onchain_operations/allocation.md +28 -0
  65. package/docs/skills/onchain_operations/arbitration.md +106 -0
  66. package/docs/skills/onchain_operations/contact.md +40 -0
  67. package/docs/skills/onchain_operations/demand.md +53 -0
  68. package/docs/skills/onchain_operations/gen_passport.md +23 -0
  69. package/docs/skills/onchain_operations/guard.md +56 -0
  70. package/docs/skills/onchain_operations/machine.md +89 -0
  71. package/docs/skills/onchain_operations/order.md +56 -0
  72. package/docs/skills/onchain_operations/payment.md +24 -0
  73. package/docs/skills/onchain_operations/permission.md +68 -0
  74. package/docs/skills/onchain_operations/personal.md +58 -0
  75. package/docs/skills/onchain_operations/progress.md +38 -0
  76. package/docs/skills/onchain_operations/repository.md +70 -0
  77. package/docs/skills/onchain_operations/reward.md +38 -0
  78. package/docs/skills/onchain_operations/service.md +78 -0
  79. package/docs/skills/onchain_operations/treasury.md +68 -0
  80. package/docs/skills/schema-account_operation.md +402 -0
  81. package/docs/skills/schema-guard2file.md +153 -0
  82. package/docs/skills/schema-local_info_operation.md +160 -0
  83. package/docs/skills/schema-local_mark_operation.md +148 -0
  84. package/docs/skills/schema-machineNode2file.md +155 -0
  85. package/docs/skills/schema-messenger_operation.md +547 -0
  86. package/docs/skills/schema-onchain_events.md +201 -0
  87. package/docs/skills/schema-onchain_table_data.md +334 -0
  88. package/docs/skills/schema-query_toolkit.md +395 -0
  89. package/docs/skills/schema-wip_file.md +240 -0
  90. package/docs/skills/schema-wowok_buildin_info.md +296 -0
  91. package/docs/wip-examples/three_body.html +57 -0
  92. package/docs/wip-examples/three_body.wip +30 -0
  93. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -6,7 +6,8 @@ import { readFileSync } from "fs";
6
6
  import { resolve } from "path";
7
7
  const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
8
8
  import { CallService_DataSchema, CallMachine_DataSchema, MachineNode2File_InputSchema, MachineNode2File_OutputWrappedSchema, CallProgress_DataSchema, CallPermission_DataSchema, CallGuard_DataSchema, Guard2File_InputSchema, Guard2File_OutputWrappedSchema, CallArbitration_DataSchema, CallRepository_DataSchema, CallContact_DataSchema, CallTreasury_DataSchema, CallReward_DataSchema, CallAllocation_DataSchema, CallPersonal_DataSchema, CallPayment_DataSchema, CallDemand_DataSchema, CallOrder_DataSchema, CallEnvSchema, SubmissionCallSchema, strictParse, CallOutputSchema, handleCallResult, createServerConfig, createCapabilitiesConfig, createToolMeta, transformSubmission, getEnvConfig, WipGenerationOptionsSchema, WipToHtmlOptionsSchema, TokenDataFilterSchema, LocalInfoFilterSchema, LocalMarkFilterSchema, AccountFilterSchema, TokenTypeSchema, OnchainEventsInputSchema, OnchainEventsResultSchema, ProtocolInfoQuerySchema, ProtocolInfoResultSchema, TableAnswerSchema, TableItem_RepositoryDataSchema, TableItem_PermissionPermSchema, TableItem_EntityRegistrarSchema, TableItem_EntityLinkerSchema, TableItem_RewardRecordSchema, TableItem_DemandPresenterSchema, TableItem_TreasuryHistorySchema, TableItem_MachineNodeSchema, TableItem_ProgressHistorySchema, TableItem_AddressMarkSchema, NameOrAddressSchema, ObjectBaseSchema, AccountOrMark_AddressSchema, AccountOrMark_AddressAISchema, EntrypointSchema, AccountOperationOutputWrappedSchema, LocalMarkOperationOutputWrappedSchema, LocalInfoOperationOutputWrappedSchema, WipOperationOutputSchema, MessengerOperationOutputSchema, AccountOperationSchema, LocalMarkOperationSchema, LocalInfoOperationSchema, parseMachineNodesFromText, formatNodeErrors as formatMachineNodeErrors, MessengerOperationInputSchema, } from "./schema/index.js";
9
- import { CallService, CallMachine, CallProgress, CallPermission, CallGuard, CallArbitration, CallRepository, CallContact, CallTreasury, CallReward, CallAllocation, CallPersonal, CallPayment, CallDemand, CallOrder, gen_passport, guard2file, parseGuardFile, formatGuardParseErrors, machineNode2file, generateNodeComments, generate_wip, verify_wip, sign_wip, wip2html, account_operation, local_mark_operation, local_info_operation, watch_conversations, send_message, send_file, watch_messages, extract_zip_messages, generate_wts, verify_wts, sign_wts, wts2html, proof_message, mark_messages_as_viewed, mark_conversation_as_viewed, query_local_mark_list, query_account_list, query_local_info_list, query_local_token_list, query_account, query_personal, query_objects, query_table, query_tableItem, queryProtocolInfo, query_received, queryTableItem_RepositoryData, queryTableItem_PermissionPerm, queryTableItem_RewardRecord, queryTableItem_DemandPresenter, queryTableItem_TreasuryHistory, queryTableItem_MachineNode, queryTableItem_ProgressHistory, queryTableItem_AddressMark, queryTableItem_EntityRegistrar, queryTableItem_EntityLinker, query_events, blacklist, friendslist, guardlist, settings, AmountType, } from "@wowok/wowok";
9
+ import { CallService, CallMachine, CallProgress, CallPermission, CallGuard, CallArbitration, CallRepository, CallContact, CallTreasury, CallReward, CallAllocation, CallPersonal, CallPayment, CallDemand, CallOrder, gen_passport, guard2file, parseGuardFile, formatGuardParseErrors, machineNode2file, generateNodeComments, generate_wip, verify_wip, sign_wip, wip2html, account_operation, local_mark_operation, local_info_operation, watch_conversations, send_message, send_file, watch_messages, extract_zip_messages, generate_wts, verify_wts, sign_wts, wts2html, proof_message, mark_messages_as_viewed, mark_conversation_as_viewed, query_local_mark_list, query_account_list, query_local_info_list, query_local_token_list, query_account, GetLocalNamesByAddresses, query_personal, query_objects, query_table, query_tableItem, queryProtocolInfo, query_received, queryTableItem_RepositoryData, queryTableItem_PermissionPerm, queryTableItem_RewardRecord, queryTableItem_DemandPresenter, queryTableItem_TreasuryHistory, queryTableItem_MachineNode, queryTableItem_ProgressHistory, queryTableItem_AddressMark, queryTableItem_EntityRegistrar, queryTableItem_EntityLinker, query_events, blacklist, friendslist, guardlist, settings, AmountType, } from "@wowok/wowok";
10
+ import { loadAllDocuments, isDocumentationAvailable, getDocStats, processLearnRequest, } from "./docs/index.js";
10
11
  const SERVER_DESCRIPTION = `WoWok MCP Server - Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.
11
12
 
12
13
  ## Token System Overview
@@ -576,6 +577,10 @@ const WatchQueryOperationsSchema = z.preprocess((input) => {
576
577
  token_type: TokenTypeSchema.optional().describe("Token type to query; defaults to 0x2::wow::WOW (platform token)"),
577
578
  network: EntrypointSchema.optional(),
578
579
  }).describe("Query an account's coin balance OR paginated coin objects. Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. Returns: { address, balance? | coin? }"),
580
+ z.object({
581
+ query_type: z.literal("local_names"),
582
+ addresses: z.array(z.string()).describe("Array of addresses to look up local names for"),
583
+ }).describe("Query local names (account name and local mark name) for a list of addresses. Returns array of: { account?: string, local_mark?: string, address: string }"),
579
584
  ]),
580
585
  z.discriminatedUnion("query_type", [
581
586
  z.object({
@@ -1000,6 +1005,11 @@ async function handleWatchQueryOperations(args) {
1000
1005
  result = { query_type: "account_balance", result: queryResult };
1001
1006
  break;
1002
1007
  }
1008
+ case "local_names": {
1009
+ const queryResult = await GetLocalNamesByAddresses(validated.addresses);
1010
+ result = { query_type: "local_names", result: queryResult };
1011
+ break;
1012
+ }
1003
1013
  case "onchain_personal_profile": {
1004
1014
  const queryResult = await query_personal({ account: validated.account, no_cache: validated.no_cache, network: validated.network });
1005
1015
  result = { query_type: "onchain_personal_profile", result: queryResult };
@@ -1040,7 +1050,7 @@ async function handleWatchQueryOperations(args) {
1040
1050
  break;
1041
1051
  }
1042
1052
  default:
1043
- throw new Error(`Unknown query type. Valid query_types are: "local_mark_list", "account_list", "local_info_list", "token_list", "account_balance", "onchain_personal_profile", "onchain_objects", "onchain_received". For table queries, use the "onchain_table_data" tool.`);
1053
+ throw new Error(`Unknown query type. Valid query_types are: "local_mark_list", "account_list", "local_info_list", "token_list", "account_balance", "local_names", "onchain_personal_profile", "onchain_objects", "onchain_received". For table queries, use the "onchain_table_data" tool.`);
1044
1054
  }
1045
1055
  return {
1046
1056
  content: [{ type: "text", text: JSON.stringify({ result }) }],
@@ -1296,6 +1306,20 @@ async function handleMachineNode2File(args) {
1296
1306
  }
1297
1307
  export { OnchainOperationsSchema, WipOperationsSchema, WatchQueryOperationsSchema, AccountOperationSchema, LocalMarkOperationSchema, LocalInfoOperationSchema, ProtocolInfoQuerySchema, CallOutputSchema, MessengerOperationInputSchema, MessengerOperationOutputSchema };
1298
1308
  async function main() {
1309
+ let docIndex = null;
1310
+ if (isDocumentationAvailable()) {
1311
+ try {
1312
+ docIndex = loadAllDocuments();
1313
+ const stats = getDocStats();
1314
+ console.error(`Documentation loaded: ${stats.total} files (${stats.skills} skills, ${stats.examples} examples)`);
1315
+ }
1316
+ catch (error) {
1317
+ console.error("Failed to load documentation:", error);
1318
+ }
1319
+ }
1320
+ else {
1321
+ console.error("Documentation not available. Please ensure docs/skills and docs/examples directories exist.");
1322
+ }
1299
1323
  server.registerTool("onchain_operations", {
1300
1324
  title: "⛓️ On-chain Operations",
1301
1325
  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).",
@@ -1364,17 +1388,18 @@ async function main() {
1364
1388
  }, handleMachineNode2File);
1365
1389
  server.registerTool("query_toolkit", {
1366
1390
  title: "🔍 Data Query Toolkit",
1367
- description: "WOWOK data query toolkit — 8 query types covering local device data and on-chain blockchain data:\n\n"
1391
+ description: "WOWOK data query toolkit — 9 query types covering local device data and on-chain blockchain data:\n\n"
1368
1392
  + "LOCAL (device-only, never on-chain):\n"
1369
1393
  + "1. local_mark_list — Query your LOCAL address book: maps human-readable names to blockchain addresses with optional tags. Use to resolve names→addresses or find addresses by tag.\n"
1370
1394
  + "2. account_list — Query your LOCAL accounts: view all accounts stored on this device (addresses, public keys, messenger status, suspension state). Use to discover available accounts before operations.\n"
1371
1395
  + "3. local_info_list — Query your LOCAL private info: sensitive data like delivery addresses, phone numbers, contacts stored ONLY on this device.\n"
1372
1396
  + "4. token_list — Query cached token metadata: symbol, decimals, icon URL, description for tokens previously fetched from chain. Use to look up token precision/decimals before performing token operations. Returns: TokenTypeInfo[] (type, alias, name, symbol, decimals, iconUrl).\n"
1373
- + "5. account_balance — Query an account's coin balance OR paginated coin objects. Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. Supports multi-token via token_type parameter.\n\n"
1397
+ + "5. account_balance — Query an account's coin balance OR paginated coin objects. Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. Supports multi-token via token_type parameter.\n"
1398
+ + "6. local_names — Query local names by a list of addresses. For each address, returns the resolved account name (if exists) and local mark name (if exists). Returns: { account?, local_mark?, address }[].\n\n"
1374
1399
  + "ONCHAIN (blockchain):\n"
1375
- + "6. onchain_personal_profile — Query any user's PUBLIC on-chain profile: social links, reputation (likes/dislikes), personal info records, voting history, referrer.\n"
1376
- + "7. onchain_objects — Batch query on-chain WOWOK objects by ID or name: supports Service, Machine, Order, Treasury, Reward, Arb, Personal, Contact, and more.\n"
1377
- + "8. onchain_received — Query objects (Payments, Tokens, NFTs) received by a specific object. Supports pagination and all_type filter.\n\n"
1400
+ + "7. onchain_personal_profile — Query any user's PUBLIC on-chain profile: social links, reputation (likes/dislikes), personal info records, voting history, referrer.\n"
1401
+ + "8. onchain_objects — Batch query on-chain WOWOK objects by ID or name: supports Service, Machine, Order, Treasury, Reward, Arb, Personal, Contact, and more.\n"
1402
+ + "9. onchain_received — Query objects (Payments, Tokens, NFTs) received by a specific object. Supports pagination and all_type filter.\n\n"
1378
1403
  + "For dynamic table data queries (pagination, table items), use the 'onchain_table_data' tool.",
1379
1404
  inputSchema: WatchQueryOperationsSchema,
1380
1405
  outputSchema: z.object({
@@ -1421,52 +1446,134 @@ async function main() {
1421
1446
  }, handleWowokInfo);
1422
1447
  server.registerTool("documents_and_learn", {
1423
1448
  title: "📚 Documents and Learn",
1424
- description: "Access WoWok documentation and learning resources. Provides official documentation URL for users and AI to get more information about WoWok protocol, components, and usage.",
1449
+ description: "Access WoWok documentation and learning resources locally. Search documentation, get operation schemas, learn from examples, and read guides without external network access.",
1425
1450
  inputSchema: z.object({
1426
- topic: z.string().optional().describe("Optional topic to search for in documentation (e.g., 'guard', 'service', 'messenger', 'stage-01-introduction')"),
1451
+ action: z.enum(["search", "get_schema", "learn_example", "guide", "list_operations", "list_examples"])
1452
+ .describe("Action to perform: 'search' for keywords, 'get_schema' for operation/tool schemas, 'learn_example' for case studies, 'guide' for documentation, 'list_operations' or 'list_examples' to see available resources"),
1453
+ topic: z.string().optional().describe("Topic for guide or schema lookup (e.g., 'guard', 'service', 'WOWOK', '_index')"),
1454
+ query: z.string().optional().describe("Search query for finding relevant documentation"),
1455
+ example: z.string().optional().describe("Example name to learn from (e.g., 'MyShop', 'Travel', 'Insurance')"),
1456
+ operationType: z.string().optional().describe("Operation type for schema lookup (e.g., 'service', 'guard', 'machine', 'order')"),
1457
+ toolName: z.string().optional().describe("Tool name for schema lookup (e.g., 'query_toolkit', 'messenger_operation')"),
1427
1458
  }),
1428
1459
  outputSchema: z.object({
1429
- documentation_url: z.string().describe("Official WoWok documentation URL on GitHub"),
1430
- topic: z.string().optional().describe("Requested topic if specified"),
1431
- original_topic: z.string().optional().describe("Original topic input by user (before normalization)"),
1432
- message: z.string().describe("Welcome message with documentation information. Always included in response."),
1460
+ success: z.boolean().describe("Whether the request was successful"),
1461
+ action: z.string().describe("The action that was performed"),
1462
+ data: z.any().describe("Response data (varies by action)"),
1463
+ message: z.string().describe("Human-readable message describing the result"),
1464
+ suggestions: z.array(z.string()).optional().describe("Suggested next steps or alternatives"),
1433
1465
  }),
1434
1466
  annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
1435
- _meta: createToolMeta("documentation", ["docs", "learn", "tutorial", "guide", "help", "reference"]),
1467
+ _meta: createToolMeta("documentation", ["docs", "learn", "tutorial", "guide", "help", "reference", "schema", "example"]),
1436
1468
  }, async (args) => {
1437
- const GITHUB_BASE_URL = "https://github.com/wowok-ai/docs/blob/main/docs";
1438
- if (!args.topic) {
1439
- const url = GITHUB_BASE_URL;
1440
- const message = `Welcome to WoWok Documentation! Access comprehensive guides, tutorials, and API references at: ${url}`;
1469
+ if (!docIndex) {
1441
1470
  return {
1442
- content: [
1443
- {
1471
+ content: [{
1444
1472
  type: "text",
1445
- text: message,
1446
- },
1447
- ],
1473
+ text: "Documentation system is not available. Please ensure docs/skills and docs/examples are copied to the package.",
1474
+ }],
1448
1475
  structuredContent: {
1449
- documentation_url: url,
1450
- message: message,
1476
+ success: false,
1477
+ action: args.action,
1478
+ data: null,
1479
+ message: "Documentation system unavailable",
1480
+ suggestions: ["Check that docs/ directory exists", "Ensure docs/skills and docs/examples subdirectories are present"],
1451
1481
  },
1452
1482
  };
1453
1483
  }
1454
- const normalizedTopic = args.topic.toLowerCase().trim();
1455
- const url = `${GITHUB_BASE_URL}/${normalizedTopic}.md`;
1456
- const message = `Documentation for "${normalizedTopic}"\nGitHub URL: ${url}`;
1484
+ const request = {
1485
+ action: args.action,
1486
+ topic: args.topic,
1487
+ query: args.query,
1488
+ example: args.example,
1489
+ operationType: args.operationType,
1490
+ toolName: args.toolName,
1491
+ };
1492
+ const response = processLearnRequest(docIndex.index, request);
1493
+ let textContent = response.message;
1494
+ const data = response.data;
1495
+ if (response.success && data) {
1496
+ switch (args.action) {
1497
+ case "search":
1498
+ if (Array.isArray(data) && data.length > 0) {
1499
+ textContent += "\n\nFound documents:\n";
1500
+ for (const item of data) {
1501
+ textContent += `\n📄 ${item.title} (${item.category})\n`;
1502
+ if (item.snippets && item.snippets.length > 0) {
1503
+ textContent += ` ${item.snippets[0].slice(0, 150)}...\n`;
1504
+ }
1505
+ }
1506
+ }
1507
+ break;
1508
+ case "get_schema":
1509
+ if (data.title) {
1510
+ textContent += `\n\n${data.title}\n`;
1511
+ textContent += `${"=".repeat(data.title.length)}\n\n`;
1512
+ }
1513
+ if (data.description) {
1514
+ textContent += `${data.description}\n\n`;
1515
+ }
1516
+ if (data.dataSchema) {
1517
+ textContent += "## Data Schema\n\n";
1518
+ textContent += "```typescript\n";
1519
+ textContent += data.dataSchema.slice(0, 1000);
1520
+ textContent += "\n```\n";
1521
+ }
1522
+ if (data.relatedOperations && data.relatedOperations.length > 0) {
1523
+ textContent += `\nRelated operations: ${data.relatedOperations.join(", ")}\n`;
1524
+ }
1525
+ break;
1526
+ case "learn_example":
1527
+ if (data.name) {
1528
+ textContent += `\n\n📚 ${data.title || data.name}\n`;
1529
+ textContent += `${"=".repeat((data.title || data.name).length)}\n\n`;
1530
+ }
1531
+ if (data.description) {
1532
+ textContent += `${data.description}\n\n`;
1533
+ }
1534
+ if (data.documents && data.documents.length > 0) {
1535
+ textContent += "Documents:\n";
1536
+ for (const doc of data.documents) {
1537
+ textContent += ` • ${doc.title}\n`;
1538
+ }
1539
+ }
1540
+ if (data.hasTestResults) {
1541
+ textContent += "\n✓ Test results available\n";
1542
+ }
1543
+ break;
1544
+ case "guide":
1545
+ if (data.content) {
1546
+ const maxLength = 3000;
1547
+ let content = data.content;
1548
+ if (content.length > maxLength) {
1549
+ content = content.slice(0, maxLength) + "\n\n... [Content truncated, use search for specific topics]";
1550
+ }
1551
+ textContent += `\n\n${content}\n`;
1552
+ }
1553
+ break;
1554
+ case "list_operations":
1555
+ case "list_examples":
1556
+ if (Array.isArray(response.data)) {
1557
+ textContent += `\n\nAvailable ${args.action === "list_operations" ? "operations" : "examples"}:\n`;
1558
+ for (const item of response.data) {
1559
+ textContent += ` • ${item.name}${item.title ? ` - ${item.title}` : ""}\n`;
1560
+ }
1561
+ }
1562
+ break;
1563
+ }
1564
+ }
1565
+ if (response.suggestions && response.suggestions.length > 0) {
1566
+ textContent += "\n\n💡 Suggestions:\n";
1567
+ for (const suggestion of response.suggestions) {
1568
+ textContent += ` • ${suggestion}\n`;
1569
+ }
1570
+ }
1457
1571
  return {
1458
- content: [
1459
- {
1572
+ content: [{
1460
1573
  type: "text",
1461
- text: message,
1462
- },
1463
- ],
1464
- structuredContent: {
1465
- documentation_url: url,
1466
- topic: normalizedTopic,
1467
- original_topic: args.topic,
1468
- message: message,
1469
- },
1574
+ text: textContent,
1575
+ }],
1576
+ structuredContent: response,
1470
1577
  };
1471
1578
  });
1472
1579
  const transport = new StdioServerTransport();
package/docs/README.md ADDED
@@ -0,0 +1,249 @@
1
+ # WoWok: Next-Generation Trust Network Fusing AI and Blockchain
2
+
3
+ ---
4
+
5
+ ### 💡 Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.
6
+
7
+ ---
8
+
9
+ ## 🌟 Welcome to WoWok
10
+
11
+ In this Skill Book, we will take you step by step to explore the complete WoWok ecosystem. Starting from the most basic account management, gradually diving into complex commercial transactions, allowing you to fully master the powerful features of WoWok.
12
+
13
+ ### 📖 What is WoWok?
14
+
15
+ WoWok is not a centralized network, but a distributed trust network built on cryptography. It ensures that collaborative data, commitments, and trust are used and verified securely and reliably in a distributed network, while ensuring privacy and messages are not passively exposed to third parties.
16
+
17
+ ### 🚀 WoWok Builds Brand-New Network Infrastructure
18
+
19
+ | Component | Description | Key Features |
20
+ |-----------|-------------|--------------|
21
+ | **⛓️ Quantum-Safe Blockchain** | Blockchain L1 & L2(soon) | Immutable data, transparent execution, secure trust |
22
+ | **🔒 Messenger** | Commercial end-to-end encrypted IM | WTS self-proving messages, privacy-first |
23
+ | **🤖 Wowok-Agent** | User-AI-Blockchain interface | MCP integration, prompt-driven workflows |
24
+
25
+ ### 🌐 A Trust Network for Everyone
26
+
27
+ WoWok balances privacy and open collaboration through innovative mechanisms:
28
+
29
+ | Feature | Benefit |
30
+ |---------|---------|
31
+ | **Transparent and Trusted Infrastructure** | Based on WoWok public chain, collaborative data, conditions, and methods are publicly transparent and immutable |
32
+ | **User Data Sovereignty** | Data ownership and usage rights belong to users, who have complete control over their data |
33
+ | **Customizable Trust Rules** | Create custom trust verification rules using Guards based on on-chain data |
34
+ | **WTS Self-Proving Messages** | Witness Timestamped Signature ensures message authenticity, integrity, and self-provability |
35
+ | **WIP Immutable Commitments** | Witness Immutable Promise ensures commitments are visible and immutable to all participants |
36
+ | **Arbitration Dispute Protection** | Complete evidence chain for broken commitments, with on-chain data and provable messages |
37
+ | **Quantum-Safe Network** | On-chain wallets (Falcon), smart contracts, and Messenger(Kyber) secured by post-quantum cryptography, ensuring network-wide quantum resistance |
38
+
39
+ ### 🤖 AI-Native Transaction Mechanism
40
+
41
+ | Feature | How It Works |
42
+ |---------|--------------|
43
+ | **Deterministic Execution** | Smart contracts ensure commitments, workflows, and compensation are visible and executable |
44
+ | **Disintermediation** | No third-party review, recommendation, or fees - just on-chain open data and events |
45
+ | **AI Empowerment** | Every AI Agent can independently express demands, evaluate trust, collaborate, and transact |
46
+ ---
47
+
48
+ ### How to Use? Just One Step!
49
+ Configure "@wowok/agent-mcp" in your AI client (such as Claude Desktop, Cursor, etc.) (You can ask the AI how to configure MCP Server):
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "wowok": {
55
+ "command": "npx",
56
+ "args": [
57
+ "-y",
58
+ "@wowok/agent-mcp"
59
+ ]
60
+ }
61
+ }
62
+ }
63
+ ```
64
+ After restarting the AI client, you can try a conversation like this to verify:
65
+
66
+ **💬 You**: Please provide all tools and detailed usage of @wowok/agent-mcp.
67
+
68
+ **🤖 AI**: *(If a detailed list of tools is returned, it means it has been configured and enabled successfully!)*
69
+
70
+ ---
71
+
72
+ > 🚀 **Enhanced AI Experience**: For an even better AI experience, install both:
73
+ > - **WoWok Agent (MCP Server)**: [`https://github.com/wowok-ai/agent/`](https://github.com/wowok-ai/agent/)
74
+ > - **WoWok Skills**: [`https://github.com/wowok-ai/skills/`](https://github.com/wowok-ai/skills/) - `npm install -g @wowok/skills`
75
+ >
76
+ > Skills help AI assistants use WoWok tools correctly, solving common challenges: complex system building, tool usage failures, and safety protocols.
77
+
78
+ ### 📦 Using Skills in Your Project
79
+
80
+ After installing `@wowok/skills` globally, you can use the following commands in your project:
81
+
82
+ ```bash
83
+ # List all available skills
84
+ wowok-skills list
85
+
86
+ # Show details of a specific skill
87
+ wowok-skills get wowok-build
88
+
89
+ # Install skills to current project (creates .claude/skills/)
90
+ wowok-skills init
91
+
92
+ # Remove skills from current project
93
+ wowok-skills uninit
94
+ ```
95
+
96
+ **Quick Start in Project:**
97
+ ```bash
98
+ # Navigate to your project directory
99
+ cd your-project
100
+
101
+ # Install skills for this project
102
+ wowok-skills init
103
+
104
+ # Now Claude Code will automatically use these skills when working with WoWok
105
+ ```
106
+
107
+ ---
108
+
109
+ > 💡 We believe AI and WoWok together can accomplish everything. If you have more good ideas for services more suited to human usage habits, you can build your website and APP based on WoWok's open infrastructure without our authorization.
110
+
111
+ ## 📚 Learning Path
112
+
113
+ We have designed 8 learning stages and a large number of Prompt examples for you, with each stage building on the previous one:
114
+
115
+ ```
116
+ ┌─────────────────────────────────────────────────────────────────┐
117
+ │ Stage 1: Getting Started ⭐ │
118
+ │ ├─ Account - Local Wallet Management │
119
+ │ └─ LocalMark - User/Object Naming and Categorization │
120
+ ├─────────────────────────────────────────────────────────────────┤
121
+ │ Stage 2: Trust Management 🔐 │
122
+ │ ├─ Permission - Who Can Do What │
123
+ │ └─ Guard - Programmable Trust Rules │
124
+ ├─────────────────────────────────────────────────────────────────┤
125
+ │ Stage 3: Open Collaboration 🤝 │
126
+ │ ├─ Machine + Progress - Automated Workflows │
127
+ │ ├─ Messenger - Private Communication │
128
+ │ └─ Contact - Public Contact Information │
129
+ ├─────────────────────────────────────────────────────────────────┤
130
+ │ Stage 4: Transaction Execution 💼 │
131
+ │ ├─ Allocation - Automatic Fund Distribution │
132
+ │ ├─ Service + Order - WYSIWYG Product Trading │
133
+ │ └─ Arbitration - Dispute Resolution │
134
+ ├─────────────────────────────────────────────────────────────────┤
135
+ │ Stage 5: Business Components 🏪 │
136
+ │ ├─ Repository - Data Management │
137
+ │ ├─ Treasury - Team Fund Management │
138
+ │ └─ Reward - Marketing Incentives │
139
+ ├─────────────────────────────────────────────────────────────────┤
140
+ │ Stage 6: Personal Services 👤 │
141
+ │ ├─ LocalInfo - Private Information Management │
142
+ │ ├─ Demand - Seeking Assistance │
143
+ │ └─ Personal - Personal On-Chain Portal │
144
+ ├─────────────────────────────────────────────────────────────────┤
145
+ │ Stage 7: Data Query 🔍 │
146
+ │ ├─ query_toolkit — Query on-chain objects, balances, profiles │
147
+ │ ├─ onchain_table_data — Query dynamic table data & items │
148
+ │ ├─ On-chain Events - Watch real-time on-chain events │
149
+ │ └─ WoWok Build-in Info - Query protocol constants & info │
150
+ ├─────────────────────────────────────────────────────────────────┤
151
+ │ Stage 8: Practical Examples 🚀 │
152
+ │ ├─ MyShop - Basic E-Commerce Example │
153
+ │ ├─ ThreeBody_Signature - Signed Book Service Example │
154
+ │ ├─ MyShop_Advanced - Advanced E-Commerce Example │
155
+ │ ├─ Insurance - Time-Lock Insurance Claim Processing │
156
+ │ └─ Travel - Weather-Dependent Travel with Sub-Orders │
157
+ └─────────────────────────────────────────────────────────────────┘
158
+ ```
159
+
160
+ ---
161
+
162
+ ## 🚀 Start Your Journey
163
+
164
+ Choose a stage to begin your WoWok journey:
165
+
166
+ ### [📖 Stage 1: Getting Started →](docs/stage-01-introduction.md)
167
+ **For Beginners** - Set up your local wallet (Account) and learn to name blockchain addresses with LocalMark.
168
+
169
+ ### [🔐 Stage 2: Trust Management →](docs/stage-02-trust.md)
170
+ **Understanding Permissions** - Learn how to manage permissions and establish trust rules.
171
+
172
+ ### [🤝 Stage 3: Open Collaboration →](docs/stage-03-collaboration.md)
173
+ **Start Collaborating** - Master workflows, communication, and contact information management.
174
+
175
+ ### [💼 Stage 4: Transaction Execution →](docs/stage-04-transaction.md)
176
+ **Conduct Transactions** - Learn how to use Service, Order, and Arbitration for commercial transactions with WIP-backed product descriptions.
177
+
178
+ ### [🏪 Stage 5: Business Components →](docs/stage-05-business.md)
179
+ **Business Operations** - Use Repository for structured data, Treasury for team funds, and Reward for marketing incentives.
180
+
181
+ ### [👤 Stage 6: Personal Services →](docs/stage-06-personal.md)
182
+ **Personal Services** - Manage private info locally with LocalInfo, post bounty requests with Demand, and build your on-chain identity with Personal.
183
+
184
+ ### [🔍 Stage 7: Data Query →](docs/stage-07-query.md)
185
+ **Explore Data** - Query objects, events, and protocol info; access documentation and learning resources.
186
+
187
+ ### [🚀 Stage 8: Practical Examples →](examples/)
188
+ **Real-World Applications** - Explore complete business examples demonstrating various WoWok protocol features:
189
+
190
+ | Example | Core Feature | Description |
191
+ |---------|--------------|-------------|
192
+ | [MyShop](examples/MyShop/) | Basic E-Commerce | Simple online store with product listings and orders |
193
+ | [ThreeBody_Signature](examples/ThreeBody_Signature/) | Signed Book Service | Limited edition signed book sales with WIP verification |
194
+ | [MyShop_Advanced](examples/MyShop_Advanced/) | Advanced E-Commerce | Full merchant system with arbitration and rewards |
195
+ | [Insurance](examples/Insurance/) | Time-Lock Guards | Insurance claims with time-lock verification using convert_witness |
196
+ | [Travel](examples/Travel/) | Multi-Node Workflow | Iceland travel service with weather-dependent activities and sub-orders |
197
+
198
+ ---
199
+
200
+ ## 📋 Quick Reference
201
+
202
+ | Component | Type | Stage | Description |
203
+ |-----------|------|-------|-------------|
204
+ | [Account](docs/account.md) | Local | 1 | Local wallet management |
205
+ | [LocalMark](docs/localmark.md) | Local | 1 | User/Object naming and categorization |
206
+ | [LocalInfo](docs/localinfo.md) | Local | 6 | Private information management |
207
+ | [Permission](docs/permission.md) | On-Chain | 2 | Permission management |
208
+ | [Guard](docs/guard.md) | On-Chain | 2 | Trust verification engine |
209
+ | [Machine](docs/machine.md) | On-Chain | 3 | Workflow template |
210
+ | [Progress](docs/progress.md) | On-Chain | 3 | Order progress |
211
+ | [Messenger](docs/messenger.md) | Local+On-Chain | 3 | Secure end-to-end encrypted chat |
212
+ | [Contact](docs/contact.md) | On-Chain | 3 | Public contact information |
213
+ | [Allocation](docs/allocation.md) | On-Chain | 4 | Automatic fund distribution |
214
+ | [Service](docs/service.md) | On-Chain | 4 | WYSIWYG product trading |
215
+ | [Order](docs/order.md) | On-Chain | 4 | Order management |
216
+ | [Arbitration](docs/arbitration.md) | On-Chain | 4 | Dispute resolution |
217
+ | [Repository](docs/repository.md) | On-Chain | 5 | Data ownership and usage rights |
218
+ | [Treasury](docs/treasury.md) | On-Chain | 5 | Team fund management |
219
+ | [Reward](docs/reward.md) | On-Chain | 5 | Marketing incentives |
220
+ | [Demand](docs/demand.md) | On-Chain | 6 | Seeking assistance |
221
+ | [Personal](docs/personal.md) | On-Chain | 6 | Personal on-chain portal |
222
+ | [Query](docs/query.md) | Query | 7 | Data query (query_toolkit + onchain_table_data) |
223
+ | [On-chain Events](docs/onchain_events.md) | Query | 7 | Watch and query on-chain events |
224
+ | [WoWok Build-in Info](docs/wowok_buildin_info.md) | Query | 7 | Query protocol constants and info |
225
+ | [MyShop Example](examples/MyShop/) | Example | 8 | Basic e-commerce store with product listings |
226
+ | [ThreeBody_Signature Example](examples/ThreeBody_Signature/) | Example | 8 | Signed book service with WIP verification |
227
+ | [MyShop_Advanced Example](examples/MyShop_Advanced/) | Example | 8 | Advanced merchant system with arbitration |
228
+ | [Insurance Example](examples/Insurance/) | Example | 8 | Time-lock insurance claims with convert_witness |
229
+ | [Travel Example](examples/Travel/) | Example | 8 | Multi-node workflow with weather checks and sub-orders |
230
+
231
+ ---
232
+
233
+ ## ⚠️ Important Notes
234
+
235
+ - **Local vs On-Chain** - Distinguish between local operations and on-chain operations
236
+ - **Test Network** - It is recommended to practice on the test network first
237
+ - **Public Transparency** - On-chain data is permanently public, please be cautious when publishing sensitive information
238
+
239
+ ---
240
+
241
+ ## 🌟 Ready to Get Started?
242
+
243
+ Click the link below to begin your Stage 1 learning:
244
+
245
+ **[📖 Go to Stage 1: Getting Started →](docs/stage-01-introduction.md)**
246
+
247
+ ---
248
+
249
+ *WoWok - Making It Easy for AI Agents to Communicate, Collaborate, Trade and Trust.* 💎