@wowok/agent-mcp 2.7.8 → 3.0.0

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 (393) hide show
  1. package/README.md +2 -2
  2. package/dist/config/runtime.d.ts +1 -1
  3. package/dist/config/runtime.js +1 -1
  4. package/dist/examples/rental-ziroom-machine-create.json +1 -2
  5. package/dist/examples/rental-ziroom-permission-create.json +1 -2
  6. package/dist/examples/rental-ziroom-service-create.json +1 -2
  7. package/dist/experience/experience-reuse.js +1 -1
  8. package/dist/experience/index.d.ts +2 -1
  9. package/dist/experience/index.js +1 -1
  10. package/dist/experience/persistence-config.d.ts +6 -0
  11. package/dist/experience/persistence-config.js +1 -0
  12. package/dist/experience/persistence.d.ts +21 -0
  13. package/dist/experience/persistence.js +1 -0
  14. package/dist/experience/realtime-feedback.js +1 -1
  15. package/dist/experience/user-profile.js +1 -1
  16. package/dist/extensions/business-modules.d.ts +1 -1
  17. package/dist/extensions/capability-manifest.d.ts +2 -83
  18. package/dist/extensions/capability-manifest.js +1 -1
  19. package/dist/extensions/constraint-registry.d.ts +6 -4
  20. package/dist/extensions/constraint-registry.js +1 -1
  21. package/dist/extensions/index.d.ts +4 -5
  22. package/dist/extensions/index.js +1 -1
  23. package/dist/extensions/industry-pack.js +1 -1
  24. package/dist/extensions/metric-registry.d.ts +6 -4
  25. package/dist/extensions/metric-registry.js +1 -1
  26. package/dist/extensions/mode-evaluator.d.ts +2 -3
  27. package/dist/extensions/mode-evaluator.js +1 -1
  28. package/dist/extensions/registry.d.ts +3 -25
  29. package/dist/extensions/registry.js +1 -1
  30. package/dist/extensions/types.d.ts +1 -69
  31. package/dist/goal/GoalClassifier.d.ts +17 -0
  32. package/dist/goal/GoalClassifier.js +1 -0
  33. package/dist/goal/GoalEngine.d.ts +155 -0
  34. package/dist/goal/GoalEngine.js +1 -0
  35. package/dist/goal/GoalStore.d.ts +27 -0
  36. package/dist/goal/GoalStore.js +1 -0
  37. package/dist/goal/plan-approval.d.ts +5 -0
  38. package/dist/goal/plan-approval.js +1 -0
  39. package/dist/goal/types.d.ts +80 -0
  40. package/dist/goal/types.js +1 -0
  41. package/dist/harness/index.d.ts +2 -7
  42. package/dist/harness/index.js +1 -1
  43. package/dist/harness/plan.d.ts +1 -1
  44. package/dist/harness/types.d.ts +0 -35
  45. package/dist/index.js +1 -1
  46. package/dist/knowledge/account-marks.d.ts +36 -0
  47. package/dist/knowledge/account-marks.js +1 -0
  48. package/dist/knowledge/audit-rules.d.ts +3 -1
  49. package/dist/knowledge/audit-rules.js +1 -1
  50. package/dist/knowledge/examples-scanner-cli.js +1 -1
  51. package/dist/knowledge/examples-scanner.js +1 -1
  52. package/dist/knowledge/fund-layer.d.ts +13 -9
  53. package/dist/knowledge/fund-layer.js +1 -1
  54. package/dist/knowledge/goal-completion.d.ts +19 -0
  55. package/dist/knowledge/goal-completion.js +1 -0
  56. package/dist/knowledge/guard-bindings.d.ts +21 -0
  57. package/dist/knowledge/guard-bindings.js +1 -0
  58. package/dist/knowledge/guard-translation.js +1 -1
  59. package/dist/knowledge/index.d.ts +6 -3
  60. package/dist/knowledge/index.js +1 -1
  61. package/dist/knowledge/industry-registry.js +1 -1
  62. package/dist/knowledge/mcp-schema-audit-cli.js +1 -1
  63. package/dist/knowledge/mcp-schema-audit.js +1 -1
  64. package/dist/knowledge/operation-dictionary.js +1 -1
  65. package/dist/knowledge/passport-confirm.js +1 -1
  66. package/dist/knowledge/passport-puzzle.js +1 -1
  67. package/dist/knowledge/passport-translation.js +1 -1
  68. package/dist/knowledge/proof-risk.js +1 -1
  69. package/dist/knowledge/reward-risk.d.ts +1 -1
  70. package/dist/knowledge/reward-risk.js +1 -1
  71. package/dist/knowledge/safety-rules.d.ts +2 -1
  72. package/dist/knowledge/safety-rules.js +1 -1
  73. package/dist/knowledge/scenario-topology.d.ts +43 -0
  74. package/dist/knowledge/scenario-topology.js +1 -0
  75. package/dist/knowledge/service-translation.js +1 -1
  76. package/dist/knowledge/supply-chain.js +1 -1
  77. package/dist/knowledge/template-registry.js +1 -1
  78. package/dist/knowledge/tools-reference.js +1 -1
  79. package/dist/knowledge/workflow-guidance.d.ts +36 -0
  80. package/dist/knowledge/workflow-guidance.js +1 -1
  81. package/dist/knowledge/workspace-lists.d.ts +57 -0
  82. package/dist/knowledge/workspace-lists.js +1 -0
  83. package/dist/loop-engineering/context-collect.d.ts +1 -1
  84. package/dist/monitor/EventRouter.d.ts +10 -0
  85. package/dist/monitor/EventRouter.js +1 -0
  86. package/dist/monitor/EventStore.d.ts +32 -12
  87. package/dist/monitor/EventStore.js +1 -1
  88. package/dist/monitor/MonitorLoop.d.ts +81 -0
  89. package/dist/monitor/MonitorLoop.js +1 -0
  90. package/dist/monitor/ProblemBridge.d.ts +32 -0
  91. package/dist/monitor/ProblemBridge.js +1 -0
  92. package/dist/monitor/ScopeResolver.d.ts +59 -0
  93. package/dist/monitor/ScopeResolver.js +1 -0
  94. package/dist/monitor/SubscriptionStore.d.ts +13 -0
  95. package/dist/monitor/SubscriptionStore.js +1 -0
  96. package/dist/monitor/SuggestionBridge.d.ts +38 -0
  97. package/dist/monitor/SuggestionBridge.js +1 -0
  98. package/dist/monitor/normalize.d.ts +8 -0
  99. package/dist/monitor/normalize.js +1 -0
  100. package/dist/monitor/types.d.ts +89 -0
  101. package/dist/monitor/types.js +1 -0
  102. package/dist/participation/arbitrator-interest.d.ts +20 -0
  103. package/dist/participation/arbitrator-interest.js +1 -0
  104. package/dist/participation/demander-interest.d.ts +23 -0
  105. package/dist/participation/demander-interest.js +1 -0
  106. package/dist/persona/address-format.d.ts +1 -1
  107. package/dist/persona/address-format.js +1 -1
  108. package/dist/persona/distill-goal.d.ts +20 -0
  109. package/dist/persona/distill-goal.js +1 -0
  110. package/dist/persona/index.d.ts +2 -0
  111. package/dist/persona/index.js +1 -1
  112. package/dist/persona/model.js +1 -1
  113. package/dist/playbooks/service-build/business-puzzle.js +1 -0
  114. package/dist/{project → playbooks/service-build}/context-assembly.d.ts +9 -4
  115. package/dist/playbooks/service-build/context-assembly.js +1 -0
  116. package/dist/{project → playbooks/service-build}/game-theory.d.ts +1 -1
  117. package/dist/playbooks/service-build/index.d.ts +14 -0
  118. package/dist/playbooks/service-build/index.js +1 -0
  119. package/dist/{project → playbooks/service-build}/intent-analyzer.d.ts +1 -1
  120. package/dist/playbooks/service-build/intent-analyzer.js +1 -0
  121. package/dist/playbooks/service-build/machine-nodes.js +1 -0
  122. package/dist/{project → playbooks/service-build}/machine-panorama.d.ts +5 -3
  123. package/dist/playbooks/service-build/machine-panorama.js +1 -0
  124. package/dist/{project → playbooks/service-build}/merchant-guide.d.ts +21 -1
  125. package/dist/playbooks/service-build/merchant-guide.js +1 -0
  126. package/dist/{project → playbooks/service-build}/mode-actions.d.ts +32 -8
  127. package/dist/playbooks/service-build/mode-actions.js +1 -0
  128. package/dist/playbooks/service-build/namespace.d.ts +2 -0
  129. package/dist/playbooks/service-build/namespace.js +1 -0
  130. package/dist/{project → playbooks/service-build}/object-panorama.d.ts +2 -3
  131. package/dist/playbooks/service-build/object-panorama.js +1 -0
  132. package/dist/{project → playbooks/service-build}/participation-radar.d.ts +4 -5
  133. package/dist/playbooks/service-build/participation-radar.js +1 -0
  134. package/dist/{project → playbooks/service-build}/pipeline-actions.d.ts +9 -9
  135. package/dist/playbooks/service-build/pipeline-actions.js +1 -0
  136. package/dist/playbooks/service-build/process.d.ts +6 -0
  137. package/dist/playbooks/service-build/process.js +1 -0
  138. package/dist/playbooks/service-build/relationship-profile.d.ts +2 -0
  139. package/dist/playbooks/service-build/relationship-profile.js +1 -0
  140. package/dist/playbooks/service-build/risk-aggregator.js +1 -0
  141. package/dist/{project → playbooks/service-build}/semantic-graph.d.ts +7 -3
  142. package/dist/playbooks/service-build/semantic-graph.js +1 -0
  143. package/dist/{project → playbooks/service-build}/service-panorama.d.ts +3 -19
  144. package/dist/playbooks/service-build/service-panorama.js +1 -0
  145. package/dist/relationship/derivation.d.ts +88 -0
  146. package/dist/relationship/derivation.js +1 -0
  147. package/dist/relationship/incentive.d.ts +38 -0
  148. package/dist/relationship/incentive.js +1 -0
  149. package/dist/relationship/index.d.ts +4 -0
  150. package/dist/relationship/index.js +1 -0
  151. package/dist/relationship/registry.d.ts +13 -0
  152. package/dist/relationship/registry.js +1 -0
  153. package/dist/relationship/types.d.ts +45 -0
  154. package/dist/relationship/types.js +1 -0
  155. package/dist/review/arb.d.ts +6 -0
  156. package/dist/review/arb.js +1 -0
  157. package/dist/review/demand.d.ts +3 -0
  158. package/dist/review/demand.js +1 -0
  159. package/dist/review/index.d.ts +3 -0
  160. package/dist/review/index.js +1 -0
  161. package/dist/review/machine.d.ts +3 -0
  162. package/dist/review/machine.js +1 -0
  163. package/dist/review/order.d.ts +9 -0
  164. package/dist/review/order.js +1 -0
  165. package/dist/review/progress.d.ts +3 -0
  166. package/dist/review/progress.js +1 -0
  167. package/dist/review/repository.d.ts +3 -0
  168. package/dist/review/repository.js +1 -0
  169. package/dist/review/service.d.ts +5 -0
  170. package/dist/review/service.js +1 -0
  171. package/dist/review/types.d.ts +156 -0
  172. package/dist/review/types.js +1 -0
  173. package/dist/rules.d.ts +2 -2
  174. package/dist/rules.js +1 -1
  175. package/dist/safety/confirm-gate.js +1 -1
  176. package/dist/safety/index.d.ts +1 -1
  177. package/dist/safety/index.js +1 -1
  178. package/dist/safety/preview.d.ts +1 -0
  179. package/dist/safety/preview.js +1 -1
  180. package/dist/schema/call/allocation.d.ts +1 -1
  181. package/dist/schema/call/arbitration.d.ts +1 -1
  182. package/dist/schema/call/base.d.ts +1 -1
  183. package/dist/schema/call/base.js +1 -1
  184. package/dist/schema/call/bridge.d.ts +29 -7
  185. package/dist/schema/call/bridge.js +1 -1
  186. package/dist/schema/call/contact.d.ts +1 -1
  187. package/dist/schema/call/contact.js +1 -1
  188. package/dist/schema/call/demand.d.ts +1 -1
  189. package/dist/schema/call/demand.js +1 -1
  190. package/dist/schema/call/guard.d.ts +3 -3
  191. package/dist/schema/call/handler.d.ts +0 -3
  192. package/dist/schema/call/handler.js +1 -1
  193. package/dist/schema/call/machine.d.ts +2 -2
  194. package/dist/schema/call/order.d.ts +1 -1
  195. package/dist/schema/call/payment.d.ts +1 -1
  196. package/dist/schema/call/permission.d.ts +1 -1
  197. package/dist/schema/call/personal.d.ts +1 -1
  198. package/dist/schema/call/progress.d.ts +1 -1
  199. package/dist/schema/call/proof.d.ts +2 -2
  200. package/dist/schema/call/repository.d.ts +1 -1
  201. package/dist/schema/call/repository.js +1 -1
  202. package/dist/schema/call/reward.d.ts +1 -1
  203. package/dist/schema/call/semantic.js +1 -1
  204. package/dist/schema/call/service.d.ts +1 -1
  205. package/dist/schema/call/service.js +1 -1
  206. package/dist/schema/call/treasury.d.ts +1 -1
  207. package/dist/schema/common/index.js +1 -1
  208. package/dist/schema/goal/index.d.ts +343 -0
  209. package/dist/schema/goal/index.js +1 -0
  210. package/dist/schema/goal/planning.d.ts +465 -0
  211. package/dist/schema/goal/planning.js +1 -0
  212. package/dist/schema/index.d.ts +1 -2
  213. package/dist/schema/index.js +1 -1
  214. package/dist/schema/industry-pack/index.d.ts +323 -1
  215. package/dist/schema/industry-pack/index.js +1 -1
  216. package/dist/schema/industry-pack/modes.d.ts +326 -0
  217. package/dist/schema/industry-pack/modes.js +1 -0
  218. package/dist/schema/intent-radar/index.d.ts +19 -19
  219. package/dist/schema/local/index.d.ts +11 -0
  220. package/dist/schema/local/index.js +1 -1
  221. package/dist/schema/operations.d.ts +258 -19
  222. package/dist/schema/operations.js +1 -1
  223. package/dist/schema/permission/index.d.ts +1 -0
  224. package/dist/schema/permission/index.js +1 -1
  225. package/dist/schema/persona/index.d.ts +40 -0
  226. package/dist/schema/persona/index.js +1 -1
  227. package/dist/schema/query/bi.d.ts +912 -0
  228. package/dist/schema/query/bi.js +1 -0
  229. package/dist/schema/query/index.d.ts +663 -2
  230. package/dist/schema/query/index.js +1 -1
  231. package/dist/schema/schema-version.js +1 -1
  232. package/dist/schema/utils/skills-recommendation.d.ts +0 -1
  233. package/dist/schema/utils/skills-recommendation.js +1 -1
  234. package/dist/schema-query-impl/index.js +1 -1
  235. package/dist/schemas/account_operation.output.json +32 -3
  236. package/dist/schemas/account_operation.schema.json +8 -4
  237. package/dist/schemas/bridge_operation.output.json +26 -3
  238. package/dist/schemas/bridge_operation.schema.json +85 -13
  239. package/dist/schemas/config_operation.output.json +1 -1
  240. package/dist/schemas/config_operation.schema.json +1 -1
  241. package/dist/schemas/goal_operation.schema.json +1092 -0
  242. package/dist/schemas/guard2file.schema.json +3 -3
  243. package/dist/schemas/index.json +12 -13
  244. package/dist/schemas/industry_pack_operation.output.json +1073 -0
  245. package/dist/schemas/industry_pack_operation.schema.json +236 -2
  246. package/dist/schemas/local_info_operation.output.json +2 -2
  247. package/dist/schemas/local_mark_operation.output.json +2 -2
  248. package/dist/schemas/machineNode2file.schema.json +3 -3
  249. package/dist/schemas/messenger_operation.output.json +2 -2
  250. package/dist/schemas/monitor_events.output.json +78 -3
  251. package/dist/schemas/monitor_events.schema.json +24 -1
  252. package/dist/schemas/monitor_subscription.output.json +1462 -0
  253. package/dist/schemas/monitor_subscription.schema.json +327 -0
  254. package/dist/schemas/onchain_events.output.json +5 -5
  255. package/dist/schemas/onchain_operations.output.json +2 -2
  256. package/dist/schemas/onchain_operations.schema.json +100 -100
  257. package/dist/schemas/onchain_operations_allocation.schema.json +7 -7
  258. package/dist/schemas/onchain_operations_arbitration.schema.json +6 -6
  259. package/dist/schemas/onchain_operations_contact.schema.json +6 -6
  260. package/dist/schemas/onchain_operations_demand.schema.json +6 -6
  261. package/dist/schemas/onchain_operations_gen_passport.schema.json +3 -3
  262. package/dist/schemas/onchain_operations_gen_proof.schema.json +3 -3
  263. package/dist/schemas/onchain_operations_guard.schema.json +3 -3
  264. package/dist/schemas/onchain_operations_machine.schema.json +5 -5
  265. package/dist/schemas/onchain_operations_order.schema.json +5 -5
  266. package/dist/schemas/onchain_operations_payment.schema.json +4 -4
  267. package/dist/schemas/onchain_operations_permission.schema.json +5 -5
  268. package/dist/schemas/onchain_operations_personal.schema.json +3 -3
  269. package/dist/schemas/onchain_operations_progress.schema.json +5 -5
  270. package/dist/schemas/onchain_operations_proof.schema.json +3 -3
  271. package/dist/schemas/onchain_operations_repository.schema.json +7 -7
  272. package/dist/schemas/onchain_operations_reward.schema.json +9 -9
  273. package/dist/schemas/onchain_operations_service.schema.json +11 -11
  274. package/dist/schemas/onchain_operations_treasury.schema.json +9 -9
  275. package/dist/schemas/onchain_table_data.output.json +399 -2
  276. package/dist/schemas/onchain_table_data.schema.json +22 -22
  277. package/dist/schemas/permission_operation.schema.json +6 -2
  278. package/dist/schemas/persona_operation.output.json +145 -0
  279. package/dist/schemas/persona_operation.schema.json +28 -2
  280. package/dist/schemas/query_toolkit.output.json +1514 -22
  281. package/dist/schemas/query_toolkit.schema.json +465 -11
  282. package/dist/schemas/workflow_operation.schema.json +4 -4
  283. package/dist/task/ProcessStore.d.ts +98 -0
  284. package/dist/task/ProcessStore.js +1 -0
  285. package/dist/task/playbook.d.ts +11 -0
  286. package/dist/task/playbook.js +1 -0
  287. package/dist/task/stage-gate.d.ts +22 -0
  288. package/dist/task/stage-gate.js +1 -0
  289. package/dist/{project → task}/substep-trace.d.ts +6 -45
  290. package/dist/task/types.d.ts +144 -0
  291. package/dist/task/types.js +1 -0
  292. package/dist/tools/handlers/config.js +1 -1
  293. package/dist/tools/handlers/evaluation.js +1 -1
  294. package/dist/tools/handlers/goal.d.ts +4 -0
  295. package/dist/tools/handlers/goal.js +1 -0
  296. package/dist/tools/handlers/industry-pack.js +1 -1
  297. package/dist/tools/handlers/local.d.ts +4 -3
  298. package/dist/tools/handlers/local.js +1 -1
  299. package/dist/tools/handlers/monitor.d.ts +24 -0
  300. package/dist/tools/handlers/monitor.js +1 -1
  301. package/dist/tools/handlers/network.d.ts +1 -0
  302. package/dist/tools/handlers/network.js +1 -0
  303. package/dist/tools/handlers/onchain.js +1 -1
  304. package/dist/tools/handlers/permission.js +1 -1
  305. package/dist/tools/handlers/persona.js +1 -1
  306. package/dist/tools/handlers/query.js +1 -1
  307. package/dist/tools/handlers/watch.js +1 -1
  308. package/dist/tools/handlers/workflow.js +1 -1
  309. package/dist/tools/index.d.ts +2 -0
  310. package/dist/tools/index.js +1 -1
  311. package/dist/tools/rules-hook.d.ts +1 -0
  312. package/dist/tools/rules-hook.js +1 -1
  313. package/dist/tools/shared.js +1 -1
  314. package/dist/tools/wrap.js +1 -1
  315. package/package.json +5 -4
  316. package/dist/harness/checkpoint.d.ts +0 -8
  317. package/dist/harness/checkpoint.js +0 -1
  318. package/dist/knowledge/deployment-scanner.d.ts +0 -66
  319. package/dist/knowledge/deployment-scanner.js +0 -1
  320. package/dist/mode-market/index.d.ts +0 -3
  321. package/dist/mode-market/index.js +0 -1
  322. package/dist/mode-market/registry.d.ts +0 -53
  323. package/dist/mode-market/registry.js +0 -1
  324. package/dist/mode-market/review.d.ts +0 -27
  325. package/dist/mode-market/review.js +0 -1
  326. package/dist/mode-market/submission.d.ts +0 -25
  327. package/dist/mode-market/submission.js +0 -1
  328. package/dist/project/business-puzzle.js +0 -1
  329. package/dist/project/context-assembly.js +0 -1
  330. package/dist/project/deployment-bridge.d.ts +0 -5
  331. package/dist/project/deployment-bridge.js +0 -1
  332. package/dist/project/deployment-doc.d.ts +0 -190
  333. package/dist/project/deployment-doc.js +0 -1
  334. package/dist/project/edit-planner.d.ts +0 -123
  335. package/dist/project/edit-planner.js +0 -1
  336. package/dist/project/evaluation-fix.spec.d.ts +0 -1
  337. package/dist/project/evaluation-fix.spec.js +0 -1
  338. package/dist/project/evaluation.d.ts +0 -127
  339. package/dist/project/evaluation.js +0 -1
  340. package/dist/project/graph-builder.d.ts +0 -51
  341. package/dist/project/graph-builder.js +0 -1
  342. package/dist/project/graph.d.ts +0 -70
  343. package/dist/project/graph.js +0 -1
  344. package/dist/project/handlers.d.ts +0 -524
  345. package/dist/project/handlers.js +0 -1
  346. package/dist/project/index.d.ts +0 -91
  347. package/dist/project/index.js +0 -1
  348. package/dist/project/intent-analyzer.js +0 -1
  349. package/dist/project/machine-nodes.js +0 -1
  350. package/dist/project/machine-panorama.js +0 -1
  351. package/dist/project/merchant-guide.js +0 -1
  352. package/dist/project/mode-actions.js +0 -1
  353. package/dist/project/namespace.d.ts +0 -72
  354. package/dist/project/namespace.js +0 -1
  355. package/dist/project/object-panorama.js +0 -1
  356. package/dist/project/participation-radar.js +0 -1
  357. package/dist/project/pipeline-actions.js +0 -1
  358. package/dist/project/project-store.d.ts +0 -110
  359. package/dist/project/project-store.js +0 -1
  360. package/dist/project/query.d.ts +0 -43
  361. package/dist/project/query.js +0 -1
  362. package/dist/project/risk-aggregator.js +0 -1
  363. package/dist/project/semantic-assembler.d.ts +0 -93
  364. package/dist/project/semantic-assembler.js +0 -1
  365. package/dist/project/semantic-graph.js +0 -1
  366. package/dist/project/service-panorama.js +0 -1
  367. package/dist/project/stage-gate.d.ts +0 -52
  368. package/dist/project/stage-gate.js +0 -1
  369. package/dist/project/task-tracker.d.ts +0 -30
  370. package/dist/project/task-tracker.js +0 -1
  371. package/dist/schema/project/index.d.ts +0 -2021
  372. package/dist/schema/project/index.js +0 -1
  373. package/dist/schema/task-status.d.ts +0 -62
  374. package/dist/schema/task-status.js +0 -1
  375. package/dist/schemas/project_operation.output.json +0 -7877
  376. package/dist/schemas/project_operation.schema.json +0 -1139
  377. package/dist/schemas/query_task_status.output.json +0 -211
  378. package/dist/schemas/query_task_status.schema.json +0 -18
  379. package/dist/tools/handlers/project.d.ts +0 -2
  380. package/dist/tools/handlers/project.js +0 -1
  381. package/dist/tools/handlers/task-status.d.ts +0 -2
  382. package/dist/tools/handlers/task-status.js +0 -1
  383. /package/dist/{project → playbooks/service-build}/business-puzzle.d.ts +0 -0
  384. /package/dist/{project → playbooks/service-build}/game-theory.js +0 -0
  385. /package/dist/{project → playbooks/service-build}/machine-nodes.d.ts +0 -0
  386. /package/dist/{project → playbooks/service-build}/object-type.d.ts +0 -0
  387. /package/dist/{project → playbooks/service-build}/object-type.js +0 -0
  388. /package/dist/{project → playbooks/service-build}/reverse-mapping.d.ts +0 -0
  389. /package/dist/{project → playbooks/service-build}/reverse-mapping.js +0 -0
  390. /package/dist/{project → playbooks/service-build}/risk-aggregator.d.ts +0 -0
  391. /package/dist/{project → playbooks/service-build}/workflow-design-assessment.d.ts +0 -0
  392. /package/dist/{project → playbooks/service-build}/workflow-design-assessment.js +0 -0
  393. /package/dist/{project → task}/substep-trace.js +0 -0
@@ -1 +1 @@
1
- import*as a347a from'@wowok/wowok';const SDK_SCHEMA_VERSION=a347a['SCHEMA_VERSION']??'1.0.0',checkSchemaCompatibility=a347a['checkSchemaCompatibility']??((a,b)=>({'compatible':!![]}));export const MCP_SCHEMA_VERSION='1.0.0';export function getSchemaVersions(){return{'sdk':SDK_SCHEMA_VERSION,'mcp':MCP_SCHEMA_VERSION};}export function checkClientSchemaCompatibility(a,b={}){const c=getSchemaVersions(),d={'compatible':!![],'warnings':[],'errors':[],'versions':c,'client_version':a};if(!a)return d;const e=checkSchemaCompatibility(a,c['sdk']);if(!e['compatible']){d['compatible']=![];const g='SDK\x20schema\x20incompatibility:\x20'+e['reason'];b['mode']==='strict'?d['errors']['push'](g):d['warnings']['push'](g);}const f=checkSchemaCompatibility(a,c['mcp']);if(!f['compatible']){d['compatible']=![];const h='MCP\x20schema\x20incompatibility:\x20'+f['reason'];b['mode']==='strict'?d['errors']['push'](h):d['warnings']['push'](h);}return d;}export function attachSchemaWarning(a,b){if(b['warnings']['length']===0x0&&b['errors']['length']===0x0)return a;const c=[];b['warnings']['length']>0x0&&c['push'](...b['warnings']);b['errors']['length']>0x0&&c['push'](...b['errors']);const d=a['semantic']?{...a['semantic'],'warnings':[...a['semantic']['warnings']||[],...c]}:undefined;return{...a,'semantic':d,'schema_warning':{'compatible':b['compatible'],'warnings':c,'client_version':b['client_version'],'server_versions':b['versions']}};}
1
+ import*as a369a from'@wowok/wowok';const SDK_SCHEMA_VERSION=a369a['SCHEMA_VERSION']??'1.0.0',checkSchemaCompatibility=a369a['checkSchemaCompatibility']??((a,b)=>({'compatible':!![]}));export const MCP_SCHEMA_VERSION='1.0.0';export function getSchemaVersions(){return{'sdk':SDK_SCHEMA_VERSION,'mcp':MCP_SCHEMA_VERSION};}export function checkClientSchemaCompatibility(a,b={}){const c=getSchemaVersions(),d={'compatible':!![],'warnings':[],'errors':[],'versions':c,'client_version':a};if(!a)return d;const e=checkSchemaCompatibility(a,c['sdk']);if(!e['compatible']){d['compatible']=![];const g='SDK\x20schema\x20incompatibility:\x20'+e['reason'];b['mode']==='strict'?d['errors']['push'](g):d['warnings']['push'](g);}const f=checkSchemaCompatibility(a,c['mcp']);if(!f['compatible']){d['compatible']=![];const h='MCP\x20schema\x20incompatibility:\x20'+f['reason'];b['mode']==='strict'?d['errors']['push'](h):d['warnings']['push'](h);}return d;}export function attachSchemaWarning(a,b){if(b['warnings']['length']===0x0&&b['errors']['length']===0x0)return a;const c=[];b['warnings']['length']>0x0&&c['push'](...b['warnings']);b['errors']['length']>0x0&&c['push'](...b['errors']);const d=a['semantic']?{...a['semantic'],'warnings':[...a['semantic']['warnings']||[],...c]}:undefined;return{...a,'semantic':d,'schema_warning':{'compatible':b['compatible'],'warnings':c,'client_version':b['client_version'],'server_versions':b['versions']}};}
@@ -1,3 +1,2 @@
1
1
  export declare function getSkillsHintForOnchain(operationType: string, data?: unknown): string | undefined;
2
- export declare function getSkillsHintForProject(action: string): string | undefined;
3
2
  export declare function getSkillsHintForEvaluation(action: string): string | undefined;
@@ -1 +1 @@
1
- const SKILLS_BY_OPERATION_TYPE={'service':['wowok-provider'],'machine':['wowok-machine'],'guard':[],'arbitration':['wowok-arbitrator'],'allocation':['wowok-provider'],'permission':[],'treasury':['wowok-provider'],'reward':['wowok-provider'],'repository':['wowok-provider'],'demand':['wowok-provider','wowok-supplier'],'contact':['wowok-messenger'],'order':['wowok-order'],'progress':['wowok-collaborator'],'personal':[],'payment':[],'proof':[]},SKILLS_BY_PROJECT_ACTION={'create_project':['wowok-onboard','wowok-planner'],'create_project_from_onchain':['wowok-onboard'],'evaluate_project':['wowok-auditor'],'pre_evaluate_check':['wowok-auditor'],'verify_deployment':['wowok-auditor'],'generate_deployment_doc':['wowok-planner'],'migrate_to_mainnet':['wowok-onboard'],'migrate_network':['wowok-onboard'],'clone_project_to_network':['wowok-onboard'],'build_graph':['wowok-planner'],'list_projects':[],'get_project_detail':[],'update_project':[],'add_object':[],'remove_object':[],'update_object':[],'create_version':[],'get_graph':[],'save_evaluation':[],'compare_projects':[],'refresh_objects':[],'get_object_diff':[],'delete_project':[],'assemble_context':[],'get_machine_graph':['wowok-machine'],'get_guard_graph':[],'plan_object_edit':['wowok-machine','wowok-auditor'],'apply_object_edit':[],'patch_machine_nodes':['wowok-machine'],'patch_guard_tree':[],'participation_radar':['wowok-order','wowok-supplier','wowok-collaborator','wowok-messenger']};export function getSkillsHintForOnchain(a,b){const c=SKILLS_BY_OPERATION_TYPE[a];if(!c||c['length']===0x0)return undefined;const d=b?.['publish']===!![],e=!!b?.['order_allocators'],f=d||e,g=f?'SKILLS\x20RECOMMENDED\x20(complex\x20operation\x20—\x20skills\x20provide\x20business-semantic\x20guidance):':'SKILLS\x20RECOMMENDED\x20(optional\x20—\x20skills\x20provide\x20deeper\x20guidance):';return g+'\x20'+c['join'](',\x20')+'.\x20'+'skills\x20focus\x20on\x20business\x20intent\x20→\x20object\x20parameter\x20translation;\x20'+'MCP\x20handles\x20object\x20structure\x20and\x20on-chain\x20execution.\x20'+'If\x20skills\x20are\x20installed,\x20consult\x20them\x20BEFORE\x20this\x20call\x20for\x20design\x20rationale.\x20'+'If\x20not\x20installed,\x20MCP\x20executes\x20independently\x20—\x20this\x20hint\x20is\x20informational\x20only.';}export function getSkillsHintForProject(a){const b=SKILLS_BY_PROJECT_ACTION[a];if(!b||b['length']===0x0)return undefined;return'SKILLS\x20RECOMMENDED\x20(optional\x20—\x20skills\x20provide\x20deeper\x20guidance):\x20'+b['join'](',\x20')+'.\x20'+'skills\x20focus\x20on\x20business\x20intent\x20→\x20object\x20parameter\x20translation;\x20'+'MCP\x20handles\x20project\x20structure\x20and\x20evaluation.\x20'+'If\x20skills\x20are\x20installed,\x20consult\x20them\x20for\x20design/planning\x20rationale.\x20'+'If\x20not\x20installed,\x20MCP\x20executes\x20independently\x20—\x20this\x20hint\x20is\x20informational\x20only.';}const SKILLS_BY_EVALUATION_ACTION={'match_discover':['wowok-market'],'discover_services':['wowok-market'],'discover_demands':['wowok-market'],'arbitration_score':['wowok-market','wowok-arbitrator'],'account_events':['wowok-market'],'market_metrics':['wowok-market'],'anti_cheat':['wowok-market'],'market_operations':['wowok-market']};export function getSkillsHintForEvaluation(a){const b=SKILLS_BY_EVALUATION_ACTION[a];if(!b||b['length']===0x0)return undefined;return'SKILLS\x20RECOMMENDED\x20(optional\x20—\x20skills\x20provide\x20deeper\x20guidance):\x20'+b['join'](',\x20')+'.\x20'+'skills\x20focus\x20on\x20market/operational\x20intent\x20→\x20action\x20parameters;\x20'+'MCP\x20handles\x20enumeration,\x20scoring\x20and\x20on-chain\x20execution.\x20'+'If\x20not\x20installed,\x20MCP\x20executes\x20independently\x20—\x20this\x20hint\x20is\x20informational\x20only.';}
1
+ const SKILLS_BY_OPERATION_TYPE={'service':['wowok-provider'],'machine':['wowok-machine'],'guard':[],'arbitration':['wowok-arbitrator'],'allocation':['wowok-provider'],'permission':[],'treasury':['wowok-provider'],'reward':['wowok-provider'],'repository':['wowok-provider'],'demand':['wowok-provider','wowok-supplier'],'contact':['wowok-messenger'],'order':['wowok-order'],'progress':['wowok-collaborator'],'personal':[],'payment':[],'proof':[]};export function getSkillsHintForOnchain(a,b){const c=SKILLS_BY_OPERATION_TYPE[a];if(!c||c['length']===0x0)return undefined;const d=b?.['publish']===!![],e=!!b?.['order_allocators'],f=d||e,g=f?'SKILLS\x20RECOMMENDED\x20(complex\x20operation\x20—\x20skills\x20provide\x20business-semantic\x20guidance):':'SKILLS\x20RECOMMENDED\x20(optional\x20—\x20skills\x20provide\x20deeper\x20guidance):';return g+'\x20'+c['join'](',\x20')+'.\x20'+'skills\x20focus\x20on\x20business\x20intent\x20→\x20object\x20parameter\x20translation;\x20'+'MCP\x20handles\x20object\x20structure\x20and\x20on-chain\x20execution.\x20'+'If\x20skills\x20are\x20installed,\x20consult\x20them\x20BEFORE\x20this\x20call\x20for\x20design\x20rationale.\x20'+'If\x20not\x20installed,\x20MCP\x20executes\x20independently\x20—\x20this\x20hint\x20is\x20informational\x20only.';}const SKILLS_BY_EVALUATION_ACTION={'match_discover':['wowok-market'],'discover_services':['wowok-market'],'discover_demands':['wowok-market'],'arbitration_score':['wowok-market','wowok-arbitrator'],'account_events':['wowok-market'],'market_metrics':['wowok-market'],'anti_cheat':['wowok-market'],'market_operations':['wowok-market']};export function getSkillsHintForEvaluation(a){const b=SKILLS_BY_EVALUATION_ACTION[a];if(!b||b['length']===0x0)return undefined;return'SKILLS\x20RECOMMENDED\x20(optional\x20—\x20skills\x20provide\x20deeper\x20guidance):\x20'+b['join'](',\x20')+'.\x20'+'skills\x20focus\x20on\x20market/operational\x20intent\x20→\x20action\x20parameters;\x20'+'MCP\x20handles\x20enumeration,\x20scoring\x20and\x20on-chain\x20execution.\x20'+'If\x20not\x20installed,\x20MCP\x20executes\x20independently\x20—\x20this\x20hint\x20is\x20informational\x20only.';}
@@ -1 +1 @@
1
- import{readFileSync,existsSync,writeFileSync,mkdirSync,readdirSync}from'fs';import{resolve,join,dirname}from'path';import{fileURLToPath}from'url';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'../knowledge/tools-reference.js';import{GUARD_DESIGN_PATTERNS,getGuardDesignPattern,GUARD_DESIGN_PATTERNS_VERSION}from'../knowledge/guard-design-patterns.js';import{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';import{listTemplates as a360a,getTemplateDetail,instantiateTemplate,getTemplateCounts,TEMPLATE_OBJECT_TYPES}from'../knowledge/template-registry.js';const __filename=fileURLToPath(import.meta.url),__dirname=fileURLToPath(new URL('.',import.meta.url)),SCHEMAS_DIR=resolve(__dirname,'../../dist/schemas'),GUARD_TEMPLATES_PATH_SCRIPTS=resolve(__dirname,'../../scripts/guard-templates.json'),GUARD_TEMPLATES_PATH_DIST=resolve(__dirname,'../../dist/schemas/guard-templates.json'),GUARD_TEMPLATES_PATH=existsSync(GUARD_TEMPLATES_PATH_SCRIPTS)?GUARD_TEMPLATES_PATH_SCRIPTS:GUARD_TEMPLATES_PATH_DIST,EXAMPLES_DIR_SCRIPTS=resolve(__dirname,'../../scripts/examples'),EXAMPLES_DIR_DIST=resolve(__dirname,'../examples');export const EXAMPLES_DIR=existsSync(EXAMPLES_DIR_SCRIPTS)?EXAMPLES_DIR_SCRIPTS:EXAMPLES_DIR_DIST;const WORKSPACE_TMP_DIR=resolve(process['cwd'](),'.trae','tmp');export function areSchemasAvailable(){return existsSync(SCHEMAS_DIR)&&existsSync(join(SCHEMAS_DIR,'index.json'));}export function getSchemaIndex(){try{const a=join(SCHEMAS_DIR,'index.json');if(!existsSync(a))return null;const b=readFileSync(a,'utf-8');return JSON['parse'](b);}catch{return null;}}export function listSchemas(){const a=getSchemaIndex();if(!a)return[];return[...a['tools']||[],...a['operations']||[]];}export function getSchema(a){try{let b=join(SCHEMAS_DIR,a+'.schema.json');!existsSync(b)&&(b=join(SCHEMAS_DIR,a+'.json'));if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getOutputSchema(a){try{const b=join(SCHEMAS_DIR,a+'.output.json');if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getGuardTemplates(a){try{if(!existsSync(GUARD_TEMPLATES_PATH))return null;const b=readFileSync(GUARD_TEMPLATES_PATH,'utf-8'),c=JSON['parse'](b);if(!a)return{'version':c['version'],'description':c['description'],'templates':(c['templates']||[])['map'](e=>({'name':e['name'],'title':e['title'],'description':e['description'],'use_case':e['use_case']})),'query_reference':c['query_reference'],'node_return_types':c['node_return_types']};const d=(c['templates']||[])['find'](e=>e['name']===a);if(!d)return null;return d;}catch{return null;}}export function searchExamples(a){if(!existsSync(EXAMPLES_DIR))return[];let b;try{b=readdirSync(EXAMPLES_DIR);}catch{return[];}const c=a['toLowerCase']()['trim']();if(!c)return[];const d=[];for(const e of b){if(!e['endsWith']('.json'))continue;const f=join(EXAMPLES_DIR,e);try{const g=readFileSync(f,'utf-8'),h=JSON['parse'](g),i=String(h['title']??''),j=String(h['description']??''),k=Array['isArray'](h['tags'])?h['tags']['map'](o=>String(o)):[],l=String(h['operation_type']??''),m=String(h['industry']??''),n=[];i['toLowerCase']()['includes'](c)&&n['push']('title'),j['toLowerCase']()['includes'](c)&&n['push']('description'),k['some'](o=>o['toLowerCase']()===c)&&n['push']('tags'),l&&l['toLowerCase']()===c&&n['push']('operation_type'),m&&m['toLowerCase']()===c&&n['push']('industry'),n['length']>0x0&&d['push']({'file':e,'title':i,'description':j,'tags':k,'industry':m,'operation_type':l,'verified':h['verified']===!![],'score':n['length'],'matched_fields':n});}catch{continue;}}return d['sort']((o,p)=>{if(p['score']!==o['score'])return p['score']-o['score'];return o['file']['localeCompare'](p['file']);}),d;}export function getSchemaField(a,b){const c=getSchema(a);if(!c)return null;const d=b['split']('.')['filter'](Boolean);let e=c;for(const f of d){if(!e||typeof e!=='object')return null;if(e['properties']&&f in e['properties']){e=e['properties'][f];continue;}if(e['items']&&typeof e['items']==='object'){if(/^\d+$/['test'](f)){e=e['items'];continue;}if(e['items']['properties']&&f in e['items']['properties']){e=e['items']['properties'][f];continue;}}if(Array['isArray'](e['oneOf'])||Array['isArray'](e['anyOf'])){const g=e['oneOf']??e['anyOf'];for(const h of g){if(h&&typeof h==='object'&&h['properties']&&f in h['properties']){e=h['properties'][f];break;}}continue;}if(f in e){e=e[f];continue;}return null;}return e;}function resolveSchemaRefs(a,b=new Set()){if(!a||typeof a!=='object')return a;if(Array['isArray'](a))return a['map'](d=>resolveSchemaRefs(d,b));const c={};for(const [d,e]of Object['entries'](a)){if(d==='$ref'&&typeof e==='string'){if(e['startsWith']('#'))c[d]=e;else{const f=loadRefSchema(e,b);f&&Object['assign'](c,resolveSchemaRefs(f,b));}}else typeof e==='object'?c[d]=resolveSchemaRefs(e,b):c[d]=e;}return c;}function loadRefSchema(a,b){if(a['startsWith']('#'))return null;if(b['has'](a))return{'description':'Circular\x20reference\x20to\x20'+a};b['add'](a);try{const c=join(SCHEMAS_DIR,a);if(!existsSync(c))return null;const d=readFileSync(c,'utf-8');return JSON['parse'](d);}catch{return null;}}export function searchSchemas(a){const b=listSchemas(),c=a['toLowerCase']();return b['filter'](d=>{const e=d['name']['toLowerCase']()['includes'](c),f=d['title']?.['toLowerCase']()['includes'](c),g=d['description']?.['toLowerCase']()['includes'](c);return e||f||g;});}export function listOperations(){const a=getSchemaIndex();if(!a)return[];return(a['operations']||[])['filter'](b=>b['name']['startsWith']('onchain_operations_'));}function writeResponseToFile(a,b){try{let c;if(b)c=resolve(process['cwd'](),b);else{!existsSync(WORKSPACE_TMP_DIR)&&mkdirSync(WORKSPACE_TMP_DIR,{'recursive':!![]});const g=Date['now']();c=join(WORKSPACE_TMP_DIR,'schema-'+g+'.json');}const d=dirname(c);!existsSync(d)&&mkdirSync(d,{'recursive':!![]});const f=typeof a==='string'?a:JSON['stringify'](a,null,0x2);return writeFileSync(c,f,'utf-8'),c;}catch(h){return null;}}export function processSchemaQuery(a){const {action:b,name:c,query:d,field_path:f,template:g,output_file:h,object_type:i,params:j}=a;if(b==='get_guard_templates'){const k=getGuardTemplates(g);if(!k)return{'success':![],'action':b,'data':null,'message':g?'Guard\x20template\x20\x27'+g+'\x27\x20not\x20found.\x20Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.':'Guard\x20templates\x20file\x20not\x20found.\x20Ensure\x20scripts/guard-templates.json\x20exists.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.','Available\x20template\x20names:\x20signer_verification,\x20progress_node_check,\x20order_owner_verification,\x20service_belonging_check,\x20reward_not_claimed,\x20combined_reward_guard']};if(h){const l=writeResponseToFile(k,h);if(l)return{'success':!![],'action':b,'data':null,'message':'Guard\x20template'+(g?'\x20\x27'+g+'\x27':'s')+'\x20written\x20to\x20file:\x20'+l,'output_file_path':l,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+l]};}return{'success':!![],'action':b,'data':k,'message':g?'Retrieved\x20Guard\x20template:\x20'+g:'Retrieved\x20'+(Array['isArray'](k['templates'])?k['templates']['length']:0x0)+'\x20Guard\x20templates'};}if(b==='get_templates'){if(!g){const p=a360a(i),q=getTemplateCounts(),r={'total':p['length'],'filter':i??null,'counts_by_object_type':q,'templates':p};if(h){const s=writeResponseToFile(r,h);if(s)return{'success':!![],'action':b,'data':null,'message':p['length']+'\x20templates\x20written\x20to\x20file:\x20'+s,'output_file_path':s,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+s]};}return{'success':!![],'action':b,'data':r,'message':p['length']+'\x20template(s)'+(i?'\x20for\x20object_type=\x27'+i+'\x27':'')+'\x20'+('(total\x20registry:\x20'+Object['values'](q)['reduce']((t,u)=>t+u,0x0)+'\x20across\x20'+TEMPLATE_OBJECT_TYPES['length']+'\x20object\x20types).\x20')+'Provide\x20\x27template\x27\x20(id)\x20for\x20full\x20detail;\x20add\x20\x27params\x27\x20(JSON\x20string)\x20to\x20instantiate.'};}if(!j){const t=getTemplateDetail(g);if(!t)return{'success':![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20registry.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20template\x20metadata\x20(id\x20+\x20object_type\x20+\x20parameters).','Filter\x20by\x20object_type:\x20'+TEMPLATE_OBJECT_TYPES['join'](',\x20')]};if(h){const u=writeResponseToFile(t,h);if(u)return{'success':!![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20detail\x20written\x20to\x20file:\x20'+u,'output_file_path':u,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+u]};}return{'success':!![],'action':b,'data':t,'message':'Template\x20\x27'+g+'\x27\x20('+t['object_type']+',\x20'+(t['instantiable']?'instantiable':'guidance-only')+').\x20'+'To\x20instantiate,\x20call\x20again\x20with\x20\x27params\x27\x20=\x20JSON\x20object\x20of\x20the\x20declared\x20parameters.'};}let m;try{const v=JSON['parse'](j);if(!v||typeof v!=='object'||Array['isArray'](v))return{'success':![],'action':b,'data':null,'message':'\x27params\x27\x20must\x20be\x20a\x20JSON\x20object\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27),\x20got\x20'+(Array['isArray'](v)?'array':typeof v)+'.'};m=v;}catch(w){return{'success':![],'action':b,'data':null,'message':'Failed\x20to\x20parse\x20\x27params\x27\x20as\x20JSON:\x20'+(w instanceof Error?w['message']:String(w)),'suggestions':['Example:\x20params=\x27{\x22whitelist\x22:[\x220xabc...\x22]}\x27']};}const n=instantiateTemplate(g,m);if(!n['ok'])return{'success':![],'action':b,'data':n['guidance']!==undefined?{'guidance':n['guidance']}:null,'message':'Instantiation\x20failed\x20for\x20\x27'+g+'\x27:\x20'+n['error'],'suggestions':n['missing_params']?['Missing\x20required\x20params:\x20'+n['missing_params']['join'](',\x20'),'Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']:['Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']};const o={'object_type':n['object_type'],'template_id':n['template_id'],'body':n['body'],...n['notes']?{'notes':n['notes']}:{}};if(h){const x=writeResponseToFile(o,h);if(x)return{'success':!![],'action':b,'data':null,'message':'Instantiated\x20template\x20\x27'+g+'\x27\x20written\x20to\x20file:\x20'+x,'output_file_path':x,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+x]};}return{'success':!![],'action':b,'data':o,'message':'Instantiated\x20\x27'+g+'\x27\x20('+n['object_type']+').\x20'+'Review\x20the\x20body\x20against\x20the\x20onchain_operations\x20schema\x20before\x20submitting.'};}if(b==='search_examples'){if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search_examples\x27\x20action','suggestions':['Provide\x20a\x20\x27query\x27\x20string\x20(e.g.\x20\x27rental\x27,\x20\x27guard\x27,\x20\x27service\x27,\x20\x27machine\x27)','Searchable\x20fields:\x20title,\x20description,\x20tags,\x20operation_type,\x20industry']};const y=searchExamples(d);return{'success':!![],'action':b,'data':y,'message':'Found\x20'+y['length']+'\x20example(s)\x20matching\x20\x27'+d+'\x27','suggestions':y['length']===0x0?['Try\x20broader\x20terms\x20like\x20\x27service\x27,\x20\x27machine\x27,\x20\x27guard\x27,\x20\x27permission\x27','Try\x20an\x20industry\x20name:\x20\x27rental\x27,\x20\x27retail\x27,\x20\x27general\x27','Use\x20\x27get\x27\x20action\x20with\x20a\x20schema\x20name\x20to\x20see\x20the\x20full\x20JSON\x20Schema']:undefined};}if(b==='get_tool_reference'){if(c){const A=getToolReference(c);if(!A)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found\x20in\x20the\x20tool\x20reference.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20all\x20tools.','Available\x20tools:\x20'+TOOLS_REFERENCE['map'](C=>C['name'])['join'](',\x20')]};const B=getToolSequence(c);return{'success':!![],'action':b,'data':{'tool':A,'call_sequence':B??null},'message':'Retrieved\x20tool\x20reference:\x20'+c};}if(d){const C=searchToolReference(d);return{'success':!![],'action':b,'data':{'tools':C,'count':C['length']},'message':'Found\x20'+C['length']+'\x20tool(s)\x20matching\x20\x27'+d+'\x27','suggestions':C['length']===0x0?['Try\x20a\x20broader\x20keyword\x20(e.g.\x20\x27onchain\x27,\x20\x27guard\x27,\x20\x27schema\x27),\x20or\x20omit\x20\x27query\x27\x20to\x20list\x20all\x20tools.']:undefined};}const z=TOOLS_REFERENCE['map'](D=>({'name':D['name'],'summary':D['summary'],'actions':D['actions']??[],'notes':D['notes']??[]}));return{'success':!![],'action':b,'data':{'tools':z,'count':z['length']},'message':'Retrieved\x20reference\x20for\x20'+z['length']+'\x20MCP\x20tools.\x20Pass\x20name=\x27<tool>\x27\x20for\x20full\x20detail\x20(params,\x20prerequisites,\x20follow-ups).'};}if(b==='get_guard_design_patterns'){if(c){const E=getGuardDesignPattern(c);if(!E)return{'success':![],'action':b,'data':null,'message':'Guard\x20design\x20pattern\x20\x27'+c+'\x27\x20not\x20found.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20the\x20full\x20catalog.','Available\x20pattern\x20ids:\x20'+GUARD_DESIGN_PATTERNS['map'](F=>F['id'])['join'](',\x20')]};return{'success':!![],'action':b,'data':{'pattern':E},'message':'Retrieved\x20Guard\x20design\x20pattern:\x20'+c};}if(d){const F=GUARD_DESIGN_PATTERNS['filter'](H=>H['host']===d),G=F['length']>0x0?F:GUARD_DESIGN_PATTERNS['filter'](H=>H['business_requirement']['toLowerCase']()['includes'](d['toLowerCase']())||H['logic_summary']['toLowerCase']()['includes'](d['toLowerCase']()));return{'success':!![],'action':b,'data':{'patterns':G,'count':G['length'],'filtered_by':F['length']>0x0?'host':'keyword'},'message':'Found\x20'+G['length']+'\x20Guard\x20design\x20pattern(s)\x20matching\x20\x27'+d+'\x27','suggestions':G['length']===0x0?['Filter\x20by\x20host:\x20service_buy_guard,\x20service_allocator_guard,\x20machine_forward,\x20progress_submission,\x20reward_claim,\x20repository_write,\x20arbitration_usage,\x20arbitration_voting,\x20gen_passport']:undefined};}const D=GUARD_DESIGN_PATTERNS['map'](H=>({'id':H['id'],'business_requirement':H['business_requirement'],'host':H['host'],'data_source':H['data_source'],'verifier_level':H['verifier_level'],'logic_summary':H['logic_summary'],'key_queries':H['key_queries'],'notes':H['notes']??[]}));return{'success':!![],'action':b,'data':{'patterns':D,'count':D['length'],'version':GUARD_DESIGN_PATTERNS_VERSION},'message':'Retrieved\x20'+D['length']+'\x20Guard\x20design\x20patterns.\x20Pass\x20name=\x27<pattern_id>\x27\x20for\x20full\x20detail\x20(witness\x20types,\x20mitigated\x20risks,\x20industries).'};}if(b==='get_safety_rules')return{'success':!![],'action':b,'data':{'version':SAFETY_RULES_VERSION,'object_reuse_rules':OBJECT_REUSE_RULES,'create_vs_modify_pattern':CREATE_VS_MODIFY_PATTERN,'immutability_rules':IMMUTABILITY_RULES,'operation_type_classification':OPERATION_TYPE_CLASSIFICATION,'operation_class_meta':OPERATION_CLASS_META,'naming_conventions':NAMING_CONVENTIONS},'message':'Retrieved\x20safety\x20rule\x20tables\x20(reuse\x20/\x20immutability\x20/\x20operation\x20classification\x20/\x20naming).\x20'+'Key\x20points:\x20prefer\x20REUSING\x20existing\x20objects\x20(string\x20reference\x20=\x20reuse,\x20object\x20shape\x20=\x20create);\x20'+'Machine\x20publish\x20locks\x20nodes/pairs/forwards,\x20Service\x20publish\x20locks\x20machine/order_allocators/arbitrations\x20(sales\x20stays\x20mutable);\x20'+'Guard\x20is\x20CREATE-only\x20immutable;\x20on-chain\x20writes\x20require\x20explicit\x20user\x20confirmation.'};if(!areSchemasAvailable())return{'success':![],'action':b,'data':null,'message':'Schema\x20files\x20are\x20not\x20available.\x20Please\x20run\x20\x27npm\x20run\x20generate:schemas\x27\x20first.','suggestions':['Run\x20\x27npm\x20run\x20generate:schemas\x27\x20to\x20generate\x20schema\x20files','Ensure\x20the\x20dist/schemas\x20directory\x20exists']};switch(b){case'list':{const H=listSchemas();return{'success':!![],'action':b,'data':H,'message':'Found\x20'+H['length']+'\x20available\x20schemas'};}case'get':{if(!c)return{'success':![],'action':b,'data':null,'message':'Schema\x20name\x20is\x20required\x20for\x20\x27get\x27\x20action','suggestions':['Provide\x20a\x20schema\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};const I=getSchema(c);if(!I){const J=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20not\x20found','suggestions':J['length']>0x0?J['map'](K=>'Did\x20you\x20mean:\x20'+K['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};}if(h){const K=writeResponseToFile(I,h);if(K)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+K,'output_file_path':K,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+K]};}return{'success':!![],'action':b,'data':I,'message':'Retrieved\x20schema:\x20'+c};}case'get_field':{if(!c||!f)return{'success':![],'action':b,'data':null,'message':'Both\x20\x27name\x27\x20and\x20\x27field_path\x27\x20are\x20required\x20for\x20\x27get_field\x27\x20action','suggestions':['Example:\x20{action:\x20\x27get_field\x27,\x20name:\x20\x27onchain_operations_machine\x27,\x20field_path:\x20\x27data.node\x27}','Use\x20\x27get\x27\x20action\x20to\x20retrieve\x20the\x20full\x20schema']};const L=getSchemaField(c,f);if(!L)return{'success':![],'action':b,'data':null,'message':'Field\x20path\x20\x27'+f+'\x27\x20not\x20found\x20in\x20schema\x20\x27'+c+'\x27','suggestions':['Check\x20the\x20field\x20path\x20(dot-separated,\x20e.g.\x20\x27data.node\x27)','Use\x20\x27get\x27\x20action\x20to\x20see\x20the\x20full\x20schema\x20structure']};return{'success':!![],'action':b,'data':L,'message':'Retrieved\x20field\x20\x27'+f+'\x27\x20from\x20schema\x20\x27'+c+'\x27'};}case'search':{if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search\x27\x20action'};const M=searchSchemas(d);return{'success':!![],'action':b,'data':M,'message':'Found\x20'+M['length']+'\x20schemas\x20matching\x20\x27'+d+'\x27'};}case'list_operations':{const N=listOperations();return{'success':!![],'action':b,'data':N,'message':'Found\x20'+N['length']+'\x20on-chain\x20operations'};}case'get_output':{if(!c)return{'success':![],'action':b,'data':null,'message':'Tool\x20name\x20is\x20required\x20for\x20\x27get_output\x27\x20action','suggestions':['Provide\x20a\x20tool\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools\x20and\x20their\x20outputPath']};const O=getOutputSchema(c);if(!O){const P=listSchemas(),Q=P['find'](S=>S['name']===c);if(Q)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20exists\x20but\x20has\x20no\x20output\x20schema\x20file.\x20The\x20tool\x20may\x20not\x20declare\x20an\x20outputSchema,\x20or\x20the\x20schema\x20file\x20was\x20not\x20generated.','suggestions':['Use\x20\x27get\x27\x20action\x20with\x20name=\x27'+c+'\x27\x20to\x20retrieve\x20its\x20input\x20schema']};const R=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found','suggestions':R['length']>0x0?R['map'](S=>'Did\x20you\x20mean:\x20'+S['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools']};}if(h){const S=writeResponseToFile(O,h);if(S)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+S,'output_file_path':S,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+S]};}return{'success':!![],'action':b,'data':O,'message':'Retrieved\x20output\x20schema:\x20'+c};}default:return{'success':![],'action':b,'data':null,'message':'Unknown\x20action:\x20'+b,'suggestions':['Use\x20\x27list\x27,\x20\x27get\x27,\x20\x27get_field\x27,\x20\x27get_output\x27,\x20\x27search\x27,\x20\x27list_operations\x27,\x20\x27get_guard_templates\x27,\x20or\x20\x27search_examples\x27']};}}
1
+ import{readFileSync,existsSync,writeFileSync,mkdirSync,readdirSync}from'fs';import{resolve,join,dirname}from'path';import{fileURLToPath}from'url';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'../knowledge/tools-reference.js';import{GUARD_DESIGN_PATTERNS,getGuardDesignPattern,GUARD_DESIGN_PATTERNS_VERSION}from'../knowledge/guard-design-patterns.js';import{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';import{listTemplates as a381a,getTemplateDetail,instantiateTemplate,getTemplateCounts,TEMPLATE_OBJECT_TYPES}from'../knowledge/template-registry.js';const __filename=fileURLToPath(import.meta.url),__dirname=fileURLToPath(new URL('.',import.meta.url)),SCHEMAS_DIR=resolve(__dirname,'../../dist/schemas'),GUARD_TEMPLATES_PATH_SCRIPTS=resolve(__dirname,'../../scripts/guard-templates.json'),GUARD_TEMPLATES_PATH_DIST=resolve(__dirname,'../../dist/schemas/guard-templates.json'),GUARD_TEMPLATES_PATH=existsSync(GUARD_TEMPLATES_PATH_SCRIPTS)?GUARD_TEMPLATES_PATH_SCRIPTS:GUARD_TEMPLATES_PATH_DIST,EXAMPLES_DIR_SCRIPTS=resolve(__dirname,'../../scripts/examples'),EXAMPLES_DIR_DIST=resolve(__dirname,'../examples');export const EXAMPLES_DIR=existsSync(EXAMPLES_DIR_SCRIPTS)?EXAMPLES_DIR_SCRIPTS:EXAMPLES_DIR_DIST;const WORKSPACE_TMP_DIR=resolve(process['cwd'](),'.trae','tmp');export function areSchemasAvailable(){return existsSync(SCHEMAS_DIR)&&existsSync(join(SCHEMAS_DIR,'index.json'));}export function getSchemaIndex(){try{const a=join(SCHEMAS_DIR,'index.json');if(!existsSync(a))return null;const b=readFileSync(a,'utf-8');return JSON['parse'](b);}catch{return null;}}export function listSchemas(){const a=getSchemaIndex();if(!a)return[];return[...a['tools']||[],...a['operations']||[]];}export function getSchema(a){try{let b=join(SCHEMAS_DIR,a+'.schema.json');!existsSync(b)&&(b=join(SCHEMAS_DIR,a+'.json'));if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getOutputSchema(a){try{const b=join(SCHEMAS_DIR,a+'.output.json');if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getGuardTemplates(a){try{if(!existsSync(GUARD_TEMPLATES_PATH))return null;const b=readFileSync(GUARD_TEMPLATES_PATH,'utf-8'),c=JSON['parse'](b);if(!a)return{'version':c['version'],'description':c['description'],'templates':(c['templates']||[])['map'](e=>({'name':e['name'],'title':e['title'],'description':e['description'],'use_case':e['use_case']})),'query_reference':c['query_reference'],'node_return_types':c['node_return_types']};const d=(c['templates']||[])['find'](e=>e['name']===a);if(!d)return null;return d;}catch{return null;}}export function searchExamples(a){if(!existsSync(EXAMPLES_DIR))return[];let b;try{b=readdirSync(EXAMPLES_DIR);}catch{return[];}const c=a['toLowerCase']()['trim']();if(!c)return[];const d=[];for(const e of b){if(!e['endsWith']('.json'))continue;const f=join(EXAMPLES_DIR,e);try{const g=readFileSync(f,'utf-8'),h=JSON['parse'](g),i=String(h['title']??''),j=String(h['description']??''),k=Array['isArray'](h['tags'])?h['tags']['map'](o=>String(o)):[],l=String(h['operation_type']??''),m=String(h['industry']??''),n=[];i['toLowerCase']()['includes'](c)&&n['push']('title'),j['toLowerCase']()['includes'](c)&&n['push']('description'),k['some'](o=>o['toLowerCase']()===c)&&n['push']('tags'),l&&l['toLowerCase']()===c&&n['push']('operation_type'),m&&m['toLowerCase']()===c&&n['push']('industry'),n['length']>0x0&&d['push']({'file':e,'title':i,'description':j,'tags':k,'industry':m,'operation_type':l,'verified':h['verified']===!![],'score':n['length'],'matched_fields':n});}catch{continue;}}return d['sort']((o,p)=>{if(p['score']!==o['score'])return p['score']-o['score'];return o['file']['localeCompare'](p['file']);}),d;}export function getSchemaField(a,b){const c=getSchema(a);if(!c)return null;const d=b['split']('.')['filter'](Boolean);let e=c;for(const f of d){if(!e||typeof e!=='object')return null;if(e['properties']&&f in e['properties']){e=e['properties'][f];continue;}if(e['items']&&typeof e['items']==='object'){if(/^\d+$/['test'](f)){e=e['items'];continue;}if(e['items']['properties']&&f in e['items']['properties']){e=e['items']['properties'][f];continue;}}if(Array['isArray'](e['oneOf'])||Array['isArray'](e['anyOf'])){const g=e['oneOf']??e['anyOf'];for(const h of g){if(h&&typeof h==='object'&&h['properties']&&f in h['properties']){e=h['properties'][f];break;}}continue;}if(f in e){e=e[f];continue;}return null;}return e;}function resolveSchemaRefs(a,b=new Set()){if(!a||typeof a!=='object')return a;if(Array['isArray'](a))return a['map'](d=>resolveSchemaRefs(d,b));const c={};for(const [d,e]of Object['entries'](a)){if(d==='$ref'&&typeof e==='string'){if(e['startsWith']('#'))c[d]=e;else{const f=loadRefSchema(e,b);f&&Object['assign'](c,resolveSchemaRefs(f,b));}}else typeof e==='object'?c[d]=resolveSchemaRefs(e,b):c[d]=e;}return c;}function loadRefSchema(a,b){if(a['startsWith']('#'))return null;if(b['has'](a))return{'description':'Circular\x20reference\x20to\x20'+a};b['add'](a);try{const c=join(SCHEMAS_DIR,a);if(!existsSync(c))return null;const d=readFileSync(c,'utf-8');return JSON['parse'](d);}catch{return null;}}export function searchSchemas(a){const b=listSchemas(),c=a['toLowerCase']();return b['filter'](d=>{const e=d['name']['toLowerCase']()['includes'](c),f=d['title']?.['toLowerCase']()['includes'](c),g=d['description']?.['toLowerCase']()['includes'](c);return e||f||g;});}export function listOperations(){const a=getSchemaIndex();if(!a)return[];return(a['operations']||[])['filter'](b=>b['name']['startsWith']('onchain_operations_'));}function writeResponseToFile(a,b){try{let c;if(b)c=resolve(process['cwd'](),b);else{!existsSync(WORKSPACE_TMP_DIR)&&mkdirSync(WORKSPACE_TMP_DIR,{'recursive':!![]});const g=Date['now']();c=join(WORKSPACE_TMP_DIR,'schema-'+g+'.json');}const d=dirname(c);!existsSync(d)&&mkdirSync(d,{'recursive':!![]});const f=typeof a==='string'?a:JSON['stringify'](a,null,0x2);return writeFileSync(c,f,'utf-8'),c;}catch(h){return null;}}export function processSchemaQuery(a){const {action:b,name:c,query:d,field_path:f,template:g,output_file:h,object_type:i,params:j}=a;if(b==='get_guard_templates'){const k=getGuardTemplates(g);if(!k)return{'success':![],'action':b,'data':null,'message':g?'Guard\x20template\x20\x27'+g+'\x27\x20not\x20found.\x20Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.':'Guard\x20templates\x20file\x20not\x20found.\x20Ensure\x20scripts/guard-templates.json\x20exists.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.','Available\x20template\x20names:\x20signer_verification,\x20progress_node_check,\x20order_owner_verification,\x20service_belonging_check,\x20reward_not_claimed,\x20combined_reward_guard']};if(h){const l=writeResponseToFile(k,h);if(l)return{'success':!![],'action':b,'data':null,'message':'Guard\x20template'+(g?'\x20\x27'+g+'\x27':'s')+'\x20written\x20to\x20file:\x20'+l,'output_file_path':l,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+l]};}return{'success':!![],'action':b,'data':k,'message':g?'Retrieved\x20Guard\x20template:\x20'+g:'Retrieved\x20'+(Array['isArray'](k['templates'])?k['templates']['length']:0x0)+'\x20Guard\x20templates'};}if(b==='get_templates'){if(!g){const p=a381a(i),q=getTemplateCounts(),r={'total':p['length'],'filter':i??null,'counts_by_object_type':q,'templates':p};if(h){const s=writeResponseToFile(r,h);if(s)return{'success':!![],'action':b,'data':null,'message':p['length']+'\x20templates\x20written\x20to\x20file:\x20'+s,'output_file_path':s,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+s]};}return{'success':!![],'action':b,'data':r,'message':p['length']+'\x20template(s)'+(i?'\x20for\x20object_type=\x27'+i+'\x27':'')+'\x20'+('(total\x20registry:\x20'+Object['values'](q)['reduce']((t,u)=>t+u,0x0)+'\x20across\x20'+TEMPLATE_OBJECT_TYPES['length']+'\x20object\x20types).\x20')+'Provide\x20\x27template\x27\x20(id)\x20for\x20full\x20detail;\x20add\x20\x27params\x27\x20(JSON\x20string)\x20to\x20instantiate.'};}if(!j){const t=getTemplateDetail(g);if(!t)return{'success':![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20registry.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20template\x20metadata\x20(id\x20+\x20object_type\x20+\x20parameters).','Filter\x20by\x20object_type:\x20'+TEMPLATE_OBJECT_TYPES['join'](',\x20')]};if(h){const u=writeResponseToFile(t,h);if(u)return{'success':!![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20detail\x20written\x20to\x20file:\x20'+u,'output_file_path':u,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+u]};}return{'success':!![],'action':b,'data':t,'message':'Template\x20\x27'+g+'\x27\x20('+t['object_type']+',\x20'+(t['instantiable']?'instantiable':'guidance-only')+').\x20'+'To\x20instantiate,\x20call\x20again\x20with\x20\x27params\x27\x20=\x20JSON\x20object\x20of\x20the\x20declared\x20parameters.'};}let m;try{const v=JSON['parse'](j);if(!v||typeof v!=='object'||Array['isArray'](v))return{'success':![],'action':b,'data':null,'message':'\x27params\x27\x20must\x20be\x20a\x20JSON\x20object\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27),\x20got\x20'+(Array['isArray'](v)?'array':typeof v)+'.'};m=v;}catch(w){return{'success':![],'action':b,'data':null,'message':'Failed\x20to\x20parse\x20\x27params\x27\x20as\x20JSON:\x20'+(w instanceof Error?w['message']:String(w)),'suggestions':['Example:\x20params=\x27{\x22whitelist\x22:[\x220xabc...\x22]}\x27']};}const n=instantiateTemplate(g,m);if(!n['ok'])return{'success':![],'action':b,'data':n['guidance']!==undefined?{'guidance':n['guidance']}:null,'message':'Instantiation\x20failed\x20for\x20\x27'+g+'\x27:\x20'+n['error'],'suggestions':n['missing_params']?['Missing\x20required\x20params:\x20'+n['missing_params']['join'](',\x20'),'Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']:['Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']};const o={'object_type':n['object_type'],'template_id':n['template_id'],'body':n['body'],...n['notes']?{'notes':n['notes']}:{}};if(h){const x=writeResponseToFile(o,h);if(x)return{'success':!![],'action':b,'data':null,'message':'Instantiated\x20template\x20\x27'+g+'\x27\x20written\x20to\x20file:\x20'+x,'output_file_path':x,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+x]};}return{'success':!![],'action':b,'data':o,'message':'Instantiated\x20\x27'+g+'\x27\x20('+n['object_type']+').\x20'+'Review\x20the\x20body\x20against\x20the\x20onchain_operations\x20schema\x20before\x20submitting.'};}if(b==='search_examples'){if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search_examples\x27\x20action','suggestions':['Provide\x20a\x20\x27query\x27\x20string\x20(e.g.\x20\x27rental\x27,\x20\x27guard\x27,\x20\x27service\x27,\x20\x27machine\x27)','Searchable\x20fields:\x20title,\x20description,\x20tags,\x20operation_type,\x20industry']};const y=searchExamples(d);return{'success':!![],'action':b,'data':y,'message':'Found\x20'+y['length']+'\x20example(s)\x20matching\x20\x27'+d+'\x27','suggestions':y['length']===0x0?['Try\x20broader\x20terms\x20like\x20\x27service\x27,\x20\x27machine\x27,\x20\x27guard\x27,\x20\x27permission\x27','Try\x20an\x20industry\x20name:\x20\x27rental\x27,\x20\x27retail\x27,\x20\x27general\x27','Use\x20\x27get\x27\x20action\x20with\x20a\x20schema\x20name\x20to\x20see\x20the\x20full\x20JSON\x20Schema']:undefined};}if(b==='get_tool_reference'){if(c){const A=getToolReference(c);if(!A)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found\x20in\x20the\x20tool\x20reference.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20all\x20tools.','Available\x20tools:\x20'+TOOLS_REFERENCE['map'](C=>C['name'])['join'](',\x20')]};const B=getToolSequence(c);return{'success':!![],'action':b,'data':{'tool':A,'call_sequence':B??null},'message':'Retrieved\x20tool\x20reference:\x20'+c};}if(d){const C=searchToolReference(d);return{'success':!![],'action':b,'data':{'tools':C,'count':C['length']},'message':'Found\x20'+C['length']+'\x20tool(s)\x20matching\x20\x27'+d+'\x27','suggestions':C['length']===0x0?['Try\x20a\x20broader\x20keyword\x20(e.g.\x20\x27onchain\x27,\x20\x27guard\x27,\x20\x27schema\x27),\x20or\x20omit\x20\x27query\x27\x20to\x20list\x20all\x20tools.']:undefined};}const z=TOOLS_REFERENCE['map'](D=>({'name':D['name'],'summary':D['summary'],'actions':D['actions']??[],'notes':D['notes']??[]}));return{'success':!![],'action':b,'data':{'tools':z,'count':z['length']},'message':'Retrieved\x20reference\x20for\x20'+z['length']+'\x20MCP\x20tools.\x20Pass\x20name=\x27<tool>\x27\x20for\x20full\x20detail\x20(params,\x20prerequisites,\x20follow-ups).'};}if(b==='get_guard_design_patterns'){if(c){const E=getGuardDesignPattern(c);if(!E)return{'success':![],'action':b,'data':null,'message':'Guard\x20design\x20pattern\x20\x27'+c+'\x27\x20not\x20found.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20the\x20full\x20catalog.','Available\x20pattern\x20ids:\x20'+GUARD_DESIGN_PATTERNS['map'](F=>F['id'])['join'](',\x20')]};return{'success':!![],'action':b,'data':{'pattern':E},'message':'Retrieved\x20Guard\x20design\x20pattern:\x20'+c};}if(d){const F=GUARD_DESIGN_PATTERNS['filter'](H=>H['host']===d),G=F['length']>0x0?F:GUARD_DESIGN_PATTERNS['filter'](H=>H['business_requirement']['toLowerCase']()['includes'](d['toLowerCase']())||H['logic_summary']['toLowerCase']()['includes'](d['toLowerCase']()));return{'success':!![],'action':b,'data':{'patterns':G,'count':G['length'],'filtered_by':F['length']>0x0?'host':'keyword'},'message':'Found\x20'+G['length']+'\x20Guard\x20design\x20pattern(s)\x20matching\x20\x27'+d+'\x27','suggestions':G['length']===0x0?['Filter\x20by\x20host:\x20service_buy_guard,\x20service_allocator_guard,\x20machine_forward,\x20progress_submission,\x20reward_claim,\x20repository_write,\x20arbitration_usage,\x20arbitration_voting,\x20gen_passport']:undefined};}const D=GUARD_DESIGN_PATTERNS['map'](H=>({'id':H['id'],'business_requirement':H['business_requirement'],'host':H['host'],'data_source':H['data_source'],'verifier_level':H['verifier_level'],'logic_summary':H['logic_summary'],'key_queries':H['key_queries'],'notes':H['notes']??[]}));return{'success':!![],'action':b,'data':{'patterns':D,'count':D['length'],'version':GUARD_DESIGN_PATTERNS_VERSION},'message':'Retrieved\x20'+D['length']+'\x20Guard\x20design\x20patterns.\x20Pass\x20name=\x27<pattern_id>\x27\x20for\x20full\x20detail\x20(witness\x20types,\x20mitigated\x20risks,\x20industries).'};}if(b==='get_safety_rules')return{'success':!![],'action':b,'data':{'version':SAFETY_RULES_VERSION,'object_reuse_rules':OBJECT_REUSE_RULES,'create_vs_modify_pattern':CREATE_VS_MODIFY_PATTERN,'immutability_rules':IMMUTABILITY_RULES,'operation_type_classification':OPERATION_TYPE_CLASSIFICATION,'operation_class_meta':OPERATION_CLASS_META,'naming_conventions':NAMING_CONVENTIONS},'message':'Retrieved\x20safety\x20rule\x20tables\x20(reuse\x20/\x20immutability\x20/\x20operation\x20classification\x20/\x20naming).\x20'+'Key\x20points:\x20prefer\x20REUSING\x20existing\x20objects\x20(string\x20reference\x20=\x20reuse,\x20object\x20shape\x20=\x20create);\x20'+'Machine\x20publish\x20locks\x20nodes/pairs/forwards,\x20Service\x20publish\x20locks\x20machine/order_allocators/arbitrations\x20(sales\x20stays\x20mutable);\x20'+'Guard\x20is\x20CREATE-only\x20immutable;\x20on-chain\x20writes\x20require\x20explicit\x20user\x20confirmation.'};if(!areSchemasAvailable())return{'success':![],'action':b,'data':null,'message':'Schema\x20files\x20are\x20not\x20available.\x20Please\x20run\x20\x27npm\x20run\x20generate:schemas\x27\x20first.','suggestions':['Run\x20\x27npm\x20run\x20generate:schemas\x27\x20to\x20generate\x20schema\x20files','Ensure\x20the\x20dist/schemas\x20directory\x20exists']};switch(b){case'list':{const H=listSchemas();return{'success':!![],'action':b,'data':H,'message':'Found\x20'+H['length']+'\x20available\x20schemas'};}case'get':{if(!c)return{'success':![],'action':b,'data':null,'message':'Schema\x20name\x20is\x20required\x20for\x20\x27get\x27\x20action','suggestions':['Provide\x20a\x20schema\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};const I=getSchema(c);if(!I){const J=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20not\x20found','suggestions':J['length']>0x0?J['map'](K=>'Did\x20you\x20mean:\x20'+K['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};}if(h){const K=writeResponseToFile(I,h);if(K)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+K,'output_file_path':K,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+K]};}return{'success':!![],'action':b,'data':I,'message':'Retrieved\x20schema:\x20'+c};}case'get_field':{if(!c||!f)return{'success':![],'action':b,'data':null,'message':'Both\x20\x27name\x27\x20and\x20\x27field_path\x27\x20are\x20required\x20for\x20\x27get_field\x27\x20action','suggestions':['Example:\x20{action:\x20\x27get_field\x27,\x20name:\x20\x27onchain_operations_machine\x27,\x20field_path:\x20\x27data.node\x27}','Use\x20\x27get\x27\x20action\x20to\x20retrieve\x20the\x20full\x20schema']};const L=getSchemaField(c,f);if(!L)return{'success':![],'action':b,'data':null,'message':'Field\x20path\x20\x27'+f+'\x27\x20not\x20found\x20in\x20schema\x20\x27'+c+'\x27','suggestions':['Check\x20the\x20field\x20path\x20(dot-separated,\x20e.g.\x20\x27data.node\x27)','Use\x20\x27get\x27\x20action\x20to\x20see\x20the\x20full\x20schema\x20structure']};return{'success':!![],'action':b,'data':L,'message':'Retrieved\x20field\x20\x27'+f+'\x27\x20from\x20schema\x20\x27'+c+'\x27'};}case'search':{if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search\x27\x20action'};const M=searchSchemas(d);return{'success':!![],'action':b,'data':M,'message':'Found\x20'+M['length']+'\x20schemas\x20matching\x20\x27'+d+'\x27'};}case'list_operations':{const N=listOperations();return{'success':!![],'action':b,'data':N,'message':'Found\x20'+N['length']+'\x20on-chain\x20operations'};}case'get_output':{if(!c)return{'success':![],'action':b,'data':null,'message':'Tool\x20name\x20is\x20required\x20for\x20\x27get_output\x27\x20action','suggestions':['Provide\x20a\x20tool\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools\x20and\x20their\x20outputPath']};const O=getOutputSchema(c);if(!O){const P=listSchemas(),Q=P['find'](S=>S['name']===c);if(Q)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20exists\x20but\x20has\x20no\x20output\x20schema\x20file.\x20The\x20tool\x20may\x20not\x20declare\x20an\x20outputSchema,\x20or\x20the\x20schema\x20file\x20was\x20not\x20generated.','suggestions':['Use\x20\x27get\x27\x20action\x20with\x20name=\x27'+c+'\x27\x20to\x20retrieve\x20its\x20input\x20schema']};const R=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found','suggestions':R['length']>0x0?R['map'](S=>'Did\x20you\x20mean:\x20'+S['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools']};}if(h){const S=writeResponseToFile(O,h);if(S)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+S,'output_file_path':S,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+S]};}return{'success':!![],'action':b,'data':O,'message':'Retrieved\x20output\x20schema:\x20'+c};}default:return{'success':![],'action':b,'data':null,'message':'Unknown\x20action:\x20'+b,'suggestions':['Use\x20\x27list\x27,\x20\x27get\x27,\x20\x27get_field\x27,\x20\x27get_output\x27,\x20\x27search\x27,\x20\x27list_operations\x27,\x20\x27get_guard_templates\x27,\x20or\x20\x27search_examples\x27']};}}
@@ -2247,7 +2247,7 @@
2247
2247
  "testnet",
2248
2248
  "mainnet"
2249
2249
  ],
2250
- "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
2250
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
2251
2251
  }
2252
2252
  },
2253
2253
  "required": [
@@ -2358,6 +2358,35 @@
2358
2358
  "error"
2359
2359
  ],
2360
2360
  "additionalProperties": false
2361
+ },
2362
+ {
2363
+ "type": "object",
2364
+ "properties": {
2365
+ "status": {
2366
+ "type": "string",
2367
+ "const": "pending_confirmation"
2368
+ },
2369
+ "operation": {
2370
+ "type": "string",
2371
+ "description": "Operation that was blocked (e.g. 'account_transfer')"
2372
+ },
2373
+ "message": {
2374
+ "type": "string",
2375
+ "description": "Human-readable confirmation message (amount, token full type, decimals, recipient, warnings)"
2376
+ },
2377
+ "rule_id": {
2378
+ "type": "string",
2379
+ "description": "Id of the confirmation rule that matched"
2380
+ }
2381
+ },
2382
+ "required": [
2383
+ "status",
2384
+ "operation",
2385
+ "message",
2386
+ "rule_id"
2387
+ ],
2388
+ "additionalProperties": false,
2389
+ "description": "Pending confirmation — the transfer was NOT executed. Read message first; if the user consents, re-invoke the SAME call with transfer.confirmed=true."
2361
2390
  }
2362
2391
  ],
2363
2392
  "description": "Account operation output schema with discriminator"
@@ -2762,10 +2791,10 @@
2762
2791
  "items": {
2763
2792
  "type": "string"
2764
2793
  },
2765
- "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"
2794
+ "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','experience_layer']"
2766
2795
  },
2767
2796
  "inactive": {
2768
- "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']",
2797
+ "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness']",
2769
2798
  "type": "array",
2770
2799
  "items": {
2771
2800
  "type": "string"
@@ -109,7 +109,7 @@
109
109
  "additionalProperties": false
110
110
  },
111
111
  "transfer": {
112
- "description": "Transfer tokens from one account to another",
112
+ "description": "💰 FUND MOVEMENT (on-chain, irreversible): transfer tokens from one account to another. Amount parsing: display strings like \"2.5WOW\" are converted to raw smallest units with the token's decimals; bare decimal numbers are rejected. Requires confirmation — first call previews, re-call with confirmed=true.",
113
113
  "type": "object",
114
114
  "properties": {
115
115
  "name_or_address_from": {
@@ -129,7 +129,7 @@
129
129
  "type": "string"
130
130
  }
131
131
  ],
132
- "description": "Amount of tokens to transfer"
132
+ "description": "Amount of tokens to transfer. Accepts: raw smallest-unit integer (string/number, e.g. \"2500000000\"), or display format with the token symbol (e.g. \"2.5WOW\") — converted with the token's own decimals. Bare decimals like \"2.5\" or 2.5 are REJECTED (must carry the symbol suffix)."
133
133
  },
134
134
  "token_type": {
135
135
  "description": "Token type; default token type is 0x2::wow::WOW",
@@ -142,7 +142,11 @@
142
142
  "testnet",
143
143
  "mainnet"
144
144
  ],
145
- "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
145
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
146
+ },
147
+ "confirmed": {
148
+ "description": "ConfirmGate: set to true to proceed after a 'pending_confirmation' result. Token transfers are irreversible on-chain fund movements — the first call returns a pending_confirmation preview (amount, token, recipient); re-call with confirmed=true after user consent.",
149
+ "type": "boolean"
146
150
  }
147
151
  },
148
152
  "required": [
@@ -180,7 +184,7 @@
180
184
  "testnet",
181
185
  "mainnet"
182
186
  ],
183
- "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
187
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
184
188
  }
185
189
  },
186
190
  "required": [
@@ -76,9 +76,32 @@
76
76
  ],
77
77
  "additionalProperties": false,
78
78
  "description": "Error result"
79
+ },
80
+ {
81
+ "type": "object",
82
+ "properties": {
83
+ "type": {
84
+ "type": "string",
85
+ "const": "pending_confirmation"
86
+ },
87
+ "preview": {
88
+ "description": "ConfirmGate preview (level, operation, amount, warnings)"
89
+ },
90
+ "rule_id": {
91
+ "type": "string",
92
+ "description": "Id of the confirmation rule that matched"
93
+ }
94
+ },
95
+ "required": [
96
+ "type",
97
+ "preview",
98
+ "rule_id"
99
+ ],
100
+ "additionalProperties": false,
101
+ "description": "Pending confirmation. The ConfirmGate blocked this fund-moving operation. Read preview first; if user consents, re-invoke the SAME call with env.confirmed=true."
79
102
  }
80
103
  ],
81
- "description": "Bridge operation result (data or error)"
104
+ "description": "Bridge operation result (data, error, or pending_confirmation)"
82
105
  },
83
106
  "semantic": {
84
107
  "description": "Business semantic summary for bridge operation",
@@ -480,10 +503,10 @@
480
503
  "items": {
481
504
  "type": "string"
482
505
  },
483
- "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"
506
+ "description": "Phase 2 services currently active (enabled). Example: ['confirm_gate','experience_layer']"
484
507
  },
485
508
  "inactive": {
486
- "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']",
509
+ "description": "Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness']",
487
510
  "type": "array",
488
511
  "items": {
489
512
  "type": "string"
@@ -78,7 +78,7 @@
78
78
  "testnet",
79
79
  "mainnet"
80
80
  ],
81
- "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
81
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
82
82
  },
83
83
  "referrer": {
84
84
  "description": "Referrer ID. If the user is using the network for the first time, the referrer ID will be recorded (also applied when the SDK auto-registers the sender in the global Entity table).",
@@ -99,8 +99,8 @@
99
99
  "type": "string"
100
100
  }
101
101
  },
102
- "project": {
103
- "description": "Project prefix to assign this object to (e.g. 'myshop'). When set: 1) the object is tagged with 'project:<prefix>' on-chain automatically via ProjectService, 2) the newly created object is auto-associated to the SQLite project for local management, evaluation, and graph tracking. The project MUST exist (create via project_operation action='create_project' first). Use project_operation to manage projects.",
102
+ "plan_approval": {
103
+ "description": "K3 24 PlanApproval: id of a goal whose plan was approved via goal_operation action='approve'. When set: 1) the ConfirmGate treats fail-open rules (standard/none levels) as pre-approved for operations under this goal's plan; 2) after successful CREATION operations, the created objects are auto-registered into the goal (GoalRecord.objects + its TaskProcess manifest — ACT station 'execution registers'). Fail-closed levels (irreversible/publish/amount) still require per-operation confirmation with env.confirmed=true.",
104
104
  "type": "string"
105
105
  },
106
106
  "client_schema_version": {
@@ -205,7 +205,7 @@
205
205
  "testnet",
206
206
  "mainnet"
207
207
  ],
208
- "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
208
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
209
209
  },
210
210
  "referrer": {
211
211
  "description": "Referrer ID. If the user is using the network for the first time, the referrer ID will be recorded (also applied when the SDK auto-registers the sender in the global Entity table).",
@@ -226,8 +226,8 @@
226
226
  "type": "string"
227
227
  }
228
228
  },
229
- "project": {
230
- "description": "Project prefix to assign this object to (e.g. 'myshop'). When set: 1) the object is tagged with 'project:<prefix>' on-chain automatically via ProjectService, 2) the newly created object is auto-associated to the SQLite project for local management, evaluation, and graph tracking. The project MUST exist (create via project_operation action='create_project' first). Use project_operation to manage projects.",
229
+ "plan_approval": {
230
+ "description": "K3 24 PlanApproval: id of a goal whose plan was approved via goal_operation action='approve'. When set: 1) the ConfirmGate treats fail-open rules (standard/none levels) as pre-approved for operations under this goal's plan; 2) after successful CREATION operations, the created objects are auto-registered into the goal (GoalRecord.objects + its TaskProcess manifest — ACT station 'execution registers'). Fail-closed levels (irreversible/publish/amount) still require per-operation confirmation with env.confirmed=true.",
231
231
  "type": "string"
232
232
  },
233
233
  "client_schema_version": {
@@ -306,7 +306,7 @@
306
306
  "testnet",
307
307
  "mainnet"
308
308
  ],
309
- "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
309
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
310
310
  },
311
311
  "referrer": {
312
312
  "description": "Referrer ID. If the user is using the network for the first time, the referrer ID will be recorded (also applied when the SDK auto-registers the sender in the global Entity table).",
@@ -327,8 +327,8 @@
327
327
  "type": "string"
328
328
  }
329
329
  },
330
- "project": {
331
- "description": "Project prefix to assign this object to (e.g. 'myshop'). When set: 1) the object is tagged with 'project:<prefix>' on-chain automatically via ProjectService, 2) the newly created object is auto-associated to the SQLite project for local management, evaluation, and graph tracking. The project MUST exist (create via project_operation action='create_project' first). Use project_operation to manage projects.",
330
+ "plan_approval": {
331
+ "description": "K3 24 PlanApproval: id of a goal whose plan was approved via goal_operation action='approve'. When set: 1) the ConfirmGate treats fail-open rules (standard/none levels) as pre-approved for operations under this goal's plan; 2) after successful CREATION operations, the created objects are auto-registered into the goal (GoalRecord.objects + its TaskProcess manifest — ACT station 'execution registers'). Fail-closed levels (irreversible/publish/amount) still require per-operation confirmation with env.confirmed=true.",
332
332
  "type": "string"
333
333
  },
334
334
  "client_schema_version": {
@@ -407,7 +407,7 @@
407
407
  "testnet",
408
408
  "mainnet"
409
409
  ],
410
- "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Use project_operation action='clone_project_to_network' to clone the project blueprint to the target network, then re-run onchain_operations with env.network=target_network to deploy."
410
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
411
411
  },
412
412
  "referrer": {
413
413
  "description": "Referrer ID. If the user is using the network for the first time, the referrer ID will be recorded (also applied when the SDK auto-registers the sender in the global Entity table).",
@@ -428,8 +428,8 @@
428
428
  "type": "string"
429
429
  }
430
430
  },
431
- "project": {
432
- "description": "Project prefix to assign this object to (e.g. 'myshop'). When set: 1) the object is tagged with 'project:<prefix>' on-chain automatically via ProjectService, 2) the newly created object is auto-associated to the SQLite project for local management, evaluation, and graph tracking. The project MUST exist (create via project_operation action='create_project' first). Use project_operation to manage projects.",
431
+ "plan_approval": {
432
+ "description": "K3 24 PlanApproval: id of a goal whose plan was approved via goal_operation action='approve'. When set: 1) the ConfirmGate treats fail-open rules (standard/none levels) as pre-approved for operations under this goal's plan; 2) after successful CREATION operations, the created objects are auto-registered into the goal (GoalRecord.objects + its TaskProcess manifest — ACT station 'execution registers'). Fail-closed levels (irreversible/publish/amount) still require per-operation confirmation with env.confirmed=true.",
433
433
  "type": "string"
434
434
  },
435
435
  "client_schema_version": {
@@ -512,6 +512,78 @@
512
512
  ],
513
513
  "additionalProperties": false,
514
514
  "description": "Withdraw from activeEvmAccount to another EVM address"
515
+ },
516
+ "env": {
517
+ "description": "Optional env — needed to pass confirmed=true after a pending_confirmation block (funds leave activeEvmAccount).",
518
+ "type": "object",
519
+ "properties": {
520
+ "account": {
521
+ "default": "",
522
+ "type": "string",
523
+ "description": "Account/Object name or ID. If specifying an account, use empty string '' for the default account. If it starts with '0x', it will be treated as an ID. Otherwise, it will be treated as a name (max 64 bcs characters)."
524
+ },
525
+ "permission_guard": {
526
+ "description": "List of permission guard IDs. Used to extend additional operation permissions (requires verification and configuration in the Permission object).",
527
+ "type": "array",
528
+ "items": {
529
+ "type": "string"
530
+ }
531
+ },
532
+ "no_cache": {
533
+ "description": "Whether to disable caching.",
534
+ "type": "boolean"
535
+ },
536
+ "network": {
537
+ "type": "string",
538
+ "enum": [
539
+ "localnet",
540
+ "testnet",
541
+ "mainnet"
542
+ ],
543
+ "description": "Network entrypoint: Specifies which network the operation occurs on. FIX-010 cross-network note: LocalMark names are scoped per network (testnet marks are invisible on mainnet and vice versa). When migrating from testnet to mainnet, recreate all objects on mainnet and re-register LocalMark names with the SAME names to keep name-based references working across networks. Recreate all objects on the target network via onchain_operations with env.network=target_network, then re-register the LocalMark names."
544
+ },
545
+ "referrer": {
546
+ "description": "Referrer ID. If the user is using the network for the first time, the referrer ID will be recorded (also applied when the SDK auto-registers the sender in the global Entity table).",
547
+ "type": "string"
548
+ },
549
+ "no_auto_register": {
550
+ "description": "Opt-out of SDK-level Entity auto-registration. By default, a business transaction whose sender has no entry in the global Entity table automatically appends entity_register: the sender gets registered and receives an owned Resource object (their on-chain mark book) in the wallet. Set true ONLY when the user explicitly cancelled their entity registration (entity_cancel) or demands that the transaction not touch the Entity table.",
551
+ "type": "boolean"
552
+ },
553
+ "confirmed": {
554
+ "description": "Phase 2 ConfirmGate: set to true to proceed after a 'pending_confirmation' result. The operation is NOT executed until you re-call with confirmed=true after user consent.",
555
+ "type": "boolean"
556
+ },
557
+ "user_intent_phrases": {
558
+ "description": "Phase 2 ConfirmGate: explicit user intent phrases collected from conversation context (e.g. 'use default account', 'force publish'). Used to bypass confirmation rules whose bypass_on_explicit_intent matches.",
559
+ "type": "array",
560
+ "items": {
561
+ "type": "string"
562
+ }
563
+ },
564
+ "plan_approval": {
565
+ "description": "K3 24 PlanApproval: id of a goal whose plan was approved via goal_operation action='approve'. When set: 1) the ConfirmGate treats fail-open rules (standard/none levels) as pre-approved for operations under this goal's plan; 2) after successful CREATION operations, the created objects are auto-registered into the goal (GoalRecord.objects + its TaskProcess manifest — ACT station 'execution registers'). Fail-closed levels (irreversible/publish/amount) still require per-operation confirmation with env.confirmed=true.",
566
+ "type": "string"
567
+ },
568
+ "client_schema_version": {
569
+ "description": "Client-side schema version (semver, e.g. '1.0.0'). When provided, the server checks compatibility and attaches warnings if mismatched.",
570
+ "type": "string"
571
+ },
572
+ "schema_strict_mode": {
573
+ "default": false,
574
+ "description": "When true, schema incompatibility returns an error instead of a warning. Default: false (warn mode).",
575
+ "type": "boolean"
576
+ },
577
+ "dry_run": {
578
+ "description": "Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify an operation will succeed before committing. Essential for the 5-step loop's Plan step. The returned digest will be 'dry_run:<timestamp>' and objectChanges will be empty (simulation only).",
579
+ "type": "boolean"
580
+ }
581
+ },
582
+ "required": [
583
+ "account",
584
+ "schema_strict_mode"
585
+ ],
586
+ "additionalProperties": false
515
587
  }
516
588
  },
517
589
  "required": [
@@ -519,7 +591,7 @@
519
591
  "data"
520
592
  ],
521
593
  "additionalProperties": false,
522
- "description": "Withdraw from activeEvmAccount to another EVM address (non-cross-chain). [No env needed]"
594
+ "description": "Withdraw from activeEvmAccount to another EVM address (non-cross-chain). [env optional: only needed for env.confirmed after a confirmation block]"
523
595
  },
524
596
  {
525
597
  "type": "object",
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://wowok.net/schemas/config_operation.output.json",
4
4
  "title": "Config - Runtime Service Toggles",
5
- "description": "Runtime configuration — toggle Phase 2/3/4 services on/off at runtime WITHOUT restarting the MCP server. Actions: list, toggle, enable, disable, reset, info. Services (9 total): confirm_gate, project_service, harness, graph_persist, semantic_rich, experience_layer, customer_intelligence, order_monitor, industry_evolution.",
5
+ "description": "Runtime configuration — toggle Phase 2/3/4 services on/off at runtime WITHOUT restarting the MCP server. Actions: list, toggle, enable, disable, reset, info. Services (7 total): confirm_gate, harness, semantic_rich, experience_layer, customer_intelligence, order_monitor, industry_evolution.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "result": {
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://wowok.net/schemas/config_operation.json",
4
4
  "title": "Config - Runtime Service Toggles",
5
- "description": "Runtime configuration — toggle Phase 2/3/4 services on/off at runtime WITHOUT restarting the MCP server. Actions: list, toggle, enable, disable, reset, info. Services (9 total): confirm_gate, project_service, harness, graph_persist, semantic_rich, experience_layer, customer_intelligence, order_monitor, industry_evolution.",
5
+ "description": "Runtime configuration — toggle Phase 2/3/4 services on/off at runtime WITHOUT restarting the MCP server. Actions: list, toggle, enable, disable, reset, info. Services (7 total): confirm_gate, harness, semantic_rich, experience_layer, customer_intelligence, order_monitor, industry_evolution.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "action": {