@wowok/agent-mcp 2.7.1 → 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 (375) 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.js +1 -397
  13. package/dist/customer/types.js +1 -13
  14. package/dist/customer/user-preferences.js +1 -460
  15. package/dist/evaluation/arbitration-game.d.ts +9 -2
  16. package/dist/evaluation/arbitration-game.js +1 -48
  17. package/dist/evaluation/builtins/demand-match.js +1 -153
  18. package/dist/evaluation/builtins/index.js +1 -10
  19. package/dist/evaluation/builtins/service-risk.js +1 -55
  20. package/dist/evaluation/capability.js +1 -13
  21. package/dist/evaluation/composer.js +1 -40
  22. package/dist/evaluation/engine.js +1 -175
  23. package/dist/evaluation/extract.js +1 -115
  24. package/dist/evaluation/game-strategy.d.ts +27 -0
  25. package/dist/evaluation/game-strategy.js +1 -0
  26. package/dist/evaluation/gap.js +1 -100
  27. package/dist/evaluation/index.d.ts +1 -0
  28. package/dist/evaluation/index.js +1 -11
  29. package/dist/evaluation/node-game.d.ts +31 -3
  30. package/dist/evaluation/node-game.js +1 -57
  31. package/dist/evaluation/region.js +1 -36
  32. package/dist/evaluation/types.d.ts +1 -0
  33. package/dist/evaluation/types.js +1 -1
  34. package/dist/evaluation/user-injection.js +1 -27
  35. package/dist/experience/experience-reuse.js +1 -103
  36. package/dist/experience/index.js +1 -5
  37. package/dist/experience/intent-distill.js +1 -83
  38. package/dist/experience/realtime-feedback.js +1 -94
  39. package/dist/experience/types.js +1 -1
  40. package/dist/experience/user-profile.js +1 -171
  41. package/dist/extensions/business-modules.js +1 -287
  42. package/dist/extensions/capability-manifest.js +1 -781
  43. package/dist/extensions/constraint-registry.js +1 -198
  44. package/dist/extensions/index.js +1 -6
  45. package/dist/extensions/metric-registry.js +1 -257
  46. package/dist/extensions/mode-evaluator.js +1 -170
  47. package/dist/extensions/modes.js +1 -499
  48. package/dist/extensions/registry.js +1 -717
  49. package/dist/extensions/types.js +1 -1
  50. package/dist/harness/auto-escalation.js +1 -68
  51. package/dist/harness/checkpoint.js +1 -129
  52. package/dist/harness/index.js +1 -78
  53. package/dist/harness/plan.js +1 -315
  54. package/dist/harness/recover.js +1 -139
  55. package/dist/harness/types.js +1 -1
  56. package/dist/harness/verify.js +1 -237
  57. package/dist/index.js +1 -273
  58. package/dist/intent/enrich.js +1 -67
  59. package/dist/intent/index.js +1 -60
  60. package/dist/intent/matcher.js +1 -81
  61. package/dist/intent/store.js +1 -55
  62. package/dist/intent/types.js +1 -10
  63. package/dist/knowledge/acquisition-flywheel.js +1 -192
  64. package/dist/knowledge/allocation-confirm.js +1 -534
  65. package/dist/knowledge/allocation-context.js +1 -249
  66. package/dist/knowledge/allocation-ledger.js +1 -463
  67. package/dist/knowledge/allocation-puzzle.js +1 -298
  68. package/dist/knowledge/allocation-risk.js +1 -568
  69. package/dist/knowledge/allocation-templates.js +1 -970
  70. package/dist/knowledge/allocation-translation.js +1 -585
  71. package/dist/knowledge/arb-risk.js +1 -210
  72. package/dist/knowledge/arbitration-confirm.js +1 -559
  73. package/dist/knowledge/arbitration-context.js +1 -505
  74. package/dist/knowledge/arbitration-ledger.js +1 -521
  75. package/dist/knowledge/arbitration-puzzle.js +1 -304
  76. package/dist/knowledge/arbitration-risk.js +1 -423
  77. package/dist/knowledge/arbitration-templates.js +1 -276
  78. package/dist/knowledge/arbitration-translation.js +1 -487
  79. package/dist/knowledge/arbitration-trust.js +1 -117
  80. package/dist/knowledge/audit-rules.js +1 -141
  81. package/dist/knowledge/bridge-risk.js +1 -263
  82. package/dist/knowledge/contact-risk.js +1 -200
  83. package/dist/knowledge/contact-templates.js +1 -60
  84. package/dist/knowledge/demand-confirm.js +1 -206
  85. package/dist/knowledge/demand-matching.js +1 -132
  86. package/dist/knowledge/demand-risk.js +1 -240
  87. package/dist/knowledge/demand-translation.js +1 -354
  88. package/dist/knowledge/deployment-scanner.js +1 -823
  89. package/dist/knowledge/dynamic-pricing.js +1 -87
  90. package/dist/knowledge/examples-scanner-cli.js +1 -26
  91. package/dist/knowledge/examples-scanner.js +1 -843
  92. package/dist/knowledge/flywheel-loop.js +1 -404
  93. package/dist/knowledge/fund-layer.js +1 -973
  94. package/dist/knowledge/glossary.js +1 -211
  95. package/dist/knowledge/guard-confirm.js +1 -406
  96. package/dist/knowledge/guard-context.js +1 -287
  97. package/dist/knowledge/guard-design-patterns.js +1 -360
  98. package/dist/knowledge/guard-ledger.js +1 -260
  99. package/dist/knowledge/guard-lint.js +1 -670
  100. package/dist/knowledge/guard-migration.js +1 -228
  101. package/dist/knowledge/guard-puzzle.js +1 -805
  102. package/dist/knowledge/guard-render.js +1 -700
  103. package/dist/knowledge/guard-risk.js +1 -1879
  104. package/dist/knowledge/guard-submission-prompt.js +1 -171
  105. package/dist/knowledge/guard-templates.js +1 -1105
  106. package/dist/knowledge/guard-translation.js +1 -1119
  107. package/dist/knowledge/index.js +1 -436
  108. package/dist/knowledge/industry-evolution.js +1 -323
  109. package/dist/knowledge/industry-generalizer.js +1 -381
  110. package/dist/knowledge/industry-registry.js +1 -174
  111. package/dist/knowledge/intent-metrics.d.ts +4 -3
  112. package/dist/knowledge/intent-metrics.js +1 -566
  113. package/dist/knowledge/machine-confirm.js +1 -559
  114. package/dist/knowledge/machine-context.js +1 -833
  115. package/dist/knowledge/machine-ledger.js +1 -338
  116. package/dist/knowledge/machine-puzzle.js +1 -494
  117. package/dist/knowledge/machine-render.js +1 -565
  118. package/dist/knowledge/machine-risk.js +1 -669
  119. package/dist/knowledge/machine-templates.js +1 -1597
  120. package/dist/knowledge/machine-topology.js +1 -234
  121. package/dist/knowledge/machine-translation.js +1 -513
  122. package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
  123. package/dist/knowledge/mcp-schema-audit.js +1 -777
  124. package/dist/knowledge/onchain-constants.js +1 -35
  125. package/dist/knowledge/order-confirm.js +1 -573
  126. package/dist/knowledge/order-context.js +1 -390
  127. package/dist/knowledge/order-ledger.js +1 -341
  128. package/dist/knowledge/order-puzzle.js +1 -255
  129. package/dist/knowledge/order-risk.js +1 -653
  130. package/dist/knowledge/order-templates.js +1 -368
  131. package/dist/knowledge/order-translation.js +1 -550
  132. package/dist/knowledge/overrides-loader.js +1 -65
  133. package/dist/knowledge/passport-confirm.js +1 -531
  134. package/dist/knowledge/passport-context.js +1 -306
  135. package/dist/knowledge/passport-ledger.js +1 -282
  136. package/dist/knowledge/passport-puzzle.js +1 -333
  137. package/dist/knowledge/passport-risk.js +1 -450
  138. package/dist/knowledge/passport-templates.js +1 -568
  139. package/dist/knowledge/passport-translation.js +1 -516
  140. package/dist/knowledge/payment-risk.js +1 -249
  141. package/dist/knowledge/permission-confirm.js +1 -426
  142. package/dist/knowledge/permission-context.js +1 -224
  143. package/dist/knowledge/permission-ledger.js +1 -403
  144. package/dist/knowledge/permission-puzzle.js +1 -173
  145. package/dist/knowledge/permission-risk.js +1 -411
  146. package/dist/knowledge/permission-templates.js +1 -234
  147. package/dist/knowledge/permission-translation.js +1 -350
  148. package/dist/knowledge/personal-risk.js +1 -212
  149. package/dist/knowledge/process-model.js +1 -160
  150. package/dist/knowledge/progress-confirm.js +1 -456
  151. package/dist/knowledge/progress-context.js +1 -452
  152. package/dist/knowledge/progress-ledger.js +1 -330
  153. package/dist/knowledge/progress-puzzle.js +1 -219
  154. package/dist/knowledge/progress-risk.js +1 -461
  155. package/dist/knowledge/progress-templates.js +1 -228
  156. package/dist/knowledge/progress-translation.js +1 -405
  157. package/dist/knowledge/proof-confirm.js +1 -187
  158. package/dist/knowledge/proof-risk.js +1 -207
  159. package/dist/knowledge/proof-translation.js +1 -283
  160. package/dist/knowledge/registrar-risk.js +1 -217
  161. package/dist/knowledge/repository-confirm.js +1 -286
  162. package/dist/knowledge/repository-risk.js +1 -373
  163. package/dist/knowledge/repository-translation.js +1 -445
  164. package/dist/knowledge/reputation-rules.js +1 -99
  165. package/dist/knowledge/resource-risk.js +1 -157
  166. package/dist/knowledge/reward-confirm.js +1 -526
  167. package/dist/knowledge/reward-context.js +1 -504
  168. package/dist/knowledge/reward-ledger.js +1 -502
  169. package/dist/knowledge/reward-puzzle.js +1 -300
  170. package/dist/knowledge/reward-risk.js +1 -627
  171. package/dist/knowledge/reward-templates.js +1 -197
  172. package/dist/knowledge/reward-translation.js +1 -501
  173. package/dist/knowledge/safety-rules.js +1 -404
  174. package/dist/knowledge/scenario-modes.js +1 -321
  175. package/dist/knowledge/service-confirm.js +1 -807
  176. package/dist/knowledge/service-context.js +1 -403
  177. package/dist/knowledge/service-ledger.js +1 -609
  178. package/dist/knowledge/service-puzzle.js +1 -236
  179. package/dist/knowledge/service-risk.js +1 -651
  180. package/dist/knowledge/service-templates.js +1 -456
  181. package/dist/knowledge/service-translation.js +1 -622
  182. package/dist/knowledge/template-registry.js +1 -353
  183. package/dist/knowledge/tool-constraints.js +1 -195
  184. package/dist/knowledge/tools-reference.js +1 -178
  185. package/dist/knowledge/treasury-confirm.js +1 -512
  186. package/dist/knowledge/treasury-context.js +1 -363
  187. package/dist/knowledge/treasury-ledger.js +1 -300
  188. package/dist/knowledge/treasury-puzzle.js +1 -216
  189. package/dist/knowledge/treasury-risk.js +1 -440
  190. package/dist/knowledge/treasury-templates.js +1 -358
  191. package/dist/knowledge/treasury-translation.js +1 -498
  192. package/dist/knowledge/trust-metrics.js +1 -198
  193. package/dist/knowledge/util-risk.js +1 -135
  194. package/dist/loop-engineering/aggregate.js +1 -132
  195. package/dist/loop-engineering/context-collect.js +1 -83
  196. package/dist/loop-engineering/diagnose.js +1 -273
  197. package/dist/loop-engineering/improve.js +1 -405
  198. package/dist/loop-engineering/index.js +1 -4
  199. package/dist/loop-engineering/pipeline.js +1 -56
  200. package/dist/mode-market/index.js +1 -3
  201. package/dist/mode-market/registry.js +1 -124
  202. package/dist/mode-market/review.js +1 -214
  203. package/dist/mode-market/submission.js +1 -85
  204. package/dist/participation/collaborator-interest.d.ts +23 -0
  205. package/dist/participation/collaborator-interest.js +1 -0
  206. package/dist/participation/customer-interest.d.ts +25 -0
  207. package/dist/participation/customer-interest.js +1 -0
  208. package/dist/participation/merchant-interest.js +1 -100
  209. package/dist/participation/radar-core.d.ts +13 -3
  210. package/dist/participation/radar-core.js +1 -269
  211. package/dist/participation/supplier-interest.d.ts +25 -0
  212. package/dist/participation/supplier-interest.js +1 -0
  213. package/dist/persona/analyzer.js +1 -66
  214. package/dist/persona/bridge.js +1 -86
  215. package/dist/persona/defaults.js +1 -195
  216. package/dist/persona/experience-bridge.js +1 -23
  217. package/dist/persona/index.js +1 -71
  218. package/dist/persona/model.js +1 -111
  219. package/dist/persona/store.js +1 -62
  220. package/dist/persona/types.d.ts +3 -1
  221. package/dist/persona/types.js +1 -5
  222. package/dist/project/business-puzzle.js +1 -383
  223. package/dist/project/context-assembly.js +1 -254
  224. package/dist/project/deployment-bridge.js +1 -120
  225. package/dist/project/deployment-doc.js +1 -1126
  226. package/dist/project/edit-planner.js +1 -1342
  227. package/dist/project/evaluation.js +1 -2011
  228. package/dist/project/game-theory.js +1 -177
  229. package/dist/project/graph-builder.js +1 -656
  230. package/dist/project/graph.js +1 -340
  231. package/dist/project/handlers.js +1 -1784
  232. package/dist/project/index.d.ts +1 -0
  233. package/dist/project/index.js +1 -301
  234. package/dist/project/intent-analyzer.js +1 -149
  235. package/dist/project/machine-nodes.js +1 -36
  236. package/dist/project/merchant-guide.js +1 -264
  237. package/dist/project/migration.js +1 -125
  238. package/dist/project/mode-actions.js +1 -309
  239. package/dist/project/namespace.js +1 -206
  240. package/dist/project/participation-radar.js +1 -428
  241. package/dist/project/pipeline-actions.js +1 -109
  242. package/dist/project/project-store.js +1 -422
  243. package/dist/project/query.js +1 -153
  244. package/dist/project/reverse-mapping.d.ts +34 -0
  245. package/dist/project/reverse-mapping.js +1 -0
  246. package/dist/project/risk-aggregator.js +1 -295
  247. package/dist/project/rollback-policy.js +1 -290
  248. package/dist/project/semantic-assembler.js +1 -345
  249. package/dist/project/semantic-graph.js +1 -292
  250. package/dist/project/stage-gate.js +1 -369
  251. package/dist/project/substep-trace.js +1 -332
  252. package/dist/project/task-tracker.js +1 -78
  253. package/dist/role/derivation.d.ts +18 -0
  254. package/dist/role/derivation.js +1 -0
  255. package/dist/role/index.d.ts +5 -0
  256. package/dist/role/index.js +1 -0
  257. package/dist/role/model.d.ts +8 -0
  258. package/dist/role/model.js +1 -0
  259. package/dist/role/resolution.d.ts +11 -0
  260. package/dist/role/resolution.js +1 -0
  261. package/dist/role/types.d.ts +11 -0
  262. package/dist/role/types.js +1 -0
  263. package/dist/rules.js +1 -52
  264. package/dist/safety/confirm-gate.js +1 -88
  265. package/dist/safety/index.js +1 -3
  266. package/dist/safety/preview.js +1 -52
  267. package/dist/schema/call/allocation.js +1 -34
  268. package/dist/schema/call/arbitration.js +1 -113
  269. package/dist/schema/call/base.d.ts +15 -15
  270. package/dist/schema/call/base.js +1 -370
  271. package/dist/schema/call/bridge-handler.js +1 -265
  272. package/dist/schema/call/bridge.d.ts +7 -7
  273. package/dist/schema/call/bridge.js +1 -458
  274. package/dist/schema/call/contact.js +1 -37
  275. package/dist/schema/call/demand.js +1 -47
  276. package/dist/schema/call/guard.js +1 -161
  277. package/dist/schema/call/handler.js +1 -322
  278. package/dist/schema/call/index.js +1 -20
  279. package/dist/schema/call/machine.js +1 -193
  280. package/dist/schema/call/order.js +1 -35
  281. package/dist/schema/call/payment.js +1 -37
  282. package/dist/schema/call/permission-handler.js +1 -54
  283. package/dist/schema/call/permission.js +1 -105
  284. package/dist/schema/call/personal.js +1 -78
  285. package/dist/schema/call/progress.js +1 -47
  286. package/dist/schema/call/proof.js +1 -33
  287. package/dist/schema/call/repository.js +1 -77
  288. package/dist/schema/call/reward.js +1 -30
  289. package/dist/schema/call/semantic.js +1 -1679
  290. package/dist/schema/call/service.js +1 -184
  291. package/dist/schema/call/treasury.js +1 -71
  292. package/dist/schema/common/index.js +1 -407
  293. package/dist/schema/config/index.js +1 -68
  294. package/dist/schema/evaluation/index.d.ts +213 -16
  295. package/dist/schema/evaluation/index.js +1 -356
  296. package/dist/schema/index.js +1 -17
  297. package/dist/schema/intent-radar/index.d.ts +13 -13
  298. package/dist/schema/intent-radar/index.js +1 -89
  299. package/dist/schema/local/index.d.ts +21 -21
  300. package/dist/schema/local/index.js +1 -927
  301. package/dist/schema/local/wip.js +1 -187
  302. package/dist/schema/messenger/index.d.ts +7 -7
  303. package/dist/schema/messenger/index.js +1 -475
  304. package/dist/schema/operations.d.ts +7 -7
  305. package/dist/schema/operations.js +1 -520
  306. package/dist/schema/persona/index.d.ts +54 -54
  307. package/dist/schema/persona/index.js +1 -148
  308. package/dist/schema/project/index.d.ts +94 -48
  309. package/dist/schema/project/index.js +1 -2057
  310. package/dist/schema/query/index.d.ts +423 -7
  311. package/dist/schema/query/index.js +1 -1646
  312. package/dist/schema/schema-query/index.js +1 -104
  313. package/dist/schema/schema-version.js +1 -76
  314. package/dist/schema/sync-layer4.js +1 -286
  315. package/dist/schema/task-status.js +1 -36
  316. package/dist/schema/trust/index.js +1 -314
  317. package/dist/schema/utils/guard-parser.js +1 -419
  318. package/dist/schema/utils/guard-query-utils.js +1 -46
  319. package/dist/schema/utils/node-parser.js +1 -369
  320. package/dist/schema/utils/object-type-utils.js +1 -35
  321. package/dist/schema/utils/permission-index-utils.js +1 -7
  322. package/dist/schema/utils/permission-machine-check.js +1 -121
  323. package/dist/schema/utils/skills-recommendation.js +1 -77
  324. package/dist/schema-query/index.js +1 -810
  325. package/dist/schemas/account_operation.output.json +5 -2
  326. package/dist/schemas/bridge_operation.output.json +5 -2
  327. package/dist/schemas/evaluation_operation.output.json +112 -7
  328. package/dist/schemas/evaluation_operation.schema.json +93 -6
  329. package/dist/schemas/index.json +1 -1
  330. package/dist/schemas/intent_radar.output.json +4 -1
  331. package/dist/schemas/intent_radar.schema.json +4 -1
  332. package/dist/schemas/local_info_operation.output.json +5 -2
  333. package/dist/schemas/local_mark_operation.output.json +5 -2
  334. package/dist/schemas/messenger_operation.output.json +5 -2
  335. package/dist/schemas/onchain_events.output.json +5 -2
  336. package/dist/schemas/onchain_operations.output.json +5 -2
  337. package/dist/schemas/onchain_operations.schema.json +4 -4
  338. package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
  339. package/dist/schemas/onchain_operations_machine.schema.json +2 -2
  340. package/dist/schemas/onchain_operations_service.schema.json +1 -1
  341. package/dist/schemas/onchain_table_data.output.json +6 -3
  342. package/dist/schemas/persona_operation.output.json +4 -1
  343. package/dist/schemas/persona_operation.schema.json +4 -1
  344. package/dist/schemas/project_operation.output.json +28 -8
  345. package/dist/schemas/query_toolkit.output.json +8 -5
  346. package/dist/schemas/wowok_buildin_info.output.json +132 -0
  347. package/dist/schemas/wowok_buildin_info.schema.json +14 -0
  348. package/dist/telemetry/index.js +1 -112
  349. package/dist/telemetry/redact.js +1 -23
  350. package/dist/telemetry/storage.js +1 -80
  351. package/dist/tools/handlers/bridge.js +1 -1
  352. package/dist/tools/handlers/config.js +1 -74
  353. package/dist/tools/handlers/evaluation.js +1 -123
  354. package/dist/tools/handlers/file-export.js +1 -90
  355. package/dist/tools/handlers/intent-radar.js +1 -76
  356. package/dist/tools/handlers/local.js +1 -53
  357. package/dist/tools/handlers/messenger.js +1 -188
  358. package/dist/tools/handlers/onchain.js +1 -1180
  359. package/dist/tools/handlers/persona.js +1 -89
  360. package/dist/tools/handlers/project.js +1 -211
  361. package/dist/tools/handlers/query.js +1 -434
  362. package/dist/tools/handlers/schema-query.js +1 -176
  363. package/dist/tools/handlers/task-status.js +1 -26
  364. package/dist/tools/handlers/trust.js +1 -380
  365. package/dist/tools/handlers/wip.js +1 -90
  366. package/dist/tools/index.js +1 -1382
  367. package/dist/tools/retry.js +1 -85
  368. package/dist/tools/rules-hook.js +1 -23
  369. package/dist/tools/shared.js +1 -130
  370. package/dist/tools/types.js +1 -1
  371. package/dist/tools/upgrade-check.d.ts +19 -0
  372. package/dist/tools/upgrade-check.js +1 -0
  373. package/dist/tools/wip-deploy-assist.js +1 -306
  374. package/dist/tools/wrap.js +1 -500
  375. package/package.json +4 -2
@@ -1,214 +1 @@
1
- export const AUDIT_CHECKLIST = [
2
- {
3
- key: "permission_indexes_valid",
4
- label: "Permission indexes are valid (1000-65535 range, no conflicts)",
5
- required: true,
6
- description: "All permission indexes in default_permissions must be in the valid range and not conflict with namedOperator assignments.",
7
- },
8
- {
9
- key: "machine_nodes_min_two",
10
- label: "Machine has at least 2 nodes (entry + terminal)",
11
- required: true,
12
- description: "The scenario template's Machine object must define at least 2 nodes.",
13
- },
14
- {
15
- key: "guards_immutable_flagged",
16
- label: "Immutable objects (Guard) are flagged with risk_flags",
17
- required: true,
18
- description: "All Guard objects must have 'immutable_after_creation' in risk_flags.",
19
- },
20
- {
21
- key: "allocation_sum_correct",
22
- label: "Allocation sharing ratios sum to 10000 basis points",
23
- required: true,
24
- description: "When allocation is defined, the sharing percentages must sum to 100% (10000 bps).",
25
- },
26
- {
27
- key: "dependencies_acyclic",
28
- label: "Object dependencies form a DAG (no cycles)",
29
- required: true,
30
- description: "The object dependency graph must not contain cycles.",
31
- },
32
- {
33
- key: "phases_cover_objects",
34
- label: "All phases reference valid object types",
35
- required: true,
36
- description: "Every phase's object_types must be a subset of the objects defined in the template.",
37
- },
38
- {
39
- key: "description_non_empty",
40
- label: "Template has a non-empty description",
41
- required: false,
42
- description: "The template should have a meaningful description for users.",
43
- },
44
- {
45
- key: "keywords_non_empty",
46
- label: "Template has at least 3 keywords for intent matching",
47
- required: false,
48
- description: "Keywords help the Plan Loop match user intent to this template.",
49
- },
50
- {
51
- key: "arbiter_configured",
52
- label: "Arbiter permission is configured",
53
- required: false,
54
- description: "The template should specify an arbiter role for dispute resolution.",
55
- },
56
- {
57
- key: "no_infinite_loops",
58
- label: "Machine state graph has no infinite loops (terminal node reachable)",
59
- required: true,
60
- description: "The Machine must have a path to a terminal state from every node.",
61
- },
62
- ];
63
- function validatePermissionIndexes(entry) {
64
- const perms = entry.scenario.default_permissions;
65
- if (perms.provider !== undefined) {
66
- if (typeof perms.provider === "number" && (perms.provider < 1000 || perms.provider > 65535)) {
67
- return false;
68
- }
69
- }
70
- if (perms.arbiter !== undefined) {
71
- if (typeof perms.arbiter === "number" && (perms.arbiter < 1000 || perms.arbiter > 65535)) {
72
- return false;
73
- }
74
- }
75
- return true;
76
- }
77
- function validateMachineNodes(entry) {
78
- const machineObjects = entry.scenario.objects.filter((o) => o.type === "Machine");
79
- if (machineObjects.length === 0)
80
- return true;
81
- return true;
82
- }
83
- function validateGuardsFlagged(entry) {
84
- const guardObjects = entry.scenario.objects.filter((o) => o.type === "Guard");
85
- for (const g of guardObjects) {
86
- if (!g.risk_flags || !g.risk_flags.includes("immutable_after_creation")) {
87
- return false;
88
- }
89
- }
90
- return true;
91
- }
92
- function validateAllocationSum(entry) {
93
- const allocObjects = entry.scenario.objects.filter((o) => o.type === "Allocation");
94
- if (allocObjects.length === 0)
95
- return true;
96
- return true;
97
- }
98
- function validateDependenciesAcyclic(entry) {
99
- const objects = entry.scenario.objects;
100
- const visited = new Set();
101
- const recursionStack = new Set();
102
- function hasCycle(objType, path) {
103
- if (recursionStack.has(objType))
104
- return true;
105
- if (visited.has(objType))
106
- return false;
107
- visited.add(objType);
108
- recursionStack.add(objType);
109
- const obj = objects.find((o) => o.type === objType);
110
- if (obj) {
111
- for (const dep of obj.dependencies) {
112
- if (path.has(dep))
113
- continue;
114
- if (hasCycle(dep, new Set([...path, objType])))
115
- return true;
116
- }
117
- }
118
- recursionStack.delete(objType);
119
- return false;
120
- }
121
- for (const obj of objects) {
122
- visited.clear();
123
- recursionStack.clear();
124
- if (hasCycle(obj.type, new Set()))
125
- return false;
126
- }
127
- return true;
128
- }
129
- function validatePhasesCoverObjects(entry) {
130
- const definedTypes = new Set(entry.scenario.objects.map((o) => o.type));
131
- for (const phase of entry.scenario.phases) {
132
- for (const ot of phase.object_types) {
133
- if (!definedTypes.has(ot))
134
- return false;
135
- }
136
- }
137
- return true;
138
- }
139
- function validateDescription(entry) {
140
- return !!entry.description && entry.description.trim().length > 0;
141
- }
142
- function validateKeywords(entry) {
143
- return entry.scenario.keywords.length >= 3;
144
- }
145
- function validateArbiter(entry) {
146
- return entry.scenario.default_permissions.arbiter !== undefined;
147
- }
148
- function validateNoInfiniteLoops(entry) {
149
- return true;
150
- }
151
- const VALIDATORS = {
152
- permission_indexes_valid: validatePermissionIndexes,
153
- machine_nodes_min_two: validateMachineNodes,
154
- guards_immutable_flagged: validateGuardsFlagged,
155
- allocation_sum_correct: validateAllocationSum,
156
- dependencies_acyclic: validateDependenciesAcyclic,
157
- phases_cover_objects: validatePhasesCoverObjects,
158
- description_non_empty: validateDescription,
159
- keywords_non_empty: validateKeywords,
160
- arbiter_configured: validateArbiter,
161
- no_infinite_loops: validateNoInfiniteLoops,
162
- };
163
- export function runAudit(entry, auditor) {
164
- const checklistResults = {};
165
- const failedRequired = [];
166
- for (const item of AUDIT_CHECKLIST) {
167
- const validator = VALIDATORS[item.key];
168
- const passed = validator ? validator(entry) : true;
169
- checklistResults[item.key] = passed;
170
- if (!passed && item.required) {
171
- failedRequired.push(item.key);
172
- }
173
- }
174
- const auditId = `AUDIT-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
175
- const notes = failedRequired.length === 0
176
- ? "All required checklist items passed."
177
- : `Failed required items: ${failedRequired.join(", ")}`;
178
- return {
179
- audit_id: auditId,
180
- template_id: entry.template_id,
181
- auditor,
182
- timestamp: new Date().toISOString(),
183
- checklist_results: checklistResults,
184
- passed: failedRequired.length === 0,
185
- failed_required_items: failedRequired,
186
- notes,
187
- };
188
- }
189
- export const MIN_COMMUNITY_RATING_FOR_APPROVAL = 3.5;
190
- export const MIN_REVIEWS_FOR_APPROVAL = 1;
191
- export function meetsCommunityRatingThreshold(entry) {
192
- if (entry.reviews.length < MIN_REVIEWS_FOR_APPROVAL)
193
- return false;
194
- return entry.average_rating >= MIN_COMMUNITY_RATING_FOR_APPROVAL;
195
- }
196
- export function canApprove(entry, audit) {
197
- return audit.passed && meetsCommunityRatingThreshold(entry);
198
- }
199
- export function getApprovalEligibility(entry, audit) {
200
- const blockers = [];
201
- if (!audit.passed) {
202
- blockers.push(`Official audit failed: ${audit.failed_required_items.join(", ")}`);
203
- }
204
- if (entry.reviews.length < MIN_REVIEWS_FOR_APPROVAL) {
205
- blockers.push(`Insufficient community reviews: ${entry.reviews.length}/${MIN_REVIEWS_FOR_APPROVAL}`);
206
- }
207
- if (entry.average_rating < MIN_COMMUNITY_RATING_FOR_APPROVAL) {
208
- blockers.push(`Community rating too low: ${entry.average_rating.toFixed(1)}/${MIN_COMMUNITY_RATING_FOR_APPROVAL}`);
209
- }
210
- return {
211
- eligible: blockers.length === 0,
212
- blockers,
213
- };
214
- }
1
+ export const AUDIT_CHECKLIST=[{'key':'permission_indexes_valid','label':'Permission\x20indexes\x20are\x20valid\x20(1000-65535\x20range,\x20no\x20conflicts)','required':!![],'description':'All\x20permission\x20indexes\x20in\x20default_permissions\x20must\x20be\x20in\x20the\x20valid\x20range\x20and\x20not\x20conflict\x20with\x20namedOperator\x20assignments.'},{'key':'machine_nodes_min_two','label':'Machine\x20has\x20at\x20least\x202\x20nodes\x20(entry\x20+\x20terminal)','required':!![],'description':'The\x20scenario\x20template\x27s\x20Machine\x20object\x20must\x20define\x20at\x20least\x202\x20nodes.'},{'key':'guards_immutable_flagged','label':'Immutable\x20objects\x20(Guard)\x20are\x20flagged\x20with\x20risk_flags','required':!![],'description':'All\x20Guard\x20objects\x20must\x20have\x20\x27immutable_after_creation\x27\x20in\x20risk_flags.'},{'key':'allocation_sum_correct','label':'Allocation\x20sharing\x20ratios\x20sum\x20to\x2010000\x20basis\x20points','required':!![],'description':'When\x20allocation\x20is\x20defined,\x20the\x20sharing\x20percentages\x20must\x20sum\x20to\x20100%\x20(10000\x20bps).'},{'key':'dependencies_acyclic','label':'Object\x20dependencies\x20form\x20a\x20DAG\x20(no\x20cycles)','required':!![],'description':'The\x20object\x20dependency\x20graph\x20must\x20not\x20contain\x20cycles.'},{'key':'phases_cover_objects','label':'All\x20phases\x20reference\x20valid\x20object\x20types','required':!![],'description':'Every\x20phase\x27s\x20object_types\x20must\x20be\x20a\x20subset\x20of\x20the\x20objects\x20defined\x20in\x20the\x20template.'},{'key':'description_non_empty','label':'Template\x20has\x20a\x20non-empty\x20description','required':![],'description':'The\x20template\x20should\x20have\x20a\x20meaningful\x20description\x20for\x20users.'},{'key':'keywords_non_empty','label':'Template\x20has\x20at\x20least\x203\x20keywords\x20for\x20intent\x20matching','required':![],'description':'Keywords\x20help\x20the\x20Plan\x20Loop\x20match\x20user\x20intent\x20to\x20this\x20template.'},{'key':'arbiter_configured','label':'Arbiter\x20permission\x20is\x20configured','required':![],'description':'The\x20template\x20should\x20specify\x20an\x20arbiter\x20role\x20for\x20dispute\x20resolution.'},{'key':'no_infinite_loops','label':'Machine\x20state\x20graph\x20has\x20no\x20infinite\x20loops\x20(terminal\x20node\x20reachable)','required':!![],'description':'The\x20Machine\x20must\x20have\x20a\x20path\x20to\x20a\x20terminal\x20state\x20from\x20every\x20node.'}];function validatePermissionIndexes(a){const b=a['scenario']['default_permissions'];if(b['provider']!==undefined){if(typeof b['provider']==='number'&&(b['provider']<0x3e8||b['provider']>0xffff))return![];}if(b['arbiter']!==undefined){if(typeof b['arbiter']==='number'&&(b['arbiter']<0x3e8||b['arbiter']>0xffff))return![];}return!![];}function validateMachineNodes(a){const b=a['scenario']['objects']['filter'](c=>c['type']==='Machine');if(b['length']===0x0)return!![];return!![];}function validateGuardsFlagged(a){const b=a['scenario']['objects']['filter'](c=>c['type']==='Guard');for(const c of b){if(!c['risk_flags']||!c['risk_flags']['includes']('immutable_after_creation'))return![];}return!![];}function validateAllocationSum(a){const b=a['scenario']['objects']['filter'](c=>c['type']==='Allocation');if(b['length']===0x0)return!![];return!![];}function validateDependenciesAcyclic(a){const b=a['scenario']['objects'],c=new Set(),d=new Set();function e(f,g){if(d['has'](f))return!![];if(c['has'](f))return![];c['add'](f),d['add'](f);const h=b['find'](i=>i['type']===f);if(h)for(const i of h['dependencies']){if(g['has'](i))continue;if(e(i,new Set([...g,f])))return!![];}return d['delete'](f),![];}for(const f of b){c['clear'](),d['clear']();if(e(f['type'],new Set()))return![];}return!![];}function validatePhasesCoverObjects(a){const b=new Set(a['scenario']['objects']['map'](c=>c['type']));for(const c of a['scenario']['phases']){for(const d of c['object_types']){if(!b['has'](d))return![];}}return!![];}function validateDescription(a){return!!a['description']&&a['description']['trim']()['length']>0x0;}function validateKeywords(a){return a['scenario']['keywords']['length']>=0x3;}function validateArbiter(a){return a['scenario']['default_permissions']['arbiter']!==undefined;}function validateNoInfiniteLoops(a){return!![];}const VALIDATORS={'permission_indexes_valid':validatePermissionIndexes,'machine_nodes_min_two':validateMachineNodes,'guards_immutable_flagged':validateGuardsFlagged,'allocation_sum_correct':validateAllocationSum,'dependencies_acyclic':validateDependenciesAcyclic,'phases_cover_objects':validatePhasesCoverObjects,'description_non_empty':validateDescription,'keywords_non_empty':validateKeywords,'arbiter_configured':validateArbiter,'no_infinite_loops':validateNoInfiniteLoops};export function runAudit(a,b){const c={},d=[];for(const g of AUDIT_CHECKLIST){const h=VALIDATORS[g['key']],i=h?h(a):!![];c[g['key']]=i,!i&&g['required']&&d['push'](g['key']);}const e='AUDIT-'+Date['now']()+'-'+Math['random']()['toString'](0x24)['slice'](0x2,0x6),f=d['length']===0x0?'All\x20required\x20checklist\x20items\x20passed.':'Failed\x20required\x20items:\x20'+d['join'](',\x20');return{'audit_id':e,'template_id':a['template_id'],'auditor':b,'timestamp':new Date()['toISOString'](),'checklist_results':c,'passed':d['length']===0x0,'failed_required_items':d,'notes':f};}export const MIN_COMMUNITY_RATING_FOR_APPROVAL=3.5;export const MIN_REVIEWS_FOR_APPROVAL=0x1;export function meetsCommunityRatingThreshold(a){if(a['reviews']['length']<MIN_REVIEWS_FOR_APPROVAL)return![];return a['average_rating']>=MIN_COMMUNITY_RATING_FOR_APPROVAL;}export function canApprove(a,b){return b['passed']&&meetsCommunityRatingThreshold(a);}export function getApprovalEligibility(a,b){const c=[];return!b['passed']&&c['push']('Official\x20audit\x20failed:\x20'+b['failed_required_items']['join'](',\x20')),a['reviews']['length']<MIN_REVIEWS_FOR_APPROVAL&&c['push']('Insufficient\x20community\x20reviews:\x20'+a['reviews']['length']+'/'+MIN_REVIEWS_FOR_APPROVAL),a['average_rating']<MIN_COMMUNITY_RATING_FOR_APPROVAL&&c['push']('Community\x20rating\x20too\x20low:\x20'+a['average_rating']['toFixed'](0x1)+'/'+MIN_COMMUNITY_RATING_FOR_APPROVAL),{'eligible':c['length']===0x0,'blockers':c};}
@@ -1,85 +1 @@
1
- const VALID_OBJECT_TYPES = [
2
- "Permission", "Service", "Machine", "Guard", "Allocation",
3
- "Progress", "Repository", "Treasury", "Reward", "Demand",
4
- "Order", "Arbitration", "Contact", "Personal", "Payment",
5
- ];
6
- export function validateSubmission(submission) {
7
- const errors = [];
8
- const warnings = [];
9
- if (!submission.template_name || submission.template_name.trim().length === 0) {
10
- errors.push("template_name is required");
11
- }
12
- if (!submission.submitter || submission.submitter.trim().length === 0) {
13
- errors.push("submitter is required");
14
- }
15
- if (!submission.description || submission.description.trim().length === 0) {
16
- errors.push("description is required");
17
- }
18
- if (!submission.scenario) {
19
- errors.push("scenario is required");
20
- }
21
- if (submission.version && !/^\d+\.\d+\.\d+$/.test(submission.version)) {
22
- errors.push("version must be in semver format (e.g., '1.0.0')");
23
- }
24
- if (submission.scenario) {
25
- const s = submission.scenario;
26
- if (!s.name || s.name.trim().length === 0) {
27
- errors.push("scenario.name is required");
28
- }
29
- if (!s.keywords || s.keywords.length === 0) {
30
- warnings.push("scenario.keywords is empty — intent matching will fail");
31
- }
32
- else if (s.keywords.length < 3) {
33
- warnings.push("scenario.keywords has fewer than 3 entries — intent matching may be weak");
34
- }
35
- if (!s.objects || s.objects.length === 0) {
36
- errors.push("scenario.objects must have at least one object");
37
- }
38
- else {
39
- for (const obj of s.objects) {
40
- if (!VALID_OBJECT_TYPES.includes(obj.type)) {
41
- errors.push(`Invalid object type: '${obj.type}'. Valid types: ${VALID_OBJECT_TYPES.join(", ")}`);
42
- }
43
- if (obj.dependencies.includes(obj.type)) {
44
- warnings.push(`Object type '${obj.type}' depends on itself — may cause issues`);
45
- }
46
- }
47
- }
48
- if (!s.phases || s.phases.length === 0) {
49
- warnings.push("scenario.phases is empty — no phased execution plan defined");
50
- }
51
- const perms = s.default_permissions;
52
- if (perms.provider !== undefined && typeof perms.provider === "number") {
53
- if (perms.provider < 1000 || perms.provider > 65535) {
54
- errors.push(`default_permissions.provider index ${perms.provider} is out of range (1000-65535)`);
55
- }
56
- }
57
- if (perms.arbiter !== undefined && typeof perms.arbiter === "number") {
58
- if (perms.arbiter < 1000 || perms.arbiter > 65535) {
59
- errors.push(`default_permissions.arbiter index ${perms.arbiter} is out of range (1000-65535)`);
60
- }
61
- }
62
- }
63
- if (submission.tags && submission.tags.length > 10) {
64
- warnings.push("More than 10 tags — consider trimming for relevance");
65
- }
66
- return {
67
- valid: errors.length === 0,
68
- errors,
69
- warnings,
70
- };
71
- }
72
- export function createSubmission(submitter, templateName, description, scenario, options) {
73
- return {
74
- submission_id: `SUB-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
75
- submitter,
76
- submitted_date: new Date().toISOString(),
77
- template_name: templateName,
78
- version: options?.version || "1.0.0",
79
- description,
80
- tags: options?.tags || [],
81
- scenario,
82
- contact: options?.contact,
83
- license: options?.license,
84
- };
85
- }
1
+ const VALID_OBJECT_TYPES=['Permission','Service','Machine','Guard','Allocation','Progress','Repository','Treasury','Reward','Demand','Order','Arbitration','Contact','Personal','Payment'];export function validateSubmission(a){const b=[],c=[];(!a['template_name']||a['template_name']['trim']()['length']===0x0)&&b['push']('template_name\x20is\x20required');(!a['submitter']||a['submitter']['trim']()['length']===0x0)&&b['push']('submitter\x20is\x20required');(!a['description']||a['description']['trim']()['length']===0x0)&&b['push']('description\x20is\x20required');!a['scenario']&&b['push']('scenario\x20is\x20required');a['version']&&!/^\d+\.\d+\.\d+$/['test'](a['version'])&&b['push']('version\x20must\x20be\x20in\x20semver\x20format\x20(e.g.,\x20\x271.0.0\x27)');if(a['scenario']){const d=a['scenario'];(!d['name']||d['name']['trim']()['length']===0x0)&&b['push']('scenario.name\x20is\x20required');if(!d['keywords']||d['keywords']['length']===0x0)c['push']('scenario.keywords\x20is\x20empty\x20—\x20intent\x20matching\x20will\x20fail');else d['keywords']['length']<0x3&&c['push']('scenario.keywords\x20has\x20fewer\x20than\x203\x20entries\x20—\x20intent\x20matching\x20may\x20be\x20weak');if(!d['objects']||d['objects']['length']===0x0)b['push']('scenario.objects\x20must\x20have\x20at\x20least\x20one\x20object');else for(const f of d['objects']){!VALID_OBJECT_TYPES['includes'](f['type'])&&b['push']('Invalid\x20object\x20type:\x20\x27'+f['type']+'\x27.\x20Valid\x20types:\x20'+VALID_OBJECT_TYPES['join'](',\x20')),f['dependencies']['includes'](f['type'])&&c['push']('Object\x20type\x20\x27'+f['type']+'\x27\x20depends\x20on\x20itself\x20—\x20may\x20cause\x20issues');}(!d['phases']||d['phases']['length']===0x0)&&c['push']('scenario.phases\x20is\x20empty\x20—\x20no\x20phased\x20execution\x20plan\x20defined');const e=d['default_permissions'];e['provider']!==undefined&&typeof e['provider']==='number'&&((e['provider']<0x3e8||e['provider']>0xffff)&&b['push']('default_permissions.provider\x20index\x20'+e['provider']+'\x20is\x20out\x20of\x20range\x20(1000-65535)')),e['arbiter']!==undefined&&typeof e['arbiter']==='number'&&((e['arbiter']<0x3e8||e['arbiter']>0xffff)&&b['push']('default_permissions.arbiter\x20index\x20'+e['arbiter']+'\x20is\x20out\x20of\x20range\x20(1000-65535)'));}return a['tags']&&a['tags']['length']>0xa&&c['push']('More\x20than\x2010\x20tags\x20—\x20consider\x20trimming\x20for\x20relevance'),{'valid':b['length']===0x0,'errors':b,'warnings':c};}export function createSubmission(a,b,c,d,e){return{'submission_id':'SUB-'+Date['now']()+'-'+Math['random']()['toString'](0x24)['slice'](0x2,0x8),'submitter':a,'submitted_date':new Date()['toISOString'](),'template_name':b,'version':e?.['version']||'1.0.0','description':c,'tags':e?.['tags']||[],'scenario':d,'contact':e?.['contact'],'license':e?.['license']};}
@@ -0,0 +1,23 @@
1
+ import type { RadarForward } from "./radar-core.js";
2
+ export interface CollaboratorInterestInput {
3
+ account: string;
4
+ current_node: string;
5
+ operable: RadarForward[];
6
+ waiting_on: Array<{
7
+ role: string;
8
+ forwards: string[];
9
+ }>;
10
+ collaborator_kind?: "permission_entity" | "named_operator";
11
+ arbitration_bound: boolean;
12
+ terminal?: "completed" | "refunded" | null;
13
+ stalled_hours?: number;
14
+ unread_messages?: number;
15
+ }
16
+ export interface CollaboratorInterestAnalysis {
17
+ fund_flow: string[];
18
+ responsibility: string[];
19
+ leverage: string[];
20
+ stakes: string[];
21
+ summary: string;
22
+ }
23
+ export declare function analyzeCollaboratorInterest(input: CollaboratorInterestInput): CollaboratorInterestAnalysis;
@@ -0,0 +1 @@
1
+ export function analyzeCollaboratorInterest(a){const b=[],c=[],d=[],e=[],f=a['collaborator_kind']==='named_operator'?'external\x20named\x20operator':'permission\x20entity\x20(internal\x20staff)';b['push']('As\x20a\x20'+f+',\x20you\x20carry\x20no\x20direct\x20settlement\x20stake\x20in\x20this\x20order\x20—\x20'+'your\x20compensation\x20is\x20typically\x20outside\x20the\x20on-chain\x20order\x20(salary/contract)\x20'+'unless\x20the\x20allocation\x20waterfall\x20explicitly\x20routes\x20a\x20slot\x20to\x20your\x20address.');const g=a['operable']['filter'](j=>j['guard']);a['operable']['length']>0x0&&c['push'](a['operable']['length']+'\x20forward(s)\x20are\x20executable\x20by\x20YOUR\x20role\x20right\x20now\x20'+('('+a['operable']['map'](j=>'\x27'+j['name']+'\x27')['join'](',\x20')+'):\x20your\x20inaction\x20stalls\x20the\x20workflow,\x20')+'and\x20the\x20stall\x20is\x20publicly\x20visible\x20on-chain\x20(flow\x20statistics\x20+\x20stall\x20metrics).');g['length']>0x0&&c['push']('Forward(s)\x20'+g['map'](j=>'\x27'+j['name']+'\x27')['join'](',\x20')+'\x20are\x20guard-gated:\x20YOU\x20must\x20satisfy\x20the\x20guard\x20conditions\x20'+'(evidence,\x20verification,\x20timing)\x20before\x20execution\x20—\x20prepare\x20submissions\x20(proof/repository\x20data)\x20in\x20advance.');a['terminal']==null&&a['operable']['length']===0x0&&a['waiting_on']['length']>0x0&&c['push']('No\x20forward\x20is\x20yours\x20at\x20this\x20node\x20—\x20you\x20carry\x20no\x20execution\x20responsibility\x20here;\x20'+'avoid\x20interfering\x20outside\x20your\x20permission/named-operator\x20scope\x20(creates\x20semantic\x20responsibility\x20without\x20authority).');a['operable']['length']>0x0&&a['terminal']==null&&d['push']('Advancing\x20NOW\x20keeps\x20the\x20workflow\x20flowing\x20and\x20protects\x20your\x20professional\x20reputation\x20'+'(stall\x20metrics\x20and\x20dispute\x20rate\x20are\x20public\x20and\x20read\x20by\x20future\x20counterparties).');g['length']>0x0&&d['push']('Uploading\x20evidence\x20(Repository/proof)\x20BEFORE\x20executing\x20guard-gated\x20forwards\x20reduces\x20dispute\x20probability\x20'+'and\x20pre-builds\x20the\x20merchant\x27s\x20arbitration\x20defense\x20—\x20your\x20diligence\x20is\x20visible\x20on-chain.');(a['unread_messages']??0x0)>0x0&&d['push'](a['unread_messages']+'\x20unread\x20message(s)\x20from\x20this\x20order\x27s\x20counterparties\x20—\x20timely\x20replies\x20protect\x20your\x20position\x20(WTS\x20record).');a['stalled_hours']!=null&&a['stalled_hours']>0x48&&a['terminal']==null&&e['push']('Order\x20stalled\x20'+Math['round'](a['stalled_hours'])+'h:\x20prolonged\x20stalls\x20degrade\x20flow\x20statistics\x20'+'and\x20can\x20trigger\x20timeout\x20penalties\x20or\x20disputes\x20recorded\x20permanently\x20on-chain\x20—\x20the\x20two\x20cheapest\x20reputation\x20losses\x20to\x20avoid.');a['arbitration_bound']&&a['terminal']==null&&g['length']>0x0&&e['push']('A\x20dispute\x20path\x20exists\x20and\x20you\x20hold\x20guard-gated\x20forwards:\x20if\x20the\x20guard\x20fails\x20or\x20you\x20execute\x20out-of-order,\x20'+'the\x20dispute\x20record\x20lands\x20permanently\x20on-chain\x20and\x20names\x20this\x20workflow\x27s\x20operators.');a['terminal']==='refunded'&&e['push']('Refund\x20executed:\x20the\x20order\x20is\x20closed.\x20Your\x20residual\x20exposure\x20is\x20reputational\x20—\x20'+'a\x20clean\x20close-out\x20(evidence\x20archived,\x20no\x20loose\x20ends)\x20protects\x20your\x20professional\x20standing.');const h=a['terminal']==='completed'?'order\x20completed\x20—\x20workflow\x20closed':a['terminal']==='refunded'?'order\x20refunded\x20—\x20workflow\x20closed':a['operable']['length']>0x0?'YOU\x20can\x20advance\x20'+a['operable']['length']+'\x20forward(s)\x20—\x20workflow\x20momentum\x20is\x20in\x20your\x20hands':'waiting\x20on\x20'+(a['waiting_on']['map'](j=>j['role'])['join'](',\x20')||'others')+'\x20—\x20monitor\x20only',i='Collaborator\x20interest\x20('+f+')\x20at\x20node\x20\x27'+(a['current_node']||'(entry)')+'\x27:\x20'+h+'.\x20'+'All\x20options\x20above\x20are\x20informational\x20—\x20the\x20decision\x20is\x20yours.';return{'fund_flow':b,'responsibility':c,'leverage':d,'stakes':e,'summary':i};}
@@ -0,0 +1,25 @@
1
+ import type { RadarForward } from "./radar-core.js";
2
+ export interface CustomerInterestInput {
3
+ account: string;
4
+ current_node: string;
5
+ operable: RadarForward[];
6
+ waiting_on: Array<{
7
+ role: string;
8
+ forwards: string[];
9
+ }>;
10
+ order_amount?: string;
11
+ token_type?: string;
12
+ compensation_fund?: string;
13
+ arbitration_bound: boolean;
14
+ terminal?: "completed" | "refunded" | null;
15
+ stalled_hours?: number;
16
+ unread_messages?: number;
17
+ }
18
+ export interface CustomerInterestAnalysis {
19
+ fund_flow: string[];
20
+ responsibility: string[];
21
+ leverage: string[];
22
+ stakes: string[];
23
+ summary: string;
24
+ }
25
+ export declare function analyzeCustomerInterest(input: CustomerInterestInput): CustomerInterestAnalysis;
@@ -0,0 +1 @@
1
+ export function analyzeCustomerInterest(a){const b=[],c=[],d=[],e=[],f=a['token_type']?'\x20('+a['token_type']+')':'';if(a['terminal']==='completed')b['push']('Order\x20reached\x20a\x20completion\x20terminal:\x20escrowed\x20funds\x20were\x20released\x20to\x20the\x20merchant.\x20'+'Verify\x20the\x20deliverable\x20matched\x20the\x20agreement\x20BEFORE\x20confirming\x20—\x20after\x20release,\x20refunds\x20are\x20harder.');else{if(a['terminal']==='refunded')b['push']('Order\x20reached\x20a\x20refund\x20terminal:\x20escrowed\x20funds\x20return\x20to\x20you\x20per\x20the\x20Allocation\x20configuration.');else a['order_amount']!=null&&b['push'](a['order_amount']+'\x20raw\x20units'+f+'\x20of\x20YOUR\x20money\x20sit\x20escrowed\x20in\x20the\x20Order\x20—\x20'+'released\x20to\x20the\x20merchant\x20ONLY\x20when\x20the\x20workflow\x20advances\x20to\x20completion;\x20returned\x20to\x20you\x20ONLY\x20via\x20a\x20refund\x20path.');}a['compensation_fund']!=null&&a['compensation_fund']!=='0'?b['push']('Merchant\x20compensation_fund\x20holds\x20'+a['compensation_fund']+'\x20raw\x20units'+f+'\x20—\x20your\x20recourse\x20if\x20arbitration\x20awards\x20indemnity\x20(paid\x20FROM\x20it).'):b['push']('Merchant\x20compensation_fund\x20is\x20EMPTY\x20—\x20arbitration\x20indemnity\x20is\x20unenforceable;\x20your\x20protection\x20is\x20the\x20refund\x20path\x20+\x20on-chain\x20reputation\x20only.');a['operable']['length']>0x0&&c['push']('YOU\x20can\x20execute\x20'+a['operable']['map'](j=>'\x27'+j['name']+'\x27')['join'](',\x20')+'\x20right\x20now\x20—\x20'+'your\x20confirmation\x20is\x20the\x20fund-release\x20trigger:\x20only\x20confirm\x20when\x20the\x20deliverable\x20matches\x20the\x20agreement.');a['terminal']==null&&a['operable']['length']===0x0&&a['waiting_on']['length']>0x0&&c['push']('No\x20forward\x20is\x20yours\x20at\x20this\x20node\x20—\x20you\x20carry\x20no\x20execution\x20responsibility\x20here;\x20'+'delivery\x20depends\x20on\x20the\x20merchant-side\x20roles\x20in\x20waiting_on.');a['operable']['length']>0x0&&a['terminal']==null&&d['push']('Your\x20confirmation\x20is\x20your\x20LEVERAGE:\x20escrowed\x20money\x20stays\x20locked\x20until\x20YOU\x20act\x20—\x20'+'do\x20not\x20confirm\x20before\x20verifying\x20the\x20deliverable\x20(WIP\x20hash\x20/\x20receipt).');const g=a['waiting_on']['some'](j=>j['role']!=='OrderHolder\x20(customer)');g&&a['terminal']==null&&d['push']('The\x20workflow\x20waits\x20on\x20merchant-side\x20roles:\x20a\x20Messenger\x20nudge\x20accelerates\x20delivery\x20'+'and\x20the\x20conversation\x20is\x20recorded\x20as\x20WTS\x20evidence\x20protecting\x20you\x20in\x20a\x20dispute.');a['arbitration_bound']&&a['terminal']==null&&d['push']('A\x20dispute\x20path\x20exists:\x20if\x20the\x20merchant\x20stalls\x20or\x20under-delivers,\x20open\x20arbitration\x20—\x20'+'your\x20evidence\x20(WTS\x20+\x20WIP\x20hash)\x20decides\x20the\x20outcome.');(a['unread_messages']??0x0)>0x0&&d['push'](a['unread_messages']+'\x20unread\x20Messenger\x20message(s)\x20—\x20timely\x20replies\x20protect\x20your\x20position\x20(WTS\x20record).');a['order_amount']!=null&&a['terminal']==null&&e['push'](a['order_amount']+'\x20raw\x20units'+f+'\x20are\x20at\x20risk\x20while\x20escrowed\x20—\x20if\x20the\x20merchant\x20stalls\x20beyond\x20the\x20timeout,\x20'+'pursue\x20refund/arbitration\x20rather\x20than\x20letting\x20the\x20order\x20stall\x20indefinitely.');a['stalled_hours']!=null&&a['stalled_hours']>0x18&&a['terminal']==null&&e['push']('Order\x20stalled\x20'+Math['round'](a['stalled_hours'])+'h:\x20your\x20leverage\x20is\x20compensation_fund\x20(if\x20any)\x20+\x20arbitration\x20+\x20on-chain\x20reputation\x20(dislike)\x20—\x20in\x20that\x20order.');a['terminal']==='refunded'&&e['push']('Refund\x20executed:\x20funds\x20returned.\x20Remaining\x20stakes\x20are\x20reputational\x20—\x20a\x20dislike\x20vote\x20is\x20your\x20residual\x20recourse\x20if\x20the\x20merchant\x20behaved\x20unfairly.');const h=a['terminal']==='completed'?'order\x20completed\x20—\x20funds\x20released\x20(verify\x20deliverable\x20matched\x20before\x20confirming\x20next\x20time)':a['terminal']==='refunded'?'order\x20refunded\x20—\x20funds\x20returned':a['operable']['length']>0x0?'YOU\x20can\x20act\x20('+a['operable']['length']+'\x20forward(s))\x20—\x20your\x20confirmation\x20releases\x20funds,\x20verify\x20first':'waiting\x20on\x20'+(a['waiting_on']['map'](j=>j['role'])['join'](',\x20')||'others')+'\x20—\x20monitor\x20and\x20nudge',i='Customer\x20interest\x20at\x20node\x20\x27'+(a['current_node']||'(entry)')+'\x27:\x20'+h+'.\x20'+'All\x20options\x20above\x20are\x20informational\x20—\x20the\x20decision\x20is\x20yours.';return{'fund_flow':b,'responsibility':c,'leverage':d,'stakes':e,'summary':i};}
@@ -1,100 +1 @@
1
- export function analyzeMerchantInterest(input) {
2
- const fund_flow = [];
3
- const responsibility = [];
4
- const leverage = [];
5
- const stakes = [];
6
- const token = input.token_type ? ` (${input.token_type})` : "";
7
- if (input.terminal === "completed") {
8
- fund_flow.push("Order reached a completion terminal: escrowed funds are released through the Allocation waterfall. " +
9
- "Verify your expected share arrived (query the Allocation/Treasury objects).");
10
- }
11
- else if (input.terminal === "refunded") {
12
- fund_flow.push("Order reached a refund terminal: escrowed funds returned to the buyer per the Allocation configuration. " +
13
- "No settlement remains for this order.");
14
- }
15
- else {
16
- if (input.order_amount != null) {
17
- fund_flow.push(`${input.order_amount} raw units${token} sit escrowed in the Order object — ` +
18
- "released ONLY by workflow advancement to a completion path (not by time, not by platform decision).");
19
- }
20
- if (input.allocation) {
21
- const a = input.allocation;
22
- const parts = [`settlement splits across ${a.recipient_slots} recipient slot(s)`];
23
- if (a.direct_to_me_slots > 0)
24
- parts.push(`${a.direct_to_me_slots} pay directly to you`);
25
- if (a.guard_gated_slots > 0)
26
- parts.push(`${a.guard_gated_slots} are guard-resolved at settlement time (recipient not statically known)`);
27
- if (a.to_payer_slots > 0)
28
- parts.push(`${a.to_payer_slots} route back to the payer (refund-oriented)`);
29
- fund_flow.push(`Allocation waterfall: ${parts.join("; ")}.`);
30
- }
31
- else {
32
- fund_flow.push("Allocation waterfall not configured or unresolved — settlement recipients unknown; " +
33
- "funds may sit in the Order until an allocation is set or refund path triggers.");
34
- }
35
- }
36
- if (input.compensation_fund != null && input.compensation_fund !== "0") {
37
- fund_flow.push(`Service compensation_fund holds ${input.compensation_fund} raw units${token} — merchant-funded skin-in-the-game: ` +
38
- "arbitration indemnity is paid FROM it, but it also converts directly into buyer trust (higher preorder confidence).");
39
- }
40
- const myGated = input.operable.filter(f => f.guard);
41
- if (input.operable.length > 0) {
42
- responsibility.push(`${input.operable.length} forward(s) are executable by YOUR role right now ` +
43
- `(${input.operable.map(f => `'${f.name}'`).join(", ")}): inaction keeps settlement locked and the stall is publicly visible on-chain.`);
44
- }
45
- if (myGated.length > 0) {
46
- responsibility.push(`Forward(s) ${myGated.map(f => `'${f.name}'`).join(", ")} are guard-gated: YOU must satisfy the guard conditions ` +
47
- "(evidence, verification, timing) before execution — prepare submissions (proof/repository data) in advance.");
48
- }
49
- if (input.terminal == null && input.operable.length === 0 && input.waiting_on.length > 0) {
50
- responsibility.push("No forward is yours at this node — you carry no execution responsibility here; " +
51
- "avoid interfering outside your permission scope (creates semantic responsibility without authority).");
52
- }
53
- if (input.operable.length > 0 && input.terminal == null) {
54
- leverage.push("Advancing NOW shortens your fund-settlement cycle and improves your publicly-visible flow statistics " +
55
- "(future buyers' trust evaluation reads stall/dispute metrics).");
56
- }
57
- const waitingOnCustomer = input.waiting_on.some(w => w.role.includes("OrderHolder"));
58
- if (waitingOnCustomer && input.terminal == null) {
59
- leverage.push("The workflow waits on the customer (OrderHolder): a Messenger nudge accelerates fund release " +
60
- "without creating semantic responsibility — and the conversation is recorded as WTS evidence protecting YOU in a dispute.");
61
- }
62
- if (myGated.length > 0) {
63
- leverage.push("Uploading delivery evidence (Repository/proof) BEFORE executing guard-gated forwards reduces dispute probability " +
64
- "and pre-builds your arbitration defense.");
65
- }
66
- if ((input.unread_messages ?? 0) > 0) {
67
- leverage.push(`${input.unread_messages} unread message(s) from this order's counterparties — timely replies protect your position (WTS record).`);
68
- }
69
- if (input.rewards_count > 0) {
70
- leverage.push(`${input.rewards_count} reward(s) configured on the Service — honoring them (discounts/bonuses) builds repeat-buyer rate and like/dislike reputation.`);
71
- }
72
- if (input.arbitration_bound && input.terminal == null) {
73
- const fundNote = input.compensation_fund != null && input.compensation_fund !== "0"
74
- ? `indemnity would be paid from the compensation_fund (${input.compensation_fund} raw units)`
75
- : "the compensation_fund is empty (indemnity unenforceable — but the arb-loss record still lands)";
76
- stakes.push(`A dispute path exists: if the customer opens arbitration and you lose, ${fundNote}, ` +
77
- "and the loss is permanently recorded (arb-loss rate is a public metric in future buyers' trust evaluation).");
78
- }
79
- if (input.stalled_hours != null && input.stalled_hours > 72 && input.terminal == null) {
80
- stakes.push(`Order stalled ${Math.round(input.stalled_hours)}h: prolonged stalls degrade merchant flow statistics ` +
81
- "and invite dispute/dislike — the two cheapest reputation losses to avoid.");
82
- }
83
- if (input.terminal === "refunded") {
84
- stakes.push("Refund executed: settlement lost. Remaining stakes are reputational — a dislike vote is the customer's residual leverage; " +
85
- "a professional post-refund Messenger close-out is your residual protection.");
86
- }
87
- const pos = input.terminal === "completed"
88
- ? "order completed — settlement released"
89
- : input.terminal === "refunded"
90
- ? "order refunded — settlement lost"
91
- : input.operable.length > 0
92
- ? `YOU can advance ${input.operable.length} forward(s) — settlement speed is in your hands`
93
- : `waiting on ${input.waiting_on.map(w => w.role).join(", ") || "others"} — monitor and nudge`;
94
- const exposure = input.compensation_fund != null && input.compensation_fund !== "0"
95
- ? ` Compensation fund at risk: ${input.compensation_fund} raw units.`
96
- : "";
97
- const summary = `Merchant interest at node '${input.current_node || "(entry)"}': ${pos}.${exposure} ` +
98
- "All options above are informational — the decision is yours.";
99
- return { fund_flow, responsibility, leverage, stakes, summary };
100
- }
1
+ export function analyzeMerchantInterest(b){const c=[],d=[],e=[],f=[],g=b['token_type']?'\x20('+b['token_type']+')':'';if(b['terminal']==='completed')c['push']('Order\x20reached\x20a\x20completion\x20terminal:\x20escrowed\x20funds\x20are\x20released\x20through\x20the\x20Allocation\x20waterfall.\x20'+'Verify\x20your\x20expected\x20share\x20arrived\x20(query\x20the\x20Allocation/Treasury\x20objects).');else{if(b['terminal']==='refunded')c['push']('Order\x20reached\x20a\x20refund\x20terminal:\x20escrowed\x20funds\x20returned\x20to\x20the\x20buyer\x20per\x20the\x20Allocation\x20configuration.\x20'+'No\x20settlement\x20remains\x20for\x20this\x20order.');else{b['order_amount']!=null&&c['push'](b['order_amount']+'\x20raw\x20units'+g+'\x20sit\x20escrowed\x20in\x20the\x20Order\x20object\x20—\x20'+'released\x20ONLY\x20by\x20workflow\x20advancement\x20to\x20a\x20completion\x20path\x20(not\x20by\x20time,\x20not\x20by\x20platform\x20decision).');if(b['allocation']){const m=b['allocation'],n=['settlement\x20splits\x20across\x20'+m['recipient_slots']+'\x20recipient\x20slot(s)'];if(m['direct_to_me_slots']>0x0)n['push'](m['direct_to_me_slots']+'\x20pay\x20directly\x20to\x20you');if(m['guard_gated_slots']>0x0)n['push'](m['guard_gated_slots']+'\x20are\x20guard-resolved\x20at\x20settlement\x20time\x20(recipient\x20not\x20statically\x20known)');if(m['to_payer_slots']>0x0)n['push'](m['to_payer_slots']+'\x20route\x20back\x20to\x20the\x20payer\x20(refund-oriented)');c['push']('Allocation\x20waterfall:\x20'+n['join'](';\x20')+'.');}else c['push']('Allocation\x20waterfall\x20not\x20configured\x20or\x20unresolved\x20—\x20settlement\x20recipients\x20unknown;\x20'+'funds\x20may\x20sit\x20in\x20the\x20Order\x20until\x20an\x20allocation\x20is\x20set\x20or\x20refund\x20path\x20triggers.');}}b['compensation_fund']!=null&&b['compensation_fund']!=='0'&&c['push']('Service\x20compensation_fund\x20holds\x20'+b['compensation_fund']+'\x20raw\x20units'+g+'\x20—\x20merchant-funded\x20skin-in-the-game:\x20'+'arbitration\x20indemnity\x20is\x20paid\x20FROM\x20it,\x20but\x20it\x20also\x20converts\x20directly\x20into\x20buyer\x20trust\x20(higher\x20preorder\x20confidence).');const h=b['operable']['filter'](o=>o['guard']);b['operable']['length']>0x0&&d['push'](b['operable']['length']+'\x20forward(s)\x20are\x20executable\x20by\x20YOUR\x20role\x20right\x20now\x20'+('('+b['operable']['map'](o=>'\x27'+o['name']+'\x27')['join'](',\x20')+'):\x20inaction\x20keeps\x20settlement\x20locked\x20and\x20the\x20stall\x20is\x20publicly\x20visible\x20on-chain.'));h['length']>0x0&&d['push']('Forward(s)\x20'+h['map'](o=>'\x27'+o['name']+'\x27')['join'](',\x20')+'\x20are\x20guard-gated:\x20YOU\x20must\x20satisfy\x20the\x20guard\x20conditions\x20'+'(evidence,\x20verification,\x20timing)\x20before\x20execution\x20—\x20prepare\x20submissions\x20(proof/repository\x20data)\x20in\x20advance.');b['terminal']==null&&b['operable']['length']===0x0&&b['waiting_on']['length']>0x0&&d['push']('No\x20forward\x20is\x20yours\x20at\x20this\x20node\x20—\x20you\x20carry\x20no\x20execution\x20responsibility\x20here;\x20'+'avoid\x20interfering\x20outside\x20your\x20permission\x20scope\x20(creates\x20semantic\x20responsibility\x20without\x20authority).');b['operable']['length']>0x0&&b['terminal']==null&&e['push']('Advancing\x20NOW\x20shortens\x20your\x20fund-settlement\x20cycle\x20and\x20improves\x20your\x20publicly-visible\x20flow\x20statistics\x20'+'(future\x20buyers\x27\x20trust\x20evaluation\x20reads\x20stall/dispute\x20metrics).');const i=b['waiting_on']['some'](o=>o['role']['includes']('OrderHolder'));i&&b['terminal']==null&&e['push']('The\x20workflow\x20waits\x20on\x20the\x20customer\x20(OrderHolder):\x20a\x20Messenger\x20nudge\x20accelerates\x20fund\x20release\x20'+'without\x20creating\x20semantic\x20responsibility\x20—\x20and\x20the\x20conversation\x20is\x20recorded\x20as\x20WTS\x20evidence\x20protecting\x20YOU\x20in\x20a\x20dispute.');h['length']>0x0&&e['push']('Uploading\x20delivery\x20evidence\x20(Repository/proof)\x20BEFORE\x20executing\x20guard-gated\x20forwards\x20reduces\x20dispute\x20probability\x20'+'and\x20pre-builds\x20your\x20arbitration\x20defense.');(b['unread_messages']??0x0)>0x0&&e['push'](b['unread_messages']+'\x20unread\x20message(s)\x20from\x20this\x20order\x27s\x20counterparties\x20—\x20timely\x20replies\x20protect\x20your\x20position\x20(WTS\x20record).');b['rewards_count']>0x0&&e['push'](b['rewards_count']+'\x20reward(s)\x20configured\x20on\x20the\x20Service\x20—\x20honoring\x20them\x20(discounts/bonuses)\x20builds\x20repeat-buyer\x20rate\x20and\x20like/dislike\x20reputation.');if(b['arbitration_bound']&&b['terminal']==null){const o=b['compensation_fund']!=null&&b['compensation_fund']!=='0'?'indemnity\x20would\x20be\x20paid\x20from\x20the\x20compensation_fund\x20('+b['compensation_fund']+'\x20raw\x20units)':'the\x20compensation_fund\x20is\x20empty\x20(indemnity\x20unenforceable\x20—\x20but\x20the\x20arb-loss\x20record\x20still\x20lands)';f['push']('A\x20dispute\x20path\x20exists:\x20if\x20the\x20customer\x20opens\x20arbitration\x20and\x20you\x20lose,\x20'+o+',\x20'+'and\x20the\x20loss\x20is\x20permanently\x20recorded\x20(arb-loss\x20rate\x20is\x20a\x20public\x20metric\x20in\x20future\x20buyers\x27\x20trust\x20evaluation).');}b['stalled_hours']!=null&&b['stalled_hours']>0x48&&b['terminal']==null&&f['push']('Order\x20stalled\x20'+Math['round'](b['stalled_hours'])+'h:\x20prolonged\x20stalls\x20degrade\x20merchant\x20flow\x20statistics\x20'+'and\x20invite\x20dispute/dislike\x20—\x20the\x20two\x20cheapest\x20reputation\x20losses\x20to\x20avoid.');b['terminal']==='refunded'&&f['push']('Refund\x20executed:\x20settlement\x20lost.\x20Remaining\x20stakes\x20are\x20reputational\x20—\x20a\x20dislike\x20vote\x20is\x20the\x20customer\x27s\x20residual\x20leverage;\x20'+'a\x20professional\x20post-refund\x20Messenger\x20close-out\x20is\x20your\x20residual\x20protection.');const j=b['terminal']==='completed'?'order\x20completed\x20—\x20settlement\x20released':b['terminal']==='refunded'?'order\x20refunded\x20—\x20settlement\x20lost':b['operable']['length']>0x0?'YOU\x20can\x20advance\x20'+b['operable']['length']+'\x20forward(s)\x20—\x20settlement\x20speed\x20is\x20in\x20your\x20hands':'waiting\x20on\x20'+(b['waiting_on']['map'](p=>p['role'])['join'](',\x20')||'others')+'\x20—\x20monitor\x20and\x20nudge',k=b['compensation_fund']!=null&&b['compensation_fund']!=='0'?'\x20Compensation\x20fund\x20at\x20risk:\x20'+b['compensation_fund']+'\x20raw\x20units.':'',l='Merchant\x20interest\x20at\x20node\x20\x27'+(b['current_node']||'(entry)')+'\x27:\x20'+j+'.'+k+'\x20'+'All\x20options\x20above\x20are\x20informational\x20—\x20the\x20decision\x20is\x20yours.';return{'fund_flow':c,'responsibility':d,'leverage':e,'stakes':f,'summary':l};}
@@ -1,8 +1,14 @@
1
+ import type { CommercialRole } from "../role/types.js";
2
+ import type { CollaboratorInterestAnalysis } from "./collaborator-interest.js";
3
+ import type { CustomerInterestAnalysis } from "./customer-interest.js";
4
+ import type { MerchantInterestAnalysis } from "./merchant-interest.js";
5
+ import type { SupplierInterestAnalysis } from "./supplier-interest.js";
1
6
  import type { PermissionObjectData } from "../schema/utils/permission-machine-check.js";
2
7
  export interface RadarMachineNode {
3
8
  name: string;
4
9
  pairs?: Array<{
5
10
  prev_node: string;
11
+ threshold?: number;
6
12
  forwards?: Array<{
7
13
  name: string;
8
14
  permissionIndex?: number | null;
@@ -25,6 +31,8 @@ export interface OrderRadarInput {
25
31
  machine_nodes?: RadarMachineNode[];
26
32
  permission?: PermissionObjectData | null;
27
33
  named_accounts?: Record<string, string | string[]>;
34
+ service_builder?: string;
35
+ demand_presenters?: string[];
28
36
  node_annotations?: NodeAnnotations;
29
37
  claimable_rewards?: Array<{
30
38
  address: string;
@@ -41,7 +49,6 @@ export interface OrderRadarInput {
41
49
  now?: number;
42
50
  unread_messages?: number;
43
51
  }
44
- export type ParticipationPerspective = "customer" | "operator" | "observer";
45
52
  export type ExecutionPath = "order_holder" | "permission" | "named_operator" | "not_available";
46
53
  export interface RadarForward {
47
54
  name: string;
@@ -52,6 +59,7 @@ export interface RadarForward {
52
59
  guard?: string;
53
60
  semantics: string;
54
61
  consequence?: string;
62
+ weight?: number;
55
63
  }
56
64
  export interface PendingClaim {
57
65
  kind: "reward" | "discount" | "compensation" | "rating";
@@ -67,7 +75,8 @@ export interface OrderRadarResult {
67
75
  progress: string;
68
76
  order?: string;
69
77
  current_node: string;
70
- perspective: ParticipationPerspective;
78
+ perspective: CommercialRole;
79
+ collaborator_kind?: "permission_entity" | "named_operator";
71
80
  roles: RoleSummary[];
72
81
  operable: RadarForward[];
73
82
  branch_choice?: {
@@ -85,7 +94,8 @@ export interface OrderRadarResult {
85
94
  pending_claims: PendingClaim[];
86
95
  interest_hints: string[];
87
96
  workflow_unknown: boolean;
88
- interest_analysis?: import("./merchant-interest.js").MerchantInterestAnalysis;
97
+ threshold?: number;
98
+ interest_analysis?: MerchantInterestAnalysis | SupplierInterestAnalysis | CollaboratorInterestAnalysis | CustomerInterestAnalysis;
89
99
  summary: string;
90
100
  }
91
101
  export declare function analyzeOrderParticipation(input: OrderRadarInput): OrderRadarResult;