@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,373 +1 @@
|
|
|
1
|
-
import { CUSTOMER_INTELLIGENCE_VERSION } from "./types.js";
|
|
2
|
-
const SCENARIO_SPECS = {
|
|
3
|
-
info_asymmetry: {
|
|
4
|
-
scenario: "info_asymmetry",
|
|
5
|
-
merchant_tactic: "Hides key workflow information; Machine is not public",
|
|
6
|
-
user_strategy: "Request machineNode2file export + Guard configuration; ask about key nodes via Messenger",
|
|
7
|
-
nash_equilibrium: "Merchant becomes transparent (provides full Machine docs) ↔ User purchases",
|
|
8
|
-
fallback: "Abandon purchase",
|
|
9
|
-
confidence: (puzzle) => {
|
|
10
|
-
if (puzzle.workflow_analysis === undefined)
|
|
11
|
-
return 0.9;
|
|
12
|
-
if (puzzle.completeness < 0.5)
|
|
13
|
-
return 0.9;
|
|
14
|
-
return 0.5;
|
|
15
|
-
},
|
|
16
|
-
rationale: (puzzle) => {
|
|
17
|
-
if (puzzle.workflow_analysis === undefined) {
|
|
18
|
-
return "Workflow structure analysis missing; severe information asymmetry";
|
|
19
|
-
}
|
|
20
|
-
if (puzzle.completeness < 0.5) {
|
|
21
|
-
return `Information completeness is only ${Math.round(puzzle.completeness * 100)}%; key puzzle pieces missing`;
|
|
22
|
-
}
|
|
23
|
-
return "Information completeness is acceptable, but still recommend requesting Machine docs";
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
fund_safety: {
|
|
27
|
-
scenario: "fund_safety",
|
|
28
|
-
merchant_tactic: "No compensation fund or insufficient compensation fund",
|
|
29
|
-
user_strategy: "Require merchant to top up compensation_fund to 100% of order amount; write into WTS agreement",
|
|
30
|
-
nash_equilibrium: "Merchant tops up compensation fund ↔ User purchases",
|
|
31
|
-
fallback: "Choose another merchant or require arbitration upfront",
|
|
32
|
-
confidence: (puzzle) => {
|
|
33
|
-
const fund = puzzle.fund_safety;
|
|
34
|
-
if (!fund)
|
|
35
|
-
return 0.6;
|
|
36
|
-
if (fund.compensation_covers_order === false)
|
|
37
|
-
return 0.95;
|
|
38
|
-
return 0.4;
|
|
39
|
-
},
|
|
40
|
-
rationale: (puzzle) => {
|
|
41
|
-
const fund = puzzle.fund_safety;
|
|
42
|
-
if (!fund)
|
|
43
|
-
return "Fund safety analysis missing";
|
|
44
|
-
if (fund.compensation_covers_order === false) {
|
|
45
|
-
return `Compensation fund covers only ${Math.round(fund.compensation_ratio * 100)}% of order amount`;
|
|
46
|
-
}
|
|
47
|
-
return "Compensation fund covers the order amount";
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
refund_dispute: {
|
|
51
|
-
scenario: "refund_dispute",
|
|
52
|
-
merchant_tactic: "No refund path or unfair refund Allocator configuration",
|
|
53
|
-
user_strategy: "Negotiate refund terms via Messenger + require 100%→Order Allocator",
|
|
54
|
-
nash_equilibrium: "Merchant configures refund Allocator ↔ User purchases",
|
|
55
|
-
fallback: "Arbitration",
|
|
56
|
-
confidence: (puzzle) => {
|
|
57
|
-
const wf = puzzle.workflow_analysis;
|
|
58
|
-
if (!wf)
|
|
59
|
-
return 0.5;
|
|
60
|
-
if (wf.has_refund_path === false)
|
|
61
|
-
return 0.85;
|
|
62
|
-
return 0.4;
|
|
63
|
-
},
|
|
64
|
-
rationale: (puzzle) => {
|
|
65
|
-
const wf = puzzle.workflow_analysis;
|
|
66
|
-
if (!wf)
|
|
67
|
-
return "Workflow structure missing; cannot confirm refund path";
|
|
68
|
-
if (wf.has_refund_path === false)
|
|
69
|
-
return "No refund path detected in the workflow";
|
|
70
|
-
return "Refund path exists";
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
arbitration_fairness: {
|
|
74
|
-
scenario: "arbitration_fairness",
|
|
75
|
-
merchant_tactic: "Self-built arbitration (owner=service owner)",
|
|
76
|
-
user_strategy: "Require third-party arbitration; verify arb owner via query_toolkit",
|
|
77
|
-
nash_equilibrium: "Third-party arbitration ↔ User purchases",
|
|
78
|
-
fallback: "Do not purchase",
|
|
79
|
-
confidence: (puzzle) => {
|
|
80
|
-
const trust = puzzle.trust_signals;
|
|
81
|
-
if (!trust)
|
|
82
|
-
return 0.6;
|
|
83
|
-
if (trust.arbitration_independent === false)
|
|
84
|
-
return 0.9;
|
|
85
|
-
return 0.3;
|
|
86
|
-
},
|
|
87
|
-
rationale: (puzzle) => {
|
|
88
|
-
const trust = puzzle.trust_signals;
|
|
89
|
-
if (!trust)
|
|
90
|
-
return "Trust signals missing; cannot judge arbitration independence";
|
|
91
|
-
if (trust.arbitration_independent === false) {
|
|
92
|
-
return "Arbitrator and merchant are the same address; fairness is questionable";
|
|
93
|
-
}
|
|
94
|
-
return "Arbitration is independent; fairness is assured";
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
pricing: {
|
|
98
|
-
scenario: "pricing",
|
|
99
|
-
merchant_tactic: "Price is 20%+ above market average",
|
|
100
|
-
user_strategy: "Cite puzzle.market_context.avg_price in negotiation; request discount or Reward",
|
|
101
|
-
nash_equilibrium: "Merchant lowers price or provides Reward ↔ User purchases",
|
|
102
|
-
fallback: "Accept current price but request additional benefits",
|
|
103
|
-
confidence: (puzzle) => {
|
|
104
|
-
const market = puzzle.market_context;
|
|
105
|
-
if (!market)
|
|
106
|
-
return 0.4;
|
|
107
|
-
if (market.price_percentile > 0.8)
|
|
108
|
-
return 0.7;
|
|
109
|
-
return 0.3;
|
|
110
|
-
},
|
|
111
|
-
rationale: (puzzle) => {
|
|
112
|
-
const market = puzzle.market_context;
|
|
113
|
-
if (!market)
|
|
114
|
-
return "Market context data missing";
|
|
115
|
-
return `Price is at the ${Math.round(market.price_percentile * 100)}th market percentile`;
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
delivery_sla: {
|
|
119
|
-
scenario: "delivery_sla",
|
|
120
|
-
merchant_tactic: "No milestone nodes / no delivery time commitment",
|
|
121
|
-
user_strategy: "Require milestone nodes + write time commitment into WTS",
|
|
122
|
-
nash_equilibrium: "Merchant configures SLA ↔ User purchases",
|
|
123
|
-
fallback: "Accept but agree on timeline in writing via Messenger",
|
|
124
|
-
confidence: (puzzle) => {
|
|
125
|
-
const wf = puzzle.workflow_analysis;
|
|
126
|
-
if (!wf)
|
|
127
|
-
return 0.5;
|
|
128
|
-
if (wf.has_milestone_nodes === false)
|
|
129
|
-
return 0.8;
|
|
130
|
-
return 0.3;
|
|
131
|
-
},
|
|
132
|
-
rationale: (puzzle) => {
|
|
133
|
-
const wf = puzzle.workflow_analysis;
|
|
134
|
-
if (!wf)
|
|
135
|
-
return "Workflow structure missing; cannot assess milestones";
|
|
136
|
-
if (wf.has_milestone_nodes === false)
|
|
137
|
-
return "No milestone nodes detected";
|
|
138
|
-
return "Milestone nodes are configured";
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
quality_verification: {
|
|
142
|
-
scenario: "quality_verification",
|
|
143
|
-
merchant_tactic: "WIP hash not verified",
|
|
144
|
-
user_strategy: "Require WIP hash verification; request samples or phased delivery evidence",
|
|
145
|
-
nash_equilibrium: "Merchant provides WIP verification ↔ User purchases",
|
|
146
|
-
fallback: "Request samples via Messenger",
|
|
147
|
-
confidence: (puzzle) => {
|
|
148
|
-
const basics = puzzle.service_basics;
|
|
149
|
-
if (basics.wip_verified === false)
|
|
150
|
-
return 0.85;
|
|
151
|
-
return 0.3;
|
|
152
|
-
},
|
|
153
|
-
rationale: (puzzle) => {
|
|
154
|
-
const basics = puzzle.service_basics;
|
|
155
|
-
if (basics.wip_verified === false)
|
|
156
|
-
return "WIP hash is unverified; deliverables may have been tampered with";
|
|
157
|
-
return "WIP hash is verified";
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
after_sales: {
|
|
161
|
-
scenario: "after_sales",
|
|
162
|
-
merchant_tactic: "No Messenger or post-sale support",
|
|
163
|
-
user_strategy: "Require Messenger to be configured; require post-sale terms to be written down",
|
|
164
|
-
nash_equilibrium: "Merchant provides post-sale channel ↔ User purchases",
|
|
165
|
-
fallback: "Use Contact channel as a substitute",
|
|
166
|
-
confidence: (puzzle) => {
|
|
167
|
-
const trust = puzzle.trust_signals;
|
|
168
|
-
if (!trust)
|
|
169
|
-
return 0.5;
|
|
170
|
-
if (trust.has_messenger === false)
|
|
171
|
-
return 0.75;
|
|
172
|
-
return 0.3;
|
|
173
|
-
},
|
|
174
|
-
rationale: (puzzle) => {
|
|
175
|
-
const trust = puzzle.trust_signals;
|
|
176
|
-
if (!trust)
|
|
177
|
-
return "Trust signals missing; cannot confirm Messenger";
|
|
178
|
-
if (trust.has_messenger === false)
|
|
179
|
-
return "Messenger is not configured; no post-sale channel";
|
|
180
|
-
return "Messenger is configured";
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
};
|
|
184
|
-
export function recommendStrategy(scenario, ctx) {
|
|
185
|
-
const spec = SCENARIO_SPECS[scenario];
|
|
186
|
-
const { puzzle, prefs } = ctx;
|
|
187
|
-
const strategy = {
|
|
188
|
-
scenario: spec.scenario,
|
|
189
|
-
merchant_tactic: spec.merchant_tactic,
|
|
190
|
-
user_strategy: spec.user_strategy,
|
|
191
|
-
nash_equilibrium: spec.nash_equilibrium,
|
|
192
|
-
};
|
|
193
|
-
const confidence = clampConfidence(spec.confidence(puzzle));
|
|
194
|
-
const fallback = applyPrefsToFallback(scenario, spec.fallback, prefs);
|
|
195
|
-
const rationale = spec.rationale(puzzle);
|
|
196
|
-
return {
|
|
197
|
-
scenario: spec.scenario,
|
|
198
|
-
strategy,
|
|
199
|
-
confidence,
|
|
200
|
-
fallback,
|
|
201
|
-
rationale,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
export function detectScenarios(puzzle) {
|
|
205
|
-
const scenarios = [];
|
|
206
|
-
if (puzzle.workflow_analysis === undefined || puzzle.completeness < 0.5) {
|
|
207
|
-
scenarios.push("info_asymmetry");
|
|
208
|
-
}
|
|
209
|
-
if (puzzle.fund_safety?.compensation_covers_order === false) {
|
|
210
|
-
scenarios.push("fund_safety");
|
|
211
|
-
}
|
|
212
|
-
if (puzzle.workflow_analysis?.has_refund_path === false) {
|
|
213
|
-
scenarios.push("refund_dispute");
|
|
214
|
-
}
|
|
215
|
-
if (puzzle.trust_signals?.arbitration_independent === false) {
|
|
216
|
-
scenarios.push("arbitration_fairness");
|
|
217
|
-
}
|
|
218
|
-
if (puzzle.market_context && puzzle.market_context.price_percentile > 0.8) {
|
|
219
|
-
scenarios.push("pricing");
|
|
220
|
-
}
|
|
221
|
-
if (puzzle.workflow_analysis?.has_milestone_nodes === false) {
|
|
222
|
-
scenarios.push("delivery_sla");
|
|
223
|
-
}
|
|
224
|
-
if (puzzle.service_basics.wip_verified === false) {
|
|
225
|
-
scenarios.push("quality_verification");
|
|
226
|
-
}
|
|
227
|
-
if (puzzle.trust_signals?.has_messenger === false) {
|
|
228
|
-
scenarios.push("after_sales");
|
|
229
|
-
}
|
|
230
|
-
return scenarios.slice(0, 3);
|
|
231
|
-
}
|
|
232
|
-
export function flowMigrationStrategy(puzzle) {
|
|
233
|
-
const wf = puzzle.workflow_analysis;
|
|
234
|
-
if (!wf || wf.machine_published === false) {
|
|
235
|
-
return {
|
|
236
|
-
strategy: "Machine is not published; strongly recommend requiring the merchant to publish before ordering",
|
|
237
|
-
risk: "high",
|
|
238
|
-
advice: "An unpublished Machine means the workflow is not yet in effect; after ordering, the order may not advance along the expected path. Suggest asking the merchant via Messenger to publish the Machine before placing the order.",
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
if (wf.machine_paused === true) {
|
|
242
|
-
return {
|
|
243
|
-
strategy: "Machine is paused; confirm the reason before ordering",
|
|
244
|
-
risk: "medium",
|
|
245
|
-
advice: "The Machine has been paused by the merchant; it may be temporary maintenance or an active delisting. Suggest asking the merchant via Messenger about the reason and confirming the resumption time before ordering.",
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
return {
|
|
249
|
-
strategy: "Safe to order; workflow is stable",
|
|
250
|
-
risk: "low",
|
|
251
|
-
advice: "The Machine is published and not paused; the workflow is active and it is safe to order. Still recommend monitoring progress via Progress nodes after ordering.",
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
export function repeatGameStrategy(puzzle, history) {
|
|
255
|
-
const isLongTerm = history.completed >= 5 &&
|
|
256
|
-
(history.completed === 0 || history.disputes / history.completed < 0.2);
|
|
257
|
-
if (isLongTerm) {
|
|
258
|
-
const disputeRate = history.completed > 0
|
|
259
|
-
? Math.round((history.disputes / history.completed) * 100)
|
|
260
|
-
: 0;
|
|
261
|
-
return {
|
|
262
|
-
strategy: "Long-term trust established; consider bulk ordering / discount negotiation",
|
|
263
|
-
is_long_term_partner: true,
|
|
264
|
-
advice: `Historical completed orders: ${history.completed}, dispute rate: ${disputeRate}%, trust level is high. ` +
|
|
265
|
-
"Consider bulk ordering to negotiate discounts, or negotiate a long-term cooperation agreement. Still recommend keeping WTS evidence for future rights protection.",
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
if (history.completed < 5) {
|
|
269
|
-
return {
|
|
270
|
-
strategy: "First-time cooperation; recommend a small test order before scaling up once trust is established",
|
|
271
|
-
is_long_term_partner: false,
|
|
272
|
-
advice: `Only ${history.completed} historical order(s); sample is insufficient to judge long-term trust. ` +
|
|
273
|
-
"Recommend testing the merchant's fulfillment and communication efficiency with a small order first, " +
|
|
274
|
-
"and scaling up once trust is accumulated. Focus on refund path and arbitration configuration.",
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
const disputeRate = Math.round((history.disputes / history.completed) * 100);
|
|
278
|
-
return {
|
|
279
|
-
strategy: "Historical dispute rate is high; recommend ordering with caution and strengthening risk safeguards",
|
|
280
|
-
is_long_term_partner: false,
|
|
281
|
-
advice: `Among ${history.completed} historical orders, the dispute rate of ${disputeRate}% is high. Recommend requiring the merchant to top up the compensation fund, write terms into the WTS agreement, and strengthen upfront arbitration clauses for this order.`,
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
export function rightsProtectionStrategy(puzzle, prefs) {
|
|
285
|
-
const required = [];
|
|
286
|
-
const negotiable = [];
|
|
287
|
-
const red_lines = [];
|
|
288
|
-
const hasRefundPath = puzzle.workflow_analysis?.has_refund_path ?? false;
|
|
289
|
-
const hasArbPath = puzzle.workflow_analysis?.has_arbitration_path ?? false;
|
|
290
|
-
const arbIndependent = puzzle.trust_signals?.arbitration_independent ?? true;
|
|
291
|
-
const compensationRatio = puzzle.fund_safety?.compensation_ratio ?? 0;
|
|
292
|
-
if (!hasRefundPath) {
|
|
293
|
-
required.push("Require the merchant to configure a refund Allocator (100%→Order)");
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
required.push("Confirm the refund path is available");
|
|
297
|
-
}
|
|
298
|
-
if (!hasArbPath) {
|
|
299
|
-
required.push("Require the merchant to bind a third-party arbitration service");
|
|
300
|
-
}
|
|
301
|
-
else if (!arbIndependent) {
|
|
302
|
-
required.push("Require the merchant to switch to third-party arbitration (currently self-built arbitration)");
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
required.push("Confirm the arbitration path is available");
|
|
306
|
-
}
|
|
307
|
-
if (compensationRatio < 1) {
|
|
308
|
-
required.push(`Require the merchant to top up the compensation fund to 100% of the order amount (currently covers ${Math.round(compensationRatio * 100)}%)`);
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
required.push("Confirm the compensation fund is sufficient");
|
|
312
|
-
}
|
|
313
|
-
if (prefs?.require_arbitration && !hasArbPath) {
|
|
314
|
-
required.push("User preference requires mandatory arbitration");
|
|
315
|
-
}
|
|
316
|
-
if (prefs?.require_compensation_fund && compensationRatio < 1) {
|
|
317
|
-
required.push("User preference requires a mandatory compensation fund");
|
|
318
|
-
}
|
|
319
|
-
negotiable.push("Price (negotiate based on market average)");
|
|
320
|
-
negotiable.push("Delivery time (agree in writing via Messenger)");
|
|
321
|
-
negotiable.push("Reward or discount (based on puzzle.market_context)");
|
|
322
|
-
if (prefs) {
|
|
323
|
-
if (prefs.bargain_hunting > 0.5) {
|
|
324
|
-
negotiable.push("Additional discount (user has a strong bargain-hunting tendency)");
|
|
325
|
-
}
|
|
326
|
-
if (prefs.reward_seeking) {
|
|
327
|
-
negotiable.push("Reward incentive terms");
|
|
328
|
-
}
|
|
329
|
-
if (prefs.delivery_speed_priority === "urgent") {
|
|
330
|
-
negotiable.push("Expedited delivery commitment");
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
if (!hasArbPath && !hasRefundPath) {
|
|
334
|
-
red_lines.push("No arbitration and no refund path: the merchant can breach at will, funds are unprotected; recommend not purchasing");
|
|
335
|
-
}
|
|
336
|
-
if (compensationRatio < 0.5) {
|
|
337
|
-
red_lines.push(`Compensation fund coverage is only ${Math.round(compensationRatio * 100)}% (<50%): payout is severely insufficient if the order fails; recommend not purchasing`);
|
|
338
|
-
}
|
|
339
|
-
if (prefs) {
|
|
340
|
-
const trustScore = puzzle.trust_signals?.trust_score ?? 100;
|
|
341
|
-
if (trustScore < prefs.min_trust_score) {
|
|
342
|
-
red_lines.push(`Composite trust score ${trustScore} is below the user's minimum requirement of ${prefs.min_trust_score}`);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
return {
|
|
346
|
-
required_rights: required,
|
|
347
|
-
negotiable_rights: negotiable,
|
|
348
|
-
red_lines: red_lines,
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
function clampConfidence(value) {
|
|
352
|
-
if (value < 0)
|
|
353
|
-
return 0;
|
|
354
|
-
if (value > 1)
|
|
355
|
-
return 1;
|
|
356
|
-
return value;
|
|
357
|
-
}
|
|
358
|
-
function applyPrefsToFallback(scenario, defaultFallback, prefs) {
|
|
359
|
-
if (!prefs)
|
|
360
|
-
return defaultFallback;
|
|
361
|
-
if (prefs.risk_appetite === "conservative") {
|
|
362
|
-
if (scenario === "arbitration_fairness" || scenario === "fund_safety") {
|
|
363
|
-
return "Abandon purchase (conservative user)";
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (prefs.risk_appetite === "aggressive") {
|
|
367
|
-
if (scenario === "pricing") {
|
|
368
|
-
return "Accept current price but request additional Reward or discount";
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
return defaultFallback;
|
|
372
|
-
}
|
|
373
|
-
export { CUSTOMER_INTELLIGENCE_VERSION };
|
|
1
|
+
import{CUSTOMER_INTELLIGENCE_VERSION}from'./types.js';const SCENARIO_SPECS={'info_asymmetry':{'scenario':'info_asymmetry','merchant_tactic':'Hides\x20key\x20workflow\x20information;\x20Machine\x20is\x20not\x20public','user_strategy':'Request\x20machineNode2file\x20export\x20+\x20Guard\x20configuration;\x20ask\x20about\x20key\x20nodes\x20via\x20Messenger','nash_equilibrium':'Merchant\x20becomes\x20transparent\x20(provides\x20full\x20Machine\x20docs)\x20↔\x20User\x20purchases','fallback':'Abandon\x20purchase','confidence':a=>{if(a['workflow_analysis']===undefined)return 0.9;if(a['completeness']<0.5)return 0.9;return 0.5;},'rationale':a=>{if(a['workflow_analysis']===undefined)return'Workflow\x20structure\x20analysis\x20missing;\x20severe\x20information\x20asymmetry';if(a['completeness']<0.5)return'Information\x20completeness\x20is\x20only\x20'+Math['round'](a['completeness']*0x64)+'%;\x20key\x20puzzle\x20pieces\x20missing';return'Information\x20completeness\x20is\x20acceptable,\x20but\x20still\x20recommend\x20requesting\x20Machine\x20docs';}},'fund_safety':{'scenario':'fund_safety','merchant_tactic':'No\x20compensation\x20fund\x20or\x20insufficient\x20compensation\x20fund','user_strategy':'Require\x20merchant\x20to\x20top\x20up\x20compensation_fund\x20to\x20100%\x20of\x20order\x20amount;\x20write\x20into\x20WTS\x20agreement','nash_equilibrium':'Merchant\x20tops\x20up\x20compensation\x20fund\x20↔\x20User\x20purchases','fallback':'Choose\x20another\x20merchant\x20or\x20require\x20arbitration\x20upfront','confidence':a=>{const b=a['fund_safety'];if(!b)return 0.6;if(b['compensation_covers_order']===![])return 0.95;return 0.4;},'rationale':a=>{const b=a['fund_safety'];if(!b)return'Fund\x20safety\x20analysis\x20missing';if(b['compensation_covers_order']===![])return'Compensation\x20fund\x20covers\x20only\x20'+Math['round'](b['compensation_ratio']*0x64)+'%\x20of\x20order\x20amount';return'Compensation\x20fund\x20covers\x20the\x20order\x20amount';}},'refund_dispute':{'scenario':'refund_dispute','merchant_tactic':'No\x20refund\x20path\x20or\x20unfair\x20refund\x20Allocator\x20configuration','user_strategy':'Negotiate\x20refund\x20terms\x20via\x20Messenger\x20+\x20require\x20100%→Order\x20Allocator','nash_equilibrium':'Merchant\x20configures\x20refund\x20Allocator\x20↔\x20User\x20purchases','fallback':'Arbitration','confidence':a=>{const b=a['workflow_analysis'];if(!b)return 0.5;if(b['has_refund_path']===![])return 0.85;return 0.4;},'rationale':a=>{const b=a['workflow_analysis'];if(!b)return'Workflow\x20structure\x20missing;\x20cannot\x20confirm\x20refund\x20path';if(b['has_refund_path']===![])return'No\x20refund\x20path\x20detected\x20in\x20the\x20workflow';return'Refund\x20path\x20exists';}},'arbitration_fairness':{'scenario':'arbitration_fairness','merchant_tactic':'Self-built\x20arbitration\x20(owner=service\x20owner)','user_strategy':'Require\x20third-party\x20arbitration;\x20verify\x20arb\x20owner\x20via\x20query_toolkit','nash_equilibrium':'Third-party\x20arbitration\x20↔\x20User\x20purchases','fallback':'Do\x20not\x20purchase','confidence':a=>{const b=a['trust_signals'];if(!b)return 0.6;if(b['arbitration_independent']===![])return 0.9;return 0.3;},'rationale':a=>{const b=a['trust_signals'];if(!b)return'Trust\x20signals\x20missing;\x20cannot\x20judge\x20arbitration\x20independence';if(b['arbitration_independent']===![])return'Arbitrator\x20and\x20merchant\x20are\x20the\x20same\x20address;\x20fairness\x20is\x20questionable';return'Arbitration\x20is\x20independent;\x20fairness\x20is\x20assured';}},'pricing':{'scenario':'pricing','merchant_tactic':'Price\x20is\x2020%+\x20above\x20market\x20average','user_strategy':'Cite\x20puzzle.market_context.avg_price\x20in\x20negotiation;\x20request\x20discount\x20or\x20Reward','nash_equilibrium':'Merchant\x20lowers\x20price\x20or\x20provides\x20Reward\x20↔\x20User\x20purchases','fallback':'Accept\x20current\x20price\x20but\x20request\x20additional\x20benefits','confidence':a=>{const b=a['market_context'];if(!b)return 0.4;if(b['price_percentile']>0.8)return 0.7;return 0.3;},'rationale':a=>{const b=a['market_context'];if(!b)return'Market\x20context\x20data\x20missing';return'Price\x20is\x20at\x20the\x20'+Math['round'](b['price_percentile']*0x64)+'th\x20market\x20percentile';}},'delivery_sla':{'scenario':'delivery_sla','merchant_tactic':'No\x20milestone\x20nodes\x20/\x20no\x20delivery\x20time\x20commitment','user_strategy':'Require\x20milestone\x20nodes\x20+\x20write\x20time\x20commitment\x20into\x20WTS','nash_equilibrium':'Merchant\x20configures\x20SLA\x20↔\x20User\x20purchases','fallback':'Accept\x20but\x20agree\x20on\x20timeline\x20in\x20writing\x20via\x20Messenger','confidence':a=>{const b=a['workflow_analysis'];if(!b)return 0.5;if(b['has_milestone_nodes']===![])return 0.8;return 0.3;},'rationale':a=>{const b=a['workflow_analysis'];if(!b)return'Workflow\x20structure\x20missing;\x20cannot\x20assess\x20milestones';if(b['has_milestone_nodes']===![])return'No\x20milestone\x20nodes\x20detected';return'Milestone\x20nodes\x20are\x20configured';}},'quality_verification':{'scenario':'quality_verification','merchant_tactic':'WIP\x20hash\x20not\x20verified','user_strategy':'Require\x20WIP\x20hash\x20verification;\x20request\x20samples\x20or\x20phased\x20delivery\x20evidence','nash_equilibrium':'Merchant\x20provides\x20WIP\x20verification\x20↔\x20User\x20purchases','fallback':'Request\x20samples\x20via\x20Messenger','confidence':a=>{const b=a['service_basics'];if(b['wip_verified']===![])return 0.85;return 0.3;},'rationale':a=>{const b=a['service_basics'];if(b['wip_verified']===![])return'WIP\x20hash\x20is\x20unverified;\x20deliverables\x20may\x20have\x20been\x20tampered\x20with';return'WIP\x20hash\x20is\x20verified';}},'after_sales':{'scenario':'after_sales','merchant_tactic':'No\x20Messenger\x20or\x20post-sale\x20support','user_strategy':'Require\x20Messenger\x20to\x20be\x20configured;\x20require\x20post-sale\x20terms\x20to\x20be\x20written\x20down','nash_equilibrium':'Merchant\x20provides\x20post-sale\x20channel\x20↔\x20User\x20purchases','fallback':'Use\x20Contact\x20channel\x20as\x20a\x20substitute','confidence':a=>{const b=a['trust_signals'];if(!b)return 0.5;if(b['has_messenger']===![])return 0.75;return 0.3;},'rationale':a=>{const b=a['trust_signals'];if(!b)return'Trust\x20signals\x20missing;\x20cannot\x20confirm\x20Messenger';if(b['has_messenger']===![])return'Messenger\x20is\x20not\x20configured;\x20no\x20post-sale\x20channel';return'Messenger\x20is\x20configured';}}};export function recommendStrategy(a,b){const c=SCENARIO_SPECS[a],{puzzle:d,prefs:e}=b,f={'scenario':c['scenario'],'merchant_tactic':c['merchant_tactic'],'user_strategy':c['user_strategy'],'nash_equilibrium':c['nash_equilibrium']},g=clampConfidence(c['confidence'](d)),h=applyPrefsToFallback(a,c['fallback'],e),i=c['rationale'](d);return{'scenario':c['scenario'],'strategy':f,'confidence':g,'fallback':h,'rationale':i};}export function detectScenarios(a){const b=[];return(a['workflow_analysis']===undefined||a['completeness']<0.5)&&b['push']('info_asymmetry'),a['fund_safety']?.['compensation_covers_order']===![]&&b['push']('fund_safety'),a['workflow_analysis']?.['has_refund_path']===![]&&b['push']('refund_dispute'),a['trust_signals']?.['arbitration_independent']===![]&&b['push']('arbitration_fairness'),a['market_context']&&a['market_context']['price_percentile']>0.8&&b['push']('pricing'),a['workflow_analysis']?.['has_milestone_nodes']===![]&&b['push']('delivery_sla'),a['service_basics']['wip_verified']===![]&&b['push']('quality_verification'),a['trust_signals']?.['has_messenger']===![]&&b['push']('after_sales'),b['slice'](0x0,0x3);}export function flowMigrationStrategy(a){const b=a['workflow_analysis'];if(!b||b['machine_published']===![])return{'strategy':'Machine\x20is\x20not\x20published;\x20strongly\x20recommend\x20requiring\x20the\x20merchant\x20to\x20publish\x20before\x20ordering','risk':'high','advice':'An\x20unpublished\x20Machine\x20means\x20the\x20workflow\x20is\x20not\x20yet\x20in\x20effect;\x20after\x20ordering,\x20the\x20order\x20may\x20not\x20advance\x20along\x20the\x20expected\x20path.\x20Suggest\x20asking\x20the\x20merchant\x20via\x20Messenger\x20to\x20publish\x20the\x20Machine\x20before\x20placing\x20the\x20order.'};if(b['machine_paused']===!![])return{'strategy':'Machine\x20is\x20paused;\x20confirm\x20the\x20reason\x20before\x20ordering','risk':'medium','advice':'The\x20Machine\x20has\x20been\x20paused\x20by\x20the\x20merchant;\x20it\x20may\x20be\x20temporary\x20maintenance\x20or\x20an\x20active\x20delisting.\x20Suggest\x20asking\x20the\x20merchant\x20via\x20Messenger\x20about\x20the\x20reason\x20and\x20confirming\x20the\x20resumption\x20time\x20before\x20ordering.'};return{'strategy':'Safe\x20to\x20order;\x20workflow\x20is\x20stable','risk':'low','advice':'The\x20Machine\x20is\x20published\x20and\x20not\x20paused;\x20the\x20workflow\x20is\x20active\x20and\x20it\x20is\x20safe\x20to\x20order.\x20Still\x20recommend\x20monitoring\x20progress\x20via\x20Progress\x20nodes\x20after\x20ordering.'};}export function repeatGameStrategy(a,b){const c=b['completed']>=0x5&&(b['completed']===0x0||b['disputes']/b['completed']<0.2);if(c){const e=b['completed']>0x0?Math['round'](b['disputes']/b['completed']*0x64):0x0;return{'strategy':'Long-term\x20trust\x20established;\x20consider\x20bulk\x20ordering\x20/\x20discount\x20negotiation','is_long_term_partner':!![],'advice':'Historical\x20completed\x20orders:\x20'+b['completed']+',\x20dispute\x20rate:\x20'+e+'%,\x20trust\x20level\x20is\x20high.\x20'+'Consider\x20bulk\x20ordering\x20to\x20negotiate\x20discounts,\x20or\x20negotiate\x20a\x20long-term\x20cooperation\x20agreement.\x20Still\x20recommend\x20keeping\x20WTS\x20evidence\x20for\x20future\x20rights\x20protection.'};}if(b['completed']<0x5)return{'strategy':'First-time\x20cooperation;\x20recommend\x20a\x20small\x20test\x20order\x20before\x20scaling\x20up\x20once\x20trust\x20is\x20established','is_long_term_partner':![],'advice':'Only\x20'+b['completed']+'\x20historical\x20order(s);\x20sample\x20is\x20insufficient\x20to\x20judge\x20long-term\x20trust.\x20'+'Recommend\x20testing\x20the\x20merchant\x27s\x20fulfillment\x20and\x20communication\x20efficiency\x20with\x20a\x20small\x20order\x20first,\x20'+'and\x20scaling\x20up\x20once\x20trust\x20is\x20accumulated.\x20Focus\x20on\x20refund\x20path\x20and\x20arbitration\x20configuration.'};const d=Math['round'](b['disputes']/b['completed']*0x64);return{'strategy':'Historical\x20dispute\x20rate\x20is\x20high;\x20recommend\x20ordering\x20with\x20caution\x20and\x20strengthening\x20risk\x20safeguards','is_long_term_partner':![],'advice':'Among\x20'+b['completed']+'\x20historical\x20orders,\x20the\x20dispute\x20rate\x20of\x20'+d+'%\x20is\x20high.\x20Recommend\x20requiring\x20the\x20merchant\x20to\x20top\x20up\x20the\x20compensation\x20fund,\x20write\x20terms\x20into\x20the\x20WTS\x20agreement,\x20and\x20strengthen\x20upfront\x20arbitration\x20clauses\x20for\x20this\x20order.'};}export function rightsProtectionStrategy(a,b){const c=[],d=[],e=[],f=a['workflow_analysis']?.['has_refund_path']??![],g=a['workflow_analysis']?.['has_arbitration_path']??![],h=a['trust_signals']?.['arbitration_independent']??!![],i=a['fund_safety']?.['compensation_ratio']??0x0;!f?c['push']('Require\x20the\x20merchant\x20to\x20configure\x20a\x20refund\x20Allocator\x20(100%→Order)'):c['push']('Confirm\x20the\x20refund\x20path\x20is\x20available');if(!g)c['push']('Require\x20the\x20merchant\x20to\x20bind\x20a\x20third-party\x20arbitration\x20service');else!h?c['push']('Require\x20the\x20merchant\x20to\x20switch\x20to\x20third-party\x20arbitration\x20(currently\x20self-built\x20arbitration)'):c['push']('Confirm\x20the\x20arbitration\x20path\x20is\x20available');i<0x1?c['push']('Require\x20the\x20merchant\x20to\x20top\x20up\x20the\x20compensation\x20fund\x20to\x20100%\x20of\x20the\x20order\x20amount\x20(currently\x20covers\x20'+Math['round'](i*0x64)+'%)'):c['push']('Confirm\x20the\x20compensation\x20fund\x20is\x20sufficient');b?.['require_arbitration']&&!g&&c['push']('User\x20preference\x20requires\x20mandatory\x20arbitration');b?.['require_compensation_fund']&&i<0x1&&c['push']('User\x20preference\x20requires\x20a\x20mandatory\x20compensation\x20fund');d['push']('Price\x20(negotiate\x20based\x20on\x20market\x20average)'),d['push']('Delivery\x20time\x20(agree\x20in\x20writing\x20via\x20Messenger)'),d['push']('Reward\x20or\x20discount\x20(based\x20on\x20puzzle.market_context)');b&&(b['bargain_hunting']>0.5&&d['push']('Additional\x20discount\x20(user\x20has\x20a\x20strong\x20bargain-hunting\x20tendency)'),b['reward_seeking']&&d['push']('Reward\x20incentive\x20terms'),b['delivery_speed_priority']==='urgent'&&d['push']('Expedited\x20delivery\x20commitment'));!g&&!f&&e['push']('No\x20arbitration\x20and\x20no\x20refund\x20path:\x20the\x20merchant\x20can\x20breach\x20at\x20will,\x20funds\x20are\x20unprotected;\x20recommend\x20not\x20purchasing');i<0.5&&e['push']('Compensation\x20fund\x20coverage\x20is\x20only\x20'+Math['round'](i*0x64)+'%\x20(<50%):\x20payout\x20is\x20severely\x20insufficient\x20if\x20the\x20order\x20fails;\x20recommend\x20not\x20purchasing');if(b){const j=a['trust_signals']?.['trust_score']??0x64;j<b['min_trust_score']&&e['push']('Composite\x20trust\x20score\x20'+j+'\x20is\x20below\x20the\x20user\x27s\x20minimum\x20requirement\x20of\x20'+b['min_trust_score']);}return{'required_rights':c,'negotiable_rights':d,'red_lines':e};}function clampConfidence(a){if(a<0x0)return 0x0;if(a>0x1)return 0x1;return a;}function applyPrefsToFallback(a,b,c){if(!c)return b;if(c['risk_appetite']==='conservative'){if(a==='arbitration_fairness'||a==='fund_safety')return'Abandon\x20purchase\x20(conservative\x20user)';}if(c['risk_appetite']==='aggressive'){if(a==='pricing')return'Accept\x20current\x20price\x20but\x20request\x20additional\x20Reward\x20or\x20discount';}return b;}export{CUSTOMER_INTELLIGENCE_VERSION};
|