@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,456 +1 @@
|
|
|
1
|
-
export const SERVICE_TEMPLATES = [
|
|
2
|
-
{
|
|
3
|
-
id: "T-S-01",
|
|
4
|
-
name: "Retail e-commerce Service",
|
|
5
|
-
description: "Standard retail shop with multiple SKUs, WIP-verified products, owner-only allocation",
|
|
6
|
-
applicable_scenes: ["service_retail", "service_buy_guard"],
|
|
7
|
-
industry_tags: ["retail", "ecommerce", "digital_goods"],
|
|
8
|
-
params: [
|
|
9
|
-
{ name: "owner_address", type: "address", description: "Service owner address (receives payments)", required: true },
|
|
10
|
-
{ name: "permission_address", type: "address", description: "Permission object address (must be owned by owner)", required: true },
|
|
11
|
-
{ name: "description", type: "string", description: "Shop description", required: true },
|
|
12
|
-
{ name: "location", type: "string", description: "Service geographic location (city/region)", required: false, default: "" },
|
|
13
|
-
{ name: "sales_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
14
|
-
{ name: "buy_guard_address", type: "address", description: "Buyer eligibility Guard (null for public sale)", required: false, default: "" },
|
|
15
|
-
],
|
|
16
|
-
body: (p) => {
|
|
17
|
-
const result = {
|
|
18
|
-
object: null,
|
|
19
|
-
description: p.description,
|
|
20
|
-
permission: p.permission_address,
|
|
21
|
-
location: p.location || undefined,
|
|
22
|
-
sales: { op: "add", sales: p.sales_items },
|
|
23
|
-
order_allocators: [
|
|
24
|
-
{
|
|
25
|
-
threshold: "0",
|
|
26
|
-
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
};
|
|
30
|
-
if (p.buy_guard_address)
|
|
31
|
-
result.buy_guard = p.buy_guard_address;
|
|
32
|
-
return result;
|
|
33
|
-
},
|
|
34
|
-
notes: [
|
|
35
|
-
"WIP hash is MANDATORY for tamper protection — never leave empty if wip URL is set",
|
|
36
|
-
"Use buy_guard for pre-sale whitelist phase, then clear for public sale",
|
|
37
|
-
"Single-recipient allocation (owner 100%) — use T-S-08 for multi-party split",
|
|
38
|
-
],
|
|
39
|
-
post_publish_considerations: [
|
|
40
|
-
"machine/arbitrations/order_allocators become immutable — verify before publish",
|
|
41
|
-
"Sales can still be added/removed/updated post-publish",
|
|
42
|
-
"buy_guard can be changed post-publish (unusual exception)",
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: "T-S-02",
|
|
47
|
-
name: "Rental Service (deposit + use + return)",
|
|
48
|
-
description: "Equipment/asset rental with deposit guarantee, Machine workflow, and arbitration",
|
|
49
|
-
applicable_scenes: ["service_rental"],
|
|
50
|
-
industry_tags: ["rental", "equipment", "real_estate"],
|
|
51
|
-
params: [
|
|
52
|
-
{ name: "owner_address", type: "address", description: "Service owner (rental company)", required: true },
|
|
53
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
54
|
-
{ name: "description", type: "string", description: "Rental service description", required: true },
|
|
55
|
-
{ name: "machine_address", type: "address", description: "Published Machine with Reserve→Pay→Pickup→Return→Refund nodes", required: true },
|
|
56
|
-
{ name: "arbitration_address", type: "address", description: "Arbitration for deposit disputes", required: true },
|
|
57
|
-
{ name: "rental_items", type: "object", description: "Array of {name, price, stock=1, wip, wip_hash}", required: true },
|
|
58
|
-
{ name: "compensation_fund_balance", type: "string", description: "Initial deposit to compensation_fund (in base units)", required: false, default: "0" },
|
|
59
|
-
],
|
|
60
|
-
body: (p) => ({
|
|
61
|
-
object: null,
|
|
62
|
-
description: p.description,
|
|
63
|
-
permission: p.permission_address,
|
|
64
|
-
machine: p.machine_address,
|
|
65
|
-
arbitrations: { op: "add", objects: [p.arbitration_address] },
|
|
66
|
-
sales: { op: "add", sales: p.rental_items },
|
|
67
|
-
order_allocators: [
|
|
68
|
-
{
|
|
69
|
-
threshold: "0",
|
|
70
|
-
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
compensation_fund_add: p.compensation_fund_balance && p.compensation_fund_balance !== "0"
|
|
74
|
-
? { balance: p.compensation_fund_balance }
|
|
75
|
-
: undefined,
|
|
76
|
-
}),
|
|
77
|
-
notes: [
|
|
78
|
-
"stock=1 per rental item (unique items) — once rented, stock becomes 0",
|
|
79
|
-
"Machine must define deposit/return/refund nodes for proper rental flow",
|
|
80
|
-
"compensation_fund holds deposit guarantees — separate from rental fee",
|
|
81
|
-
"Arbitration required if compensation_fund > 0 (F-S-19)",
|
|
82
|
-
],
|
|
83
|
-
post_publish_considerations: [
|
|
84
|
-
"Machine binding is permanent — verify workflow before publish",
|
|
85
|
-
"Arbitration binding is permanent — choose reputable arbiters",
|
|
86
|
-
"Sales can be updated (add new rental items, remove deprecated ones)",
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
id: "T-S-03",
|
|
91
|
-
name: "Subscription Service (tiered plans)",
|
|
92
|
-
description: "Recurring-access service with tiered plans (Free/Pro/Enterprise), discount coupons, loyalty rewards",
|
|
93
|
-
applicable_scenes: ["service_subscription"],
|
|
94
|
-
industry_tags: ["subscription", "saas", "membership"],
|
|
95
|
-
params: [
|
|
96
|
-
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
97
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
98
|
-
{ name: "description", type: "string", description: "Subscription service description", required: true },
|
|
99
|
-
{ name: "tier_plans", type: "object", description: "Array of {name, price, stock=999999, wip, wip_hash} for each tier", required: true },
|
|
100
|
-
{ name: "trial_discount_count", type: "number", description: "Number of trial discount coupons to issue", required: false, default: 0 },
|
|
101
|
-
{ name: "reward_address", type: "address", description: "Loyalty Reward object address (optional)", required: false, default: "" },
|
|
102
|
-
],
|
|
103
|
-
body: (p) => {
|
|
104
|
-
const result = {
|
|
105
|
-
object: null,
|
|
106
|
-
description: p.description,
|
|
107
|
-
permission: p.permission_address,
|
|
108
|
-
sales: { op: "add", sales: p.tier_plans },
|
|
109
|
-
order_allocators: [
|
|
110
|
-
{
|
|
111
|
-
threshold: "0",
|
|
112
|
-
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
};
|
|
116
|
-
if (p.reward_address) {
|
|
117
|
-
result.rewards = { op: "add", objects: [p.reward_address] };
|
|
118
|
-
}
|
|
119
|
-
return result;
|
|
120
|
-
},
|
|
121
|
-
notes: [
|
|
122
|
-
"Subscription renewals are handled by repeat orders (no native recurring billing)",
|
|
123
|
-
"Use large stock values (e.g. 999999) since subscriptions are not inventory-limited",
|
|
124
|
-
"Trial discounts: issue via service::discount (312) post-publish",
|
|
125
|
-
"Loyalty rewards: bind via service::reward_add (318) — locked by setting_lock_duration",
|
|
126
|
-
],
|
|
127
|
-
post_publish_considerations: [
|
|
128
|
-
"Tier prices can be updated via sales_set (existing subscribers unaffected)",
|
|
129
|
-
"Discount coupons can be issued/destroyed post-publish",
|
|
130
|
-
"Rewards can be added but removal locked by duration",
|
|
131
|
-
],
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
id: "T-S-04",
|
|
135
|
-
name: "Workflow-bound Service (machine-driven delivery)",
|
|
136
|
-
description: "Service with multi-step delivery workflow (e.g. freelance, custom manufacturing, course)",
|
|
137
|
-
applicable_scenes: ["service_workflow", "service_rental"],
|
|
138
|
-
industry_tags: ["workflow", "freelance", "manufacturing", "education"],
|
|
139
|
-
params: [
|
|
140
|
-
{ name: "owner_address", type: "address", description: "Service owner (provider)", required: true },
|
|
141
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
142
|
-
{ name: "description", type: "string", description: "Service description", required: true },
|
|
143
|
-
{ name: "machine_address", type: "address", description: "Published Machine with Pay→Confirm→Deliver→Sign-off nodes", required: true },
|
|
144
|
-
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
145
|
-
{ name: "customer_required", type: "string[]", description: "Required info fields (e.g. ['name','project_brief'])", required: false, default: [] },
|
|
146
|
-
],
|
|
147
|
-
body: (p) => ({
|
|
148
|
-
object: null,
|
|
149
|
-
description: p.description,
|
|
150
|
-
permission: p.permission_address,
|
|
151
|
-
machine: p.machine_address,
|
|
152
|
-
sales: { op: "add", sales: p.service_items },
|
|
153
|
-
customer_required: p.customer_required,
|
|
154
|
-
order_allocators: [
|
|
155
|
-
{
|
|
156
|
-
threshold: "0",
|
|
157
|
-
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
}),
|
|
161
|
-
notes: [
|
|
162
|
-
"Machine MUST be published before binding (machine::publish)",
|
|
163
|
-
"Each order creates a Progress object tracking the workflow",
|
|
164
|
-
"Named operators can be assigned per Forward in the Machine",
|
|
165
|
-
"Service.bPaused does NOT affect already-created Progress (existing orders continue)",
|
|
166
|
-
],
|
|
167
|
-
post_publish_considerations: [
|
|
168
|
-
"Machine binding is PERMANENT — cannot upgrade workflow post-publish",
|
|
169
|
-
"To change workflow: clone Service with new Machine, migrate customers via discounts",
|
|
170
|
-
"customer_required fields can be updated post-publish",
|
|
171
|
-
],
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
id: "T-S-05",
|
|
175
|
-
name: "Arbitration-bound Service (dispute-ready)",
|
|
176
|
-
description: "Service with multiple Arbitration objects for different dispute scopes + compensation_fund",
|
|
177
|
-
applicable_scenes: ["service_arbitration", "service_arbitration_binding"],
|
|
178
|
-
industry_tags: ["arbitration", "dispute_resolution", "high_value"],
|
|
179
|
-
params: [
|
|
180
|
-
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
181
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
182
|
-
{ name: "description", type: "string", description: "Service description", required: true },
|
|
183
|
-
{ name: "arbitration_addresses", type: "string[]", description: "1-3 Arbitration object addresses (different scopes)", required: true },
|
|
184
|
-
{ name: "compensation_fund_balance", type: "string", description: "Initial compensation_fund deposit (base units)", required: true },
|
|
185
|
-
{ name: "setting_lock_duration_ms", type: "number", description: "Initial setting_lock_duration in ms (default 30 days)", required: false, default: 2592000000 },
|
|
186
|
-
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
187
|
-
],
|
|
188
|
-
body: (p) => ({
|
|
189
|
-
object: null,
|
|
190
|
-
description: p.description,
|
|
191
|
-
permission: p.permission_address,
|
|
192
|
-
arbitrations: { op: "add", objects: p.arbitration_addresses },
|
|
193
|
-
compensation_fund_add: { balance: p.compensation_fund_balance },
|
|
194
|
-
setting_lock_duration_add: p.setting_lock_duration_ms,
|
|
195
|
-
sales: { op: "add", sales: p.service_items },
|
|
196
|
-
order_allocators: [
|
|
197
|
-
{
|
|
198
|
-
threshold: "0",
|
|
199
|
-
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
}),
|
|
203
|
-
notes: [
|
|
204
|
-
"Use 2-3 Arbitration objects: e.g. one for quality disputes, one for delivery disputes",
|
|
205
|
-
"compensation_fund > 0 REQUIRES arbitrations non-empty (F-S-19, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)",
|
|
206
|
-
"compensation_fund coin type MUST match Service<T> type parameter",
|
|
207
|
-
"setting_lock_duration protects customers — only-increase mechanism",
|
|
208
|
-
],
|
|
209
|
-
post_publish_considerations: [
|
|
210
|
-
"Arbitration bindings are PERMANENT — verify arb reputation before publish",
|
|
211
|
-
"compensation_fund_add (deposit) is always mutable post-publish",
|
|
212
|
-
"compensation_fund_withdraw requires bPaused=true + lock_duration expired",
|
|
213
|
-
"Cannot add new Arbitration post-publish — only pre-publish",
|
|
214
|
-
],
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
id: "T-S-06",
|
|
218
|
-
name: "Compensation fund Service (embedded Balance<T>)",
|
|
219
|
-
description: "Service focused on compensation_fund management — emphasizes distinction from Treasury",
|
|
220
|
-
applicable_scenes: ["service_compensation_fund", "service_arbitration"],
|
|
221
|
-
industry_tags: ["finance", "escrow", "guarantee"],
|
|
222
|
-
params: [
|
|
223
|
-
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
224
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
225
|
-
{ name: "description", type: "string", description: "Service description", required: true },
|
|
226
|
-
{ name: "arbitration_addresses", type: "string[]", description: "Arbitration objects (required when fund > 0)", required: true },
|
|
227
|
-
{ name: "initial_deposit", type: "string", description: "Initial compensation_fund deposit (base units)", required: true },
|
|
228
|
-
{ name: "lock_duration_ms", type: "number", description: "setting_lock_duration (ms)", required: false, default: 2592000000 },
|
|
229
|
-
{ name: "service_items", type: "object", description: "Sales items", required: true },
|
|
230
|
-
],
|
|
231
|
-
body: (p) => ({
|
|
232
|
-
object: null,
|
|
233
|
-
description: p.description,
|
|
234
|
-
permission: p.permission_address,
|
|
235
|
-
arbitrations: { op: "add", objects: p.arbitration_addresses },
|
|
236
|
-
compensation_fund_add: { balance: p.initial_deposit },
|
|
237
|
-
setting_lock_duration_add: p.lock_duration_ms,
|
|
238
|
-
sales: { op: "add", sales: p.service_items },
|
|
239
|
-
order_allocators: [
|
|
240
|
-
{
|
|
241
|
-
threshold: "0",
|
|
242
|
-
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
243
|
-
},
|
|
244
|
-
],
|
|
245
|
-
}),
|
|
246
|
-
notes: [
|
|
247
|
-
"⚠️ compensation_fund is INTERNAL Balance<T> — distinct from Treasury (external)",
|
|
248
|
-
"Treasury is referenced via order_allocators.sharing.who=Entity (Treasury address)",
|
|
249
|
-
"compensation_fund is consumed by arbitration::compensation_claim (driven by arb result)",
|
|
250
|
-
"Owner can only withdraw via compensation_fund_withdraw (requires paused + lock expired)",
|
|
251
|
-
],
|
|
252
|
-
post_publish_considerations: [
|
|
253
|
-
"Deposits (compensation_fund_add) always allowed",
|
|
254
|
-
"Withdrawals (compensation_fund_withdraw) require bPaused=true + lock_duration expired",
|
|
255
|
-
"Receive (compensation_fund_receive) locked by duration",
|
|
256
|
-
"setting_lock_duration only-increase — plan withdrawal timeline carefully",
|
|
257
|
-
],
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
id: "T-S-07",
|
|
261
|
-
name: "Dynamic pricing Service (discount-driven)",
|
|
262
|
-
description: "Service with promotional discount coupons — supports rates (basis points, per 10000) and minus (direct deduction) types",
|
|
263
|
-
applicable_scenes: ["service_dynamic_pricing"],
|
|
264
|
-
industry_tags: ["retail", "marketing", "promotion"],
|
|
265
|
-
params: [
|
|
266
|
-
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
267
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
268
|
-
{ name: "description", type: "string", description: "Service description", required: true },
|
|
269
|
-
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
270
|
-
{ name: "discount_specs", type: "object", description: "Array of {name, type, data, count, expire_at} for initial discounts", required: false, default: [] },
|
|
271
|
-
],
|
|
272
|
-
body: (p) => ({
|
|
273
|
-
object: null,
|
|
274
|
-
description: p.description,
|
|
275
|
-
permission: p.permission_address,
|
|
276
|
-
sales: { op: "add", sales: p.service_items },
|
|
277
|
-
order_allocators: [
|
|
278
|
-
{
|
|
279
|
-
threshold: "0",
|
|
280
|
-
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
}),
|
|
284
|
-
notes: [
|
|
285
|
-
"Discounts are issued POST-PUBLISH via service::discount (312) — not in create body",
|
|
286
|
-
"discount_type=0 rates (basis points, e.g. 1000=10%); 1=minus (direct deduction, base units)",
|
|
287
|
-
"MAX_DISCOUNT_COUNT_ONCE = 1000 per issue call",
|
|
288
|
-
"MAX_DISCOUNT_RECEIVER_ONCE = 1000 receivers per call",
|
|
289
|
-
"MAX_DISCOUNT_TOTAL_COUNT = 20000 total coupons per Service",
|
|
290
|
-
"discount_destroy is holder-only (no SERVICE_DISCOUNT permission needed)",
|
|
291
|
-
],
|
|
292
|
-
post_publish_considerations: [
|
|
293
|
-
"Discount coupons can be issued/destroyed freely",
|
|
294
|
-
"Sales prices can be updated via sales_set (existing orders unaffected)",
|
|
295
|
-
"Track discount usage to avoid stockout of promotional items",
|
|
296
|
-
],
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
id: "T-S-08",
|
|
300
|
-
name: "Multi-allocator Service (tiered fund distribution)",
|
|
301
|
-
description: "Service with multiple allocator tiers — first-match-wins distribution based on order value",
|
|
302
|
-
applicable_scenes: ["service_multi_allocator", "service_order_allocator", "service_reward"],
|
|
303
|
-
industry_tags: ["marketplace", "platform", "logistics"],
|
|
304
|
-
params: [
|
|
305
|
-
{ name: "owner_address", type: "address", description: "Service owner (merchant)", required: true },
|
|
306
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
307
|
-
{ name: "description", type: "string", description: "Service description", required: true },
|
|
308
|
-
{ name: "platform_address", type: "address", description: "Platform fee recipient", required: true },
|
|
309
|
-
{ name: "logistics_address", type: "address", description: "Logistics fee recipient (optional)", required: false, default: "" },
|
|
310
|
-
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
311
|
-
{ name: "tier1_threshold", type: "string", description: "Small order threshold (base units, e.g. '0')", required: false, default: "0" },
|
|
312
|
-
{ name: "tier2_threshold", type: "string", description: "Medium order threshold (base units)", required: false, default: "10000000000" },
|
|
313
|
-
{ name: "tier3_threshold", type: "string", description: "Large order threshold (base units)", required: false, default: "100000000000" },
|
|
314
|
-
],
|
|
315
|
-
body: (p) => {
|
|
316
|
-
const allocators = [
|
|
317
|
-
{
|
|
318
|
-
threshold: p.tier1_threshold,
|
|
319
|
-
sharing: [
|
|
320
|
-
{ who: { Object: p.owner_address }, weight: 90 },
|
|
321
|
-
{ who: { Object: p.platform_address }, weight: 10 },
|
|
322
|
-
],
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
threshold: p.tier2_threshold,
|
|
326
|
-
sharing: p.logistics_address
|
|
327
|
-
? [
|
|
328
|
-
{ who: { Object: p.owner_address }, weight: 80 },
|
|
329
|
-
{ who: { Object: p.platform_address }, weight: 10 },
|
|
330
|
-
{ who: { Object: p.logistics_address }, weight: 10 },
|
|
331
|
-
]
|
|
332
|
-
: [
|
|
333
|
-
{ who: { Object: p.owner_address }, weight: 85 },
|
|
334
|
-
{ who: { Object: p.platform_address }, weight: 15 },
|
|
335
|
-
],
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
threshold: p.tier3_threshold,
|
|
339
|
-
sharing: p.logistics_address
|
|
340
|
-
? [
|
|
341
|
-
{ who: { Object: p.owner_address }, weight: 70 },
|
|
342
|
-
{ who: { Object: p.platform_address }, weight: 10 },
|
|
343
|
-
{ who: { Object: p.logistics_address }, weight: 20 },
|
|
344
|
-
]
|
|
345
|
-
: [
|
|
346
|
-
{ who: { Object: p.owner_address }, weight: 80 },
|
|
347
|
-
{ who: { Object: p.platform_address }, weight: 20 },
|
|
348
|
-
],
|
|
349
|
-
},
|
|
350
|
-
];
|
|
351
|
-
return {
|
|
352
|
-
object: null,
|
|
353
|
-
description: p.description,
|
|
354
|
-
permission: p.permission_address,
|
|
355
|
-
sales: { op: "add", sales: p.service_items },
|
|
356
|
-
order_allocators: allocators,
|
|
357
|
-
};
|
|
358
|
-
},
|
|
359
|
-
notes: [
|
|
360
|
-
"First-match-wins: first allocator whose threshold <= order value handles distribution",
|
|
361
|
-
"Each tier can have its own Guard for execution authorization (optional)",
|
|
362
|
-
"Thresholds must be ascending (tier1 < tier2 < tier3)",
|
|
363
|
-
"MAX_SHARING_COUNT = 100 per allocator (sum of sharing entries)",
|
|
364
|
-
"Treasury addresses can be referenced via sharing.who=Entity (Treasury object)",
|
|
365
|
-
],
|
|
366
|
-
post_publish_considerations: [
|
|
367
|
-
"⚠️ order_allocators is IMMUTABLE post-publish (F-S-22) — verify tiers before publish",
|
|
368
|
-
"To change fee split: clone Service with new allocators (cannot migrate existing Orders)",
|
|
369
|
-
"Sales can still be updated post-publish (only allocator is locked)",
|
|
370
|
-
],
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
id: "T-S-09",
|
|
374
|
-
name: "Supply Chain Sub-order Service (milestone unlock via buy_guard)",
|
|
375
|
-
description: "Sub-service whose buy_guard verifies the user purchased the main service order. Each milestone = one sub-order. Enables supply chain composition: main service → multiple sub-services with conditional access.",
|
|
376
|
-
applicable_scenes: ["service_buy_guard"],
|
|
377
|
-
industry_tags: ["travel", "rental", "education", "freelance", "ecommerce", "supply_chain"],
|
|
378
|
-
params: [
|
|
379
|
-
{ name: "owner_address", type: "address", description: "Sub-service owner address", required: true },
|
|
380
|
-
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
381
|
-
{ name: "description", type: "string", description: "Sub-service description (e.g., 'Hotel booking for tour package X')", required: true },
|
|
382
|
-
{ name: "main_service_address", type: "address", description: "Main Service object address (the parent service)", required: true },
|
|
383
|
-
{ name: "buy_guard_address", type: "address", description: "Guard address verifying main order ownership (order.owner==Signer AND order.service==main_service)", required: true },
|
|
384
|
-
{ name: "price", type: "number", description: "Sub-service price", required: true },
|
|
385
|
-
{ name: "machine_address", type: "address", description: "Machine object for sub-order workflow", required: true },
|
|
386
|
-
],
|
|
387
|
-
body: (p) => ({
|
|
388
|
-
object: null,
|
|
389
|
-
description: p.description,
|
|
390
|
-
service_type: "supply_chain_sub",
|
|
391
|
-
buy_guard: p.buy_guard_address,
|
|
392
|
-
price: p.price,
|
|
393
|
-
machine: p.machine_address,
|
|
394
|
-
permission: p.permission_address,
|
|
395
|
-
}),
|
|
396
|
-
notes: [
|
|
397
|
-
"VERIFIED: service.move#L173 (buy_guard: Option<address>), L263-268 (buy_with_passport evaluates buy_guard)",
|
|
398
|
-
"VERIFIER-EVIDENCE DESIGN: user submits main Order as evidence (b_submission=true), buy_guard verifies order.owner==Signer AND order.service==main_service_address",
|
|
399
|
-
"No parent_order field needed — relationship verified via buy_guard querying submitted Order fields",
|
|
400
|
-
"Each milestone = one sub-order with its own Service + buy_guard + Machine",
|
|
401
|
-
"Main flow Machine can branch to different sub-services based on node progression",
|
|
402
|
-
"Use tpl_buy_guard_order_holder (guard-templates.ts) for the buy_guard design",
|
|
403
|
-
],
|
|
404
|
-
post_publish_considerations: [
|
|
405
|
-
"buy_guard is mutable post-publish (can update the guard address)",
|
|
406
|
-
"If main service is unpublished, sub-service buy_guard will fail (order.service won't match)",
|
|
407
|
-
"Consider publishing main service before sub-services",
|
|
408
|
-
],
|
|
409
|
-
},
|
|
410
|
-
];
|
|
411
|
-
export const SERVICE_TEMPLATES_VERSION = "1.0.0";
|
|
412
|
-
export function getAllServiceTemplates() {
|
|
413
|
-
return [...SERVICE_TEMPLATES];
|
|
414
|
-
}
|
|
415
|
-
export function getServiceTemplateById(id) {
|
|
416
|
-
return SERVICE_TEMPLATES.find(t => t.id === id);
|
|
417
|
-
}
|
|
418
|
-
export function getServiceTemplatesByScene(sceneId) {
|
|
419
|
-
return SERVICE_TEMPLATES.filter(t => t.applicable_scenes.includes(sceneId));
|
|
420
|
-
}
|
|
421
|
-
export function getServiceTemplatesByIndustry(industry) {
|
|
422
|
-
return SERVICE_TEMPLATES.filter(t => t.industry_tags.includes(industry) || t.industry_tags.includes("universal"));
|
|
423
|
-
}
|
|
424
|
-
export function suggestServiceTemplateForScene(sceneId) {
|
|
425
|
-
const matches = getServiceTemplatesByScene(sceneId);
|
|
426
|
-
return matches.length > 0 ? matches[0] : undefined;
|
|
427
|
-
}
|
|
428
|
-
export function listServiceTemplates() {
|
|
429
|
-
return SERVICE_TEMPLATES.map(t => ({
|
|
430
|
-
id: t.id,
|
|
431
|
-
name: t.name,
|
|
432
|
-
description: t.description,
|
|
433
|
-
scenes: t.applicable_scenes,
|
|
434
|
-
}));
|
|
435
|
-
}
|
|
436
|
-
export function fillServiceTemplate(templateId, params) {
|
|
437
|
-
const tpl = getServiceTemplateById(templateId);
|
|
438
|
-
if (!tpl)
|
|
439
|
-
return { ok: false, error: `Template ${templateId} not found` };
|
|
440
|
-
const missing = [];
|
|
441
|
-
for (const p of tpl.params) {
|
|
442
|
-
if (p.required && !(p.name in params)) {
|
|
443
|
-
missing.push(p.name);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
if (missing.length > 0) {
|
|
447
|
-
return { ok: false, error: `Missing required params: ${missing.join(", ")}`, missing_required: missing };
|
|
448
|
-
}
|
|
449
|
-
const filled = { ...params };
|
|
450
|
-
for (const p of tpl.params) {
|
|
451
|
-
if (!(p.name in filled) && p.default !== undefined) {
|
|
452
|
-
filled[p.name] = p.default;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
return { ok: true, body: tpl.body(filled) };
|
|
456
|
-
}
|
|
1
|
+
export const SERVICE_TEMPLATES=[{'id':'T-S-01','name':'Retail\x20e-commerce\x20Service','description':'Standard\x20retail\x20shop\x20with\x20multiple\x20SKUs,\x20WIP-verified\x20products,\x20owner-only\x20allocation','applicable_scenes':['service_retail','service_buy_guard'],'industry_tags':['retail','ecommerce','digital_goods'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20address\x20(receives\x20payments)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address\x20(must\x20be\x20owned\x20by\x20owner)','required':!![]},{'name':'description','type':'string','description':'Shop\x20description','required':!![]},{'name':'location','type':'string','description':'Service\x20geographic\x20location\x20(city/region)','required':![],'default':''},{'name':'sales_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'buy_guard_address','type':'address','description':'Buyer\x20eligibility\x20Guard\x20(null\x20for\x20public\x20sale)','required':![],'default':''}],'body':a=>{const b={'object':null,'description':a['description'],'permission':a['permission_address'],'location':a['location']||undefined,'sales':{'op':'add','sales':a['sales_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]};if(a['buy_guard_address'])b['buy_guard']=a['buy_guard_address'];return b;},'notes':['WIP\x20hash\x20is\x20MANDATORY\x20for\x20tamper\x20protection\x20—\x20never\x20leave\x20empty\x20if\x20wip\x20URL\x20is\x20set','Use\x20buy_guard\x20for\x20pre-sale\x20whitelist\x20phase,\x20then\x20clear\x20for\x20public\x20sale','Single-recipient\x20allocation\x20(owner\x20100%)\x20—\x20use\x20T-S-08\x20for\x20multi-party\x20split'],'post_publish_considerations':['machine/arbitrations/order_allocators\x20become\x20immutable\x20—\x20verify\x20before\x20publish','Sales\x20can\x20still\x20be\x20added/removed/updated\x20post-publish','buy_guard\x20can\x20be\x20changed\x20post-publish\x20(unusual\x20exception)']},{'id':'T-S-02','name':'Rental\x20Service\x20(deposit\x20+\x20use\x20+\x20return)','description':'Equipment/asset\x20rental\x20with\x20deposit\x20guarantee,\x20Machine\x20workflow,\x20and\x20arbitration','applicable_scenes':['service_rental'],'industry_tags':['rental','equipment','real_estate'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(rental\x20company)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Rental\x20service\x20description','required':!![]},{'name':'machine_address','type':'address','description':'Published\x20Machine\x20with\x20Reserve→Pay→Pickup→Return→Refund\x20nodes','required':!![]},{'name':'arbitration_address','type':'address','description':'Arbitration\x20for\x20deposit\x20disputes','required':!![]},{'name':'rental_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock=1,\x20wip,\x20wip_hash}','required':!![]},{'name':'compensation_fund_balance','type':'string','description':'Initial\x20deposit\x20to\x20compensation_fund\x20(in\x20base\x20units)','required':![],'default':'0'}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'machine':a['machine_address'],'arbitrations':{'op':'add','objects':[a['arbitration_address']]},'sales':{'op':'add','sales':a['rental_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}],'compensation_fund_add':a['compensation_fund_balance']&&a['compensation_fund_balance']!=='0'?{'balance':a['compensation_fund_balance']}:undefined}),'notes':['stock=1\x20per\x20rental\x20item\x20(unique\x20items)\x20—\x20once\x20rented,\x20stock\x20becomes\x200','Machine\x20must\x20define\x20deposit/return/refund\x20nodes\x20for\x20proper\x20rental\x20flow','compensation_fund\x20holds\x20deposit\x20guarantees\x20—\x20separate\x20from\x20rental\x20fee','Arbitration\x20required\x20if\x20compensation_fund\x20>\x200\x20(F-S-19)'],'post_publish_considerations':['Machine\x20binding\x20is\x20permanent\x20—\x20verify\x20workflow\x20before\x20publish','Arbitration\x20binding\x20is\x20permanent\x20—\x20choose\x20reputable\x20arbiters','Sales\x20can\x20be\x20updated\x20(add\x20new\x20rental\x20items,\x20remove\x20deprecated\x20ones)']},{'id':'T-S-03','name':'Subscription\x20Service\x20(tiered\x20plans)','description':'Recurring-access\x20service\x20with\x20tiered\x20plans\x20(Free/Pro/Enterprise),\x20discount\x20coupons,\x20loyalty\x20rewards','applicable_scenes':['service_subscription'],'industry_tags':['subscription','saas','membership'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Subscription\x20service\x20description','required':!![]},{'name':'tier_plans','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock=999999,\x20wip,\x20wip_hash}\x20for\x20each\x20tier','required':!![]},{'name':'trial_discount_count','type':'number','description':'Number\x20of\x20trial\x20discount\x20coupons\x20to\x20issue','required':![],'default':0x0},{'name':'reward_address','type':'address','description':'Loyalty\x20Reward\x20object\x20address\x20(optional)','required':![],'default':''}],'body':a=>{const b={'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['tier_plans']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]};return a['reward_address']&&(b['rewards']={'op':'add','objects':[a['reward_address']]}),b;},'notes':['Subscription\x20renewals\x20are\x20handled\x20by\x20repeat\x20orders\x20(no\x20native\x20recurring\x20billing)','Use\x20large\x20stock\x20values\x20(e.g.\x20999999)\x20since\x20subscriptions\x20are\x20not\x20inventory-limited','Trial\x20discounts:\x20issue\x20via\x20service::discount\x20(312)\x20post-publish','Loyalty\x20rewards:\x20bind\x20via\x20service::reward_add\x20(318)\x20—\x20locked\x20by\x20setting_lock_duration'],'post_publish_considerations':['Tier\x20prices\x20can\x20be\x20updated\x20via\x20sales_set\x20(existing\x20subscribers\x20unaffected)','Discount\x20coupons\x20can\x20be\x20issued/destroyed\x20post-publish','Rewards\x20can\x20be\x20added\x20but\x20removal\x20locked\x20by\x20duration']},{'id':'T-S-04','name':'Workflow-bound\x20Service\x20(machine-driven\x20delivery)','description':'Service\x20with\x20multi-step\x20delivery\x20workflow\x20(e.g.\x20freelance,\x20custom\x20manufacturing,\x20course)','applicable_scenes':['service_workflow','service_rental'],'industry_tags':['workflow','freelance','manufacturing','education'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(provider)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'machine_address','type':'address','description':'Published\x20Machine\x20with\x20Pay→Confirm→Deliver→Sign-off\x20nodes','required':!![]},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'customer_required','type':'string[]','description':'Required\x20info\x20fields\x20(e.g.\x20[\x27name\x27,\x27project_brief\x27])','required':![],'default':[]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'machine':a['machine_address'],'sales':{'op':'add','sales':a['service_items']},'customer_required':a['customer_required'],'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Machine\x20MUST\x20be\x20published\x20before\x20binding\x20(machine::publish)','Each\x20order\x20creates\x20a\x20Progress\x20object\x20tracking\x20the\x20workflow','Named\x20operators\x20can\x20be\x20assigned\x20per\x20Forward\x20in\x20the\x20Machine','Service.bPaused\x20does\x20NOT\x20affect\x20already-created\x20Progress\x20(existing\x20orders\x20continue)'],'post_publish_considerations':['Machine\x20binding\x20is\x20PERMANENT\x20—\x20cannot\x20upgrade\x20workflow\x20post-publish','To\x20change\x20workflow:\x20clone\x20Service\x20with\x20new\x20Machine,\x20migrate\x20customers\x20via\x20discounts','customer_required\x20fields\x20can\x20be\x20updated\x20post-publish']},{'id':'T-S-05','name':'Arbitration-bound\x20Service\x20(dispute-ready)','description':'Service\x20with\x20multiple\x20Arbitration\x20objects\x20for\x20different\x20dispute\x20scopes\x20+\x20compensation_fund','applicable_scenes':['service_arbitration','service_arbitration_binding'],'industry_tags':['arbitration','dispute_resolution','high_value'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'arbitration_addresses','type':'string[]','description':'1-3\x20Arbitration\x20object\x20addresses\x20(different\x20scopes)','required':!![]},{'name':'compensation_fund_balance','type':'string','description':'Initial\x20compensation_fund\x20deposit\x20(base\x20units)','required':!![]},{'name':'setting_lock_duration_ms','type':'number','description':'Initial\x20setting_lock_duration\x20in\x20ms\x20(default\x2030\x20days)','required':![],'default':0x9a7ec800},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'arbitrations':{'op':'add','objects':a['arbitration_addresses']},'compensation_fund_add':{'balance':a['compensation_fund_balance']},'setting_lock_duration_add':a['setting_lock_duration_ms'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Use\x202-3\x20Arbitration\x20objects:\x20e.g.\x20one\x20for\x20quality\x20disputes,\x20one\x20for\x20delivery\x20disputes','compensation_fund\x20>\x200\x20REQUIRES\x20arbitrations\x20non-empty\x20(F-S-19,\x20E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)','compensation_fund\x20coin\x20type\x20MUST\x20match\x20Service<T>\x20type\x20parameter','setting_lock_duration\x20protects\x20customers\x20—\x20only-increase\x20mechanism'],'post_publish_considerations':['Arbitration\x20bindings\x20are\x20PERMANENT\x20—\x20verify\x20arb\x20reputation\x20before\x20publish','compensation_fund_add\x20(deposit)\x20is\x20always\x20mutable\x20post-publish','compensation_fund_withdraw\x20requires\x20bPaused=true\x20+\x20lock_duration\x20expired','Cannot\x20add\x20new\x20Arbitration\x20post-publish\x20—\x20only\x20pre-publish']},{'id':'T-S-06','name':'Compensation\x20fund\x20Service\x20(embedded\x20Balance<T>)','description':'Service\x20focused\x20on\x20compensation_fund\x20management\x20—\x20emphasizes\x20distinction\x20from\x20Treasury','applicable_scenes':['service_compensation_fund','service_arbitration'],'industry_tags':['finance','escrow','guarantee'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'arbitration_addresses','type':'string[]','description':'Arbitration\x20objects\x20(required\x20when\x20fund\x20>\x200)','required':!![]},{'name':'initial_deposit','type':'string','description':'Initial\x20compensation_fund\x20deposit\x20(base\x20units)','required':!![]},{'name':'lock_duration_ms','type':'number','description':'setting_lock_duration\x20(ms)','required':![],'default':0x9a7ec800},{'name':'service_items','type':'object','description':'Sales\x20items','required':!![]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'arbitrations':{'op':'add','objects':a['arbitration_addresses']},'compensation_fund_add':{'balance':a['initial_deposit']},'setting_lock_duration_add':a['lock_duration_ms'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['⚠️\x20compensation_fund\x20is\x20INTERNAL\x20Balance<T>\x20—\x20distinct\x20from\x20Treasury\x20(external)','Treasury\x20is\x20referenced\x20via\x20order_allocators.sharing.who=Entity\x20(Treasury\x20address)','compensation_fund\x20is\x20consumed\x20by\x20arbitration::compensation_claim\x20(driven\x20by\x20arb\x20result)','Owner\x20can\x20only\x20withdraw\x20via\x20compensation_fund_withdraw\x20(requires\x20paused\x20+\x20lock\x20expired)'],'post_publish_considerations':['Deposits\x20(compensation_fund_add)\x20always\x20allowed','Withdrawals\x20(compensation_fund_withdraw)\x20require\x20bPaused=true\x20+\x20lock_duration\x20expired','Receive\x20(compensation_fund_receive)\x20locked\x20by\x20duration','setting_lock_duration\x20only-increase\x20—\x20plan\x20withdrawal\x20timeline\x20carefully']},{'id':'T-S-07','name':'Dynamic\x20pricing\x20Service\x20(discount-driven)','description':'Service\x20with\x20promotional\x20discount\x20coupons\x20—\x20supports\x20rates\x20(basis\x20points,\x20per\x2010000)\x20and\x20minus\x20(direct\x20deduction)\x20types','applicable_scenes':['service_dynamic_pricing'],'industry_tags':['retail','marketing','promotion'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'discount_specs','type':'object','description':'Array\x20of\x20{name,\x20type,\x20data,\x20count,\x20expire_at}\x20for\x20initial\x20discounts','required':![],'default':[]}],'body':a=>({'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':[{'threshold':'0','sharing':[{'who':{'Object':a['owner_address']},'weight':0x64}]}]}),'notes':['Discounts\x20are\x20issued\x20POST-PUBLISH\x20via\x20service::discount\x20(312)\x20—\x20not\x20in\x20create\x20body','discount_type=0\x20rates\x20(basis\x20points,\x20e.g.\x201000=10%);\x201=minus\x20(direct\x20deduction,\x20base\x20units)','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\x20per\x20Service','discount_destroy\x20is\x20holder-only\x20(no\x20SERVICE_DISCOUNT\x20permission\x20needed)'],'post_publish_considerations':['Discount\x20coupons\x20can\x20be\x20issued/destroyed\x20freely','Sales\x20prices\x20can\x20be\x20updated\x20via\x20sales_set\x20(existing\x20orders\x20unaffected)','Track\x20discount\x20usage\x20to\x20avoid\x20stockout\x20of\x20promotional\x20items']},{'id':'T-S-08','name':'Multi-allocator\x20Service\x20(tiered\x20fund\x20distribution)','description':'Service\x20with\x20multiple\x20allocator\x20tiers\x20—\x20first-match-wins\x20distribution\x20based\x20on\x20order\x20value','applicable_scenes':['service_multi_allocator','service_order_allocator','service_reward'],'industry_tags':['marketplace','platform','logistics'],'params':[{'name':'owner_address','type':'address','description':'Service\x20owner\x20(merchant)','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Service\x20description','required':!![]},{'name':'platform_address','type':'address','description':'Platform\x20fee\x20recipient','required':!![]},{'name':'logistics_address','type':'address','description':'Logistics\x20fee\x20recipient\x20(optional)','required':![],'default':''},{'name':'service_items','type':'object','description':'Array\x20of\x20{name,\x20price,\x20stock,\x20wip,\x20wip_hash}','required':!![]},{'name':'tier1_threshold','type':'string','description':'Small\x20order\x20threshold\x20(base\x20units,\x20e.g.\x20\x270\x27)','required':![],'default':'0'},{'name':'tier2_threshold','type':'string','description':'Medium\x20order\x20threshold\x20(base\x20units)','required':![],'default':'10000000000'},{'name':'tier3_threshold','type':'string','description':'Large\x20order\x20threshold\x20(base\x20units)','required':![],'default':'100000000000'}],'body':a=>{const b=[{'threshold':a['tier1_threshold'],'sharing':[{'who':{'Object':a['owner_address']},'weight':0x5a},{'who':{'Object':a['platform_address']},'weight':0xa}]},{'threshold':a['tier2_threshold'],'sharing':a['logistics_address']?[{'who':{'Object':a['owner_address']},'weight':0x50},{'who':{'Object':a['platform_address']},'weight':0xa},{'who':{'Object':a['logistics_address']},'weight':0xa}]:[{'who':{'Object':a['owner_address']},'weight':0x55},{'who':{'Object':a['platform_address']},'weight':0xf}]},{'threshold':a['tier3_threshold'],'sharing':a['logistics_address']?[{'who':{'Object':a['owner_address']},'weight':0x46},{'who':{'Object':a['platform_address']},'weight':0xa},{'who':{'Object':a['logistics_address']},'weight':0x14}]:[{'who':{'Object':a['owner_address']},'weight':0x50},{'who':{'Object':a['platform_address']},'weight':0x14}]}];return{'object':null,'description':a['description'],'permission':a['permission_address'],'sales':{'op':'add','sales':a['service_items']},'order_allocators':b};},'notes':['First-match-wins:\x20first\x20allocator\x20whose\x20threshold\x20<=\x20order\x20value\x20handles\x20distribution','Each\x20tier\x20can\x20have\x20its\x20own\x20Guard\x20for\x20execution\x20authorization\x20(optional)','Thresholds\x20must\x20be\x20ascending\x20(tier1\x20<\x20tier2\x20<\x20tier3)','MAX_SHARING_COUNT\x20=\x20100\x20per\x20allocator\x20(sum\x20of\x20sharing\x20entries)','Treasury\x20addresses\x20can\x20be\x20referenced\x20via\x20sharing.who=Entity\x20(Treasury\x20object)'],'post_publish_considerations':['⚠️\x20order_allocators\x20is\x20IMMUTABLE\x20post-publish\x20(F-S-22)\x20—\x20verify\x20tiers\x20before\x20publish','To\x20change\x20fee\x20split:\x20clone\x20Service\x20with\x20new\x20allocators\x20(cannot\x20migrate\x20existing\x20Orders)','Sales\x20can\x20still\x20be\x20updated\x20post-publish\x20(only\x20allocator\x20is\x20locked)']},{'id':'T-S-09','name':'Supply\x20Chain\x20Sub-order\x20Service\x20(milestone\x20unlock\x20via\x20buy_guard)','description':'Sub-service\x20whose\x20buy_guard\x20verifies\x20the\x20user\x20purchased\x20the\x20main\x20service\x20order.\x20Each\x20milestone\x20=\x20one\x20sub-order.\x20Enables\x20supply\x20chain\x20composition:\x20main\x20service\x20→\x20multiple\x20sub-services\x20with\x20conditional\x20access.','applicable_scenes':['service_buy_guard'],'industry_tags':['travel','rental','education','freelance','ecommerce','supply_chain'],'params':[{'name':'owner_address','type':'address','description':'Sub-service\x20owner\x20address','required':!![]},{'name':'permission_address','type':'address','description':'Permission\x20object\x20address','required':!![]},{'name':'description','type':'string','description':'Sub-service\x20description\x20(e.g.,\x20\x27Hotel\x20booking\x20for\x20tour\x20package\x20X\x27)','required':!![]},{'name':'main_service_address','type':'address','description':'Main\x20Service\x20object\x20address\x20(the\x20parent\x20service)','required':!![]},{'name':'buy_guard_address','type':'address','description':'Guard\x20address\x20verifying\x20main\x20order\x20ownership\x20(order.owner==Signer\x20AND\x20order.service==main_service)','required':!![]},{'name':'price','type':'number','description':'Sub-service\x20price','required':!![]},{'name':'machine_address','type':'address','description':'Machine\x20object\x20for\x20sub-order\x20workflow','required':!![]}],'body':a=>({'object':null,'description':a['description'],'service_type':'supply_chain_sub','buy_guard':a['buy_guard_address'],'price':a['price'],'machine':a['machine_address'],'permission':a['permission_address']}),'notes':['VERIFIED:\x20service.move#L173\x20(buy_guard:\x20Option<address>),\x20L263-268\x20(buy_with_passport\x20evaluates\x20buy_guard)','VERIFIER-EVIDENCE\x20DESIGN:\x20user\x20submits\x20main\x20Order\x20as\x20evidence\x20(b_submission=true),\x20buy_guard\x20verifies\x20order.owner==Signer\x20AND\x20order.service==main_service_address','No\x20parent_order\x20field\x20needed\x20—\x20relationship\x20verified\x20via\x20buy_guard\x20querying\x20submitted\x20Order\x20fields','Each\x20milestone\x20=\x20one\x20sub-order\x20with\x20its\x20own\x20Service\x20+\x20buy_guard\x20+\x20Machine','Main\x20flow\x20Machine\x20can\x20branch\x20to\x20different\x20sub-services\x20based\x20on\x20node\x20progression','Use\x20tpl_buy_guard_order_holder\x20(guard-templates.ts)\x20for\x20the\x20buy_guard\x20design'],'post_publish_considerations':['buy_guard\x20is\x20mutable\x20post-publish\x20(can\x20update\x20the\x20guard\x20address)','If\x20main\x20service\x20is\x20unpublished,\x20sub-service\x20buy_guard\x20will\x20fail\x20(order.service\x20won\x27t\x20match)','Consider\x20publishing\x20main\x20service\x20before\x20sub-services']}];export const SERVICE_TEMPLATES_VERSION='1.0.0';export function getAllServiceTemplates(){return[...SERVICE_TEMPLATES];}export function getServiceTemplateById(a){return SERVICE_TEMPLATES['find'](b=>b['id']===a);}export function getServiceTemplatesByScene(a){return SERVICE_TEMPLATES['filter'](b=>b['applicable_scenes']['includes'](a));}export function getServiceTemplatesByIndustry(a){return SERVICE_TEMPLATES['filter'](b=>b['industry_tags']['includes'](a)||b['industry_tags']['includes']('universal'));}export function suggestServiceTemplateForScene(a){const b=getServiceTemplatesByScene(a);return b['length']>0x0?b[0x0]:undefined;}export function listServiceTemplates(){return SERVICE_TEMPLATES['map'](a=>({'id':a['id'],'name':a['name'],'description':a['description'],'scenes':a['applicable_scenes']}));}export function fillServiceTemplate(a,b){const c=getServiceTemplateById(a);if(!c)return{'ok':![],'error':'Template\x20'+a+'\x20not\x20found'};const d=[];for(const f of c['params']){f['required']&&!(f['name']in b)&&d['push'](f['name']);}if(d['length']>0x0)return{'ok':![],'error':'Missing\x20required\x20params:\x20'+d['join'](',\x20'),'missing_required':d};const e={...b};for(const g of c['params']){!(g['name']in e)&&g['default']!==undefined&&(e[g['name']]=g['default']);}return{'ok':!![],'body':c['body'](e)};}
|