@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 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as a39a from'node:fs';import*as a39b from'node:path';import{z}from'zod';import{getWowMcpDir}from'@wowok/wowok';const FILE_NAME='template-params.json',ParamValueSchema=z['union']([z['number']()['finite']()['nonnegative'](),z['string']()['min'](0x1)]),TemplateParamsFileSchema=z['object']({'version':z['number']()['int']()['nonnegative']()['optional'](),'comment':z['string']()['optional'](),'defaults':z['record'](z['string'](),ParamValueSchema)['optional'](),'templates':z['record'](z['string'](),z['record'](z['string'](),ParamValueSchema))['optional']()})['strict']();export function templateParamsFilePath(){const a=process['env']['WOWOK_CONFIG_DIR']||getWowMcpDir();return a39b['join'](a,FILE_NAME);}let cache=null;function zodMessage(a){return a instanceof z['ZodError']?a['issues']['map'](b=>b['path']['join']('.')+':\x20'+b['message'])['join'](';\x20'):a instanceof Error?a['message']:String(a);}function readAndParse(a){let b;try{b=a39a['readFileSync'](a,'utf-8');}catch(c){return{'path':a,'exists':!![],'error':'unreadable:\x20'+(c instanceof Error?c['message']:String(c))};}try{const d=TemplateParamsFileSchema['parse'](JSON['parse'](b));return{'path':a,'exists':!![],'error':null,...d['comment']!==undefined?{'comment':d['comment']}:{},...d['defaults']!==undefined?{'defaults':d['defaults']}:{},...d['templates']!==undefined?{'templates':d['templates']}:{}};}catch(f){return{'path':a,'exists':!![],'error':zodMessage(f)};}}export function getTemplateParamFileState(){const a=templateParamsFilePath();try{const b=a39a['statSync'](a);if(cache&&cache['mtimeMs']===b['mtimeMs'])return cache['state'];const c=readAndParse(a);if(c['error']===null)cache={'mtimeMs':b['mtimeMs'],'state':c};return c;}catch{return{'path':a,'exists':![],'error':null};}}export function getTemplateParamFileLayer(a){const b=getTemplateParamFileState();if(b['error']!==null)return{};const c=b['templates']?.[a];return{...b['defaults']??{},...c??{}};}export function resetTemplateParamFileCache(){cache=null;}export const ARB_VOTING_WINDOW_DEFAULT_MS=0xf731400;export function arbVotingWindowMs(){const a=getTemplateParamFileState();if(a['error']!==null)return ARB_VOTING_WINDOW_DEFAULT_MS;const b=a['defaults']?.['arb_voting_window_ms'];return typeof b==='number'&&Number['isFinite'](b)&&b>0x0?b:ARB_VOTING_WINDOW_DEFAULT_MS;}function isPlainObject(a){return typeof a==='object'&&a!==null&&!Array['isArray'](a);}function deepMergeValues(a,b){if(isPlainObject(a)&&isPlainObject(b)){const c={...a};for(const [d,e]of Object['entries'](b)){c[d]=d in a?deepMergeValues(a[d],e):e;}return c;}return b;}function collectLeafChanges(a,c,d,e){if(isPlainObject(c)){const f=isPlainObject(a)?a:{};for(const [g,h]of Object['entries'](c)){collectLeafChanges(f[g],h,d?d+'.'+g:g,e);}return;}JSON['stringify'](a)!==JSON['stringify'](c)&&e['push']({'path':d||'(root)','old':a===undefined?null:a,'new':c});}export function patchTemplateParamFile(a){const b=templateParamsFilePath(),c=a39b['join'](a39b['dirname'](b),'template-params.backup.json');if(!isPlainObject(a))throw new Error('\x27patch\x27\x20must\x20be\x20an\x20object\x20like\x20{\x22defaults\x22:\x20{…},\x20\x22templates\x22:\x20{\x22<tpl-id>\x22:\x20{…}}}');const d=Object['keys'](a)['filter'](m=>m!=='defaults'&&m!=='templates'&&m!=='comment');if(d['length']>0x0)throw new Error('patch\x20rejected:\x20unknown\x20key(s)\x20'+d['map'](m=>'\x27'+m+'\x27')['join'](',\x20')+'\x20—\x20allowed:\x20defaults,\x20templates,\x20comment');let f={},g=![];try{const m=a39a['readFileSync'](b,'utf-8');g=!![],f=TemplateParamsFileSchema['parse'](JSON['parse'](m));}catch(n){if(g)throw new Error('the\x20current\x20template-params.json\x20is\x20not\x20a\x20valid\x20template-params\x20document\x20('+zodMessage(n)+')\x20—\x20fix\x20or\x20remove\x20'+b+'\x20by\x20hand\x20first');f={};}const h={...f},i=[];for(const o of['defaults','templates']){const p=a[o];if(p===undefined)continue;if(!isPlainObject(p))throw new Error('patch.'+o+'\x20must\x20be\x20an\x20object\x20(param\x20→\x20value'+(o==='templates'?',\x20keyed\x20by\x20template\x20id':'')+')');const q=deepMergeValues(f[o]??{},p);try{h[o]=TemplateParamsFileSchema['shape'][o]['parse'](q);}catch(r){throw new Error('patch.'+o+'\x20rejected:\x20'+zodMessage(r));}collectLeafChanges(f[o]??{},p,o,i);}if(a['comment']!==undefined){if(typeof a['comment']!=='string')throw new Error('patch.comment\x20must\x20be\x20a\x20string');h['comment']=a['comment'];}if(i['length']===0x0)return{'applied':!![],'path':b,'backup_path':null,'changed':i,'error':null};const j={'version':0x1,...h};TemplateParamsFileSchema['parse'](j);const k=JSON['stringify'](j,null,0x2)+'\x0a';a39a['mkdirSync'](a39b['dirname'](b),{'recursive':!![]});if(g)a39a['copyFileSync'](b,c);const l=b+'.tmp';return a39a['writeFileSync'](l,k,'utf-8'),a39a['renameSync'](l,b),cache={'mtimeMs':a39a['statSync'](b)['mtimeMs'],'state':readAndParse(b)},{'applied':!![],'path':b,'backup_path':g?c:null,'changed':i,'error':cache['state']['error']};}export function clearTemplateParamFile(a){const b=templateParamsFilePath(),c=a39b['join'](a39b['dirname'](b),'template-params.backup.json');try{a39a['statSync'](b);}catch{return{'cleared':![],'path':b,'scope':'file','backup_path':null};}a39a['copyFileSync'](b,c);if(!a)return a39a['rmSync'](b),cache=null,{'cleared':!![],'path':b,'scope':'file','backup_path':c};let d;try{d=JSON['parse'](a39a['readFileSync'](b,'utf-8'));}catch(g){throw new Error('template-params.json\x20is\x20unreadable\x20('+zodMessage(g)+')\x20—\x20clear\x20the\x20WHOLE\x20file\x20(omit\x20\x27template\x27)\x20or\x20remove\x20'+b+'\x20by\x20hand');}if(a==='defaults')delete d['defaults'];else{const h=isPlainObject(d['templates'])?{...d['templates']}:{};if(!(a in h))return{'cleared':![],'path':b,'scope':'template','template_id':a,'backup_path':null};delete h[a],d['templates']=h;}const f=isPlainObject(d['defaults'])&&Object['keys'](d['defaults'])['length']>0x0||isPlainObject(d['templates'])&&Object['keys'](d['templates'])['length']>0x0;if(f){const i=JSON['stringify'](d,null,0x2)+'\x0a',j=b+'.tmp';a39a['writeFileSync'](j,i,'utf-8'),a39a['renameSync'](j,b);}else a39a['rmSync'](b);return cache=null,{'cleared':!![],'path':b,'scope':a==='defaults'?'defaults':'template','template_id':a==='defaults'?undefined:a,'backup_path':c};}
|
package/dist/data/sync/cdc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WowClient,WowGraphQLClient,getFullnodeUrl,getGraphqlUrl,normalizeWowAddress,wowTypedKindFromMoveType}from'@wowok/wowok';import{canonicalChainIdentifier,GraphQLSnapshotSource}from'./graphql-source.js';const CDC_PAGE_QUERY='\x0aquery\x20CdcPage($after:\x20UInt53!,\x20$before:\x20UInt53!,\x20$cursor:\x20String)\x20{\x0a\x20\x20\x20\x20transactions(\x0a\x20\x20\x20\x20\x20\x20\x20\x20filter:\x20{\x20afterCheckpoint:\x20$after,\x20beforeCheckpoint:\x20$before\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20first:\x2050\x0a\x20\x20\x20\x20\x20\x20\x20\x20after:\x20$cursor\x0a\x20\x20\x20\x20)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20pageInfo\x20{\x20hasNextPage\x20endCursor\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20nodes\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20digest\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20effects\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20checkpoint\x20{\x20sequenceNumber\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20objectChanges\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nodes\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20address\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20idCreated\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20idDeleted\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20outputState\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20version\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20asMoveObject\x20{\x20contents\x20{\x20type\x20{\x20repr\x20}\x20}\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a}',MAX_TX_PAGES=0xc8;function stalledLagCheckpoints(){const a=process['env']['WOWOK_CDC_STALLED_LAG_CHECKPOINTS'];if(a===undefined||a['trim']()==='')return 0x186a0n;const b=Number(a);if(!Number['isInteger'](b)||b<0x0)throw new Error('Invalid\x20WOWOK_CDC_STALLED_LAG_CHECKPOINTS:\x20'+a);return BigInt(b);}export class GraphQLCdcSource{['graphql'];['snapshot'];['rpc'];['expectedChainId'];constructor(a,b,c,d){this['graphql']=a,this['snapshot']=b,this['rpc']=c,this['expectedChainId']=d;}static['forNetwork'](a,b){const c=getGraphqlUrl(a);if(!c)throw new Error('No\x20GraphQL\x20endpoint\x20configured\x20for\x20'+a);return new GraphQLCdcSource(new WowGraphQLClient({'url':c,'network':a}),GraphQLSnapshotSource['forNetwork'](a,b),new WowClient({'url':getFullnodeUrl(a),'network':a}),b);}async['head'](){const [a,b
|
|
1
|
+
import{WowClient,WowGraphQLClient,getFullnodeUrl,getGraphqlUrl,normalizeWowAddress,wowTypedKindFromMoveType}from'@wowok/wowok';import{canonicalChainIdentifier,GraphQLSnapshotSource,verifyChainIdentity}from'./graphql-source.js';const CDC_PAGE_QUERY='\x0aquery\x20CdcPage($after:\x20UInt53!,\x20$before:\x20UInt53!,\x20$cursor:\x20String)\x20{\x0a\x20\x20\x20\x20transactions(\x0a\x20\x20\x20\x20\x20\x20\x20\x20filter:\x20{\x20afterCheckpoint:\x20$after,\x20beforeCheckpoint:\x20$before\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20first:\x2050\x0a\x20\x20\x20\x20\x20\x20\x20\x20after:\x20$cursor\x0a\x20\x20\x20\x20)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20pageInfo\x20{\x20hasNextPage\x20endCursor\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20nodes\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20digest\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20effects\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20checkpoint\x20{\x20sequenceNumber\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20objectChanges\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nodes\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20address\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20idCreated\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20idDeleted\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20outputState\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20version\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20asMoveObject\x20{\x20contents\x20{\x20type\x20{\x20repr\x20}\x20}\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a}',MAX_TX_PAGES=0xc8;function stalledLagCheckpoints(){const a=process['env']['WOWOK_CDC_STALLED_LAG_CHECKPOINTS'];if(a===undefined||a['trim']()==='')return 0x186a0n;const b=Number(a);if(!Number['isInteger'](b)||b<0x0)throw new Error('Invalid\x20WOWOK_CDC_STALLED_LAG_CHECKPOINTS:\x20'+a);return BigInt(b);}export class GraphQLCdcSource{['graphql'];['snapshot'];['rpc'];['expectedChainId'];constructor(a,b,c,d){this['graphql']=a,this['snapshot']=b,this['rpc']=c,this['expectedChainId']=d;}static['forNetwork'](a,b){const c=getGraphqlUrl(a);if(!c)throw new Error('No\x20GraphQL\x20endpoint\x20configured\x20for\x20'+a);return new GraphQLCdcSource(new WowGraphQLClient({'url':c,'network':a}),GraphQLSnapshotSource['forNetwork'](a,b),new WowClient({'url':getFullnodeUrl(a),'network':a}),b);}async['head'](){const [a,b]=await Promise['all']([verifyChainIdentity(this['graphql'],this['rpc'],this['expectedChainId']),this['rpc']['getLatestCheckpointSequenceNumber']()]);return{'chainId':a,'checkpoint':b};}async['readChanges'](a,b,c){const d=BigInt(a),e=BigInt(b);if(e<=d)return{'facts':[],'deletedIds':[],'observedThrough':a,'pages':0x0};const f=canonicalChainIdentifier(this['expectedChainId']),g=new Set(),h=new Set();let i=null,j=0x0,k=a;do{const m=await this['graphql']['query']({'query':CDC_PAGE_QUERY,'variables':{'after':Number(d),'before':Number(e),'cursor':i}});if(m['errors']?.['length'])throw new Error('CDC\x20GraphQL\x20error:\x20'+JSON['stringify'](m['errors'])['slice'](0x0,0x1f4));const n=m['data']?.['transactions'];if(!n)throw new Error('CDC\x20GraphQL\x20returned\x20no\x20transactions\x20connection');for(const o of n['nodes']??[]){const p=o?.['effects']?.['checkpoint']?.['sequenceNumber'];if(p===undefined||p===null)continue;const q=BigInt(p);if(q<=d||q>=e)throw new Error('CDC_INTERVAL_VIOLATION:\x20tx\x20checkpoint\x20'+p+'\x20outside\x20('+d+',\x20'+e+')');if(q>BigInt(k))k=String(q);for(const r of o?.['effects']?.['objectChanges']?.['nodes']??[]){const s=normalizeWowAddress(r['address']);if(r['idDeleted']){h['add'](s);continue;}const t=r['outputState']?.['asMoveObject']?.['contents']?.['type']?.['repr'];if(!t)continue;if(wowTypedKindFromMoveType(t)!==c)continue;g['add'](s);}}j+=0x1,i=n['pageInfo']?.['hasNextPage']?n['pageInfo']['endCursor']:null;}while(i!==null&&j<MAX_TX_PAGES);if(i!==null)throw new Error('CDC_PAGE_CAP:\x20exceeded\x20'+MAX_TX_PAGES+'\x20pages\x20for\x20('+a+',\x20'+b+')');for(const u of h)g['delete'](u);const l=await this['snapshot']['hydrateFacts']([...g],f,k);return{'facts':l,'deletedIds':[...h],'observedThrough':k,'pages':j};}}export class CdcSynchronizer{['projection'];['source'];['cursors'];constructor(a,b,c){this['projection']=a,this['source']=b,this['cursors']=c;}async['run'](a){if(!a['expectedChainId'])throw new Error('expectedChainId\x20is\x20required');if(!a['kind'])throw new Error('kind\x20is\x20required');const b=a['maxSpan']??0x1f4;if(!Number['isInteger'](b)||b<0x1)throw new Error('Invalid\x20maxSpan:\x20'+b);if(a['stalledLag']!==undefined&&(!Number['isInteger'](a['stalledLag'])||a['stalledLag']<0x0))throw new Error('Invalid\x20stalledLag:\x20'+a['stalledLag']);const c=a['stalledLag']===undefined?stalledLagCheckpoints():BigInt(a['stalledLag']);return this['cursors']['withCdcLock'](a['expectedChainId'],a['kind'],()=>this['poll'](a,b,c));}async['poll'](a,b,c){const d=a['expectedChainId'],e=await this['source']['head']();if(e['chainId']!==d)throw new Error('CHAIN_IDENTITY_MISMATCH:\x20source\x20reported\x20'+e['chainId']);const f=await this['cursors']['cdcCheckpoint'](d,a['kind']),g={'applied':0x0,'duplicate':0x0,'stale':0x0,'quarantined':0x0,'conflict':0x0,'tombstoned':0x0,'skipped_facts':0x0};if(f===null)return await this['cursors']['setCdcCheckpoint'](d,a['kind'],e['checkpoint']),{'chainId':d,'kind':a['kind'],'anchored':!![],'reanchored_from':null,'from':null,'to':e['checkpoint'],'head':e['checkpoint'],'pages':0x0,...g};const h=BigInt(f),i=BigInt(e['checkpoint']);if(i<=h)return{'chainId':d,'kind':a['kind'],'anchored':![],'reanchored_from':null,'from':f,'to':f,'head':e['checkpoint'],'pages':0x0,...g};if(c>0x0n&&i-h>c)return await this['cursors']['setCdcCheckpoint'](d,a['kind'],e['checkpoint']),{'chainId':d,'kind':a['kind'],'anchored':![],'reanchored_from':f,'from':f,'to':e['checkpoint'],'head':e['checkpoint'],'pages':0x0,...g};const j=i<h+BigInt(b)?i:h+BigInt(b),k=await this['source']['readChanges'](f,(j+0x1n)['toString'](),a['kind']);for(const m of k['facts']){const n=m;if(!n['object_id']){g['skipped_facts']+=0x1;continue;}const o=await this['projection']['apply'](m);o['status']in g&&(g[o['status']]+=0x1);}for(const p of k['deletedIds']){await this['projection']['markTombstoneIfKind'](d,p,a['kind'])&&(g['tombstoned']+=0x1);}const l=k['observedThrough'];return BigInt(l)>h&&await this['cursors']['setCdcCheckpoint'](d,a['kind'],l),{'chainId':d,'kind':a['kind'],'anchored':![],'reanchored_from':null,'from':f,'to':BigInt(l)>h?l:f,'head':e['checkpoint'],'pages':k['pages'],...g};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ObjectError,WowClient,WowGraphQLClient,fromBase58,getFullnodeUrl,getGraphqlUrl,gqlObject2RpcData,needsRpcFallback,normalizeWowAddress,object_name_from_type,toHex}from'@wowok/wowok';export function canonicalChainIdentifier(a){if(/^[0-9a-fA-F]{8}$/['test'](a))return a['toLowerCase']();const b=fromBase58(a);if(b['length']<0x4)throw new Error('Invalid\x20genesis\x20chain\x20identifier');return toHex(b['slice'](0x0,0x4));}function ownerAddress(a){switch(a['$kind']){case'AddressOwner':return a['AddressOwner'];case'ObjectOwner':return a['ObjectOwner'];case'ConsensusAddressOwner':return a['ConsensusAddressOwner']['owner'];default:return undefined;}}export function factFromRpc(a,b,c,d,e){if(!d?.['digest']||!d['type']||!d['content']||!('fields'in d['content']))return null;const f=fromBase58(d['digest']);if(f['length']!==0x20)throw new Error('Invalid\x20object\x20digest:\x20'+d['objectId']);if(!d['previousTransaction'])return null;const g=normalizeWowAddress(d['objectId']);return{'chain_id':b,'object_id':g,'object_version':String(d['version']),'move_type':d['type'],'owner_kind':d['owner']?.['$kind']??'Shared','owner_address':d['owner']?ownerAddress(d['owner']):undefined,'payload_uri':'graphql://'+a+'/object/'+g+'/version/'+d['version'],'payload_hash':'0x'+toHex(f),'payload_format':'rpc-content-v1','payload_json':d['content']?.['fields']??null,'checkpoint':c,'tx_digest':d['previousTransaction'],'state':'active','observed_at':e};}export class GraphQLSnapshotSource{['graphql'];['rpc'];['network'];['expectedChainId'];constructor(a,b,c,d){this['graphql']=a,this['rpc']=b,this['network']=c,this['expectedChainId']=d;}static['forNetwork'](a,b){const c=getGraphqlUrl(a);if(!c)throw new Error('No\x20GraphQL\x20endpoint\x20configured\x20for\x20'+a);return new GraphQLSnapshotSource(new WowGraphQLClient({'url':c,'network':a}),new WowClient({'url':getFullnodeUrl(a),'network':a}),a,b);}async['observe'](){const [a,b
|
|
1
|
+
import{ObjectError,WowClient,WowGraphQLClient,fromBase58,getFullnodeUrl,getGraphqlUrl,gqlObject2RpcData,needsRpcFallback,normalizeWowAddress,object_name_from_type,toHex}from'@wowok/wowok';export function canonicalChainIdentifier(a){if(/^[0-9a-fA-F]{8}$/['test'](a))return a['toLowerCase']();const b=fromBase58(a);if(b['length']<0x4)throw new Error('Invalid\x20genesis\x20chain\x20identifier');return toHex(b['slice'](0x0,0x4));}const LATEST_CHECKPOINT_QUERY='\x0aquery\x20ChainIdentity\x20{\x0a\x20\x20\x20\x20checkpoint\x20{\x20sequenceNumber\x20digest\x20}\x0a}';export async function verifyChainIdentity(a,b,c){const d=await b['getChainIdentifier'](),e=canonicalChainIdentifier(typeof d==='string'?d:d?.['chainIdentifier']),f=canonicalChainIdentifier(c);if(e!==f)throw new Error('CHAIN_IDENTITY_MISMATCH');let g=null;try{const k=await a['core']['getChainIdentifier']();g=canonicalChainIdentifier(k['chainIdentifier']);}catch{g=null;}if(g!==null){if(g!==e)throw new Error('CHAIN_IDENTITY_MISMATCH');return e;}const h=await a['query']({'query':LATEST_CHECKPOINT_QUERY,'variables':{}});if(h?.['errors']?.['length'])throw new Error('GraphQL\x20identity\x20query\x20failed:\x20'+JSON['stringify'](h['errors'])['slice'](0x0,0x1f4));const i=h?.['data']?.['checkpoint'];if(!i?.['sequenceNumber']||!i?.['digest'])throw new Error('CHAIN_IDENTITY_MISMATCH');const j=await b['getCheckpoint']({'id':String(i['sequenceNumber'])});if(!j?.['digest']||toHex(fromBase58(j['digest']))!==toHex(fromBase58(i['digest'])))throw new Error('CHAIN_IDENTITY_MISMATCH');return e;}function ownerAddress(a){switch(a['$kind']){case'AddressOwner':return a['AddressOwner'];case'ObjectOwner':return a['ObjectOwner'];case'ConsensusAddressOwner':return a['ConsensusAddressOwner']['owner'];default:return undefined;}}export function factFromRpc(a,b,c,d,e){if(!d?.['digest']||!d['type']||!d['content']||!('fields'in d['content']))return null;const f=fromBase58(d['digest']);if(f['length']!==0x20)throw new Error('Invalid\x20object\x20digest:\x20'+d['objectId']);if(!d['previousTransaction'])return null;const g=normalizeWowAddress(d['objectId']);return{'chain_id':b,'object_id':g,'object_version':String(d['version']),'move_type':d['type'],'owner_kind':d['owner']?.['$kind']??'Shared','owner_address':d['owner']?ownerAddress(d['owner']):undefined,'payload_uri':'graphql://'+a+'/object/'+g+'/version/'+d['version'],'payload_hash':'0x'+toHex(f),'payload_format':'rpc-content-v1','payload_json':d['content']?.['fields']??null,'checkpoint':c,'tx_digest':d['previousTransaction'],'state':'active','observed_at':e};}export class GraphQLSnapshotSource{['graphql'];['rpc'];['network'];['expectedChainId'];constructor(a,b,c,d){this['graphql']=a,this['rpc']=b,this['network']=c,this['expectedChainId']=d;}static['forNetwork'](a,b){const c=getGraphqlUrl(a);if(!c)throw new Error('No\x20GraphQL\x20endpoint\x20configured\x20for\x20'+a);return new GraphQLSnapshotSource(new WowGraphQLClient({'url':c,'network':a}),new WowClient({'url':getFullnodeUrl(a),'network':a}),a,b);}async['observe'](){const [a,b]=await Promise['all']([verifyChainIdentity(this['graphql'],this['rpc'],this['expectedChainId']),this['rpc']['getLatestCheckpointSequenceNumber']()]);return{'chainId':a,'checkpoint':b};}async['readPage'](a){const [b,c]=await Promise['all']([this['observe'](),this['graphql']['listSharedObjects']({'type':a['type'],'cursor':a['cursor'],'limit':a['limit'],'include':{'previousTransaction':!![]},'signal':a['signal']})]),d=await this['fetchRpcShapes'](c['objects']['map'](g=>g['objectId']),a['signal']),e=new Date()['toISOString'](),f=c['objects']['map']((g,h)=>{if(!g['type']||!g['previousTransaction'])throw new Error('Incomplete\x20GraphQL\x20object\x20metadata:\x20'+g['objectId']);const i=fromBase58(g['digest']);if(i['length']!==0x20)throw new Error('Invalid\x20object\x20digest:\x20'+g['objectId']);const j=d[h];if(!j)throw new Error('OBJECT_VANISHED_MID_PAGE:\x20'+g['objectId']);if(String(j['version'])!==String(g['version']))throw new Error('NON_STABLE_SNAPSHOT:\x20'+g['objectId']);const k=normalizeWowAddress(g['objectId']);return{'chain_id':b['chainId'],'object_id':k,'object_version':g['version'],'move_type':j['type']??g['type'],'owner_kind':g['owner']['$kind'],'owner_address':ownerAddress(g['owner']),'payload_uri':'graphql://'+this['network']+'/object/'+k+'/version/'+g['version'],'payload_hash':'0x'+toHex(i),'payload_format':'rpc-content-v1','payload_json':j['content']?.['fields']??null,'checkpoint':b['checkpoint'],'tx_digest':g['previousTransaction'],'state':'active','observed_at':e};});return{'chainId':b['chainId'],'checkpoint':b['checkpoint'],'facts':f,'nextCursor':c['cursor'],'hasNextPage':c['hasNextPage']};}async['fetchRpcShapes'](a,b){if(a['length']===0x0)return[];const c=new Array(a['length']),d=[],e=[],f=await this['graphql']['getObjects']({'objectIds':a,'include':{'json':!![]},'signal':b});f['objects']['forEach']((h,i)=>{if(h instanceof ObjectError)return;const j=h;if(!j['json']||!j['layout']){d['push'](a[i]),e['push'](i);return;}const k=gqlObject2RpcData(j);if(needsRpcFallback(object_name_from_type(k['type']))){d['push'](a[i]),e['push'](i);return;}c[i]=k;});if(d['length']>0x0){const g=await this['rpc']['multiGetObjects']({'objectIds':d,'options':{'showContent':!![],'showPreviousTransaction':!![]}});g['forEach']((h,j)=>{h?.['data']?.['content']&&'fields'in h['data']['content']&&(c[e[j]]=h['data']);});}return c;}async['hydrateFacts'](a,b,c,d){if(a['length']===0x0)return[];const e=await this['rpc']['multiGetObjects']({'objectIds':a,'options':{'showContent':!![],'showPreviousTransaction':!![],'showOwner':!![],'showType':!![]},'signal':d}),f=new Date()['toISOString'](),g=[];for(const h of e){if(!h?.['data'])continue;const i=factFromRpc(this['network'],b,c,h['data'],f);if(i)g['push'](i);}return g;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{REQUIREMENT_PASS_THRESHOLD,effectiveWeight,isDataSourceEnabled,isRuleEnabled,normalizeInjection}from'./user-injection.js';import{levelFromScore as
|
|
1
|
+
import{REQUIREMENT_PASS_THRESHOLD,effectiveWeight,isDataSourceEnabled,isRuleEnabled,normalizeInjection}from'./user-injection.js';import{levelFromScore as a77a,concernLabel}from'./standards.js';export function levelFromScore(a){return a77a(a);}function appliesTo(a,b){if(!a||a['length']===0x0)return!![];return a['includes'](b);}export class EvaluationEngine{static ['instance']=null;['dataSources']=new Map();['rules']=new Map();static['Instance'](){return!EvaluationEngine['instance']&&(EvaluationEngine['instance']=new EvaluationEngine()),EvaluationEngine['instance'];}['registerDataSource'](a){if(!a['id']||this['dataSources']['has'](a['id']))return![];return this['dataSources']['set'](a['id'],a),!![];}['unregisterDataSource'](a){return this['dataSources']['delete'](a);}['registerRule'](a){if(!a['id']||this['rules']['has'](a['id']))return![];return this['rules']['set'](a['id'],a),!![];}['unregisterRule'](a){return this['rules']['delete'](a);}['getRule'](a){return this['rules']['get'](a);}['listRules'](){return Array['from'](this['rules']['values']());}['getDataSource'](a){return this['dataSources']['get'](a);}['listDataSources'](){return Array['from'](this['dataSources']['values']());}async['evaluate'](a,b,c){const d=normalizeInjection(c),e={'evaluation_id':a,'entities':b,'facts':{},'injection':d,'now':Date['now']()},f=[],g=[],h=Array['from'](this['dataSources']['values']())['filter'](n=>appliesTo(n['evaluation_ids'],a))['sort']((n,o)=>(n['priority']??0x0)-(o['priority']??0x0));for(const n of h){if(!isDataSourceEnabled(n['id'],d)){f['push']({'kind':'override','id':n['id'],'detail':'data\x20source\x20disabled\x20by\x20user\x20override'});continue;}if(n['isEnabled']&&!n['isEnabled'](e))continue;const o=await n['extract'](e);Object['assign'](e['facts'],o),f['push']({'kind':'data_source','id':n['id'],'detail':'extracted\x20'+Object['keys'](o)['length']+'\x20fact(s)'});}const i=[],j=[];for(const p of this['rules']['values']()){if(!appliesTo(p['evaluation_ids'],a))continue;if(!isRuleEnabled(p['id'],d)){f['push']({'kind':'override','id':p['id'],'detail':'rule\x20disabled\x20by\x20user\x20override'});continue;}if(p['isEnabled']&&!p['isEnabled'](e))continue;const q=p['evaluate'](e);if(!q){f['push']({'kind':'rule','id':p['id'],'detail':'not\x20applicable\x20—\x20excluded\x20from\x20weighted\x20aggregation'});continue;}const r=effectiveWeight(p,d);i['push']({'rule_id':p['id'],'dimension':p['dimension'],'score':q['score'],'weight':r,'weight_source':r!==p['weight']?'override':'default','reason':q['reason'],'matched':q['matched'],'mismatched':q['mismatched'],'finding_refs':q['finding_refs'],'red_flag':q['red_flag']});if(q['red_flag']){const s=q['reason']??p['id']+'\x20triggered\x20a\x20hard\x20block';j['push'](s),g['push']({'flag':s,'basis':'object_defect','rule_id':p['id']});}f['push']({'kind':'rule','id':p['id'],'detail':'score='+q['score']+'\x20weight='+r});}const k=aggregateScore(i);let l=j['length']>0x0;for(const t of d['requirements']??[]){const u=i['find'](v=>v['rule_id']===t['rule_id']);if(t['condition']==='require'){if(!u||u['score']<REQUIREMENT_PASS_THRESHOLD||u['red_flag']){l=!![];const v=t['note']??'Requirement\x20requires\x20rule\x20\x27'+t['rule_id']+'\x27\x20to\x20pass';j['push'](v),g['push']({'flag':v,'basis':'requirement_unmet','rule_id':t['rule_id']});}}else{if(t['condition']==='forbid'){if(u&&u['red_flag']){l=!![];const w=t['note']??'Requirement\x20forbids\x20rule\x20\x27'+t['rule_id']+'\x27\x20from\x20triggering';j['push'](w),g['push']({'flag':w,'basis':'requirement_unmet','rule_id':t['rule_id']});}}}}const m=e['facts']['summary']??buildSummary(a,k,i,j,l);return{'evaluation_id':a,'total':k,'level':levelFromScore(k),'level_label':concernLabel(k),'breakdown':i,'red_flags':j,'red_flag_basis':g,'blocked':l,'trace':f,'summary':m,'criterionScores':e['facts']['criterionScores'],'findings':e['facts']['findings'],'strengths':e['facts']['strengths'],'needsLlm':e['facts']['needsLlm'],'llmPrompt':e['facts']['llmPrompt']};}}function aggregateScore(a){if(a['length']===0x0)return 0x0;let c=0x0,d=0x0;for(const e of a){c+=e['score']*e['weight'],d+=e['weight'];}if(d<=0x0)return 0x0;return clamp(Math['round'](c/d),0x0,0x64);}function clamp(a,b,c){return Math['max'](b,Math['min'](c,a));}function buildSummary(a,b,c,d,e){const f=['Evaluation\x20\x27'+a+'\x27:\x20score\x20'+b+'/100'];return e?f['push']('BLOCKED\x20('+d['length']+'\x20red\x20flag(s))'):f['push'](c['length']+'\x20rule(s)\x20evaluated'),f['join']('\x20—\x20');}export function getEvaluationEngine(){return EvaluationEngine['Instance']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{distillIntent,extractSignals}from'./intent-distill.js';import{getProfile,updateFromOperation}from'./user-profile.js';import{findMatches,recordSignature}from'./experience-reuse.js';import{EXPERIENCE_LAYER_VERSION}from'./types.js';import{isEnabled as
|
|
1
|
+
import{distillIntent,extractSignals}from'./intent-distill.js';import{getProfile,updateFromOperation}from'./user-profile.js';import{findMatches,recordSignature}from'./experience-reuse.js';import{EXPERIENCE_LAYER_VERSION}from'./types.js';import{isEnabled as a102a}from'../config/index.js';import{recordIndustrySignal}from'../knowledge/flywheel-loop.js';export{EXPERIENCE_LAYER_VERSION};export function getExperienceFeedback(a,b,c){try{const d=distillIntent(a,b,c),e=findMatches(d['primary_intent'],a,b,0x3);if(e['length']===0x0)return undefined;const f=e[0x0],g=getProfile();return formatFeedback(f,e,d['scenario'],g);}catch{return undefined;}}export function recordOperationOutcome(a,b,c,d,e,f=[]){try{const g=distillIntent(a,b,c),h=extractSignals(a,b);recordSignature({'intent':g['primary_intent'],'scenario':g['scenario'],'signals':h,'timestamp':Date['now'](),'outcome':d,'error_code':e}),updateFromOperation(g['primary_intent'],g['scenario'],d,e,f);try{if(a102a('industry_evolution')){const i=typeof b?.['industry']==='string'&&b['industry']['trim']()?b['industry']['trim']():undefined;if(i){const j=d==='success'?{'success':!![]}:{'success':![],'error_code':e};recordIndustrySignal(i,{'type':a,'data':b},j);}}}catch{}}catch{}}function formatFeedback(a,b,c,d){const e=buildAdviceText(a,b,d),f=collectAvoidList(b,d),g=a['relevance'],h=c??a['signature']['scenario'],i={};if(e)i['advice']=e;if(f['length']>0x0)i['avoid']=f;if(g>0x0)i['relevance']=Math['round'](g*0x64)/0x64;if(h)i['matched_scenario']=h;return i;}function buildAdviceText(a,b,c){const d=[];if(a['signature']['outcome']==='success')d['push']('Historically,\x20'+a['signature']['intent']+'\x20operation\x20succeeded');else a['signature']['outcome']==='failed'&&d['push']('Historically,\x20'+a['signature']['intent']+'\x20operation\x20failed\x20('+(a['signature']['error_code']??'unknown\x20error')+'),\x20pay\x20special\x20attention\x20to\x20parameters');return c['expertise_tier']==='novice'&&b['length']>0x0&&d['push']('It\x20is\x20recommended\x20to\x20carefully\x20check\x20parameters\x20before\x20executing'),d['join'](';\x20')||a['advice'];}function collectAvoidList(b,c){const d=new Set();for(const e of b){for(const f of e['avoid']){d['add'](f);}}for(const g of c['frequent_pitfalls']){d['add']('You\x20often\x20make\x20mistakes\x20at\x20the\x20'+g+'\x20step,\x20please\x20be\x20especially\x20careful');}return Array['from'](d)['slice'](0x0,0x5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EDGE_SCHEMAS,EDGE_SCHEMA_BY_ID}from'./edge-schema.js';import{extractCoinType,extractEventRefs,extractObjectEdges,extractReverseRefs,extractTableRefs,inferObjectType,REVERSE_GROUP_WILDCARD}from'./extract.js';import{mergeBudget}from'./dataplane.js';import{deriveOrderCompletion,terminalNamesOfEdges}from'./order-status.js';import{LINKER_RING_LIMIT as a153a}from'./sdk-batch.js';import{wowAddressKind}from'@wowok/wowok';function readStats(a){const b=a;if(b['stats'])return{'batches':b['stats']['batches'],'byChannel':{...b['stats']['byChannel']},'dedupHits':b['stats']['dedupHits']};if(b['batches'])return{'batches':Object['values'](b['batches'])['reduce']((c,d)=>c+d,0x0),'byChannel':{...b['batches']},'dedupHits':b['dedupHits']??0x0};return{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0};}function isEoa(a){return wowAddressKind(a)==='user';}function isWfNodeId(a){return a['includes']('::node::');}class Gate{['wl'];constructor(a){this['wl']=a;}['allows'](a,b){if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['schemas'])return this['wl']['schemas']['includes'](a['id']);if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!![];}['allowsTable'](a,b){if(a['read']['kind']!=='table')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['tableEdges']?.['includes'](a['id']);}['allowsEvent'](a,b){if(a['read']['kind']!=='event')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['eventEdges']?.['includes'](a['id']);}['effectiveMaxHops'](a){const b=a['maxHops'],c=this['wl']['schemaHops']?.[a['id']];if(b===undefined)return c;if(c===undefined)return b;return Math['min'](b,c);}}class GraphBuilder{['graph'];['edgeIds']=new Set();['budget'];['exhausted']={};constructor(a,b,c){this['budget']=c,this['graph']={'network':a,'seed':b,'builtAt':Date['now'](),'nodes':new Map(),'edges':[],'out':new Map(),'inc':new Map(),'gaps':[],'truncations':[],'rpcReport':{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0},'budgetExhausted':{}};}['addSeed'](a){const b=inferObjectType(a),c={'id':a,'kind':isWfNodeId(a)?'wfnode':isEoa(a)?'eoa':'object','objectType':b??undefined,'state':'seed','origins':[],'depth':0x0};return this['graph']['nodes']['set'](a,c),c;}['addNode'](a,b,c){const d=this['graph']['nodes']['get'](a);if(d){if(c)d['origins']['push']({'via':c['schema'],'from':c['from'],'depth':b});return d;}if(this['graph']['nodes']['size']>=this['budget']['maxNodes'])return this['exhausted']['nodes']=!![],undefined;const e=isWfNodeId(a),f=e?undefined:inferObjectType(a),g={'id':a,'kind':e?'wfnode':isEoa(a)?'eoa':'object','objectType':f??undefined,'state':e?'stub':'seed','origins':c?[{'via':c['schema'],'from':c['from'],'depth':b}]:[],'depth':b};return this['graph']['nodes']['set'](a,g),g;}['addEdge'](a,b,c,d,e){const f=c['to'],g=c['key']?'|'+c['key']:'',h=a['id']+'|'+b+'→'+f+g;if(this['edgeIds']['has'](h))return;this['edgeIds']['add'](h);const i={'id':h,'schema':a['id'],'family':a['family'],'from':b,'to':f,'retention':a['retention'],'observedAt':d,'payload':c['payload'],'truncated':e||a['retention']==='bounded_window','key':c['key']};this['graph']['edges']['push'](i),pushMap(this['graph']['out'],b,i),pushMap(this['graph']['inc'],f,i);}['markTruncation'](a){this['graph']['truncations']['push'](a);}['finalize'](a){return this['graph']['rpcReport']=readStats(a),this['graph']['budgetExhausted']=this['exhausted'],this['graph'];}}function pushMap(a,b,c){const d=a['get'](b);if(d)d['push'](c);else a['set'](b,[c]);}export async function expandTopology(a,c){const d=c['seed']['toLowerCase'](),e=mergeBudget(c['budget']),f=new Gate(c['edges']??{}),h=new GraphBuilder(c['network'],d,e);h['addSeed'](d);const i=new Set(),j=new Set(),l=new Set(),m=new Map(),n=new Set();let o=new Set([d]);for(let p=0x0;p<=e['maxDepth'];p++){if(o['size']===0x0)break;if(h['exhausted']['nodes'])break;const q=Date['now'](),r=new Map(),t=(D,E)=>{const F=r['get'](D);if(F)return F;const G=new Map();r['set'](D,G);const H=h['graph']['nodes']['get'](D);if(H&&H['origins']['length']>0x0&&!E['has'](D)){E['add'](D);for(const I of H['origins']){if(!I['via']||!I['from']||E['has'](I['from']))continue;const J=t(I['from'],E);for(const [L,M]of J){if(M<(G['get'](L)??Infinity))G['set'](L,M);}const K=(J['get'](I['via'])??0x0)+0x1;if(K<(G['get'](I['via'])??Infinity))G['set'](I['via'],K);}E['delete'](D);}return G;},u=[...o]['filter'](D=>{const E=h['graph']['nodes']['get'](D);return E['kind']==='object'&&(E['state']==='seed'||E['state']==='stub')&&!i['has'](D);}),v=new Set();if(u['length']>0x0){const D=await a['getObjects'](u);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];for(const E of u){const F=h['graph']['nodes']['get'](E),G=lookupMapLower(D,E);i['add'](E);if(!G){F['state']='error',F['error']='not_found_or_failed',h['graph']['gaps']['push'](E);continue;}F['state']='fetched',F['raw']=G,F['objectType']=String(G['type']??F['objectType']??inferObjectType(E)??''),F['coinType']=extractCoinType(G['type_raw']),v['add'](E);}}const w=[];for(const H of v){const I=h['graph']['nodes']['get'](H);if(!I['objectType']||!I['raw'])continue;for(const J of extractObjectEdges(I['objectType'],I['raw'])){const K=EDGE_SCHEMA_BY_ID['get'](J['schemaId']);if(!K||!f['allows'](K,p))continue;w['push']({'schema':K,'sourceId':H,'refs':J['refs'],'observed':J['refs']['length']});}}const x=[...v]['filter'](L=>{const M=h['graph']['nodes']['get'](L);return EDGE_SCHEMAS['some'](N=>N['source']===M['objectType']&&N['read']['kind']==='table');});for(const L of x){const M=h['graph']['nodes']['get'](L),N=EDGE_SCHEMAS['filter'](P=>P['source']===M['objectType']&&P['read']['kind']==='table'&&f['allowsTable'](P,p)),O=new Map();for(const P of N){const Q=P['read']['rowType'],R=O['get'](Q)??[];R['push'](P),O['set'](Q,R);}for(const [S,T]of O){const U=L+'|'+S;if(l['has'](U))continue;l['add'](U);const V=Math['max'](...T['map'](a0=>e['perKindCaps'][a0['id']]??e['maxFanoutPerNode']));let W,X=![];try{const a0=await a['getTable'](L,{'maxItems':V});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];W=a0['items'],X=a0['truncated'];}catch{h['graph']['gaps']['push'](L+'#'+S);continue;}const Y=new Set(T['map'](a1=>a1['id'])),Z=extractTableRefs(S,L,W)['filter'](a1=>{const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);return a2['read']['kind']==='derived'||Y['has'](a1['schemaId']);});for(const a1 of Z){const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);let a3=a1['refs'];a2['family']==='M'&&M['coinType']&&(a3=a3['map'](a4=>({...a4,'payload':{'coinType':M['coinType'],...a4['payload']}}))),w['push']({'schema':a2,'sourceId':L,'refs':a3,'observed':a3['length']});}X&&h['markTruncation']({'nodeId':L,'schema':T[0x0]['id'],'observed':W['length'],'limit':V,'reason':'table_page'});}}const y=[...o]['filter'](a4=>{const a5=h['graph']['nodes']['get'](a4);return a5['kind']!=='wfnode'&&(a5['kind']==='eoa'||a5['state']==='fetched');}),z=new Map(),A=new Map();for(const a4 of y){const a5=h['graph']['nodes']['get'](a4);for(const a6 of EDGE_SCHEMAS){if(a6['read']['kind']!=='reverse'||!f['allows'](a6,p))continue;if(!sourceMatches(a6['source'],a5))continue;const a7=a6['read']['parent'],a8=a4+'|'+a7;if(j['has'](a8))continue;if(!z['has'](a7))z['set'](a7,[]);z['get'](a7)['push'](a4);const a9=a4+'|'+a7+'|schema',aa=A['get'](a9)??[];aa['push'](a6),A['set'](a9,aa);}}for(const [ab,ac]of z){for(const ae of ac)j['add'](ae+'|'+ab);let ad=new Map();try{ad=await a['getKeyedFields'](ab,ac);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];}catch{h['graph']['gaps']['push']('reverse:'+ab);continue;}for(const af of ac){const ag=A['get'](af+'|'+ab+'|schema')??[],ah=lookupMapLower(ad,af);if(!ah)continue;const ai=extractReverseRefs(ab,ah['data']??ah);for(const aj of ag){const ak=aj['read'];for(const al of ai){if(al['schemaId']!==REVERSE_GROUP_WILDCARD&&al['schemaId']!==aj['id'])continue;let am=al['refs']['map'](an=>an['to']?an:{...an,'to':af});ak['kind']==='reverse'&&ak['filterType']&&(am=am['filter'](an=>inferObjectType(an['to'])===ak['filterType']));if(am['length']===0x0)continue;w['push']({'schema':aj,'sourceId':af,'refs':am,'observed':am['length']});}}}}for(const an of EDGE_SCHEMAS){const ao=an['read'];if(ao['kind']!=='event'||!f['allowsEvent'](an,p))continue;const ap=[...o]['filter'](ar=>{if(n['has'](ar+'|'+an['id']))return![];return sourceMatches(an['source'],h['graph']['nodes']['get'](ar));});if(ap['length']===0x0)continue;let aq=m['get'](ao['eventType']);if(!aq){aq={'events':[],'truncated':![],'failed':![]};try{const ar=await a['getEvents'](ao['eventType'],{'maxPages':e['maxEventPages']});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];aq['events']=ar['events'],aq['truncated']=ar['truncated'],ar['truncated']&&ar['events']['length']===0x0&&(aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']));}catch{aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']);}m['set'](ao['eventType'],aq);}if(aq['failed']){for(const as of ap)n['add'](as+'|'+an['id']);continue;}if(aq['truncated']){h['exhausted']['eventPages']=!![];for(const at of ap){h['markTruncation']({'nodeId':at,'schema':an['id'],'observed':aq['events']['length'],'limit':e['maxEventPages'],'reason':'event_pages'});}}for(const au of ap){n['add'](au+'|'+an['id']);const av=extractEventRefs(ao,au,aq['events']);if(av['length']===0x0)continue;w['push']({'schema':an,'sourceId':au,'refs':av,'observed':av['length'],'truncated':aq['truncated']});}}const B=new Set(),C=new Map();for(const aw of w){const ax=e['perKindCaps'][aw['schema']['id']]??e['maxFanoutPerNode'],ay=C['get'](aw['sourceId'])??0x0,az=Math['max'](0x0,e['maxFanoutPerNode']-ay),aA=Math['min'](ax,az),aB=aw['refs']['slice'](0x0,aA);aw['refs']['length']>aA&&h['markTruncation']({'nodeId':aw['sourceId'],'schema':aw['schema']['id'],'observed':aw['refs']['length'],'limit':a153a,'reason':'fanout'});const aC=new Map();for(const aD of aB){const aE=aD['from']??aw['sourceId'],aF=isWfNodeId(aD['to'])?p:p+0x1,aG=h['graph']['nodes']['has'](aD['to']),aH=f['effectiveMaxHops'](aw['schema']);if(aH!==undefined){const aJ=(t(aE,new Set())['get'](aw['schema']['id'])??0x0)+0x1;if(aJ>aH&&!aG){aC['set'](aE,(aC['get'](aE)??0x0)+0x1);continue;}}if(aF>e['maxDepth']&&!aG){h['exhausted']['depth']=!![];continue;}const aI=h['addNode'](aD['to'],Math['min'](aF,e['maxDepth']),{'schema':aw['schema']['id'],'from':aE});if(!aI)break;h['addEdge'](aw['schema'],aE,aD,q,aw['truncated']===!![]||aw['refs']['length']>aA),C['set'](aw['sourceId'],ay+0x1);if(!isWfNodeId(aD['to'])&&aF<=e['maxDepth'])B['add'](aD['to']);}for(const [aK,aL]of aC){h['markTruncation']({'nodeId':aK,'schema':aw['schema']['id'],'observed':aL,'limit':f['effectiveMaxHops'](aw['schema'])??0x0,'reason':'schema_hops'});}}if(h['exhausted']['rpcs']){h['graph']['gaps']['push']('budget:maxRpcs');break;}o=B;}return h['finalize'](a);}function sourceMatches(a,b){if(a==='ANY')return!![];if(a==='EOA')return b['kind']==='eoa';return b['objectType']===a;}function lookupMapLower(a,b){const c=a['get'](b);if(c!==undefined)return c;for(const [d,e]of a)if(d['toLowerCase']()===b)return e;return undefined;}export function orderCompletionInGraph(a,b){const c=a['nodes']['get'](b['toLowerCase']()),d=c?.['raw']?.['data']??c?.['raw']??{},e=String(d['machine']??''),f=String(d['progress']??''),g=a['nodes']['get'](f['toLowerCase']()),h=String((g?.['raw']?.['data']??g?.['raw']??{})['current']??'');let i=null;if(e){const j=e['toLowerCase']()+'::node::',k=a['edges']['filter'](l=>l['schema']==='wf.transition'&&l['from']['startsWith'](j))['map'](l=>({'node':l['payload']?.['node'],'prev_node':l['payload']?.['prevNode']}));if(k['length']>0x0)i=terminalNamesOfEdges(k);}return deriveOrderCompletion({'machine':e||null,'progress':f||null,'currentNode':h||null,'terminalNames':i});}
|
|
1
|
+
import{EDGE_SCHEMAS,EDGE_SCHEMA_BY_ID}from'./edge-schema.js';import{extractCoinType,extractEventRefs,extractObjectEdges,extractReverseRefs,extractTableRefs,inferObjectType,REVERSE_GROUP_WILDCARD}from'./extract.js';import{mergeBudget}from'./dataplane.js';import{deriveOrderCompletion,terminalNamesOfEdges}from'./order-status.js';import{LINKER_RING_LIMIT as a129a}from'./sdk-batch.js';import{wowAddressKind}from'@wowok/wowok';function readStats(a){const b=a;if(b['stats'])return{'batches':b['stats']['batches'],'byChannel':{...b['stats']['byChannel']},'dedupHits':b['stats']['dedupHits']};if(b['batches'])return{'batches':Object['values'](b['batches'])['reduce']((c,d)=>c+d,0x0),'byChannel':{...b['batches']},'dedupHits':b['dedupHits']??0x0};return{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0};}function isEoa(a){return wowAddressKind(a)==='user';}function isWfNodeId(a){return a['includes']('::node::');}class Gate{['wl'];constructor(a){this['wl']=a;}['allows'](a,b){if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['schemas'])return this['wl']['schemas']['includes'](a['id']);if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!![];}['allowsTable'](a,b){if(a['read']['kind']!=='table')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['tableEdges']?.['includes'](a['id']);}['allowsEvent'](a,b){if(a['read']['kind']!=='event')return![];if(this['wl']['deny']?.['includes'](a['id']))return![];const c=this['wl']['familyDepths']?.[a['family']];if(c!==undefined&&b>=c)return![];if(this['wl']['families']&&!this['wl']['families']['includes'](a['family']))return![];return!!this['wl']['eventEdges']?.['includes'](a['id']);}['effectiveMaxHops'](a){const b=a['maxHops'],c=this['wl']['schemaHops']?.[a['id']];if(b===undefined)return c;if(c===undefined)return b;return Math['min'](b,c);}}class GraphBuilder{['graph'];['edgeIds']=new Set();['budget'];['exhausted']={};constructor(a,b,c){this['budget']=c,this['graph']={'network':a,'seed':b,'builtAt':Date['now'](),'nodes':new Map(),'edges':[],'out':new Map(),'inc':new Map(),'gaps':[],'truncations':[],'rpcReport':{'batches':0x0,'byChannel':{'objects':0x0,'keyedFields':0x0,'tables':0x0,'events':0x0},'dedupHits':0x0},'budgetExhausted':{}};}['addSeed'](a){const b=inferObjectType(a),c={'id':a,'kind':isWfNodeId(a)?'wfnode':isEoa(a)?'eoa':'object','objectType':b??undefined,'state':'seed','origins':[],'depth':0x0};return this['graph']['nodes']['set'](a,c),c;}['addNode'](a,b,c){const d=this['graph']['nodes']['get'](a);if(d){if(c)d['origins']['push']({'via':c['schema'],'from':c['from'],'depth':b});return d;}if(this['graph']['nodes']['size']>=this['budget']['maxNodes'])return this['exhausted']['nodes']=!![],undefined;const e=isWfNodeId(a),f=e?undefined:inferObjectType(a),g={'id':a,'kind':e?'wfnode':isEoa(a)?'eoa':'object','objectType':f??undefined,'state':e?'stub':'seed','origins':c?[{'via':c['schema'],'from':c['from'],'depth':b}]:[],'depth':b};return this['graph']['nodes']['set'](a,g),g;}['addEdge'](a,b,c,d,e){const f=c['to'],g=c['key']?'|'+c['key']:'',h=a['id']+'|'+b+'→'+f+g;if(this['edgeIds']['has'](h))return;this['edgeIds']['add'](h);const i={'id':h,'schema':a['id'],'family':a['family'],'from':b,'to':f,'retention':a['retention'],'observedAt':d,'payload':c['payload'],'truncated':e||a['retention']==='bounded_window','key':c['key']};this['graph']['edges']['push'](i),pushMap(this['graph']['out'],b,i),pushMap(this['graph']['inc'],f,i);}['markTruncation'](a){this['graph']['truncations']['push'](a);}['finalize'](a){return this['graph']['rpcReport']=readStats(a),this['graph']['budgetExhausted']=this['exhausted'],this['graph'];}}function pushMap(a,b,c){const d=a['get'](b);if(d)d['push'](c);else a['set'](b,[c]);}export async function expandTopology(a,c){const d=c['seed']['toLowerCase'](),e=mergeBudget(c['budget']),f=new Gate(c['edges']??{}),h=new GraphBuilder(c['network'],d,e);h['addSeed'](d);const i=new Set(),j=new Set(),l=new Set(),m=new Map(),n=new Set();let o=new Set([d]);for(let p=0x0;p<=e['maxDepth'];p++){if(o['size']===0x0)break;if(h['exhausted']['nodes'])break;const q=Date['now'](),r=new Map(),t=(D,E)=>{const F=r['get'](D);if(F)return F;const G=new Map();r['set'](D,G);const H=h['graph']['nodes']['get'](D);if(H&&H['origins']['length']>0x0&&!E['has'](D)){E['add'](D);for(const I of H['origins']){if(!I['via']||!I['from']||E['has'](I['from']))continue;const J=t(I['from'],E);for(const [L,M]of J){if(M<(G['get'](L)??Infinity))G['set'](L,M);}const K=(J['get'](I['via'])??0x0)+0x1;if(K<(G['get'](I['via'])??Infinity))G['set'](I['via'],K);}E['delete'](D);}return G;},u=[...o]['filter'](D=>{const E=h['graph']['nodes']['get'](D);return E['kind']==='object'&&(E['state']==='seed'||E['state']==='stub')&&!i['has'](D);}),v=new Set();if(u['length']>0x0){const D=await a['getObjects'](u);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];for(const E of u){const F=h['graph']['nodes']['get'](E),G=lookupMapLower(D,E);i['add'](E);if(!G){F['state']='error',F['error']='not_found_or_failed',h['graph']['gaps']['push'](E);continue;}F['state']='fetched',F['raw']=G,F['objectType']=String(G['type']??F['objectType']??inferObjectType(E)??''),F['coinType']=extractCoinType(G['type_raw']),v['add'](E);}}const w=[];for(const H of v){const I=h['graph']['nodes']['get'](H);if(!I['objectType']||!I['raw'])continue;for(const J of extractObjectEdges(I['objectType'],I['raw'])){const K=EDGE_SCHEMA_BY_ID['get'](J['schemaId']);if(!K||!f['allows'](K,p))continue;w['push']({'schema':K,'sourceId':H,'refs':J['refs'],'observed':J['refs']['length']});}}const x=[...v]['filter'](L=>{const M=h['graph']['nodes']['get'](L);return EDGE_SCHEMAS['some'](N=>N['source']===M['objectType']&&N['read']['kind']==='table');});for(const L of x){const M=h['graph']['nodes']['get'](L),N=EDGE_SCHEMAS['filter'](P=>P['source']===M['objectType']&&P['read']['kind']==='table'&&f['allowsTable'](P,p)),O=new Map();for(const P of N){const Q=P['read']['rowType'],R=O['get'](Q)??[];R['push'](P),O['set'](Q,R);}for(const [S,T]of O){const U=L+'|'+S;if(l['has'](U))continue;l['add'](U);const V=Math['max'](...T['map'](a0=>e['perKindCaps'][a0['id']]??e['maxFanoutPerNode']));let W,X=![];try{const a0=await a['getTable'](L,{'maxItems':V});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];W=a0['items'],X=a0['truncated'];}catch{h['graph']['gaps']['push'](L+'#'+S);continue;}const Y=new Set(T['map'](a1=>a1['id'])),Z=extractTableRefs(S,L,W)['filter'](a1=>{const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);return a2['read']['kind']==='derived'||Y['has'](a1['schemaId']);});for(const a1 of Z){const a2=EDGE_SCHEMA_BY_ID['get'](a1['schemaId']);let a3=a1['refs'];a2['family']==='M'&&M['coinType']&&(a3=a3['map'](a4=>({...a4,'payload':{'coinType':M['coinType'],...a4['payload']}}))),w['push']({'schema':a2,'sourceId':L,'refs':a3,'observed':a3['length']});}X&&h['markTruncation']({'nodeId':L,'schema':T[0x0]['id'],'observed':W['length'],'limit':V,'reason':'table_page'});}}const y=[...o]['filter'](a4=>{const a5=h['graph']['nodes']['get'](a4);return a5['kind']!=='wfnode'&&(a5['kind']==='eoa'||a5['state']==='fetched');}),z=new Map(),A=new Map();for(const a4 of y){const a5=h['graph']['nodes']['get'](a4);for(const a6 of EDGE_SCHEMAS){if(a6['read']['kind']!=='reverse'||!f['allows'](a6,p))continue;if(!sourceMatches(a6['source'],a5))continue;const a7=a6['read']['parent'],a8=a4+'|'+a7;if(j['has'](a8))continue;if(!z['has'](a7))z['set'](a7,[]);z['get'](a7)['push'](a4);const a9=a4+'|'+a7+'|schema',aa=A['get'](a9)??[];aa['push'](a6),A['set'](a9,aa);}}for(const [ab,ac]of z){for(const ae of ac)j['add'](ae+'|'+ab);let ad=new Map();try{ad=await a['getKeyedFields'](ab,ac);if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];}catch{h['graph']['gaps']['push']('reverse:'+ab);continue;}for(const af of ac){const ag=A['get'](af+'|'+ab+'|schema')??[],ah=lookupMapLower(ad,af);if(!ah)continue;const ai=extractReverseRefs(ab,ah['data']??ah);for(const aj of ag){const ak=aj['read'];for(const al of ai){if(al['schemaId']!==REVERSE_GROUP_WILDCARD&&al['schemaId']!==aj['id'])continue;let am=al['refs']['map'](an=>an['to']?an:{...an,'to':af});ak['kind']==='reverse'&&ak['filterType']&&(am=am['filter'](an=>inferObjectType(an['to'])===ak['filterType']));if(am['length']===0x0)continue;w['push']({'schema':aj,'sourceId':af,'refs':am,'observed':am['length']});}}}}for(const an of EDGE_SCHEMAS){const ao=an['read'];if(ao['kind']!=='event'||!f['allowsEvent'](an,p))continue;const ap=[...o]['filter'](ar=>{if(n['has'](ar+'|'+an['id']))return![];return sourceMatches(an['source'],h['graph']['nodes']['get'](ar));});if(ap['length']===0x0)continue;let aq=m['get'](ao['eventType']);if(!aq){aq={'events':[],'truncated':![],'failed':![]};try{const ar=await a['getEvents'](ao['eventType'],{'maxPages':e['maxEventPages']});if(readStats(a)['batches']>=e['maxRpcs'])h['exhausted']['rpcs']=!![];aq['events']=ar['events'],aq['truncated']=ar['truncated'],ar['truncated']&&ar['events']['length']===0x0&&(aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']));}catch{aq['failed']=!![],h['graph']['gaps']['push']('events:'+ao['eventType']);}m['set'](ao['eventType'],aq);}if(aq['failed']){for(const as of ap)n['add'](as+'|'+an['id']);continue;}if(aq['truncated']){h['exhausted']['eventPages']=!![];for(const at of ap){h['markTruncation']({'nodeId':at,'schema':an['id'],'observed':aq['events']['length'],'limit':e['maxEventPages'],'reason':'event_pages'});}}for(const au of ap){n['add'](au+'|'+an['id']);const av=extractEventRefs(ao,au,aq['events']);if(av['length']===0x0)continue;w['push']({'schema':an,'sourceId':au,'refs':av,'observed':av['length'],'truncated':aq['truncated']});}}const B=new Set(),C=new Map();for(const aw of w){const ax=e['perKindCaps'][aw['schema']['id']]??e['maxFanoutPerNode'],ay=C['get'](aw['sourceId'])??0x0,az=Math['max'](0x0,e['maxFanoutPerNode']-ay),aA=Math['min'](ax,az),aB=aw['refs']['slice'](0x0,aA);aw['refs']['length']>aA&&h['markTruncation']({'nodeId':aw['sourceId'],'schema':aw['schema']['id'],'observed':aw['refs']['length'],'limit':a129a,'reason':'fanout'});const aC=new Map();for(const aD of aB){const aE=aD['from']??aw['sourceId'],aF=isWfNodeId(aD['to'])?p:p+0x1,aG=h['graph']['nodes']['has'](aD['to']),aH=f['effectiveMaxHops'](aw['schema']);if(aH!==undefined){const aJ=(t(aE,new Set())['get'](aw['schema']['id'])??0x0)+0x1;if(aJ>aH&&!aG){aC['set'](aE,(aC['get'](aE)??0x0)+0x1);continue;}}if(aF>e['maxDepth']&&!aG){h['exhausted']['depth']=!![];continue;}const aI=h['addNode'](aD['to'],Math['min'](aF,e['maxDepth']),{'schema':aw['schema']['id'],'from':aE});if(!aI)break;h['addEdge'](aw['schema'],aE,aD,q,aw['truncated']===!![]||aw['refs']['length']>aA),C['set'](aw['sourceId'],ay+0x1);if(!isWfNodeId(aD['to'])&&aF<=e['maxDepth'])B['add'](aD['to']);}for(const [aK,aL]of aC){h['markTruncation']({'nodeId':aK,'schema':aw['schema']['id'],'observed':aL,'limit':f['effectiveMaxHops'](aw['schema'])??0x0,'reason':'schema_hops'});}}if(h['exhausted']['rpcs']){h['graph']['gaps']['push']('budget:maxRpcs');break;}o=B;}return h['finalize'](a);}function sourceMatches(a,b){if(a==='ANY')return!![];if(a==='EOA')return b['kind']==='eoa';return b['objectType']===a;}function lookupMapLower(a,b){const c=a['get'](b);if(c!==undefined)return c;for(const [d,e]of a)if(d['toLowerCase']()===b)return e;return undefined;}export function orderCompletionInGraph(a,b){const c=a['nodes']['get'](b['toLowerCase']()),d=c?.['raw']?.['data']??c?.['raw']??{},e=String(d['machine']??''),f=String(d['progress']??''),g=a['nodes']['get'](f['toLowerCase']()),h=String((g?.['raw']?.['data']??g?.['raw']??{})['current']??'');let i=null;if(e){const j=e['toLowerCase']()+'::node::',k=a['edges']['filter'](l=>l['schema']==='wf.transition'&&l['from']['startsWith'](j))['map'](l=>({'node':l['payload']?.['node'],'prev_node':l['payload']?.['prevNode']}));if(k['length']>0x0)i=terminalNamesOfEdges(k);}return deriveOrderCompletion({'machine':e||null,'progress':f||null,'currentNode':h||null,'terminalNames':i});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyExposureGate as
|
|
1
|
+
import{applyExposureGate as a131a}from'../../config/exposure.js';export{resolveViability,factRef,parseFactRef}from'../../config/exposure.js';export const EXPOSURE_ROLES={'buyer':'buyer','merchant':'merchant','supplier':'supplier','collaborator':'collaborator','arbitrator':'arbitrator','system':'system','neutral':'neutral'};export function applyExposureGate(a,b){return a131a(a,b);}export function lossParty(a,b){return{'role':a,'basis':b};}export function gainPath(a,b,c,d){return{'role':a,'path':b,'viability':c,'gate':d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ObjectType,objectTypeFromAddress,LocalMark}from'@wowok/wowok';import{MAX_OBJECTS_PER_QUERY}from'./dataplane.js';import{SdkDataPlane}from'./sdk-dataplane.js';export const QUERY_OBJECTS_BATCH=MAX_OBJECTS_PER_QUERY;const planes=new Map();function batchPlane(a,b){const c=(a??'')+'|'+(b?0x1:0x0);let d=planes['get'](c);return!d&&(d=new SdkDataPlane(a??undefined,{'noCache':b}),planes['set'](c,d)),d;}export function lastUnresolvedInputs(a,b){return batchPlane(a,b)['unresolvedInputs'];}function parentToken(a){return String(a)['toLowerCase']();}export async function batchQueryObjectsByIds(a,b,c){const d=await batchPlane(b,c)['getObjects'](a);return[...d['values']()];}export async function batchQueryObjectsByRef(a,b,c){const d=a['map'](h=>String(h)['toLowerCase']());let e=d['map'](()=>null);try{e=await LocalMark['Instance']()['get_many_address'](d);}catch{}const f=await batchQueryObjectsByIds(d,b,c),g=new Map();for(const h of f){const j=String(h?.['object']??'')['toLowerCase']();if(j==='')continue;for(let k=0x0;k<d['length'];k++){if(g['has'](d[k]))continue;const l=e[k]?String(e[k])['toLowerCase']():'';if(d[k]===j||l===j)g['set'](d[k],h);}}return g;}export async function fetchTableEntries(a,b){const {items:c,truncated:d}=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit'],'fetchValues':![]});return{'entries':c['map'](f=>({'key':f['key'],'objectId':f['objectId']})),'truncated':d};}export async function fetchAllFieldObjectIds(a,b,c){const {entries:d}=await fetchTableEntries(a,{'network':b,'noCache':c});return d['map'](f=>f['objectId']);}export async function batchQueryTableItems(a,b){const c=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit']});return{'items':c['items'],'truncated':c['truncated']};}export async function fetchMachineNodes(a,b,c){const d=await batchQueryObjectsByIds([a],b,c),e=d[0x0],f=e?.['object']??(typeof a==='string'&&a['startsWith']('0x')?a:undefined);if(!f)return[];const {items:g}=await batchQueryTableItems(f,{'network':b,'noCache':c});return g['map'](h=>h['object'])['filter'](
|
|
1
|
+
import{ObjectType,objectTypeFromAddress,LocalMark}from'@wowok/wowok';import{MAX_OBJECTS_PER_QUERY}from'./dataplane.js';import{SdkDataPlane}from'./sdk-dataplane.js';export const QUERY_OBJECTS_BATCH=MAX_OBJECTS_PER_QUERY;const planes=new Map();function batchPlane(a,b){const c=(a??'')+'|'+(b?0x1:0x0);let d=planes['get'](c);return!d&&(d=new SdkDataPlane(a??undefined,{'noCache':b}),planes['set'](c,d)),d;}export function lastUnresolvedInputs(a,b){return batchPlane(a,b)['unresolvedInputs'];}function parentToken(a){return String(a)['toLowerCase']();}export async function batchQueryObjectsByIds(a,b,c){const d=await batchPlane(b,c)['getObjects'](a);return[...d['values']()];}export async function batchQueryObjectsByRef(a,b,c){const d=a['map'](h=>String(h)['toLowerCase']());let e=d['map'](()=>null);try{e=await LocalMark['Instance']()['get_many_address'](d);}catch{}const f=await batchQueryObjectsByIds(d,b,c),g=new Map();for(const h of f){const j=String(h?.['object']??'')['toLowerCase']();if(j==='')continue;for(let k=0x0;k<d['length'];k++){if(g['has'](d[k]))continue;const l=e[k]?String(e[k])['toLowerCase']():'';if(d[k]===j||l===j)g['set'](d[k],h);}}return g;}export async function fetchTableEntries(a,b){const {items:c,truncated:d}=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit'],'fetchValues':![]});return{'entries':c['map'](f=>({'key':f['key'],'objectId':f['objectId']})),'truncated':d};}export async function fetchAllFieldObjectIds(a,b,c){const {entries:d}=await fetchTableEntries(a,{'network':b,'noCache':c});return d['map'](f=>f['objectId']);}export async function batchQueryTableItems(a,b){const c=await batchPlane(b?.['network'],b?.['noCache'])['getTable'](a,{'maxItems':b?.['maxItems'],'pageLimit':b?.['limit']});return{'items':c['items'],'truncated':c['truncated']};}export async function fetchMachineNodes(a,b,c){const d=await batchQueryObjectsByIds([a],b,c),e=d[0x0],f=e?.['object']??(typeof a==='string'&&a['startsWith']('0x')?a:undefined);if(!f)return[];const {items:g}=await batchQueryTableItems(f,{'network':b,'noCache':c});return parseMachineNodeItems(g['map'](h=>h['object']));}export function parseMachineNodeItems(a){return a['filter'](b=>b?.['type']==='TableItem_MachineNode'||typeof b?.['name']==='string'&&(Array['isArray'](b?.['value'])||Array['isArray'](b?.['pairs'])))['map'](b=>{const c=b?.['data']??b,d=typeof c?.['name']==='string'?c['name']:'',e=Array['isArray'](c?.['value'])?c['value']:Array['isArray'](c?.['pairs'])?c['pairs']:[];if(!d)return null;return{'name':d,'pairs':e['map'](f=>({'prev_node':String(f?.['prev_node']??''),'threshold':Number(f?.['threshold']??0x0),'forwards':Array['isArray'](f?.['forwards'])?f['forwards']['map'](g=>{const h=typeof g?.['guard']==='object'&&g?.['guard']!==null?g['guard']['guard']??undefined:typeof g?.['guard']==='string'?g['guard']:undefined;return{'name':String(g?.['name']??''),'weight':Number(g?.['weight']??0x0),'namedOperator':g?.['namedOperator']!==undefined&&g?.['namedOperator']!==null?String(g['namedOperator']):undefined,'permissionIndex':g?.['permissionIndex']!==undefined&&g?.['permissionIndex']!==null?Number(g['permissionIndex']):undefined,'guard':h};}):[]}))};})['filter'](b=>b!==null);}export async function batchReadAddressKeyedFields(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f)['toLowerCase']())['filter'](f=>f['startsWith']('0x')))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e);}export async function batchReadKeyedItems(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f)['toLowerCase']())['filter'](f=>f['startsWith']('0x')))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e,{'strict':!![]});}export async function batchReadU64KeyedFields(a,b,c,d){const e=[...new Set((b??[])['map'](f=>String(f))['filter'](f=>f!==''&&Number['isFinite'](Number(f))))];return batchPlane(c,d)['getKeyedFields'](parentToken(a),e,{'keyType':'u64'});}export const ENTITY_REGISTRAR_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000aab';export const ENTITY_LINKER_OBJECT_ID='0x0000000000000000000000000000000000000000000000000000000000000aaa';export async function batchFetchEntityRegistrar(a,b,c){try{return await batchReadAddressKeyedFields(ENTITY_REGISTRAR_OBJECT_ID,a,b,c);}catch{return new Map();}}export async function batchFetchEntityLinker(a,b,c){try{return await batchReadAddressKeyedFields(ENTITY_LINKER_OBJECT_ID,a,b,c);}catch{return new Map();}}export const ENTITY_PERMISSION_OBJECT_ID='0xaad';export const ENTITY_PERMISSION_ROLES={'OWNER':0x1,'ADMIN':0x2,'ENTITY':0x4};export async function batchFetchEntityPermission(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_PERMISSION_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byPermission':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=Number(n?.['role']??0x0),p=String(n?.['permission']??'')['toLowerCase'](),q=Number(n?.['time']??0x0);p&&(l['push']({'role':o,'permission':p,'time':q}),m['set'](p,(m['get'](p)??0x0)|o));}f['set'](i,{'items':l,'byPermission':m});}return f;}export async function fetchEntityPermission(a,b,c){try{const d=await batchFetchEntityPermission([a],b,c);return d['get'](String(a)['toLowerCase']());}catch{return undefined;}}export const ENTITY_CONTACT_OBJECT_ID='0xaa9';export async function batchFetchEntityContact(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_CONTACT_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byContact':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=String(n?.['contact']??'')['toLowerCase'](),p=Number(n?.['time']??0x0);o&&(l['push']({'contact':o,'time':p}),m['set'](o,(m['get'](o)??0x0)||p));}f['set'](i,{'items':l,'byContact':m});}return f;}export async function fetchEntityContact(a,b,c){try{const d=await batchFetchEntityContact([a],b,c);return d['get'](String(a)['toLowerCase']());}catch{return undefined;}}export const ENTITY_ORDER_OBJECT_ID='0xaa8';export const ENTITY_ORDER_ROLES={'OWNER':0x1,'AGENT':0x2};export async function batchFetchEntityOrder(b,c,e){const f=new Map(),g=await batchReadKeyedItems(ENTITY_ORDER_OBJECT_ID,b,c,e);for(const h of new Set((b??[])['map'](i=>String(i)['toLowerCase']()))){f['set'](h,{'items':[],'byOrder':new Map()});}for(const [i,j]of g){const k=j,l=[],m=new Map();for(const n of Array['isArray'](k?.['items'])?k['items']:[]){const o=Number(n?.['role']??0x0),p=String(n?.['order']??'')['toLowerCase'](),q=Number(n?.['time']??0x0);p&&(l['push']({'role':o,'order':p,'time':q}),m['set'](p,(m['get'](p)??0x0)|o));}f['set'](i,{'items':l,'byOrder':m});}return f;}export const OBJECT_LINKER_CORE_OBJECT_ID='0xaae';export const OBJECT_LINKER_TX_OBJECT_ID='0xaaf';export const LINKER_RING_LIMIT=0x1450;export function ringWindowSaturated(a){return a>=LINKER_RING_LIMIT;}export async function batchFetchObjectLinker(b,c,e,f){const g=new Map(),h=await batchReadKeyedItems(b,c,e,f);for(const i of new Set((c??[])['map'](j=>String(j)['toLowerCase']()))){g['set'](i,{'items':[],'byWho':new Map()});}for(const [j,k]of h){const l=k,m=[],n=new Map();for(const o of Array['isArray'](l?.['items'])?l['items']:[]){const p=String(o?.['who']??'')['toLowerCase'](),q=Number(o?.['time']??0x0);p&&(m['push']({'who':p,'time':q}),n['set'](p,q));}g['set'](j,{'items':m,'byWho':n});}return g;}export function batchFetchObjectLinkerCore(a,b,c){return batchFetchObjectLinker(OBJECT_LINKER_CORE_OBJECT_ID,a,b,c);}export function batchFetchObjectLinkerTx(a,b,c){return batchFetchObjectLinker(OBJECT_LINKER_TX_OBJECT_ID,a,b,c);}async function fetchObjectLinker(a,b,c,d){try{const e=await batchFetchObjectLinker(a,[b],c,d);return e['get'](String(b)['toLowerCase']());}catch{return undefined;}}export function fetchObjectLinkerCore(a,b,c){return fetchObjectLinker(OBJECT_LINKER_CORE_OBJECT_ID,a,b,c);}export function fetchObjectLinkerTx(a,b,c){return fetchObjectLinker(OBJECT_LINKER_TX_OBJECT_ID,a,b,c);}export async function fetchServiceOrders(a,b,c){const d=await fetchObjectLinkerTx(a,b,c);if(!d)return undefined;const e=ringWindowSaturated(d['items']['length']),f=d['items']['filter'](g=>objectTypeFromAddress(g['who'])===ObjectType['Order']);return{'items':f,'byWho':new Map(f['map'](g=>[g['who'],g['time']])),'ring_saturated':e};}export async function fetchPermissionContext(a,b,c){try{const e=await batchQueryObjectsByIds([a],b,c),f=e[0x0],g=f?.['data']??f,h=new Set((g?.['admin']??[])['map'](k=>String(k)['toLowerCase']())),i=new Map(),{items:j}=await batchQueryTableItems(a,{'network':b,'noCache':c});for(const k of j){const l=k['object'],m=l?.['data']??l;m?.['address']!=null&&Array['isArray'](m['perm'])&&i['set'](String(m['address'])['toLowerCase'](),new Set(m['perm']['map'](n=>Number(n))));}return{'admin':h,'table':i};}catch{return undefined;}}export async function fetchOrderContext(a,b,c){try{const e=await batchQueryObjectsByIds([a],b,c),f=e[0x0];if(f?.['type']!=='Order'&&f?.['data']?.['type']!=='Order')return undefined;const g=f?.['data']??f;return{'builder':String(g['builder']??g['owner']??''),'agent':new Set((g['agent']??[])['map'](h=>String(h)['toLowerCase']()))};}catch{return undefined;}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resolveOrderEntryContext,readEntryGuardReports,classifyEntryFire,fireEntryEdgeForward,buildEntryEdgePendingRecipe}from'../tools/handlers/entry-edge-recipe.js';import{extractMoveAbortInfo}from'../schema/call/semantic.js';const PAYER_REQUIRED_MODULE='progress',PAYER_REQUIRED_CODE=0xd;export function isProgressPayerRequiredAbort(a){const b=extractMoveAbortInfo(a);return!!b&&b['module']===PAYER_REQUIRED_MODULE&&b['code']===PAYER_REQUIRED_CODE;}let depsOverride;export function setEntryIgniteSelfHealDeps(a){depsOverride=a;}function igniteDeps(){if(depsOverride)return depsOverride;return{'resolveContext':(a,b)=>resolveOrderEntryContext(a,b),'readReports':(a,b,c)=>readEntryGuardReports(a,b,c),'classify':(a,b)=>classifyEntryFire(a,b),'fire':(a,b)=>fireEntryEdgeForward(a,b)};}export async function maybeSelfHealEntryIgnite(a){if(!isProgressPayerRequiredAbort(a['error']))return{'healed':![]};if(a['env']?.['dry_run']===!![])return{'healed':![],'note':'DRY-RUN\x20—\x20no\x20self-heal:\x20the\x20payer-required\x20abort\x20surfaced\x20under\x20simulation,\x20so\x20no\x20entry\x20'+'transaction\x20is\x20chained.\x20Fire\x20the\x20entry\x20forward\x20for\x20real,\x20then\x20re-drive\x20the\x20forward.'};if(!a['orderRef'])return{'healed':![]};const b=igniteDeps(),c=await b['resolveContext'](a['orderRef'],a['env']?.['network'])['catch'](()=>undefined);if(!c)return{'healed':![]};let d;try{d=await b['readReports'](c['edges'],c['orderAddr'],a['env']?.['network']);}catch{return{'healed':![]};}const e=b['classify'](c['edges'],d);if(e['kind']==='recipe'){const i=buildEntryEdgePendingRecipe({'machineAddr':c['machineAddr'],'progressAddr':c['progressAddr'],'orderAddr':c['orderAddr'],'edges':e['edges'],'reports':e['reports'],'reason':e['reason']});return{'healed':![],'note':'AUTO-IGNITE\x20NOT\x20SAFE:\x20the\x20entry\x20edge\x20on\x20this\x20machine\x20is\x20recipe-shaped,\x20so\x20the\x20'+'payer-required\x20abort\x20was\x20NOT\x20auto-remedied\x20—\x20complete\x20the\x20entry\x20recipe\x20below,\x20then\x20'+('re-drive\x20the\x20forward.\x0a'+i['note'])};}const f=await b['fire'](e,{'progressAddr':c['progressAddr'],'orderAddr':c['orderAddr'],'env':a['env']});if(!f?.['ok'])return{'healed':![],'note':'AUTO-IGNITE\x20ATTEMPTED\x20BUT\x20FAILED:\x20the\x20entry\x20forward\x20could\x20not\x20be\x20fired\x20automatically\x20('+((f?.['error']??'unknown\x20rejection')+').\x20The\x20original\x20payer-required\x20abort\x20stands\x20—\x20')+'fire\x20the\x20entry\x20forward\x20manually,\x20then\x20re-drive\x20the\x20forward.'};const g=f['digest'];let h;try{h=await a['retry']();}catch(j){const k=a['error']instanceof Error?a['error']['message']:String(a['error']);throw new Error(k+'\x0a'+'ENTRY-IGNITE\x20SELF-HEAL\x20EXHAUSTED:\x20the\x20entry\x20forward\x20WAS\x20fired\x20automatically'+(g?'\x20(digest\x20'+g+')':'')+'\x20and\x20the\x20original\x20forward\x20was\x20re-driven\x20once\x20—\x20the\x20re-drive\x20still\x20failed\x20with\x20the\x20error\x20above.\x20'+'No\x20further\x20retries\x20are\x20attempted\x20(bounded\x20to\x20one).');}return{'healed':!![],'entry_digest':g,'result':h,'note':'AUTO-ENTRY-IGNITE\x20+\x20RETRY\x20(K3\x20D5):\x20the\x20forward\x20died\x20with\x20the\x20payer-required\x20abort\x20'+'(E_ORDER_PAYER_REQUIRED)\x20because\x20the\x20order\x20was\x20still\x20parked\x20on\x20the\x20reserved\x20empty\x20entry\x20node.\x20'+'The\x20entry\x20forward\x20was\x20fired\x20automatically\x20(same\x20signer,\x20protocol\x20slot\x20254\x20holder\x20signature)'+(g?',\x20digest\x20'+g+',':',')+'\x20and\x20the\x20ORIGINAL\x20forward\x20was\x20re-driven\x20once\x20(bounded\x20—\x20never\x20a\x20loop).\x20Business\x20semantics\x20'+'unchanged:\x20without\x20this\x20abort\x20there\x20is\x20no\x20auto-enter.'};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LocalMark}from'@wowok/wowok';import{submissionItemsForGuard,buildGuardSubmissionEntries,evaluateGuardLegs,renderLegDiagnosisLines}from'../knowledge/guard-leg-eval.js';import{loadGuardJsonFromChain}from'../knowledge/guard-submission-brief.js';let depsOverride;export function setForwardLegPreflightDeps(a){depsOverride=a;}function legPreflightDeps(){if(depsOverride)return depsOverride;return{'loadGuard':(a,b)=>loadGuardJsonFromChain(a,b),'evaluate':(a,b,c,d)=>evaluateGuardLegs(a,b,c,d)};}const RUNTIME_BACKFILL_NOTE='Protocol\x20slot\x20254\x20(task\x20binding)\x20is\x20auto-backfilled\x20at\x20execution\x20when\x20the\x20order\x20reference\x20is\x20resolvable\x20'+'(F-RQ-03)\x20—\x20a\x20would-fail\x20that\x20names\x20ONLY\x20slot\x20254\x20may\x20still\x20succeed;\x20supply\x20the\x20slot\x20explicitly\x20to\x20pre-check\x20it.';export async function preflightForwardLegs(a){const b=[],c=a['submission'],d=Array['isArray'](c?.['guard'])?c['guard']:[];if(d['length']===0x0)return{'lines':b,'evaluated':0x0};const f=Math['max'](0x1,a['maxGuards']??0x3),h=a['env']?.['network'];let i=0x0;for(const j of d){if(i>=f){b['push']('L3\x20FORWARD\x20LEG\x20PREFLIGHT:\x20'+(d['length']-i)+'\x20further\x20impact\x20guard(s)\x20not\x20'+'pre-evaluated\x20(bounded\x20cost)\x20—\x20run\x20verify_guard_dry_run\x20on\x20them\x20if\x20the\x20forward\x20fails.');break;}let k=typeof j?.['object']==='string'?j['object']:undefined;if(!k)continue;if(j?.['impack']!==!![])continue;if(!k['startsWith']('0x')){k=await LocalMark['Instance']()['get_address'](k)['catch'](()=>undefined)??undefined;if(!k||!k['startsWith']('0x'))continue;}try{const m=await legPreflightDeps()['loadGuard'](k,h);if(!m){b['push']('L3\x20FORWARD\x20LEG\x20PREFLIGHT:\x20impact\x20guard\x20'+k['slice'](0x0,0xc)+'…\x20could\x20not\x20be\x20read\x20on\x20'+((h||'the\x20current\x20network')+'\x20—\x20definition\x20not\x20pre-checked\x20(the\x20real\x20submission\x20')+'still\x20enforces\x20it).');continue;}const n=await submissionItemsForGuard(k,c),o=buildGuardSubmissionEntries(n,m['json']['table']),p=await legPreflightDeps()['evaluate'](a['env'],k,o,[k]);i+=0x1;if(p?.['verdict']==='pass'){b['push']('L3\x20FORWARD\x20LEG\x20PREFLIGHT:\x20guard\x20'+(m['name']?m['name']+'\x20('+k['slice'](0x0,0xc)+'…)':k['slice'](0x0,0xc)+'…')+'\x20'+'PASSES\x20with\x20this\x20submission\x20against\x20the\x20current\x20snapshot\x20(read-only\x20evaluation;\x20the\x20real\x20'+'submission\x20is\x20judged\x20by\x20actual\x20execution).');continue;}for(const q of renderLegDiagnosisLines(p,{'passLine':'the\x20guard\x20PASSES\x20with\x20this\x20submission\x20against\x20the\x20current\x20snapshot.'})){b['push']('L3\x20FORWARD\x20LEG\x20PREFLIGHT:\x20'+(m['name']?m['name']+'\x20('+k['slice'](0x0,0xc)+'…):\x20':k['slice'](0x0,0xc)+'…:\x20')+q);}p?.['verdict']!=='pass'&&b['push']('REMEDY:\x20run\x20verify_guard_dry_run\x20on\x20'+k+'\x20carrying\x20this\x20submission\x20for\x20the\x20per-slot/leg\x20'+'map\x20before\x20re-driving\x20the\x20forward.');}catch(r){b['push']('L3\x20FORWARD\x20LEG\x20PREFLIGHT:\x20impact\x20guard\x20'+k['slice'](0x0,0xc)+'…\x20evaluation\x20failed\x20'+('('+String(r?.['message']??r)['slice'](0x0,0xc8)+')\x20—\x20pre-check\x20inconclusive;\x20the\x20real\x20')+'submission\x20still\x20enforces\x20on-chain\x20validation.');}}if(i>0x0){const s=b['some'](t=>t['includes']('are\x20FALSE')||t['includes']('condition\x20is\x20FALSE')||t['includes']('ABSENCE-REJECT'));s&&typeof a['orderRef']==='string'&&a['orderRef']['startsWith']('0x')&&b['push']('NOTE:\x20'+RUNTIME_BACKFILL_NOTE);}return{'lines':b,'evaluated':i};}
|