@wowok/agent-mcp 2.7.1 → 2.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (597) hide show
  1. package/dist/config/index.js +1 -1
  2. package/dist/config/runtime.js +1 -238
  3. package/dist/customer/account-events.d.ts +32 -0
  4. package/dist/customer/account-events.js +1 -0
  5. package/dist/customer/customer-advice.d.ts +1 -0
  6. package/dist/customer/customer-advice.js +1 -130
  7. package/dist/customer/index.js +1 -11
  8. package/dist/customer/industry-risks.js +1 -438
  9. package/dist/customer/info-puzzle.js +1 -681
  10. package/dist/customer/order-monitor.js +1 -328
  11. package/dist/customer/order-strategy.d.ts +1 -1
  12. package/dist/customer/order-strategy.js +1 -373
  13. package/dist/customer/post-purchase.js +1 -351
  14. package/dist/customer/preorder-compare.js +1 -34
  15. package/dist/customer/reminder-system.d.ts +2 -0
  16. package/dist/customer/reminder-system.js +1 -316
  17. package/dist/customer/risk-assessment.d.ts +1 -0
  18. package/dist/customer/risk-assessment.js +1 -397
  19. package/dist/customer/types.d.ts +2 -0
  20. package/dist/customer/types.js +1 -13
  21. package/dist/customer/user-preferences.js +1 -460
  22. package/dist/evaluation/arbitration-game.d.ts +9 -2
  23. package/dist/evaluation/arbitration-game.js +1 -48
  24. package/dist/evaluation/builtins/arbitration-score.d.ts +41 -0
  25. package/dist/evaluation/builtins/arbitration-score.js +1 -0
  26. package/dist/evaluation/builtins/demand-match.js +1 -153
  27. package/dist/evaluation/builtins/index.d.ts +1 -0
  28. package/dist/evaluation/builtins/index.js +1 -10
  29. package/dist/evaluation/builtins/service-risk.js +1 -55
  30. package/dist/evaluation/capability.js +1 -13
  31. package/dist/evaluation/category-match-rules.d.ts +30 -0
  32. package/dist/evaluation/category-match-rules.js +1 -0
  33. package/dist/evaluation/composer.js +1 -40
  34. package/dist/evaluation/engine.js +1 -175
  35. package/dist/evaluation/extract.js +1 -115
  36. package/dist/evaluation/game-strategy.d.ts +27 -0
  37. package/dist/evaluation/game-strategy.js +1 -0
  38. package/dist/evaluation/gap.js +1 -100
  39. package/dist/evaluation/index.d.ts +2 -0
  40. package/dist/evaluation/index.js +1 -11
  41. package/dist/evaluation/location-match.d.ts +42 -0
  42. package/dist/evaluation/location-match.js +1 -0
  43. package/dist/evaluation/node-game.d.ts +31 -3
  44. package/dist/evaluation/node-game.js +1 -57
  45. package/dist/evaluation/path-reasoning.d.ts +35 -0
  46. package/dist/evaluation/path-reasoning.js +1 -0
  47. package/dist/evaluation/region.d.ts +6 -0
  48. package/dist/evaluation/region.js +1 -36
  49. package/dist/evaluation/types.d.ts +18 -0
  50. package/dist/evaluation/types.js +1 -1
  51. package/dist/evaluation/user-injection.js +1 -27
  52. package/dist/experience/experience-reuse.js +1 -103
  53. package/dist/experience/index.js +1 -5
  54. package/dist/experience/intent-distill.js +1 -83
  55. package/dist/experience/realtime-feedback.js +1 -94
  56. package/dist/experience/types.js +1 -1
  57. package/dist/experience/user-profile.d.ts +1 -1
  58. package/dist/experience/user-profile.js +1 -171
  59. package/dist/extensions/business-modules.js +1 -287
  60. package/dist/extensions/capability-manifest.js +1 -781
  61. package/dist/extensions/constraint-registry.js +1 -198
  62. package/dist/extensions/index.d.ts +6 -0
  63. package/dist/extensions/index.js +1 -6
  64. package/dist/extensions/industry-layers.d.ts +75 -0
  65. package/dist/extensions/industry-layers.js +1 -0
  66. package/dist/extensions/industry-pack.d.ts +105 -0
  67. package/dist/extensions/industry-pack.js +1 -0
  68. package/dist/extensions/metric-registry.js +1 -257
  69. package/dist/extensions/mode-evaluator.d.ts +1 -1
  70. package/dist/extensions/mode-evaluator.js +1 -170
  71. package/dist/extensions/modes.js +1 -499
  72. package/dist/extensions/registry.d.ts +1 -0
  73. package/dist/extensions/registry.js +1 -717
  74. package/dist/extensions/types.js +1 -1
  75. package/dist/graph/base.d.ts +8 -0
  76. package/dist/graph/base.js +1 -0
  77. package/dist/harness/auto-escalation.js +1 -68
  78. package/dist/harness/checkpoint.js +1 -129
  79. package/dist/harness/index.d.ts +1 -0
  80. package/dist/harness/index.js +1 -78
  81. package/dist/harness/plan.d.ts +2 -0
  82. package/dist/harness/plan.js +1 -315
  83. package/dist/harness/recover.d.ts +1 -1
  84. package/dist/harness/recover.js +1 -139
  85. package/dist/harness/types.d.ts +2 -3
  86. package/dist/harness/types.js +1 -1
  87. package/dist/harness/verify.js +1 -237
  88. package/dist/index.js +1 -273
  89. package/dist/intent/enrich.js +1 -67
  90. package/dist/intent/index.js +1 -60
  91. package/dist/intent/matcher.js +1 -81
  92. package/dist/intent/store.js +1 -55
  93. package/dist/intent/types.js +1 -10
  94. package/dist/knowledge/acquisition-flywheel.js +1 -192
  95. package/dist/knowledge/allocation-confirm.js +1 -534
  96. package/dist/knowledge/allocation-context.js +1 -249
  97. package/dist/knowledge/allocation-ledger.js +1 -463
  98. package/dist/knowledge/allocation-puzzle.js +1 -298
  99. package/dist/knowledge/allocation-risk.js +1 -568
  100. package/dist/knowledge/allocation-templates.js +1 -970
  101. package/dist/knowledge/allocation-translation.js +1 -585
  102. package/dist/knowledge/anti-cheat.d.ts +37 -0
  103. package/dist/knowledge/anti-cheat.js +1 -0
  104. package/dist/knowledge/arb-confirm.d.ts +28 -0
  105. package/dist/knowledge/arb-confirm.js +1 -0
  106. package/dist/knowledge/arb-risk.js +1 -210
  107. package/dist/knowledge/arb-translation.d.ts +48 -0
  108. package/dist/knowledge/arb-translation.js +1 -0
  109. package/dist/knowledge/arbitration-confirm.js +1 -559
  110. package/dist/knowledge/arbitration-context.js +1 -505
  111. package/dist/knowledge/arbitration-ledger.js +1 -521
  112. package/dist/knowledge/arbitration-puzzle.js +1 -304
  113. package/dist/knowledge/arbitration-risk.js +1 -423
  114. package/dist/knowledge/arbitration-templates.js +1 -276
  115. package/dist/knowledge/arbitration-translation.js +1 -487
  116. package/dist/knowledge/audit-rules.js +1 -141
  117. package/dist/knowledge/bridge-confirm.d.ts +26 -0
  118. package/dist/knowledge/bridge-confirm.js +1 -0
  119. package/dist/knowledge/bridge-risk.js +1 -263
  120. package/dist/knowledge/bridge-translation.d.ts +37 -0
  121. package/dist/knowledge/bridge-translation.js +1 -0
  122. package/dist/knowledge/contact-confirm.d.ts +27 -0
  123. package/dist/knowledge/contact-confirm.js +1 -0
  124. package/dist/knowledge/contact-risk.js +1 -200
  125. package/dist/knowledge/contact-templates.js +1 -60
  126. package/dist/knowledge/contact-translation.d.ts +39 -0
  127. package/dist/knowledge/contact-translation.js +1 -0
  128. package/dist/knowledge/demand-confirm.js +1 -206
  129. package/dist/knowledge/demand-context.d.ts +17 -0
  130. package/dist/knowledge/demand-context.js +1 -0
  131. package/dist/knowledge/demand-ledger.d.ts +26 -0
  132. package/dist/knowledge/demand-ledger.js +1 -0
  133. package/dist/knowledge/demand-matching.js +1 -132
  134. package/dist/knowledge/demand-puzzle.d.ts +29 -0
  135. package/dist/knowledge/demand-puzzle.js +1 -0
  136. package/dist/knowledge/demand-risk.js +1 -240
  137. package/dist/knowledge/demand-templates.d.ts +12 -0
  138. package/dist/knowledge/demand-templates.js +1 -0
  139. package/dist/knowledge/demand-translation.js +1 -354
  140. package/dist/knowledge/deployment-scanner.js +1 -823
  141. package/dist/knowledge/dynamic-pricing.js +1 -87
  142. package/dist/knowledge/evidence-review.d.ts +12 -0
  143. package/dist/knowledge/evidence-review.js +1 -0
  144. package/dist/knowledge/examples-scanner-cli.js +1 -26
  145. package/dist/knowledge/examples-scanner.js +1 -843
  146. package/dist/knowledge/flywheel-loop.d.ts +0 -1
  147. package/dist/knowledge/flywheel-loop.js +1 -404
  148. package/dist/knowledge/fund-layer.js +1 -973
  149. package/dist/knowledge/glossary.js +1 -211
  150. package/dist/knowledge/guard-confirm.js +1 -406
  151. package/dist/knowledge/guard-context.js +1 -287
  152. package/dist/knowledge/guard-design-patterns.js +1 -360
  153. package/dist/knowledge/guard-ledger.js +1 -260
  154. package/dist/knowledge/guard-lint.js +1 -670
  155. package/dist/knowledge/guard-migration.d.ts +1 -1
  156. package/dist/knowledge/guard-migration.js +1 -228
  157. package/dist/knowledge/guard-puzzle.js +1 -805
  158. package/dist/knowledge/guard-render.js +1 -700
  159. package/dist/knowledge/guard-risk.js +1 -1879
  160. package/dist/knowledge/guard-submission-prompt.js +1 -171
  161. package/dist/knowledge/guard-templates.js +1 -1105
  162. package/dist/knowledge/guard-translation.js +1 -1119
  163. package/dist/knowledge/index.d.ts +71 -3
  164. package/dist/knowledge/index.js +1 -436
  165. package/dist/knowledge/industry-evolution.js +1 -323
  166. package/dist/knowledge/industry-generalizer.js +1 -381
  167. package/dist/knowledge/industry-registry.js +1 -174
  168. package/dist/knowledge/intent-metrics.d.ts +4 -3
  169. package/dist/knowledge/intent-metrics.js +1 -566
  170. package/dist/knowledge/machine-confirm.js +1 -559
  171. package/dist/knowledge/machine-context.js +1 -833
  172. package/dist/knowledge/machine-ledger.js +1 -338
  173. package/dist/knowledge/machine-puzzle.js +1 -494
  174. package/dist/knowledge/machine-render.js +1 -565
  175. package/dist/knowledge/machine-risk.js +1 -669
  176. package/dist/knowledge/machine-templates.js +1 -1597
  177. package/dist/knowledge/machine-topology.js +1 -234
  178. package/dist/knowledge/machine-translation.js +1 -513
  179. package/dist/knowledge/market-metrics.d.ts +12 -0
  180. package/dist/knowledge/market-metrics.js +1 -0
  181. package/dist/knowledge/market-operations.d.ts +46 -0
  182. package/dist/knowledge/market-operations.js +1 -0
  183. package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
  184. package/dist/knowledge/mcp-schema-audit.d.ts +22 -22
  185. package/dist/knowledge/mcp-schema-audit.js +1 -777
  186. package/dist/knowledge/onchain-constants.js +1 -35
  187. package/dist/knowledge/order-confirm.js +1 -573
  188. package/dist/knowledge/order-context.js +1 -390
  189. package/dist/knowledge/order-ledger.js +1 -341
  190. package/dist/knowledge/order-puzzle.js +1 -255
  191. package/dist/knowledge/order-risk.js +1 -653
  192. package/dist/knowledge/order-templates.js +1 -368
  193. package/dist/knowledge/order-translation.js +1 -550
  194. package/dist/knowledge/overrides-loader.js +1 -65
  195. package/dist/knowledge/passport-confirm.js +1 -531
  196. package/dist/knowledge/passport-context.js +1 -306
  197. package/dist/knowledge/passport-ledger.js +1 -282
  198. package/dist/knowledge/passport-puzzle.js +1 -333
  199. package/dist/knowledge/passport-risk.js +1 -450
  200. package/dist/knowledge/passport-templates.js +1 -568
  201. package/dist/knowledge/passport-translation.js +1 -516
  202. package/dist/knowledge/payment-confirm.d.ts +26 -0
  203. package/dist/knowledge/payment-confirm.js +1 -0
  204. package/dist/knowledge/payment-risk.js +1 -249
  205. package/dist/knowledge/payment-translation.d.ts +37 -0
  206. package/dist/knowledge/payment-translation.js +1 -0
  207. package/dist/knowledge/permission-confirm.js +1 -426
  208. package/dist/knowledge/permission-context.js +1 -224
  209. package/dist/knowledge/permission-ledger.d.ts +11 -0
  210. package/dist/knowledge/permission-ledger.js +1 -403
  211. package/dist/knowledge/permission-puzzle.js +1 -173
  212. package/dist/knowledge/permission-risk.js +1 -411
  213. package/dist/knowledge/permission-templates.js +1 -234
  214. package/dist/knowledge/permission-translation.js +1 -350
  215. package/dist/knowledge/personal-confirm.d.ts +29 -0
  216. package/dist/knowledge/personal-confirm.js +1 -0
  217. package/dist/knowledge/personal-risk.js +1 -212
  218. package/dist/knowledge/personal-translation.d.ts +37 -0
  219. package/dist/knowledge/personal-translation.js +1 -0
  220. package/dist/knowledge/process-model.d.ts +1 -11
  221. package/dist/knowledge/process-model.js +1 -160
  222. package/dist/knowledge/progress-confirm.js +1 -456
  223. package/dist/knowledge/progress-context.js +1 -452
  224. package/dist/knowledge/progress-ledger.js +1 -330
  225. package/dist/knowledge/progress-puzzle.js +1 -219
  226. package/dist/knowledge/progress-risk.js +1 -461
  227. package/dist/knowledge/progress-templates.js +1 -228
  228. package/dist/knowledge/progress-translation.js +1 -405
  229. package/dist/knowledge/proof-confirm.js +1 -187
  230. package/dist/knowledge/proof-context.d.ts +17 -0
  231. package/dist/knowledge/proof-context.js +1 -0
  232. package/dist/knowledge/proof-ledger.d.ts +34 -0
  233. package/dist/knowledge/proof-ledger.js +1 -0
  234. package/dist/knowledge/proof-puzzle.d.ts +35 -0
  235. package/dist/knowledge/proof-puzzle.js +1 -0
  236. package/dist/knowledge/proof-risk.js +1 -207
  237. package/dist/knowledge/proof-templates.d.ts +22 -0
  238. package/dist/knowledge/proof-templates.js +1 -0
  239. package/dist/knowledge/proof-translation.js +1 -283
  240. package/dist/knowledge/registrar-confirm.d.ts +26 -0
  241. package/dist/knowledge/registrar-confirm.js +1 -0
  242. package/dist/knowledge/registrar-risk.js +1 -217
  243. package/dist/knowledge/registrar-translation.d.ts +37 -0
  244. package/dist/knowledge/registrar-translation.js +1 -0
  245. package/dist/knowledge/repository-confirm.js +1 -286
  246. package/dist/knowledge/repository-context.d.ts +12 -0
  247. package/dist/knowledge/repository-context.js +1 -0
  248. package/dist/knowledge/repository-ledger.d.ts +25 -0
  249. package/dist/knowledge/repository-ledger.js +1 -0
  250. package/dist/knowledge/repository-puzzle.d.ts +30 -0
  251. package/dist/knowledge/repository-puzzle.js +1 -0
  252. package/dist/knowledge/repository-risk.js +1 -373
  253. package/dist/knowledge/repository-templates.d.ts +14 -0
  254. package/dist/knowledge/repository-templates.js +1 -0
  255. package/dist/knowledge/repository-translation.js +1 -445
  256. package/dist/knowledge/reputation-rules.js +1 -99
  257. package/dist/knowledge/resource-confirm.d.ts +25 -0
  258. package/dist/knowledge/resource-confirm.js +1 -0
  259. package/dist/knowledge/resource-risk.js +1 -157
  260. package/dist/knowledge/resource-translation.d.ts +37 -0
  261. package/dist/knowledge/resource-translation.js +1 -0
  262. package/dist/knowledge/reward-confirm.js +1 -526
  263. package/dist/knowledge/reward-context.d.ts +2 -2
  264. package/dist/knowledge/reward-context.js +1 -504
  265. package/dist/knowledge/reward-ledger.js +1 -502
  266. package/dist/knowledge/reward-puzzle.js +1 -300
  267. package/dist/knowledge/reward-risk.js +1 -627
  268. package/dist/knowledge/reward-templates.js +1 -197
  269. package/dist/knowledge/reward-translation.js +1 -501
  270. package/dist/knowledge/safety-rules.d.ts +1 -0
  271. package/dist/knowledge/safety-rules.js +1 -404
  272. package/dist/knowledge/scenario-modes.js +1 -321
  273. package/dist/knowledge/service-confirm.js +1 -807
  274. package/dist/knowledge/service-context.js +1 -403
  275. package/dist/knowledge/service-ledger.js +1 -609
  276. package/dist/knowledge/service-puzzle.js +1 -236
  277. package/dist/knowledge/service-risk.d.ts +1 -1
  278. package/dist/knowledge/service-risk.js +1 -651
  279. package/dist/knowledge/service-templates.js +1 -456
  280. package/dist/knowledge/service-translation.js +1 -622
  281. package/dist/knowledge/template-registry.js +1 -353
  282. package/dist/knowledge/tool-constraints.js +1 -195
  283. package/dist/knowledge/tools-reference.js +1 -178
  284. package/dist/knowledge/treasury-confirm.js +1 -512
  285. package/dist/knowledge/treasury-context.js +1 -363
  286. package/dist/knowledge/treasury-ledger.js +1 -300
  287. package/dist/knowledge/treasury-puzzle.js +1 -216
  288. package/dist/knowledge/treasury-risk.js +1 -440
  289. package/dist/knowledge/treasury-templates.js +1 -358
  290. package/dist/knowledge/treasury-translation.js +1 -498
  291. package/dist/knowledge/trust-metrics.js +1 -198
  292. package/dist/knowledge/universal-template.d.ts +22 -0
  293. package/dist/knowledge/universal-template.js +1 -0
  294. package/dist/knowledge/util-confirm.d.ts +24 -0
  295. package/dist/knowledge/util-confirm.js +1 -0
  296. package/dist/knowledge/util-risk.js +1 -135
  297. package/dist/knowledge/util-translation.d.ts +38 -0
  298. package/dist/knowledge/util-translation.js +1 -0
  299. package/dist/knowledge/workflow-guidance.d.ts +116 -0
  300. package/dist/knowledge/workflow-guidance.js +1 -0
  301. package/dist/loop-engineering/aggregate.js +1 -132
  302. package/dist/loop-engineering/context-collect.js +1 -83
  303. package/dist/loop-engineering/diagnose.js +1 -273
  304. package/dist/loop-engineering/improve.js +1 -405
  305. package/dist/loop-engineering/index.js +1 -4
  306. package/dist/loop-engineering/pipeline.js +1 -56
  307. package/dist/mode-market/index.js +1 -3
  308. package/dist/mode-market/registry.js +1 -124
  309. package/dist/mode-market/review.js +1 -214
  310. package/dist/mode-market/submission.js +1 -85
  311. package/dist/participation/collaborator-interest.d.ts +23 -0
  312. package/dist/participation/collaborator-interest.js +1 -0
  313. package/dist/participation/customer-interest.d.ts +25 -0
  314. package/dist/participation/customer-interest.js +1 -0
  315. package/dist/participation/employee-kpi.d.ts +25 -0
  316. package/dist/participation/employee-kpi.js +1 -0
  317. package/dist/participation/employee-store.d.ts +16 -0
  318. package/dist/participation/employee-store.js +1 -0
  319. package/dist/participation/index.d.ts +2 -0
  320. package/dist/participation/index.js +1 -0
  321. package/dist/participation/merchant-interest.js +1 -100
  322. package/dist/participation/radar-core.d.ts +13 -3
  323. package/dist/participation/radar-core.js +1 -269
  324. package/dist/participation/supplier-interest.d.ts +25 -0
  325. package/dist/participation/supplier-interest.js +1 -0
  326. package/dist/persona/analyzer.js +1 -66
  327. package/dist/persona/bridge.js +1 -86
  328. package/dist/persona/defaults.js +1 -195
  329. package/dist/persona/experience-bridge.js +1 -23
  330. package/dist/persona/index.d.ts +9 -2
  331. package/dist/persona/index.js +1 -71
  332. package/dist/persona/local-region.d.ts +20 -0
  333. package/dist/persona/local-region.js +1 -0
  334. package/dist/persona/model.js +1 -111
  335. package/dist/persona/overrides.d.ts +10 -0
  336. package/dist/persona/overrides.js +1 -0
  337. package/dist/persona/pack-personae.d.ts +11 -0
  338. package/dist/persona/pack-personae.js +1 -0
  339. package/dist/persona/store.js +1 -62
  340. package/dist/persona/strategy-intent.d.ts +20 -0
  341. package/dist/persona/strategy-intent.js +1 -0
  342. package/dist/persona/types.d.ts +6 -2
  343. package/dist/persona/types.js +1 -5
  344. package/dist/project/business-puzzle.d.ts +1 -1
  345. package/dist/project/business-puzzle.js +1 -383
  346. package/dist/project/context-assembly.js +1 -254
  347. package/dist/project/deployment-bridge.js +1 -120
  348. package/dist/project/deployment-doc.js +1 -1126
  349. package/dist/project/edit-planner.js +1 -1342
  350. package/dist/project/evaluation.d.ts +37 -1
  351. package/dist/project/evaluation.js +1 -2011
  352. package/dist/project/game-theory.js +1 -177
  353. package/dist/project/graph-builder.js +1 -656
  354. package/dist/project/graph.d.ts +3 -6
  355. package/dist/project/graph.js +1 -340
  356. package/dist/project/handlers.d.ts +33 -2
  357. package/dist/project/handlers.js +1 -1784
  358. package/dist/project/index.d.ts +2 -0
  359. package/dist/project/index.js +1 -301
  360. package/dist/project/intent-analyzer.js +1 -149
  361. package/dist/project/machine-nodes.js +1 -36
  362. package/dist/project/merchant-guide.d.ts +19 -0
  363. package/dist/project/merchant-guide.js +1 -264
  364. package/dist/project/migration.js +1 -125
  365. package/dist/project/mode-actions.js +1 -309
  366. package/dist/project/namespace.js +1 -206
  367. package/dist/project/participation-radar.js +1 -428
  368. package/dist/project/pipeline-actions.js +1 -109
  369. package/dist/project/project-store.js +1 -422
  370. package/dist/project/query.js +1 -153
  371. package/dist/project/reverse-mapping.d.ts +34 -0
  372. package/dist/project/reverse-mapping.js +1 -0
  373. package/dist/project/risk-aggregator.js +1 -295
  374. package/dist/project/rollback-policy.js +1 -290
  375. package/dist/project/semantic-assembler.js +1 -345
  376. package/dist/project/semantic-graph.d.ts +3 -5
  377. package/dist/project/semantic-graph.js +1 -292
  378. package/dist/project/stage-gate.js +1 -369
  379. package/dist/project/substep-trace.js +1 -332
  380. package/dist/project/task-tracker.js +1 -78
  381. package/dist/project/workflow-design-assessment.d.ts +24 -0
  382. package/dist/project/workflow-design-assessment.js +1 -0
  383. package/dist/role/derivation.d.ts +18 -0
  384. package/dist/role/derivation.js +1 -0
  385. package/dist/role/index.d.ts +5 -0
  386. package/dist/role/index.js +1 -0
  387. package/dist/role/model.d.ts +8 -0
  388. package/dist/role/model.js +1 -0
  389. package/dist/role/resolution.d.ts +11 -0
  390. package/dist/role/resolution.js +1 -0
  391. package/dist/role/types.d.ts +11 -0
  392. package/dist/role/types.js +1 -0
  393. package/dist/rules.js +1 -52
  394. package/dist/safety/confirm-gate.d.ts +1 -1
  395. package/dist/safety/confirm-gate.js +1 -88
  396. package/dist/safety/index.js +1 -3
  397. package/dist/safety/preview.js +1 -52
  398. package/dist/schema/call/allocation.d.ts +186 -1385
  399. package/dist/schema/call/allocation.js +1 -34
  400. package/dist/schema/call/arbitration.d.ts +272 -1871
  401. package/dist/schema/call/arbitration.js +1 -113
  402. package/dist/schema/call/base.d.ts +1831 -9076
  403. package/dist/schema/call/base.js +1 -370
  404. package/dist/schema/call/bridge.d.ts +911 -3171
  405. package/dist/schema/call/bridge.js +1 -458
  406. package/dist/schema/call/contact.d.ts +135 -931
  407. package/dist/schema/call/contact.js +1 -37
  408. package/dist/schema/call/demand.d.ts +164 -1194
  409. package/dist/schema/call/demand.js +1 -47
  410. package/dist/schema/call/guard.d.ts +298 -1140
  411. package/dist/schema/call/guard.js +1 -161
  412. package/dist/schema/call/handler.js +1 -322
  413. package/dist/schema/call/index.js +1 -20
  414. package/dist/schema/call/machine.d.ts +459 -5403
  415. package/dist/schema/call/machine.js +1 -193
  416. package/dist/schema/call/order.d.ts +137 -844
  417. package/dist/schema/call/order.js +1 -35
  418. package/dist/schema/call/payment.d.ts +74 -561
  419. package/dist/schema/call/payment.js +1 -37
  420. package/dist/schema/call/permission-handler.js +1 -54
  421. package/dist/schema/call/permission.d.ts +335 -2791
  422. package/dist/schema/call/permission.js +1 -105
  423. package/dist/schema/call/personal.d.ts +227 -1814
  424. package/dist/schema/call/personal.js +1 -78
  425. package/dist/schema/call/progress.d.ts +140 -843
  426. package/dist/schema/call/progress.js +1 -47
  427. package/dist/schema/call/proof.d.ts +42 -258
  428. package/dist/schema/call/proof.js +1 -33
  429. package/dist/schema/call/repository.d.ts +324 -2222
  430. package/dist/schema/call/repository.js +1 -77
  431. package/dist/schema/call/reward.d.ts +153 -1183
  432. package/dist/schema/call/reward.js +1 -30
  433. package/dist/schema/call/semantic.js +1 -1679
  434. package/dist/schema/call/service.d.ts +376 -3431
  435. package/dist/schema/call/service.js +1 -184
  436. package/dist/schema/call/treasury.d.ts +252 -2158
  437. package/dist/schema/call/treasury.js +1 -71
  438. package/dist/schema/common/index.d.ts +222 -697
  439. package/dist/schema/common/index.js +1 -407
  440. package/dist/schema/config/index.d.ts +18 -161
  441. package/dist/schema/config/index.js +1 -68
  442. package/dist/schema/employee/index.d.ts +99 -0
  443. package/dist/schema/employee/index.js +1 -0
  444. package/dist/schema/evaluation/index.d.ts +1062 -3748
  445. package/dist/schema/evaluation/index.js +1 -356
  446. package/dist/schema/index.d.ts +3 -0
  447. package/dist/schema/index.js +1 -17
  448. package/dist/schema/industry-pack/index.d.ts +132 -0
  449. package/dist/schema/industry-pack/index.js +1 -0
  450. package/dist/schema/intent-radar/index.d.ts +92 -245
  451. package/dist/schema/intent-radar/index.js +1 -89
  452. package/dist/schema/local/index.d.ts +2045 -18080
  453. package/dist/schema/local/index.js +1 -927
  454. package/dist/schema/local/wip.d.ts +61 -651
  455. package/dist/schema/local/wip.js +1 -187
  456. package/dist/schema/messenger/index.d.ts +949 -5557
  457. package/dist/schema/messenger/index.js +1 -475
  458. package/dist/schema/operations.d.ts +2969 -26518
  459. package/dist/schema/operations.js +1 -520
  460. package/dist/schema/persona/index.d.ts +469 -1820
  461. package/dist/schema/persona/index.js +1 -148
  462. package/dist/schema/project/index.d.ts +1027 -8408
  463. package/dist/schema/project/index.js +1 -2057
  464. package/dist/schema/query/index.d.ts +12041 -75261
  465. package/dist/schema/query/index.js +1 -1646
  466. package/dist/schema/schema-query/index.d.ts +35 -98
  467. package/dist/schema/schema-query/index.js +1 -104
  468. package/dist/schema/schema-version.js +1 -76
  469. package/dist/schema/task-status.d.ts +26 -132
  470. package/dist/schema/task-status.js +1 -36
  471. package/dist/schema/trust/index.d.ts +194 -1290
  472. package/dist/schema/trust/index.js +1 -314
  473. package/dist/schema/utils/guard-parser.js +1 -419
  474. package/dist/schema/utils/guard-query-utils.js +1 -46
  475. package/dist/schema/utils/node-parser.js +1 -369
  476. package/dist/schema/utils/object-type-utils.js +1 -35
  477. package/dist/schema/utils/permission-index-utils.js +1 -7
  478. package/dist/schema/utils/permission-machine-check.js +1 -121
  479. package/dist/schema/utils/skills-recommendation.d.ts +1 -0
  480. package/dist/schema/utils/skills-recommendation.js +1 -77
  481. package/dist/schema/workspace/index.d.ts +69 -0
  482. package/dist/schema/workspace/index.js +1 -0
  483. package/dist/schema-query-impl/index.js +1 -0
  484. package/dist/schemas/account_operation.output.json +3147 -1652
  485. package/dist/schemas/account_operation.schema.json +225 -218
  486. package/dist/schemas/bridge_operation.output.json +1168 -650
  487. package/dist/schemas/bridge_operation.schema.json +736 -504
  488. package/dist/schemas/config_operation.output.json +185 -179
  489. package/dist/schemas/config_operation.schema.json +21 -26
  490. package/dist/schemas/employee_operation.output.json +207 -0
  491. package/dist/schemas/employee_operation.schema.json +176 -0
  492. package/dist/schemas/evaluation_operation.output.json +2329 -557
  493. package/dist/schemas/evaluation_operation.schema.json +2939 -720
  494. package/dist/schemas/guard2file.output.json +58 -64
  495. package/dist/schemas/guard2file.schema.json +79 -81
  496. package/dist/schemas/index.json +29 -11
  497. package/dist/schemas/industry_pack_operation.output.json +594 -0
  498. package/dist/schemas/industry_pack_operation.schema.json +55 -0
  499. package/dist/schemas/intent_radar.output.json +275 -200
  500. package/dist/schemas/intent_radar.schema.json +124 -123
  501. package/dist/schemas/local_info_operation.output.json +1174 -657
  502. package/dist/schemas/local_info_operation.schema.json +119 -125
  503. package/dist/schemas/local_mark_operation.output.json +1239 -689
  504. package/dist/schemas/local_mark_operation.schema.json +91 -96
  505. package/dist/schemas/machineNode2file.output.json +63 -69
  506. package/dist/schemas/machineNode2file.schema.json +79 -81
  507. package/dist/schemas/messenger_operation.output.json +2722 -1528
  508. package/dist/schemas/messenger_operation.schema.json +1482 -1264
  509. package/dist/schemas/onchain_events.output.json +2590 -975
  510. package/dist/schemas/onchain_events.schema.json +117 -99
  511. package/dist/schemas/onchain_operations.output.json +3957 -2309
  512. package/dist/schemas/onchain_operations.schema.json +20799 -9285
  513. package/dist/schemas/onchain_operations_allocation.schema.json +172 -108
  514. package/dist/schemas/onchain_operations_arbitration.schema.json +233 -146
  515. package/dist/schemas/onchain_operations_contact.schema.json +129 -90
  516. package/dist/schemas/onchain_operations_demand.schema.json +170 -112
  517. package/dist/schemas/onchain_operations_gen_passport.schema.json +61 -646
  518. package/dist/schemas/onchain_operations_gen_proof.schema.json +40 -172
  519. package/dist/schemas/onchain_operations_guard.schema.json +3765 -294
  520. package/dist/schemas/onchain_operations_machine.schema.json +537 -164
  521. package/dist/schemas/onchain_operations_order.schema.json +126 -96
  522. package/dist/schemas/onchain_operations_payment.schema.json +82 -67
  523. package/dist/schemas/onchain_operations_permission.schema.json +331 -93
  524. package/dist/schemas/onchain_operations_personal.schema.json +636 -96
  525. package/dist/schemas/onchain_operations_progress.schema.json +125 -92
  526. package/dist/schemas/onchain_operations_proof.schema.json +76 -69
  527. package/dist/schemas/onchain_operations_repository.schema.json +636 -249
  528. package/dist/schemas/onchain_operations_reward.schema.json +218 -108
  529. package/dist/schemas/onchain_operations_service.schema.json +679 -221
  530. package/dist/schemas/onchain_operations_treasury.schema.json +401 -135
  531. package/dist/schemas/onchain_table_data.output.json +6018 -2430
  532. package/dist/schemas/onchain_table_data.schema.json +544 -430
  533. package/dist/schemas/persona_operation.output.json +1568 -265
  534. package/dist/schemas/persona_operation.schema.json +346 -202
  535. package/dist/schemas/project_operation.output.json +6957 -5147
  536. package/dist/schemas/project_operation.schema.json +1050 -1020
  537. package/dist/schemas/query_task_status.output.json +195 -99
  538. package/dist/schemas/query_task_status.schema.json +12 -18
  539. package/dist/schemas/query_toolkit.output.json +18870 -14566
  540. package/dist/schemas/query_toolkit.schema.json +614 -522
  541. package/dist/schemas/schema_query.output.json +127 -129
  542. package/dist/schemas/schema_query.schema.json +64 -69
  543. package/dist/schemas/trust_score.output.json +678 -587
  544. package/dist/schemas/trust_score.schema.json +289 -277
  545. package/dist/schemas/wip_file.output.json +116 -124
  546. package/dist/schemas/wip_file.schema.json +142 -143
  547. package/dist/schemas/workspace_operation.output.json +277 -0
  548. package/dist/schemas/workspace_operation.schema.json +45 -0
  549. package/dist/schemas/wowok_buildin_info.output.json +1693 -723
  550. package/dist/schemas/wowok_buildin_info.schema.json +576 -512
  551. package/dist/telemetry/index.js +1 -112
  552. package/dist/telemetry/redact.js +1 -23
  553. package/dist/telemetry/storage.js +1 -80
  554. package/dist/tools/handlers/bridge.d.ts +8 -1
  555. package/dist/tools/handlers/bridge.js +1 -1
  556. package/dist/tools/handlers/config.js +1 -74
  557. package/dist/tools/handlers/employee.d.ts +2 -0
  558. package/dist/tools/handlers/employee.js +1 -0
  559. package/dist/tools/handlers/evaluation.js +1 -123
  560. package/dist/tools/handlers/file-export.js +1 -90
  561. package/dist/tools/handlers/industry-pack.d.ts +2 -0
  562. package/dist/tools/handlers/industry-pack.js +1 -0
  563. package/dist/tools/handlers/intent-radar.js +1 -76
  564. package/dist/tools/handlers/local.js +1 -53
  565. package/dist/tools/handlers/messenger.js +1 -188
  566. package/dist/tools/handlers/onchain.js +1 -1180
  567. package/dist/tools/handlers/persona.js +1 -89
  568. package/dist/tools/handlers/project.js +1 -211
  569. package/dist/tools/handlers/query.js +1 -434
  570. package/dist/tools/handlers/schema-query.js +1 -176
  571. package/dist/tools/handlers/task-status.js +1 -26
  572. package/dist/tools/handlers/trust.js +1 -380
  573. package/dist/tools/handlers/wip.js +1 -90
  574. package/dist/tools/handlers/workspace.d.ts +2 -0
  575. package/dist/tools/handlers/workspace.js +1 -0
  576. package/dist/tools/index.d.ts +2 -1
  577. package/dist/tools/index.js +1 -1382
  578. package/dist/tools/retry.js +1 -85
  579. package/dist/tools/rules-hook.d.ts +1 -1
  580. package/dist/tools/rules-hook.js +1 -23
  581. package/dist/tools/shared.d.ts +1 -1
  582. package/dist/tools/shared.js +1 -130
  583. package/dist/tools/types.d.ts +2 -1
  584. package/dist/tools/types.js +1 -1
  585. package/dist/tools/upgrade-check.d.ts +19 -0
  586. package/dist/tools/upgrade-check.js +1 -0
  587. package/dist/tools/wip-deploy-assist.js +1 -306
  588. package/dist/tools/wrap.js +1 -500
  589. package/package.json +7 -6
  590. package/dist/knowledge/arbitration-trust.d.ts +0 -24
  591. package/dist/knowledge/arbitration-trust.js +0 -117
  592. package/dist/schema/call/bridge-handler.d.ts +0 -8
  593. package/dist/schema/call/bridge-handler.js +0 -265
  594. package/dist/schema/sync-layer4.d.ts +0 -21
  595. package/dist/schema/sync-layer4.js +0 -286
  596. package/dist/schema-query/index.js +0 -810
  597. /package/dist/{schema-query → schema-query-impl}/index.d.ts +0 -0
@@ -3,1101 +3,1131 @@
3
3
  "$id": "https://wowok.net/schemas/project_operation.json",
4
4
  "title": "Project - Entity Management & Evaluation",
5
5
  "description": "Project management service — manage projects as first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine. Actions: list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff, assemble_context.",
6
- "$ref": "#/definitions/project_operation",
7
- "definitions": {
8
- "project_operation": {
6
+ "type": "object",
7
+ "properties": {
8
+ "action": {
9
+ "type": "string",
10
+ "enum": [
11
+ "list_projects",
12
+ "create_project",
13
+ "create_project_from_onchain",
14
+ "update_project",
15
+ "get_project_detail",
16
+ "add_object",
17
+ "remove_object",
18
+ "update_object",
19
+ "create_version",
20
+ "build_graph",
21
+ "get_graph",
22
+ "evaluate_project",
23
+ "save_evaluation",
24
+ "compare_projects",
25
+ "refresh_objects",
26
+ "get_object_diff",
27
+ "delete_project",
28
+ "assemble_context",
29
+ "reverse_map",
30
+ "get_machine_graph",
31
+ "get_guard_graph",
32
+ "generate_deployment_doc",
33
+ "pre_evaluate_check",
34
+ "verify_deployment",
35
+ "clone_project_to_network",
36
+ "migrate_network",
37
+ "migrate_to_mainnet",
38
+ "plan_object_edit",
39
+ "apply_object_edit",
40
+ "patch_machine_nodes",
41
+ "patch_guard_tree",
42
+ "recommend_industry",
43
+ "list_modes",
44
+ "derive_user_mode",
45
+ "evolve_user_mode",
46
+ "register_user_mode",
47
+ "unregister_user_mode",
48
+ "register_custom_metric",
49
+ "register_custom_constraint",
50
+ "list_metrics_constraints",
51
+ "analyze_intent",
52
+ "aggregate_risks",
53
+ "trace_substeps",
54
+ "merchant_guide",
55
+ "participation_radar"
56
+ ],
57
+ "description": "Action to perform. Two categories:\n1. Project Entity + Evaluation (15, GLM6): list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff. Projects are first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine.\n2. Context Assembly (1): assemble_context (query on-chain object states + extract embedded history + optional events, and assemble a structured semantic context for LLM consumption). Required input: context_objects (array of object IDs/names). Optional: include_events (query recent state-transition events).\n2b. Reverse Mapping (1): reverse_map (deterministic L4→L1 business report — queries the on-chain objects, classifies them into business semantics, and emits a fixed-rule BusinessReport with merchant profile, user risk assessment, and game-theory analysis. Same objects ALWAYS yield the same report — no LLM involved). Required input: context_objects (include the Service; add Machine/Allocation for refund-path detection). Optional: context_network, order_amount.\n3. Cross-Network Migration (FIX-012): clone_project_to_network (or its alias migrate_network) copies a source project's object metadata to a new project bound to target_network. The 5-step migration workflow: 1) call clone_project_to_network (or migrate_network) with target_network to copy metadata, 2) re-run onchain_operations with env.network=target_network to deploy objects on-chain, 3) re-register LocalMark names with the SAME names on the target network (FIX-011 cross-network consistency), 4) update_project to set service_address on the new project, 5) build_graph to construct the new project's relationship graph."
58
+ },
59
+ "project": {
60
+ "description": "Project prefix (human-readable unique identifier). For create_project: OPTIONAL — if omitted, auto-derived from project_name (e.g. 'Twitch Service' → 'twitch_service'). For other actions (build_graph, evaluate_project, etc.): used to identify the project. Takes precedence resolution: project_id > project (prefix).",
61
+ "type": "string"
62
+ },
63
+ "version": {
64
+ "description": "Project version (e.g. 'v1'). Used by create_version.",
65
+ "type": "string",
66
+ "pattern": "^v\\d+$"
67
+ },
68
+ "context_objects": {
69
+ "description": "Object IDs (0x...) or LocalMark names to assemble context for. Required when action='assemble_context'. The current on-chain state of each object will be queried and enriched with semantic annotations.",
70
+ "type": "array",
71
+ "items": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ "include_events": {
76
+ "description": "When true, assemble_context also queries recent state-transition events (NewOrderEvent, ProgressEvent, ArbEvent, etc.). Events are the real-time transition log — convergent and bounded. Defaults to false. Note: object-embedded history (ProgressSession.forwards, Order.disputes) is ALWAYS extracted automatically — no flag needed.",
77
+ "type": "boolean"
78
+ },
79
+ "context_network": {
80
+ "description": "Network for assemble_context / reverse_map queries. Defaults to 'testnet' if omitted.",
81
+ "type": "string",
82
+ "enum": [
83
+ "testnet",
84
+ "mainnet"
85
+ ]
86
+ },
87
+ "reverse_order_amount": {
88
+ "description": "Escrowed order amount (smallest-unit string) for reverse_map — included in the report summary as the concrete escrow mention.",
89
+ "type": "string"
90
+ },
91
+ "context_depth": {
92
+ "description": "BFS recursion depth for dependency expansion in assemble_context (default 0 = no expansion). When >0, the assembly recursively queries objects referenced by the center objects (permission, guard, machine, service, repositories, etc.) up to the given depth, using the same address-field extraction rules as build_graph (Pathway 1). Each level issues one batched query_objects call (≤50 IDs per batch). Cycles are detected and skipped via a visited set. Discovered dependencies are returned in `dependencies` (edge metadata) and `dependency_objects` (full object states). Recommended: 1–2 for most use cases; 3+ may pull large subgraphs (use context_include to constrain).",
93
+ "type": "integer",
94
+ "minimum": 0,
95
+ "maximum": 5
96
+ },
97
+ "context_include": {
98
+ "description": "Optional filter for dependency expansion edge types. When omitted, ALL outbound references are followed. When provided, only edges whose `field` matches one of the listed names are followed. Recognized field names (from extractAddressFields): 'permission', 'machine', 'service', 'progress', 'buy_guard', 'um', 'repositories', 'arbitrations', 'rewards', 'consensus_repositories', 'context_repositories', 'dispute', 'allocation', 'external_deposit_guard', 'external_withdraw_guard', 'allocator_guard', 'for_object', 'for_guard', 'payment', 'voting_guard', 'usage_guard', 'guard', 'write_guard', 'quote_guard', 'recipient_entity', 'order_allocators'. Example: ['permission','guard'] expands only permission/guard dependencies.",
99
+ "type": "array",
100
+ "items": {
101
+ "type": "string"
102
+ }
103
+ },
104
+ "filter_status": {
105
+ "description": "Filter list_projects by project status.",
106
+ "type": "string",
107
+ "enum": [
108
+ "draft",
109
+ "active",
110
+ "inactive",
111
+ "archived"
112
+ ]
113
+ },
114
+ "filter_perspective": {
115
+ "description": "Filter list_projects by project perspective.",
116
+ "type": "string",
117
+ "enum": [
118
+ "producer",
119
+ "consumer",
120
+ "both"
121
+ ]
122
+ },
123
+ "filter_network": {
124
+ "description": "Filter list_projects by network.",
125
+ "type": "string",
126
+ "enum": [
127
+ "testnet",
128
+ "mainnet"
129
+ ]
130
+ },
131
+ "project_name": {
132
+ "description": "Display name for create_project / create_project_from_onchain / update_project. Required when action='create_project'.",
133
+ "type": "string",
134
+ "minLength": 1,
135
+ "maxLength": 200
136
+ },
137
+ "project_description": {
138
+ "description": "Project description for create_project / update_project.",
139
+ "type": "string",
140
+ "maxLength": 2000
141
+ },
142
+ "project_industry": {
143
+ "description": "Industry tag for create_project. Drives template defaults — when set (and not 'general'), the system auto-applies an industry blueprint with ~10 draft objects (Permission, Service, Machine, Guard, Treasury, Allocation, etc.) + graph edges, ready for deployment. Supported industries: 'general' (no template), 'retail', 'retail_d2c' (Direct-to-Consumer, e.g., Shopify — Allocation escrow + 2 Guards), 'service', 'rental', 'freelance', 'education', 'travel', 'subscription', 'custom'. Each industry preset embeds risk constraints (e.g., 'freelance' does NOT require compensation_fund, while 'rental'/'travel' do). Example: project_industry='freelance' creates a freelance-style blueprint with setting_locked_time ≥ 7d. Set skip_templates=true to bypass template application.",
144
+ "type": "string",
145
+ "enum": [
146
+ "general",
147
+ "retail",
148
+ "retail_d2c",
149
+ "service",
150
+ "rental",
151
+ "freelance",
152
+ "education",
153
+ "travel",
154
+ "subscription",
155
+ "custom"
156
+ ]
157
+ },
158
+ "project_perspective": {
159
+ "description": "Project perspective for create_project. 'producer' = build/operate services, 'consumer' = evaluate/buy services, 'both' = dual role. Defaults to 'producer'.",
160
+ "type": "string",
161
+ "enum": [
162
+ "producer",
163
+ "consumer",
164
+ "both"
165
+ ]
166
+ },
167
+ "project_labels": {
168
+ "description": "Free-form labels for create_project / update_project (e.g. ['travel','london','priority']).",
169
+ "type": "array",
170
+ "items": {
171
+ "type": "string"
172
+ }
173
+ },
174
+ "service_address": {
175
+ "description": "On-chain Service object address. Required for create_project_from_onchain. Optional for create_project (links the project to its core Service).",
176
+ "type": "string"
177
+ },
178
+ "project_network": {
179
+ "description": "Network the project is bound to. A Service deployed to different networks are different projects. Defaults to 'testnet'.",
180
+ "type": "string",
181
+ "enum": [
182
+ "testnet",
183
+ "mainnet"
184
+ ]
185
+ },
186
+ "skip_templates": {
187
+ "description": "When true, create_project skips applying the industry template (no draft:* blueprint objects). Use this when you want a clean project with no pre-filled blueprint objects — useful for custom architectures that do not match any industry mode, or to avoid draft objects appearing in build_graph / evaluate_project before deployment. Defaults to false (templates applied).",
188
+ "type": "boolean"
189
+ },
190
+ "project_id": {
191
+ "description": "Project UUID for update_project / get_project_detail / add_object / remove_object / create_version / build_graph / evaluate_project / refresh_objects. Takes precedence over 'project' (prefix) when both are given.",
192
+ "type": "string"
193
+ },
194
+ "project_status": {
195
+ "description": "New status for update_project. 'active' projects are live, 'archived' are read-only.",
196
+ "type": "string",
197
+ "enum": [
198
+ "draft",
199
+ "active",
200
+ "inactive",
201
+ "archived"
202
+ ]
203
+ },
204
+ "target_network": {
205
+ "description": "Target network for clone_project_to_network (or its alias migrate_network). The source project's objects are copied to a new project bound to this network. The new project's prefix is '<source_prefix>_<target_network>' to avoid collision. See the action description for the full 5-step migration workflow (FIX-012).",
206
+ "type": "string",
207
+ "enum": [
208
+ "testnet",
209
+ "mainnet"
210
+ ]
211
+ },
212
+ "object_address": {
213
+ "description": "On-chain object address (0x followed by 32-64 hex chars) for add_object / remove_object. Also accepts the internal 'draft:<name>' sentinel used by create_project for blueprint objects not yet on-chain. For add_object, alternatively use object_name_add to resolve via LocalMark. H-06 fix: invalid formats are rejected at the handler level with a descriptive error.",
214
+ "type": "string"
215
+ },
216
+ "object_name_add": {
217
+ "description": "LocalMark name for add_object (alternative to object_address).",
218
+ "type": "string"
219
+ },
220
+ "object_type_add": {
221
+ "description": "Object type for add_object.",
222
+ "type": "string",
223
+ "enum": [
224
+ "Service",
225
+ "Machine",
226
+ "Guard",
227
+ "Permission",
228
+ "Reward",
229
+ "Arbitration",
230
+ "Progress",
231
+ "Treasury",
232
+ "Demand",
233
+ "Repository",
234
+ "Contact",
235
+ "Order",
236
+ "Allocation",
237
+ "Personal",
238
+ "Payment",
239
+ "Proof"
240
+ ]
241
+ },
242
+ "object_role": {
243
+ "description": "Object role in project for add_object. 'core' = the Service (only one per project), 'dependency' = required binding, 'reference' = optional/auxiliary. Defaults to 'reference'.",
244
+ "type": "string",
245
+ "enum": [
246
+ "core",
247
+ "dependency",
248
+ "reference"
249
+ ]
250
+ },
251
+ "object_tags_add": {
252
+ "description": "Tags for add_object.",
253
+ "type": "array",
254
+ "items": {
255
+ "type": "string"
256
+ }
257
+ },
258
+ "object_id_remove": {
259
+ "description": "ProjectObject UUID for remove_object (the project_objects.id, NOT the on-chain address).",
260
+ "type": "string"
261
+ },
262
+ "object_id_update": {
263
+ "description": "ProjectObject UUID for update_object (the project_objects.id).",
264
+ "type": "string"
265
+ },
266
+ "object_name_update": {
267
+ "description": "New name for update_object.",
268
+ "type": "string"
269
+ },
270
+ "object_type_update": {
271
+ "description": "New type for update_object.",
272
+ "type": "string"
273
+ },
274
+ "object_role_update": {
275
+ "description": "New role for update_object.",
276
+ "type": "string",
277
+ "enum": [
278
+ "core",
279
+ "dependency",
280
+ "reference"
281
+ ]
282
+ },
283
+ "object_tags_update": {
284
+ "description": "New tags for update_object.",
285
+ "type": "array",
286
+ "items": {
287
+ "type": "string"
288
+ }
289
+ },
290
+ "version_description": {
291
+ "description": "Description for create_version.",
292
+ "type": "string",
293
+ "maxLength": 500
294
+ },
295
+ "fork_from_version": {
296
+ "description": "Source version for create_version (fork objects + graph from this version).",
297
+ "type": "string"
298
+ },
299
+ "max_depth": {
300
+ "description": "Max recursion depth for Pathway 1 (internal reference derivation) in build_graph. Default 3.",
301
+ "type": "integer",
302
+ "minimum": 1,
303
+ "maximum": 5
304
+ },
305
+ "depth": {
306
+ "description": "Alias for max_depth (build_graph). When both are set, max_depth takes precedence. Default 3.",
307
+ "type": "integer",
308
+ "minimum": 1,
309
+ "maximum": 5
310
+ },
311
+ "enable_registrar": {
312
+ "description": "Enable Pathway 2 (Registrar inbound query) in build_graph. Default true.",
313
+ "type": "boolean"
314
+ },
315
+ "enable_potential": {
316
+ "description": "Enable Pathway 3 (potential relationship detection) in build_graph. Default false.",
317
+ "type": "boolean"
318
+ },
319
+ "async_mode": {
320
+ "description": "When true, build_graph / evaluate_project runs in the background and returns { task_id } immediately. Poll query_task_status(task_id) to check progress and retrieve the result. Default false (synchronous). Use async_mode=true for large projects with enable_potential=true where build may take >10s.",
321
+ "type": "boolean"
322
+ },
323
+ "evaluation_type": {
324
+ "description": "Evaluation type for evaluate_project. risk/trust/completeness are rule-based (computed locally). worth_buying/value require LLM assistance (returns a prompt for the caller to process).",
325
+ "type": "string",
326
+ "enum": [
327
+ "risk",
328
+ "trust",
329
+ "completeness",
330
+ "value",
331
+ "worth_buying"
332
+ ]
333
+ },
334
+ "refresh_before_eval": {
335
+ "description": "When true (DEFAULT), evaluate_project refreshes object cache from chain before evaluating. Set to false ONLY for read-only checks where staleness is acceptable (e.g., quick comparisons). BUG-P0-2 fix: previously defaulted to false, causing stale Machine node_count and other dynamic-field-derived fields to produce false findings (e.g., 'Machine has no nodes'). Now defaults to true — set refresh_before_eval=false explicitly to skip refresh.",
336
+ "type": "boolean"
337
+ },
338
+ "eval_score": {
339
+ "description": "Overall evaluation score (0-100) for save_evaluation.",
340
+ "type": "number",
341
+ "minimum": 0,
342
+ "maximum": 100
343
+ },
344
+ "eval_summary": {
345
+ "description": "Evaluation summary for save_evaluation.",
346
+ "type": "string",
347
+ "maxLength": 1000
348
+ },
349
+ "eval_details": {
350
+ "description": "Structured evaluation details for save_evaluation (criterion_scores, findings, etc.).",
9
351
  "type": "object",
10
- "properties": {
11
- "action": {
12
- "type": "string",
13
- "enum": [
14
- "list_projects",
15
- "create_project",
16
- "create_project_from_onchain",
17
- "update_project",
18
- "get_project_detail",
19
- "add_object",
20
- "remove_object",
21
- "update_object",
22
- "create_version",
23
- "build_graph",
24
- "get_graph",
25
- "evaluate_project",
26
- "save_evaluation",
27
- "compare_projects",
28
- "refresh_objects",
29
- "get_object_diff",
30
- "delete_project",
31
- "assemble_context",
32
- "get_machine_graph",
33
- "get_guard_graph",
34
- "generate_deployment_doc",
35
- "pre_evaluate_check",
36
- "verify_deployment",
37
- "clone_project_to_network",
38
- "migrate_network",
39
- "migrate_to_mainnet",
40
- "plan_object_edit",
41
- "apply_object_edit",
42
- "patch_machine_nodes",
43
- "patch_guard_tree",
44
- "recommend_industry",
45
- "list_modes",
46
- "derive_user_mode",
47
- "evolve_user_mode",
48
- "register_user_mode",
49
- "unregister_user_mode",
50
- "register_custom_metric",
51
- "register_custom_constraint",
52
- "list_metrics_constraints",
53
- "analyze_intent",
54
- "aggregate_risks",
55
- "trace_substeps",
56
- "merchant_guide",
57
- "participation_radar"
58
- ],
59
- "description": "Action to perform. Two categories:\n1. Project Entity + Evaluation (15, GLM6): list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff. Projects are first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine.\n2. Context Assembly (1): assemble_context (query on-chain object states + extract embedded history + optional events, and assemble a structured semantic context for LLM consumption). Required input: context_objects (array of object IDs/names). Optional: include_events (query recent state-transition events).\n3. Cross-Network Migration (FIX-012): clone_project_to_network (or its alias migrate_network) copies a source project's object metadata to a new project bound to target_network. The 5-step migration workflow: 1) call clone_project_to_network (or migrate_network) with target_network to copy metadata, 2) re-run onchain_operations with env.network=target_network to deploy objects on-chain, 3) re-register LocalMark names with the SAME names on the target network (FIX-011 cross-network consistency), 4) update_project to set service_address on the new project, 5) build_graph to construct the new project's relationship graph."
60
- },
61
- "project": {
62
- "type": "string",
63
- "description": "Project prefix (human-readable unique identifier). For create_project: OPTIONAL — if omitted, auto-derived from project_name (e.g. 'Twitch Service' → 'twitch_service'). For other actions (build_graph, evaluate_project, etc.): used to identify the project. Takes precedence resolution: project_id > project (prefix)."
64
- },
65
- "version": {
66
- "type": "string",
67
- "pattern": "^v\\d+$",
68
- "description": "Project version (e.g. 'v1'). Used by create_version."
69
- },
70
- "context_objects": {
71
- "type": "array",
72
- "items": {
73
- "type": "string"
74
- },
75
- "description": "Object IDs (0x...) or LocalMark names to assemble context for. Required when action='assemble_context'. The current on-chain state of each object will be queried and enriched with semantic annotations."
76
- },
77
- "include_events": {
78
- "type": "boolean",
79
- "description": "When true, assemble_context also queries recent state-transition events (NewOrderEvent, ProgressEvent, ArbEvent, etc.). Events are the real-time transition log — convergent and bounded. Defaults to false. Note: object-embedded history (ProgressSession.forwards, Order.disputes) is ALWAYS extracted automatically — no flag needed."
80
- },
81
- "context_network": {
82
- "type": "string",
83
- "enum": [
84
- "testnet",
85
- "mainnet"
86
- ],
87
- "description": "Network for assemble_context queries. Defaults to 'testnet' if omitted."
88
- },
89
- "context_depth": {
90
- "type": "integer",
91
- "minimum": 0,
92
- "maximum": 5,
93
- "description": "BFS recursion depth for dependency expansion in assemble_context (default 0 = no expansion). When >0, the assembly recursively queries objects referenced by the center objects (permission, guard, machine, service, repositories, etc.) up to the given depth, using the same address-field extraction rules as build_graph (Pathway 1). Each level issues one batched query_objects call (≤50 IDs per batch). Cycles are detected and skipped via a visited set. Discovered dependencies are returned in `dependencies` (edge metadata) and `dependency_objects` (full object states). Recommended: 1–2 for most use cases; 3+ may pull large subgraphs (use context_include to constrain)."
94
- },
95
- "context_include": {
96
- "type": "array",
97
- "items": {
98
- "type": "string"
99
- },
100
- "description": "Optional filter for dependency expansion edge types. When omitted, ALL outbound references are followed. When provided, only edges whose `field` matches one of the listed names are followed. Recognized field names (from extractAddressFields): 'permission', 'machine', 'service', 'progress', 'buy_guard', 'um', 'repositories', 'arbitrations', 'rewards', 'consensus_repositories', 'context_repositories', 'dispute', 'allocation', 'external_deposit_guard', 'external_withdraw_guard', 'allocator_guard', 'for_object', 'for_guard', 'payment', 'voting_guard', 'usage_guard', 'guard', 'write_guard', 'quote_guard', 'recipient_entity', 'order_allocators'. Example: ['permission','guard'] expands only permission/guard dependencies."
101
- },
102
- "filter_status": {
103
- "type": "string",
104
- "enum": [
105
- "draft",
106
- "active",
107
- "inactive",
108
- "archived"
109
- ],
110
- "description": "Filter list_projects by project status."
111
- },
112
- "filter_perspective": {
113
- "type": "string",
114
- "enum": [
115
- "producer",
116
- "consumer",
117
- "both"
118
- ],
119
- "description": "Filter list_projects by project perspective."
120
- },
121
- "filter_network": {
122
- "type": "string",
123
- "enum": [
124
- "testnet",
125
- "mainnet"
126
- ],
127
- "description": "Filter list_projects by network."
128
- },
129
- "project_name": {
130
- "type": "string",
131
- "minLength": 1,
132
- "maxLength": 200,
133
- "description": "Display name for create_project / create_project_from_onchain / update_project. Required when action='create_project'."
134
- },
135
- "project_description": {
136
- "type": "string",
137
- "maxLength": 2000,
138
- "description": "Project description for create_project / update_project."
139
- },
140
- "project_industry": {
141
- "type": "string",
142
- "enum": [
143
- "general",
144
- "retail",
145
- "retail_d2c",
146
- "service",
147
- "rental",
148
- "freelance",
149
- "education",
150
- "travel",
151
- "subscription",
152
- "custom"
153
- ],
154
- "description": "Industry tag for create_project. Drives template defaults — when set (and not 'general'), the system auto-applies an industry blueprint with ~10 draft objects (Permission, Service, Machine, Guard, Treasury, Allocation, etc.) + graph edges, ready for deployment. Supported industries: 'general' (no template), 'retail', 'retail_d2c' (Direct-to-Consumer, e.g., Shopify — Allocation escrow + 2 Guards), 'service', 'rental', 'freelance', 'education', 'travel', 'subscription', 'custom'. Each industry preset embeds risk constraints (e.g., 'freelance' does NOT require compensation_fund, while 'rental'/'travel' do). Example: project_industry='freelance' creates a freelance-style blueprint with setting_locked_time ≥ 7d. Set skip_templates=true to bypass template application."
155
- },
156
- "project_perspective": {
157
- "type": "string",
158
- "enum": [
159
- "producer",
160
- "consumer",
161
- "both"
162
- ],
163
- "description": "Project perspective for create_project. 'producer' = build/operate services, 'consumer' = evaluate/buy services, 'both' = dual role. Defaults to 'producer'."
164
- },
165
- "project_labels": {
166
- "type": "array",
167
- "items": {
168
- "type": "string"
169
- },
170
- "description": "Free-form labels for create_project / update_project (e.g. ['travel','london','priority'])."
171
- },
172
- "service_address": {
173
- "type": "string",
174
- "description": "On-chain Service object address. Required for create_project_from_onchain. Optional for create_project (links the project to its core Service)."
175
- },
176
- "project_network": {
177
- "type": "string",
178
- "enum": [
179
- "testnet",
180
- "mainnet"
181
- ],
182
- "description": "Network the project is bound to. A Service deployed to different networks are different projects. Defaults to 'testnet'."
183
- },
184
- "skip_templates": {
185
- "type": "boolean",
186
- "description": "When true, create_project skips applying the industry template (no draft:* blueprint objects). Use this when you want a clean project with no pre-filled blueprint objects — useful for custom architectures that do not match any industry mode, or to avoid draft objects appearing in build_graph / evaluate_project before deployment. Defaults to false (templates applied)."
187
- },
188
- "project_id": {
189
- "type": "string",
190
- "description": "Project UUID for update_project / get_project_detail / add_object / remove_object / create_version / build_graph / evaluate_project / refresh_objects. Takes precedence over 'project' (prefix) when both are given."
191
- },
192
- "project_status": {
193
- "type": "string",
194
- "enum": [
195
- "draft",
196
- "active",
197
- "inactive",
198
- "archived"
199
- ],
200
- "description": "New status for update_project. 'active' projects are live, 'archived' are read-only."
201
- },
202
- "target_network": {
203
- "type": "string",
204
- "enum": [
205
- "testnet",
206
- "mainnet"
207
- ],
208
- "description": "Target network for clone_project_to_network (or its alias migrate_network). The source project's objects are copied to a new project bound to this network. The new project's prefix is '<source_prefix>_<target_network>' to avoid collision. See the action description for the full 5-step migration workflow (FIX-012)."
209
- },
210
- "object_address": {
211
- "type": "string",
212
- "description": "On-chain object address (0x followed by 32-64 hex chars) for add_object / remove_object. Also accepts the internal 'draft:<name>' sentinel used by create_project for blueprint objects not yet on-chain. For add_object, alternatively use object_name_add to resolve via LocalMark. H-06 fix: invalid formats are rejected at the handler level with a descriptive error."
213
- },
214
- "object_name_add": {
215
- "type": "string",
216
- "description": "LocalMark name for add_object (alternative to object_address)."
217
- },
218
- "object_type_add": {
219
- "type": "string",
220
- "enum": [
221
- "Service",
222
- "Machine",
223
- "Guard",
224
- "Permission",
225
- "Reward",
226
- "Arbitration",
227
- "Progress",
228
- "Treasury",
229
- "Demand",
230
- "Repository",
231
- "Contact",
232
- "Order",
233
- "Allocation",
234
- "Personal",
235
- "Payment",
236
- "Proof"
237
- ],
238
- "description": "Object type for add_object."
239
- },
240
- "object_role": {
241
- "type": "string",
242
- "enum": [
243
- "core",
244
- "dependency",
245
- "reference"
246
- ],
247
- "description": "Object role in project for add_object. 'core' = the Service (only one per project), 'dependency' = required binding, 'reference' = optional/auxiliary. Defaults to 'reference'."
248
- },
249
- "object_tags_add": {
250
- "type": "array",
251
- "items": {
252
- "type": "string"
253
- },
254
- "description": "Tags for add_object."
255
- },
256
- "object_id_remove": {
257
- "type": "string",
258
- "description": "ProjectObject UUID for remove_object (the project_objects.id, NOT the on-chain address)."
259
- },
260
- "object_id_update": {
261
- "type": "string",
262
- "description": "ProjectObject UUID for update_object (the project_objects.id)."
263
- },
264
- "object_name_update": {
265
- "type": "string",
266
- "description": "New name for update_object."
267
- },
268
- "object_type_update": {
269
- "type": "string",
270
- "description": "New type for update_object."
271
- },
272
- "object_role_update": {
273
- "type": "string",
274
- "enum": [
275
- "core",
276
- "dependency",
277
- "reference"
278
- ],
279
- "description": "New role for update_object."
280
- },
281
- "object_tags_update": {
282
- "type": "array",
283
- "items": {
284
- "type": "string"
352
+ "propertyNames": {
353
+ "type": "string"
354
+ },
355
+ "additionalProperties": {}
356
+ },
357
+ "compare_project_ids": {
358
+ "description": "Array of project IDs to compare (for compare_projects). Minimum 2.",
359
+ "minItems": 2,
360
+ "type": "array",
361
+ "items": {
362
+ "type": "string"
363
+ }
364
+ },
365
+ "diff_address": {
366
+ "description": "Object address for get_object_diff.",
367
+ "type": "string"
368
+ },
369
+ "diff_from_time": {
370
+ "description": "Start timestamp (ms) for get_object_diff.",
371
+ "type": "integer",
372
+ "minimum": -9007199254740991,
373
+ "maximum": 9007199254740991
374
+ },
375
+ "diff_to_time": {
376
+ "description": "End timestamp (ms) for get_object_diff.",
377
+ "type": "integer",
378
+ "minimum": -9007199254740991,
379
+ "maximum": 9007199254740991
380
+ },
381
+ "network": {
382
+ "description": "Target network for generate_deployment_doc. Required when action='generate_deployment_doc'.",
383
+ "type": "string",
384
+ "enum": [
385
+ "testnet",
386
+ "mainnet"
387
+ ]
388
+ },
389
+ "save": {
390
+ "description": "When true (default), persist the generated MD to SQLite project_documents table for generate_deployment_doc.",
391
+ "type": "boolean"
392
+ },
393
+ "detail_level": {
394
+ "description": "P2-03: Deployment document detail level (only for generate_deployment_doc). 'summary' (default): object name + type + key bindings (machine, permission, buy_guard, order_allocators). 'detailed': adds sale list, arbitration list, reward list. 'full': complete fields including stock, price, wip_hash, all config. Use 'summary' for quick review; request 'detailed' or 'full' only when deeper inspection is needed.",
395
+ "type": "string",
396
+ "enum": [
397
+ "summary",
398
+ "detailed",
399
+ "full"
400
+ ]
401
+ },
402
+ "object_kind": {
403
+ "description": "Object kind for plan_object_edit. 'machine' = Machine workflow directed graph (cycles allowed), 'guard' = Guard computation tree. Required when action='plan_object_edit'. Inferred from action for patch_machine_nodes (always 'machine') and patch_guard_tree (always 'guard').",
404
+ "type": "string",
405
+ "enum": [
406
+ "machine",
407
+ "guard"
408
+ ]
409
+ },
410
+ "edit_format": {
411
+ "description": "Format of the edited content for plan_object_edit. 'tree_outline' (default): the indented Markdown outline produced by get_machine_graph / get_guard_graph (human-editable). 'json': raw JSON (machine-readable, for programmatic edits). Both formats are bidirectional with the parse functions in knowledge/machine-render.ts / guard-render.ts.",
412
+ "type": "string",
413
+ "enum": [
414
+ "tree_outline",
415
+ "json"
416
+ ]
417
+ },
418
+ "edited_content": {
419
+ "description": "Edited content for plan_object_edit. Must be in the format specified by edit_format. For 'tree_outline': the full tree_outline string from get_machine_graph/get_guard_graph with user edits. For 'json': a JSON string matching the Machine/Guard schema. The content is parsed + validated + diffed against the current on-chain state.",
420
+ "type": "string"
421
+ },
422
+ "plan_id": {
423
+ "description": "Plan ID returned by plan_object_edit. Required for apply_object_edit. The plan is short-lived (10-minute TTL) and stored in-memory.",
424
+ "type": "string"
425
+ },
426
+ "expected_hash": {
427
+ "description": "Expected hash returned by plan_object_edit. Required for apply_object_edit. Used for optimistic concurrency control: if the on-chain state changed between plan and apply, the hash will mismatch and apply will refuse to proceed (stale edit protection).",
428
+ "type": "string"
429
+ },
430
+ "patch_operations": {
431
+ "description": "Patch operations for patch_machine_nodes / patch_guard_tree. Each string is a single patch operation.\nMachine operations (13 total):\n 'add node <name>' | 'remove node <name>' | 'set description <node_name> <text...>'\n 'add edge <from> <to>' | 'remove edge <from> <to>' | 'set threshold <edge_from> <edge_to> <value>'\n 'add forward <edge_from> <edge_to> <forward_name>' | 'remove forward <edge_from> <edge_to> <forward_name>'\n 'set guard <edge_from> <edge_to> <forward_name> <guard_addr_or_name|none>'\n 'set permission <edge_from> <edge_to> <forward_name> <perm_index>'\n 'set operator <edge_from> <edge_to> <forward_name> <named_operator|none>'\n 'set weight <edge_from> <edge_to> <forward_name> <weight>'\n 'set retained_submission <edge_from> <edge_to> <forward_name> <comma_separated_indices|none>'\nGuard operations (8 total — see patch_guard_tree):\n 'add table <identifier> <name|none> <value_type> <b_submission> [json_value]'\n 'remove table <identifier>' | 'set table_value <identifier> [json_value|none]'\n 'set table_name <identifier> <name|none>' | 'set table_submission <identifier> <true|false>'\n 'set root <json_node>' | 'set rely <comma_separated_guard_addresses|none>'\nOperations are applied in order. Both patches are validated (validateMachine/validateGuard) before execution.",
432
+ "type": "array",
433
+ "items": {
434
+ "type": "string"
435
+ }
436
+ },
437
+ "intent": {
438
+ "description": "Business intent text for recommend_industry (e.g. 'I rent cameras to photographers with deposit and damage inspection'). Falls back to project_description / project_name when omitted.",
439
+ "type": "string",
440
+ "maxLength": 2000
441
+ },
442
+ "mode_source": {
443
+ "description": "Source builtin mode name for derive_user_mode (e.g. 'freelance'). Call list_modes to see available modes.",
444
+ "type": "string"
445
+ },
446
+ "mode_name": {
447
+ "description": "Mode name for derive_user_mode (new mode name), evolve_user_mode / unregister_user_mode (existing custom mode), register_user_mode (new mode name). Must NOT conflict with builtin mode names.",
448
+ "type": "string",
449
+ "maxLength": 100
450
+ },
451
+ "mode_display_name": {
452
+ "description": "Display name for derive_user_mode / register_user_mode. Defaults to mode_name.",
453
+ "type": "string",
454
+ "maxLength": 200
455
+ },
456
+ "mode_changes": {
457
+ "description": "Mode field overrides for derive_user_mode / evolve_user_mode / register_user_mode. For register_user_mode, REQUIRED fields: machine_shape (non-empty array of {name, role}) and key_risk (string). Common overrides: machine_shape (array of {name:string, role:string}), config_overrides (per-object config), allocator, guards, build_notes, risk_appetite. R-M1-11 ENFORCED: machine_shape node names must NOT contain dispute/refund/arb terms — disputes flow through Service.arbitrations independently of the Machine.",
458
+ "type": "object",
459
+ "propertyNames": {
460
+ "type": "string"
461
+ },
462
+ "additionalProperties": {}
463
+ },
464
+ "mode_change_description": {
465
+ "description": "Change description for evolve_user_mode (recorded in evolution history).",
466
+ "type": "string",
467
+ "maxLength": 500
468
+ },
469
+ "mode_bump_version": {
470
+ "description": "Whether evolve_user_mode bumps the patch version (default true: v1.0 → v1.1).",
471
+ "type": "boolean"
472
+ },
473
+ "metric_id": {
474
+ "description": "Unique metric ID for register_custom_metric (e.g. 'seasonality_risk').",
475
+ "type": "string",
476
+ "maxLength": 100
477
+ },
478
+ "metric_display_name": {
479
+ "description": "Display name for register_custom_metric.",
480
+ "type": "string",
481
+ "maxLength": 200
482
+ },
483
+ "metric_description": {
484
+ "description": "Description for register_custom_metric.",
485
+ "type": "string",
486
+ "maxLength": 1000
487
+ },
488
+ "metric_type": {
489
+ "description": "Metric type for register_custom_metric: 'risk' (negative) or 'benefit' (positive).",
490
+ "type": "string",
491
+ "enum": [
492
+ "risk",
493
+ "benefit"
494
+ ]
495
+ },
496
+ "metric_scale": {
497
+ "description": "Metric scale for register_custom_metric: 'level' (high/medium/low), 'numeric', or 'percentage'.",
498
+ "type": "string",
499
+ "enum": [
500
+ "level",
501
+ "numeric",
502
+ "percentage"
503
+ ]
504
+ },
505
+ "metric_weight": {
506
+ "description": "Metric weight for register_custom_metric (default 1.0).",
507
+ "type": "number",
508
+ "minimum": 0,
509
+ "maximum": 10
510
+ },
511
+ "constraint_id": {
512
+ "description": "Unique constraint ID for register_custom_constraint.",
513
+ "type": "string",
514
+ "maxLength": 100
515
+ },
516
+ "constraint_display_name": {
517
+ "description": "Display name for register_custom_constraint.",
518
+ "type": "string",
519
+ "maxLength": 200
520
+ },
521
+ "constraint_description": {
522
+ "description": "Description for register_custom_constraint.",
523
+ "type": "string",
524
+ "maxLength": 1000
525
+ },
526
+ "constraint_rule": {
527
+ "description": "Constraint rule for register_custom_constraint. 4 types: capability_required/capability_forbidden (capability_id), numeric_limit (field + max/min), condition_required (natural-language condition, AI-evaluated).",
528
+ "oneOf": [
529
+ {
530
+ "type": "object",
531
+ "properties": {
532
+ "type": {
533
+ "type": "string",
534
+ "const": "capability_required"
535
+ },
536
+ "capability_id": {
537
+ "type": "string"
538
+ }
285
539
  },
286
- "description": "New tags for update_object."
287
- },
288
- "version_description": {
289
- "type": "string",
290
- "maxLength": 500,
291
- "description": "Description for create_version."
292
- },
293
- "fork_from_version": {
294
- "type": "string",
295
- "description": "Source version for create_version (fork objects + graph from this version)."
296
- },
297
- "max_depth": {
298
- "type": "integer",
299
- "minimum": 1,
300
- "maximum": 5,
301
- "description": "Max recursion depth for Pathway 1 (internal reference derivation) in build_graph. Default 3."
302
- },
303
- "depth": {
304
- "type": "integer",
305
- "minimum": 1,
306
- "maximum": 5,
307
- "description": "Alias for max_depth (build_graph). When both are set, max_depth takes precedence. Default 3."
308
- },
309
- "enable_registrar": {
310
- "type": "boolean",
311
- "description": "Enable Pathway 2 (Registrar inbound query) in build_graph. Default true."
312
- },
313
- "enable_potential": {
314
- "type": "boolean",
315
- "description": "Enable Pathway 3 (potential relationship detection) in build_graph. Default false."
316
- },
317
- "async_mode": {
318
- "type": "boolean",
319
- "description": "When true, build_graph / evaluate_project runs in the background and returns { task_id } immediately. Poll query_task_status(task_id) to check progress and retrieve the result. Default false (synchronous). Use async_mode=true for large projects with enable_potential=true where build may take >10s."
320
- },
321
- "evaluation_type": {
322
- "type": "string",
323
- "enum": [
324
- "risk",
325
- "trust",
326
- "completeness",
327
- "value",
328
- "worth_buying"
540
+ "required": [
541
+ "type",
542
+ "capability_id"
329
543
  ],
330
- "description": "Evaluation type for evaluate_project. risk/trust/completeness are rule-based (computed locally). worth_buying/value require LLM assistance (returns a prompt for the caller to process)."
331
- },
332
- "refresh_before_eval": {
333
- "type": "boolean",
334
- "description": "When true (DEFAULT), evaluate_project refreshes object cache from chain before evaluating. Set to false ONLY for read-only checks where staleness is acceptable (e.g., quick comparisons). BUG-P0-2 fix: previously defaulted to false, causing stale Machine node_count and other dynamic-field-derived fields to produce false findings (e.g., 'Machine has no nodes'). Now defaults to true — set refresh_before_eval=false explicitly to skip refresh."
544
+ "additionalProperties": false
335
545
  },
336
- "eval_score": {
337
- "type": "number",
338
- "minimum": 0,
339
- "maximum": 100,
340
- "description": "Overall evaluation score (0-100) for save_evaluation."
341
- },
342
- "eval_summary": {
343
- "type": "string",
344
- "maxLength": 1000,
345
- "description": "Evaluation summary for save_evaluation."
346
- },
347
- "eval_details": {
546
+ {
348
547
  "type": "object",
349
- "additionalProperties": {},
350
- "description": "Structured evaluation details for save_evaluation (criterion_scores, findings, etc.)."
351
- },
352
- "compare_project_ids": {
353
- "type": "array",
354
- "items": {
355
- "type": "string"
548
+ "properties": {
549
+ "type": {
550
+ "type": "string",
551
+ "const": "capability_forbidden"
552
+ },
553
+ "capability_id": {
554
+ "type": "string"
555
+ }
356
556
  },
357
- "minItems": 2,
358
- "description": "Array of project IDs to compare (for compare_projects). Minimum 2."
359
- },
360
- "diff_address": {
361
- "type": "string",
362
- "description": "Object address for get_object_diff."
363
- },
364
- "diff_from_time": {
365
- "type": "integer",
366
- "description": "Start timestamp (ms) for get_object_diff."
367
- },
368
- "diff_to_time": {
369
- "type": "integer",
370
- "description": "End timestamp (ms) for get_object_diff."
371
- },
372
- "network": {
373
- "type": "string",
374
- "enum": [
375
- "testnet",
376
- "mainnet"
377
- ],
378
- "description": "Target network for generate_deployment_doc. Required when action='generate_deployment_doc'."
379
- },
380
- "save": {
381
- "type": "boolean",
382
- "description": "When true (default), persist the generated MD to SQLite project_documents table for generate_deployment_doc."
383
- },
384
- "detail_level": {
385
- "type": "string",
386
- "enum": [
387
- "summary",
388
- "detailed",
389
- "full"
390
- ],
391
- "description": "P2-03: Deployment document detail level (only for generate_deployment_doc). 'summary' (default): object name + type + key bindings (machine, permission, buy_guard, order_allocators). 'detailed': adds sale list, arbitration list, reward list. 'full': complete fields including stock, price, wip_hash, all config. Use 'summary' for quick review; request 'detailed' or 'full' only when deeper inspection is needed."
392
- },
393
- "object_kind": {
394
- "type": "string",
395
- "enum": [
396
- "machine",
397
- "guard"
398
- ],
399
- "description": "Object kind for plan_object_edit. 'machine' = Machine workflow directed graph (cycles allowed), 'guard' = Guard computation tree. Required when action='plan_object_edit'. Inferred from action for patch_machine_nodes (always 'machine') and patch_guard_tree (always 'guard')."
400
- },
401
- "edit_format": {
402
- "type": "string",
403
- "enum": [
404
- "tree_outline",
405
- "json"
557
+ "required": [
558
+ "type",
559
+ "capability_id"
406
560
  ],
407
- "description": "Format of the edited content for plan_object_edit. 'tree_outline' (default): the indented Markdown outline produced by get_machine_graph / get_guard_graph (human-editable). 'json': raw JSON (machine-readable, for programmatic edits). Both formats are bidirectional with the parse functions in knowledge/machine-render.ts / guard-render.ts."
408
- },
409
- "edited_content": {
410
- "type": "string",
411
- "description": "Edited content for plan_object_edit. Must be in the format specified by edit_format. For 'tree_outline': the full tree_outline string from get_machine_graph/get_guard_graph with user edits. For 'json': a JSON string matching the Machine/Guard schema. The content is parsed + validated + diffed against the current on-chain state."
412
- },
413
- "plan_id": {
414
- "type": "string",
415
- "description": "Plan ID returned by plan_object_edit. Required for apply_object_edit. The plan is short-lived (10-minute TTL) and stored in-memory."
416
- },
417
- "expected_hash": {
418
- "type": "string",
419
- "description": "Expected hash returned by plan_object_edit. Required for apply_object_edit. Used for optimistic concurrency control: if the on-chain state changed between plan and apply, the hash will mismatch and apply will refuse to proceed (stale edit protection)."
420
- },
421
- "patch_operations": {
422
- "type": "array",
423
- "items": {
424
- "type": "string"
425
- },
426
- "description": "Patch operations for patch_machine_nodes / patch_guard_tree. Each string is a single patch operation.\nMachine operations (13 total):\n 'add node <name>' | 'remove node <name>' | 'set description <node_name> <text...>'\n 'add edge <from> <to>' | 'remove edge <from> <to>' | 'set threshold <edge_from> <edge_to> <value>'\n 'add forward <edge_from> <edge_to> <forward_name>' | 'remove forward <edge_from> <edge_to> <forward_name>'\n 'set guard <edge_from> <edge_to> <forward_name> <guard_addr_or_name|none>'\n 'set permission <edge_from> <edge_to> <forward_name> <perm_index>'\n 'set operator <edge_from> <edge_to> <forward_name> <named_operator|none>'\n 'set weight <edge_from> <edge_to> <forward_name> <weight>'\n 'set retained_submission <edge_from> <edge_to> <forward_name> <comma_separated_indices|none>'\nGuard operations (8 total — see patch_guard_tree):\n 'add table <identifier> <name|none> <value_type> <b_submission> [json_value]'\n 'remove table <identifier>' | 'set table_value <identifier> [json_value|none]'\n 'set table_name <identifier> <name|none>' | 'set table_submission <identifier> <true|false>'\n 'set root <json_node>' | 'set rely <comma_separated_guard_addresses|none>'\nOperations are applied in order. Both patches are validated (validateMachine/validateGuard) before execution."
427
- },
428
- "intent": {
429
- "type": "string",
430
- "maxLength": 2000,
431
- "description": "Business intent text for recommend_industry (e.g. 'I rent cameras to photographers with deposit and damage inspection'). Falls back to project_description / project_name when omitted."
432
- },
433
- "mode_source": {
434
- "type": "string",
435
- "description": "Source builtin mode name for derive_user_mode (e.g. 'freelance'). Call list_modes to see available modes."
436
- },
437
- "mode_name": {
438
- "type": "string",
439
- "maxLength": 100,
440
- "description": "Mode name for derive_user_mode (new mode name), evolve_user_mode / unregister_user_mode (existing custom mode), register_user_mode (new mode name). Must NOT conflict with builtin mode names."
441
- },
442
- "mode_display_name": {
443
- "type": "string",
444
- "maxLength": 200,
445
- "description": "Display name for derive_user_mode / register_user_mode. Defaults to mode_name."
561
+ "additionalProperties": false
446
562
  },
447
- "mode_changes": {
563
+ {
448
564
  "type": "object",
449
- "additionalProperties": {},
450
- "description": "Mode field overrides for derive_user_mode / evolve_user_mode / register_user_mode. For register_user_mode, REQUIRED fields: machine_shape (non-empty array of {name, role}) and key_risk (string). Common overrides: machine_shape (array of {name:string, role:string}), config_overrides (per-object config), allocator, guards, build_notes, risk_appetite. R-M1-11 ENFORCED: machine_shape node names must NOT contain dispute/refund/arb terms — disputes flow through Service.arbitrations independently of the Machine."
451
- },
452
- "mode_change_description": {
453
- "type": "string",
454
- "maxLength": 500,
455
- "description": "Change description for evolve_user_mode (recorded in evolution history)."
456
- },
457
- "mode_bump_version": {
458
- "type": "boolean",
459
- "description": "Whether evolve_user_mode bumps the patch version (default true: v1.0 → v1.1)."
460
- },
461
- "metric_id": {
462
- "type": "string",
463
- "maxLength": 100,
464
- "description": "Unique metric ID for register_custom_metric (e.g. 'seasonality_risk')."
465
- },
466
- "metric_display_name": {
467
- "type": "string",
468
- "maxLength": 200,
469
- "description": "Display name for register_custom_metric."
470
- },
471
- "metric_description": {
472
- "type": "string",
473
- "maxLength": 1000,
474
- "description": "Description for register_custom_metric."
475
- },
476
- "metric_type": {
477
- "type": "string",
478
- "enum": [
479
- "risk",
480
- "benefit"
481
- ],
482
- "description": "Metric type for register_custom_metric: 'risk' (negative) or 'benefit' (positive)."
483
- },
484
- "metric_scale": {
485
- "type": "string",
486
- "enum": [
487
- "level",
488
- "numeric",
489
- "percentage"
490
- ],
491
- "description": "Metric scale for register_custom_metric: 'level' (high/medium/low), 'numeric', or 'percentage'."
492
- },
493
- "metric_weight": {
494
- "type": "number",
495
- "minimum": 0,
496
- "maximum": 10,
497
- "description": "Metric weight for register_custom_metric (default 1.0)."
498
- },
499
- "constraint_id": {
500
- "type": "string",
501
- "maxLength": 100,
502
- "description": "Unique constraint ID for register_custom_constraint."
503
- },
504
- "constraint_display_name": {
505
- "type": "string",
506
- "maxLength": 200,
507
- "description": "Display name for register_custom_constraint."
508
- },
509
- "constraint_description": {
510
- "type": "string",
511
- "maxLength": 1000,
512
- "description": "Description for register_custom_constraint."
513
- },
514
- "constraint_rule": {
515
- "anyOf": [
516
- {
517
- "type": "object",
518
- "properties": {
519
- "type": {
520
- "type": "string",
521
- "const": "capability_required"
522
- },
523
- "capability_id": {
524
- "type": "string"
525
- }
526
- },
527
- "required": [
528
- "type",
529
- "capability_id"
530
- ],
531
- "additionalProperties": false
565
+ "properties": {
566
+ "type": {
567
+ "type": "string",
568
+ "const": "numeric_limit"
532
569
  },
533
- {
534
- "type": "object",
535
- "properties": {
536
- "type": {
537
- "type": "string",
538
- "const": "capability_forbidden"
539
- },
540
- "capability_id": {
541
- "type": "string"
542
- }
543
- },
544
- "required": [
545
- "type",
546
- "capability_id"
547
- ],
548
- "additionalProperties": false
570
+ "field": {
571
+ "type": "string"
549
572
  },
550
- {
551
- "type": "object",
552
- "properties": {
553
- "type": {
554
- "type": "string",
555
- "const": "numeric_limit"
556
- },
557
- "field": {
558
- "type": "string"
559
- },
560
- "max": {
561
- "type": "number"
562
- },
563
- "min": {
564
- "type": "number"
565
- }
566
- },
567
- "required": [
568
- "type",
569
- "field"
570
- ],
571
- "additionalProperties": false
573
+ "max": {
574
+ "type": "number"
572
575
  },
573
- {
574
- "type": "object",
575
- "properties": {
576
- "type": {
577
- "type": "string",
578
- "const": "condition_required"
579
- },
580
- "condition": {
581
- "type": "string"
582
- },
583
- "ai_evaluated": {
584
- "type": "boolean",
585
- "const": true
586
- }
587
- },
588
- "required": [
589
- "type",
590
- "condition",
591
- "ai_evaluated"
592
- ],
593
- "additionalProperties": false
576
+ "min": {
577
+ "type": "number"
594
578
  }
579
+ },
580
+ "required": [
581
+ "type",
582
+ "field"
595
583
  ],
596
- "description": "Constraint rule for register_custom_constraint. 4 types: capability_required/capability_forbidden (capability_id), numeric_limit (field + max/min), condition_required (natural-language condition, AI-evaluated)."
597
- },
598
- "constraint_severity": {
599
- "type": "string",
600
- "enum": [
601
- "hard",
602
- "soft"
603
- ],
604
- "description": "Constraint severity for register_custom_constraint: 'hard' blocks applyTemplate on violation; 'soft' only warns (default 'soft')."
605
- },
606
- "constraint_on_violation": {
607
- "type": "string",
608
- "enum": [
609
- "block",
610
- "warn",
611
- "log"
612
- ],
613
- "description": "Violation action for register_custom_constraint (default 'warn')."
614
- },
615
- "metric_type_filter": {
616
- "type": "string",
617
- "enum": [
618
- "risk",
619
- "benefit"
620
- ],
621
- "description": "Filter list_metrics_constraints by metric type."
584
+ "additionalProperties": false
622
585
  },
623
- "scope_filter": {
624
- "type": "string",
625
- "enum": [
626
- "builtin",
627
- "custom"
586
+ {
587
+ "type": "object",
588
+ "properties": {
589
+ "type": {
590
+ "type": "string",
591
+ "const": "condition_required"
592
+ },
593
+ "condition": {
594
+ "type": "string"
595
+ },
596
+ "ai_evaluated": {
597
+ "type": "boolean",
598
+ "const": true
599
+ }
600
+ },
601
+ "required": [
602
+ "type",
603
+ "condition",
604
+ "ai_evaluated"
628
605
  ],
629
- "description": "Filter list_metrics_constraints by scope (builtin or custom)."
630
- },
631
- "target_objects": {
632
- "type": "array",
633
- "items": {
606
+ "additionalProperties": false
607
+ }
608
+ ]
609
+ },
610
+ "constraint_severity": {
611
+ "description": "Constraint severity for register_custom_constraint: 'hard' blocks applyTemplate on violation; 'soft' only warns (default 'soft').",
612
+ "type": "string",
613
+ "enum": [
614
+ "hard",
615
+ "soft"
616
+ ]
617
+ },
618
+ "constraint_on_violation": {
619
+ "description": "Violation action for register_custom_constraint (default 'warn').",
620
+ "type": "string",
621
+ "enum": [
622
+ "block",
623
+ "warn",
624
+ "log"
625
+ ]
626
+ },
627
+ "metric_type_filter": {
628
+ "description": "Filter list_metrics_constraints by metric type.",
629
+ "type": "string",
630
+ "enum": [
631
+ "risk",
632
+ "benefit"
633
+ ]
634
+ },
635
+ "scope_filter": {
636
+ "description": "Filter list_metrics_constraints by scope (builtin or custom).",
637
+ "type": "string",
638
+ "enum": [
639
+ "builtin",
640
+ "custom"
641
+ ]
642
+ },
643
+ "target_objects": {
644
+ "description": "Optional explicit target objects for analyze_intent (entry_ids or object_type names). When provided, puzzle snapshots are restricted to these objects.",
645
+ "type": "array",
646
+ "items": {
647
+ "type": "string"
648
+ }
649
+ },
650
+ "puzzles": {
651
+ "description": "Per-object puzzle snapshots for aggregate_risks, keyed by object_type. Pass the 'puzzles' field from a prior analyze_intent result UNCHANGED. When omitted but 'intent' is present, the handler runs analyze_intent first (C1→C2 in one call).",
652
+ "type": "object",
653
+ "propertyNames": {
654
+ "type": "string"
655
+ },
656
+ "additionalProperties": {
657
+ "type": "object",
658
+ "properties": {
659
+ "puzzle": {
660
+ "description": "Puzzle snapshot (opaque — pass through from analyze_intent output unchanged)."
661
+ },
662
+ "completeness": {
663
+ "description": "Completeness snapshot (opaque — pass through unchanged)."
664
+ },
665
+ "missing_dimensions": {
666
+ "type": "array",
667
+ "items": {
668
+ "type": "string"
669
+ },
670
+ "description": "Dimensions still missing for this object."
671
+ }
672
+ },
673
+ "required": [
674
+ "puzzle",
675
+ "completeness",
676
+ "missing_dimensions"
677
+ ],
678
+ "additionalProperties": false
679
+ }
680
+ },
681
+ "severity_threshold": {
682
+ "description": "Severity threshold for aggregate_risks (default 'HIGH'). Risks at or above this level block deployment (status RISK_BLOCKED).",
683
+ "type": "string",
684
+ "enum": [
685
+ "CRITICAL",
686
+ "HIGH",
687
+ "MEDIUM",
688
+ "LOW",
689
+ "INFO"
690
+ ]
691
+ },
692
+ "user_confirmed_high_risks": {
693
+ "description": "IDs of HIGH risks the user has already confirmed in a prior round (aggregate_risks). Confirmed HIGH risks no longer trigger RISK_PENDING_CONFIRM.",
694
+ "type": "array",
695
+ "items": {
696
+ "type": "string"
697
+ }
698
+ },
699
+ "planned_objects": {
700
+ "description": "Planned objects for aggregate_risks OBJECT_REUSE check (safety-rules). Flags NEW objects whose type carries an always/strongly-recommended reuse rule.",
701
+ "type": "array",
702
+ "items": {
703
+ "type": "object",
704
+ "properties": {
705
+ "object_type": {
706
+ "type": "string",
707
+ "description": "Wowok object type (e.g. 'service', 'guard', 'machine')."
708
+ },
709
+ "is_new": {
710
+ "type": "boolean",
711
+ "description": "true when creating a NEW object; false when reusing an existing one."
712
+ },
713
+ "name": {
714
+ "description": "Planned object name (for readable messages).",
634
715
  "type": "string"
716
+ }
717
+ },
718
+ "required": [
719
+ "object_type",
720
+ "is_new"
721
+ ],
722
+ "additionalProperties": false
723
+ }
724
+ },
725
+ "planned_operations": {
726
+ "description": "Planned create/publish operations for aggregate_risks IMMUTABILITY check (safety-rules). Warns which fields become permanently locked after each operation.",
727
+ "type": "array",
728
+ "items": {
729
+ "type": "object",
730
+ "properties": {
731
+ "object_type": {
732
+ "type": "string",
733
+ "description": "Wowok object type (e.g. 'service', 'arbitration')."
635
734
  },
636
- "description": "Optional explicit target objects for analyze_intent (entry_ids or object_type names). When provided, puzzle snapshots are restricted to these objects."
637
- },
638
- "puzzles": {
639
- "type": "object",
640
- "additionalProperties": {
735
+ "trigger": {
736
+ "type": "string",
737
+ "enum": [
738
+ "create",
739
+ "publish"
740
+ ],
741
+ "description": "Lifecycle trigger that locks fields."
742
+ },
743
+ "name": {
744
+ "description": "Object name (for readable messages).",
745
+ "type": "string"
746
+ }
747
+ },
748
+ "required": [
749
+ "object_type",
750
+ "trigger"
751
+ ],
752
+ "additionalProperties": false
753
+ }
754
+ },
755
+ "substeps": {
756
+ "description": "Substep execution records for trace_substeps (63-spec §2.1). Required when action='trace_substeps'. Construct from your deployment execution trace.",
757
+ "type": "array",
758
+ "items": {
759
+ "type": "object",
760
+ "properties": {
761
+ "step_id": {
762
+ "type": "string",
763
+ "description": "Substep id, format 'T<step>.<substep>' e.g. 'T1.1'."
764
+ },
765
+ "parent_step": {
766
+ "type": "string",
767
+ "description": "Parent step id, format 'T<step>' e.g. 'T1'."
768
+ },
769
+ "object_type": {
770
+ "type": "string",
771
+ "enum": [
772
+ "service",
773
+ "machine",
774
+ "guard",
775
+ "permission",
776
+ "reward",
777
+ "arb",
778
+ "progress",
779
+ "treasury",
780
+ "demand",
781
+ "repository",
782
+ "contact",
783
+ "order",
784
+ "allocation",
785
+ "personal",
786
+ "payment",
787
+ "proof"
788
+ ],
789
+ "description": "Wowok object type this substep operates on."
790
+ },
791
+ "entry_id": {
792
+ "type": "string",
793
+ "description": "Puzzle entry_id this substep corresponds to."
794
+ },
795
+ "operation_type": {
796
+ "type": "string",
797
+ "description": "operation_type for onchain_operations."
798
+ },
799
+ "network": {
800
+ "type": "string",
801
+ "enum": [
802
+ "testnet",
803
+ "mainnet"
804
+ ],
805
+ "description": "Target network."
806
+ },
807
+ "input": {
641
808
  "type": "object",
642
809
  "properties": {
643
- "puzzle": {
644
- "description": "Puzzle snapshot (opaque — pass through from analyze_intent output unchanged)."
645
- },
646
- "completeness": {
647
- "description": "Completeness snapshot (opaque — pass through unchanged)."
810
+ "data": {
811
+ "type": "object",
812
+ "propertyNames": {
813
+ "type": "string"
814
+ },
815
+ "additionalProperties": {},
816
+ "description": "Input data payload."
648
817
  },
649
- "missing_dimensions": {
818
+ "input_refs": {
650
819
  "type": "array",
651
820
  "items": {
652
821
  "type": "string"
653
822
  },
654
- "description": "Dimensions still missing for this object."
823
+ "description": "Upstream substep_ids this substep consumes."
655
824
  }
656
825
  },
657
826
  "required": [
658
- "missing_dimensions"
827
+ "data",
828
+ "input_refs"
659
829
  ],
660
830
  "additionalProperties": false
661
831
  },
662
- "description": "Per-object puzzle snapshots for aggregate_risks, keyed by object_type. Pass the 'puzzles' field from a prior analyze_intent result UNCHANGED. When omitted but 'intent' is present, the handler runs analyze_intent first (C1→C2 in one call)."
663
- },
664
- "severity_threshold": {
665
- "type": "string",
666
- "enum": [
667
- "CRITICAL",
668
- "HIGH",
669
- "MEDIUM",
670
- "LOW",
671
- "INFO"
672
- ],
673
- "description": "Severity threshold for aggregate_risks (default 'HIGH'). Risks at or above this level block deployment (status RISK_BLOCKED)."
674
- },
675
- "user_confirmed_high_risks": {
676
- "type": "array",
677
- "items": {
678
- "type": "string"
679
- },
680
- "description": "IDs of HIGH risks the user has already confirmed in a prior round (aggregate_risks). Confirmed HIGH risks no longer trigger RISK_PENDING_CONFIRM."
681
- },
682
- "planned_objects": {
683
- "type": "array",
684
- "items": {
832
+ "output": {
833
+ "description": "Output data (filled after execution).",
685
834
  "type": "object",
686
835
  "properties": {
687
- "object_type": {
688
- "type": "string",
689
- "description": "Wowok object type (e.g. 'service', 'guard', 'machine')."
690
- },
691
- "is_new": {
692
- "type": "boolean",
693
- "description": "true when creating a NEW object; false when reusing an existing one."
836
+ "object_id": {
837
+ "type": "string"
694
838
  },
695
- "name": {
696
- "type": "string",
697
- "description": "Planned object name (for readable messages)."
839
+ "tx_digest": {
840
+ "type": "string"
698
841
  }
699
842
  },
700
- "required": [
701
- "object_type",
702
- "is_new"
703
- ],
704
- "additionalProperties": false
843
+ "additionalProperties": {}
705
844
  },
706
- "description": "Planned objects for aggregate_risks OBJECT_REUSE check (safety-rules). Flags NEW objects whose type carries an always/strongly-recommended reuse rule."
707
- },
708
- "planned_operations": {
709
- "type": "array",
710
- "items": {
711
- "type": "object",
712
- "properties": {
713
- "object_type": {
714
- "type": "string",
715
- "description": "Wowok object type (e.g. 'service', 'arbitration')."
716
- },
717
- "trigger": {
718
- "type": "string",
719
- "enum": [
720
- "create",
721
- "publish"
722
- ],
723
- "description": "Lifecycle trigger that locks fields."
724
- },
725
- "name": {
726
- "type": "string",
727
- "description": "Object name (for readable messages)."
728
- }
729
- },
730
- "required": [
731
- "object_type",
732
- "trigger"
845
+ "timestamp": {
846
+ "type": "number",
847
+ "description": "Execution timestamp (ms)."
848
+ },
849
+ "status": {
850
+ "type": "string",
851
+ "enum": [
852
+ "PENDING",
853
+ "SUCCESS",
854
+ "FAILED",
855
+ "SKIPPED"
733
856
  ],
734
- "additionalProperties": false
857
+ "description": "Execution status."
735
858
  },
736
- "description": "Planned create/publish operations for aggregate_risks IMMUTABILITY check (safety-rules). Warns which fields become permanently locked after each operation."
737
- },
738
- "substeps": {
739
- "type": "array",
740
- "items": {
859
+ "failure_reason": {
860
+ "description": "Failure reason (when status='FAILED').",
861
+ "type": "string"
862
+ },
863
+ "dependencies": {
741
864
  "type": "object",
742
865
  "properties": {
743
- "step_id": {
744
- "type": "string",
745
- "description": "Substep id, format 'T<step>.<substep>' e.g. 'T1.1'."
746
- },
747
- "parent_step": {
748
- "type": "string",
749
- "description": "Parent step id, format 'T<step>' e.g. 'T1'."
750
- },
751
- "object_type": {
752
- "type": "string",
753
- "enum": [
754
- "service",
755
- "machine",
756
- "guard",
757
- "permission",
758
- "reward",
759
- "arb",
760
- "progress",
761
- "treasury",
762
- "demand",
763
- "repository",
764
- "contact",
765
- "order",
766
- "allocation",
767
- "personal",
768
- "payment",
769
- "proof"
770
- ],
771
- "description": "Wowok object type this substep operates on."
772
- },
773
- "entry_id": {
774
- "type": "string",
775
- "description": "Puzzle entry_id this substep corresponds to."
776
- },
777
- "operation_type": {
778
- "type": "string",
779
- "description": "operation_type for onchain_operations."
780
- },
781
- "network": {
782
- "type": "string",
783
- "enum": [
784
- "testnet",
785
- "mainnet"
786
- ],
787
- "description": "Target network."
866
+ "input_refs": {
867
+ "type": "array",
868
+ "items": {
869
+ "type": "string"
870
+ }
788
871
  },
789
- "input": {
790
- "type": "object",
791
- "properties": {
792
- "data": {
793
- "type": "object",
794
- "additionalProperties": {},
795
- "description": "Input data payload."
796
- },
797
- "input_refs": {
798
- "type": "array",
799
- "items": {
800
- "type": "string"
872
+ "output_refs": {
873
+ "type": "array",
874
+ "items": {
875
+ "type": "object",
876
+ "properties": {
877
+ "substep_id": {
878
+ "type": "string",
879
+ "description": "Downstream substep that consumes this output."
801
880
  },
802
- "description": "Upstream substep_ids this substep consumes."
803
- }
804
- },
805
- "required": [
806
- "data",
807
- "input_refs"
808
- ],
809
- "additionalProperties": false
810
- },
811
- "output": {
812
- "type": "object",
813
- "properties": {
814
- "object_id": {
815
- "type": "string"
816
- },
817
- "tx_digest": {
818
- "type": "string"
819
- }
820
- },
821
- "additionalProperties": {},
822
- "description": "Output data (filled after execution)."
823
- },
824
- "timestamp": {
825
- "type": "number",
826
- "description": "Execution timestamp (ms)."
827
- },
828
- "status": {
829
- "type": "string",
830
- "enum": [
831
- "PENDING",
832
- "SUCCESS",
833
- "FAILED",
834
- "SKIPPED"
835
- ],
836
- "description": "Execution status."
837
- },
838
- "failure_reason": {
839
- "type": "string",
840
- "description": "Failure reason (when status='FAILED')."
841
- },
842
- "dependencies": {
843
- "type": "object",
844
- "properties": {
845
- "input_refs": {
846
- "type": "array",
847
- "items": {
848
- "type": "string"
881
+ "field_path": {
882
+ "type": "string",
883
+ "description": "Field path produced by this substep (e.g. 'permission_address')."
849
884
  }
850
885
  },
851
- "output_refs": {
852
- "type": "array",
853
- "items": {
854
- "type": "object",
855
- "properties": {
856
- "substep_id": {
857
- "type": "string",
858
- "description": "Downstream substep that consumes this output."
859
- },
860
- "field_path": {
861
- "type": "string",
862
- "description": "Field path produced by this substep (e.g. 'permission_address')."
863
- }
864
- },
865
- "required": [
866
- "substep_id",
867
- "field_path"
868
- ],
869
- "additionalProperties": false
870
- }
871
- }
872
- },
873
- "required": [
874
- "input_refs",
875
- "output_refs"
876
- ],
877
- "additionalProperties": false,
878
- "description": "Dependencies (input_refs + output_refs)."
879
- },
880
- "retry_info": {
881
- "type": "object",
882
- "properties": {
883
- "original_step_id": {
884
- "type": "string"
885
- },
886
- "retry_count": {
887
- "type": "number"
888
- },
889
- "retry_reason": {
890
- "type": "string"
891
- }
892
- },
893
- "required": [
894
- "original_step_id",
895
- "retry_count",
896
- "retry_reason"
897
- ],
898
- "additionalProperties": false,
899
- "description": "Retry info (when this substep is a retry of an earlier one)."
886
+ "required": [
887
+ "substep_id",
888
+ "field_path"
889
+ ],
890
+ "additionalProperties": false
891
+ }
900
892
  }
901
893
  },
902
894
  "required": [
903
- "step_id",
904
- "parent_step",
905
- "object_type",
906
- "entry_id",
907
- "operation_type",
908
- "network",
909
- "input",
910
- "timestamp",
911
- "status",
912
- "dependencies"
895
+ "input_refs",
896
+ "output_refs"
913
897
  ],
914
- "additionalProperties": false
898
+ "additionalProperties": false,
899
+ "description": "Dependencies (input_refs + output_refs)."
915
900
  },
916
- "description": "Substep execution records for trace_substeps (63-spec §2.1). Required when action='trace_substeps'. Construct from your deployment execution trace."
917
- },
918
- "substep_edges": {
919
- "type": "array",
920
- "items": {
901
+ "retry_info": {
902
+ "description": "Retry info (when this substep is a retry of an earlier one).",
921
903
  "type": "object",
922
904
  "properties": {
923
- "source": {
924
- "type": "string",
925
- "description": "Source substep id."
905
+ "original_step_id": {
906
+ "type": "string"
926
907
  },
927
- "target": {
928
- "type": "string",
929
- "description": "Target substep id (depends on source)."
908
+ "retry_count": {
909
+ "type": "number"
930
910
  },
931
- "field_path": {
932
- "type": "string",
933
- "description": "Field path flowing along this edge."
911
+ "retry_reason": {
912
+ "type": "string"
934
913
  }
935
914
  },
936
915
  "required": [
937
- "source",
938
- "target",
939
- "field_path"
916
+ "original_step_id",
917
+ "retry_count",
918
+ "retry_reason"
940
919
  ],
941
920
  "additionalProperties": false
921
+ }
922
+ },
923
+ "required": [
924
+ "step_id",
925
+ "parent_step",
926
+ "object_type",
927
+ "entry_id",
928
+ "operation_type",
929
+ "network",
930
+ "input",
931
+ "timestamp",
932
+ "status",
933
+ "dependencies"
934
+ ],
935
+ "additionalProperties": false
936
+ }
937
+ },
938
+ "substep_edges": {
939
+ "description": "Explicit DAG edges for trace_substeps. When omitted, edges are derived from each substep's input_refs.",
940
+ "type": "array",
941
+ "items": {
942
+ "type": "object",
943
+ "properties": {
944
+ "source": {
945
+ "type": "string",
946
+ "description": "Source substep id."
942
947
  },
943
- "description": "Explicit DAG edges for trace_substeps. When omitted, edges are derived from each substep's input_refs."
948
+ "target": {
949
+ "type": "string",
950
+ "description": "Target substep id (depends on source)."
951
+ },
952
+ "field_path": {
953
+ "type": "string",
954
+ "description": "Field path flowing along this edge."
955
+ }
956
+ },
957
+ "required": [
958
+ "source",
959
+ "target",
960
+ "field_path"
961
+ ],
962
+ "additionalProperties": false
963
+ }
964
+ },
965
+ "guide_state": {
966
+ "description": "Wizard state from a prior merchant_guide result. Pass back UNCHANGED on every subsequent call (same pattern as C1→C2 puzzles). The handler re-runs the pipeline deterministically and advances to the furthest reachable step.",
967
+ "type": "object",
968
+ "properties": {
969
+ "intent_text": {
970
+ "type": "string",
971
+ "description": "Step 1: raw merchant business description."
972
+ },
973
+ "confirmed_industry": {
974
+ "description": "Step 2: merchant-confirmed industry id.",
975
+ "type": "string"
944
976
  },
945
- "guide_state": {
977
+ "currency": {
978
+ "description": "Step 5: payment currency (default WOW).",
979
+ "type": "string"
980
+ },
981
+ "deliverables": {
982
+ "description": "Step 4: merchant-defined deliverables (opaque passthrough).",
983
+ "type": "array",
984
+ "items": {}
985
+ },
986
+ "payment_override": {
987
+ "description": "Step 5: payment structure overrides (opaque passthrough).",
946
988
  "type": "object",
947
- "properties": {
948
- "intent_text": {
949
- "type": "string",
950
- "description": "Step 1: raw merchant business description."
951
- },
952
- "confirmed_industry": {
953
- "type": "string",
954
- "description": "Step 2: merchant-confirmed industry id."
955
- },
956
- "currency": {
957
- "type": "string",
958
- "description": "Step 5: payment currency (default WOW)."
959
- },
960
- "deliverables": {
961
- "type": "array",
962
- "items": {},
963
- "description": "Step 4: merchant-defined deliverables (opaque passthrough)."
964
- },
965
- "payment_override": {
966
- "type": "object",
967
- "additionalProperties": {},
968
- "description": "Step 5: payment structure overrides (opaque passthrough)."
969
- },
970
- "trust_override": {
971
- "type": "object",
972
- "additionalProperties": {},
973
- "description": "Step 6: trust mechanism overrides (opaque passthrough)."
974
- },
975
- "adopted_module_ids": {
976
- "type": "array",
977
- "items": {
978
- "type": "string"
979
- },
980
- "description": "Step 6: merchant-confirmed business module ids."
981
- }
989
+ "propertyNames": {
990
+ "type": "string"
982
991
  },
983
- "required": [
984
- "intent_text"
985
- ],
986
- "additionalProperties": false,
987
- "description": "Wizard state from a prior merchant_guide result. Pass back UNCHANGED on every subsequent call (same pattern as C1→C2 puzzles). The handler re-runs the pipeline deterministically and advances to the furthest reachable step."
992
+ "additionalProperties": {}
988
993
  },
989
- "guide_confirm": {
994
+ "trust_override": {
995
+ "description": "Step 6: trust mechanism overrides (opaque passthrough).",
990
996
  "type": "object",
991
- "properties": {
992
- "industry": {
993
- "type": "string",
994
- "description": "Step 2 confirmation: industry id (e.g. 'freelance')."
995
- },
996
- "currency": {
997
- "type": "string",
998
- "description": "Step 5 confirmation: payment currency."
999
- },
1000
- "deliverables": {
1001
- "type": "array",
1002
- "items": {},
1003
- "description": "Step 4 confirmation: deliverable definitions."
1004
- },
1005
- "payment": {
1006
- "type": "object",
1007
- "additionalProperties": {},
1008
- "description": "Step 5 confirmation: { model, triggers, allocation } overrides."
1009
- },
1010
- "trust": {
1011
- "type": "object",
1012
- "additionalProperties": {},
1013
- "description": "Step 6 confirmation: { refundPolicy, arbitration, escrow } overrides."
1014
- },
1015
- "adopted_module_ids": {
1016
- "type": "array",
1017
- "items": {
1018
- "type": "string"
1019
- },
1020
- "description": "Step 6 confirmation: business module ids to adopt (overrides recommendation)."
1021
- }
997
+ "propertyNames": {
998
+ "type": "string"
1022
999
  },
1023
- "additionalProperties": false,
1024
- "description": "Merchant decisions for the current wizard step. Merged over guide_state. Typical flow: call 1 with intent only → receive step-2 industry options → call 2 with guide_state + guide_confirm={industry} → receive full blueprint plan (steps 7-10)."
1000
+ "additionalProperties": {}
1025
1001
  },
1026
- "radar_account": {
1027
- "type": "string",
1028
- "description": "Account to analyze — address (0x...) or LocalMark name (resolved to an address). Required when action='participation_radar'. The perspective (customer/operator/observer) is DERIVED from on-chain data (Order.builder + PermissionPerm grants) — never asserted by this field."
1029
- },
1030
- "radar_targets": {
1002
+ "adopted_module_ids": {
1003
+ "description": "Step 6: merchant-confirmed business module ids.",
1031
1004
  "type": "array",
1032
1005
  "items": {
1033
- "type": "object",
1034
- "properties": {
1035
- "progress": {
1036
- "type": "string",
1037
- "description": "Progress object address (0x...) or LocalMark name. The Progress carries the current node + bound Machine."
1038
- },
1039
- "order": {
1040
- "type": "string",
1041
- "description": "Order object address or LocalMark name (optional but recommended — enables order-holder detection, service-level compensation/reward claims, and dispute context)."
1042
- }
1043
- },
1044
- "required": [
1045
- "progress"
1046
- ],
1047
- "additionalProperties": false
1048
- },
1049
- "minItems": 1,
1050
- "maxItems": 20,
1051
- "description": "In-flight orders to analyze (1-20). Required when action='participation_radar'. Each target is analyzed independently; results are aggregated into one account dashboard."
1006
+ "type": "string"
1007
+ }
1008
+ }
1009
+ },
1010
+ "required": [
1011
+ "intent_text"
1012
+ ],
1013
+ "additionalProperties": false
1014
+ },
1015
+ "guide_confirm": {
1016
+ "description": "Merchant decisions for the current wizard step. Merged over guide_state. Typical flow: call 1 with intent only → receive step-2 industry options → call 2 with guide_state + guide_confirm={industry} → receive full blueprint plan (steps 7-10).",
1017
+ "type": "object",
1018
+ "properties": {
1019
+ "industry": {
1020
+ "description": "Step 2 confirmation: industry id (e.g. 'freelance').",
1021
+ "type": "string"
1052
1022
  },
1053
- "radar_include_alerts": {
1054
- "type": "boolean",
1055
- "description": "Attach order-monitor alerts (progress stall / compensation fund / review & arbitration windows) to each per-order result. Default true."
1023
+ "currency": {
1024
+ "description": "Step 5 confirmation: payment currency.",
1025
+ "type": "string"
1056
1026
  },
1057
- "radar_monitor_thresholds": {
1027
+ "deliverables": {
1028
+ "description": "Step 4 confirmation: deliverable definitions.",
1029
+ "type": "array",
1030
+ "items": {}
1031
+ },
1032
+ "payment": {
1033
+ "description": "Step 5 confirmation: { model, triggers, allocation } overrides.",
1058
1034
  "type": "object",
1059
- "properties": {
1060
- "progress_stall_hours": {
1061
- "type": "number",
1062
- "exclusiveMinimum": 0,
1063
- "description": "Progress stall alert threshold in HOURS. Default 0 = auto (expected_node_duration × 2)."
1064
- },
1065
- "compensation_drop_ratio": {
1066
- "type": "number",
1067
- "minimum": 0,
1068
- "maximum": 1,
1069
- "description": "Compensation fund drop alert ratio (0-1). Default 0.3 = alert on ≥30% drop."
1070
- },
1071
- "compensation_coverage_min": {
1072
- "type": "number",
1073
- "minimum": 0,
1074
- "maximum": 1,
1075
- "description": "Minimum compensation coverage ratio vs order amount (0-1). Default 1.0 = must fully cover."
1076
- },
1077
- "messenger_timeout_hours": {
1078
- "type": "number",
1079
- "exclusiveMinimum": 0,
1080
- "description": "Messenger no-reply timeout in HOURS. Default 24."
1081
- },
1082
- "review_window_closing_days": {
1083
- "type": "number",
1084
- "exclusiveMinimum": 0,
1085
- "description": "Review window near-closing alert threshold in DAYS. Default 3."
1086
- },
1087
- "arb_window_closing_days": {
1088
- "type": "number",
1089
- "exclusiveMinimum": 0,
1090
- "description": "Arbitration window near-closing alert threshold in DAYS. Default 3."
1091
- }
1035
+ "propertyNames": {
1036
+ "type": "string"
1037
+ },
1038
+ "additionalProperties": {}
1039
+ },
1040
+ "trust": {
1041
+ "description": "Step 6 confirmation: { refundPolicy, arbitration, escrow } overrides.",
1042
+ "type": "object",
1043
+ "propertyNames": {
1044
+ "type": "string"
1092
1045
  },
1093
- "additionalProperties": false,
1094
- "description": "Optional per-call overrides for order-monitor alert thresholds (only used when radar_include_alerts is on). All fields optional; omitted fields keep defaults. Units: hours/days as marked per field."
1046
+ "additionalProperties": {}
1047
+ },
1048
+ "adopted_module_ids": {
1049
+ "description": "Step 6 confirmation: business module ids to adopt (overrides recommendation).",
1050
+ "type": "array",
1051
+ "items": {
1052
+ "type": "string"
1053
+ }
1054
+ }
1055
+ },
1056
+ "additionalProperties": false
1057
+ },
1058
+ "radar_account": {
1059
+ "description": "Account to analyze — address (0x...) or LocalMark name (resolved to an address). Required when action='participation_radar'. The perspective (customer/operator/observer) is DERIVED from on-chain data (Order.builder + PermissionPerm grants) — never asserted by this field.",
1060
+ "type": "string"
1061
+ },
1062
+ "radar_targets": {
1063
+ "description": "In-flight orders to analyze (1-20). Required when action='participation_radar'. Each target is analyzed independently; results are aggregated into one account dashboard.",
1064
+ "minItems": 1,
1065
+ "maxItems": 20,
1066
+ "type": "array",
1067
+ "items": {
1068
+ "type": "object",
1069
+ "properties": {
1070
+ "progress": {
1071
+ "type": "string",
1072
+ "description": "Progress object address (0x...) or LocalMark name. The Progress carries the current node + bound Machine."
1073
+ },
1074
+ "order": {
1075
+ "description": "Order object address or LocalMark name (optional but recommended — enables order-holder detection, service-level compensation/reward claims, and dispute context).",
1076
+ "type": "string"
1077
+ }
1078
+ },
1079
+ "required": [
1080
+ "progress"
1081
+ ],
1082
+ "additionalProperties": false
1083
+ }
1084
+ },
1085
+ "radar_include_alerts": {
1086
+ "description": "Attach order-monitor alerts (progress stall / compensation fund / review & arbitration windows) to each per-order result. Default true.",
1087
+ "type": "boolean"
1088
+ },
1089
+ "radar_monitor_thresholds": {
1090
+ "description": "Optional per-call overrides for order-monitor alert thresholds (only used when radar_include_alerts is on). All fields optional; omitted fields keep defaults. Units: hours/days as marked per field.",
1091
+ "type": "object",
1092
+ "properties": {
1093
+ "progress_stall_hours": {
1094
+ "description": "Progress stall alert threshold in HOURS. Default 0 = auto (expected_node_duration × 2).",
1095
+ "type": "number",
1096
+ "exclusiveMinimum": 0
1097
+ },
1098
+ "compensation_drop_ratio": {
1099
+ "description": "Compensation fund drop alert ratio (0-1). Default 0.3 = alert on ≥30% drop.",
1100
+ "type": "number",
1101
+ "minimum": 0,
1102
+ "maximum": 1
1103
+ },
1104
+ "compensation_coverage_min": {
1105
+ "description": "Minimum compensation coverage ratio vs order amount (0-1). Default 1.0 = must fully cover.",
1106
+ "type": "number",
1107
+ "minimum": 0,
1108
+ "maximum": 1
1109
+ },
1110
+ "messenger_timeout_hours": {
1111
+ "description": "Messenger no-reply timeout in HOURS. Default 24.",
1112
+ "type": "number",
1113
+ "exclusiveMinimum": 0
1114
+ },
1115
+ "review_window_closing_days": {
1116
+ "description": "Review window near-closing alert threshold in DAYS. Default 3.",
1117
+ "type": "number",
1118
+ "exclusiveMinimum": 0
1119
+ },
1120
+ "arb_window_closing_days": {
1121
+ "description": "Arbitration window near-closing alert threshold in DAYS. Default 3.",
1122
+ "type": "number",
1123
+ "exclusiveMinimum": 0
1095
1124
  }
1096
1125
  },
1097
- "required": [
1098
- "action"
1099
- ],
1100
1126
  "additionalProperties": false
1101
1127
  }
1102
- }
1128
+ },
1129
+ "required": [
1130
+ "action"
1131
+ ],
1132
+ "additionalProperties": false
1103
1133
  }