@wowok/agent-mcp 2.7.0 → 2.7.2

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 (427) hide show
  1. package/dist/config/index.js +1 -1
  2. package/dist/config/runtime.js +1 -238
  3. package/dist/customer/customer-advice.js +1 -130
  4. package/dist/customer/index.js +1 -11
  5. package/dist/customer/industry-risks.js +1 -438
  6. package/dist/customer/info-puzzle.js +1 -681
  7. package/dist/customer/order-monitor.js +1 -328
  8. package/dist/customer/order-strategy.js +1 -373
  9. package/dist/customer/post-purchase.js +1 -351
  10. package/dist/customer/preorder-compare.js +1 -34
  11. package/dist/customer/reminder-system.js +1 -316
  12. package/dist/customer/risk-assessment.d.ts +5 -1
  13. package/dist/customer/risk-assessment.js +1 -397
  14. package/dist/customer/types.js +1 -13
  15. package/dist/customer/user-preferences.js +1 -460
  16. package/dist/evaluation/arbitration-game.d.ts +23 -0
  17. package/dist/evaluation/arbitration-game.js +1 -0
  18. package/dist/evaluation/builtins/demand-match.d.ts +15 -0
  19. package/dist/evaluation/builtins/demand-match.js +1 -0
  20. package/dist/evaluation/builtins/index.d.ts +3 -0
  21. package/dist/evaluation/builtins/index.js +1 -0
  22. package/dist/evaluation/builtins/service-risk.d.ts +6 -0
  23. package/dist/evaluation/builtins/service-risk.js +1 -0
  24. package/dist/evaluation/capability.d.ts +50 -0
  25. package/dist/evaluation/capability.js +1 -0
  26. package/dist/evaluation/composer.d.ts +13 -0
  27. package/dist/evaluation/composer.js +1 -0
  28. package/dist/evaluation/engine.d.ts +18 -0
  29. package/dist/evaluation/engine.js +1 -0
  30. package/dist/evaluation/extract.d.ts +30 -0
  31. package/dist/evaluation/extract.js +1 -0
  32. package/dist/evaluation/game-strategy.d.ts +27 -0
  33. package/dist/evaluation/game-strategy.js +1 -0
  34. package/dist/evaluation/gap.d.ts +2 -0
  35. package/dist/evaluation/gap.js +1 -0
  36. package/dist/evaluation/index.d.ts +12 -0
  37. package/dist/evaluation/index.js +1 -0
  38. package/dist/evaluation/node-game.d.ts +62 -0
  39. package/dist/evaluation/node-game.js +1 -0
  40. package/dist/evaluation/region.d.ts +10 -0
  41. package/dist/evaluation/region.js +1 -0
  42. package/dist/evaluation/types.d.ts +77 -0
  43. package/dist/evaluation/types.js +1 -0
  44. package/dist/evaluation/user-injection.d.ts +6 -0
  45. package/dist/evaluation/user-injection.js +1 -0
  46. package/dist/examples/education-contact-create.json +40 -0
  47. package/dist/examples/freelance-contact-create.json +40 -0
  48. package/dist/examples/insurance-machine-create.json +1 -1
  49. package/dist/examples/insurance-service-allocators.json +1 -1
  50. package/dist/examples/machine-publish.json +1 -1
  51. package/dist/examples/rental-ziroom-service-create.json +1 -1
  52. package/dist/examples/retail-adv-guard-messenger-proof-create.json +1 -1
  53. package/dist/examples/retail-myshop-service-create.json +1 -1
  54. package/dist/examples/retail-myshop-service-customer-required.json +1 -1
  55. package/dist/examples/subscription-contact-create.json +40 -0
  56. package/dist/examples/threebody-machine-create.json +1 -1
  57. package/dist/examples/travel-machine-create.json +1 -1
  58. package/dist/examples/travel-service-create.json +1 -1
  59. package/dist/experience/experience-reuse.js +1 -103
  60. package/dist/experience/index.js +1 -5
  61. package/dist/experience/intent-distill.js +1 -83
  62. package/dist/experience/realtime-feedback.js +1 -94
  63. package/dist/experience/types.js +1 -1
  64. package/dist/experience/user-profile.js +1 -171
  65. package/dist/extensions/business-modules.js +1 -287
  66. package/dist/extensions/capability-manifest.js +1 -781
  67. package/dist/extensions/constraint-registry.js +1 -198
  68. package/dist/extensions/index.js +1 -6
  69. package/dist/extensions/metric-registry.js +1 -257
  70. package/dist/extensions/mode-evaluator.js +1 -170
  71. package/dist/extensions/modes.js +1 -499
  72. package/dist/extensions/registry.js +1 -717
  73. package/dist/extensions/types.js +1 -1
  74. package/dist/harness/auto-escalation.js +1 -68
  75. package/dist/harness/checkpoint.js +1 -129
  76. package/dist/harness/index.js +1 -78
  77. package/dist/harness/plan.js +1 -276
  78. package/dist/harness/recover.js +1 -139
  79. package/dist/harness/types.js +1 -1
  80. package/dist/harness/verify.js +1 -237
  81. package/dist/index.js +1 -273
  82. package/dist/intent/enrich.d.ts +1 -0
  83. package/dist/intent/enrich.js +1 -0
  84. package/dist/intent/index.d.ts +23 -0
  85. package/dist/intent/index.js +1 -0
  86. package/dist/intent/matcher.d.ts +2 -0
  87. package/dist/intent/matcher.js +1 -0
  88. package/dist/intent/store.d.ts +19 -0
  89. package/dist/intent/store.js +1 -0
  90. package/dist/intent/types.d.ts +33 -0
  91. package/dist/intent/types.js +1 -0
  92. package/dist/knowledge/acquisition-flywheel.js +1 -192
  93. package/dist/knowledge/allocation-confirm.js +1 -534
  94. package/dist/knowledge/allocation-context.js +1 -249
  95. package/dist/knowledge/allocation-ledger.js +1 -463
  96. package/dist/knowledge/allocation-puzzle.js +1 -298
  97. package/dist/knowledge/allocation-risk.js +1 -568
  98. package/dist/knowledge/allocation-templates.js +1 -970
  99. package/dist/knowledge/allocation-translation.js +1 -585
  100. package/dist/knowledge/arb-risk.js +1 -210
  101. package/dist/knowledge/arbitration-confirm.js +1 -559
  102. package/dist/knowledge/arbitration-context.js +1 -505
  103. package/dist/knowledge/arbitration-ledger.js +1 -521
  104. package/dist/knowledge/arbitration-puzzle.js +1 -304
  105. package/dist/knowledge/arbitration-risk.js +1 -433
  106. package/dist/knowledge/arbitration-templates.js +1 -276
  107. package/dist/knowledge/arbitration-translation.js +1 -487
  108. package/dist/knowledge/arbitration-trust.js +1 -117
  109. package/dist/knowledge/audit-rules.js +1 -141
  110. package/dist/knowledge/bridge-risk.js +1 -263
  111. package/dist/knowledge/contact-risk.js +1 -200
  112. package/dist/knowledge/contact-templates.d.ts +27 -0
  113. package/dist/knowledge/contact-templates.js +1 -0
  114. package/dist/knowledge/demand-confirm.js +1 -206
  115. package/dist/knowledge/demand-matching.js +1 -132
  116. package/dist/knowledge/demand-risk.js +1 -240
  117. package/dist/knowledge/demand-translation.js +1 -354
  118. package/dist/knowledge/deployment-scanner.js +1 -823
  119. package/dist/knowledge/dynamic-pricing.js +1 -87
  120. package/dist/knowledge/examples-scanner-cli.js +1 -26
  121. package/dist/knowledge/examples-scanner.js +1 -825
  122. package/dist/knowledge/flywheel-loop.js +1 -404
  123. package/dist/knowledge/fund-layer.js +1 -973
  124. package/dist/knowledge/glossary.js +1 -211
  125. package/dist/knowledge/guard-confirm.js +1 -406
  126. package/dist/knowledge/guard-context.js +1 -287
  127. package/dist/knowledge/guard-design-patterns.js +1 -360
  128. package/dist/knowledge/guard-ledger.js +1 -260
  129. package/dist/knowledge/guard-lint.js +1 -670
  130. package/dist/knowledge/guard-migration.js +1 -228
  131. package/dist/knowledge/guard-puzzle.js +1 -805
  132. package/dist/knowledge/guard-render.js +1 -700
  133. package/dist/knowledge/guard-risk.js +1 -1879
  134. package/dist/knowledge/guard-submission-prompt.js +1 -171
  135. package/dist/knowledge/guard-templates.js +1 -1105
  136. package/dist/knowledge/guard-translation.js +1 -1119
  137. package/dist/knowledge/index.js +1 -436
  138. package/dist/knowledge/industry-evolution.js +1 -323
  139. package/dist/knowledge/industry-generalizer.js +1 -381
  140. package/dist/knowledge/industry-registry.js +1 -174
  141. package/dist/knowledge/intent-metrics.d.ts +4 -3
  142. package/dist/knowledge/intent-metrics.js +1 -566
  143. package/dist/knowledge/machine-confirm.js +1 -559
  144. package/dist/knowledge/machine-context.js +1 -833
  145. package/dist/knowledge/machine-ledger.js +1 -338
  146. package/dist/knowledge/machine-puzzle.js +1 -494
  147. package/dist/knowledge/machine-render.js +1 -565
  148. package/dist/knowledge/machine-risk.js +1 -670
  149. package/dist/knowledge/machine-templates.js +1 -1597
  150. package/dist/knowledge/machine-topology.js +1 -234
  151. package/dist/knowledge/machine-translation.js +1 -513
  152. package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
  153. package/dist/knowledge/mcp-schema-audit.d.ts +1 -1
  154. package/dist/knowledge/mcp-schema-audit.js +1 -773
  155. package/dist/knowledge/onchain-constants.js +1 -35
  156. package/dist/knowledge/order-confirm.js +1 -573
  157. package/dist/knowledge/order-context.js +1 -390
  158. package/dist/knowledge/order-ledger.js +1 -341
  159. package/dist/knowledge/order-puzzle.js +1 -255
  160. package/dist/knowledge/order-risk.js +1 -653
  161. package/dist/knowledge/order-templates.js +1 -368
  162. package/dist/knowledge/order-translation.js +1 -550
  163. package/dist/knowledge/overrides-loader.js +1 -65
  164. package/dist/knowledge/passport-confirm.js +1 -531
  165. package/dist/knowledge/passport-context.js +1 -306
  166. package/dist/knowledge/passport-ledger.js +1 -282
  167. package/dist/knowledge/passport-puzzle.js +1 -333
  168. package/dist/knowledge/passport-risk.js +1 -450
  169. package/dist/knowledge/passport-templates.js +1 -568
  170. package/dist/knowledge/passport-translation.js +1 -516
  171. package/dist/knowledge/payment-risk.js +1 -249
  172. package/dist/knowledge/permission-confirm.js +1 -426
  173. package/dist/knowledge/permission-context.js +1 -224
  174. package/dist/knowledge/permission-ledger.js +1 -403
  175. package/dist/knowledge/permission-puzzle.js +1 -173
  176. package/dist/knowledge/permission-risk.js +1 -411
  177. package/dist/knowledge/permission-templates.js +1 -234
  178. package/dist/knowledge/permission-translation.js +1 -350
  179. package/dist/knowledge/personal-risk.js +1 -212
  180. package/dist/knowledge/process-model.js +1 -160
  181. package/dist/knowledge/progress-confirm.js +1 -456
  182. package/dist/knowledge/progress-context.js +1 -452
  183. package/dist/knowledge/progress-ledger.js +1 -330
  184. package/dist/knowledge/progress-puzzle.js +1 -219
  185. package/dist/knowledge/progress-risk.js +1 -461
  186. package/dist/knowledge/progress-templates.js +1 -228
  187. package/dist/knowledge/progress-translation.js +1 -405
  188. package/dist/knowledge/proof-confirm.js +1 -187
  189. package/dist/knowledge/proof-risk.js +1 -207
  190. package/dist/knowledge/proof-translation.js +1 -283
  191. package/dist/knowledge/registrar-risk.js +1 -217
  192. package/dist/knowledge/repository-confirm.js +1 -286
  193. package/dist/knowledge/repository-risk.js +1 -373
  194. package/dist/knowledge/repository-translation.js +1 -445
  195. package/dist/knowledge/reputation-rules.js +1 -99
  196. package/dist/knowledge/resource-risk.js +1 -157
  197. package/dist/knowledge/reward-confirm.js +1 -526
  198. package/dist/knowledge/reward-context.js +1 -504
  199. package/dist/knowledge/reward-ledger.js +1 -502
  200. package/dist/knowledge/reward-puzzle.js +1 -300
  201. package/dist/knowledge/reward-risk.js +1 -627
  202. package/dist/knowledge/reward-templates.js +1 -197
  203. package/dist/knowledge/reward-translation.js +1 -501
  204. package/dist/knowledge/safety-rules.js +1 -404
  205. package/dist/knowledge/scenario-modes.js +1 -321
  206. package/dist/knowledge/service-confirm.js +1 -807
  207. package/dist/knowledge/service-context.js +1 -403
  208. package/dist/knowledge/service-ledger.js +1 -609
  209. package/dist/knowledge/service-puzzle.js +1 -236
  210. package/dist/knowledge/service-risk.js +1 -615
  211. package/dist/knowledge/service-templates.js +1 -456
  212. package/dist/knowledge/service-translation.js +1 -622
  213. package/dist/knowledge/template-registry.d.ts +1 -1
  214. package/dist/knowledge/template-registry.js +1 -341
  215. package/dist/knowledge/tool-constraints.js +1 -195
  216. package/dist/knowledge/tools-reference.js +1 -155
  217. package/dist/knowledge/treasury-confirm.js +1 -512
  218. package/dist/knowledge/treasury-context.js +1 -363
  219. package/dist/knowledge/treasury-ledger.js +1 -300
  220. package/dist/knowledge/treasury-puzzle.js +1 -216
  221. package/dist/knowledge/treasury-risk.js +1 -440
  222. package/dist/knowledge/treasury-templates.js +1 -358
  223. package/dist/knowledge/treasury-translation.js +1 -498
  224. package/dist/knowledge/trust-metrics.js +1 -198
  225. package/dist/knowledge/util-risk.js +1 -135
  226. package/dist/loop-engineering/aggregate.js +1 -132
  227. package/dist/loop-engineering/context-collect.js +1 -83
  228. package/dist/loop-engineering/diagnose.js +1 -273
  229. package/dist/loop-engineering/improve.js +1 -405
  230. package/dist/loop-engineering/index.js +1 -4
  231. package/dist/loop-engineering/pipeline.js +1 -56
  232. package/dist/mode-market/index.js +1 -3
  233. package/dist/mode-market/registry.js +1 -124
  234. package/dist/mode-market/review.js +1 -214
  235. package/dist/mode-market/submission.js +1 -85
  236. package/dist/participation/collaborator-interest.d.ts +23 -0
  237. package/dist/participation/collaborator-interest.js +1 -0
  238. package/dist/participation/customer-interest.d.ts +25 -0
  239. package/dist/participation/customer-interest.js +1 -0
  240. package/dist/participation/merchant-interest.js +1 -100
  241. package/dist/participation/radar-core.d.ts +13 -3
  242. package/dist/participation/radar-core.js +1 -269
  243. package/dist/participation/supplier-interest.d.ts +25 -0
  244. package/dist/participation/supplier-interest.js +1 -0
  245. package/dist/persona/analyzer.d.ts +16 -0
  246. package/dist/persona/analyzer.js +1 -0
  247. package/dist/persona/bridge.d.ts +5 -0
  248. package/dist/persona/bridge.js +1 -0
  249. package/dist/persona/defaults.d.ts +4 -0
  250. package/dist/persona/defaults.js +1 -0
  251. package/dist/persona/experience-bridge.d.ts +3 -0
  252. package/dist/persona/experience-bridge.js +1 -0
  253. package/dist/persona/index.d.ts +18 -0
  254. package/dist/persona/index.js +1 -0
  255. package/dist/persona/model.d.ts +7 -0
  256. package/dist/persona/model.js +1 -0
  257. package/dist/persona/store.d.ts +19 -0
  258. package/dist/persona/store.js +1 -0
  259. package/dist/persona/types.d.ts +45 -0
  260. package/dist/persona/types.js +1 -0
  261. package/dist/project/business-puzzle.js +1 -383
  262. package/dist/project/context-assembly.js +1 -254
  263. package/dist/project/deployment-bridge.js +1 -120
  264. package/dist/project/deployment-doc.js +1 -1126
  265. package/dist/project/edit-planner.js +1 -1342
  266. package/dist/project/evaluation.js +1 -2011
  267. package/dist/project/game-theory.js +1 -177
  268. package/dist/project/graph-builder.js +1 -656
  269. package/dist/project/graph.js +1 -340
  270. package/dist/project/handlers.d.ts +5 -0
  271. package/dist/project/handlers.js +1 -1762
  272. package/dist/project/index.d.ts +1 -0
  273. package/dist/project/index.js +1 -301
  274. package/dist/project/intent-analyzer.js +1 -149
  275. package/dist/project/machine-nodes.js +1 -36
  276. package/dist/project/merchant-guide.js +1 -264
  277. package/dist/project/migration.js +1 -125
  278. package/dist/project/mode-actions.js +1 -309
  279. package/dist/project/namespace.js +1 -206
  280. package/dist/project/participation-radar.js +1 -428
  281. package/dist/project/pipeline-actions.js +1 -109
  282. package/dist/project/project-store.js +1 -422
  283. package/dist/project/query.js +1 -153
  284. package/dist/project/reverse-mapping.d.ts +34 -0
  285. package/dist/project/reverse-mapping.js +1 -0
  286. package/dist/project/risk-aggregator.js +1 -295
  287. package/dist/project/rollback-policy.js +1 -290
  288. package/dist/project/semantic-assembler.js +1 -345
  289. package/dist/project/semantic-graph.js +1 -245
  290. package/dist/project/stage-gate.js +1 -369
  291. package/dist/project/substep-trace.js +1 -332
  292. package/dist/project/task-tracker.js +1 -78
  293. package/dist/role/derivation.d.ts +18 -0
  294. package/dist/role/derivation.js +1 -0
  295. package/dist/role/index.d.ts +5 -0
  296. package/dist/role/index.js +1 -0
  297. package/dist/role/model.d.ts +8 -0
  298. package/dist/role/model.js +1 -0
  299. package/dist/role/resolution.d.ts +11 -0
  300. package/dist/role/resolution.js +1 -0
  301. package/dist/role/types.d.ts +11 -0
  302. package/dist/role/types.js +1 -0
  303. package/dist/rules.d.ts +2 -0
  304. package/dist/rules.js +1 -9
  305. package/dist/safety/confirm-gate.js +1 -88
  306. package/dist/safety/index.js +1 -3
  307. package/dist/safety/preview.js +1 -52
  308. package/dist/schema/call/allocation.js +1 -34
  309. package/dist/schema/call/arbitration.js +1 -113
  310. package/dist/schema/call/base.d.ts +15 -15
  311. package/dist/schema/call/base.js +1 -370
  312. package/dist/schema/call/bridge-handler.js +1 -265
  313. package/dist/schema/call/bridge.d.ts +7 -7
  314. package/dist/schema/call/bridge.js +1 -458
  315. package/dist/schema/call/contact.js +1 -37
  316. package/dist/schema/call/demand.js +1 -47
  317. package/dist/schema/call/guard.js +1 -161
  318. package/dist/schema/call/handler.js +1 -322
  319. package/dist/schema/call/index.js +1 -20
  320. package/dist/schema/call/machine.js +1 -193
  321. package/dist/schema/call/order.js +1 -35
  322. package/dist/schema/call/payment.js +1 -37
  323. package/dist/schema/call/permission-handler.js +1 -54
  324. package/dist/schema/call/permission.js +1 -105
  325. package/dist/schema/call/personal.js +1 -78
  326. package/dist/schema/call/progress.js +1 -47
  327. package/dist/schema/call/proof.js +1 -33
  328. package/dist/schema/call/repository.js +1 -77
  329. package/dist/schema/call/reward.js +1 -30
  330. package/dist/schema/call/semantic.js +1 -1657
  331. package/dist/schema/call/service.js +1 -178
  332. package/dist/schema/call/treasury.js +1 -71
  333. package/dist/schema/common/index.js +1 -407
  334. package/dist/schema/config/index.js +1 -68
  335. package/dist/schema/evaluation/index.d.ts +4436 -0
  336. package/dist/schema/evaluation/index.js +1 -0
  337. package/dist/schema/index.d.ts +4 -0
  338. package/dist/schema/index.js +1 -13
  339. package/dist/schema/intent-radar/index.d.ts +284 -0
  340. package/dist/schema/intent-radar/index.js +1 -0
  341. package/dist/schema/local/index.d.ts +21 -21
  342. package/dist/schema/local/index.js +1 -927
  343. package/dist/schema/local/wip.js +1 -187
  344. package/dist/schema/messenger/index.d.ts +7 -7
  345. package/dist/schema/messenger/index.js +1 -475
  346. package/dist/schema/operations.d.ts +7 -7
  347. package/dist/schema/operations.js +1 -520
  348. package/dist/schema/persona/index.d.ts +1985 -0
  349. package/dist/schema/persona/index.js +1 -0
  350. package/dist/schema/project/index.d.ts +96 -50
  351. package/dist/schema/project/index.js +1 -2057
  352. package/dist/schema/query/index.d.ts +423 -7
  353. package/dist/schema/query/index.js +1 -1640
  354. package/dist/schema/schema-query/index.js +1 -104
  355. package/dist/schema/schema-version.js +1 -76
  356. package/dist/schema/sync-layer4.d.ts +1 -1
  357. package/dist/schema/sync-layer4.js +1 -282
  358. package/dist/schema/task-status.d.ts +168 -0
  359. package/dist/schema/task-status.js +1 -0
  360. package/dist/schema/trust/index.js +1 -314
  361. package/dist/schema/utils/guard-parser.js +1 -419
  362. package/dist/schema/utils/guard-query-utils.js +1 -46
  363. package/dist/schema/utils/node-parser.js +1 -369
  364. package/dist/schema/utils/object-type-utils.js +1 -35
  365. package/dist/schema/utils/permission-index-utils.js +1 -7
  366. package/dist/schema/utils/permission-machine-check.js +1 -121
  367. package/dist/schema/utils/skills-recommendation.js +1 -77
  368. package/dist/schema-query/index.js +1 -810
  369. package/dist/schemas/account_operation.output.json +5 -2
  370. package/dist/schemas/bridge_operation.output.json +5 -2
  371. package/dist/schemas/evaluation_operation.output.json +782 -0
  372. package/dist/schemas/evaluation_operation.schema.json +990 -0
  373. package/dist/schemas/index.json +25 -1
  374. package/dist/schemas/intent_radar.output.json +232 -0
  375. package/dist/schemas/intent_radar.schema.json +138 -0
  376. package/dist/schemas/local_info_operation.output.json +5 -2
  377. package/dist/schemas/local_mark_operation.output.json +5 -2
  378. package/dist/schemas/messenger_operation.output.json +5 -2
  379. package/dist/schemas/onchain_events.output.json +5 -2
  380. package/dist/schemas/onchain_operations.output.json +5 -2
  381. package/dist/schemas/onchain_operations.schema.json +6 -6
  382. package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
  383. package/dist/schemas/onchain_operations_machine.schema.json +2 -2
  384. package/dist/schemas/onchain_operations_service.schema.json +3 -3
  385. package/dist/schemas/onchain_table_data.output.json +6 -3
  386. package/dist/schemas/persona_operation.output.json +392 -0
  387. package/dist/schemas/persona_operation.schema.json +250 -0
  388. package/dist/schemas/project_operation.output.json +28 -8
  389. package/dist/schemas/query_task_status.output.json +115 -0
  390. package/dist/schemas/query_task_status.schema.json +24 -0
  391. package/dist/schemas/query_toolkit.output.json +9 -6
  392. package/dist/schemas/trust_score.schema.json +1 -1
  393. package/dist/schemas/wowok_buildin_info.output.json +132 -0
  394. package/dist/schemas/wowok_buildin_info.schema.json +14 -0
  395. package/dist/telemetry/index.js +1 -112
  396. package/dist/telemetry/redact.js +1 -23
  397. package/dist/telemetry/storage.js +1 -80
  398. package/dist/tools/handlers/bridge.js +1 -1
  399. package/dist/tools/handlers/config.js +1 -74
  400. package/dist/tools/handlers/evaluation.d.ts +2 -0
  401. package/dist/tools/handlers/evaluation.js +1 -0
  402. package/dist/tools/handlers/file-export.js +1 -90
  403. package/dist/tools/handlers/intent-radar.d.ts +2 -0
  404. package/dist/tools/handlers/intent-radar.js +1 -0
  405. package/dist/tools/handlers/local.js +1 -53
  406. package/dist/tools/handlers/messenger.js +1 -188
  407. package/dist/tools/handlers/onchain.js +1 -1082
  408. package/dist/tools/handlers/persona.d.ts +4 -0
  409. package/dist/tools/handlers/persona.js +1 -0
  410. package/dist/tools/handlers/project.js +1 -211
  411. package/dist/tools/handlers/query.js +1 -434
  412. package/dist/tools/handlers/schema-query.js +1 -176
  413. package/dist/tools/handlers/task-status.d.ts +0 -168
  414. package/dist/tools/handlers/task-status.js +1 -55
  415. package/dist/tools/handlers/trust.js +1 -380
  416. package/dist/tools/handlers/wip.js +1 -90
  417. package/dist/tools/index.js +1 -1306
  418. package/dist/tools/retry.js +1 -85
  419. package/dist/tools/rules-hook.js +1 -23
  420. package/dist/tools/shared.js +1 -130
  421. package/dist/tools/types.js +1 -1
  422. package/dist/tools/upgrade-check.d.ts +19 -0
  423. package/dist/tools/upgrade-check.js +1 -0
  424. package/dist/tools/wip-deploy-assist.d.ts +1 -1
  425. package/dist/tools/wip-deploy-assist.js +1 -278
  426. package/dist/tools/wrap.js +1 -500
  427. package/package.json +5 -3
@@ -1,2057 +1 @@
1
- import { z } from "zod";
2
- const IndustryEnum = z.enum([
3
- "general",
4
- "retail",
5
- "retail_d2c",
6
- "service",
7
- "rental",
8
- "freelance",
9
- "education",
10
- "travel",
11
- "subscription",
12
- "custom",
13
- ]);
14
- export const ProjectObjectTypeEnum = z.enum([
15
- "service",
16
- "machine",
17
- "guard",
18
- "permission",
19
- "reward",
20
- "arb",
21
- "progress",
22
- "treasury",
23
- "demand",
24
- "repository",
25
- "contact",
26
- "order",
27
- "allocation",
28
- "personal",
29
- "payment",
30
- "proof",
31
- ]);
32
- export const EdgeKindEnum = z.enum([
33
- "machine",
34
- "order_allocators",
35
- "arbitrations",
36
- "compensation_fund",
37
- "rewards",
38
- "buy_guard",
39
- "permission",
40
- "guard",
41
- "prev",
42
- "next",
43
- "forward",
44
- "parent",
45
- "service",
46
- "progress",
47
- "arbitration",
48
- "sub_order",
49
- "references",
50
- ]);
51
- export const ProjectOperationInputSchema = z
52
- .object({
53
- action: z
54
- .enum([
55
- "list_projects",
56
- "create_project",
57
- "create_project_from_onchain",
58
- "update_project",
59
- "get_project_detail",
60
- "add_object",
61
- "remove_object",
62
- "update_object",
63
- "create_version",
64
- "build_graph",
65
- "get_graph",
66
- "evaluate_project",
67
- "save_evaluation",
68
- "compare_projects",
69
- "refresh_objects",
70
- "get_object_diff",
71
- "delete_project",
72
- "assemble_context",
73
- "get_machine_graph",
74
- "get_guard_graph",
75
- "generate_deployment_doc",
76
- "pre_evaluate_check",
77
- "verify_deployment",
78
- "clone_project_to_network",
79
- "migrate_network",
80
- "migrate_to_mainnet",
81
- "plan_object_edit",
82
- "apply_object_edit",
83
- "patch_machine_nodes",
84
- "patch_guard_tree",
85
- "recommend_industry",
86
- "list_modes",
87
- "derive_user_mode",
88
- "evolve_user_mode",
89
- "register_user_mode",
90
- "unregister_user_mode",
91
- "register_custom_metric",
92
- "register_custom_constraint",
93
- "list_metrics_constraints",
94
- "analyze_intent",
95
- "aggregate_risks",
96
- "trace_substeps",
97
- "merchant_guide",
98
- "participation_radar",
99
- ])
100
- .describe("Action to perform. Two categories:\n" +
101
- "1. 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.\n" +
102
- "2. 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).\n" +
103
- "3. 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."),
104
- project: z
105
- .string()
106
- .optional()
107
- .describe("Project prefix (human-readable unique identifier). " +
108
- "For create_project: OPTIONAL — if omitted, auto-derived from project_name (e.g. 'Twitch Service' → 'twitch_service'). " +
109
- "For other actions (build_graph, evaluate_project, etc.): used to identify the project. " +
110
- "Takes precedence resolution: project_id > project (prefix)."),
111
- version: z
112
- .string()
113
- .regex(/^v\d+$/)
114
- .optional()
115
- .describe("Project version (e.g. 'v1'). Used by create_version."),
116
- context_objects: z
117
- .array(z.string())
118
- .optional()
119
- .describe("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."),
120
- include_events: z
121
- .boolean()
122
- .optional()
123
- .describe("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."),
124
- context_network: z
125
- .enum(["testnet", "mainnet"])
126
- .optional()
127
- .describe("Network for assemble_context queries. Defaults to 'testnet' if omitted."),
128
- context_depth: z
129
- .number()
130
- .int()
131
- .min(0)
132
- .max(5)
133
- .optional()
134
- .describe("BFS recursion depth for dependency expansion in assemble_context (default 0 = no expansion). " +
135
- "When >0, the assembly recursively queries objects referenced by the center objects " +
136
- "(permission, guard, machine, service, repositories, etc.) up to the given depth, " +
137
- "using the same address-field extraction rules as build_graph (Pathway 1). " +
138
- "Each level issues one batched query_objects call (≤50 IDs per batch). " +
139
- "Cycles are detected and skipped via a visited set. " +
140
- "Discovered dependencies are returned in `dependencies` (edge metadata) and " +
141
- "`dependency_objects` (full object states). Recommended: 1–2 for most use cases; " +
142
- "3+ may pull large subgraphs (use context_include to constrain)."),
143
- context_include: z
144
- .array(z.string())
145
- .optional()
146
- .describe("Optional filter for dependency expansion edge types. When omitted, ALL outbound " +
147
- "references are followed. When provided, only edges whose `field` matches one of the " +
148
- "listed names are followed. Recognized field names (from extractAddressFields): " +
149
- "'permission', 'machine', 'service', 'progress', 'buy_guard', 'um', 'repositories', " +
150
- "'arbitrations', 'rewards', 'consensus_repositories', 'context_repositories', " +
151
- "'dispute', 'allocation', 'external_deposit_guard', 'external_withdraw_guard', " +
152
- "'allocator_guard', 'for_object', 'for_guard', 'payment', 'voting_guard', 'usage_guard', " +
153
- "'guard', 'write_guard', 'quote_guard', 'recipient_entity', 'order_allocators'. " +
154
- "Example: ['permission','guard'] expands only permission/guard dependencies."),
155
- filter_status: z
156
- .enum(["draft", "active", "inactive", "archived"])
157
- .optional()
158
- .describe("Filter list_projects by project status."),
159
- filter_perspective: z
160
- .enum(["producer", "consumer", "both"])
161
- .optional()
162
- .describe("Filter list_projects by project perspective."),
163
- filter_network: z
164
- .enum(["testnet", "mainnet"])
165
- .optional()
166
- .describe("Filter list_projects by network."),
167
- project_name: z
168
- .string()
169
- .min(1)
170
- .max(200)
171
- .optional()
172
- .describe("Display name for create_project / create_project_from_onchain / update_project. Required when action='create_project'."),
173
- project_description: z
174
- .string()
175
- .max(2000)
176
- .optional()
177
- .describe("Project description for create_project / update_project."),
178
- project_industry: IndustryEnum.optional().describe("Industry tag for create_project. Drives template defaults — when set " +
179
- "(and not 'general'), the system auto-applies an industry blueprint " +
180
- "with ~10 draft objects (Permission, Service, Machine, Guard, Treasury, " +
181
- "Allocation, etc.) + graph edges, ready for deployment. " +
182
- "Supported industries: 'general' (no template), 'retail', 'retail_d2c' " +
183
- "(Direct-to-Consumer, e.g., Shopify — Allocation escrow + 2 Guards), 'service', " +
184
- "'rental', 'freelance', 'education', 'travel', 'subscription', 'custom'. " +
185
- "Each industry preset embeds risk constraints (e.g., 'freelance' does " +
186
- "NOT require compensation_fund, while 'rental'/'travel' do). " +
187
- "Example: project_industry='freelance' creates a freelance-style " +
188
- "blueprint with setting_locked_time ≥ 7d. " +
189
- "Set skip_templates=true to bypass template application."),
190
- project_perspective: z
191
- .enum(["producer", "consumer", "both"])
192
- .optional()
193
- .describe("Project perspective for create_project. 'producer' = build/operate services, 'consumer' = evaluate/buy services, 'both' = dual role. Defaults to 'producer'."),
194
- project_labels: z
195
- .array(z.string())
196
- .optional()
197
- .describe("Free-form labels for create_project / update_project (e.g. ['travel','london','priority'])."),
198
- service_address: z
199
- .string()
200
- .optional()
201
- .describe("On-chain Service object address. Required for create_project_from_onchain. Optional for create_project (links the project to its core Service)."),
202
- project_network: z
203
- .enum(["testnet", "mainnet"])
204
- .optional()
205
- .describe("Network the project is bound to. A Service deployed to different networks are different projects. Defaults to 'testnet'."),
206
- skip_templates: z
207
- .boolean()
208
- .optional()
209
- .describe("When true, create_project skips applying the industry template (no draft:* blueprint objects). " +
210
- "Use this when you want a clean project with no pre-filled blueprint objects — useful for " +
211
- "custom architectures that do not match any industry mode, or to avoid draft objects " +
212
- "appearing in build_graph / evaluate_project before deployment. Defaults to false (templates applied)."),
213
- project_id: z
214
- .string()
215
- .optional()
216
- .describe("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."),
217
- project_status: z
218
- .enum(["draft", "active", "inactive", "archived"])
219
- .optional()
220
- .describe("New status for update_project. 'active' projects are live, 'archived' are read-only."),
221
- target_network: z
222
- .enum(["testnet", "mainnet"])
223
- .optional()
224
- .describe("Target network for clone_project_to_network (or its alias migrate_network). " +
225
- "The source project's objects are copied to a new project bound to this network. " +
226
- "The new project's prefix is '<source_prefix>_<target_network>' to avoid collision. " +
227
- "See the action description for the full 5-step migration workflow (FIX-012)."),
228
- object_address: z
229
- .string()
230
- .optional()
231
- .describe("On-chain object address (0x followed by 32-64 hex chars) for add_object / remove_object. " +
232
- "Also accepts the internal 'draft:<name>' sentinel used by create_project for blueprint objects not yet on-chain. " +
233
- "For add_object, alternatively use object_name_add to resolve via LocalMark. " +
234
- "H-06 fix: invalid formats are rejected at the handler level with a descriptive error."),
235
- object_name_add: z
236
- .string()
237
- .optional()
238
- .describe("LocalMark name for add_object (alternative to object_address)."),
239
- object_type_add: z
240
- .enum([
241
- "Service", "Machine", "Guard", "Permission", "Reward", "Arbitration",
242
- "Progress", "Treasury", "Demand", "Repository", "Contact", "Order",
243
- "Allocation", "Personal", "Payment", "Proof",
244
- ])
245
- .optional()
246
- .describe("Object type for add_object."),
247
- object_role: z
248
- .enum(["core", "dependency", "reference"])
249
- .optional()
250
- .describe("Object role in project for add_object. 'core' = the Service (only one per project), 'dependency' = required binding, 'reference' = optional/auxiliary. Defaults to 'reference'."),
251
- object_tags_add: z
252
- .array(z.string())
253
- .optional()
254
- .describe("Tags for add_object."),
255
- object_id_remove: z
256
- .string()
257
- .optional()
258
- .describe("ProjectObject UUID for remove_object (the project_objects.id, NOT the on-chain address)."),
259
- object_id_update: z
260
- .string()
261
- .optional()
262
- .describe("ProjectObject UUID for update_object (the project_objects.id)."),
263
- object_name_update: z
264
- .string()
265
- .optional()
266
- .describe("New name for update_object."),
267
- object_type_update: z
268
- .string()
269
- .optional()
270
- .describe("New type for update_object."),
271
- object_role_update: z
272
- .enum(["core", "dependency", "reference"])
273
- .optional()
274
- .describe("New role for update_object."),
275
- object_tags_update: z
276
- .array(z.string())
277
- .optional()
278
- .describe("New tags for update_object."),
279
- version_description: z
280
- .string()
281
- .max(500)
282
- .optional()
283
- .describe("Description for create_version."),
284
- fork_from_version: z
285
- .string()
286
- .optional()
287
- .describe("Source version for create_version (fork objects + graph from this version)."),
288
- max_depth: z
289
- .number()
290
- .int()
291
- .min(1)
292
- .max(5)
293
- .optional()
294
- .describe("Max recursion depth for Pathway 1 (internal reference derivation) in build_graph. Default 3."),
295
- depth: z
296
- .number()
297
- .int()
298
- .min(1)
299
- .max(5)
300
- .optional()
301
- .describe("Alias for max_depth (build_graph). When both are set, max_depth takes precedence. Default 3."),
302
- enable_registrar: z
303
- .boolean()
304
- .optional()
305
- .describe("Enable Pathway 2 (Registrar inbound query) in build_graph. Default true."),
306
- enable_potential: z
307
- .boolean()
308
- .optional()
309
- .describe("Enable Pathway 3 (potential relationship detection) in build_graph. Default false."),
310
- async_mode: z
311
- .boolean()
312
- .optional()
313
- .describe("When true, build_graph / evaluate_project runs in the background and returns { task_id } immediately. " +
314
- "Poll query_task_status(task_id) to check progress and retrieve the result. " +
315
- "Default false (synchronous). Use async_mode=true for large projects with enable_potential=true " +
316
- "where build may take >10s."),
317
- evaluation_type: z
318
- .enum(["risk", "trust", "completeness", "value", "worth_buying"])
319
- .optional()
320
- .describe("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)."),
321
- refresh_before_eval: z
322
- .boolean()
323
- .optional()
324
- .describe("When true (DEFAULT), evaluate_project refreshes object cache from chain before evaluating. " +
325
- "Set to false ONLY for read-only checks where staleness is acceptable (e.g., quick comparisons). " +
326
- "BUG-P0-2 fix: previously defaulted to false, causing stale Machine node_count and other " +
327
- "dynamic-field-derived fields to produce false findings (e.g., 'Machine has no nodes'). " +
328
- "Now defaults to true — set refresh_before_eval=false explicitly to skip refresh."),
329
- eval_score: z
330
- .number()
331
- .min(0)
332
- .max(100)
333
- .optional()
334
- .describe("Overall evaluation score (0-100) for save_evaluation."),
335
- eval_summary: z
336
- .string()
337
- .max(1000)
338
- .optional()
339
- .describe("Evaluation summary for save_evaluation."),
340
- eval_details: z
341
- .record(z.unknown())
342
- .optional()
343
- .describe("Structured evaluation details for save_evaluation (criterion_scores, findings, etc.)."),
344
- compare_project_ids: z
345
- .array(z.string())
346
- .min(2)
347
- .optional()
348
- .describe("Array of project IDs to compare (for compare_projects). Minimum 2."),
349
- diff_address: z
350
- .string()
351
- .optional()
352
- .describe("Object address for get_object_diff."),
353
- diff_from_time: z
354
- .number()
355
- .int()
356
- .optional()
357
- .describe("Start timestamp (ms) for get_object_diff."),
358
- diff_to_time: z
359
- .number()
360
- .int()
361
- .optional()
362
- .describe("End timestamp (ms) for get_object_diff."),
363
- network: z
364
- .enum(["testnet", "mainnet"])
365
- .optional()
366
- .describe("Target network for generate_deployment_doc. Required when action='generate_deployment_doc'."),
367
- save: z
368
- .boolean()
369
- .optional()
370
- .describe("When true (default), persist the generated MD to SQLite project_documents table for generate_deployment_doc."),
371
- detail_level: z
372
- .enum(["summary", "detailed", "full"])
373
- .optional()
374
- .describe("P2-03: Deployment document detail level (only for generate_deployment_doc). " +
375
- "'summary' (default): object name + type + key bindings (machine, permission, buy_guard, order_allocators). " +
376
- "'detailed': adds sale list, arbitration list, reward list. " +
377
- "'full': complete fields including stock, price, wip_hash, all config. " +
378
- "Use 'summary' for quick review; request 'detailed' or 'full' only when deeper inspection is needed."),
379
- object_kind: z
380
- .enum(["machine", "guard"])
381
- .optional()
382
- .describe("Object kind for plan_object_edit. 'machine' = Machine workflow directed graph (cycles allowed), 'guard' = Guard computation tree. " +
383
- "Required when action='plan_object_edit'. Inferred from action for patch_machine_nodes (always 'machine') " +
384
- "and patch_guard_tree (always 'guard')."),
385
- edit_format: z
386
- .enum(["tree_outline", "json"])
387
- .optional()
388
- .describe("Format of the edited content for plan_object_edit. " +
389
- "'tree_outline' (default): the indented Markdown outline produced by get_machine_graph / get_guard_graph (human-editable). " +
390
- "'json': raw JSON (machine-readable, for programmatic edits). " +
391
- "Both formats are bidirectional with the parse functions in knowledge/machine-render.ts / guard-render.ts."),
392
- edited_content: z
393
- .string()
394
- .optional()
395
- .describe("Edited content for plan_object_edit. Must be in the format specified by edit_format. " +
396
- "For 'tree_outline': the full tree_outline string from get_machine_graph/get_guard_graph with user edits. " +
397
- "For 'json': a JSON string matching the Machine/Guard schema. " +
398
- "The content is parsed + validated + diffed against the current on-chain state."),
399
- plan_id: z
400
- .string()
401
- .optional()
402
- .describe("Plan ID returned by plan_object_edit. Required for apply_object_edit. " +
403
- "The plan is short-lived (10-minute TTL) and stored in-memory."),
404
- expected_hash: z
405
- .string()
406
- .optional()
407
- .describe("Expected hash returned by plan_object_edit. Required for apply_object_edit. " +
408
- "Used for optimistic concurrency control: if the on-chain state changed between plan and apply, " +
409
- "the hash will mismatch and apply will refuse to proceed (stale edit protection)."),
410
- patch_operations: z
411
- .array(z.string())
412
- .optional()
413
- .describe("Patch operations for patch_machine_nodes / patch_guard_tree. Each string is a single patch operation.\n" +
414
- "Machine operations (13 total):\n" +
415
- " 'add node <name>' | 'remove node <name>' | 'set description <node_name> <text...>'\n" +
416
- " 'add edge <from> <to>' | 'remove edge <from> <to>' | 'set threshold <edge_from> <edge_to> <value>'\n" +
417
- " 'add forward <edge_from> <edge_to> <forward_name>' | 'remove forward <edge_from> <edge_to> <forward_name>'\n" +
418
- " 'set guard <edge_from> <edge_to> <forward_name> <guard_addr_or_name|none>'\n" +
419
- " 'set permission <edge_from> <edge_to> <forward_name> <perm_index>'\n" +
420
- " 'set operator <edge_from> <edge_to> <forward_name> <named_operator|none>'\n" +
421
- " 'set weight <edge_from> <edge_to> <forward_name> <weight>'\n" +
422
- " 'set retained_submission <edge_from> <edge_to> <forward_name> <comma_separated_indices|none>'\n" +
423
- "Guard operations (8 total — see patch_guard_tree):\n" +
424
- " 'add table <identifier> <name|none> <value_type> <b_submission> [json_value]'\n" +
425
- " 'remove table <identifier>' | 'set table_value <identifier> [json_value|none]'\n" +
426
- " 'set table_name <identifier> <name|none>' | 'set table_submission <identifier> <true|false>'\n" +
427
- " 'set root <json_node>' | 'set rely <comma_separated_guard_addresses|none>'\n" +
428
- "Operations are applied in order. Both patches are validated (validateMachine/validateGuard) before execution."),
429
- intent: z
430
- .string()
431
- .max(2000)
432
- .optional()
433
- .describe("Business intent text for recommend_industry (e.g. 'I rent cameras to photographers " +
434
- "with deposit and damage inspection'). Falls back to project_description / project_name when omitted."),
435
- mode_source: z
436
- .string()
437
- .optional()
438
- .describe("Source builtin mode name for derive_user_mode (e.g. 'freelance'). Call list_modes to see available modes."),
439
- mode_name: z
440
- .string()
441
- .max(100)
442
- .optional()
443
- .describe("Mode name for derive_user_mode (new mode name), evolve_user_mode / unregister_user_mode (existing custom mode), register_user_mode (new mode name). " +
444
- "Must NOT conflict with builtin mode names."),
445
- mode_display_name: z
446
- .string()
447
- .max(200)
448
- .optional()
449
- .describe("Display name for derive_user_mode / register_user_mode. Defaults to mode_name."),
450
- mode_changes: z
451
- .record(z.unknown())
452
- .optional()
453
- .describe("Mode field overrides for derive_user_mode / evolve_user_mode / register_user_mode. " +
454
- "For register_user_mode, REQUIRED fields: machine_shape (non-empty array of {name, role}) and key_risk (string). " +
455
- "Common overrides: machine_shape (array of {name:string, role:string}), config_overrides (per-object config), " +
456
- "allocator, guards, build_notes, risk_appetite. " +
457
- "R-M1-11 ENFORCED: machine_shape node names must NOT contain dispute/refund/arb terms — " +
458
- "disputes flow through Service.arbitrations independently of the Machine."),
459
- mode_change_description: z
460
- .string()
461
- .max(500)
462
- .optional()
463
- .describe("Change description for evolve_user_mode (recorded in evolution history)."),
464
- mode_bump_version: z
465
- .boolean()
466
- .optional()
467
- .describe("Whether evolve_user_mode bumps the patch version (default true: v1.0 → v1.1)."),
468
- metric_id: z.string().max(100).optional().describe("Unique metric ID for register_custom_metric (e.g. 'seasonality_risk')."),
469
- metric_display_name: z.string().max(200).optional().describe("Display name for register_custom_metric."),
470
- metric_description: z.string().max(1000).optional().describe("Description for register_custom_metric."),
471
- metric_type: z
472
- .enum(["risk", "benefit"])
473
- .optional()
474
- .describe("Metric type for register_custom_metric: 'risk' (negative) or 'benefit' (positive)."),
475
- metric_scale: z
476
- .enum(["level", "numeric", "percentage"])
477
- .optional()
478
- .describe("Metric scale for register_custom_metric: 'level' (high/medium/low), 'numeric', or 'percentage'."),
479
- metric_weight: z
480
- .number()
481
- .min(0)
482
- .max(10)
483
- .optional()
484
- .describe("Metric weight for register_custom_metric (default 1.0)."),
485
- constraint_id: z.string().max(100).optional().describe("Unique constraint ID for register_custom_constraint."),
486
- constraint_display_name: z.string().max(200).optional().describe("Display name for register_custom_constraint."),
487
- constraint_description: z.string().max(1000).optional().describe("Description for register_custom_constraint."),
488
- constraint_rule: z
489
- .discriminatedUnion("type", [
490
- z.object({ type: z.literal("capability_required"), capability_id: z.string() }).strict(),
491
- z.object({ type: z.literal("capability_forbidden"), capability_id: z.string() }).strict(),
492
- z.object({ type: z.literal("numeric_limit"), field: z.string(), max: z.number().optional(), min: z.number().optional() }).strict(),
493
- z.object({ type: z.literal("condition_required"), condition: z.string(), ai_evaluated: z.literal(true) }).strict(),
494
- ])
495
- .optional()
496
- .describe("Constraint rule for register_custom_constraint. 4 types: " +
497
- "capability_required/capability_forbidden (capability_id), numeric_limit (field + max/min), " +
498
- "condition_required (natural-language condition, AI-evaluated)."),
499
- constraint_severity: z
500
- .enum(["hard", "soft"])
501
- .optional()
502
- .describe("Constraint severity for register_custom_constraint: 'hard' blocks applyTemplate on violation; 'soft' only warns (default 'soft')."),
503
- constraint_on_violation: z
504
- .enum(["block", "warn", "log"])
505
- .optional()
506
- .describe("Violation action for register_custom_constraint (default 'warn')."),
507
- metric_type_filter: z
508
- .enum(["risk", "benefit"])
509
- .optional()
510
- .describe("Filter list_metrics_constraints by metric type."),
511
- scope_filter: z
512
- .enum(["builtin", "custom"])
513
- .optional()
514
- .describe("Filter list_metrics_constraints by scope (builtin or custom)."),
515
- target_objects: z
516
- .array(z.string())
517
- .optional()
518
- .describe("Optional explicit target objects for analyze_intent (entry_ids or object_type names). " +
519
- "When provided, puzzle snapshots are restricted to these objects."),
520
- puzzles: z
521
- .record(z
522
- .object({
523
- puzzle: z.unknown().describe("Puzzle snapshot (opaque — pass through from analyze_intent output unchanged)."),
524
- completeness: z.unknown().describe("Completeness snapshot (opaque — pass through unchanged)."),
525
- missing_dimensions: z.array(z.string()).describe("Dimensions still missing for this object."),
526
- })
527
- .strict())
528
- .optional()
529
- .describe("Per-object puzzle snapshots for aggregate_risks, keyed by object_type. " +
530
- "Pass the 'puzzles' field from a prior analyze_intent result UNCHANGED. " +
531
- "When omitted but 'intent' is present, the handler runs analyze_intent first (C1→C2 in one call)."),
532
- severity_threshold: z
533
- .enum(["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"])
534
- .optional()
535
- .describe("Severity threshold for aggregate_risks (default 'HIGH'). Risks at or above this level block deployment (status RISK_BLOCKED)."),
536
- user_confirmed_high_risks: z
537
- .array(z.string())
538
- .optional()
539
- .describe("IDs of HIGH risks the user has already confirmed in a prior round (aggregate_risks). " +
540
- "Confirmed HIGH risks no longer trigger RISK_PENDING_CONFIRM."),
541
- planned_objects: z
542
- .array(z
543
- .object({
544
- object_type: z.string().describe("Wowok object type (e.g. 'service', 'guard', 'machine')."),
545
- is_new: z.boolean().describe("true when creating a NEW object; false when reusing an existing one."),
546
- name: z.string().optional().describe("Planned object name (for readable messages)."),
547
- })
548
- .strict())
549
- .optional()
550
- .describe("Planned objects for aggregate_risks OBJECT_REUSE check (safety-rules). " +
551
- "Flags NEW objects whose type carries an always/strongly-recommended reuse rule."),
552
- planned_operations: z
553
- .array(z
554
- .object({
555
- object_type: z.string().describe("Wowok object type (e.g. 'service', 'arbitration')."),
556
- trigger: z.enum(["create", "publish"]).describe("Lifecycle trigger that locks fields."),
557
- name: z.string().optional().describe("Object name (for readable messages)."),
558
- })
559
- .strict())
560
- .optional()
561
- .describe("Planned create/publish operations for aggregate_risks IMMUTABILITY check (safety-rules). " +
562
- "Warns which fields become permanently locked after each operation."),
563
- substeps: z
564
- .array(z
565
- .object({
566
- step_id: z.string().describe("Substep id, format 'T<step>.<substep>' e.g. 'T1.1'."),
567
- parent_step: z.string().describe("Parent step id, format 'T<step>' e.g. 'T1'."),
568
- object_type: ProjectObjectTypeEnum.describe("Wowok object type this substep operates on."),
569
- entry_id: z.string().describe("Puzzle entry_id this substep corresponds to."),
570
- operation_type: z.string().describe("operation_type for onchain_operations."),
571
- network: z.enum(["testnet", "mainnet"]).describe("Target network."),
572
- input: z
573
- .object({
574
- data: z.record(z.unknown()).describe("Input data payload."),
575
- input_refs: z.array(z.string()).describe("Upstream substep_ids this substep consumes."),
576
- })
577
- .strict(),
578
- output: z
579
- .object({
580
- object_id: z.string().optional(),
581
- tx_digest: z.string().optional(),
582
- })
583
- .catchall(z.unknown())
584
- .optional()
585
- .describe("Output data (filled after execution)."),
586
- timestamp: z.number().describe("Execution timestamp (ms)."),
587
- status: z.enum(["PENDING", "SUCCESS", "FAILED", "SKIPPED"]).describe("Execution status."),
588
- failure_reason: z.string().optional().describe("Failure reason (when status='FAILED')."),
589
- dependencies: z
590
- .object({
591
- input_refs: z.array(z.string()),
592
- output_refs: z
593
- .array(z
594
- .object({
595
- substep_id: z.string().describe("Downstream substep that consumes this output."),
596
- field_path: z.string().describe("Field path produced by this substep (e.g. 'permission_address')."),
597
- })
598
- .strict()),
599
- })
600
- .strict()
601
- .describe("Dependencies (input_refs + output_refs)."),
602
- retry_info: z
603
- .object({
604
- original_step_id: z.string(),
605
- retry_count: z.number(),
606
- retry_reason: z.string(),
607
- })
608
- .strict()
609
- .optional()
610
- .describe("Retry info (when this substep is a retry of an earlier one)."),
611
- })
612
- .strict())
613
- .optional()
614
- .describe("Substep execution records for trace_substeps (63-spec §2.1). " +
615
- "Required when action='trace_substeps'. Construct from your deployment execution trace."),
616
- substep_edges: z
617
- .array(z
618
- .object({
619
- source: z.string().describe("Source substep id."),
620
- target: z.string().describe("Target substep id (depends on source)."),
621
- field_path: z.string().describe("Field path flowing along this edge."),
622
- })
623
- .strict())
624
- .optional()
625
- .describe("Explicit DAG edges for trace_substeps. When omitted, edges are derived from each substep's input_refs."),
626
- guide_state: z
627
- .object({
628
- intent_text: z.string().describe("Step 1: raw merchant business description."),
629
- confirmed_industry: z.string().optional().describe("Step 2: merchant-confirmed industry id."),
630
- currency: z.string().optional().describe("Step 5: payment currency (default WOW)."),
631
- deliverables: z.array(z.unknown()).optional().describe("Step 4: merchant-defined deliverables (opaque passthrough)."),
632
- payment_override: z.record(z.unknown()).optional().describe("Step 5: payment structure overrides (opaque passthrough)."),
633
- trust_override: z.record(z.unknown()).optional().describe("Step 6: trust mechanism overrides (opaque passthrough)."),
634
- adopted_module_ids: z.array(z.string()).optional().describe("Step 6: merchant-confirmed business module ids."),
635
- })
636
- .strict()
637
- .optional()
638
- .describe("Wizard state from a prior merchant_guide result. Pass back UNCHANGED on " +
639
- "every subsequent call (same pattern as C1→C2 puzzles). The handler re-runs " +
640
- "the pipeline deterministically and advances to the furthest reachable step."),
641
- guide_confirm: z
642
- .object({
643
- industry: z.string().optional().describe("Step 2 confirmation: industry id (e.g. 'freelance')."),
644
- currency: z.string().optional().describe("Step 5 confirmation: payment currency."),
645
- deliverables: z.array(z.unknown()).optional().describe("Step 4 confirmation: deliverable definitions."),
646
- payment: z.record(z.unknown()).optional().describe("Step 5 confirmation: { model, triggers, allocation } overrides."),
647
- trust: z.record(z.unknown()).optional().describe("Step 6 confirmation: { refundPolicy, arbitration, escrow } overrides."),
648
- adopted_module_ids: z.array(z.string()).optional().describe("Step 6 confirmation: business module ids to adopt (overrides recommendation)."),
649
- })
650
- .strict()
651
- .optional()
652
- .describe("Merchant decisions for the current wizard step. Merged over guide_state. " +
653
- "Typical flow: call 1 with intent only → receive step-2 industry options → " +
654
- "call 2 with guide_state + guide_confirm={industry} → receive full blueprint " +
655
- "plan (steps 7-10)."),
656
- radar_account: z
657
- .string()
658
- .optional()
659
- .describe("Account to analyze — address (0x...) or LocalMark name (resolved to an address). " +
660
- "Required when action='participation_radar'. The perspective (customer/operator/observer) " +
661
- "is DERIVED from on-chain data (Order.builder + PermissionPerm grants) — never asserted by this field."),
662
- radar_targets: z
663
- .array(z
664
- .object({
665
- progress: z
666
- .string()
667
- .describe("Progress object address (0x...) or LocalMark name. The Progress carries the current node + bound Machine."),
668
- order: z
669
- .string()
670
- .optional()
671
- .describe("Order object address or LocalMark name (optional but recommended — enables order-holder detection, " +
672
- "service-level compensation/reward claims, and dispute context)."),
673
- })
674
- .strict())
675
- .min(1)
676
- .max(20)
677
- .optional()
678
- .describe("In-flight orders to analyze (1-20). Required when action='participation_radar'. " +
679
- "Each target is analyzed independently; results are aggregated into one account dashboard."),
680
- radar_include_alerts: z
681
- .boolean()
682
- .optional()
683
- .describe("Attach order-monitor alerts (progress stall / compensation fund / review & arbitration windows) " +
684
- "to each per-order result. Default true."),
685
- radar_monitor_thresholds: z
686
- .object({
687
- progress_stall_hours: z
688
- .number()
689
- .positive()
690
- .optional()
691
- .describe("Progress stall alert threshold in HOURS. Default 0 = auto (expected_node_duration × 2)."),
692
- compensation_drop_ratio: z
693
- .number()
694
- .min(0)
695
- .max(1)
696
- .optional()
697
- .describe("Compensation fund drop alert ratio (0-1). Default 0.3 = alert on ≥30% drop."),
698
- compensation_coverage_min: z
699
- .number()
700
- .min(0)
701
- .max(1)
702
- .optional()
703
- .describe("Minimum compensation coverage ratio vs order amount (0-1). Default 1.0 = must fully cover."),
704
- messenger_timeout_hours: z
705
- .number()
706
- .positive()
707
- .optional()
708
- .describe("Messenger no-reply timeout in HOURS. Default 24."),
709
- review_window_closing_days: z
710
- .number()
711
- .positive()
712
- .optional()
713
- .describe("Review window near-closing alert threshold in DAYS. Default 3."),
714
- arb_window_closing_days: z
715
- .number()
716
- .positive()
717
- .optional()
718
- .describe("Arbitration window near-closing alert threshold in DAYS. Default 3."),
719
- })
720
- .strict()
721
- .optional()
722
- .describe("Optional per-call overrides for order-monitor alert thresholds (only used when radar_include_alerts is on). " +
723
- "All fields optional; omitted fields keep defaults. Units: hours/days as marked per field."),
724
- })
725
- .strict();
726
- const AssembleContextResultSchema = z
727
- .object({
728
- action: z.literal("assemble_context"),
729
- objects: z
730
- .array(z.unknown())
731
- .describe("Current on-chain states of the requested objects (from query_objects)."),
732
- events: z
733
- .array(z.unknown())
734
- .optional()
735
- .describe("Recent state-transition events (only when include_events=true). " +
736
- "Includes NewOrderEvent, ProgressEvent, ArbEvent, etc."),
737
- embedded_history: z
738
- .record(z.string(), z.unknown())
739
- .optional()
740
- .describe("Operation history extracted from object states — NOT from tx queries. " +
741
- "Progress objects: session.forwards (who did what, when, accomplished). " +
742
- "Order objects: disputes, claimed_by, progress_object. " +
743
- "This is the CORRECT history source: convergent, no infinite recursion."),
744
- dependencies: z
745
- .array(z.object({
746
- object: z.string().describe("Discovered dependency object ID (0x...)."),
747
- depth: z.number().int().min(1).describe("BFS depth at which this dependency was discovered (1 = direct reference from a center object)."),
748
- via_field: z.string().describe("Field name on the parent object that references this dependency (e.g. 'permission', 'machine', 'guard'). Matches extractAddressFields output."),
749
- via_type: z.string().describe("Semantic edge type: 'bind' | 'validate' | 'consume' | 'trigger' | 'create'."),
750
- parent: z.string().describe("Object ID of the parent that referenced this dependency."),
751
- }))
752
- .optional()
753
- .describe("Dependency edges discovered via BFS expansion (only when context_depth > 0). " +
754
- "Each entry describes one outbound reference (parent → child) with the field name " +
755
- "and semantic edge type. Use with dependency_objects to get the full states. " +
756
- "Cycles are deduplicated — each object ID appears at most once at its shallowest depth."),
757
- dependency_objects: z
758
- .array(z.unknown())
759
- .optional()
760
- .describe("Full on-chain states of the discovered dependency objects (only when context_depth > 0). " +
761
- "Order matches `dependencies` when possible; safe to consume as an unordered set. " +
762
- "Center objects are NOT repeated here — they live in `objects`."),
763
- semantic_summary: z
764
- .unknown()
765
- .optional()
766
- .describe("Business semantic annotations generated by buildDataSemantic — " +
767
- "maps raw object fields to business-meaningful concepts for LLM consumption."),
768
- context_digest: z
769
- .string()
770
- .describe("Unique digest for this assembled context (SHA of object IDs + versions + timestamp). " +
771
- "Use for caching or to detect state changes between two assembly calls."),
772
- next_action: z
773
- .string()
774
- .describe("Suggested next action: use onchain_transaction to verify a specific past tx, " +
775
- "or proceed with onchain_operations to modify state, or re-call assemble_context " +
776
- "after state changes."),
777
- flywheel_collected: z
778
- .object({
779
- signature_recorded: z.boolean().describe("Whether the experience signature was recorded in the real-time experience layer."),
780
- proposal_created: z.boolean().describe("Whether an improvement proposal was created for the offline distillation flywheel."),
781
- proposal_id: z.string().optional().describe("The proposal ID, if created."),
782
- })
783
- .optional()
784
- .describe("Distillation flywheel collection result. Non-blocking — may be undefined if collection fails. " +
785
- "When present, the assembled context has been fed back into the experience layer and/or improvement queue."),
786
- })
787
- .strict();
788
- const ProjectObjectSchema = z
789
- .object({
790
- id: z.string().describe("ProjectObject UUID (project_objects.id)."),
791
- projectId: z.string().describe("Owning project UUID."),
792
- objectAddress: z.string().describe("On-chain object address (0x...) or 'draft:<name>' sentinel for blueprint objects."),
793
- objectType: z.string().nullable().describe("Object type (Service, Machine, etc.) or null if unknown."),
794
- objectName: z.string().nullable().describe("LocalMark name or null."),
795
- role: z.string().describe("Object role in project. Valid values: 'core' (the Service), 'dependency' (required binding), 'reference' (optional/auxiliary). Other values indicate data corruption — see objectGroups.other bucket."),
796
- tags: z.array(z.string()).nullable().describe("Tags array or null."),
797
- addedAt: z.number().describe("Timestamp (ms) when added to project."),
798
- metadata: z.record(z.unknown()).nullable().describe("Arbitrary metadata key-value pairs or null."),
799
- })
800
- .strict();
801
- const ProjectSchema = z
802
- .object({
803
- id: z.string().describe("Project UUID."),
804
- prefix: z.string().describe("Human-readable unique prefix."),
805
- name: z.string().describe("Display name."),
806
- description: z.string().nullable(),
807
- industry: z.string().nullable(),
808
- perspective: z.enum(["producer", "consumer", "both"]),
809
- status: z.enum(["draft", "active", "inactive", "archived"]),
810
- labels: z.array(z.string()).nullable(),
811
- currentVersion: z.string().nullable().describe("Current version tag (e.g. 'v1')."),
812
- serviceAddress: z.string().nullable().describe("Core Service on-chain address (producer projects)."),
813
- defaultAccount: z.string().nullable(),
814
- network: z.string().describe("Network the project is bound to."),
815
- createdAt: z.number(),
816
- updatedAt: z.number(),
817
- metadata: z.record(z.unknown()).nullable().describe("Arbitrary metadata key-value pairs or null."),
818
- })
819
- .strict();
820
- const ProjectListItemSchema = ProjectSchema.extend({
821
- objectCount: z.number().describe("Number of objects in this project (from project_objects table)."),
822
- evaluationCount: z.number().describe("Number of stored evaluations for this project (from evaluations table)."),
823
- objectTypes: z.array(z.string()).describe("Distinct object types in this project (e.g. ['Service','Machine'])."),
824
- });
825
- const ListProjectsResultSchema = z
826
- .object({
827
- action: z.literal("list_projects"),
828
- items: z.array(ProjectListItemSchema).describe("GLM6 projects from SQLite (first-class entities, with object summary)."),
829
- total: z.number().describe("Total number of projects returned."),
830
- })
831
- .strict();
832
- const RecommendedCreationOrderItemSchema = z.object({
833
- step: z.number().describe("Step number (1-based)."),
834
- object: z.string().describe("Object type to create (e.g. 'Permission', 'Service (unpublished)')."),
835
- reason: z.string().describe("Why this step is here, including dependencies and irreversibility notes."),
836
- required: z.boolean().describe("Whether this step is mandatory for a working deployment."),
837
- }).strict();
838
- const RecommendedIndustryItemSchema = z.object({
839
- industry: z.string().describe("Recommended builtin industry mode name."),
840
- similarity: z.number().describe("Trait similarity 0-1 (10-dim industry trait match)."),
841
- matched_traits: z.array(z.string()).describe("Trait dimensions that matched."),
842
- reference_examples: z.array(z.object({
843
- file: z.string().describe("Example file name (fetch via schema_query search_examples)."),
844
- title: z.string(),
845
- operation_type: z.string(),
846
- verified: z.boolean(),
847
- }).strict()).describe("Verified reference examples for this industry (top 3)."),
848
- }).strict();
849
- const CreateProjectResultSchema = z
850
- .object({
851
- action: z.literal("create_project"),
852
- project: ProjectSchema.describe("The created project."),
853
- recommended_creation_order: z.array(RecommendedCreationOrderItemSchema).describe("Canonical deployment sequence satisfying dependency constraints. " +
854
- "All industries share this base order; see IndustryMode.build_notes for industry-specific deviations."),
855
- blueprint: z.object({
856
- objects_count: z.number().describe("Number of draft objects created from the template."),
857
- edges_count: z.number().describe("Number of graph edges from the template."),
858
- industry_source: z.string().describe("Industry mode name that sourced the template."),
859
- applied_template: z.string().describe("Template identifier applied."),
860
- steps_count: z.number().describe("Number of deployment steps in the template."),
861
- scenarios_count: z.number().describe("Number of scenarios in the template."),
862
- key_risk: z.string().nullable().optional().describe("Industry-specific key risk note (or null)."),
863
- intent_inference: z.object({
864
- traits: z.record(z.string(), z.unknown()).describe("10-dimension inferred industry traits (unmatched traits use neutral defaults)."),
865
- confidence: z.number().describe("Inference confidence 0-1 (matched trait count / 10)."),
866
- matched_keywords: z.array(z.string()).describe("Keywords that triggered trait inference."),
867
- top_matches: z.array(z.object({
868
- industry: z.string(),
869
- similarity: z.number().describe("Trait similarity 0-1."),
870
- }).strict()).describe("Top-3 similar industries by trait similarity."),
871
- }).strict().optional().describe("Intent inference summary (E.3) — present when industry template applied."),
872
- industry_mismatch_hint: z.string().optional().describe("Advisory hint — present when intent inference suggests a different industry fits the description better (non-blocking)."),
873
- }).strict().optional().describe("Blueprint summary — present when industry template applied successfully. Objects have status='draft' and address='draft:<name>'. Full steps/scenarios persisted as project document doc_type='blueprint'."),
874
- blueprint_warning: z.string().optional().describe("Warning message — present when industry template application failed. Project is created without blueprint; use add_object to manually add objects."),
875
- blueprint_skipped: z.boolean().optional().describe("True when skip_templates=true was passed — no industry blueprint objects were created."),
876
- hint: z.string().optional().describe("User-facing hint — guides to next action (e.g. add_object, generate_deployment_doc)."),
877
- recommended_industries: z.array(RecommendedIndustryItemSchema).optional().describe("Top-3 recommended industry modes inferred from the project description (E.7). " +
878
- "Present only when no project_industry was given. Each item includes reference examples " +
879
- "('standing on giants' shoulders'). To apply: call update_project is NOT enough — recreate " +
880
- "via create_project with project_industry set to get the blueprint."),
881
- })
882
- .strict();
883
- const CreateProjectFromOnchainResultSchema = z
884
- .object({
885
- action: z.literal("create_project_from_onchain"),
886
- project: ProjectSchema.describe("The created consumer project."),
887
- objects: z.array(ProjectObjectSchema).describe("Objects discovered from on-chain Service + graph traversal."),
888
- graphEdgeCount: z.number().describe("Number of relationship edges discovered and persisted."),
889
- })
890
- .strict();
891
- const UpdateProjectResultSchema = z
892
- .object({ action: z.literal("update_project"), project: ProjectSchema.describe("The updated project.") })
893
- .strict();
894
- const EvaluationDetailsSchema = z
895
- .object({
896
- criterionScores: z
897
- .array(z.object({
898
- name: z.string().describe("Criterion name (e.g. 'Service Published', 'Governance Present')."),
899
- score: z.number().describe("Per-criterion score (0-100, higher = better)."),
900
- weight: z.number().describe("Weight in the overall score (0-1)."),
901
- rationale: z.string().describe("Why this score was assigned."),
902
- }).strict())
903
- .describe("Per-criterion scores with rationale."),
904
- findings: z
905
- .array(z.object({
906
- criterion: z.string().describe("Criterion this finding relates to."),
907
- severity: z.enum(["critical", "warning", "info"]).describe("Severity level: critical (blocks deployment), warning (should fix), info (advisory)."),
908
- message: z.string().describe("Human-readable finding description."),
909
- deduction: z.number().describe("Score deduction applied (negative number, e.g. -20)."),
910
- }).strict())
911
- .describe("Negative findings (warnings/critical issues) with deductions."),
912
- strengths: z
913
- .array(z.string())
914
- .describe("Positive evidence explaining high scores."),
915
- })
916
- .strict();
917
- const GetProjectDetailResultSchema = z
918
- .object({
919
- action: z.literal("get_project_detail"),
920
- project: ProjectSchema,
921
- objects: z.array(ProjectObjectSchema).describe("Project objects (rigid relationships). Flat list — use objectGroups for role-based navigation."),
922
- objectGroups: z.object({
923
- core: z.array(ProjectObjectSchema).describe("Core objects (the Service) — the primary deliverable of the project."),
924
- dependency: z.array(ProjectObjectSchema).describe("Dependency objects (Permission, Machine, Guard, Allocation, Treasury, etc.) — required for the Service to function."),
925
- reference: z.array(ProjectObjectSchema).describe("Reference objects (read-only or external) — tracked but not owned by this project."),
926
- other: z.array(ProjectObjectSchema).describe("Objects with invalid or missing role (data corruption, legacy data). Grouped here for visibility — should normally be empty. Check server logs for warnings."),
927
- stats: z.object({
928
- total: z.number().describe("Total object count."),
929
- core_count: z.number().describe("Number of core objects."),
930
- dependency_count: z.number().describe("Number of dependency objects."),
931
- reference_count: z.number().describe("Number of reference objects."),
932
- other_count: z.number().describe("Number of objects with invalid/missing role (in 'other' bucket). Normally 0."),
933
- by_type: z.record(z.string(), z.number()).describe("Object count grouped by objectType prefix (e.g. {'service': 1, 'permission': 1, 'guard': 5})."),
934
- }).strict().describe("Aggregate counts for quick project sizing."),
935
- }).strict().describe("Objects grouped by role (core/dependency/reference/other) for easier navigation. The 'other' bucket captures objects with invalid roles (H-05 fix). The flat `objects` array is preserved for backward compatibility."),
936
- graphEdgeCount: z.number().describe("Number of persisted graph edges."),
937
- serviceStatus: z
938
- .object({
939
- published: z.boolean().nullable().describe("Whether the on-chain Service is published (live). null = unknown / query failed."),
940
- paused: z.boolean().nullable().describe("Whether the on-chain Service is paused (not accepting orders). null = unknown."),
941
- })
942
- .strict()
943
- .nullable()
944
- .describe("On-chain Service status (published / paused). Separate from the project's local lifecycle status. null if the project has no serviceAddress or the on-chain query failed."),
945
- evaluations: z
946
- .array(z.object({
947
- id: z.string(),
948
- evalType: z.enum(["risk", "trust", "completeness", "value", "worth_buying"]),
949
- score: z.number().nullable(),
950
- summary: z.string().nullable(),
951
- details: EvaluationDetailsSchema.nullable().describe("Structured inspection content (criterion scores, findings, strengths). Null for evaluations created before details were stored."),
952
- evaluatedAt: z.number(),
953
- }).strict())
954
- .describe("Stored evaluation results (most recent first)."),
955
- versions: z
956
- .array(z.object({
957
- version: z.string(),
958
- description: z.string().nullable(),
959
- createdAt: z.number(),
960
- }).strict())
961
- .describe("Project version history."),
962
- })
963
- .strict();
964
- const AddObjectResultSchema = z
965
- .object({ action: z.literal("add_object"), object: ProjectObjectSchema.describe("The added project-object relationship.") })
966
- .strict();
967
- const RemoveObjectResultSchema = z
968
- .object({ action: z.literal("remove_object"), removed: z.literal(true).describe("Always true — confirms removal.") })
969
- .strict();
970
- const UpdateObjectResultSchema = z
971
- .object({
972
- action: z.literal("update_object"),
973
- object: ProjectObjectSchema.describe("The updated project-object relationship."),
974
- })
975
- .strict();
976
- const CreateVersionResultSchema = z
977
- .object({
978
- action: z.literal("create_version"),
979
- version: z.object({
980
- version: z.string().describe("Version tag (e.g. 'v2')."),
981
- description: z.string().nullable(),
982
- createdAt: z.number(),
983
- }).strict(),
984
- })
985
- .strict();
986
- const BuildGraphResultSchema = z
987
- .object({
988
- action: z.literal("build_graph"),
989
- async_mode: z.boolean().optional().describe("True when graph is building asynchronously (background task). When true, call query_task_status with task_id to retrieve the result."),
990
- task_id: z.string().optional().describe("Async task id — present only when async_mode=true. Use with query_task_status."),
991
- nodeCount: z.number().optional().describe("Total nodes in the constructed graph (sync mode only)."),
992
- edgeCount: z.number().optional().describe("Total edges (after conflict resolution + dedup) (sync mode only)."),
993
- edgesBySource: z.record(z.string(), z.number()).optional().describe("Edge counts by source: { internal: N, registrar: N, potential: N } (sync mode only)."),
994
- reputationCount: z.number().optional().describe("Number of objects with Registrar reputation data (sync mode only)."),
995
- builtAt: z.number().optional().describe("Build timestamp in ms (sync mode only)."),
996
- binding_verification: z
997
- .object({
998
- service: z.string().describe("Service object address that was verified."),
999
- bindings: z
1000
- .record(z.string(), z.object({
1001
- expected: z.string().describe("Expected target object type."),
1002
- actual: z.string().nullable().describe("Actual on-chain value (address or null)."),
1003
- count: z.number().optional().describe("Item count for array fields (order_allocators, arbitrations)."),
1004
- verified: z.boolean().describe("Whether the binding exists on-chain."),
1005
- }))
1006
- .describe("Per-field binding verification result."),
1007
- all_verified: z.boolean().describe("True when all critical bindings exist on-chain."),
1008
- })
1009
- .nullable()
1010
- .optional()
1011
- .describe("On-chain verification of Service bindings (F-15). Null when no Service address or query failed. Sync mode only."),
1012
- topEdges: z.array(z.object({
1013
- source: z.string().describe("Source object address."),
1014
- target: z.string().describe("Target object address."),
1015
- fieldName: z.string().nullable().describe("Field name on the source object (or null)."),
1016
- relationshipType: z.string().describe("Relationship type (bind, create, trigger, etc.)."),
1017
- weight: z.number().nullable().describe("Edge weight (0-1, higher = more important)."),
1018
- verified: z.boolean().describe("Whether the edge has been verified on-chain."),
1019
- }).strict()).optional().describe("Top 5 critical edges by weight (sync mode only). Preview of the most important relationships — call get_graph for the full list."),
1020
- visualization: z.string().optional().describe("Mermaid-style ASCII visualization of top edges (sync mode only). Compact format: 'source --field--> target'."),
1021
- hint: z.string().optional().describe("User-facing hint — guides to next action (e.g. call get_graph for full list, or query_task_status for async result)."),
1022
- })
1023
- .strict();
1024
- const GetGraphResultSchema = z
1025
- .object({
1026
- action: z.literal("get_graph"),
1027
- edges: z.array(z.object({
1028
- sourceObject: z.string(),
1029
- targetObject: z.string(),
1030
- edgeSource: z.enum(["internal", "registrar", "potential"]),
1031
- relationshipType: z.string(),
1032
- fieldName: z.string().nullable(),
1033
- depth: z.number(),
1034
- verified: z.boolean(),
1035
- weight: z.number(),
1036
- direction: z.string().nullable(),
1037
- }).strict()).describe("Persisted graph edges."),
1038
- })
1039
- .strict();
1040
- const EvaluateProjectResultSchema = z
1041
- .object({
1042
- action: z.literal("evaluate_project"),
1043
- evaluationType: z.enum(["risk", "trust", "completeness", "value", "worth_buying"]),
1044
- score: z.number().describe("Overall score (0-100, higher = better). 0 when needsLlm=true."),
1045
- summary: z.string(),
1046
- criterionScores: z.array(z.object({
1047
- name: z.string(), score: z.number(), weight: z.number(), rationale: z.string(),
1048
- }).strict()).describe("Per-criterion scores. Empty when needsLlm=true."),
1049
- findings: z.array(z.object({
1050
- criterion: z.string(),
1051
- severity: z.enum(["critical", "warning", "info"]),
1052
- message: z.string(),
1053
- deduction: z.number(),
1054
- }).strict()).describe("Negative findings (deductions). Empty when needsLlm=true."),
1055
- strengths: z.array(z.string()).describe("Positive evidence. Empty when needsLlm=true."),
1056
- needsLlm: z.boolean().describe("True for worth_buying/value evaluations. When true, process the llmPrompt with an LLM and call save_evaluation to store the result."),
1057
- llmPrompt: z.string().optional().describe("Present when needsLlm=true. Send this prompt to an LLM, parse the JSON response, and call save_evaluation."),
1058
- evaluationId: z.string().describe("ID of the stored evaluation record (for rule-based types). Empty for LLM-assisted types."),
1059
- })
1060
- .strict();
1061
- const SaveEvaluationResultSchema = z
1062
- .object({
1063
- action: z.literal("save_evaluation"),
1064
- evaluation: z.object({
1065
- id: z.string(),
1066
- evalType: z.enum(["risk", "trust", "completeness", "value", "worth_buying"]),
1067
- score: z.number().nullable(),
1068
- summary: z.string().nullable(),
1069
- evaluatedAt: z.number(),
1070
- }).strict().describe("The stored evaluation record."),
1071
- })
1072
- .strict();
1073
- const CompareProjectsResultSchema = z
1074
- .object({
1075
- action: z.literal("compare_projects"),
1076
- evaluationType: z.enum(["risk", "trust", "completeness", "value", "worth_buying"]),
1077
- ranking: z.array(z.object({
1078
- projectId: z.string(),
1079
- projectName: z.string(),
1080
- score: z.number().nullable(),
1081
- summary: z.string().nullable(),
1082
- evaluatedAt: z.number().nullable(),
1083
- }).strict()).describe("Projects sorted by score descending (nulls last)."),
1084
- bestProjectId: z.string().nullable().describe("Project ID with the highest score, or null if none have evaluations."),
1085
- })
1086
- .strict();
1087
- const RefreshObjectsResultSchema = z
1088
- .object({
1089
- action: z.literal("refresh_objects"),
1090
- refreshedCount: z.number().describe("Number of objects re-fetched from chain."),
1091
- failedCount: z.number().describe("Number of objects that failed to refresh."),
1092
- refreshedAt: z.number().describe("Refresh timestamp (ms)."),
1093
- })
1094
- .strict();
1095
- const DeleteProjectResultSchema = z
1096
- .object({
1097
- action: z.literal("delete_project"),
1098
- deleted: z.literal(true).describe("Always true — confirms deletion of the project and all associated objects, evaluations, versions, and graph edges."),
1099
- })
1100
- .strict();
1101
- const GetObjectDiffResultSchema = z
1102
- .object({
1103
- action: z.literal("get_object_diff"),
1104
- address: z.string(),
1105
- fromTime: z.number(),
1106
- toTime: z.number(),
1107
- changedFields: z.array(z.object({
1108
- fieldPath: z.string().describe("Dotted field path (e.g. 'machine', 'sales[0].price')."),
1109
- oldValue: z.unknown().describe("Previous value (null if field was added)."),
1110
- newValue: z.unknown().describe("New value (null if field was removed)."),
1111
- changeType: z.enum(["added", "removed", "modified"]),
1112
- }).strict()).describe("Changed fields between the two timestamps."),
1113
- })
1114
- .strict();
1115
- const GenerateDeploymentDocResultSchema = z
1116
- .object({
1117
- action: z.literal("generate_deployment_doc"),
1118
- markdown: z.string().describe("Generated deployment document markdown content (follows 71-deployment-list-spec)."),
1119
- validation: z.object({
1120
- valid: z.boolean().describe("True iff no D-check FAIL."),
1121
- checks: z.array(z.object({
1122
- check_id: z.string(),
1123
- description: z.string(),
1124
- status: z.enum(["PASS", "FAIL", "WARN"]),
1125
- notes: z.string().optional(),
1126
- }).strict()).describe("D-01..D-20 check results (20 deployment checks including D-19 Machine entry-node forward and D-20 Service compensation_fund)."),
1127
- errors: z.array(z.string()).describe("List of FAIL error messages."),
1128
- }).strict().describe("Deployment doc validation result against D-01..D-20."),
1129
- saved: z.boolean().describe("Whether the markdown was persisted to SQLite project_documents table."),
1130
- detail_level: z.enum(["summary", "detailed", "full"]).describe("Effective detail level used to render the deployment doc. " +
1131
- "'summary' (default) shows only key bindings; 'detailed' adds sale/arbitration lists; 'full' shows complete config."),
1132
- stage_gate: z.object({
1133
- stage: z.number().describe("The stage that was validated (4 = deployment doc generation gate)."),
1134
- passed: z.boolean().describe("True iff no FAIL checks exist — gate allows advancing to Stage 5."),
1135
- can_proceed: z.boolean().describe("Alias for `passed` — whether the stage gate allows advancement."),
1136
- blocking_issues: z.array(z.string()).describe("FAIL status messages — must be resolved before deploying."),
1137
- warnings: z.array(z.string()).describe("WARN status messages — non-blocking, user may proceed at own risk."),
1138
- checks: z.array(z.object({
1139
- dimension: z.enum(["semantic", "tools", "reversibility", "risk", "isolation", "gas_budget"]).describe("The validation dimension."),
1140
- status: z.enum(["PASS", "WARN", "FAIL"]).describe("Check result status."),
1141
- message: z.string().describe("Human-readable check result message."),
1142
- }).strict()).describe("Per-dimension check results."),
1143
- }).strict().describe("Stage gate validation (GLM6 5-stage lifecycle handoff). Validates Stage 3 risk score threshold (>=80 PASS, >=50 WARN, <50 FAIL) and Stage 4 deployment doc generation prerequisite."),
1144
- deployment_scan: z.object({
1145
- overall_readiness: z.enum(["ready", "blocked", "warnings"]).describe("'ready' = all 20 checks pass; 'blocked' = any critical fail; 'warnings' = only warning fails."),
1146
- critical_count: z.number().describe("Number of critical findings (blocks deployment)."),
1147
- warning_count: z.number().describe("Number of warning findings (non-blocking)."),
1148
- findings: z.array(z.object({
1149
- check_id: z.string().describe("D-XX check id (e.g. 'D-19') or sub-id (e.g. 'D-10a')."),
1150
- severity: z.enum(["critical", "warning", "info"]).describe("Finding severity."),
1151
- message: z.string().describe("Human-readable finding message."),
1152
- location: z.string().optional().describe("Document location (section, line, or step id)."),
1153
- suggestion: z.string().optional().describe("Suggested fix."),
1154
- }).strict()).describe("All findings from the 20 D-XX deployment checks."),
1155
- checks: z.object({
1156
- D01_object_defined: z.enum(["pass", "fail"]),
1157
- D02_dependency_complete: z.enum(["pass", "fail"]),
1158
- D03_scenario_covered: z.enum(["pass", "fail"]),
1159
- D04_testnet_topo_order: z.enum(["pass", "fail"]),
1160
- D05_testnet_network: z.enum(["pass", "fail"]),
1161
- D06_testnet_replace: z.enum(["pass", "fail"]),
1162
- D07_permission_index: z.enum(["pass", "fail"]),
1163
- D08_guard_gen_passport: z.enum(["pass", "fail"]),
1164
- D09_machine_node_count: z.enum(["pass", "fail"]),
1165
- D10_substep_coherence: z.enum(["pass", "fail"]),
1166
- D11_mainnet_testnet_match: z.enum(["pass", "fail"]),
1167
- D12_mainnet_network: z.enum(["pass", "fail"]),
1168
- D13_mainnet_replace: z.enum(["pass", "fail"]),
1169
- D14_testnet_verification: z.enum(["pass", "fail"]),
1170
- D15_mainnet_verification: z.enum(["pass", "fail"]),
1171
- D16_no_critical_risk: z.enum(["pass", "fail"]),
1172
- D17_no_high_risk: z.enum(["pass", "fail"]),
1173
- D18_completeness_checklist: z.enum(["pass", "fail"]),
1174
- D19_machine_entry_forward: z.enum(["pass", "fail"]).describe("Machine entry node (prev_node='') forwards non-empty — avoids Progress stuck at current=''."),
1175
- D20_service_compensation_fund: z.enum(["pass", "fail"]).describe("Service compensation_fund (Balance<T>) present or industry-exempt — ensures arbitration refund capability."),
1176
- }).strict().describe("Per-check pass/fail status for all 20 D-XX checks."),
1177
- }).strict().describe("Deployment scanner result — 20 D-XX checks including D-19 (Machine entry forward) and D-20 (Service compensation_fund)."),
1178
- })
1179
- .strict();
1180
- const PreEvaluateCheckResultSchema = z
1181
- .object({
1182
- action: z.literal("pre_evaluate_check"),
1183
- ready: z.boolean().describe("True if evaluate_project will produce meaningful results (no hard blockers). " +
1184
- "If false, address the items in `missing` first."),
1185
- missing: z.array(z.object({
1186
- id: z.string().describe("Check ID (e.g. PE-01, PE-06)."),
1187
- description: z.string().describe("What is missing."),
1188
- impact: z.string().describe("How it affects the evaluation, and how to fix it."),
1189
- }).strict()).describe("Hard blockers — must be resolved before evaluation."),
1190
- warnings: z.array(z.object({
1191
- id: z.string().describe("Check ID (e.g. PE-02, PE-03)."),
1192
- description: z.string().describe("What is suboptimal."),
1193
- impact: z.string().describe("How it affects the evaluation, and how to improve it."),
1194
- }).strict()).describe("Soft issues — evaluation runs but quality may be reduced."),
1195
- summary: z.string().describe("One-line human-readable status."),
1196
- counts: z.object({
1197
- objects: z.number().describe("Total project_objects count."),
1198
- edges: z.number().describe("Total graph_edges count."),
1199
- uncached: z.number().describe("Objects with no cached on-chain data."),
1200
- stale: z.number().describe("Objects with cache older than 24 hours."),
1201
- dangling_edges: z.number().describe("Edges referencing objects not in project_objects."),
1202
- drafts: z.number().describe("Objects still in draft (not yet on-chain)."),
1203
- }).strict().describe("Quick-scan counts for triage."),
1204
- })
1205
- .strict();
1206
- const VerifyDeploymentResultSchema = z
1207
- .object({
1208
- action: z.literal("verify_deployment"),
1209
- verifiedCount: z.number().describe("Number of objects actually verified (excludes drafts and unreachable)."),
1210
- matched: z.number().describe("Objects whose on-chain state matches SQLite."),
1211
- mismatched: z.number().describe("Objects whose on-chain state differs from SQLite (see `results[].differences`)."),
1212
- missing: z.number().describe("Objects that no longer exist on-chain (deleted or never deployed)."),
1213
- unreachable: z.number().describe("Objects that could not be queried (network error)."),
1214
- results: z.array(z.object({
1215
- objectAddress: z.string(),
1216
- objectName: z.string().nullable(),
1217
- objectType: z.string().nullable(),
1218
- status: z.enum(["matched", "mismatched", "missing", "unreachable"]).describe("Verification status: 'matched' = on-chain matches SQLite; " +
1219
- "'mismatched' = on-chain differs (see differences); " +
1220
- "'missing' = object no longer exists on-chain; " +
1221
- "'unreachable' = query failed (network error or rate limit)."),
1222
- differences: z.array(z.object({
1223
- field: z.string().describe("Field path that differs."),
1224
- sqlite: z.unknown().describe("Value recorded in SQLite."),
1225
- onchain: z.unknown().describe("Value observed on-chain."),
1226
- }).strict()).optional().describe("Per-field differences (only for status='mismatched')."),
1227
- bindings: z.object({
1228
- machine: z.boolean(),
1229
- permission: z.boolean(),
1230
- buy_guard: z.boolean(),
1231
- order_allocators: z.boolean(),
1232
- }).strict().optional().describe("Critical binding status (only for Service objects). " +
1233
- "Each boolean indicates whether the binding is set to a non-null value on-chain."),
1234
- error: z.string().optional().describe("Error message (only for status='unreachable')."),
1235
- }).strict()).describe("Per-object verification results."),
1236
- summary: z.string().describe("One-line human-readable summary."),
1237
- })
1238
- .strict();
1239
- const MachineGraphForwardSchema = z.object({
1240
- name: z.string().describe("Forward name."),
1241
- weight: z.number().describe("Forward weight (for weighted threshold)."),
1242
- guard: z.string().nullable().describe("Guard object address if the forward is guard-gated, else null."),
1243
- named_operator: z.string().nullable().describe("Named operator if set, else null."),
1244
- permission_index: z.number().nullable().describe("Permission index if set, else null."),
1245
- }).strict();
1246
- const MachineGraphEdgeSchema = z.object({
1247
- from: z.string().describe("Source node name (prev_node)."),
1248
- to: z.string().describe("Target node name (next_node)."),
1249
- threshold: z.number().describe("Minimum weighted forward count required to advance."),
1250
- forwards: z.array(MachineGraphForwardSchema).describe("Forwards within this pair — each is an advance operation."),
1251
- }).strict();
1252
- const MachineGraphNodeSchema = z.object({
1253
- name: z.string().describe("Node name."),
1254
- description: z.string().nullable().describe("Node description if set, else null."),
1255
- }).strict();
1256
- const GetMachineGraphResultSchema = z
1257
- .object({
1258
- action: z.literal("get_machine_graph"),
1259
- machineAddress: z.string().describe("The Machine object address."),
1260
- machineName: z.string().nullable().describe("The Machine's local name (from LocalMark) if available."),
1261
- nodes: z.array(MachineGraphNodeSchema).describe("Workflow nodes (states)."),
1262
- edges: z.array(MachineGraphEdgeSchema).describe("Directed edges (pairs) connecting nodes. Each edge has a threshold and forwards."),
1263
- published: z.boolean().nullable().describe("Whether the Machine is published (locked for production). null = unknown."),
1264
- paused: z.boolean().nullable().describe("Whether the Machine is paused (not generating new Progress). null = unknown."),
1265
- mermaid: z.string().describe("Mermaid stateDiagram-v2 string visualizing the directed graph. Entry nodes start from [*]. Edge labels include forward name + threshold + guard info. Cycles (revision loops) are rendered as normal edges. Includes a color legend comment block + BehaviorTree.CPP-style color annotations (entry=green, terminal=red, revision=amber, normal=blue). Renderable in markdown viewers."),
1266
- tree_outline: z.string().describe("Indented Markdown outline of the directed graph (human-editable format). Lists edges as outline entries with forwards nested under each edge. Includes a Backrefs section consolidating incoming edges per node (editing aid — answers 'who transitions INTO node X?'). Bidirectional with parseMachineTreeIndented(). Includes JSON code block for round-trip safety. Use this for the download -> edit -> republish workflow."),
1267
- ascii_art: z.string().describe("ASCII art directed graph visualization using arrow notation (A -forward-> B). Cycle (revision loop) and terminal annotations included. Terminal-friendly, avoids JSON escaping issues that affect multi-line Mermaid strings. Use when rendering in plain-text contexts."),
1268
- markmap: z.string().describe("Markmap-compatible Markdown string (heading levels represent hierarchy). Edge-centric layout with forwards nested under edges. Renderable by VS Code Markmap extension or markmap.js. Provides an interactive mind-map view of the workflow."),
1269
- })
1270
- .strict();
1271
- const GuardGraphNodeSchema = z.lazy(() => z.object({
1272
- type: z.string().describe("Guard node type (logic_and, query, identifier, context, calc_*, convert_*, vec_*, etc.)."),
1273
- nodes: z.array(GuardGraphNodeSchema).optional().describe("Child nodes (for logic_and/or, calc_*, vec_contains_*, etc.)."),
1274
- node: GuardGraphNodeSchema.optional().describe("Single child (for logic_not, convert_*, value_type)."),
1275
- nodeLeft: GuardGraphNodeSchema.optional().describe("Left child (for vec_indexof_*)."),
1276
- nodeRight: GuardGraphNodeSchema.optional().describe("Right child (for vec_indexof_*)."),
1277
- query: z.union([z.number(), z.string()]).optional().describe("Query instruction ID or name (for query nodes)."),
1278
- object: z.object({
1279
- identifier: z.number().optional(),
1280
- convert_witness: z.number().optional(),
1281
- }).optional().describe("Query target object reference."),
1282
- parameters: z.array(GuardGraphNodeSchema).optional().describe("Query parameters."),
1283
- identifier: z.number().optional().describe("Table entry index (for identifier nodes)."),
1284
- context: z.string().optional().describe("Context type: Signer, Clock, or Guard."),
1285
- }).strict());
1286
- const GuardTableEntrySchema = z.object({
1287
- identifier: z.number().describe("Table entry index (0-255)."),
1288
- b_submission: z.boolean().describe("Whether this entry is submitted at runtime."),
1289
- value_type: z.union([z.number(), z.string()]).describe("Value type (numeric code or name)."),
1290
- value: z.unknown().optional().describe("Constant value (if b_submission=false)."),
1291
- name: z.string().optional().describe("Human-readable name/description."),
1292
- }).strict();
1293
- const GetGuardGraphResultSchema = z
1294
- .object({
1295
- action: z.literal("get_guard_graph"),
1296
- guardAddress: z.string().describe("The Guard object address."),
1297
- guardName: z.string().nullable().describe("The Guard's local name (from LocalMark) if available."),
1298
- root: GuardGraphNodeSchema.describe("Root computation node (returns Bool). The tree is recursive — each node may have children."),
1299
- table: z.array(GuardTableEntrySchema).describe("Guard data table entries (constants + submission slots)."),
1300
- rely: z.object({
1301
- guards: z.array(z.string()),
1302
- logic_or: z.boolean().optional(),
1303
- }).nullable().describe("Rely dependencies (other Guards this Guard depends on). null = no rely."),
1304
- immutable: z.boolean().nullable().describe("Whether the Guard is immutable (frozen for verification). null = unknown."),
1305
- mermaid: z.string().describe("Mermaid flowchart TD string visualizing the tree. Node shapes: {}=decision (logic_*), []=computation/query, ([])=leaf (identifier), {{}}=context. Includes a color legend comment block + BehaviorTree.CPP-style color annotations (control=blue, decision=amber, computation=purple, query=cyan, leaf=gray, context=green)."),
1306
- tree_outline: z.string().describe("Indented Markdown outline of the tree (human-editable format). Bidirectional with parseGuardTreeIndented(). Includes JSON code block for round-trip safety."),
1307
- ascii_art: z.string().describe("ASCII art tree visualization using box-drawing characters (+-- --, |). Table summary appended. Terminal-friendly, avoids JSON escaping issues that affect multi-line Mermaid strings."),
1308
- markmap: z.string().describe("Markmap-compatible Markdown string (heading levels represent tree depth). Root -> branches -> leaves hierarchy. Renderable by VS Code Markmap extension or markmap.js. Provides an interactive mind-map view of the Guard tree."),
1309
- })
1310
- .strict();
1311
- const PlanObjectEditResultSchema = z
1312
- .object({
1313
- action: z.literal("plan_object_edit"),
1314
- plan_id: z.string().describe("Unique plan ID (UUID). Pass to apply_object_edit within 10 minutes to execute."),
1315
- object_kind: z.enum(["machine", "guard"]).describe("The object kind that was edited."),
1316
- object_address: z.string().describe("The on-chain object address being edited."),
1317
- object_name: z.string().nullable().describe("The object's local name (from LocalMark) if available."),
1318
- expected_hash: z.string().describe("SHA-256 hash of (current_onchain_state + edited_content). Pass to apply_object_edit as expected_hash for stale-edit detection."),
1319
- diff: z.object({
1320
- added: z.array(z.string()).describe("List of added items (node names, edge 'from->to', table identifiers, etc.)."),
1321
- removed: z.array(z.string()).describe("List of removed items."),
1322
- modified: z.array(z.string()).describe("List of modified items with a brief description of the change."),
1323
- summary: z.string().describe("Human-readable one-line diff summary (e.g. '2 nodes added, 1 edge removed, 3 forwards modified')."),
1324
- }).describe("Structured diff between current on-chain state and edited content."),
1325
- warnings: z.array(z.object({
1326
- id: z.string().describe("Warning identifier (e.g. 'W-01')."),
1327
- description: z.string().describe("What the warning is about."),
1328
- impact: z.string().describe("Potential impact if ignored."),
1329
- })).describe("Non-blocking warnings (the edit can still proceed, but review is recommended)."),
1330
- blocking_errors: z.array(z.object({
1331
- id: z.string().describe("Error identifier (e.g. 'E-01')."),
1332
- description: z.string().describe("What the error is."),
1333
- impact: z.string().describe("Why this blocks execution."),
1334
- })).describe("Blocking errors (the edit CANNOT proceed until these are fixed)."),
1335
- can_apply: z.boolean().describe("Whether apply_object_edit can proceed. false if blocking_errors is non-empty."),
1336
- prepared_call: z.unknown().nullable().describe("The prepared onchain_operations call data (operation_type + data). null if can_apply=false. Pass this to onchain_operations to execute the edit."),
1337
- expires_at: z.string().describe("ISO timestamp when the plan expires (10 minutes from creation). After expiry, apply_object_edit will refuse to proceed."),
1338
- summary: z.string().describe("Human-readable one-line plan summary."),
1339
- })
1340
- .strict();
1341
- const ApplyObjectEditResultSchema = z
1342
- .object({
1343
- action: z.literal("apply_object_edit"),
1344
- plan_id: z.string().describe("The plan ID that was applied."),
1345
- applied: z.boolean().describe("Whether the plan was successfully applied (hash matched and plan was fresh)."),
1346
- hash_match: z.boolean().describe("Whether the expected_hash matched the stored plan hash. false = stale edit detected."),
1347
- prepared_call: z.unknown().nullable().describe("The prepared onchain_operations call data. Pass this to onchain_operations to execute the edit on-chain. null if applied=false."),
1348
- error: z.string().nullable().describe("Error message if applied=false (e.g. 'Plan not found', 'Hash mismatch — on-chain state changed', 'Plan expired'). null on success."),
1349
- next_step: z.string().describe("Instructions for the next step (typically 'Pass prepared_call to onchain_operations to execute the edit on-chain')."),
1350
- })
1351
- .strict();
1352
- const PatchMachineNodesResultSchema = z
1353
- .object({
1354
- action: z.literal("patch_machine_nodes"),
1355
- machine_address: z.string().describe("The Machine object address being patched."),
1356
- machine_name: z.string().nullable().describe("The Machine's local name (from LocalMark) if available."),
1357
- operations_applied: z.number().describe("Number of patch operations successfully applied."),
1358
- operations_failed: z.array(z.object({
1359
- operation: z.string().describe("The original operation string."),
1360
- error: z.string().describe("Why the operation failed."),
1361
- })).describe("Operations that failed parse/apply (not applied). Also surfaced as E-OP entries in blocking_errors for schema symmetry with plan_object_edit."),
1362
- patched_nodes: z.array(z.unknown()).describe("The patched Machine nodes (after applying all successful operations)."),
1363
- patched_edges: z.array(z.unknown()).describe("The patched Machine edges (after applying all successful operations)."),
1364
- diff: z.object({
1365
- added: z.array(z.string()).describe("List of added items."),
1366
- removed: z.array(z.string()).describe("List of removed items."),
1367
- modified: z.array(z.string()).describe("List of modified items."),
1368
- summary: z.string().describe("Human-readable one-line diff summary."),
1369
- }).describe("Diff between original and patched Machine."),
1370
- warnings: z.array(z.object({
1371
- id: z.string().describe("Warning identifier (e.g. 'W-01' unreachable node, 'W-02' self-loop)."),
1372
- description: z.string().describe("What the warning is about."),
1373
- impact: z.string().describe("Potential impact if ignored."),
1374
- })).describe("Non-blocking warnings from validateMachine (W-01 unreachable, W-02 self-loop)."),
1375
- blocking_errors: z.array(z.object({
1376
- id: z.string().describe("Error identifier (e.g. 'E-01' no entry forward, 'E-02' orphan endpoint, 'E-03' too many nodes, 'E-OP' operation failed)."),
1377
- description: z.string().describe("What the error is."),
1378
- impact: z.string().describe("Why this blocks execution."),
1379
- })).describe("Blocking errors (operation failures + structural validation). The patch CANNOT proceed until these are fixed. Empty array when can_apply=true."),
1380
- can_apply: z.boolean().describe("Whether the patch can be applied on-chain. false if any blocking_errors exist (operation failures or validateMachine blocking errors)."),
1381
- prepared_call: z.unknown().nullable().describe("The prepared onchain_operations call data. null if can_apply=false."),
1382
- summary: z.string().describe("Human-readable one-line patch summary."),
1383
- })
1384
- .strict();
1385
- const PatchGuardTreeResultSchema = z
1386
- .object({
1387
- action: z.literal("patch_guard_tree"),
1388
- guard_address: z.string().describe("The Guard object address being patched."),
1389
- guard_name: z.string().nullable().describe("The Guard's local name (from LocalMark) if available."),
1390
- operations_applied: z.number().describe("Number of Guard patch operations successfully applied."),
1391
- operations_failed: z.array(z.object({
1392
- operation: z.string().describe("The original operation string."),
1393
- error: z.string().describe("Why the operation failed."),
1394
- })).describe("Operations that failed parse/apply (not applied). Also surfaced as E-OP entries in blocking_errors."),
1395
- patched_root: z.unknown().describe("The patched Guard root node (after applying all successful operations). For set_root, this is the new root; otherwise the original root unchanged."),
1396
- patched_table: z.array(z.unknown()).describe("The patched Guard table entries (after applying all successful table operations)."),
1397
- patched_rely: z.unknown().nullable().describe("The patched rely field (cross-guard composition). null if rely was cleared or never set. Shape: { guards: string[], logic_or?: boolean }."),
1398
- diff: z.object({
1399
- added: z.array(z.string()).describe("List of added items (table entries, tree nodes)."),
1400
- removed: z.array(z.string()).describe("List of removed items."),
1401
- modified: z.array(z.string()).describe("List of modified items with a brief description of the change."),
1402
- summary: z.string().describe("Human-readable one-line diff summary."),
1403
- }).describe("Diff between original and patched Guard (root tree + table)."),
1404
- warnings: z.array(z.object({
1405
- id: z.string().describe("Warning identifier (e.g. 'W-01' dead submission slot, 'W-02' orphan table entry, 'W-03' deep nesting)."),
1406
- description: z.string().describe("What the warning is about."),
1407
- impact: z.string().describe("Potential impact if ignored."),
1408
- })).describe("Non-blocking warnings from validateGuard (W-01 dead submission slot, W-02 orphan table entry, W-03 deep nesting > 16)."),
1409
- blocking_errors: z.array(z.object({
1410
- id: z.string().describe("Error identifier (e.g. 'E-01' no root, 'E-02' identifier not in table, 'E-03' table too large, 'E-OP' operation failed)."),
1411
- description: z.string().describe("What the error is."),
1412
- impact: z.string().describe("Why this blocks execution."),
1413
- })).describe("Blocking errors (operation failures + structural validation). The patch CANNOT proceed until these are fixed. Empty array when can_apply=true."),
1414
- can_apply: z.boolean().describe("Whether the patch can be applied on-chain. false if any blocking_errors exist."),
1415
- prepared_call: z.unknown().nullable().describe("The prepared onchain_operations call data (operation_type='guard'). null if can_apply=false."),
1416
- summary: z.string().describe("Human-readable one-line patch summary."),
1417
- })
1418
- .strict();
1419
- const CloneProjectToNetworkResultSchema = z
1420
- .object({
1421
- action: z.literal("clone_project_to_network"),
1422
- new_project_id: z.string().describe("The newly created project's UUID."),
1423
- new_prefix: z.string().describe("New project prefix ('<source_prefix>_<target_network>')."),
1424
- target_network: z.enum(["testnet", "mainnet"]).describe("The target network the new project is bound to."),
1425
- cloned_objects_count: z.number().describe("Number of object metadata entries copied (objectAddress is empty — await on-chain deployment)."),
1426
- message: z.string().describe("Human-readable summary of the clone operation."),
1427
- next_steps: z.string().describe("Instructions for deploying the cloned objects on the target network."),
1428
- })
1429
- .strict();
1430
- const MigrateNetworkResultSchema = z
1431
- .object({
1432
- action: z.literal("migrate_network"),
1433
- new_project_id: z.string().describe("The newly created project's UUID."),
1434
- new_prefix: z.string().describe("New project prefix ('<source_prefix>_<target_network>')."),
1435
- target_network: z.enum(["testnet", "mainnet"]).describe("The target network the new project is bound to."),
1436
- cloned_objects_count: z.number().describe("Number of object metadata entries copied (objectAddress is empty — await on-chain deployment)."),
1437
- message: z.string().describe("Human-readable summary of the migration operation."),
1438
- next_steps: z.string().describe("Instructions for deploying the migrated objects on the target network."),
1439
- })
1440
- .strict();
1441
- const MigrationPlanStepSchema = z.object({
1442
- step: z.number().describe("Step number (1-5)."),
1443
- status: z.enum(["completed", "pending_user_action"]).describe("Whether this step is done or awaits user action."),
1444
- action: z.string().describe("The action to perform (e.g. 'clone_project_to_network', 'onchain_operations', 'local_mark_operation', 'update_project', 'build_graph')."),
1445
- description: z.string().describe("Human-readable description of what this step does."),
1446
- result: z.string().optional().describe("Result of this step (only present when status='completed')."),
1447
- deployment_plan: z.array(z.object({
1448
- order: z.number(),
1449
- object_type: z.string(),
1450
- object_name: z.string(),
1451
- operation_type: z.string(),
1452
- localmark_name: z.string(),
1453
- note: z.string(),
1454
- })).optional().describe("Deployment plan for step 2 (on-chain deployment). Only present for step 2."),
1455
- names_to_register: z.array(z.string()).optional().describe("LocalMark names to re-register on mainnet. Only present for step 3."),
1456
- critical_note: z.string().optional().describe("Critical note for this step."),
1457
- }).strict();
1458
- const MigrateToMainnetResultSchema = z
1459
- .object({
1460
- action: z.literal("migrate_to_mainnet"),
1461
- migration_status: z.string().describe("Overall migration status (e.g. 'step_1_complete_steps_2_5_pending_user_action')."),
1462
- source_project: z.object({
1463
- prefix: z.string(),
1464
- network: z.string(),
1465
- preserved: z.boolean().describe("Whether the source project is preserved unchanged (always true)."),
1466
- }).strict(),
1467
- target_project: z.object({
1468
- prefix: z.string(),
1469
- project_id: z.string(),
1470
- network: z.string(),
1471
- cloned_objects_count: z.number(),
1472
- }).strict(),
1473
- key_principle: z.string().describe("Explains that testnet/mainnet are different projects with different addresses for same names."),
1474
- payment_token_decision: z.object({
1475
- round: z.string().describe("Decision round identifier (e.g. 'M1')."),
1476
- question: z.string().describe("Question asking whether to keep WOW or switch to a stablecoin when migrating testnet → mainnet."),
1477
- options: z.array(z.string()).describe("Available choices (e.g. Keep WOW / Switch to USDT / Switch to USDC / Other stablecoin)."),
1478
- default: z.string().optional().describe("Recommended default choice (Keep WOW)."),
1479
- note: z.string().optional().describe("Guidance: mainnet stablecoins are available via the ETH mainnet cross-chain bridge; if switching, update Service/Treasury/Allocation type_parameter before publishing."),
1480
- }).strict().describe("Payment-token migration decision. testnet recommends WOW; mainnet supports USDT and other stablecoins via the ETH mainnet bridge. Must be resolved BEFORE step 2 (on-chain deployment) because the Service/Treasury/Allocation type_parameter determines the payment token."),
1481
- migration_plan: z.array(MigrationPlanStepSchema).describe("5-step migration plan. Step 1 is completed; steps 2-5 require user action."),
1482
- summary: z.string().describe("Human-readable summary of the migration."),
1483
- })
1484
- .strict();
1485
- const RecommendIndustryResultSchema = z
1486
- .object({
1487
- action: z.literal("recommend_industry"),
1488
- intent: z.string().describe("The intent text used for inference."),
1489
- inferred_traits: z.record(z.unknown()).describe("10-dim industry traits inferred from intent."),
1490
- inference_confidence: z.number().describe("Inference confidence 0-1 (matched trait count / 10)."),
1491
- matched_keywords: z.array(z.string()).describe("Keywords that triggered trait inference."),
1492
- recommendations: z.array(RecommendedIndustryItemSchema).describe("Top-3 similar industries + reference examples."),
1493
- hint: z.string().describe("How to apply the recommendation (create_project with project_industry)."),
1494
- })
1495
- .strict();
1496
- const ModeSummarySchema = z.object({
1497
- name: z.string(),
1498
- display_name: z.string(),
1499
- version: z.string(),
1500
- derived_from: z.string().nullable().describe("Source builtin mode (derive_user_mode) or null."),
1501
- owner: z.string().optional().describe("Mode owner (custom modes only)."),
1502
- key_risk: z.string(),
1503
- machine_nodes: z.array(z.string()).describe("Machine shape node names."),
1504
- similar_industries: z.array(z.string()).optional(),
1505
- evolution_history: z.array(z.object({
1506
- version: z.string(),
1507
- changed_at: z.number(),
1508
- changes: z.array(z.string()),
1509
- }).strict()).optional(),
1510
- }).strict();
1511
- const ListModesResultSchema = z
1512
- .object({
1513
- action: z.literal("list_modes"),
1514
- builtin_modes: z.array(ModeSummarySchema).describe("Builtin industry modes (use name as project_industry)."),
1515
- user_modes: z.array(ModeSummarySchema).describe("Caller's custom modes (derive/evolve/register)."),
1516
- owner: z.string().describe("Owner key for custom modes (local single-user)."),
1517
- hint: z.string(),
1518
- })
1519
- .strict();
1520
- const DeriveUserModeResultSchema = z
1521
- .object({
1522
- action: z.literal("derive_user_mode"),
1523
- mode: ModeSummarySchema.describe("The derived (and registered) custom mode."),
1524
- hint: z.string(),
1525
- })
1526
- .strict();
1527
- const EvolveUserModeResultSchema = z
1528
- .object({
1529
- action: z.literal("evolve_user_mode"),
1530
- mode: ModeSummarySchema.describe("The evolved custom mode (version bumped)."),
1531
- hint: z.string(),
1532
- })
1533
- .strict();
1534
- const RegisterUserModeResultSchema = z
1535
- .object({
1536
- action: z.literal("register_user_mode"),
1537
- mode: ModeSummarySchema.describe("The registered fully-custom mode."),
1538
- hint: z.string(),
1539
- })
1540
- .strict();
1541
- const UnregisterUserModeResultSchema = z
1542
- .object({
1543
- action: z.literal("unregister_user_mode"),
1544
- removed: z.literal(true),
1545
- mode_name: z.string(),
1546
- })
1547
- .strict();
1548
- const MetricInfoSchema = z.object({
1549
- metric_id: z.string(),
1550
- display_name: z.string(),
1551
- description: z.string(),
1552
- type: z.enum(["risk", "benefit"]),
1553
- scale: z.enum(["level", "numeric", "percentage"]),
1554
- weight: z.number(),
1555
- scope: z.enum(["builtin", "custom"]),
1556
- owner: z.string().optional(),
1557
- }).strict();
1558
- const RegisterCustomMetricResultSchema = z
1559
- .object({
1560
- action: z.literal("register_custom_metric"),
1561
- metric: MetricInfoSchema.describe("The registered custom metric (globally effective)."),
1562
- hint: z.string(),
1563
- })
1564
- .strict();
1565
- const ConstraintInfoSchema = z.object({
1566
- constraint_id: z.string(),
1567
- display_name: z.string(),
1568
- description: z.string(),
1569
- rule: z.record(z.unknown()).describe("Constraint rule (4 types — see constraint_rule input)."),
1570
- severity: z.enum(["hard", "soft"]),
1571
- on_violation: z.enum(["block", "warn", "log"]),
1572
- scope: z.enum(["builtin", "custom"]),
1573
- owner: z.string().optional(),
1574
- }).strict();
1575
- const RegisterCustomConstraintResultSchema = z
1576
- .object({
1577
- action: z.literal("register_custom_constraint"),
1578
- constraint: ConstraintInfoSchema.describe("The registered custom constraint."),
1579
- hint: z.string(),
1580
- })
1581
- .strict();
1582
- const ListMetricsConstraintsResultSchema = z
1583
- .object({
1584
- action: z.literal("list_metrics_constraints"),
1585
- metrics: z.array(MetricInfoSchema),
1586
- constraints: z.array(ConstraintInfoSchema),
1587
- hint: z.string(),
1588
- })
1589
- .strict();
1590
- const KeywordMatchSchema = z
1591
- .object({
1592
- keyword: z.string(),
1593
- category: z.string(),
1594
- matched_objects: z.array(z.string()),
1595
- required_level: z.enum(["R", "C", "OPTIONAL"]),
1596
- match_count: z.number(),
1597
- })
1598
- .strict();
1599
- const AnalyzeIntentResultSchema = z
1600
- .object({
1601
- action: z.literal("analyze_intent"),
1602
- intent_parsed: z
1603
- .object({
1604
- primary_object: z.string().describe("Primary object inferred from the intent keywords."),
1605
- secondary_objects: z.array(z.string()).describe("Supporting objects typically required alongside the primary one."),
1606
- detected_scenes: z
1607
- .array(z
1608
- .object({
1609
- object: z.string(),
1610
- scene_id: z.string().describe("Free-form scene id, e.g. 'retail', 'rental_return'."),
1611
- })
1612
- .strict())
1613
- .describe("Scenes detected from the intent (used for template selection)."),
1614
- industry: z.string().describe("Industry mode resolved from the intent (defaults to 'general')."),
1615
- keyword_matches: z.array(KeywordMatchSchema).describe("All keyword matches that drove the identification."),
1616
- })
1617
- .strict(),
1618
- puzzles: z
1619
- .record(z
1620
- .object({
1621
- puzzle: z.unknown(),
1622
- completeness: z.unknown(),
1623
- missing_dimensions: z.array(z.string()),
1624
- })
1625
- .strict())
1626
- .describe("Per-object puzzle snapshot, keyed by object_type. Pass this UNCHANGED to aggregate_risks."),
1627
- overall_completeness: z.enum(["complete", "partial", "empty"]),
1628
- next_step: z.string().describe("Human-readable suggestion for the next puzzle step."),
1629
- recommended_creation_order: z.array(z.string()).describe("Recommended object creation order (dependency topology)."),
1630
- warnings: z.array(z.string()),
1631
- })
1632
- .strict();
1633
- const AggregatedRiskSchema = z
1634
- .object({
1635
- risk_rule_id: z.string().describe("Unified risk rule id, e.g. 'R-S-01'."),
1636
- object_type: z.string(),
1637
- entry_id: z.string().describe("Object entry_id ('*' when cross-object)."),
1638
- severity: z.enum(["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"]),
1639
- message: z.string(),
1640
- fix_suggestion: z.string(),
1641
- details: z
1642
- .object({
1643
- field_path: z.string().optional(),
1644
- actual_value: z.unknown().optional(),
1645
- expected_value: z.unknown().optional(),
1646
- rule_source: z.string().optional(),
1647
- })
1648
- .strict()
1649
- .optional(),
1650
- })
1651
- .strict();
1652
- const SafetyFindingSchema = z
1653
- .object({
1654
- rule_id: z.string().describe("Safety rule id (e.g. 'REUSE-SERVICE-01', 'IMMUT-001')."),
1655
- severity: z.enum(["info", "warn"]),
1656
- message: z.string(),
1657
- })
1658
- .strict();
1659
- const AggregateRisksResultSchema = z
1660
- .object({
1661
- action: z.literal("aggregate_risks"),
1662
- namespace: z
1663
- .object({
1664
- prefix: z.string(),
1665
- version: z.string(),
1666
- industry: z.string().optional(),
1667
- })
1668
- .strict(),
1669
- findings: z.array(AggregatedRiskSchema).describe("All risks found, sorted (CRITICAL first)."),
1670
- severity_summary: z.record(z.number()).describe("Counts keyed by severity."),
1671
- status: z
1672
- .enum(["RISK_PASSED", "RISK_BLOCKED", "RISK_PENDING_CONFIRM", "RISK_CANCELLED"])
1673
- .describe("Aggregated status (62-spec §3.2). RISK_BLOCKED = CRITICAL or above-threshold risks present."),
1674
- pending_confirmations: z
1675
- .array(z
1676
- .object({
1677
- risk_rule_id: z.string(),
1678
- description: z.string(),
1679
- fix_suggestion: z.string(),
1680
- object_type: z.string(),
1681
- entry_id: z.string(),
1682
- })
1683
- .strict())
1684
- .optional()
1685
- .describe("HIGH risks awaiting user confirmation (only when status='RISK_PENDING_CONFIRM')."),
1686
- calibrated_at: z.number().describe("Calibration timestamp (ms)."),
1687
- fix_suggestions_grouped: z
1688
- .record(z.array(z
1689
- .object({
1690
- risk_rule_id: z.string(),
1691
- severity: z.enum(["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"]),
1692
- message: z.string(),
1693
- fix_suggestion: z.string(),
1694
- entry_id: z.string(),
1695
- })
1696
- .strict()))
1697
- .optional()
1698
- .describe("Fix suggestions grouped by object_type."),
1699
- safety_findings: z
1700
- .array(SafetyFindingSchema)
1701
- .optional()
1702
- .describe("OBJECT_REUSE / IMMUTABILITY findings from safety-rules (only when planned_objects / planned_operations were provided)."),
1703
- intent_echo: z
1704
- .object({
1705
- primary_object: z.string(),
1706
- industry: z.string(),
1707
- overall_completeness: z.enum(["complete", "partial", "empty"]),
1708
- })
1709
- .strict()
1710
- .optional()
1711
- .describe("Echo of the auto-run analyze_intent (only when 'puzzles' was omitted and 'intent' was used)."),
1712
- warnings: z.array(z.string()),
1713
- })
1714
- .strict();
1715
- const TraceSubstepsResultSchema = z
1716
- .object({
1717
- action: z.literal("trace_substeps"),
1718
- namespace: z.object({ prefix: z.string(), version: z.string() }).strict(),
1719
- network: z.enum(["testnet", "mainnet"]),
1720
- coherent: z.boolean().describe("True when no dangling inputs, no cycles, no missing outputs, no cross-step breaks."),
1721
- dangling_inputs: z
1722
- .array(z.object({ substep_id: z.string(), missing_ref: z.string(), field_path: z.string() }).strict())
1723
- .describe("Input refs pointing to non-existent substeps."),
1724
- circular_refs: z
1725
- .array(z.object({ cycle: z.array(z.string()) }).strict())
1726
- .describe("Substep id cycles (when present, topological_order is empty)."),
1727
- missing_outputs: z
1728
- .array(z
1729
- .object({
1730
- substep_id: z.string(),
1731
- expected_field: z.string(),
1732
- dependent_substeps: z.array(z.string()),
1733
- })
1734
- .strict())
1735
- .describe("Substeps that should have produced a field but did not."),
1736
- cross_step_breaks: z
1737
- .array(z
1738
- .object({
1739
- source_step: z.string(),
1740
- target_step: z.string(),
1741
- missing_field: z.string(),
1742
- })
1743
- .strict())
1744
- .describe("Upstream step failed → downstream cannot proceed."),
1745
- step_details: z
1746
- .array(z
1747
- .object({
1748
- parent_step: z.string(),
1749
- total_substeps: z.number(),
1750
- successful: z.number(),
1751
- failed: z.number(),
1752
- pending: z.number(),
1753
- skipped: z.number(),
1754
- substep_ids: z.array(z.string()),
1755
- })
1756
- .strict())
1757
- .describe("Per-step summary, keyed by parent_step."),
1758
- topological_order: z.array(z.string()).describe("Topological order of substep ids (empty when a cycle exists)."),
1759
- d10_check: z
1760
- .object({
1761
- check_id: z.literal("D-10"),
1762
- description: z.string(),
1763
- status: z.enum(["PASS", "FAIL", "WARN"]),
1764
- notes: z.array(z.string()),
1765
- })
1766
- .strict()
1767
- .describe("D-10 substep linkage completeness verdict."),
1768
- })
1769
- .strict();
1770
- const MerchantGuideResultSchema = z
1771
- .object({
1772
- action: z.literal("merchant_guide"),
1773
- current_step: z.number().describe("Furthest wizard step reached (2 = awaiting industry confirmation; 9 = harness issues found; 10 = plan ready)."),
1774
- step_name: z.string(),
1775
- guide_state: z
1776
- .object({
1777
- intent_text: z.string(),
1778
- confirmed_industry: z.string().optional(),
1779
- currency: z.string().optional(),
1780
- deliverables: z.array(z.unknown()).optional(),
1781
- payment_override: z.record(z.unknown()).optional(),
1782
- trust_override: z.record(z.unknown()).optional(),
1783
- adopted_module_ids: z.array(z.string()).optional(),
1784
- })
1785
- .strict()
1786
- .describe("Wizard state — pass back UNCHANGED on the next merchant_guide call."),
1787
- intent_draft: z.unknown().optional().describe("Step 1-2 only: BusinessIntent draft inferred from the description."),
1788
- industry_options: z
1789
- .object({
1790
- inferred: z.string(),
1791
- confidence: z.number(),
1792
- similar: z.array(z.string()),
1793
- })
1794
- .strict()
1795
- .optional()
1796
- .describe("Step 2 only: industry candidates awaiting merchant confirmation."),
1797
- intent: z.unknown().optional().describe("Steps 7-10: final BusinessIntent after merchant overrides."),
1798
- adopted_modules: z
1799
- .array(z
1800
- .object({
1801
- id: z.string(),
1802
- name: z.string(),
1803
- description: z.string(),
1804
- requires_keeper: z.boolean(),
1805
- keeper_hint: z.string().optional(),
1806
- user_protections: z.array(z.string()),
1807
- merchant_obligations: z.array(z.string()),
1808
- })
1809
- .strict())
1810
- .optional()
1811
- .describe("Steps 6-10: adopted business modules with protections/obligations."),
1812
- blueprint: z
1813
- .object({
1814
- nodes: z.array(z.object({ id: z.string(), type: z.string(), purpose: z.string() }).strict()),
1815
- edges: z.array(z.object({ from: z.string(), to: z.string(), relation: z.string(), required: z.boolean() }).strict()),
1816
- })
1817
- .strict()
1818
- .optional()
1819
- .describe("Step 7: semantic object graph (nodes + edges)."),
1820
- evaluation_preview: z.unknown().optional().describe("Step 8: estimated risk/trust/completeness scores + key risks + module boosts."),
1821
- graph_validation: z
1822
- .object({
1823
- valid: z.boolean(),
1824
- hard_violations: z.array(z.object({ id: z.string(), description: z.string(), fix: z.string().optional() }).strict()),
1825
- soft_notes: z.array(z.object({ id: z.string(), description: z.string() }).strict()),
1826
- })
1827
- .strict()
1828
- .optional()
1829
- .describe("Step 8: structural validation of the semantic graph."),
1830
- harness_check: z
1831
- .object({
1832
- module_constraints: z.array(z.object({
1833
- module: z.string(),
1834
- plan_satisfied: z.boolean(),
1835
- missing: z.array(z.string()).optional(),
1836
- reason: z.string().optional(),
1837
- estimated_score_boost: z.number(),
1838
- }).strict()),
1839
- blocking_issues: z.array(z.object({
1840
- module: z.string(),
1841
- missing_constraints: z.array(z.string()).optional(),
1842
- fix: z.string().optional(),
1843
- }).strict()),
1844
- deploy_time_checks: z.array(z.string()),
1845
- })
1846
- .strict()
1847
- .optional()
1848
- .describe("Step 9: module constraint check at blueprint stage + deploy-time checklist."),
1849
- game_theory: z
1850
- .object({
1851
- summary: z.string(),
1852
- coverage: z.string().describe("Covered/total scenario count, e.g. '4/5'."),
1853
- exposed_scenarios: z.array(z.string()),
1854
- wow_alignments: z.array(z.string()).describe("Active WOW mechanisms aligning merchant/user incentives."),
1855
- scenarios: z.array(z.object({
1856
- scenario: z.string(),
1857
- covered: z.boolean(),
1858
- conflict: z.string(),
1859
- user_protection: z.string(),
1860
- evaluation_metric: z.string(),
1861
- recommendation: z.string().optional(),
1862
- }).strict()),
1863
- })
1864
- .strict()
1865
- .optional()
1866
- .describe("Step 9 (GLM6/93 §2.3): merchant-user adversarial scenario coverage. 5 canonical scenarios checked against the blueprint; exposed scenarios include fix recommendations."),
1867
- creation_plan: z
1868
- .array(z.object({
1869
- order: z.number(),
1870
- node_id: z.string(),
1871
- object_type: z.string(),
1872
- suggested_name: z.string(),
1873
- depends_on: z.array(z.string()),
1874
- operation_hint: z.string(),
1875
- }).strict())
1876
- .optional()
1877
- .describe("Step 10: topologically ordered creation plan. NOT executed — materialize via create_project + onchain_operations."),
1878
- warnings: z.array(z.string()),
1879
- next_action: z.string().describe("Human-readable guidance for the next call."),
1880
- })
1881
- .strict();
1882
- const RadarMonitorAlertSchema = z
1883
- .object({
1884
- id: z.string(),
1885
- category: z.enum([
1886
- "progress_stall", "compensation_drop", "compensation_insufficient",
1887
- "messenger_timeout", "user_action_required", "review_window",
1888
- "arb_window", "refund_received", "anomaly",
1889
- ]),
1890
- severity: z.enum(["info", "warning", "critical"]),
1891
- title: z.string(),
1892
- message: z.string(),
1893
- action: z.string().optional().describe("Suggested next step."),
1894
- timestamp: z.number(),
1895
- order_id: z.string().optional(),
1896
- service_id: z.string().optional(),
1897
- node: z.string().optional(),
1898
- metric: z
1899
- .object({
1900
- label: z.string(),
1901
- value: z.number(),
1902
- threshold: z.number().optional(),
1903
- unit: z.string().optional(),
1904
- })
1905
- .strict()
1906
- .optional(),
1907
- })
1908
- .strict();
1909
- const RadarForwardSchema = z
1910
- .object({
1911
- name: z.string().describe("Forward (operation) name."),
1912
- to_node: z.string().describe("Target node after execution."),
1913
- execution_path: z
1914
- .enum(["order_holder", "permission", "named_operator", "not_available"])
1915
- .describe("How this account may execute it (not_available if it can't)."),
1916
- permission_index: z.number().optional().describe("Permission index required (if permission-gated)."),
1917
- named_operator: z.string().optional().describe("Named operator (LocalMark name) required (if named-gated)."),
1918
- guard: z.string().optional().describe("Guard address gating this forward."),
1919
- semantics: z.string().describe("Human explanation of what executing this forward means."),
1920
- consequence: z.string().optional().describe("Consequence hint (completion fund-release / refund path)."),
1921
- })
1922
- .strict();
1923
- const RadarPendingClaimSchema = z
1924
- .object({
1925
- kind: z.enum(["reward", "discount", "compensation", "rating"]),
1926
- label: z.string(),
1927
- how: z.string().describe("How to claim (tool + operation hint)."),
1928
- })
1929
- .strict();
1930
- const MerchantInterestAnalysisSchema = z
1931
- .object({
1932
- fund_flow: z
1933
- .array(z.string())
1934
- .describe("Where money sits and what releases it (escrow, Allocation waterfall, compensation_fund)."),
1935
- responsibility: z
1936
- .array(z.string())
1937
- .describe("What this account is semantically liable for right now (permission-gated forwards, guard obligations)."),
1938
- leverage: z
1939
- .array(z.string())
1940
- .describe("Actions serving the merchant's own interest (settlement speed, evidence pre-upload, Messenger nudge). Informational only."),
1941
- stakes: z
1942
- .array(z.string())
1943
- .describe("Downside exposure (arbitration indemnity, arb-loss record, stall statistics, refund aftermath)."),
1944
- summary: z.string().describe("One-paragraph merchant-interest summary."),
1945
- })
1946
- .strict();
1947
- const OrderRadarResultSchema = z
1948
- .object({
1949
- account: z.string(),
1950
- progress: z.string(),
1951
- order: z.string().optional(),
1952
- current_node: z.string().describe("Current node name ('' = entry, not yet started)."),
1953
- perspective: z
1954
- .enum(["customer", "operator", "observer"])
1955
- .describe("Derived from on-chain data (Order.builder + PermissionPerm grants), never caller-asserted."),
1956
- roles: z
1957
- .array(z.object({ label: z.string(), can_act_now: z.boolean() }).strict())
1958
- .describe("All roles this account holds on this order's workflow."),
1959
- operable: z.array(RadarForwardSchema).describe("Forwards THIS account can execute NOW (branch options if >1)."),
1960
- branch_choice: z
1961
- .object({
1962
- message: z.string(),
1963
- options: z.array(z.object({ forward: z.string(), to_node: z.string(), consequence: z.string().optional() }).strict()),
1964
- })
1965
- .strict()
1966
- .optional()
1967
- .describe("Present when >1 operable forward. AI MUST present options neutrally; the role decides."),
1968
- waiting_on: z
1969
- .array(z.object({ role: z.string(), forwards: z.array(z.string()) }).strict())
1970
- .describe("What the workflow is waiting on from OTHER roles."),
1971
- pending_claims: z.array(RadarPendingClaimSchema).describe("Unclaimed benefits / post-purchase actions."),
1972
- interest_hints: z
1973
- .array(z.string())
1974
- .describe("Perspective-specific own-interest hints (fund-release trigger, settlement cycle, reputation)."),
1975
- workflow_unknown: z.boolean().describe("True when Machine data was unavailable — operable/waiting_on unknown."),
1976
- interest_analysis: MerchantInterestAnalysisSchema.optional().describe("Merchant-side interest analysis (fund_flow/responsibility/leverage/stakes) — present ONLY when perspective='operator' " +
1977
- "and order data is available. AI MUST surface it as neutral information; the merchant decides."),
1978
- summary: z.string().describe("One-paragraph AI-ready summary."),
1979
- attached_alerts: z
1980
- .array(RadarMonitorAlertSchema)
1981
- .optional()
1982
- .describe("Order-monitor alerts (stall/compensation/review-window) when radar_include_alerts=true."),
1983
- })
1984
- .strict();
1985
- const ParticipationRadarResultSchema = z
1986
- .object({
1987
- action: z.literal("participation_radar"),
1988
- account: z.string().describe("Resolved account address."),
1989
- orders_analyzed: z.number(),
1990
- actionable: z
1991
- .array(OrderRadarResultSchema)
1992
- .describe("Orders where the account can act NOW or has pending claims (customer perspective first)."),
1993
- waiting: z.array(OrderRadarResultSchema).describe("Orders where the account is only waiting on other roles."),
1994
- all_pending_claims: z
1995
- .array(RadarPendingClaimSchema.extend({ progress: z.string() }))
1996
- .describe("All pending claims across orders, tagged with their Progress address."),
1997
- unread_messages_total: z.number().describe("Unread Messenger messages total across all conversations of the radar account (local encrypted storage, read-only — never marks messages viewed; 0 with a data_gaps note when the account is not a local messenger account)."),
1998
- data_gaps: z
1999
- .array(z.string())
2000
- .describe("Graceful degradation notes (e.g. 'Order 0x… not found', 'Machine nodes unavailable')."),
2001
- summary: z.string().describe("Account-level dashboard summary."),
2002
- })
2003
- .strict();
2004
- export const ProjectOperationOutputSchema = z
2005
- .object({
2006
- result: z.discriminatedUnion("action", [
2007
- ListProjectsResultSchema,
2008
- CreateProjectResultSchema,
2009
- CreateProjectFromOnchainResultSchema,
2010
- UpdateProjectResultSchema,
2011
- GetProjectDetailResultSchema,
2012
- AddObjectResultSchema,
2013
- RemoveObjectResultSchema,
2014
- UpdateObjectResultSchema,
2015
- CreateVersionResultSchema,
2016
- BuildGraphResultSchema,
2017
- GetGraphResultSchema,
2018
- EvaluateProjectResultSchema,
2019
- SaveEvaluationResultSchema,
2020
- CompareProjectsResultSchema,
2021
- RefreshObjectsResultSchema,
2022
- GetObjectDiffResultSchema,
2023
- DeleteProjectResultSchema,
2024
- AssembleContextResultSchema,
2025
- GenerateDeploymentDocResultSchema,
2026
- PreEvaluateCheckResultSchema,
2027
- VerifyDeploymentResultSchema,
2028
- GetMachineGraphResultSchema,
2029
- GetGuardGraphResultSchema,
2030
- PlanObjectEditResultSchema,
2031
- ApplyObjectEditResultSchema,
2032
- PatchMachineNodesResultSchema,
2033
- PatchGuardTreeResultSchema,
2034
- CloneProjectToNetworkResultSchema,
2035
- MigrateNetworkResultSchema,
2036
- MigrateToMainnetResultSchema,
2037
- RecommendIndustryResultSchema,
2038
- ListModesResultSchema,
2039
- DeriveUserModeResultSchema,
2040
- EvolveUserModeResultSchema,
2041
- RegisterUserModeResultSchema,
2042
- UnregisterUserModeResultSchema,
2043
- RegisterCustomMetricResultSchema,
2044
- RegisterCustomConstraintResultSchema,
2045
- ListMetricsConstraintsResultSchema,
2046
- AnalyzeIntentResultSchema,
2047
- AggregateRisksResultSchema,
2048
- TraceSubstepsResultSchema,
2049
- MerchantGuideResultSchema,
2050
- ParticipationRadarResultSchema,
2051
- ]).describe("Query result — shape depends on action"),
2052
- skills_recommended: z.string().optional().describe("Skills recommendation hint (F-10). Informational only — MCP executes " +
2053
- "independently of skills. Present when the action benefits from skills' " +
2054
- "business-semantic guidance (e.g. service/machine/guard/evaluation). " +
2055
- "Users without skills installed can ignore this field."),
2056
- })
2057
- .strict();
1
+ import{z}from'zod';const IndustryEnum=z['enum'](['general','retail','retail_d2c','service','rental','freelance','education','travel','subscription','custom']);export const ProjectObjectTypeEnum=z['enum'](['service','machine','guard','permission','reward','arb','progress','treasury','demand','repository','contact','order','allocation','personal','payment','proof']);export const EdgeKindEnum=z['enum'](['machine','order_allocators','arbitrations','compensation_fund','rewards','buy_guard','permission','guard','prev','next','forward','parent','service','progress','arbitration','sub_order','references']);export const ProjectOperationInputSchema=z['object']({'action':z['enum'](['list_projects','create_project','create_project_from_onchain','update_project','get_project_detail','add_object','remove_object','update_object','create_version','build_graph','get_graph','evaluate_project','save_evaluation','compare_projects','refresh_objects','get_object_diff','delete_project','assemble_context','get_machine_graph','get_guard_graph','generate_deployment_doc','pre_evaluate_check','verify_deployment','clone_project_to_network','migrate_network','migrate_to_mainnet','plan_object_edit','apply_object_edit','patch_machine_nodes','patch_guard_tree','recommend_industry','list_modes','derive_user_mode','evolve_user_mode','register_user_mode','unregister_user_mode','register_custom_metric','register_custom_constraint','list_metrics_constraints','analyze_intent','aggregate_risks','trace_substeps','merchant_guide','participation_radar'])['describe']('Action\x20to\x20perform.\x20Two\x20categories:\x0a'+'1.\x20Project\x20Entity\x20+\x20Evaluation\x20(15,\x20GLM6):\x20list_projects,\x20create_project,\x20create_project_from_onchain,\x20update_project,\x20get_project_detail,\x20add_object,\x20remove_object,\x20create_version,\x20build_graph,\x20get_graph,\x20evaluate_project,\x20save_evaluation,\x20compare_projects,\x20refresh_objects,\x20get_object_diff.\x20Projects\x20are\x20first-class\x20entities\x20with\x20SQLite\x20persistence,\x20rigid\x20project-object\x20relationships,\x20three-pathway\x20graph\x20construction,\x20and\x20a\x20dual\x20rule-based\x20+\x20LLM-assisted\x20evaluation\x20engine.\x0a'+'2.\x20Context\x20Assembly\x20(1):\x20assemble_context\x20(query\x20on-chain\x20object\x20states\x20+\x20extract\x20embedded\x20history\x20+\x20optional\x20events,\x20and\x20assemble\x20a\x20structured\x20semantic\x20context\x20for\x20LLM\x20consumption).\x20Required\x20input:\x20context_objects\x20(array\x20of\x20object\x20IDs/names).\x20Optional:\x20include_events\x20(query\x20recent\x20state-transition\x20events).\x0a'+'3.\x20Cross-Network\x20Migration\x20(FIX-012):\x20clone_project_to_network\x20(or\x20its\x20alias\x20migrate_network)\x20copies\x20a\x20source\x20project\x27s\x20object\x20metadata\x20to\x20a\x20new\x20project\x20bound\x20to\x20target_network.\x20The\x205-step\x20migration\x20workflow:\x201)\x20call\x20clone_project_to_network\x20(or\x20migrate_network)\x20with\x20target_network\x20to\x20copy\x20metadata,\x202)\x20re-run\x20onchain_operations\x20with\x20env.network=target_network\x20to\x20deploy\x20objects\x20on-chain,\x203)\x20re-register\x20LocalMark\x20names\x20with\x20the\x20SAME\x20names\x20on\x20the\x20target\x20network\x20(FIX-011\x20cross-network\x20consistency),\x204)\x20update_project\x20to\x20set\x20service_address\x20on\x20the\x20new\x20project,\x205)\x20build_graph\x20to\x20construct\x20the\x20new\x20project\x27s\x20relationship\x20graph.'),'project':z['string']()['optional']()['describe']('Project\x20prefix\x20(human-readable\x20unique\x20identifier).\x20'+'For\x20create_project:\x20OPTIONAL\x20—\x20if\x20omitted,\x20auto-derived\x20from\x20project_name\x20(e.g.\x20\x27Twitch\x20Service\x27\x20→\x20\x27twitch_service\x27).\x20'+'For\x20other\x20actions\x20(build_graph,\x20evaluate_project,\x20etc.):\x20used\x20to\x20identify\x20the\x20project.\x20'+'Takes\x20precedence\x20resolution:\x20project_id\x20>\x20project\x20(prefix).'),'version':z['string']()['regex'](/^v\d+$/)['optional']()['describe']('Project\x20version\x20(e.g.\x20\x27v1\x27).\x20Used\x20by\x20create_version.'),'context_objects':z['array'](z['string']())['optional']()['describe']('Object\x20IDs\x20(0x...)\x20or\x20LocalMark\x20names\x20to\x20assemble\x20context\x20for.\x20Required\x20when\x20action=\x27assemble_context\x27.\x20The\x20current\x20on-chain\x20state\x20of\x20each\x20object\x20will\x20be\x20queried\x20and\x20enriched\x20with\x20semantic\x20annotations.'),'include_events':z['boolean']()['optional']()['describe']('When\x20true,\x20assemble_context\x20also\x20queries\x20recent\x20state-transition\x20events\x20(NewOrderEvent,\x20ProgressEvent,\x20ArbEvent,\x20etc.).\x20Events\x20are\x20the\x20real-time\x20transition\x20log\x20—\x20convergent\x20and\x20bounded.\x20Defaults\x20to\x20false.\x20Note:\x20object-embedded\x20history\x20(ProgressSession.forwards,\x20Order.disputes)\x20is\x20ALWAYS\x20extracted\x20automatically\x20—\x20no\x20flag\x20needed.'),'context_network':z['enum'](['testnet','mainnet'])['optional']()['describe']('Network\x20for\x20assemble_context\x20queries.\x20Defaults\x20to\x20\x27testnet\x27\x20if\x20omitted.'),'context_depth':z['number']()['int']()['min'](0x0)['max'](0x5)['optional']()['describe']('BFS\x20recursion\x20depth\x20for\x20dependency\x20expansion\x20in\x20assemble_context\x20(default\x200\x20=\x20no\x20expansion).\x20'+'When\x20>0,\x20the\x20assembly\x20recursively\x20queries\x20objects\x20referenced\x20by\x20the\x20center\x20objects\x20'+'(permission,\x20guard,\x20machine,\x20service,\x20repositories,\x20etc.)\x20up\x20to\x20the\x20given\x20depth,\x20'+'using\x20the\x20same\x20address-field\x20extraction\x20rules\x20as\x20build_graph\x20(Pathway\x201).\x20'+'Each\x20level\x20issues\x20one\x20batched\x20query_objects\x20call\x20(≤50\x20IDs\x20per\x20batch).\x20'+'Cycles\x20are\x20detected\x20and\x20skipped\x20via\x20a\x20visited\x20set.\x20'+'Discovered\x20dependencies\x20are\x20returned\x20in\x20`dependencies`\x20(edge\x20metadata)\x20and\x20'+'`dependency_objects`\x20(full\x20object\x20states).\x20Recommended:\x201–2\x20for\x20most\x20use\x20cases;\x20'+'3+\x20may\x20pull\x20large\x20subgraphs\x20(use\x20context_include\x20to\x20constrain).'),'context_include':z['array'](z['string']())['optional']()['describe']('Optional\x20filter\x20for\x20dependency\x20expansion\x20edge\x20types.\x20When\x20omitted,\x20ALL\x20outbound\x20'+'references\x20are\x20followed.\x20When\x20provided,\x20only\x20edges\x20whose\x20`field`\x20matches\x20one\x20of\x20the\x20'+'listed\x20names\x20are\x20followed.\x20Recognized\x20field\x20names\x20(from\x20extractAddressFields):\x20'+'\x27permission\x27,\x20\x27machine\x27,\x20\x27service\x27,\x20\x27progress\x27,\x20\x27buy_guard\x27,\x20\x27um\x27,\x20\x27repositories\x27,\x20'+'\x27arbitrations\x27,\x20\x27rewards\x27,\x20\x27consensus_repositories\x27,\x20\x27context_repositories\x27,\x20'+'\x27dispute\x27,\x20\x27allocation\x27,\x20\x27external_deposit_guard\x27,\x20\x27external_withdraw_guard\x27,\x20'+'\x27allocator_guard\x27,\x20\x27for_object\x27,\x20\x27for_guard\x27,\x20\x27payment\x27,\x20\x27voting_guard\x27,\x20\x27usage_guard\x27,\x20'+'\x27guard\x27,\x20\x27write_guard\x27,\x20\x27quote_guard\x27,\x20\x27recipient_entity\x27,\x20\x27order_allocators\x27.\x20'+'Example:\x20[\x27permission\x27,\x27guard\x27]\x20expands\x20only\x20permission/guard\x20dependencies.'),'filter_status':z['enum'](['draft','active','inactive','archived'])['optional']()['describe']('Filter\x20list_projects\x20by\x20project\x20status.'),'filter_perspective':z['enum'](['producer','consumer','both'])['optional']()['describe']('Filter\x20list_projects\x20by\x20project\x20perspective.'),'filter_network':z['enum'](['testnet','mainnet'])['optional']()['describe']('Filter\x20list_projects\x20by\x20network.'),'project_name':z['string']()['min'](0x1)['max'](0xc8)['optional']()['describe']('Display\x20name\x20for\x20create_project\x20/\x20create_project_from_onchain\x20/\x20update_project.\x20Required\x20when\x20action=\x27create_project\x27.'),'project_description':z['string']()['max'](0x7d0)['optional']()['describe']('Project\x20description\x20for\x20create_project\x20/\x20update_project.'),'project_industry':IndustryEnum['optional']()['describe']('Industry\x20tag\x20for\x20create_project.\x20Drives\x20template\x20defaults\x20—\x20when\x20set\x20'+'(and\x20not\x20\x27general\x27),\x20the\x20system\x20auto-applies\x20an\x20industry\x20blueprint\x20'+'with\x20~10\x20draft\x20objects\x20(Permission,\x20Service,\x20Machine,\x20Guard,\x20Treasury,\x20'+'Allocation,\x20etc.)\x20+\x20graph\x20edges,\x20ready\x20for\x20deployment.\x20'+'Supported\x20industries:\x20\x27general\x27\x20(no\x20template),\x20\x27retail\x27,\x20\x27retail_d2c\x27\x20'+'(Direct-to-Consumer,\x20e.g.,\x20Shopify\x20—\x20Allocation\x20escrow\x20+\x202\x20Guards),\x20\x27service\x27,\x20'+'\x27rental\x27,\x20\x27freelance\x27,\x20\x27education\x27,\x20\x27travel\x27,\x20\x27subscription\x27,\x20\x27custom\x27.\x20'+'Each\x20industry\x20preset\x20embeds\x20risk\x20constraints\x20(e.g.,\x20\x27freelance\x27\x20does\x20'+'NOT\x20require\x20compensation_fund,\x20while\x20\x27rental\x27/\x27travel\x27\x20do).\x20'+'Example:\x20project_industry=\x27freelance\x27\x20creates\x20a\x20freelance-style\x20'+'blueprint\x20with\x20setting_locked_time\x20≥\x207d.\x20'+'Set\x20skip_templates=true\x20to\x20bypass\x20template\x20application.'),'project_perspective':z['enum'](['producer','consumer','both'])['optional']()['describe']('Project\x20perspective\x20for\x20create_project.\x20\x27producer\x27\x20=\x20build/operate\x20services,\x20\x27consumer\x27\x20=\x20evaluate/buy\x20services,\x20\x27both\x27\x20=\x20dual\x20role.\x20Defaults\x20to\x20\x27producer\x27.'),'project_labels':z['array'](z['string']())['optional']()['describe']('Free-form\x20labels\x20for\x20create_project\x20/\x20update_project\x20(e.g.\x20[\x27travel\x27,\x27london\x27,\x27priority\x27]).'),'service_address':z['string']()['optional']()['describe']('On-chain\x20Service\x20object\x20address.\x20Required\x20for\x20create_project_from_onchain.\x20Optional\x20for\x20create_project\x20(links\x20the\x20project\x20to\x20its\x20core\x20Service).'),'project_network':z['enum'](['testnet','mainnet'])['optional']()['describe']('Network\x20the\x20project\x20is\x20bound\x20to.\x20A\x20Service\x20deployed\x20to\x20different\x20networks\x20are\x20different\x20projects.\x20Defaults\x20to\x20\x27testnet\x27.'),'skip_templates':z['boolean']()['optional']()['describe']('When\x20true,\x20create_project\x20skips\x20applying\x20the\x20industry\x20template\x20(no\x20draft:*\x20blueprint\x20objects).\x20'+'Use\x20this\x20when\x20you\x20want\x20a\x20clean\x20project\x20with\x20no\x20pre-filled\x20blueprint\x20objects\x20—\x20useful\x20for\x20'+'custom\x20architectures\x20that\x20do\x20not\x20match\x20any\x20industry\x20mode,\x20or\x20to\x20avoid\x20draft\x20objects\x20'+'appearing\x20in\x20build_graph\x20/\x20evaluate_project\x20before\x20deployment.\x20Defaults\x20to\x20false\x20(templates\x20applied).'),'project_id':z['string']()['optional']()['describe']('Project\x20UUID\x20for\x20update_project\x20/\x20get_project_detail\x20/\x20add_object\x20/\x20remove_object\x20/\x20create_version\x20/\x20build_graph\x20/\x20evaluate_project\x20/\x20refresh_objects.\x20Takes\x20precedence\x20over\x20\x27project\x27\x20(prefix)\x20when\x20both\x20are\x20given.'),'project_status':z['enum'](['draft','active','inactive','archived'])['optional']()['describe']('New\x20status\x20for\x20update_project.\x20\x27active\x27\x20projects\x20are\x20live,\x20\x27archived\x27\x20are\x20read-only.'),'target_network':z['enum'](['testnet','mainnet'])['optional']()['describe']('Target\x20network\x20for\x20clone_project_to_network\x20(or\x20its\x20alias\x20migrate_network).\x20'+'The\x20source\x20project\x27s\x20objects\x20are\x20copied\x20to\x20a\x20new\x20project\x20bound\x20to\x20this\x20network.\x20'+'The\x20new\x20project\x27s\x20prefix\x20is\x20\x27<source_prefix>_<target_network>\x27\x20to\x20avoid\x20collision.\x20'+'See\x20the\x20action\x20description\x20for\x20the\x20full\x205-step\x20migration\x20workflow\x20(FIX-012).'),'object_address':z['string']()['optional']()['describe']('On-chain\x20object\x20address\x20(0x\x20followed\x20by\x2032-64\x20hex\x20chars)\x20for\x20add_object\x20/\x20remove_object.\x20'+'Also\x20accepts\x20the\x20internal\x20\x27draft:<name>\x27\x20sentinel\x20used\x20by\x20create_project\x20for\x20blueprint\x20objects\x20not\x20yet\x20on-chain.\x20'+'For\x20add_object,\x20alternatively\x20use\x20object_name_add\x20to\x20resolve\x20via\x20LocalMark.\x20'+'H-06\x20fix:\x20invalid\x20formats\x20are\x20rejected\x20at\x20the\x20handler\x20level\x20with\x20a\x20descriptive\x20error.'),'object_name_add':z['string']()['optional']()['describe']('LocalMark\x20name\x20for\x20add_object\x20(alternative\x20to\x20object_address).'),'object_type_add':z['enum'](['Service','Machine','Guard','Permission','Reward','Arbitration','Progress','Treasury','Demand','Repository','Contact','Order','Allocation','Personal','Payment','Proof'])['optional']()['describe']('Object\x20type\x20for\x20add_object.'),'object_role':z['enum'](['core','dependency','reference'])['optional']()['describe']('Object\x20role\x20in\x20project\x20for\x20add_object.\x20\x27core\x27\x20=\x20the\x20Service\x20(only\x20one\x20per\x20project),\x20\x27dependency\x27\x20=\x20required\x20binding,\x20\x27reference\x27\x20=\x20optional/auxiliary.\x20Defaults\x20to\x20\x27reference\x27.'),'object_tags_add':z['array'](z['string']())['optional']()['describe']('Tags\x20for\x20add_object.'),'object_id_remove':z['string']()['optional']()['describe']('ProjectObject\x20UUID\x20for\x20remove_object\x20(the\x20project_objects.id,\x20NOT\x20the\x20on-chain\x20address).'),'object_id_update':z['string']()['optional']()['describe']('ProjectObject\x20UUID\x20for\x20update_object\x20(the\x20project_objects.id).'),'object_name_update':z['string']()['optional']()['describe']('New\x20name\x20for\x20update_object.'),'object_type_update':z['string']()['optional']()['describe']('New\x20type\x20for\x20update_object.'),'object_role_update':z['enum'](['core','dependency','reference'])['optional']()['describe']('New\x20role\x20for\x20update_object.'),'object_tags_update':z['array'](z['string']())['optional']()['describe']('New\x20tags\x20for\x20update_object.'),'version_description':z['string']()['max'](0x1f4)['optional']()['describe']('Description\x20for\x20create_version.'),'fork_from_version':z['string']()['optional']()['describe']('Source\x20version\x20for\x20create_version\x20(fork\x20objects\x20+\x20graph\x20from\x20this\x20version).'),'max_depth':z['number']()['int']()['min'](0x1)['max'](0x5)['optional']()['describe']('Max\x20recursion\x20depth\x20for\x20Pathway\x201\x20(internal\x20reference\x20derivation)\x20in\x20build_graph.\x20Default\x203.'),'depth':z['number']()['int']()['min'](0x1)['max'](0x5)['optional']()['describe']('Alias\x20for\x20max_depth\x20(build_graph).\x20When\x20both\x20are\x20set,\x20max_depth\x20takes\x20precedence.\x20Default\x203.'),'enable_registrar':z['boolean']()['optional']()['describe']('Enable\x20Pathway\x202\x20(Registrar\x20inbound\x20query)\x20in\x20build_graph.\x20Default\x20true.'),'enable_potential':z['boolean']()['optional']()['describe']('Enable\x20Pathway\x203\x20(potential\x20relationship\x20detection)\x20in\x20build_graph.\x20Default\x20false.'),'async_mode':z['boolean']()['optional']()['describe']('When\x20true,\x20build_graph\x20/\x20evaluate_project\x20runs\x20in\x20the\x20background\x20and\x20returns\x20{\x20task_id\x20}\x20immediately.\x20'+'Poll\x20query_task_status(task_id)\x20to\x20check\x20progress\x20and\x20retrieve\x20the\x20result.\x20'+'Default\x20false\x20(synchronous).\x20Use\x20async_mode=true\x20for\x20large\x20projects\x20with\x20enable_potential=true\x20'+'where\x20build\x20may\x20take\x20>10s.'),'evaluation_type':z['enum'](['risk','trust','completeness','value','worth_buying'])['optional']()['describe']('Evaluation\x20type\x20for\x20evaluate_project.\x20risk/trust/completeness\x20are\x20rule-based\x20(computed\x20locally).\x20worth_buying/value\x20require\x20LLM\x20assistance\x20(returns\x20a\x20prompt\x20for\x20the\x20caller\x20to\x20process).'),'refresh_before_eval':z['boolean']()['optional']()['describe']('When\x20true\x20(DEFAULT),\x20evaluate_project\x20refreshes\x20object\x20cache\x20from\x20chain\x20before\x20evaluating.\x20'+'Set\x20to\x20false\x20ONLY\x20for\x20read-only\x20checks\x20where\x20staleness\x20is\x20acceptable\x20(e.g.,\x20quick\x20comparisons).\x20'+'BUG-P0-2\x20fix:\x20previously\x20defaulted\x20to\x20false,\x20causing\x20stale\x20Machine\x20node_count\x20and\x20other\x20'+'dynamic-field-derived\x20fields\x20to\x20produce\x20false\x20findings\x20(e.g.,\x20\x27Machine\x20has\x20no\x20nodes\x27).\x20'+'Now\x20defaults\x20to\x20true\x20—\x20set\x20refresh_before_eval=false\x20explicitly\x20to\x20skip\x20refresh.'),'eval_score':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Overall\x20evaluation\x20score\x20(0-100)\x20for\x20save_evaluation.'),'eval_summary':z['string']()['max'](0x3e8)['optional']()['describe']('Evaluation\x20summary\x20for\x20save_evaluation.'),'eval_details':z['record'](z['unknown']())['optional']()['describe']('Structured\x20evaluation\x20details\x20for\x20save_evaluation\x20(criterion_scores,\x20findings,\x20etc.).'),'compare_project_ids':z['array'](z['string']())['min'](0x2)['optional']()['describe']('Array\x20of\x20project\x20IDs\x20to\x20compare\x20(for\x20compare_projects).\x20Minimum\x202.'),'diff_address':z['string']()['optional']()['describe']('Object\x20address\x20for\x20get_object_diff.'),'diff_from_time':z['number']()['int']()['optional']()['describe']('Start\x20timestamp\x20(ms)\x20for\x20get_object_diff.'),'diff_to_time':z['number']()['int']()['optional']()['describe']('End\x20timestamp\x20(ms)\x20for\x20get_object_diff.'),'network':z['enum'](['testnet','mainnet'])['optional']()['describe']('Target\x20network\x20for\x20generate_deployment_doc.\x20Required\x20when\x20action=\x27generate_deployment_doc\x27.'),'save':z['boolean']()['optional']()['describe']('When\x20true\x20(default),\x20persist\x20the\x20generated\x20MD\x20to\x20SQLite\x20project_documents\x20table\x20for\x20generate_deployment_doc.'),'detail_level':z['enum'](['summary','detailed','full'])['optional']()['describe']('P2-03:\x20Deployment\x20document\x20detail\x20level\x20(only\x20for\x20generate_deployment_doc).\x20'+'\x27summary\x27\x20(default):\x20object\x20name\x20+\x20type\x20+\x20key\x20bindings\x20(machine,\x20permission,\x20buy_guard,\x20order_allocators).\x20'+'\x27detailed\x27:\x20adds\x20sale\x20list,\x20arbitration\x20list,\x20reward\x20list.\x20'+'\x27full\x27:\x20complete\x20fields\x20including\x20stock,\x20price,\x20wip_hash,\x20all\x20config.\x20'+'Use\x20\x27summary\x27\x20for\x20quick\x20review;\x20request\x20\x27detailed\x27\x20or\x20\x27full\x27\x20only\x20when\x20deeper\x20inspection\x20is\x20needed.'),'object_kind':z['enum'](['machine','guard'])['optional']()['describe']('Object\x20kind\x20for\x20plan_object_edit.\x20\x27machine\x27\x20=\x20Machine\x20workflow\x20directed\x20graph\x20(cycles\x20allowed),\x20\x27guard\x27\x20=\x20Guard\x20computation\x20tree.\x20'+'Required\x20when\x20action=\x27plan_object_edit\x27.\x20Inferred\x20from\x20action\x20for\x20patch_machine_nodes\x20(always\x20\x27machine\x27)\x20'+'and\x20patch_guard_tree\x20(always\x20\x27guard\x27).'),'edit_format':z['enum'](['tree_outline','json'])['optional']()['describe']('Format\x20of\x20the\x20edited\x20content\x20for\x20plan_object_edit.\x20'+'\x27tree_outline\x27\x20(default):\x20the\x20indented\x20Markdown\x20outline\x20produced\x20by\x20get_machine_graph\x20/\x20get_guard_graph\x20(human-editable).\x20'+'\x27json\x27:\x20raw\x20JSON\x20(machine-readable,\x20for\x20programmatic\x20edits).\x20'+'Both\x20formats\x20are\x20bidirectional\x20with\x20the\x20parse\x20functions\x20in\x20knowledge/machine-render.ts\x20/\x20guard-render.ts.'),'edited_content':z['string']()['optional']()['describe']('Edited\x20content\x20for\x20plan_object_edit.\x20Must\x20be\x20in\x20the\x20format\x20specified\x20by\x20edit_format.\x20'+'For\x20\x27tree_outline\x27:\x20the\x20full\x20tree_outline\x20string\x20from\x20get_machine_graph/get_guard_graph\x20with\x20user\x20edits.\x20'+'For\x20\x27json\x27:\x20a\x20JSON\x20string\x20matching\x20the\x20Machine/Guard\x20schema.\x20'+'The\x20content\x20is\x20parsed\x20+\x20validated\x20+\x20diffed\x20against\x20the\x20current\x20on-chain\x20state.'),'plan_id':z['string']()['optional']()['describe']('Plan\x20ID\x20returned\x20by\x20plan_object_edit.\x20Required\x20for\x20apply_object_edit.\x20'+'The\x20plan\x20is\x20short-lived\x20(10-minute\x20TTL)\x20and\x20stored\x20in-memory.'),'expected_hash':z['string']()['optional']()['describe']('Expected\x20hash\x20returned\x20by\x20plan_object_edit.\x20Required\x20for\x20apply_object_edit.\x20'+'Used\x20for\x20optimistic\x20concurrency\x20control:\x20if\x20the\x20on-chain\x20state\x20changed\x20between\x20plan\x20and\x20apply,\x20'+'the\x20hash\x20will\x20mismatch\x20and\x20apply\x20will\x20refuse\x20to\x20proceed\x20(stale\x20edit\x20protection).'),'patch_operations':z['array'](z['string']())['optional']()['describe']('Patch\x20operations\x20for\x20patch_machine_nodes\x20/\x20patch_guard_tree.\x20Each\x20string\x20is\x20a\x20single\x20patch\x20operation.\x0a'+'Machine\x20operations\x20(13\x20total):\x0a'+'\x20\x20\x27add\x20node\x20<name>\x27\x20|\x20\x27remove\x20node\x20<name>\x27\x20|\x20\x27set\x20description\x20<node_name>\x20<text...>\x27\x0a'+'\x20\x20\x27add\x20edge\x20<from>\x20<to>\x27\x20|\x20\x27remove\x20edge\x20<from>\x20<to>\x27\x20|\x20\x27set\x20threshold\x20<edge_from>\x20<edge_to>\x20<value>\x27\x0a'+'\x20\x20\x27add\x20forward\x20<edge_from>\x20<edge_to>\x20<forward_name>\x27\x20|\x20\x27remove\x20forward\x20<edge_from>\x20<edge_to>\x20<forward_name>\x27\x0a'+'\x20\x20\x27set\x20guard\x20<edge_from>\x20<edge_to>\x20<forward_name>\x20<guard_addr_or_name|none>\x27\x0a'+'\x20\x20\x27set\x20permission\x20<edge_from>\x20<edge_to>\x20<forward_name>\x20<perm_index>\x27\x0a'+'\x20\x20\x27set\x20operator\x20<edge_from>\x20<edge_to>\x20<forward_name>\x20<named_operator|none>\x27\x0a'+'\x20\x20\x27set\x20weight\x20<edge_from>\x20<edge_to>\x20<forward_name>\x20<weight>\x27\x0a'+'\x20\x20\x27set\x20retained_submission\x20<edge_from>\x20<edge_to>\x20<forward_name>\x20<comma_separated_indices|none>\x27\x0a'+'Guard\x20operations\x20(8\x20total\x20—\x20see\x20patch_guard_tree):\x0a'+'\x20\x20\x27add\x20table\x20<identifier>\x20<name|none>\x20<value_type>\x20<b_submission>\x20[json_value]\x27\x0a'+'\x20\x20\x27remove\x20table\x20<identifier>\x27\x20|\x20\x27set\x20table_value\x20<identifier>\x20[json_value|none]\x27\x0a'+'\x20\x20\x27set\x20table_name\x20<identifier>\x20<name|none>\x27\x20|\x20\x27set\x20table_submission\x20<identifier>\x20<true|false>\x27\x0a'+'\x20\x20\x27set\x20root\x20<json_node>\x27\x20|\x20\x27set\x20rely\x20<comma_separated_guard_addresses|none>\x27\x0a'+'Operations\x20are\x20applied\x20in\x20order.\x20Both\x20patches\x20are\x20validated\x20(validateMachine/validateGuard)\x20before\x20execution.'),'intent':z['string']()['max'](0x7d0)['optional']()['describe']('Business\x20intent\x20text\x20for\x20recommend_industry\x20(e.g.\x20\x27I\x20rent\x20cameras\x20to\x20photographers\x20'+'with\x20deposit\x20and\x20damage\x20inspection\x27).\x20Falls\x20back\x20to\x20project_description\x20/\x20project_name\x20when\x20omitted.'),'mode_source':z['string']()['optional']()['describe']('Source\x20builtin\x20mode\x20name\x20for\x20derive_user_mode\x20(e.g.\x20\x27freelance\x27).\x20Call\x20list_modes\x20to\x20see\x20available\x20modes.'),'mode_name':z['string']()['max'](0x64)['optional']()['describe']('Mode\x20name\x20for\x20derive_user_mode\x20(new\x20mode\x20name),\x20evolve_user_mode\x20/\x20unregister_user_mode\x20(existing\x20custom\x20mode),\x20register_user_mode\x20(new\x20mode\x20name).\x20'+'Must\x20NOT\x20conflict\x20with\x20builtin\x20mode\x20names.'),'mode_display_name':z['string']()['max'](0xc8)['optional']()['describe']('Display\x20name\x20for\x20derive_user_mode\x20/\x20register_user_mode.\x20Defaults\x20to\x20mode_name.'),'mode_changes':z['record'](z['unknown']())['optional']()['describe']('Mode\x20field\x20overrides\x20for\x20derive_user_mode\x20/\x20evolve_user_mode\x20/\x20register_user_mode.\x20'+'For\x20register_user_mode,\x20REQUIRED\x20fields:\x20machine_shape\x20(non-empty\x20array\x20of\x20{name,\x20role})\x20and\x20key_risk\x20(string).\x20'+'Common\x20overrides:\x20machine_shape\x20(array\x20of\x20{name:string,\x20role:string}),\x20config_overrides\x20(per-object\x20config),\x20'+'allocator,\x20guards,\x20build_notes,\x20risk_appetite.\x20'+'R-M1-11\x20ENFORCED:\x20machine_shape\x20node\x20names\x20must\x20NOT\x20contain\x20dispute/refund/arb\x20terms\x20—\x20'+'disputes\x20flow\x20through\x20Service.arbitrations\x20independently\x20of\x20the\x20Machine.'),'mode_change_description':z['string']()['max'](0x1f4)['optional']()['describe']('Change\x20description\x20for\x20evolve_user_mode\x20(recorded\x20in\x20evolution\x20history).'),'mode_bump_version':z['boolean']()['optional']()['describe']('Whether\x20evolve_user_mode\x20bumps\x20the\x20patch\x20version\x20(default\x20true:\x20v1.0\x20→\x20v1.1).'),'metric_id':z['string']()['max'](0x64)['optional']()['describe']('Unique\x20metric\x20ID\x20for\x20register_custom_metric\x20(e.g.\x20\x27seasonality_risk\x27).'),'metric_display_name':z['string']()['max'](0xc8)['optional']()['describe']('Display\x20name\x20for\x20register_custom_metric.'),'metric_description':z['string']()['max'](0x3e8)['optional']()['describe']('Description\x20for\x20register_custom_metric.'),'metric_type':z['enum'](['risk','benefit'])['optional']()['describe']('Metric\x20type\x20for\x20register_custom_metric:\x20\x27risk\x27\x20(negative)\x20or\x20\x27benefit\x27\x20(positive).'),'metric_scale':z['enum'](['level','numeric','percentage'])['optional']()['describe']('Metric\x20scale\x20for\x20register_custom_metric:\x20\x27level\x27\x20(high/medium/low),\x20\x27numeric\x27,\x20or\x20\x27percentage\x27.'),'metric_weight':z['number']()['min'](0x0)['max'](0xa)['optional']()['describe']('Metric\x20weight\x20for\x20register_custom_metric\x20(default\x201.0).'),'constraint_id':z['string']()['max'](0x64)['optional']()['describe']('Unique\x20constraint\x20ID\x20for\x20register_custom_constraint.'),'constraint_display_name':z['string']()['max'](0xc8)['optional']()['describe']('Display\x20name\x20for\x20register_custom_constraint.'),'constraint_description':z['string']()['max'](0x3e8)['optional']()['describe']('Description\x20for\x20register_custom_constraint.'),'constraint_rule':z['discriminatedUnion']('type',[z['object']({'type':z['literal']('capability_required'),'capability_id':z['string']()})['strict'](),z['object']({'type':z['literal']('capability_forbidden'),'capability_id':z['string']()})['strict'](),z['object']({'type':z['literal']('numeric_limit'),'field':z['string'](),'max':z['number']()['optional'](),'min':z['number']()['optional']()})['strict'](),z['object']({'type':z['literal']('condition_required'),'condition':z['string'](),'ai_evaluated':z['literal'](!![])})['strict']()])['optional']()['describe']('Constraint\x20rule\x20for\x20register_custom_constraint.\x204\x20types:\x20'+'capability_required/capability_forbidden\x20(capability_id),\x20numeric_limit\x20(field\x20+\x20max/min),\x20'+'condition_required\x20(natural-language\x20condition,\x20AI-evaluated).'),'constraint_severity':z['enum'](['hard','soft'])['optional']()['describe']('Constraint\x20severity\x20for\x20register_custom_constraint:\x20\x27hard\x27\x20blocks\x20applyTemplate\x20on\x20violation;\x20\x27soft\x27\x20only\x20warns\x20(default\x20\x27soft\x27).'),'constraint_on_violation':z['enum'](['block','warn','log'])['optional']()['describe']('Violation\x20action\x20for\x20register_custom_constraint\x20(default\x20\x27warn\x27).'),'metric_type_filter':z['enum'](['risk','benefit'])['optional']()['describe']('Filter\x20list_metrics_constraints\x20by\x20metric\x20type.'),'scope_filter':z['enum'](['builtin','custom'])['optional']()['describe']('Filter\x20list_metrics_constraints\x20by\x20scope\x20(builtin\x20or\x20custom).'),'target_objects':z['array'](z['string']())['optional']()['describe']('Optional\x20explicit\x20target\x20objects\x20for\x20analyze_intent\x20(entry_ids\x20or\x20object_type\x20names).\x20'+'When\x20provided,\x20puzzle\x20snapshots\x20are\x20restricted\x20to\x20these\x20objects.'),'puzzles':z['record'](z['object']({'puzzle':z['unknown']()['describe']('Puzzle\x20snapshot\x20(opaque\x20—\x20pass\x20through\x20from\x20analyze_intent\x20output\x20unchanged).'),'completeness':z['unknown']()['describe']('Completeness\x20snapshot\x20(opaque\x20—\x20pass\x20through\x20unchanged).'),'missing_dimensions':z['array'](z['string']())['describe']('Dimensions\x20still\x20missing\x20for\x20this\x20object.')})['strict']())['optional']()['describe']('Per-object\x20puzzle\x20snapshots\x20for\x20aggregate_risks,\x20keyed\x20by\x20object_type.\x20'+'Pass\x20the\x20\x27puzzles\x27\x20field\x20from\x20a\x20prior\x20analyze_intent\x20result\x20UNCHANGED.\x20'+'When\x20omitted\x20but\x20\x27intent\x27\x20is\x20present,\x20the\x20handler\x20runs\x20analyze_intent\x20first\x20(C1→C2\x20in\x20one\x20call).'),'severity_threshold':z['enum'](['CRITICAL','HIGH','MEDIUM','LOW','INFO'])['optional']()['describe']('Severity\x20threshold\x20for\x20aggregate_risks\x20(default\x20\x27HIGH\x27).\x20Risks\x20at\x20or\x20above\x20this\x20level\x20block\x20deployment\x20(status\x20RISK_BLOCKED).'),'user_confirmed_high_risks':z['array'](z['string']())['optional']()['describe']('IDs\x20of\x20HIGH\x20risks\x20the\x20user\x20has\x20already\x20confirmed\x20in\x20a\x20prior\x20round\x20(aggregate_risks).\x20'+'Confirmed\x20HIGH\x20risks\x20no\x20longer\x20trigger\x20RISK_PENDING_CONFIRM.'),'planned_objects':z['array'](z['object']({'object_type':z['string']()['describe']('Wowok\x20object\x20type\x20(e.g.\x20\x27service\x27,\x20\x27guard\x27,\x20\x27machine\x27).'),'is_new':z['boolean']()['describe']('true\x20when\x20creating\x20a\x20NEW\x20object;\x20false\x20when\x20reusing\x20an\x20existing\x20one.'),'name':z['string']()['optional']()['describe']('Planned\x20object\x20name\x20(for\x20readable\x20messages).')})['strict']())['optional']()['describe']('Planned\x20objects\x20for\x20aggregate_risks\x20OBJECT_REUSE\x20check\x20(safety-rules).\x20'+'Flags\x20NEW\x20objects\x20whose\x20type\x20carries\x20an\x20always/strongly-recommended\x20reuse\x20rule.'),'planned_operations':z['array'](z['object']({'object_type':z['string']()['describe']('Wowok\x20object\x20type\x20(e.g.\x20\x27service\x27,\x20\x27arbitration\x27).'),'trigger':z['enum'](['create','publish'])['describe']('Lifecycle\x20trigger\x20that\x20locks\x20fields.'),'name':z['string']()['optional']()['describe']('Object\x20name\x20(for\x20readable\x20messages).')})['strict']())['optional']()['describe']('Planned\x20create/publish\x20operations\x20for\x20aggregate_risks\x20IMMUTABILITY\x20check\x20(safety-rules).\x20'+'Warns\x20which\x20fields\x20become\x20permanently\x20locked\x20after\x20each\x20operation.'),'substeps':z['array'](z['object']({'step_id':z['string']()['describe']('Substep\x20id,\x20format\x20\x27T<step>.<substep>\x27\x20e.g.\x20\x27T1.1\x27.'),'parent_step':z['string']()['describe']('Parent\x20step\x20id,\x20format\x20\x27T<step>\x27\x20e.g.\x20\x27T1\x27.'),'object_type':ProjectObjectTypeEnum['describe']('Wowok\x20object\x20type\x20this\x20substep\x20operates\x20on.'),'entry_id':z['string']()['describe']('Puzzle\x20entry_id\x20this\x20substep\x20corresponds\x20to.'),'operation_type':z['string']()['describe']('operation_type\x20for\x20onchain_operations.'),'network':z['enum'](['testnet','mainnet'])['describe']('Target\x20network.'),'input':z['object']({'data':z['record'](z['unknown']())['describe']('Input\x20data\x20payload.'),'input_refs':z['array'](z['string']())['describe']('Upstream\x20substep_ids\x20this\x20substep\x20consumes.')})['strict'](),'output':z['object']({'object_id':z['string']()['optional'](),'tx_digest':z['string']()['optional']()})['catchall'](z['unknown']())['optional']()['describe']('Output\x20data\x20(filled\x20after\x20execution).'),'timestamp':z['number']()['describe']('Execution\x20timestamp\x20(ms).'),'status':z['enum'](['PENDING','SUCCESS','FAILED','SKIPPED'])['describe']('Execution\x20status.'),'failure_reason':z['string']()['optional']()['describe']('Failure\x20reason\x20(when\x20status=\x27FAILED\x27).'),'dependencies':z['object']({'input_refs':z['array'](z['string']()),'output_refs':z['array'](z['object']({'substep_id':z['string']()['describe']('Downstream\x20substep\x20that\x20consumes\x20this\x20output.'),'field_path':z['string']()['describe']('Field\x20path\x20produced\x20by\x20this\x20substep\x20(e.g.\x20\x27permission_address\x27).')})['strict']())})['strict']()['describe']('Dependencies\x20(input_refs\x20+\x20output_refs).'),'retry_info':z['object']({'original_step_id':z['string'](),'retry_count':z['number'](),'retry_reason':z['string']()})['strict']()['optional']()['describe']('Retry\x20info\x20(when\x20this\x20substep\x20is\x20a\x20retry\x20of\x20an\x20earlier\x20one).')})['strict']())['optional']()['describe']('Substep\x20execution\x20records\x20for\x20trace_substeps\x20(63-spec\x20§2.1).\x20'+'Required\x20when\x20action=\x27trace_substeps\x27.\x20Construct\x20from\x20your\x20deployment\x20execution\x20trace.'),'substep_edges':z['array'](z['object']({'source':z['string']()['describe']('Source\x20substep\x20id.'),'target':z['string']()['describe']('Target\x20substep\x20id\x20(depends\x20on\x20source).'),'field_path':z['string']()['describe']('Field\x20path\x20flowing\x20along\x20this\x20edge.')})['strict']())['optional']()['describe']('Explicit\x20DAG\x20edges\x20for\x20trace_substeps.\x20When\x20omitted,\x20edges\x20are\x20derived\x20from\x20each\x20substep\x27s\x20input_refs.'),'guide_state':z['object']({'intent_text':z['string']()['describe']('Step\x201:\x20raw\x20merchant\x20business\x20description.'),'confirmed_industry':z['string']()['optional']()['describe']('Step\x202:\x20merchant-confirmed\x20industry\x20id.'),'currency':z['string']()['optional']()['describe']('Step\x205:\x20payment\x20currency\x20(default\x20WOW).'),'deliverables':z['array'](z['unknown']())['optional']()['describe']('Step\x204:\x20merchant-defined\x20deliverables\x20(opaque\x20passthrough).'),'payment_override':z['record'](z['unknown']())['optional']()['describe']('Step\x205:\x20payment\x20structure\x20overrides\x20(opaque\x20passthrough).'),'trust_override':z['record'](z['unknown']())['optional']()['describe']('Step\x206:\x20trust\x20mechanism\x20overrides\x20(opaque\x20passthrough).'),'adopted_module_ids':z['array'](z['string']())['optional']()['describe']('Step\x206:\x20merchant-confirmed\x20business\x20module\x20ids.')})['strict']()['optional']()['describe']('Wizard\x20state\x20from\x20a\x20prior\x20merchant_guide\x20result.\x20Pass\x20back\x20UNCHANGED\x20on\x20'+'every\x20subsequent\x20call\x20(same\x20pattern\x20as\x20C1→C2\x20puzzles).\x20The\x20handler\x20re-runs\x20'+'the\x20pipeline\x20deterministically\x20and\x20advances\x20to\x20the\x20furthest\x20reachable\x20step.'),'guide_confirm':z['object']({'industry':z['string']()['optional']()['describe']('Step\x202\x20confirmation:\x20industry\x20id\x20(e.g.\x20\x27freelance\x27).'),'currency':z['string']()['optional']()['describe']('Step\x205\x20confirmation:\x20payment\x20currency.'),'deliverables':z['array'](z['unknown']())['optional']()['describe']('Step\x204\x20confirmation:\x20deliverable\x20definitions.'),'payment':z['record'](z['unknown']())['optional']()['describe']('Step\x205\x20confirmation:\x20{\x20model,\x20triggers,\x20allocation\x20}\x20overrides.'),'trust':z['record'](z['unknown']())['optional']()['describe']('Step\x206\x20confirmation:\x20{\x20refundPolicy,\x20arbitration,\x20escrow\x20}\x20overrides.'),'adopted_module_ids':z['array'](z['string']())['optional']()['describe']('Step\x206\x20confirmation:\x20business\x20module\x20ids\x20to\x20adopt\x20(overrides\x20recommendation).')})['strict']()['optional']()['describe']('Merchant\x20decisions\x20for\x20the\x20current\x20wizard\x20step.\x20Merged\x20over\x20guide_state.\x20'+'Typical\x20flow:\x20call\x201\x20with\x20intent\x20only\x20→\x20receive\x20step-2\x20industry\x20options\x20→\x20'+'call\x202\x20with\x20guide_state\x20+\x20guide_confirm={industry}\x20→\x20receive\x20full\x20blueprint\x20'+'plan\x20(steps\x207-10).'),'radar_account':z['string']()['optional']()['describe']('Account\x20to\x20analyze\x20—\x20address\x20(0x...)\x20or\x20LocalMark\x20name\x20(resolved\x20to\x20an\x20address).\x20'+'Required\x20when\x20action=\x27participation_radar\x27.\x20The\x20perspective\x20(customer/operator/observer)\x20'+'is\x20DERIVED\x20from\x20on-chain\x20data\x20(Order.builder\x20+\x20PermissionPerm\x20grants)\x20—\x20never\x20asserted\x20by\x20this\x20field.'),'radar_targets':z['array'](z['object']({'progress':z['string']()['describe']('Progress\x20object\x20address\x20(0x...)\x20or\x20LocalMark\x20name.\x20The\x20Progress\x20carries\x20the\x20current\x20node\x20+\x20bound\x20Machine.'),'order':z['string']()['optional']()['describe']('Order\x20object\x20address\x20or\x20LocalMark\x20name\x20(optional\x20but\x20recommended\x20—\x20enables\x20order-holder\x20detection,\x20'+'service-level\x20compensation/reward\x20claims,\x20and\x20dispute\x20context).')})['strict']())['min'](0x1)['max'](0x14)['optional']()['describe']('In-flight\x20orders\x20to\x20analyze\x20(1-20).\x20Required\x20when\x20action=\x27participation_radar\x27.\x20'+'Each\x20target\x20is\x20analyzed\x20independently;\x20results\x20are\x20aggregated\x20into\x20one\x20account\x20dashboard.'),'radar_include_alerts':z['boolean']()['optional']()['describe']('Attach\x20order-monitor\x20alerts\x20(progress\x20stall\x20/\x20compensation\x20fund\x20/\x20review\x20&\x20arbitration\x20windows)\x20'+'to\x20each\x20per-order\x20result.\x20Default\x20true.'),'radar_monitor_thresholds':z['object']({'progress_stall_hours':z['number']()['positive']()['optional']()['describe']('Progress\x20stall\x20alert\x20threshold\x20in\x20HOURS.\x20Default\x200\x20=\x20auto\x20(expected_node_duration\x20×\x202).'),'compensation_drop_ratio':z['number']()['min'](0x0)['max'](0x1)['optional']()['describe']('Compensation\x20fund\x20drop\x20alert\x20ratio\x20(0-1).\x20Default\x200.3\x20=\x20alert\x20on\x20≥30%\x20drop.'),'compensation_coverage_min':z['number']()['min'](0x0)['max'](0x1)['optional']()['describe']('Minimum\x20compensation\x20coverage\x20ratio\x20vs\x20order\x20amount\x20(0-1).\x20Default\x201.0\x20=\x20must\x20fully\x20cover.'),'messenger_timeout_hours':z['number']()['positive']()['optional']()['describe']('Messenger\x20no-reply\x20timeout\x20in\x20HOURS.\x20Default\x2024.'),'review_window_closing_days':z['number']()['positive']()['optional']()['describe']('Review\x20window\x20near-closing\x20alert\x20threshold\x20in\x20DAYS.\x20Default\x203.'),'arb_window_closing_days':z['number']()['positive']()['optional']()['describe']('Arbitration\x20window\x20near-closing\x20alert\x20threshold\x20in\x20DAYS.\x20Default\x203.')})['strict']()['optional']()['describe']('Optional\x20per-call\x20overrides\x20for\x20order-monitor\x20alert\x20thresholds\x20(only\x20used\x20when\x20radar_include_alerts\x20is\x20on).\x20'+'All\x20fields\x20optional;\x20omitted\x20fields\x20keep\x20defaults.\x20Units:\x20hours/days\x20as\x20marked\x20per\x20field.')})['strict']();const AssembleContextResultSchema=z['object']({'action':z['literal']('assemble_context'),'objects':z['array'](z['unknown']())['describe']('Current\x20on-chain\x20states\x20of\x20the\x20requested\x20objects\x20(from\x20query_objects).'),'events':z['array'](z['unknown']())['optional']()['describe']('Recent\x20state-transition\x20events\x20(only\x20when\x20include_events=true).\x20'+'Includes\x20NewOrderEvent,\x20ProgressEvent,\x20ArbEvent,\x20etc.'),'embedded_history':z['record'](z['string'](),z['unknown']())['optional']()['describe']('Operation\x20history\x20extracted\x20from\x20object\x20states\x20—\x20NOT\x20from\x20tx\x20queries.\x20'+'Progress\x20objects:\x20session.forwards\x20(who\x20did\x20what,\x20when,\x20accomplished).\x20'+'Order\x20objects:\x20disputes,\x20claimed_by,\x20progress_object.\x20'+'This\x20is\x20the\x20CORRECT\x20history\x20source:\x20convergent,\x20no\x20infinite\x20recursion.'),'dependencies':z['array'](z['object']({'object':z['string']()['describe']('Discovered\x20dependency\x20object\x20ID\x20(0x...).'),'depth':z['number']()['int']()['min'](0x1)['describe']('BFS\x20depth\x20at\x20which\x20this\x20dependency\x20was\x20discovered\x20(1\x20=\x20direct\x20reference\x20from\x20a\x20center\x20object).'),'via_field':z['string']()['describe']('Field\x20name\x20on\x20the\x20parent\x20object\x20that\x20references\x20this\x20dependency\x20(e.g.\x20\x27permission\x27,\x20\x27machine\x27,\x20\x27guard\x27).\x20Matches\x20extractAddressFields\x20output.'),'via_type':z['string']()['describe']('Semantic\x20edge\x20type:\x20\x27bind\x27\x20|\x20\x27validate\x27\x20|\x20\x27consume\x27\x20|\x20\x27trigger\x27\x20|\x20\x27create\x27.'),'parent':z['string']()['describe']('Object\x20ID\x20of\x20the\x20parent\x20that\x20referenced\x20this\x20dependency.')}))['optional']()['describe']('Dependency\x20edges\x20discovered\x20via\x20BFS\x20expansion\x20(only\x20when\x20context_depth\x20>\x200).\x20'+'Each\x20entry\x20describes\x20one\x20outbound\x20reference\x20(parent\x20→\x20child)\x20with\x20the\x20field\x20name\x20'+'and\x20semantic\x20edge\x20type.\x20Use\x20with\x20dependency_objects\x20to\x20get\x20the\x20full\x20states.\x20'+'Cycles\x20are\x20deduplicated\x20—\x20each\x20object\x20ID\x20appears\x20at\x20most\x20once\x20at\x20its\x20shallowest\x20depth.'),'dependency_objects':z['array'](z['unknown']())['optional']()['describe']('Full\x20on-chain\x20states\x20of\x20the\x20discovered\x20dependency\x20objects\x20(only\x20when\x20context_depth\x20>\x200).\x20'+'Order\x20matches\x20`dependencies`\x20when\x20possible;\x20safe\x20to\x20consume\x20as\x20an\x20unordered\x20set.\x20'+'Center\x20objects\x20are\x20NOT\x20repeated\x20here\x20—\x20they\x20live\x20in\x20`objects`.'),'semantic_summary':z['unknown']()['optional']()['describe']('Business\x20semantic\x20annotations\x20generated\x20by\x20buildDataSemantic\x20—\x20'+'maps\x20raw\x20object\x20fields\x20to\x20business-meaningful\x20concepts\x20for\x20LLM\x20consumption.'),'context_digest':z['string']()['describe']('Unique\x20digest\x20for\x20this\x20assembled\x20context\x20(SHA\x20of\x20object\x20IDs\x20+\x20versions\x20+\x20timestamp).\x20'+'Use\x20for\x20caching\x20or\x20to\x20detect\x20state\x20changes\x20between\x20two\x20assembly\x20calls.'),'next_action':z['string']()['describe']('Suggested\x20next\x20action:\x20use\x20onchain_transaction\x20to\x20verify\x20a\x20specific\x20past\x20tx,\x20'+'or\x20proceed\x20with\x20onchain_operations\x20to\x20modify\x20state,\x20or\x20re-call\x20assemble_context\x20'+'after\x20state\x20changes.'),'flywheel_collected':z['object']({'signature_recorded':z['boolean']()['describe']('Whether\x20the\x20experience\x20signature\x20was\x20recorded\x20in\x20the\x20real-time\x20experience\x20layer.'),'proposal_created':z['boolean']()['describe']('Whether\x20an\x20improvement\x20proposal\x20was\x20created\x20for\x20the\x20offline\x20distillation\x20flywheel.'),'proposal_id':z['string']()['optional']()['describe']('The\x20proposal\x20ID,\x20if\x20created.')})['optional']()['describe']('Distillation\x20flywheel\x20collection\x20result.\x20Non-blocking\x20—\x20may\x20be\x20undefined\x20if\x20collection\x20fails.\x20'+'When\x20present,\x20the\x20assembled\x20context\x20has\x20been\x20fed\x20back\x20into\x20the\x20experience\x20layer\x20and/or\x20improvement\x20queue.')})['strict'](),ProjectObjectSchema=z['object']({'id':z['string']()['describe']('ProjectObject\x20UUID\x20(project_objects.id).'),'projectId':z['string']()['describe']('Owning\x20project\x20UUID.'),'objectAddress':z['string']()['describe']('On-chain\x20object\x20address\x20(0x...)\x20or\x20\x27draft:<name>\x27\x20sentinel\x20for\x20blueprint\x20objects.'),'objectType':z['string']()['nullable']()['describe']('Object\x20type\x20(Service,\x20Machine,\x20etc.)\x20or\x20null\x20if\x20unknown.'),'objectName':z['string']()['nullable']()['describe']('LocalMark\x20name\x20or\x20null.'),'role':z['string']()['describe']('Object\x20role\x20in\x20project.\x20Valid\x20values:\x20\x27core\x27\x20(the\x20Service),\x20\x27dependency\x27\x20(required\x20binding),\x20\x27reference\x27\x20(optional/auxiliary).\x20Other\x20values\x20indicate\x20data\x20corruption\x20—\x20see\x20objectGroups.other\x20bucket.'),'tags':z['array'](z['string']())['nullable']()['describe']('Tags\x20array\x20or\x20null.'),'addedAt':z['number']()['describe']('Timestamp\x20(ms)\x20when\x20added\x20to\x20project.'),'metadata':z['record'](z['unknown']())['nullable']()['describe']('Arbitrary\x20metadata\x20key-value\x20pairs\x20or\x20null.')})['strict'](),ProjectSchema=z['object']({'id':z['string']()['describe']('Project\x20UUID.'),'prefix':z['string']()['describe']('Human-readable\x20unique\x20prefix.'),'name':z['string']()['describe']('Display\x20name.'),'description':z['string']()['nullable'](),'industry':z['string']()['nullable'](),'perspective':z['enum'](['producer','consumer','both']),'status':z['enum'](['draft','active','inactive','archived']),'labels':z['array'](z['string']())['nullable'](),'currentVersion':z['string']()['nullable']()['describe']('Current\x20version\x20tag\x20(e.g.\x20\x27v1\x27).'),'serviceAddress':z['string']()['nullable']()['describe']('Core\x20Service\x20on-chain\x20address\x20(producer\x20projects).'),'defaultAccount':z['string']()['nullable'](),'network':z['string']()['describe']('Network\x20the\x20project\x20is\x20bound\x20to.'),'createdAt':z['number'](),'updatedAt':z['number'](),'metadata':z['record'](z['unknown']())['nullable']()['describe']('Arbitrary\x20metadata\x20key-value\x20pairs\x20or\x20null.')})['strict'](),ProjectListItemSchema=ProjectSchema['extend']({'objectCount':z['number']()['describe']('Number\x20of\x20objects\x20in\x20this\x20project\x20(from\x20project_objects\x20table).'),'evaluationCount':z['number']()['describe']('Number\x20of\x20stored\x20evaluations\x20for\x20this\x20project\x20(from\x20evaluations\x20table).'),'objectTypes':z['array'](z['string']())['describe']('Distinct\x20object\x20types\x20in\x20this\x20project\x20(e.g.\x20[\x27Service\x27,\x27Machine\x27]).')}),ListProjectsResultSchema=z['object']({'action':z['literal']('list_projects'),'items':z['array'](ProjectListItemSchema)['describe']('GLM6\x20projects\x20from\x20SQLite\x20(first-class\x20entities,\x20with\x20object\x20summary).'),'total':z['number']()['describe']('Total\x20number\x20of\x20projects\x20returned.')})['strict'](),RecommendedCreationOrderItemSchema=z['object']({'step':z['number']()['describe']('Step\x20number\x20(1-based).'),'object':z['string']()['describe']('Object\x20type\x20to\x20create\x20(e.g.\x20\x27Permission\x27,\x20\x27Service\x20(unpublished)\x27).'),'reason':z['string']()['describe']('Why\x20this\x20step\x20is\x20here,\x20including\x20dependencies\x20and\x20irreversibility\x20notes.'),'required':z['boolean']()['describe']('Whether\x20this\x20step\x20is\x20mandatory\x20for\x20a\x20working\x20deployment.')})['strict'](),RecommendedIndustryItemSchema=z['object']({'industry':z['string']()['describe']('Recommended\x20builtin\x20industry\x20mode\x20name.'),'similarity':z['number']()['describe']('Trait\x20similarity\x200-1\x20(10-dim\x20industry\x20trait\x20match).'),'matched_traits':z['array'](z['string']())['describe']('Trait\x20dimensions\x20that\x20matched.'),'reference_examples':z['array'](z['object']({'file':z['string']()['describe']('Example\x20file\x20name\x20(fetch\x20via\x20schema_query\x20search_examples).'),'title':z['string'](),'operation_type':z['string'](),'verified':z['boolean']()})['strict']())['describe']('Verified\x20reference\x20examples\x20for\x20this\x20industry\x20(top\x203).')})['strict'](),CreateProjectResultSchema=z['object']({'action':z['literal']('create_project'),'project':ProjectSchema['describe']('The\x20created\x20project.'),'recommended_creation_order':z['array'](RecommendedCreationOrderItemSchema)['describe']('Canonical\x20deployment\x20sequence\x20satisfying\x20dependency\x20constraints.\x20'+'All\x20industries\x20share\x20this\x20base\x20order;\x20see\x20IndustryMode.build_notes\x20for\x20industry-specific\x20deviations.'),'blueprint':z['object']({'objects_count':z['number']()['describe']('Number\x20of\x20draft\x20objects\x20created\x20from\x20the\x20template.'),'edges_count':z['number']()['describe']('Number\x20of\x20graph\x20edges\x20from\x20the\x20template.'),'industry_source':z['string']()['describe']('Industry\x20mode\x20name\x20that\x20sourced\x20the\x20template.'),'applied_template':z['string']()['describe']('Template\x20identifier\x20applied.'),'steps_count':z['number']()['describe']('Number\x20of\x20deployment\x20steps\x20in\x20the\x20template.'),'scenarios_count':z['number']()['describe']('Number\x20of\x20scenarios\x20in\x20the\x20template.'),'key_risk':z['string']()['nullable']()['optional']()['describe']('Industry-specific\x20key\x20risk\x20note\x20(or\x20null).'),'intent_inference':z['object']({'traits':z['record'](z['string'](),z['unknown']())['describe']('10-dimension\x20inferred\x20industry\x20traits\x20(unmatched\x20traits\x20use\x20neutral\x20defaults).'),'confidence':z['number']()['describe']('Inference\x20confidence\x200-1\x20(matched\x20trait\x20count\x20/\x2010).'),'matched_keywords':z['array'](z['string']())['describe']('Keywords\x20that\x20triggered\x20trait\x20inference.'),'top_matches':z['array'](z['object']({'industry':z['string'](),'similarity':z['number']()['describe']('Trait\x20similarity\x200-1.')})['strict']())['describe']('Top-3\x20similar\x20industries\x20by\x20trait\x20similarity.')})['strict']()['optional']()['describe']('Intent\x20inference\x20summary\x20(E.3)\x20—\x20present\x20when\x20industry\x20template\x20applied.'),'industry_mismatch_hint':z['string']()['optional']()['describe']('Advisory\x20hint\x20—\x20present\x20when\x20intent\x20inference\x20suggests\x20a\x20different\x20industry\x20fits\x20the\x20description\x20better\x20(non-blocking).')})['strict']()['optional']()['describe']('Blueprint\x20summary\x20—\x20present\x20when\x20industry\x20template\x20applied\x20successfully.\x20Objects\x20have\x20status=\x27draft\x27\x20and\x20address=\x27draft:<name>\x27.\x20Full\x20steps/scenarios\x20persisted\x20as\x20project\x20document\x20doc_type=\x27blueprint\x27.'),'blueprint_warning':z['string']()['optional']()['describe']('Warning\x20message\x20—\x20present\x20when\x20industry\x20template\x20application\x20failed.\x20Project\x20is\x20created\x20without\x20blueprint;\x20use\x20add_object\x20to\x20manually\x20add\x20objects.'),'blueprint_skipped':z['boolean']()['optional']()['describe']('True\x20when\x20skip_templates=true\x20was\x20passed\x20—\x20no\x20industry\x20blueprint\x20objects\x20were\x20created.'),'hint':z['string']()['optional']()['describe']('User-facing\x20hint\x20—\x20guides\x20to\x20next\x20action\x20(e.g.\x20add_object,\x20generate_deployment_doc).'),'recommended_industries':z['array'](RecommendedIndustryItemSchema)['optional']()['describe']('Top-3\x20recommended\x20industry\x20modes\x20inferred\x20from\x20the\x20project\x20description\x20(E.7).\x20'+'Present\x20only\x20when\x20no\x20project_industry\x20was\x20given.\x20Each\x20item\x20includes\x20reference\x20examples\x20'+'(\x27standing\x20on\x20giants\x27\x20shoulders\x27).\x20To\x20apply:\x20call\x20update_project\x20is\x20NOT\x20enough\x20—\x20recreate\x20'+'via\x20create_project\x20with\x20project_industry\x20set\x20to\x20get\x20the\x20blueprint.')})['strict'](),CreateProjectFromOnchainResultSchema=z['object']({'action':z['literal']('create_project_from_onchain'),'project':ProjectSchema['describe']('The\x20created\x20consumer\x20project.'),'objects':z['array'](ProjectObjectSchema)['describe']('Objects\x20discovered\x20from\x20on-chain\x20Service\x20+\x20graph\x20traversal.'),'graphEdgeCount':z['number']()['describe']('Number\x20of\x20relationship\x20edges\x20discovered\x20and\x20persisted.')})['strict'](),UpdateProjectResultSchema=z['object']({'action':z['literal']('update_project'),'project':ProjectSchema['describe']('The\x20updated\x20project.')})['strict'](),EvaluationDetailsSchema=z['object']({'criterionScores':z['array'](z['object']({'name':z['string']()['describe']('Criterion\x20name\x20(e.g.\x20\x27Service\x20Published\x27,\x20\x27Governance\x20Present\x27).'),'score':z['number']()['describe']('Per-criterion\x20score\x20(0-100,\x20higher\x20=\x20better).'),'weight':z['number']()['describe']('Weight\x20in\x20the\x20overall\x20score\x20(0-1).'),'rationale':z['string']()['describe']('Why\x20this\x20score\x20was\x20assigned.')})['strict']())['describe']('Per-criterion\x20scores\x20with\x20rationale.'),'findings':z['array'](z['object']({'criterion':z['string']()['describe']('Criterion\x20this\x20finding\x20relates\x20to.'),'severity':z['enum'](['critical','warning','info'])['describe']('Severity\x20level:\x20critical\x20(blocks\x20deployment),\x20warning\x20(should\x20fix),\x20info\x20(advisory).'),'message':z['string']()['describe']('Human-readable\x20finding\x20description.'),'deduction':z['number']()['describe']('Score\x20deduction\x20applied\x20(negative\x20number,\x20e.g.\x20-20).')})['strict']())['describe']('Negative\x20findings\x20(warnings/critical\x20issues)\x20with\x20deductions.'),'strengths':z['array'](z['string']())['describe']('Positive\x20evidence\x20explaining\x20high\x20scores.')})['strict'](),GetProjectDetailResultSchema=z['object']({'action':z['literal']('get_project_detail'),'project':ProjectSchema,'objects':z['array'](ProjectObjectSchema)['describe']('Project\x20objects\x20(rigid\x20relationships).\x20Flat\x20list\x20—\x20use\x20objectGroups\x20for\x20role-based\x20navigation.'),'objectGroups':z['object']({'core':z['array'](ProjectObjectSchema)['describe']('Core\x20objects\x20(the\x20Service)\x20—\x20the\x20primary\x20deliverable\x20of\x20the\x20project.'),'dependency':z['array'](ProjectObjectSchema)['describe']('Dependency\x20objects\x20(Permission,\x20Machine,\x20Guard,\x20Allocation,\x20Treasury,\x20etc.)\x20—\x20required\x20for\x20the\x20Service\x20to\x20function.'),'reference':z['array'](ProjectObjectSchema)['describe']('Reference\x20objects\x20(read-only\x20or\x20external)\x20—\x20tracked\x20but\x20not\x20owned\x20by\x20this\x20project.'),'other':z['array'](ProjectObjectSchema)['describe']('Objects\x20with\x20invalid\x20or\x20missing\x20role\x20(data\x20corruption,\x20legacy\x20data).\x20Grouped\x20here\x20for\x20visibility\x20—\x20should\x20normally\x20be\x20empty.\x20Check\x20server\x20logs\x20for\x20warnings.'),'stats':z['object']({'total':z['number']()['describe']('Total\x20object\x20count.'),'core_count':z['number']()['describe']('Number\x20of\x20core\x20objects.'),'dependency_count':z['number']()['describe']('Number\x20of\x20dependency\x20objects.'),'reference_count':z['number']()['describe']('Number\x20of\x20reference\x20objects.'),'other_count':z['number']()['describe']('Number\x20of\x20objects\x20with\x20invalid/missing\x20role\x20(in\x20\x27other\x27\x20bucket).\x20Normally\x200.'),'by_type':z['record'](z['string'](),z['number']())['describe']('Object\x20count\x20grouped\x20by\x20objectType\x20prefix\x20(e.g.\x20{\x27service\x27:\x201,\x20\x27permission\x27:\x201,\x20\x27guard\x27:\x205}).')})['strict']()['describe']('Aggregate\x20counts\x20for\x20quick\x20project\x20sizing.')})['strict']()['describe']('Objects\x20grouped\x20by\x20role\x20(core/dependency/reference/other)\x20for\x20easier\x20navigation.\x20The\x20\x27other\x27\x20bucket\x20captures\x20objects\x20with\x20invalid\x20roles\x20(H-05\x20fix).\x20The\x20flat\x20`objects`\x20array\x20is\x20preserved\x20for\x20backward\x20compatibility.'),'graphEdgeCount':z['number']()['describe']('Number\x20of\x20persisted\x20graph\x20edges.'),'serviceStatus':z['object']({'published':z['boolean']()['nullable']()['describe']('Whether\x20the\x20on-chain\x20Service\x20is\x20published\x20(live).\x20null\x20=\x20unknown\x20/\x20query\x20failed.'),'paused':z['boolean']()['nullable']()['describe']('Whether\x20the\x20on-chain\x20Service\x20is\x20paused\x20(not\x20accepting\x20orders).\x20null\x20=\x20unknown.')})['strict']()['nullable']()['describe']('On-chain\x20Service\x20status\x20(published\x20/\x20paused).\x20Separate\x20from\x20the\x20project\x27s\x20local\x20lifecycle\x20status.\x20null\x20if\x20the\x20project\x20has\x20no\x20serviceAddress\x20or\x20the\x20on-chain\x20query\x20failed.'),'evaluations':z['array'](z['object']({'id':z['string'](),'evalType':z['enum'](['risk','trust','completeness','value','worth_buying']),'score':z['number']()['nullable'](),'summary':z['string']()['nullable'](),'details':EvaluationDetailsSchema['nullable']()['describe']('Structured\x20inspection\x20content\x20(criterion\x20scores,\x20findings,\x20strengths).\x20Null\x20for\x20evaluations\x20created\x20before\x20details\x20were\x20stored.'),'evaluatedAt':z['number']()})['strict']())['describe']('Stored\x20evaluation\x20results\x20(most\x20recent\x20first).'),'versions':z['array'](z['object']({'version':z['string'](),'description':z['string']()['nullable'](),'createdAt':z['number']()})['strict']())['describe']('Project\x20version\x20history.')})['strict'](),AddObjectResultSchema=z['object']({'action':z['literal']('add_object'),'object':ProjectObjectSchema['describe']('The\x20added\x20project-object\x20relationship.')})['strict'](),RemoveObjectResultSchema=z['object']({'action':z['literal']('remove_object'),'removed':z['literal'](!![])['describe']('Always\x20true\x20—\x20confirms\x20removal.')})['strict'](),UpdateObjectResultSchema=z['object']({'action':z['literal']('update_object'),'object':ProjectObjectSchema['describe']('The\x20updated\x20project-object\x20relationship.')})['strict'](),CreateVersionResultSchema=z['object']({'action':z['literal']('create_version'),'version':z['object']({'version':z['string']()['describe']('Version\x20tag\x20(e.g.\x20\x27v2\x27).'),'description':z['string']()['nullable'](),'createdAt':z['number']()})['strict']()})['strict'](),BuildGraphResultSchema=z['object']({'action':z['literal']('build_graph'),'async_mode':z['boolean']()['optional']()['describe']('True\x20when\x20graph\x20is\x20building\x20asynchronously\x20(background\x20task).\x20When\x20true,\x20call\x20query_task_status\x20with\x20task_id\x20to\x20retrieve\x20the\x20result.'),'task_id':z['string']()['optional']()['describe']('Async\x20task\x20id\x20—\x20present\x20only\x20when\x20async_mode=true.\x20Use\x20with\x20query_task_status.'),'nodeCount':z['number']()['optional']()['describe']('Total\x20nodes\x20in\x20the\x20constructed\x20graph\x20(sync\x20mode\x20only).'),'edgeCount':z['number']()['optional']()['describe']('Total\x20edges\x20(after\x20conflict\x20resolution\x20+\x20dedup)\x20(sync\x20mode\x20only).'),'edgesBySource':z['record'](z['string'](),z['number']())['optional']()['describe']('Edge\x20counts\x20by\x20source:\x20{\x20internal:\x20N,\x20registrar:\x20N,\x20potential:\x20N\x20}\x20(sync\x20mode\x20only).'),'reputationCount':z['number']()['optional']()['describe']('Number\x20of\x20objects\x20with\x20Registrar\x20reputation\x20data\x20(sync\x20mode\x20only).'),'builtAt':z['number']()['optional']()['describe']('Build\x20timestamp\x20in\x20ms\x20(sync\x20mode\x20only).'),'binding_verification':z['object']({'service':z['string']()['describe']('Service\x20object\x20address\x20that\x20was\x20verified.'),'bindings':z['record'](z['string'](),z['object']({'expected':z['string']()['describe']('Expected\x20target\x20object\x20type.'),'actual':z['string']()['nullable']()['describe']('Actual\x20on-chain\x20value\x20(address\x20or\x20null).'),'count':z['number']()['optional']()['describe']('Item\x20count\x20for\x20array\x20fields\x20(order_allocators,\x20arbitrations).'),'verified':z['boolean']()['describe']('Whether\x20the\x20binding\x20exists\x20on-chain.')}))['describe']('Per-field\x20binding\x20verification\x20result.'),'all_verified':z['boolean']()['describe']('True\x20when\x20all\x20critical\x20bindings\x20exist\x20on-chain.')})['nullable']()['optional']()['describe']('On-chain\x20verification\x20of\x20Service\x20bindings\x20(F-15).\x20Null\x20when\x20no\x20Service\x20address\x20or\x20query\x20failed.\x20Sync\x20mode\x20only.'),'topEdges':z['array'](z['object']({'source':z['string']()['describe']('Source\x20object\x20address.'),'target':z['string']()['describe']('Target\x20object\x20address.'),'fieldName':z['string']()['nullable']()['describe']('Field\x20name\x20on\x20the\x20source\x20object\x20(or\x20null).'),'relationshipType':z['string']()['describe']('Relationship\x20type\x20(bind,\x20create,\x20trigger,\x20etc.).'),'weight':z['number']()['nullable']()['describe']('Edge\x20weight\x20(0-1,\x20higher\x20=\x20more\x20important).'),'verified':z['boolean']()['describe']('Whether\x20the\x20edge\x20has\x20been\x20verified\x20on-chain.')})['strict']())['optional']()['describe']('Top\x205\x20critical\x20edges\x20by\x20weight\x20(sync\x20mode\x20only).\x20Preview\x20of\x20the\x20most\x20important\x20relationships\x20—\x20call\x20get_graph\x20for\x20the\x20full\x20list.'),'visualization':z['string']()['optional']()['describe']('Mermaid-style\x20ASCII\x20visualization\x20of\x20top\x20edges\x20(sync\x20mode\x20only).\x20Compact\x20format:\x20\x27source\x20--field-->\x20target\x27.'),'hint':z['string']()['optional']()['describe']('User-facing\x20hint\x20—\x20guides\x20to\x20next\x20action\x20(e.g.\x20call\x20get_graph\x20for\x20full\x20list,\x20or\x20query_task_status\x20for\x20async\x20result).')})['strict'](),GetGraphResultSchema=z['object']({'action':z['literal']('get_graph'),'edges':z['array'](z['object']({'sourceObject':z['string'](),'targetObject':z['string'](),'edgeSource':z['enum'](['internal','registrar','potential']),'relationshipType':z['string'](),'fieldName':z['string']()['nullable'](),'depth':z['number'](),'verified':z['boolean'](),'weight':z['number'](),'direction':z['string']()['nullable']()})['strict']())['describe']('Persisted\x20graph\x20edges.')})['strict'](),EvaluateProjectResultSchema=z['object']({'action':z['literal']('evaluate_project'),'evaluationType':z['enum'](['risk','trust','completeness','value','worth_buying']),'score':z['number']()['describe']('Overall\x20score\x20(0-100,\x20higher\x20=\x20better).\x200\x20when\x20needsLlm=true.'),'summary':z['string'](),'criterionScores':z['array'](z['object']({'name':z['string'](),'score':z['number'](),'weight':z['number'](),'rationale':z['string']()})['strict']())['describe']('Per-criterion\x20scores.\x20Empty\x20when\x20needsLlm=true.'),'findings':z['array'](z['object']({'criterion':z['string'](),'severity':z['enum'](['critical','warning','info']),'message':z['string'](),'deduction':z['number']()})['strict']())['describe']('Negative\x20findings\x20(deductions).\x20Empty\x20when\x20needsLlm=true.'),'strengths':z['array'](z['string']())['describe']('Positive\x20evidence.\x20Empty\x20when\x20needsLlm=true.'),'needsLlm':z['boolean']()['describe']('True\x20for\x20worth_buying/value\x20evaluations.\x20When\x20true,\x20process\x20the\x20llmPrompt\x20with\x20an\x20LLM\x20and\x20call\x20save_evaluation\x20to\x20store\x20the\x20result.'),'llmPrompt':z['string']()['optional']()['describe']('Present\x20when\x20needsLlm=true.\x20Send\x20this\x20prompt\x20to\x20an\x20LLM,\x20parse\x20the\x20JSON\x20response,\x20and\x20call\x20save_evaluation.'),'evaluationId':z['string']()['describe']('ID\x20of\x20the\x20stored\x20evaluation\x20record\x20(for\x20rule-based\x20types).\x20Empty\x20for\x20LLM-assisted\x20types.')})['strict'](),SaveEvaluationResultSchema=z['object']({'action':z['literal']('save_evaluation'),'evaluation':z['object']({'id':z['string'](),'evalType':z['enum'](['risk','trust','completeness','value','worth_buying']),'score':z['number']()['nullable'](),'summary':z['string']()['nullable'](),'evaluatedAt':z['number']()})['strict']()['describe']('The\x20stored\x20evaluation\x20record.')})['strict'](),CompareProjectsResultSchema=z['object']({'action':z['literal']('compare_projects'),'evaluationType':z['enum'](['risk','trust','completeness','value','worth_buying']),'ranking':z['array'](z['object']({'projectId':z['string'](),'projectName':z['string'](),'score':z['number']()['nullable'](),'summary':z['string']()['nullable'](),'evaluatedAt':z['number']()['nullable']()})['strict']())['describe']('Projects\x20sorted\x20by\x20score\x20descending\x20(nulls\x20last).'),'bestProjectId':z['string']()['nullable']()['describe']('Project\x20ID\x20with\x20the\x20highest\x20score,\x20or\x20null\x20if\x20none\x20have\x20evaluations.')})['strict'](),RefreshObjectsResultSchema=z['object']({'action':z['literal']('refresh_objects'),'refreshedCount':z['number']()['describe']('Number\x20of\x20objects\x20re-fetched\x20from\x20chain.'),'failedCount':z['number']()['describe']('Number\x20of\x20objects\x20that\x20failed\x20to\x20refresh.'),'refreshedAt':z['number']()['describe']('Refresh\x20timestamp\x20(ms).')})['strict'](),DeleteProjectResultSchema=z['object']({'action':z['literal']('delete_project'),'deleted':z['literal'](!![])['describe']('Always\x20true\x20—\x20confirms\x20deletion\x20of\x20the\x20project\x20and\x20all\x20associated\x20objects,\x20evaluations,\x20versions,\x20and\x20graph\x20edges.')})['strict'](),GetObjectDiffResultSchema=z['object']({'action':z['literal']('get_object_diff'),'address':z['string'](),'fromTime':z['number'](),'toTime':z['number'](),'changedFields':z['array'](z['object']({'fieldPath':z['string']()['describe']('Dotted\x20field\x20path\x20(e.g.\x20\x27machine\x27,\x20\x27sales[0].price\x27).'),'oldValue':z['unknown']()['describe']('Previous\x20value\x20(null\x20if\x20field\x20was\x20added).'),'newValue':z['unknown']()['describe']('New\x20value\x20(null\x20if\x20field\x20was\x20removed).'),'changeType':z['enum'](['added','removed','modified'])})['strict']())['describe']('Changed\x20fields\x20between\x20the\x20two\x20timestamps.')})['strict'](),GenerateDeploymentDocResultSchema=z['object']({'action':z['literal']('generate_deployment_doc'),'markdown':z['string']()['describe']('Generated\x20deployment\x20document\x20markdown\x20content\x20(follows\x2071-deployment-list-spec).'),'validation':z['object']({'valid':z['boolean']()['describe']('True\x20iff\x20no\x20D-check\x20FAIL.'),'checks':z['array'](z['object']({'check_id':z['string'](),'description':z['string'](),'status':z['enum'](['PASS','FAIL','WARN']),'notes':z['string']()['optional']()})['strict']())['describe']('D-01..D-20\x20check\x20results\x20(20\x20deployment\x20checks\x20including\x20D-19\x20Machine\x20entry-node\x20forward\x20and\x20D-20\x20Service\x20compensation_fund).'),'errors':z['array'](z['string']())['describe']('List\x20of\x20FAIL\x20error\x20messages.')})['strict']()['describe']('Deployment\x20doc\x20validation\x20result\x20against\x20D-01..D-20.'),'saved':z['boolean']()['describe']('Whether\x20the\x20markdown\x20was\x20persisted\x20to\x20SQLite\x20project_documents\x20table.'),'detail_level':z['enum'](['summary','detailed','full'])['describe']('Effective\x20detail\x20level\x20used\x20to\x20render\x20the\x20deployment\x20doc.\x20'+'\x27summary\x27\x20(default)\x20shows\x20only\x20key\x20bindings;\x20\x27detailed\x27\x20adds\x20sale/arbitration\x20lists;\x20\x27full\x27\x20shows\x20complete\x20config.'),'stage_gate':z['object']({'stage':z['number']()['describe']('The\x20stage\x20that\x20was\x20validated\x20(4\x20=\x20deployment\x20doc\x20generation\x20gate).'),'passed':z['boolean']()['describe']('True\x20iff\x20no\x20FAIL\x20checks\x20exist\x20—\x20gate\x20allows\x20advancing\x20to\x20Stage\x205.'),'can_proceed':z['boolean']()['describe']('Alias\x20for\x20`passed`\x20—\x20whether\x20the\x20stage\x20gate\x20allows\x20advancement.'),'blocking_issues':z['array'](z['string']())['describe']('FAIL\x20status\x20messages\x20—\x20must\x20be\x20resolved\x20before\x20deploying.'),'warnings':z['array'](z['string']())['describe']('WARN\x20status\x20messages\x20—\x20non-blocking,\x20user\x20may\x20proceed\x20at\x20own\x20risk.'),'checks':z['array'](z['object']({'dimension':z['enum'](['semantic','tools','reversibility','risk','isolation','gas_budget'])['describe']('The\x20validation\x20dimension.'),'status':z['enum'](['PASS','WARN','FAIL'])['describe']('Check\x20result\x20status.'),'message':z['string']()['describe']('Human-readable\x20check\x20result\x20message.')})['strict']())['describe']('Per-dimension\x20check\x20results.')})['strict']()['describe']('Stage\x20gate\x20validation\x20(GLM6\x205-stage\x20lifecycle\x20handoff).\x20Validates\x20Stage\x203\x20risk\x20score\x20threshold\x20(>=80\x20PASS,\x20>=50\x20WARN,\x20<50\x20FAIL)\x20and\x20Stage\x204\x20deployment\x20doc\x20generation\x20prerequisite.'),'deployment_scan':z['object']({'overall_readiness':z['enum'](['ready','blocked','warnings'])['describe']('\x27ready\x27\x20=\x20all\x2020\x20checks\x20pass;\x20\x27blocked\x27\x20=\x20any\x20critical\x20fail;\x20\x27warnings\x27\x20=\x20only\x20warning\x20fails.'),'critical_count':z['number']()['describe']('Number\x20of\x20critical\x20findings\x20(blocks\x20deployment).'),'warning_count':z['number']()['describe']('Number\x20of\x20warning\x20findings\x20(non-blocking).'),'findings':z['array'](z['object']({'check_id':z['string']()['describe']('D-XX\x20check\x20id\x20(e.g.\x20\x27D-19\x27)\x20or\x20sub-id\x20(e.g.\x20\x27D-10a\x27).'),'severity':z['enum'](['critical','warning','info'])['describe']('Finding\x20severity.'),'message':z['string']()['describe']('Human-readable\x20finding\x20message.'),'location':z['string']()['optional']()['describe']('Document\x20location\x20(section,\x20line,\x20or\x20step\x20id).'),'suggestion':z['string']()['optional']()['describe']('Suggested\x20fix.')})['strict']())['describe']('All\x20findings\x20from\x20the\x2020\x20D-XX\x20deployment\x20checks.'),'checks':z['object']({'D01_object_defined':z['enum'](['pass','fail']),'D02_dependency_complete':z['enum'](['pass','fail']),'D03_scenario_covered':z['enum'](['pass','fail']),'D04_testnet_topo_order':z['enum'](['pass','fail']),'D05_testnet_network':z['enum'](['pass','fail']),'D06_testnet_replace':z['enum'](['pass','fail']),'D07_permission_index':z['enum'](['pass','fail']),'D08_guard_gen_passport':z['enum'](['pass','fail']),'D09_machine_node_count':z['enum'](['pass','fail']),'D10_substep_coherence':z['enum'](['pass','fail']),'D11_mainnet_testnet_match':z['enum'](['pass','fail']),'D12_mainnet_network':z['enum'](['pass','fail']),'D13_mainnet_replace':z['enum'](['pass','fail']),'D14_testnet_verification':z['enum'](['pass','fail']),'D15_mainnet_verification':z['enum'](['pass','fail']),'D16_no_critical_risk':z['enum'](['pass','fail']),'D17_no_high_risk':z['enum'](['pass','fail']),'D18_completeness_checklist':z['enum'](['pass','fail']),'D19_machine_entry_forward':z['enum'](['pass','fail'])['describe']('Machine\x20entry\x20node\x20(prev_node=\x27\x27)\x20forwards\x20non-empty\x20—\x20avoids\x20Progress\x20stuck\x20at\x20current=\x27\x27.'),'D20_service_compensation_fund':z['enum'](['pass','fail'])['describe']('Service\x20compensation_fund\x20(Balance<T>)\x20present\x20or\x20industry-exempt\x20—\x20ensures\x20arbitration\x20refund\x20capability.')})['strict']()['describe']('Per-check\x20pass/fail\x20status\x20for\x20all\x2020\x20D-XX\x20checks.')})['strict']()['describe']('Deployment\x20scanner\x20result\x20—\x2020\x20D-XX\x20checks\x20including\x20D-19\x20(Machine\x20entry\x20forward)\x20and\x20D-20\x20(Service\x20compensation_fund).')})['strict'](),PreEvaluateCheckResultSchema=z['object']({'action':z['literal']('pre_evaluate_check'),'ready':z['boolean']()['describe']('True\x20if\x20evaluate_project\x20will\x20produce\x20meaningful\x20results\x20(no\x20hard\x20blockers).\x20'+'If\x20false,\x20address\x20the\x20items\x20in\x20`missing`\x20first.'),'missing':z['array'](z['object']({'id':z['string']()['describe']('Check\x20ID\x20(e.g.\x20PE-01,\x20PE-06).'),'description':z['string']()['describe']('What\x20is\x20missing.'),'impact':z['string']()['describe']('How\x20it\x20affects\x20the\x20evaluation,\x20and\x20how\x20to\x20fix\x20it.')})['strict']())['describe']('Hard\x20blockers\x20—\x20must\x20be\x20resolved\x20before\x20evaluation.'),'warnings':z['array'](z['object']({'id':z['string']()['describe']('Check\x20ID\x20(e.g.\x20PE-02,\x20PE-03).'),'description':z['string']()['describe']('What\x20is\x20suboptimal.'),'impact':z['string']()['describe']('How\x20it\x20affects\x20the\x20evaluation,\x20and\x20how\x20to\x20improve\x20it.')})['strict']())['describe']('Soft\x20issues\x20—\x20evaluation\x20runs\x20but\x20quality\x20may\x20be\x20reduced.'),'summary':z['string']()['describe']('One-line\x20human-readable\x20status.'),'counts':z['object']({'objects':z['number']()['describe']('Total\x20project_objects\x20count.'),'edges':z['number']()['describe']('Total\x20graph_edges\x20count.'),'uncached':z['number']()['describe']('Objects\x20with\x20no\x20cached\x20on-chain\x20data.'),'stale':z['number']()['describe']('Objects\x20with\x20cache\x20older\x20than\x2024\x20hours.'),'dangling_edges':z['number']()['describe']('Edges\x20referencing\x20objects\x20not\x20in\x20project_objects.'),'drafts':z['number']()['describe']('Objects\x20still\x20in\x20draft\x20(not\x20yet\x20on-chain).')})['strict']()['describe']('Quick-scan\x20counts\x20for\x20triage.')})['strict'](),VerifyDeploymentResultSchema=z['object']({'action':z['literal']('verify_deployment'),'verifiedCount':z['number']()['describe']('Number\x20of\x20objects\x20actually\x20verified\x20(excludes\x20drafts\x20and\x20unreachable).'),'matched':z['number']()['describe']('Objects\x20whose\x20on-chain\x20state\x20matches\x20SQLite.'),'mismatched':z['number']()['describe']('Objects\x20whose\x20on-chain\x20state\x20differs\x20from\x20SQLite\x20(see\x20`results[].differences`).'),'missing':z['number']()['describe']('Objects\x20that\x20no\x20longer\x20exist\x20on-chain\x20(deleted\x20or\x20never\x20deployed).'),'unreachable':z['number']()['describe']('Objects\x20that\x20could\x20not\x20be\x20queried\x20(network\x20error).'),'results':z['array'](z['object']({'objectAddress':z['string'](),'objectName':z['string']()['nullable'](),'objectType':z['string']()['nullable'](),'status':z['enum'](['matched','mismatched','missing','unreachable'])['describe']('Verification\x20status:\x20\x27matched\x27\x20=\x20on-chain\x20matches\x20SQLite;\x20'+'\x27mismatched\x27\x20=\x20on-chain\x20differs\x20(see\x20differences);\x20'+'\x27missing\x27\x20=\x20object\x20no\x20longer\x20exists\x20on-chain;\x20'+'\x27unreachable\x27\x20=\x20query\x20failed\x20(network\x20error\x20or\x20rate\x20limit).'),'differences':z['array'](z['object']({'field':z['string']()['describe']('Field\x20path\x20that\x20differs.'),'sqlite':z['unknown']()['describe']('Value\x20recorded\x20in\x20SQLite.'),'onchain':z['unknown']()['describe']('Value\x20observed\x20on-chain.')})['strict']())['optional']()['describe']('Per-field\x20differences\x20(only\x20for\x20status=\x27mismatched\x27).'),'bindings':z['object']({'machine':z['boolean'](),'permission':z['boolean'](),'buy_guard':z['boolean'](),'order_allocators':z['boolean']()})['strict']()['optional']()['describe']('Critical\x20binding\x20status\x20(only\x20for\x20Service\x20objects).\x20'+'Each\x20boolean\x20indicates\x20whether\x20the\x20binding\x20is\x20set\x20to\x20a\x20non-null\x20value\x20on-chain.'),'error':z['string']()['optional']()['describe']('Error\x20message\x20(only\x20for\x20status=\x27unreachable\x27).')})['strict']())['describe']('Per-object\x20verification\x20results.'),'summary':z['string']()['describe']('One-line\x20human-readable\x20summary.')})['strict'](),MachineGraphForwardSchema=z['object']({'name':z['string']()['describe']('Forward\x20name.'),'weight':z['number']()['describe']('Forward\x20weight\x20(for\x20weighted\x20threshold).'),'guard':z['string']()['nullable']()['describe']('Guard\x20object\x20address\x20if\x20the\x20forward\x20is\x20guard-gated,\x20else\x20null.'),'named_operator':z['string']()['nullable']()['describe']('Named\x20operator\x20if\x20set,\x20else\x20null.'),'permission_index':z['number']()['nullable']()['describe']('Permission\x20index\x20if\x20set,\x20else\x20null.')})['strict'](),MachineGraphEdgeSchema=z['object']({'from':z['string']()['describe']('Source\x20node\x20name\x20(prev_node).'),'to':z['string']()['describe']('Target\x20node\x20name\x20(next_node).'),'threshold':z['number']()['describe']('Minimum\x20weighted\x20forward\x20count\x20required\x20to\x20advance.'),'forwards':z['array'](MachineGraphForwardSchema)['describe']('Forwards\x20within\x20this\x20pair\x20—\x20each\x20is\x20an\x20advance\x20operation.')})['strict'](),MachineGraphNodeSchema=z['object']({'name':z['string']()['describe']('Node\x20name.'),'description':z['string']()['nullable']()['describe']('Node\x20description\x20if\x20set,\x20else\x20null.')})['strict'](),GetMachineGraphResultSchema=z['object']({'action':z['literal']('get_machine_graph'),'machineAddress':z['string']()['describe']('The\x20Machine\x20object\x20address.'),'machineName':z['string']()['nullable']()['describe']('The\x20Machine\x27s\x20local\x20name\x20(from\x20LocalMark)\x20if\x20available.'),'nodes':z['array'](MachineGraphNodeSchema)['describe']('Workflow\x20nodes\x20(states).'),'edges':z['array'](MachineGraphEdgeSchema)['describe']('Directed\x20edges\x20(pairs)\x20connecting\x20nodes.\x20Each\x20edge\x20has\x20a\x20threshold\x20and\x20forwards.'),'published':z['boolean']()['nullable']()['describe']('Whether\x20the\x20Machine\x20is\x20published\x20(locked\x20for\x20production).\x20null\x20=\x20unknown.'),'paused':z['boolean']()['nullable']()['describe']('Whether\x20the\x20Machine\x20is\x20paused\x20(not\x20generating\x20new\x20Progress).\x20null\x20=\x20unknown.'),'mermaid':z['string']()['describe']('Mermaid\x20stateDiagram-v2\x20string\x20visualizing\x20the\x20directed\x20graph.\x20Entry\x20nodes\x20start\x20from\x20[*].\x20Edge\x20labels\x20include\x20forward\x20name\x20+\x20threshold\x20+\x20guard\x20info.\x20Cycles\x20(revision\x20loops)\x20are\x20rendered\x20as\x20normal\x20edges.\x20Includes\x20a\x20color\x20legend\x20comment\x20block\x20+\x20BehaviorTree.CPP-style\x20color\x20annotations\x20(entry=green,\x20terminal=red,\x20revision=amber,\x20normal=blue).\x20Renderable\x20in\x20markdown\x20viewers.'),'tree_outline':z['string']()['describe']('Indented\x20Markdown\x20outline\x20of\x20the\x20directed\x20graph\x20(human-editable\x20format).\x20Lists\x20edges\x20as\x20outline\x20entries\x20with\x20forwards\x20nested\x20under\x20each\x20edge.\x20Includes\x20a\x20Backrefs\x20section\x20consolidating\x20incoming\x20edges\x20per\x20node\x20(editing\x20aid\x20—\x20answers\x20\x27who\x20transitions\x20INTO\x20node\x20X?\x27).\x20Bidirectional\x20with\x20parseMachineTreeIndented().\x20Includes\x20JSON\x20code\x20block\x20for\x20round-trip\x20safety.\x20Use\x20this\x20for\x20the\x20download\x20->\x20edit\x20->\x20republish\x20workflow.'),'ascii_art':z['string']()['describe']('ASCII\x20art\x20directed\x20graph\x20visualization\x20using\x20arrow\x20notation\x20(A\x20-forward->\x20B).\x20Cycle\x20(revision\x20loop)\x20and\x20terminal\x20annotations\x20included.\x20Terminal-friendly,\x20avoids\x20JSON\x20escaping\x20issues\x20that\x20affect\x20multi-line\x20Mermaid\x20strings.\x20Use\x20when\x20rendering\x20in\x20plain-text\x20contexts.'),'markmap':z['string']()['describe']('Markmap-compatible\x20Markdown\x20string\x20(heading\x20levels\x20represent\x20hierarchy).\x20Edge-centric\x20layout\x20with\x20forwards\x20nested\x20under\x20edges.\x20Renderable\x20by\x20VS\x20Code\x20Markmap\x20extension\x20or\x20markmap.js.\x20Provides\x20an\x20interactive\x20mind-map\x20view\x20of\x20the\x20workflow.')})['strict'](),GuardGraphNodeSchema=z['lazy'](()=>z['object']({'type':z['string']()['describe']('Guard\x20node\x20type\x20(logic_and,\x20query,\x20identifier,\x20context,\x20calc_*,\x20convert_*,\x20vec_*,\x20etc.).'),'nodes':z['array'](GuardGraphNodeSchema)['optional']()['describe']('Child\x20nodes\x20(for\x20logic_and/or,\x20calc_*,\x20vec_contains_*,\x20etc.).'),'node':GuardGraphNodeSchema['optional']()['describe']('Single\x20child\x20(for\x20logic_not,\x20convert_*,\x20value_type).'),'nodeLeft':GuardGraphNodeSchema['optional']()['describe']('Left\x20child\x20(for\x20vec_indexof_*).'),'nodeRight':GuardGraphNodeSchema['optional']()['describe']('Right\x20child\x20(for\x20vec_indexof_*).'),'query':z['union']([z['number'](),z['string']()])['optional']()['describe']('Query\x20instruction\x20ID\x20or\x20name\x20(for\x20query\x20nodes).'),'object':z['object']({'identifier':z['number']()['optional'](),'convert_witness':z['number']()['optional']()})['optional']()['describe']('Query\x20target\x20object\x20reference.'),'parameters':z['array'](GuardGraphNodeSchema)['optional']()['describe']('Query\x20parameters.'),'identifier':z['number']()['optional']()['describe']('Table\x20entry\x20index\x20(for\x20identifier\x20nodes).'),'context':z['string']()['optional']()['describe']('Context\x20type:\x20Signer,\x20Clock,\x20or\x20Guard.')})['strict']()),GuardTableEntrySchema=z['object']({'identifier':z['number']()['describe']('Table\x20entry\x20index\x20(0-255).'),'b_submission':z['boolean']()['describe']('Whether\x20this\x20entry\x20is\x20submitted\x20at\x20runtime.'),'value_type':z['union']([z['number'](),z['string']()])['describe']('Value\x20type\x20(numeric\x20code\x20or\x20name).'),'value':z['unknown']()['optional']()['describe']('Constant\x20value\x20(if\x20b_submission=false).'),'name':z['string']()['optional']()['describe']('Human-readable\x20name/description.')})['strict'](),GetGuardGraphResultSchema=z['object']({'action':z['literal']('get_guard_graph'),'guardAddress':z['string']()['describe']('The\x20Guard\x20object\x20address.'),'guardName':z['string']()['nullable']()['describe']('The\x20Guard\x27s\x20local\x20name\x20(from\x20LocalMark)\x20if\x20available.'),'root':GuardGraphNodeSchema['describe']('Root\x20computation\x20node\x20(returns\x20Bool).\x20The\x20tree\x20is\x20recursive\x20—\x20each\x20node\x20may\x20have\x20children.'),'table':z['array'](GuardTableEntrySchema)['describe']('Guard\x20data\x20table\x20entries\x20(constants\x20+\x20submission\x20slots).'),'rely':z['object']({'guards':z['array'](z['string']()),'logic_or':z['boolean']()['optional']()})['nullable']()['describe']('Rely\x20dependencies\x20(other\x20Guards\x20this\x20Guard\x20depends\x20on).\x20null\x20=\x20no\x20rely.'),'immutable':z['boolean']()['nullable']()['describe']('Whether\x20the\x20Guard\x20is\x20immutable\x20(frozen\x20for\x20verification).\x20null\x20=\x20unknown.'),'mermaid':z['string']()['describe']('Mermaid\x20flowchart\x20TD\x20string\x20visualizing\x20the\x20tree.\x20Node\x20shapes:\x20{}=decision\x20(logic_*),\x20[]=computation/query,\x20([])=leaf\x20(identifier),\x20{{}}=context.\x20Includes\x20a\x20color\x20legend\x20comment\x20block\x20+\x20BehaviorTree.CPP-style\x20color\x20annotations\x20(control=blue,\x20decision=amber,\x20computation=purple,\x20query=cyan,\x20leaf=gray,\x20context=green).'),'tree_outline':z['string']()['describe']('Indented\x20Markdown\x20outline\x20of\x20the\x20tree\x20(human-editable\x20format).\x20Bidirectional\x20with\x20parseGuardTreeIndented().\x20Includes\x20JSON\x20code\x20block\x20for\x20round-trip\x20safety.'),'ascii_art':z['string']()['describe']('ASCII\x20art\x20tree\x20visualization\x20using\x20box-drawing\x20characters\x20(+--\x20--,\x20|).\x20Table\x20summary\x20appended.\x20Terminal-friendly,\x20avoids\x20JSON\x20escaping\x20issues\x20that\x20affect\x20multi-line\x20Mermaid\x20strings.'),'markmap':z['string']()['describe']('Markmap-compatible\x20Markdown\x20string\x20(heading\x20levels\x20represent\x20tree\x20depth).\x20Root\x20->\x20branches\x20->\x20leaves\x20hierarchy.\x20Renderable\x20by\x20VS\x20Code\x20Markmap\x20extension\x20or\x20markmap.js.\x20Provides\x20an\x20interactive\x20mind-map\x20view\x20of\x20the\x20Guard\x20tree.')})['strict'](),PlanObjectEditResultSchema=z['object']({'action':z['literal']('plan_object_edit'),'plan_id':z['string']()['describe']('Unique\x20plan\x20ID\x20(UUID).\x20Pass\x20to\x20apply_object_edit\x20within\x2010\x20minutes\x20to\x20execute.'),'object_kind':z['enum'](['machine','guard'])['describe']('The\x20object\x20kind\x20that\x20was\x20edited.'),'object_address':z['string']()['describe']('The\x20on-chain\x20object\x20address\x20being\x20edited.'),'object_name':z['string']()['nullable']()['describe']('The\x20object\x27s\x20local\x20name\x20(from\x20LocalMark)\x20if\x20available.'),'expected_hash':z['string']()['describe']('SHA-256\x20hash\x20of\x20(current_onchain_state\x20+\x20edited_content).\x20Pass\x20to\x20apply_object_edit\x20as\x20expected_hash\x20for\x20stale-edit\x20detection.'),'diff':z['object']({'added':z['array'](z['string']())['describe']('List\x20of\x20added\x20items\x20(node\x20names,\x20edge\x20\x27from->to\x27,\x20table\x20identifiers,\x20etc.).'),'removed':z['array'](z['string']())['describe']('List\x20of\x20removed\x20items.'),'modified':z['array'](z['string']())['describe']('List\x20of\x20modified\x20items\x20with\x20a\x20brief\x20description\x20of\x20the\x20change.'),'summary':z['string']()['describe']('Human-readable\x20one-line\x20diff\x20summary\x20(e.g.\x20\x272\x20nodes\x20added,\x201\x20edge\x20removed,\x203\x20forwards\x20modified\x27).')})['describe']('Structured\x20diff\x20between\x20current\x20on-chain\x20state\x20and\x20edited\x20content.'),'warnings':z['array'](z['object']({'id':z['string']()['describe']('Warning\x20identifier\x20(e.g.\x20\x27W-01\x27).'),'description':z['string']()['describe']('What\x20the\x20warning\x20is\x20about.'),'impact':z['string']()['describe']('Potential\x20impact\x20if\x20ignored.')}))['describe']('Non-blocking\x20warnings\x20(the\x20edit\x20can\x20still\x20proceed,\x20but\x20review\x20is\x20recommended).'),'blocking_errors':z['array'](z['object']({'id':z['string']()['describe']('Error\x20identifier\x20(e.g.\x20\x27E-01\x27).'),'description':z['string']()['describe']('What\x20the\x20error\x20is.'),'impact':z['string']()['describe']('Why\x20this\x20blocks\x20execution.')}))['describe']('Blocking\x20errors\x20(the\x20edit\x20CANNOT\x20proceed\x20until\x20these\x20are\x20fixed).'),'can_apply':z['boolean']()['describe']('Whether\x20apply_object_edit\x20can\x20proceed.\x20false\x20if\x20blocking_errors\x20is\x20non-empty.'),'prepared_call':z['unknown']()['nullable']()['describe']('The\x20prepared\x20onchain_operations\x20call\x20data\x20(operation_type\x20+\x20data).\x20null\x20if\x20can_apply=false.\x20Pass\x20this\x20to\x20onchain_operations\x20to\x20execute\x20the\x20edit.'),'expires_at':z['string']()['describe']('ISO\x20timestamp\x20when\x20the\x20plan\x20expires\x20(10\x20minutes\x20from\x20creation).\x20After\x20expiry,\x20apply_object_edit\x20will\x20refuse\x20to\x20proceed.'),'summary':z['string']()['describe']('Human-readable\x20one-line\x20plan\x20summary.')})['strict'](),ApplyObjectEditResultSchema=z['object']({'action':z['literal']('apply_object_edit'),'plan_id':z['string']()['describe']('The\x20plan\x20ID\x20that\x20was\x20applied.'),'applied':z['boolean']()['describe']('Whether\x20the\x20plan\x20was\x20successfully\x20applied\x20(hash\x20matched\x20and\x20plan\x20was\x20fresh).'),'hash_match':z['boolean']()['describe']('Whether\x20the\x20expected_hash\x20matched\x20the\x20stored\x20plan\x20hash.\x20false\x20=\x20stale\x20edit\x20detected.'),'prepared_call':z['unknown']()['nullable']()['describe']('The\x20prepared\x20onchain_operations\x20call\x20data.\x20Pass\x20this\x20to\x20onchain_operations\x20to\x20execute\x20the\x20edit\x20on-chain.\x20null\x20if\x20applied=false.'),'error':z['string']()['nullable']()['describe']('Error\x20message\x20if\x20applied=false\x20(e.g.\x20\x27Plan\x20not\x20found\x27,\x20\x27Hash\x20mismatch\x20—\x20on-chain\x20state\x20changed\x27,\x20\x27Plan\x20expired\x27).\x20null\x20on\x20success.'),'next_step':z['string']()['describe']('Instructions\x20for\x20the\x20next\x20step\x20(typically\x20\x27Pass\x20prepared_call\x20to\x20onchain_operations\x20to\x20execute\x20the\x20edit\x20on-chain\x27).')})['strict'](),PatchMachineNodesResultSchema=z['object']({'action':z['literal']('patch_machine_nodes'),'machine_address':z['string']()['describe']('The\x20Machine\x20object\x20address\x20being\x20patched.'),'machine_name':z['string']()['nullable']()['describe']('The\x20Machine\x27s\x20local\x20name\x20(from\x20LocalMark)\x20if\x20available.'),'operations_applied':z['number']()['describe']('Number\x20of\x20patch\x20operations\x20successfully\x20applied.'),'operations_failed':z['array'](z['object']({'operation':z['string']()['describe']('The\x20original\x20operation\x20string.'),'error':z['string']()['describe']('Why\x20the\x20operation\x20failed.')}))['describe']('Operations\x20that\x20failed\x20parse/apply\x20(not\x20applied).\x20Also\x20surfaced\x20as\x20E-OP\x20entries\x20in\x20blocking_errors\x20for\x20schema\x20symmetry\x20with\x20plan_object_edit.'),'patched_nodes':z['array'](z['unknown']())['describe']('The\x20patched\x20Machine\x20nodes\x20(after\x20applying\x20all\x20successful\x20operations).'),'patched_edges':z['array'](z['unknown']())['describe']('The\x20patched\x20Machine\x20edges\x20(after\x20applying\x20all\x20successful\x20operations).'),'diff':z['object']({'added':z['array'](z['string']())['describe']('List\x20of\x20added\x20items.'),'removed':z['array'](z['string']())['describe']('List\x20of\x20removed\x20items.'),'modified':z['array'](z['string']())['describe']('List\x20of\x20modified\x20items.'),'summary':z['string']()['describe']('Human-readable\x20one-line\x20diff\x20summary.')})['describe']('Diff\x20between\x20original\x20and\x20patched\x20Machine.'),'warnings':z['array'](z['object']({'id':z['string']()['describe']('Warning\x20identifier\x20(e.g.\x20\x27W-01\x27\x20unreachable\x20node,\x20\x27W-02\x27\x20self-loop).'),'description':z['string']()['describe']('What\x20the\x20warning\x20is\x20about.'),'impact':z['string']()['describe']('Potential\x20impact\x20if\x20ignored.')}))['describe']('Non-blocking\x20warnings\x20from\x20validateMachine\x20(W-01\x20unreachable,\x20W-02\x20self-loop).'),'blocking_errors':z['array'](z['object']({'id':z['string']()['describe']('Error\x20identifier\x20(e.g.\x20\x27E-01\x27\x20no\x20entry\x20forward,\x20\x27E-02\x27\x20orphan\x20endpoint,\x20\x27E-03\x27\x20too\x20many\x20nodes,\x20\x27E-OP\x27\x20operation\x20failed).'),'description':z['string']()['describe']('What\x20the\x20error\x20is.'),'impact':z['string']()['describe']('Why\x20this\x20blocks\x20execution.')}))['describe']('Blocking\x20errors\x20(operation\x20failures\x20+\x20structural\x20validation).\x20The\x20patch\x20CANNOT\x20proceed\x20until\x20these\x20are\x20fixed.\x20Empty\x20array\x20when\x20can_apply=true.'),'can_apply':z['boolean']()['describe']('Whether\x20the\x20patch\x20can\x20be\x20applied\x20on-chain.\x20false\x20if\x20any\x20blocking_errors\x20exist\x20(operation\x20failures\x20or\x20validateMachine\x20blocking\x20errors).'),'prepared_call':z['unknown']()['nullable']()['describe']('The\x20prepared\x20onchain_operations\x20call\x20data.\x20null\x20if\x20can_apply=false.'),'summary':z['string']()['describe']('Human-readable\x20one-line\x20patch\x20summary.')})['strict'](),PatchGuardTreeResultSchema=z['object']({'action':z['literal']('patch_guard_tree'),'guard_address':z['string']()['describe']('The\x20Guard\x20object\x20address\x20being\x20patched.'),'guard_name':z['string']()['nullable']()['describe']('The\x20Guard\x27s\x20local\x20name\x20(from\x20LocalMark)\x20if\x20available.'),'operations_applied':z['number']()['describe']('Number\x20of\x20Guard\x20patch\x20operations\x20successfully\x20applied.'),'operations_failed':z['array'](z['object']({'operation':z['string']()['describe']('The\x20original\x20operation\x20string.'),'error':z['string']()['describe']('Why\x20the\x20operation\x20failed.')}))['describe']('Operations\x20that\x20failed\x20parse/apply\x20(not\x20applied).\x20Also\x20surfaced\x20as\x20E-OP\x20entries\x20in\x20blocking_errors.'),'patched_root':z['unknown']()['describe']('The\x20patched\x20Guard\x20root\x20node\x20(after\x20applying\x20all\x20successful\x20operations).\x20For\x20set_root,\x20this\x20is\x20the\x20new\x20root;\x20otherwise\x20the\x20original\x20root\x20unchanged.'),'patched_table':z['array'](z['unknown']())['describe']('The\x20patched\x20Guard\x20table\x20entries\x20(after\x20applying\x20all\x20successful\x20table\x20operations).'),'patched_rely':z['unknown']()['nullable']()['describe']('The\x20patched\x20rely\x20field\x20(cross-guard\x20composition).\x20null\x20if\x20rely\x20was\x20cleared\x20or\x20never\x20set.\x20Shape:\x20{\x20guards:\x20string[],\x20logic_or?:\x20boolean\x20}.'),'diff':z['object']({'added':z['array'](z['string']())['describe']('List\x20of\x20added\x20items\x20(table\x20entries,\x20tree\x20nodes).'),'removed':z['array'](z['string']())['describe']('List\x20of\x20removed\x20items.'),'modified':z['array'](z['string']())['describe']('List\x20of\x20modified\x20items\x20with\x20a\x20brief\x20description\x20of\x20the\x20change.'),'summary':z['string']()['describe']('Human-readable\x20one-line\x20diff\x20summary.')})['describe']('Diff\x20between\x20original\x20and\x20patched\x20Guard\x20(root\x20tree\x20+\x20table).'),'warnings':z['array'](z['object']({'id':z['string']()['describe']('Warning\x20identifier\x20(e.g.\x20\x27W-01\x27\x20dead\x20submission\x20slot,\x20\x27W-02\x27\x20orphan\x20table\x20entry,\x20\x27W-03\x27\x20deep\x20nesting).'),'description':z['string']()['describe']('What\x20the\x20warning\x20is\x20about.'),'impact':z['string']()['describe']('Potential\x20impact\x20if\x20ignored.')}))['describe']('Non-blocking\x20warnings\x20from\x20validateGuard\x20(W-01\x20dead\x20submission\x20slot,\x20W-02\x20orphan\x20table\x20entry,\x20W-03\x20deep\x20nesting\x20>\x2016).'),'blocking_errors':z['array'](z['object']({'id':z['string']()['describe']('Error\x20identifier\x20(e.g.\x20\x27E-01\x27\x20no\x20root,\x20\x27E-02\x27\x20identifier\x20not\x20in\x20table,\x20\x27E-03\x27\x20table\x20too\x20large,\x20\x27E-OP\x27\x20operation\x20failed).'),'description':z['string']()['describe']('What\x20the\x20error\x20is.'),'impact':z['string']()['describe']('Why\x20this\x20blocks\x20execution.')}))['describe']('Blocking\x20errors\x20(operation\x20failures\x20+\x20structural\x20validation).\x20The\x20patch\x20CANNOT\x20proceed\x20until\x20these\x20are\x20fixed.\x20Empty\x20array\x20when\x20can_apply=true.'),'can_apply':z['boolean']()['describe']('Whether\x20the\x20patch\x20can\x20be\x20applied\x20on-chain.\x20false\x20if\x20any\x20blocking_errors\x20exist.'),'prepared_call':z['unknown']()['nullable']()['describe']('The\x20prepared\x20onchain_operations\x20call\x20data\x20(operation_type=\x27guard\x27).\x20null\x20if\x20can_apply=false.'),'summary':z['string']()['describe']('Human-readable\x20one-line\x20patch\x20summary.')})['strict'](),CloneProjectToNetworkResultSchema=z['object']({'action':z['literal']('clone_project_to_network'),'new_project_id':z['string']()['describe']('The\x20newly\x20created\x20project\x27s\x20UUID.'),'new_prefix':z['string']()['describe']('New\x20project\x20prefix\x20(\x27<source_prefix>_<target_network>\x27).'),'target_network':z['enum'](['testnet','mainnet'])['describe']('The\x20target\x20network\x20the\x20new\x20project\x20is\x20bound\x20to.'),'cloned_objects_count':z['number']()['describe']('Number\x20of\x20object\x20metadata\x20entries\x20copied\x20(objectAddress\x20is\x20empty\x20—\x20await\x20on-chain\x20deployment).'),'message':z['string']()['describe']('Human-readable\x20summary\x20of\x20the\x20clone\x20operation.'),'next_steps':z['string']()['describe']('Instructions\x20for\x20deploying\x20the\x20cloned\x20objects\x20on\x20the\x20target\x20network.')})['strict'](),MigrateNetworkResultSchema=z['object']({'action':z['literal']('migrate_network'),'new_project_id':z['string']()['describe']('The\x20newly\x20created\x20project\x27s\x20UUID.'),'new_prefix':z['string']()['describe']('New\x20project\x20prefix\x20(\x27<source_prefix>_<target_network>\x27).'),'target_network':z['enum'](['testnet','mainnet'])['describe']('The\x20target\x20network\x20the\x20new\x20project\x20is\x20bound\x20to.'),'cloned_objects_count':z['number']()['describe']('Number\x20of\x20object\x20metadata\x20entries\x20copied\x20(objectAddress\x20is\x20empty\x20—\x20await\x20on-chain\x20deployment).'),'message':z['string']()['describe']('Human-readable\x20summary\x20of\x20the\x20migration\x20operation.'),'next_steps':z['string']()['describe']('Instructions\x20for\x20deploying\x20the\x20migrated\x20objects\x20on\x20the\x20target\x20network.')})['strict'](),MigrationPlanStepSchema=z['object']({'step':z['number']()['describe']('Step\x20number\x20(1-5).'),'status':z['enum'](['completed','pending_user_action'])['describe']('Whether\x20this\x20step\x20is\x20done\x20or\x20awaits\x20user\x20action.'),'action':z['string']()['describe']('The\x20action\x20to\x20perform\x20(e.g.\x20\x27clone_project_to_network\x27,\x20\x27onchain_operations\x27,\x20\x27local_mark_operation\x27,\x20\x27update_project\x27,\x20\x27build_graph\x27).'),'description':z['string']()['describe']('Human-readable\x20description\x20of\x20what\x20this\x20step\x20does.'),'result':z['string']()['optional']()['describe']('Result\x20of\x20this\x20step\x20(only\x20present\x20when\x20status=\x27completed\x27).'),'deployment_plan':z['array'](z['object']({'order':z['number'](),'object_type':z['string'](),'object_name':z['string'](),'operation_type':z['string'](),'localmark_name':z['string'](),'note':z['string']()}))['optional']()['describe']('Deployment\x20plan\x20for\x20step\x202\x20(on-chain\x20deployment).\x20Only\x20present\x20for\x20step\x202.'),'names_to_register':z['array'](z['string']())['optional']()['describe']('LocalMark\x20names\x20to\x20re-register\x20on\x20mainnet.\x20Only\x20present\x20for\x20step\x203.'),'critical_note':z['string']()['optional']()['describe']('Critical\x20note\x20for\x20this\x20step.')})['strict'](),MigrateToMainnetResultSchema=z['object']({'action':z['literal']('migrate_to_mainnet'),'migration_status':z['string']()['describe']('Overall\x20migration\x20status\x20(e.g.\x20\x27step_1_complete_steps_2_5_pending_user_action\x27).'),'source_project':z['object']({'prefix':z['string'](),'network':z['string'](),'preserved':z['boolean']()['describe']('Whether\x20the\x20source\x20project\x20is\x20preserved\x20unchanged\x20(always\x20true).')})['strict'](),'target_project':z['object']({'prefix':z['string'](),'project_id':z['string'](),'network':z['string'](),'cloned_objects_count':z['number']()})['strict'](),'key_principle':z['string']()['describe']('Explains\x20that\x20testnet/mainnet\x20are\x20different\x20projects\x20with\x20different\x20addresses\x20for\x20same\x20names.'),'payment_token_decision':z['object']({'round':z['string']()['describe']('Decision\x20round\x20identifier\x20(e.g.\x20\x27M1\x27).'),'question':z['string']()['describe']('Question\x20asking\x20whether\x20to\x20keep\x20WOW\x20or\x20switch\x20to\x20a\x20stablecoin\x20when\x20migrating\x20testnet\x20→\x20mainnet.'),'options':z['array'](z['string']())['describe']('Available\x20choices\x20(e.g.\x20Keep\x20WOW\x20/\x20Switch\x20to\x20USDT\x20/\x20Switch\x20to\x20USDC\x20/\x20Other\x20stablecoin).'),'default':z['string']()['optional']()['describe']('Recommended\x20default\x20choice\x20(Keep\x20WOW).'),'note':z['string']()['optional']()['describe']('Guidance:\x20mainnet\x20stablecoins\x20are\x20available\x20via\x20the\x20ETH\x20mainnet\x20cross-chain\x20bridge;\x20if\x20switching,\x20update\x20Service/Treasury/Allocation\x20type_parameter\x20before\x20publishing.')})['strict']()['describe']('Payment-token\x20migration\x20decision.\x20testnet\x20recommends\x20WOW;\x20mainnet\x20supports\x20USDT\x20and\x20other\x20stablecoins\x20via\x20the\x20ETH\x20mainnet\x20bridge.\x20Must\x20be\x20resolved\x20BEFORE\x20step\x202\x20(on-chain\x20deployment)\x20because\x20the\x20Service/Treasury/Allocation\x20type_parameter\x20determines\x20the\x20payment\x20token.'),'migration_plan':z['array'](MigrationPlanStepSchema)['describe']('5-step\x20migration\x20plan.\x20Step\x201\x20is\x20completed;\x20steps\x202-5\x20require\x20user\x20action.'),'summary':z['string']()['describe']('Human-readable\x20summary\x20of\x20the\x20migration.')})['strict'](),RecommendIndustryResultSchema=z['object']({'action':z['literal']('recommend_industry'),'intent':z['string']()['describe']('The\x20intent\x20text\x20used\x20for\x20inference.'),'inferred_traits':z['record'](z['unknown']())['describe']('10-dim\x20industry\x20traits\x20inferred\x20from\x20intent.'),'inference_confidence':z['number']()['describe']('Inference\x20confidence\x200-1\x20(matched\x20trait\x20count\x20/\x2010).'),'matched_keywords':z['array'](z['string']())['describe']('Keywords\x20that\x20triggered\x20trait\x20inference.'),'recommendations':z['array'](RecommendedIndustryItemSchema)['describe']('Top-3\x20similar\x20industries\x20+\x20reference\x20examples.'),'hint':z['string']()['describe']('How\x20to\x20apply\x20the\x20recommendation\x20(create_project\x20with\x20project_industry).')})['strict'](),ModeSummarySchema=z['object']({'name':z['string'](),'display_name':z['string'](),'version':z['string'](),'derived_from':z['string']()['nullable']()['describe']('Source\x20builtin\x20mode\x20(derive_user_mode)\x20or\x20null.'),'owner':z['string']()['optional']()['describe']('Mode\x20owner\x20(custom\x20modes\x20only).'),'key_risk':z['string'](),'machine_nodes':z['array'](z['string']())['describe']('Machine\x20shape\x20node\x20names.'),'similar_industries':z['array'](z['string']())['optional'](),'evolution_history':z['array'](z['object']({'version':z['string'](),'changed_at':z['number'](),'changes':z['array'](z['string']())})['strict']())['optional']()})['strict'](),ListModesResultSchema=z['object']({'action':z['literal']('list_modes'),'builtin_modes':z['array'](ModeSummarySchema)['describe']('Builtin\x20industry\x20modes\x20(use\x20name\x20as\x20project_industry).'),'user_modes':z['array'](ModeSummarySchema)['describe']('Caller\x27s\x20custom\x20modes\x20(derive/evolve/register).'),'owner':z['string']()['describe']('Owner\x20key\x20for\x20custom\x20modes\x20(local\x20single-user).'),'hint':z['string']()})['strict'](),DeriveUserModeResultSchema=z['object']({'action':z['literal']('derive_user_mode'),'mode':ModeSummarySchema['describe']('The\x20derived\x20(and\x20registered)\x20custom\x20mode.'),'hint':z['string']()})['strict'](),EvolveUserModeResultSchema=z['object']({'action':z['literal']('evolve_user_mode'),'mode':ModeSummarySchema['describe']('The\x20evolved\x20custom\x20mode\x20(version\x20bumped).'),'hint':z['string']()})['strict'](),RegisterUserModeResultSchema=z['object']({'action':z['literal']('register_user_mode'),'mode':ModeSummarySchema['describe']('The\x20registered\x20fully-custom\x20mode.'),'hint':z['string']()})['strict'](),UnregisterUserModeResultSchema=z['object']({'action':z['literal']('unregister_user_mode'),'removed':z['literal'](!![]),'mode_name':z['string']()})['strict'](),MetricInfoSchema=z['object']({'metric_id':z['string'](),'display_name':z['string'](),'description':z['string'](),'type':z['enum'](['risk','benefit']),'scale':z['enum'](['level','numeric','percentage']),'weight':z['number'](),'scope':z['enum'](['builtin','custom']),'owner':z['string']()['optional']()})['strict'](),RegisterCustomMetricResultSchema=z['object']({'action':z['literal']('register_custom_metric'),'metric':MetricInfoSchema['describe']('The\x20registered\x20custom\x20metric\x20(globally\x20effective).'),'hint':z['string']()})['strict'](),ConstraintInfoSchema=z['object']({'constraint_id':z['string'](),'display_name':z['string'](),'description':z['string'](),'rule':z['record'](z['unknown']())['describe']('Constraint\x20rule\x20(4\x20types\x20—\x20see\x20constraint_rule\x20input).'),'severity':z['enum'](['hard','soft']),'on_violation':z['enum'](['block','warn','log']),'scope':z['enum'](['builtin','custom']),'owner':z['string']()['optional']()})['strict'](),RegisterCustomConstraintResultSchema=z['object']({'action':z['literal']('register_custom_constraint'),'constraint':ConstraintInfoSchema['describe']('The\x20registered\x20custom\x20constraint.'),'hint':z['string']()})['strict'](),ListMetricsConstraintsResultSchema=z['object']({'action':z['literal']('list_metrics_constraints'),'metrics':z['array'](MetricInfoSchema),'constraints':z['array'](ConstraintInfoSchema),'hint':z['string']()})['strict'](),KeywordMatchSchema=z['object']({'keyword':z['string'](),'category':z['string'](),'matched_objects':z['array'](z['string']()),'required_level':z['enum'](['R','C','OPTIONAL']),'match_count':z['number']()})['strict'](),AnalyzeIntentResultSchema=z['object']({'action':z['literal']('analyze_intent'),'intent_parsed':z['object']({'primary_object':z['string']()['describe']('Primary\x20object\x20inferred\x20from\x20the\x20intent\x20keywords.'),'secondary_objects':z['array'](z['string']())['describe']('Supporting\x20objects\x20typically\x20required\x20alongside\x20the\x20primary\x20one.'),'detected_scenes':z['array'](z['object']({'object':z['string'](),'scene_id':z['string']()['describe']('Free-form\x20scene\x20id,\x20e.g.\x20\x27retail\x27,\x20\x27rental_return\x27.')})['strict']())['describe']('Scenes\x20detected\x20from\x20the\x20intent\x20(used\x20for\x20template\x20selection).'),'industry':z['string']()['describe']('Industry\x20mode\x20resolved\x20from\x20the\x20intent\x20(defaults\x20to\x20\x27general\x27).'),'keyword_matches':z['array'](KeywordMatchSchema)['describe']('All\x20keyword\x20matches\x20that\x20drove\x20the\x20identification.')})['strict'](),'puzzles':z['record'](z['object']({'puzzle':z['unknown'](),'completeness':z['unknown'](),'missing_dimensions':z['array'](z['string']())})['strict']())['describe']('Per-object\x20puzzle\x20snapshot,\x20keyed\x20by\x20object_type.\x20Pass\x20this\x20UNCHANGED\x20to\x20aggregate_risks.'),'overall_completeness':z['enum'](['complete','partial','empty']),'next_step':z['string']()['describe']('Human-readable\x20suggestion\x20for\x20the\x20next\x20puzzle\x20step.'),'recommended_creation_order':z['array'](z['string']())['describe']('Recommended\x20object\x20creation\x20order\x20(dependency\x20topology).'),'warnings':z['array'](z['string']())})['strict'](),AggregatedRiskSchema=z['object']({'risk_rule_id':z['string']()['describe']('Unified\x20risk\x20rule\x20id,\x20e.g.\x20\x27R-S-01\x27.'),'object_type':z['string'](),'entry_id':z['string']()['describe']('Object\x20entry_id\x20(\x27*\x27\x20when\x20cross-object).'),'severity':z['enum'](['CRITICAL','HIGH','MEDIUM','LOW','INFO']),'message':z['string'](),'fix_suggestion':z['string'](),'details':z['object']({'field_path':z['string']()['optional'](),'actual_value':z['unknown']()['optional'](),'expected_value':z['unknown']()['optional'](),'rule_source':z['string']()['optional']()})['strict']()['optional']()})['strict'](),SafetyFindingSchema=z['object']({'rule_id':z['string']()['describe']('Safety\x20rule\x20id\x20(e.g.\x20\x27REUSE-SERVICE-01\x27,\x20\x27IMMUT-001\x27).'),'severity':z['enum'](['info','warn']),'message':z['string']()})['strict'](),AggregateRisksResultSchema=z['object']({'action':z['literal']('aggregate_risks'),'namespace':z['object']({'prefix':z['string'](),'version':z['string'](),'industry':z['string']()['optional']()})['strict'](),'findings':z['array'](AggregatedRiskSchema)['describe']('All\x20risks\x20found,\x20sorted\x20(CRITICAL\x20first).'),'severity_summary':z['record'](z['number']())['describe']('Counts\x20keyed\x20by\x20severity.'),'status':z['enum'](['RISK_PASSED','RISK_BLOCKED','RISK_PENDING_CONFIRM','RISK_CANCELLED'])['describe']('Aggregated\x20status\x20(62-spec\x20§3.2).\x20RISK_BLOCKED\x20=\x20CRITICAL\x20or\x20above-threshold\x20risks\x20present.'),'pending_confirmations':z['array'](z['object']({'risk_rule_id':z['string'](),'description':z['string'](),'fix_suggestion':z['string'](),'object_type':z['string'](),'entry_id':z['string']()})['strict']())['optional']()['describe']('HIGH\x20risks\x20awaiting\x20user\x20confirmation\x20(only\x20when\x20status=\x27RISK_PENDING_CONFIRM\x27).'),'calibrated_at':z['number']()['describe']('Calibration\x20timestamp\x20(ms).'),'fix_suggestions_grouped':z['record'](z['array'](z['object']({'risk_rule_id':z['string'](),'severity':z['enum'](['CRITICAL','HIGH','MEDIUM','LOW','INFO']),'message':z['string'](),'fix_suggestion':z['string'](),'entry_id':z['string']()})['strict']()))['optional']()['describe']('Fix\x20suggestions\x20grouped\x20by\x20object_type.'),'safety_findings':z['array'](SafetyFindingSchema)['optional']()['describe']('OBJECT_REUSE\x20/\x20IMMUTABILITY\x20findings\x20from\x20safety-rules\x20(only\x20when\x20planned_objects\x20/\x20planned_operations\x20were\x20provided).'),'intent_echo':z['object']({'primary_object':z['string'](),'industry':z['string'](),'overall_completeness':z['enum'](['complete','partial','empty'])})['strict']()['optional']()['describe']('Echo\x20of\x20the\x20auto-run\x20analyze_intent\x20(only\x20when\x20\x27puzzles\x27\x20was\x20omitted\x20and\x20\x27intent\x27\x20was\x20used).'),'warnings':z['array'](z['string']())})['strict'](),TraceSubstepsResultSchema=z['object']({'action':z['literal']('trace_substeps'),'namespace':z['object']({'prefix':z['string'](),'version':z['string']()})['strict'](),'network':z['enum'](['testnet','mainnet']),'coherent':z['boolean']()['describe']('True\x20when\x20no\x20dangling\x20inputs,\x20no\x20cycles,\x20no\x20missing\x20outputs,\x20no\x20cross-step\x20breaks.'),'dangling_inputs':z['array'](z['object']({'substep_id':z['string'](),'missing_ref':z['string'](),'field_path':z['string']()})['strict']())['describe']('Input\x20refs\x20pointing\x20to\x20non-existent\x20substeps.'),'circular_refs':z['array'](z['object']({'cycle':z['array'](z['string']())})['strict']())['describe']('Substep\x20id\x20cycles\x20(when\x20present,\x20topological_order\x20is\x20empty).'),'missing_outputs':z['array'](z['object']({'substep_id':z['string'](),'expected_field':z['string'](),'dependent_substeps':z['array'](z['string']())})['strict']())['describe']('Substeps\x20that\x20should\x20have\x20produced\x20a\x20field\x20but\x20did\x20not.'),'cross_step_breaks':z['array'](z['object']({'source_step':z['string'](),'target_step':z['string'](),'missing_field':z['string']()})['strict']())['describe']('Upstream\x20step\x20failed\x20→\x20downstream\x20cannot\x20proceed.'),'step_details':z['array'](z['object']({'parent_step':z['string'](),'total_substeps':z['number'](),'successful':z['number'](),'failed':z['number'](),'pending':z['number'](),'skipped':z['number'](),'substep_ids':z['array'](z['string']())})['strict']())['describe']('Per-step\x20summary,\x20keyed\x20by\x20parent_step.'),'topological_order':z['array'](z['string']())['describe']('Topological\x20order\x20of\x20substep\x20ids\x20(empty\x20when\x20a\x20cycle\x20exists).'),'d10_check':z['object']({'check_id':z['literal']('D-10'),'description':z['string'](),'status':z['enum'](['PASS','FAIL','WARN']),'notes':z['array'](z['string']())})['strict']()['describe']('D-10\x20substep\x20linkage\x20completeness\x20verdict.')})['strict'](),MerchantGuideResultSchema=z['object']({'action':z['literal']('merchant_guide'),'current_step':z['number']()['describe']('Furthest\x20wizard\x20step\x20reached\x20(2\x20=\x20awaiting\x20industry\x20confirmation;\x209\x20=\x20harness\x20issues\x20found;\x2010\x20=\x20plan\x20ready).'),'step_name':z['string'](),'guide_state':z['object']({'intent_text':z['string'](),'confirmed_industry':z['string']()['optional'](),'currency':z['string']()['optional'](),'deliverables':z['array'](z['unknown']())['optional'](),'payment_override':z['record'](z['unknown']())['optional'](),'trust_override':z['record'](z['unknown']())['optional'](),'adopted_module_ids':z['array'](z['string']())['optional']()})['strict']()['describe']('Wizard\x20state\x20—\x20pass\x20back\x20UNCHANGED\x20on\x20the\x20next\x20merchant_guide\x20call.'),'intent_draft':z['unknown']()['optional']()['describe']('Step\x201-2\x20only:\x20BusinessIntent\x20draft\x20inferred\x20from\x20the\x20description.'),'industry_options':z['object']({'inferred':z['string'](),'confidence':z['number'](),'similar':z['array'](z['string']())})['strict']()['optional']()['describe']('Step\x202\x20only:\x20industry\x20candidates\x20awaiting\x20merchant\x20confirmation.'),'intent':z['unknown']()['optional']()['describe']('Steps\x207-10:\x20final\x20BusinessIntent\x20after\x20merchant\x20overrides.'),'adopted_modules':z['array'](z['object']({'id':z['string'](),'name':z['string'](),'description':z['string'](),'requires_keeper':z['boolean'](),'keeper_hint':z['string']()['optional'](),'user_protections':z['array'](z['string']()),'merchant_obligations':z['array'](z['string']())})['strict']())['optional']()['describe']('Steps\x206-10:\x20adopted\x20business\x20modules\x20with\x20protections/obligations.'),'blueprint':z['object']({'nodes':z['array'](z['object']({'id':z['string'](),'type':z['string'](),'purpose':z['string']()})['strict']()),'edges':z['array'](z['object']({'from':z['string'](),'to':z['string'](),'relation':z['string'](),'required':z['boolean']()})['strict']())})['strict']()['optional']()['describe']('Step\x207:\x20semantic\x20object\x20graph\x20(nodes\x20+\x20edges).'),'evaluation_preview':z['unknown']()['optional']()['describe']('Step\x208:\x20estimated\x20risk/trust/completeness\x20scores\x20+\x20key\x20risks\x20+\x20module\x20boosts.'),'graph_validation':z['object']({'valid':z['boolean'](),'hard_violations':z['array'](z['object']({'id':z['string'](),'description':z['string'](),'fix':z['string']()['optional']()})['strict']()),'soft_notes':z['array'](z['object']({'id':z['string'](),'description':z['string']()})['strict']())})['strict']()['optional']()['describe']('Step\x208:\x20structural\x20validation\x20of\x20the\x20semantic\x20graph.'),'harness_check':z['object']({'module_constraints':z['array'](z['object']({'module':z['string'](),'plan_satisfied':z['boolean'](),'missing':z['array'](z['string']())['optional'](),'reason':z['string']()['optional'](),'estimated_score_boost':z['number']()})['strict']()),'blocking_issues':z['array'](z['object']({'module':z['string'](),'missing_constraints':z['array'](z['string']())['optional'](),'fix':z['string']()['optional']()})['strict']()),'deploy_time_checks':z['array'](z['string']())})['strict']()['optional']()['describe']('Step\x209:\x20module\x20constraint\x20check\x20at\x20blueprint\x20stage\x20+\x20deploy-time\x20checklist.'),'game_theory':z['object']({'summary':z['string'](),'coverage':z['string']()['describe']('Covered/total\x20scenario\x20count,\x20e.g.\x20\x274/5\x27.'),'exposed_scenarios':z['array'](z['string']()),'wow_alignments':z['array'](z['string']())['describe']('Active\x20WOW\x20mechanisms\x20aligning\x20merchant/user\x20incentives.'),'scenarios':z['array'](z['object']({'scenario':z['string'](),'covered':z['boolean'](),'conflict':z['string'](),'user_protection':z['string'](),'evaluation_metric':z['string'](),'recommendation':z['string']()['optional']()})['strict']())})['strict']()['optional']()['describe']('Step\x209\x20(GLM6/93\x20§2.3):\x20merchant-user\x20adversarial\x20scenario\x20coverage.\x205\x20canonical\x20scenarios\x20checked\x20against\x20the\x20blueprint;\x20exposed\x20scenarios\x20include\x20fix\x20recommendations.'),'creation_plan':z['array'](z['object']({'order':z['number'](),'node_id':z['string'](),'object_type':z['string'](),'suggested_name':z['string'](),'depends_on':z['array'](z['string']()),'operation_hint':z['string']()})['strict']())['optional']()['describe']('Step\x2010:\x20topologically\x20ordered\x20creation\x20plan.\x20NOT\x20executed\x20—\x20materialize\x20via\x20create_project\x20+\x20onchain_operations.'),'warnings':z['array'](z['string']()),'next_action':z['string']()['describe']('Human-readable\x20guidance\x20for\x20the\x20next\x20call.')})['strict'](),RadarMonitorAlertSchema=z['object']({'id':z['string'](),'category':z['enum'](['progress_stall','compensation_drop','compensation_insufficient','messenger_timeout','user_action_required','review_window','arb_window','refund_received','anomaly']),'severity':z['enum'](['info','warning','critical']),'title':z['string'](),'message':z['string'](),'action':z['string']()['optional']()['describe']('Suggested\x20next\x20step.'),'timestamp':z['number'](),'order_id':z['string']()['optional'](),'service_id':z['string']()['optional'](),'node':z['string']()['optional'](),'metric':z['object']({'label':z['string'](),'value':z['number'](),'threshold':z['number']()['optional'](),'unit':z['string']()['optional']()})['strict']()['optional']()})['strict'](),RadarForwardSchema=z['object']({'name':z['string']()['describe']('Forward\x20(operation)\x20name.'),'to_node':z['string']()['describe']('Target\x20node\x20after\x20execution.'),'execution_path':z['enum'](['order_holder','permission','named_operator','not_available'])['describe']('How\x20this\x20account\x20may\x20execute\x20it\x20(not_available\x20if\x20it\x20can\x27t).'),'permission_index':z['number']()['optional']()['describe']('Permission\x20index\x20required\x20(if\x20permission-gated).'),'named_operator':z['string']()['optional']()['describe']('Named\x20operator\x20(LocalMark\x20name)\x20required\x20(if\x20named-gated).'),'guard':z['string']()['optional']()['describe']('Guard\x20address\x20gating\x20this\x20forward.'),'semantics':z['string']()['describe']('Human\x20explanation\x20of\x20what\x20executing\x20this\x20forward\x20means.'),'consequence':z['string']()['optional']()['describe']('Consequence\x20hint\x20(completion\x20fund-release\x20/\x20refund\x20path).'),'weight':z['number']()['optional']()['describe']('Forward\x20weight\x20(accumulates\x20toward\x20the\x20pair\x27s\x20threshold).')})['strict'](),RadarPendingClaimSchema=z['object']({'kind':z['enum'](['reward','discount','compensation','rating']),'label':z['string'](),'how':z['string']()['describe']('How\x20to\x20claim\x20(tool\x20+\x20operation\x20hint).')})['strict'](),InterestAnalysisSchema=z['object']({'fund_flow':z['array'](z['string']())['describe']('Where\x20money\x20sits\x20and\x20what\x20releases\x20it\x20(escrow,\x20Allocation\x20waterfall,\x20compensation_fund,\x20or\x20the\x20role\x27s\x20non-settlement\x20stake).'),'responsibility':z['array'](z['string']())['describe']('What\x20this\x20account\x20is\x20semantically\x20liable\x20for\x20right\x20now\x20(permission-gated\x20forwards,\x20guard\x20obligations).'),'leverage':z['array'](z['string']())['describe']('Actions\x20serving\x20the\x20role\x27s\x20own\x20interest\x20(settlement\x20speed,\x20evidence\x20pre-upload,\x20Messenger\x20nudge,\x20arbitration).\x20Informational\x20only.'),'stakes':z['array'](z['string']())['describe']('Downside\x20exposure\x20(arbitration\x20indemnity,\x20arb-loss\x20record,\x20stall\x20statistics,\x20non-delivery,\x20refund\x20aftermath).'),'summary':z['string']()['describe']('One-paragraph\x20role-interest\x20summary.')})['strict'](),OrderRadarResultSchema=z['object']({'account':z['string'](),'progress':z['string'](),'order':z['string']()['optional'](),'current_node':z['string']()['describe']('Current\x20node\x20name\x20(\x27\x27\x20=\x20entry,\x20not\x20yet\x20started).'),'perspective':z['enum'](['merchant','customer','prospect','supplier','collaborator','arbitrator'])['describe']('Derived\x20commercial\x20role\x20from\x20on-chain\x20data\x20(Order.builder\x20+\x20PermissionPerm\x20grants\x20+\x20named\x20operators),\x20never\x20caller-asserted.'),'collaborator_kind':z['enum'](['permission_entity','named_operator'])['optional']()['describe']('Collaborator\x20sub-kind\x20when\x20perspective\x20===\x20\x27collaborator\x27\x20(internal\x20staff\x20vs\x20external\x20operator).'),'roles':z['array'](z['object']({'label':z['string'](),'can_act_now':z['boolean']()})['strict']())['describe']('All\x20roles\x20this\x20account\x20holds\x20on\x20this\x20order\x27s\x20workflow.'),'operable':z['array'](RadarForwardSchema)['describe']('Forwards\x20THIS\x20account\x20can\x20execute\x20NOW\x20(branch\x20options\x20if\x20>1).'),'branch_choice':z['object']({'message':z['string'](),'options':z['array'](z['object']({'forward':z['string'](),'to_node':z['string'](),'consequence':z['string']()['optional']()})['strict']())})['strict']()['optional']()['describe']('Present\x20when\x20>1\x20operable\x20forward.\x20AI\x20MUST\x20present\x20options\x20neutrally;\x20the\x20role\x20decides.'),'waiting_on':z['array'](z['object']({'role':z['string'](),'forwards':z['array'](z['string']())})['strict']())['describe']('What\x20the\x20workflow\x20is\x20waiting\x20on\x20from\x20OTHER\x20roles.'),'pending_claims':z['array'](RadarPendingClaimSchema)['describe']('Unclaimed\x20benefits\x20/\x20post-purchase\x20actions.'),'interest_hints':z['array'](z['string']())['describe']('Perspective-specific\x20own-interest\x20hints\x20(fund-release\x20trigger,\x20settlement\x20cycle,\x20reputation).'),'workflow_unknown':z['boolean']()['describe']('True\x20when\x20Machine\x20data\x20was\x20unavailable\x20—\x20operable/waiting_on\x20unknown.'),'threshold':z['number']()['int']()['min'](0x1)['optional']()['describe']('Current\x20pair\x27s\x20threshold\x20(accumulated\x20forward\x20weights\x20to\x20advance).'),'interest_analysis':InterestAnalysisSchema['optional']()['describe']('Role-specific\x20interest\x20analysis\x20(fund_flow/responsibility/leverage/stakes)\x20—\x20present\x20when\x20order\x20data\x20is\x20available.\x20'+'merchant\x20→\x20merchant-interest;\x20supplier\x20→\x20supplier-interest;\x20collaborator\x20→\x20collaborator-interest;\x20customer\x20→\x20customer-interest.\x20'+'AI\x20MUST\x20surface\x20it\x20as\x20neutral\x20information;\x20the\x20role\x20decides.'),'summary':z['string']()['describe']('One-paragraph\x20AI-ready\x20summary.'),'attached_alerts':z['array'](RadarMonitorAlertSchema)['optional']()['describe']('Order-monitor\x20alerts\x20(stall/compensation/review-window)\x20when\x20radar_include_alerts=true.')})['strict'](),ParticipationRadarResultSchema=z['object']({'action':z['literal']('participation_radar'),'account':z['string']()['describe']('Resolved\x20account\x20address.'),'orders_analyzed':z['number'](),'actionable':z['array'](OrderRadarResultSchema)['describe']('Orders\x20where\x20the\x20account\x20can\x20act\x20NOW\x20or\x20has\x20pending\x20claims\x20(customer\x20perspective\x20first).'),'waiting':z['array'](OrderRadarResultSchema)['describe']('Orders\x20where\x20the\x20account\x20is\x20only\x20waiting\x20on\x20other\x20roles.'),'all_pending_claims':z['array'](RadarPendingClaimSchema['extend']({'progress':z['string']()}))['describe']('All\x20pending\x20claims\x20across\x20orders,\x20tagged\x20with\x20their\x20Progress\x20address.'),'unread_messages_total':z['number']()['describe']('Unread\x20Messenger\x20messages\x20total\x20across\x20all\x20conversations\x20of\x20the\x20radar\x20account\x20(local\x20encrypted\x20storage,\x20read-only\x20—\x20never\x20marks\x20messages\x20viewed;\x200\x20with\x20a\x20data_gaps\x20note\x20when\x20the\x20account\x20is\x20not\x20a\x20local\x20messenger\x20account).'),'data_gaps':z['array'](z['string']())['describe']('Graceful\x20degradation\x20notes\x20(e.g.\x20\x27Order\x200x…\x20not\x20found\x27,\x20\x27Machine\x20nodes\x20unavailable\x27).'),'summary':z['string']()['describe']('Account-level\x20dashboard\x20summary.')})['strict']();export const ProjectOperationOutputSchema=z['object']({'result':z['discriminatedUnion']('action',[ListProjectsResultSchema,CreateProjectResultSchema,CreateProjectFromOnchainResultSchema,UpdateProjectResultSchema,GetProjectDetailResultSchema,AddObjectResultSchema,RemoveObjectResultSchema,UpdateObjectResultSchema,CreateVersionResultSchema,BuildGraphResultSchema,GetGraphResultSchema,EvaluateProjectResultSchema,SaveEvaluationResultSchema,CompareProjectsResultSchema,RefreshObjectsResultSchema,GetObjectDiffResultSchema,DeleteProjectResultSchema,AssembleContextResultSchema,GenerateDeploymentDocResultSchema,PreEvaluateCheckResultSchema,VerifyDeploymentResultSchema,GetMachineGraphResultSchema,GetGuardGraphResultSchema,PlanObjectEditResultSchema,ApplyObjectEditResultSchema,PatchMachineNodesResultSchema,PatchGuardTreeResultSchema,CloneProjectToNetworkResultSchema,MigrateNetworkResultSchema,MigrateToMainnetResultSchema,RecommendIndustryResultSchema,ListModesResultSchema,DeriveUserModeResultSchema,EvolveUserModeResultSchema,RegisterUserModeResultSchema,UnregisterUserModeResultSchema,RegisterCustomMetricResultSchema,RegisterCustomConstraintResultSchema,ListMetricsConstraintsResultSchema,AnalyzeIntentResultSchema,AggregateRisksResultSchema,TraceSubstepsResultSchema,MerchantGuideResultSchema,ParticipationRadarResultSchema])['describe']('Query\x20result\x20—\x20shape\x20depends\x20on\x20action'),'skills_recommended':z['string']()['optional']()['describe']('Skills\x20recommendation\x20hint\x20(F-10).\x20Informational\x20only\x20—\x20MCP\x20executes\x20'+'independently\x20of\x20skills.\x20Present\x20when\x20the\x20action\x20benefits\x20from\x20skills\x27\x20'+'business-semantic\x20guidance\x20(e.g.\x20service/machine/guard/evaluation).\x20'+'Users\x20without\x20skills\x20installed\x20can\x20ignore\x20this\x20field.')})['strict']();