@wowok/agent-mcp 3.4.3 → 3.4.4
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/.build-stamp.json +3 -3
- package/dist/build-stamp.js +1 -0
- package/dist/chain-semantics/composition-truth.js +1 -1
- package/dist/chain-semantics/eval-order.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.js +1 -1
- package/dist/composition/generate.js +1 -1
- package/dist/composition/guard-fill.js +1 -1
- package/dist/composition/input-normalize.js +1 -1
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.js +1 -1
- package/dist/composition/plan.js +1 -1
- package/dist/composition/product-card.js +1 -1
- package/dist/composition/shape-expand.js +1 -0
- package/dist/config/judgment.js +1 -1
- package/dist/config/template-params.js +1 -1
- package/dist/data/sync/cdc.js +1 -1
- package/dist/data/sync/graphql-source.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/sdk-batch.js +1 -1
- package/dist/harness/entry-ignite-selfheal.js +1 -0
- package/dist/harness/forward-leg-preflight.js +1 -0
- package/dist/harness/recover.js +1 -1
- package/dist/keeper/detectors.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-operation-face.js +1 -0
- package/dist/knowledge/arbitration-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +15 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/alloc_audit.json.good +310 -0
- package/dist/knowledge/baselines/rules/allocation.json.good +568 -0
- package/dist/knowledge/baselines/rules/arb.json.good +174 -0
- package/dist/knowledge/baselines/rules/arbitration.json.good +393 -0
- package/dist/knowledge/baselines/rules/bridge.json.good +197 -0
- package/dist/knowledge/baselines/rules/contact.json.good +152 -0
- package/dist/knowledge/baselines/rules/demand.json.good +158 -0
- package/dist/knowledge/baselines/rules/graph.json.good +534 -0
- package/dist/knowledge/baselines/rules/guard.json +18 -5
- package/dist/knowledge/baselines/rules/guard.json.good +1192 -0
- package/dist/knowledge/baselines/rules/machine.json.good +734 -0
- package/dist/knowledge/baselines/rules/oracle.json +1 -1
- package/dist/knowledge/baselines/rules/oracle.json.good +120 -0
- package/dist/knowledge/baselines/rules/order.json.good +549 -0
- package/dist/knowledge/baselines/rules/payment.json.good +205 -0
- package/dist/knowledge/baselines/rules/permission.json.good +330 -0
- package/dist/knowledge/baselines/rules/personal.json.good +139 -0
- package/dist/knowledge/baselines/rules/plan.json +343 -1
- package/dist/knowledge/baselines/rules/plan.json.good +1187 -0
- package/dist/knowledge/baselines/rules/progress.json.good +364 -0
- package/dist/knowledge/baselines/rules/proof.json.good +158 -0
- package/dist/knowledge/baselines/rules/registrar.json.good +159 -0
- package/dist/knowledge/baselines/rules/repository.json.good +244 -0
- package/dist/knowledge/baselines/rules/resource.json.good +117 -0
- package/dist/knowledge/baselines/rules/reward.json +10 -10
- package/dist/knowledge/baselines/rules/reward.json.good +586 -0
- package/dist/knowledge/baselines/rules/service.json.good +595 -0
- package/dist/knowledge/baselines/rules/treasury.json.good +440 -0
- package/dist/knowledge/baselines/rules/util.json.good +101 -0
- package/dist/knowledge/builtin-templates.d.ts +13 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/chain-query-registry.js +1 -1
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +2 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.js +1 -1
- package/dist/knowledge/guard-binding-verifier.js +1 -1
- package/dist/knowledge/guard-create-preflight.js +1 -0
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-host-context.js +1 -1
- package/dist/knowledge/guard-leg-eval.js +1 -0
- package/dist/knowledge/guard-node-gates.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-quality.js +1 -0
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-semantic-walk.js +1 -0
- package/dist/knowledge/guard-templates.d.ts +1 -0
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/path-oracle/coverage.js +1 -1
- package/dist/knowledge/path-oracle/index.js +1 -1
- package/dist/knowledge/path-oracle/products/airbnb.js +1 -0
- package/dist/knowledge/path-oracle/products/algora.js +1 -0
- package/dist/knowledge/path-oracle/products/alibaba-1688.js +1 -0
- package/dist/knowledge/path-oracle/products/amazon.js +1 -0
- package/dist/knowledge/path-oracle/products/beatstars.js +1 -0
- package/dist/knowledge/path-oracle/products/booking-com.js +1 -0
- package/dist/knowledge/path-oracle/products/contra.js +1 -0
- package/dist/knowledge/path-oracle/products/costco.js +1 -0
- package/dist/knowledge/path-oracle/products/coursera.js +1 -0
- package/dist/knowledge/path-oracle/products/duoduo-maicai.js +1 -0
- package/dist/knowledge/path-oracle/products/etsy.js +1 -0
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
- package/dist/knowledge/path-oracle/products/gamefound.js +1 -0
- package/dist/knowledge/path-oracle/products/gofundme.js +1 -0
- package/dist/knowledge/path-oracle/products/hackerone.js +1 -0
- package/dist/knowledge/path-oracle/products/kickstarter.js +1 -0
- package/dist/knowledge/path-oracle/products/klook.js +1 -0
- package/dist/knowledge/path-oracle/products/ninety-nine-designs.js +1 -0
- package/dist/knowledge/path-oracle/products/onlyfans.js +1 -0
- package/dist/knowledge/path-oracle/products/patreon.js +1 -0
- package/dist/knowledge/path-oracle/products/pinduoduo-kuaituantuan.js +1 -0
- package/dist/knowledge/path-oracle/products/royalty-exchange.js +1 -0
- package/dist/knowledge/path-oracle/products/shansong.js +1 -0
- package/dist/knowledge/path-oracle/products/taobao-presale.js +1 -0
- package/dist/knowledge/path-oracle/products/upwork-catalog.js +1 -0
- package/dist/knowledge/path-oracle/products/upwork.js +1 -0
- package/dist/knowledge/path-oracle/products/yuanfudao.js +1 -0
- package/dist/knowledge/path-oracle/products/ziroom.js +1 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/product-detail-source.js +1 -1
- package/dist/knowledge/product-doc-b5.js +1 -1
- package/dist/knowledge/product-doc-facets.js +1 -0
- package/dist/knowledge/projection.js +1 -1
- package/dist/knowledge/publish-gate.js +1 -1
- package/dist/knowledge/publish-surface-contract.js +1 -1
- package/dist/knowledge/recipient-constraint.d.ts +20 -0
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/rule-declaration-types.d.ts +13 -0
- package/dist/knowledge/rule-declaration-types.js +1 -0
- package/dist/knowledge/rule-declarations.js +1 -0
- package/dist/knowledge/scenario-modes.d.ts +6 -0
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-prose.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/service.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +9 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/arbitration.d.ts +8 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +8 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +2 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/handler.d.ts +2 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/order.d.ts +10 -0
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/permission.js +1 -1
- package/dist/schema/call/progress.d.ts +15 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/receipt.d.ts +1 -0
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +12 -0
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.d.ts +1 -0
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +5 -3
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/envelope-unify.js +1 -1
- package/dist/schema/goal/index.d.ts +23 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +2 -2
- package/dist/schema/local/index.d.ts +20 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.d.ts +4 -0
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +5 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +944 -1
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +5 -5
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workspace/index.d.ts +2 -2
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.schema.json +1 -257
- package/dist/schemas/ask_user.schema.json +1 -78
- package/dist/schemas/benchmark_migration_operation.schema.json +1 -626
- package/dist/schemas/bridge_operation.schema.json +1 -1069
- package/dist/schemas/config_operation.schema.json +1 -82
- package/dist/schemas/employee_operation.schema.json +1 -319
- package/dist/schemas/evaluation_operation.schema.json +1 -3932
- package/dist/schemas/goal_operation.schema.json +1 -1650
- package/dist/schemas/guard2file.schema.json +1 -137
- package/dist/schemas/index.json +1 -285
- package/dist/schemas/industry_pack_operation.schema.json +1 -582
- package/dist/schemas/intent_radar.schema.json +1 -155
- package/dist/schemas/keeper_operation.schema.json +1 -364
- package/dist/schemas/local_cache_operation.schema.json +1 -116
- package/dist/schemas/local_history_operation.schema.json +1 -105
- package/dist/schemas/local_info_operation.schema.json +1 -140
- package/dist/schemas/local_mark_operation.schema.json +1 -124
- package/dist/schemas/machineNode2file.schema.json +1 -137
- package/dist/schemas/messenger_operation.schema.json +1 -2068
- package/dist/schemas/monitor_events.schema.json +1 -87
- package/dist/schemas/monitor_subscription.schema.json +1 -327
- package/dist/schemas/onchain_events.schema.json +1 -207
- package/dist/schemas/onchain_operations.schema.json +1 -28699
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1376
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1355
- package/dist/schemas/onchain_operations_contact.schema.json +1 -988
- package/dist/schemas/onchain_operations_demand.schema.json +1 -1146
- package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -663
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -180
- package/dist/schemas/onchain_operations_guard.schema.json +1 -8518
- package/dist/schemas/onchain_operations_machine.schema.json +1 -1879
- package/dist/schemas/onchain_operations_order.schema.json +1 -1121
- package/dist/schemas/onchain_operations_payment.schema.json +1 -316
- package/dist/schemas/onchain_operations_permission.schema.json +1 -1036
- package/dist/schemas/onchain_operations_personal.schema.json +1 -1463
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1041
- package/dist/schemas/onchain_operations_proof.schema.json +1 -750
- package/dist/schemas/onchain_operations_repository.schema.json +1 -2046
- package/dist/schemas/onchain_operations_reward.schema.json +1 -1286
- package/dist/schemas/onchain_operations_service.schema.json +1 -2602
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -1527
- package/dist/schemas/onchain_table_data.schema.json +1 -1146
- package/dist/schemas/permission_operation.schema.json +1 -43
- package/dist/schemas/persona_operation.schema.json +1 -10424
- package/dist/schemas/query_toolkit.schema.json +1 -1867
- package/dist/schemas/schema_query.schema.json +1 -116
- package/dist/schemas/service_clone_operation.schema.json +1 -49
- package/dist/schemas/settle_sweep.schema.json +1 -0
- package/dist/schemas/strategy_review_operation.schema.json +1 -66
- package/dist/schemas/verify_guard_dry_run.schema.json +1 -0
- package/dist/schemas/watch_operation.schema.json +1 -145
- package/dist/schemas/wip_file.schema.json +1 -299
- package/dist/schemas/workflow_operation.schema.json +1 -722
- package/dist/schemas/workspace_operation.schema.json +1 -104
- package/dist/schemas/wowok_buildin_info.schema.json +1 -758
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/entry-edge-recipe.js +1 -1
- package/dist/tools/handlers/file-export.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/pending-settlement-recipe.js +1 -0
- package/dist/tools/handlers/plan-recovery.js +1 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/repository-row-id.js +1 -0
- package/dist/tools/handlers/review-chain.js +1 -1
- package/dist/tools/handlers/settle-sweep.js +1 -0
- package/dist/tools/handlers/stale-build-check.js +1 -1
- package/dist/tools/handlers/submission-assembly.js +1 -1
- package/dist/tools/handlers/verify-guard-dry-run.js +1 -0
- package/dist/tools/handlers/wip-upload.js +1 -1
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/publish-gate-state.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/types.d.ts +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +11 -4
- package/dist/chain-semantics/composition-truth.d.ts +0 -102
- package/dist/chain-semantics/eval-order.d.ts +0 -17
- package/dist/chain-semantics/field-capability.d.ts +0 -11
- package/dist/chain-semantics/freeze-map.d.ts +0 -11
- package/dist/chain-semantics/fund-flow.d.ts +0 -10
- package/dist/chain-semantics/guard-verbs.d.ts +0 -22
- package/dist/chain-semantics/index.d.ts +0 -12
- package/dist/chain-semantics/object-graph.d.ts +0 -18
- package/dist/communication/evidence.d.ts +0 -6
- package/dist/communication/message-cursors.d.ts +0 -35
- package/dist/communication/proof-reuse.d.ts +0 -9
- package/dist/communication/wts-attestation.d.ts +0 -39
- package/dist/composition/audit.d.ts +0 -15
- package/dist/composition/blueprint-view.d.ts +0 -63
- package/dist/composition/compile.d.ts +0 -83
- package/dist/composition/emit-phases.d.ts +0 -234
- package/dist/composition/generate.d.ts +0 -40
- package/dist/composition/guard-fill.d.ts +0 -52
- package/dist/composition/inflight.d.ts +0 -86
- package/dist/composition/input-normalize.d.ts +0 -15
- package/dist/composition/materialize.d.ts +0 -78
- package/dist/composition/mode-gates.d.ts +0 -35
- package/dist/composition/param-disclosure.d.ts +0 -61
- package/dist/composition/plan-retry-ledger.d.ts +0 -37
- package/dist/composition/plan.d.ts +0 -121
- package/dist/composition/product-card.d.ts +0 -94
- package/dist/composition/reflux.d.ts +0 -28
- package/dist/composition/supply-chain-emit.d.ts +0 -46
- package/dist/config/config-audit.spec.d.ts +0 -1
- package/dist/config/config-audit.spec.js +0 -1
- package/dist/config/config-warnings.d.ts +0 -2
- package/dist/config/index.d.ts +0 -4
- package/dist/config/judgment.spec.d.ts +0 -1
- package/dist/config/judgment.spec.js +0 -1
- package/dist/config/match-policy-file.d.ts +0 -34
- package/dist/config/match-policy-file.spec.d.ts +0 -1
- package/dist/config/match-policy-file.spec.js +0 -1
- package/dist/config/rule-engine.spec.d.ts +0 -1
- package/dist/config/rule-engine.spec.js +0 -1
- package/dist/config/runtime.d.ts +0 -29
- package/dist/config/store-policy.d.ts +0 -14
- package/dist/config/store-policy.spec.d.ts +0 -1
- package/dist/config/store-policy.spec.js +0 -1
- package/dist/config/template-params.d.ts +0 -42
- package/dist/config/template-params.spec.d.ts +0 -1
- package/dist/config/template-params.spec.js +0 -1
- package/dist/customer/account-events.d.ts +0 -32
- package/dist/data/api/api.spec.d.ts +0 -1
- package/dist/data/api/api.spec.js +0 -1
- package/dist/data/api/cli.d.ts +0 -1
- package/dist/data/api/head.d.ts +0 -16
- package/dist/data/api/head.spec.d.ts +0 -1
- package/dist/data/api/head.spec.js +0 -1
- package/dist/data/api/index.d.ts +0 -2
- package/dist/data/api/match.d.ts +0 -69
- package/dist/data/api/match.spec.d.ts +0 -1
- package/dist/data/api/match.spec.js +0 -1
- package/dist/data/api/server.d.ts +0 -13
- package/dist/data/projection/cli.d.ts +0 -1
- package/dist/data/projection/edges.d.ts +0 -8
- package/dist/data/projection/edges.spec.d.ts +0 -1
- package/dist/data/projection/edges.spec.js +0 -1
- package/dist/data/projection/facets.d.ts +0 -18
- package/dist/data/projection/facets.spec.d.ts +0 -1
- package/dist/data/projection/facets.spec.js +0 -1
- package/dist/data/projection/facts.d.ts +0 -40
- package/dist/data/projection/index.d.ts +0 -6
- package/dist/data/projection/project.d.ts +0 -10
- package/dist/data/projection/projection.spec.d.ts +0 -1
- package/dist/data/projection/projection.spec.js +0 -1
- package/dist/data/projection/schema.d.ts +0 -1
- package/dist/data/projection/store.d.ts +0 -51
- package/dist/data/projection/types.d.ts +0 -169
- package/dist/data/sync/cdc.d.ts +0 -33
- package/dist/data/sync/cdc.spec.d.ts +0 -1
- package/dist/data/sync/cdc.spec.js +0 -1
- package/dist/data/sync/graphql-source.d.ts +0 -16
- package/dist/data/sync/index.d.ts +0 -5
- package/dist/data/sync/reconciler.d.ts +0 -14
- package/dist/data/sync/reconciler.spec.d.ts +0 -1
- package/dist/data/sync/reconciler.spec.js +0 -1
- package/dist/data/sync/schema.d.ts +0 -1
- package/dist/data/sync/store.d.ts +0 -24
- package/dist/data/sync/sync.spec.d.ts +0 -1
- package/dist/data/sync/sync.spec.js +0 -1
- package/dist/data/sync/synchronizer.d.ts +0 -10
- package/dist/data/sync/types.d.ts +0 -164
- package/dist/evaluation/acceptance.d.ts +0 -33
- package/dist/evaluation/architecture.spec.d.ts +0 -1
- package/dist/evaluation/architecture.spec.js +0 -1
- package/dist/evaluation/builtins/arbitration-score.d.ts +0 -42
- package/dist/evaluation/builtins/demand-match.d.ts +0 -16
- package/dist/evaluation/builtins/graph-service.spec.d.ts +0 -1
- package/dist/evaluation/builtins/graph-service.spec.js +0 -1
- package/dist/evaluation/builtins/index.d.ts +0 -4
- package/dist/evaluation/builtins/purity.spec.d.ts +0 -1
- package/dist/evaluation/builtins/purity.spec.js +0 -1
- package/dist/evaluation/composer.d.ts +0 -38
- package/dist/evaluation/facets/catalog.d.ts +0 -19
- package/dist/evaluation/gap.d.ts +0 -2
- package/dist/evaluation/guard-scan.d.ts +0 -10
- package/dist/evaluation/index.d.ts +0 -14
- package/dist/evaluation/injection.d.ts +0 -6
- package/dist/evaluation/location-match.d.ts +0 -42
- package/dist/evaluation/match-operation.d.ts +0 -23
- package/dist/evaluation/match-policy-resolver.d.ts +0 -9
- package/dist/evaluation/match-policy.spec.d.ts +0 -1
- package/dist/evaluation/match-policy.spec.js +0 -1
- package/dist/evaluation/path-reasoning.d.ts +0 -37
- package/dist/evaluation/standards.d.ts +0 -11
- package/dist/evaluation/standards.spec.d.ts +0 -1
- package/dist/evaluation/standards.spec.js +0 -1
- package/dist/evaluation/structured-lines.d.ts +0 -8
- package/dist/evaluation/user-injection.d.ts +0 -6
- package/dist/experience/experience-reuse.d.ts +0 -10
- package/dist/experience/index.d.ts +0 -7
- package/dist/experience/persistence-config.d.ts +0 -6
- package/dist/experience/persistence.d.ts +0 -21
- package/dist/experience/realtime-feedback.d.ts +0 -5
- package/dist/experience/user-profile.d.ts +0 -25
- package/dist/extensions/capability.d.ts +0 -91
- package/dist/extensions/industry-audit.spec.d.ts +0 -1
- package/dist/extensions/industry-audit.spec.js +0 -1
- package/dist/goal/GoalClassifier.d.ts +0 -17
- package/dist/goal/GoalEngine.d.ts +0 -175
- package/dist/goal/GoalStore.d.ts +0 -27
- package/dist/goal/next-steps.d.ts +0 -12
- package/dist/goal/plan-approval.d.ts +0 -5
- package/dist/goal/pursue.d.ts +0 -18
- package/dist/graph/base.d.ts +0 -8
- package/dist/graph/onchain/analyze.d.ts +0 -59
- package/dist/graph/onchain/analyze.spec.d.ts +0 -1
- package/dist/graph/onchain/analyze.spec.js +0 -1
- package/dist/graph/onchain/anti-cheat.d.ts +0 -69
- package/dist/graph/onchain/anti-cheat.spec.d.ts +0 -1
- package/dist/graph/onchain/anti-cheat.spec.js +0 -1
- package/dist/graph/onchain/dataplane.d.ts +0 -44
- package/dist/graph/onchain/edge-batch.spec.d.ts +0 -1
- package/dist/graph/onchain/edge-batch.spec.js +0 -1
- package/dist/graph/onchain/edge-schema.d.ts +0 -69
- package/dist/graph/onchain/entity-profile.spec.d.ts +0 -1
- package/dist/graph/onchain/entity-profile.spec.js +0 -1
- package/dist/graph/onchain/event-history.spec.d.ts +0 -1
- package/dist/graph/onchain/event-history.spec.js +0 -1
- package/dist/graph/onchain/expand.d.ts +0 -4
- package/dist/graph/onchain/exploration.d.ts +0 -28
- package/dist/graph/onchain/exploration.spec.d.ts +0 -1
- package/dist/graph/onchain/exploration.spec.js +0 -1
- package/dist/graph/onchain/exposure.d.ts +0 -18
- package/dist/graph/onchain/exposure.spec.d.ts +0 -1
- package/dist/graph/onchain/exposure.spec.js +0 -1
- package/dist/graph/onchain/extract-deep.spec.d.ts +0 -1
- package/dist/graph/onchain/extract-deep.spec.js +0 -1
- package/dist/graph/onchain/extract.d.ts +0 -29
- package/dist/graph/onchain/facet-projection.d.ts +0 -99
- package/dist/graph/onchain/facet-projection.spec.d.ts +0 -1
- package/dist/graph/onchain/facet-projection.spec.js +0 -1
- package/dist/graph/onchain/facts.spec.d.ts +0 -1
- package/dist/graph/onchain/facts.spec.js +0 -1
- package/dist/graph/onchain/field-manifest.d.ts +0 -29
- package/dist/graph/onchain/field-manifest.spec.d.ts +0 -1
- package/dist/graph/onchain/field-manifest.spec.js +0 -1
- package/dist/graph/onchain/fixtures.d.ts +0 -80
- package/dist/graph/onchain/fixtures.spec.d.ts +0 -1
- package/dist/graph/onchain/fixtures.spec.js +0 -1
- package/dist/graph/onchain/graph-policy.spec.d.ts +0 -1
- package/dist/graph/onchain/graph-policy.spec.js +0 -1
- package/dist/graph/onchain/index.d.ts +0 -29
- package/dist/graph/onchain/interest.d.ts +0 -10
- package/dist/graph/onchain/interest.spec.d.ts +0 -1
- package/dist/graph/onchain/interest.spec.js +0 -1
- package/dist/graph/onchain/label-lint.spec.d.ts +0 -1
- package/dist/graph/onchain/label-lint.spec.js +0 -1
- package/dist/graph/onchain/names.d.ts +0 -23
- package/dist/graph/onchain/names.spec.d.ts +0 -1
- package/dist/graph/onchain/names.spec.js +0 -1
- package/dist/graph/onchain/object-held-receipts.d.ts +0 -20
- package/dist/graph/onchain/object-held-receipts.spec.d.ts +0 -1
- package/dist/graph/onchain/object-held-receipts.spec.js +0 -1
- package/dist/graph/onchain/onchain.spec.d.ts +0 -1
- package/dist/graph/onchain/onchain.spec.js +0 -1
- package/dist/graph/onchain/policy.d.ts +0 -8
- package/dist/graph/onchain/project-relationship.d.ts +0 -3
- package/dist/graph/onchain/proposal-graph.d.ts +0 -11
- package/dist/graph/onchain/proposal-graph.spec.d.ts +0 -1
- package/dist/graph/onchain/proposal-graph.spec.js +0 -1
- package/dist/graph/onchain/sdk-batch.d.ts +0 -129
- package/dist/graph/onchain/sdk-dataplane.d.ts +0 -44
- package/dist/graph/onchain/strategy.spec.d.ts +0 -1
- package/dist/graph/onchain/strategy.spec.js +0 -1
- package/dist/graph/onchain/synthesis.d.ts +0 -20
- package/dist/graph/onchain/synthesis.spec.d.ts +0 -1
- package/dist/graph/onchain/synthesis.spec.js +0 -1
- package/dist/graph/onchain/table-ledger.spec.d.ts +0 -1
- package/dist/graph/onchain/table-ledger.spec.js +0 -1
- package/dist/graph/onchain/viewport.d.ts +0 -6
- package/dist/harness/auto-escalation.d.ts +0 -15
- package/dist/intent/enrich.d.ts +0 -1
- package/dist/intent/index.d.ts +0 -23
- package/dist/intent/matcher.d.ts +0 -2
- package/dist/intent/store.d.ts +0 -19
- package/dist/intent/types.d.ts +0 -32
- package/dist/keeper/KeeperScan.d.ts +0 -41
- package/dist/keeper/KeeperStore.d.ts +0 -43
- package/dist/keeper/detectors.d.ts +0 -42
- package/dist/keeper/keeper.spec.d.ts +0 -1
- package/dist/keeper/keeper.spec.js +0 -1
- package/dist/keeper/types.d.ts +0 -67
- package/dist/knowledge/account-marks.d.ts +0 -36
- package/dist/knowledge/allocation-ledger.d.ts +0 -75
- package/dist/knowledge/allocation-puzzle.d.ts +0 -138
- package/dist/knowledge/allocation-risk.d.ts +0 -82
- package/dist/knowledge/allocation-templates.d.ts +0 -38
- package/dist/knowledge/allocator-rail-verifier.d.ts +0 -59
- package/dist/knowledge/anti-cheat.d.ts +0 -2
- package/dist/knowledge/arb-fund-facts.d.ts +0 -51
- package/dist/knowledge/arb-risk.d.ts +0 -39
- package/dist/knowledge/arbitration-puzzle.d.ts +0 -84
- package/dist/knowledge/arbitration-rail-verifier.d.ts +0 -35
- package/dist/knowledge/arbitration-risk.d.ts +0 -114
- package/dist/knowledge/arbitration-templates.d.ts +0 -39
- package/dist/knowledge/arbitration-venue-order.d.ts +0 -25
- package/dist/knowledge/baselines/guard-lint-baseline.spec.d.ts +0 -1
- package/dist/knowledge/baselines/guard-lint-baseline.spec.js +0 -1
- package/dist/knowledge/baselines/risk-baselines.spec.d.ts +0 -1
- package/dist/knowledge/baselines/risk-baselines.spec.js +0 -1
- package/dist/knowledge/baselines/risk-cases.d.ts +0 -8
- package/dist/knowledge/baselines/semantic-facts.d.ts +0 -12
- package/dist/knowledge/bridge-risk.d.ts +0 -36
- package/dist/knowledge/catalog-facts.d.ts +0 -4
- package/dist/knowledge/chain-query-registry.d.ts +0 -14
- package/dist/knowledge/commission-landing.d.ts +0 -26
- package/dist/knowledge/component-schema.d.ts +0 -64
- package/dist/knowledge/contact-risk.d.ts +0 -32
- package/dist/knowledge/contact-templates.d.ts +0 -26
- package/dist/knowledge/contract-invariants.d.ts +0 -54
- package/dist/knowledge/demand-risk.d.ts +0 -30
- package/dist/knowledge/discount-threshold.d.ts +0 -26
- package/dist/knowledge/dynamic-pricing.d.ts +0 -29
- package/dist/knowledge/entity-recipient-guard.d.ts +0 -21
- package/dist/knowledge/event-semantics.d.ts +0 -23
- package/dist/knowledge/evidence-review.d.ts +0 -35
- package/dist/knowledge/fee-param-bindings.d.ts +0 -28
- package/dist/knowledge/flywheel-loop.d.ts +0 -41
- package/dist/knowledge/game-scenarios.d.ts +0 -21
- package/dist/knowledge/getting-started.d.ts +0 -37
- package/dist/knowledge/goal-completion.d.ts +0 -31
- package/dist/knowledge/guard-anchor-reach.d.ts +0 -19
- package/dist/knowledge/guard-binding-table.d.ts +0 -52
- package/dist/knowledge/guard-binding-verifier.d.ts +0 -37
- package/dist/knowledge/guard-bindings.d.ts +0 -21
- package/dist/knowledge/guard-blueprint.d.ts +0 -68
- package/dist/knowledge/guard-design-patterns.d.ts +0 -38
- package/dist/knowledge/guard-eval.d.ts +0 -15
- package/dist/knowledge/guard-field-cognition.d.ts +0 -48
- package/dist/knowledge/guard-host-context.d.ts +0 -24
- package/dist/knowledge/guard-ledger.d.ts +0 -19
- package/dist/knowledge/guard-leg-map.d.ts +0 -5
- package/dist/knowledge/guard-lint.d.ts +0 -79
- package/dist/knowledge/guard-node-gates.d.ts +0 -9
- package/dist/knowledge/guard-puzzle.d.ts +0 -188
- package/dist/knowledge/guard-render.d.ts +0 -71
- package/dist/knowledge/guard-risk.d.ts +0 -71
- package/dist/knowledge/guard-submission-brief.d.ts +0 -94
- package/dist/knowledge/guard-submission-prompt.d.ts +0 -63
- package/dist/knowledge/guard-translation.d.ts +0 -58
- package/dist/knowledge/index.d.ts +0 -299
- package/dist/knowledge/industry-evolution.d.ts +0 -82
- package/dist/knowledge/industry-generalizer.d.ts +0 -63
- package/dist/knowledge/industry-rule-node.d.ts +0 -7
- package/dist/knowledge/industry-strategy.d.ts +0 -91
- package/dist/knowledge/intent-metrics.d.ts +0 -43
- package/dist/knowledge/jsonrpc-enum.d.ts +0 -102
- package/dist/knowledge/knob-docs.d.ts +0 -5
- package/dist/knowledge/machine-fork-watch.d.ts +0 -9
- package/dist/knowledge/machine-ledger.d.ts +0 -42
- package/dist/knowledge/machine-puzzle.d.ts +0 -206
- package/dist/knowledge/machine-risk.d.ts +0 -72
- package/dist/knowledge/machine-templates.d.ts +0 -92
- package/dist/knowledge/machine-topology.d.ts +0 -116
- package/dist/knowledge/machine-translation.d.ts +0 -96
- package/dist/knowledge/market-metrics.d.ts +0 -34
- package/dist/knowledge/market-operations.d.ts +0 -46
- package/dist/knowledge/migration-preflight.d.ts +0 -27
- package/dist/knowledge/object-dependency.d.ts +0 -31
- package/dist/knowledge/operation-dictionary.d.ts +0 -18
- package/dist/knowledge/order-ledger.d.ts +0 -69
- package/dist/knowledge/order-puzzle.d.ts +0 -162
- package/dist/knowledge/order-risk.d.ts +0 -62
- package/dist/knowledge/order-templates.d.ts +0 -50
- package/dist/knowledge/param-schema.d.ts +0 -93
- package/dist/knowledge/param-tiers.d.ts +0 -27
- package/dist/knowledge/passport-ledger.d.ts +0 -60
- package/dist/knowledge/passport-templates.d.ts +0 -40
- package/dist/knowledge/path-oracle/coverage.d.ts +0 -16
- package/dist/knowledge/path-oracle/index.d.ts +0 -5
- package/dist/knowledge/path-oracle/products/food-delivery.d.ts +0 -2
- package/dist/knowledge/path-oracle/schema.d.ts +0 -188
- package/dist/knowledge/pattern-resolutions.d.ts +0 -110
- package/dist/knowledge/payment-risk.d.ts +0 -38
- package/dist/knowledge/payment-tracker.d.ts +0 -63
- package/dist/knowledge/permission-ledger.d.ts +0 -49
- package/dist/knowledge/permission-puzzle.d.ts +0 -122
- package/dist/knowledge/permission-risk.d.ts +0 -70
- package/dist/knowledge/permission-templates.d.ts +0 -38
- package/dist/knowledge/personal-risk.d.ts +0 -36
- package/dist/knowledge/product-detail-source.d.ts +0 -37
- package/dist/knowledge/product-doc-b5.d.ts +0 -16
- package/dist/knowledge/progress-ledger.d.ts +0 -63
- package/dist/knowledge/progress-puzzle.d.ts +0 -82
- package/dist/knowledge/progress-risk.d.ts +0 -75
- package/dist/knowledge/progress-templates.d.ts +0 -38
- package/dist/knowledge/projection.d.ts +0 -54
- package/dist/knowledge/projection.spec.d.ts +0 -1
- package/dist/knowledge/projection.spec.js +0 -1
- package/dist/knowledge/proof-risk.d.ts +0 -33
- package/dist/knowledge/protocol-facts.d.ts +0 -17
- package/dist/knowledge/publish-gate.d.ts +0 -20
- package/dist/knowledge/publish-readiness.d.ts +0 -25
- package/dist/knowledge/publish-surface-contract.d.ts +0 -16
- package/dist/knowledge/puzzle-projections.d.ts +0 -11
- package/dist/knowledge/rail-exit-satisfiability.d.ts +0 -25
- package/dist/knowledge/registrar-risk.d.ts +0 -34
- package/dist/knowledge/release-sentinel.d.ts +0 -12
- package/dist/knowledge/repository-risk.d.ts +0 -46
- package/dist/knowledge/repository-write-semantics.d.ts +0 -27
- package/dist/knowledge/reputation-rules.d.ts +0 -36
- package/dist/knowledge/requirement-families.d.ts +0 -13
- package/dist/knowledge/resource-risk.d.ts +0 -32
- package/dist/knowledge/reward-ledger.d.ts +0 -97
- package/dist/knowledge/reward-puzzle.d.ts +0 -98
- package/dist/knowledge/reward-risk.d.ts +0 -86
- package/dist/knowledge/reward-templates.d.ts +0 -25
- package/dist/knowledge/rule-node-analyzers.d.ts +0 -49
- package/dist/knowledge/rule-outcome.d.ts +0 -5
- package/dist/knowledge/scenario-topology.d.ts +0 -48
- package/dist/knowledge/semantic-ir.d.ts +0 -136
- package/dist/knowledge/service-allocation-semantics.d.ts +0 -36
- package/dist/knowledge/service-allocator-audit-node.d.ts +0 -3
- package/dist/knowledge/service-ledger.d.ts +0 -87
- package/dist/knowledge/service-puzzle.d.ts +0 -158
- package/dist/knowledge/service-risk-node.d.ts +0 -3
- package/dist/knowledge/service-risk.d.ts +0 -110
- package/dist/knowledge/service-templates.d.ts +0 -41
- package/dist/knowledge/settlement-semantics.d.ts +0 -1
- package/dist/knowledge/strategy-manuals.d.ts +0 -15
- package/dist/knowledge/supply-chain.d.ts +0 -35
- package/dist/knowledge/template-index.d.ts +0 -19
- package/dist/knowledge/template-loader.d.ts +0 -425
- package/dist/knowledge/template-nav.d.ts +0 -9
- package/dist/knowledge/template-prose.d.ts +0 -50
- package/dist/knowledge/template-registry.d.ts +0 -48
- package/dist/knowledge/template-scanner.d.ts +0 -158
- package/dist/knowledge/template-test-profiles.d.ts +0 -17
- package/dist/knowledge/template-validation.d.ts +0 -3
- package/dist/knowledge/tools-reference.d.ts +0 -17
- package/dist/knowledge/treasury-ledger.d.ts +0 -42
- package/dist/knowledge/treasury-puzzle.d.ts +0 -163
- package/dist/knowledge/treasury-risk.d.ts +0 -88
- package/dist/knowledge/treasury-templates.d.ts +0 -38
- package/dist/knowledge/universal-template.d.ts +0 -22
- package/dist/knowledge/util-risk.d.ts +0 -30
- package/dist/knowledge/workflow-guidance.d.ts +0 -194
- package/dist/knowledge/workspace-lists.d.ts +0 -61
- package/dist/monitor/SuggestionBridge.spec.d.ts +0 -1
- package/dist/monitor/SuggestionBridge.spec.js +0 -1
- package/dist/participation/arbitrator-interest.d.ts +0 -22
- package/dist/participation/demander-interest.d.ts +0 -23
- package/dist/participation/employee-kpi.d.ts +0 -37
- package/dist/participation/employee-kpi.spec.d.ts +0 -1
- package/dist/participation/employee-kpi.spec.js +0 -1
- package/dist/participation/employee-store.d.ts +0 -16
- package/dist/participation/game-context.d.ts +0 -25
- package/dist/participation/index.d.ts +0 -2
- package/dist/participation/node-action-advisor.d.ts +0 -68
- package/dist/participation/time-window.d.ts +0 -48
- package/dist/persona/facet-profile.d.ts +0 -33
- package/dist/persona/persona-audit.spec.d.ts +0 -1
- package/dist/persona/persona-audit.spec.js +0 -1
- package/dist/playbooks/service-build/business-puzzle.d.ts +0 -48
- package/dist/playbooks/service-build/context-assembly.d.ts +0 -32
- package/dist/playbooks/service-build/facet-money.d.ts +0 -33
- package/dist/playbooks/service-build/facet-money.spec.d.ts +0 -1
- package/dist/playbooks/service-build/facet-money.spec.js +0 -1
- package/dist/playbooks/service-build/game-theory.d.ts +0 -47
- package/dist/playbooks/service-build/index.d.ts +0 -15
- package/dist/playbooks/service-build/intent-analyzer.d.ts +0 -72
- package/dist/playbooks/service-build/machine-nodes.d.ts +0 -27
- package/dist/playbooks/service-build/machine-panorama.d.ts +0 -71
- package/dist/playbooks/service-build/merchant-guide.d.ts +0 -382
- package/dist/playbooks/service-build/migration-planner.d.ts +0 -61
- package/dist/playbooks/service-build/mode-actions.d.ts +0 -260
- package/dist/playbooks/service-build/object-panorama.d.ts +0 -317
- package/dist/playbooks/service-build/object-type.d.ts +0 -1
- package/dist/playbooks/service-build/participation-radar.d.ts +0 -20
- package/dist/playbooks/service-build/pipeline-actions.d.ts +0 -108
- package/dist/playbooks/service-build/process.d.ts +0 -6
- package/dist/playbooks/service-build/relationship-profile.d.ts +0 -3
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.d.ts +0 -1
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +0 -1
- package/dist/playbooks/service-build/reverse-mapping-refund-p0-5.spec.d.ts +0 -1
- package/dist/playbooks/service-build/reverse-mapping-refund-p0-5.spec.js +0 -1
- package/dist/playbooks/service-build/reverse-mapping.d.ts +0 -66
- package/dist/playbooks/service-build/risk-aggregator.d.ts +0 -59
- package/dist/playbooks/service-build/service-panorama.d.ts +0 -229
- package/dist/playbooks/service-build/service-quote.d.ts +0 -2
- package/dist/playbooks/service-build/service-quote.spec.d.ts +0 -1
- package/dist/playbooks/service-build/service-quote.spec.js +0 -1
- package/dist/playbooks/service-build/topology-evaluation.spec.d.ts +0 -1
- package/dist/playbooks/service-build/topology-evaluation.spec.js +0 -1
- package/dist/playbooks/service-build/topology-query.d.ts +0 -25
- package/dist/playbooks/service-build/workflow-design-assessment.d.ts +0 -33
- package/dist/relationship/derivation.d.ts +0 -95
- package/dist/relationship/derivation.spec.d.ts +0 -1
- package/dist/relationship/derivation.spec.js +0 -1
- package/dist/relationship/incentive.d.ts +0 -38
- package/dist/relationship/index.d.ts +0 -4
- package/dist/relationship/registry.d.ts +0 -13
- package/dist/relationship/types.d.ts +0 -45
- package/dist/review/arb.d.ts +0 -4
- package/dist/review/demand.d.ts +0 -3
- package/dist/review/index.d.ts +0 -3
- package/dist/review/machine.d.ts +0 -3
- package/dist/review/order.d.ts +0 -8
- package/dist/review/progress.d.ts +0 -3
- package/dist/review/repository.d.ts +0 -3
- package/dist/review/service.d.ts +0 -5
- package/dist/review/types.d.ts +0 -163
- package/dist/role/derivation.d.ts +0 -35
- package/dist/role/index.d.ts +0 -6
- package/dist/role/intent.d.ts +0 -23
- package/dist/role/model.d.ts +0 -9
- package/dist/role/profiles.d.ts +0 -26
- package/dist/role/resolution.d.ts +0 -27
- package/dist/runtime/instance-registry.d.ts +0 -14
- package/dist/safety/index.d.ts +0 -3
- package/dist/schema/call/permission-handler.d.ts +0 -5
- package/dist/schema/call/semantic-customer-advice.spec.d.ts +0 -1
- package/dist/schema/call/semantic-customer-advice.spec.js +0 -1
- package/dist/schema/common/tokentype-short-probe.spec.d.ts +0 -1
- package/dist/schema/common/tokentype-short-probe.spec.js +0 -1
- package/dist/schema/envelope-unify.d.ts +0 -5
- package/dist/schema/goal/planning.d.ts +0 -742
- package/dist/schema/industry-pack/modes.d.ts +0 -447
- package/dist/schema/query/bi.d.ts +0 -3369
- package/dist/schema/utils/guard-query-utils.d.ts +0 -18
- package/dist/schema/utils/permission-index-utils.d.ts +0 -2
- package/dist/schema/utils/skills-recommendation.d.ts +0 -2
- package/dist/schema-query-impl/index.d.ts +0 -83
- package/dist/schemas/account_operation.output.json +0 -3869
- package/dist/schemas/ask_user.output.json +0 -54
- package/dist/schemas/benchmark_migration_operation.output.json +0 -1669
- package/dist/schemas/bridge_operation.output.json +0 -1548
- package/dist/schemas/config_operation.output.json +0 -896
- package/dist/schemas/employee_operation.output.json +0 -307
- package/dist/schemas/evaluation_operation.output.json +0 -4716
- package/dist/schemas/guard2file.output.json +0 -83
- package/dist/schemas/industry_pack_operation.output.json +0 -2985
- package/dist/schemas/intent_radar.output.json +0 -326
- package/dist/schemas/keeper_operation.output.json +0 -1441
- package/dist/schemas/local_cache_operation.output.json +0 -1718
- package/dist/schemas/local_history_operation.output.json +0 -1644
- package/dist/schemas/local_info_operation.output.json +0 -1530
- package/dist/schemas/local_mark_operation.output.json +0 -1622
- package/dist/schemas/machineNode2file.output.json +0 -88
- package/dist/schemas/messenger_operation.output.json +0 -4692
- package/dist/schemas/monitor_events.output.json +0 -1602
- package/dist/schemas/monitor_subscription.output.json +0 -1629
- package/dist/schemas/onchain_events.output.json +0 -4053
- package/dist/schemas/onchain_operations.output.json +0 -7788
- package/dist/schemas/onchain_table_data.output.json +0 -11868
- package/dist/schemas/permission_operation.output.json +0 -205
- package/dist/schemas/persona_operation.output.json +0 -64612
- package/dist/schemas/query_toolkit.output.json +0 -28302
- package/dist/schemas/schema_query.output.json +0 -81
- package/dist/schemas/service_clone_operation.output.json +0 -247
- package/dist/schemas/strategy_review_operation.output.json +0 -532
- package/dist/schemas/watch_operation.output.json +0 -930
- package/dist/schemas/wip_file.output.json +0 -360
- package/dist/schemas/workflow_operation.output.json +0 -422
- package/dist/schemas/workspace_operation.output.json +0 -477
- package/dist/schemas/wowok_buildin_info.output.json +0 -2477
- package/dist/strategy/collectors.d.ts +0 -66
- package/dist/strategy/collectors.spec.d.ts +0 -1
- package/dist/strategy/collectors.spec.js +0 -1
- package/dist/strategy/index.d.ts +0 -5
- package/dist/strategy/metrics.d.ts +0 -20
- package/dist/strategy/review.d.ts +0 -48
- package/dist/strategy/scorecard.d.ts +0 -32
- package/dist/strategy/store.d.ts +0 -26
- package/dist/task/ProcessStore.d.ts +0 -98
- package/dist/task/playbook.d.ts +0 -11
- package/dist/task/substep-trace.d.ts +0 -91
- package/dist/tools/build-fingerprint.d.ts +0 -28
- package/dist/tools/error-catalog.d.ts +0 -17
- package/dist/tools/handlers/ask-user.d.ts +0 -3
- package/dist/tools/handlers/benchmark-migration.d.ts +0 -121
- package/dist/tools/handlers/bridge.d.ts +0 -8
- package/dist/tools/handlers/config.d.ts +0 -2
- package/dist/tools/handlers/dispatch-expectations.d.ts +0 -2
- package/dist/tools/handlers/dispatch-expectations.spec.d.ts +0 -1
- package/dist/tools/handlers/dispatch-expectations.spec.js +0 -1
- package/dist/tools/handlers/employee.d.ts +0 -8
- package/dist/tools/handlers/employee.spec.d.ts +0 -1
- package/dist/tools/handlers/employee.spec.js +0 -1
- package/dist/tools/handlers/entry-edge-recipe.d.ts +0 -101
- package/dist/tools/handlers/escrow-deficit.d.ts +0 -10
- package/dist/tools/handlers/evaluation.d.ts +0 -2
- package/dist/tools/handlers/evaluation.spec.d.ts +0 -1
- package/dist/tools/handlers/evaluation.spec.js +0 -1
- package/dist/tools/handlers/file-export.d.ts +0 -3
- package/dist/tools/handlers/fund-rail-recipe.d.ts +0 -10
- package/dist/tools/handlers/goal.d.ts +0 -4
- package/dist/tools/handlers/industry-pack.d.ts +0 -3
- package/dist/tools/handlers/intent-radar.d.ts +0 -2
- package/dist/tools/handlers/keeper.d.ts +0 -12
- package/dist/tools/handlers/local.d.ts +0 -6
- package/dist/tools/handlers/mark-namespace.d.ts +0 -30
- package/dist/tools/handlers/messenger.d.ts +0 -24
- package/dist/tools/handlers/monitor.d.ts +0 -26
- package/dist/tools/handlers/name-resolution.d.ts +0 -4
- package/dist/tools/handlers/name-resolution.spec.d.ts +0 -1
- package/dist/tools/handlers/name-resolution.spec.js +0 -1
- package/dist/tools/handlers/network.d.ts +0 -1
- package/dist/tools/handlers/onchain-name-registration.d.ts +0 -49
- package/dist/tools/handlers/onchain-name-registration.spec.d.ts +0 -1
- package/dist/tools/handlers/onchain-name-registration.spec.js +0 -1
- package/dist/tools/handlers/onchain.d.ts +0 -132
- package/dist/tools/handlers/permission.d.ts +0 -2
- package/dist/tools/handlers/persona.d.ts +0 -4
- package/dist/tools/handlers/publish-binding-echo.d.ts +0 -22
- package/dist/tools/handlers/review-chain.d.ts +0 -19
- package/dist/tools/handlers/schema-query.d.ts +0 -2
- package/dist/tools/handlers/service-clone.d.ts +0 -20
- package/dist/tools/handlers/stale-build-check.d.ts +0 -9
- package/dist/tools/handlers/strategy-review.d.ts +0 -2
- package/dist/tools/handlers/submission-assembly.d.ts +0 -55
- package/dist/tools/handlers/watch.d.ts +0 -2
- package/dist/tools/handlers/winner-derivation.d.ts +0 -20
- package/dist/tools/handlers/wip-upload.d.ts +0 -22
- package/dist/tools/handlers/wip.d.ts +0 -2
- package/dist/tools/handlers/workflow.d.ts +0 -2
- package/dist/tools/handlers/workspace.d.ts +0 -4
- package/dist/tools/move-fn-index.gen.d.ts +0 -3
- package/dist/tools/publish-gate-state.d.ts +0 -5
- package/dist/tools/registry/agent.d.ts +0 -2
- package/dist/tools/registry/bridge.d.ts +0 -2
- package/dist/tools/registry/business.d.ts +0 -2
- package/dist/tools/registry/config.d.ts +0 -2
- package/dist/tools/registry/evaluation.d.ts +0 -2
- package/dist/tools/registry/files.d.ts +0 -2
- package/dist/tools/registry/identity.d.ts +0 -2
- package/dist/tools/registry/interaction.d.ts +0 -2
- package/dist/tools/registry/local.d.ts +0 -2
- package/dist/tools/registry/messenger.d.ts +0 -2
- package/dist/tools/registry/monitor.d.ts +0 -2
- package/dist/tools/registry/onchain.d.ts +0 -2
- package/dist/tools/registry/query.d.ts +0 -2
- package/dist/tools/retry.d.ts +0 -8
- package/dist/tools/rules-hook.d.ts +0 -5
- package/dist/tools/runtime-health.d.ts +0 -10
- package/dist/tools/sanitize-description-roundtrip.spec.d.ts +0 -1
- package/dist/tools/sanitize-description-roundtrip.spec.js +0 -1
- package/dist/tools/sanitize-output.d.ts +0 -4
- package/dist/tools/sanitize-output.spec.d.ts +0 -1
- package/dist/tools/sanitize-output.spec.js +0 -1
- package/dist/tools/shared.d.ts +0 -20
- package/dist/tools/transport-integrity.d.ts +0 -7
- package/dist/tools/upgrade-check.d.ts +0 -75
- package/dist/tools/wip-deploy-assist.d.ts +0 -34
- package/dist/tools/wip-verify-ledger.d.ts +0 -16
- package/dist/tools/wrap.d.ts +0 -45
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
declare const TemplateParamsFileSchema: z.ZodObject<{
|
|
3
|
-
version: z.ZodOptional<z.ZodNumber>;
|
|
4
|
-
comment: z.ZodOptional<z.ZodString>;
|
|
5
|
-
defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
6
|
-
templates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
|
|
7
|
-
}, z.core.$strict>;
|
|
8
|
-
export type TemplateParamsFileState = z.infer<typeof TemplateParamsFileSchema>;
|
|
9
|
-
export interface TemplateParamFileRead {
|
|
10
|
-
path: string;
|
|
11
|
-
exists: boolean;
|
|
12
|
-
error: string | null;
|
|
13
|
-
comment?: string;
|
|
14
|
-
defaults?: Record<string, number | string>;
|
|
15
|
-
templates?: Record<string, Record<string, number | string>>;
|
|
16
|
-
}
|
|
17
|
-
export declare function templateParamsFilePath(): string;
|
|
18
|
-
export declare function getTemplateParamFileState(): TemplateParamFileRead;
|
|
19
|
-
export declare function getTemplateParamFileLayer(templateId: string): Record<string, number | string>;
|
|
20
|
-
export declare function resetTemplateParamFileCache(): void;
|
|
21
|
-
export interface TemplateParamPatchChange {
|
|
22
|
-
path: string;
|
|
23
|
-
old: unknown;
|
|
24
|
-
new: unknown;
|
|
25
|
-
}
|
|
26
|
-
export interface TemplateParamPatchResult {
|
|
27
|
-
applied: true;
|
|
28
|
-
path: string;
|
|
29
|
-
backup_path: string | null;
|
|
30
|
-
changed: TemplateParamPatchChange[];
|
|
31
|
-
error: string | null;
|
|
32
|
-
}
|
|
33
|
-
export declare function patchTemplateParamFile(patch: unknown): TemplateParamPatchResult;
|
|
34
|
-
export interface TemplateParamClearResult {
|
|
35
|
-
cleared: boolean;
|
|
36
|
-
path: string;
|
|
37
|
-
scope: "file" | "defaults" | "template";
|
|
38
|
-
template_id?: string;
|
|
39
|
-
backup_path: string | null;
|
|
40
|
-
}
|
|
41
|
-
export declare function clearTemplateParamFile(template?: string): TemplateParamClearResult;
|
|
42
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{mkdtempSync,rmSync,writeFileSync,existsSync}from'node:fs';import{tmpdir}from'node:os';import{join}from'node:path';import{afterEach,beforeEach,describe,expect,it}from'vitest';import{getTemplateParamFileLayer,getTemplateParamFileState,patchTemplateParamFile,clearTemplateParamFile,resetTemplateParamFileCache,templateParamsFilePath}from'./template-params.js';let dir;beforeEach(()=>{dir=mkdtempSync(join(tmpdir(),'tpl-params-')),process['env']['WOWOK_CONFIG_DIR']=dir,resetTemplateParamFileCache();}),afterEach(()=>{delete process['env']['WOWOK_CONFIG_DIR'],resetTemplateParamFileCache(),rmSync(dir,{'recursive':!![],'force':!![]});}),describe('template-params\x20config\x20layer',()=>{it('is\x20inert\x20when\x20no\x20file\x20exists\x20({}\x20layer,\x20shipped\x20defaults\x20in\x20force)',()=>{const a=getTemplateParamFileState();expect(a['exists'])['toBe'](![]),expect(a['error'])['toBeNull'](),expect(getTemplateParamFileLayer('travel/global-ota'))['toEqual']({});}),it('patches\x20defaults\x20+\x20per-template\x20sections;\x20the\x20template\x20section\x20wins\x20over\x20defaults',()=>{const a=patchTemplateParamFile({'defaults':{'review_window_days':0x7,'platform_commission_bps':0x0},'templates':{'travel/global-ota':{'review_window_days':0x3}}});expect(a['applied'])['toBe'](!![]),expect(a['error'])['toBeNull'](),expect(existsSync(templateParamsFilePath()))['toBe'](!![]),expect(getTemplateParamFileLayer('freelance/agent-task'))['toEqual']({'review_window_days':0x7,'platform_commission_bps':0x0}),expect(getTemplateParamFileLayer('travel/global-ota'))['toEqual']({'review_window_days':0x3,'platform_commission_bps':0x0});}),it('deep-merges\x20a\x20second\x20patch\x20into\x20the\x20current\x20file\x20and\x20records\x20leaf\x20changes',()=>{patchTemplateParamFile({'defaults':{'review_window_days':0x7}});const a=patchTemplateParamFile({'defaults':{'escrow_release_days':0x2}});expect(a['changed']['map'](b=>b['path']))['toContain']('defaults.escrow_release_days'),expect(getTemplateParamFileLayer('retail/vertical-handmade'))['toEqual']({'review_window_days':0x7,'escrow_release_days':0x2});}),it('rejects\x20an\x20illegal\x20value\x20BEFORE\x20any\x20disk\x20write\x20(string\x20or\x20finite\x20non-negative\x20number\x20only)',()=>{expect(()=>patchTemplateParamFile({'defaults':{'review_window_days':-0x1}}))['toThrow'](),expect(()=>patchTemplateParamFile({'defaults':{'review_window_days':!![]}}))['toThrow'](),expect(existsSync(templateParamsFilePath()))['toBe'](![]);}),it('never\x20patches\x20over\x20an\x20existing\x20invalid\x20file\x20—\x20the\x20human\x20fixes\x20it\x20by\x20hand',()=>{writeFileSync(templateParamsFilePath(),'{\x20not\x20json','utf-8'),expect(()=>patchTemplateParamFile({'defaults':{'review_window_days':0x7}}))['toThrow'](/not a valid template-params document/);}),it('clears\x20one\x20template\x20section,\x20keeps\x20the\x20rest;\x20clears\x20the\x20whole\x20file\x20without\x20an\x20id',()=>{patchTemplateParamFile({'defaults':{'review_window_days':0x7},'templates':{'travel/global-ota':{'escrow_release_days':0x3},'retail/vertical-handmade':{}}});const a=clearTemplateParamFile('travel/global-ota');expect(a['cleared'])['toBe'](!![]),expect(a['scope'])['toBe']('template'),expect(getTemplateParamFileLayer('travel/global-ota'))['toEqual']({'review_window_days':0x7});const b=clearTemplateParamFile();expect(b['cleared'])['toBe'](!![]),expect(b['scope'])['toBe']('file'),expect(existsSync(templateParamsFilePath()))['toBe'](![]),expect(getTemplateParamFileLayer('retail/vertical-handmade'))['toEqual']({});});});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ENTRYPOINT } from "@wowok/wowok";
|
|
2
|
-
import { type Review } from "../knowledge/reputation-rules.js";
|
|
3
|
-
export type AccountEventPriority = "required" | "recommended" | "info" | "reminder";
|
|
4
|
-
export interface AccountEvent {
|
|
5
|
-
id: string;
|
|
6
|
-
category: string;
|
|
7
|
-
priority: AccountEventPriority;
|
|
8
|
-
title: string;
|
|
9
|
-
message: string;
|
|
10
|
-
action?: string;
|
|
11
|
-
object_ref?: string;
|
|
12
|
-
timestamp: number;
|
|
13
|
-
}
|
|
14
|
-
export interface AccountEventWatcherContext {
|
|
15
|
-
account?: string;
|
|
16
|
-
network?: ENTRYPOINT;
|
|
17
|
-
reviews?: Review[];
|
|
18
|
-
order_history?: Array<{
|
|
19
|
-
id: string;
|
|
20
|
-
status: string;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
export interface AccountEventWatcher {
|
|
24
|
-
id: string;
|
|
25
|
-
description: string;
|
|
26
|
-
applies?: (ctx: AccountEventWatcherContext) => boolean | Promise<boolean>;
|
|
27
|
-
watch: (ctx: AccountEventWatcherContext) => Promise<AccountEvent[]>;
|
|
28
|
-
}
|
|
29
|
-
export declare function registerAccountEventWatcher(watcher: AccountEventWatcher): boolean;
|
|
30
|
-
export declare function unregisterAccountEventWatcher(id: string): boolean;
|
|
31
|
-
export declare function listAccountEventWatchers(): AccountEventWatcher[];
|
|
32
|
-
export declare function runAccountEventWatchers(ctx: AccountEventWatcherContext, categories?: string[]): Promise<AccountEvent[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{toBase58}from'@wowok/wowok';import{DataType,newDb}from'pg-mem';import{afterEach,beforeEach,describe,expect,it}from'vitest';import{PostgresProjectionStore}from'../projection/store.js';import{PostgresSyncStore}from'../sync/store.js';import{createProjectionApi}from'./server.js';const digest=toBase58(new Uint8Array(0x20)['fill'](0x7)),objectId='0x14'+'01'['repeat'](0x1f);describe('projection\x20read-only\x20API',()=>{let a,b,c,d;beforeEach(async()=>{const e=newDb();e['public']['registerFunction']({'name':'pg_advisory_xact_lock','args':[DataType['integer'],DataType['integer']],'returns':DataType['integer'],'implementation':()=>0x0});const {Pool:f}=e['adapters']['createPg']();a=new PostgresProjectionStore(new f(),0x10),b=new PostgresSyncStore(new f()),await a['migrate'](),await b['migrate'](),await a['apply']({'chain_id':'chain_a','object_id':objectId,'object_version':'1','move_type':'0x2::service::Service<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/service-1','payload_hash':'0x'+'41'['repeat'](0x20),'payload_format':'json+bcs-v1','payload_json':{'name':'Indexed\x20service','stock':0x3},'checkpoint':'100','tx_digest':digest,'state':'active','observed_at':'2026-10-24T00:00:00.000Z'});const g=await b['start']({'chainId':'chain_a','stream':'graphql-shared:Service','scope':{'kind':'Service'},'checkpoint':'100'});await b['savePage']({'chainId':g['chainId'],'stream':g['stream'],'runId':g['runId'],'cursor':null,'checkpoint':'100','objects':[{'objectId':objectId,'objectVersion':0x1n}]}),await b['complete']({'chainId':g['chainId'],'stream':g['stream'],'runId':g['runId']}),c=createProjectionApi({'chainId':'chain_a','projection':a,'sync':b}),await new Promise(i=>c['listen'](0x0,'127.0.0.1',i));const h=c['address']();d='http://127.0.0.1:'+h['port'];}),afterEach(async()=>{await new Promise((e,f)=>{c['close'](g=>g?f(g):e());}),await a['close'](),await b['close']();}),it('returns\x20projection\x20and\x20persisted\x20sync\x20status',async()=>{const e=await fetch(d+'/v1/status'),f=await e['json']();expect(e['status'])['toBe'](0xc8),expect(f)['toMatchObject']({'chain_id':'chain_a','read_only':!![],'projection':{'active_objects':0x1,'coverage':{'complete':![]}},'sync':[{'state':'complete','pages':0x1,'objects':0x1}],'head':null,'freshness':null,'cdc':[]}),expect(f['watermarks'])['toEqual']([{'verified_kind':'Service','max_checkpoint':'100','active_objects':0x1}]);}),it('publishes\x20every\x20CDC\x20cursor\x20with\x20its\x20distance\x20from\x20head',async()=>{await b['setCdcCheckpoint']('chain_a','Service','100'),await b['setCdcCheckpoint']('chain_a','Demand','90');const e=createProjectionApi({'chainId':'chain_a','projection':a,'sync':b,'head':{'read':async()=>({'checkpoint':'200','observed_at':'2026-10-24T12:00:00.000Z','source':'probe'})}});await new Promise(g=>e['listen'](0x0,'127.0.0.1',g));const f=e['address']();try{const g=await(await fetch('http://127.0.0.1:'+f['port']+'/v1/status'))['json']();expect(g['cdc'])['toEqual']([{'kind':'Demand','checkpoint':'90','updated_at':expect['any'](String),'behind_head':'110'},{'kind':'Service','checkpoint':'100','updated_at':expect['any'](String),'behind_head':'100'}]);}finally{await new Promise((h,i)=>{e['close'](j=>j?i(j):h());});}}),it('reports\x20chain-head\x20lag\x20and\x20staleness\x20when\x20a\x20probe\x20is\x20configured',async()=>{const e=createProjectionApi({'chainId':'chain_a','projection':a,'sync':b,'staleLag':0x3,'head':{'read':async()=>({'checkpoint':'105','observed_at':'2026-10-24T12:00:00.000Z','source':'probe'})}});await new Promise(g=>e['listen'](0x0,'127.0.0.1',g));const f=e['address']();try{const g=await fetch('http://127.0.0.1:'+f['port']+'/v1/status'),h=await g['json']();expect(h['head'])['toMatchObject']({'checkpoint':'105','source':'probe'}),expect(h['freshness'])['toMatchObject']({'head_checkpoint':'105','projection_checkpoint':'100','head_lag':'5','stale':!![]}),expect(h['freshness']['projection_age_seconds'])['toBe'](0x0),expect(h['freshness']['version_observed_at'])['toBe']('2026-10-24T00:00:00.000Z');}finally{await new Promise((i,j)=>{e['close'](k=>k?j(k):i());});}}),it('scores\x20freshness\x20off\x20the\x20last\x20confirmed\x20round,\x20not\x20off\x20the\x20last\x20version\x20change',async()=>{const e=await b['start']({'chainId':'chain_a','stream':'graphql-shared:Service','scope':{'kind':'Service'},'checkpoint':'200'});await b['savePage']({'chainId':e['chainId'],'stream':e['stream'],'runId':e['runId'],'cursor':null,'checkpoint':'200','objects':[{'objectId':objectId,'objectVersion':0x1n}]}),await b['complete']({'chainId':e['chainId'],'stream':e['stream'],'runId':e['runId']});const f=createProjectionApi({'chainId':'chain_a','projection':a,'sync':b,'staleAgeSec':0x1,'head':{'read':async()=>({'checkpoint':'210','observed_at':new Date()['toISOString'](),'source':'probe'})}});await new Promise(h=>f['listen'](0x0,'127.0.0.1',h));const g=f['address']();try{const h=await(await fetch('http://127.0.0.1:'+g['port']+'/v1/status'))['json']();expect(h['freshness'])['toMatchObject']({'projection_checkpoint':'200','head_lag':'10','version_checkpoint':'100','version_observed_at':'2026-10-24T00:00:00.000Z','stale':![]}),expect(h['freshness']['projection_age_seconds'])['toBeLessThan'](0x3c);}finally{await new Promise((i,j)=>{f['close'](k=>k?j(k):i());});}}),it('splits\x20quarantined\x20facts\x20into\x20blocking\x20and\x20superseded',async()=>{const e=await a['apply']({'chain_id':'chain_a','object_id':objectId,'object_version':'1','move_type':'0x2::service::Service<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/service-other','payload_hash':'0x'+'42'['repeat'](0x20),'payload_format':'json+bcs-v1','checkpoint':'150','tx_digest':digest,'state':'active','observed_at':'2026-10-24T01:00:00.000Z'});expect(e['status'])['toBe']('conflict');const f=await a['apply']({'chain_id':'chain_a','object_id':'0x14'+'02'['repeat'](0x1f),'object_version':'7','move_type':'0x9::unknown::Unknown','owner_kind':'Shared','payload_uri':'test://raw/unknown-1','payload_hash':'0x'+'43'['repeat'](0x20),'payload_format':'json+bcs-v1','checkpoint':'160','tx_digest':digest,'state':'active','observed_at':'2026-10-24T02:00:00.000Z'});expect(f['status'])['toBe']('quarantined');const g=await(await fetch(d+'/v1/status'))['json']();expect(g['quarantine']['blocking'])['toBe'](0x1),expect(g['quarantine']['entries']['map'](h=>[h['reason_code'],h['blocking']]))['toEqual']([['UNSUPPORTED_OR_INVALID_MOVE_TYPE',!![]],['CONFLICTING_OBJECT_VERSION',![]]]),expect(g['quarantine']['entries'][0x1]['object_id'])['toBe'](objectId);}),it('calls\x20a\x20projection\x20stale\x20by\x20age\x20even\x20when\x20it\x20sits\x20on\x20the\x20chain\x20head',async()=>{for(const g of await b['status']('chain_a')){await b['fail'](g['chainId'],g['stream'],g['runId'],'simulated\x20timer\x20outage');}const e=createProjectionApi({'chainId':'chain_a','projection':a,'sync':b,'staleAgeSec':0x1,'head':{'read':async()=>({'checkpoint':'100','observed_at':'2026-10-24T12:00:00.000Z','source':'probe'})}});await new Promise(h=>e['listen'](0x0,'127.0.0.1',h));const f=e['address']();try{const h=await(await fetch('http://127.0.0.1:'+f['port']+'/v1/status'))['json']();expect(h['freshness'])['toMatchObject']({'head_lag':'0','stale':!![]}),expect(h['projection']['observed_at'])['toBe']('2026-10-24T00:00:00.000Z');}finally{await new Promise((i,j)=>{e['close'](k=>k?j(k):i());});}}),it('lists\x20current\x20objects\x20with\x20coverage\x20and\x20version\x20metadata',async()=>{const e=await fetch(d+'/v1/objects?kind=Service&limit=1'),f=await e['json']();expect(e['status'])['toBe'](0xc8),expect(f['objects'])['toHaveLength'](0x1),expect(f['objects'][0x0])['toMatchObject']({'objectId':objectId,'objectVersion':'1','verifiedKind':'Service','payloadJson':{'name':'Indexed\x20service','stock':0x3}}),expect(f['coverage'])['toMatchObject']({'mode':'known_objects','complete':![]}),expect(e['headers']['get']('cache-control'))['toBe']('no-store');}),it('rejects\x20invalid\x20selectors\x20without\x20exposing\x20internal\x20errors',async()=>{const e=await fetch(d+'/v1/objects?kind=Unknown'),f=await fetch(d+'/v1/objects?cursor=invalid'),g=await fetch(d+'/v1/objects?shard_count=16');expect(e['status'])['toBe'](0x190),expect(f['status'])['toBe'](0x190),expect(g['status'])['toBe'](0x190),expect(await e['json']())['toEqual']({'error':{'code':'BAD_REQUEST','message':'Unknown\x20object\x20kind:\x20Unknown'}});}),it('exposes\x20graph\x20edges\x20with\x20orphan\x20annotation',async()=>{const e='0x15'+'02'['repeat'](0x1f);await a['apply']({'chain_id':'chain_a','object_id':objectId,'object_version':'2','move_type':'0x2::service::Service<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/service-2','payload_hash':'0x'+'43'['repeat'](0x20),'payload_format':'rpc-content-v1','payload_json':{'machine':e,'name':'Indexed\x20service'},'checkpoint':'101','tx_digest':digest,'state':'active','observed_at':'2026-10-24T01:00:00.000Z'});const f=await fetch(d+'/v1/edges?src='+objectId),g=await f['json']();expect(f['status'])['toBe'](0xc8),expect(g)['toMatchObject']({'direction':'out','object_id':objectId,'orphan_count':0x1}),expect(g['edges'])['toEqual']([{'src':objectId,'srcKind':'Service','edge':'machine','dst':e,'dstKind':'Machine','objectVersion':'2','dstProjected':![]}]);const h=await fetch(d+'/v1/edges?dst='+e),i=await h['json']();expect(h['status'])['toBe'](0xc8),expect(i['direction'])['toBe']('in'),expect(i['edges'][0x0])['toMatchObject']({'src':objectId,'edge':'machine'});const j=await fetch(d+'/v1/edges'),k=await fetch(d+'/v1/edges?src=invalid');expect(j['status'])['toBe'](0x190),expect(k['status'])['toBe'](0x190);}),it('has\x20no\x20write\x20or\x20catch-all\x20endpoints',async()=>{const e=await fetch(d+'/v1/objects',{'method':'POST','body':'{}'}),f=await fetch(d+'/v1/unknown');expect(e['status'])['toBe'](0x195),expect(e['headers']['get']('allow'))['toBe']('GET'),expect(f['status'])['toBe'](0x194);});}),describe('match\x20API',()=>{let a,b,c,d;const e=j=>'0x14'+j['repeat'](0x1f),f=e('01'),g=e('02'),h=e('03');function i(j,k,l){return{'chain_id':'chain_a','object_id':j,'object_version':k,'move_type':'0x2::service::Service<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/'+j+'-'+k,'payload_hash':'0x'+'41'['repeat'](0x20),'payload_format':'rpc-content-v1','payload_json':l,'checkpoint':'100','tx_digest':toBase58(new Uint8Array(0x20)['fill'](0x7)),'state':'active','observed_at':'2026-10-24T00:00:00.000Z'};}beforeEach(async()=>{const j=newDb();j['public']['registerFunction']({'name':'pg_advisory_xact_lock','args':[DataType['integer'],DataType['integer']],'returns':DataType['integer'],'implementation':()=>0x0});const {Pool:k}=j['adapters']['createPg']();a=new PostgresProjectionStore(new k(),0x10),b=new PostgresSyncStore(new k()),await a['migrate'](),await b['migrate'](),await a['apply'](i(f,'1',{'description':'Exclusive\x20beat\x20license\x20for\x20hip\x20hop\x20producers','location':'remote','sales':[{'fields':{'name':'Beat\x20License','price':'6000000000','wip_hash':'0xabc'}}],'arbitrations':['0x12'+'04'['repeat'](0x1f)],'compensation_fund':'1000000000','machine':'0x15'+'05'['repeat'](0x1f),'um':'0x24'+'06'['repeat'](0x1f),'bPublished':!![],'bPaused':![]})),await a['apply'](i(g,'1',{'description':'Coffee\x20shop\x20interior\x20mural\x20painting','location':'Shanghai','sales':[{'fields':{'name':'Mural','price':'15000000000'}}],'arbitrations':[],'compensation_fund':'0','bPublished':!![],'bPaused':![]})),await a['apply'](i(h,'1',{'description':'Beat\x20store\x20on\x20holiday','sales':[{'fields':{'name':'Beat\x20Pack','price':'1000000000'}}],'bPublished':!![],'bPaused':!![]})),c=createProjectionApi({'chainId':'chain_a','projection':a,'sync':b}),await new Promise(l=>c['listen'](0x0,'127.0.0.1',l)),d='http://127.0.0.1:'+c['address']()['port'];}),afterEach(async()=>{await new Promise((j,k)=>{c['close'](l=>l?k(l):j());}),await a['close'](),await b['close']();}),it('matches\x20materialized\x20facets\x20end-to-end\x20with\x20honest\x20coverage',async()=>{const j=new URLSearchParams({'kind':'Service','q':'beat\x20license','capabilities':'has_arbitration','budget':'10','limit':'10'}),k=await fetch(d+'/v1/match?'+j),l=await k['json']();expect(k['status'])['toBe'](0xc8),expect(l['chain_id'])['toBe']('chain_a'),expect(l['policy_version'])['toBe']('public-baseline-1'),expect(l['coverage'])['toMatchObject']({'mode':'known_objects','complete':![]}),expect(l['recall'])['toMatchObject']({'live_set':0x3,'gated':0x2,'merged':0x2,'channels_active':['structured','bm25']}),expect(l['candidates']['map'](o=>o['object_id']))['toEqual']([f,g]);const m=l['candidates'][0x0];expect(m['server_evaluation']['policy_version'])['toBe']('public-baseline-1'),expect(m['server_evaluation']['total'])['toBe'](0x64),expect(m['server_evaluation']['unknown_rules']['some'](o=>o['startsWith']('trust:')))['toBe'](!![]),expect(m['public_features']['capabilities'])['toContain']('has_refund_path');const n=l['candidates'][0x1];expect(n['server_evaluation']['red_flags'])['toEqual'](['price_over_budget','missing_capability:has_arbitration']);}),it('rejects\x20invalid\x20match\x20parameters',async()=>{const j=['/v1/match','/v1/match?kind=Arb','/v1/match?kind=Service&capabilities=has_wings','/v1/match?kind=Service&budget=abc','/v1/match?kind=Service&budget=1.2345678901','/v1/match?kind=Service&budget=-5','/v1/match?kind=Service&limit=0','/v1/match?kind=Service&limit=101','/v1/match?kind=Service&recall_limit=1001'];for(const k of j){const l=await fetch(''+d+k);expect(l['status'],k)['toBe'](0x190),expect((await l['json']())['error']['code'])['toBe']('BAD_REQUEST');}});}),describe('projection\x20aggregate\x20API\x20(S17-C\x20F-RQD2-06\x20cross-order\x20view)',()=>{let a,b,c,d;const e='0x14'+'aa'['repeat'](0x1f),f='0x14'+'bb'['repeat'](0x1f),g='0x15'+'cc'['repeat'](0x1f),h='0x12'+'dd'['repeat'](0x1f),i='0x00'+'11'['repeat'](0x1f),j='0x00'+'22'['repeat'](0x1f),k=o=>'0x16'+String(o)['padStart'](0x2,'0')['repeat'](0x1f),l=toBase58(new Uint8Array(0x20)['fill'](0x9));async function m(n,o){await a['apply']({'chain_id':'chain_a','object_id':n,'object_version':'1','move_type':'0x2::order::Order<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/'+n,'payload_hash':'0x'+'42'['repeat'](0x20),'payload_format':'rpc-content-v1','payload_json':{'service':o['service'],...o['machine']?{'machine':o['machine']}:{},'amount':o['amount'],'owner':o['owner'],'claimed_by':o['claimed_by']??null,'time':0x1a18a4d1565},'checkpoint':'200','tx_digest':l,'state':'active','observed_at':'2026-10-31T00:00:00.000Z'});}beforeEach(async()=>{const n=newDb();n['public']['registerFunction']({'name':'pg_advisory_xact_lock','args':[DataType['integer'],DataType['integer']],'returns':DataType['integer'],'implementation':()=>0x0});const {Pool:o}=n['adapters']['createPg']();a=new PostgresProjectionStore(new o(),0x10),b=new PostgresSyncStore(new o()),await a['migrate'](),await b['migrate'](),await m(k(0x1),{'service':e,'amount':'6000000000','owner':i}),await m(k(0x2),{'service':e,'amount':'6000000000','owner':j}),await m(k(0x3),{'service':e,'amount':'6000000000','owner':i,'claimed_by':h}),await m(k(0x4),{'service':f,'machine':g,'amount':'1000000000','owner':j}),c=createProjectionApi({'chainId':'chain_a','projection':a,'sync':b}),await new Promise(p=>c['listen'](0x0,'127.0.0.1',p)),d='http://127.0.0.1:'+c['address']()['port'];}),afterEach(async()=>{await new Promise((n,o)=>{c['close'](p=>p?o(p):n());}),await a['close'](),await b['close']();}),it('aggregates\x20orders\x20per\x20service\x20with\x20totals\x20and\x20the\x20coverage\x20watermark',async()=>{const n=await fetch(d+'/v1/aggregate?kind=Order'),o=await n['json']();expect(n['status'])['toBe'](0xc8),expect(o)['toMatchObject']({'chain_id':'chain_a','kind':'Order','group':'service','group_id':null,'metric':'amount','exclude_claimed':![],'rows':[{'group_id':e,'count':0x3,'metric_sum':'18000000000','max_checkpoint':'200'},{'group_id':f,'count':0x1,'metric_sum':'1000000000','max_checkpoint':'200'}],'totals':{'count':0x4,'metric_sum':'19000000000'},'truncated':![]}),expect(o['coverage'])['toMatchObject']({'mode':'known_objects','chain_id':'chain_a'});}),it('answers\x20the\x20target\x20check:\x20single\x20group\x20with\x20claimed\x20orders\x20excluded',async()=>{const n=new URLSearchParams({'kind':'Order','group_id':e,'exclude_claimed':'1'}),o=await(await fetch(d+'/v1/aggregate?'+n))['json']();expect(o['rows'])['toEqual']([{'group_id':e,'count':0x2,'metric_sum':'12000000000','max_checkpoint':'200'}]),expect(o['totals'])['toEqual']({'count':0x2,'metric_sum':'12000000000'});}),it('aggregates\x20by\x20the\x20owner\x20dimension',async()=>{const n=await(await fetch(d+'/v1/aggregate?kind=Order&group=owner'))['json']();expect(n['rows'])['toEqual']([{'group_id':i,'count':0x2,'metric_sum':'12000000000','max_checkpoint':'200'},{'group_id':j,'count':0x2,'metric_sum':'7000000000','max_checkpoint':'200'}]);}),it('returns\x20an\x20empty\x20honest\x20aggregate\x20when\x20nothing\x20is\x20projected',async()=>{const n=newDb();n['public']['registerFunction']({'name':'pg_advisory_xact_lock','args':[DataType['integer'],DataType['integer']],'returns':DataType['integer'],'implementation':()=>0x0});const {Pool:o}=n['adapters']['createPg'](),p=new PostgresProjectionStore(new o(),0x10);await p['migrate']();try{const q=createProjectionApi({'chainId':'chain_a','projection':p,'sync':b});await new Promise(s=>q['listen'](0x0,'127.0.0.1',s));const r=q['address']()['port'];try{const s=await(await fetch('http://127.0.0.1:'+r+'/v1/aggregate?kind=Order'))['json']();expect(s['rows'])['toEqual']([]),expect(s['totals'])['toEqual']({'count':0x0,'metric_sum':'0'}),expect(s['coverage'])['toMatchObject']({'chain_id':'chain_a'});}finally{await new Promise((t,u)=>{q['close'](v=>v?u(v):t());});}}finally{await p['close']();}}),it('rejects\x20invalid\x20aggregate\x20parameters',async()=>{const n=['/v1/aggregate','/v1/aggregate?kind=Arb','/v1/aggregate?kind=Order&group=progress','/v1/aggregate?kind=Order&metric=allocation','/v1/aggregate?kind=Order&group_id=not-an-address','/v1/aggregate?kind=Order&exclude_claimed=maybe','/v1/aggregate?kind=Order&limit=0','/v1/aggregate?kind=Order&limit=1001'];for(const o of n){const p=await fetch(''+d+o);expect(p['status'],o)['toBe'](0x190),expect((await p['json']())['error']['code'])['toBe']('BAD_REQUEST');}});});
|
package/dist/data/api/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/data/api/head.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface ChainHeadState {
|
|
2
|
-
checkpoint: string | null;
|
|
3
|
-
observed_at: string | null;
|
|
4
|
-
source: "probe" | "cache" | null;
|
|
5
|
-
error?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ChainHeadProbe {
|
|
8
|
-
read(): Promise<ChainHeadState>;
|
|
9
|
-
}
|
|
10
|
-
interface HeadProbeOptions {
|
|
11
|
-
cacheMs?: number;
|
|
12
|
-
timeoutMs?: number;
|
|
13
|
-
fetchImpl?: typeof fetch;
|
|
14
|
-
}
|
|
15
|
-
export declare function createChainHeadProbe(rpcUrl: string, options?: HeadProbeOptions): ChainHeadProbe;
|
|
16
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{describe,expect,it,vi}from'vitest';import{createChainHeadProbe}from'./head.js';function jsonResponse(a,b=0xc8){return new Response(JSON['stringify'](a),{'status':b,'headers':{'Content-Type':'application/json'}});}describe('createChainHeadProbe',()=>{it('reads\x20the\x20latest\x20checkpoint\x20through\x20JSON-RPC',async()=>{const a=vi['fn'](async(e,f)=>jsonResponse({'jsonrpc':'2.0','id':0x1,'result':'12345'})),b=createChainHeadProbe('http://127.0.0.1:9000',{'fetchImpl':a}),c=await b['read']();expect(c)['toMatchObject']({'checkpoint':'12345','source':'probe'});const d=a['mock']['calls'][0x0][0x1];expect(JSON['parse'](String(d?.['body']))['method'])['toBe']('w_getLatestCheckpointSequenceNumber');}),it('serves\x20repeated\x20reads\x20from\x20cache\x20within\x20the\x20cache\x20window',async()=>{const a=vi['fn'](async()=>jsonResponse({'jsonrpc':'2.0','id':0x1,'result':'7'})),b=createChainHeadProbe('http://127.0.0.1:9000',{'cacheMs':0xea60,'fetchImpl':a});await b['read']();const c=await b['read']();expect(c)['toMatchObject']({'checkpoint':'7','source':'cache'}),expect(a)['toHaveBeenCalledTimes'](0x1);}),it('degrades\x20to\x20a\x20null\x20checkpoint\x20when\x20the\x20endpoint\x20fails',async()=>{const a=vi['fn'](async()=>{throw new Error('connect\x20ECONNREFUSED');}),b=createChainHeadProbe('http://127.0.0.1:9000',{'fetchImpl':a}),c=await b['read']();expect(c['checkpoint'])['toBeNull'](),expect(c['source'])['toBeNull'](),expect(c['error'])['toContain']('ECONNREFUSED');}),it('degrades\x20on\x20JSON-RPC\x20errors\x20and\x20malformed\x20results',async()=>{const a=createChainHeadProbe('http://x',{'fetchImpl':vi['fn'](async()=>jsonResponse({'jsonrpc':'2.0','id':0x1,'error':{'message':'method\x20not\x20found'}}))});expect(await a['read']())['toMatchObject']({'checkpoint':null,'error':'method\x20not\x20found'});const b=createChainHeadProbe('http://x',{'fetchImpl':vi['fn'](async()=>jsonResponse({'jsonrpc':'2.0','id':0x1,'result':'not-a-number'}))});expect((await b['read']())['checkpoint'])['toBeNull']();});});
|
package/dist/data/api/index.d.ts
DELETED
package/dist/data/api/match.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { ObjectFacetRow } from "../projection/types.js";
|
|
2
|
-
export declare const PUBLIC_POLICY_VERSION = "public-baseline-1";
|
|
3
|
-
export declare const KNOWN_CAPABILITIES: readonly ["has_arbitration", "has_refund_path", "has_milestone_nodes", "has_compensation_fund", "has_wip_verification", "has_messenger", "has_buy_guard"];
|
|
4
|
-
declare const DIMENSION_WEIGHTS: {
|
|
5
|
-
readonly text: 30;
|
|
6
|
-
readonly region: 15;
|
|
7
|
-
readonly industry: 20;
|
|
8
|
-
readonly price: 15;
|
|
9
|
-
readonly capabilities: 20;
|
|
10
|
-
};
|
|
11
|
-
export interface MatchQuery {
|
|
12
|
-
kind: "Service" | "Demand";
|
|
13
|
-
q?: string;
|
|
14
|
-
location?: string;
|
|
15
|
-
budgetWei?: string;
|
|
16
|
-
industry?: string;
|
|
17
|
-
capabilities?: string[];
|
|
18
|
-
limit?: number;
|
|
19
|
-
recallLimit?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface MatchBreakdownEntry {
|
|
22
|
-
dimension: keyof typeof DIMENSION_WEIGHTS;
|
|
23
|
-
weight: number;
|
|
24
|
-
score: number | null;
|
|
25
|
-
}
|
|
26
|
-
export interface MatchServerEvaluation {
|
|
27
|
-
policy_version: typeof PUBLIC_POLICY_VERSION;
|
|
28
|
-
total: number;
|
|
29
|
-
breakdown: MatchBreakdownEntry[];
|
|
30
|
-
unknown_rules: string[];
|
|
31
|
-
red_flags: string[];
|
|
32
|
-
}
|
|
33
|
-
export interface MatchCandidate {
|
|
34
|
-
object_id: string;
|
|
35
|
-
verified_kind: string;
|
|
36
|
-
object_version: string;
|
|
37
|
-
facet_version: string;
|
|
38
|
-
channels: string[];
|
|
39
|
-
rrf: number;
|
|
40
|
-
public_features: {
|
|
41
|
-
industry: string | null;
|
|
42
|
-
industry_confidence: number;
|
|
43
|
-
location: string | null;
|
|
44
|
-
price_min: string | null;
|
|
45
|
-
price_max: string | null;
|
|
46
|
-
capabilities: string[];
|
|
47
|
-
published: boolean;
|
|
48
|
-
paused: boolean;
|
|
49
|
-
keywords: string[];
|
|
50
|
-
};
|
|
51
|
-
server_evaluation: MatchServerEvaluation;
|
|
52
|
-
}
|
|
53
|
-
export interface MatchResult {
|
|
54
|
-
policy_version: typeof PUBLIC_POLICY_VERSION;
|
|
55
|
-
kind: string;
|
|
56
|
-
query: MatchQuery;
|
|
57
|
-
recall: {
|
|
58
|
-
live_set: number;
|
|
59
|
-
gated: number;
|
|
60
|
-
structured: number;
|
|
61
|
-
bm25: number;
|
|
62
|
-
merged: number;
|
|
63
|
-
channels_active: string[];
|
|
64
|
-
};
|
|
65
|
-
candidates: MatchCandidate[];
|
|
66
|
-
truncated: boolean;
|
|
67
|
-
}
|
|
68
|
-
export declare function runMatch(facets: ObjectFacetRow[], query: MatchQuery): MatchResult;
|
|
69
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{describe,expect,it}from'vitest';import{tokenize}from'../projection/facets.js';import{PUBLIC_POLICY_VERSION,runMatch}from'./match.js';function facetRow(a={}){return{'objectId':'0xaa01','verifiedKind':'Service','objectVersion':'1','facetVersion':'facets-1','industry':null,'industryConfidence':0x0,'location':null,'priceMin':null,'priceMax':null,'capabilities':[],'published':!![],'paused':![],'nameTokens':[],'textTokens':[],'keywords':[],'checkpoint':'100',...a};}const S1=facetRow({'objectId':'0xs1','nameTokens':tokenize('Exclusive\x20Beat\x20License'),'textTokens':[...tokenize('urban\x20hip\x20hop\x20beats\x20and\x20exclusive\x20beat\x20license'),...tokenize('Exclusive\x20Beat\x20License')],'capabilities':['has_arbitration','has_refund_path'],'priceMin':'6000000000','priceMax':'7500000000','location':'remote'}),S2=facetRow({'objectId':'0xs2','textTokens':tokenize('license\x20agreement\x20covering\x20third\x20party\x20beats'),'priceMin':'15000000000','priceMax':'15000000000','location':'Shanghai'}),S3=facetRow({'objectId':'0xs3','textTokens':tokenize('coffee\x20shop\x20interior\x20painting')}),PAUSED=facetRow({'objectId':'0xpaused','published':!![],'paused':!![]}),UNPUBLISHED=facetRow({'objectId':'0xunpub','published':![]}),DEMAND=facetRow({'objectId':'0xdemand','verifiedKind':'Demand'}),POOL=[S1,S2,S3,PAUSED,UNPUBLISHED,DEMAND],FULL_QUERY={'kind':'Service','q':'beat\x20license','capabilities':['has_arbitration'],'budgetWei':'10000000000','limit':0xa};describe('runMatch\x20hard\x20gate',()=>{it('admits\x20only\x20active-published\x20objects\x20of\x20the\x20requested\x20kind',()=>{const a=runMatch(POOL,FULL_QUERY);expect(a['recall']['live_set'])['toBe'](0x5),expect(a['recall']['gated'])['toBe'](0x3),expect(a['candidates']['map'](b=>b['object_id']))['toEqual'](['0xs1','0xs2','0xs3']);});}),describe('runMatch\x20recall\x20channels',()=>{it('runs\x20bm25\x20only\x20for\x20a\x20non-empty\x20tokenizable\x20query',()=>{const a=runMatch(POOL,{'kind':'Service','q':'beat\x20license','limit':0xa});expect(a['recall']['channels_active'])['toEqual'](['bm25']),expect(a['candidates']['map'](d=>d['object_id']))['toEqual'](['0xs1','0xs2']);const b=runMatch(POOL,{'kind':'Service','q':'the\x20and\x20of','limit':0xa});expect(b['recall']['channels_active'])['toEqual']([]),expect(b['recall']['merged'])['toBe'](0x3);}),it('runs\x20structured\x20only\x20when\x20a\x20structured\x20condition\x20exists',()=>{const a=runMatch(POOL,{'kind':'Service','capabilities':['has_arbitration'],'limit':0xa});expect(a['recall']['channels_active'])['toEqual'](['structured']),expect(a['recall']['structured'])['toBe'](0x3),expect(a['candidates'][0x0]['object_id'])['toBe']('0xs1');}),it('fuses\x20both\x20channels\x20with\x20RRF\x20and\x20records\x20membership',()=>{const a=runMatch(POOL,FULL_QUERY),b=a['candidates']['find'](d=>d['object_id']==='0xs1'),c=a['candidates']['find'](d=>d['object_id']==='0xs3');expect(b['channels'])['toEqual'](['bm25','structured']),expect(b['rrf'])['toBeCloseTo'](0x2/0x3d,0xa),expect(c['channels'])['toEqual'](['structured']),expect(a['recall']['bm25'])['toBe'](0x2),expect(a['recall']['merged'])['toBe'](0x3);});}),describe('runMatch\x20public\x20evaluation\x20(public-baseline-1)',()=>{it('ranks\x20the\x20semantically-fitting\x20store\x20first\x20with\x20an\x20honest\x20breakdown',()=>{const a=runMatch(POOL,FULL_QUERY);expect(a['policy_version'])['toBe'](PUBLIC_POLICY_VERSION);const b=a['candidates'][0x0];expect(b['object_id'])['toBe']('0xs1'),expect(b['server_evaluation']['total'])['toBe'](0x64),expect(b['server_evaluation']['red_flags'])['toEqual']([]);const c=Object['fromEntries'](b['server_evaluation']['breakdown']['map'](d=>[d['dimension'],d['score']]));expect(c)['toEqual']({'text':0x64,'region':null,'industry':null,'price':0x64,'capabilities':0x64});}),it('flags\x20over-budget\x20prices\x20and\x20missing\x20capabilities\x20instead\x20of\x20hiding\x20them',()=>{const a=runMatch(POOL,FULL_QUERY),b=a['candidates']['find'](d=>d['object_id']==='0xs2');expect(b['server_evaluation']['red_flags'])['toEqual'](['price_over_budget','missing_capability:has_arbitration']);const c=Object['fromEntries'](b['server_evaluation']['breakdown']['map'](d=>[d['dimension'],d['score']]));expect(c['price'])['toBe'](0x0),expect(c['capabilities'])['toBe'](0x0);}),it('never\x20presents\x20trust\x20as\x20a\x20fact\x20and\x20reports\x20unknown\x20dimensions',()=>{const a=runMatch(POOL,{'kind':'Service','q':'beat\x20license','limit':0xa});for(const b of a['candidates']){expect(b['server_evaluation']['unknown_rules']['some'](d=>d['startsWith']('trust:')))['toBe'](!![]);const c=Object['fromEntries'](b['server_evaluation']['breakdown']['map'](d=>[d['dimension'],d['score']]));expect(c['region'])['toBeNull'](),expect(c['industry'])['toBeNull'](),expect(c['price'])['toBeNull'](),expect(b['server_evaluation']['unknown_rules'])['toContain']('region:\x20no\x20location\x20supplied\x20in\x20query');}}),it('scores\x20region\x20relations\x20on\x20the\x20frozen\x20scale',()=>{const a=runMatch(POOL,{'kind':'Service','location':'remote','limit':0xa}),b=a['candidates']['find'](f=>f['object_id']==='0xs1'),c=a['candidates']['find'](f=>f['object_id']==='0xs2'),d=a['candidates']['find'](f=>f['object_id']==='0xs3'),e=f=>f['server_evaluation']['breakdown']['find'](g=>g['dimension']==='region')['score'];expect(e(b))['toBe'](0x3c),expect(e(c))['toBe'](0x3c),expect(e(d))['toBeNull'](),expect(d['server_evaluation']['unknown_rules'])['toContain']('region:\x20candidate\x20location\x20unknown');});}),describe('runMatch\x20ordering\x20and\x20paging',()=>{it('orders\x20by\x20total\x20DESC,\x20rrf\x20DESC,\x20object_id\x20ASC',()=>{const a=[facetRow({'objectId':'0xbbb','textTokens':tokenize('beat')}),facetRow({'objectId':'0xaaa','textTokens':tokenize('beat')})],b=runMatch(a,{'kind':'Service','q':'beat','limit':0xa});expect(b['candidates']['map'](d=>d['object_id']))['toEqual'](['0xaaa','0xbbb']),expect(b['candidates'][0x0]['server_evaluation']['total'])['toBe'](b['candidates'][0x1]['server_evaluation']['total']);}),it('falls\x20back\x20to\x20the\x20full\x20gated\x20set\x20with\x20rrf\x200\x20when\x20no\x20channel\x20is\x20active',()=>{const a=runMatch(POOL,{'kind':'Service','limit':0x2});expect(a['recall']['channels_active'])['toEqual']([]),expect(a['recall']['merged'])['toBe'](0x3),expect(a['candidates'])['toHaveLength'](0x2),expect(a['truncated'])['toBe'](!![]),expect(a['candidates']['every'](b=>b['rrf']===0x0))['toBe'](!![]),expect(a['candidates']['map'](b=>b['object_id']))['toEqual'](['0xs1','0xs2']);}),it('is\x20deterministic\x20across\x20repeated\x20runs',()=>{const a=JSON['stringify'](runMatch(POOL,FULL_QUERY));for(let b=0x0;b<0x14;b+=0x1){expect(JSON['stringify'](runMatch(POOL,FULL_QUERY)))['toBe'](a);}});});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Server } from "node:http";
|
|
2
|
-
import type { PostgresProjectionStore } from "../projection/store.js";
|
|
3
|
-
import type { PostgresSyncStore } from "../sync/store.js";
|
|
4
|
-
import type { ChainHeadProbe } from "./head.js";
|
|
5
|
-
export interface ProjectionApiOptions {
|
|
6
|
-
chainId: string;
|
|
7
|
-
projection: PostgresProjectionStore;
|
|
8
|
-
sync: PostgresSyncStore;
|
|
9
|
-
head?: ChainHeadProbe;
|
|
10
|
-
staleLag?: number;
|
|
11
|
-
staleAgeSec?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare function createProjectionApi(options: ProjectionApiOptions): Server;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface GraphEdgeRef {
|
|
2
|
-
src: string;
|
|
3
|
-
srcKind: string;
|
|
4
|
-
edge: string;
|
|
5
|
-
dst: string;
|
|
6
|
-
dstKind: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function extractGraphEdges(verifiedKind: string, objectId: string, payloadJson: Record<string, unknown> | null | undefined): GraphEdgeRef[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{toBase58}from'@wowok/wowok';import{DataType,newDb}from'pg-mem';import{afterEach,beforeEach,describe,expect,it}from'vitest';import{extractGraphEdges}from'./edges.js';import{PostgresProjectionStore}from'./store.js';const digest=toBase58(new Uint8Array(0x20)['fill'](0x7));function objectId(a,b){return'0x'+a['toString'](0x10)['padStart'](0x2,'0')+b['toString'](0x10)['padStart'](0x2,'0')['repeat'](0x1f);}const SERVICE_ID=objectId(0x14,0x1),MACHINE_ID=objectId(0x15,0x2),UM_ID=objectId(0x24,0x3),PERM_ID=objectId(0x40,0x4),GUARD_ID=objectId(0x41,0x5),REWARD_ID=objectId(0x42,0x6),ARB_ID=objectId(0x12,0x7),ARB_TARGET=objectId(0x12,0xb),REPO_ID=objectId(0x11,0x8),ORDER_ID=objectId(0x30,0x9),SERVICE_PAYLOAD={'id':{'id':SERVICE_ID},'um':UM_ID,'machine':MACHINE_ID,'permission':PERM_ID,'buy_guard':GUARD_ID,'rewards':[REWARD_ID,'not-an-address'],'arbitrations':[ARB_ID],'repositories':[REPO_ID],'sales':[{'fields':{'wip':'https://wip.example/f/hash'}}]};function fact(a={}){return{'chain_id':'chain_a','object_id':SERVICE_ID,'object_version':'1','move_type':'0x2::service::Service<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/service-1','payload_hash':'0x'+'41'['repeat'](0x20),'payload_format':'rpc-content-v1','checkpoint':'100','tx_digest':digest,'state':'active','observed_at':'2026-10-24T00:00:00.000Z',...a};}describe('extractGraphEdges',()=>{it('extracts\x20Service\x20static\x20references\x20from\x20real\x20payload\x20shape',()=>{const a=extractGraphEdges('Service',SERVICE_ID,SERVICE_PAYLOAD);expect(a)['toEqual']([{'src':SERVICE_ID,'srcKind':'Service','edge':'um','dst':UM_ID,'dstKind':'UM'},{'src':SERVICE_ID,'srcKind':'Service','edge':'machine','dst':MACHINE_ID,'dstKind':'Machine'},{'src':SERVICE_ID,'srcKind':'Service','edge':'permission','dst':PERM_ID,'dstKind':'Permission'},{'src':SERVICE_ID,'srcKind':'Service','edge':'buy_guard','dst':GUARD_ID,'dstKind':'Guard'},{'src':SERVICE_ID,'srcKind':'Service','edge':'rewards','dst':REWARD_ID,'dstKind':'Reward'},{'src':SERVICE_ID,'srcKind':'Service','edge':'arbitrations','dst':ARB_ID,'dstKind':'Arbitration'},{'src':SERVICE_ID,'srcKind':'Service','edge':'repositories','dst':REPO_ID,'dstKind':'Repository'}]);}),it('extracts\x20Arb\x20arbitration\x20and\x20order\x20references',()=>{const a=objectId(0x12,0x7),b=extractGraphEdges('Arb',a,{'order':ORDER_ID,'arbitration':ARB_TARGET,'voted':[{'fields':{'voter':GUARD_ID}}]});expect(b)['toEqual']([{'src':a,'srcKind':'Arb','edge':'arbitration','dst':ARB_TARGET,'dstKind':'Arbitration'},{'src':a,'srcKind':'Arb','edge':'order','dst':ORDER_ID,'dstKind':'Order'}]);}),it('skips\x20self-references,\x20null\x20guards\x20and\x20unprojected\x20kinds',()=>{expect(extractGraphEdges('Service',SERVICE_ID,{'buy_guard':null,'machine':SERVICE_ID}))['toEqual']([]),expect(extractGraphEdges('Demand',SERVICE_ID,{'machine':MACHINE_ID}))['toEqual']([]),expect(extractGraphEdges('Service',SERVICE_ID,null))['toEqual']([]);});}),describe('PostgresProjectionStore\x20graph\x20edges',()=>{let a;beforeEach(async()=>{const b=newDb();b['public']['registerFunction']({'name':'pg_advisory_xact_lock','args':[DataType['integer'],DataType['integer']],'returns':DataType['integer'],'implementation':()=>0x0});const {Pool:c}=b['adapters']['createPg'](),d=new c();a=new PostgresProjectionStore(d,0x10),await a['migrate']();}),afterEach(async()=>{await a?.['close']();}),it('syncs\x20edges\x20on\x20apply\x20and\x20annotates\x20unprojected\x20destinations',async()=>{await a['apply'](fact({'payload_json':SERVICE_PAYLOAD}));const b=await a['edgesFrom']('chain_a',SERVICE_ID);expect(b)['toHaveLength'](0x7),expect(b['filter'](d=>!d['dstProjected']))['toHaveLength'](0x7),expect(b['every'](d=>d['objectVersion']==='1'))['toBe'](!![]);const c=await a['edgesTo']('chain_a',MACHINE_ID);expect(c)['toEqual']([{'src':SERVICE_ID,'srcKind':'Service','edge':'machine','dst':MACHINE_ID,'dstKind':'Machine','objectVersion':'1','dstProjected':!![]}]);}),it('replaces\x20edges\x20when\x20a\x20newer\x20version\x20changes\x20its\x20references',async()=>{await a['apply'](fact({'payload_json':SERVICE_PAYLOAD})),await a['apply'](fact({'object_version':'2','payload_hash':'0x'+'43'['repeat'](0x20),'payload_uri':'test://raw/service-2','payload_json':{...SERVICE_PAYLOAD,'machine':GUARD_ID,'arbitrations':[]}}));const b=await a['edgesFrom']('chain_a',SERVICE_ID);expect(b['filter'](c=>c['edge']==='machine'))['toEqual']([{'src':SERVICE_ID,'srcKind':'Service','edge':'machine','dst':GUARD_ID,'dstKind':'Machine','objectVersion':'2','dstProjected':![]}]),expect(b['filter'](c=>c['edge']==='arbitrations'))['toEqual']([]),expect(b)['toHaveLength'](0x6);}),it('leaves\x20edges\x20untouched\x20for\x20duplicate\x20replays\x20and\x20removes\x20them\x20on\x20tombstone',async()=>{await a['apply'](fact({'payload_json':SERVICE_PAYLOAD})),expect((await a['apply'](fact({'payload_json':SERVICE_PAYLOAD})))['status'])['toBe']('duplicate'),expect(await a['edgesFrom']('chain_a',SERVICE_ID))['toHaveLength'](0x7),await a['markTombstone']('chain_a',SERVICE_ID),expect(await a['edgesFrom']('chain_a',SERVICE_ID))['toEqual']([]);}),it('backfills\x20edges\x20for\x20active\x20objects\x20from\x20their\x20current\x20version\x20payloads',async()=>{await a['apply'](fact({'payload_json':SERVICE_PAYLOAD})),await a['apply'](fact({'object_id':objectId(0x12,0x7),'move_type':'0x2::arb::Arb<0x2::wow::WOW>','payload_uri':'test://raw/arb-1','payload_json':{'order':ORDER_ID,'arbitration':ARB_TARGET}}));const b=await a['backfillGraphEdges']('chain_a');expect(b)['toEqual']({'objects':0x2,'edges':0x9}),expect(await a['edgesFrom']('chain_a',SERVICE_ID))['toHaveLength'](0x7),expect(await a['edgesFrom']('chain_a',objectId(0x12,0x7)))['toHaveLength'](0x2);});});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const FACET_VERSION = "facets-1";
|
|
2
|
-
export interface ObjectFacet {
|
|
3
|
-
verifiedKind: string;
|
|
4
|
-
objectId: string;
|
|
5
|
-
industry: string | null;
|
|
6
|
-
industryConfidence: number;
|
|
7
|
-
location: string | null;
|
|
8
|
-
priceMin: string | null;
|
|
9
|
-
priceMax: string | null;
|
|
10
|
-
capabilities: string[];
|
|
11
|
-
published: boolean;
|
|
12
|
-
paused: boolean;
|
|
13
|
-
nameTokens: string[];
|
|
14
|
-
textTokens: string[];
|
|
15
|
-
keywords: string[];
|
|
16
|
-
}
|
|
17
|
-
export declare function tokenize(text: string): string[];
|
|
18
|
-
export declare function extractFacets(verifiedKind: string, objectId: string, payloadJson: unknown): ObjectFacet | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{toBase58}from'@wowok/wowok';import{DataType,newDb}from'pg-mem';import{afterEach,beforeEach,describe,expect,it}from'vitest';import{extractFacets,FACET_VERSION,tokenize}from'./facets.js';import{PostgresProjectionStore}from'./store.js';const digest=toBase58(new Uint8Array(0x20)['fill'](0x7));function objectId(a,b){return'0x'+a['toString'](0x10)['padStart'](0x2,'0')+b['toString'](0x10)['padStart'](0x2,'0')['repeat'](0x1f);}const SERVICE_ID=objectId(0x14,0x1),DEMAND_ID=objectId(0x1b,0x2),MACHINE_ID=objectId(0x15,0x3),UM_ID=objectId(0x24,0x4),PERM_ID=objectId(0x40,0x5),ARB_TARGET=objectId(0x12,0x6),REWARD_ID=objectId(0x42,0x7),SERVICE_PAYLOAD={'id':SERVICE_ID,'description':'NanoBrew\x20One\x20—\x20threshold-funded\x20reward\x20campaign\x20with\x20escrow\x20and\x20refunds','location':'Shenzhen,\x20CN\x20(ships\x20worldwide)','sales':[{'name':'Early\x20Bird','price':'6000000000','stock':'20','wip_hash':'aa'['repeat'](0x20)},{'name':'Standard','price':'7500000000','stock':'20'}],'buy_guard':null,'machine':MACHINE_ID,'bPublished':!![],'bPaused':![],'arbitrations':[ARB_TARGET],'compensation_fund':'15000000000','rewards':[REWARD_ID],'um':UM_ID,'permission':PERM_ID};function fact(a={}){return{'chain_id':'chain_a','object_id':SERVICE_ID,'object_version':'1','move_type':'0x2::service::Service<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/service-1','payload_hash':'0x'+'41'['repeat'](0x20),'payload_format':'rpc-content-v1','checkpoint':'100','tx_digest':digest,'state':'active','observed_at':'2026-10-24T00:00:00.000Z',...a};}describe('tokenize\x20(facets-1)',()=>{it('lowercases,\x20drops\x20stopwords\x20and\x20short\x20latin\x20words',()=>{expect(tokenize('The\x20BEAT\x20License\x20for\x20a\x20Video!'))['toEqual'](['beat','license','video']);}),it('keeps\x20duplicates\x20so\x20BM25\x20sees\x20term\x20frequency',()=>{expect(tokenize('beat\x20beat'))['toEqual'](['beat','beat']);});}),describe('extractFacets',()=>{it('extracts\x20evidence-backed\x20Service\x20facets\x20from\x20the\x20real\x20payload\x20shape',()=>{const a=extractFacets('Service',SERVICE_ID,SERVICE_PAYLOAD);expect(a)['not']['toBeNull'](),expect(a['verifiedKind'])['toBe']('Service'),expect(a['objectId'])['toBe'](SERVICE_ID['toLowerCase']()),expect(a['priceMin'])['toBe']('6000000000'),expect(a['priceMax'])['toBe']('7500000000'),expect(a['published'])['toBe'](!![]),expect(a['paused'])['toBe'](![]),expect(a['location'])['toBe']('Shenzhen,\x20CN\x20(ships\x20worldwide)'),expect(a['capabilities'])['toEqual'](['has_arbitration','has_refund_path','has_milestone_nodes','has_compensation_fund','has_wip_verification','has_messenger']),expect(a['nameTokens'])['toContain']('early'),expect(a['textTokens'])['toContain']('escrow'),expect(a['textTokens'])['toContain']('shenzhen');}),it('never\x20fabricates\x20industry:\x20no\x20signal\x20→\x20null\x20(unknown)',()=>{const a=extractFacets('Service',SERVICE_ID,{...SERVICE_PAYLOAD,'description':''});expect(a['industry'])['toBeNull'](),expect(a['industryConfidence'])['toBe'](0x0);}),it('is\x20deterministic\x20for\x20identical\x20input',()=>{const c=extractFacets('Service',SERVICE_ID,SERVICE_PAYLOAD),d=extractFacets('Service',SERVICE_ID,SERVICE_PAYLOAD);expect(c)['toEqual'](d);}),it('derives\x20refund\x20path\x20only\x20from\x20arbitration\x20AND\x20funded\x20compensation',()=>{const a=extractFacets('Service',SERVICE_ID,{...SERVICE_PAYLOAD,'compensation_fund':'0'});expect(a['capabilities'])['toContain']('has_arbitration'),expect(a['capabilities'])['not']['toContain']('has_refund_path'),expect(a['capabilities'])['not']['toContain']('has_compensation_fund');const b=extractFacets('Service',SERVICE_ID,{...SERVICE_PAYLOAD,'arbitrations':[]});expect(b['capabilities'])['not']['toContain']('has_refund_path');}),it('extracts\x20Demand\x20facets\x20and\x20skips\x20kinds\x20without\x20facet\x20support',()=>{const a=extractFacets('Demand',DEMAND_ID,{'description':'Looking\x20for\x20a\x20licensed\x20beat','location':'Remote','um':UM_ID});expect(a['verifiedKind'])['toBe']('Demand'),expect(a['capabilities'])['toEqual'](['has_messenger']),expect(a['priceMin'])['toBeNull'](),expect(extractFacets('Arb',objectId(0x12,0x9),{'order':SERVICE_ID}))['toBeNull'](),expect(extractFacets('Service',SERVICE_ID,null))['toBeNull']();});}),describe('PostgresProjectionStore\x20facets',()=>{let a;beforeEach(async()=>{const b=newDb();b['public']['registerFunction']({'name':'pg_advisory_xact_lock','args':[DataType['integer'],DataType['integer']],'returns':DataType['integer'],'implementation':()=>0x0});const {Pool:c}=b['adapters']['createPg']();a=new PostgresProjectionStore(new c(),0x10),await a['migrate']();}),afterEach(async()=>{await a?.['close']();}),it('materializes\x20the\x20facet\x20row\x20on\x20apply\x20with\x20version\x20and\x20facet\x20generation',async()=>{await a['apply'](fact({'payload_json':SERVICE_PAYLOAD}));const b=await a['activeFacets']('chain_a','Service');expect(b)['toHaveLength'](0x1),expect(b[0x0])['toMatchObject']({'objectId':SERVICE_ID['toLowerCase'](),'verifiedKind':'Service','objectVersion':'1','facetVersion':FACET_VERSION,'priceMin':'6000000000','priceMax':'7500000000','published':!![],'paused':![]}),expect(b[0x0]['capabilities'])['toContain']('has_refund_path');}),it('computes\x20facets\x20when\x20the\x20JSON\x20payload\x20attaches\x20to\x20an\x20existing\x20raw\x20version',async()=>{await a['apply'](fact()),expect(await a['activeFacets']('chain_a','Service'))['toEqual']([]);const b=await a['apply'](fact({'payload_json':SERVICE_PAYLOAD}));expect(b['status'])['toBe']('duplicate'),expect(await a['activeFacets']('chain_a','Service'))['toHaveLength'](0x1);}),it('replaces\x20facets\x20on\x20a\x20newer\x20version\x20and\x20ignores\x20tombstoned\x20objects',async()=>{await a['apply'](fact({'payload_json':SERVICE_PAYLOAD})),await a['apply'](fact({'object_version':'2','payload_hash':'0x'+'43'['repeat'](0x20),'payload_uri':'test://raw/service-2','payload_json':{...SERVICE_PAYLOAD,'bPaused':!![],'compensation_fund':'0'}}));const b=await a['activeFacets']('chain_a','Service');expect(b)['toHaveLength'](0x1),expect(b[0x0]['objectVersion'])['toBe']('2'),expect(b[0x0]['paused'])['toBe'](!![]),expect(b[0x0]['capabilities'])['not']['toContain']('has_compensation_fund'),await a['markTombstone']('chain_a',SERVICE_ID),expect(await a['activeFacets']('chain_a','Service'))['toEqual']([]);}),it('backfills\x20facets\x20for\x20active\x20objects\x20from\x20current\x20version\x20payloads',async()=>{await a['apply'](fact({'payload_json':SERVICE_PAYLOAD})),await a['apply'](fact({'object_id':DEMAND_ID,'move_type':'0x2::demand::Demand<0x2::wow::WOW>','payload_uri':'test://raw/demand-1','payload_json':{'description':'Need\x20a\x20beat','location':'Remote','um':UM_ID}}));const b=await a['backfillFacets']('chain_a');expect(b)['toEqual']({'objects':0x2,'facets':0x2}),expect(await a['activeFacets']('chain_a'))['toHaveLength'](0x2),expect(await a['activeFacets']('chain_a','Demand'))['toHaveLength'](0x1);});});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { ObjectVersionFact } from "./types.js";
|
|
3
|
-
export declare const ObjectVersionFactSchema: z.ZodPipe<z.ZodObject<{
|
|
4
|
-
chain_id: z.ZodString;
|
|
5
|
-
object_id: z.ZodString;
|
|
6
|
-
object_version: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
7
|
-
move_type: z.ZodString;
|
|
8
|
-
owner_kind: z.ZodString;
|
|
9
|
-
owner_address: z.ZodOptional<z.ZodString>;
|
|
10
|
-
payload_uri: z.ZodString;
|
|
11
|
-
payload_hash: z.ZodString;
|
|
12
|
-
payload_format: z.ZodString;
|
|
13
|
-
payload_json: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
14
|
-
checkpoint: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
15
|
-
tx_digest: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
16
|
-
previous_version: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<bigint, string | number | bigint>>>;
|
|
17
|
-
state: z.ZodEnum<{
|
|
18
|
-
deleted: "deleted";
|
|
19
|
-
active: "active";
|
|
20
|
-
wrapped: "wrapped";
|
|
21
|
-
}>;
|
|
22
|
-
observed_at: z.ZodString;
|
|
23
|
-
}, z.core.$strict>, z.ZodTransform<ObjectVersionFact, {
|
|
24
|
-
chain_id: string;
|
|
25
|
-
object_id: string;
|
|
26
|
-
object_version: bigint;
|
|
27
|
-
move_type: string;
|
|
28
|
-
owner_kind: string;
|
|
29
|
-
payload_uri: string;
|
|
30
|
-
payload_hash: string;
|
|
31
|
-
payload_format: string;
|
|
32
|
-
checkpoint: bigint;
|
|
33
|
-
tx_digest: string;
|
|
34
|
-
state: "deleted" | "active" | "wrapped";
|
|
35
|
-
observed_at: string;
|
|
36
|
-
owner_address?: string | undefined;
|
|
37
|
-
payload_json?: Record<string, unknown> | null | undefined;
|
|
38
|
-
previous_version?: bigint | undefined;
|
|
39
|
-
}>>;
|
|
40
|
-
export declare function parseObjectVersionFact(input: unknown): ObjectVersionFact;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { ObjectVersionFactSchema, parseObjectVersionFact } from "./facts.js";
|
|
2
|
-
export { projectObjectVersion } from "./project.js";
|
|
3
|
-
export { PROJECTION_SCHEMA_SQL } from "./schema.js";
|
|
4
|
-
export { PostgresProjectionStore } from "./store.js";
|
|
5
|
-
export type { ListCurrentObjectsOptions } from "./store.js";
|
|
6
|
-
export type { ApplyProjectionResult, ApplyProjectionStatus, CurrentObject, CurrentObjectPage, ObjectVersionFact, ObjectVersionState, ProjectionCoverage, ProjectionStatus, } from "./types.js";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type WowTypedObjectKind } from "@wowok/wowok";
|
|
2
|
-
import type { ObjectVersionFact } from "./types.js";
|
|
3
|
-
export interface ObjectProjection {
|
|
4
|
-
kindHint: number;
|
|
5
|
-
verifiedKind: WowTypedObjectKind | null;
|
|
6
|
-
shardCount: number;
|
|
7
|
-
shardIndex: number | null;
|
|
8
|
-
quarantineReason?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function projectObjectVersion(fact: ObjectVersionFact, shardCount: number): ObjectProjection;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{toBase58,wowAddressShard}from'@wowok/wowok';import{DataType,newDb}from'pg-mem';import{afterEach,beforeEach,describe,expect,it}from'vitest';import{parseObjectVersionFact}from'./facts.js';import{PostgresProjectionStore}from'./store.js';const digest=toBase58(new Uint8Array(0x20)['fill'](0x7));function objectId(a=0x14,b=0x1){return'0x'+a['toString'](0x10)['padStart'](0x2,'0')+b['toString'](0x10)['padStart'](0x2,'0')['repeat'](0x1f);}function fact(a={}){return{'chain_id':'chain_a','object_id':objectId(),'object_version':'1','move_type':'0x2::service::Service<0x2::wow::WOW>','owner_kind':'Shared','payload_uri':'test://raw/service-1','payload_hash':'0x'+'41'['repeat'](0x20),'payload_format':'json+bcs-v1','checkpoint':'100','tx_digest':digest,'state':'active','observed_at':'2026-10-24T00:00:00.000Z',...a};}describe('PostgresProjectionStore',()=>{let a;beforeEach(async()=>{const b=newDb();b['public']['registerFunction']({'name':'pg_advisory_xact_lock','args':[DataType['integer'],DataType['integer']],'returns':DataType['integer'],'implementation':()=>0x0});const {Pool:c}=b['adapters']['createPg'](),d=new c();a=new PostgresProjectionStore(d,0x10),await a['migrate']();}),afterEach(async()=>{await a?.['close']();}),it('applies\x20a\x20typed\x20object\x20once\x20and\x20preserves\x20raw\x20history\x20on\x20replay',async()=>{expect((await a['apply'](fact()))['status'])['toBe']('applied'),expect((await a['apply'](fact()))['status'])['toBe']('duplicate');const b=await a['status']('chain_a');expect(b)['toMatchObject']({'raw_versions':0x1,'current_objects':0x1,'active_objects':0x1,'quarantined_versions':0x0,'max_checkpoint':'100'});const c=await a['listCurrent']({'chainId':'chain_a'});expect(c['objects'])['toHaveLength'](0x1),expect(c['coverage'])['toMatchObject']({'mode':'known_objects','complete':![],'truncated':![],'degraded_reasons':['RECONCILIATION_REQUIRED']});}),it('allows\x20the\x20same\x20immutable\x20version\x20at\x20a\x20later\x20observation\x20checkpoint',async()=>{expect((await a['apply'](fact()))['status'])['toBe']('applied'),expect((await a['apply'](fact({'checkpoint':'101'})))['status'])['toBe']('duplicate'),expect(await a['status']('chain_a'))['toMatchObject']({'raw_versions':0x1,'quarantined_versions':0x0});}),it('enriches\x20legacy\x20raw\x20rows\x20and\x20detects\x20JSON\x20content\x20conflicts\x20independently\x20of\x20key\x20order',async()=>{await a['apply'](fact()),expect((await a['apply'](fact({'payload_json':{'name':'one','stock':0x2}})))['status'])['toBe']('duplicate'),expect((await a['apply'](fact({'payload_json':{'stock':0x2,'name':'one'}})))['status'])['toBe']('duplicate'),expect((await a['apply'](fact()))['status'])['toBe']('duplicate'),expect((await a['listCurrent']({'chainId':'chain_a'}))['objects'][0x0]['payloadJson'])['toEqual']({'name':'one','stock':0x2});const b=await a['apply'](fact({'payload_json':{'name':'changed','stock':0x2}}));expect(b)['toMatchObject']({'status':'conflict','reasonCode':'CONFLICTING_OBJECT_VERSION'});}),it('rejects\x20a\x20different\x20payload\x20hash\x20for\x20an\x20existing\x20immutable\x20version',async()=>{await a['apply'](fact());const b=await a['apply'](fact({'payload_hash':'0x'+'42'['repeat'](0x20)}));expect(b)['toMatchObject']({'status':'conflict','reasonCode':'CONFLICTING_OBJECT_VERSION'}),expect(await a['status']('chain_a'))['toMatchObject']({'raw_versions':0x1,'current_objects':0x1,'quarantined_versions':0x1});}),it('rejects\x20a\x20changed\x20payload\x20URI\x20for\x20an\x20existing\x20immutable\x20version',async()=>{await a['apply'](fact());const b=await a['apply'](fact({'payload_uri':'test://raw/service-1-conflict'}));expect(b)['toMatchObject']({'status':'conflict','reasonCode':'CONFLICTING_OBJECT_VERSION'}),expect(await a['status']('chain_a'))['toMatchObject']({'raw_versions':0x1,'current_objects':0x1,'quarantined_versions':0x1});}),it('rejects\x20values\x20above\x20PostgreSQL\x20BIGINT',()=>{expect(()=>parseObjectVersionFact(fact({'object_version':'9223372036854775808'})))['toThrow']('Integer\x20exceeds\x20PostgreSQL\x20BIGINT');}),it('never\x20rolls\x20current\x20back\x20when\x20an\x20older\x20delta\x20arrives\x20late',async()=>{await a['apply'](fact({'object_version':'2','checkpoint':'101'}));const b=await a['apply'](fact());expect(b)['toMatchObject']({'status':'stale','currentVersion':'2'});const c=await a['listCurrent']({'chainId':'chain_a'});expect(c['objects'][0x0])['toMatchObject']({'objectVersion':'2','checkpoint':'101'}),expect(await a['status']('chain_a'))['toMatchObject']({'raw_versions':0x2,'quarantined_versions':0x1});}),it('does\x20not\x20install\x20an\x20older\x20valid\x20version\x20after\x20a\x20newer\x20quarantined\x20version',async()=>{await a['apply'](fact({'object_version':'2','move_type':'0x2::demand::Demand','checkpoint':'101'})),expect((await a['apply'](fact()))['status'])['toBe']('stale'),expect((await a['listCurrent']({'chainId':'chain_a'}))['objects'])['toEqual']([]),expect(await a['status']('chain_a'))['toMatchObject']({'raw_versions':0x2,'current_objects':0x0,'quarantined_versions':0x2});}),it('keeps\x20typed/actual\x20mismatches\x20out\x20of\x20normal\x20candidates',async()=>{const b=await a['apply'](fact({'move_type':'0x2::demand::Demand'}));expect(b)['toMatchObject']({'status':'quarantined','reasonCode':'TYPED_ACTUAL_KIND_MISMATCH'}),expect((await a['listCurrent']({'chainId':'chain_a'}))['objects'])['toEqual']([]),expect(await a['status']('chain_a'))['toMatchObject']({'raw_versions':0x1,'current_objects':0x0,'quarantined_versions':0x1});}),it('retains\x20deletion\x20tombstones\x20while\x20withdrawing\x20active\x20candidates',async()=>{await a['apply'](fact()),await a['apply'](fact({'object_version':'2','state':'deleted','checkpoint':'101'})),expect((await a['listCurrent']({'chainId':'chain_a'}))['objects'])['toEqual']([]),expect(await a['status']('chain_a'))['toMatchObject']({'raw_versions':0x2,'current_objects':0x1,'active_objects':0x0});}),it('isolates\x20identical\x20object\x20ids\x20on\x20replacement\x20chains',async()=>{await a['apply'](fact()),await a['apply'](fact({'chain_id':'chain_b','checkpoint':'1'})),expect((await a['listCurrent']({'chainId':'chain_a'}))['objects'][0x0]['checkpoint'])['toBe']('100'),expect((await a['listCurrent']({'chainId':'chain_b'}))['objects'][0x0]['checkpoint'])['toBe']('1');}),it('uses\x20a\x20lookahead\x20row\x20for\x20pagination\x20and\x20kind+hash\x20shard\x20filters',async()=>{await a['apply'](fact({'object_id':objectId(0x14,0x1)})),await a['apply'](fact({'object_id':objectId(0x14,0x2)})),await a['apply'](fact({'object_id':objectId(0x14,0x3)}));const b=await a['listCurrent']({'chainId':'chain_a','kind':'Service','limit':0x2});expect(b['objects'])['toHaveLength'](0x2),expect(b['coverage']['truncated'])['toBe'](!![]),expect(b['next_cursor'])['toBe'](b['objects'][0x1]['objectId']);const c=await a['listCurrent']({'chainId':'chain_a','kind':'Service','cursor':b['next_cursor']??undefined,'limit':0x2});expect(c['objects'])['toHaveLength'](0x1),expect(c['coverage']['truncated'])['toBe'](![]);const d=b['objects'][0x0];expect(d['shardIndex'])['toBe'](wowAddressShard(d['objectId'],'Service',0x10));const e=await a['listCurrent']({'chainId':'chain_a','kind':'Service','shard':{'count':0x10,'index':d['shardIndex']}});expect(e['objects']['some'](g=>g['objectId']===d['objectId']))['toBe'](!![]);const f=await a['listCurrent']({'chainId':'chain_a','kind':'Service','shard':{'count':0x10,'index':(d['shardIndex']+0x1)%0x10}});expect(f['objects']['some'](g=>g['objectId']===d['objectId']))['toBe'](![]);});});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PROJECTION_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS object_version (\n chain_id TEXT NOT NULL,\n object_id BYTEA NOT NULL,\n kind_hint SMALLINT NOT NULL,\n object_version BIGINT NOT NULL,\n move_type TEXT NOT NULL,\n owner_kind TEXT NOT NULL,\n owner_address BYTEA,\n payload_uri TEXT NOT NULL,\n payload_hash BYTEA NOT NULL,\n payload_format TEXT NOT NULL,\n payload_json JSONB,\n payload_json_present BOOLEAN NOT NULL DEFAULT FALSE,\n checkpoint BIGINT NOT NULL,\n tx_digest BYTEA NOT NULL,\n previous_version BIGINT,\n state TEXT NOT NULL CHECK (state IN ('active', 'deleted', 'wrapped')),\n observed_at TIMESTAMPTZ NOT NULL,\n PRIMARY KEY (chain_id, object_id, object_version)\n);\nALTER TABLE object_version ADD COLUMN IF NOT EXISTS payload_json JSONB;\nALTER TABLE object_version ADD COLUMN IF NOT EXISTS payload_json_present BOOLEAN NOT NULL DEFAULT FALSE;\n\nCREATE TABLE IF NOT EXISTS object_current (\n chain_id TEXT NOT NULL,\n object_id BYTEA NOT NULL,\n kind_hint SMALLINT NOT NULL,\n object_version BIGINT NOT NULL,\n move_type TEXT NOT NULL,\n verified_kind TEXT NOT NULL,\n shard_count INTEGER NOT NULL,\n shard_index INTEGER NOT NULL,\n checkpoint BIGINT NOT NULL,\n state TEXT NOT NULL CHECK (state IN ('active', 'deleted', 'wrapped')),\n payload_hash BYTEA NOT NULL,\n updated_at TIMESTAMPTZ NOT NULL,\n PRIMARY KEY (chain_id, object_id)\n);\n\nCREATE INDEX IF NOT EXISTS object_current_kind_shard\n ON object_current (chain_id, verified_kind, shard_count, shard_index, object_id)\n WHERE state = 'active';\nCREATE INDEX IF NOT EXISTS object_current_kind_version\n ON object_current (chain_id, kind_hint, object_version DESC);\n\nCREATE TABLE IF NOT EXISTS quarantine (\n chain_id TEXT NOT NULL,\n object_id BYTEA NOT NULL,\n object_version BIGINT NOT NULL,\n reason_code TEXT NOT NULL,\n raw_ref TEXT NOT NULL,\n first_seen TIMESTAMPTZ NOT NULL,\n PRIMARY KEY (chain_id, object_id, object_version, reason_code)\n);\n\n-- W2 live-set reconciliation. Evidence arrays are post-repair RESIDUALS\n-- (fail-closed: a pass verdict means all three residual sets are empty);\n-- pre-repair diff sizes are kept in the repaired_*/counts columns.\nCREATE TABLE IF NOT EXISTS reconciliation_run (\n chain_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n run_id TEXT NOT NULL,\n live_set_checkpoint BIGINT NOT NULL,\n missing TEXT[] NOT NULL DEFAULT '{}',\n extra TEXT[] NOT NULL DEFAULT '{}',\n version_drift TEXT[] NOT NULL DEFAULT '{}',\n missing_count INTEGER NOT NULL DEFAULT 0,\n extra_count INTEGER NOT NULL DEFAULT 0,\n version_drift_count INTEGER NOT NULL DEFAULT 0,\n repaired_missing INTEGER NOT NULL DEFAULT 0,\n repaired_drift INTEGER NOT NULL DEFAULT 0,\n tombstoned INTEGER NOT NULL DEFAULT 0,\n verdict TEXT NOT NULL CHECK (verdict IN ('pass', 'fail')),\n live_count INTEGER NOT NULL,\n projection_active INTEGER NOT NULL,\n generation INTEGER,\n reconciled_through BIGINT,\n started_at TIMESTAMPTZ NOT NULL,\n completed_at TIMESTAMPTZ NOT NULL,\n error TEXT,\n PRIMARY KEY (chain_id, kind, run_id)\n);\n\n-- Generation atomic publish: bumped ONLY inside the same transaction that\n-- records a verdict='pass' reconciliation run. Consumers read this table to\n-- decide whether coverage may drop RECONCILIATION_REQUIRED.\nCREATE TABLE IF NOT EXISTS projection_generation (\n chain_id TEXT NOT NULL,\n kind TEXT NOT NULL,\n generation INTEGER NOT NULL,\n reconciled_through BIGINT NOT NULL,\n updated_at TIMESTAMPTZ NOT NULL,\n PRIMARY KEY (chain_id, kind)\n);\n\n-- W4 minimal graph materialization: static reference edges extracted from the\n-- applied version payload, synced in the same transaction as object_current.\n-- Out-degree lookup uses the PK prefix (chain_id, src); in-degree uses graph_edge_in.\nCREATE TABLE IF NOT EXISTS graph_edge (\n chain_id TEXT NOT NULL,\n src BYTEA NOT NULL,\n src_kind TEXT NOT NULL,\n edge TEXT NOT NULL,\n dst BYTEA NOT NULL,\n dst_kind TEXT NOT NULL,\n object_version BIGINT NOT NULL,\n PRIMARY KEY (chain_id, src, edge, dst)\n);\n\nCREATE INDEX IF NOT EXISTS graph_edge_in\n ON graph_edge (chain_id, dst, edge);\n\n-- R3-W1 public facet materialization (K5-10 \u00A72.4): versioned, evidence-backed\n-- retrieval/scoring facets extracted from the applied payload in the SAME\n-- transaction as object_current. Prices stay decimal TEXT (wei) \u2014 v1 filters\n-- run in the API layer for determinism and pg-mem testability; push down to\n-- NUMERIC + GIN when the corpus outgrows an in-memory facet scan.\nCREATE TABLE IF NOT EXISTS object_facet (\n chain_id TEXT NOT NULL,\n object_id BYTEA NOT NULL,\n verified_kind TEXT NOT NULL,\n facet_version TEXT NOT NULL,\n object_version BIGINT NOT NULL,\n industry TEXT,\n industry_confidence REAL NOT NULL DEFAULT 0,\n location TEXT,\n price_min TEXT,\n price_max TEXT,\n capabilities TEXT[] NOT NULL DEFAULT '{}',\n published BOOLEAN NOT NULL DEFAULT FALSE,\n paused BOOLEAN NOT NULL DEFAULT FALSE,\n name_tokens TEXT[] NOT NULL DEFAULT '{}',\n text_tokens TEXT[] NOT NULL DEFAULT '{}',\n keywords TEXT[] NOT NULL DEFAULT '{}',\n computed_at TEXT NOT NULL,\n PRIMARY KEY (chain_id, object_id)\n);\n\nCREATE INDEX IF NOT EXISTS object_facet_kind\n ON object_facet (chain_id, verified_kind);\n";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { type WowTypedObjectKind } from "@wowok/wowok";
|
|
2
|
-
import { Pool } from "pg";
|
|
3
|
-
import type { AggregateAnswer, AggregateOptions, ApplyProjectionResult, CurrentObjectPage, GraphEdgeView, ObjectFacetRow, ObjectVersionFact, ProjectionStatus, ProjectionWatermark, QuarantineEntry, RecordReconciliationOptions, RecordReconciliationResult, ReconciliationGeneration } from "./types.js";
|
|
4
|
-
export interface ListCurrentObjectsOptions {
|
|
5
|
-
chainId: string;
|
|
6
|
-
kind?: WowTypedObjectKind;
|
|
7
|
-
shard?: {
|
|
8
|
-
count: number;
|
|
9
|
-
index: number;
|
|
10
|
-
};
|
|
11
|
-
cursor?: string;
|
|
12
|
-
limit?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare class PostgresProjectionStore {
|
|
15
|
-
private readonly pool;
|
|
16
|
-
private readonly shardCount;
|
|
17
|
-
constructor(pool: Pool, shardCount?: number);
|
|
18
|
-
static fromDatabaseUrl(databaseUrl: string, shardCount?: number): PostgresProjectionStore;
|
|
19
|
-
migrate(): Promise<void>;
|
|
20
|
-
close(): Promise<void>;
|
|
21
|
-
apply(input: unknown): Promise<ApplyProjectionResult>;
|
|
22
|
-
applyFact(fact: ObjectVersionFact): Promise<ApplyProjectionResult>;
|
|
23
|
-
private applyWithClient;
|
|
24
|
-
private syncGraphEdges;
|
|
25
|
-
private syncFacets;
|
|
26
|
-
private attachJson;
|
|
27
|
-
private quarantine;
|
|
28
|
-
liveSetVersions(chainId: string, kind: string): Promise<Map<string, string>>;
|
|
29
|
-
markTombstone(chainId: string, objectId: string): Promise<boolean>;
|
|
30
|
-
markTombstoneIfKind(chainId: string, objectId: string, kind: string): Promise<boolean>;
|
|
31
|
-
edgesFrom(chainId: string, objectId: string): Promise<GraphEdgeView[]>;
|
|
32
|
-
edgesTo(chainId: string, objectId: string): Promise<GraphEdgeView[]>;
|
|
33
|
-
backfillGraphEdges(chainId: string): Promise<{
|
|
34
|
-
objects: number;
|
|
35
|
-
edges: number;
|
|
36
|
-
}>;
|
|
37
|
-
backfillFacets(chainId: string): Promise<{
|
|
38
|
-
objects: number;
|
|
39
|
-
facets: number;
|
|
40
|
-
}>;
|
|
41
|
-
activeFacets(chainId: string, kind?: string): Promise<ObjectFacetRow[]>;
|
|
42
|
-
currentPayloads(chainId: string, objectIds: string[]): Promise<Map<string, Record<string, unknown> | null>>;
|
|
43
|
-
aggregate(chainId: string, options: AggregateOptions): Promise<AggregateAnswer>;
|
|
44
|
-
recordReconciliation(options: RecordReconciliationOptions): Promise<RecordReconciliationResult>;
|
|
45
|
-
reconciliationSummary(chainId: string): Promise<ReconciliationGeneration[]>;
|
|
46
|
-
private reconciledThrough;
|
|
47
|
-
status(chainId: string): Promise<ProjectionStatus>;
|
|
48
|
-
watermarks(chainId: string): Promise<ProjectionWatermark[]>;
|
|
49
|
-
quarantineQueue(chainId: string, limit?: number): Promise<QuarantineEntry[]>;
|
|
50
|
-
listCurrent(options: ListCurrentObjectsOptions): Promise<CurrentObjectPage>;
|
|
51
|
-
}
|