@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
package/dist/tools/retry.js
CHANGED
|
@@ -1,85 +1 @@
|
|
|
1
|
-
export const DEFAULT_FAUCET_RETRY_CONFIG = {
|
|
2
|
-
maxRetries: 5,
|
|
3
|
-
intervalMs: 3000,
|
|
4
|
-
};
|
|
5
|
-
export function loadFaucetRetryConfig() {
|
|
6
|
-
const maxRetries = Number(process.env.WOWOK_FAUCET_RETRY_COUNT);
|
|
7
|
-
const intervalMs = Number(process.env.WOWOK_FAUCET_RETRY_INTERVAL_MS);
|
|
8
|
-
return {
|
|
9
|
-
maxRetries: Number.isFinite(maxRetries) && maxRetries > 0
|
|
10
|
-
? Math.floor(maxRetries)
|
|
11
|
-
: DEFAULT_FAUCET_RETRY_CONFIG.maxRetries,
|
|
12
|
-
intervalMs: Number.isFinite(intervalMs) && intervalMs > 0
|
|
13
|
-
? Math.floor(intervalMs)
|
|
14
|
-
: DEFAULT_FAUCET_RETRY_CONFIG.intervalMs,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export function isFaucetRateLimitError(error) {
|
|
18
|
-
if (!error)
|
|
19
|
-
return false;
|
|
20
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
21
|
-
const lower = msg.toLowerCase();
|
|
22
|
-
if (lower.includes("429"))
|
|
23
|
-
return true;
|
|
24
|
-
if (lower.includes("rate limit"))
|
|
25
|
-
return true;
|
|
26
|
-
if (lower.includes("rate-limit"))
|
|
27
|
-
return true;
|
|
28
|
-
if (lower.includes("too many requests"))
|
|
29
|
-
return true;
|
|
30
|
-
if (lower.includes("try again in"))
|
|
31
|
-
return true;
|
|
32
|
-
if (lower.includes("throttle"))
|
|
33
|
-
return true;
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
function isFaucetOperation(input) {
|
|
37
|
-
if (typeof input !== "object" || input === null)
|
|
38
|
-
return false;
|
|
39
|
-
const obj = input;
|
|
40
|
-
return obj.faucet !== undefined && obj.faucet !== null;
|
|
41
|
-
}
|
|
42
|
-
export function withFaucetRetry(fn, config = loadFaucetRetryConfig()) {
|
|
43
|
-
return async (input) => {
|
|
44
|
-
if (!isFaucetOperation(input)) {
|
|
45
|
-
return fn(input);
|
|
46
|
-
}
|
|
47
|
-
let lastError;
|
|
48
|
-
for (let attempt = 1; attempt <= config.maxRetries; attempt++) {
|
|
49
|
-
try {
|
|
50
|
-
const result = await fn(input);
|
|
51
|
-
if (result && typeof result === "object" && !Array.isArray(result)) {
|
|
52
|
-
const obj = result;
|
|
53
|
-
if (obj.faucet_retry_count === undefined && attempt > 1) {
|
|
54
|
-
obj.faucet_retry_count = attempt;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
lastError = error;
|
|
61
|
-
if (!isFaucetRateLimitError(error)) {
|
|
62
|
-
throw error;
|
|
63
|
-
}
|
|
64
|
-
if (attempt === config.maxRetries) {
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
await new Promise((resolve) => setTimeout(resolve, config.intervalMs));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
const lastMsg = lastError instanceof Error ? lastError.message : String(lastError);
|
|
71
|
-
const err = new Error(`Faucet request failed after ${config.maxRetries} attempts ` +
|
|
72
|
-
`(interval ${config.intervalMs}ms). Last error: ${lastMsg}. ` +
|
|
73
|
-
`The faucet endpoint is currently rate-limiting this account. ` +
|
|
74
|
-
`Suggestions:\n` +
|
|
75
|
-
` 1. Wait a few minutes and try again.\n` +
|
|
76
|
-
` 2. Use a different faucet network if available.\n` +
|
|
77
|
-
` 3. Override retry config via env vars: ` +
|
|
78
|
-
`WOWOK_FAUCET_RETRY_COUNT (default 5), ` +
|
|
79
|
-
`WOWOK_FAUCET_RETRY_INTERVAL_MS (default 3000).`);
|
|
80
|
-
if (lastError instanceof Error && lastError.code) {
|
|
81
|
-
err.code = lastError.code;
|
|
82
|
-
}
|
|
83
|
-
throw err;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
1
|
+
export const DEFAULT_FAUCET_RETRY_CONFIG={'maxRetries':0x5,'intervalMs':0xbb8};export function loadFaucetRetryConfig(){const a=Number(process['env']['WOWOK_FAUCET_RETRY_COUNT']),b=Number(process['env']['WOWOK_FAUCET_RETRY_INTERVAL_MS']);return{'maxRetries':Number['isFinite'](a)&&a>0x0?Math['floor'](a):DEFAULT_FAUCET_RETRY_CONFIG['maxRetries'],'intervalMs':Number['isFinite'](b)&&b>0x0?Math['floor'](b):DEFAULT_FAUCET_RETRY_CONFIG['intervalMs']};}export function isFaucetRateLimitError(a){if(!a)return![];const b=a instanceof Error?a['message']:String(a),c=b['toLowerCase']();if(c['includes']('429'))return!![];if(c['includes']('rate\x20limit'))return!![];if(c['includes']('rate-limit'))return!![];if(c['includes']('too\x20many\x20requests'))return!![];if(c['includes']('try\x20again\x20in'))return!![];if(c['includes']('throttle'))return!![];return![];}function isFaucetOperation(a){if(typeof a!=='object'||a===null)return![];const b=a;return b['faucet']!==undefined&&b['faucet']!==null;}export function withFaucetRetry(a,b=loadFaucetRetryConfig()){return async c=>{if(!isFaucetOperation(c))return a(c);let d;for(let g=0x1;g<=b['maxRetries'];g++){try{const h=await a(c);if(h&&typeof h==='object'&&!Array['isArray'](h)){const i=h;i['faucet_retry_count']===undefined&&g>0x1&&(i['faucet_retry_count']=g);}return h;}catch(j){d=j;if(!isFaucetRateLimitError(j))throw j;if(g===b['maxRetries'])break;await new Promise(k=>setTimeout(k,b['intervalMs']));}}const e=d instanceof Error?d['message']:String(d),f=new Error('Faucet\x20request\x20failed\x20after\x20'+b['maxRetries']+'\x20attempts\x20'+('(interval\x20'+b['intervalMs']+'ms).\x20Last\x20error:\x20'+e+'.\x20')+'The\x20faucet\x20endpoint\x20is\x20currently\x20rate-limiting\x20this\x20account.\x20'+'Suggestions:\x0a'+'\x20\x201.\x20Wait\x20a\x20few\x20minutes\x20and\x20try\x20again.\x0a'+'\x20\x202.\x20Use\x20a\x20different\x20faucet\x20network\x20if\x20available.\x0a'+'\x20\x203.\x20Override\x20retry\x20config\x20via\x20env\x20vars:\x20'+'WOWOK_FAUCET_RETRY_COUNT\x20(default\x205),\x20'+'WOWOK_FAUCET_RETRY_INTERVAL_MS\x20(default\x203000).');d instanceof Error&&d['code']&&(f['code']=d['code']);throw f;};}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToolDispatchResult } from "./types.js";
|
|
2
|
-
export declare function applyOnchainRules(args: unknown): ToolDispatchResult | null
|
|
2
|
+
export declare function applyOnchainRules(args: unknown): Promise<ToolDispatchResult | null>;
|
package/dist/tools/rules-hook.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { buildPendingConfirmation, buildConstraintError } from "./shared.js";
|
|
3
|
-
import { validateOperation, hasBlockingViolations, } from "../knowledge/index.js";
|
|
4
|
-
export function applyOnchainRules(args) {
|
|
5
|
-
let validated;
|
|
6
|
-
try {
|
|
7
|
-
validated = strictParse(OnchainOperationsSchema, args, "onchain_operations input");
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
const env = getEnvConfig(validated.env);
|
|
13
|
-
const data = 'data' in validated ? validated.data : undefined;
|
|
14
|
-
const gateResult = buildPendingConfirmation(validated.operation_type, data, env);
|
|
15
|
-
if (gateResult.structuredContent) {
|
|
16
|
-
return gateResult;
|
|
17
|
-
}
|
|
18
|
-
const constraintViolations = validateOperation(validated.operation_type, data);
|
|
19
|
-
if (hasBlockingViolations(constraintViolations)) {
|
|
20
|
-
return buildConstraintError(validated.operation_type, constraintViolations);
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
1
|
+
import{OnchainOperationsSchema,strictParse,getEnvConfig}from'../schema/index.js';import{buildPendingConfirmation,buildConstraintError}from'./shared.js';import{validateOperation,hasBlockingViolations}from'../knowledge/index.js';import{resolveEffectiveOverrides}from'../persona/index.js';export async function applyOnchainRules(a){let b;try{b=strictParse(OnchainOperationsSchema,a,'onchain_operations\x20input');}catch{return null;}const c=getEnvConfig(b['env']),d=await resolveEffectiveOverrides(c?.['account']),e='data'in b?b['data']:undefined,f=buildPendingConfirmation(b['operation_type'],e,c,d);if(f['structuredContent'])return f;const g=validateOperation(b['operation_type'],e);if(hasBlockingViolations(g))return buildConstraintError(b['operation_type'],g);return null;}
|
package/dist/tools/shared.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface LocalHandlerConfig<S extends z.ZodTypeAny> {
|
|
|
11
11
|
buildContext: (validated: z.infer<S>) => SemanticContext;
|
|
12
12
|
}
|
|
13
13
|
export declare function wrapLocalHandler<S extends z.ZodTypeAny>(config: LocalHandlerConfig<S>): (args: unknown) => Promise<ToolDispatchResult>;
|
|
14
|
-
export declare function buildPendingConfirmation(operation_type: string, data: unknown, env: CallEnv | undefined): ToolDispatchResult | {
|
|
14
|
+
export declare function buildPendingConfirmation(operation_type: string, data: unknown, env: CallEnv | undefined, overrides?: Record<string, string>): ToolDispatchResult | {
|
|
15
15
|
content: never[];
|
|
16
16
|
structuredContent: null;
|
|
17
17
|
};
|
package/dist/tools/shared.js
CHANGED
|
@@ -1,130 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { renderPreview } from "../safety/preview.js";
|
|
3
|
-
import { validateOperation, hasBlockingViolations, getWarningViolations, } from "../knowledge/index.js";
|
|
4
|
-
import { getHarness } from "../harness/index.js";
|
|
5
|
-
import { isEnabled as isRuntimeEnabled } from "../config/index.js";
|
|
6
|
-
import { classifyError, buildDataSemantic, } from "../schema/call/semantic.js";
|
|
7
|
-
import { strictParse } from "../schema/index.js";
|
|
8
|
-
export function withHarness(base, operation, intent) {
|
|
9
|
-
if (!isRuntimeEnabled("harness"))
|
|
10
|
-
return base;
|
|
11
|
-
try {
|
|
12
|
-
const harness = getHarness();
|
|
13
|
-
const expected = harness.expect(operation, intent, base.operation_type, base.data);
|
|
14
|
-
return {
|
|
15
|
-
...base,
|
|
16
|
-
harness,
|
|
17
|
-
expected,
|
|
18
|
-
operation_id: `${base.operation_type}_${Date.now()}`,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return base;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export function wrapLocalHandler(config) {
|
|
26
|
-
const { schema, operationFn, parseLabel, buildContext } = config;
|
|
27
|
-
return async (args) => {
|
|
28
|
-
let validated;
|
|
29
|
-
try {
|
|
30
|
-
validated = strictParse(schema, args, parseLabel);
|
|
31
|
-
const result = await operationFn(validated);
|
|
32
|
-
const ctx = buildContext(validated);
|
|
33
|
-
return {
|
|
34
|
-
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
35
|
-
structuredContent: {
|
|
36
|
-
result: {
|
|
37
|
-
status: "success",
|
|
38
|
-
data: result,
|
|
39
|
-
},
|
|
40
|
-
semantic: buildDataSemantic(result, ctx),
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
46
|
-
const ctx = validated ? buildContext(validated) : undefined;
|
|
47
|
-
const classified = classifyError(errorMessage);
|
|
48
|
-
const errorResult = {
|
|
49
|
-
status: "error",
|
|
50
|
-
error: errorMessage,
|
|
51
|
-
};
|
|
52
|
-
if (classified.error_code !== undefined)
|
|
53
|
-
errorResult.error_code = classified.error_code;
|
|
54
|
-
if (classified.retryable !== undefined)
|
|
55
|
-
errorResult.retryable = classified.retryable;
|
|
56
|
-
if (classified.recovery_hint !== undefined)
|
|
57
|
-
errorResult.recovery_hint = classified.recovery_hint;
|
|
58
|
-
return {
|
|
59
|
-
content: [{ type: "text", text: `Error: ${errorMessage}` }],
|
|
60
|
-
structuredContent: {
|
|
61
|
-
result: errorResult,
|
|
62
|
-
semantic: buildDataSemantic(undefined, ctx, true, errorMessage),
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
export function buildPendingConfirmation(operation_type, data, env) {
|
|
69
|
-
const gate = confirmGate(operation_type, data, env, env?.user_intent_phrases);
|
|
70
|
-
if (gate.pass)
|
|
71
|
-
return { content: [], structuredContent: null };
|
|
72
|
-
const preview = gate.preview;
|
|
73
|
-
const rendered = renderPreview(preview);
|
|
74
|
-
const output = {
|
|
75
|
-
message: rendered,
|
|
76
|
-
result: {
|
|
77
|
-
type: "pending_confirmation",
|
|
78
|
-
preview,
|
|
79
|
-
rule_id: gate.rule_id,
|
|
80
|
-
},
|
|
81
|
-
semantic: {
|
|
82
|
-
intent: `${operation_type}_awaiting_confirmation`,
|
|
83
|
-
status: "pending_input",
|
|
84
|
-
summary: `Operation blocked by ConfirmGate (${gate.level}). Review the preview and re-call with env.confirmed=true to proceed.`,
|
|
85
|
-
next_actions: [
|
|
86
|
-
{
|
|
87
|
-
action: "confirm: re-call the SAME operation with env.confirmed=true",
|
|
88
|
-
reason: `ConfirmGate rule '${gate.rule_id}' matched. The operation was NOT executed.`,
|
|
89
|
-
tool: "onchain_operations",
|
|
90
|
-
priority: "required",
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
warnings: preview.warnings ?? [],
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
return {
|
|
97
|
-
content: [{ type: "text", text: rendered }],
|
|
98
|
-
structuredContent: output,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export function buildConstraintError(operation_type, violations) {
|
|
102
|
-
const errors = violations.filter((v) => v.severity === "error");
|
|
103
|
-
const errorList = errors.map((v) => ` • [${v.field}] ${v.message}`).join("\n");
|
|
104
|
-
const message = `Pre-call constraint violations for '${operation_type}':\n${errorList}\n\nFix the listed field(s) and retry.`;
|
|
105
|
-
const output = {
|
|
106
|
-
message,
|
|
107
|
-
result: {
|
|
108
|
-
type: "error",
|
|
109
|
-
error: message,
|
|
110
|
-
error_code: "invalid_parameter",
|
|
111
|
-
retryable: false,
|
|
112
|
-
recovery_hint: "Review the constraint violations above and correct the corresponding fields.",
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
return {
|
|
116
|
-
content: [{ type: "text", text: message }],
|
|
117
|
-
structuredContent: output,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
export function buildClassifiedErrorResult(base, error, classified) {
|
|
121
|
-
const result = { ...base, error };
|
|
122
|
-
if (classified.error_code !== undefined)
|
|
123
|
-
result.error_code = classified.error_code;
|
|
124
|
-
if (classified.retryable !== undefined)
|
|
125
|
-
result.retryable = classified.retryable;
|
|
126
|
-
if (classified.recovery_hint !== undefined)
|
|
127
|
-
result.recovery_hint = classified.recovery_hint;
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
130
|
-
export { validateOperation, hasBlockingViolations, getWarningViolations, };
|
|
1
|
+
import{confirmGate}from'../safety/confirm-gate.js';import{renderPreview}from'../safety/preview.js';import{validateOperation,hasBlockingViolations,getWarningViolations}from'../knowledge/index.js';import{getHarness}from'../harness/index.js';import{isEnabled as a370a}from'../config/index.js';import{classifyError,buildDataSemantic}from'../schema/call/semantic.js';import{strictParse}from'../schema/index.js';export function withHarness(a,b,c){if(!a370a('harness'))return a;try{const d=getHarness(),e=d['expect'](b,c,a['operation_type'],a['data']);return{...a,'harness':d,'expected':e,'operation_id':a['operation_type']+'_'+Date['now']()};}catch{return a;}}export function wrapLocalHandler(a){const {schema:b,operationFn:c,parseLabel:d,buildContext:e}=a;return async f=>{let g;try{g=strictParse(b,f,d);const h=await c(g),i=e(g);return{'content':[{'type':'text','text':JSON['stringify'](h)}],'structuredContent':{'result':{'status':'success','data':h},'semantic':buildDataSemantic(h,i)}};}catch(j){const k=j instanceof Error?j['message']:String(j),l=g?e(g):undefined,m=classifyError(k),n={'status':'error','error':k};if(m['error_code']!==undefined)n['error_code']=m['error_code'];if(m['retryable']!==undefined)n['retryable']=m['retryable'];if(m['recovery_hint']!==undefined)n['recovery_hint']=m['recovery_hint'];return{'content':[{'type':'text','text':'Error:\x20'+k}],'structuredContent':{'result':n,'semantic':buildDataSemantic(undefined,l,!![],k)}};}};}export function buildPendingConfirmation(a,b,c,d){const e=confirmGate(a,b,c,c?.['user_intent_phrases'],d);if(e['pass'])return{'content':[],'structuredContent':null};const f=e['preview'],g=renderPreview(f),h={'message':g,'result':{'type':'pending_confirmation','preview':f,'rule_id':e['rule_id']},'semantic':{'intent':a+'_awaiting_confirmation','status':'pending_input','summary':'Operation\x20blocked\x20by\x20ConfirmGate\x20('+e['level']+').\x20Review\x20the\x20preview\x20and\x20re-call\x20with\x20env.confirmed=true\x20to\x20proceed.','next_actions':[{'action':'confirm:\x20re-call\x20the\x20SAME\x20operation\x20with\x20env.confirmed=true','reason':'ConfirmGate\x20rule\x20\x27'+e['rule_id']+'\x27\x20matched.\x20The\x20operation\x20was\x20NOT\x20executed.','tool':'onchain_operations','priority':'required'}],'warnings':f['warnings']??[]}};return{'content':[{'type':'text','text':g}],'structuredContent':h};}export function buildConstraintError(a,b){const c=b['filter'](g=>g['severity']==='error'),d=c['map'](g=>'\x20\x20•\x20['+g['field']+']\x20'+g['message'])['join']('\x0a'),e='Pre-call\x20constraint\x20violations\x20for\x20\x27'+a+'\x27:\x0a'+d+'\x0a\x0aFix\x20the\x20listed\x20field(s)\x20and\x20retry.',f={'message':e,'result':{'type':'error','error':e,'error_code':'invalid_parameter','retryable':![],'recovery_hint':'Review\x20the\x20constraint\x20violations\x20above\x20and\x20correct\x20the\x20corresponding\x20fields.'}};return{'content':[{'type':'text','text':e}],'structuredContent':f};}export function buildClassifiedErrorResult(a,b,c){const d={...a,'error':b};if(c['error_code']!==undefined)d['error_code']=c['error_code'];if(c['retryable']!==undefined)d['retryable']=c['retryable'];if(c['recovery_hint']!==undefined)d['recovery_hint']=c['recovery_hint'];return d;}export{validateOperation,hasBlockingViolations,getWarningViolations};
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { SemanticContext } from "../schema/call/semantic.js";
|
|
|
4
4
|
export interface ToolConfig {
|
|
5
5
|
title: string;
|
|
6
6
|
description: string;
|
|
7
|
+
summary: string;
|
|
7
8
|
inputSchema: z.ZodTypeAny;
|
|
8
9
|
outputSchema?: z.ZodTypeAny;
|
|
9
10
|
annotations?: {
|
|
@@ -28,7 +29,7 @@ export interface ToolEntry {
|
|
|
28
29
|
config: ToolConfig;
|
|
29
30
|
errorShapeBuilder?: ErrorShapeBuilder;
|
|
30
31
|
timeoutMs?: number;
|
|
31
|
-
applyRules?: (args: unknown) => ToolDispatchResult | null;
|
|
32
|
+
applyRules?: (args: unknown) => Promise<ToolDispatchResult | null> | ToolDispatchResult | null;
|
|
32
33
|
}
|
|
33
34
|
export interface DispatchOptions {
|
|
34
35
|
skipRules?: boolean;
|
package/dist/tools/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UpgradeCheckComponent {
|
|
2
|
+
current: string | null;
|
|
3
|
+
latest: string | null;
|
|
4
|
+
outdated: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface UpgradeCheckResult {
|
|
7
|
+
mcp: UpgradeCheckComponent;
|
|
8
|
+
sdk: UpgradeCheckComponent;
|
|
9
|
+
client_installed: boolean;
|
|
10
|
+
client_install_hint: string | null;
|
|
11
|
+
upgrade_available: boolean;
|
|
12
|
+
reminder: {
|
|
13
|
+
type: "upgrade" | "install_client" | "none";
|
|
14
|
+
due: boolean;
|
|
15
|
+
message: string | null;
|
|
16
|
+
};
|
|
17
|
+
checked_at: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function checkUpgrade(): Promise<UpgradeCheckResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readFileSync,existsSync,writeFileSync,mkdirSync}from'fs';import{join,dirname}from'path';import{fileURLToPath}from'url';import{getWowMcpDir}from'@wowok/wowok';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_PACKAGE='@wowok/agent-mcp',SDK_PACKAGE='@wowok/wowok',WEEK_MS=0x7*0x18*0x3c*0x3c*0x3e8,REMINDER_FILE=join(getWowMcpDir(),'upgrade-reminder.json');function readMcpVersion(){try{const a=join(__dirname,'..','..','package.json'),b=JSON['parse'](readFileSync(a,'utf-8'));return b['version']??null;}catch{return null;}}function readSdkVersion(){try{const a=fileURLToPath(import.meta.resolve(SDK_PACKAGE));let b=dirname(a);for(let c=0x0;c<0x6;c++){const d=join(b,'package.json');if(existsSync(d)){const e=JSON['parse'](readFileSync(d,'utf-8'));if(e['name']===SDK_PACKAGE)return e['version']??null;}b=dirname(b);}return null;}catch{return null;}}async function fetchNpmLatest(a){const b='https://registry.npmjs.org/'+encodeURIComponent(a)+'/latest',c=new AbortController(),d=setTimeout(()=>c['abort'](),0x1770);try{const e=await fetch(b,{'signal':c['signal']});if(!e['ok'])return null;const f=await e['json']();return f['version']??null;}catch{return null;}finally{clearTimeout(d);}}function compareVersions(c,e){const f=c['split']('.')['map'](h=>parseInt(h,0xa)||0x0),g=e['split']('.')['map'](h=>parseInt(h,0xa)||0x0);for(let h=0x0;h<Math['max'](f['length'],g['length']);h++){const j=(f[h]||0x0)-(g[h]||0x0);if(j!==0x0)return j;}return 0x0;}function detectClientInstall(){const a=[];if(process['platform']==='win32'){const b=process['env']['LOCALAPPDATA'];b&&(a['push'](join(b,'WoWok','WoWok.exe')),a['push'](join(b,'Programs','WoWok','WoWok.exe')));}else{if(process['platform']==='darwin')a['push']('/Applications/WoWok.app');else{const d=process['env']['HOME']||process['env']['USERPROFILE']||'';d&&(a['push'](join(d,'.local','share','applications','wowok.desktop')),a['push'](join(d,'Applications','WoWok.AppImage')),a['push'](join(d,'.local','bin','wowok')));}}for(const e of a){if(e&&existsSync(e))return{'installed':!![],'hint':null};}return{'installed':![],'hint':'https://download.wowok.net'};}function readReminderState(){try{const a=readFileSync(REMINDER_FILE,'utf-8'),b=JSON['parse'](a);return{'lastInstallClientReminderAt':Number(b['lastInstallClientReminderAt'])||0x0};}catch{return{'lastInstallClientReminderAt':0x0};}}function writeReminderState(a){try{mkdirSync(dirname(REMINDER_FILE),{'recursive':!![]}),writeFileSync(REMINDER_FILE,JSON['stringify'](a),'utf-8');}catch{}}export async function checkUpgrade(){const a=readMcpVersion(),b=readSdkVersion(),[c,d]=await Promise['all']([fetchNpmLatest(MCP_PACKAGE),fetchNpmLatest(SDK_PACKAGE)]),e=detectClientInstall(),f=readReminderState(),g=Date['now'](),h=!!(a&&c&&compareVersions(c,a)>0x0),i=!!(b&&d&&compareVersions(d,b)>0x0),j=h||i;let k='none',l=![],m=null;if(j){k='upgrade',l=!![];const n=c??d??'',o=a??'';m='A\x20newer\x20WoWok\x20version\x20is\x20available\x20(current\x20v'+o+'\x20→\x20latest\x20v'+n+').\x20'+('Upgrade\x20for\x20more\x20features\x20and\x20improvements.\x20Run:\x20npm\x20install\x20-g\x20'+MCP_PACKAGE+'@latest');}else!e['installed']&&g-f['lastInstallClientReminderAt']>=WEEK_MS&&(k='install_client',l=!![],m='The\x20WoWok\x20desktop\x20client\x20is\x20not\x20installed\x20yet.\x20It\x20provides\x20wallet\x20management,\x20encrypted\x20Messenger,\x20project\x20management\x20and\x20more.\x20'+'Download\x20it\x20at\x20https://download.wowok.net\x20to\x20get\x20started.',f['lastInstallClientReminderAt']=g,writeReminderState(f));return{'mcp':{'current':a,'latest':c,'outdated':h},'sdk':{'current':b,'latest':d,'outdated':i},'client_installed':e['installed'],'client_install_hint':e['hint'],'upgrade_available':j,'reminder':{'type':k,'due':l,'message':m},'checked_at':new Date()['toISOString']()};}
|