@wowok/agent-mcp 2.7.7 → 2.7.10

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 (441) hide show
  1. package/README.md +2 -2
  2. package/dist/config/runtime.d.ts +1 -1
  3. package/dist/config/runtime.js +1 -1
  4. package/dist/customer/index.d.ts +3 -4
  5. package/dist/customer/index.js +1 -1
  6. package/dist/customer/info-puzzle.js +1 -1
  7. package/dist/customer/order-monitor.d.ts +0 -9
  8. package/dist/customer/order-monitor.js +1 -1
  9. package/dist/customer/order-strategy.d.ts +0 -19
  10. package/dist/customer/order-strategy.js +1 -1
  11. package/dist/customer/reminder-system.d.ts +0 -5
  12. package/dist/customer/reminder-system.js +1 -1
  13. package/dist/evaluation/game-strategy.js +1 -1
  14. package/dist/evaluation/injection.d.ts +6 -0
  15. package/dist/evaluation/injection.js +1 -0
  16. package/dist/evaluation/node-game.js +1 -1
  17. package/dist/examples/machine-multisig-threshold.json +1 -0
  18. package/dist/examples/rental-ziroom-machine-create.json +1 -2
  19. package/dist/examples/rental-ziroom-permission-create.json +1 -2
  20. package/dist/examples/rental-ziroom-service-create.json +1 -2
  21. package/dist/experience/experience-reuse.js +1 -1
  22. package/dist/experience/index.d.ts +2 -1
  23. package/dist/experience/index.js +1 -1
  24. package/dist/experience/persistence-config.d.ts +6 -0
  25. package/dist/experience/persistence-config.js +1 -0
  26. package/dist/experience/persistence.d.ts +21 -0
  27. package/dist/experience/persistence.js +1 -0
  28. package/dist/experience/realtime-feedback.js +1 -1
  29. package/dist/experience/user-profile.js +1 -1
  30. package/dist/extensions/business-modules.d.ts +1 -1
  31. package/dist/extensions/capability-manifest.d.ts +1 -1
  32. package/dist/extensions/types.d.ts +1 -1
  33. package/dist/goal/GoalClassifier.d.ts +17 -0
  34. package/dist/goal/GoalClassifier.js +1 -0
  35. package/dist/goal/GoalEngine.d.ts +120 -0
  36. package/dist/goal/GoalEngine.js +1 -0
  37. package/dist/goal/GoalStore.d.ts +27 -0
  38. package/dist/goal/GoalStore.js +1 -0
  39. package/dist/goal/plan-approval.d.ts +5 -0
  40. package/dist/goal/plan-approval.js +1 -0
  41. package/dist/goal/types.d.ts +76 -0
  42. package/dist/goal/types.js +1 -0
  43. package/dist/harness/index.d.ts +2 -7
  44. package/dist/harness/index.js +1 -1
  45. package/dist/harness/plan.d.ts +1 -1
  46. package/dist/harness/recover.js +1 -1
  47. package/dist/harness/types.d.ts +1 -36
  48. package/dist/harness/verify.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/intent/enrich.js +1 -1
  51. package/dist/intent/matcher.js +1 -1
  52. package/dist/intent/types.d.ts +1 -1
  53. package/dist/intent/types.js +1 -1
  54. package/dist/knowledge/account-marks.d.ts +35 -0
  55. package/dist/knowledge/account-marks.js +1 -0
  56. package/dist/knowledge/arbitration-ledger.js +1 -1
  57. package/dist/knowledge/audit-rules.d.ts +3 -1
  58. package/dist/knowledge/audit-rules.js +1 -1
  59. package/dist/knowledge/contract-invariants.d.ts +53 -0
  60. package/dist/knowledge/contract-invariants.js +1 -0
  61. package/dist/knowledge/dynamic-pricing.d.ts +0 -2
  62. package/dist/knowledge/dynamic-pricing.js +1 -1
  63. package/dist/knowledge/event-semantics.d.ts +20 -0
  64. package/dist/knowledge/event-semantics.js +1 -0
  65. package/dist/knowledge/examples-scanner-cli.js +1 -1
  66. package/dist/knowledge/examples-scanner.js +1 -1
  67. package/dist/knowledge/glossary.js +1 -1
  68. package/dist/knowledge/goal-completion.d.ts +19 -0
  69. package/dist/knowledge/goal-completion.js +1 -0
  70. package/dist/knowledge/guard-submission-prompt.js +1 -1
  71. package/dist/knowledge/guard-translation.js +1 -1
  72. package/dist/knowledge/immutability.d.ts +11 -0
  73. package/dist/knowledge/immutability.js +1 -0
  74. package/dist/knowledge/index.d.ts +13 -6
  75. package/dist/knowledge/index.js +1 -1
  76. package/dist/knowledge/industry-registry.js +1 -1
  77. package/dist/knowledge/intent-metrics.d.ts +1 -1
  78. package/dist/knowledge/jsonrpc-enum.d.ts +37 -0
  79. package/dist/knowledge/jsonrpc-enum.js +1 -0
  80. package/dist/knowledge/machine-confirm.js +1 -1
  81. package/dist/knowledge/machine-risk.js +1 -1
  82. package/dist/knowledge/machine-topology.d.ts +11 -0
  83. package/dist/knowledge/machine-topology.js +1 -1
  84. package/dist/knowledge/machine-translation.js +1 -1
  85. package/dist/knowledge/market-metrics.d.ts +11 -0
  86. package/dist/knowledge/market-metrics.js +1 -1
  87. package/dist/knowledge/mcp-schema-audit-cli.js +1 -1
  88. package/dist/knowledge/mcp-schema-audit.d.ts +1 -0
  89. package/dist/knowledge/mcp-schema-audit.js +1 -1
  90. package/dist/knowledge/messenger-guard-guidance.d.ts +17 -0
  91. package/dist/knowledge/messenger-guard-guidance.js +1 -0
  92. package/dist/knowledge/operation-dictionary.d.ts +18 -0
  93. package/dist/knowledge/operation-dictionary.js +1 -0
  94. package/dist/knowledge/passport-confirm.js +1 -1
  95. package/dist/knowledge/passport-puzzle.js +1 -1
  96. package/dist/knowledge/passport-translation.js +1 -1
  97. package/dist/knowledge/proof-risk.js +1 -1
  98. package/dist/knowledge/safety-rules.js +1 -1
  99. package/dist/knowledge/service-ledger.js +1 -1
  100. package/dist/knowledge/service-risk.js +1 -1
  101. package/dist/knowledge/service-translation.js +1 -1
  102. package/dist/knowledge/supply-chain.d.ts +24 -0
  103. package/dist/knowledge/supply-chain.js +1 -0
  104. package/dist/knowledge/template-registry.js +1 -1
  105. package/dist/knowledge/tools-reference.js +1 -1
  106. package/dist/knowledge/trust-metrics.d.ts +27 -2
  107. package/dist/knowledge/trust-metrics.js +1 -1
  108. package/dist/knowledge/workflow-guidance.d.ts +22 -0
  109. package/dist/knowledge/workflow-guidance.js +1 -1
  110. package/dist/knowledge/workspace-lists.d.ts +56 -0
  111. package/dist/knowledge/workspace-lists.js +1 -0
  112. package/dist/loop-engineering/context-collect.d.ts +1 -1
  113. package/dist/monitor/EventRouter.d.ts +10 -0
  114. package/dist/monitor/EventRouter.js +1 -0
  115. package/dist/monitor/EventStore.d.ts +98 -0
  116. package/dist/monitor/EventStore.js +1 -0
  117. package/dist/monitor/MonitorLoop.d.ts +79 -0
  118. package/dist/monitor/MonitorLoop.js +1 -0
  119. package/dist/monitor/ProblemBridge.d.ts +32 -0
  120. package/dist/monitor/ProblemBridge.js +1 -0
  121. package/dist/monitor/ScopeResolver.d.ts +59 -0
  122. package/dist/monitor/ScopeResolver.js +1 -0
  123. package/dist/monitor/SubscriptionStore.d.ts +13 -0
  124. package/dist/monitor/SubscriptionStore.js +1 -0
  125. package/dist/monitor/normalize.d.ts +8 -0
  126. package/dist/monitor/normalize.js +1 -0
  127. package/dist/monitor/types.d.ts +89 -0
  128. package/dist/monitor/types.js +1 -0
  129. package/dist/participation/radar-core.d.ts +0 -1
  130. package/dist/participation/radar-core.js +1 -1
  131. package/dist/persona/address-format.d.ts +6 -0
  132. package/dist/persona/address-format.js +1 -0
  133. package/dist/persona/analyzer.js +1 -1
  134. package/dist/persona/distill-goal.d.ts +20 -0
  135. package/dist/persona/distill-goal.js +1 -0
  136. package/dist/persona/index.d.ts +5 -0
  137. package/dist/persona/index.js +1 -1
  138. package/dist/persona/model.js +1 -1
  139. package/dist/persona/types.d.ts +1 -1
  140. package/dist/persona/types.js +1 -1
  141. package/dist/playbooks/service-build/business-puzzle.js +1 -0
  142. package/dist/{project → playbooks/service-build}/context-assembly.d.ts +9 -4
  143. package/dist/playbooks/service-build/context-assembly.js +1 -0
  144. package/dist/{project → playbooks/service-build}/game-theory.d.ts +1 -1
  145. package/dist/playbooks/service-build/index.d.ts +14 -0
  146. package/dist/playbooks/service-build/index.js +1 -0
  147. package/dist/{project → playbooks/service-build}/intent-analyzer.d.ts +1 -1
  148. package/dist/playbooks/service-build/intent-analyzer.js +1 -0
  149. package/dist/playbooks/service-build/machine-nodes.d.ts +25 -0
  150. package/dist/playbooks/service-build/machine-nodes.js +1 -0
  151. package/dist/playbooks/service-build/machine-panorama.d.ts +43 -0
  152. package/dist/playbooks/service-build/machine-panorama.js +1 -0
  153. package/dist/{project → playbooks/service-build}/merchant-guide.d.ts +1 -1
  154. package/dist/playbooks/service-build/merchant-guide.js +1 -0
  155. package/dist/{project → playbooks/service-build}/mode-actions.d.ts +2 -2
  156. package/dist/playbooks/service-build/mode-actions.js +1 -0
  157. package/dist/playbooks/service-build/namespace.d.ts +2 -0
  158. package/dist/playbooks/service-build/namespace.js +1 -0
  159. package/dist/playbooks/service-build/object-panorama.d.ts +178 -0
  160. package/dist/playbooks/service-build/object-panorama.js +1 -0
  161. package/dist/playbooks/service-build/object-type.d.ts +1 -0
  162. package/dist/playbooks/service-build/object-type.js +1 -0
  163. package/dist/{project → playbooks/service-build}/participation-radar.d.ts +4 -5
  164. package/dist/playbooks/service-build/participation-radar.js +1 -0
  165. package/dist/{project → playbooks/service-build}/pipeline-actions.d.ts +9 -9
  166. package/dist/playbooks/service-build/pipeline-actions.js +1 -0
  167. package/dist/playbooks/service-build/process.d.ts +6 -0
  168. package/dist/playbooks/service-build/process.js +1 -0
  169. package/dist/playbooks/service-build/risk-aggregator.js +1 -0
  170. package/dist/{project → playbooks/service-build}/semantic-graph.d.ts +2 -2
  171. package/dist/playbooks/service-build/service-panorama.d.ts +164 -0
  172. package/dist/playbooks/service-build/service-panorama.js +1 -0
  173. package/dist/review/arb.d.ts +6 -0
  174. package/dist/review/arb.js +1 -0
  175. package/dist/review/demand.d.ts +3 -0
  176. package/dist/review/demand.js +1 -0
  177. package/dist/review/index.d.ts +3 -0
  178. package/dist/review/index.js +1 -0
  179. package/dist/review/machine.d.ts +3 -0
  180. package/dist/review/machine.js +1 -0
  181. package/dist/review/order.d.ts +9 -0
  182. package/dist/review/order.js +1 -0
  183. package/dist/review/progress.d.ts +3 -0
  184. package/dist/review/progress.js +1 -0
  185. package/dist/review/repository.d.ts +3 -0
  186. package/dist/review/repository.js +1 -0
  187. package/dist/review/service.d.ts +5 -0
  188. package/dist/review/service.js +1 -0
  189. package/dist/review/types.d.ts +156 -0
  190. package/dist/review/types.js +1 -0
  191. package/dist/role/derivation.d.ts +19 -2
  192. package/dist/role/derivation.js +1 -1
  193. package/dist/role/index.d.ts +2 -2
  194. package/dist/role/index.js +1 -1
  195. package/dist/role/model.js +1 -1
  196. package/dist/role/resolution.d.ts +16 -0
  197. package/dist/role/resolution.js +1 -1
  198. package/dist/role/types.d.ts +1 -1
  199. package/dist/role/types.js +1 -1
  200. package/dist/rules.d.ts +2 -2
  201. package/dist/rules.js +1 -1
  202. package/dist/safety/confirm-gate.js +1 -1
  203. package/dist/safety/index.d.ts +1 -1
  204. package/dist/safety/index.js +1 -1
  205. package/dist/safety/preview.d.ts +1 -0
  206. package/dist/safety/preview.js +1 -1
  207. package/dist/schema/call/allocation.d.ts +2 -1
  208. package/dist/schema/call/arbitration.d.ts +5 -4
  209. package/dist/schema/call/arbitration.js +1 -1
  210. package/dist/schema/call/base.d.ts +17 -1
  211. package/dist/schema/call/base.js +1 -1
  212. package/dist/schema/call/bridge.d.ts +11 -4
  213. package/dist/schema/call/contact.d.ts +2 -1
  214. package/dist/schema/call/contact.js +1 -1
  215. package/dist/schema/call/demand.d.ts +2 -1
  216. package/dist/schema/call/demand.js +1 -1
  217. package/dist/schema/call/guard.d.ts +6 -3
  218. package/dist/schema/call/handler.d.ts +0 -3
  219. package/dist/schema/call/handler.js +1 -1
  220. package/dist/schema/call/machine.d.ts +4 -2
  221. package/dist/schema/call/machine.js +1 -1
  222. package/dist/schema/call/order.d.ts +2 -1
  223. package/dist/schema/call/payment.d.ts +2 -1
  224. package/dist/schema/call/permission.d.ts +2 -1
  225. package/dist/schema/call/personal.d.ts +39 -1
  226. package/dist/schema/call/personal.js +1 -1
  227. package/dist/schema/call/progress.d.ts +2 -1
  228. package/dist/schema/call/proof.d.ts +4 -2
  229. package/dist/schema/call/repository.d.ts +6 -5
  230. package/dist/schema/call/repository.js +1 -1
  231. package/dist/schema/call/reward.d.ts +2 -13
  232. package/dist/schema/call/reward.js +1 -1
  233. package/dist/schema/call/semantic.d.ts +3 -2
  234. package/dist/schema/call/semantic.js +1 -1
  235. package/dist/schema/call/service.d.ts +2 -1
  236. package/dist/schema/call/service.js +1 -1
  237. package/dist/schema/call/treasury.d.ts +2 -1
  238. package/dist/schema/common/index.js +1 -1
  239. package/dist/schema/evaluation/index.d.ts +146 -0
  240. package/dist/schema/evaluation/index.js +1 -1
  241. package/dist/schema/goal/index.d.ts +317 -0
  242. package/dist/schema/goal/index.js +1 -0
  243. package/dist/schema/goal/planning.d.ts +465 -0
  244. package/dist/schema/goal/planning.js +1 -0
  245. package/dist/schema/index.d.ts +2 -2
  246. package/dist/schema/index.js +1 -1
  247. package/dist/schema/industry-pack/index.d.ts +265 -1
  248. package/dist/schema/industry-pack/index.js +1 -1
  249. package/dist/schema/industry-pack/modes.d.ts +268 -0
  250. package/dist/schema/industry-pack/modes.js +1 -0
  251. package/dist/schema/intent-radar/index.d.ts +30 -3
  252. package/dist/schema/intent-radar/index.js +1 -1
  253. package/dist/schema/local/index.d.ts +9 -0
  254. package/dist/schema/local/index.js +1 -1
  255. package/dist/schema/messenger/index.d.ts +54 -0
  256. package/dist/schema/messenger/index.js +1 -1
  257. package/dist/schema/operations.d.ts +1147 -94
  258. package/dist/schema/operations.js +1 -1
  259. package/dist/schema/permission/index.d.ts +18 -0
  260. package/dist/schema/permission/index.js +1 -1
  261. package/dist/schema/persona/index.d.ts +40 -0
  262. package/dist/schema/persona/index.js +1 -1
  263. package/dist/schema/query/bi.d.ts +783 -0
  264. package/dist/schema/query/bi.js +1 -0
  265. package/dist/schema/query/index.d.ts +1471 -208
  266. package/dist/schema/query/index.js +1 -1
  267. package/dist/schema/schema-version.js +1 -1
  268. package/dist/schema/trust/index.d.ts +17 -0
  269. package/dist/schema/trust/index.js +1 -1
  270. package/dist/schema/utils/skills-recommendation.d.ts +0 -1
  271. package/dist/schema/utils/skills-recommendation.js +1 -1
  272. package/dist/schema/watch/index.d.ts +204 -0
  273. package/dist/schema/watch/index.js +1 -0
  274. package/dist/schema/workflow/index.d.ts +301 -0
  275. package/dist/schema/workflow/index.js +1 -1
  276. package/dist/schema-query-impl/index.js +1 -1
  277. package/dist/schemas/account_operation.output.json +8 -5
  278. package/dist/schemas/account_operation.schema.json +2 -2
  279. package/dist/schemas/bridge_operation.output.json +7 -4
  280. package/dist/schemas/bridge_operation.schema.json +37 -21
  281. package/dist/schemas/config_operation.output.json +1 -1
  282. package/dist/schemas/config_operation.schema.json +1 -1
  283. package/dist/schemas/evaluation_operation.output.json +276 -1
  284. package/dist/schemas/evaluation_operation.schema.json +307 -0
  285. package/dist/schemas/goal_operation.schema.json +1016 -0
  286. package/dist/schemas/guard2file.schema.json +9 -5
  287. package/dist/schemas/index.json +22 -11
  288. package/dist/schemas/industry_pack_operation.output.json +898 -0
  289. package/dist/schemas/industry_pack_operation.schema.json +217 -2
  290. package/dist/schemas/intent_radar.output.json +20 -2
  291. package/dist/schemas/intent_radar.schema.json +10 -1
  292. package/dist/schemas/local_info_operation.output.json +7 -4
  293. package/dist/schemas/local_mark_operation.output.json +7 -4
  294. package/dist/schemas/machineNode2file.schema.json +9 -5
  295. package/dist/schemas/messenger_operation.output.json +107 -4
  296. package/dist/schemas/messenger_operation.schema.json +98 -0
  297. package/dist/schemas/monitor_events.output.json +1435 -0
  298. package/dist/schemas/monitor_events.schema.json +85 -0
  299. package/dist/schemas/monitor_subscription.output.json +1462 -0
  300. package/dist/schemas/monitor_subscription.schema.json +327 -0
  301. package/dist/schemas/onchain_events.output.json +241 -18
  302. package/dist/schemas/onchain_events.schema.json +20 -0
  303. package/dist/schemas/onchain_operations.output.json +12 -7
  304. package/dist/schemas/onchain_operations.schema.json +570 -478
  305. package/dist/schemas/onchain_operations_allocation.schema.json +14 -10
  306. package/dist/schemas/onchain_operations_arbitration.schema.json +17 -12
  307. package/dist/schemas/onchain_operations_contact.schema.json +13 -9
  308. package/dist/schemas/onchain_operations_demand.schema.json +13 -9
  309. package/dist/schemas/onchain_operations_gen_passport.schema.json +9 -5
  310. package/dist/schemas/onchain_operations_gen_proof.schema.json +9 -5
  311. package/dist/schemas/onchain_operations_guard.schema.json +9 -5
  312. package/dist/schemas/onchain_operations_machine.schema.json +17 -13
  313. package/dist/schemas/onchain_operations_order.schema.json +12 -8
  314. package/dist/schemas/onchain_operations_payment.schema.json +10 -6
  315. package/dist/schemas/onchain_operations_permission.schema.json +12 -8
  316. package/dist/schemas/onchain_operations_personal.schema.json +47 -5
  317. package/dist/schemas/onchain_operations_progress.schema.json +12 -8
  318. package/dist/schemas/onchain_operations_proof.schema.json +9 -5
  319. package/dist/schemas/onchain_operations_repository.schema.json +295 -310
  320. package/dist/schemas/onchain_operations_reward.schema.json +17 -13
  321. package/dist/schemas/onchain_operations_service.schema.json +21 -17
  322. package/dist/schemas/onchain_operations_treasury.schema.json +17 -13
  323. package/dist/schemas/onchain_table_data.output.json +4125 -239
  324. package/dist/schemas/onchain_table_data.schema.json +326 -15
  325. package/dist/schemas/permission_operation.output.json +32 -0
  326. package/dist/schemas/permission_operation.schema.json +6 -2
  327. package/dist/schemas/persona_operation.output.json +145 -0
  328. package/dist/schemas/persona_operation.schema.json +28 -2
  329. package/dist/schemas/query_toolkit.output.json +3384 -2040
  330. package/dist/schemas/query_toolkit.schema.json +548 -9
  331. package/dist/schemas/trust_score.output.json +38 -0
  332. package/dist/schemas/trust_score.schema.json +32 -0
  333. package/dist/schemas/watch_operation.output.json +827 -0
  334. package/dist/schemas/watch_operation.schema.json +145 -0
  335. package/dist/schemas/workflow_operation.output.json +263 -5
  336. package/dist/schemas/workflow_operation.schema.json +599 -4
  337. package/dist/task/ProcessStore.d.ts +81 -0
  338. package/dist/task/ProcessStore.js +1 -0
  339. package/dist/task/playbook.d.ts +11 -0
  340. package/dist/task/playbook.js +1 -0
  341. package/dist/task/stage-gate.d.ts +22 -0
  342. package/dist/task/stage-gate.js +1 -0
  343. package/dist/{project → task}/substep-trace.d.ts +6 -45
  344. package/dist/task/types.d.ts +120 -0
  345. package/dist/task/types.js +1 -0
  346. package/dist/tools/handlers/config.js +1 -1
  347. package/dist/tools/handlers/evaluation.js +1 -1
  348. package/dist/tools/handlers/goal.d.ts +4 -0
  349. package/dist/tools/handlers/goal.js +1 -0
  350. package/dist/tools/handlers/industry-pack.js +1 -1
  351. package/dist/tools/handlers/intent-radar.js +1 -1
  352. package/dist/tools/handlers/messenger.js +1 -1
  353. package/dist/tools/handlers/monitor.d.ts +26 -0
  354. package/dist/tools/handlers/monitor.js +1 -0
  355. package/dist/tools/handlers/network.d.ts +1 -0
  356. package/dist/tools/handlers/network.js +1 -0
  357. package/dist/tools/handlers/onchain.js +1 -1
  358. package/dist/tools/handlers/permission.js +1 -1
  359. package/dist/tools/handlers/persona.js +1 -1
  360. package/dist/tools/handlers/query.js +1 -1
  361. package/dist/tools/handlers/trust.d.ts +14 -0
  362. package/dist/tools/handlers/trust.js +1 -1
  363. package/dist/tools/handlers/watch.d.ts +2 -0
  364. package/dist/tools/handlers/watch.js +1 -0
  365. package/dist/tools/handlers/workflow.js +1 -1
  366. package/dist/tools/index.d.ts +4 -0
  367. package/dist/tools/index.js +1 -1
  368. package/dist/tools/shared.js +1 -1
  369. package/dist/tools/wrap.js +1 -1
  370. package/package.json +5 -4
  371. package/dist/customer/post-purchase.d.ts +0 -44
  372. package/dist/customer/post-purchase.js +0 -1
  373. package/dist/harness/checkpoint.d.ts +0 -8
  374. package/dist/harness/checkpoint.js +0 -1
  375. package/dist/knowledge/deployment-scanner.d.ts +0 -66
  376. package/dist/knowledge/deployment-scanner.js +0 -1
  377. package/dist/project/business-puzzle.js +0 -1
  378. package/dist/project/context-assembly.js +0 -1
  379. package/dist/project/deployment-bridge.d.ts +0 -5
  380. package/dist/project/deployment-bridge.js +0 -1
  381. package/dist/project/deployment-doc.d.ts +0 -190
  382. package/dist/project/deployment-doc.js +0 -1
  383. package/dist/project/edit-planner.d.ts +0 -123
  384. package/dist/project/edit-planner.js +0 -1
  385. package/dist/project/evaluation-fix.spec.d.ts +0 -1
  386. package/dist/project/evaluation-fix.spec.js +0 -1
  387. package/dist/project/evaluation.d.ts +0 -127
  388. package/dist/project/evaluation.js +0 -1
  389. package/dist/project/graph-builder.d.ts +0 -51
  390. package/dist/project/graph-builder.js +0 -1
  391. package/dist/project/graph.d.ts +0 -70
  392. package/dist/project/graph.js +0 -1
  393. package/dist/project/handlers.d.ts +0 -540
  394. package/dist/project/handlers.js +0 -1
  395. package/dist/project/index.d.ts +0 -91
  396. package/dist/project/index.js +0 -1
  397. package/dist/project/intent-analyzer.js +0 -1
  398. package/dist/project/machine-nodes.d.ts +0 -2
  399. package/dist/project/machine-nodes.js +0 -1
  400. package/dist/project/merchant-guide.js +0 -1
  401. package/dist/project/migration.d.ts +0 -22
  402. package/dist/project/migration.js +0 -1
  403. package/dist/project/mode-actions.js +0 -1
  404. package/dist/project/namespace.d.ts +0 -72
  405. package/dist/project/namespace.js +0 -1
  406. package/dist/project/participation-radar.js +0 -1
  407. package/dist/project/pipeline-actions.js +0 -1
  408. package/dist/project/project-store.d.ts +0 -110
  409. package/dist/project/project-store.js +0 -1
  410. package/dist/project/query.d.ts +0 -43
  411. package/dist/project/query.js +0 -1
  412. package/dist/project/risk-aggregator.js +0 -1
  413. package/dist/project/rollback-policy.d.ts +0 -45
  414. package/dist/project/rollback-policy.js +0 -1
  415. package/dist/project/semantic-assembler.d.ts +0 -93
  416. package/dist/project/semantic-assembler.js +0 -1
  417. package/dist/project/stage-gate.d.ts +0 -53
  418. package/dist/project/stage-gate.js +0 -1
  419. package/dist/project/task-tracker.d.ts +0 -26
  420. package/dist/project/task-tracker.js +0 -1
  421. package/dist/schema/project/index.d.ts +0 -2015
  422. package/dist/schema/project/index.js +0 -1
  423. package/dist/schema/task-status.d.ts +0 -62
  424. package/dist/schema/task-status.js +0 -1
  425. package/dist/schemas/project_operation.output.json +0 -7877
  426. package/dist/schemas/project_operation.schema.json +0 -1133
  427. package/dist/schemas/query_task_status.output.json +0 -211
  428. package/dist/schemas/query_task_status.schema.json +0 -18
  429. package/dist/tools/handlers/project.d.ts +0 -2
  430. package/dist/tools/handlers/project.js +0 -1
  431. package/dist/tools/handlers/task-status.d.ts +0 -2
  432. package/dist/tools/handlers/task-status.js +0 -1
  433. /package/dist/{project → playbooks/service-build}/business-puzzle.d.ts +0 -0
  434. /package/dist/{project → playbooks/service-build}/game-theory.js +0 -0
  435. /package/dist/{project → playbooks/service-build}/reverse-mapping.d.ts +0 -0
  436. /package/dist/{project → playbooks/service-build}/reverse-mapping.js +0 -0
  437. /package/dist/{project → playbooks/service-build}/risk-aggregator.d.ts +0 -0
  438. /package/dist/{project → playbooks/service-build}/semantic-graph.js +0 -0
  439. /package/dist/{project → playbooks/service-build}/workflow-design-assessment.d.ts +0 -0
  440. /package/dist/{project → playbooks/service-build}/workflow-design-assessment.js +0 -0
  441. /package/dist/{project → task}/substep-trace.js +0 -0
@@ -1,110 +0,0 @@
1
- export declare const CURRENT_SCHEMA_VERSION = "1.0.0";
2
- export declare function projectsRootDir(): string;
3
- export declare function projectDir(prefix: string, version: string): string;
4
- export declare function deploymentDir(prefix: string, version: string): string;
5
- export interface ProjectManifest {
6
- schema_version: string;
7
- mcp_version: string;
8
- prefix: string;
9
- version: string;
10
- created_at: string;
11
- updated_at: string;
12
- forked_from?: string;
13
- needs_recalibration?: boolean;
14
- }
15
- export type ProjectStage = 1 | 2 | 3 | 4 | 5;
16
- export interface StageState {
17
- stage: ProjectStage;
18
- updated_at: number;
19
- stage_meta: Record<ProjectStage, {
20
- committed: boolean;
21
- committed_at?: number;
22
- gate_passed: boolean;
23
- blocking_issues: string[];
24
- completion: number;
25
- }>;
26
- has_published_object: boolean;
27
- archived: boolean;
28
- }
29
- export type AuditEventType = "stage_commit" | "stage_rollback" | "risk_acknowledged" | "fork_created" | "migration_applied" | "gate_validation" | "object_published";
30
- export interface AuditRecord {
31
- timestamp: string;
32
- event: AuditEventType;
33
- stage?: ProjectStage;
34
- reason: string;
35
- affected_files: string[];
36
- user_confirmed?: boolean;
37
- }
38
- export declare function ensureProjectDir(prefix: string, version: string): string;
39
- export declare function initProject(prefix: string, version: string, options?: {
40
- mcpVersion?: string;
41
- forkedFrom?: string;
42
- }): ProjectManifest;
43
- export declare function loadManifest(prefix: string, version: string): ProjectManifest;
44
- export declare function saveManifest(prefix: string, version: string, manifest: ProjectManifest): void;
45
- export declare function loadStageState(prefix: string, version: string): StageState | undefined;
46
- export declare function saveStageState(prefix: string, version: string, state: StageState): void;
47
- export declare function saveProjectFile(prefix: string, version: string, relPath: string, data: unknown): string;
48
- export declare function loadProjectFile<T = unknown>(prefix: string, version: string, relPath: string): T | undefined;
49
- export declare function saveProjectMarkdown(prefix: string, version: string, relPath: string, markdown: string): string;
50
- export declare function appendJsonl(prefix: string, version: string, relPath: string, record: unknown): string;
51
- export declare function appendAudit(prefix: string, version: string, record: AuditRecord): void;
52
- export declare function readAuditLog(prefix: string, version: string): AuditRecord[];
53
- export interface LocalProjectEntry {
54
- dir_name: string;
55
- prefix: string;
56
- version: string;
57
- path: string;
58
- initialized: boolean;
59
- archived: boolean;
60
- needs_migration: boolean;
61
- forked_from?: string;
62
- mtime: number;
63
- }
64
- export declare function parseProjectDirName(dirName: string): {
65
- prefix: string;
66
- version: string;
67
- } | undefined;
68
- export declare function listLocalProjects(): LocalProjectEntry[];
69
- export declare function projectExists(prefix: string, version: string): boolean;
70
- export interface ForkOptions {
71
- newVersion: string;
72
- newPrefix?: string;
73
- mcpVersion?: string;
74
- }
75
- export interface ForkResult {
76
- new_prefix: string;
77
- new_version: string;
78
- new_path: string;
79
- forked_from: string;
80
- copied_files: string[];
81
- }
82
- export declare function forkProject(srcPrefix: string, srcVersion: string, opts: ForkOptions): ForkResult;
83
- export interface ProjectFileEntry {
84
- path: string;
85
- abs_path: string;
86
- size: number;
87
- mtime: number;
88
- kind: "json" | "markdown" | "jsonl" | "other";
89
- }
90
- export declare function listProjectFiles(prefix: string, version: string): ProjectFileEntry[];
91
- export declare function readProjectFile(prefix: string, version: string, relPath: string): string | undefined;
92
- export declare function commitStage(prefix: string, version: string, stage: ProjectStage, options?: {
93
- gatePassed?: boolean;
94
- blockingIssues?: string[];
95
- completion?: number;
96
- reason?: string;
97
- userConfirmed?: boolean;
98
- }): StageState;
99
- export declare function rollbackStage(prefix: string, version: string, toStage: ProjectStage, options?: {
100
- reason?: string;
101
- affectedFiles?: string[];
102
- }): StageState;
103
- export declare function markObjectPublished(prefix: string, version: string, objectName: string): void;
104
- export interface ProjectSyncStatus {
105
- local_exists: boolean;
106
- initialized: boolean;
107
- needs_migration: boolean;
108
- archived: boolean;
109
- }
110
- export declare function getLocalSyncStatus(prefix: string, version: string): ProjectSyncStatus;
@@ -1 +0,0 @@
1
- import{existsSync,mkdirSync,readFileSync,writeFileSync,readdirSync,copyFileSync,statSync,appendFileSync}from'fs';import{dirname,join}from'path';import{getWowMcpDir}from'@wowok/wowok';export const CURRENT_SCHEMA_VERSION='1.0.0';export function projectsRootDir(){return join(getWowMcpDir(),'projects');}export function projectDir(a,b){return join(projectsRootDir(),a+'_'+b);}export function deploymentDir(a,b){return join(projectDir(a,b),'deployment');}function manifestPath(a,b){return join(projectDir(a,b),'manifest.json');}function stageStatePath(a,b){return join(projectDir(a,b),'stage.json');}function auditLogPath(a,b){return join(projectDir(a,b),'audit.jsonl');}export function ensureProjectDir(a,b){const c=projectDir(a,b);return!existsSync(c)&&mkdirSync(c,{'recursive':!![]}),c;}export function initProject(a,b,c={}){ensureProjectDir(a,b);const d=new Date()['toISOString'](),e={'schema_version':CURRENT_SCHEMA_VERSION,'mcp_version':c['mcpVersion']??'unknown','prefix':a,'version':b,'created_at':d,'updated_at':d,'forked_from':c['forkedFrom']};writeFileSync(manifestPath(a,b),JSON['stringify'](e,null,0x2),'utf-8');const f={'stage':0x1,'updated_at':Date['now'](),'stage_meta':{0x1:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x2:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x3:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x4:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x5:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0}},'has_published_object':![],'archived':![]};return saveStageState(a,b,f),appendAudit(a,b,{'timestamp':d,'event':'stage_commit','stage':0x1,'reason':'project\x20initialized'+(c['forkedFrom']?'\x20(forked\x20from\x20'+c['forkedFrom']+')':''),'affected_files':['manifest.json','stage.json']}),e;}export function loadManifest(a,b){const c=manifestPath(a,b);if(!existsSync(c))throw new Error('project\x20not\x20initialized:\x20'+a+'_'+b+'\x20(missing\x20manifest.json)');const d=readFileSync(c,'utf-8');return JSON['parse'](d);}export function saveManifest(a,b,c){c['updated_at']=new Date()['toISOString'](),writeFileSync(manifestPath(a,b),JSON['stringify'](c,null,0x2),'utf-8');}export function loadStageState(a,b){const c=stageStatePath(a,b);if(!existsSync(c))return undefined;const d=readFileSync(c,'utf-8');return JSON['parse'](d);}export function saveStageState(a,b,c){c['updated_at']=Date['now'](),ensureProjectDir(a,b),writeFileSync(stageStatePath(a,b),JSON['stringify'](c,null,0x2),'utf-8');}export function saveProjectFile(a,b,c,d){const e=join(projectDir(a,b),c);return mkdirSync(dirname(e),{'recursive':!![]}),writeFileSync(e,JSON['stringify'](d,null,0x2),'utf-8'),e;}export function loadProjectFile(a,b,c){const d=join(projectDir(a,b),c);if(!existsSync(d))return undefined;const e=readFileSync(d,'utf-8');return JSON['parse'](e);}export function saveProjectMarkdown(a,b,c,d){const e=join(projectDir(a,b),c);return mkdirSync(dirname(e),{'recursive':!![]}),writeFileSync(e,d,'utf-8'),e;}export function appendJsonl(a,b,c,d){const e=join(projectDir(a,b),c);return ensureProjectDir(a,b),mkdirSync(dirname(e),{'recursive':!![]}),appendFileSync(e,JSON['stringify'](d)+'\x0a','utf-8'),e;}export function appendAudit(a,b,c){appendJsonl(a,b,'audit.jsonl',c);}export function readAuditLog(a,b){const c=auditLogPath(a,b);if(!existsSync(c))return[];const d=readFileSync(c,'utf-8');return d['split']('\x0a')['filter'](e=>e['trim']()['length']>0x0)['map'](e=>JSON['parse'](e));}export function parseProjectDirName(a){const b=a['match'](/^(.+)_v(\d+)$/);if(!b)return undefined;return{'prefix':b[0x1],'version':'v'+b[0x2]};}export function listLocalProjects(){const a=projectsRootDir();if(!existsSync(a))return[];const b=readdirSync(a,{'withFileTypes':!![]}),c=[];for(const d of b){if(!d['isDirectory']())continue;const f=parseProjectDirName(d['name']);if(!f)continue;const g=join(a,d['name']),h=join(g,'manifest.json'),i=join(g,'stage.json');let j=![],k=![],l=![],n;if(existsSync(h)){j=!![];try{const p=JSON['parse'](readFileSync(h,'utf-8'));l=p['schema_version']!==CURRENT_SCHEMA_VERSION,n=p['forked_from'];}catch{}}if(existsSync(i))try{const q=JSON['parse'](readFileSync(i,'utf-8'));k=q['archived'];}catch{}let o=0x0;try{o=statSync(g)['mtimeMs'];}catch{}c['push']({'dir_name':d['name'],'prefix':f['prefix'],'version':f['version'],'path':g,'initialized':j,'archived':k,'needs_migration':l,'forked_from':n,'mtime':o});}return c['sort']((r,t)=>t['mtime']-r['mtime']);}export function projectExists(a,b){return existsSync(manifestPath(a,b));}export function forkProject(a,b,c){if(!projectExists(a,b))throw new Error('source\x20project\x20not\x20found:\x20'+a+'_'+b);const d=c['newPrefix']??a;if(c['newVersion']===b&&d===a)throw new Error('fork\x20target\x20must\x20differ\x20from\x20source\x20(set\x20newVersion\x20or\x20newPrefix)');ensureProjectDir(d,c['newVersion']);const e=projectDir(a,b),f=projectDir(d,c['newVersion']),g=[];function h(m){const n=join(e,m);if(!existsSync(n))return;const o=readdirSync(n,{'withFileTypes':!![]});for(const p of o){const q=m?join(m,p['name']):p['name'],r=join(e,q),s=join(f,q);if(p['isDirectory']())mkdirSync(s,{'recursive':!![]}),h(q);else{if(p['isFile']()){if(q==='stage.json'||q==='audit.jsonl')continue;mkdirSync(dirname(s),{'recursive':!![]}),copyFileSync(r,s),g['push'](q);}}}}h('');const i=new Date()['toISOString'](),j={'schema_version':CURRENT_SCHEMA_VERSION,'mcp_version':c['mcpVersion']??'unknown','prefix':d,'version':c['newVersion'],'created_at':i,'updated_at':i,'forked_from':e};writeFileSync(manifestPath(d,c['newVersion']),JSON['stringify'](j,null,0x2),'utf-8');const k={'stage':0x1,'updated_at':Date['now'](),'stage_meta':{0x1:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x2:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x3:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x4:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0},0x5:{'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0}},'has_published_object':![],'archived':![]};saveStageState(d,c['newVersion'],k),appendAudit(d,c['newVersion'],{'timestamp':i,'event':'fork_created','reason':'forked\x20from\x20'+a+'_'+b+';\x20objects\x20must\x20be\x20re-created\x20(project\x20isolation\x20§3.0)','affected_files':['manifest.json','stage.json']});const l=loadStageState(a,b);return l&&(l['archived']=!![],saveStageState(a,b,l),appendAudit(a,b,{'timestamp':i,'event':'stage_commit','reason':'archived\x20after\x20fork\x20to\x20'+d+'_'+c['newVersion'],'affected_files':['stage.json']})),{'new_prefix':d,'new_version':c['newVersion'],'new_path':f,'forked_from':e,'copied_files':g};}export function listProjectFiles(a,b){const c=projectDir(a,b);if(!existsSync(c))return[];const d=[];function e(f){const g=join(c,f),h=readdirSync(g,{'withFileTypes':!![]});for(const i of h){const j=f?join(f,i['name']):i['name'],k=join(c,j);if(i['isDirectory']())e(j);else{if(i['isFile']()){let l;try{l=statSync(k);}catch{continue;}let m='other';if(k['endsWith']('.json'))m='json';else{if(k['endsWith']('.md'))m='markdown';else{if(k['endsWith']('.jsonl'))m='jsonl';}}d['push']({'path':j,'abs_path':k,'size':l['size'],'mtime':l['mtimeMs'],'kind':m});}}}}return e(''),d['sort']((f,g)=>f['path']['localeCompare'](g['path']));}export function readProjectFile(a,b,c){const d=join(projectDir(a,b),c);if(!existsSync(d))return undefined;return readFileSync(d,'utf-8');}export function commitStage(a,b,c,d={}){const e=loadStageState(a,b);if(!e)throw new Error('project\x20not\x20initialized:\x20'+a+'_'+b);const f=d['gatePassed']??![];return e['stage_meta'][c]={'committed':!![],'committed_at':Date['now'](),'gate_passed':f,'blocking_issues':d['blockingIssues']??[],'completion':d['completion']??(f?0x64:0x0)},c<0x5&&f&&(e['stage']=c+0x1),saveStageState(a,b,e),appendAudit(a,b,{'timestamp':new Date()['toISOString'](),'event':'stage_commit','stage':c,'reason':d['reason']??'stage\x20'+c+'\x20committed','affected_files':['stage.json'],'user_confirmed':d['userConfirmed']}),e;}export function rollbackStage(a,b,c,d={}){const e=loadStageState(a,b);if(!e)throw new Error('project\x20not\x20initialized:\x20'+a+'_'+b);if(e['has_published_object'])throw new Error('cannot\x20rollback:\x20project\x20has\x20published\x20objects\x20—\x20must\x20fork\x20new\x20version\x20(§3.3)');const f=e['stage'];for(let g=c+0x1;g<=0x5;g++){e['stage_meta'][g]={'committed':![],'gate_passed':![],'blocking_issues':[],'completion':0x0};}return e['stage']=c,saveStageState(a,b,e),appendAudit(a,b,{'timestamp':new Date()['toISOString'](),'event':'stage_rollback','stage':c,'reason':d['reason']??'rollback\x20from\x20stage\x20'+f+'\x20to\x20'+c,'affected_files':d['affectedFiles']??['stage.json']}),e;}export function markObjectPublished(a,b,c){const d=loadStageState(a,b);if(!d)return;if(d['has_published_object'])return;d['has_published_object']=!![],saveStageState(a,b,d),appendAudit(a,b,{'timestamp':new Date()['toISOString'](),'event':'object_published','stage':0x5,'reason':'object\x20published:\x20'+c+'\x20—\x20rollback\x20now\x20requires\x20fork\x20(§3.3)','affected_files':['stage.json']});}export function getLocalSyncStatus(a,b){const c=projectExists(a,b);if(!c)return{'local_exists':![],'initialized':![],'needs_migration':![],'archived':![]};let d=!![],e=![],f=![];try{const g=loadManifest(a,b);e=g['schema_version']!==CURRENT_SCHEMA_VERSION;}catch{d=![];}try{const h=loadStageState(a,b);if(h)f=h['archived'];}catch{}return{'local_exists':!![],'initialized':d,'needs_migration':e,'archived':f};}
@@ -1,43 +0,0 @@
1
- import type { ProjectGraph, GraphEdge } from "./graph.js";
2
- export interface ProjectInfo {
3
- prefix: string;
4
- objectCount: number;
5
- types: string[];
6
- versions?: string[];
7
- objects: Array<{
8
- name?: string;
9
- address?: string;
10
- type?: string;
11
- version?: string;
12
- tags?: string[];
13
- }>;
14
- }
15
- export interface DependencyTrace {
16
- object: string;
17
- directDependencies: GraphEdge[];
18
- transitive: Array<{
19
- object: string;
20
- via: string[];
21
- }>;
22
- dangling: string[];
23
- }
24
- export interface ReverseTrace {
25
- object: string;
26
- referencedBy: GraphEdge[];
27
- }
28
- export declare function listProjects(): Promise<ProjectInfo[]>;
29
- export declare function listProjectObjects(prefix: string): Promise<ProjectInfo["objects"]>;
30
- export declare function listShareableObjects(): Promise<Array<{
31
- name?: string;
32
- address?: string;
33
- type?: string;
34
- project?: string;
35
- }>>;
36
- export declare function traceDependencies(graph: ProjectGraph, objectId: string): DependencyTrace;
37
- export declare function traceReferencedBy(graph: ProjectGraph, objectId: string): ReverseTrace;
38
- export declare function prePublishCheck(graph: ProjectGraph, serviceId: string): string[];
39
- export declare function findCrossProjectReferences(graph: ProjectGraph): Array<{
40
- edge: GraphEdge;
41
- fromProject?: string;
42
- toProject?: string;
43
- }>;
@@ -1 +0,0 @@
1
- import{LocalMark}from'@wowok/wowok';import{extractAllProjectVersions,TAG_PREFIX}from'./namespace.js';export async function listProjects(){const a=await LocalMark['Instance']()['list'](undefined),b=new Map();for(const c of a){const d=extractAllProjectVersions(c['tags']);if(d['length']===0x0)continue;const e=new Map();for(const h of d){if(!e['has'](h['prefix']))e['set'](h['prefix'],[]);e['get'](h['prefix'])['push'](h['version']);}const f=c['tags']?.['find'](i=>i['startsWith'](TAG_PREFIX['type'])),g=f?.['slice'](TAG_PREFIX['type']['length']);for(const [i,j]of e){const k=j['some'](o=>o!==undefined),l=k?j['filter'](o=>o!==undefined):j;!b['has'](i)&&b['set'](i,{'prefix':i,'objectCount':0x0,'types':[],'versions':[],'objects':[]});const n=b['get'](i);if(g&&!n['types']['includes'](g))n['types']['push'](g);for(const o of l){n['objectCount']++,o&&!n['versions']['includes'](o)&&n['versions']['push'](o),n['objects']['push']({'name':c['name'],'address':c['address'],'type':g,'version':o,'tags':c['tags']});}}}return Array['from'](b['values']())['sort']((p,q)=>q['objectCount']-p['objectCount']);}export async function listProjectObjects(a){const b=await LocalMark['Instance']()['list'](undefined),c=[],d=a['includes']('_v');for(const e of b){const f=extractAllProjectVersions(e['tags']),g=f['find'](i=>{if(d)return i['version']?i['prefix']+'_'+i['version']===a:![];return i['prefix']===a;});if(!g)continue;const h=e['tags']?.['find'](i=>i['startsWith'](TAG_PREFIX['type']));c['push']({'name':e['name'],'address':e['address'],'type':h?.['slice'](TAG_PREFIX['type']['length']),'version':g['version'],'tags':e['tags']});}return c;}export async function listShareableObjects(){const a=await LocalMark['Instance']()['list']({'tags':[TAG_PREFIX['shareable']+'true']});return a['map'](b=>{const c=b['tags']?.['find'](e=>e['startsWith'](TAG_PREFIX['type'])),d=b['tags']?.['find'](e=>e['startsWith'](TAG_PREFIX['project']));return{'name':b['name'],'address':b['address'],'type':c?.['slice'](TAG_PREFIX['type']['length']),'project':d?.['slice'](TAG_PREFIX['project']['length'])};});}export function traceDependencies(a,b){const c=a['getDependencies'](b),d=new Set([b]),f=[],g=c['map'](i=>({'id':i['to'],'via':[i['from'],i['to']]})),h=new Set();while(g['length']>0x0){const {id:i,via:j}=g['shift']();if(d['has'](i))continue;d['add'](i);const k=a['getNode'](i);(!k||!k['address']&&!k['project'])&&h['add'](i);f['push']({'object':i,'via':j});const l=a['getDependencies'](i);for(const m of l){!d['has'](m['to'])&&g['push']({'id':m['to'],'via':[...j,m['to']]});}}return{'object':b,'directDependencies':c,'transitive':f,'dangling':Array['from'](h)};}export function traceReferencedBy(a,b){return{'object':b,'referencedBy':a['getReferencedBy'](b)};}export function prePublishCheck(a,b){const c=[],d=traceDependencies(a,b);d['dangling']['length']>0x0&&c['push']('Service\x20\x27'+b+'\x27\x20references\x20objects\x20not\x20yet\x20created:\x20'+d['dangling']['join'](',\x20')+'.\x20'+'Publishing\x20will\x20lock\x20\x27machine\x27\x20and\x20\x27order_allocators\x27\x20—\x20ensure\x20these\x20are\x20finalized\x20first.');const e=a['detectCycles']();return e['length']>0x0&&c['push']('Dependency\x20graph\x20contains\x20'+e['length']+'\x20cycle(s):\x20'+e['map'](f=>f['join']('\x20→\x20'))['join'](';\x20')+'.\x20Cycles\x20may\x20indicate\x20a\x20design\x20issue.'),c;}export function findCrossProjectReferences(a){const b=[];for(const c of a['getEdges']()){const d=a['getNode'](c['from']),e=a['getNode'](c['to']),f=d?.['project'],g=e?.['project'];f&&g&&f!==g&&b['push']({'edge':c,'fromProject':f,'toProject':g});}return b;}
@@ -1 +0,0 @@
1
- import{assessServiceRisks,assessMachineRisks,assessAllocationRisks,assessTreasuryRisks,assessArbitrationRisks,assessRewardRisks,assessProgressRisks,assessOrderRisks,assessGuardRisks,checkContactRisks,checkResourceRisks,checkPaymentRisks,checkArbRisks,checkPersonalRisks,checkUtilRisks,checkRegistrarRisks,checkBridgeRisks,checkProofRisks,checkRepositoryRisks,checkDemandRisks}from'../knowledge/index.js';import{assessPermissionRisks}from'../knowledge/permission-risk.js';const SEVERITY_ORDER={'CRITICAL':0x0,'HIGH':0x1,'MEDIUM':0x2,'LOW':0x3,'INFO':0x4},ALL_SEVERITIES=['CRITICAL','HIGH','MEDIUM','LOW','INFO'];function normalizeSeverity(a){if(typeof a!=='string')return'INFO';const b=a['toUpperCase']();return ALL_SEVERITIES['includes'](b)?b:'INFO';}function extractRiskId(a,b){if(!a||typeof a!=='object')return b;return String(a['id']??a['risk_rule_id']??a['rule_id']??b);}function extractRiskMessage(a){if(!a||typeof a!=='object')return'(no\x20message)';return String(a['title']??a['message']??a['description']??a['trigger']??'(no\x20message)');}function extractFixSuggestion(a){if(!a||typeof a!=='object')return'';return String(a['mitigation']??a['fix_suggestion']??a['suggestion']??'');}function toAggregatedRisk(a,b,c){return{'risk_rule_id':extractRiskId(a,'R-'+b['toUpperCase']()+'-?'),'object_type':b,'entry_id':c,'severity':normalizeSeverity(a?.['level']??a?.['severity']),'message':extractRiskMessage(a),'fix_suggestion':extractFixSuggestion(a),'details':a?.['evidence']?{'field_path':String(a['evidence'])}:undefined};}function isL1L2Object(a){return['service','machine','allocation','treasury','arb','reward','progress','order','permission','guard']['includes'](a);}function buildL1L2Dispatch(){const a=(b,c)=>{try{const d=b??{},e=c(d);if(Array['isArray'](e))return e;if(e&&typeof e==='object'){const f=e['risks'];if(Array['isArray'](f))return f;}return[];}catch{return[];}};return{'service':{'assess':b=>a(b,assessServiceRisks)},'machine':{'assess':b=>a(b,c=>assessMachineRisks(c,{}))},'allocation':{'assess':b=>a(b,assessAllocationRisks)},'treasury':{'assess':b=>a(b,assessTreasuryRisks)},'arb':{'assess':b=>a(b,assessArbitrationRisks)},'reward':{'assess':b=>a(b,c=>assessRewardRisks(c))},'progress':{'assess':b=>a(b,c=>assessProgressRisks(c))},'order':{'assess':b=>a(b,assessOrderRisks)},'permission':{'assess':b=>a(b,assessPermissionRisks)},'guard':{'assess':b=>{try{const c=assessGuardRisks({'table':[],'root':undefined});if(Array['isArray'](c))return c;if(c&&typeof c==='object'){const d=c['risks'];if(Array['isArray'](d))return d;}return[];}catch{return[];}}}};}function buildL3Dispatch(){const a=(b,c)=>{try{const d=b??{},e=c(d);if(Array['isArray'](e))return e;return[];}catch{return[];}};return{'contact':{'check':b=>a(b,checkContactRisks)},'resource':{'check':b=>a(b,checkResourceRisks)},'payment':{'check':b=>a(b,checkPaymentRisks)},'arb':{'check':b=>a(b,checkArbRisks)},'personal':{'check':b=>a(b,checkPersonalRisks)},'util':{'check':b=>a(b,checkUtilRisks)},'registrar':{'check':b=>a(b,checkRegistrarRisks)},'bridge':{'check':b=>a(b,checkBridgeRisks)},'proof':{'check':b=>a(b,checkProofRisks)},'repository':{'check':b=>a(b,checkRepositoryRisks)},'demand':{'check':b=>a(b,checkDemandRisks)}};}export function aggregateProjectRisks(a){const b=[];(!a||!a['project_prefix'])&&b['push']('input.project_prefix\x20is\x20empty');const c=a?.['puzzles']??{},e=[],f=buildL1L2Dispatch(),g=buildL3Dispatch();for(const [m,n]of Object['entries'](c)){const o=m,p=(a['project_prefix']??'project')+'_'+o,q=n?.['puzzle'];if(isL1L2Object(o)){const s=f[o];if(!s){b['push']('No\x20L1/L2\x20risk\x20dispatcher\x20for\x20\x27'+o+'\x27');continue;}const t=s['assess'](q);for(const u of t){e['push'](toAggregatedRisk(u,o,p));}}else{const v=g[o];if(!v){b['push']('No\x20L3\x20risk\x20dispatcher\x20for\x20\x27'+o+'\x27');continue;}const w=v['check'](q);for(const x of w){e['push'](toAggregatedRisk(x,o,p));}}}sortFindings(e);const h=countBySeverity(e),i=a['severity_threshold']??'HIGH',j=determineStatus(h,i,a['user_confirmed_high_risks']??[],e);let k;j==='RISK_PENDING_CONFIRM'&&(k=e['filter'](y=>y['severity']==='HIGH')['filter'](y=>!(a['user_confirmed_high_risks']??[])['includes'](y['risk_rule_id']))['map'](y=>({'risk_rule_id':y['risk_rule_id'],'description':y['message'],'fix_suggestion':y['fix_suggestion'],'object_type':y['object_type'],'entry_id':y['entry_id']})));const l={};for(const y of e){const z=y['object_type'];!l[z]&&(l[z]=[]),l[z]['push']({'risk_rule_id':y['risk_rule_id'],'severity':y['severity'],'message':y['message'],'fix_suggestion':y['fix_suggestion'],'entry_id':y['entry_id']});}return{'namespace':{'prefix':a['project_prefix']??'','version':a['version']??'','industry':a['industry']??'general'},'findings':e,'severity_summary':h,'status':j,'pending_confirmations':k,'calibrated_at':Date['now'](),'fix_suggestions_grouped':l,'warnings':b};}export function sortFindings(a){return a['sort']((c,d)=>{const e=SEVERITY_ORDER[c['severity']]-SEVERITY_ORDER[d['severity']];if(e!==0x0)return e;if(c['object_type']!==d['object_type'])return c['object_type']['localeCompare'](d['object_type']);return c['risk_rule_id']['localeCompare'](d['risk_rule_id']);});}export function countBySeverity(a){const b={'CRITICAL':0x0,'HIGH':0x0,'MEDIUM':0x0,'LOW':0x0,'INFO':0x0};for(const c of a){b[c['severity']]++;}return b;}export function determineStatus(a,b,c,d){if(a['CRITICAL']>0x0)return'RISK_BLOCKED';const e=SEVERITY_ORDER[b];if(a['HIGH']>0x0&&e<=SEVERITY_ORDER['HIGH']){const f=d['filter'](g=>g['severity']==='HIGH'&&!c['includes'](g['risk_rule_id']));if(f['length']>0x0)return'RISK_PENDING_CONFIRM';}if(a['MEDIUM']>0x0&&e<=SEVERITY_ORDER['MEDIUM'])return'RISK_BLOCKED';if(a['LOW']>0x0&&e<=SEVERITY_ORDER['LOW'])return'RISK_BLOCKED';return'RISK_PASSED';}export function getCriticalRisks(a){if(!a?.['findings'])return[];return a['findings']['filter'](b=>b['severity']==='CRITICAL');}export function summarizeRiskReport(a){if(!a)return'(no\x20result)';const b=[];b['push']('#\x20Risk\x20Aggregation\x20Report'),b['push'](''),b['push']('-\x20Project:\x20'+a['namespace']['prefix']+'_'+a['namespace']['version']),b['push']('-\x20Status:\x20'+a['status']),b['push']('-\x20Calibrated\x20at:\x20'+new Date(a['calibrated_at'])['toISOString']()),b['push'](''),b['push']('##\x20Severity\x20Summary'),b['push'](''),b['push']('|\x20Severity\x20|\x20Count\x20|'),b['push']('|----------|-------|');for(const c of ALL_SEVERITIES){b['push']('|\x20'+c+'\x20|\x20'+(a['severity_summary'][c]??0x0)+'\x20|');}b['push']('');if(a['findings']['length']===0x0)return b['push']('No\x20risks\x20found.'),b['join']('\x0a');b['push']('##\x20Findings\x20(sorted\x20by\x20severity)'),b['push']('');for(const d of a['findings']){b['push']('-\x20**['+d['severity']+']\x20'+d['risk_rule_id']+'**\x20('+d['object_type']+'\x20/\x20'+d['entry_id']+')'),b['push']('\x20\x20-\x20'+d['message']),d['fix_suggestion']&&b['push']('\x20\x20-\x20Fix:\x20'+d['fix_suggestion']);}if(a['warnings']['length']>0x0){b['push'](''),b['push']('##\x20Warnings');for(const e of a['warnings'])b['push']('-\x20'+e);}return b['join']('\x0a');}
@@ -1,45 +0,0 @@
1
- import { type ProjectStage, type StageState } from "./project-store.js";
2
- export type ObjectLifecycleState = "created" | "referenced" | "published" | "bound";
3
- export type StructReversibility = "reversible" | "limited" | "immutable";
4
- export type GasImpact = "low" | "medium" | "high" | "none";
5
- export interface ReversibilityEntry {
6
- object_type: string;
7
- lifecycle_state: ObjectLifecycleState;
8
- struct_reversible: StructReversibility;
9
- behavior_reversible: boolean;
10
- gas_impact: GasImpact;
11
- explanation: string;
12
- }
13
- export declare const REVERSIBILITY_MATRIX: ReversibilityEntry[];
14
- export declare function queryReversibility(objectType: string, lifecycleState: ObjectLifecycleState): ReversibilityEntry | undefined;
15
- export declare function getReversibilityForType(objectType: string): ReversibilityEntry[];
16
- export type IterationStrategy = "in_place" | "fork";
17
- export interface IterationRecommendation {
18
- strategy: IterationStrategy;
19
- reason: string;
20
- fork_to_version?: string;
21
- published_objects?: string[];
22
- }
23
- export declare function recommendIterationStrategy(prefix: string, version: string, currentStage?: ProjectStage): IterationRecommendation;
24
- export interface RollbackPolicyResult {
25
- allowed: boolean;
26
- target_stage: ProjectStage;
27
- current_stage: ProjectStage;
28
- block_reason?: string;
29
- files_to_clean: string[];
30
- warnings: string[];
31
- iteration_strategy: IterationRecommendation;
32
- }
33
- export declare function evaluateRollbackPolicy(prefix: string, version: string, targetStage: ProjectStage): RollbackPolicyResult;
34
- export interface RollbackResult {
35
- success: boolean;
36
- target_stage: ProjectStage;
37
- previous_stage: ProjectStage;
38
- files_to_clean: string[];
39
- files_cleaned: string[];
40
- stage_state: StageState;
41
- warnings: string[];
42
- iteration_strategy: IterationRecommendation;
43
- message: string;
44
- }
45
- export declare function rollbackStageWithPolicy(prefix: string, version: string, targetStage: ProjectStage, reason?: string): RollbackResult;
@@ -1 +0,0 @@
1
- import{existsSync,rmSync}from'fs';import{join}from'path';import{loadStageState,projectDir,rollbackStage as a282a}from'./project-store.js';export const REVERSIBILITY_MATRIX=[{'object_type':'permission','lifecycle_state':'created','struct_reversible':'reversible','behavior_reversible':!![],'gas_impact':'low','explanation':'Permission\x20(unpublished):\x20can\x20add\x20tables/admins\x20freely'},{'object_type':'permission','lifecycle_state':'referenced','struct_reversible':'limited','behavior_reversible':!![],'gas_impact':'medium','explanation':'Permission\x20(referenced\x20by\x20published\x20service):\x20modifications\x20limited\x20—\x20affects\x20dependents'},{'object_type':'machine','lifecycle_state':'created','struct_reversible':'reversible','behavior_reversible':!![],'gas_impact':'low','explanation':'Machine\x20(unpublished):\x20can\x20modify\x20nodes/edges/forwards\x20freely'},{'object_type':'machine','lifecycle_state':'published','struct_reversible':'immutable','behavior_reversible':!![],'gas_impact':'none','explanation':'Machine\x20(published):\x20structure\x20is\x20immutable\x20—\x20can\x20only\x20advance\x20progress'},{'object_type':'service','lifecycle_state':'created','struct_reversible':'reversible','behavior_reversible':!![],'gas_impact':'low','explanation':'Service\x20(unpublished):\x20can\x20modify\x20fields\x20freely'},{'object_type':'service','lifecycle_state':'published','struct_reversible':'immutable','behavior_reversible':!![],'gas_impact':'none','explanation':'Service\x20(published):\x20machine/order_allocators\x20frozen\x20—\x20can\x20still\x20transact\x20normally'},{'object_type':'guard','lifecycle_state':'created','struct_reversible':'immutable','behavior_reversible':![],'gas_impact':'none','explanation':'Guard:\x20create-only\x20semantics\x20—\x20immutable\x20from\x20creation'},{'object_type':'allocation','lifecycle_state':'created','struct_reversible':'reversible','behavior_reversible':!![],'gas_impact':'low','explanation':'Allocator\x20(unbound):\x20can\x20modify\x20strategy\x20freely'},{'object_type':'allocation','lifecycle_state':'bound','struct_reversible':'limited','behavior_reversible':!![],'gas_impact':'medium','explanation':'Allocator\x20(bound\x20to\x20published\x20service):\x20strategy\x20modifications\x20limited'},{'object_type':'treasury','lifecycle_state':'created','struct_reversible':'reversible','behavior_reversible':!![],'gas_impact':'low','explanation':'Treasury:\x20can\x20modify\x20rules\x20freely'},{'object_type':'arb','lifecycle_state':'created','struct_reversible':'reversible','behavior_reversible':!![],'gas_impact':'low','explanation':'Arbitration:\x20can\x20modify\x20rules\x20freely'},{'object_type':'reward','lifecycle_state':'created','struct_reversible':'reversible','behavior_reversible':!![],'gas_impact':'low','explanation':'Reward:\x20can\x20modify\x20rules\x20freely'},{'object_type':'progress','lifecycle_state':'bound','struct_reversible':'immutable','behavior_reversible':!![],'gas_impact':'none','explanation':'Progress\x20(bound\x20to\x20machine):\x20cannot\x20swap\x20machine\x20—\x20can\x20only\x20forward'},{'object_type':'order','lifecycle_state':'created','struct_reversible':'immutable','behavior_reversible':!![],'gas_impact':'none','explanation':'Order:\x20structure\x20immutable\x20after\x20creation\x20—\x20can\x20only\x20advance\x20state'}];export function queryReversibility(a,b){return REVERSIBILITY_MATRIX['find'](c=>c['object_type']===a&&c['lifecycle_state']===b);}export function getReversibilityForType(a){return REVERSIBILITY_MATRIX['filter'](b=>b['object_type']===a);}export function recommendIterationStrategy(a,b,c){const d=loadStageState(a,b);if(!d)return{'strategy':'in_place','reason':'Project\x20not\x20initialized\x20—\x20no\x20stage\x20state\x20found.\x20Use\x20in-place\x20for\x20new\x20projects.'};if(d['has_published_object']){const f=b['match'](/^v(\d+)$/),g=f?parseInt(f[0x1])+0x1:0x2,h='v'+g;return{'strategy':'fork','reason':'Project\x20has\x20published\x20on-chain\x20objects\x20—\x20in-place\x20modification\x20would\x20break\x20running\x20business.\x20'+('Fork\x20to\x20'+h+'\x20to\x20preserve\x20the\x20original\x20version\x20as\x20a\x20read-only\x20historical\x20snapshot.'),'fork_to_version':h,'published_objects':d['stage_meta'][0x5]?.['committed']?['see\x20deployment/05-substeps/\x20for\x20published\x20object\x20list']:[]};}const e=c??d['stage'];return{'strategy':'in_place','reason':'Project\x20has\x20no\x20published\x20objects\x20(current\x20stage:\x20'+e+').\x20'+'Safe\x20to\x20modify\x20the\x20current\x20version\x20directly\x20—\x20all\x20changes\x20are\x20local\x20and\x20reversible.'};}const STAGE_DIR_SUFFIXES={0x1:'01-namespace',0x2:'02-puzzle',0x3:'03-risk',0x4:'04-steps',0x5:'05-substeps'};export function evaluateRollbackPolicy(a,b,c){const d=loadStageState(a,b);if(!d)return{'allowed':![],'target_stage':c,'current_stage':0x1,'block_reason':'Project\x20not\x20initialized:\x20'+a+'_'+b,'files_to_clean':[],'warnings':[],'iteration_strategy':{'strategy':'in_place','reason':'Project\x20not\x20initialized.'}};const e=d['stage'],f=recommendIterationStrategy(a,b,e);if(d['has_published_object'])return{'allowed':![],'target_stage':c,'current_stage':e,'block_reason':'Project\x20has\x20published\x20on-chain\x20objects\x20—\x20rollback\x20is\x20forbidden\x20(§3.3).\x20'+'Use\x20fork_project\x20to\x20create\x20a\x20new\x20version\x20for\x20modifications.','files_to_clean':[],'warnings':[],'iteration_strategy':f};if(c>=e)return{'allowed':![],'target_stage':c,'current_stage':e,'block_reason':'Target\x20stage\x20'+c+'\x20must\x20be\x20less\x20than\x20current\x20stage\x20'+e+'.','files_to_clean':[],'warnings':[],'iteration_strategy':f};if(c<0x1)return{'allowed':![],'target_stage':c,'current_stage':e,'block_reason':'Cannot\x20rollback\x20below\x20stage\x201.','files_to_clean':[],'warnings':[],'iteration_strategy':f};const g=[],h=[],i=join(projectDir(a,b),'deployment');for(let j=c+0x1;j<=0x5;j++){const k=join(i,STAGE_DIR_SUFFIXES[j]);existsSync(k)&&g['push']('deployment/'+STAGE_DIR_SUFFIXES[j]+'/');}return c<=0x2&&existsSync(i)&&(g['length']=0x0,g['push']('deployment/')),g['length']>0x0&&h['push']('Rollback\x20will\x20delete\x20'+g['length']+'\x20file(s)/directory(ies):\x20'+g['join'](',\x20')+'.\x20'+'This\x20data\x20will\x20be\x20lost\x20—\x20regenerate\x20by\x20re-running\x20the\x20stage\x20action.'),{'allowed':!![],'target_stage':c,'current_stage':e,'files_to_clean':g,'warnings':h,'iteration_strategy':f};}export function rollbackStageWithPolicy(a,b,c,d){const e=evaluateRollbackPolicy(a,b,c);if(!e['allowed'])return{'success':![],'target_stage':c,'previous_stage':e['current_stage'],'files_to_clean':[],'files_cleaned':[],'stage_state':loadStageState(a,b),'warnings':[],'iteration_strategy':e['iteration_strategy'],'message':'Rollback\x20blocked:\x20'+e['block_reason']};const f=[],g=join(projectDir(a,b),'deployment');if(e['files_to_clean']['includes']('deployment/'))existsSync(g)&&(rmSync(g,{'recursive':!![],'force':!![]}),f['push']('deployment/'));else for(const i of e['files_to_clean']){const j=join(projectDir(a,b),i);existsSync(j)&&(rmSync(j,{'recursive':!![],'force':!![]}),f['push'](i));}const h=a282a(a,b,c,{'reason':d??'rollback\x20to\x20stage\x20'+c+'\x20(policy-evaluated)','affectedFiles':f['length']>0x0?f:['stage.json']});return{'success':!![],'target_stage':c,'previous_stage':e['current_stage'],'files_to_clean':e['files_to_clean'],'files_cleaned':f,'stage_state':h,'warnings':e['warnings'],'iteration_strategy':e['iteration_strategy'],'message':'Rolled\x20back\x20from\x20stage\x20'+e['current_stage']+'\x20to\x20'+c+'.\x20'+(f['length']+'\x20file(s)/directory(ies)\x20cleaned.\x20')+'Stage\x20state\x20updated.\x20'+(e['iteration_strategy']['strategy']==='fork'?'Note:\x20this\x20project\x20has\x20published\x20objects\x20—\x20future\x20modifications\x20require\x20fork.':'Project\x20has\x20no\x20published\x20objects\x20—\x20in-place\x20modification\x20is\x20safe.')};}
@@ -1,93 +0,0 @@
1
- import { type Project, type ProjectObject, type GraphEdge } from "@wowok/wowok";
2
- import type { ReputationData } from "./graph-builder.js";
3
- export interface SemanticObjectContext {
4
- address: string;
5
- name: string | null;
6
- objectType: string | null;
7
- role: string | null;
8
- description: string;
9
- keyFields: Record<string, unknown>;
10
- cacheFreshness: "fresh" | "stale" | "unknown";
11
- }
12
- export interface SemanticGraphContext {
13
- nodeCount: number;
14
- edgeCount: number;
15
- edgesByType: Record<string, number>;
16
- edgesBySource: Record<string, number>;
17
- directDependencies: Array<{
18
- target: string;
19
- targetType: string | null;
20
- fieldName: string | null;
21
- relationshipType: string;
22
- }>;
23
- potentialGaps: Array<{
24
- target: string;
25
- targetType: string | null;
26
- fieldName: string;
27
- reason: string;
28
- }>;
29
- }
30
- export interface SemanticReputationContext {
31
- address: string;
32
- likes: number;
33
- dislikes: number;
34
- favorites: number;
35
- sentimentScore: number;
36
- notableVoters: Array<{
37
- who: string;
38
- like: boolean;
39
- dislike: boolean;
40
- favor: boolean;
41
- }>;
42
- }
43
- export interface SemanticProjectContext {
44
- project: {
45
- prefix: string;
46
- name: string;
47
- description: string | null;
48
- industry: string | null;
49
- perspective: string;
50
- status: string;
51
- network: string;
52
- serviceAddress: string | null;
53
- currentVersion: string | null;
54
- };
55
- objects: SemanticObjectContext[];
56
- graph: SemanticGraphContext;
57
- reputation: SemanticReputationContext[];
58
- freshnessSummary: {
59
- freshCount: number;
60
- staleCount: number;
61
- unknownCount: number;
62
- oldestFetch: number | null;
63
- newestFetch: number | null;
64
- };
65
- }
66
- export interface EvaluationPrompt {
67
- evaluationType: "risk" | "trust" | "worth_buying" | "completeness" | "value";
68
- context: SemanticProjectContext;
69
- prompt: string;
70
- scoringCriteria: ScoringCriterion[];
71
- }
72
- export interface ScoringCriterion {
73
- name: string;
74
- description: string;
75
- weight: number;
76
- minScore: number;
77
- maxScore: number;
78
- }
79
- export declare class SemanticAssembler {
80
- private localProject;
81
- constructor();
82
- assemble(project: Project, objects: ProjectObject[], edges: GraphEdge[], reputation?: Map<string, ReputationData>): Promise<SemanticProjectContext>;
83
- private assembleObjects;
84
- private describeObject;
85
- private extractKeyFields;
86
- private assembleGraph;
87
- private assembleReputation;
88
- private classifyFreshness;
89
- private computeFreshnessSummary;
90
- buildEvaluationPrompt(evaluationType: EvaluationPrompt["evaluationType"], context: SemanticProjectContext): EvaluationPrompt;
91
- private getScoringCriteria;
92
- private formatPrompt;
93
- }
@@ -1 +0,0 @@
1
- import{LocalProject}from'@wowok/wowok';const FRESH_THRESHOLD_MS=0x1*0x3c*0x3c*0x3e8,STALE_THRESHOLD_MS=0x18*0x3c*0x3c*0x3e8;export class SemanticAssembler{['localProject'];constructor(){this['localProject']=LocalProject['Instance']();}async['assemble'](a,b,c,d){const e=await this['assembleObjects'](b),f=this['assembleGraph'](c),g=this['assembleReputation'](b,d),h=this['computeFreshnessSummary'](e);return{'project':{'prefix':a['prefix'],'name':a['name'],'description':a['description'],'industry':a['industry'],'perspective':a['perspective'],'status':a['status'],'network':a['network'],'serviceAddress':a['serviceAddress'],'currentVersion':a['currentVersion']},'objects':e,'graph':f,'reputation':g,'freshnessSummary':h};}async['assembleObjects'](a){const b=[];for(const c of a){const d=await this['localProject']['getCachedObject'](c['objectAddress']),e=d?this['describeObject'](c,d):'Object\x20'+c['objectAddress']+'\x20(no\x20cached\x20on-chain\x20data)',f=d?this['extractKeyFields'](c['objectType'],d):{},g=d?this['classifyFreshness'](d['fetchedAt']):'unknown';b['push']({'address':c['objectAddress'],'name':c['objectName'],'objectType':c['objectType'],'role':c['role'],'description':e,'keyFields':f,'cacheFreshness':g});}return b;}['describeObject'](a,b){const c=a['objectType']??'unknown',d=a['objectName']??abbreviateAddress(a['objectAddress']);let e=c+'\x20\x22'+d+'\x22\x20at\x20'+abbreviateAddress(a['objectAddress']);try{const f=JSON['parse'](b['data']);switch(c){case'Service':{const g=f['bPublished'],h=f['bPaused'],i=f['sales'];e+=g?h?'\x20(published\x20but\x20PAUSED)':'\x20(published,\x20active)':'\x20(not\x20yet\x20published)';i&&Array['isArray'](i)&&i['length']>0x0&&(e+='\x20with\x20'+i['length']+'\x20sale\x20option(s)');break;}case'Machine':{const j=f['node_count']??f['nodeCount'],k=f['bPublished'];e+=k?'\x20(published,\x20'+j+'\x20nodes)':'\x20(draft,\x20'+j+'\x20nodes)';break;}case'Treasury':{e+='\x20(compensation\x20fund)';break;}case'Guard':{e+='\x20(validation\x20rules)';break;}default:break;}}catch{}return e;}['extractKeyFields'](a,b){const c={};try{const d=JSON['parse'](b['data']);switch(a){case'Service':c['bPublished']=d['bPublished'],c['bPaused']=d['bPaused'],c['sales']=d['sales'],c['machine']=d['machine'],c['buy_guard']=d['buy_guard'],c['permission']=d['permission'],c['compensation_fund']=d['compensation_fund'],c['order_allocators']=d['order_allocators'],c['arbitrations']=d['arbitrations'],c['rewards']=d['rewards'],c['repositories']=d['repositories'];break;case'Machine':c['bPublished']=d['bPublished'],c['bPaused']=d['bPaused'],c['node_count']=d['node_count']??d['nodeCount'],c['permission']=d['permission'];break;case'Treasury':c['permission']=d['permission'],c['guard']=d['guard'];break;case'Allocation':case'Arbitration':case'Reward':case'Repository':case'Demand':c['permission']=d['permission'],c['guard']=d['guard'];break;default:break;}}catch{}return c;}['assembleGraph'](a){const b={},c={},d=[],e=[];for(const f of a){b[f['relationshipType']]=(b[f['relationshipType']]??0x0)+0x1,c[f['edgeSource']]=(c[f['edgeSource']]??0x0)+0x1;f['edgeSource']==='internal'&&f['depth']===0x0&&d['push']({'target':f['targetObject'],'targetType':null,'fieldName':f['fieldName'],'relationshipType':f['relationshipType']});if(f['edgeSource']==='potential'){const g=f['metadata']?.['reason'];e['push']({'target':f['targetObject'],'targetType':f['metadata']?.['expected_target_type'],'fieldName':f['fieldName']??'unknown','reason':typeof g==='string'?g:'expected_relationship_missing'});}}return{'nodeCount':new Set([...a['map'](h=>h['sourceObject']),...a['map'](h=>h['targetObject'])])['size'],'edgeCount':a['length'],'edgesByType':b,'edgesBySource':c,'directDependencies':d,'potentialGaps':e};}['assembleReputation'](a,b){if(!b||b['size']===0x0)return[];const c=[];for(const d of a){const e=b['get'](d['objectAddress']);if(!e)continue;const f=e['likes']+e['dislikes'],g=f>0x0?e['likes']/f:0.5;c['push']({'address':d['objectAddress'],'likes':e['likes'],'dislikes':e['dislikes'],'favorites':e['favorites'],'sentimentScore':g,'notableVoters':e['voters']['slice'](0x0,0x5)['map'](h=>({'who':abbreviateAddress(h['who']),'like':h['like'],'dislike':h['dislike'],'favor':h['favor']}))});}return c;}['classifyFreshness'](a){const b=Date['now']()-a;if(b<FRESH_THRESHOLD_MS)return'fresh';if(b<STALE_THRESHOLD_MS)return'stale';return'stale';}['computeFreshnessSummary'](a){let b=0x0,c=0x0,d=0x0,e=null,f=null;for(const g of a){switch(g['cacheFreshness']){case'fresh':b++;break;case'stale':c++;break;case'unknown':d++;break;}}return{'freshCount':b,'staleCount':c,'unknownCount':d,'oldestFetch':e,'newestFetch':f};}['buildEvaluationPrompt'](a,b){const c=this['getScoringCriteria'](a),d=this['formatPrompt'](a,b,c);return{'evaluationType':a,'context':b,'prompt':d,'scoringCriteria':c};}['getScoringCriteria'](a){switch(a){case'risk':return[{'name':'structural_risk','description':'Risk\x20from\x20missing\x20bindings,\x20broken\x20workflows,\x20incomplete\x20setup','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'fund_safety','description':'Risk\x20from\x20Treasury/Allocation\x20misconfiguration,\x20missing\x20compensation\x20fund','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'operational_risk','description':'Risk\x20from\x20Machine/Guard\x20complexity,\x20pause\x20state,\x20missing\x20arbitration','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'governance_risk','description':'Risk\x20from\x20Permission\x20setup,\x20missing\x20UM,\x20overly\x20permissive\x20rules','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'trust':return[{'name':'reputation','description':'Registrar\x20like/dislike\x20ratio\x20and\x20favor\x20count','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'arbitration_coverage','description':'Presence\x20and\x20quality\x20of\x20arbitration\x20arrangements','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'guard_quality','description':'Guard\x20rule\x20complexity\x20and\x20coverage\x20of\x20business\x20scenarios','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'transparency','description':'Object\x20descriptions,\x20repository\x20data,\x20contact\x20information\x20availability','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'worth_buying':return[{'name':'price_reasonableness','description':'Service\x20pricing\x20vs.\x20comparable\x20services\x20and\x20market\x20norms','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'refund_protection','description':'Compensation\x20fund\x20balance,\x20lock\x20duration,\x20refund\x20workflow\x20availability','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'risk_adjusted_value','description':'Value\x20proposition\x20adjusted\x20for\x20project\x20risk\x20score','weight':0.25,'minScore':0x0,'maxScore':0x64},{'name':'trust_adjusted_value','description':'Value\x20proposition\x20adjusted\x20for\x20merchant\x20trust\x20score','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'completeness':return[{'name':'object_coverage','description':'Expected\x20objects\x20present\x20vs.\x20missing\x20(based\x20on\x20EXPECTED_RELATIONSHIPS)','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'binding_completeness','description':'Required\x20bindings\x20established\x20(Service→Machine,\x20Guard,\x20Permission,\x20etc.)','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'workflow_rationality','description':'Machine\x20node\x20topology\x20is\x20sound,\x20no\x20dangling\x20nodes\x20or\x20cycles','weight':0.2,'minScore':0x0,'maxScore':0x64},{'name':'deployment_readiness','description':'Service\x20publishable,\x20all\x20prerequisites\x20met','weight':0.2,'minScore':0x0,'maxScore':0x64}];case'value':return[{'name':'market_positioning','description':'Service\x20differentiation\x20and\x20competitive\x20positioning','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'revenue_potential','description':'Pricing\x20strategy\x20and\x20revenue\x20model\x20viability','weight':0.3,'minScore':0x0,'maxScore':0x64},{'name':'scalability','description':'Ability\x20to\x20handle\x20growth\x20(Machine\x20capacity,\x20Allocation\x20flexibility)','weight':0.2,'minScore':0x0,'maxScore':0x64},{'name':'ecosystem_fit','description':'Integration\x20with\x20WoWok\x20ecosystem\x20(rewards,\x20demands,\x20repositories)','weight':0.2,'minScore':0x0,'maxScore':0x64}];}}['formatPrompt'](a,b,d){const e=[];e['push']('#\x20Project\x20Evaluation:\x20'+a['toUpperCase']()),e['push'](''),e['push']('##\x20Project:\x20'+b['project']['name']+'\x20('+b['project']['prefix']+')'),e['push']('-\x20Perspective:\x20'+b['project']['perspective']),e['push']('-\x20Status:\x20'+b['project']['status']),e['push']('-\x20Network:\x20'+b['project']['network']),e['push']('-\x20Industry:\x20'+(b['project']['industry']??'unspecified')),e['push']('-\x20Service:\x20'+(b['project']['serviceAddress']??'not\x20set')),e['push'](''),e['push']('##\x20Objects');for(const f of b['objects']){e['push']('-\x20'+f['description']);}e['push'](''),e['push']('##\x20Relationship\x20Graph'),e['push']('-\x20Total\x20nodes:\x20'+b['graph']['nodeCount']),e['push']('-\x20Total\x20edges:\x20'+b['graph']['edgeCount']),e['push']('-\x20Edge\x20sources:\x20'+JSON['stringify'](b['graph']['edgesBySource'])),e['push']('-\x20Edge\x20types:\x20'+JSON['stringify'](b['graph']['edgesByType'])),e['push']('-\x20Direct\x20dependencies:\x20'+b['graph']['directDependencies']['length']);if(b['graph']['potentialGaps']['length']>0x0){e['push']('-\x20**Missing\x20relationships\x20(potential\x20gaps):\x20'+b['graph']['potentialGaps']['length']+'**');for(const g of b['graph']['potentialGaps']['slice'](0x0,0xa)){e['push']('\x20\x20-\x20'+g['fieldName']+'\x20→\x20'+(g['targetType']??'unknown')+'\x20('+g['reason']+')');}}e['push']('');if(b['reputation']['length']>0x0){e['push']('##\x20Reputation\x20Data\x20(from\x20Registrar)');for(const h of b['reputation']){e['push']('-\x20'+abbreviateAddress(h['address'])+':\x20'+h['likes']+'\x20likes,\x20'+h['dislikes']+'\x20dislikes,\x20'+h['favorites']+'\x20favorites\x20(sentiment:\x20'+(h['sentimentScore']*0x64)['toFixed'](0x0)+'%)');}e['push']('');}e['push']('##\x20Cache\x20Freshness'),e['push']('-\x20Fresh:\x20'+b['freshnessSummary']['freshCount']),e['push']('-\x20Stale:\x20'+b['freshnessSummary']['staleCount']),e['push']('-\x20Unknown:\x20'+b['freshnessSummary']['unknownCount']),e['push'](''),e['push']('##\x20Scoring\x20Criteria'),e['push']('Please\x20score\x20each\x20criterion\x20(0-100,\x20higher\x20=\x20better)\x20and\x20provide\x20a\x20brief\x20justification:');for(const i of d){e['push']('-\x20**'+i['name']+'**\x20(weight:\x20'+i['weight']+'):\x20'+i['description']);}return e['push'](''),e['push']('##\x20Instructions'),e['push']('1.\x20Analyze\x20the\x20project\x20from\x20the\x20\x22'+a+'\x22\x20perspective.'),e['push']('2.\x20Score\x20each\x20criterion\x20above\x20(0-100).'),e['push']('3.\x20Compute\x20a\x20weighted\x20overall\x20score.'),e['push']('4.\x20Provide\x20a\x201-2\x20sentence\x20summary\x20of\x20your\x20assessment.'),e['push']('5.\x20Return\x20the\x20result\x20as\x20JSON:\x20{\x20score:\x20number,\x20summary:\x20string,\x20details:\x20{\x20criterion_scores:\x20{...},\x20justification:\x20string\x20}\x20}'),e['join']('\x0a');}}function abbreviateAddress(a){if(!a||a['length']<0xc)return a;return a['slice'](0x0,0x6)+'...'+a['slice'](-0x4);}
@@ -1,53 +0,0 @@
1
- import type { ProjectStage } from "./project-store.js";
2
- export type GateDimension = "semantic" | "tools" | "reversibility" | "risk" | "isolation" | "gas_budget";
3
- export interface GasBudgetCheck {
4
- network: "testnet" | "mainnet";
5
- already_spent_gas: number;
6
- estimated_rerun_gas: number;
7
- warning?: string;
8
- }
9
- export interface StageGateCheck {
10
- dimension: GateDimension;
11
- status: "PASS" | "FAIL" | "WARN";
12
- message: string;
13
- }
14
- export interface StageGateInput {
15
- stage: ProjectStage;
16
- prefix: string;
17
- version: string;
18
- naming?: {
19
- prefix_valid: boolean;
20
- version_valid: boolean;
21
- };
22
- puzzles?: Record<string, unknown>;
23
- puzzles_completeness?: "complete" | "partial" | "empty";
24
- risk_status?: string;
25
- risk_can_proceed?: boolean;
26
- doc_error_count?: number;
27
- objects?: Array<{
28
- entry_id: string;
29
- object_type?: string;
30
- reused_from?: string;
31
- }>;
32
- edges?: Array<{
33
- from: string;
34
- to: string;
35
- }>;
36
- trace_coherent?: boolean;
37
- has_published_object?: boolean;
38
- evaluation_score?: number;
39
- deployment_doc_generated?: boolean;
40
- gas_budget?: GasBudgetCheck;
41
- }
42
- export interface StageGateResult {
43
- stage: ProjectStage;
44
- passed: boolean;
45
- checks: StageGateCheck[];
46
- blocking_issues: string[];
47
- warnings: string[];
48
- can_proceed: boolean;
49
- }
50
- export declare const STAGE5_RISK_SCORE_BLOCK = 50;
51
- export declare const STAGE5_RISK_SCORE_WARN = 80;
52
- export declare function validateStageGate(input: StageGateInput): StageGateResult;
53
- export declare function validateStageGateFromDisk(prefix: string, version: string, stage?: ProjectStage, extra?: Partial<StageGateInput>): StageGateResult;
@@ -1 +0,0 @@
1
- import{loadStageState,projectExists}from'./project-store.js';export const STAGE5_RISK_SCORE_BLOCK=0x32;export const STAGE5_RISK_SCORE_WARN=0x50;function buildStage5ScoreCheck(a){if(a['evaluation_score']!==undefined&&a['evaluation_score']!==null){const c=a['evaluation_score'];if(c<STAGE5_RISK_SCORE_BLOCK)return{'dimension':'risk','status':'FAIL','message':'Stage\x203\x20evaluation\x20score\x20'+c+'\x20<\x20'+STAGE5_RISK_SCORE_BLOCK+'\x20(block\x20threshold).\x20'+'GLM6\x20handoff\x20validation:\x20deployment\x20blocked\x20—\x20too\x20many\x20CRITICAL\x20risks\x20unresolved.\x20'+'Fix\x20risks\x20in\x20Stage\x203\x20(aggregate_risks)\x20before\x20deploying.'};if(c<STAGE5_RISK_SCORE_WARN)return{'dimension':'risk','status':'WARN','message':'Stage\x203\x20evaluation\x20score\x20'+c+'\x20<\x20'+STAGE5_RISK_SCORE_WARN+'\x20(warn\x20threshold).\x20'+'GLM6\x20handoff\x20validation:\x20non-blocking\x20—\x20proceed\x20at\x20your\x20own\x20risk.\x20'+'Recommend\x20improving\x20risk\x20posture\x20before\x20deploying\x20to\x20mainnet.'};return{'dimension':'risk','status':'PASS','message':'Stage\x203\x20evaluation\x20score\x20'+c+'\x20>=\x20'+STAGE5_RISK_SCORE_WARN+'\x20—\x20safe\x20to\x20deploy'};}const b=a['risk_status']==='RISK_PASSED';return{'dimension':'risk','status':b?'PASS':'WARN','message':b?'Risk\x20status\x20is\x20RISK_PASSED':'Risk\x20status\x20is\x20'+(a['risk_status']??'unknown')+'\x20—\x20recommend\x20resolving\x20before\x20deployment'};}function buildStage5DocCheck(a){if(a['deployment_doc_generated']!==!![])return{'dimension':'semantic','status':'FAIL','message':'GLM6\x20handoff\x20validation:\x20Stage\x204\x20deployment\x20doc\x20not\x20generated.\x20'+'Call\x20generate_deployment_doc\x20(Stage\x204)\x20before\x20executing\x20deployment\x20(Stage\x205).'};const b=a['doc_error_count']??0x0;if(b>0x0)return{'dimension':'semantic','status':'FAIL','message':'GLM6\x20handoff\x20validation:\x20Stage\x204\x20deployment\x20doc\x20has\x20'+b+'\x20D-error(s).\x20'+'Fix\x20all\x20D-errors\x20before\x20executing\x20deployment.'};return{'dimension':'semantic','status':'PASS','message':'Stage\x204\x20deployment\x20doc\x20generated\x20with\x200\x20D-errors'};}function buildGasBudgetCheck(a){const b=a['gas_budget'];if(!b)return{'dimension':'gas_budget','status':'PASS','message':'Gas\x20budget\x20not\x20provided\x20(N/A\x20for\x20this\x20stage\x20or\x20caller\x20omitted)'};if(b['network']==='testnet')return{'dimension':'gas_budget','status':'PASS','message':'testnet:\x20no\x20gas\x20limit\x20(faucet\x20is\x20free);\x20rollback\x20is\x20costless'};const c=b['already_spent_gas']+b['estimated_rerun_gas'],d=b['warning']??'mainnet:\x20estimated\x20total\x20gas\x20'+c+'\x20MIST\x20(already_spent='+b['already_spent_gas']+'\x20+\x20rerun='+b['estimated_rerun_gas']+').\x20Rollback\x20will\x20incur\x20real\x20cost.';return{'dimension':'gas_budget','status':'WARN','message':d};}function validateStage1Gate(a){const b=[],c=a['naming']?.['prefix_valid']&&a['naming']?.['version_valid'];return b['push']({'dimension':'semantic','status':c?'PASS':'FAIL','message':c?'Project\x20namespace\x20is\x20valid\x20(prefix\x20+\x20version)':'Project\x20naming\x20is\x20invalid\x20—\x20prefix\x20must\x20match\x20^[a-z][a-z0-9_]{2,63}$\x20and\x20version\x20must\x20match\x20^v\x5cd+$'}),b['push']({'dimension':'tools','status':'PASS','message':'Stage\x201\x20requires\x20no\x20on-chain\x20tools\x20(namespace\x20is\x20local-only)'}),b['push']({'dimension':'reversibility','status':'PASS','message':'Stage\x201\x20is\x20fully\x20reversible\x20(no\x20on-chain\x20state\x20changes)'}),b['push']({'dimension':'risk','status':'PASS','message':'No\x20risks\x20at\x20namespace\x20stage'}),b['push']({'dimension':'isolation','status':'PASS','message':'Stage\x201\x20has\x20no\x20objects\x20(isolation\x20N/A)'}),b['push'](buildGasBudgetCheck(a)),b;}function validateStage2Gate(a){const b=[],c=a['puzzles']&&Object['keys'](a['puzzles'])['length']>0x0,d=a['puzzles_completeness']??'empty';b['push']({'dimension':'semantic','status':c?d==='complete'?'PASS':d==='partial'?'WARN':'FAIL':'FAIL','message':c?'Puzzles\x20present\x20with\x20completeness:\x20'+d:'No\x20puzzles\x20found\x20—\x20call\x20analyze_intent\x20first'});if(c){const e=Object['keys'](a['puzzles']);b['push']({'dimension':'tools','status':'PASS','message':e['length']+'\x20object\x20type(s)\x20defined:\x20'+e['join'](',\x20')});}else b['push']({'dimension':'tools','status':'FAIL','message':'Cannot\x20verify\x20tools\x20—\x20no\x20puzzles\x20available'});b['push']({'dimension':'reversibility','status':'PASS','message':'Stage\x202\x20is\x20in-memory\x20only\x20(no\x20on-chain\x20state\x20changes)'}),b['push']({'dimension':'risk','status':'PASS','message':'Risk\x20assessment\x20happens\x20in\x20stage\x203\x20(aggregate_risks)'});if(a['objects']&&a['objects']['length']>0x0){const f=a['objects']['filter'](g=>g['reused_from']&&g['reused_from']['includes'](':')&&!g['reused_from']['startsWith']('0x'));b['push']({'dimension':'isolation','status':f['length']===0x0?'PASS':'FAIL','message':f['length']===0x0?'No\x20cross-project\x20object\x20references\x20detected':f['length']+'\x20object(s)\x20reference\x20external\x20projects\x20(§3.0\x20violation):\x20'+f['map'](g=>g['entry_id'])['join'](',\x20')});}else b['push']({'dimension':'isolation','status':'PASS','message':'No\x20objects\x20to\x20check\x20for\x20isolation\x20(stage\x202)'});return b['push'](buildGasBudgetCheck(a)),b;}function validateStage3Gate(a){const b=[],c=a['risk_status']!==undefined&&a['risk_status']!=='';b['push']({'dimension':'semantic','status':c?'PASS':'FAIL','message':c?'Risk\x20status:\x20'+a['risk_status']:'No\x20risk\x20assessment\x20found\x20—\x20call\x20aggregate_risks\x20first'}),b['push']({'dimension':'tools','status':'PASS','message':'Risk\x20assessment\x20uses\x20puzzles\x20from\x20stage\x202\x20(no\x20additional\x20tools)'}),b['push']({'dimension':'reversibility','status':'PASS','message':'Stage\x203\x20is\x20reversible\x20(re-run\x20aggregate_risks\x20to\x20update)'});const d=a['risk_can_proceed']===!![];return b['push']({'dimension':'risk','status':d?'PASS':'FAIL','message':d?'All\x20CRITICAL\x20risks\x20resolved\x20—\x20may\x20proceed':'CRITICAL\x20risks\x20remain\x20—\x20fix\x20before\x20proceeding\x20(non-blocking\x20principle:\x20only\x20CRITICAL\x20blocks)'}),b['push']({'dimension':'isolation','status':'PASS','message':'Isolation\x20verified\x20in\x20stage\x202'}),b['push'](buildGasBudgetCheck(a)),b;}function validateStage4Gate(a){const b=[],c=a['doc_error_count']??-0x1;b['push']({'dimension':'semantic','status':c===0x0?'PASS':c>0x0?'FAIL':'WARN','message':c===0x0?'Deployment\x20doc\x20generated\x20with\x200\x20D-errors':c>0x0?c+'\x20D-error(s)\x20remain\x20—\x20fix\x20before\x20proceeding':'Doc\x20error\x20count\x20unknown\x20—\x20call\x20generate_deployment_doc\x20first'});if(a['objects']&&a['edges']){const e=new Set(a['objects']['map'](g=>g['entry_id'])),f=a['edges']['filter'](g=>!e['has'](g['from'])||!e['has'](g['to']));b['push']({'dimension':'tools','status':f['length']===0x0?'PASS':'FAIL','message':f['length']===0x0?'All\x20'+a['edges']['length']+'\x20edge(s)\x20reference\x20defined\x20objects':f['length']+'\x20edge(s)\x20reference\x20undefined\x20objects'});}else b['push']({'dimension':'tools','status':'WARN','message':'Objects/edges\x20not\x20provided\x20—\x20cannot\x20verify\x20tool\x20availability'});b['push']({'dimension':'reversibility','status':'PASS','message':'Stage\x204\x20is\x20reversible\x20(regenerate\x20deployment\x20doc)'});const d=a['risk_status']==='RISK_PASSED';b['push']({'dimension':'risk','status':d?'PASS':'WARN','message':d?'Risk\x20status\x20is\x20RISK_PASSED':'Risk\x20status\x20is\x20'+(a['risk_status']??'unknown')+'\x20—\x20recommend\x20resolving\x20before\x20deployment'});if(a['objects']&&a['objects']['length']>0x0){const g=a['objects']['filter'](h=>h['reused_from']&&!h['reused_from']['startsWith']('0x')&&h['reused_from']['includes'](':'));b['push']({'dimension':'isolation','status':g['length']===0x0?'PASS':'FAIL','message':g['length']===0x0?'No\x20cross-project\x20references\x20in\x20deployment\x20objects':g['length']+'\x20object(s)\x20have\x20cross-project\x20reused_from\x20(§3.0\x20violation)'});}else b['push']({'dimension':'isolation','status':'PASS','message':'No\x20objects\x20to\x20check\x20for\x20isolation\x20(stage\x204)'});return b['push'](buildGasBudgetCheck(a)),b;}function validateStage5Gate(a){const b=[];b['push'](buildStage5DocCheck(a));const c=a['trace_coherent']===!![];b['push']({'dimension':'semantic','status':c?'PASS':'FAIL','message':c?'Substeps\x20are\x20coherent\x20(no\x20dangling/circular/missing)':'Substeps\x20are\x20not\x20coherent\x20—\x20call\x20trace_substeps\x20and\x20fix\x20issues'}),b['push']({'dimension':'tools','status':c?'PASS':'FAIL','message':c?'All\x20substep\x20dependencies\x20resolve':'Substep\x20dependencies\x20have\x20issues\x20(see\x20trace_substeps\x20output)'});const d=a['has_published_object']===!![];return b['push']({'dimension':'reversibility','status':d?'WARN':'PASS','message':d?'Objects\x20have\x20been\x20published\x20on-chain\x20—\x20rollback\x20requires\x20fork\x20(§3.3).\x20'+'Ensure\x20all\x20substeps\x20are\x20correct\x20before\x20executing\x20on\x20mainnet.':'No\x20objects\x20published\x20yet\x20—\x20stage\x205\x20is\x20still\x20reversible'}),b['push'](buildStage5ScoreCheck(a)),b['push']({'dimension':'isolation','status':'PASS','message':'Isolation\x20verified\x20in\x20stages\x202\x20and\x204'}),b['push'](buildGasBudgetCheck(a)),b;}const STAGE_VALIDATORS={0x1:validateStage1Gate,0x2:validateStage2Gate,0x3:validateStage3Gate,0x4:validateStage4Gate,0x5:validateStage5Gate};export function validateStageGate(a){const b=STAGE_VALIDATORS[a['stage']],c=b(a),d=c['filter'](f=>f['status']==='FAIL')['map'](f=>'['+f['dimension']+']\x20'+f['message']),e=c['filter'](f=>f['status']==='WARN')['map'](f=>'['+f['dimension']+']\x20'+f['message']);return{'stage':a['stage'],'passed':d['length']===0x0,'checks':c,'blocking_issues':d,'warnings':e,'can_proceed':d['length']===0x0};}export function validateStageGateFromDisk(a,b,c,d){if(!projectExists(a,b))return{'stage':c??0x1,'passed':![],'checks':[{'dimension':'semantic','status':'FAIL','message':'Project\x20not\x20found\x20locally:\x20'+a+'_'+b}],'blocking_issues':['Project\x20not\x20found\x20locally:\x20'+a+'_'+b],'warnings':[],'can_proceed':![]};const e=loadStageState(a,b),f=c??e?.['stage']??0x1,g=e?.['has_published_object']??![];return validateStageGate({'stage':f,'prefix':a,'version':b,'has_published_object':g,...d});}
@@ -1,26 +0,0 @@
1
- export type TaskStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
2
- export interface TaskState {
3
- task_id: string;
4
- operation: string;
5
- status: TaskStatus;
6
- progress: number;
7
- message: string;
8
- result: unknown;
9
- error: string | null;
10
- started_at: number;
11
- completed_at: number | null;
12
- project_id: string | null;
13
- }
14
- declare class TaskTrackerImpl {
15
- private tasks;
16
- private counter;
17
- create(operation: string, projectId?: string): string;
18
- update(task_id: string, progress: number, message?: string): void;
19
- complete(task_id: string, result: unknown): void;
20
- fail(task_id: string, error: string): void;
21
- get(task_id: string): TaskState | undefined;
22
- list(projectId?: string): TaskState[];
23
- private evictExpired;
24
- }
25
- export declare const TaskTracker: TaskTrackerImpl;
26
- export {};
@@ -1 +0,0 @@
1
- const RETENTION_MS=0x5*0x3c*0x3e8,MAX_TASKS=0xc8;class TaskTrackerImpl{['tasks']=new Map();['counter']=0x0;['create'](a,b){this['evictExpired'](),this['counter']++;const c='task_'+Date['now']()+'_'+this['counter'],d={'task_id':c,'operation':a,'status':'pending','progress':0x0,'message':'Task\x20created','result':null,'error':null,'started_at':Date['now'](),'completed_at':null,'project_id':b??null};return this['tasks']['set'](c,d),c;}['update'](a,b,c){const d=this['tasks']['get'](a);if(!d)return;d['progress']=Math['max'](0x0,Math['min'](0x64,b));if(c)d['message']=c;if(d['status']==='pending')d['status']='running';}['complete'](a,b){const c=this['tasks']['get'](a);if(!c)return;c['status']='completed',c['progress']=0x64,c['result']=b,c['completed_at']=Date['now']();}['fail'](a,b){const c=this['tasks']['get'](a);if(!c)return;c['status']='failed',c['error']=b,c['completed_at']=Date['now']();}['get'](a){return this['tasks']['get'](a);}['list'](a){const b=Array['from'](this['tasks']['values']());if(a)return b['filter'](c=>c['project_id']===a);return b;}['evictExpired'](){const a=Date['now']();for(const [b,c]of this['tasks']){c['completed_at']&&a-c['completed_at']>RETENTION_MS&&this['tasks']['delete'](b);}if(this['tasks']['size']>MAX_TASKS){const d=Array['from'](this['tasks']['values']())['filter'](f=>f['status']==='completed'||f['status']==='failed')['sort']((f,g)=>(f['completed_at']??0x0)-(g['completed_at']??0x0)),e=d['slice'](0x0,this['tasks']['size']-MAX_TASKS);for(const f of e)this['tasks']['delete'](f['task_id']);}}}export const TaskTracker=new TaskTrackerImpl();