@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/project/graph.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ProjectObjectType } from "./namespace.js";
|
|
2
|
+
import type { GraphEdgeBase, GraphNodeBase } from "../graph/base.js";
|
|
2
3
|
export type EdgeKind = "machine" | "order_allocators" | "arbitrations" | "compensation_fund" | "rewards" | "buy_guard" | "permission" | "guard" | "prev" | "next" | "forward" | "parent" | "service" | "progress" | "arbitration" | "sub_order" | "references";
|
|
3
|
-
export interface GraphNode {
|
|
4
|
-
id: string;
|
|
4
|
+
export interface GraphNode extends GraphNodeBase {
|
|
5
5
|
project?: string;
|
|
6
6
|
projects?: string[];
|
|
7
7
|
type?: ProjectObjectType;
|
|
8
|
-
address?: string;
|
|
9
8
|
isTemplate?: boolean;
|
|
10
9
|
decision_contexts?: GraphDecisionContext[];
|
|
11
10
|
}
|
|
@@ -19,9 +18,7 @@ export interface GraphDecisionContext {
|
|
|
19
18
|
rationale?: string;
|
|
20
19
|
outcome?: "success" | "failed" | "pending";
|
|
21
20
|
}
|
|
22
|
-
export interface GraphEdge {
|
|
23
|
-
from: string;
|
|
24
|
-
to: string;
|
|
21
|
+
export interface GraphEdge extends GraphEdgeBase {
|
|
25
22
|
kind: EdgeKind;
|
|
26
23
|
}
|
|
27
24
|
export interface GraphSnapshot {
|
package/dist/project/graph.js
CHANGED
|
@@ -1,340 +1 @@
|
|
|
1
|
-
function matchesProjectFilter(
|
|
2
|
-
if (nodeProject === filter)
|
|
3
|
-
return true;
|
|
4
|
-
if (!filter.includes("_v")) {
|
|
5
|
-
const m = nodeProject.match(/^(.+)_v\d+$/);
|
|
6
|
-
if (m && m[1] === filter)
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
export class ProjectGraph {
|
|
12
|
-
nodes = new Map();
|
|
13
|
-
edges = [];
|
|
14
|
-
outEdges = new Map();
|
|
15
|
-
inEdges = new Map();
|
|
16
|
-
cycles = [];
|
|
17
|
-
updatedAt = Date.now();
|
|
18
|
-
upsertNode(node) {
|
|
19
|
-
const existing = this.nodes.get(node.id);
|
|
20
|
-
if (existing) {
|
|
21
|
-
const mergedProjects = new Set([
|
|
22
|
-
...(existing.projects ?? []),
|
|
23
|
-
...(node.projects ?? []),
|
|
24
|
-
]);
|
|
25
|
-
this.nodes.set(node.id, {
|
|
26
|
-
...existing,
|
|
27
|
-
...node,
|
|
28
|
-
project: node.project ?? existing.project,
|
|
29
|
-
type: node.type ?? existing.type,
|
|
30
|
-
address: node.address ?? existing.address,
|
|
31
|
-
projects: mergedProjects.size > 0 ? Array.from(mergedProjects) : (existing.projects ?? node.projects),
|
|
32
|
-
});
|
|
33
|
-
return this.nodes.get(node.id);
|
|
34
|
-
}
|
|
35
|
-
this.nodes.set(node.id, { ...node });
|
|
36
|
-
return node;
|
|
37
|
-
}
|
|
38
|
-
addEdge(from, to, kind) {
|
|
39
|
-
if (from === to)
|
|
40
|
-
return;
|
|
41
|
-
if (!this.nodes.has(from))
|
|
42
|
-
this.upsertNode({ id: from });
|
|
43
|
-
if (!this.nodes.has(to))
|
|
44
|
-
this.upsertNode({ id: to });
|
|
45
|
-
const dup = this.edges.some((e) => e.from === from && e.to === to && e.kind === kind);
|
|
46
|
-
if (dup)
|
|
47
|
-
return;
|
|
48
|
-
const idx = this.edges.length;
|
|
49
|
-
this.edges.push({ from, to, kind });
|
|
50
|
-
if (!this.outEdges.has(from))
|
|
51
|
-
this.outEdges.set(from, new Set());
|
|
52
|
-
this.outEdges.get(from).add(idx);
|
|
53
|
-
if (!this.inEdges.has(to))
|
|
54
|
-
this.inEdges.set(to, new Set());
|
|
55
|
-
this.inEdges.get(to).add(idx);
|
|
56
|
-
this.updatedAt = Date.now();
|
|
57
|
-
}
|
|
58
|
-
removeNode(id) {
|
|
59
|
-
if (!this.nodes.has(id))
|
|
60
|
-
return;
|
|
61
|
-
this.nodes.delete(id);
|
|
62
|
-
const outSet = this.outEdges.get(id);
|
|
63
|
-
const inSet = this.inEdges.get(id);
|
|
64
|
-
const indicesToRemove = new Set([
|
|
65
|
-
...(outSet ?? []),
|
|
66
|
-
...(inSet ?? []),
|
|
67
|
-
]);
|
|
68
|
-
const newEdges = [];
|
|
69
|
-
const indexMap = new Map();
|
|
70
|
-
for (let i = 0; i < this.edges.length; i++) {
|
|
71
|
-
if (indicesToRemove.has(i))
|
|
72
|
-
continue;
|
|
73
|
-
indexMap.set(i, newEdges.length);
|
|
74
|
-
newEdges.push(this.edges[i]);
|
|
75
|
-
}
|
|
76
|
-
this.edges = newEdges;
|
|
77
|
-
this.outEdges.clear();
|
|
78
|
-
this.inEdges.clear();
|
|
79
|
-
for (let i = 0; i < this.edges.length; i++) {
|
|
80
|
-
const e = this.edges[i];
|
|
81
|
-
if (!this.outEdges.has(e.from))
|
|
82
|
-
this.outEdges.set(e.from, new Set());
|
|
83
|
-
this.outEdges.get(e.from).add(i);
|
|
84
|
-
if (!this.inEdges.has(e.to))
|
|
85
|
-
this.inEdges.set(e.to, new Set());
|
|
86
|
-
this.inEdges.get(e.to).add(i);
|
|
87
|
-
}
|
|
88
|
-
this.updatedAt = Date.now();
|
|
89
|
-
}
|
|
90
|
-
getNode(id) {
|
|
91
|
-
return this.nodes.get(id);
|
|
92
|
-
}
|
|
93
|
-
listNodes(projectPrefix) {
|
|
94
|
-
const all = Array.from(this.nodes.values());
|
|
95
|
-
if (!projectPrefix)
|
|
96
|
-
return all;
|
|
97
|
-
return all.filter((n) => {
|
|
98
|
-
if (n.projects && n.projects.length > 0) {
|
|
99
|
-
return n.projects.some((p) => matchesProjectFilter(p, projectPrefix));
|
|
100
|
-
}
|
|
101
|
-
if (!n.project)
|
|
102
|
-
return false;
|
|
103
|
-
if (n.project === projectPrefix)
|
|
104
|
-
return true;
|
|
105
|
-
if (projectPrefix.startsWith(n.project + "_v"))
|
|
106
|
-
return true;
|
|
107
|
-
return false;
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
getDependencies(id) {
|
|
111
|
-
const idxs = this.outEdges.get(id);
|
|
112
|
-
if (!idxs)
|
|
113
|
-
return [];
|
|
114
|
-
return Array.from(idxs).map((i) => this.edges[i]);
|
|
115
|
-
}
|
|
116
|
-
getReferencedBy(id) {
|
|
117
|
-
const idxs = this.inEdges.get(id);
|
|
118
|
-
if (!idxs)
|
|
119
|
-
return [];
|
|
120
|
-
return Array.from(idxs).map((i) => this.edges[i]);
|
|
121
|
-
}
|
|
122
|
-
detectCycles() {
|
|
123
|
-
const WHITE = 0, GRAY = 1, BLACK = 2;
|
|
124
|
-
const color = new Map();
|
|
125
|
-
for (const id of this.nodes.keys())
|
|
126
|
-
color.set(id, WHITE);
|
|
127
|
-
const cycles = [];
|
|
128
|
-
const stack = [];
|
|
129
|
-
const dfs = (u) => {
|
|
130
|
-
color.set(u, GRAY);
|
|
131
|
-
stack.push(u);
|
|
132
|
-
const outIdxs = this.outEdges.get(u);
|
|
133
|
-
if (outIdxs) {
|
|
134
|
-
for (const i of outIdxs) {
|
|
135
|
-
const v = this.edges[i].to;
|
|
136
|
-
if (color.get(v) === GRAY) {
|
|
137
|
-
const start = stack.indexOf(v);
|
|
138
|
-
if (start >= 0) {
|
|
139
|
-
cycles.push(stack.slice(start).concat(v));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else if (color.get(v) === WHITE) {
|
|
143
|
-
dfs(v);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
stack.pop();
|
|
148
|
-
color.set(u, BLACK);
|
|
149
|
-
};
|
|
150
|
-
for (const id of this.nodes.keys()) {
|
|
151
|
-
if (color.get(id) === WHITE)
|
|
152
|
-
dfs(id);
|
|
153
|
-
}
|
|
154
|
-
this.cycles = cycles;
|
|
155
|
-
return cycles;
|
|
156
|
-
}
|
|
157
|
-
findDanglingDependencies() {
|
|
158
|
-
const result = [];
|
|
159
|
-
for (const [id, node] of this.nodes) {
|
|
160
|
-
const deps = this.getDependencies(id);
|
|
161
|
-
const missing = deps
|
|
162
|
-
.map((e) => this.nodes.get(e.to))
|
|
163
|
-
.filter((n) => !!n)
|
|
164
|
-
.filter((n) => !n.address && !n.project)
|
|
165
|
-
.map((n) => n.id);
|
|
166
|
-
if (missing.length > 0) {
|
|
167
|
-
result.push({ from: id, missing: Array.from(new Set(missing)) });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return result;
|
|
171
|
-
}
|
|
172
|
-
snapshot() {
|
|
173
|
-
return {
|
|
174
|
-
nodes: Object.fromEntries(this.nodes),
|
|
175
|
-
edges: this.edges,
|
|
176
|
-
cycles: this.cycles,
|
|
177
|
-
version: 1,
|
|
178
|
-
updatedAt: this.updatedAt,
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
restore(snap) {
|
|
182
|
-
this.nodes.clear();
|
|
183
|
-
this.edges = [];
|
|
184
|
-
this.outEdges.clear();
|
|
185
|
-
this.inEdges.clear();
|
|
186
|
-
for (const [id, node] of Object.entries(snap.nodes)) {
|
|
187
|
-
this.nodes.set(id, { ...node });
|
|
188
|
-
}
|
|
189
|
-
for (const e of snap.edges) {
|
|
190
|
-
this.addEdge(e.from, e.to, e.kind);
|
|
191
|
-
}
|
|
192
|
-
this.cycles = snap.cycles ?? [];
|
|
193
|
-
this.updatedAt = snap.updatedAt ?? Date.now();
|
|
194
|
-
}
|
|
195
|
-
clear() {
|
|
196
|
-
this.nodes.clear();
|
|
197
|
-
this.edges = [];
|
|
198
|
-
this.outEdges.clear();
|
|
199
|
-
this.inEdges.clear();
|
|
200
|
-
this.cycles = [];
|
|
201
|
-
this.updatedAt = Date.now();
|
|
202
|
-
}
|
|
203
|
-
get nodeCount() { return this.nodes.size; }
|
|
204
|
-
get edgeCount() { return this.edges.length; }
|
|
205
|
-
getEdges() {
|
|
206
|
-
return this.edges;
|
|
207
|
-
}
|
|
208
|
-
attachDecisionContext(nodeId, ctx) {
|
|
209
|
-
if (!nodeId)
|
|
210
|
-
return undefined;
|
|
211
|
-
const node = this.nodes.get(nodeId) ?? this.upsertNode({ id: nodeId });
|
|
212
|
-
const fullCtx = {
|
|
213
|
-
id: ctx.id ?? `${nodeId}_${Date.now()}`,
|
|
214
|
-
decided_at: ctx.decided_at ?? Date.now(),
|
|
215
|
-
decider: ctx.decider,
|
|
216
|
-
industry: ctx.industry,
|
|
217
|
-
intent: ctx.intent,
|
|
218
|
-
alternatives: ctx.alternatives,
|
|
219
|
-
rationale: ctx.rationale,
|
|
220
|
-
outcome: ctx.outcome,
|
|
221
|
-
};
|
|
222
|
-
if (!node.decision_contexts)
|
|
223
|
-
node.decision_contexts = [];
|
|
224
|
-
node.decision_contexts.push(fullCtx);
|
|
225
|
-
this.updatedAt = Date.now();
|
|
226
|
-
return fullCtx;
|
|
227
|
-
}
|
|
228
|
-
getDecisionContexts(nodeId) {
|
|
229
|
-
return this.nodes.get(nodeId)?.decision_contexts ?? [];
|
|
230
|
-
}
|
|
231
|
-
queryDecisionContextsByIndustry(industry) {
|
|
232
|
-
const results = [];
|
|
233
|
-
for (const [id, node] of this.nodes) {
|
|
234
|
-
if (!node.decision_contexts)
|
|
235
|
-
continue;
|
|
236
|
-
for (const ctx of node.decision_contexts) {
|
|
237
|
-
if (ctx.industry === industry) {
|
|
238
|
-
results.push({ node_id: id, ctx });
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
results.sort((a, b) => b.ctx.decided_at - a.ctx.decided_at);
|
|
243
|
-
return results;
|
|
244
|
-
}
|
|
245
|
-
backfillDecisionOutcome(decisionId, outcome) {
|
|
246
|
-
for (const node of this.nodes.values()) {
|
|
247
|
-
if (!node.decision_contexts)
|
|
248
|
-
continue;
|
|
249
|
-
const ctx = node.decision_contexts.find((c) => c.id === decisionId);
|
|
250
|
-
if (ctx) {
|
|
251
|
-
ctx.outcome = outcome;
|
|
252
|
-
this.updatedAt = Date.now();
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
export function extractReferences(operation_type, data) {
|
|
260
|
-
const refs = [];
|
|
261
|
-
if (!data || typeof data !== "object")
|
|
262
|
-
return refs;
|
|
263
|
-
const pushRef = (field, val, kind) => {
|
|
264
|
-
if (!val)
|
|
265
|
-
return;
|
|
266
|
-
if (typeof val === "string") {
|
|
267
|
-
if (val.trim())
|
|
268
|
-
refs.push({ field, target: val.trim(), kind });
|
|
269
|
-
}
|
|
270
|
-
else if (Array.isArray(val)) {
|
|
271
|
-
for (const v of val)
|
|
272
|
-
pushRef(field, v, kind);
|
|
273
|
-
}
|
|
274
|
-
else if (typeof val === "object") {
|
|
275
|
-
const name = val.name_or_address ?? val.name ?? val.address;
|
|
276
|
-
if (typeof name === "string" && name.trim()) {
|
|
277
|
-
refs.push({ field, target: name.trim(), kind });
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
if (operation_type === "service") {
|
|
282
|
-
pushRef("machine", data.machine, "machine");
|
|
283
|
-
pushRef("order_allocators", data.order_allocators, "order_allocators");
|
|
284
|
-
pushRef("arbitrations", data.arbitrations, "arbitrations");
|
|
285
|
-
pushRef("compensation_fund", data.compensation_fund, "compensation_fund");
|
|
286
|
-
pushRef("rewards", data.rewards, "rewards");
|
|
287
|
-
pushRef("buy_guard", data.buy_guard, "buy_guard");
|
|
288
|
-
pushRef("permission", data.permission, "permission");
|
|
289
|
-
}
|
|
290
|
-
if (operation_type === "order") {
|
|
291
|
-
pushRef("service", data.service, "service");
|
|
292
|
-
pushRef("progress", data.progress, "progress");
|
|
293
|
-
pushRef("arbitration", data.arbitration, "arbitration");
|
|
294
|
-
}
|
|
295
|
-
if (operation_type === "machine" && Array.isArray(data.node?.nodes)) {
|
|
296
|
-
for (const n of data.node.nodes) {
|
|
297
|
-
if (!n || typeof n !== "object")
|
|
298
|
-
continue;
|
|
299
|
-
const nodeName = n.name;
|
|
300
|
-
if (typeof nodeName !== "string")
|
|
301
|
-
continue;
|
|
302
|
-
if (Array.isArray(n.pairs)) {
|
|
303
|
-
for (const p of n.pairs) {
|
|
304
|
-
if (p && typeof p === "object") {
|
|
305
|
-
if (typeof p.prev === "string") {
|
|
306
|
-
refs.push({ field: `node.${nodeName}.prev`, target: p.prev, kind: "prev" });
|
|
307
|
-
}
|
|
308
|
-
if (typeof p.next === "string") {
|
|
309
|
-
refs.push({ field: `node.${nodeName}.next`, target: p.next, kind: "next" });
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
if (Array.isArray(n.forward)) {
|
|
315
|
-
for (const f of n.forward) {
|
|
316
|
-
if (f && typeof f === "object" && typeof f.next === "string") {
|
|
317
|
-
refs.push({ field: `node.${nodeName}.forward`, target: f.next, kind: "forward" });
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
if (operation_type === "progress" && data.parent) {
|
|
324
|
-
pushRef("parent", data.parent, "parent");
|
|
325
|
-
}
|
|
326
|
-
if (data.permission)
|
|
327
|
-
pushRef("permission", data.permission, "permission");
|
|
328
|
-
if (data.guard)
|
|
329
|
-
pushRef("guard", data.guard, "guard");
|
|
330
|
-
if (data.buy_guard)
|
|
331
|
-
pushRef("buy_guard", data.buy_guard, "buy_guard");
|
|
332
|
-
return refs;
|
|
333
|
-
}
|
|
334
|
-
export function nodeIdOf(name, address) {
|
|
335
|
-
if (name && typeof name === "string" && name.trim())
|
|
336
|
-
return name.trim();
|
|
337
|
-
if (address && typeof address === "string" && address.trim())
|
|
338
|
-
return address.trim();
|
|
339
|
-
return undefined;
|
|
340
|
-
}
|
|
1
|
+
function matchesProjectFilter(a,b){if(a===b)return!![];if(!b['includes']('_v')){const c=a['match'](/^(.+)_v\d+$/);if(c&&c[0x1]===b)return!![];}return![];}export class ProjectGraph{['nodes']=new Map();['edges']=[];['outEdges']=new Map();['inEdges']=new Map();['cycles']=[];['updatedAt']=Date['now']();['upsertNode'](a){const b=this['nodes']['get'](a['id']);if(b){const c=new Set([...b['projects']??[],...a['projects']??[]]);return this['nodes']['set'](a['id'],{...b,...a,'project':a['project']??b['project'],'type':a['type']??b['type'],'address':a['address']??b['address'],'projects':c['size']>0x0?Array['from'](c):b['projects']??a['projects']}),this['nodes']['get'](a['id']);}return this['nodes']['set'](a['id'],{...a}),a;}['addEdge'](a,b,c){if(a===b)return;if(!this['nodes']['has'](a))this['upsertNode']({'id':a});if(!this['nodes']['has'](b))this['upsertNode']({'id':b});const d=this['edges']['some'](f=>f['from']===a&&f['to']===b&&f['kind']===c);if(d)return;const e=this['edges']['length'];this['edges']['push']({'from':a,'to':b,'kind':c});if(!this['outEdges']['has'](a))this['outEdges']['set'](a,new Set());this['outEdges']['get'](a)['add'](e);if(!this['inEdges']['has'](b))this['inEdges']['set'](b,new Set());this['inEdges']['get'](b)['add'](e),this['updatedAt']=Date['now']();}['removeNode'](a){if(!this['nodes']['has'](a))return;this['nodes']['delete'](a);const b=this['outEdges']['get'](a),c=this['inEdges']['get'](a),d=new Set([...b??[],...c??[]]),f=[],g=new Map();for(let h=0x0;h<this['edges']['length'];h++){if(d['has'](h))continue;g['set'](h,f['length']),f['push'](this['edges'][h]);}this['edges']=f,this['outEdges']['clear'](),this['inEdges']['clear']();for(let j=0x0;j<this['edges']['length'];j++){const k=this['edges'][j];if(!this['outEdges']['has'](k['from']))this['outEdges']['set'](k['from'],new Set());this['outEdges']['get'](k['from'])['add'](j);if(!this['inEdges']['has'](k['to']))this['inEdges']['set'](k['to'],new Set());this['inEdges']['get'](k['to'])['add'](j);}this['updatedAt']=Date['now']();}['getNode'](a){return this['nodes']['get'](a);}['listNodes'](a){const b=Array['from'](this['nodes']['values']());if(!a)return b;return b['filter'](c=>{if(c['projects']&&c['projects']['length']>0x0)return c['projects']['some'](d=>matchesProjectFilter(d,a));if(!c['project'])return![];if(c['project']===a)return!![];if(a['startsWith'](c['project']+'_v'))return!![];return![];});}['getDependencies'](a){const b=this['outEdges']['get'](a);if(!b)return[];return Array['from'](b)['map'](c=>this['edges'][c]);}['getReferencedBy'](a){const b=this['inEdges']['get'](a);if(!b)return[];return Array['from'](b)['map'](c=>this['edges'][c]);}['detectCycles'](){const a=0x0,b=0x1,c=0x2,d=new Map();for(const h of this['nodes']['keys']())d['set'](h,a);const e=[],f=[],g=j=>{d['set'](j,b),f['push'](j);const k=this['outEdges']['get'](j);if(k)for(const l of k){const m=this['edges'][l]['to'];if(d['get'](m)===b){const n=f['indexOf'](m);n>=0x0&&e['push'](f['slice'](n)['concat'](m));}else d['get'](m)===a&&g(m);}f['pop'](),d['set'](j,c);};for(const i of this['nodes']['keys']()){if(d['get'](i)===a)g(i);}return this['cycles']=e,e;}['findDanglingDependencies'](){const a=[];for(const [b,c]of this['nodes']){const d=this['getDependencies'](b),e=d['map'](f=>this['nodes']['get'](f['to']))['filter'](f=>!!f)['filter'](f=>!f['address']&&!f['project'])['map'](f=>f['id']);e['length']>0x0&&a['push']({'from':b,'missing':Array['from'](new Set(e))});}return a;}['snapshot'](){return{'nodes':Object['fromEntries'](this['nodes']),'edges':this['edges'],'cycles':this['cycles'],'version':0x1,'updatedAt':this['updatedAt']};}['restore'](a){this['nodes']['clear'](),this['edges']=[],this['outEdges']['clear'](),this['inEdges']['clear']();for(const [b,c]of Object['entries'](a['nodes'])){this['nodes']['set'](b,{...c});}for(const d of a['edges']){this['addEdge'](d['from'],d['to'],d['kind']);}this['cycles']=a['cycles']??[],this['updatedAt']=a['updatedAt']??Date['now']();}['clear'](){this['nodes']['clear'](),this['edges']=[],this['outEdges']['clear'](),this['inEdges']['clear'](),this['cycles']=[],this['updatedAt']=Date['now']();}get['nodeCount'](){return this['nodes']['size'];}get['edgeCount'](){return this['edges']['length'];}['getEdges'](){return this['edges'];}['attachDecisionContext'](a,b){if(!a)return undefined;const c=this['nodes']['get'](a)??this['upsertNode']({'id':a}),d={'id':b['id']??a+'_'+Date['now'](),'decided_at':b['decided_at']??Date['now'](),'decider':b['decider'],'industry':b['industry'],'intent':b['intent'],'alternatives':b['alternatives'],'rationale':b['rationale'],'outcome':b['outcome']};if(!c['decision_contexts'])c['decision_contexts']=[];return c['decision_contexts']['push'](d),this['updatedAt']=Date['now'](),d;}['getDecisionContexts'](a){return this['nodes']['get'](a)?.['decision_contexts']??[];}['queryDecisionContextsByIndustry'](a){const b=[];for(const [c,d]of this['nodes']){if(!d['decision_contexts'])continue;for(const e of d['decision_contexts']){e['industry']===a&&b['push']({'node_id':c,'ctx':e});}}return b['sort']((f,g)=>g['ctx']['decided_at']-f['ctx']['decided_at']),b;}['backfillDecisionOutcome'](a,b){for(const c of this['nodes']['values']()){if(!c['decision_contexts'])continue;const d=c['decision_contexts']['find'](e=>e['id']===a);if(d)return d['outcome']=b,this['updatedAt']=Date['now'](),!![];}return![];}}export function extractReferences(a,b){const c=[];if(!b||typeof b!=='object')return c;const d=(e,g,h)=>{if(!g)return;if(typeof g==='string'){if(g['trim']())c['push']({'field':e,'target':g['trim'](),'kind':h});}else{if(Array['isArray'](g)){for(const i of g)d(e,i,h);}else{if(typeof g==='object'){const j=g['name_or_address']??g['name']??g['address'];typeof j==='string'&&j['trim']()&&c['push']({'field':e,'target':j['trim'](),'kind':h});}}}};a==='service'&&(d('machine',b['machine'],'machine'),d('order_allocators',b['order_allocators'],'order_allocators'),d('arbitrations',b['arbitrations'],'arbitrations'),d('compensation_fund',b['compensation_fund'],'compensation_fund'),d('rewards',b['rewards'],'rewards'),d('buy_guard',b['buy_guard'],'buy_guard'),d('permission',b['permission'],'permission'));a==='order'&&(d('service',b['service'],'service'),d('progress',b['progress'],'progress'),d('arbitration',b['arbitration'],'arbitration'));if(a==='machine'&&Array['isArray'](b['node']?.['nodes']))for(const e of b['node']['nodes']){if(!e||typeof e!=='object')continue;const g=e['name'];if(typeof g!=='string')continue;if(Array['isArray'](e['pairs']))for(const h of e['pairs']){h&&typeof h==='object'&&(typeof h['prev']==='string'&&c['push']({'field':'node.'+g+'.prev','target':h['prev'],'kind':'prev'}),typeof h['next']==='string'&&c['push']({'field':'node.'+g+'.next','target':h['next'],'kind':'next'}));}if(Array['isArray'](e['forward']))for(const i of e['forward']){i&&typeof i==='object'&&typeof i['next']==='string'&&c['push']({'field':'node.'+g+'.forward','target':i['next'],'kind':'forward'});}}a==='progress'&&b['parent']&&d('parent',b['parent'],'parent');if(b['permission'])d('permission',b['permission'],'permission');if(b['guard'])d('guard',b['guard'],'guard');if(b['buy_guard'])d('buy_guard',b['buy_guard'],'buy_guard');return c;}export function nodeIdOf(a,b){if(a&&typeof a==='string'&&a['trim']())return a['trim']();if(b&&typeof b==='string'&&b['trim']())return b['trim']();return undefined;}
|
|
@@ -4,7 +4,7 @@ import type { ProjectOperationInputSchema } from "../schema/project/index.js";
|
|
|
4
4
|
type ProjectInput = z.infer<typeof ProjectOperationInputSchema>;
|
|
5
5
|
export declare function handleListProjects(v: ProjectInput): Promise<{
|
|
6
6
|
action: "list_projects";
|
|
7
|
-
items: {
|
|
7
|
+
items: ({
|
|
8
8
|
objectCount: number;
|
|
9
9
|
evaluationCount: number;
|
|
10
10
|
objectTypes: string[];
|
|
@@ -23,7 +23,32 @@ export declare function handleListProjects(v: ProjectInput): Promise<{
|
|
|
23
23
|
createdAt: number;
|
|
24
24
|
updatedAt: number;
|
|
25
25
|
metadata: Record<string, unknown> | null;
|
|
26
|
-
}
|
|
26
|
+
} | {
|
|
27
|
+
onchainLastUpdated: {
|
|
28
|
+
timestamp_ms: string;
|
|
29
|
+
digest: string | undefined;
|
|
30
|
+
sender: string | undefined;
|
|
31
|
+
object: string;
|
|
32
|
+
};
|
|
33
|
+
objectCount: number;
|
|
34
|
+
evaluationCount: number;
|
|
35
|
+
objectTypes: string[];
|
|
36
|
+
id: string;
|
|
37
|
+
prefix: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description: string | null;
|
|
40
|
+
industry: string | null;
|
|
41
|
+
perspective: import("@wowok/wowok").ProjectPerspective;
|
|
42
|
+
status: import("@wowok/wowok").ProjectStatus;
|
|
43
|
+
labels: string[] | null;
|
|
44
|
+
currentVersion: string | null;
|
|
45
|
+
serviceAddress: string | null;
|
|
46
|
+
defaultAccount: string | null;
|
|
47
|
+
network: string;
|
|
48
|
+
createdAt: number;
|
|
49
|
+
updatedAt: number;
|
|
50
|
+
metadata: Record<string, unknown> | null;
|
|
51
|
+
})[];
|
|
27
52
|
total: number;
|
|
28
53
|
}>;
|
|
29
54
|
export declare function handleCreateProject(v: ProjectInput): Promise<{
|
|
@@ -175,6 +200,12 @@ export declare function handleGetProjectDetail(v: ProjectInput): Promise<{
|
|
|
175
200
|
published: boolean | null;
|
|
176
201
|
paused: boolean | null;
|
|
177
202
|
} | null;
|
|
203
|
+
onchainLastUpdated: {
|
|
204
|
+
timestamp_ms: string;
|
|
205
|
+
digest?: string;
|
|
206
|
+
sender?: string;
|
|
207
|
+
object?: string;
|
|
208
|
+
} | null;
|
|
178
209
|
evaluations: {
|
|
179
210
|
id: string;
|
|
180
211
|
evalType: EvaluationType;
|