@wowok/agent-mcp 3.2.4 → 3.2.7
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/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/communication/wts-attestation.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/blueprint-view.d.ts +64 -0
- package/dist/composition/blueprint-view.js +1 -0
- package/dist/composition/compile.d.ts +3 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +17 -0
- package/dist/composition/inflight.js +1 -0
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/customer/account-events.js +1 -1
- package/dist/customer/order-monitor.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/constraint-registry.d.ts +6 -1
- package/dist/extensions/constraint-registry.js +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/industry-pack.d.ts +6 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/mode-evaluator.d.ts +3 -2
- package/dist/extensions/mode-evaluator.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/extensions/registry.d.ts +1 -2
- package/dist/extensions/registry.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/anti-cheat.d.ts +32 -2
- package/dist/graph/onchain/anti-cheat.js +1 -1
- package/dist/graph/onchain/anti-cheat.spec.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/extract.js +1 -1
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/graph-policy.spec.js +1 -1
- package/dist/graph/onchain/index.d.ts +2 -2
- package/dist/graph/onchain/index.js +1 -1
- package/dist/graph/onchain/project-relationship.js +1 -1
- package/dist/graph/onchain/table-ledger.spec.js +1 -1
- package/dist/graph/onchain/types.d.ts +3 -0
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/arbitration-venue-order.d.ts +25 -0
- package/dist/knowledge/arbitration-venue-order.js +1 -0
- package/dist/knowledge/audit-rules.d.ts +12 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/risk-baselines.spec.js +1 -1
- package/dist/knowledge/baselines/rules/allocation.json +5 -5
- package/dist/knowledge/baselines/rules/arb.json +1 -1
- package/dist/knowledge/baselines/rules/graph.json +81 -0
- package/dist/knowledge/baselines/rules/guard.json +9 -9
- package/dist/knowledge/baselines/rules/machine.json +5 -5
- package/dist/knowledge/baselines/rules/order.json +1 -1
- package/dist/knowledge/baselines/rules/plan.json +80 -2
- package/dist/knowledge/builtin-templates.d.ts +18 -2
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/entity-recipient-guard.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +4 -0
- package/dist/knowledge/guard-node-gates.js +1 -0
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-submission-prompt.d.ts +1 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-topology.d.ts +6 -0
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/reputation-rules.d.ts +3 -9
- package/dist/knowledge/reputation-rules.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +10 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +2 -4
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-templates.js +1 -1
- package/dist/knowledge/settlement-semantics.d.ts +1 -0
- package/dist/knowledge/settlement-semantics.js +1 -0
- package/dist/knowledge/template-loader.d.ts +29 -2
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +14 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-validation.d.ts +2 -0
- package/dist/knowledge/template-validation.js +1 -0
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +1 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/allocation-advice.js +1 -1
- package/dist/participation/customer-interest.js +1 -1
- package/dist/participation/radar-core.d.ts +6 -1
- package/dist/participation/radar-core.js +1 -1
- 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/game-theory.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +79 -13
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +7 -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.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/pipeline-actions.d.ts +1 -1
- package/dist/playbooks/service-build/pipeline-actions.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.d.ts +1 -0
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -0
- package/dist/playbooks/service-build/reverse-mapping.d.ts +24 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/risk-aggregator.d.ts +1 -1
- package/dist/playbooks/service-build/risk-aggregator.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/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/playbooks/service-build/workflow-design-assessment.d.ts +2 -2
- package/dist/playbooks/service-build/workflow-design-assessment.js +1 -1
- package/dist/relationship/derivation.d.ts +1 -0
- package/dist/review/index.js +1 -1
- package/dist/runtime/instance-registry.d.ts +8 -0
- package/dist/runtime/instance-registry.js +1 -0
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +14 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +109 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +14 -0
- package/dist/schema/call/contact.js +1 -1
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.d.ts +7 -0
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +7 -0
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/progress.d.ts +46 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +22 -8
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/index.d.ts +11 -0
- package/dist/schema/goal/planning.d.ts +32 -1
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +40 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +13 -0
- package/dist/schema/local/index.d.ts +75 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +17 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +46 -2
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +64 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +94 -0
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.d.ts +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/permission-machine-check.js +1 -1
- package/dist/schema/workspace/index.d.ts +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +45 -0
- package/dist/schemas/benchmark_migration_operation.output.json +24 -4
- package/dist/schemas/benchmark_migration_operation.schema.json +70 -0
- package/dist/schemas/bridge_operation.output.json +45 -0
- package/dist/schemas/goal_operation.schema.json +79 -1
- package/dist/schemas/guard2file.output.json +6 -1
- package/dist/schemas/guard2file.schema.json +9 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +91 -0
- package/dist/schemas/industry_pack_operation.schema.json +19 -1
- package/dist/schemas/keeper_operation.output.json +44 -0
- package/dist/schemas/local_cache_operation.output.json +45 -0
- package/dist/schemas/local_history_operation.output.json +45 -0
- package/dist/schemas/local_info_operation.output.json +45 -0
- package/dist/schemas/local_mark_operation.output.json +45 -0
- package/dist/schemas/machineNode2file.output.json +6 -1
- package/dist/schemas/machineNode2file.schema.json +9 -0
- package/dist/schemas/messenger_operation.output.json +52 -0
- package/dist/schemas/monitor_events.output.json +44 -0
- package/dist/schemas/monitor_subscription.output.json +44 -0
- package/dist/schemas/onchain_events.output.json +44 -0
- package/dist/schemas/onchain_operations.output.json +133 -0
- package/dist/schemas/onchain_operations.schema.json +110 -18
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
- package/dist/schemas/onchain_operations_contact.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_progress.schema.json +57 -0
- package/dist/schemas/onchain_operations_service.schema.json +44 -10
- package/dist/schemas/onchain_table_data.output.json +81 -13
- package/dist/schemas/onchain_table_data.schema.json +21 -21
- package/dist/schemas/query_toolkit.output.json +218 -9
- package/dist/schemas/query_toolkit.schema.json +50 -26
- package/dist/schemas/wowok_buildin_info.output.json +80 -1
- package/dist/schemas/wowok_buildin_info.schema.json +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +3 -13
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/file-export.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +22 -0
- package/dist/tools/handlers/review-chain.js +1 -0
- package/dist/tools/registry/agent.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/files.js +1 -1
- package/dist/tools/registry/identity.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/registry/messenger.js +1 -1
- package/dist/tools/registry/monitor.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/rules-hook.js +1 -1
- package/dist/tools/runtime-health.d.ts +10 -0
- package/dist/tools/runtime-health.js +1 -0
- package/dist/tools/upgrade-check.d.ts +10 -1
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wip-deploy-assist.js +1 -1
- package/dist/tools/wrap.d.ts +3 -0
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
- package/dist/playbooks/service-build/semantic-graph.d.ts +0 -99
- package/dist/playbooks/service-build/semantic-graph.js +0 -1
package/dist/knowledge/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind}from'./workflow-guidance.js';import{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules}from'./safety-rules.js';import{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations}from'./tool-constraints.js';import{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate}from'./reward-templates.js';import{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./audit-rules.js';import{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION}from'./dynamic-pricing.js';import{buildReviewRepositorySetup,computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION}from'./reputation-rules.js';import{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION}from'./acquisition-flywheel.js';import{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames}from'./industry-registry.js';import{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries}from'./industry-generalizer.js';import{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline}from'./industry-evolution.js';import{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext}from'./flywheel-loop.js';import{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole}from'./intent-metrics.js';import{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes}from'./guard-ledger.js';import{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory}from'./guard-translation.js';import{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP}from'./guard-puzzle.js';import{runGuardRulePack,assembleGuardAssessment,getRiskRulesCount}from'./guard-risk.js';import{evaluateGuardDraft}from'./guard-eval.js';import{GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding}from'./guard-bindings.js';import{SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects}from'./scenario-topology.js';import{GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams}from'./guard-templates.js';import{lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult}from'./guard-lint.js';import{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,findScene as a196a,getScenesByIndustry as a196b,getScenesByPattern,inferSceneFromFlow}from'./machine-ledger.js';import{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,getAllTemplates as a196c,getTemplateById as a196d,getTemplatesByScene as a196e,getTemplatesByIndustry as a196f,suggestTemplateForIntent,walkDecisionTree,fillTemplate as a196g,forkTemplate as a196h,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds}from'./machine-templates.js';import{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,matchSemanticPattern as a196i,identifyExecutionMode,identifyTopology,explainForwardPermission,getConstraintsByCategory as a196j,getConstraintById,getOnChainConstraints as a196k,getOffChainConstraints as a196l}from'./machine-translation.js';import{MACHINE_RISK_RULES,MACHINE_RISK_VERSION,assessMachineRisks}from'./machine-risk.js';import{analyzeTopology,identifyTopologyPattern,formatTopologySummary,MACHINE_TOPOLOGY_VERSION,MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT}from'./machine-topology.js';import{initPuzzleFromIntent as a196m,initPuzzleFromTemplate,checkPuzzleCompleteness as a196n,recommendNextStep as a196o,derivePuzzleFromMachineJson,generateConfirmationText as a196p,MACHINE_PUZZLE_VERSION}from'./machine-puzzle.js';import{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,getScenesByCategory as a196q,findSceneById as a196r,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,inferSceneFromIntent as a196s,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,getCrossObjectBindings as a196t}from'./service-ledger.js';import{initPuzzleFromIntent as a196u,checkPuzzleCompleteness as a196v,validateConstraints as a196w,generateConfirmationText as a196x,initOrderFlowPuzzle,checkOrderFlowCompleteness}from'./service-puzzle.js';import{SERVICE_RISK_VERSION,assessServiceRisks,getAllServiceRiskRules}from'./service-risk.js';import{SERVICE_TEMPLATES,SERVICE_TEMPLATES_VERSION,getServiceTemplateById,getServiceTemplatesByScene,getServiceTemplatesByIndustry,suggestServiceTemplateForScene,listServiceTemplates,fillServiceTemplate,getAllServiceTemplates}from'./service-templates.js';import{ALLOCATION_SCENES,ALLOCATION_LEDGER_VERSION,MAX_ALLOCATOR_COUNT,ALLOCATION_MAX_SHARING_COUNT,ALLOCATION_MODE_AMOUNT,ALLOCATION_MODE_RATE,ALLOCATION_MODE_SURPLUS,RATE_TOTAL_FULL,ALLOCATION_ERROR_CODES,getScenesByTriggerSource as a196y,getScenesByMode as a196z,getScenesByStrategy as a196A,findSceneById as a196B,inferSceneFromIntent as a196C,getAllScenes as a196D,getScenesCount as a196E,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,getErrorName as a196F,getErrorDescription as a196G}from'./allocation-ledger.js';import{initPuzzleFromIntent as a196H,checkPuzzleCompleteness as a196I,validateConstraints as a196J,generateConfirmationText as a196K,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION}from'./allocation-puzzle.js';import{ALLOCATION_RISK_VERSION,assessAllocationRisks,getAllRiskRules as a196L}from'./allocation-risk.js';import{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,getAllTemplates as a196M,getTemplateById as a196N,getTemplatesByScene as a196O,getTemplatesByIndustry as a196P,suggestTemplateForScene as a196Q,listTemplates as a196R,fillTemplate as a196S}from'./allocation-templates.js';import{RECIPIENT_CONSTRAINT_VERSION,classifyRecipient,analyzeRecipientConstraints,isUnboundSignerTheft,canonicalDoctrine,recipientDesignGuidance,derivePayoffFromSharing,OBJECT_DRIVEABILITY,driveabilityOf,RECIPIENT_DESIGN_OPTIONS}from'./recipient-constraint.js';import{paymentRelations,scanRecentPaymentEvents,resolveBeneficialOwners,extractionPlanForHolder,pendingWrappersAt,trackAccountPayments}from'./payment-tracker.js';import{TREASURY_LEDGER_VERSION,TREASURY_SCENES,TREASURY_PERMISSIONS as a196T,getScenesByHostObject as a196U,findSceneById as a196V,findSceneByPermissionIndex as a196W,getBuiltinPermissionByIndex as a196X,isBuiltinTreasuryPermission,getActiveBuiltinPermissions as a196Y,getReservedBuiltinPermissions as a196Z,inferSceneFromIntent as a196a0,getTreasuryScenesCount,getGovernedOperationsForPermissionIndex as a196a1}from'./treasury-ledger.js';import{initPuzzleFromIntent as a196a2,checkPuzzleCompleteness as a196a3,validateConstraints as a196a4,generateConfirmationText as a196a5,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,MAX_DESCRIPTION_LENGTH as a196a6}from'./treasury-puzzle.js';import{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,getTemplateById as a196a7,getTemplatesByScene as a196a8,getTemplatesByIndustry as a196a9,suggestTemplateForScene as a196aa,listTemplates as a196ab,fillTemplate as a196ac}from'./treasury-templates.js';import{TREASURY_RISK_VERSION,assessTreasuryRisks,getAllTreasuryRiskRules}from'./treasury-risk.js';import{ORDER_LEDGER_VERSION,ORDER_SCENES,ORDER_FIELDS,ORDER_STATES,ORDER_STATE_TRANSITIONS,ORDER_LIFECYCLE_EVENTS,ORDER_PERMISSION_MATRIX,ORDER_AUDIT_FORMULAS,getScenesByOperationField as a196ad,findSceneById as a196ae,findSceneByMoveEntry as a196af,getScenesByPermissionLayer as a196ag,getScenesByReversibility as a196ah,getFieldDef as a196ai,getMutableFields as a196aj,getImmutableFields as a196ak,getFrozenAfterProgressFields as a196al,getOneTimeSetFields as a196am,inferSceneFromIntent as a196an,getEmittedEvents as a196ao,getInferredEvents as a196ap,getOrderScenesCount,sdkToMoveField as a196aq,moveToSdkField as a196ar}from'./order-ledger.js';import{initPuzzleFromIntent as a196as,checkPuzzleCompleteness as a196at,validateConstraints as a196au,generateConfirmationText as a196av,verifySnapshotMechanism as a196aw,inferLifecyclePhase as a196ax,matchSceneFromPuzzle as a196ay,listAllScenes as a196az,lookupScene as a196aA}from'./order-puzzle.js';import{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,getTemplateById as a196aB,getTemplatesByScene as a196aC,getTemplatesByIndustry as a196aD,getTemplatesByPermissionLayer as a196aE,getIrreversibleTemplates as a196aF,suggestTemplateForScene as a196aG,listOrderTemplates,fillTemplate as a196aH,suggestTemplateFromIntent as a196aI,getTemplateParameters as a196aJ,validateTemplateParams as a196aK}from'./order-templates.js';import{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules}from'./order-risk.js';import{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,PROGRESS_PERMISSIONS as a196aL,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,getScenesByPhase as a196aM,findSceneById as a196aN,getScenesByIndustry as a196aO,getBuiltinPermissionByIndex as a196aP,isProgressBuiltinPermission,inferSceneFromIntent as a196aQ,getAllBuiltinPermissions as a196aR,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount}from'./progress-ledger.js';import{initPuzzleFromIntent as a196aS,checkPuzzleCompleteness as a196aT,validateConstraints as a196aU,generateConfirmationText as a196aV,resolveBuiltinPermission as a196aW,isOrderHolderForward,getRelevantDimensions as a196aX}from'./progress-puzzle.js';import{PROGRESS_TEMPLATES,PROGRESS_TEMPLATES_VERSION,getAllProgressTemplates,getProgressTemplateById,getProgressTemplatesByScene,getProgressTemplatesByIndustry,suggestProgressTemplateForScene,listProgressTemplates,fillProgressTemplate}from'./progress-templates.js';import{PROGRESS_RISK_VERSION,assessProgressRisks,getAllProgressRiskRules}from'./progress-risk.js';import{ARBITRATION_LEDGER_VERSION,ARBITRATION_SCENES,ARBITRATION_PERMISSIONS as a196aY,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,getScenesByCategory as a196aZ,findSceneById as a196b0,findSceneByPermissionIndex as a196b1,getPermissionByIndex as a196b2,getPermissionByName as a196b3,isReservedIndex as a196b4,isUsedPermissionIndex as a196b5,getActivePermissionCount as a196b6,inferSceneFromIntent as a196b7,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,getScenesProducingStatus as a196b8,getScenesRequiringStatus as a196b9,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions}from'./arbitration-ledger.js';import{initPuzzleFromIntent as a196ba,checkPuzzleCompleteness as a196bb,validateConstraints as a196bc,generateConfirmationText as a196bd}from'./arbitration-puzzle.js';import{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,getAllTemplates as a196be,getTemplateById as a196bf,getTemplatesByScene as a196bg,getTemplatesByIndustry as a196bh,suggestTemplateForScene as a196bi,listTemplates as a196bj,fillTemplate as a196bk}from'./arbitration-templates.js';import{ARBITRATION_RISK_VERSION,assessArbitrationRisks,getAllRiskRules as a196bl}from'./arbitration-risk.js';import{REWARD_LEDGER_VERSION,REWARD_SCENES,REWARD_PERMISSIONS,REWARD_FIELDS,REWARD_GUARD_CONSTRUCTORS,REWARD_ERROR_CODES,REWARD_CROSS_OBJECT_REFS,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,getScenesByPhase as a196bm,findSceneById as a196bn,getScenesByIndustry as a196bo,getBuiltinPermissionByIndex as a196bp,isRewardBuiltinPermission,getAllBuiltinPermissions as a196bq,getRewardScenesCount,getGuardConstructorSpec as a196br,resolveGuardConstructor as a196bs,getRewardErrorByCode,getRewardErrorByName,validateGuardCount as a196bt,validateRecordCount as a196bu,inferSceneFromIntent as a196bv}from'./reward-ledger.js';import{REWARD_FIELD_MUTABILITY,initPuzzleFromIntent as a196bw,checkPuzzleCompleteness as a196bx,validateConstraints as a196by,generateConfirmationText as a196bz,resolveBuiltinPermission as a196bA,requiresGuardConfig as a196bB,requiresPassport as a196bC,getRelevantDimensions as a196bD,getFieldMutability as a196bE,isAdminMutableField as a196bF,getFieldPermissionIndex as a196bG}from'./reward-puzzle.js';import{REWARD_RISK_VERSION,assessRewardRisks,getAllRewardRiskRules}from'./reward-risk.js';import{PASSPORT_LEDGER_VERSION,PASSPORT_ERROR_CODES,PASSPORT_SCENARIOS,MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT,getAllScenarios as a196bH,getScenariosCount as a196bI,findScenarioById as a196bJ,getScenariosByConsumer as a196bK,getScenariosUsingRelies as a196bL,inferScenarioFromIntent as a196bM,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,getErrorName as a196bN,getErrorDescription as a196bO}from'./passport-ledger.js';import{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,getAllTemplates as a196bP,getTemplateById as a196bQ,getTemplatesByScenario as a196bR,getTemplatesByIndustry as a196bS,suggestTemplateForScenario as a196bT,listTemplates as a196bU,fillTemplate as a196bV}from'./passport-templates.js';import{PROOF_RISK_RULES,checkProofRisks}from'./proof-risk.js';import{REPOSITORY_RISK_RULES,checkRepositoryRisks,parseIdFromForRiskCheck}from'./repository-risk.js';import{DEMAND_RISK_RULES,checkDemandRisks}from'./demand-risk.js';import{CONTACT_RISK_RULES,CONTACT_RISK_VERSION,checkContactRisks}from'./contact-risk.js';import{RESOURCE_RISK_RULES,RESOURCE_RISK_VERSION,checkResourceRisks}from'./resource-risk.js';import{PAYMENT_RISK_RULES,PAYMENT_RISK_VERSION,checkPaymentRisks}from'./payment-risk.js';import{ARB_RISK_RULES,ARB_RISK_VERSION,checkArbRisks}from'./arb-risk.js';import{PERSONAL_RISK_RULES,PERSONAL_RISK_VERSION,checkPersonalRisks}from'./personal-risk.js';import{UTIL_RISK_RULES,UTIL_RISK_VERSION,checkUtilRisks}from'./util-risk.js';import{REGISTRAR_RISK_RULES,REGISTRAR_RISK_VERSION,checkRegistrarRisks}from'./registrar-risk.js';import{BRIDGE_RISK_RULES,BRIDGE_RISK_VERSION,checkBridgeRisks}from'./bridge-risk.js';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'./tools-reference.js';import{SCENARIO_MODES,SCENARIO_MODES_VERSION,MODE_COMPOSITIONS,matchScenarioMode,inferScenarioTraits,getScenarioMode,listScenarioModes,getShippedModes,getModeCompositions}from'./scenario-modes.js';import{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION,getBuiltinTemplate,listBuiltinTemplates,TEMPLATE_KEYWORDS}from'./builtin-templates.js';import{resolveTemplatesDir,seedBuiltinTemplates,reloadTemplates,listTemplates,getTemplate,getTemplatesByIndustry as a196bW,parseTemplateFile,renderTemplateFile,loadAndValidate,TemplateFrontmatterSchema}from'./template-loader.js';import{scanTemplate}from'./template-scanner.js';import{GUARD_DESIGN_PATTERNS,GUARD_DESIGN_PATTERNS_VERSION,VERIFIER_LEVEL_GUIDANCE,getGuardDesignPattern,searchGuardDesignPatterns,getPatternsByHost,getPatternsByIndustry,getPatternsByDataSourceClass,getVerifierLevelGuidance,suggestPatternForRequirement}from'./guard-design-patterns.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules};export{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations};export{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate};export{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings};export{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION};export{buildReviewRepositorySetup,computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION};export{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION};export{STRATEGY_MANUAL_FILENAME,STRATEGY_MANUAL_VERSION,renderStrategyManual,parseManualSentinel,classifyManualFile,getBuiltinStrategyManual,listBuiltinStrategyManualIndustries}from'./strategy-manuals.js';export{INDUSTRY_STRATEGIES,getIndustryStrategy,listIndustryStrategies,registerIndustryStrategy,unregisterIndustryStrategy,recommendStrategy,stageFromOrderCount,validateStrategyLevers}from'./industry-strategy.js';export{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,listIndustries as listRegistryIndustries,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames};export{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries};export{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline};export{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext};export{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole};export{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes};export{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory};export{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP};export{runGuardRulePack,assembleGuardAssessment,evaluateGuardDraft,getRiskRulesCount,GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams,GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding,SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects,lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult};export{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,a196a as findMachineScene,a196b as getMachineScenesByIndustry,getScenesByPattern,inferSceneFromFlow};export{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,a196c as getAllMachineTemplates,a196d as getMachineTemplateById,a196e as getMachineTemplatesByScene,a196f as getMachineTemplatesByIndustry,suggestTemplateForIntent,walkDecisionTree,a196g as fillMachineTemplate,a196h as forkMachineTemplate,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds};export{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,a196i as matchMachinePattern,identifyExecutionMode,identifyTopology,explainForwardPermission,a196j as getMachineConstraintsByCategory,getConstraintById,a196k as getOnChainMachineConstraints,a196l as getOffChainMachineConstraints};export{MACHINE_RISK_RULES,MACHINE_RISK_VERSION,assessMachineRisks};export{analyzeTopology,identifyTopologyPattern,formatTopologySummary,MACHINE_TOPOLOGY_VERSION,MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT};export{a196m as initMachinePuzzleFromIntent,initPuzzleFromTemplate,a196n as checkMachinePuzzleCompleteness,a196o as recommendMachineNextStep,derivePuzzleFromMachineJson,a196p as generateMachineConfirmationText,MACHINE_PUZZLE_VERSION};export{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,a196q as getServiceScenesByCategory,a196r as findServiceSceneById,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,a196s as inferServiceSceneFromIntent,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,a196t as getServiceCrossObjectBindings};export{a196u as initServicePuzzleFromIntent,a196v as checkServicePuzzleCompleteness,a196w as validateServiceConstraints,a196x as generateServicePuzzleConfirmationText,initOrderFlowPuzzle,checkOrderFlowCompleteness};export{SERVICE_RISK_VERSION,assessServiceRisks,getAllServiceRiskRules};export{SERVICE_TEMPLATES,SERVICE_TEMPLATES_VERSION,getServiceTemplateById,getServiceTemplatesByScene,getServiceTemplatesByIndustry,suggestServiceTemplateForScene,listServiceTemplates,fillServiceTemplate,getAllServiceTemplates};export{ALLOCATION_SCENES,ALLOCATION_LEDGER_VERSION,MAX_ALLOCATOR_COUNT,ALLOCATION_MAX_SHARING_COUNT,ALLOCATION_MODE_AMOUNT,ALLOCATION_MODE_RATE,ALLOCATION_MODE_SURPLUS,RATE_TOTAL_FULL,ALLOCATION_ERROR_CODES,a196y as getAllocationScenesByTriggerSource,a196z as getAllocationScenesByMode,a196A as getAllocationScenesByStrategy,a196B as findAllocationSceneById,a196C as inferAllocationSceneFromIntent,a196D as getAllAllocationScenes,a196E as getAllocationScenesCount,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,a196F as getAllocationErrorName,a196G as getAllocationErrorDescription};export{a196H as initAllocationPuzzleFromIntent,a196I as checkAllocationPuzzleCompleteness,a196J as validateAllocationConstraints,a196K as generateAllocationPuzzleConfirmationText,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION};export{ALLOCATION_RISK_VERSION,assessAllocationRisks,a196L as getAllAllocationRiskRules};export{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,a196M as getAllAllocationTemplates,a196N as getAllocationTemplateById,a196O as getAllocationTemplatesByScene,a196P as getAllocationTemplatesByIndustry,a196Q as suggestAllocationTemplateForScene,a196R as listAllocationTemplates,a196S as fillAllocationTemplate};export{RECIPIENT_CONSTRAINT_VERSION,classifyRecipient,analyzeRecipientConstraints,isUnboundSignerTheft,canonicalDoctrine,recipientDesignGuidance,derivePayoffFromSharing,OBJECT_DRIVEABILITY,driveabilityOf,RECIPIENT_DESIGN_OPTIONS};export{paymentRelations,scanRecentPaymentEvents,resolveBeneficialOwners,extractionPlanForHolder,pendingWrappersAt,trackAccountPayments};export{TREASURY_LEDGER_VERSION,TREASURY_SCENES,a196T as TREASURY_BUILTIN_PERMISSIONS,a196U as getTreasuryScenesByHostObject,a196V as findTreasurySceneById,a196W as findTreasurySceneByPermissionIndex,a196X as getTreasuryBuiltinPermissionByIndex,isBuiltinTreasuryPermission,a196Y as getActiveTreasuryBuiltinPermissions,a196Z as getReservedTreasuryBuiltinPermissions,a196a0 as inferTreasurySceneFromIntent,getTreasuryScenesCount,a196a1 as getTreasuryGovernedOperationsForPermissionIndex};export{a196a2 as initTreasuryPuzzleFromIntent,a196a3 as checkTreasuryPuzzleCompleteness,a196a4 as validateTreasuryConstraints,a196a5 as generateTreasuryPuzzleConfirmationText,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,a196a6 as TREASURY_MAX_DESCRIPTION_LENGTH};export{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,a196a7 as getTreasuryTemplateById,a196a8 as getTreasuryTemplatesByScene,a196a9 as getTreasuryTemplatesByIndustry,a196aa as suggestTreasuryTemplateForScene,a196ab as listTreasuryTemplates,a196ac as fillTreasuryTemplate};export{TREASURY_RISK_VERSION,assessTreasuryRisks,getAllTreasuryRiskRules};export{ORDER_LEDGER_VERSION,ORDER_SCENES,ORDER_FIELDS,ORDER_STATES,ORDER_STATE_TRANSITIONS,ORDER_LIFECYCLE_EVENTS,ORDER_PERMISSION_MATRIX,ORDER_AUDIT_FORMULAS,a196ad as getOrderScenesByOperationField,a196ae as findOrderSceneById,a196af as findOrderSceneByMoveEntry,a196ag as getOrderScenesByPermissionLayer,a196ah as getOrderScenesByReversibility,a196ai as getOrderFieldDef,a196aj as getOrderMutableFields,a196ak as getOrderImmutableFields,a196al as getOrderFrozenAfterProgressFields,a196am as getOrderOneTimeSetFields,a196an as inferOrderSceneFromIntent,a196ao as getOrderEmittedEvents,a196ap as getOrderInferredEvents,getOrderScenesCount,a196aq as sdkToMoveOrderField,a196ar as moveToSdkOrderField};export{a196as as initOrderPuzzleFromIntent,a196at as checkOrderPuzzleCompleteness,a196au as validateOrderConstraints,a196av as generateOrderPuzzleConfirmationText,a196aw as verifyOrderSnapshotMechanism,a196ax as inferOrderLifecyclePhase,a196ay as matchOrderSceneFromPuzzle,a196az as listAllOrderScenes,a196aA as lookupOrderScene};export{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,a196aB as getOrderTemplateById,a196aC as getOrderTemplatesByScene,a196aD as getOrderTemplatesByIndustry,a196aE as getOrderTemplatesByPermissionLayer,a196aF as getIrreversibleOrderTemplates,a196aG as suggestOrderTemplateForScene,listOrderTemplates,a196aH as fillOrderTemplate,a196aI as suggestOrderTemplateFromIntent,a196aJ as getOrderTemplateParameters,a196aK as validateOrderTemplateParams};export{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules};export{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,a196aL as PROGRESS_BUILTIN_PERMISSIONS,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,a196aM as getProgressScenesByPhase,a196aN as findProgressSceneById,a196aO as getProgressScenesByIndustry,a196aP as getProgressBuiltinPermissionByIndex,isProgressBuiltinPermission,a196aQ as inferProgressSceneFromIntent,a196aR as getAllProgressBuiltinPermissions,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount};export{a196aS as initProgressPuzzleFromIntent,a196aT as checkProgressPuzzleCompleteness,a196aU as validateProgressConstraints,a196aV as generateProgressPuzzleConfirmationText,a196aW as resolveProgressBuiltinPermission,isOrderHolderForward,a196aX as getProgressRelevantDimensions};export{PROGRESS_TEMPLATES,PROGRESS_TEMPLATES_VERSION,getAllProgressTemplates,getProgressTemplateById,getProgressTemplatesByScene,getProgressTemplatesByIndustry,suggestProgressTemplateForScene,listProgressTemplates,fillProgressTemplate};export{PROGRESS_RISK_VERSION,assessProgressRisks,getAllProgressRiskRules};export{ARBITRATION_LEDGER_VERSION,ARBITRATION_SCENES,a196aY as ARBITRATION_BUILTIN_PERMISSIONS,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,a196aZ as getArbitrationScenesByCategory,a196b0 as findArbitrationSceneById,a196b1 as findArbitrationSceneByPermissionIndex,a196b2 as getArbitrationPermissionByIndex,a196b3 as getArbitrationPermissionByName,a196b4 as isArbitrationReservedIndex,a196b5 as isArbitrationUsedPermissionIndex,a196b6 as getArbitrationActivePermissionCount,a196b7 as inferArbitrationSceneFromIntent,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,a196b8 as getArbitrationScenesProducingStatus,a196b9 as getArbitrationScenesRequiringStatus,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions};export{a196ba as initArbitrationPuzzleFromIntent,a196bb as checkArbitrationPuzzleCompleteness,a196bc as validateArbitrationConstraints,a196bd as generateArbitrationPuzzleConfirmationText};export{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,a196be as getAllArbitrationTemplates,a196bf as getArbitrationTemplateById,a196bg as getArbitrationTemplatesByScene,a196bh as getArbitrationTemplatesByIndustry,a196bi as suggestArbitrationTemplateForScene,a196bj as listArbitrationTemplates,a196bk as fillArbitrationTemplate};export{ARBITRATION_RISK_VERSION,assessArbitrationRisks,a196bl as getAllArbitrationRiskRules};export{REWARD_LEDGER_VERSION,REWARD_SCENES,REWARD_PERMISSIONS,REWARD_FIELDS,REWARD_GUARD_CONSTRUCTORS,REWARD_ERROR_CODES,REWARD_CROSS_OBJECT_REFS,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,a196bm as getRewardScenesByPhase,a196bn as findRewardSceneById,a196bo as getRewardScenesByIndustry,a196bp as getRewardBuiltinPermissionByIndex,isRewardBuiltinPermission,a196bq as getAllRewardBuiltinPermissions,getRewardScenesCount,a196br as getRewardGuardConstructorSpec,a196bs as resolveRewardGuardConstructor,getRewardErrorByCode,getRewardErrorByName,a196bt as validateRewardGuardCount,a196bu as validateRewardRecordCount,a196bv as inferRewardSceneFromIntent};export{REWARD_FIELD_MUTABILITY,a196bw as initRewardPuzzleFromIntent,a196bx as checkRewardPuzzleCompleteness,a196by as validateRewardConstraints,a196bz as generateRewardPuzzleConfirmationText,a196bA as resolveRewardBuiltinPermission,a196bB as requiresRewardGuardConfig,a196bC as requiresRewardPassport,a196bD as getRewardRelevantDimensions,a196bE as getRewardFieldMutability,a196bF as isRewardAdminMutableField,a196bG as getRewardFieldPermissionIndex};export{REWARD_RISK_VERSION,assessRewardRisks,getAllRewardRiskRules};export{PASSPORT_LEDGER_VERSION,PASSPORT_ERROR_CODES,PASSPORT_SCENARIOS,MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT,a196bH as getAllPassportScenarios,a196bI as getPassportScenesCount,a196bJ as findPassportScenarioById,a196bK as getPassportScenariosByConsumer,a196bL as getPassportScenariosUsingRelies,a196bM as inferPassportScenarioFromIntent,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,a196bN as getPassportErrorName,a196bO as getPassportErrorDescription};export{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,a196bP as getAllPassportTemplates,a196bQ as getPassportTemplateById,a196bR as getPassportTemplatesByScenario,a196bS as getPassportTemplatesByIndustry,a196bT as suggestPassportTemplateForScenario,a196bU as listPassportTemplates,a196bV as fillPassportTemplate};export{PROOF_RISK_RULES,checkProofRisks};export{REPOSITORY_RISK_RULES,checkRepositoryRisks,parseIdFromForRiskCheck};export{assessEvidenceReview,reviewEvidenceList}from'./evidence-review.js';export{DEMAND_RISK_RULES,checkDemandRisks};export{CONTACT_RISK_RULES,CONTACT_RISK_VERSION,checkContactRisks};export{RESOURCE_RISK_RULES,RESOURCE_RISK_VERSION,checkResourceRisks};export{PAYMENT_RISK_RULES,PAYMENT_RISK_VERSION,checkPaymentRisks};export{ARB_RISK_RULES,ARB_RISK_VERSION,checkArbRisks};export{PERSONAL_RISK_RULES,PERSONAL_RISK_VERSION,checkPersonalRisks};export{UTIL_RISK_RULES,UTIL_RISK_VERSION,checkUtilRisks};export{REGISTRAR_RISK_RULES,REGISTRAR_RISK_VERSION,checkRegistrarRisks};export{BRIDGE_RISK_RULES,BRIDGE_RISK_VERSION,checkBridgeRisks};export{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence};export{SCENARIO_MODES,SCENARIO_MODES_VERSION,MODE_COMPOSITIONS,matchScenarioMode,inferScenarioTraits,getScenarioMode,listScenarioModes,getShippedModes,getModeCompositions};export{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION,getBuiltinTemplate,listBuiltinTemplates,TEMPLATE_KEYWORDS};export{resolveTemplatesDir,seedBuiltinTemplates,reloadTemplates,listTemplates,getTemplate,a196bW as getIndustryTemplates,parseTemplateFile,renderTemplateFile,loadAndValidate,TemplateFrontmatterSchema};export{scanTemplate};export{GUARD_DESIGN_PATTERNS,GUARD_DESIGN_PATTERNS_VERSION,VERIFIER_LEVEL_GUIDANCE,getGuardDesignPattern,searchGuardDesignPatterns,getPatternsByHost,getPatternsByIndustry,getPatternsByDataSourceClass,getVerifierLevelGuidance,suggestPatternForRequirement};export function getKnowledgeBase(){return{'version':{'safety':SAFETY_RULES_VERSION,'tool_constraints':TOOL_CONSTRAINTS_VERSION,'reward_templates':REWARD_TEMPLATES_VERSION,'audit_rules':AUDIT_RULES_VERSION,'dynamic_pricing':DYNAMIC_PRICING_VERSION,'reputation_rules':REPUTATION_RULES_VERSION,'acquisition_flywheel':ACQUISITION_FLYWHEEL_VERSION,'industry_registry':INDUSTRY_REGISTRY_VERSION,'flywheel_loop':FLYWHEEL_LOOP_VERSION,'machine_ledger':MACHINE_LEDGER_VERSION,'machine_templates':MACHINE_TEMPLATES_VERSION,'machine_translation':MACHINE_TRANSLATION_VERSION,'machine_risk':MACHINE_RISK_VERSION,'machine_topology':MACHINE_TOPOLOGY_VERSION,'machine_puzzle':MACHINE_PUZZLE_VERSION,'service_ledger':SERVICE_LEDGER_VERSION,'service_risk':SERVICE_RISK_VERSION,'service_templates':SERVICE_TEMPLATES_VERSION,'allocation_ledger':ALLOCATION_LEDGER_VERSION,'allocation_puzzle':ALLOCATION_PUZZLE_VERSION,'allocation_risk':ALLOCATION_RISK_VERSION,'allocation_templates':ALLOCATION_TEMPLATES_VERSION,'treasury_ledger':TREASURY_LEDGER_VERSION,'treasury_templates':TREASURY_TEMPLATES_VERSION,'treasury_risk':TREASURY_RISK_VERSION,'order_ledger':ORDER_LEDGER_VERSION,'order_templates':ORDER_TEMPLATES_VERSION,'order_risk':ORDER_RISK_VERSION,'progress_ledger':PROGRESS_LEDGER_VERSION,'progress_templates':PROGRESS_TEMPLATES_VERSION,'progress_risk':PROGRESS_RISK_VERSION,'arbitration_ledger':ARBITRATION_LEDGER_VERSION,'arbitration_templates':ARBITRATION_TEMPLATES_VERSION,'arbitration_risk':ARBITRATION_RISK_VERSION,'reward_ledger':REWARD_LEDGER_VERSION,'reward_risk':REWARD_RISK_VERSION,'passport_ledger':PASSPORT_LEDGER_VERSION,'passport_templates':PASSPORT_TEMPLATES_VERSION,'contact_risk':CONTACT_RISK_VERSION,'resource_risk':RESOURCE_RISK_VERSION,'payment_risk':PAYMENT_RISK_VERSION,'arb_risk':ARB_RISK_VERSION,'personal_risk':PERSONAL_RISK_VERSION,'util_risk':UTIL_RISK_VERSION,'registrar_risk':REGISTRAR_RISK_VERSION,'bridge_risk':BRIDGE_RISK_VERSION,'scenario_modes':SCENARIO_MODES_VERSION,'guard_design_patterns':GUARD_DESIGN_PATTERNS_VERSION,'builtin_templates':BUILTIN_TEMPLATES_VERSION},'confirmation_rules':CONFIRMATION_RULES['length'],'confirmation_rule_ids':CONFIRMATION_RULES['map'](a=>a['id']),'tool_constraints_count':TOOL_CONSTRAINTS['length'],'reward_templates_count':REWARD_TEMPLATES['length'],'audit_rules_count':AUDIT_RULES['length'],'mutable_fields_count':MUTABLE_FIELDS['length'],'industry_flywheels_count':INDUSTRY_FLYWHEELS['length'],'industry_registry_count':getRegistrySize(),'intent_count':listIntents()['length'],'guard_scenes_count':GUARD_SCENES['length'],'guard_semantic_rules_count':SEMANTIC_TO_SCHEMA_RULES['length'],'guard_schema_rules_count':SCHEMA_TO_SEMANTIC_RULES['length'],'guard_constraint_rules_count':GUARD_CONSTRAINT_RULES['length'],'guard_risk_rules_count':getRiskRulesCount(),'guard_templates_count':GUARD_TEMPLATES_COUNT,'guard_lint_enabled':!![],'machine_scenes_count':MACHINE_SCENES_COUNT,'machine_templates_count':MACHINE_TEMPLATES['length'],'machine_patterns_count':SEMANTIC_TO_MACHINE_RULES['length'],'machine_constraint_rules_count':MACHINE_CONSTRAINT_RULES['length'],'machine_risk_rules_count':MACHINE_RISK_RULES['length'],'machine_on_chain_limits':{'max_node_count':MAX_NODE_COUNT,'max_node_pair_count':MAX_NODE_PAIR_COUNT,'max_forward_count':MAX_FORWARD_COUNT},'service_scenes_count':SERVICE_SCENES['length'],'service_permissions_count':SERVICE_PERMISSIONS['length'],'service_order_flow_stages_count':SERVICE_ORDER_FLOW_STAGES['length'],'service_cross_object_bindings_count':SERVICE_CROSS_OBJECT_BINDINGS['length'],'service_risk_rules_count':getAllServiceRiskRules()['length'],'service_templates_count':SERVICE_TEMPLATES['length'],'service_context_enabled':!![],'allocation_scenes_count':ALLOCATION_SCENES['length'],'allocation_risk_rules_count':a196L()['length'],'allocation_templates_count':ALLOCATION_TEMPLATES['length'],'allocation_context_enabled':!![],'treasury_scenes_count':TREASURY_SCENES['length'],'treasury_builtin_permissions_count':a196T['length'],'treasury_risk_rules_count':getAllTreasuryRiskRules()['length'],'treasury_templates_count':TREASURY_TEMPLATES['length'],'treasury_context_enabled':!![],'order_scenes_count':ORDER_SCENES['length'],'order_fields_count':ORDER_FIELDS['length'],'order_states_count':ORDER_STATES['length'],'order_lifecycle_events_count':ORDER_LIFECYCLE_EVENTS['length'],'order_risk_rules_count':getAllOrderRiskRules()['length'],'order_templates_count':ORDER_TEMPLATES['length'],'order_context_enabled':!![],'progress_scenes_count':PROGRESS_SCENES['length'],'progress_builtin_permissions_count':a196aL['length'],'progress_risk_rules_count':getAllProgressRiskRules()['length'],'progress_templates_count':PROGRESS_TEMPLATES['length'],'progress_context_enabled':!![],'arbitration_scenes_count':ARBITRATION_SCENES['length'],'arbitration_builtin_permissions_count':a196aY['length'],'arbitration_risk_rules_count':a196bl()['length'],'arbitration_templates_count':ARBITRATION_TEMPLATES['length'],'arbitration_context_enabled':!![],'reward_scenes_count':REWARD_SCENES['length'],'reward_builtin_permissions_count':REWARD_PERMISSIONS['length'],'reward_fields_count':REWARD_FIELDS['length'],'reward_guard_constructors_count':REWARD_GUARD_CONSTRUCTORS['length'],'reward_error_codes_count':REWARD_ERROR_CODES['length'],'reward_risk_rules_count':getAllRewardRiskRules()['length'],'reward_context_enabled':!![],'passport_scenarios_count':PASSPORT_SCENARIOS['length'],'passport_max_guard_count':MAX_GUARD_COUNT_PASSPORT,'passport_max_submission_size':MAX_SUBMISSION_SIZE_PASSPORT,'passport_templates_count':PASSPORT_TEMPLATES['length'],'passport_context_enabled':!![],'proof_risk_rules_count':PROOF_RISK_RULES['length'],'repository_risk_rules_count':REPOSITORY_RISK_RULES['length'],'demand_risk_rules_count':DEMAND_RISK_RULES['length'],'contact_risk_rules_count':CONTACT_RISK_RULES['length'],'resource_risk_rules_count':RESOURCE_RISK_RULES['length'],'payment_risk_rules_count':PAYMENT_RISK_RULES['length'],'arb_risk_rules_count':ARB_RISK_RULES['length'],'personal_risk_rules_count':PERSONAL_RISK_RULES['length'],'util_risk_rules_count':UTIL_RISK_RULES['length'],'registrar_risk_rules_count':REGISTRAR_RISK_RULES['length'],'bridge_risk_rules_count':BRIDGE_RISK_RULES['length'],'tools_reference_count':TOOLS_REFERENCE['length'],'scenario_modes_count':SCENARIO_MODES['length'],'scenario_mode_compositions_count':MODE_COMPOSITIONS['length'],'builtin_templates_count':BUILTIN_TEMPLATES['length'],'guard_design_patterns_count':GUARD_DESIGN_PATTERNS['length'],'verifier_level_guidance_count':VERIFIER_LEVEL_GUIDANCE['length']};}export{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind};export{buildWorkspaceLists}from'./workspace-lists.js';export{resolveSupplyChainGraph}from'./supply-chain.js';export{enumerateObjectOperations,operationCategoryOf,operationComplexityOf,isPermissionIndexType}from'./operation-dictionary.js';export{enumerateServices,enumerateDemands,enumerateArbs}from'./jsonrpc-enum.js';export{FIELD_MUTABILITY_RULES,LOCK_CONSTRAINTS,IRREVERSIBLE_OPERATIONS,STATE_MACHINE_TERMINALS,NUMERIC_LIMIT_CONSTRAINTS,EXTERNAL_ACCESS_MECHANISMS,fieldMutabilityOf,isActionForbidden,lockConstraintOf,numericLimitOf,externalAccessOf}from'./contract-invariants.js';export{GUARD_FIELD_COGNITION_VERSION,GUARD_FIELD_SITES,VALUE_ORIGIN_SEMANTICS,GUARD_PASSPORT_DOCTRINE,guardSitesFor,guardCognitionDoctrine,REPOSITORY_WRITE_ROUTE_MATRIX,repositoryRouteSlotConflicts}from'./guard-field-cognition.js';
|
|
1
|
+
import{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind}from'./workflow-guidance.js';import{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules}from'./safety-rules.js';import{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations}from'./tool-constraints.js';import{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate}from'./reward-templates.js';import{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./audit-rules.js';import{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION}from'./dynamic-pricing.js';import{computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION}from'./reputation-rules.js';import{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION}from'./acquisition-flywheel.js';import{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames}from'./industry-registry.js';import{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries}from'./industry-generalizer.js';import{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline}from'./industry-evolution.js';import{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext}from'./flywheel-loop.js';import{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole}from'./intent-metrics.js';import{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes}from'./guard-ledger.js';import{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory}from'./guard-translation.js';import{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP}from'./guard-puzzle.js';import{runGuardRulePack,assembleGuardAssessment,getRiskRulesCount}from'./guard-risk.js';import{evaluateGuardDraft}from'./guard-eval.js';import{GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding}from'./guard-bindings.js';import{SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects}from'./scenario-topology.js';import{GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams}from'./guard-templates.js';import{lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult}from'./guard-lint.js';import{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,findScene as a200a,getScenesByIndustry as a200b,getScenesByPattern,inferSceneFromFlow}from'./machine-ledger.js';import{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,getAllTemplates as a200c,getTemplateById as a200d,getTemplatesByScene as a200e,getTemplatesByIndustry as a200f,suggestTemplateForIntent,walkDecisionTree,fillTemplate as a200g,forkTemplate as a200h,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds}from'./machine-templates.js';import{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,matchSemanticPattern as a200i,identifyExecutionMode,identifyTopology,explainForwardPermission,getConstraintsByCategory as a200j,getConstraintById,getOnChainConstraints as a200k,getOffChainConstraints as a200l}from'./machine-translation.js';import{MACHINE_RISK_RULES,MACHINE_RISK_VERSION,assessMachineRisks}from'./machine-risk.js';import{analyzeTopology,identifyTopologyPattern,formatTopologySummary,MACHINE_TOPOLOGY_VERSION,MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT}from'./machine-topology.js';import{initPuzzleFromIntent as a200m,initPuzzleFromTemplate,checkPuzzleCompleteness as a200n,recommendNextStep as a200o,derivePuzzleFromMachineJson,generateConfirmationText as a200p,MACHINE_PUZZLE_VERSION}from'./machine-puzzle.js';import{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,getScenesByCategory as a200q,findSceneById as a200r,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,inferSceneFromIntent as a200s,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,getCrossObjectBindings as a200t}from'./service-ledger.js';import{initPuzzleFromIntent as a200u,checkPuzzleCompleteness as a200v,validateConstraints as a200w,generateConfirmationText as a200x,initOrderFlowPuzzle,checkOrderFlowCompleteness}from'./service-puzzle.js';import{SERVICE_RISK_VERSION,assessServiceRisks,getAllServiceRiskRules}from'./service-risk.js';import{SERVICE_TEMPLATES,SERVICE_TEMPLATES_VERSION,getServiceTemplateById,getServiceTemplatesByScene,getServiceTemplatesByIndustry,suggestServiceTemplateForScene,listServiceTemplates,fillServiceTemplate,getAllServiceTemplates}from'./service-templates.js';import{ALLOCATION_SCENES,ALLOCATION_LEDGER_VERSION,MAX_ALLOCATOR_COUNT,ALLOCATION_MAX_SHARING_COUNT,ALLOCATION_MODE_AMOUNT,ALLOCATION_MODE_RATE,ALLOCATION_MODE_SURPLUS,RATE_TOTAL_FULL,ALLOCATION_ERROR_CODES,getScenesByTriggerSource as a200y,getScenesByMode as a200z,getScenesByStrategy as a200A,findSceneById as a200B,inferSceneFromIntent as a200C,getAllScenes as a200D,getScenesCount as a200E,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,getErrorName as a200F,getErrorDescription as a200G}from'./allocation-ledger.js';import{initPuzzleFromIntent as a200H,checkPuzzleCompleteness as a200I,validateConstraints as a200J,generateConfirmationText as a200K,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION}from'./allocation-puzzle.js';import{ALLOCATION_RISK_VERSION,assessAllocationRisks,getAllRiskRules as a200L}from'./allocation-risk.js';import{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,getAllTemplates as a200M,getTemplateById as a200N,getTemplatesByScene as a200O,getTemplatesByIndustry as a200P,suggestTemplateForScene as a200Q,listTemplates as a200R,fillTemplate as a200S}from'./allocation-templates.js';import{RECIPIENT_CONSTRAINT_VERSION,classifyRecipient,analyzeRecipientConstraints,isUnboundSignerTheft,canonicalDoctrine,recipientDesignGuidance,derivePayoffFromSharing,OBJECT_DRIVEABILITY,driveabilityOf,RECIPIENT_DESIGN_OPTIONS}from'./recipient-constraint.js';import{paymentRelations,scanRecentPaymentEvents,resolveBeneficialOwners,extractionPlanForHolder,pendingWrappersAt,trackAccountPayments}from'./payment-tracker.js';import{TREASURY_LEDGER_VERSION,TREASURY_SCENES,TREASURY_PERMISSIONS as a200T,getScenesByHostObject as a200U,findSceneById as a200V,findSceneByPermissionIndex as a200W,getBuiltinPermissionByIndex as a200X,isBuiltinTreasuryPermission,getActiveBuiltinPermissions as a200Y,getReservedBuiltinPermissions as a200Z,inferSceneFromIntent as a200a0,getTreasuryScenesCount,getGovernedOperationsForPermissionIndex as a200a1}from'./treasury-ledger.js';import{initPuzzleFromIntent as a200a2,checkPuzzleCompleteness as a200a3,validateConstraints as a200a4,generateConfirmationText as a200a5,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,MAX_DESCRIPTION_LENGTH as a200a6}from'./treasury-puzzle.js';import{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,getTemplateById as a200a7,getTemplatesByScene as a200a8,getTemplatesByIndustry as a200a9,suggestTemplateForScene as a200aa,listTemplates as a200ab,fillTemplate as a200ac}from'./treasury-templates.js';import{TREASURY_RISK_VERSION,assessTreasuryRisks,getAllTreasuryRiskRules}from'./treasury-risk.js';import{ORDER_LEDGER_VERSION,ORDER_SCENES,ORDER_FIELDS,ORDER_STATES,ORDER_STATE_TRANSITIONS,ORDER_LIFECYCLE_EVENTS,ORDER_PERMISSION_MATRIX,ORDER_AUDIT_FORMULAS,getScenesByOperationField as a200ad,findSceneById as a200ae,findSceneByMoveEntry as a200af,getScenesByPermissionLayer as a200ag,getScenesByReversibility as a200ah,getFieldDef as a200ai,getMutableFields as a200aj,getImmutableFields as a200ak,getFrozenAfterProgressFields as a200al,getOneTimeSetFields as a200am,inferSceneFromIntent as a200an,getEmittedEvents as a200ao,getInferredEvents as a200ap,getOrderScenesCount,sdkToMoveField as a200aq,moveToSdkField as a200ar}from'./order-ledger.js';import{initPuzzleFromIntent as a200as,checkPuzzleCompleteness as a200at,validateConstraints as a200au,generateConfirmationText as a200av,verifySnapshotMechanism as a200aw,inferLifecyclePhase as a200ax,matchSceneFromPuzzle as a200ay,listAllScenes as a200az,lookupScene as a200aA}from'./order-puzzle.js';import{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,getTemplateById as a200aB,getTemplatesByScene as a200aC,getTemplatesByIndustry as a200aD,getTemplatesByPermissionLayer as a200aE,getIrreversibleTemplates as a200aF,suggestTemplateForScene as a200aG,listOrderTemplates,fillTemplate as a200aH,suggestTemplateFromIntent as a200aI,getTemplateParameters as a200aJ,validateTemplateParams as a200aK}from'./order-templates.js';import{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules}from'./order-risk.js';import{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,PROGRESS_PERMISSIONS as a200aL,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,getScenesByPhase as a200aM,findSceneById as a200aN,getScenesByIndustry as a200aO,getBuiltinPermissionByIndex as a200aP,isProgressBuiltinPermission,inferSceneFromIntent as a200aQ,getAllBuiltinPermissions as a200aR,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount}from'./progress-ledger.js';import{initPuzzleFromIntent as a200aS,checkPuzzleCompleteness as a200aT,validateConstraints as a200aU,generateConfirmationText as a200aV,resolveBuiltinPermission as a200aW,isOrderHolderForward,getRelevantDimensions as a200aX}from'./progress-puzzle.js';import{PROGRESS_TEMPLATES,PROGRESS_TEMPLATES_VERSION,getAllProgressTemplates,getProgressTemplateById,getProgressTemplatesByScene,getProgressTemplatesByIndustry,suggestProgressTemplateForScene,listProgressTemplates,fillProgressTemplate}from'./progress-templates.js';import{PROGRESS_RISK_VERSION,assessProgressRisks,getAllProgressRiskRules}from'./progress-risk.js';import{ARBITRATION_LEDGER_VERSION,ARBITRATION_SCENES,ARBITRATION_PERMISSIONS as a200aY,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,getScenesByCategory as a200aZ,findSceneById as a200b0,findSceneByPermissionIndex as a200b1,getPermissionByIndex as a200b2,getPermissionByName as a200b3,isReservedIndex as a200b4,isUsedPermissionIndex as a200b5,getActivePermissionCount as a200b6,inferSceneFromIntent as a200b7,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,getScenesProducingStatus as a200b8,getScenesRequiringStatus as a200b9,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions}from'./arbitration-ledger.js';import{initPuzzleFromIntent as a200ba,checkPuzzleCompleteness as a200bb,validateConstraints as a200bc,generateConfirmationText as a200bd}from'./arbitration-puzzle.js';import{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,getAllTemplates as a200be,getTemplateById as a200bf,getTemplatesByScene as a200bg,getTemplatesByIndustry as a200bh,suggestTemplateForScene as a200bi,listTemplates as a200bj,fillTemplate as a200bk}from'./arbitration-templates.js';import{ARBITRATION_RISK_VERSION,assessArbitrationRisks,getAllRiskRules as a200bl}from'./arbitration-risk.js';import{REWARD_LEDGER_VERSION,REWARD_SCENES,REWARD_PERMISSIONS,REWARD_FIELDS,REWARD_GUARD_CONSTRUCTORS,REWARD_ERROR_CODES,REWARD_CROSS_OBJECT_REFS,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,getScenesByPhase as a200bm,findSceneById as a200bn,getScenesByIndustry as a200bo,getBuiltinPermissionByIndex as a200bp,isRewardBuiltinPermission,getAllBuiltinPermissions as a200bq,getRewardScenesCount,getGuardConstructorSpec as a200br,resolveGuardConstructor as a200bs,getRewardErrorByCode,getRewardErrorByName,validateGuardCount as a200bt,validateRecordCount as a200bu,inferSceneFromIntent as a200bv}from'./reward-ledger.js';import{REWARD_FIELD_MUTABILITY,initPuzzleFromIntent as a200bw,checkPuzzleCompleteness as a200bx,validateConstraints as a200by,generateConfirmationText as a200bz,resolveBuiltinPermission as a200bA,requiresGuardConfig as a200bB,requiresPassport as a200bC,getRelevantDimensions as a200bD,getFieldMutability as a200bE,isAdminMutableField as a200bF,getFieldPermissionIndex as a200bG}from'./reward-puzzle.js';import{REWARD_RISK_VERSION,assessRewardRisks,getAllRewardRiskRules}from'./reward-risk.js';import{PASSPORT_LEDGER_VERSION,PASSPORT_ERROR_CODES,PASSPORT_SCENARIOS,MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT,getAllScenarios as a200bH,getScenariosCount as a200bI,findScenarioById as a200bJ,getScenariosByConsumer as a200bK,getScenariosUsingRelies as a200bL,inferScenarioFromIntent as a200bM,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,getErrorName as a200bN,getErrorDescription as a200bO}from'./passport-ledger.js';import{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,getAllTemplates as a200bP,getTemplateById as a200bQ,getTemplatesByScenario as a200bR,getTemplatesByIndustry as a200bS,suggestTemplateForScenario as a200bT,listTemplates as a200bU,fillTemplate as a200bV}from'./passport-templates.js';import{PROOF_RISK_RULES,checkProofRisks}from'./proof-risk.js';import{REPOSITORY_RISK_RULES,checkRepositoryRisks,parseIdFromForRiskCheck}from'./repository-risk.js';import{DEMAND_RISK_RULES,checkDemandRisks}from'./demand-risk.js';import{CONTACT_RISK_RULES,CONTACT_RISK_VERSION,checkContactRisks}from'./contact-risk.js';import{RESOURCE_RISK_RULES,RESOURCE_RISK_VERSION,checkResourceRisks}from'./resource-risk.js';import{PAYMENT_RISK_RULES,PAYMENT_RISK_VERSION,checkPaymentRisks}from'./payment-risk.js';import{ARB_RISK_RULES,ARB_RISK_VERSION,checkArbRisks}from'./arb-risk.js';import{PERSONAL_RISK_RULES,PERSONAL_RISK_VERSION,checkPersonalRisks}from'./personal-risk.js';import{UTIL_RISK_RULES,UTIL_RISK_VERSION,checkUtilRisks}from'./util-risk.js';import{REGISTRAR_RISK_RULES,REGISTRAR_RISK_VERSION,checkRegistrarRisks}from'./registrar-risk.js';import{BRIDGE_RISK_RULES,BRIDGE_RISK_VERSION,checkBridgeRisks}from'./bridge-risk.js';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'./tools-reference.js';import{SCENARIO_MODES,SCENARIO_MODES_VERSION,MODE_COMPOSITIONS,matchScenarioMode,inferScenarioTraits,getScenarioMode,listScenarioModes,getShippedModes,getModeCompositions}from'./scenario-modes.js';import{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION,getBuiltinTemplate,listBuiltinTemplates,TEMPLATE_KEYWORDS}from'./builtin-templates.js';import{resolveTemplatesDir,seedBuiltinTemplates,reloadTemplates,listTemplates,getTemplate,getTemplatesByIndustry as a200bW,parseTemplateFile,renderTemplateFile,loadAndValidate,TemplateFrontmatterSchema}from'./template-loader.js';import{scanTemplate}from'./template-scanner.js';import{GUARD_DESIGN_PATTERNS,GUARD_DESIGN_PATTERNS_VERSION,VERIFIER_LEVEL_GUIDANCE,getGuardDesignPattern,searchGuardDesignPatterns,getPatternsByHost,getPatternsByIndustry,getPatternsByDataSourceClass,getVerifierLevelGuidance,suggestPatternForRequirement}from'./guard-design-patterns.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules};export{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations};export{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate};export{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings};export{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION};export{computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION};export{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION};export{STRATEGY_MANUAL_FILENAME,STRATEGY_MANUAL_VERSION,renderStrategyManual,parseManualSentinel,classifyManualFile,getBuiltinStrategyManual,listBuiltinStrategyManualIndustries}from'./strategy-manuals.js';export{INDUSTRY_STRATEGIES,getIndustryStrategy,listIndustryStrategies,registerIndustryStrategy,unregisterIndustryStrategy,recommendStrategy,stageFromOrderCount,validateStrategyLevers}from'./industry-strategy.js';export{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,listIndustries as listRegistryIndustries,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames};export{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries};export{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline};export{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext};export{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole};export{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes};export{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory};export{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP};export{runGuardRulePack,assembleGuardAssessment,evaluateGuardDraft,getRiskRulesCount,GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams,GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding,SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects,lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult};export{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,a200a as findMachineScene,a200b as getMachineScenesByIndustry,getScenesByPattern,inferSceneFromFlow};export{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,a200c as getAllMachineTemplates,a200d as getMachineTemplateById,a200e as getMachineTemplatesByScene,a200f as getMachineTemplatesByIndustry,suggestTemplateForIntent,walkDecisionTree,a200g as fillMachineTemplate,a200h as forkMachineTemplate,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds};export{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,a200i as matchMachinePattern,identifyExecutionMode,identifyTopology,explainForwardPermission,a200j as getMachineConstraintsByCategory,getConstraintById,a200k as getOnChainMachineConstraints,a200l as getOffChainMachineConstraints};export{MACHINE_RISK_RULES,MACHINE_RISK_VERSION,assessMachineRisks};export{analyzeTopology,identifyTopologyPattern,formatTopologySummary,MACHINE_TOPOLOGY_VERSION,MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT};export{a200m as initMachinePuzzleFromIntent,initPuzzleFromTemplate,a200n as checkMachinePuzzleCompleteness,a200o as recommendMachineNextStep,derivePuzzleFromMachineJson,a200p as generateMachineConfirmationText,MACHINE_PUZZLE_VERSION};export{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,a200q as getServiceScenesByCategory,a200r as findServiceSceneById,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,a200s as inferServiceSceneFromIntent,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,a200t as getServiceCrossObjectBindings};export{a200u as initServicePuzzleFromIntent,a200v as checkServicePuzzleCompleteness,a200w as validateServiceConstraints,a200x as generateServicePuzzleConfirmationText,initOrderFlowPuzzle,checkOrderFlowCompleteness};export{SERVICE_RISK_VERSION,assessServiceRisks,getAllServiceRiskRules};export{SERVICE_TEMPLATES,SERVICE_TEMPLATES_VERSION,getServiceTemplateById,getServiceTemplatesByScene,getServiceTemplatesByIndustry,suggestServiceTemplateForScene,listServiceTemplates,fillServiceTemplate,getAllServiceTemplates};export{ALLOCATION_SCENES,ALLOCATION_LEDGER_VERSION,MAX_ALLOCATOR_COUNT,ALLOCATION_MAX_SHARING_COUNT,ALLOCATION_MODE_AMOUNT,ALLOCATION_MODE_RATE,ALLOCATION_MODE_SURPLUS,RATE_TOTAL_FULL,ALLOCATION_ERROR_CODES,a200y as getAllocationScenesByTriggerSource,a200z as getAllocationScenesByMode,a200A as getAllocationScenesByStrategy,a200B as findAllocationSceneById,a200C as inferAllocationSceneFromIntent,a200D as getAllAllocationScenes,a200E as getAllocationScenesCount,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,a200F as getAllocationErrorName,a200G as getAllocationErrorDescription};export{a200H as initAllocationPuzzleFromIntent,a200I as checkAllocationPuzzleCompleteness,a200J as validateAllocationConstraints,a200K as generateAllocationPuzzleConfirmationText,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION};export{ALLOCATION_RISK_VERSION,assessAllocationRisks,a200L as getAllAllocationRiskRules};export{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,a200M as getAllAllocationTemplates,a200N as getAllocationTemplateById,a200O as getAllocationTemplatesByScene,a200P as getAllocationTemplatesByIndustry,a200Q as suggestAllocationTemplateForScene,a200R as listAllocationTemplates,a200S as fillAllocationTemplate};export{RECIPIENT_CONSTRAINT_VERSION,classifyRecipient,analyzeRecipientConstraints,isUnboundSignerTheft,canonicalDoctrine,recipientDesignGuidance,derivePayoffFromSharing,OBJECT_DRIVEABILITY,driveabilityOf,RECIPIENT_DESIGN_OPTIONS};export{paymentRelations,scanRecentPaymentEvents,resolveBeneficialOwners,extractionPlanForHolder,pendingWrappersAt,trackAccountPayments};export{TREASURY_LEDGER_VERSION,TREASURY_SCENES,a200T as TREASURY_BUILTIN_PERMISSIONS,a200U as getTreasuryScenesByHostObject,a200V as findTreasurySceneById,a200W as findTreasurySceneByPermissionIndex,a200X as getTreasuryBuiltinPermissionByIndex,isBuiltinTreasuryPermission,a200Y as getActiveTreasuryBuiltinPermissions,a200Z as getReservedTreasuryBuiltinPermissions,a200a0 as inferTreasurySceneFromIntent,getTreasuryScenesCount,a200a1 as getTreasuryGovernedOperationsForPermissionIndex};export{a200a2 as initTreasuryPuzzleFromIntent,a200a3 as checkTreasuryPuzzleCompleteness,a200a4 as validateTreasuryConstraints,a200a5 as generateTreasuryPuzzleConfirmationText,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,a200a6 as TREASURY_MAX_DESCRIPTION_LENGTH};export{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,a200a7 as getTreasuryTemplateById,a200a8 as getTreasuryTemplatesByScene,a200a9 as getTreasuryTemplatesByIndustry,a200aa as suggestTreasuryTemplateForScene,a200ab as listTreasuryTemplates,a200ac as fillTreasuryTemplate};export{TREASURY_RISK_VERSION,assessTreasuryRisks,getAllTreasuryRiskRules};export{ORDER_LEDGER_VERSION,ORDER_SCENES,ORDER_FIELDS,ORDER_STATES,ORDER_STATE_TRANSITIONS,ORDER_LIFECYCLE_EVENTS,ORDER_PERMISSION_MATRIX,ORDER_AUDIT_FORMULAS,a200ad as getOrderScenesByOperationField,a200ae as findOrderSceneById,a200af as findOrderSceneByMoveEntry,a200ag as getOrderScenesByPermissionLayer,a200ah as getOrderScenesByReversibility,a200ai as getOrderFieldDef,a200aj as getOrderMutableFields,a200ak as getOrderImmutableFields,a200al as getOrderFrozenAfterProgressFields,a200am as getOrderOneTimeSetFields,a200an as inferOrderSceneFromIntent,a200ao as getOrderEmittedEvents,a200ap as getOrderInferredEvents,getOrderScenesCount,a200aq as sdkToMoveOrderField,a200ar as moveToSdkOrderField};export{a200as as initOrderPuzzleFromIntent,a200at as checkOrderPuzzleCompleteness,a200au as validateOrderConstraints,a200av as generateOrderPuzzleConfirmationText,a200aw as verifyOrderSnapshotMechanism,a200ax as inferOrderLifecyclePhase,a200ay as matchOrderSceneFromPuzzle,a200az as listAllOrderScenes,a200aA as lookupOrderScene};export{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,a200aB as getOrderTemplateById,a200aC as getOrderTemplatesByScene,a200aD as getOrderTemplatesByIndustry,a200aE as getOrderTemplatesByPermissionLayer,a200aF as getIrreversibleOrderTemplates,a200aG as suggestOrderTemplateForScene,listOrderTemplates,a200aH as fillOrderTemplate,a200aI as suggestOrderTemplateFromIntent,a200aJ as getOrderTemplateParameters,a200aK as validateOrderTemplateParams};export{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules};export{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,a200aL as PROGRESS_BUILTIN_PERMISSIONS,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,a200aM as getProgressScenesByPhase,a200aN as findProgressSceneById,a200aO as getProgressScenesByIndustry,a200aP as getProgressBuiltinPermissionByIndex,isProgressBuiltinPermission,a200aQ as inferProgressSceneFromIntent,a200aR as getAllProgressBuiltinPermissions,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount};export{a200aS as initProgressPuzzleFromIntent,a200aT as checkProgressPuzzleCompleteness,a200aU as validateProgressConstraints,a200aV as generateProgressPuzzleConfirmationText,a200aW as resolveProgressBuiltinPermission,isOrderHolderForward,a200aX as getProgressRelevantDimensions};export{PROGRESS_TEMPLATES,PROGRESS_TEMPLATES_VERSION,getAllProgressTemplates,getProgressTemplateById,getProgressTemplatesByScene,getProgressTemplatesByIndustry,suggestProgressTemplateForScene,listProgressTemplates,fillProgressTemplate};export{PROGRESS_RISK_VERSION,assessProgressRisks,getAllProgressRiskRules};export{ARBITRATION_LEDGER_VERSION,ARBITRATION_SCENES,a200aY as ARBITRATION_BUILTIN_PERMISSIONS,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,a200aZ as getArbitrationScenesByCategory,a200b0 as findArbitrationSceneById,a200b1 as findArbitrationSceneByPermissionIndex,a200b2 as getArbitrationPermissionByIndex,a200b3 as getArbitrationPermissionByName,a200b4 as isArbitrationReservedIndex,a200b5 as isArbitrationUsedPermissionIndex,a200b6 as getArbitrationActivePermissionCount,a200b7 as inferArbitrationSceneFromIntent,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,a200b8 as getArbitrationScenesProducingStatus,a200b9 as getArbitrationScenesRequiringStatus,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions};export{a200ba as initArbitrationPuzzleFromIntent,a200bb as checkArbitrationPuzzleCompleteness,a200bc as validateArbitrationConstraints,a200bd as generateArbitrationPuzzleConfirmationText};export{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,a200be as getAllArbitrationTemplates,a200bf as getArbitrationTemplateById,a200bg as getArbitrationTemplatesByScene,a200bh as getArbitrationTemplatesByIndustry,a200bi as suggestArbitrationTemplateForScene,a200bj as listArbitrationTemplates,a200bk as fillArbitrationTemplate};export{ARBITRATION_RISK_VERSION,assessArbitrationRisks,a200bl as getAllArbitrationRiskRules};export{REWARD_LEDGER_VERSION,REWARD_SCENES,REWARD_PERMISSIONS,REWARD_FIELDS,REWARD_GUARD_CONSTRUCTORS,REWARD_ERROR_CODES,REWARD_CROSS_OBJECT_REFS,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,a200bm as getRewardScenesByPhase,a200bn as findRewardSceneById,a200bo as getRewardScenesByIndustry,a200bp as getRewardBuiltinPermissionByIndex,isRewardBuiltinPermission,a200bq as getAllRewardBuiltinPermissions,getRewardScenesCount,a200br as getRewardGuardConstructorSpec,a200bs as resolveRewardGuardConstructor,getRewardErrorByCode,getRewardErrorByName,a200bt as validateRewardGuardCount,a200bu as validateRewardRecordCount,a200bv as inferRewardSceneFromIntent};export{REWARD_FIELD_MUTABILITY,a200bw as initRewardPuzzleFromIntent,a200bx as checkRewardPuzzleCompleteness,a200by as validateRewardConstraints,a200bz as generateRewardPuzzleConfirmationText,a200bA as resolveRewardBuiltinPermission,a200bB as requiresRewardGuardConfig,a200bC as requiresRewardPassport,a200bD as getRewardRelevantDimensions,a200bE as getRewardFieldMutability,a200bF as isRewardAdminMutableField,a200bG as getRewardFieldPermissionIndex};export{REWARD_RISK_VERSION,assessRewardRisks,getAllRewardRiskRules};export{PASSPORT_LEDGER_VERSION,PASSPORT_ERROR_CODES,PASSPORT_SCENARIOS,MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT,a200bH as getAllPassportScenarios,a200bI as getPassportScenesCount,a200bJ as findPassportScenarioById,a200bK as getPassportScenariosByConsumer,a200bL as getPassportScenariosUsingRelies,a200bM as inferPassportScenarioFromIntent,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,a200bN as getPassportErrorName,a200bO as getPassportErrorDescription};export{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,a200bP as getAllPassportTemplates,a200bQ as getPassportTemplateById,a200bR as getPassportTemplatesByScenario,a200bS as getPassportTemplatesByIndustry,a200bT as suggestPassportTemplateForScenario,a200bU as listPassportTemplates,a200bV as fillPassportTemplate};export{PROOF_RISK_RULES,checkProofRisks};export{REPOSITORY_RISK_RULES,checkRepositoryRisks,parseIdFromForRiskCheck};export{assessEvidenceReview,reviewEvidenceList}from'./evidence-review.js';export{DEMAND_RISK_RULES,checkDemandRisks};export{CONTACT_RISK_RULES,CONTACT_RISK_VERSION,checkContactRisks};export{RESOURCE_RISK_RULES,RESOURCE_RISK_VERSION,checkResourceRisks};export{PAYMENT_RISK_RULES,PAYMENT_RISK_VERSION,checkPaymentRisks};export{ARB_RISK_RULES,ARB_RISK_VERSION,checkArbRisks};export{PERSONAL_RISK_RULES,PERSONAL_RISK_VERSION,checkPersonalRisks};export{UTIL_RISK_RULES,UTIL_RISK_VERSION,checkUtilRisks};export{REGISTRAR_RISK_RULES,REGISTRAR_RISK_VERSION,checkRegistrarRisks};export{BRIDGE_RISK_RULES,BRIDGE_RISK_VERSION,checkBridgeRisks};export{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence};export{SCENARIO_MODES,SCENARIO_MODES_VERSION,MODE_COMPOSITIONS,matchScenarioMode,inferScenarioTraits,getScenarioMode,listScenarioModes,getShippedModes,getModeCompositions};export{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION,getBuiltinTemplate,listBuiltinTemplates,TEMPLATE_KEYWORDS};export{resolveTemplatesDir,seedBuiltinTemplates,reloadTemplates,listTemplates,getTemplate,a200bW as getIndustryTemplates,parseTemplateFile,renderTemplateFile,loadAndValidate,TemplateFrontmatterSchema};export{scanTemplate};export{GUARD_DESIGN_PATTERNS,GUARD_DESIGN_PATTERNS_VERSION,VERIFIER_LEVEL_GUIDANCE,getGuardDesignPattern,searchGuardDesignPatterns,getPatternsByHost,getPatternsByIndustry,getPatternsByDataSourceClass,getVerifierLevelGuidance,suggestPatternForRequirement};export function getKnowledgeBase(){return{'version':{'safety':SAFETY_RULES_VERSION,'tool_constraints':TOOL_CONSTRAINTS_VERSION,'reward_templates':REWARD_TEMPLATES_VERSION,'audit_rules':AUDIT_RULES_VERSION,'dynamic_pricing':DYNAMIC_PRICING_VERSION,'reputation_rules':REPUTATION_RULES_VERSION,'acquisition_flywheel':ACQUISITION_FLYWHEEL_VERSION,'industry_registry':INDUSTRY_REGISTRY_VERSION,'flywheel_loop':FLYWHEEL_LOOP_VERSION,'machine_ledger':MACHINE_LEDGER_VERSION,'machine_templates':MACHINE_TEMPLATES_VERSION,'machine_translation':MACHINE_TRANSLATION_VERSION,'machine_risk':MACHINE_RISK_VERSION,'machine_topology':MACHINE_TOPOLOGY_VERSION,'machine_puzzle':MACHINE_PUZZLE_VERSION,'service_ledger':SERVICE_LEDGER_VERSION,'service_risk':SERVICE_RISK_VERSION,'service_templates':SERVICE_TEMPLATES_VERSION,'allocation_ledger':ALLOCATION_LEDGER_VERSION,'allocation_puzzle':ALLOCATION_PUZZLE_VERSION,'allocation_risk':ALLOCATION_RISK_VERSION,'allocation_templates':ALLOCATION_TEMPLATES_VERSION,'treasury_ledger':TREASURY_LEDGER_VERSION,'treasury_templates':TREASURY_TEMPLATES_VERSION,'treasury_risk':TREASURY_RISK_VERSION,'order_ledger':ORDER_LEDGER_VERSION,'order_templates':ORDER_TEMPLATES_VERSION,'order_risk':ORDER_RISK_VERSION,'progress_ledger':PROGRESS_LEDGER_VERSION,'progress_templates':PROGRESS_TEMPLATES_VERSION,'progress_risk':PROGRESS_RISK_VERSION,'arbitration_ledger':ARBITRATION_LEDGER_VERSION,'arbitration_templates':ARBITRATION_TEMPLATES_VERSION,'arbitration_risk':ARBITRATION_RISK_VERSION,'reward_ledger':REWARD_LEDGER_VERSION,'reward_risk':REWARD_RISK_VERSION,'passport_ledger':PASSPORT_LEDGER_VERSION,'passport_templates':PASSPORT_TEMPLATES_VERSION,'contact_risk':CONTACT_RISK_VERSION,'resource_risk':RESOURCE_RISK_VERSION,'payment_risk':PAYMENT_RISK_VERSION,'arb_risk':ARB_RISK_VERSION,'personal_risk':PERSONAL_RISK_VERSION,'util_risk':UTIL_RISK_VERSION,'registrar_risk':REGISTRAR_RISK_VERSION,'bridge_risk':BRIDGE_RISK_VERSION,'scenario_modes':SCENARIO_MODES_VERSION,'guard_design_patterns':GUARD_DESIGN_PATTERNS_VERSION,'builtin_templates':BUILTIN_TEMPLATES_VERSION},'confirmation_rules':CONFIRMATION_RULES['length'],'confirmation_rule_ids':CONFIRMATION_RULES['map'](a=>a['id']),'tool_constraints_count':TOOL_CONSTRAINTS['length'],'reward_templates_count':REWARD_TEMPLATES['length'],'audit_rules_count':AUDIT_RULES['length'],'mutable_fields_count':MUTABLE_FIELDS['length'],'industry_flywheels_count':INDUSTRY_FLYWHEELS['length'],'industry_registry_count':getRegistrySize(),'intent_count':listIntents()['length'],'guard_scenes_count':GUARD_SCENES['length'],'guard_semantic_rules_count':SEMANTIC_TO_SCHEMA_RULES['length'],'guard_schema_rules_count':SCHEMA_TO_SEMANTIC_RULES['length'],'guard_constraint_rules_count':GUARD_CONSTRAINT_RULES['length'],'guard_risk_rules_count':getRiskRulesCount(),'guard_templates_count':GUARD_TEMPLATES_COUNT,'guard_lint_enabled':!![],'machine_scenes_count':MACHINE_SCENES_COUNT,'machine_templates_count':MACHINE_TEMPLATES['length'],'machine_patterns_count':SEMANTIC_TO_MACHINE_RULES['length'],'machine_constraint_rules_count':MACHINE_CONSTRAINT_RULES['length'],'machine_risk_rules_count':MACHINE_RISK_RULES['length'],'machine_on_chain_limits':{'max_node_count':MAX_NODE_COUNT,'max_node_pair_count':MAX_NODE_PAIR_COUNT,'max_forward_count':MAX_FORWARD_COUNT},'service_scenes_count':SERVICE_SCENES['length'],'service_permissions_count':SERVICE_PERMISSIONS['length'],'service_order_flow_stages_count':SERVICE_ORDER_FLOW_STAGES['length'],'service_cross_object_bindings_count':SERVICE_CROSS_OBJECT_BINDINGS['length'],'service_risk_rules_count':getAllServiceRiskRules()['length'],'service_templates_count':SERVICE_TEMPLATES['length'],'service_context_enabled':!![],'allocation_scenes_count':ALLOCATION_SCENES['length'],'allocation_risk_rules_count':a200L()['length'],'allocation_templates_count':ALLOCATION_TEMPLATES['length'],'allocation_context_enabled':!![],'treasury_scenes_count':TREASURY_SCENES['length'],'treasury_builtin_permissions_count':a200T['length'],'treasury_risk_rules_count':getAllTreasuryRiskRules()['length'],'treasury_templates_count':TREASURY_TEMPLATES['length'],'treasury_context_enabled':!![],'order_scenes_count':ORDER_SCENES['length'],'order_fields_count':ORDER_FIELDS['length'],'order_states_count':ORDER_STATES['length'],'order_lifecycle_events_count':ORDER_LIFECYCLE_EVENTS['length'],'order_risk_rules_count':getAllOrderRiskRules()['length'],'order_templates_count':ORDER_TEMPLATES['length'],'order_context_enabled':!![],'progress_scenes_count':PROGRESS_SCENES['length'],'progress_builtin_permissions_count':a200aL['length'],'progress_risk_rules_count':getAllProgressRiskRules()['length'],'progress_templates_count':PROGRESS_TEMPLATES['length'],'progress_context_enabled':!![],'arbitration_scenes_count':ARBITRATION_SCENES['length'],'arbitration_builtin_permissions_count':a200aY['length'],'arbitration_risk_rules_count':a200bl()['length'],'arbitration_templates_count':ARBITRATION_TEMPLATES['length'],'arbitration_context_enabled':!![],'reward_scenes_count':REWARD_SCENES['length'],'reward_builtin_permissions_count':REWARD_PERMISSIONS['length'],'reward_fields_count':REWARD_FIELDS['length'],'reward_guard_constructors_count':REWARD_GUARD_CONSTRUCTORS['length'],'reward_error_codes_count':REWARD_ERROR_CODES['length'],'reward_risk_rules_count':getAllRewardRiskRules()['length'],'reward_context_enabled':!![],'passport_scenarios_count':PASSPORT_SCENARIOS['length'],'passport_max_guard_count':MAX_GUARD_COUNT_PASSPORT,'passport_max_submission_size':MAX_SUBMISSION_SIZE_PASSPORT,'passport_templates_count':PASSPORT_TEMPLATES['length'],'passport_context_enabled':!![],'proof_risk_rules_count':PROOF_RISK_RULES['length'],'repository_risk_rules_count':REPOSITORY_RISK_RULES['length'],'demand_risk_rules_count':DEMAND_RISK_RULES['length'],'contact_risk_rules_count':CONTACT_RISK_RULES['length'],'resource_risk_rules_count':RESOURCE_RISK_RULES['length'],'payment_risk_rules_count':PAYMENT_RISK_RULES['length'],'arb_risk_rules_count':ARB_RISK_RULES['length'],'personal_risk_rules_count':PERSONAL_RISK_RULES['length'],'util_risk_rules_count':UTIL_RISK_RULES['length'],'registrar_risk_rules_count':REGISTRAR_RISK_RULES['length'],'bridge_risk_rules_count':BRIDGE_RISK_RULES['length'],'tools_reference_count':TOOLS_REFERENCE['length'],'scenario_modes_count':SCENARIO_MODES['length'],'scenario_mode_compositions_count':MODE_COMPOSITIONS['length'],'builtin_templates_count':BUILTIN_TEMPLATES['length'],'guard_design_patterns_count':GUARD_DESIGN_PATTERNS['length'],'verifier_level_guidance_count':VERIFIER_LEVEL_GUIDANCE['length']};}export{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind};export{buildWorkspaceLists}from'./workspace-lists.js';export{resolveSupplyChainGraph}from'./supply-chain.js';export{enumerateObjectOperations,operationCategoryOf,operationComplexityOf,isPermissionIndexType}from'./operation-dictionary.js';export{enumerateServices,enumerateDemands,enumerateArbs}from'./jsonrpc-enum.js';export{FIELD_MUTABILITY_RULES,LOCK_CONSTRAINTS,IRREVERSIBLE_OPERATIONS,STATE_MACHINE_TERMINALS,NUMERIC_LIMIT_CONSTRAINTS,EXTERNAL_ACCESS_MECHANISMS,fieldMutabilityOf,isActionForbidden,lockConstraintOf,numericLimitOf,externalAccessOf}from'./contract-invariants.js';export{GUARD_FIELD_COGNITION_VERSION,GUARD_FIELD_SITES,VALUE_ORIGIN_SEMANTICS,GUARD_PASSPORT_DOCTRINE,guardSitesFor,guardCognitionDoctrine,REPOSITORY_WRITE_ROUTE_MATRIX,repositoryRouteSlotConflicts}from'./guard-field-cognition.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getIndustryProfile,listIndustries,registerIndustry}from'./industry-registry.js';const TRAIT_INFERENCE_RULES=[{'keywords':['logistics','shipping','delivery','express','shipment','ship'],'trait':'has_logistics','value':!![],'weight':0.85},{'keywords':['digital','online','cloud','virtual'],'trait':'has_logistics','value':![],'weight':0.7},{'keywords':['consulting','communication','requirement-confirmation','revision-rounds','negotiate','consult'],'trait':'communication_heavy','value':!![],'weight':0.8},{'keywords':['standard-product','in-stock','one-click-order','standard','instant'],'trait':'communication_heavy','value':![],'weight':0.7},{'keywords':['digital','file','code','design-draft','electronic','online','software','source'],'trait':'pure_digital','value':!![],'weight':0.8},{'keywords':['physical','hardware','equipment'],'trait':'pure_digital','value':![],'weight':0.75},{'keywords':['course','semester','long-cycle','long-term','project-based','project'],'trait':'long_cycle','value':!![],'weight':0.75},{'keywords':['instant','in-stock','same-day','immediate'],'trait':'long_cycle','value':![],'weight':0.8},{'keywords':['rental','rent','deposit','lease'],'trait':'deposit_required','value':!![],'weight':0.9},{'keywords':['purchase','buyout','buy'],'trait':'deposit_required','value':![],'weight':0.6},{'keywords':['multi-party','segmented','multi-stage','multi-vendor','itinerary','segment'],'trait':'multi_tier_allocation','value':!![],'weight':0.75},{'keywords':['medical','legal','financial','insurance','pharmaceutical','pharma'],'trait':'regulatory_intensity','value':'high','weight':0.9},{'keywords':['education','food','construction'],'trait':'regulatory_intensity','value':'medium','weight':0.7},{'keywords':['entertainment','gaming','digital','game'],'trait':'regulatory_intensity','value':'low','weight':0.6},{'keywords':['custom','high-value','customized','bespoke'],'trait':'trust_sensitivity','value':'high','weight':0.8},{'keywords':['standard-product','small-ticket','standard','low-value'],'trait':'trust_sensitivity','value':'low','weight':0.7},{'keywords':['subscription','membership','recurring'],'trait':'consumption_frequency','value':'frequent','weight':0.85},{'keywords':['course','semester','education'],'trait':'consumption_frequency','value':'one_time','weight':0.75},{'keywords':['daily','frequent','common'],'trait':'consumption_frequency','value':'frequent','weight':0.75},{'keywords':['small-ticket','daily','convenience-store','micro'],'trait':'avg_ticket_size','value':'micro','weight':0.7},{'keywords':['retail','commodity','standard-product'],'trait':'avg_ticket_size','value':'small','weight':0.7},{'keywords':['custom','project','outsourcing'],'trait':'avg_ticket_size','value':'medium','weight':0.7},{'keywords':['real-estate','automobile','high-value','luxury','realestate','car'],'trait':'avg_ticket_size','value':'large','weight':0.85},{'keywords':['物流','配送','送货','快递','发货','运输','上门'],'trait':'has_logistics','value':!![],'weight':0.85},{'keywords':['数字','线上','云端','虚拟'],'trait':'has_logistics','value':![],'weight':0.7},{'keywords':['沟通','客服','咨询','洽谈','协商','客服沟通'],'trait':'communication_heavy','value':!![],'weight':0.8},{'keywords':['标准品','现货','一键下单','标准','即时'],'trait':'communication_heavy','value':![],'weight':0.7},{'keywords':['数字','文件','代码','设计稿','电子','线上','软件','源码','数字商品'],'trait':'pure_digital','value':!![],'weight':0.8},{'keywords':['实物','硬件','设备','线下商品'],'trait':'pure_digital','value':![],'weight':0.75},{'keywords':['课程','学期','长周期','长期','项目制'],'trait':'long_cycle','value':!![],'weight':0.75},{'keywords':['即时','现货','当天','即时交付'],'trait':'long_cycle','value':![],'weight':0.8},{'keywords':['租赁','租借','租金','押金','定金','预订金'],'trait':'deposit_required','value':!![],'weight':0.9},{'keywords':['购买','买断','现购'],'trait':'deposit_required','value':![],'weight':0.6},{'keywords':['多方','多方参与','分段','多段','多供应商','行程','路线','套餐'],'trait':'multi_tier_allocation','value':!![],'weight':0.75},{'keywords':['医疗','法律','金融','保险','医药','药企'],'trait':'regulatory_intensity','value':'high','weight':0.9},{'keywords':['教育','餐饮','建筑'],'trait':'regulatory_intensity','value':'medium','weight':0.7},{'keywords':['娱乐','游戏','数字娱乐'],'trait':'regulatory_intensity','value':'low','weight':0.6},{'keywords':['定制','高价值','高端定制'],'trait':'trust_sensitivity','value':'high','weight':0.8},{'keywords':['标准品','小额','标准','低价','廉价'],'trait':'trust_sensitivity','value':'low','weight':0.7},{'keywords':['订阅','会员','续费','复购'],'trait':'consumption_frequency','value':'frequent','weight':0.85},{'keywords':['课程','学期','学历'],'trait':'consumption_frequency','value':'one_time','weight':0.75},{'keywords':['日常','频繁','常见'],'trait':'consumption_frequency','value':'frequent','weight':0.75},{'keywords':['小额','日常','便利店','微型'],'trait':'avg_ticket_size','value':'micro','weight':0.7},{'keywords':['零售','商品','标准品'],'trait':'avg_ticket_size','value':'small','weight':0.7},{'keywords':['定制','项目','外包'],'trait':'avg_ticket_size','value':'medium','weight':0.7},{'keywords':['房产','汽车','高价值','奢侈品','贵重','豪华','高端'],'trait':'avg_ticket_size','value':'large','weight':0.85},{'keywords':['酒店','住宿','民宿','客栈','宾馆','客房','房源','门店','到店','线下','度假村','公寓','旅馆','机票','旅游','旅行','行程','度假','门票','游轮','hotel','hostel','apartment','resort','stay','room','property','accommodation','lodging','flight','itinerary','tourism','travel','trip','vacation'],'trait':'has_logistics','value':!![],'weight':0.8},{'keywords':['预订','预约','订房','下单','退房','入住','核销','行程','签证','门票','机票','旅游','旅行','度假','booking','reservation','reservation','check-in','checkin','checkout','check-out','itinerary','flight','ticket','vacation','travel','trip'],'trait':'multi_tier_allocation','value':!![],'weight':0.75},{'keywords':['实名','证件','身份证','核销','核验','凭证','资质','持证','真实房源','验真'],'trait':'trust_sensitivity','value':'high','weight':0.8},{'keywords':['酒店','住宿','民宿','客栈','旅游','旅行','度假','签证','旅行社','旅馆','hospitality','tourism','visa','lodging'],'trait':'regulatory_intensity','value':'medium','weight':0.8},{'keywords':['单次','一次性','单晚','单程','单间','每晚','按晚'],'trait':'consumption_frequency','value':'one_time','weight':0.75},{'keywords':['房费','房价','客单价','高客单','机票','游轮','度假套餐','酒店','住宿','民宿','客栈','度假村','度假','签证','hotel','hostel','resort','flight','accommodation','lodging'],'trait':'avg_ticket_size','value':'large','weight':0.85},{'keywords':['门店','到店','线下','实地','面对面'],'trait':'pure_digital','value':![],'weight':0.75},{'keywords':['沟通','客服','messenger','咨询','售后沟通'],'trait':'communication_heavy','value':!![],'weight':0.8}];export const DEFAULT_TRAITS={'has_logistics':![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'occasional','avg_ticket_size':'small'};export function inferTraitsFromDescription(a){const b=(a??'')['toLowerCase'](),c=[],d=new Map(),e=new Map();for(const i of TRAIT_INFERENCE_RULES){const j=i['keywords']['find'](l=>b['includes'](l['toLowerCase']()));if(j){c['push'](j);const l=d['get'](i['trait'])??0x0;i['weight']>l&&(d['set'](i['trait'],i['weight']),e['set'](i['trait'],i['value']));}}const f={...DEFAULT_TRAITS};for(const [m,n]of e['entries']()){f[m]=n;}const g=d['size'],h=Math['min'](0x1,g/0xa);return{'traits':f,'confidence':h,'matched_keywords':Array['from'](new Set(c)),'trait_confidence':Object['fromEntries'](d)};}const ENUM_TRAIT_SCALES={'regulatory_intensity':['low','medium','high'],'trust_sensitivity':['low','medium','high'],'consumption_frequency':['one_time','occasional','frequent'],'avg_ticket_size':['micro','small','medium','large']},BOOLEAN_TRAIT_KEYS=['has_logistics','communication_heavy','pure_digital','long_cycle','deposit_required','multi_tier_allocation'],ENUM_TRAIT_KEYS=['regulatory_intensity','trust_sensitivity','consumption_frequency','avg_ticket_size'],EVIDENCE_THRESHOLD=0.5;export const INDUSTRY_REQUIRED_TRAITS={'subscription':[{'trait':'pure_digital','value':!![],'reason':'subscription\x20build\x20notes:\x20\x27Pure\x20digital\x20—\x20native\x20WoWok\x20soil\x27'}],'retail':[{'trait':'has_logistics','value':!![],'reason':'retail\x20fulfilment\x20is\x20physical\x20shipping'}],'retail_d2c':[{'trait':'has_logistics','value':!![],'reason':'retail_d2c\x20fulfilment\x20is\x20physical\x20shipping'}],'rental':[{'trait':'deposit_required','value':!![],'reason':'rental\x20without\x20a\x20deposit\x20is\x20not\x20the\x20rental\x20model'}],'travel':[{'trait':'has_logistics','value':!![],'reason':'travel\x20fulfilment\x20happens\x20at\x20a\x20physical\x20destination'},{'trait':'multi_tier_allocation','value':!![],'reason':'travel\x20splits\x20guest\x20/\x20property\x20/\x20payment\x20legs'}],'education':[{'trait':'long_cycle','value':!![],'reason':'education\x20delivers\x20over\x20a\x20course/term\x20cycle'}],'freelance':[{'trait':'communication_heavy','value':!![],'reason':'freelance\x20is\x20requirement-confirmation\x20driven'}],'general':[]};export function traitContradictions(a,b,c){const d=INDUSTRY_REQUIRED_TRAITS[a];if(!d||d['length']===0x0)return[];const e=[];for(const f of d){const g=b[f['trait']],h=typeof f['value']==='boolean'?g!==f['value']:g!==f['value'];if(!h)continue;const i=c?.[f['trait']];if(c&&(i===undefined||i<EVIDENCE_THRESHOLD))continue;e['push'](f);}return e;}export function filterConsistentIndustries(a,b,c){const d=[],e=[];for(const f of a){const g=traitContradictions(f['industry'],b,c);if(g['length']>0x0)e['push']({'industry':f['industry'],'contradictions':g});else d['push'](f);}return{'consistent':d,'inconsistent':e};}export const DOMAIN_PRIORS=[{'domain':'travel_accommodation','keywords':['酒店','住宿','民宿','客栈','宾馆','旅馆','客房','房源','公寓','度假村','度假','旅游','旅行','机票','门票','行程','预订','订房','下单','入住','退房','核销','签证','hotel','hostel','apartment','resort','flight','ticket','itinerary','reservation','booking','check-in','checkin','checkout','check-out','stay','room','property','vacation','travel','trip','ota','accommodation','lodging'],'industries':['travel','rental'],'boost':0.15}];export function detectDomainPriors(a){const b=(a??'')['toLowerCase'](),c=[];for(const d of DOMAIN_PRIORS){const e=d['keywords']['filter'](f=>b['includes'](f['toLowerCase']()));if(e['length']===0x0)continue;c['push']({'domain':d['domain'],'matched_keywords':Array['from'](new Set(e)),'industries':[...d['industries']],'boost':d['boost']});}return c;}function dimAffinity(c,d,e){if(d===e)return 0x1;const f=ENUM_TRAIT_SCALES[c];if(!f)return 0x0;const g=f['indexOf'](String(d)),h=f['indexOf'](String(e));if(g<0x0||h<0x0)return 0x0;const i=f['length']-0x1;return Math['max'](0x0,0x1-Math['abs'](g-h)/ i);}const REQUIREMENT_SUPPORT_WEIGHT=0.25;export function requirementSupport(a,b,c){const d=INDUSTRY_REQUIRED_TRAITS[a];if(!d||d['length']===0x0)return undefined;let e=0x0;for(const f of d){const g=c?.[f['trait']];if(c&&(g===undefined||g<EVIDENCE_THRESHOLD)){e+=0.5;continue;}e+=b[f['trait']]===f['value']?0x1:0x0;}return e/d['length'];}export function findSimilarIndustries(a,b,d){const e=listIndustries(),f=[],g=d?.['trait_confidence'],h=[...BOOLEAN_TRAIT_KEYS,...ENUM_TRAIT_KEYS];for(const i of e){const j=i['traits'];let l=0x0;const m=[],n=[],o=[];for(const s of h){const t=dimAffinity(s,a[s],j[s]),u=g?.[s],v=g===undefined||u!==undefined&&u>=EVIDENCE_THRESHOLD;if(v){o['push'](s);if(t===0x1)m['push'](s);else n['push'](s);}l+=v?t:0.5;}const p=l/h['length'],q=requirementSupport(i['name'],a,d?.['trait_confidence']),r=q===undefined?p:p+REQUIREMENT_SUPPORT_WEIGHT*q;f['push']({'industry':i['name'],'similarity':r,'matched_traits':m,'contradicted_traits':n,'evidenced_traits':o,'trait_distance':Number((0x1-r)['toFixed'](0x4)),...q===undefined?{}:{'requirement_support':Number(q['toFixed'](0x4))}});}return f['sort']((w,x)=>x['similarity']-w['similarity']),typeof b==='number'?f['slice'](0x0,Math['max'](0x0,b)):f;}const FALLBACK_RISK_CHECK_RULES=[{'trait_key':'deposit_required','trait_value':!![],'check':{'id':'fb_deposit_lock','description':'Deposit\x20lock-period\x20safety\x20(deposit\x20cannot\x20be\x20withdrawn\x20by\x20merchant\x20at\x20any\x20time)','weight':0x1e,'passed':a=>a?.['fund_safety']?.['lock_duration_safe']??![],'advice':'⚠️\x20Lock\x20period\x20unsafe:\x20deposit\x20may\x20be\x20withdrawn\x20at\x20any\x20time;\x20recommend\x20requiring\x20a\x20lock\x20period\x20≥\x207\x20days.'},'need':{'id':'need_deposit_lock','tier':'personalized','description':'Deposit\x20lock-period\x20safety','satisfied':a=>a?.['fund_safety']?.['lock_duration_safe']??![],'advice':'Deposit\x20lock-period\x20unsafe.'}},{'trait_key':'has_logistics','trait_value':!![],'check':{'id':'fb_logistics_track','description':'Logistics\x20Guard\x20configuration\x20(shipping/receipt\x20verification)','weight':0x19,'passed':a=>a?.['workflow_analysis']?.['has_milestone_nodes']??![],'advice':'⚠️\x20No\x20logistics\x20Guard:\x20shipping\x20and\x20receipt\x20status\x20are\x20not\x20verified\x20by\x20a\x20third\x20party.'}},{'trait_key':'pure_digital','trait_value':!![],'check':{'id':'fb_wip_verified','description':'WIP\x20hash\x20verification\x20(digital\x20deliverables\x20traceable)','weight':0x19,'passed':a=>a?.['service_basics']?.['wip_verified']===!![],'advice':'⚠️\x20WIP\x20not\x20verified:\x20digital\x20deliverables\x20cannot\x20be\x20traced.'}},{'trait_key':'long_cycle','trait_value':!![],'check':{'id':'fb_milestone','description':'Milestone\x20nodes\x20(phased\x20acceptance)','weight':0x19,'passed':a=>a?.['workflow_analysis']?.['has_milestone_nodes']??![],'advice':'⚠️\x20No\x20milestone\x20nodes:\x20long-cycle\x20projects\x20lack\x20phased\x20acceptance.'}},{'trait_key':'regulatory_intensity','trait_value':'high','check':{'id':'fb_compliance','description':'Compliance\x20configuration\x20(arbitration\x20+\x20compensation\x20fund)','weight':0x1e,'passed':a=>(a?.['workflow_analysis']?.['has_arbitration_path']??![])&&(a?.['service_basics']?.['compensation_fund_balance']??0x0n)>0x0n,'advice':'🔴\x20Compliance\x20requirement\x20not\x20met:\x20highly\x20regulated\x20industries\x20must\x20configure\x20arbitration\x20and\x20a\x20compensation\x20fund.'}},{'trait_key':'multi_tier_allocation','trait_value':!![],'check':{'id':'fb_multi_tier_fair','description':'Multi-tier\x20allocation\x20fairness\x20(each\x20segment\x20has\x20a\x20corresponding\x20Allocator)','weight':0x14,'passed':a=>(a?.['workflow_analysis']?.['total_nodes']??0x0)>=0x3,'advice':'⚠️\x20Multi-tier\x20allocation\x20requires\x20corresponding\x20nodes\x20and\x20Allocators,\x20otherwise\x20fund\x20distribution\x20is\x20opaque.'}}];function buildFallbackFlywheel(a,b){const c=['Fund\x20escrow\x20+\x20process\x20transparency'];if(b['deposit_required'])c['push']('Deposit\x20escrow\x20+\x20lock-period\x20guarantee');if(b['has_logistics'])c['push']('Logistics\x20Guard\x20verification');if(b['pure_digital'])c['push']('WIP\x20digital\x20deliverable\x20traceability');if(b['regulatory_intensity']==='high')c['push']('Compliant\x20arbitration\x20+\x20compensation\x20fund\x20guarantee');const d=[{'action':'Set\x20first-order\x20Reward','purpose':'Attract\x20new\x20customers','mutableField':'rewards','metricToWatch':'New\x20customer\x20order\x20rate'},{'action':'Configure\x20compensation_fund','purpose':'Improve\x20trust\x20score','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}];return b['long_cycle']&&d['push']({'action':'Milestone\x20Reward','purpose':'Incentivize\x20completion\x20of\x20long-cycle\x20projects','mutableField':'rewards','metricToWatch':'Completion\x20rate'}),b['consumption_frequency']==='frequent'&&d['push']({'action':'Loyalty\x20Reward','purpose':'Improve\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'}),{'industry':a,'trustSellingPoints':c,'keyActions':d,'rewardStrategy':'First-order\x20reward\x20+\x20referral\x20cashback'+(b['consumption_frequency']==='frequent'?'\x20+\x20loyalty\x20reward':''),'discountStrategy':b['long_cycle']?'Long-term\x20cooperation\x20discount\x20+\x20tiered\x20discount':'First-order\x20discount\x20+\x20spend-threshold\x20discount','trustDescription':c['join']('\x20+\x20')};}function buildFallbackPreferenceTemplate(a){return{'max_acceptable_cycle':a['long_cycle']?0x5a:0xe,'response_time_expectation':a['communication_heavy']?0x4:0xc,'require_arbitration':a['regulatory_intensity']!=='low'||a['trust_sensitivity']==='high','require_compensation_fund':a['trust_sensitivity']==='high'||a['deposit_required'],'risk_appetite':a['trust_sensitivity']==='high'?'conservative':'balanced','delivery_speed_priority':a['has_logistics']&&a['consumption_frequency']==='frequent'?'urgent':'normal','after_sales_expectation':a['trust_sensitivity']==='high'?'full':'basic'};}export function synthesizeProfile(a,b){const c=findSimilarIndustries(a,0x1),d=c[0x0],e=d&&d['similarity']>=0.6?getIndustryProfile(d['industry']):undefined,f=b??'custom_'+Date['now']()['toString'](0x24),g=b??'Custom\x20Industry',h=e?{...e['flywheel'],'industry':f}:buildFallbackFlywheel(f,a),i=e?{...e['preference_template'],'max_acceptable_cycle':a['long_cycle']?Math['max'](e['preference_template']['max_acceptable_cycle'],0x5a):e['preference_template']['max_acceptable_cycle'],'require_compensation_fund':a['trust_sensitivity']==='high'?!![]:e['preference_template']['require_compensation_fund']}:buildFallbackPreferenceTemplate(a),j=[],k=[];for(const l of FALLBACK_RISK_CHECK_RULES){a[l['trait_key']]===l['trait_value']&&(j['push']({...l['check'],'industry':f}),l['need']&&k['push']({...l['need']}));}return j['length']===0x0&&j['push']({'id':'fb_basic_arbitration','industry':f,'description':'Configure\x20arbitration\x20(basic\x20dispute\x20resolution)','weight':0x64,'passed':m=>m?.['workflow_analysis']?.['has_arbitration_path']??![],'advice':'⚠️\x20No\x20arbitration\x20configured:\x20basic\x20disputes\x20have\x20no\x20resolution\x20channel.'}),{'name':f,'display_name':g,'traits':a,'source':'inferred','version':'v1','flywheel':h,'risk_checks':j,'preference_template':i,'needs':k,'confidence':d?.['similarity']??0.3,'evolution':{'version':0x1,'last_updated':Date['now'](),'signal_count':0x0,'pending_suggestions':0x0}};}export function composeIndustries(a,b){if(!a||a['length']===0x0)return undefined;const d=[];for(const o of a){const q=getIndustryProfile(o);if(!q)return undefined;d['push'](q);}const e={'has_logistics':d['some'](r=>r['traits']['has_logistics']),'communication_heavy':d['some'](r=>r['traits']['communication_heavy']),'pure_digital':d['every'](r=>r['traits']['pure_digital']),'long_cycle':d['some'](r=>r['traits']['long_cycle']),'deposit_required':d['some'](r=>r['traits']['deposit_required']),'multi_tier_allocation':d['some'](r=>r['traits']['multi_tier_allocation']),'regulatory_intensity':pickStrictest(d['map'](r=>r['traits']['regulatory_intensity']),['low','medium','high']),'trust_sensitivity':pickStrictest(d['map'](r=>r['traits']['trust_sensitivity']),['low','medium','high']),'consumption_frequency':pickStrictest(d['map'](r=>r['traits']['consumption_frequency']),['one_time','occasional','frequent']),'avg_ticket_size':pickStrictest(d['map'](r=>r['traits']['avg_ticket_size']),['micro','small','medium','large'])},f=b??'composed_'+a['join']('_and_'),g=Array['from'](new Set(d['flatMap'](r=>r['flywheel']['trustSellingPoints']))),h=Array['from'](new Set(d['flatMap'](r=>r['flywheel']['keyActions']))),i={'industry':f,'trustSellingPoints':g,'keyActions':h,'rewardStrategy':d['map'](r=>r['flywheel']['rewardStrategy'])['join']('\x20+\x20'),'discountStrategy':d['map'](r=>r['flywheel']['discountStrategy'])['join']('\x20+\x20'),'trustDescription':d['map'](r=>r['flywheel']['trustDescription'])['join']('\x20+\x20')},j=new Map();for(const r of d){for(const s of r['risk_checks']){!j['has'](s['id'])&&j['set'](s['id'],{...s,'industry':f});}}const k=new Map();for(const t of d){for(const u of t['needs']){!k['has'](u['id'])&&k['set'](u['id'],{...u});}}const l={'max_acceptable_cycle':Math['max'](...d['map'](v=>v['preference_template']['max_acceptable_cycle'])),'response_time_expectation':Math['min'](...d['map'](v=>v['preference_template']['response_time_expectation'])),'require_arbitration':d['some'](v=>v['preference_template']['require_arbitration']),'require_compensation_fund':d['some'](v=>v['preference_template']['require_compensation_fund']),'risk_appetite':pickStrictest(d['map'](v=>v['preference_template']['risk_appetite']),['aggressive','balanced','conservative']),'delivery_speed_priority':pickStrictest(d['map'](v=>v['preference_template']['delivery_speed_priority']),['flexible','normal','urgent']),'after_sales_expectation':pickStrictest(d['map'](v=>v['preference_template']['after_sales_expectation']),['minimal','basic','full'])},m={'name':f,'display_name':b??'Composed\x20Industry\x20('+a['join']('+')+')','traits':e,'source':'composed','version':'v1','flywheel':i,'risk_checks':Array['from'](j['values']()),'preference_template':l,'needs':Array['from'](k['values']()),'parent_industries':[...a],'evolution':{'version':0x1,'last_updated':Date['now'](),'signal_count':0x0,'pending_suggestions':0x0}};return registerIndustry(m),m;}function pickStrictest(a,b){let c=0x0,d=a[0x0]??b[0x0];for(const e of a){const f=b['indexOf'](e);f>=0x0&&f>c&&(c=f,d=e);}return d;}
|
|
1
|
+
import{getIndustryProfile,listIndustries,registerIndustry}from'./industry-registry.js';const TRAIT_INFERENCE_RULES=[{'keywords':['logistics','shipping','delivery','express','shipment','ship'],'trait':'has_logistics','value':!![],'weight':0.85},{'keywords':['digital','online','cloud','virtual'],'trait':'has_logistics','value':![],'weight':0.7},{'keywords':['consulting','communication','requirement-confirmation','revision-rounds','negotiate','consult'],'trait':'communication_heavy','value':!![],'weight':0.8},{'keywords':['standard-product','in-stock','one-click-order','standard','instant'],'trait':'communication_heavy','value':![],'weight':0.7},{'keywords':['digital','file','code','design-draft','electronic','online','software','source'],'trait':'pure_digital','value':!![],'weight':0.8},{'keywords':['physical','hardware','equipment'],'trait':'pure_digital','value':![],'weight':0.75},{'keywords':['course','semester','long-cycle','long-term','project-based','project'],'trait':'long_cycle','value':!![],'weight':0.75},{'keywords':['instant','in-stock','same-day','immediate'],'trait':'long_cycle','value':![],'weight':0.8},{'keywords':['rental','rent','deposit','lease','shortstay','short-stay','short\x20stay','bnb','homestay','短租'],'trait':'deposit_required','value':!![],'weight':0.9},{'keywords':['purchase','buyout','buy'],'trait':'deposit_required','value':![],'weight':0.6},{'keywords':['multi-party','segmented','multi-stage','multi-vendor','itinerary','segment'],'trait':'multi_tier_allocation','value':!![],'weight':0.75},{'keywords':['medical','legal','financial','insurance','pharmaceutical','pharma'],'trait':'regulatory_intensity','value':'high','weight':0.9},{'keywords':['education','food','construction'],'trait':'regulatory_intensity','value':'medium','weight':0.7},{'keywords':['entertainment','gaming','digital','game'],'trait':'regulatory_intensity','value':'low','weight':0.6},{'keywords':['custom','high-value','customized','bespoke'],'trait':'trust_sensitivity','value':'high','weight':0.8},{'keywords':['standard-product','small-ticket','standard','low-value'],'trait':'trust_sensitivity','value':'low','weight':0.7},{'keywords':['subscription','membership','recurring'],'trait':'consumption_frequency','value':'frequent','weight':0.85},{'keywords':['course','semester','education'],'trait':'consumption_frequency','value':'one_time','weight':0.75},{'keywords':['daily','frequent','common'],'trait':'consumption_frequency','value':'frequent','weight':0.75},{'keywords':['small-ticket','daily','convenience-store','micro'],'trait':'avg_ticket_size','value':'micro','weight':0.7},{'keywords':['retail','commodity','standard-product'],'trait':'avg_ticket_size','value':'small','weight':0.7},{'keywords':['custom','project','outsourcing'],'trait':'avg_ticket_size','value':'medium','weight':0.7},{'keywords':['real-estate','automobile','high-value','luxury','realestate','car'],'trait':'avg_ticket_size','value':'large','weight':0.85},{'keywords':['物流','配送','送货','快递','发货','运输','上门'],'trait':'has_logistics','value':!![],'weight':0.85},{'keywords':['数字','线上','云端','虚拟'],'trait':'has_logistics','value':![],'weight':0.7},{'keywords':['沟通','客服','咨询','洽谈','协商','客服沟通'],'trait':'communication_heavy','value':!![],'weight':0.8},{'keywords':['标准品','现货','一键下单','标准','即时'],'trait':'communication_heavy','value':![],'weight':0.7},{'keywords':['数字','文件','代码','设计稿','电子','线上','软件','源码','数字商品'],'trait':'pure_digital','value':!![],'weight':0.8},{'keywords':['实物','硬件','设备','线下商品'],'trait':'pure_digital','value':![],'weight':0.75},{'keywords':['课程','学期','长周期','长期','项目制'],'trait':'long_cycle','value':!![],'weight':0.75},{'keywords':['即时','现货','当天','即时交付'],'trait':'long_cycle','value':![],'weight':0.8},{'keywords':['租赁','租借','租金','押金','定金','预订金'],'trait':'deposit_required','value':!![],'weight':0.9},{'keywords':['购买','买断','现购'],'trait':'deposit_required','value':![],'weight':0.6},{'keywords':['多方','多方参与','分段','多段','多供应商','行程','路线','套餐'],'trait':'multi_tier_allocation','value':!![],'weight':0.75},{'keywords':['医疗','法律','金融','保险','医药','药企'],'trait':'regulatory_intensity','value':'high','weight':0.9},{'keywords':['教育','餐饮','建筑'],'trait':'regulatory_intensity','value':'medium','weight':0.7},{'keywords':['娱乐','游戏','数字娱乐'],'trait':'regulatory_intensity','value':'low','weight':0.6},{'keywords':['定制','高价值','高端定制'],'trait':'trust_sensitivity','value':'high','weight':0.8},{'keywords':['标准品','小额','标准','低价','廉价'],'trait':'trust_sensitivity','value':'low','weight':0.7},{'keywords':['订阅','会员','续费','复购'],'trait':'consumption_frequency','value':'frequent','weight':0.85},{'keywords':['课程','学期','学历'],'trait':'consumption_frequency','value':'one_time','weight':0.75},{'keywords':['日常','频繁','常见'],'trait':'consumption_frequency','value':'frequent','weight':0.75},{'keywords':['小额','日常','便利店','微型'],'trait':'avg_ticket_size','value':'micro','weight':0.7},{'keywords':['零售','商品','标准品'],'trait':'avg_ticket_size','value':'small','weight':0.7},{'keywords':['定制','项目','外包'],'trait':'avg_ticket_size','value':'medium','weight':0.7},{'keywords':['房产','汽车','高价值','奢侈品','贵重','豪华','高端'],'trait':'avg_ticket_size','value':'large','weight':0.85},{'keywords':['酒店','住宿','民宿','客栈','宾馆','客房','房源','门店','到店','线下','度假村','公寓','旅馆','机票','旅游','旅行','行程','度假','门票','游轮','hotel','hostel','apartment','resort','stay','room','property','accommodation','lodging','bnb','homestay','shortstay','短租','flight','itinerary','tourism','travel','trip','vacation'],'trait':'has_logistics','value':!![],'weight':0.8},{'keywords':['预订','预约','订房','下单','退房','入住','核销','行程','签证','门票','机票','旅游','旅行','度假','booking','reservation','reservation','check-in','checkin','checkout','check-out','itinerary','flight','ticket','vacation','travel','trip'],'trait':'multi_tier_allocation','value':!![],'weight':0.75},{'keywords':['实名','证件','身份证','核销','核验','凭证','资质','持证','真实房源','验真'],'trait':'trust_sensitivity','value':'high','weight':0.8},{'keywords':['酒店','住宿','民宿','客栈','旅游','旅行','度假','签证','旅行社','旅馆','hospitality','tourism','visa','lodging'],'trait':'regulatory_intensity','value':'medium','weight':0.8},{'keywords':['单次','一次性','单晚','单程','单间','每晚','按晚'],'trait':'consumption_frequency','value':'one_time','weight':0.75},{'keywords':['房费','房价','客单价','高客单','机票','游轮','度假套餐','酒店','住宿','民宿','客栈','度假村','度假','签证','hotel','hostel','resort','flight','accommodation','lodging'],'trait':'avg_ticket_size','value':'large','weight':0.85},{'keywords':['门店','到店','线下','实地','面对面'],'trait':'pure_digital','value':![],'weight':0.75},{'keywords':['沟通','客服','messenger','咨询','售后沟通'],'trait':'communication_heavy','value':!![],'weight':0.8}];export const DEFAULT_TRAITS={'has_logistics':![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'occasional','avg_ticket_size':'small'};export function inferTraitsFromDescription(a){const b=(a??'')['toLowerCase'](),c=[],d=new Map(),e=new Map();for(const i of TRAIT_INFERENCE_RULES){const j=i['keywords']['find'](l=>b['includes'](l['toLowerCase']()));if(j){c['push'](j);const l=d['get'](i['trait'])??0x0;i['weight']>l&&(d['set'](i['trait'],i['weight']),e['set'](i['trait'],i['value']));}}const f={...DEFAULT_TRAITS};for(const [m,n]of e['entries']()){f[m]=n;}const g=d['size'],h=Math['min'](0x1,g/0xa);return{'traits':f,'confidence':h,'matched_keywords':Array['from'](new Set(c)),'trait_confidence':Object['fromEntries'](d)};}const ENUM_TRAIT_SCALES={'regulatory_intensity':['low','medium','high'],'trust_sensitivity':['low','medium','high'],'consumption_frequency':['one_time','occasional','frequent'],'avg_ticket_size':['micro','small','medium','large']},BOOLEAN_TRAIT_KEYS=['has_logistics','communication_heavy','pure_digital','long_cycle','deposit_required','multi_tier_allocation'],ENUM_TRAIT_KEYS=['regulatory_intensity','trust_sensitivity','consumption_frequency','avg_ticket_size'],EVIDENCE_THRESHOLD=0.5;export const INDUSTRY_REQUIRED_TRAITS={'subscription':[{'trait':'pure_digital','value':!![],'reason':'subscription\x20build\x20notes:\x20\x27Pure\x20digital\x20—\x20native\x20WoWok\x20soil\x27'}],'retail':[{'trait':'has_logistics','value':!![],'reason':'retail\x20fulfilment\x20is\x20physical\x20shipping'}],'retail_d2c':[{'trait':'has_logistics','value':!![],'reason':'retail_d2c\x20fulfilment\x20is\x20physical\x20shipping'}],'rental':[{'trait':'deposit_required','value':!![],'reason':'rental\x20without\x20a\x20deposit\x20is\x20not\x20the\x20rental\x20model'}],'travel':[{'trait':'has_logistics','value':!![],'reason':'travel\x20fulfilment\x20happens\x20at\x20a\x20physical\x20destination'},{'trait':'multi_tier_allocation','value':!![],'reason':'travel\x20splits\x20guest\x20/\x20property\x20/\x20payment\x20legs'}],'education':[{'trait':'long_cycle','value':!![],'reason':'education\x20delivers\x20over\x20a\x20course/term\x20cycle'}],'freelance':[{'trait':'communication_heavy','value':!![],'reason':'freelance\x20is\x20requirement-confirmation\x20driven'}],'general':[]};export function traitContradictions(a,b,c){const d=INDUSTRY_REQUIRED_TRAITS[a];if(!d||d['length']===0x0)return[];const e=[];for(const f of d){const g=b[f['trait']],h=typeof f['value']==='boolean'?g!==f['value']:g!==f['value'];if(!h)continue;const i=c?.[f['trait']];if(c&&(i===undefined||i<EVIDENCE_THRESHOLD))continue;e['push'](f);}return e;}export function filterConsistentIndustries(a,b,c){const d=[],e=[];for(const f of a){const g=traitContradictions(f['industry'],b,c);if(g['length']>0x0)e['push']({'industry':f['industry'],'contradictions':g});else d['push'](f);}return{'consistent':d,'inconsistent':e};}export const DOMAIN_PRIORS=[{'domain':'travel_accommodation','keywords':['酒店','住宿','民宿','客栈','宾馆','旅馆','客房','房源','公寓','度假村','度假','旅游','旅行','机票','门票','行程','预订','订房','下单','入住','退房','核销','签证','hotel','hostel','apartment','resort','flight','ticket','itinerary','reservation','booking','check-in','checkin','checkout','check-out','stay','room','property','vacation','travel','trip','ota','accommodation','lodging','bnb','homestay','shortstay','short-stay','短租'],'industries':['travel','rental'],'boost':0.15}];export function detectDomainPriors(a){const b=(a??'')['toLowerCase'](),c=[];for(const d of DOMAIN_PRIORS){const e=d['keywords']['filter'](f=>b['includes'](f['toLowerCase']()));if(e['length']===0x0)continue;c['push']({'domain':d['domain'],'matched_keywords':Array['from'](new Set(e)),'industries':[...d['industries']],'boost':d['boost']});}return c;}function dimAffinity(c,d,e){if(d===e)return 0x1;const f=ENUM_TRAIT_SCALES[c];if(!f)return 0x0;const g=f['indexOf'](String(d)),h=f['indexOf'](String(e));if(g<0x0||h<0x0)return 0x0;const i=f['length']-0x1;return Math['max'](0x0,0x1-Math['abs'](g-h)/ i);}const REQUIREMENT_SUPPORT_WEIGHT=0.25;export function requirementSupport(a,b,c){const d=INDUSTRY_REQUIRED_TRAITS[a];if(!d||d['length']===0x0)return undefined;let e=0x0;for(const f of d){const g=c?.[f['trait']];if(c&&(g===undefined||g<EVIDENCE_THRESHOLD)){e+=0.5;continue;}e+=b[f['trait']]===f['value']?0x1:0x0;}return e/d['length'];}export function findSimilarIndustries(a,b,d){const e=listIndustries(),f=[],g=d?.['trait_confidence'],h=[...BOOLEAN_TRAIT_KEYS,...ENUM_TRAIT_KEYS];for(const i of e){const j=i['traits'];let l=0x0;const m=[],n=[],o=[];for(const s of h){const t=dimAffinity(s,a[s],j[s]),u=g?.[s],v=g===undefined||u!==undefined&&u>=EVIDENCE_THRESHOLD;if(v){o['push'](s);if(t===0x1)m['push'](s);else n['push'](s);}l+=v?t:0.5;}const p=l/h['length'],q=requirementSupport(i['name'],a,d?.['trait_confidence']),r=q===undefined?p:p+REQUIREMENT_SUPPORT_WEIGHT*q;f['push']({'industry':i['name'],'similarity':r,'matched_traits':m,'contradicted_traits':n,'evidenced_traits':o,'trait_distance':Number((0x1-r)['toFixed'](0x4)),...q===undefined?{}:{'requirement_support':Number(q['toFixed'](0x4))}});}return f['sort']((w,x)=>x['similarity']-w['similarity']),typeof b==='number'?f['slice'](0x0,Math['max'](0x0,b)):f;}const FALLBACK_RISK_CHECK_RULES=[{'trait_key':'deposit_required','trait_value':!![],'check':{'id':'fb_deposit_lock','description':'Deposit\x20lock-period\x20safety\x20(deposit\x20cannot\x20be\x20withdrawn\x20by\x20merchant\x20at\x20any\x20time)','weight':0x1e,'passed':a=>a?.['fund_safety']?.['lock_duration_safe']??![],'advice':'⚠️\x20Lock\x20period\x20unsafe:\x20deposit\x20may\x20be\x20withdrawn\x20at\x20any\x20time;\x20recommend\x20requiring\x20a\x20lock\x20period\x20≥\x207\x20days.'},'need':{'id':'need_deposit_lock','tier':'personalized','description':'Deposit\x20lock-period\x20safety','satisfied':a=>a?.['fund_safety']?.['lock_duration_safe']??![],'advice':'Deposit\x20lock-period\x20unsafe.'}},{'trait_key':'has_logistics','trait_value':!![],'check':{'id':'fb_logistics_track','description':'Logistics\x20Guard\x20configuration\x20(shipping/receipt\x20verification)','weight':0x19,'passed':a=>a?.['workflow_analysis']?.['has_milestone_nodes']??![],'advice':'⚠️\x20No\x20logistics\x20Guard:\x20shipping\x20and\x20receipt\x20status\x20are\x20not\x20verified\x20by\x20a\x20third\x20party.'}},{'trait_key':'pure_digital','trait_value':!![],'check':{'id':'fb_wip_verified','description':'WIP\x20hash\x20verification\x20(digital\x20deliverables\x20traceable)','weight':0x19,'passed':a=>a?.['service_basics']?.['wip_verified']===!![],'advice':'⚠️\x20WIP\x20not\x20verified:\x20digital\x20deliverables\x20cannot\x20be\x20traced.'}},{'trait_key':'long_cycle','trait_value':!![],'check':{'id':'fb_milestone','description':'Milestone\x20nodes\x20(phased\x20acceptance)','weight':0x19,'passed':a=>a?.['workflow_analysis']?.['has_milestone_nodes']??![],'advice':'⚠️\x20No\x20milestone\x20nodes:\x20long-cycle\x20projects\x20lack\x20phased\x20acceptance.'}},{'trait_key':'regulatory_intensity','trait_value':'high','check':{'id':'fb_compliance','description':'Compliance\x20configuration\x20(arbitration\x20+\x20compensation\x20fund)','weight':0x1e,'passed':a=>(a?.['workflow_analysis']?.['has_arbitration_path']??![])&&(a?.['service_basics']?.['compensation_fund_balance']??0x0n)>0x0n,'advice':'🔴\x20Compliance\x20requirement\x20not\x20met:\x20highly\x20regulated\x20industries\x20must\x20configure\x20arbitration\x20and\x20a\x20compensation\x20fund.'}},{'trait_key':'multi_tier_allocation','trait_value':!![],'check':{'id':'fb_multi_tier_fair','description':'Multi-tier\x20allocation\x20fairness\x20(each\x20segment\x20has\x20a\x20corresponding\x20Allocator)','weight':0x14,'passed':a=>(a?.['workflow_analysis']?.['total_nodes']??0x0)>=0x3,'advice':'⚠️\x20Multi-tier\x20allocation\x20requires\x20corresponding\x20nodes\x20and\x20Allocators,\x20otherwise\x20fund\x20distribution\x20is\x20opaque.'}}];function buildFallbackFlywheel(a,b){const c=['Fund\x20escrow\x20+\x20process\x20transparency'];if(b['deposit_required'])c['push']('Deposit\x20escrow\x20+\x20lock-period\x20guarantee');if(b['has_logistics'])c['push']('Logistics\x20Guard\x20verification');if(b['pure_digital'])c['push']('WIP\x20digital\x20deliverable\x20traceability');if(b['regulatory_intensity']==='high')c['push']('Compliant\x20arbitration\x20+\x20compensation\x20fund\x20guarantee');const d=[{'action':'Set\x20first-order\x20Reward','purpose':'Attract\x20new\x20customers','mutableField':'rewards','metricToWatch':'New\x20customer\x20order\x20rate'},{'action':'Configure\x20compensation_fund','purpose':'Improve\x20trust\x20score','mutableField':'compensation_fund','metricToWatch':'Trust\x20score'}];return b['long_cycle']&&d['push']({'action':'Milestone\x20Reward','purpose':'Incentivize\x20completion\x20of\x20long-cycle\x20projects','mutableField':'rewards','metricToWatch':'Completion\x20rate'}),b['consumption_frequency']==='frequent'&&d['push']({'action':'Loyalty\x20Reward','purpose':'Improve\x20repurchase','mutableField':'rewards','metricToWatch':'Repurchase\x20rate'}),{'industry':a,'trustSellingPoints':c,'keyActions':d,'rewardStrategy':'First-order\x20reward\x20+\x20referral\x20cashback'+(b['consumption_frequency']==='frequent'?'\x20+\x20loyalty\x20reward':''),'discountStrategy':b['long_cycle']?'Long-term\x20cooperation\x20discount\x20+\x20tiered\x20discount':'First-order\x20discount\x20+\x20spend-threshold\x20discount','trustDescription':c['join']('\x20+\x20')};}function buildFallbackPreferenceTemplate(a){return{'max_acceptable_cycle':a['long_cycle']?0x5a:0xe,'response_time_expectation':a['communication_heavy']?0x4:0xc,'require_arbitration':a['regulatory_intensity']!=='low'||a['trust_sensitivity']==='high','require_compensation_fund':a['trust_sensitivity']==='high'||a['deposit_required'],'risk_appetite':a['trust_sensitivity']==='high'?'conservative':'balanced','delivery_speed_priority':a['has_logistics']&&a['consumption_frequency']==='frequent'?'urgent':'normal','after_sales_expectation':a['trust_sensitivity']==='high'?'full':'basic'};}export function synthesizeProfile(a,b){const c=findSimilarIndustries(a,0x1),d=c[0x0],e=d&&d['similarity']>=0.6?getIndustryProfile(d['industry']):undefined,f=b??'custom_'+Date['now']()['toString'](0x24),g=b??'Custom\x20Industry',h=e?{...e['flywheel'],'industry':f}:buildFallbackFlywheel(f,a),i=e?{...e['preference_template'],'max_acceptable_cycle':a['long_cycle']?Math['max'](e['preference_template']['max_acceptable_cycle'],0x5a):e['preference_template']['max_acceptable_cycle'],'require_compensation_fund':a['trust_sensitivity']==='high'?!![]:e['preference_template']['require_compensation_fund']}:buildFallbackPreferenceTemplate(a),j=[],k=[];for(const l of FALLBACK_RISK_CHECK_RULES){a[l['trait_key']]===l['trait_value']&&(j['push']({...l['check'],'industry':f}),l['need']&&k['push']({...l['need']}));}return j['length']===0x0&&j['push']({'id':'fb_basic_arbitration','industry':f,'description':'Configure\x20arbitration\x20(basic\x20dispute\x20resolution)','weight':0x64,'passed':m=>m?.['workflow_analysis']?.['has_arbitration_path']??![],'advice':'⚠️\x20No\x20arbitration\x20configured:\x20basic\x20disputes\x20have\x20no\x20resolution\x20channel.'}),{'name':f,'display_name':g,'traits':a,'source':'inferred','version':'v1','flywheel':h,'risk_checks':j,'preference_template':i,'needs':k,'confidence':d?.['similarity']??0.3,'evolution':{'version':0x1,'last_updated':Date['now'](),'signal_count':0x0,'pending_suggestions':0x0}};}export function composeIndustries(a,b){if(!a||a['length']===0x0)return undefined;const d=[];for(const o of a){const q=getIndustryProfile(o);if(!q)return undefined;d['push'](q);}const e={'has_logistics':d['some'](r=>r['traits']['has_logistics']),'communication_heavy':d['some'](r=>r['traits']['communication_heavy']),'pure_digital':d['every'](r=>r['traits']['pure_digital']),'long_cycle':d['some'](r=>r['traits']['long_cycle']),'deposit_required':d['some'](r=>r['traits']['deposit_required']),'multi_tier_allocation':d['some'](r=>r['traits']['multi_tier_allocation']),'regulatory_intensity':pickStrictest(d['map'](r=>r['traits']['regulatory_intensity']),['low','medium','high']),'trust_sensitivity':pickStrictest(d['map'](r=>r['traits']['trust_sensitivity']),['low','medium','high']),'consumption_frequency':pickStrictest(d['map'](r=>r['traits']['consumption_frequency']),['one_time','occasional','frequent']),'avg_ticket_size':pickStrictest(d['map'](r=>r['traits']['avg_ticket_size']),['micro','small','medium','large'])},f=b??'composed_'+a['join']('_and_'),g=Array['from'](new Set(d['flatMap'](r=>r['flywheel']['trustSellingPoints']))),h=Array['from'](new Set(d['flatMap'](r=>r['flywheel']['keyActions']))),i={'industry':f,'trustSellingPoints':g,'keyActions':h,'rewardStrategy':d['map'](r=>r['flywheel']['rewardStrategy'])['join']('\x20+\x20'),'discountStrategy':d['map'](r=>r['flywheel']['discountStrategy'])['join']('\x20+\x20'),'trustDescription':d['map'](r=>r['flywheel']['trustDescription'])['join']('\x20+\x20')},j=new Map();for(const r of d){for(const s of r['risk_checks']){!j['has'](s['id'])&&j['set'](s['id'],{...s,'industry':f});}}const k=new Map();for(const t of d){for(const u of t['needs']){!k['has'](u['id'])&&k['set'](u['id'],{...u});}}const l={'max_acceptable_cycle':Math['max'](...d['map'](v=>v['preference_template']['max_acceptable_cycle'])),'response_time_expectation':Math['min'](...d['map'](v=>v['preference_template']['response_time_expectation'])),'require_arbitration':d['some'](v=>v['preference_template']['require_arbitration']),'require_compensation_fund':d['some'](v=>v['preference_template']['require_compensation_fund']),'risk_appetite':pickStrictest(d['map'](v=>v['preference_template']['risk_appetite']),['aggressive','balanced','conservative']),'delivery_speed_priority':pickStrictest(d['map'](v=>v['preference_template']['delivery_speed_priority']),['flexible','normal','urgent']),'after_sales_expectation':pickStrictest(d['map'](v=>v['preference_template']['after_sales_expectation']),['minimal','basic','full'])},m={'name':f,'display_name':b??'Composed\x20Industry\x20('+a['join']('+')+')','traits':e,'source':'composed','version':'v1','flywheel':i,'risk_checks':Array['from'](j['values']()),'preference_template':l,'needs':Array['from'](k['values']()),'parent_industries':[...a],'evolution':{'version':0x1,'last_updated':Date['now'](),'signal_count':0x0,'pending_suggestions':0x0}};return registerIndustry(m),m;}function pickStrictest(a,b){let c=0x0,d=a[0x0]??b[0x0];for(const e of a){const f=b['indexOf'](e);f>=0x0&&f>c&&(c=f,d=e);}return d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFlywheelForIndustry,listIndustries as
|
|
1
|
+
import{getFlywheelForIndustry,listIndustries as a203a,_setRegistryLookup as a203b}from'./acquisition-flywheel.js';import{getIndustryRiskChecks,getIndustryNeeds,getIndustryTemplate,SUPPORTED_INDUSTRIES}from'../customer/index.js';import{_setRegistryLookup as a203c}from'../customer/industry-risks.js';import{_setRegistryLookup as a203d}from'../customer/user-preferences.js';export function isRegisteredIndustry(a){if(!a)return![];const b=resolveIndustryName(a)??a['toLowerCase']();return b==='general'||registry['has'](b);}const BUILTIN_TRAITS={'freelance':{'has_logistics':![],'communication_heavy':!![],'pure_digital':!![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'high','consumption_frequency':'occasional','avg_ticket_size':'medium'},'rental':{'has_logistics':!![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':!![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'high','consumption_frequency':'occasional','avg_ticket_size':'medium'},'education':{'has_logistics':![],'communication_heavy':!![],'pure_digital':![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'medium','trust_sensitivity':'high','consumption_frequency':'one_time','avg_ticket_size':'large'},'travel':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':!![],'regulatory_intensity':'medium','trust_sensitivity':'high','consumption_frequency':'one_time','avg_ticket_size':'large'},'subscription':{'has_logistics':![],'communication_heavy':![],'pure_digital':!![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'frequent','avg_ticket_size':'small'},'retail':{'has_logistics':!![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'frequent','avg_ticket_size':'small'}},BUILTIN_DISPLAY_NAMES={'freelance':'Freelance','rental':'Rental','education':'Education','travel':'Travel','subscription':'Subscription','retail':'Retail','general':'General','custom':'Custom'},INDUSTRY_ALIASES={'outsourcing':'freelance','design':'freelance','development':'freelance','consulting':'freelance','rent':'rental','lease':'rental','course':'education','training':'education','tourism':'travel','itinerary':'travel','membership':'subscription','ecommerce':'retail','goods':'retail','freelancer':'freelance','gig':'freelance','edu':'education','trip':'travel','tour':'travel','subscribe':'subscription','shop':'retail','general_industry':'general','amazon':'retail','etsy':'retail','upwork':'freelance','fiverr':'freelance','contra':'freelance','airbnb':'rental','ziroom':'rental','turo':'rental','getaround':'rental','coursera':'education','udemy':'education','yuanfudao':'education','booking':'travel','klook':'travel','patreon':'subscription','onlyfans':'subscription','substack':'subscription','bnb':'rental','homestay':'rental','shortstay':'rental','short-stay':'rental','short-term-rental':'rental'};export const INDUSTRY_REGISTRY_VERSION=0x1;const registry=new Map();function seedBuiltinProfile(a){const b=BUILTIN_TRAITS[a];if(!b)return undefined;const c=getFlywheelForIndustry(a);if(!c)return undefined;const d=getIndustryRiskChecks(a),e=getIndustryNeeds(a),f=getIndustryTemplate(a);return{'name':a,'display_name':BUILTIN_DISPLAY_NAMES[a]??a,'traits':b,'source':'builtin','version':'v1','flywheel':c,'risk_checks':d,'preference_template':f,'needs':e};}function seedBuiltinIndustries(){for(const a of SUPPORTED_INDUSTRIES){const b=seedBuiltinProfile(a);b&®istry['set'](a,b);}}seedBuiltinIndustries(),injectRegistryLookup();function injectRegistryLookup(){a203b(a=>{const b=registry['get'](a);return b?{'flywheel':b['flywheel']}:undefined;}),a203c(a=>{const b=registry['get'](a);return b?{'risk_checks':b['risk_checks'],'needs':b['needs']}:undefined;}),a203d(a=>{const b=registry['get'](a);return b?{'preference_template':b['preference_template']}:undefined;});}export function getIndustryProfile(a){const b=registry['get'](a);return b?JSON['parse'](JSON['stringify'](b)):undefined;}export function listIndustries(a){const b=Array['from'](registry['values']());if(a?.['source'])return b['filter'](c=>c['source']===a['source']);return b;}export function registerIndustry(a){if(!a['name']||!a['traits']||!a['flywheel'])return![];return registry['set'](a['name'],a),!![];}export function getIndustryTraits(a){return registry['get'](a)?.['traits'];}export function resolveIndustryName(a){if(!a||typeof a!=='string')return undefined;const b=a['trim']();if(!b)return undefined;const c=b['toLowerCase']();if(INDUSTRY_ALIASES[b])return INDUSTRY_ALIASES[b];if(INDUSTRY_ALIASES[c])return INDUSTRY_ALIASES[c];if(registry['has'](b))return b;if(registry['has'](c))return c;return undefined;}export function getRegistrySize(){return registry['size'];}export function _resetRegistryForTest(){registry['clear'](),a203b(null),a203c(null),a203d(null),seedBuiltinIndustries(),injectRegistryLookup();}export function listBuiltinIndustryNames(){return a203a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{query_events}from'@wowok/wowok';import{batchQueryObjectsByIds as
|
|
1
|
+
import{query_events}from'@wowok/wowok';import{batchQueryObjectsByIds as a207a}from'../graph/onchain/sdk-batch.js';function toStr(a){if(typeof a==='string')return a;if(typeof a==='number'||typeof a==='bigint')return String(a);return undefined;}async function collectObjectIdsByEvent(a,b,c,d,e){const f=new Set();let g=null,h=![];while(f['size']<d){const i=await query_events({'type':a,'cursor':g,'limit':0x32,'order':'descending','no_cache':e,'network':c}),j=i?.['data']??[];if(j['length']===0x0)break;for(const k of j){const l=b(k);if(l)f['add'](l);}h=!!(i?.['hasNextPage']&&i?.['nextCursor']);if(!h)break;g=i?.['nextCursor']??null;}return{'ids':Array['from'](f)['slice'](0x0,d),'hasMore':h};}export async function enumerateServices(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ServiceEvent',i=>typeof i?.['object']==='string'?i['object']:undefined,a,c,b['no_cache']),f=await a207a(d,a,b['no_cache']),g=(b['location_any']??[])['map'](i=>i['toLowerCase']()),h=f['filter'](i=>(i?.['type']??'')==='Service')['filter'](i=>{if(g['length']===0x0)return!![];const j=typeof i?.['location']==='string'?i['location']['toLowerCase']():'';return g['some'](k=>j['includes'](k));})['map'](i=>({'object':String(i['object']),'name':typeof i['name']==='string'?i['name']:undefined,'location':typeof i['location']==='string'?i['location']:'','json':{...i,'compensation_fund':toStr(i['compensation_fund']),'sales':Array['isArray'](i['sales'])?i['sales']['map'](j=>({...j,'price':toStr(j['price'])})):[]}}));return{'services':h,'total_enumerated':h['length'],'has_more':e};}export async function enumerateDemands(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('DemandChangedEvent',h=>typeof h?.['object']==='string'?h['object']:undefined,a,c,b['no_cache']),f=await a207a(d,a,b['no_cache']),g=f['filter'](h=>(h?.['type']??'')==='Demand')['map'](h=>h);return{'demands':g,'total_enumerated':g['length'],'has_more':e};}export async function enumerateArbs(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ArbEvent',i=>typeof i?.['arb']==='string'?i['arb']:undefined,a,c,b['no_cache']),f=await a207a(d,a,b['no_cache']),g=b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']:[b['status']],h=f['filter'](i=>(i?.['type']??'')==='Arb')['map'](i=>i)['filter'](i=>b['arbitration']?i['arbitration']===b['arbitration']:!![])['filter'](i=>b['order']?i['order']===b['order']:!![])['filter'](i=>g?g['includes'](Number(i['status'])):!![]);return{'arbs':h,'total_enumerated':h['length'],'has_more':e};}
|
|
@@ -99,4 +99,10 @@ export interface AmbiguityLint {
|
|
|
99
99
|
warnings: string[];
|
|
100
100
|
}
|
|
101
101
|
export declare function lintForwardAmbiguity(nodes: unknown[], context?: string): AmbiguityLint;
|
|
102
|
+
export interface LoopCycle {
|
|
103
|
+
from: string;
|
|
104
|
+
to: string;
|
|
105
|
+
cycle: string[];
|
|
106
|
+
}
|
|
107
|
+
export declare function findLoopCycles(adjacency: Map<string, string[]>): LoopCycle[];
|
|
102
108
|
export declare const MACHINE_TOPOLOGY_VERSION = "1.0.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT}from'./onchain-constants.js';export{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT};export function analyzeTopology(a,b){const c=a['map'](t=>t['name']),d=new Set(c),e=new Map(),f=new Map();for(const t of c){e['set'](t,[]),f['set'](t,[]);}for(const u of b){!e['has'](u['prev_node'])&&u['prev_node']!==''&&e['set'](u['prev_node'],[]),!f['has'](u['next_node'])&&f['set'](u['next_node'],[]),u['prev_node']!==''&&e['get'](u['prev_node'])['push'](u['next_node']),f['get'](u['next_node'])['push'](u['prev_node']);}const g=b['filter'](v=>v['prev_node']==='')['map'](v=>v['next_node'])['filter'](v=>d['has'](v)),h=c['filter'](v=>(e['get'](v)||[])['length']===0x0),i=c['filter'](v=>!g['includes'](v)&&(f['get'](v)||[])['length']===0x0),j=c['filter'](v=>(e['get'](v)||[])['length']===0x0&&!h['includes'](v)),{has_cycles:k,cycle_nodes:l}=detectCycles(c,b),m=analyzeDeadBranches(b),n=findUnachievableThresholds(b),o=computeReachability(c,b),p=b['reduce']((v,w)=>v+w['forwards']['length'],0x0),q=Math['max'](0x0,...b['map'](v=>v['forwards']['length'])),r=Math['max'](0x0,...b['flatMap'](v=>v['forwards']['map'](w=>countRetainedSubmissions(w['retained_submission'])))),s={'max_node_count':a['length']<=MAX_NODE_COUNT,'max_node_pair_count':b['length']<=MAX_NODE_PAIR_COUNT,'max_forward_count':q<=MAX_FORWARD_COUNT,'max_forward_order_count':r<=MAX_FORWARD_ORDER_COUNT,'threshold_achievable':n['length']===0x0};return{'entry_nodes':g,'terminal_nodes':h,'orphaned_nodes':i,'dead_end_nodes':j,'dead_branches':m,'unachievable_thresholds':n,'has_cycles':k,'cycle_nodes':l,'reachability':o,'node_count':a['length'],'pair_count':b['length'],'forward_count':p,'within_limits':s};}export function findUnachievableThresholds(a){const b=[];for(const c of a){const d=c['forwards']['length'],e=c['forwards']['reduce']((g,h)=>g+Number(h['weight']||0x0),0x0);if(e<c['threshold']){const f=c['threshold']>0x1&&d<c['threshold'];b['push']({'prev_node':c['prev_node'],'next_node':c['next_node'],'threshold':c['threshold'],'max_achievable':e,'distinct_forwards':d,'reason':f?'Threshold\x20'+c['threshold']+'\x20needs\x20'+c['threshold']+'\x20distinct\x20forwards\x20(each\x20forward\x20is\x20single-operator-locked\x20and\x20contributes\x20its\x20weight\x20at\x20most\x20once);\x20this\x20Pair\x20has\x20'+d+'\x20forward(s)\x20summing\x20to\x20'+e+'.\x20Add\x20more\x20parallel\x20forwards\x20or\x20lower\x20the\x20threshold.':'Threshold\x20'+c['threshold']+'\x20exceeds\x20max\x20achievable\x20weight\x20'+e+'\x20(sum\x20of\x20distinct\x20forward\x20weights).\x20The\x20transition\x20can\x20never\x20migrate.'});}}return b;}function countRetainedSubmissions(a){if(a===undefined||a===null)return 0x0;if(Array['isArray'](a))return a['length'];if(typeof a==='string')return a['length']>0x0?0x1:0x0;return 0x0;}export function detectCycle(a,b){const c=a['map'](d=>d['name']);return detectCycles(c,b);}function detectCycles(a,b){const c=new Map();for(const k of a)c['set'](k,[]);for(const l of b){l['prev_node']!==''&&c['has'](l['prev_node'])&&c['get'](l['prev_node'])['push'](l['next_node']);}const d=0x0,e=0x1,f=0x2,g=new Map();for(const m of a)g['set'](m,d);const h=[],i=[];function j(n){g['set'](n,e),i['push'](n);for(const o of c['get'](n)||[]){if(g['get'](o)===e){const p=i['indexOf'](o);return h['push'](i['slice'](p)),!![];}if(g['get'](o)===d){if(j(o))return!![];}}return i['pop'](),g['set'](n,f),![];}for(const n of a){g['get'](n)===d&&j(n);}return{'has_cycles':h['length']>0x0,'cycle_nodes':h};}function analyzeDeadBranches(a){const b=[],c=new Map();for(const d of a){if(!c['has'](d['prev_node']))c['set'](d['prev_node'],[]);c['get'](d['prev_node'])['push'](d);}for(const [e,f]of c){if(f['length']<=0x1)continue;const g=Math['min'](...f['map'](h=>h['threshold']));for(const h of f){h['threshold']>g*0x2&&b['push']({'pair':{'prev_node':h['prev_node'],'next_node':h['next_node']},'reason':'Threshold\x20'+h['threshold']+'\x20is\x20much\x20higher\x20than\x20competing\x20minimum\x20'+g+'.\x20Likely\x20always\x20loses.','competing_with':f['filter'](i=>i!==h)['map'](i=>i['next_node'])});}}return b;}function computeReachability(a,b){const c=new Map();for(const e of a)c['set'](e,[]);for(const f of b){if(f['prev_node']!==''){if(!c['has'](f['prev_node']))c['set'](f['prev_node'],[]);c['get'](f['prev_node'])['push'](f['next_node']);}}const d=new Map();for(const g of a){const h=new Set(),i=[g];while(i['length']>0x0){const j=i['shift']();for(const k of c['get'](j)||[]){!h['has'](k)&&(h['add'](k),i['push'](k));}}d['set'](g,h);}return d;}export function isReachableFromEntry(a,b){for(const c of b['entry_nodes']){if(c===a)return!![];if(b['reachability']['get'](c)?.['has'](a))return!![];}return![];}export function getNodesReachingTerminals(a){const b=new Set();for(const [c,d]of a['reachability']){for(const e of a['terminal_nodes']){if(d['has'](e)){b['add'](c);break;}}}return b;}export function formatTopologySummary(a){const b=['Nodes:\x20'+a['node_count']+'\x20(max\x20100)','Pairs:\x20'+a['pair_count']+'\x20(max\x2040)','Forwards:\x20'+a['forward_count']+'\x20(max\x2020\x20per\x20Pair)','','Entry\x20nodes:\x20'+(a['entry_nodes']['join'](',\x20')||'(none)'),'Terminal\x20nodes:\x20'+(a['terminal_nodes']['join'](',\x20')||'(none)'),'Orphaned\x20nodes:\x20'+(a['orphaned_nodes']['join'](',\x20')||'(none)'),'Dead\x20branches:\x20'+a['dead_branches']['length'],'Unachievable\x20thresholds:\x20'+a['unachievable_thresholds']['length'],'Cycles:\x20'+(a['has_cycles']?'YES\x20(❌\x20invalid\x20DAG)':'NO\x20(✓\x20valid\x20DAG)'),'','Within\x20on-chain\x20limits:\x20'+(a['within_limits']['max_node_count']&&a['within_limits']['max_node_pair_count']&&a['within_limits']['max_forward_count']&&a['within_limits']['max_forward_order_count']&&a['within_limits']['threshold_achievable']?'YES\x20✓':'NO\x20❌')];return b['join']('\x0a');}export function identifyTopologyPattern(a){const b=new Map(),c=new Map();for(const d of a){if(!b['has'](d['prev_node']))b['set'](d['prev_node'],[]);b['get'](d['prev_node'])['push'](d['next_node']);if(!c['has'](d['next_node']))c['set'](d['next_node'],[]);c['get'](d['next_node'])['push'](d['prev_node']);}for(const [e,f]of b){if(f['length']>0x1&&e!=='')return'P-M-COMPETING';}for(const [g,h]of c){if(h['length']>0x1)return'P-M-FORKMERGE';}return'P-M-LINEAR';}const FUND_REVERSING_NODE_RE=/(^|_)(cancel(led)?|refund(ed)?|return(ed|_approved)?|expired)(_|$)/i;export function flattenMachineNodeEdges(a){const b=[];for(const c of Array['isArray'](a)?a:[]){const d=c,e=typeof d?.['name']==='string'?d['name']:'';for(const g of Array['isArray'](d?.['pairs'])?d['pairs']:[]){const h=typeof g?.['prev_node']==='string'?g['prev_node']:'',i=typeof g?.['next_node']==='string'&&g['next_node']?g['next_node']:e,j=typeof g?.['threshold']==='number'?g['threshold']:undefined;for(const k of Array['isArray'](g?.['forwards'])?g['forwards']:[]){const l=k,m=typeof l?.['name']==='string'?l['name']:'';if(!m||!i)continue;const n=l?.['namedOperator']??l?.['named_operator'],o=l?.['permissionIndex']??l?.['permission_index'];b['push']({'prev_node':h,'next_node':i,'forward':m,'weight':typeof l?.['weight']==='number'?l['weight']:undefined,'threshold':j,'guard':typeof l?.['guard']==='string'?l['guard']:null,'operator':typeof n==='string'?n:null,'permission_index':typeof o==='number'?o:null});}}}return b;}function bindingKey(a){return(a['threshold']??0x0)+'|'+(a['weight']??0x0)+'|'+(a['guard']??'')+'|'+(a['operator']??'')+'|'+(a['permission_index']??'');}export function findForwardAmbiguities(a){const b=new Map();for(const d of a){const f=d['prev_node']+'\x00'+d['forward'],h=b['get'](f);if(h)h['push'](d);else b['set'](f,[d]);}const c=[];for(const [,i]of b){const j=[...new Set(i['map'](p=>p['next_node']))];if(j['length']<0x2)continue;const k=j['filter'](p=>FUND_REVERSING_NODE_RE['test'](p)),l=k['length']>0x0&&k['length']<j['length'],m=new Set(i['map'](bindingKey)),n=m['size']>0x1,o=j['filter'](p=>!FUND_REVERSING_NODE_RE['test'](p));c['push']({'prev_node':i[0x0]['prev_node'],'forward':i[0x0]['forward'],'destinations':j['sort'](),'fund_conflict':l,'binding_differs':n,'severity':l?'critical':'warning','reason':l?'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20both\x20refund\x20node(s)\x20['+k['join'](',\x20')+']\x20and\x20continue\x20node(s)\x20['+o['join'](',\x20')+'].\x20The\x20destination\x20is\x20a\x20CALLER\x20argument\x20(progress.move:540),\x20so\x20the\x20wrong\x20pick\x20puts\x20the\x20order\x20in\x20a\x20node\x20whose\x20Allocator\x20never\x20fires\x20—\x20the\x20escrow\x20strands.':'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20'+j['length']+'\x20destinations\x20['+j['join'](',\x20')+'];\x20the\x20caller\x20picks\x20which,\x20so\x20the\x20workflow\x20outcome\x20depends\x20on\x20an\x20argument\x20the\x20Machine\x20does\x20not\x20constrain'+(n?'\x20—\x20and\x20the\x20candidate\x20edges\x20carry\x20DIFFERENT\x20guard/operator/weight\x20bindings':'')+'.'});}return c['sort']((p,q)=>p['severity']===q['severity']?0x0:p['severity']==='critical'?-0x1:0x1);}export function findShadowedForwards(a){const b=new Set(),c=[];for(const d of a){const f=d['prev_node']+'\x00'+d['next_node']+'\x00'+d['forward'];b['has'](f)?c['push']({'prev_node':d['prev_node'],'next_node':d['next_node'],'forward':d['forward']}):b['add'](f);}return c;}export function lintForwardAmbiguity(b,c='machine'){const d=flattenMachineNodeEdges(b),e=findForwardAmbiguities(d),f=findShadowedForwards(d),g=[],h=[];for(const i of e){const j=c+':\x20P0-6\x20forward\x20ambiguity\x20—\x20'+i['reason'];i['severity']==='critical'?g['push'](j+'\x20Fix:\x20give\x20each\x20destination\x20its\x20own\x20forward\x20name\x20(e.g.\x20free_cancel\x20→\x20closed_cancel,\x20supplier_confirm\x20→\x20confirmed)\x20so\x20the\x20name\x20determines\x20the\x20node.'):h['push'](j+'\x20Recommended:\x20give\x20the\x20forward\x20a\x20destination-unique\x20name\x20unless\x20this\x20fork\x20is\x20intentional\x20and\x20the\x20caller\x20is\x20told\x20to\x20choose.');}for(const k of f){h['push'](c+':\x20duplicate\x20forward\x20\x22'+k['forward']+'\x22\x20in\x20the\x20'+(k['prev_node']||'(entry)')+'→'+k['next_node']+'\x20Pair\x20—\x20'+'the\x20destination\x20node\x27s\x20edge\x20lookup\x20(machine.move:284-296)\x20scans\x20forwards\x20in\x20order\x20and\x20returns\x20the\x20FIRST\x20match,\x20so\x20every\x20later\x20entry\x20with\x20that\x20name\x20is\x20unreachable\x20(dead\x20weight).\x20Rename\x20or\x20drop\x20it.');}return{'ambiguities':e,'shadowed':f,'critical':g,'warnings':h};}export const MACHINE_TOPOLOGY_VERSION='1.0.0';
|
|
1
|
+
import{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT}from'./onchain-constants.js';export{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT};export function analyzeTopology(a,b){const c=a['map'](t=>t['name']),d=new Set(c),e=new Map(),f=new Map();for(const t of c){e['set'](t,[]),f['set'](t,[]);}for(const u of b){!e['has'](u['prev_node'])&&u['prev_node']!==''&&e['set'](u['prev_node'],[]),!f['has'](u['next_node'])&&f['set'](u['next_node'],[]),u['prev_node']!==''&&e['get'](u['prev_node'])['push'](u['next_node']),f['get'](u['next_node'])['push'](u['prev_node']);}const g=b['filter'](v=>v['prev_node']==='')['map'](v=>v['next_node'])['filter'](v=>d['has'](v)),h=c['filter'](v=>(e['get'](v)||[])['length']===0x0),i=c['filter'](v=>!g['includes'](v)&&(f['get'](v)||[])['length']===0x0),j=c['filter'](v=>(e['get'](v)||[])['length']===0x0&&!h['includes'](v)),{has_cycles:k,cycle_nodes:l}=detectCycles(c,b),m=analyzeDeadBranches(b),n=findUnachievableThresholds(b),o=computeReachability(c,b),p=b['reduce']((v,w)=>v+w['forwards']['length'],0x0),q=Math['max'](0x0,...b['map'](v=>v['forwards']['length'])),r=Math['max'](0x0,...b['flatMap'](v=>v['forwards']['map'](w=>countRetainedSubmissions(w['retained_submission'])))),s={'max_node_count':a['length']<=MAX_NODE_COUNT,'max_node_pair_count':b['length']<=MAX_NODE_PAIR_COUNT,'max_forward_count':q<=MAX_FORWARD_COUNT,'max_forward_order_count':r<=MAX_FORWARD_ORDER_COUNT,'threshold_achievable':n['length']===0x0};return{'entry_nodes':g,'terminal_nodes':h,'orphaned_nodes':i,'dead_end_nodes':j,'dead_branches':m,'unachievable_thresholds':n,'has_cycles':k,'cycle_nodes':l,'reachability':o,'node_count':a['length'],'pair_count':b['length'],'forward_count':p,'within_limits':s};}export function findUnachievableThresholds(a){const b=[];for(const c of a){const d=c['forwards']['length'],e=c['forwards']['reduce']((g,h)=>g+Number(h['weight']||0x0),0x0);if(e<c['threshold']){const f=c['threshold']>0x1&&d<c['threshold'];b['push']({'prev_node':c['prev_node'],'next_node':c['next_node'],'threshold':c['threshold'],'max_achievable':e,'distinct_forwards':d,'reason':f?'Threshold\x20'+c['threshold']+'\x20needs\x20'+c['threshold']+'\x20distinct\x20forwards\x20(each\x20forward\x20is\x20single-operator-locked\x20and\x20contributes\x20its\x20weight\x20at\x20most\x20once);\x20this\x20Pair\x20has\x20'+d+'\x20forward(s)\x20summing\x20to\x20'+e+'.\x20Add\x20more\x20parallel\x20forwards\x20or\x20lower\x20the\x20threshold.':'Threshold\x20'+c['threshold']+'\x20exceeds\x20max\x20achievable\x20weight\x20'+e+'\x20(sum\x20of\x20distinct\x20forward\x20weights).\x20The\x20transition\x20can\x20never\x20migrate.'});}}return b;}function countRetainedSubmissions(a){if(a===undefined||a===null)return 0x0;if(Array['isArray'](a))return a['length'];if(typeof a==='string')return a['length']>0x0?0x1:0x0;return 0x0;}export function detectCycle(a,b){const c=a['map'](d=>d['name']);return detectCycles(c,b);}function detectCycles(a,b){const c=new Map();for(const k of a)c['set'](k,[]);for(const l of b){l['prev_node']!==''&&c['has'](l['prev_node'])&&c['get'](l['prev_node'])['push'](l['next_node']);}const d=0x0,e=0x1,f=0x2,g=new Map();for(const m of a)g['set'](m,d);const h=[],i=[];function j(n){g['set'](n,e),i['push'](n);for(const o of c['get'](n)||[]){if(g['get'](o)===e){const p=i['indexOf'](o);return h['push'](i['slice'](p)),!![];}if(g['get'](o)===d){if(j(o))return!![];}}return i['pop'](),g['set'](n,f),![];}for(const n of a){g['get'](n)===d&&j(n);}return{'has_cycles':h['length']>0x0,'cycle_nodes':h};}function analyzeDeadBranches(a){const b=[],c=new Map();for(const d of a){if(!c['has'](d['prev_node']))c['set'](d['prev_node'],[]);c['get'](d['prev_node'])['push'](d);}for(const [e,f]of c){if(f['length']<=0x1)continue;const g=Math['min'](...f['map'](h=>h['threshold']));for(const h of f){h['threshold']>g*0x2&&b['push']({'pair':{'prev_node':h['prev_node'],'next_node':h['next_node']},'reason':'Threshold\x20'+h['threshold']+'\x20is\x20much\x20higher\x20than\x20competing\x20minimum\x20'+g+'.\x20Likely\x20always\x20loses.','competing_with':f['filter'](i=>i!==h)['map'](i=>i['next_node'])});}}return b;}function computeReachability(a,b){const c=new Map();for(const e of a)c['set'](e,[]);for(const f of b){if(f['prev_node']!==''){if(!c['has'](f['prev_node']))c['set'](f['prev_node'],[]);c['get'](f['prev_node'])['push'](f['next_node']);}}const d=new Map();for(const g of a){const h=new Set(),i=[g];while(i['length']>0x0){const j=i['shift']();for(const k of c['get'](j)||[]){!h['has'](k)&&(h['add'](k),i['push'](k));}}d['set'](g,h);}return d;}export function isReachableFromEntry(a,b){for(const c of b['entry_nodes']){if(c===a)return!![];if(b['reachability']['get'](c)?.['has'](a))return!![];}return![];}export function getNodesReachingTerminals(a){const b=new Set();for(const [c,d]of a['reachability']){for(const e of a['terminal_nodes']){if(d['has'](e)){b['add'](c);break;}}}return b;}export function formatTopologySummary(a){const b=['Nodes:\x20'+a['node_count']+'\x20(max\x20100)','Pairs:\x20'+a['pair_count']+'\x20(max\x2040)','Forwards:\x20'+a['forward_count']+'\x20(max\x2020\x20per\x20Pair)','','Entry\x20nodes:\x20'+(a['entry_nodes']['join'](',\x20')||'(none)'),'Terminal\x20nodes:\x20'+(a['terminal_nodes']['join'](',\x20')||'(none)'),'Orphaned\x20nodes:\x20'+(a['orphaned_nodes']['join'](',\x20')||'(none)'),'Dead\x20branches:\x20'+a['dead_branches']['length'],'Unachievable\x20thresholds:\x20'+a['unachievable_thresholds']['length'],'Cycles:\x20'+(a['has_cycles']?'YES\x20(❌\x20invalid\x20DAG)':'NO\x20(✓\x20valid\x20DAG)'),'','Within\x20on-chain\x20limits:\x20'+(a['within_limits']['max_node_count']&&a['within_limits']['max_node_pair_count']&&a['within_limits']['max_forward_count']&&a['within_limits']['max_forward_order_count']&&a['within_limits']['threshold_achievable']?'YES\x20✓':'NO\x20❌')];return b['join']('\x0a');}export function identifyTopologyPattern(a){const b=new Map(),c=new Map();for(const d of a){if(!b['has'](d['prev_node']))b['set'](d['prev_node'],[]);b['get'](d['prev_node'])['push'](d['next_node']);if(!c['has'](d['next_node']))c['set'](d['next_node'],[]);c['get'](d['next_node'])['push'](d['prev_node']);}for(const [e,f]of b){if(f['length']>0x1&&e!=='')return'P-M-COMPETING';}for(const [g,h]of c){if(h['length']>0x1)return'P-M-FORKMERGE';}return'P-M-LINEAR';}const FUND_REVERSING_NODE_RE=/(^|_)(cancel(led)?|refund(ed)?|return(ed|_approved)?|expired)(_|$)/i;export function flattenMachineNodeEdges(a){const b=[];for(const c of Array['isArray'](a)?a:[]){const d=c,e=typeof d?.['name']==='string'?d['name']:'';for(const g of Array['isArray'](d?.['pairs'])?d['pairs']:[]){const h=typeof g?.['prev_node']==='string'?g['prev_node']:'',i=typeof g?.['next_node']==='string'&&g['next_node']?g['next_node']:e,j=typeof g?.['threshold']==='number'?g['threshold']:undefined;for(const k of Array['isArray'](g?.['forwards'])?g['forwards']:[]){const l=k,m=typeof l?.['name']==='string'?l['name']:'';if(!m||!i)continue;const n=l?.['namedOperator']??l?.['named_operator'],o=l?.['permissionIndex']??l?.['permission_index'];b['push']({'prev_node':h,'next_node':i,'forward':m,'weight':typeof l?.['weight']==='number'?l['weight']:undefined,'threshold':j,'guard':typeof l?.['guard']==='string'?l['guard']:null,'operator':typeof n==='string'?n:null,'permission_index':typeof o==='number'?o:null});}}}return b;}function bindingKey(a){return(a['threshold']??0x0)+'|'+(a['weight']??0x0)+'|'+(a['guard']??'')+'|'+(a['operator']??'')+'|'+(a['permission_index']??'');}export function findForwardAmbiguities(a){const b=new Map();for(const d of a){const f=d['prev_node']+'\x00'+d['forward'],h=b['get'](f);if(h)h['push'](d);else b['set'](f,[d]);}const c=[];for(const [,i]of b){const j=[...new Set(i['map'](p=>p['next_node']))];if(j['length']<0x2)continue;const k=j['filter'](p=>FUND_REVERSING_NODE_RE['test'](p)),l=k['length']>0x0&&k['length']<j['length'],m=new Set(i['map'](bindingKey)),n=m['size']>0x1,o=j['filter'](p=>!FUND_REVERSING_NODE_RE['test'](p));c['push']({'prev_node':i[0x0]['prev_node'],'forward':i[0x0]['forward'],'destinations':j['sort'](),'fund_conflict':l,'binding_differs':n,'severity':l?'critical':'warning','reason':l?'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20both\x20refund\x20node(s)\x20['+k['join'](',\x20')+']\x20and\x20continue\x20node(s)\x20['+o['join'](',\x20')+'].\x20The\x20destination\x20is\x20a\x20CALLER\x20argument\x20(progress.move:540),\x20so\x20the\x20wrong\x20pick\x20puts\x20the\x20order\x20in\x20a\x20node\x20whose\x20Allocator\x20never\x20fires\x20—\x20the\x20escrow\x20strands.':'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20'+j['length']+'\x20destinations\x20['+j['join'](',\x20')+'];\x20the\x20caller\x20picks\x20which,\x20so\x20the\x20workflow\x20outcome\x20depends\x20on\x20an\x20argument\x20the\x20Machine\x20does\x20not\x20constrain'+(n?'\x20—\x20and\x20the\x20candidate\x20edges\x20carry\x20DIFFERENT\x20guard/operator/weight\x20bindings':'')+'.'});}return c['sort']((p,q)=>p['severity']===q['severity']?0x0:p['severity']==='critical'?-0x1:0x1);}export function findShadowedForwards(a){const b=new Set(),c=[];for(const d of a){const f=d['prev_node']+'\x00'+d['next_node']+'\x00'+d['forward'];b['has'](f)?c['push']({'prev_node':d['prev_node'],'next_node':d['next_node'],'forward':d['forward']}):b['add'](f);}return c;}export function lintForwardAmbiguity(b,c='machine'){const d=flattenMachineNodeEdges(b),e=findForwardAmbiguities(d),f=findShadowedForwards(d),g=[],h=[];for(const i of e){const j=c+':\x20P0-6\x20forward\x20ambiguity\x20—\x20'+i['reason'];i['severity']==='critical'?g['push'](j+'\x20Fix:\x20give\x20each\x20destination\x20its\x20own\x20forward\x20name\x20(e.g.\x20free_cancel\x20→\x20closed_cancel,\x20supplier_confirm\x20→\x20confirmed)\x20so\x20the\x20name\x20determines\x20the\x20node.'):h['push'](j+'\x20Recommended:\x20give\x20the\x20forward\x20a\x20destination-unique\x20name\x20unless\x20this\x20fork\x20is\x20intentional\x20and\x20the\x20caller\x20is\x20told\x20to\x20choose.');}for(const k of f){h['push'](c+':\x20duplicate\x20forward\x20\x22'+k['forward']+'\x22\x20in\x20the\x20'+(k['prev_node']||'(entry)')+'→'+k['next_node']+'\x20Pair\x20—\x20'+'the\x20destination\x20node\x27s\x20edge\x20lookup\x20(machine.move:284-296)\x20scans\x20forwards\x20in\x20order\x20and\x20returns\x20the\x20FIRST\x20match,\x20so\x20every\x20later\x20entry\x20with\x20that\x20name\x20is\x20unreachable\x20(dead\x20weight).\x20Rename\x20or\x20drop\x20it.');}return{'ambiguities':e,'shadowed':f,'critical':g,'warnings':h};}export function findLoopCycles(a){const b=0x0,c=0x1,d=0x2,e=new Map(),f=[],g=[],h=i=>{e['set'](i,c),f['push'](i);for(const j of a['get'](i)??[]){const k=e['get'](j)??b;if(k===c){const l=f['indexOf'](j);if(l>=0x0)g['push']({'from':i,'to':j,'cycle':f['slice'](l)});}else k===b&&h(j);}f['pop'](),e['set'](i,d);};for(const i of a['keys']()){if((e['get'](i)??b)===b)h(i);}return g;}export const MACHINE_TOPOLOGY_VERSION='1.0.0';
|