@wowok/agent-mcp 2.6.0 → 2.6.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.
Files changed (186) hide show
  1. package/README.md +5 -3
  2. package/dist/customer/info-puzzle.d.ts +1 -1
  3. package/dist/customer/info-puzzle.js +4 -2
  4. package/dist/customer/risk-assessment.js +26 -4
  5. package/dist/customer/types.d.ts +2 -0
  6. package/dist/examples/guard-template-balance-check.json +38 -0
  7. package/dist/examples/guard-template-time-lock.json +39 -0
  8. package/dist/examples/machine-template-7node-rental.json +114 -0
  9. package/dist/examples/rental-ziroom-machine-create.json +137 -0
  10. package/dist/examples/rental-ziroom-permission-create.json +35 -0
  11. package/dist/examples/rental-ziroom-service-create.json +80 -0
  12. package/dist/examples/retail-myshop-service-create.json +88 -0
  13. package/dist/extensions/capability-manifest.d.ts +125 -0
  14. package/dist/extensions/capability-manifest.js +594 -0
  15. package/dist/extensions/constraint-registry.d.ts +24 -0
  16. package/dist/extensions/constraint-registry.js +196 -0
  17. package/dist/extensions/index.d.ts +12 -0
  18. package/dist/extensions/index.js +6 -0
  19. package/dist/extensions/metric-registry.d.ts +26 -0
  20. package/dist/extensions/metric-registry.js +257 -0
  21. package/dist/extensions/mode-evaluator.d.ts +15 -0
  22. package/dist/extensions/mode-evaluator.js +170 -0
  23. package/dist/extensions/modes.d.ts +2 -0
  24. package/dist/extensions/modes.js +493 -0
  25. package/dist/extensions/registry.d.ts +50 -0
  26. package/dist/extensions/registry.js +662 -0
  27. package/dist/extensions/types.d.ts +219 -0
  28. package/dist/extensions/types.js +1 -0
  29. package/dist/index.js +50 -0
  30. package/dist/knowledge/deployment-scanner.d.ts +3 -0
  31. package/dist/knowledge/deployment-scanner.js +64 -3
  32. package/dist/knowledge/fund-layer.d.ts +72 -0
  33. package/dist/knowledge/fund-layer.js +420 -0
  34. package/dist/knowledge/guard-render.d.ts +57 -0
  35. package/dist/knowledge/guard-render.js +700 -0
  36. package/dist/knowledge/guard-risk.d.ts +13 -0
  37. package/dist/knowledge/guard-risk.js +57 -0
  38. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  39. package/dist/knowledge/guard-submission-prompt.js +171 -0
  40. package/dist/knowledge/guard-templates.js +278 -0
  41. package/dist/knowledge/machine-ledger.js +1 -1
  42. package/dist/knowledge/machine-render.d.ts +41 -0
  43. package/dist/knowledge/machine-render.js +565 -0
  44. package/dist/knowledge/machine-templates.js +24 -5
  45. package/dist/knowledge/reward-confirm.js +2 -2
  46. package/dist/knowledge/reward-puzzle.js +1 -1
  47. package/dist/knowledge/reward-risk.js +9 -9
  48. package/dist/knowledge/reward-templates.js +2 -2
  49. package/dist/knowledge/service-confirm.d.ts +15 -6
  50. package/dist/knowledge/service-confirm.js +119 -11
  51. package/dist/knowledge/service-context.js +1 -1
  52. package/dist/knowledge/service-ledger.js +1 -1
  53. package/dist/knowledge/service-risk.d.ts +1 -1
  54. package/dist/knowledge/service-risk.js +3 -3
  55. package/dist/knowledge/service-templates.js +2 -2
  56. package/dist/knowledge/service-translation.d.ts +1 -1
  57. package/dist/knowledge/service-translation.js +7 -7
  58. package/dist/knowledge/tool-constraints.js +6 -2
  59. package/dist/project/deployment-bridge.d.ts +1 -1
  60. package/dist/project/deployment-bridge.js +31 -7
  61. package/dist/project/deployment-doc.d.ts +3 -0
  62. package/dist/project/deployment-doc.js +76 -14
  63. package/dist/project/edit-planner.d.ts +123 -0
  64. package/dist/project/edit-planner.js +1371 -0
  65. package/dist/project/evaluation.d.ts +2 -0
  66. package/dist/project/evaluation.js +873 -88
  67. package/dist/project/graph-builder.d.ts +4 -1
  68. package/dist/project/graph-builder.js +132 -62
  69. package/dist/project/graph.d.ts +1 -0
  70. package/dist/project/handlers.d.ts +317 -6
  71. package/dist/project/handlers.js +1171 -19
  72. package/dist/project/stage-gate.d.ts +4 -0
  73. package/dist/project/stage-gate.js +64 -5
  74. package/dist/project/task-tracker.d.ts +26 -0
  75. package/dist/project/task-tracker.js +78 -0
  76. package/dist/safety/preview.js +16 -0
  77. package/dist/schema/call/allocation.d.ts +16 -16
  78. package/dist/schema/call/allocation.js +2 -2
  79. package/dist/schema/call/arbitration.js +19 -6
  80. package/dist/schema/call/base.d.ts +21 -13
  81. package/dist/schema/call/base.js +27 -6
  82. package/dist/schema/call/bridge.d.ts +5 -5
  83. package/dist/schema/call/bridge.js +3 -1
  84. package/dist/schema/call/contact.js +2 -2
  85. package/dist/schema/call/demand.d.ts +23 -31
  86. package/dist/schema/call/demand.js +2 -2
  87. package/dist/schema/call/guard.js +2 -2
  88. package/dist/schema/call/machine.d.ts +1976 -752
  89. package/dist/schema/call/machine.js +50 -4
  90. package/dist/schema/call/order.d.ts +149 -228
  91. package/dist/schema/call/order.js +4 -3
  92. package/dist/schema/call/payment.d.ts +183 -3
  93. package/dist/schema/call/payment.js +21 -3
  94. package/dist/schema/call/permission.js +2 -2
  95. package/dist/schema/call/personal.d.ts +241 -52
  96. package/dist/schema/call/progress.d.ts +53 -61
  97. package/dist/schema/call/progress.js +18 -4
  98. package/dist/schema/call/repository.d.ts +23 -31
  99. package/dist/schema/call/repository.js +2 -2
  100. package/dist/schema/call/reward.js +3 -3
  101. package/dist/schema/call/semantic.d.ts +1 -1
  102. package/dist/schema/call/semantic.js +37 -2
  103. package/dist/schema/call/service.d.ts +275 -127
  104. package/dist/schema/call/service.js +89 -13
  105. package/dist/schema/call/treasury.js +3 -3
  106. package/dist/schema/common/index.d.ts +13 -2
  107. package/dist/schema/common/index.js +80 -15
  108. package/dist/schema/local/index.d.ts +32 -35
  109. package/dist/schema/local/index.js +28 -6
  110. package/dist/schema/messenger/index.d.ts +274 -46
  111. package/dist/schema/operations.d.ts +1264 -544
  112. package/dist/schema/operations.js +65 -7
  113. package/dist/schema/project/index.d.ts +2846 -167
  114. package/dist/schema/project/index.js +570 -16
  115. package/dist/schema/query/index.d.ts +922 -349
  116. package/dist/schema/query/index.js +205 -42
  117. package/dist/schema/schema-query/index.d.ts +65 -3
  118. package/dist/schema/schema-query/index.js +38 -5
  119. package/dist/schema/utils/node-parser.js +20 -4
  120. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  121. package/dist/schema/utils/object-type-utils.js +35 -0
  122. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  123. package/dist/schema/utils/permission-machine-check.js +121 -0
  124. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  125. package/dist/schema/utils/skills-recommendation.js +76 -0
  126. package/dist/schema-query/index.d.ts +20 -1
  127. package/dist/schema-query/index.js +306 -4
  128. package/dist/schemas/account_operation.output.json +7 -1
  129. package/dist/schemas/account_operation.schema.json +3 -3
  130. package/dist/schemas/bridge_operation.output.json +6 -0
  131. package/dist/schemas/bridge_operation.schema.json +1 -1
  132. package/dist/schemas/guard-templates.json +379 -0
  133. package/dist/schemas/guard2file.schema.json +1 -1
  134. package/dist/schemas/index.json +1 -1
  135. package/dist/schemas/local_info_operation.output.json +6 -0
  136. package/dist/schemas/local_mark_operation.output.json +7 -1
  137. package/dist/schemas/local_mark_operation.schema.json +1 -1
  138. package/dist/schemas/machineNode2file.schema.json +1 -1
  139. package/dist/schemas/messenger_operation.schema.json +4 -4
  140. package/dist/schemas/onchain_events.output.json +1 -1
  141. package/dist/schemas/onchain_operations.output.json +2820 -0
  142. package/dist/schemas/onchain_operations.schema.json +444 -330
  143. package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
  144. package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
  145. package/dist/schemas/onchain_operations_contact.schema.json +10 -10
  146. package/dist/schemas/onchain_operations_demand.schema.json +10 -10
  147. package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
  148. package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
  149. package/dist/schemas/onchain_operations_guard.schema.json +2 -2
  150. package/dist/schemas/onchain_operations_machine.schema.json +43 -35
  151. package/dist/schemas/onchain_operations_order.schema.json +72 -78
  152. package/dist/schemas/onchain_operations_payment.schema.json +141 -111
  153. package/dist/schemas/onchain_operations_permission.schema.json +3 -3
  154. package/dist/schemas/onchain_operations_personal.schema.json +7 -7
  155. package/dist/schemas/onchain_operations_progress.schema.json +9 -9
  156. package/dist/schemas/onchain_operations_proof.schema.json +8 -8
  157. package/dist/schemas/onchain_operations_repository.schema.json +10 -10
  158. package/dist/schemas/onchain_operations_reward.schema.json +14 -14
  159. package/dist/schemas/onchain_operations_service.schema.json +119 -48
  160. package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
  161. package/dist/schemas/onchain_table_data.output.json +33 -25
  162. package/dist/schemas/onchain_table_data.schema.json +22 -21
  163. package/dist/schemas/project_operation.output.json +2194 -23
  164. package/dist/schemas/project_operation.schema.json +84 -6
  165. package/dist/schemas/query_toolkit.output.json +108 -80
  166. package/dist/schemas/query_toolkit.schema.json +12 -12
  167. package/dist/schemas/schema_query.output.json +70 -3
  168. package/dist/schemas/schema_query.schema.json +18 -3
  169. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  170. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  171. package/dist/tools/handlers/local.js +20 -5
  172. package/dist/tools/handlers/onchain.js +594 -6
  173. package/dist/tools/handlers/project.js +76 -4
  174. package/dist/tools/handlers/query.js +27 -0
  175. package/dist/tools/handlers/schema-query.js +43 -1
  176. package/dist/tools/handlers/task-status.d.ts +170 -0
  177. package/dist/tools/handlers/task-status.js +55 -0
  178. package/dist/tools/handlers/wip.js +47 -1
  179. package/dist/tools/index.d.ts +8 -0
  180. package/dist/tools/index.js +387 -12
  181. package/dist/tools/retry.d.ts +8 -0
  182. package/dist/tools/retry.js +85 -0
  183. package/dist/tools/wip-deploy-assist.d.ts +28 -0
  184. package/dist/tools/wip-deploy-assist.js +278 -0
  185. package/package.json +2 -2
  186. package/dist/schemas/guard-node-examples.md +0 -199
@@ -29,13 +29,24 @@
29
29
  "get_object_diff",
30
30
  "delete_project",
31
31
  "assemble_context",
32
- "generate_deployment_doc"
32
+ "get_machine_graph",
33
+ "get_guard_graph",
34
+ "generate_deployment_doc",
35
+ "pre_evaluate_check",
36
+ "verify_deployment",
37
+ "clone_project_to_network",
38
+ "migrate_network",
39
+ "migrate_to_mainnet",
40
+ "plan_object_edit",
41
+ "apply_object_edit",
42
+ "patch_machine_nodes",
43
+ "patch_guard_tree"
33
44
  ],
34
- "description": "Action to perform. Two categories:\n1. Project Entity + Evaluation (15, GLM6): list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff. Projects are first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine.\n2. Context Assembly (1): assemble_context (query on-chain object states + extract embedded history + optional events, and assemble a structured semantic context for LLM consumption). Required input: context_objects (array of object IDs/names). Optional: include_events (query recent state-transition events)."
45
+ "description": "Action to perform. Two categories:\n1. Project Entity + Evaluation (15, GLM6): list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff. Projects are first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine.\n2. Context Assembly (1): assemble_context (query on-chain object states + extract embedded history + optional events, and assemble a structured semantic context for LLM consumption). Required input: context_objects (array of object IDs/names). Optional: include_events (query recent state-transition events).\n3. Cross-Network Migration (FIX-012): clone_project_to_network (or its alias migrate_network) copies a source project's object metadata to a new project bound to target_network. The 5-step migration workflow: 1) call clone_project_to_network (or migrate_network) with target_network to copy metadata, 2) re-run onchain_operations with env.network=target_network to deploy objects on-chain, 3) re-register LocalMark names with the SAME names on the target network (FIX-011 cross-network consistency), 4) update_project to set service_address on the new project, 5) build_graph to construct the new project's relationship graph."
35
46
  },
36
47
  "project": {
37
48
  "type": "string",
38
- "description": "Project prefix (human-readable unique identifier). Used by create_version, build_graph, evaluate_project, etc. Takes precedence resolution: project_id > project (prefix)."
49
+ "description": "Project prefix (human-readable unique identifier). For create_project: OPTIONAL — if omitted, auto-derived from project_name (e.g. 'Twitch Service' → 'twitch_service'). For other actions (build_graph, evaluate_project, etc.): used to identify the project. Takes precedence resolution: project_id > project (prefix)."
39
50
  },
40
51
  "version": {
41
52
  "type": "string",
@@ -104,6 +115,7 @@
104
115
  "enum": [
105
116
  "general",
106
117
  "retail",
118
+ "retail_d2c",
107
119
  "service",
108
120
  "rental",
109
121
  "freelance",
@@ -112,7 +124,7 @@
112
124
  "subscription",
113
125
  "custom"
114
126
  ],
115
- "description": "Industry tag for create_project. Drives template defaults."
127
+ "description": "Industry tag for create_project. Drives template defaults — when set (and not 'general'), the system auto-applies an industry blueprint with ~10 draft objects (Permission, Service, Machine, Guard, Treasury, Allocation, etc.) + graph edges, ready for deployment. Supported industries: 'general' (no template), 'retail', 'retail_d2c' (Direct-to-Consumer, e.g., Shopify — Allocation escrow + 2 Guards), 'service', 'rental', 'freelance', 'education', 'travel', 'subscription', 'custom'. Each industry preset embeds risk constraints (e.g., 'freelance' does NOT require compensation_fund, while 'rental'/'travel' do). Example: project_industry='freelance' creates a freelance-style blueprint with setting_locked_time ≥ 7d. Set skip_templates=true to bypass template application."
116
128
  },
117
129
  "project_perspective": {
118
130
  "type": "string",
@@ -142,6 +154,10 @@
142
154
  ],
143
155
  "description": "Network the project is bound to. A Service deployed to different networks are different projects. Defaults to 'testnet'."
144
156
  },
157
+ "skip_templates": {
158
+ "type": "boolean",
159
+ "description": "When true, create_project skips applying the industry template (no draft:* blueprint objects). Use this when you want a clean project with no pre-filled blueprint objects — useful for custom architectures that do not match any industry mode, or to avoid draft objects appearing in build_graph / evaluate_project before deployment. Defaults to false (templates applied)."
160
+ },
145
161
  "project_id": {
146
162
  "type": "string",
147
163
  "description": "Project UUID for update_project / get_project_detail / add_object / remove_object / create_version / build_graph / evaluate_project / refresh_objects. Takes precedence over 'project' (prefix) when both are given."
@@ -156,9 +172,17 @@
156
172
  ],
157
173
  "description": "New status for update_project. 'active' projects are live, 'archived' are read-only."
158
174
  },
175
+ "target_network": {
176
+ "type": "string",
177
+ "enum": [
178
+ "testnet",
179
+ "mainnet"
180
+ ],
181
+ "description": "Target network for clone_project_to_network (or its alias migrate_network). The source project's objects are copied to a new project bound to this network. The new project's prefix is '<source_prefix>_<target_network>' to avoid collision. See the action description for the full 5-step migration workflow (FIX-012)."
182
+ },
159
183
  "object_address": {
160
184
  "type": "string",
161
- "description": "On-chain object address (0x...) for add_object / remove_object. For add_object, alternatively use object_name to resolve via LocalMark."
185
+ "description": "On-chain object address (0x followed by 32-64 hex chars) for add_object / remove_object. Also accepts the internal 'draft:<name>' sentinel used by create_project for blueprint objects not yet on-chain. For add_object, alternatively use object_name_add to resolve via LocalMark. H-06 fix: invalid formats are rejected at the handler level with a descriptive error."
162
186
  },
163
187
  "object_name_add": {
164
188
  "type": "string",
@@ -249,6 +273,12 @@
249
273
  "maximum": 5,
250
274
  "description": "Max recursion depth for Pathway 1 (internal reference derivation) in build_graph. Default 3."
251
275
  },
276
+ "depth": {
277
+ "type": "integer",
278
+ "minimum": 1,
279
+ "maximum": 5,
280
+ "description": "Alias for max_depth (build_graph). When both are set, max_depth takes precedence. Default 3."
281
+ },
252
282
  "enable_registrar": {
253
283
  "type": "boolean",
254
284
  "description": "Enable Pathway 2 (Registrar inbound query) in build_graph. Default true."
@@ -257,6 +287,10 @@
257
287
  "type": "boolean",
258
288
  "description": "Enable Pathway 3 (potential relationship detection) in build_graph. Default false."
259
289
  },
290
+ "async_mode": {
291
+ "type": "boolean",
292
+ "description": "When true, build_graph / evaluate_project runs in the background and returns { task_id } immediately. Poll query_task_status(task_id) to check progress and retrieve the result. Default false (synchronous). Use async_mode=true for large projects with enable_potential=true where build may take >10s."
293
+ },
260
294
  "evaluation_type": {
261
295
  "type": "string",
262
296
  "enum": [
@@ -270,7 +304,7 @@
270
304
  },
271
305
  "refresh_before_eval": {
272
306
  "type": "boolean",
273
- "description": "When true, evaluate_project refreshes object cache from chain before evaluating. Default false."
307
+ "description": "When true (DEFAULT), evaluate_project refreshes object cache from chain before evaluating. Set to false ONLY for read-only checks where staleness is acceptable (e.g., quick comparisons). BUG-P0-2 fix: previously defaulted to false, causing stale Machine node_count and other dynamic-field-derived fields to produce false findings (e.g., 'Machine has no nodes'). Now defaults to true — set refresh_before_eval=false explicitly to skip refresh."
274
308
  },
275
309
  "eval_score": {
276
310
  "type": "number",
@@ -319,6 +353,50 @@
319
353
  "save": {
320
354
  "type": "boolean",
321
355
  "description": "When true (default), persist the generated MD to SQLite project_documents table for generate_deployment_doc."
356
+ },
357
+ "detail_level": {
358
+ "type": "string",
359
+ "enum": [
360
+ "summary",
361
+ "detailed",
362
+ "full"
363
+ ],
364
+ "description": "P2-03: Deployment document detail level (only for generate_deployment_doc). 'summary' (default): object name + type + key bindings (machine, permission, buy_guard, order_allocators). 'detailed': adds sale list, arbitration list, reward list. 'full': complete fields including stock, price, wip_hash, all config. Use 'summary' for quick review; request 'detailed' or 'full' only when deeper inspection is needed."
365
+ },
366
+ "object_kind": {
367
+ "type": "string",
368
+ "enum": [
369
+ "machine",
370
+ "guard"
371
+ ],
372
+ "description": "Object kind for plan_object_edit. 'machine' = Machine workflow directed graph (cycles allowed), 'guard' = Guard computation tree. Required when action='plan_object_edit'. Inferred from action for patch_machine_nodes (always 'machine') and patch_guard_tree (always 'guard')."
373
+ },
374
+ "edit_format": {
375
+ "type": "string",
376
+ "enum": [
377
+ "tree_outline",
378
+ "json"
379
+ ],
380
+ "description": "Format of the edited content for plan_object_edit. 'tree_outline' (default): the indented Markdown outline produced by get_machine_graph / get_guard_graph (human-editable). 'json': raw JSON (machine-readable, for programmatic edits). Both formats are bidirectional with the parse functions in knowledge/machine-render.ts / guard-render.ts."
381
+ },
382
+ "edited_content": {
383
+ "type": "string",
384
+ "description": "Edited content for plan_object_edit. Must be in the format specified by edit_format. For 'tree_outline': the full tree_outline string from get_machine_graph/get_guard_graph with user edits. For 'json': a JSON string matching the Machine/Guard schema. The content is parsed + validated + diffed against the current on-chain state."
385
+ },
386
+ "plan_id": {
387
+ "type": "string",
388
+ "description": "Plan ID returned by plan_object_edit. Required for apply_object_edit. The plan is short-lived (10-minute TTL) and stored in-memory."
389
+ },
390
+ "expected_hash": {
391
+ "type": "string",
392
+ "description": "Expected hash returned by plan_object_edit. Required for apply_object_edit. Used for optimistic concurrency control: if the on-chain state changed between plan and apply, the hash will mismatch and apply will refuse to proceed (stale edit protection)."
393
+ },
394
+ "patch_operations": {
395
+ "type": "array",
396
+ "items": {
397
+ "type": "string"
398
+ },
399
+ "description": "Patch operations for patch_machine_nodes / patch_guard_tree. Each string is a single patch operation.\nMachine operations (13 total):\n 'add node <name>' | 'remove node <name>' | 'set description <node_name> <text...>'\n 'add edge <from> <to>' | 'remove edge <from> <to>' | 'set threshold <edge_from> <edge_to> <value>'\n 'add forward <edge_from> <edge_to> <forward_name>' | 'remove forward <edge_from> <edge_to> <forward_name>'\n 'set guard <edge_from> <edge_to> <forward_name> <guard_addr_or_name|none>'\n 'set permission <edge_from> <edge_to> <forward_name> <perm_index>'\n 'set operator <edge_from> <edge_to> <forward_name> <named_operator|none>'\n 'set weight <edge_from> <edge_to> <forward_name> <weight>'\n 'set retained_submission <edge_from> <edge_to> <forward_name> <comma_separated_indices|none>'\nGuard operations (8 total — see patch_guard_tree):\n 'add table <identifier> <name|none> <value_type> <b_submission> [json_value]'\n 'remove table <identifier>' | 'set table_value <identifier> [json_value|none]'\n 'set table_name <identifier> <name|none>' | 'set table_submission <identifier> <true|false>'\n 'set root <json_node>' | 'set rely <comma_separated_guard_addresses|none>'\nOperations are applied in order. Both patches are validated (validateMachine/validateGuard) before execution."
322
400
  }
323
401
  },
324
402
  "required": [