@wowok/agent-mcp 2.7.1 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.js +1 -1
- package/dist/config/runtime.js +1 -238
- package/dist/customer/account-events.d.ts +32 -0
- package/dist/customer/account-events.js +1 -0
- package/dist/customer/customer-advice.d.ts +1 -0
- package/dist/customer/customer-advice.js +1 -130
- package/dist/customer/index.js +1 -11
- package/dist/customer/industry-risks.js +1 -438
- package/dist/customer/info-puzzle.js +1 -681
- package/dist/customer/order-monitor.js +1 -328
- package/dist/customer/order-strategy.d.ts +1 -1
- package/dist/customer/order-strategy.js +1 -373
- package/dist/customer/post-purchase.js +1 -351
- package/dist/customer/preorder-compare.js +1 -34
- package/dist/customer/reminder-system.d.ts +2 -0
- package/dist/customer/reminder-system.js +1 -316
- package/dist/customer/risk-assessment.d.ts +1 -0
- package/dist/customer/risk-assessment.js +1 -397
- package/dist/customer/types.d.ts +2 -0
- package/dist/customer/types.js +1 -13
- package/dist/customer/user-preferences.js +1 -460
- package/dist/evaluation/arbitration-game.d.ts +9 -2
- package/dist/evaluation/arbitration-game.js +1 -48
- package/dist/evaluation/builtins/arbitration-score.d.ts +41 -0
- package/dist/evaluation/builtins/arbitration-score.js +1 -0
- package/dist/evaluation/builtins/demand-match.js +1 -153
- package/dist/evaluation/builtins/index.d.ts +1 -0
- package/dist/evaluation/builtins/index.js +1 -10
- package/dist/evaluation/builtins/service-risk.js +1 -55
- package/dist/evaluation/capability.js +1 -13
- package/dist/evaluation/category-match-rules.d.ts +30 -0
- package/dist/evaluation/category-match-rules.js +1 -0
- package/dist/evaluation/composer.js +1 -40
- package/dist/evaluation/engine.js +1 -175
- package/dist/evaluation/extract.js +1 -115
- package/dist/evaluation/game-strategy.d.ts +27 -0
- package/dist/evaluation/game-strategy.js +1 -0
- package/dist/evaluation/gap.js +1 -100
- package/dist/evaluation/index.d.ts +2 -0
- package/dist/evaluation/index.js +1 -11
- package/dist/evaluation/location-match.d.ts +42 -0
- package/dist/evaluation/location-match.js +1 -0
- package/dist/evaluation/node-game.d.ts +31 -3
- package/dist/evaluation/node-game.js +1 -57
- package/dist/evaluation/path-reasoning.d.ts +35 -0
- package/dist/evaluation/path-reasoning.js +1 -0
- package/dist/evaluation/region.d.ts +6 -0
- package/dist/evaluation/region.js +1 -36
- package/dist/evaluation/types.d.ts +18 -0
- package/dist/evaluation/types.js +1 -1
- package/dist/evaluation/user-injection.js +1 -27
- package/dist/experience/experience-reuse.js +1 -103
- package/dist/experience/index.js +1 -5
- package/dist/experience/intent-distill.js +1 -83
- package/dist/experience/realtime-feedback.js +1 -94
- package/dist/experience/types.js +1 -1
- package/dist/experience/user-profile.d.ts +1 -1
- package/dist/experience/user-profile.js +1 -171
- package/dist/extensions/business-modules.js +1 -287
- package/dist/extensions/capability-manifest.js +1 -781
- package/dist/extensions/constraint-registry.js +1 -198
- package/dist/extensions/index.d.ts +6 -0
- package/dist/extensions/index.js +1 -6
- package/dist/extensions/industry-layers.d.ts +75 -0
- package/dist/extensions/industry-layers.js +1 -0
- package/dist/extensions/industry-pack.d.ts +105 -0
- package/dist/extensions/industry-pack.js +1 -0
- package/dist/extensions/metric-registry.js +1 -257
- package/dist/extensions/mode-evaluator.d.ts +1 -1
- package/dist/extensions/mode-evaluator.js +1 -170
- package/dist/extensions/modes.js +1 -499
- package/dist/extensions/registry.d.ts +1 -0
- package/dist/extensions/registry.js +1 -717
- package/dist/extensions/types.js +1 -1
- package/dist/graph/base.d.ts +8 -0
- package/dist/graph/base.js +1 -0
- package/dist/harness/auto-escalation.js +1 -68
- package/dist/harness/checkpoint.js +1 -129
- package/dist/harness/index.d.ts +1 -0
- package/dist/harness/index.js +1 -78
- package/dist/harness/plan.d.ts +2 -0
- package/dist/harness/plan.js +1 -315
- package/dist/harness/recover.d.ts +1 -1
- package/dist/harness/recover.js +1 -139
- package/dist/harness/types.d.ts +2 -3
- package/dist/harness/types.js +1 -1
- package/dist/harness/verify.js +1 -237
- package/dist/index.js +1 -273
- package/dist/intent/enrich.js +1 -67
- package/dist/intent/index.js +1 -60
- package/dist/intent/matcher.js +1 -81
- package/dist/intent/store.js +1 -55
- package/dist/intent/types.js +1 -10
- package/dist/knowledge/acquisition-flywheel.js +1 -192
- package/dist/knowledge/allocation-confirm.js +1 -534
- package/dist/knowledge/allocation-context.js +1 -249
- package/dist/knowledge/allocation-ledger.js +1 -463
- package/dist/knowledge/allocation-puzzle.js +1 -298
- package/dist/knowledge/allocation-risk.js +1 -568
- package/dist/knowledge/allocation-templates.js +1 -970
- package/dist/knowledge/allocation-translation.js +1 -585
- package/dist/knowledge/anti-cheat.d.ts +37 -0
- package/dist/knowledge/anti-cheat.js +1 -0
- package/dist/knowledge/arb-confirm.d.ts +28 -0
- package/dist/knowledge/arb-confirm.js +1 -0
- package/dist/knowledge/arb-risk.js +1 -210
- package/dist/knowledge/arb-translation.d.ts +48 -0
- package/dist/knowledge/arb-translation.js +1 -0
- package/dist/knowledge/arbitration-confirm.js +1 -559
- package/dist/knowledge/arbitration-context.js +1 -505
- package/dist/knowledge/arbitration-ledger.js +1 -521
- package/dist/knowledge/arbitration-puzzle.js +1 -304
- package/dist/knowledge/arbitration-risk.js +1 -423
- package/dist/knowledge/arbitration-templates.js +1 -276
- package/dist/knowledge/arbitration-translation.js +1 -487
- package/dist/knowledge/audit-rules.js +1 -141
- package/dist/knowledge/bridge-confirm.d.ts +26 -0
- package/dist/knowledge/bridge-confirm.js +1 -0
- package/dist/knowledge/bridge-risk.js +1 -263
- package/dist/knowledge/bridge-translation.d.ts +37 -0
- package/dist/knowledge/bridge-translation.js +1 -0
- package/dist/knowledge/contact-confirm.d.ts +27 -0
- package/dist/knowledge/contact-confirm.js +1 -0
- package/dist/knowledge/contact-risk.js +1 -200
- package/dist/knowledge/contact-templates.js +1 -60
- package/dist/knowledge/contact-translation.d.ts +39 -0
- package/dist/knowledge/contact-translation.js +1 -0
- package/dist/knowledge/demand-confirm.js +1 -206
- package/dist/knowledge/demand-context.d.ts +17 -0
- package/dist/knowledge/demand-context.js +1 -0
- package/dist/knowledge/demand-ledger.d.ts +26 -0
- package/dist/knowledge/demand-ledger.js +1 -0
- package/dist/knowledge/demand-matching.js +1 -132
- package/dist/knowledge/demand-puzzle.d.ts +29 -0
- package/dist/knowledge/demand-puzzle.js +1 -0
- package/dist/knowledge/demand-risk.js +1 -240
- package/dist/knowledge/demand-templates.d.ts +12 -0
- package/dist/knowledge/demand-templates.js +1 -0
- package/dist/knowledge/demand-translation.js +1 -354
- package/dist/knowledge/deployment-scanner.js +1 -823
- package/dist/knowledge/dynamic-pricing.js +1 -87
- package/dist/knowledge/evidence-review.d.ts +12 -0
- package/dist/knowledge/evidence-review.js +1 -0
- package/dist/knowledge/examples-scanner-cli.js +1 -26
- package/dist/knowledge/examples-scanner.js +1 -843
- package/dist/knowledge/flywheel-loop.d.ts +0 -1
- package/dist/knowledge/flywheel-loop.js +1 -404
- package/dist/knowledge/fund-layer.js +1 -973
- package/dist/knowledge/glossary.js +1 -211
- package/dist/knowledge/guard-confirm.js +1 -406
- package/dist/knowledge/guard-context.js +1 -287
- package/dist/knowledge/guard-design-patterns.js +1 -360
- package/dist/knowledge/guard-ledger.js +1 -260
- package/dist/knowledge/guard-lint.js +1 -670
- package/dist/knowledge/guard-migration.d.ts +1 -1
- package/dist/knowledge/guard-migration.js +1 -228
- package/dist/knowledge/guard-puzzle.js +1 -805
- package/dist/knowledge/guard-render.js +1 -700
- package/dist/knowledge/guard-risk.js +1 -1879
- package/dist/knowledge/guard-submission-prompt.js +1 -171
- package/dist/knowledge/guard-templates.js +1 -1105
- package/dist/knowledge/guard-translation.js +1 -1119
- package/dist/knowledge/index.d.ts +71 -3
- package/dist/knowledge/index.js +1 -436
- package/dist/knowledge/industry-evolution.js +1 -323
- package/dist/knowledge/industry-generalizer.js +1 -381
- package/dist/knowledge/industry-registry.js +1 -174
- package/dist/knowledge/intent-metrics.d.ts +4 -3
- package/dist/knowledge/intent-metrics.js +1 -566
- package/dist/knowledge/machine-confirm.js +1 -559
- package/dist/knowledge/machine-context.js +1 -833
- package/dist/knowledge/machine-ledger.js +1 -338
- package/dist/knowledge/machine-puzzle.js +1 -494
- package/dist/knowledge/machine-render.js +1 -565
- package/dist/knowledge/machine-risk.js +1 -669
- package/dist/knowledge/machine-templates.js +1 -1597
- package/dist/knowledge/machine-topology.js +1 -234
- package/dist/knowledge/machine-translation.js +1 -513
- package/dist/knowledge/market-metrics.d.ts +12 -0
- package/dist/knowledge/market-metrics.js +1 -0
- package/dist/knowledge/market-operations.d.ts +46 -0
- package/dist/knowledge/market-operations.js +1 -0
- package/dist/knowledge/mcp-schema-audit-cli.js +1 -45
- package/dist/knowledge/mcp-schema-audit.d.ts +22 -22
- package/dist/knowledge/mcp-schema-audit.js +1 -777
- package/dist/knowledge/onchain-constants.js +1 -35
- package/dist/knowledge/order-confirm.js +1 -573
- package/dist/knowledge/order-context.js +1 -390
- package/dist/knowledge/order-ledger.js +1 -341
- package/dist/knowledge/order-puzzle.js +1 -255
- package/dist/knowledge/order-risk.js +1 -653
- package/dist/knowledge/order-templates.js +1 -368
- package/dist/knowledge/order-translation.js +1 -550
- package/dist/knowledge/overrides-loader.js +1 -65
- package/dist/knowledge/passport-confirm.js +1 -531
- package/dist/knowledge/passport-context.js +1 -306
- package/dist/knowledge/passport-ledger.js +1 -282
- package/dist/knowledge/passport-puzzle.js +1 -333
- package/dist/knowledge/passport-risk.js +1 -450
- package/dist/knowledge/passport-templates.js +1 -568
- package/dist/knowledge/passport-translation.js +1 -516
- package/dist/knowledge/payment-confirm.d.ts +26 -0
- package/dist/knowledge/payment-confirm.js +1 -0
- package/dist/knowledge/payment-risk.js +1 -249
- package/dist/knowledge/payment-translation.d.ts +37 -0
- package/dist/knowledge/payment-translation.js +1 -0
- package/dist/knowledge/permission-confirm.js +1 -426
- package/dist/knowledge/permission-context.js +1 -224
- package/dist/knowledge/permission-ledger.d.ts +11 -0
- package/dist/knowledge/permission-ledger.js +1 -403
- package/dist/knowledge/permission-puzzle.js +1 -173
- package/dist/knowledge/permission-risk.js +1 -411
- package/dist/knowledge/permission-templates.js +1 -234
- package/dist/knowledge/permission-translation.js +1 -350
- package/dist/knowledge/personal-confirm.d.ts +29 -0
- package/dist/knowledge/personal-confirm.js +1 -0
- package/dist/knowledge/personal-risk.js +1 -212
- package/dist/knowledge/personal-translation.d.ts +37 -0
- package/dist/knowledge/personal-translation.js +1 -0
- package/dist/knowledge/process-model.d.ts +1 -11
- package/dist/knowledge/process-model.js +1 -160
- package/dist/knowledge/progress-confirm.js +1 -456
- package/dist/knowledge/progress-context.js +1 -452
- package/dist/knowledge/progress-ledger.js +1 -330
- package/dist/knowledge/progress-puzzle.js +1 -219
- package/dist/knowledge/progress-risk.js +1 -461
- package/dist/knowledge/progress-templates.js +1 -228
- package/dist/knowledge/progress-translation.js +1 -405
- package/dist/knowledge/proof-confirm.js +1 -187
- package/dist/knowledge/proof-context.d.ts +17 -0
- package/dist/knowledge/proof-context.js +1 -0
- package/dist/knowledge/proof-ledger.d.ts +34 -0
- package/dist/knowledge/proof-ledger.js +1 -0
- package/dist/knowledge/proof-puzzle.d.ts +35 -0
- package/dist/knowledge/proof-puzzle.js +1 -0
- package/dist/knowledge/proof-risk.js +1 -207
- package/dist/knowledge/proof-templates.d.ts +22 -0
- package/dist/knowledge/proof-templates.js +1 -0
- package/dist/knowledge/proof-translation.js +1 -283
- package/dist/knowledge/registrar-confirm.d.ts +26 -0
- package/dist/knowledge/registrar-confirm.js +1 -0
- package/dist/knowledge/registrar-risk.js +1 -217
- package/dist/knowledge/registrar-translation.d.ts +37 -0
- package/dist/knowledge/registrar-translation.js +1 -0
- package/dist/knowledge/repository-confirm.js +1 -286
- package/dist/knowledge/repository-context.d.ts +12 -0
- package/dist/knowledge/repository-context.js +1 -0
- package/dist/knowledge/repository-ledger.d.ts +25 -0
- package/dist/knowledge/repository-ledger.js +1 -0
- package/dist/knowledge/repository-puzzle.d.ts +30 -0
- package/dist/knowledge/repository-puzzle.js +1 -0
- package/dist/knowledge/repository-risk.js +1 -373
- package/dist/knowledge/repository-templates.d.ts +14 -0
- package/dist/knowledge/repository-templates.js +1 -0
- package/dist/knowledge/repository-translation.js +1 -445
- package/dist/knowledge/reputation-rules.js +1 -99
- package/dist/knowledge/resource-confirm.d.ts +25 -0
- package/dist/knowledge/resource-confirm.js +1 -0
- package/dist/knowledge/resource-risk.js +1 -157
- package/dist/knowledge/resource-translation.d.ts +37 -0
- package/dist/knowledge/resource-translation.js +1 -0
- package/dist/knowledge/reward-confirm.js +1 -526
- package/dist/knowledge/reward-context.d.ts +2 -2
- package/dist/knowledge/reward-context.js +1 -504
- package/dist/knowledge/reward-ledger.js +1 -502
- package/dist/knowledge/reward-puzzle.js +1 -300
- package/dist/knowledge/reward-risk.js +1 -627
- package/dist/knowledge/reward-templates.js +1 -197
- package/dist/knowledge/reward-translation.js +1 -501
- package/dist/knowledge/safety-rules.d.ts +1 -0
- package/dist/knowledge/safety-rules.js +1 -404
- package/dist/knowledge/scenario-modes.js +1 -321
- package/dist/knowledge/service-confirm.js +1 -807
- package/dist/knowledge/service-context.js +1 -403
- package/dist/knowledge/service-ledger.js +1 -609
- package/dist/knowledge/service-puzzle.js +1 -236
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +1 -651
- package/dist/knowledge/service-templates.js +1 -456
- package/dist/knowledge/service-translation.js +1 -622
- package/dist/knowledge/template-registry.js +1 -353
- package/dist/knowledge/tool-constraints.js +1 -195
- package/dist/knowledge/tools-reference.js +1 -178
- package/dist/knowledge/treasury-confirm.js +1 -512
- package/dist/knowledge/treasury-context.js +1 -363
- package/dist/knowledge/treasury-ledger.js +1 -300
- package/dist/knowledge/treasury-puzzle.js +1 -216
- package/dist/knowledge/treasury-risk.js +1 -440
- package/dist/knowledge/treasury-templates.js +1 -358
- package/dist/knowledge/treasury-translation.js +1 -498
- package/dist/knowledge/trust-metrics.js +1 -198
- package/dist/knowledge/universal-template.d.ts +22 -0
- package/dist/knowledge/universal-template.js +1 -0
- package/dist/knowledge/util-confirm.d.ts +24 -0
- package/dist/knowledge/util-confirm.js +1 -0
- package/dist/knowledge/util-risk.js +1 -135
- package/dist/knowledge/util-translation.d.ts +38 -0
- package/dist/knowledge/util-translation.js +1 -0
- package/dist/knowledge/workflow-guidance.d.ts +116 -0
- package/dist/knowledge/workflow-guidance.js +1 -0
- package/dist/loop-engineering/aggregate.js +1 -132
- package/dist/loop-engineering/context-collect.js +1 -83
- package/dist/loop-engineering/diagnose.js +1 -273
- package/dist/loop-engineering/improve.js +1 -405
- package/dist/loop-engineering/index.js +1 -4
- package/dist/loop-engineering/pipeline.js +1 -56
- package/dist/mode-market/index.js +1 -3
- package/dist/mode-market/registry.js +1 -124
- package/dist/mode-market/review.js +1 -214
- package/dist/mode-market/submission.js +1 -85
- package/dist/participation/collaborator-interest.d.ts +23 -0
- package/dist/participation/collaborator-interest.js +1 -0
- package/dist/participation/customer-interest.d.ts +25 -0
- package/dist/participation/customer-interest.js +1 -0
- package/dist/participation/employee-kpi.d.ts +25 -0
- package/dist/participation/employee-kpi.js +1 -0
- package/dist/participation/employee-store.d.ts +16 -0
- package/dist/participation/employee-store.js +1 -0
- package/dist/participation/index.d.ts +2 -0
- package/dist/participation/index.js +1 -0
- package/dist/participation/merchant-interest.js +1 -100
- package/dist/participation/radar-core.d.ts +13 -3
- package/dist/participation/radar-core.js +1 -269
- package/dist/participation/supplier-interest.d.ts +25 -0
- package/dist/participation/supplier-interest.js +1 -0
- package/dist/persona/analyzer.js +1 -66
- package/dist/persona/bridge.js +1 -86
- package/dist/persona/defaults.js +1 -195
- package/dist/persona/experience-bridge.js +1 -23
- package/dist/persona/index.d.ts +9 -2
- package/dist/persona/index.js +1 -71
- package/dist/persona/local-region.d.ts +20 -0
- package/dist/persona/local-region.js +1 -0
- package/dist/persona/model.js +1 -111
- package/dist/persona/overrides.d.ts +10 -0
- package/dist/persona/overrides.js +1 -0
- package/dist/persona/pack-personae.d.ts +11 -0
- package/dist/persona/pack-personae.js +1 -0
- package/dist/persona/store.js +1 -62
- package/dist/persona/strategy-intent.d.ts +20 -0
- package/dist/persona/strategy-intent.js +1 -0
- package/dist/persona/types.d.ts +6 -2
- package/dist/persona/types.js +1 -5
- package/dist/project/business-puzzle.d.ts +1 -1
- package/dist/project/business-puzzle.js +1 -383
- package/dist/project/context-assembly.js +1 -254
- package/dist/project/deployment-bridge.js +1 -120
- package/dist/project/deployment-doc.js +1 -1126
- package/dist/project/edit-planner.js +1 -1342
- package/dist/project/evaluation.d.ts +37 -1
- package/dist/project/evaluation.js +1 -2011
- package/dist/project/game-theory.js +1 -177
- package/dist/project/graph-builder.js +1 -656
- package/dist/project/graph.d.ts +3 -6
- package/dist/project/graph.js +1 -340
- package/dist/project/handlers.d.ts +33 -2
- package/dist/project/handlers.js +1 -1784
- package/dist/project/index.d.ts +2 -0
- package/dist/project/index.js +1 -301
- package/dist/project/intent-analyzer.js +1 -149
- package/dist/project/machine-nodes.js +1 -36
- package/dist/project/merchant-guide.d.ts +19 -0
- package/dist/project/merchant-guide.js +1 -264
- package/dist/project/migration.js +1 -125
- package/dist/project/mode-actions.js +1 -309
- package/dist/project/namespace.js +1 -206
- package/dist/project/participation-radar.js +1 -428
- package/dist/project/pipeline-actions.js +1 -109
- package/dist/project/project-store.js +1 -422
- package/dist/project/query.js +1 -153
- package/dist/project/reverse-mapping.d.ts +34 -0
- package/dist/project/reverse-mapping.js +1 -0
- package/dist/project/risk-aggregator.js +1 -295
- package/dist/project/rollback-policy.js +1 -290
- package/dist/project/semantic-assembler.js +1 -345
- package/dist/project/semantic-graph.d.ts +3 -5
- package/dist/project/semantic-graph.js +1 -292
- package/dist/project/stage-gate.js +1 -369
- package/dist/project/substep-trace.js +1 -332
- package/dist/project/task-tracker.js +1 -78
- package/dist/project/workflow-design-assessment.d.ts +24 -0
- package/dist/project/workflow-design-assessment.js +1 -0
- package/dist/role/derivation.d.ts +18 -0
- package/dist/role/derivation.js +1 -0
- package/dist/role/index.d.ts +5 -0
- package/dist/role/index.js +1 -0
- package/dist/role/model.d.ts +8 -0
- package/dist/role/model.js +1 -0
- package/dist/role/resolution.d.ts +11 -0
- package/dist/role/resolution.js +1 -0
- package/dist/role/types.d.ts +11 -0
- package/dist/role/types.js +1 -0
- package/dist/rules.js +1 -52
- package/dist/safety/confirm-gate.d.ts +1 -1
- package/dist/safety/confirm-gate.js +1 -88
- package/dist/safety/index.js +1 -3
- package/dist/safety/preview.js +1 -52
- package/dist/schema/call/allocation.d.ts +186 -1385
- package/dist/schema/call/allocation.js +1 -34
- package/dist/schema/call/arbitration.d.ts +272 -1871
- package/dist/schema/call/arbitration.js +1 -113
- package/dist/schema/call/base.d.ts +1831 -9076
- package/dist/schema/call/base.js +1 -370
- package/dist/schema/call/bridge.d.ts +911 -3171
- package/dist/schema/call/bridge.js +1 -458
- package/dist/schema/call/contact.d.ts +135 -931
- package/dist/schema/call/contact.js +1 -37
- package/dist/schema/call/demand.d.ts +164 -1194
- package/dist/schema/call/demand.js +1 -47
- package/dist/schema/call/guard.d.ts +298 -1140
- package/dist/schema/call/guard.js +1 -161
- package/dist/schema/call/handler.js +1 -322
- package/dist/schema/call/index.js +1 -20
- package/dist/schema/call/machine.d.ts +459 -5403
- package/dist/schema/call/machine.js +1 -193
- package/dist/schema/call/order.d.ts +137 -844
- package/dist/schema/call/order.js +1 -35
- package/dist/schema/call/payment.d.ts +74 -561
- package/dist/schema/call/payment.js +1 -37
- package/dist/schema/call/permission-handler.js +1 -54
- package/dist/schema/call/permission.d.ts +335 -2791
- package/dist/schema/call/permission.js +1 -105
- package/dist/schema/call/personal.d.ts +227 -1814
- package/dist/schema/call/personal.js +1 -78
- package/dist/schema/call/progress.d.ts +140 -843
- package/dist/schema/call/progress.js +1 -47
- package/dist/schema/call/proof.d.ts +42 -258
- package/dist/schema/call/proof.js +1 -33
- package/dist/schema/call/repository.d.ts +324 -2222
- package/dist/schema/call/repository.js +1 -77
- package/dist/schema/call/reward.d.ts +153 -1183
- package/dist/schema/call/reward.js +1 -30
- package/dist/schema/call/semantic.js +1 -1679
- package/dist/schema/call/service.d.ts +376 -3431
- package/dist/schema/call/service.js +1 -184
- package/dist/schema/call/treasury.d.ts +252 -2158
- package/dist/schema/call/treasury.js +1 -71
- package/dist/schema/common/index.d.ts +222 -697
- package/dist/schema/common/index.js +1 -407
- package/dist/schema/config/index.d.ts +18 -161
- package/dist/schema/config/index.js +1 -68
- package/dist/schema/employee/index.d.ts +99 -0
- package/dist/schema/employee/index.js +1 -0
- package/dist/schema/evaluation/index.d.ts +1062 -3748
- package/dist/schema/evaluation/index.js +1 -356
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.js +1 -17
- package/dist/schema/industry-pack/index.d.ts +132 -0
- package/dist/schema/industry-pack/index.js +1 -0
- package/dist/schema/intent-radar/index.d.ts +92 -245
- package/dist/schema/intent-radar/index.js +1 -89
- package/dist/schema/local/index.d.ts +2045 -18080
- package/dist/schema/local/index.js +1 -927
- package/dist/schema/local/wip.d.ts +61 -651
- package/dist/schema/local/wip.js +1 -187
- package/dist/schema/messenger/index.d.ts +949 -5557
- package/dist/schema/messenger/index.js +1 -475
- package/dist/schema/operations.d.ts +2969 -26518
- package/dist/schema/operations.js +1 -520
- package/dist/schema/persona/index.d.ts +469 -1820
- package/dist/schema/persona/index.js +1 -148
- package/dist/schema/project/index.d.ts +1027 -8408
- package/dist/schema/project/index.js +1 -2057
- package/dist/schema/query/index.d.ts +12041 -75261
- package/dist/schema/query/index.js +1 -1646
- package/dist/schema/schema-query/index.d.ts +35 -98
- package/dist/schema/schema-query/index.js +1 -104
- package/dist/schema/schema-version.js +1 -76
- package/dist/schema/task-status.d.ts +26 -132
- package/dist/schema/task-status.js +1 -36
- package/dist/schema/trust/index.d.ts +194 -1290
- package/dist/schema/trust/index.js +1 -314
- package/dist/schema/utils/guard-parser.js +1 -419
- package/dist/schema/utils/guard-query-utils.js +1 -46
- package/dist/schema/utils/node-parser.js +1 -369
- package/dist/schema/utils/object-type-utils.js +1 -35
- package/dist/schema/utils/permission-index-utils.js +1 -7
- package/dist/schema/utils/permission-machine-check.js +1 -121
- package/dist/schema/utils/skills-recommendation.d.ts +1 -0
- package/dist/schema/utils/skills-recommendation.js +1 -77
- package/dist/schema/workspace/index.d.ts +69 -0
- package/dist/schema/workspace/index.js +1 -0
- package/dist/schema-query-impl/index.js +1 -0
- package/dist/schemas/account_operation.output.json +3147 -1652
- package/dist/schemas/account_operation.schema.json +225 -218
- package/dist/schemas/bridge_operation.output.json +1168 -650
- package/dist/schemas/bridge_operation.schema.json +736 -504
- package/dist/schemas/config_operation.output.json +185 -179
- package/dist/schemas/config_operation.schema.json +21 -26
- package/dist/schemas/employee_operation.output.json +207 -0
- package/dist/schemas/employee_operation.schema.json +176 -0
- package/dist/schemas/evaluation_operation.output.json +2329 -557
- package/dist/schemas/evaluation_operation.schema.json +2939 -720
- package/dist/schemas/guard2file.output.json +58 -64
- package/dist/schemas/guard2file.schema.json +79 -81
- package/dist/schemas/index.json +29 -11
- package/dist/schemas/industry_pack_operation.output.json +594 -0
- package/dist/schemas/industry_pack_operation.schema.json +55 -0
- package/dist/schemas/intent_radar.output.json +275 -200
- package/dist/schemas/intent_radar.schema.json +124 -123
- package/dist/schemas/local_info_operation.output.json +1174 -657
- package/dist/schemas/local_info_operation.schema.json +119 -125
- package/dist/schemas/local_mark_operation.output.json +1239 -689
- package/dist/schemas/local_mark_operation.schema.json +91 -96
- package/dist/schemas/machineNode2file.output.json +63 -69
- package/dist/schemas/machineNode2file.schema.json +79 -81
- package/dist/schemas/messenger_operation.output.json +2722 -1528
- package/dist/schemas/messenger_operation.schema.json +1482 -1264
- package/dist/schemas/onchain_events.output.json +2590 -975
- package/dist/schemas/onchain_events.schema.json +117 -99
- package/dist/schemas/onchain_operations.output.json +3957 -2309
- package/dist/schemas/onchain_operations.schema.json +20799 -9285
- package/dist/schemas/onchain_operations_allocation.schema.json +172 -108
- package/dist/schemas/onchain_operations_arbitration.schema.json +233 -146
- package/dist/schemas/onchain_operations_contact.schema.json +129 -90
- package/dist/schemas/onchain_operations_demand.schema.json +170 -112
- package/dist/schemas/onchain_operations_gen_passport.schema.json +61 -646
- package/dist/schemas/onchain_operations_gen_proof.schema.json +40 -172
- package/dist/schemas/onchain_operations_guard.schema.json +3765 -294
- package/dist/schemas/onchain_operations_machine.schema.json +537 -164
- package/dist/schemas/onchain_operations_order.schema.json +126 -96
- package/dist/schemas/onchain_operations_payment.schema.json +82 -67
- package/dist/schemas/onchain_operations_permission.schema.json +331 -93
- package/dist/schemas/onchain_operations_personal.schema.json +636 -96
- package/dist/schemas/onchain_operations_progress.schema.json +125 -92
- package/dist/schemas/onchain_operations_proof.schema.json +76 -69
- package/dist/schemas/onchain_operations_repository.schema.json +636 -249
- package/dist/schemas/onchain_operations_reward.schema.json +218 -108
- package/dist/schemas/onchain_operations_service.schema.json +679 -221
- package/dist/schemas/onchain_operations_treasury.schema.json +401 -135
- package/dist/schemas/onchain_table_data.output.json +6018 -2430
- package/dist/schemas/onchain_table_data.schema.json +544 -430
- package/dist/schemas/persona_operation.output.json +1568 -265
- package/dist/schemas/persona_operation.schema.json +346 -202
- package/dist/schemas/project_operation.output.json +6957 -5147
- package/dist/schemas/project_operation.schema.json +1050 -1020
- package/dist/schemas/query_task_status.output.json +195 -99
- package/dist/schemas/query_task_status.schema.json +12 -18
- package/dist/schemas/query_toolkit.output.json +18870 -14566
- package/dist/schemas/query_toolkit.schema.json +614 -522
- package/dist/schemas/schema_query.output.json +127 -129
- package/dist/schemas/schema_query.schema.json +64 -69
- package/dist/schemas/trust_score.output.json +678 -587
- package/dist/schemas/trust_score.schema.json +289 -277
- package/dist/schemas/wip_file.output.json +116 -124
- package/dist/schemas/wip_file.schema.json +142 -143
- package/dist/schemas/workspace_operation.output.json +277 -0
- package/dist/schemas/workspace_operation.schema.json +45 -0
- package/dist/schemas/wowok_buildin_info.output.json +1693 -723
- package/dist/schemas/wowok_buildin_info.schema.json +576 -512
- package/dist/telemetry/index.js +1 -112
- package/dist/telemetry/redact.js +1 -23
- package/dist/telemetry/storage.js +1 -80
- package/dist/tools/handlers/bridge.d.ts +8 -1
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -74
- package/dist/tools/handlers/employee.d.ts +2 -0
- package/dist/tools/handlers/employee.js +1 -0
- package/dist/tools/handlers/evaluation.js +1 -123
- package/dist/tools/handlers/file-export.js +1 -90
- package/dist/tools/handlers/industry-pack.d.ts +2 -0
- package/dist/tools/handlers/industry-pack.js +1 -0
- package/dist/tools/handlers/intent-radar.js +1 -76
- package/dist/tools/handlers/local.js +1 -53
- package/dist/tools/handlers/messenger.js +1 -188
- package/dist/tools/handlers/onchain.js +1 -1180
- package/dist/tools/handlers/persona.js +1 -89
- package/dist/tools/handlers/project.js +1 -211
- package/dist/tools/handlers/query.js +1 -434
- package/dist/tools/handlers/schema-query.js +1 -176
- package/dist/tools/handlers/task-status.js +1 -26
- package/dist/tools/handlers/trust.js +1 -380
- package/dist/tools/handlers/wip.js +1 -90
- package/dist/tools/handlers/workspace.d.ts +2 -0
- package/dist/tools/handlers/workspace.js +1 -0
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.js +1 -1382
- package/dist/tools/retry.js +1 -85
- package/dist/tools/rules-hook.d.ts +1 -1
- package/dist/tools/rules-hook.js +1 -23
- package/dist/tools/shared.d.ts +1 -1
- package/dist/tools/shared.js +1 -130
- package/dist/tools/types.d.ts +2 -1
- package/dist/tools/types.js +1 -1
- package/dist/tools/upgrade-check.d.ts +19 -0
- package/dist/tools/upgrade-check.js +1 -0
- package/dist/tools/wip-deploy-assist.js +1 -306
- package/dist/tools/wrap.js +1 -500
- package/package.json +7 -6
- package/dist/knowledge/arbitration-trust.d.ts +0 -24
- package/dist/knowledge/arbitration-trust.js +0 -117
- package/dist/schema/call/bridge-handler.d.ts +0 -8
- package/dist/schema/call/bridge-handler.js +0 -265
- package/dist/schema/sync-layer4.d.ts +0 -21
- package/dist/schema/sync-layer4.js +0 -286
- package/dist/schema-query/index.js +0 -810
- /package/dist/{schema-query → schema-query-impl}/index.d.ts +0 -0
|
@@ -1,609 +1 @@
|
|
|
1
|
-
export const SERVICE_PERMISSIONS = [
|
|
2
|
-
{ index: 300, name: "SERVICE_NEW", description: "Create new Service", governed_operation: "service::new", post_publish_mutability: "na" },
|
|
3
|
-
{ index: 301, name: "SERVICE_DESCRIPTION", description: "Modify Service description", governed_operation: "service::description_set", post_publish_mutability: "mutable" },
|
|
4
|
-
{ index: 303, name: "SERVICE_LOCATION", description: "Set Service location/URL", governed_operation: "service::location_set", post_publish_mutability: "mutable" },
|
|
5
|
-
{ index: 304, name: "SERVICE_REPOSITORY", description: "Add/remove Repository references", governed_operation: "service::repository_add/remove/clear", post_publish_mutability: "mutable" },
|
|
6
|
-
{ index: 305, name: "SERVICE_SALES", description: "Add/set/remove/clear sales items", governed_operation: "service::sales_add/set/remove/clear", post_publish_mutability: "mutable" },
|
|
7
|
-
{ index: 306, name: "SERVICE_MACHINE", description: "Bind/unbind Machine workflow template", governed_operation: "service::machine_set/machine_none", post_publish_mutability: "immutable" },
|
|
8
|
-
{ index: 307, name: "SERVICE_BUY_GUARD", description: "Set/clear buy Guard (post-publish mutable)", governed_operation: "service::buy_guard_set/buy_guard_none", post_publish_mutability: "mutable" },
|
|
9
|
-
{ index: 308, name: "SERVICE_ARBITRATION", description: "Add/remove Arbitration references", governed_operation: "service::arbitration_add/remove/clear", post_publish_mutability: "immutable" },
|
|
10
|
-
{ index: 309, name: "SERVICE_CUSTOMER_INFO_REQUIRED", description: "Set customer required info fields", governed_operation: "service::customer_required_set", post_publish_mutability: "mutable" },
|
|
11
|
-
{ index: 310, name: "SERVICE_PAUSE", description: "Pause/resume Service (block new orders)", governed_operation: "service::pause", post_publish_mutability: "mutable" },
|
|
12
|
-
{ index: 311, name: "SERVICE_PUBLISH", description: "Publish Service (IRREVERSIBLE)", governed_operation: "service::publish", post_publish_mutability: "one_shot" },
|
|
13
|
-
{ index: 312, name: "SERVICE_DISCOUNT", description: "Issue/discount_destroy discount coupons", governed_operation: "service::discount", post_publish_mutability: "mutable" },
|
|
14
|
-
{ index: 313, name: "SERVICE_ORDER_ALLOCATOR", description: "Set order allocator strategy", governed_operation: "service::order_allocators_set", post_publish_mutability: "immutable" },
|
|
15
|
-
{ index: 314, name: "SERVICE_COMPENSATION_FUND_WITHDRAW", description: "Withdraw compensation fund (lock_duration)", governed_operation: "service::compensation_fund_withdraw", post_publish_mutability: "locked_by_duration" },
|
|
16
|
-
{ index: 315, name: "SERVICE_COMPENSATION_FUND_DEPOSIT", description: "Deposit to compensation fund", governed_operation: "service::compensation_fund_add", post_publish_mutability: "mutable" },
|
|
17
|
-
{ index: 316, name: "SERVICE_COMPENSATION_FUND_RECEIVE", description: "Receive compensation fund (lock_duration)", governed_operation: "service::compensation_fund_receive", post_publish_mutability: "locked_by_duration" },
|
|
18
|
-
{ index: 317, name: "SERVICE_COMPENSATION_LOCK_DURATION_ADD", description: "Extend setting_lock_duration (only-increase)", governed_operation: "service::setting_lock_duration_add", post_publish_mutability: "mutable" },
|
|
19
|
-
{ index: 318, name: "SERVICE_REWARD", description: "Add/remove Reward references (locked)", governed_operation: "service::reward_add/remove/clear", post_publish_mutability: "locked_by_duration" },
|
|
20
|
-
{ index: 319, name: "SERVICE_OWNER_RECEIVE", description: "Receive Payment/objects to owner", governed_operation: "service::owner_receive", post_publish_mutability: "mutable" },
|
|
21
|
-
{ index: 320, name: "SERVICE_UM", description: "Bind/unbind Contact as UM", governed_operation: "service::um_set/um_none", post_publish_mutability: "mutable" },
|
|
22
|
-
];
|
|
23
|
-
export const SERVICE_ORDER_FLOW_STAGES = [
|
|
24
|
-
{
|
|
25
|
-
stage: 1,
|
|
26
|
-
name: "pre_check",
|
|
27
|
-
preconditions: [
|
|
28
|
-
"Service.bPublished == true (else E_SERVICE_NOT_PUBLISHED)",
|
|
29
|
-
"Service.bPaused == false (else E_SERVICE_PAUSED)",
|
|
30
|
-
"buy_guard (if set) added to guards[] list for verification",
|
|
31
|
-
],
|
|
32
|
-
side_effects: [],
|
|
33
|
-
always_executed: true,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
stage: 2,
|
|
37
|
-
name: "wip_verify",
|
|
38
|
-
preconditions: [
|
|
39
|
-
"buy.items non-empty",
|
|
40
|
-
"Each item.name matches a sale in Service.sales (else E_SALE_NOT_FOUND)",
|
|
41
|
-
"sale.suspension == false (else E_SALE_SUSPENDED)",
|
|
42
|
-
],
|
|
43
|
-
side_effects: [
|
|
44
|
-
"If buyer passes empty wip_hash, SDK auto-fills with sale.wip_hash",
|
|
45
|
-
"verifiedWipUrls Set avoids re-verifying same WIP URL across items",
|
|
46
|
-
"verify_wip() fetches WIP file and compares hash (else E_WIP_HASH_NOT_MATCH)",
|
|
47
|
-
],
|
|
48
|
-
always_executed: true,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
stage: 3,
|
|
52
|
-
name: "quote",
|
|
53
|
-
preconditions: [
|
|
54
|
-
"All items have valid sale + wip_hash match",
|
|
55
|
-
"stock >= purchase quantity (else E_STOCK_INSUFFICIENT)",
|
|
56
|
-
"discount object (if used) is valid and unexpired",
|
|
57
|
-
],
|
|
58
|
-
side_effects: [
|
|
59
|
-
"quote_imp() computes total price (with discount if applicable)",
|
|
60
|
-
"⚠️ Stock is deducted (split) — side effect is NOT auto-rolled-back on later failure",
|
|
61
|
-
"service::quote or service::quote_with_discount MoveCall",
|
|
62
|
-
],
|
|
63
|
-
always_executed: true,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
stage: 4,
|
|
67
|
-
name: "create_order",
|
|
68
|
-
preconditions: ["Quote object from stage 3", "Registrar + Clock objects available"],
|
|
69
|
-
side_effects: [
|
|
70
|
-
"service::buy or service::buy_with_passport MoveCall",
|
|
71
|
-
"Order object created (builder=customer, service=Service.id)",
|
|
72
|
-
"Order.id recorded for stages 5-7",
|
|
73
|
-
],
|
|
74
|
-
always_executed: true,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
stage: 5,
|
|
78
|
-
name: "create_allocation",
|
|
79
|
-
preconditions: [
|
|
80
|
-
"Service.order_allocators is Some (configured)",
|
|
81
|
-
"Order from stage 4",
|
|
82
|
-
"CoinParam for total_pay matches Service<T> type",
|
|
83
|
-
],
|
|
84
|
-
side_effects: [
|
|
85
|
-
"service::order_allocation MoveCall",
|
|
86
|
-
"Allocation object created (first-match-wins fund distribution)",
|
|
87
|
-
"Order.allocation = Allocation address",
|
|
88
|
-
],
|
|
89
|
-
always_executed: true,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
stage: 6,
|
|
93
|
-
name: "create_progress",
|
|
94
|
-
preconditions: ["Service.machine is Some (machine bound)", "Order from stage 4", "Machine from Service.machine"],
|
|
95
|
-
side_effects: [
|
|
96
|
-
"service::order_progress MoveCall",
|
|
97
|
-
"Progress object created (Progress.machine = Service.machine, Progress.task = Order.id)",
|
|
98
|
-
],
|
|
99
|
-
always_executed: false,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
stage: 7,
|
|
103
|
-
name: "post_actions",
|
|
104
|
-
preconditions: ["Order/Allocation/Progress objects from stages 4-6"],
|
|
105
|
-
side_effects: [
|
|
106
|
-
"agent_set (if order_new.agents provided)",
|
|
107
|
-
"order_required_info_update (if order_required_info provided)",
|
|
108
|
-
"owner_change (if transfer provided — sets new Order owner)",
|
|
109
|
-
"namedNewOrder / namedNewAllocation / namedNewProgress (local naming)",
|
|
110
|
-
],
|
|
111
|
-
always_executed: false,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
stage: 8,
|
|
115
|
-
name: "return_result",
|
|
116
|
-
preconditions: ["All preceding stages succeeded"],
|
|
117
|
-
side_effects: [
|
|
118
|
-
"Returns BuyResult { order, allocation?, progress? }",
|
|
119
|
-
"Caller proceeds to sign + submit transaction",
|
|
120
|
-
],
|
|
121
|
-
always_executed: true,
|
|
122
|
-
},
|
|
123
|
-
];
|
|
124
|
-
export const SERVICE_CROSS_OBJECT_BINDINGS = [
|
|
125
|
-
{ object: "Machine", field: "machine", required: false, locked_after_publish: true, notes: "Workflow template; post-publish immutable (F-S-20). Progress.machine inherits this value." },
|
|
126
|
-
{ object: "Guard", field: "buy_guard", required: false, locked_after_publish: false, notes: "Buyer eligibility guard; post-publish STILL MUTABLE (unusual — see F-S-26)" },
|
|
127
|
-
{ object: "Allocation", field: "order_allocators", required: true, locked_after_publish: true, notes: "Order fund distribution strategy; publish prerequisite (F-S-18). Post-publish immutable (F-S-22)." },
|
|
128
|
-
{ object: "Arbitration", field: "arbitrations", required: false, locked_after_publish: true, notes: "Dispute handlers; required if compensation_fund > 0 (F-S-19). Post-publish immutable (F-S-21)." },
|
|
129
|
-
{ object: "Repository", field: "repositories", required: false, locked_after_publish: false, notes: "Shared data stores; mutable post-publish" },
|
|
130
|
-
{ object: "Reward", field: "rewards", required: false, locked_after_publish: false, notes: "Marketing incentives; mutable but locked by setting_lock_duration (F-S-24)" },
|
|
131
|
-
{ object: "Contact", field: "um", required: false, locked_after_publish: false, notes: "User Manager (Contact object); mutable post-publish" },
|
|
132
|
-
{ object: "Treasury", field: "(indirect via order_allocators.sharing.who=Entity)", required: false, locked_after_publish: false, notes: "Treasury is referenced by Allocation.sharing.who, not by Service directly" },
|
|
133
|
-
];
|
|
134
|
-
export const SERVICE_SCENES = [
|
|
135
|
-
{
|
|
136
|
-
id: "service_retail",
|
|
137
|
-
name: "Retail e-commerce Service",
|
|
138
|
-
category: "retail",
|
|
139
|
-
permission_index_range: "300-320",
|
|
140
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
141
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
142
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
143
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
144
|
-
admin_operations: ["description_set", "location_set", "customer_required_set"],
|
|
145
|
-
permission_index_operations: [
|
|
146
|
-
"service::publish (311)",
|
|
147
|
-
"service::pause (310)",
|
|
148
|
-
"service::sales_add/set/remove/clear (305)",
|
|
149
|
-
"service::order_allocators_set (313)",
|
|
150
|
-
"service::buy_guard_set (307)",
|
|
151
|
-
"service::discount (312)",
|
|
152
|
-
],
|
|
153
|
-
mutable_after_publish: {
|
|
154
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
155
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
156
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
157
|
-
sales: true, description: true, location: true, repositories: true,
|
|
158
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
159
|
-
},
|
|
160
|
-
publish_prerequisites: [
|
|
161
|
-
"order_allocators must be set (F-S-18, E_NO_ALLOCATOR)",
|
|
162
|
-
"If compensation_fund > 0, arbitrations must be non-empty (F-S-19)",
|
|
163
|
-
],
|
|
164
|
-
common_patterns: [
|
|
165
|
-
"Multi-tier pricing via sales[] (Standard/Premium/Enterprise)",
|
|
166
|
-
"WIP hash per sale item for tamper-proof product info",
|
|
167
|
-
"buy_guard for KYC whitelist during pre-sale, then null for public sale",
|
|
168
|
-
"compensation_fund deposited before publish + arbitrations configured",
|
|
169
|
-
],
|
|
170
|
-
recommended_templates: ["T-S-01", "T-S-06"],
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
id: "service_rental",
|
|
174
|
-
name: "Rental Service (short/long-term)",
|
|
175
|
-
category: "rental",
|
|
176
|
-
permission_index_range: "300-320",
|
|
177
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
178
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
179
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
180
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
181
|
-
admin_operations: ["description_set", "location_set"],
|
|
182
|
-
permission_index_operations: [
|
|
183
|
-
"service::publish (311)",
|
|
184
|
-
"service::sales_add/set (305)",
|
|
185
|
-
"service::machine_set (306) — for rental workflow",
|
|
186
|
-
"service::arbitration_add (308) — for deposit disputes",
|
|
187
|
-
],
|
|
188
|
-
mutable_after_publish: {
|
|
189
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
190
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
191
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
192
|
-
sales: true, description: true, location: true, repositories: true,
|
|
193
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
194
|
-
},
|
|
195
|
-
publish_prerequisites: [
|
|
196
|
-
"order_allocators must be set",
|
|
197
|
-
"machine recommended (rental workflow with deposit/return stages)",
|
|
198
|
-
"arbitrations recommended (deposit refund disputes)",
|
|
199
|
-
],
|
|
200
|
-
common_patterns: [
|
|
201
|
-
"Machine workflow with 'Deposit → Use → Return → Refund' nodes",
|
|
202
|
-
"compensation_fund holds deposit guarantees",
|
|
203
|
-
"buy_guard verifies renter identity/KYC",
|
|
204
|
-
"stock=1 per rental item (unique items)",
|
|
205
|
-
],
|
|
206
|
-
recommended_templates: ["T-S-02", "T-S-04"],
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
id: "service_subscription",
|
|
210
|
-
name: "Subscription Service (recurring)",
|
|
211
|
-
category: "subscription",
|
|
212
|
-
permission_index_range: "300-320",
|
|
213
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
214
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
215
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
216
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
217
|
-
admin_operations: ["description_set", "location_set"],
|
|
218
|
-
permission_index_operations: [
|
|
219
|
-
"service::publish (311)",
|
|
220
|
-
"service::sales_add/set (305)",
|
|
221
|
-
"service::discount (312) — promotional rates",
|
|
222
|
-
"service::reward_add (318) — loyalty rewards",
|
|
223
|
-
],
|
|
224
|
-
mutable_after_publish: {
|
|
225
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
226
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
227
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
228
|
-
sales: true, description: true, location: true, repositories: true,
|
|
229
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
230
|
-
},
|
|
231
|
-
publish_prerequisites: ["order_allocators must be set"],
|
|
232
|
-
common_patterns: [
|
|
233
|
-
"Tiered plans (Free/Pro/Enterprise) as sales[]",
|
|
234
|
-
"Discount coupons for trial periods",
|
|
235
|
-
"Rewards for long-term subscribers",
|
|
236
|
-
"Renewal handled by repeat orders (no native recurring billing)",
|
|
237
|
-
],
|
|
238
|
-
recommended_templates: ["T-S-03"],
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
id: "service_workflow",
|
|
242
|
-
name: "Workflow-bound Service (machine-bound)",
|
|
243
|
-
category: "workflow",
|
|
244
|
-
permission_index_range: "300-320",
|
|
245
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
246
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
247
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
248
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
249
|
-
admin_operations: ["description_set", "location_set"],
|
|
250
|
-
permission_index_operations: [
|
|
251
|
-
"service::machine_set (306) — bind workflow",
|
|
252
|
-
"service::publish (311)",
|
|
253
|
-
"service::order_allocators_set (313)",
|
|
254
|
-
],
|
|
255
|
-
mutable_after_publish: {
|
|
256
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
257
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
258
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
259
|
-
sales: true, description: true, location: true, repositories: true,
|
|
260
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
261
|
-
},
|
|
262
|
-
publish_prerequisites: [
|
|
263
|
-
"order_allocators must be set",
|
|
264
|
-
"machine must be published before binding",
|
|
265
|
-
"machine recommended for any multi-stage service delivery",
|
|
266
|
-
],
|
|
267
|
-
common_patterns: [
|
|
268
|
-
"Machine defines Pay → Confirm → Deliver → Sign-off nodes",
|
|
269
|
-
"Progress created per order (stage 6 of buy flow)",
|
|
270
|
-
"Named operators assigned per Forward in Machine",
|
|
271
|
-
"Service.paused does NOT affect already-created Progress (existing orders continue)",
|
|
272
|
-
],
|
|
273
|
-
recommended_templates: ["T-S-04"],
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
id: "service_arbitration",
|
|
277
|
-
name: "Arbitration-bound Service (dispute-ready)",
|
|
278
|
-
category: "arbitration",
|
|
279
|
-
permission_index_range: "300-320",
|
|
280
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
281
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
282
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
283
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
284
|
-
admin_operations: ["description_set"],
|
|
285
|
-
permission_index_operations: [
|
|
286
|
-
"service::arbitration_add (308)",
|
|
287
|
-
"service::compensation_fund_add (315)",
|
|
288
|
-
"service::setting_lock_duration_add (317)",
|
|
289
|
-
"service::publish (311)",
|
|
290
|
-
],
|
|
291
|
-
mutable_after_publish: {
|
|
292
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
293
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
294
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
295
|
-
sales: true, description: true, location: true, repositories: true,
|
|
296
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
297
|
-
},
|
|
298
|
-
publish_prerequisites: [
|
|
299
|
-
"If compensation_fund > 0, arbitrations must be non-empty (F-S-19)",
|
|
300
|
-
"Arbitration objects must be created before binding",
|
|
301
|
-
"compensation_fund_add before publish recommended (else post-publish deposit still possible)",
|
|
302
|
-
],
|
|
303
|
-
common_patterns: [
|
|
304
|
-
"2-3 Arbitration objects (different arb committees for different dispute types)",
|
|
305
|
-
"compensation_fund deposited as % of expected order volume",
|
|
306
|
-
"setting_lock_duration extended by owner to build customer trust",
|
|
307
|
-
"compensation_claim triggered by arbitration result (not by Service directly)",
|
|
308
|
-
],
|
|
309
|
-
recommended_templates: ["T-S-05", "T-S-06"],
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
id: "service_compensation_fund",
|
|
313
|
-
name: "Compensation Fund Service (embedded balance)",
|
|
314
|
-
category: "compensation_fund",
|
|
315
|
-
permission_index_range: "300-320",
|
|
316
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
317
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
318
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
319
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
320
|
-
admin_operations: ["description_set"],
|
|
321
|
-
permission_index_operations: [
|
|
322
|
-
"service::compensation_fund_add (315) — deposit",
|
|
323
|
-
"service::compensation_fund_withdraw (314) — withdraw (locked)",
|
|
324
|
-
"service::compensation_fund_receive (316) — receive (locked)",
|
|
325
|
-
"service::setting_lock_duration_add (317) — extend lock",
|
|
326
|
-
],
|
|
327
|
-
mutable_after_publish: {
|
|
328
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
329
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
330
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
331
|
-
sales: true, description: true, location: true, repositories: true,
|
|
332
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
333
|
-
},
|
|
334
|
-
publish_prerequisites: [
|
|
335
|
-
"compensation_fund > 0 → arbitrations non-empty (F-S-19)",
|
|
336
|
-
"compensation_fund coin type must match Service<T> type parameter",
|
|
337
|
-
],
|
|
338
|
-
common_patterns: [
|
|
339
|
-
"Fund inflow: compensation_fund_add (315) — always mutable",
|
|
340
|
-
"Fund outflow: compensation_fund_withdraw (314) — requires bPaused + lock_duration expired",
|
|
341
|
-
"Fund receive: compensation_fund_receive (316) — locked by duration",
|
|
342
|
-
"Fund consumer: arbitration::compensation_claim (driven by arb result)",
|
|
343
|
-
"Distinct from Treasury: Service-internal, arbitration-bound, lock-protected",
|
|
344
|
-
],
|
|
345
|
-
recommended_templates: ["T-S-06"],
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
id: "service_reward",
|
|
349
|
-
name: "Reward-attached Service (marketing)",
|
|
350
|
-
category: "reward",
|
|
351
|
-
permission_index_range: "300-320",
|
|
352
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
353
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
354
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
355
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
356
|
-
admin_operations: ["description_set"],
|
|
357
|
-
permission_index_operations: [
|
|
358
|
-
"service::reward_add/remove/clear (318) — locked by duration",
|
|
359
|
-
"service::discount (312)",
|
|
360
|
-
"service::publish (311)",
|
|
361
|
-
],
|
|
362
|
-
mutable_after_publish: {
|
|
363
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
364
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
365
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
366
|
-
sales: true, description: true, location: true, repositories: true,
|
|
367
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
368
|
-
},
|
|
369
|
-
publish_prerequisites: ["order_allocators must be set"],
|
|
370
|
-
common_patterns: [
|
|
371
|
-
"Rewards added post-publish (still allowed, but locked by duration)",
|
|
372
|
-
"Reward objects must exist before binding (queryObjectsWithType validation)",
|
|
373
|
-
"MAX_REWARD_COUNT = 20 per Service",
|
|
374
|
-
"Reward removal also locked by duration (protects customer expectations)",
|
|
375
|
-
],
|
|
376
|
-
recommended_templates: ["T-S-08"],
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
id: "service_arbitration_binding",
|
|
380
|
-
name: "Arbitration Binding Service (post-publish immutable)",
|
|
381
|
-
category: "arbitration",
|
|
382
|
-
permission_index_range: "300-320",
|
|
383
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
384
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
385
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
386
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
387
|
-
admin_operations: ["description_set"],
|
|
388
|
-
permission_index_operations: [
|
|
389
|
-
"service::arbitration_add (308) — pre-publish only",
|
|
390
|
-
"service::arbitration_remove (308) — pre-publish only",
|
|
391
|
-
"service::arbitration_clear (308) — pre-publish only",
|
|
392
|
-
"service::publish (311)",
|
|
393
|
-
],
|
|
394
|
-
mutable_after_publish: {
|
|
395
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
396
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
397
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
398
|
-
sales: true, description: true, location: true, repositories: true,
|
|
399
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
400
|
-
},
|
|
401
|
-
publish_prerequisites: [
|
|
402
|
-
"MAX_ARBITRATION_COUNT = 20 per Service (F-S-04)",
|
|
403
|
-
"Each Arbitration object must be valid (queryObjectsWithType validation)",
|
|
404
|
-
"Arbitration bound = locked post-publish (F-S-21). To change: create new Service.",
|
|
405
|
-
],
|
|
406
|
-
common_patterns: [
|
|
407
|
-
"Pre-publish: set 1-3 Arbitration objects for different dispute scopes",
|
|
408
|
-
"Post-publish: immutable — clone Service if change needed",
|
|
409
|
-
"⚠️ Data inconsistency: dynamic-pricing.ts marks arbitrations as mutable, but SDK blocks it (F-S-21)",
|
|
410
|
-
],
|
|
411
|
-
recommended_templates: ["T-S-05"],
|
|
412
|
-
},
|
|
413
|
-
{
|
|
414
|
-
id: "service_buy_guard",
|
|
415
|
-
name: "Buy Guard Service (post-publish mutable guard)",
|
|
416
|
-
category: "buy_guard",
|
|
417
|
-
permission_index_range: "300-320",
|
|
418
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
419
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
420
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
421
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
422
|
-
admin_operations: ["description_set"],
|
|
423
|
-
permission_index_operations: [
|
|
424
|
-
"service::buy_guard_set (307) — bind guard",
|
|
425
|
-
"service::buy_guard_none (307) — clear guard",
|
|
426
|
-
"service::publish (311)",
|
|
427
|
-
],
|
|
428
|
-
mutable_after_publish: {
|
|
429
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
430
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
431
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
432
|
-
sales: true, description: true, location: true, repositories: true,
|
|
433
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
434
|
-
},
|
|
435
|
-
publish_prerequisites: ["order_allocators must be set"],
|
|
436
|
-
common_patterns: [
|
|
437
|
-
"Pre-sale phase: buy_guard = whitelist Guard (KYC verified buyers only)",
|
|
438
|
-
"Public sale: buy_guard = null (anyone can buy)",
|
|
439
|
-
"Restricted phase: buy_guard = KYC Guard (compliance)",
|
|
440
|
-
"⚠️ buy_guard is the ONLY publish-locked-field exception — still mutable post-publish",
|
|
441
|
-
"buy_guard verification happens at Stage 1 of buy flow (pre_check)",
|
|
442
|
-
],
|
|
443
|
-
recommended_templates: ["T-S-01"],
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
id: "service_order_allocator",
|
|
447
|
-
name: "Order Allocator Service (fund distribution config)",
|
|
448
|
-
category: "order_allocator",
|
|
449
|
-
permission_index_range: "300-320",
|
|
450
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
451
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
452
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
453
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
454
|
-
admin_operations: ["description_set"],
|
|
455
|
-
permission_index_operations: [
|
|
456
|
-
"service::order_allocators_set (313) — pre-publish only",
|
|
457
|
-
"service::publish (311) — requires order_allocators (F-S-18)",
|
|
458
|
-
],
|
|
459
|
-
mutable_after_publish: {
|
|
460
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
461
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
462
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
463
|
-
sales: true, description: true, location: true, repositories: true,
|
|
464
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
465
|
-
},
|
|
466
|
-
publish_prerequisites: [
|
|
467
|
-
"order_allocators MUST be set (F-S-18, E_NO_ALLOCATOR)",
|
|
468
|
-
"Allocators.sharing.who can reference Treasury addresses (indirect Treasury binding)",
|
|
469
|
-
"MAX_SHARING_COUNT = 100 per allocator",
|
|
470
|
-
],
|
|
471
|
-
common_patterns: [
|
|
472
|
-
"Multi-party split: merchant 80% / platform 10% / logistics 10%",
|
|
473
|
-
"Threshold-based: different allocators for different order sizes",
|
|
474
|
-
"Guard-bound allocator: allocation execution requires Guard verification",
|
|
475
|
-
"Post-publish immutable — clone Service to change allocation strategy",
|
|
476
|
-
],
|
|
477
|
-
recommended_templates: ["T-S-08"],
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
id: "service_dynamic_pricing",
|
|
481
|
-
name: "Dynamic Pricing Service (discount-driven)",
|
|
482
|
-
category: "dynamic_pricing",
|
|
483
|
-
permission_index_range: "300-320",
|
|
484
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
485
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
486
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
487
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
488
|
-
admin_operations: ["description_set"],
|
|
489
|
-
permission_index_operations: [
|
|
490
|
-
"service::discount (312) — issue coupons",
|
|
491
|
-
"service::sales_add/set (305) — adjust base prices",
|
|
492
|
-
"service::sales_remove (305) — remove deprecated SKUs",
|
|
493
|
-
],
|
|
494
|
-
mutable_after_publish: {
|
|
495
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
496
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
497
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
498
|
-
sales: true, description: true, location: true, repositories: true,
|
|
499
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
500
|
-
},
|
|
501
|
-
publish_prerequisites: ["order_allocators must be set"],
|
|
502
|
-
common_patterns: [
|
|
503
|
-
"Discount types: 0=rates (basis points, per 10000), 1=minus (direct deduction)",
|
|
504
|
-
"MAX_DISCOUNT_COUNT_ONCE = 1000 per issue call",
|
|
505
|
-
"MAX_DISCOUNT_RECEIVER_ONCE = 1000 receivers per call",
|
|
506
|
-
"MAX_DISCOUNT_TOTAL_COUNT = 20000 total coupons",
|
|
507
|
-
"discount_destroy: holder-only (no SERVICE_DISCOUNT permission needed)",
|
|
508
|
-
],
|
|
509
|
-
recommended_templates: ["T-S-07"],
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
id: "service_multi_allocator",
|
|
513
|
-
name: "Multi-Allocator Service (tiered fund distribution)",
|
|
514
|
-
category: "multi_allocator",
|
|
515
|
-
permission_index_range: "300-320",
|
|
516
|
-
builtin_indexes: SERVICE_PERMISSIONS,
|
|
517
|
-
cross_object_bindings: SERVICE_CROSS_OBJECT_BINDINGS,
|
|
518
|
-
order_flow_stages: SERVICE_ORDER_FLOW_STAGES,
|
|
519
|
-
owner_operations: ["um_set", "builder (transfer)"],
|
|
520
|
-
admin_operations: ["description_set"],
|
|
521
|
-
permission_index_operations: [
|
|
522
|
-
"service::order_allocators_set (313) — pre-publish only",
|
|
523
|
-
"service::publish (311)",
|
|
524
|
-
],
|
|
525
|
-
mutable_after_publish: {
|
|
526
|
-
machine: false, arbitrations: false, order_allocators: false,
|
|
527
|
-
buy_guard: true, rewards: "locked_by_duration",
|
|
528
|
-
compensation_fund_withdraw: "locked_by_duration", compensation_fund_receive: "locked_by_duration",
|
|
529
|
-
sales: true, description: true, location: true, repositories: true,
|
|
530
|
-
customer_required: true, discount: true, um: true, pause: true,
|
|
531
|
-
},
|
|
532
|
-
publish_prerequisites: [
|
|
533
|
-
"order_allocators MUST be set",
|
|
534
|
-
"Each allocator has its own Guard + sharing + threshold",
|
|
535
|
-
"First-match-wins: first allocator whose threshold is met handles the order",
|
|
536
|
-
],
|
|
537
|
-
common_patterns: [
|
|
538
|
-
"Tier 1 (small orders): single-recipient allocator (low fee)",
|
|
539
|
-
"Tier 2 (medium orders): two-recipient split (merchant + platform)",
|
|
540
|
-
"Tier 3 (large orders): three-recipient split (merchant + platform + logistics)",
|
|
541
|
-
"Each tier can have its own Guard for execution authorization",
|
|
542
|
-
],
|
|
543
|
-
recommended_templates: ["T-S-08"],
|
|
544
|
-
},
|
|
545
|
-
];
|
|
546
|
-
export const SERVICE_LEDGER_VERSION = "1.0.0";
|
|
547
|
-
export function getScenesByCategory(category) {
|
|
548
|
-
return SERVICE_SCENES.filter(s => s.category === category);
|
|
549
|
-
}
|
|
550
|
-
export function findSceneById(id) {
|
|
551
|
-
return SERVICE_SCENES.find(s => s.id === id);
|
|
552
|
-
}
|
|
553
|
-
export function getServicePermissionByIndex(index) {
|
|
554
|
-
return SERVICE_PERMISSIONS.find(p => p.index === index);
|
|
555
|
-
}
|
|
556
|
-
export function isServicePermission(index) {
|
|
557
|
-
return getServicePermissionByIndex(index) !== undefined;
|
|
558
|
-
}
|
|
559
|
-
export function getPermissionsByMutability(mutability) {
|
|
560
|
-
return SERVICE_PERMISSIONS.filter(p => p.post_publish_mutability === mutability);
|
|
561
|
-
}
|
|
562
|
-
export function getImmutablePostPublishPermissions() {
|
|
563
|
-
return SERVICE_PERMISSIONS.filter(p => p.post_publish_mutability === "immutable" || p.post_publish_mutability === "one_shot");
|
|
564
|
-
}
|
|
565
|
-
export function getLockedByDurationPermissions() {
|
|
566
|
-
return SERVICE_PERMISSIONS.filter(p => p.post_publish_mutability === "locked_by_duration");
|
|
567
|
-
}
|
|
568
|
-
export function inferSceneFromIntent(intent) {
|
|
569
|
-
const lower = intent.toLowerCase();
|
|
570
|
-
const categoryKeywords = [
|
|
571
|
-
["retail", "retail"], ["ecommerce", "retail"],
|
|
572
|
-
["rental", "rental"], ["rent", "rental"], ["short-term rental", "rental"], ["long-term rental", "rental"],
|
|
573
|
-
["subscription", "subscription"], ["subscribe", "subscription"],
|
|
574
|
-
["workflow", "workflow"], ["machine-bound", "workflow"],
|
|
575
|
-
["arbitration", "arbitration"], ["dispute", "arbitration"],
|
|
576
|
-
["compensation", "compensation_fund"], ["compensation_fund", "compensation_fund"],
|
|
577
|
-
["reward", "reward"], ["marketing", "reward"],
|
|
578
|
-
["buy_guard", "buy_guard"], ["kyc", "buy_guard"], ["whitelist", "buy_guard"],
|
|
579
|
-
["allocator", "order_allocator"],
|
|
580
|
-
["discount", "dynamic_pricing"], ["coupon", "dynamic_pricing"],
|
|
581
|
-
["multi-allocator", "multi_allocator"], ["tiered", "multi_allocator"],
|
|
582
|
-
];
|
|
583
|
-
for (const [kw, cat] of categoryKeywords) {
|
|
584
|
-
if (lower.includes(kw)) {
|
|
585
|
-
const scenes = getScenesByCategory(cat);
|
|
586
|
-
if (scenes.length > 0)
|
|
587
|
-
return scenes[0];
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
if (lower.includes("service")) {
|
|
591
|
-
return findSceneById("service_retail");
|
|
592
|
-
}
|
|
593
|
-
return undefined;
|
|
594
|
-
}
|
|
595
|
-
export function getAllServiceScenes() {
|
|
596
|
-
return [...SERVICE_SCENES];
|
|
597
|
-
}
|
|
598
|
-
export function getServiceScenesCount() {
|
|
599
|
-
return SERVICE_SCENES.length;
|
|
600
|
-
}
|
|
601
|
-
export function getServicePermissionsCount() {
|
|
602
|
-
return SERVICE_PERMISSIONS.length;
|
|
603
|
-
}
|
|
604
|
-
export function getOrderFlowStage(stage) {
|
|
605
|
-
return SERVICE_ORDER_FLOW_STAGES.find(s => s.stage === stage);
|
|
606
|
-
}
|
|
607
|
-
export function getCrossObjectBindings() {
|
|
608
|
-
return [...SERVICE_CROSS_OBJECT_BINDINGS];
|
|
609
|
-
}
|
|
1
|
+
export const SERVICE_PERMISSIONS=[{'index':0x12c,'name':'SERVICE_NEW','description':'Create\x20new\x20Service','governed_operation':'service::new','post_publish_mutability':'na'},{'index':0x12d,'name':'SERVICE_DESCRIPTION','description':'Modify\x20Service\x20description','governed_operation':'service::description_set','post_publish_mutability':'mutable'},{'index':0x12f,'name':'SERVICE_LOCATION','description':'Set\x20Service\x20location/URL','governed_operation':'service::location_set','post_publish_mutability':'mutable'},{'index':0x130,'name':'SERVICE_REPOSITORY','description':'Add/remove\x20Repository\x20references','governed_operation':'service::repository_add/remove/clear','post_publish_mutability':'mutable'},{'index':0x131,'name':'SERVICE_SALES','description':'Add/set/remove/clear\x20sales\x20items','governed_operation':'service::sales_add/set/remove/clear','post_publish_mutability':'mutable'},{'index':0x132,'name':'SERVICE_MACHINE','description':'Bind/unbind\x20Machine\x20workflow\x20template','governed_operation':'service::machine_set/machine_none','post_publish_mutability':'immutable'},{'index':0x133,'name':'SERVICE_BUY_GUARD','description':'Set/clear\x20buy\x20Guard\x20(post-publish\x20mutable)','governed_operation':'service::buy_guard_set/buy_guard_none','post_publish_mutability':'mutable'},{'index':0x134,'name':'SERVICE_ARBITRATION','description':'Add/remove\x20Arbitration\x20references','governed_operation':'service::arbitration_add/remove/clear','post_publish_mutability':'immutable'},{'index':0x135,'name':'SERVICE_CUSTOMER_INFO_REQUIRED','description':'Set\x20customer\x20required\x20info\x20fields','governed_operation':'service::customer_required_set','post_publish_mutability':'mutable'},{'index':0x136,'name':'SERVICE_PAUSE','description':'Pause/resume\x20Service\x20(block\x20new\x20orders)','governed_operation':'service::pause','post_publish_mutability':'mutable'},{'index':0x137,'name':'SERVICE_PUBLISH','description':'Publish\x20Service\x20(IRREVERSIBLE)','governed_operation':'service::publish','post_publish_mutability':'one_shot'},{'index':0x138,'name':'SERVICE_DISCOUNT','description':'Issue/discount_destroy\x20discount\x20coupons','governed_operation':'service::discount','post_publish_mutability':'mutable'},{'index':0x139,'name':'SERVICE_ORDER_ALLOCATOR','description':'Set\x20order\x20allocator\x20strategy','governed_operation':'service::order_allocators_set','post_publish_mutability':'immutable'},{'index':0x13a,'name':'SERVICE_COMPENSATION_FUND_WITHDRAW','description':'Withdraw\x20compensation\x20fund\x20(lock_duration)','governed_operation':'service::compensation_fund_withdraw','post_publish_mutability':'locked_by_duration'},{'index':0x13b,'name':'SERVICE_COMPENSATION_FUND_DEPOSIT','description':'Deposit\x20to\x20compensation\x20fund','governed_operation':'service::compensation_fund_add','post_publish_mutability':'mutable'},{'index':0x13c,'name':'SERVICE_COMPENSATION_FUND_RECEIVE','description':'Receive\x20compensation\x20fund\x20(lock_duration)','governed_operation':'service::compensation_fund_receive','post_publish_mutability':'locked_by_duration'},{'index':0x13d,'name':'SERVICE_COMPENSATION_LOCK_DURATION_ADD','description':'Extend\x20setting_lock_duration\x20(only-increase)','governed_operation':'service::setting_lock_duration_add','post_publish_mutability':'mutable'},{'index':0x13e,'name':'SERVICE_REWARD','description':'Add/remove\x20Reward\x20references\x20(locked)','governed_operation':'service::reward_add/remove/clear','post_publish_mutability':'locked_by_duration'},{'index':0x13f,'name':'SERVICE_OWNER_RECEIVE','description':'Receive\x20Payment/objects\x20to\x20owner','governed_operation':'service::owner_receive','post_publish_mutability':'mutable'},{'index':0x140,'name':'SERVICE_UM','description':'Bind/unbind\x20Contact\x20as\x20UM','governed_operation':'service::um_set/um_none','post_publish_mutability':'mutable'}];export const SERVICE_ORDER_FLOW_STAGES=[{'stage':0x1,'name':'pre_check','preconditions':['Service.bPublished\x20==\x20true\x20(else\x20E_SERVICE_NOT_PUBLISHED)','Service.bPaused\x20==\x20false\x20(else\x20E_SERVICE_PAUSED)','buy_guard\x20(if\x20set)\x20added\x20to\x20guards[]\x20list\x20for\x20verification'],'side_effects':[],'always_executed':!![]},{'stage':0x2,'name':'wip_verify','preconditions':['buy.items\x20non-empty','Each\x20item.name\x20matches\x20a\x20sale\x20in\x20Service.sales\x20(else\x20E_SALE_NOT_FOUND)','sale.suspension\x20==\x20false\x20(else\x20E_SALE_SUSPENDED)'],'side_effects':['If\x20buyer\x20passes\x20empty\x20wip_hash,\x20SDK\x20auto-fills\x20with\x20sale.wip_hash','verifiedWipUrls\x20Set\x20avoids\x20re-verifying\x20same\x20WIP\x20URL\x20across\x20items','verify_wip()\x20fetches\x20WIP\x20file\x20and\x20compares\x20hash\x20(else\x20E_WIP_HASH_NOT_MATCH)'],'always_executed':!![]},{'stage':0x3,'name':'quote','preconditions':['All\x20items\x20have\x20valid\x20sale\x20+\x20wip_hash\x20match','stock\x20>=\x20purchase\x20quantity\x20(else\x20E_STOCK_INSUFFICIENT)','discount\x20object\x20(if\x20used)\x20is\x20valid\x20and\x20unexpired'],'side_effects':['quote_imp()\x20computes\x20total\x20price\x20(with\x20discount\x20if\x20applicable)','⚠️\x20Stock\x20is\x20deducted\x20(split)\x20—\x20side\x20effect\x20is\x20NOT\x20auto-rolled-back\x20on\x20later\x20failure','service::quote\x20or\x20service::quote_with_discount\x20MoveCall'],'always_executed':!![]},{'stage':0x4,'name':'create_order','preconditions':['Quote\x20object\x20from\x20stage\x203','Registrar\x20+\x20Clock\x20objects\x20available'],'side_effects':['service::buy\x20or\x20service::buy_with_passport\x20MoveCall','Order\x20object\x20created\x20(builder=customer,\x20service=Service.id)','Order.id\x20recorded\x20for\x20stages\x205-7'],'always_executed':!![]},{'stage':0x5,'name':'create_allocation','preconditions':['Service.order_allocators\x20is\x20Some\x20(configured)','Order\x20from\x20stage\x204','CoinParam\x20for\x20total_pay\x20matches\x20Service<T>\x20type'],'side_effects':['service::order_allocation\x20MoveCall','Allocation\x20object\x20created\x20(first-match-wins\x20fund\x20distribution)','Order.allocation\x20=\x20Allocation\x20address'],'always_executed':!![]},{'stage':0x6,'name':'create_progress','preconditions':['Service.machine\x20is\x20Some\x20(machine\x20bound)','Order\x20from\x20stage\x204','Machine\x20from\x20Service.machine'],'side_effects':['service::order_progress\x20MoveCall','Progress\x20object\x20created\x20(Progress.machine\x20=\x20Service.machine,\x20Progress.task\x20=\x20Order.id)'],'always_executed':![]},{'stage':0x7,'name':'post_actions','preconditions':['Order/Allocation/Progress\x20objects\x20from\x20stages\x204-6'],'side_effects':['agent_set\x20(if\x20order_new.agents\x20provided)','order_required_info_update\x20(if\x20order_required_info\x20provided)','owner_change\x20(if\x20transfer\x20provided\x20—\x20sets\x20new\x20Order\x20owner)','namedNewOrder\x20/\x20namedNewAllocation\x20/\x20namedNewProgress\x20(local\x20naming)'],'always_executed':![]},{'stage':0x8,'name':'return_result','preconditions':['All\x20preceding\x20stages\x20succeeded'],'side_effects':['Returns\x20BuyResult\x20{\x20order,\x20allocation?,\x20progress?\x20}','Caller\x20proceeds\x20to\x20sign\x20+\x20submit\x20transaction'],'always_executed':!![]}];export const SERVICE_CROSS_OBJECT_BINDINGS=[{'object':'Machine','field':'machine','required':![],'locked_after_publish':!![],'notes':'Workflow\x20template;\x20post-publish\x20immutable\x20(F-S-20).\x20Progress.machine\x20inherits\x20this\x20value.'},{'object':'Guard','field':'buy_guard','required':![],'locked_after_publish':![],'notes':'Buyer\x20eligibility\x20guard;\x20post-publish\x20STILL\x20MUTABLE\x20(unusual\x20—\x20see\x20F-S-26)'},{'object':'Allocation','field':'order_allocators','required':!![],'locked_after_publish':!![],'notes':'Order\x20fund\x20distribution\x20strategy;\x20publish\x20prerequisite\x20(F-S-18).\x20Post-publish\x20immutable\x20(F-S-22).'},{'object':'Arbitration','field':'arbitrations','required':![],'locked_after_publish':!![],'notes':'Dispute\x20handlers;\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19).\x20Post-publish\x20immutable\x20(F-S-21).'},{'object':'Repository','field':'repositories','required':![],'locked_after_publish':![],'notes':'Shared\x20data\x20stores;\x20mutable\x20post-publish'},{'object':'Reward','field':'rewards','required':![],'locked_after_publish':![],'notes':'Marketing\x20incentives;\x20mutable\x20but\x20locked\x20by\x20setting_lock_duration\x20(F-S-24)'},{'object':'Contact','field':'um','required':![],'locked_after_publish':![],'notes':'User\x20Manager\x20(Contact\x20object);\x20mutable\x20post-publish'},{'object':'Treasury','field':'(indirect\x20via\x20order_allocators.sharing.who=Entity)','required':![],'locked_after_publish':![],'notes':'Treasury\x20is\x20referenced\x20by\x20Allocation.sharing.who,\x20not\x20by\x20Service\x20directly'}];export const SERVICE_SCENES=[{'id':'service_retail','name':'Retail\x20e-commerce\x20Service','category':'retail','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set','customer_required_set'],'permission_index_operations':['service::publish\x20(311)','service::pause\x20(310)','service::sales_add/set/remove/clear\x20(305)','service::order_allocators_set\x20(313)','service::buy_guard_set\x20(307)','service::discount\x20(312)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)'],'common_patterns':['Multi-tier\x20pricing\x20via\x20sales[]\x20(Standard/Premium/Enterprise)','WIP\x20hash\x20per\x20sale\x20item\x20for\x20tamper-proof\x20product\x20info','buy_guard\x20for\x20KYC\x20whitelist\x20during\x20pre-sale,\x20then\x20null\x20for\x20public\x20sale','compensation_fund\x20deposited\x20before\x20publish\x20+\x20arbitrations\x20configured'],'recommended_templates':['T-S-01','T-S-06']},{'id':'service_rental','name':'Rental\x20Service\x20(short/long-term)','category':'rental','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::publish\x20(311)','service::sales_add/set\x20(305)','service::machine_set\x20(306)\x20—\x20for\x20rental\x20workflow','service::arbitration_add\x20(308)\x20—\x20for\x20deposit\x20disputes'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20recommended\x20(rental\x20workflow\x20with\x20deposit/return\x20stages)','arbitrations\x20recommended\x20(deposit\x20refund\x20disputes)'],'common_patterns':['Machine\x20workflow\x20with\x20\x27Deposit\x20→\x20Use\x20→\x20Return\x20→\x20Refund\x27\x20nodes','compensation_fund\x20holds\x20deposit\x20guarantees','buy_guard\x20verifies\x20renter\x20identity/KYC','stock=1\x20per\x20rental\x20item\x20(unique\x20items)'],'recommended_templates':['T-S-02','T-S-04']},{'id':'service_subscription','name':'Subscription\x20Service\x20(recurring)','category':'subscription','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::publish\x20(311)','service::sales_add/set\x20(305)','service::discount\x20(312)\x20—\x20promotional\x20rates','service::reward_add\x20(318)\x20—\x20loyalty\x20rewards'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Tiered\x20plans\x20(Free/Pro/Enterprise)\x20as\x20sales[]','Discount\x20coupons\x20for\x20trial\x20periods','Rewards\x20for\x20long-term\x20subscribers','Renewal\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)'],'recommended_templates':['T-S-03']},{'id':'service_workflow','name':'Workflow-bound\x20Service\x20(machine-bound)','category':'workflow','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set','location_set'],'permission_index_operations':['service::machine_set\x20(306)\x20—\x20bind\x20workflow','service::publish\x20(311)','service::order_allocators_set\x20(313)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set','machine\x20must\x20be\x20published\x20before\x20binding','machine\x20recommended\x20for\x20any\x20multi-stage\x20service\x20delivery'],'common_patterns':['Machine\x20defines\x20Pay\x20→\x20Confirm\x20→\x20Deliver\x20→\x20Sign-off\x20nodes','Progress\x20created\x20per\x20order\x20(stage\x206\x20of\x20buy\x20flow)','Named\x20operators\x20assigned\x20per\x20Forward\x20in\x20Machine','Service.paused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'recommended_templates':['T-S-04']},{'id':'service_arbitration','name':'Arbitration-bound\x20Service\x20(dispute-ready)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::arbitration_add\x20(308)','service::compensation_fund_add\x20(315)','service::setting_lock_duration_add\x20(317)','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['If\x20compensation_fund\x20>\x200,\x20arbitrations\x20must\x20be\x20non-empty\x20(F-S-19)','Arbitration\x20objects\x20must\x20be\x20created\x20before\x20binding','compensation_fund_add\x20before\x20publish\x20recommended\x20(else\x20post-publish\x20deposit\x20still\x20possible)'],'common_patterns':['2-3\x20Arbitration\x20objects\x20(different\x20arb\x20committees\x20for\x20different\x20dispute\x20types)','compensation_fund\x20deposited\x20as\x20%\x20of\x20expected\x20order\x20volume','setting_lock_duration\x20extended\x20by\x20owner\x20to\x20build\x20customer\x20trust','compensation_claim\x20triggered\x20by\x20arbitration\x20result\x20(not\x20by\x20Service\x20directly)'],'recommended_templates':['T-S-05','T-S-06']},{'id':'service_compensation_fund','name':'Compensation\x20Fund\x20Service\x20(embedded\x20balance)','category':'compensation_fund','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::compensation_fund_add\x20(315)\x20—\x20deposit','service::compensation_fund_withdraw\x20(314)\x20—\x20withdraw\x20(locked)','service::compensation_fund_receive\x20(316)\x20—\x20receive\x20(locked)','service::setting_lock_duration_add\x20(317)\x20—\x20extend\x20lock'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['compensation_fund\x20>\x200\x20→\x20arbitrations\x20non-empty\x20(F-S-19)','compensation_fund\x20coin\x20type\x20must\x20match\x20Service<T>\x20type\x20parameter'],'common_patterns':['Fund\x20inflow:\x20compensation_fund_add\x20(315)\x20—\x20always\x20mutable','Fund\x20outflow:\x20compensation_fund_withdraw\x20(314)\x20—\x20requires\x20bPaused\x20+\x20lock_duration\x20expired','Fund\x20receive:\x20compensation_fund_receive\x20(316)\x20—\x20locked\x20by\x20duration','Fund\x20consumer:\x20arbitration::compensation_claim\x20(driven\x20by\x20arb\x20result)','Distinct\x20from\x20Treasury:\x20Service-internal,\x20arbitration-bound,\x20lock-protected'],'recommended_templates':['T-S-06']},{'id':'service_reward','name':'Reward-attached\x20Service\x20(marketing)','category':'reward','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::reward_add/remove/clear\x20(318)\x20—\x20locked\x20by\x20duration','service::discount\x20(312)','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Rewards\x20added\x20post-publish\x20(still\x20allowed,\x20but\x20locked\x20by\x20duration)','Reward\x20objects\x20must\x20exist\x20before\x20binding\x20(queryObjectsWithType\x20validation)','MAX_REWARD_COUNT\x20=\x2020\x20per\x20Service','Reward\x20removal\x20also\x20locked\x20by\x20duration\x20(protects\x20customer\x20expectations)'],'recommended_templates':['T-S-08']},{'id':'service_arbitration_binding','name':'Arbitration\x20Binding\x20Service\x20(post-publish\x20immutable)','category':'arbitration','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::arbitration_add\x20(308)\x20—\x20pre-publish\x20only','service::arbitration_remove\x20(308)\x20—\x20pre-publish\x20only','service::arbitration_clear\x20(308)\x20—\x20pre-publish\x20only','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['MAX_ARBITRATION_COUNT\x20=\x2020\x20per\x20Service\x20(F-S-04)','Each\x20Arbitration\x20object\x20must\x20be\x20valid\x20(queryObjectsWithType\x20validation)','Arbitration\x20bound\x20=\x20locked\x20post-publish\x20(F-S-21).\x20To\x20change:\x20create\x20new\x20Service.'],'common_patterns':['Pre-publish:\x20set\x201-3\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes','Post-publish:\x20immutable\x20—\x20clone\x20Service\x20if\x20change\x20needed','⚠️\x20Data\x20inconsistency:\x20dynamic-pricing.ts\x20marks\x20arbitrations\x20as\x20mutable,\x20but\x20SDK\x20blocks\x20it\x20(F-S-21)'],'recommended_templates':['T-S-05']},{'id':'service_buy_guard','name':'Buy\x20Guard\x20Service\x20(post-publish\x20mutable\x20guard)','category':'buy_guard','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::buy_guard_set\x20(307)\x20—\x20bind\x20guard','service::buy_guard_none\x20(307)\x20—\x20clear\x20guard','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Pre-sale\x20phase:\x20buy_guard\x20=\x20whitelist\x20Guard\x20(KYC\x20verified\x20buyers\x20only)','Public\x20sale:\x20buy_guard\x20=\x20null\x20(anyone\x20can\x20buy)','Restricted\x20phase:\x20buy_guard\x20=\x20KYC\x20Guard\x20(compliance)','⚠️\x20buy_guard\x20is\x20the\x20ONLY\x20publish-locked-field\x20exception\x20—\x20still\x20mutable\x20post-publish','buy_guard\x20verification\x20happens\x20at\x20Stage\x201\x20of\x20buy\x20flow\x20(pre_check)'],'recommended_templates':['T-S-01']},{'id':'service_order_allocator','name':'Order\x20Allocator\x20Service\x20(fund\x20distribution\x20config)','category':'order_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::order_allocators_set\x20(313)\x20—\x20pre-publish\x20only','service::publish\x20(311)\x20—\x20requires\x20order_allocators\x20(F-S-18)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set\x20(F-S-18,\x20E_NO_ALLOCATOR)','Allocators.sharing.who\x20can\x20reference\x20Treasury\x20addresses\x20(indirect\x20Treasury\x20binding)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator'],'common_patterns':['Multi-party\x20split:\x20merchant\x2080%\x20/\x20platform\x2010%\x20/\x20logistics\x2010%','Threshold-based:\x20different\x20allocators\x20for\x20different\x20order\x20sizes','Guard-bound\x20allocator:\x20allocation\x20execution\x20requires\x20Guard\x20verification','Post-publish\x20immutable\x20—\x20clone\x20Service\x20to\x20change\x20allocation\x20strategy'],'recommended_templates':['T-S-08']},{'id':'service_dynamic_pricing','name':'Dynamic\x20Pricing\x20Service\x20(discount-driven)','category':'dynamic_pricing','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::discount\x20(312)\x20—\x20issue\x20coupons','service::sales_add/set\x20(305)\x20—\x20adjust\x20base\x20prices','service::sales_remove\x20(305)\x20—\x20remove\x20deprecated\x20SKUs'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20must\x20be\x20set'],'common_patterns':['Discount\x20types:\x200=rates\x20(basis\x20points,\x20per\x2010000),\x201=minus\x20(direct\x20deduction)','MAX_DISCOUNT_COUNT_ONCE\x20=\x201000\x20per\x20issue\x20call','MAX_DISCOUNT_RECEIVER_ONCE\x20=\x201000\x20receivers\x20per\x20call','MAX_DISCOUNT_TOTAL_COUNT\x20=\x2020000\x20total\x20coupons','discount_destroy:\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'recommended_templates':['T-S-07']},{'id':'service_multi_allocator','name':'Multi-Allocator\x20Service\x20(tiered\x20fund\x20distribution)','category':'multi_allocator','permission_index_range':'300-320','builtin_indexes':SERVICE_PERMISSIONS,'cross_object_bindings':SERVICE_CROSS_OBJECT_BINDINGS,'order_flow_stages':SERVICE_ORDER_FLOW_STAGES,'owner_operations':['um_set','builder\x20(transfer)'],'admin_operations':['description_set'],'permission_index_operations':['service::order_allocators_set\x20(313)\x20—\x20pre-publish\x20only','service::publish\x20(311)'],'mutable_after_publish':{'machine':![],'arbitrations':![],'order_allocators':![],'buy_guard':!![],'rewards':'locked_by_duration','compensation_fund_withdraw':'locked_by_duration','compensation_fund_receive':'locked_by_duration','sales':!![],'description':!![],'location':!![],'repositories':!![],'customer_required':!![],'discount':!![],'um':!![],'pause':!![]},'publish_prerequisites':['order_allocators\x20MUST\x20be\x20set','Each\x20allocator\x20has\x20its\x20own\x20Guard\x20+\x20sharing\x20+\x20threshold','First-match-wins:\x20first\x20allocator\x20whose\x20threshold\x20is\x20met\x20handles\x20the\x20order'],'common_patterns':['Tier\x201\x20(small\x20orders):\x20single-recipient\x20allocator\x20(low\x20fee)','Tier\x202\x20(medium\x20orders):\x20two-recipient\x20split\x20(merchant\x20+\x20platform)','Tier\x203\x20(large\x20orders):\x20three-recipient\x20split\x20(merchant\x20+\x20platform\x20+\x20logistics)','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization'],'recommended_templates':['T-S-08']}];export const SERVICE_LEDGER_VERSION='1.0.0';export function getScenesByCategory(a){return SERVICE_SCENES['filter'](b=>b['category']===a);}export function findSceneById(a){return SERVICE_SCENES['find'](b=>b['id']===a);}export function getServicePermissionByIndex(a){return SERVICE_PERMISSIONS['find'](b=>b['index']===a);}export function isServicePermission(a){return getServicePermissionByIndex(a)!==undefined;}export function getPermissionsByMutability(a){return SERVICE_PERMISSIONS['filter'](b=>b['post_publish_mutability']===a);}export function getImmutablePostPublishPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='immutable'||a['post_publish_mutability']==='one_shot');}export function getLockedByDurationPermissions(){return SERVICE_PERMISSIONS['filter'](a=>a['post_publish_mutability']==='locked_by_duration');}export function inferSceneFromIntent(a){const b=a['toLowerCase'](),c=[['retail','retail'],['ecommerce','retail'],['rental','rental'],['rent','rental'],['short-term\x20rental','rental'],['long-term\x20rental','rental'],['subscription','subscription'],['subscribe','subscription'],['workflow','workflow'],['machine-bound','workflow'],['arbitration','arbitration'],['dispute','arbitration'],['compensation','compensation_fund'],['compensation_fund','compensation_fund'],['reward','reward'],['marketing','reward'],['buy_guard','buy_guard'],['kyc','buy_guard'],['whitelist','buy_guard'],['allocator','order_allocator'],['discount','dynamic_pricing'],['coupon','dynamic_pricing'],['multi-allocator','multi_allocator'],['tiered','multi_allocator']];for(const [d,e]of c){if(b['includes'](d)){const f=getScenesByCategory(e);if(f['length']>0x0)return f[0x0];}}if(b['includes']('service'))return findSceneById('service_retail');return undefined;}export function getAllServiceScenes(){return[...SERVICE_SCENES];}export function getServiceScenesCount(){return SERVICE_SCENES['length'];}export function getServicePermissionsCount(){return SERVICE_PERMISSIONS['length'];}export function getOrderFlowStage(a){return SERVICE_ORDER_FLOW_STAGES['find'](b=>b['stage']===a);}export function getCrossObjectBindings(){return[...SERVICE_CROSS_OBJECT_BINDINGS];}
|