@wowok/agent-mcp 3.4.0 → 3.4.1
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/README.md +8 -0
- package/dist/chain-semantics/composition-truth.d.ts +102 -0
- package/dist/chain-semantics/composition-truth.js +1 -0
- package/dist/chain-semantics/eval-order.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/index.d.ts +1 -0
- package/dist/chain-semantics/index.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/blueprint-view.d.ts +3 -3
- package/dist/composition/blueprint-view.js +1 -1
- package/dist/composition/compile.d.ts +24 -3
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.d.ts +206 -0
- package/dist/composition/emit-phases.js +1 -0
- package/dist/composition/generate.d.ts +40 -0
- package/dist/composition/generate.js +1 -0
- package/dist/composition/guard-fill.d.ts +44 -0
- package/dist/composition/guard-fill.js +1 -0
- package/dist/composition/inflight.d.ts +20 -2
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/input-normalize.d.ts +15 -0
- package/dist/composition/input-normalize.js +1 -0
- package/dist/composition/materialize.d.ts +18 -13
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.d.ts +35 -0
- package/dist/composition/mode-gates.js +1 -0
- package/dist/composition/param-disclosure.js +1 -1
- package/dist/composition/plan-retry-ledger.d.ts +21 -0
- package/dist/composition/plan-retry-ledger.js +1 -0
- package/dist/composition/plan.d.ts +7 -2
- package/dist/composition/plan.js +1 -1
- package/dist/composition/product-card.d.ts +94 -0
- package/dist/composition/product-card.js +1 -0
- package/dist/composition/supply-chain-emit.d.ts +46 -0
- package/dist/composition/supply-chain-emit.js +1 -0
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/config/config-warnings.d.ts +2 -0
- package/dist/config/config-warnings.js +1 -0
- package/dist/config/exposure.d.ts +2 -2
- package/dist/config/judgment.d.ts +31 -5
- package/dist/config/judgment.js +1 -1
- package/dist/config/judgment.spec.js +1 -1
- package/dist/config/match-policy-file.d.ts +34 -0
- package/dist/config/match-policy-file.js +1 -0
- package/dist/config/match-policy-file.spec.d.ts +1 -0
- package/dist/config/match-policy-file.spec.js +1 -0
- package/dist/config/rule-engine.d.ts +5 -5
- package/dist/config/rule-engine.js +1 -1
- package/dist/config/runtime.d.ts +0 -1
- package/dist/config/runtime.js +1 -1
- package/dist/config/severity.d.ts +0 -2
- package/dist/config/severity.js +1 -1
- package/dist/config/store-policy.spec.js +1 -1
- package/dist/config/template-params.d.ts +42 -0
- package/dist/config/template-params.js +1 -0
- package/dist/config/template-params.spec.d.ts +1 -0
- package/dist/config/template-params.spec.js +1 -0
- package/dist/data/api/api.spec.js +1 -1
- package/dist/data/api/server.js +1 -1
- package/dist/data/projection/store.d.ts +2 -1
- package/dist/data/projection/store.js +1 -1
- package/dist/data/projection/types.d.ts +22 -0
- package/dist/data/sync/cdc.d.ts +1 -2
- package/dist/data/sync/cdc.js +1 -1
- package/dist/evaluation/acceptance.d.ts +8 -0
- package/dist/evaluation/acceptance.js +1 -1
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/capability.d.ts +2 -0
- package/dist/evaluation/category-match-rules.d.ts +0 -1
- package/dist/evaluation/category-match-rules.js +1 -1
- package/dist/evaluation/composer.d.ts +25 -0
- package/dist/evaluation/composer.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/extract.d.ts +7 -0
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/game-strategy.d.ts +0 -3
- package/dist/evaluation/game-strategy.js +1 -1
- package/dist/evaluation/match-operation.d.ts +9 -0
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/match-policy-resolver.d.ts +9 -0
- package/dist/evaluation/match-policy-resolver.js +1 -0
- package/dist/evaluation/match-policy.d.ts +3 -1
- package/dist/evaluation/match-policy.js +1 -1
- package/dist/evaluation/region.d.ts +0 -6
- package/dist/evaluation/region.js +1 -1
- package/dist/evaluation/standards.d.ts +2 -1
- package/dist/evaluation/standards.js +1 -1
- package/dist/evaluation/structured-lines.d.ts +8 -0
- package/dist/evaluation/structured-lines.js +1 -0
- package/dist/evaluation/types.d.ts +6 -0
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/capability-manifest.d.ts +1 -0
- package/dist/extensions/capability-manifest.js +1 -1
- package/dist/extensions/capability.d.ts +91 -0
- package/dist/extensions/capability.js +1 -0
- package/dist/extensions/industry-audit.spec.js +1 -1
- package/dist/extensions/industry-pack.d.ts +13 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/extensions/registry.d.ts +0 -2
- package/dist/extensions/registry.js +1 -1
- package/dist/goal/GoalEngine.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/order-status.d.ts +0 -1
- package/dist/graph/onchain/order-status.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/harness/verify.d.ts +0 -3
- package/dist/harness/verify.js +1 -1
- package/dist/intent/types.d.ts +0 -1
- package/dist/intent/types.js +1 -1
- package/dist/keeper/detectors.js +1 -1
- package/dist/keeper/types.d.ts +0 -1
- package/dist/keeper/types.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +1 -0
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +6 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-puzzle.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +2 -2
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/judgment-baselines.json +21 -2
- package/dist/knowledge/baselines/rules/oracle.json +120 -0
- package/dist/knowledge/baselines/rules/plan.json +384 -17
- package/dist/knowledge/baselines/rules/progress.json +20 -2
- package/dist/knowledge/builtin-templates.d.ts +12 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/component-schema.js +1 -1
- package/dist/knowledge/contact-templates.d.ts +0 -1
- package/dist/knowledge/contact-templates.js +1 -1
- package/dist/knowledge/dynamic-pricing.js +1 -1
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +1 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/game-scenarios.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.d.ts +52 -0
- package/dist/knowledge/guard-binding-table.js +1 -0
- package/dist/knowledge/guard-binding-verifier.d.ts +30 -0
- package/dist/knowledge/guard-binding-verifier.js +1 -0
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-blueprint.d.ts +68 -0
- package/dist/knowledge/guard-blueprint.js +1 -0
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-host-context.d.ts +24 -0
- package/dist/knowledge/guard-host-context.js +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +3 -0
- package/dist/knowledge/guard-node-gates.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-submission-prompt.d.ts +11 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.d.ts +6 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.d.ts +38 -0
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/object-dependency.d.ts +31 -0
- package/dist/knowledge/object-dependency.js +1 -0
- package/dist/knowledge/onchain-constants.d.ts +2 -0
- package/dist/knowledge/onchain-constants.js +1 -1
- package/dist/knowledge/param-schema.d.ts +23 -0
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/passport-ledger.js +1 -1
- package/dist/knowledge/path-oracle/coverage.d.ts +16 -0
- package/dist/knowledge/path-oracle/coverage.js +1 -0
- package/dist/knowledge/path-oracle/index.d.ts +5 -0
- package/dist/knowledge/path-oracle/index.js +1 -0
- package/dist/knowledge/path-oracle/products/food-delivery.d.ts +2 -0
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -0
- package/dist/knowledge/path-oracle/schema.d.ts +188 -0
- package/dist/knowledge/path-oracle/schema.js +1 -0
- package/dist/knowledge/pattern-resolutions.d.ts +2 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/progress-risk.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/protocol-facts.js +1 -1
- package/dist/knowledge/requirement-families.d.ts +13 -0
- package/dist/knowledge/requirement-families.js +1 -0
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +1 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/semantic-ir.d.ts +4 -0
- package/dist/knowledge/semantic-ir.js +1 -1
- package/dist/knowledge/service-ledger.d.ts +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/sku-name-gate.d.ts +17 -0
- package/dist/knowledge/sku-name-gate.js +1 -0
- package/dist/knowledge/supply-chain.d.ts +9 -0
- package/dist/knowledge/supply-chain.js +1 -1
- package/dist/knowledge/template-loader.d.ts +14 -6
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-nav.d.ts +3 -1
- package/dist/knowledge/template-nav.js +1 -1
- package/dist/knowledge/template-prose.d.ts +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +62 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +5 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/participation/time-window.js +1 -1
- package/dist/persona/address-format.d.ts +0 -1
- package/dist/persona/address-format.js +1 -1
- package/dist/persona/bridge.js +1 -1
- package/dist/persona/index.d.ts +0 -2
- package/dist/persona/index.js +1 -1
- package/dist/persona/model.js +1 -1
- package/dist/persona/persona-audit.spec.js +1 -1
- package/dist/persona/types.d.ts +6 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/game-theory.d.ts +2 -2
- package/dist/playbooks/service-build/intent-analyzer.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +50 -23
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +2 -0
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +8 -0
- 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/reverse-mapping.d.ts +6 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +1 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.d.ts +10 -1
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/repository.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +104 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +15 -6
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/base.d.ts +256 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +32 -6
- package/dist/schema/call/demand.d.ts +15 -6
- package/dist/schema/call/demand.js +1 -1
- package/dist/schema/call/guard.d.ts +8 -8
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.d.ts +3 -0
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +32 -8
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +26 -8
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +20 -8
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/permission.d.ts +330 -114
- package/dist/schema/call/permission.js +1 -1
- package/dist/schema/call/personal.d.ts +10 -4
- package/dist/schema/call/personal.js +1 -1
- package/dist/schema/call/progress.d.ts +16 -4
- package/dist/schema/call/reward.d.ts +10 -4
- 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 +128 -40
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +15 -6
- package/dist/schema/call/treasury.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/config/index.d.ts +61 -0
- package/dist/schema/config/index.js +1 -1
- package/dist/schema/envelope-unify.d.ts +4 -0
- package/dist/schema/envelope-unify.js +1 -0
- package/dist/schema/evaluation/index.d.ts +216 -19
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +47 -0
- package/dist/schema/goal/planning.d.ts +115 -1
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +137 -6
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/industry-pack/modes.d.ts +6 -6
- package/dist/schema/keeper/index.d.ts +26 -0
- package/dist/schema/local/index.d.ts +137 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.d.ts +6 -0
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +26 -0
- package/dist/schema/operations.d.ts +342 -83
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +2907 -640
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +145 -4
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +266 -73
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +1 -1
- package/dist/schema/schema-query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/permission-machine-check.d.ts +2 -0
- package/dist/schema/utils/permission-machine-check.js +1 -1
- package/dist/schema/watch/index.d.ts +16 -0
- package/dist/schema/watch/index.js +1 -1
- package/dist/schema/workflow/index.d.ts +2 -2
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +94 -0
- package/dist/schemas/benchmark_migration_operation.output.json +338 -9
- package/dist/schemas/benchmark_migration_operation.schema.json +26 -1
- package/dist/schemas/bridge_operation.output.json +94 -0
- package/dist/schemas/config_operation.output.json +352 -0
- package/dist/schemas/config_operation.schema.json +20 -2
- package/dist/schemas/evaluation_operation.output.json +570 -4
- package/dist/schemas/evaluation_operation.schema.json +194 -3
- package/dist/schemas/goal_operation.schema.json +183 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +621 -0
- package/dist/schemas/industry_pack_operation.schema.json +20 -2
- package/dist/schemas/keeper_operation.output.json +94 -0
- package/dist/schemas/local_cache_operation.output.json +94 -0
- package/dist/schemas/local_history_operation.output.json +94 -0
- package/dist/schemas/local_info_operation.output.json +94 -0
- package/dist/schemas/local_mark_operation.output.json +94 -0
- package/dist/schemas/messenger_operation.output.json +94 -0
- package/dist/schemas/monitor_events.output.json +94 -0
- package/dist/schemas/monitor_subscription.output.json +94 -0
- package/dist/schemas/onchain_events.output.json +94 -0
- package/dist/schemas/onchain_operations.output.json +313 -1
- package/dist/schemas/onchain_operations.schema.json +1248 -664
- package/dist/schemas/onchain_operations_allocation.schema.json +30 -15
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -2
- package/dist/schemas/onchain_operations_contact.schema.json +8 -1
- package/dist/schemas/onchain_operations_demand.schema.json +29 -14
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -1
- package/dist/schemas/onchain_operations_guard.schema.json +290 -105
- package/dist/schemas/onchain_operations_machine.schema.json +49 -34
- package/dist/schemas/onchain_operations_order.schema.json +63 -40
- package/dist/schemas/onchain_operations_payment.schema.json +26 -11
- package/dist/schemas/onchain_operations_permission.schema.json +362 -235
- package/dist/schemas/onchain_operations_personal.schema.json +27 -15
- package/dist/schemas/onchain_operations_progress.schema.json +45 -30
- package/dist/schemas/onchain_operations_proof.schema.json +8 -1
- package/dist/schemas/onchain_operations_repository.schema.json +8 -1
- package/dist/schemas/onchain_operations_reward.schema.json +32 -17
- package/dist/schemas/onchain_operations_service.schema.json +221 -124
- package/dist/schemas/onchain_operations_treasury.schema.json +32 -17
- package/dist/schemas/onchain_table_data.output.json +258 -6
- package/dist/schemas/onchain_table_data.schema.json +92 -52
- package/dist/schemas/persona_operation.output.json +7752 -0
- package/dist/schemas/persona_operation.schema.json +1232 -4
- package/dist/schemas/query_toolkit.output.json +756 -116
- package/dist/schemas/query_toolkit.schema.json +138 -7
- package/dist/schemas/schema_query.schema.json +1 -1
- package/dist/schemas/watch_operation.output.json +83 -0
- package/dist/schemas/wip_file.output.json +8 -0
- package/dist/schemas/workflow_operation.schema.json +2 -2
- package/dist/tools/handlers/benchmark-migration.d.ts +11 -3
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +20 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/persona.js +1 -1
- package/dist/tools/handlers/query.d.ts +8 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/winner-derivation.d.ts +20 -0
- package/dist/tools/handlers/winner-derivation.js +1 -0
- package/dist/tools/handlers/wip-upload.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/config.js +1 -1
- package/dist/tools/registry/evaluation.js +1 -1
- package/dist/tools/registry/identity.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/transport-integrity.d.ts +7 -0
- package/dist/tools/transport-integrity.js +1 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wrap.d.ts +5 -0
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
- package/dist/extensions/business-modules.d.ts +0 -54
- package/dist/extensions/business-modules.js +0 -1
- package/dist/schemas/guard-templates.json +0 -379
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initServicePuzzleFromIntent,initMachinePuzzleFromIntent,initAllocationPuzzleFromIntent,initTreasuryPuzzleFromIntent,initArbitrationPuzzleFromIntent,initRewardPuzzleFromIntent,initProgressPuzzleFromIntent,initOrderPuzzleFromIntent,initPuzzleFromIntent as
|
|
1
|
+
import{initServicePuzzleFromIntent,initMachinePuzzleFromIntent,initAllocationPuzzleFromIntent,initTreasuryPuzzleFromIntent,initArbitrationPuzzleFromIntent,initRewardPuzzleFromIntent,initProgressPuzzleFromIntent,initOrderPuzzleFromIntent,initPuzzleFromIntent as a409a,checkServicePuzzleCompleteness,checkMachinePuzzleCompleteness,checkAllocationPuzzleCompleteness,checkTreasuryPuzzleCompleteness,checkArbitrationPuzzleCompleteness,checkRewardPuzzleCompleteness,checkProgressPuzzleCompleteness,checkOrderPuzzleCompleteness,checkPuzzleCompleteness as a409b}from'../../knowledge/index.js';import{initPuzzleFromIntent as a409c,checkPuzzleCompleteness as a409d}from'../../knowledge/permission-puzzle.js';const KEYWORD_TABLE=[{'category':'Product/Service','keywords_zh':['product','selling','sell','sales','store','open\x20shop'],'keywords_en':['sell','product','sale','shop','store'],'objects':['service','order','progress'],'required_level':'R','scene_id':'retail'},{'category':'Subscription','keywords_zh':['subscription','cycle','renewal'],'keywords_en':['subscribe','recurring','subscription'],'objects':['service','machine','reward'],'required_level':'C','scene_id':'subscription'},{'category':'Rental','keywords_zh':['rent','lease','return'],'keywords_en':['rent','lease','return'],'objects':['service','machine','arb'],'required_level':'C','scene_id':'rental_return'},{'category':'Trust','keywords_zh':['deposit','pledge','verify','trust'],'keywords_en':['deposit','trust','verify'],'objects':['guard','permission','treasury'],'required_level':'R','scene_id':'trust_deposit'},{'category':'Funds','keywords_zh':['split','collect','share\x20profit','income','incentive'],'keywords_en':['split','revenue','reward'],'objects':['allocation','treasury','reward'],'required_level':'R','scene_id':'revenue_split'},{'category':'Workflow','keywords_zh':['node','stage','process','workflow'],'keywords_en':['workflow','stage','node'],'objects':['machine','progress'],'required_level':'R','scene_id':'workflow'},{'category':'Dispute','keywords_zh':['arbitration','refund','conflict','rights\x20protection'],'keywords_en':['arbitration','refund','dispute'],'objects':['arb','proof'],'required_level':'C','scene_id':'arbitration_dispute'},{'category':'Contact','keywords_zh':['customer\x20service','contact','communication'],'keywords_en':['contact','support','im'],'objects':['contact'],'required_level':'C','scene_id':'contact_im'},{'category':'Data','keywords_zh':['evidence','record','data'],'keywords_en':['evidence','record','data'],'objects':['repository','proof'],'required_level':'C','scene_id':'evidence_record'},{'category':'User\x20Profile','keywords_zh':['personal\x20info','preference','privacy'],'keywords_en':['personal','profile','privacy'],'objects':['personal','contact'],'required_level':'OPTIONAL','scene_id':'user_profile'},{'category':'Demand\x20Submission','keywords_zh':['demand','publish','inquiry'],'keywords_en':['demand','request','inquiry'],'objects':['demand'],'required_level':'OPTIONAL','scene_id':'demand_inquiry'}],INDUSTRY_KEYWORDS=[{'industry':'freelance','words':['freelance','outsourcing','freelance','gig']},{'industry':'rental','words':['rental','lease','rental','rent']},{'industry':'education','words':['education','course','training','education','course']},{'industry':'travel','words':['travel','tour','itinerary','travel','trip']},{'industry':'subscription','words':['subscription','cycle','subscription','recurring']}];function buildPuzzleDispatch(){const a=(c,d)=>{try{return c(d);}catch{return undefined;}},b=(c,d)=>{if(!c)return{'missing':[],'complete':![],'next_step':'init\x20failed'};try{return d(c);}catch{return{'missing':[],'complete':![],'next_step':'check\x20failed'};}};return{'service':{'init':c=>a(initServicePuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkServicePuzzleCompleteness)},'machine':{'init':c=>a(initMachinePuzzleFromIntent,c),'check':c=>b(c,checkMachinePuzzleCompleteness)},'allocation':{'init':c=>a(initAllocationPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkAllocationPuzzleCompleteness)},'treasury':{'init':c=>a(initTreasuryPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkTreasuryPuzzleCompleteness)},'arb':{'init':c=>a(initArbitrationPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkArbitrationPuzzleCompleteness)},'reward':{'init':c=>a(initRewardPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkRewardPuzzleCompleteness)},'progress':{'init':c=>a(initProgressPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkProgressPuzzleCompleteness)},'order':{'init':c=>a(initOrderPuzzleFromIntent,{'primary_goal':c}),'check':c=>b(c,checkOrderPuzzleCompleteness)},'permission':{'init':c=>a(a409c,{'primary_goal':c}),'check':c=>b(c,a409d)},'guard':{'init':c=>a(a409a,{'primary_goal':c}),'check':c=>b(c,a409b)}};}export function extractKeywords(a){if(!a||typeof a!=='string')return[];const b=[];for(const c of KEYWORD_TABLE){const d=[...c['keywords_zh'],...c['keywords_en']];for(const e of d){try{const f=new RegExp(escapeRegex(e),'gi'),g=(a['match'](f)||[])['length'];g>0x0&&b['push']({'keyword':e,'category':c['category'],'matched_objects':[...c['objects']],'required_level':c['required_level'],'match_count':g});}catch{}}}return b['sort']((h,i)=>i['match_count']-h['match_count']),b;}function escapeRegex(a){return a['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}export function resolveIndustry(a,b){const c=((a??'')+'\x20'+(b??''))['toLowerCase']();for(const d of INDUSTRY_KEYWORDS){for(const e of d['words']){if(c['includes'](e['toLowerCase']()))return d['industry'];}}return'general';}export function identifyObjects(a,b){if(b['length']===0x0)return{'primary':'service','secondary':['permission','machine','progress'],'scenes':[{'object':'service','scene_id':'general'}]};const c=b['find'](i=>i['required_level']==='R'),d=(c??b[0x0])['matched_objects'][0x0],e=new Set([d]),f=[];for(const i of b){for(const j of i['matched_objects']){!e['has'](j)&&(e['add'](j),f['push'](j));}}const g=[],h=new Set();for(const k of KEYWORD_TABLE){const l=b['find'](n=>n['category']===k['category']);if(!l)continue;if(h['has'](k['scene_id']))continue;h['add'](k['scene_id']),g['push']({'object':k['objects'][0x0],'scene_id':k['scene_id']});}return{'primary':d,'secondary':f,'scenes':g};}export function analyzeBusinessIntent(a){const b=[];if(!a||!a['user_intent']||typeof a['user_intent']!=='string')return{'intent_parsed':{'primary_object':'service','secondary_objects':[],'detected_scenes':[],'industry':'general','keyword_matches':[]},'puzzles':{},'overall_completeness':'empty','next_step':'Please\x20provide\x20a\x20non-empty\x20business\x20intent.','recommended_creation_order':[],'warnings':['input.user_intent\x20is\x20empty']};const c=a['user_intent'],e=extractKeywords(c),f=resolveIndustry(c,a['industry']),{primary:g,secondary:h,scenes:i}=identifyObjects(c,e);let j=[g,...h];if(a['target_objects']&&a['target_objects']['length']>0x0){const p=a['target_objects']['filter'](q=>['service','machine','guard','permission','reward','arb','progress','treasury','demand','repository','contact','order','allocation','personal','payment','proof']['includes'](q));if(p['length']>0x0)j=p;}const k=buildPuzzleDispatch(),l={};for(const q of j){const r=k[q];if(!r){b['push']('No\x20puzzle\x20module\x20for\x20\x27'+q+'\x27\x20—\x20skipped\x20(L3\x20object)');continue;}const s=r['init'](c),t=s?r['check'](s):undefined,u=extractMissingDimensions(t);l[q]={'puzzle':s,'completeness':t,'missing_dimensions':u},!s&&b['push']('Puzzle\x20init\x20failed\x20for\x20\x27'+q+'\x27');}const m=aggregatePuzzleCompleteness(l),n=suggestNextPuzzleStep({'intent_parsed':{'primary_object':g,'secondary_objects':h,'detected_scenes':i,'industry':f,'keyword_matches':e},'puzzles':l,'overall_completeness':m,'next_step':'','recommended_creation_order':[],'warnings':b}),o=['permission','progress','machine','guard','allocation','service'];return{'intent_parsed':{'primary_object':g,'secondary_objects':h,'detected_scenes':i,'industry':f,'keyword_matches':e},'puzzles':l,'overall_completeness':m,'next_step':n,'recommended_creation_order':o,'warnings':b};}function extractMissingDimensions(a){if(!a||typeof a!=='object')return[];const b=a,d=b['missing'];if(Array['isArray'](d))return d['map'](f=>String(f));const e=b['missing_details'];if(Array['isArray'](e))return e['map'](f=>String(f?.['dimension']??f));return[];}export function aggregatePuzzleCompleteness(a){const b=Object['values'](a??{});if(b['length']===0x0)return'empty';const c=b['filter'](f=>!f['puzzle'])['length'];if(c===b['length'])return'empty';const d=b['reduce']((f,g)=>f+(g['missing_dimensions']?.['length']??0x0),0x0);if(d===0x0)return'complete';return'partial';}export function suggestNextPuzzleStep(a){if(!a)return'No\x20result\x20to\x20suggest\x20from.';if(a['overall_completeness']==='complete')return'All\x20puzzle\x20dimensions\x20are\x20complete\x20—\x20ready\x20for\x20risk\x20calibration\x20(stage\x203).';if(a['overall_completeness']==='empty')return'No\x20puzzle\x20has\x20been\x20initialized.\x20Provide\x20more\x20concrete\x20business\x20intent\x20so\x20the\x20primary\x20object\x20can\x20be\x20identified.';const b=['permission','treasury','allocation','guard','machine','service','order','progress','arb','reward','proof','repository','demand','contact','personal','payment'],d=a['puzzles']??{},e=b['filter'](f=>d[f]);for(const f of e){const g=d[f];if(!g)continue;const h=g['missing_dimensions']??[];if(h['length']===0x0)continue;const i=g['completeness'],j=i&&typeof i==='object'?i['next_step']:undefined;if(typeof j==='string'&&j['trim']())return'['+f+']\x20'+j;return'['+f+']\x20Complete\x20dimension'+(h['length']>0x1?'s':'')+'\x20'+h['join'](',\x20')+'\x20to\x20advance\x20the\x20puzzle.';}return'Continue\x20dialog\x20to\x20fill\x20remaining\x20pending\x20fields.';}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Blueprint } from "../../composition/blueprint-view.js";
|
|
2
2
|
import type { BusinessIntent } from "./intent-analyzer.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { CapabilityId } from "../../extensions/capability.js";
|
|
4
4
|
export type GameScenario = "merchant_may_deliver_late" | "merchant_may_abandon" | "customer_may_deny_acceptance" | "customer_may_false_claim" | "supplier_may_not_deliver";
|
|
5
5
|
export interface GameTheoryConstraint {
|
|
6
6
|
scenario: GameScenario;
|
|
@@ -18,7 +18,7 @@ export interface GameTheoryConstraint {
|
|
|
18
18
|
};
|
|
19
19
|
evaluationMetric: string;
|
|
20
20
|
mitigationSignals: string[][];
|
|
21
|
-
mitigatingModules:
|
|
21
|
+
mitigatingModules: CapabilityId[];
|
|
22
22
|
recommendation: string;
|
|
23
23
|
appliesWhen?: (intent: BusinessIntent) => boolean;
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{findSimilarIndustries,inferTraitsFromDescription}from'../../knowledge/industry-generalizer.js';const INTENT_KEYWORDS={'sell_service':['design','develop','consult','freelance','service','build','create','write','translate'],'sell_product':['sell','product','item','goods','merchandise','store','shop'],'sell_subscription':['subscribe','subscription','membership','monthly','recurring','creator','patron'],'rent_asset':['rent','rental','lease','borrow','car','house','apartment','equipment'],'crowdfund':['crowdfund','fund','raise','campaign','donation','backer'],'escrow':['escrow','hold','mediate','intermediary','safe','secure\x20transaction']};function classifyIntentType(a){const b=a['toLowerCase']();let c='sell_service',d=0x0;for(const [e,f]of Object['entries'](INTENT_KEYWORDS)){const g=f['filter'](h=>b['includes'](h))['length'];g>d&&(d=g,c=e);}return c;}function inferPaymentModel(a){const b=a['toLowerCase']();if(b['includes']('milestone')||b['includes']('phase')||b['includes']('stage'))return'milestone';if(b['includes']('subscription')||b['includes']('monthly')||b['includes']('recurring'))return'subscription';if(b['includes']('per\x20use')||b['includes']('hourly')||b['includes']('per\x20session'))return'per_use';if(b['includes']('escrow')||b['includes']('hold'))return'escrow';return'upfront';}function inferRefundPolicy(a){const b=a['toLowerCase']();if(b['includes']('no\x20refund')||b['includes']('non-refundable'))return'no_refund';if(b['includes']('milestone')&&b['includes']('refund'))return'milestone_prorated';if(b['includes']('full\x20refund'))return'full';return'partial';}export function inferArbitration(a){const b=a['toLowerCase']();if(b['includes']('no\x20arbitration')||b['includes']('no\x20dispute'))return'none';if(b['includes']('third\x20party')||b['includes']('independent'))return'third_party';if(b['includes']('mutual'))return'mutual_pick';return'merchant_pick';}export async function analyzeIntent(a,b){const c=[],d=classifyIntentType(a),e=inferTraitsFromDescription(a),f=findSimilarIndustries(e['traits'],0x3),g=f['map'](n=>n['industry']),h=b?.['preferredIndustry']??g[0x0]??'general',i=g['includes'](h)?0.85:0.5,j=e['traits'],k={'intent':d,'industry':h,'description':a,'roles':{'merchant':{'name':'merchant','description':'Service\x20provider\x20or\x20seller','obligations':['Deliver\x20as\x20described','Maintain\x20compensation_fund\x20if\x20required','Accept\x20arbitration\x20verdicts'],'rights':['Receive\x20payment\x20upon\x20verified\x20delivery','Set\x20service\x20terms\x20before\x20publish']},'customer':{'name':'customer','description':'Buyer\x20or\x20service\x20recipient','obligations':['Pay\x20according\x20to\x20agreed\x20schedule','Provide\x20acceptance/rejection\x20within\x20timeout'],'rights':['Receive\x20deliverables\x20as\x20described','Request\x20refund\x20if\x20delivery\x20fails','Initiate\x20arbitration\x20for\x20disputes']}},'deliverables':[{'name':'main_deliverable','type':inferDeliverableType(a),'acceptanceCriteria':'To\x20be\x20defined\x20by\x20merchant\x20during\x20configuration','proofOfDelivery':'wip_hash'}],'payment':{'model':inferPaymentModel(a),'currency':b?.['currency']??'WOW','triggers':[{'event':inferPaymentModel(a)==='milestone'?'milestone\x20completion':'service\x20confirmation','guardDescription':'Guard\x20verifies\x20deliverable\x20meets\x20acceptance\x20criteria'}],'allocation':[{'recipient':'merchant','percentage':0x64}]},'trust':{'refundPolicy':inferRefundPolicy(a),'arbitration':inferArbitration(a),'escrow':!![],'transparency':'full'}};k['payment']['model']==='milestone'&&!a['toLowerCase']()['includes']('milestone')&&c['push']('Payment\x20model\x20inferred\x20as\x20\x27milestone\x27\x20but\x20not\x20explicitly\x20mentioned.\x20Please\x20verify.');k['trust']['arbitration']==='none'&&c['push']('No\x20arbitration\x20configured.\x20This\x20increases\x20risk\x20for\x20both\x20parties.\x20Consider\x20adding\x20independent_arbitration\x20module.');k['payment']['allocation']&&k['payment']['allocation']['some'](n=>n['recipient']==='platform'&&n['percentage']>0x0)&&c['push']('Platform\x20fee\x20>\x200\x20detected.\x20WOW\x20philosophy\x20recommends\x200%\x20platform\x20fee\x20for\x20peer-to-peer\x20transactions.');const l=a['toLowerCase']();/(refund|cancel|dispute)/['test'](l)&&k['payment']['model']==='milestone'&&c['push']('T1\x20B-1:\x20\x27refund/dispute\x27\x20must\x20be\x20modeled\x20via\x20the\x20Allocation\x20waterfall\x20(order_allocators)\x20+\x20'+'the\x20bound\x20Arbitration\x20—\x20NOT\x20a\x20Machine\x20\x27refunded\x27/\x27disputed\x27\x20node\x20(R-M1-11).');/(variable amount|dynamic amount|actual loss|assessed loss)/['test'](l)&&c['push']('T1\x20B-2:\x20a\x20variable/conditional\x20payout\x20amount\x20cannot\x20be\x20expressed\x20in\x20Allocation\x20—\x20amounts\x20are\x20'+'pre-configured.\x20Use\x20fixed\x20tiers\x20guarded\x20by\x20distinct\x20Guards,\x20or\x20an\x20Amount\x20with\x20a\x20max\x20cap.');/(auto|automatic|automatically|after \d+ (day|hour|week)|within \d+ (day|hour|week))/['test'](l)&&c['push']('T1\x20B-3:\x20\x27auto\x20/\x20after\x20N\x20days\x27\x20has\x20no\x20on-chain\x20cron\x20—\x20it\x20requires\x20a\x20time_guard\x20PLUS\x20an\x20off-chain\x20'+'keeper\x20to\x20submit.\x20Configuring\x20a\x20time_guard\x20without\x20a\x20keeper\x20means\x20nothing\x20ever\x20fires.');let m=[];try{const {
|
|
1
|
+
import{findSimilarIndustries,inferTraitsFromDescription}from'../../knowledge/industry-generalizer.js';const INTENT_KEYWORDS={'sell_service':['design','develop','consult','freelance','service','build','create','write','translate'],'sell_product':['sell','product','item','goods','merchandise','store','shop'],'sell_subscription':['subscribe','subscription','membership','monthly','recurring','creator','patron'],'rent_asset':['rent','rental','lease','borrow','car','house','apartment','equipment'],'crowdfund':['crowdfund','fund','raise','campaign','donation','backer'],'escrow':['escrow','hold','mediate','intermediary','safe','secure\x20transaction']};function classifyIntentType(a){const b=a['toLowerCase']();let c='sell_service',d=0x0;for(const [e,f]of Object['entries'](INTENT_KEYWORDS)){const g=f['filter'](h=>b['includes'](h))['length'];g>d&&(d=g,c=e);}return c;}function inferPaymentModel(a){const b=a['toLowerCase']();if(b['includes']('milestone')||b['includes']('phase')||b['includes']('stage'))return'milestone';if(b['includes']('subscription')||b['includes']('monthly')||b['includes']('recurring'))return'subscription';if(b['includes']('per\x20use')||b['includes']('hourly')||b['includes']('per\x20session'))return'per_use';if(b['includes']('escrow')||b['includes']('hold'))return'escrow';return'upfront';}function inferRefundPolicy(a){const b=a['toLowerCase']();if(b['includes']('no\x20refund')||b['includes']('non-refundable'))return'no_refund';if(b['includes']('milestone')&&b['includes']('refund'))return'milestone_prorated';if(b['includes']('full\x20refund'))return'full';return'partial';}export function inferArbitration(a){const b=a['toLowerCase']();if(b['includes']('no\x20arbitration')||b['includes']('no\x20dispute'))return'none';if(b['includes']('third\x20party')||b['includes']('independent'))return'third_party';if(b['includes']('mutual'))return'mutual_pick';return'merchant_pick';}export async function analyzeIntent(a,b){const c=[],d=classifyIntentType(a),e=inferTraitsFromDescription(a),f=findSimilarIndustries(e['traits'],0x3),g=f['map'](n=>n['industry']),h=b?.['preferredIndustry']??g[0x0]??'general',i=g['includes'](h)?0.85:0.5,j=e['traits'],k={'intent':d,'industry':h,'description':a,'roles':{'merchant':{'name':'merchant','description':'Service\x20provider\x20or\x20seller','obligations':['Deliver\x20as\x20described','Maintain\x20compensation_fund\x20if\x20required','Accept\x20arbitration\x20verdicts'],'rights':['Receive\x20payment\x20upon\x20verified\x20delivery','Set\x20service\x20terms\x20before\x20publish']},'customer':{'name':'customer','description':'Buyer\x20or\x20service\x20recipient','obligations':['Pay\x20according\x20to\x20agreed\x20schedule','Provide\x20acceptance/rejection\x20within\x20timeout'],'rights':['Receive\x20deliverables\x20as\x20described','Request\x20refund\x20if\x20delivery\x20fails','Initiate\x20arbitration\x20for\x20disputes']}},'deliverables':[{'name':'main_deliverable','type':inferDeliverableType(a),'acceptanceCriteria':'To\x20be\x20defined\x20by\x20merchant\x20during\x20configuration','proofOfDelivery':'wip_hash'}],'payment':{'model':inferPaymentModel(a),'currency':b?.['currency']??'WOW','triggers':[{'event':inferPaymentModel(a)==='milestone'?'milestone\x20completion':'service\x20confirmation','guardDescription':'Guard\x20verifies\x20deliverable\x20meets\x20acceptance\x20criteria'}],'allocation':[{'recipient':'merchant','percentage':0x64}]},'trust':{'refundPolicy':inferRefundPolicy(a),'arbitration':inferArbitration(a),'escrow':!![],'transparency':'full'}};k['payment']['model']==='milestone'&&!a['toLowerCase']()['includes']('milestone')&&c['push']('Payment\x20model\x20inferred\x20as\x20\x27milestone\x27\x20but\x20not\x20explicitly\x20mentioned.\x20Please\x20verify.');k['trust']['arbitration']==='none'&&c['push']('No\x20arbitration\x20configured.\x20This\x20increases\x20risk\x20for\x20both\x20parties.\x20Consider\x20adding\x20independent_arbitration\x20module.');k['payment']['allocation']&&k['payment']['allocation']['some'](n=>n['recipient']==='platform'&&n['percentage']>0x0)&&c['push']('Platform\x20fee\x20>\x200\x20detected.\x20WOW\x20philosophy\x20recommends\x200%\x20platform\x20fee\x20for\x20peer-to-peer\x20transactions.');const l=a['toLowerCase']();/(refund|cancel|dispute)/['test'](l)&&k['payment']['model']==='milestone'&&c['push']('T1\x20B-1:\x20\x27refund/dispute\x27\x20must\x20be\x20modeled\x20via\x20the\x20Allocation\x20waterfall\x20(order_allocators)\x20+\x20'+'the\x20bound\x20Arbitration\x20—\x20NOT\x20a\x20Machine\x20\x27refunded\x27/\x27disputed\x27\x20node\x20(R-M1-11).');/(variable amount|dynamic amount|actual loss|assessed loss)/['test'](l)&&c['push']('T1\x20B-2:\x20a\x20variable/conditional\x20payout\x20amount\x20cannot\x20be\x20expressed\x20in\x20Allocation\x20—\x20amounts\x20are\x20'+'pre-configured.\x20Use\x20fixed\x20tiers\x20guarded\x20by\x20distinct\x20Guards,\x20or\x20an\x20Amount\x20with\x20a\x20max\x20cap.');/(auto|automatic|automatically|after \d+ (day|hour|week)|within \d+ (day|hour|week))/['test'](l)&&c['push']('T1\x20B-3:\x20\x27auto\x20/\x20after\x20N\x20days\x27\x20has\x20no\x20on-chain\x20cron\x20—\x20it\x20requires\x20a\x20time_guard\x20PLUS\x20an\x20off-chain\x20'+'keeper\x20to\x20submit.\x20Configuring\x20a\x20time_guard\x20without\x20a\x20keeper\x20means\x20nothing\x20ever\x20fires.');let m=[];try{const {recommendCapabilities:n}=await import('../../extensions/capability.js'),o=n(h,a,{'maxCapabilities':0x5});m=o['map'](p=>p['id']);}catch{m=['milestone_escrow','independent_arbitration','wip_provenance'];}return{'intent':k,'inferredIndustry':h,'industryConfidence':i,'similarIndustries':g,'inferredTraits':j,'recommendedModules':m,'warnings':c};}function inferDeliverableType(a){const b=a['toLowerCase']();if(b['includes']('design')||b['includes']('code')||b['includes']('write')||b['includes']('digital'))return'digital';if(b['includes']('class')||b['includes']('lesson')||b['includes']('session'))return'service_session';if(b['includes']('rent')||b['includes']('access'))return'access_right';return'physical';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Config,LocalMark,query_objects,objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as
|
|
1
|
+
import{Config,LocalMark,query_objects,objectTypeFromAddress,ObjectType}from'@wowok/wowok';import{resolveAddress as a417a}from'../../tools/handlers/name-resolution.js';import{fetchMachineNodes,buildMachineGraph}from'./machine-nodes.js';import{batchQueryObjectsByIds,fetchObjectLinkerTx,ringWindowSaturated}from'../../graph/onchain/sdk-batch.js';export async function handleMachinePanorama(a){const b=a['object_address'];if(!b)throw new Error('\x27object_address\x27\x20is\x20required\x20for\x20machine_panorama');let c=a['context_network']??undefined;const d=[];let f=await a417a(b,'machine'),g=null;try{if(!c)c=await Config['Instance']()['network_get']();const x=await query_objects({'objects':[f],'network':c});g=x?.['objects']?.[0x0]??null;if(!g&&a['context_network']){const y=await Config['Instance']()['network_get']();if(y&&y!==c){const z=await query_objects({'objects':[f],'network':y,'no_cache':!![]}),A=z?.['objects']?.[0x0]??null;A&&(g=A,c=y);}}}catch(B){throw new Error('Failed\x20to\x20query\x20Machine\x20'+f+'\x20on\x20'+c+':\x20'+(''+(B instanceof Error?B['message']:String(B))));}if(!g)throw new Error('Machine\x20'+f+'\x20not\x20found\x20on\x20'+c+'.\x20It\x20may\x20not\x20exist\x20on\x20this\x20network.');f=g['object']??f;let h=null,j=[];try{const C=await LocalMark['Instance']()['list']({'address':f});C['length']>0x0&&(h=C[0x0]['name']??null,j=(C[0x0]['tags']??[])['map'](D=>String(D)));}catch{d['push']('head:\x20LocalMark\x20lookup\x20failed');}let k={'nodes':[],'edges':[]};try{const D=await fetchMachineNodes(f,c,!![]);k=buildMachineGraph(D);}catch{d['push']('graph:\x20node\x20fetch\x20failed\x20(non-blocking)');}if(typeof g['permission']==='string'&&g['permission'])try{const E=await query_objects({'objects':[g['permission']],'network':c}),F=E?.['objects']?.[0x0]??null,G=Array['isArray'](F?.['perm_remark'])?F['perm_remark']:Array['isArray'](F?.['remark'])?F['remark']:[],H=G['map'](I=>({'index':typeof I?.['index']==='number'?I['index']:parseInt(I?.['index'],0xa),'remark':typeof I?.['remark']==='string'?I['remark']:''}))['filter'](I=>Number['isFinite'](I['index']));k['permission']={'address':g['permission'],'remarks':H};}catch{d['push']('graph:\x20permission\x20read\x20failed\x20(non-blocking)');}const l=[];let m=0x0,n=null,p=null,q=0x0,s=![],u=[];try{const I=await fetchObjectLinkerTx(f,c,!![]),J=I?.['items']??[];s=ringWindowSaturated(J['length']);const K=new Map();for(const R of J){const S=typeof R?.['who']==='string'?R['who']['toLowerCase']():'';if(!S||S==='0x0')continue;if(!objectTypeFromAddress(S))continue;const T=typeof R?.['time']==='number'?R['time']:null,U=K['get'](S);K['set'](S,U==null?T:T==null?U:Math['max'](U,T));}q=K['size'];const L=new Map();for(const [V,W]of K){const X=String(objectTypeFromAddress(V)),Y=L['get'](X)??[];Y['push']({'address':V,'time':W}),L['set'](X,Y);}for(const Z of L['values']()){Z['sort']((a0,a1)=>(a1['time']??0x0)-(a0['time']??0x0));}const M=['Progress','Allocation','Payment','Guard'];u=[];for(const a0 of M){const a1=L['get'](a0);a1&&a1['length']>0x0&&(u['push']({'label':a0,'items':a1}),L['delete'](a0));}for(const [a2,a3]of L){if(a3['length']>0x0)u['push']({'label':a2,'items':a3});}const N=J['filter'](a4=>objectTypeFromAddress(a4['who'])===ObjectType['Progress']);m=N['length'];for(const a4 of N){if(typeof a4?.['time']==='number'){if(n===null||a4['time']<n)n=a4['time'];if(p===null||a4['time']>p)p=a4['time'];}}const O=N['slice'](-0x3)['reverse'](),P=O['map'](a5=>a5['who']),Q=new Map();if(P['length']>0x0)try{const a5=await batchQueryObjectsByIds(P,c,!![]);for(const a6 of a5){if(a6?.['object'])Q['set'](a6['object'],a6);}}catch{d['push']('progresses:\x20detail\x20fetch\x20failed');}for(const a7 of O){const a8=typeof a7?.['who']==='string'?a7['who']:'';if(!a8)continue;const a9=Q['get'](a8);l['push']({'progress':a8,'name':null,'current':a9?.['current']??null,'task':a9?.['task']??null,'history_count':typeof a9?.['history_count']==='number'?a9['history_count']:null,'current_time':typeof a9?.['current_time']==='number'?a9['current_time']:null,'created_at':typeof a7?.['time']==='number'?a7['time']:null});}}catch{d['push']('progresses:\x20global-table\x20lookup\x20failed\x20(non-blocking)');}const w='Analyze\x20ALL\x20workflow\x20progresses\x20of\x20Machine\x20'+f+'\x20('+c+')\x20one\x20by\x20one,\x20newest\x20first.\x20'+('The\x20progresses\x20live\x20in\x20the\x20machine\x27s\x20FIFO\x20tx-linker\x20window\x20holding\x20at\x20most\x205200\x20newest\x20entries\x20—\x20the\x20retained\x20count\x20is\x20a\x20lower\x20bound\x20when\x20the\x20window\x20is\x20saturated\x20(currently\x20'+m+(s?',\x20saturated':'')+').\x20')+'For\x20each\x20progress\x20call\x20object_panorama\x20with\x20the\x20progress\x27s\x20FULL\x200x\x20address\x20(collect\x20the\x20addresses\x20from\x20the\x20same\x20reverse-index\x20source;\x20work\x20newest-first)\x20and\x20render\x20ONE\x20table\x20row\x20per\x20progress:\x20'+'progress\x20address\x20chip\x20(first\x20column)\x20|\x20current\x20node\x20|\x20task\x20|\x20history\x20events\x20|\x20last\x20activity\x20(local\x20date)\x20|\x20registered\x20(local\x20date).\x20'+'Close\x20with\x20the\x203\x20most\x20valuable\x20patterns\x20across\x20the\x20rows\x20(stuck\x20nodes,\x20age\x20of\x20active\x20progresses,\x20throughput).\x20Progresses\x20only\x20—\x20do\x20not\x20re-analyze\x20the\x20Machine\x20graph\x20itself.';return{'action':'machine_panorama','machineAddress':f,'network':String(c),'now_ms':Date['now'](),'head':{'name':h,'tags':j,'description':typeof g['description']==='string'?g['description']:null,'published':typeof g['bPublished']==='boolean'?g['bPublished']:null,'paused':typeof g['bPaused']==='boolean'?g['bPaused']:null},'fields':{'permission':g['permission']??null,'um':g['um']??null,'node_count':k['nodes']['length']>0x0?k['nodes']['length']:typeof g['node_count']==='number'?g['node_count']+0x1:null,'onchain_table_node_count':typeof g['node_count']==='number'?g['node_count']:k['nodes']['length']>0x0?k['nodes']['length']-0x1:null,'consensus_repositories':Array['isArray'](g['consensus_repositories'])?g['consensus_repositories']:[]},'graph':k,'progresses':{'count':m,'window_saturated':s,'preview_truncated':m>l['length'],'stats':{'first_created_ms':n,'last_created_ms':p},...m>l['length']?{'drilldown':{'total_count':m,'analyzed_count':l['length'],'prompt':w}}:{},'items':l},'related':{'count':q,'window_saturated':s,'groups':u},'data_gaps':d};}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type BusinessIntent, type DeliverableDefinition, type PaymentIntent, type TrustIntent } from "./intent-analyzer.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { SupplyChainPromise } from "../../composition/supply-chain-emit.js";
|
|
3
|
+
import type { JsonValue } from "../../composition/plan.js";
|
|
4
|
+
import { type CapabilityId } from "../../extensions/capability.js";
|
|
3
5
|
import type { IndustryTemplate } from "../../knowledge/template-loader.js";
|
|
4
6
|
export interface GuideState {
|
|
5
7
|
intent_text: string;
|
|
@@ -8,7 +10,7 @@ export interface GuideState {
|
|
|
8
10
|
deliverables?: DeliverableDefinition[];
|
|
9
11
|
payment_override?: Partial<PaymentIntent>;
|
|
10
12
|
trust_override?: Partial<TrustIntent>;
|
|
11
|
-
adopted_module_ids?:
|
|
13
|
+
adopted_module_ids?: CapabilityId[];
|
|
12
14
|
guard_resolutions?: Record<string, unknown>;
|
|
13
15
|
review_mode?: "review" | "review_reward" | "none";
|
|
14
16
|
reward_funding?: string;
|
|
@@ -19,7 +21,9 @@ export interface GuideState {
|
|
|
19
21
|
affiliate_mode?: "commission" | "none";
|
|
20
22
|
crowdfunding_mode?: "threshold" | "flexible" | "none";
|
|
21
23
|
logistics_mode?: "none" | "carrier" | "merchant_managed" | "courier" | "pickup_point";
|
|
24
|
+
supply_chain?: SupplyChainPromise[];
|
|
22
25
|
sales?: unknown[];
|
|
26
|
+
fee_overrides?: Record<string, number | string>;
|
|
23
27
|
}
|
|
24
28
|
export interface MerchantGuideInput {
|
|
25
29
|
intent?: string;
|
|
@@ -41,7 +45,9 @@ export interface MerchantGuideInput {
|
|
|
41
45
|
affiliate_mode?: string;
|
|
42
46
|
crowdfunding_mode?: string;
|
|
43
47
|
logistics_mode?: string;
|
|
48
|
+
supply_chain?: SupplyChainPromise[];
|
|
44
49
|
sales?: unknown[];
|
|
50
|
+
fee_overrides?: Record<string, number | string>;
|
|
45
51
|
};
|
|
46
52
|
guide_confirm?: {
|
|
47
53
|
industry?: string;
|
|
@@ -60,6 +66,7 @@ export interface MerchantGuideInput {
|
|
|
60
66
|
affiliate_mode?: string;
|
|
61
67
|
crowdfunding_mode?: string;
|
|
62
68
|
logistics_mode?: string;
|
|
69
|
+
supply_chain?: SupplyChainPromise[];
|
|
63
70
|
sales?: unknown[];
|
|
64
71
|
};
|
|
65
72
|
template_override?: IndustryTemplate;
|
|
@@ -82,6 +89,9 @@ interface CreationPlanEntry {
|
|
|
82
89
|
depends_on: string[];
|
|
83
90
|
operation_hint: string;
|
|
84
91
|
}
|
|
92
|
+
export declare const GAS_PER_ORDER_SMALLEST = 6000000;
|
|
93
|
+
export declare const MIN_ECONOMIC_ORDER_SMALLEST = 50000000;
|
|
94
|
+
export declare function gasEconomicsWarnings(sales: unknown[] | undefined, rewardClaimAmount: string | number | undefined): string[];
|
|
85
95
|
export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
86
96
|
action: "merchant_guide";
|
|
87
97
|
current_step: number;
|
|
@@ -96,9 +106,6 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
96
106
|
warnings: string[];
|
|
97
107
|
next_action: string;
|
|
98
108
|
} | {
|
|
99
|
-
warnings: string[];
|
|
100
|
-
next_action: string;
|
|
101
|
-
plan: import("../../composition/plan.js").Plan;
|
|
102
109
|
audit: {
|
|
103
110
|
issues: import("../../composition/plan.js").PlanIssue[];
|
|
104
111
|
findings: import("../../config/rule-engine.js").RuleBookFinding[];
|
|
@@ -110,6 +117,22 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
110
117
|
blocks: import("../../composition/reflux.js").RefluxBlock[];
|
|
111
118
|
iterations: number;
|
|
112
119
|
};
|
|
120
|
+
required_local_marks?: string[] | undefined;
|
|
121
|
+
required_local_marks_note?: string | undefined;
|
|
122
|
+
warnings: string[];
|
|
123
|
+
next_action: string;
|
|
124
|
+
plan: {
|
|
125
|
+
catalog_version: number;
|
|
126
|
+
template_digest?: string;
|
|
127
|
+
version: 1;
|
|
128
|
+
intent: string;
|
|
129
|
+
templateId?: string;
|
|
130
|
+
inputs: Record<string, JsonValue>;
|
|
131
|
+
steps: import("../../composition/plan.js").PlanStep[];
|
|
132
|
+
external_refs?: string[];
|
|
133
|
+
pending_guards?: import("../../composition/plan.js").PendingGuard[];
|
|
134
|
+
derived_params?: import("../../composition/plan.js").DerivedParam[];
|
|
135
|
+
};
|
|
113
136
|
pending_count_note?: string | undefined;
|
|
114
137
|
pending_guard_designs?: {
|
|
115
138
|
how_to_resolve: string;
|
|
@@ -130,6 +153,15 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
130
153
|
template_id: string;
|
|
131
154
|
host: "reward" | "service" | "arbitration" | "machine" | "repository";
|
|
132
155
|
purpose: string;
|
|
156
|
+
bound: boolean;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
mandatory_disclosures: string[];
|
|
159
|
+
supply_chain?: {
|
|
160
|
+
handoff?: import("../../composition/supply-chain-emit.js").SupplyChainHandoff | undefined;
|
|
161
|
+
steps: string[];
|
|
162
|
+
inputs: Record<string, string>;
|
|
163
|
+
primitives: import("../../chain-semantics/composition-truth.js").PrimitiveId[];
|
|
164
|
+
notes: string[];
|
|
133
165
|
}[] | undefined;
|
|
134
166
|
blueprint: {
|
|
135
167
|
nodes: {
|
|
@@ -154,7 +186,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
154
186
|
graph_validation: {
|
|
155
187
|
valid: boolean;
|
|
156
188
|
hard_violations: {
|
|
157
|
-
id: "PLAN_DUP_STEP" | "PLAN_UNKNOWN_KIND" | "PLAN_REF_UNKNOWN" | "PLAN_REF_FORWARD" | "PLAN_PUBLISH_TARGET" | "PLAN_PROSE_GUARD" | "PLAN_MACHINE_NODES" | "PLAN_REQUIRES_UNKNOWN" | "PLAN_GUARD_PLACEHOLDER" | "PLAN_GUARD_EMPTY_VEC" | "PLAN_LOGIC_ARITY";
|
|
189
|
+
id: "PLAN_DUP_STEP" | "PLAN_UNKNOWN_KIND" | "PLAN_REF_UNKNOWN" | "PLAN_REF_FORWARD" | "PLAN_PUBLISH_TARGET" | "PLAN_PROSE_GUARD" | "PLAN_MACHINE_NODES" | "PLAN_REQUIRES_UNKNOWN" | "PLAN_GUARD_PLACEHOLDER" | "PLAN_GUARD_EMPTY_VEC" | "PLAN_GUARD_ZERO_ADDR" | "PLAN_LOGIC_ARITY" | "PLAN_NAME_COLLISION";
|
|
158
190
|
description: string;
|
|
159
191
|
fix: string;
|
|
160
192
|
}[];
|
|
@@ -165,11 +197,11 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
165
197
|
};
|
|
166
198
|
harness_check: {
|
|
167
199
|
module_constraints: {
|
|
168
|
-
module:
|
|
200
|
+
module: string;
|
|
169
201
|
plan_satisfied: boolean;
|
|
170
202
|
missing: string[] | undefined;
|
|
171
203
|
reason: string | undefined;
|
|
172
|
-
|
|
204
|
+
findings: import("../../extensions/capability.js").CapabilityAdoptionFinding[];
|
|
173
205
|
evidence_matched: boolean | undefined;
|
|
174
206
|
}[];
|
|
175
207
|
blocking_issues: {
|
|
@@ -178,13 +210,13 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
178
210
|
fix: string;
|
|
179
211
|
}[];
|
|
180
212
|
module_gaps: {
|
|
181
|
-
module:
|
|
213
|
+
module: string;
|
|
182
214
|
missing_constraints: string[] | undefined;
|
|
183
215
|
fix: string | undefined;
|
|
184
216
|
}[];
|
|
185
217
|
deploy_time_checks: string[];
|
|
186
218
|
recipient_design_guidance: {
|
|
187
|
-
id: "
|
|
219
|
+
id: "signer" | "entity" | "submitted_object" | "constrained_submission";
|
|
188
220
|
move_recipient: string;
|
|
189
221
|
semantics: string;
|
|
190
222
|
required_constraints: string[];
|
|
@@ -225,13 +257,14 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
225
257
|
};
|
|
226
258
|
creation_plan: CreationPlanEntry[];
|
|
227
259
|
post_deploy_steps: PostDeployStep[];
|
|
228
|
-
mandatory_disclosures: string[];
|
|
229
260
|
time_anchor_instructions?: string[] | undefined;
|
|
261
|
+
user_input_questions?: import("../../knowledge/param-schema.js").UserInputQuestion[] | undefined;
|
|
262
|
+
user_input_note?: string | undefined;
|
|
230
263
|
action: "merchant_guide";
|
|
231
264
|
current_step: number;
|
|
232
265
|
step_name: string;
|
|
233
266
|
guide_state: {
|
|
234
|
-
adopted_module_ids:
|
|
267
|
+
adopted_module_ids: string[];
|
|
235
268
|
intent_text: string;
|
|
236
269
|
confirmed_industry?: string;
|
|
237
270
|
currency?: string;
|
|
@@ -248,7 +281,9 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
248
281
|
affiliate_mode?: "commission" | "none";
|
|
249
282
|
crowdfunding_mode?: "threshold" | "flexible" | "none";
|
|
250
283
|
logistics_mode?: "none" | "carrier" | "merchant_managed" | "courier" | "pickup_point";
|
|
284
|
+
supply_chain?: SupplyChainPromise[];
|
|
251
285
|
sales?: unknown[];
|
|
286
|
+
fee_overrides?: Record<string, number | string>;
|
|
252
287
|
};
|
|
253
288
|
intent: {
|
|
254
289
|
intent_type: import("./intent-analyzer.js").BusinessIntentType;
|
|
@@ -264,7 +299,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
264
299
|
trust: TrustIntent;
|
|
265
300
|
};
|
|
266
301
|
adopted_modules: {
|
|
267
|
-
id:
|
|
302
|
+
id: string;
|
|
268
303
|
name: string;
|
|
269
304
|
description: string;
|
|
270
305
|
requires_keeper: boolean;
|
|
@@ -291,7 +326,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
291
326
|
purpose: string;
|
|
292
327
|
}[];
|
|
293
328
|
allocator: {
|
|
294
|
-
recipient: "fixed" | "
|
|
329
|
+
recipient: "fixed" | "signer" | "entity";
|
|
295
330
|
count: number;
|
|
296
331
|
mode: "amount" | "surplus" | "rate";
|
|
297
332
|
description: string;
|
|
@@ -300,7 +335,7 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
300
335
|
once_per_order?: boolean | undefined;
|
|
301
336
|
rows?: {
|
|
302
337
|
track: "refund" | "settlement";
|
|
303
|
-
recipient: "
|
|
338
|
+
recipient: "signer" | "entity" | "guard_identifier";
|
|
304
339
|
mode: "amount" | "surplus" | "rate";
|
|
305
340
|
recipient_key?: string | undefined;
|
|
306
341
|
value?: string | number | undefined;
|
|
@@ -319,12 +354,4 @@ export declare function handleMerchantGuide(v: MerchantGuideInput): Promise<{
|
|
|
319
354
|
intent_draft?: undefined;
|
|
320
355
|
industry_options?: undefined;
|
|
321
356
|
}>;
|
|
322
|
-
export declare function listBusinessModules(): {
|
|
323
|
-
id: BusinessModuleId;
|
|
324
|
-
name: string;
|
|
325
|
-
description: string;
|
|
326
|
-
industry_fit: Record<string, number>;
|
|
327
|
-
addresses_pain_points: string[];
|
|
328
|
-
requires_keeper: boolean;
|
|
329
|
-
}[];
|
|
330
357
|
export {};
|