@wowok/agent-mcp 3.4.4 → 3.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +3 -3
- package/dist/chain-semantics/composition-truth.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.js +1 -1
- package/dist/composition/guard-fill.js +1 -1
- package/dist/composition/input-normalize.js +1 -1
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.js +1 -1
- package/dist/composition/param-disclosure.js +1 -1
- package/dist/composition/plan-run-store.js +1 -0
- package/dist/composition/reflux.js +1 -1
- package/dist/composition/role-bindings.js +1 -0
- package/dist/composition/shape-expand.js +1 -1
- package/dist/composition/supply-chain-emit.js +1 -1
- package/dist/config/judgment.d.ts +13 -25
- package/dist/config/judgment.js +1 -1
- package/dist/config/match-policy-file.js +1 -1
- package/dist/config/rule-engine.d.ts +4 -10
- package/dist/config/rule-engine.js +1 -1
- package/dist/config/template-params.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/capability.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/harness/forward-roster-preflight.js +1 -0
- package/dist/keeper/detectors.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-operation-face.js +1 -1
- package/dist/knowledge/arbitration-rail-verifier.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +17 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/alloc_audit.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/allocation.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/arb.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/arbitration.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/bridge.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/contact.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/demand.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/graph.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/guard.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/machine.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/oracle.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/order.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/payment.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/permission.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/personal.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/plan.json +153 -33
- package/dist/knowledge/baselines/rules/plan.json.good +153 -33
- package/dist/knowledge/baselines/rules/plan.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/progress.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/proof.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/registrar.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/repository.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/resource.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/reward.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/service.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/treasury.json.good.sha256 +1 -0
- package/dist/knowledge/baselines/rules/util.json.good.sha256 +1 -0
- package/dist/knowledge/builtin-templates.d.ts +1 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +3 -2
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.js +1 -1
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/path-oracle/products/alibaba-1688.js +1 -1
- package/dist/knowledge/path-oracle/products/amazon.js +1 -1
- package/dist/knowledge/path-oracle/products/booking-com.js +1 -1
- package/dist/knowledge/path-oracle/products/contra.js +1 -1
- package/dist/knowledge/path-oracle/products/costco.js +1 -1
- package/dist/knowledge/path-oracle/products/duoduo-maicai.js +1 -1
- package/dist/knowledge/path-oracle/products/etsy.js +1 -1
- package/dist/knowledge/path-oracle/products/gamefound.js +1 -1
- package/dist/knowledge/path-oracle/products/gofundme.js +1 -1
- package/dist/knowledge/path-oracle/products/klook.js +1 -1
- package/dist/knowledge/path-oracle/products/ninety-nine-designs.js +1 -1
- package/dist/knowledge/path-oracle/products/pinduoduo-kuaituantuan.js +1 -1
- package/dist/knowledge/path-oracle/products/shansong.js +1 -1
- package/dist/knowledge/path-oracle/products/taobao-presale.js +1 -1
- package/dist/knowledge/path-oracle/products/upwork-catalog.js +1 -1
- package/dist/knowledge/path-oracle/products/upwork.js +1 -1
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/protocol-facts.js +1 -1
- package/dist/knowledge/publish-gate.js +1 -1
- package/dist/knowledge/publish-surface-contract.js +1 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/time-units.js +1 -0
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +110 -2
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/boundary-coercion.js +1 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +56 -8
- package/dist/schema/call/order.d.ts +37 -10
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/permission.d.ts +210 -30
- package/dist/schema/call/personal.d.ts +56 -8
- package/dist/schema/call/progress.d.ts +28 -4
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +84 -12
- package/dist/schema/common/index.d.ts +14 -2
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +1 -1
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +168 -24
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +655 -22
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +22 -110
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.d.ts +4 -0
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/benchmark_migration_operation.schema.json +1 -1
- package/dist/schemas/evaluation_operation.schema.json +1 -1
- package/dist/schemas/goal_operation.schema.json +1 -1
- package/dist/schemas/guard_rebind_replacement.schema.json +1 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +1 -1
- package/dist/schemas/onchain_operations.schema.json +1 -1
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
- package/dist/schemas/onchain_operations_contact.schema.json +1 -1
- package/dist/schemas/onchain_operations_demand.schema.json +1 -1
- package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +1 -1
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_permission.schema.json +1 -1
- package/dist/schemas/onchain_operations_personal.schema.json +1 -1
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1
- package/dist/schemas/onchain_operations_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_repository.schema.json +1 -1
- package/dist/schemas/onchain_operations_reward.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +1 -1
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
- package/dist/schemas/persona_operation.schema.json +1 -1
- package/dist/schemas/time_convert.schema.json +1 -0
- package/dist/schemas/wip_file.schema.json +1 -1
- package/dist/schemas/workflow_operation.schema.json +1 -1
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/fund-rail-recipe.js +1 -1
- package/dist/tools/handlers/guard-rebind-replacement.js +1 -0
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/mark-namespace.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/settle-sweep.js +1 -1
- package/dist/tools/handlers/time-convert.js +1 -0
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/handlers/workflow.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/wip-verify-ledger.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +6 -5
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{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{CHAIN_QUERY_REGISTRY,CHAIN_QUERY_COUNT,getChainQuery,getChainQueryById,hasChainQuery}from'./chain-query-registry.js';import{lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult}from'./guard-lint.js';import{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,findScene as a234a,getScenesByIndustry as a234b,getScenesByPattern,inferSceneFromFlow}from'./machine-ledger.js';import{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,getAllTemplates as a234c,getTemplateById as a234d,getTemplatesByScene as a234e,getTemplatesByIndustry as a234f,suggestTemplateForIntent,walkDecisionTree,fillTemplate as a234g,forkTemplate as a234h,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 a234i,identifyExecutionMode,identifyTopology,explainForwardPermission,getConstraintsByCategory as a234j,getConstraintById,getOnChainConstraints as a234k,getOffChainConstraints as a234l}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 a234m,initPuzzleFromTemplate,checkPuzzleCompleteness as a234n,recommendNextStep as a234o,derivePuzzleFromMachineJson,generateConfirmationText as a234p,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 a234q,findSceneById as a234r,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,inferSceneFromIntent as a234s,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,getCrossObjectBindings as a234t}from'./service-ledger.js';import{initPuzzleFromIntent as a234u,checkPuzzleCompleteness as a234v,validateConstraints as a234w,generateConfirmationText as a234x,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 a234y,getScenesByMode as a234z,getScenesByStrategy as a234A,findSceneById as a234B,inferSceneFromIntent as a234C,getAllScenes as a234D,getScenesCount as a234E,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,getErrorName as a234F,getErrorDescription as a234G}from'./allocation-ledger.js';import{initPuzzleFromIntent as a234H,checkPuzzleCompleteness as a234I,validateConstraints as a234J,generateConfirmationText as a234K,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION}from'./allocation-puzzle.js';import{ALLOCATION_RISK_VERSION,assessAllocationRisks,getAllRiskRules as a234L}from'./allocation-risk.js';import{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,getAllTemplates as a234M,getTemplateById as a234N,getTemplatesByScene as a234O,getTemplatesByIndustry as a234P,suggestTemplateForScene as a234Q,listTemplates as a234R,fillTemplate as a234S}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 a234T,getScenesByHostObject as a234U,findSceneById as a234V,findSceneByPermissionIndex as a234W,getBuiltinPermissionByIndex as a234X,isBuiltinTreasuryPermission,getActiveBuiltinPermissions as a234Y,getReservedBuiltinPermissions as a234Z,inferSceneFromIntent as a234a0,getTreasuryScenesCount,getGovernedOperationsForPermissionIndex as a234a1}from'./treasury-ledger.js';import{initPuzzleFromIntent as a234a2,checkPuzzleCompleteness as a234a3,validateConstraints as a234a4,generateConfirmationText as a234a5,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,MAX_DESCRIPTION_LENGTH as a234a6}from'./treasury-puzzle.js';import{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,getTemplateById as a234a7,getTemplatesByScene as a234a8,getTemplatesByIndustry as a234a9,suggestTemplateForScene as a234aa,listTemplates as a234ab,fillTemplate as a234ac}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 a234ad,findSceneById as a234ae,findSceneByMoveEntry as a234af,getScenesByPermissionLayer as a234ag,getScenesByReversibility as a234ah,getFieldDef as a234ai,getMutableFields as a234aj,getImmutableFields as a234ak,getFrozenAfterProgressFields as a234al,getOneTimeSetFields as a234am,inferSceneFromIntent as a234an,getEmittedEvents as a234ao,getInferredEvents as a234ap,getOrderScenesCount,sdkToMoveField as a234aq,moveToSdkField as a234ar}from'./order-ledger.js';import{initPuzzleFromIntent as a234as,checkPuzzleCompleteness as a234at,validateConstraints as a234au,generateConfirmationText as a234av,verifySnapshotMechanism as a234aw,inferLifecyclePhase as a234ax,matchSceneFromPuzzle as a234ay,listAllScenes as a234az,lookupScene as a234aA}from'./order-puzzle.js';import{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,getTemplateById as a234aB,getTemplatesByScene as a234aC,getTemplatesByIndustry as a234aD,getTemplatesByPermissionLayer as a234aE,getIrreversibleTemplates as a234aF,suggestTemplateForScene as a234aG,listOrderTemplates,fillTemplate as a234aH,suggestTemplateFromIntent as a234aI,getTemplateParameters as a234aJ,validateTemplateParams as a234aK}from'./order-templates.js';import{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules}from'./order-risk.js';import{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,PROGRESS_PERMISSIONS as a234aL,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,getScenesByPhase as a234aM,findSceneById as a234aN,getScenesByIndustry as a234aO,getBuiltinPermissionByIndex as a234aP,isProgressBuiltinPermission,inferSceneFromIntent as a234aQ,getAllBuiltinPermissions as a234aR,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount}from'./progress-ledger.js';import{initPuzzleFromIntent as a234aS,checkPuzzleCompleteness as a234aT,validateConstraints as a234aU,generateConfirmationText as a234aV,resolveBuiltinPermission as a234aW,isOrderHolderForward,getRelevantDimensions as a234aX}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 a234aY,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,getScenesByCategory as a234aZ,findSceneById as a234b0,findSceneByPermissionIndex as a234b1,getPermissionByIndex as a234b2,getPermissionByName as a234b3,isReservedIndex as a234b4,isUsedPermissionIndex as a234b5,getActivePermissionCount as a234b6,inferSceneFromIntent as a234b7,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,getScenesProducingStatus as a234b8,getScenesRequiringStatus as a234b9,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions}from'./arbitration-ledger.js';import{initPuzzleFromIntent as a234ba,checkPuzzleCompleteness as a234bb,validateConstraints as a234bc,generateConfirmationText as a234bd}from'./arbitration-puzzle.js';import{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,getAllTemplates as a234be,getTemplateById as a234bf,getTemplatesByScene as a234bg,getTemplatesByIndustry as a234bh,suggestTemplateForScene as a234bi,listTemplates as a234bj,fillTemplate as a234bk}from'./arbitration-templates.js';import{ARBITRATION_RISK_VERSION,assessArbitrationRisks,getAllRiskRules as a234bl}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 a234bm,findSceneById as a234bn,getScenesByIndustry as a234bo,getBuiltinPermissionByIndex as a234bp,isRewardBuiltinPermission,getAllBuiltinPermissions as a234bq,getRewardScenesCount,getGuardConstructorSpec as a234br,resolveGuardConstructor as a234bs,getRewardErrorByCode,getRewardErrorByName,validateGuardCount as a234bt,validateRecordCount as a234bu,inferSceneFromIntent as a234bv}from'./reward-ledger.js';import{REWARD_FIELD_MUTABILITY,initPuzzleFromIntent as a234bw,checkPuzzleCompleteness as a234bx,validateConstraints as a234by,generateConfirmationText as a234bz,resolveBuiltinPermission as a234bA,requiresGuardConfig as a234bB,requiresPassport as a234bC,getRelevantDimensions as a234bD,getFieldMutability as a234bE,isAdminMutableField as a234bF,getFieldPermissionIndex as a234bG}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 a234bH,getScenariosCount as a234bI,findScenarioById as a234bJ,getScenariosByConsumer as a234bK,getScenariosUsingRelies as a234bL,inferScenarioFromIntent as a234bM,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,getErrorName as a234bN,getErrorDescription as a234bO}from'./passport-ledger.js';import{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,getAllTemplates as a234bP,getTemplateById as a234bQ,getTemplatesByScenario as a234bR,getTemplatesByIndustry as a234bS,suggestTemplateForScenario as a234bT,listTemplates as a234bU,fillTemplate as a234bV}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 a234bW,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{CHAIN_QUERY_REGISTRY,CHAIN_QUERY_COUNT,getChainQuery,getChainQueryById,hasChainQuery};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,a234a as findMachineScene,a234b as getMachineScenesByIndustry,getScenesByPattern,inferSceneFromFlow};export{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,a234c as getAllMachineTemplates,a234d as getMachineTemplateById,a234e as getMachineTemplatesByScene,a234f as getMachineTemplatesByIndustry,suggestTemplateForIntent,walkDecisionTree,a234g as fillMachineTemplate,a234h as forkMachineTemplate,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds};export{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,a234i as matchMachinePattern,identifyExecutionMode,identifyTopology,explainForwardPermission,a234j as getMachineConstraintsByCategory,getConstraintById,a234k as getOnChainMachineConstraints,a234l 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{a234m as initMachinePuzzleFromIntent,initPuzzleFromTemplate,a234n as checkMachinePuzzleCompleteness,a234o as recommendMachineNextStep,derivePuzzleFromMachineJson,a234p as generateMachineConfirmationText,MACHINE_PUZZLE_VERSION};export{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,a234q as getServiceScenesByCategory,a234r as findServiceSceneById,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,a234s as inferServiceSceneFromIntent,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,a234t as getServiceCrossObjectBindings};export{a234u as initServicePuzzleFromIntent,a234v as checkServicePuzzleCompleteness,a234w as validateServiceConstraints,a234x 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,a234y as getAllocationScenesByTriggerSource,a234z as getAllocationScenesByMode,a234A as getAllocationScenesByStrategy,a234B as findAllocationSceneById,a234C as inferAllocationSceneFromIntent,a234D as getAllAllocationScenes,a234E as getAllocationScenesCount,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,a234F as getAllocationErrorName,a234G as getAllocationErrorDescription};export{a234H as initAllocationPuzzleFromIntent,a234I as checkAllocationPuzzleCompleteness,a234J as validateAllocationConstraints,a234K as generateAllocationPuzzleConfirmationText,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION};export{ALLOCATION_RISK_VERSION,assessAllocationRisks,a234L as getAllAllocationRiskRules};export{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,a234M as getAllAllocationTemplates,a234N as getAllocationTemplateById,a234O as getAllocationTemplatesByScene,a234P as getAllocationTemplatesByIndustry,a234Q as suggestAllocationTemplateForScene,a234R as listAllocationTemplates,a234S 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,a234T as TREASURY_BUILTIN_PERMISSIONS,a234U as getTreasuryScenesByHostObject,a234V as findTreasurySceneById,a234W as findTreasurySceneByPermissionIndex,a234X as getTreasuryBuiltinPermissionByIndex,isBuiltinTreasuryPermission,a234Y as getActiveTreasuryBuiltinPermissions,a234Z as getReservedTreasuryBuiltinPermissions,a234a0 as inferTreasurySceneFromIntent,getTreasuryScenesCount,a234a1 as getTreasuryGovernedOperationsForPermissionIndex};export{a234a2 as initTreasuryPuzzleFromIntent,a234a3 as checkTreasuryPuzzleCompleteness,a234a4 as validateTreasuryConstraints,a234a5 as generateTreasuryPuzzleConfirmationText,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,a234a6 as TREASURY_MAX_DESCRIPTION_LENGTH};export{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,a234a7 as getTreasuryTemplateById,a234a8 as getTreasuryTemplatesByScene,a234a9 as getTreasuryTemplatesByIndustry,a234aa as suggestTreasuryTemplateForScene,a234ab as listTreasuryTemplates,a234ac 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,a234ad as getOrderScenesByOperationField,a234ae as findOrderSceneById,a234af as findOrderSceneByMoveEntry,a234ag as getOrderScenesByPermissionLayer,a234ah as getOrderScenesByReversibility,a234ai as getOrderFieldDef,a234aj as getOrderMutableFields,a234ak as getOrderImmutableFields,a234al as getOrderFrozenAfterProgressFields,a234am as getOrderOneTimeSetFields,a234an as inferOrderSceneFromIntent,a234ao as getOrderEmittedEvents,a234ap as getOrderInferredEvents,getOrderScenesCount,a234aq as sdkToMoveOrderField,a234ar as moveToSdkOrderField};export{a234as as initOrderPuzzleFromIntent,a234at as checkOrderPuzzleCompleteness,a234au as validateOrderConstraints,a234av as generateOrderPuzzleConfirmationText,a234aw as verifyOrderSnapshotMechanism,a234ax as inferOrderLifecyclePhase,a234ay as matchOrderSceneFromPuzzle,a234az as listAllOrderScenes,a234aA as lookupOrderScene};export{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,a234aB as getOrderTemplateById,a234aC as getOrderTemplatesByScene,a234aD as getOrderTemplatesByIndustry,a234aE as getOrderTemplatesByPermissionLayer,a234aF as getIrreversibleOrderTemplates,a234aG as suggestOrderTemplateForScene,listOrderTemplates,a234aH as fillOrderTemplate,a234aI as suggestOrderTemplateFromIntent,a234aJ as getOrderTemplateParameters,a234aK as validateOrderTemplateParams};export{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules};export{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,a234aL as PROGRESS_BUILTIN_PERMISSIONS,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,a234aM as getProgressScenesByPhase,a234aN as findProgressSceneById,a234aO as getProgressScenesByIndustry,a234aP as getProgressBuiltinPermissionByIndex,isProgressBuiltinPermission,a234aQ as inferProgressSceneFromIntent,a234aR as getAllProgressBuiltinPermissions,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount};export{a234aS as initProgressPuzzleFromIntent,a234aT as checkProgressPuzzleCompleteness,a234aU as validateProgressConstraints,a234aV as generateProgressPuzzleConfirmationText,a234aW as resolveProgressBuiltinPermission,isOrderHolderForward,a234aX 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,a234aY as ARBITRATION_BUILTIN_PERMISSIONS,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,a234aZ as getArbitrationScenesByCategory,a234b0 as findArbitrationSceneById,a234b1 as findArbitrationSceneByPermissionIndex,a234b2 as getArbitrationPermissionByIndex,a234b3 as getArbitrationPermissionByName,a234b4 as isArbitrationReservedIndex,a234b5 as isArbitrationUsedPermissionIndex,a234b6 as getArbitrationActivePermissionCount,a234b7 as inferArbitrationSceneFromIntent,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,a234b8 as getArbitrationScenesProducingStatus,a234b9 as getArbitrationScenesRequiringStatus,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions};export{a234ba as initArbitrationPuzzleFromIntent,a234bb as checkArbitrationPuzzleCompleteness,a234bc as validateArbitrationConstraints,a234bd as generateArbitrationPuzzleConfirmationText};export{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,a234be as getAllArbitrationTemplates,a234bf as getArbitrationTemplateById,a234bg as getArbitrationTemplatesByScene,a234bh as getArbitrationTemplatesByIndustry,a234bi as suggestArbitrationTemplateForScene,a234bj as listArbitrationTemplates,a234bk as fillArbitrationTemplate};export{ARBITRATION_RISK_VERSION,assessArbitrationRisks,a234bl 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,a234bm as getRewardScenesByPhase,a234bn as findRewardSceneById,a234bo as getRewardScenesByIndustry,a234bp as getRewardBuiltinPermissionByIndex,isRewardBuiltinPermission,a234bq as getAllRewardBuiltinPermissions,getRewardScenesCount,a234br as getRewardGuardConstructorSpec,a234bs as resolveRewardGuardConstructor,getRewardErrorByCode,getRewardErrorByName,a234bt as validateRewardGuardCount,a234bu as validateRewardRecordCount,a234bv as inferRewardSceneFromIntent};export{REWARD_FIELD_MUTABILITY,a234bw as initRewardPuzzleFromIntent,a234bx as checkRewardPuzzleCompleteness,a234by as validateRewardConstraints,a234bz as generateRewardPuzzleConfirmationText,a234bA as resolveRewardBuiltinPermission,a234bB as requiresRewardGuardConfig,a234bC as requiresRewardPassport,a234bD as getRewardRelevantDimensions,a234bE as getRewardFieldMutability,a234bF as isRewardAdminMutableField,a234bG 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,a234bH as getAllPassportScenarios,a234bI as getPassportScenesCount,a234bJ as findPassportScenarioById,a234bK as getPassportScenariosByConsumer,a234bL as getPassportScenariosUsingRelies,a234bM as inferPassportScenarioFromIntent,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,a234bN as getPassportErrorName,a234bO as getPassportErrorDescription};export{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,a234bP as getAllPassportTemplates,a234bQ as getPassportTemplateById,a234bR as getPassportTemplatesByScenario,a234bS as getPassportTemplatesByIndustry,a234bT as suggestPassportTemplateForScenario,a234bU as listPassportTemplates,a234bV 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,a234bW 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':a234L()['length'],'allocation_templates_count':ALLOCATION_TEMPLATES['length'],'allocation_context_enabled':!![],'treasury_scenes_count':TREASURY_SCENES['length'],'treasury_builtin_permissions_count':a234T['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':a234aL['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':a234aY['length'],'arbitration_risk_rules_count':a234bl()['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,namedOperatorRosterNote}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{CHAIN_QUERY_REGISTRY,CHAIN_QUERY_COUNT,getChainQuery,getChainQueryById,hasChainQuery}from'./chain-query-registry.js';import{lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult}from'./guard-lint.js';import{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,findScene as a237a,getScenesByIndustry as a237b,getScenesByPattern,inferSceneFromFlow}from'./machine-ledger.js';import{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,getAllTemplates as a237c,getTemplateById as a237d,getTemplatesByScene as a237e,getTemplatesByIndustry as a237f,suggestTemplateForIntent,walkDecisionTree,fillTemplate as a237g,forkTemplate as a237h,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 a237i,identifyExecutionMode,identifyTopology,explainForwardPermission,getConstraintsByCategory as a237j,getConstraintById,getOnChainConstraints as a237k,getOffChainConstraints as a237l}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 a237m,initPuzzleFromTemplate,checkPuzzleCompleteness as a237n,recommendNextStep as a237o,derivePuzzleFromMachineJson,generateConfirmationText as a237p,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 a237q,findSceneById as a237r,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,inferSceneFromIntent as a237s,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,getCrossObjectBindings as a237t}from'./service-ledger.js';import{initPuzzleFromIntent as a237u,checkPuzzleCompleteness as a237v,validateConstraints as a237w,generateConfirmationText as a237x,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 a237y,getScenesByMode as a237z,getScenesByStrategy as a237A,findSceneById as a237B,inferSceneFromIntent as a237C,getAllScenes as a237D,getScenesCount as a237E,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,getErrorName as a237F,getErrorDescription as a237G}from'./allocation-ledger.js';import{initPuzzleFromIntent as a237H,checkPuzzleCompleteness as a237I,validateConstraints as a237J,generateConfirmationText as a237K,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION}from'./allocation-puzzle.js';import{ALLOCATION_RISK_VERSION,assessAllocationRisks,getAllRiskRules as a237L}from'./allocation-risk.js';import{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,getAllTemplates as a237M,getTemplateById as a237N,getTemplatesByScene as a237O,getTemplatesByIndustry as a237P,suggestTemplateForScene as a237Q,listTemplates as a237R,fillTemplate as a237S}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 a237T,getScenesByHostObject as a237U,findSceneById as a237V,findSceneByPermissionIndex as a237W,getBuiltinPermissionByIndex as a237X,isBuiltinTreasuryPermission,getActiveBuiltinPermissions as a237Y,getReservedBuiltinPermissions as a237Z,inferSceneFromIntent as a237a0,getTreasuryScenesCount,getGovernedOperationsForPermissionIndex as a237a1}from'./treasury-ledger.js';import{initPuzzleFromIntent as a237a2,checkPuzzleCompleteness as a237a3,validateConstraints as a237a4,generateConfirmationText as a237a5,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,MAX_DESCRIPTION_LENGTH as a237a6}from'./treasury-puzzle.js';import{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,getTemplateById as a237a7,getTemplatesByScene as a237a8,getTemplatesByIndustry as a237a9,suggestTemplateForScene as a237aa,listTemplates as a237ab,fillTemplate as a237ac}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 a237ad,findSceneById as a237ae,findSceneByMoveEntry as a237af,getScenesByPermissionLayer as a237ag,getScenesByReversibility as a237ah,getFieldDef as a237ai,getMutableFields as a237aj,getImmutableFields as a237ak,getFrozenAfterProgressFields as a237al,getOneTimeSetFields as a237am,inferSceneFromIntent as a237an,getEmittedEvents as a237ao,getInferredEvents as a237ap,getOrderScenesCount,sdkToMoveField as a237aq,moveToSdkField as a237ar}from'./order-ledger.js';import{initPuzzleFromIntent as a237as,checkPuzzleCompleteness as a237at,validateConstraints as a237au,generateConfirmationText as a237av,verifySnapshotMechanism as a237aw,inferLifecyclePhase as a237ax,matchSceneFromPuzzle as a237ay,listAllScenes as a237az,lookupScene as a237aA}from'./order-puzzle.js';import{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,getTemplateById as a237aB,getTemplatesByScene as a237aC,getTemplatesByIndustry as a237aD,getTemplatesByPermissionLayer as a237aE,getIrreversibleTemplates as a237aF,suggestTemplateForScene as a237aG,listOrderTemplates,fillTemplate as a237aH,suggestTemplateFromIntent as a237aI,getTemplateParameters as a237aJ,validateTemplateParams as a237aK}from'./order-templates.js';import{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules}from'./order-risk.js';import{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,PROGRESS_PERMISSIONS as a237aL,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,getScenesByPhase as a237aM,findSceneById as a237aN,getScenesByIndustry as a237aO,getBuiltinPermissionByIndex as a237aP,isProgressBuiltinPermission,inferSceneFromIntent as a237aQ,getAllBuiltinPermissions as a237aR,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount}from'./progress-ledger.js';import{initPuzzleFromIntent as a237aS,checkPuzzleCompleteness as a237aT,validateConstraints as a237aU,generateConfirmationText as a237aV,resolveBuiltinPermission as a237aW,isOrderHolderForward,getRelevantDimensions as a237aX}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 a237aY,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,getScenesByCategory as a237aZ,findSceneById as a237b0,findSceneByPermissionIndex as a237b1,getPermissionByIndex as a237b2,getPermissionByName as a237b3,isReservedIndex as a237b4,isUsedPermissionIndex as a237b5,getActivePermissionCount as a237b6,inferSceneFromIntent as a237b7,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,getScenesProducingStatus as a237b8,getScenesRequiringStatus as a237b9,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions}from'./arbitration-ledger.js';import{initPuzzleFromIntent as a237ba,checkPuzzleCompleteness as a237bb,validateConstraints as a237bc,generateConfirmationText as a237bd}from'./arbitration-puzzle.js';import{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,getAllTemplates as a237be,getTemplateById as a237bf,getTemplatesByScene as a237bg,getTemplatesByIndustry as a237bh,suggestTemplateForScene as a237bi,listTemplates as a237bj,fillTemplate as a237bk}from'./arbitration-templates.js';import{ARBITRATION_RISK_VERSION,assessArbitrationRisks,getAllRiskRules as a237bl}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 a237bm,findSceneById as a237bn,getScenesByIndustry as a237bo,getBuiltinPermissionByIndex as a237bp,isRewardBuiltinPermission,getAllBuiltinPermissions as a237bq,getRewardScenesCount,getGuardConstructorSpec as a237br,resolveGuardConstructor as a237bs,getRewardErrorByCode,getRewardErrorByName,validateGuardCount as a237bt,validateRecordCount as a237bu,inferSceneFromIntent as a237bv}from'./reward-ledger.js';import{REWARD_FIELD_MUTABILITY,initPuzzleFromIntent as a237bw,checkPuzzleCompleteness as a237bx,validateConstraints as a237by,generateConfirmationText as a237bz,resolveBuiltinPermission as a237bA,requiresGuardConfig as a237bB,requiresPassport as a237bC,getRelevantDimensions as a237bD,getFieldMutability as a237bE,isAdminMutableField as a237bF,getFieldPermissionIndex as a237bG}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 a237bH,getScenariosCount as a237bI,findScenarioById as a237bJ,getScenariosByConsumer as a237bK,getScenariosUsingRelies as a237bL,inferScenarioFromIntent as a237bM,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,getErrorName as a237bN,getErrorDescription as a237bO}from'./passport-ledger.js';import{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,getAllTemplates as a237bP,getTemplateById as a237bQ,getTemplatesByScenario as a237bR,getTemplatesByIndustry as a237bS,suggestTemplateForScenario as a237bT,listTemplates as a237bU,fillTemplate as a237bV}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 a237bW,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{CHAIN_QUERY_REGISTRY,CHAIN_QUERY_COUNT,getChainQuery,getChainQueryById,hasChainQuery};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,a237a as findMachineScene,a237b as getMachineScenesByIndustry,getScenesByPattern,inferSceneFromFlow};export{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,a237c as getAllMachineTemplates,a237d as getMachineTemplateById,a237e as getMachineTemplatesByScene,a237f as getMachineTemplatesByIndustry,suggestTemplateForIntent,walkDecisionTree,a237g as fillMachineTemplate,a237h as forkMachineTemplate,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds};export{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,a237i as matchMachinePattern,identifyExecutionMode,identifyTopology,explainForwardPermission,a237j as getMachineConstraintsByCategory,getConstraintById,a237k as getOnChainMachineConstraints,a237l 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{a237m as initMachinePuzzleFromIntent,initPuzzleFromTemplate,a237n as checkMachinePuzzleCompleteness,a237o as recommendMachineNextStep,derivePuzzleFromMachineJson,a237p as generateMachineConfirmationText,MACHINE_PUZZLE_VERSION};export{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,a237q as getServiceScenesByCategory,a237r as findServiceSceneById,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,a237s as inferServiceSceneFromIntent,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,a237t as getServiceCrossObjectBindings};export{a237u as initServicePuzzleFromIntent,a237v as checkServicePuzzleCompleteness,a237w as validateServiceConstraints,a237x 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,a237y as getAllocationScenesByTriggerSource,a237z as getAllocationScenesByMode,a237A as getAllocationScenesByStrategy,a237B as findAllocationSceneById,a237C as inferAllocationSceneFromIntent,a237D as getAllAllocationScenes,a237E as getAllocationScenesCount,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,a237F as getAllocationErrorName,a237G as getAllocationErrorDescription};export{a237H as initAllocationPuzzleFromIntent,a237I as checkAllocationPuzzleCompleteness,a237J as validateAllocationConstraints,a237K as generateAllocationPuzzleConfirmationText,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION};export{ALLOCATION_RISK_VERSION,assessAllocationRisks,a237L as getAllAllocationRiskRules};export{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,a237M as getAllAllocationTemplates,a237N as getAllocationTemplateById,a237O as getAllocationTemplatesByScene,a237P as getAllocationTemplatesByIndustry,a237Q as suggestAllocationTemplateForScene,a237R as listAllocationTemplates,a237S 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,a237T as TREASURY_BUILTIN_PERMISSIONS,a237U as getTreasuryScenesByHostObject,a237V as findTreasurySceneById,a237W as findTreasurySceneByPermissionIndex,a237X as getTreasuryBuiltinPermissionByIndex,isBuiltinTreasuryPermission,a237Y as getActiveTreasuryBuiltinPermissions,a237Z as getReservedTreasuryBuiltinPermissions,a237a0 as inferTreasurySceneFromIntent,getTreasuryScenesCount,a237a1 as getTreasuryGovernedOperationsForPermissionIndex};export{a237a2 as initTreasuryPuzzleFromIntent,a237a3 as checkTreasuryPuzzleCompleteness,a237a4 as validateTreasuryConstraints,a237a5 as generateTreasuryPuzzleConfirmationText,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,a237a6 as TREASURY_MAX_DESCRIPTION_LENGTH};export{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,a237a7 as getTreasuryTemplateById,a237a8 as getTreasuryTemplatesByScene,a237a9 as getTreasuryTemplatesByIndustry,a237aa as suggestTreasuryTemplateForScene,a237ab as listTreasuryTemplates,a237ac 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,a237ad as getOrderScenesByOperationField,a237ae as findOrderSceneById,a237af as findOrderSceneByMoveEntry,a237ag as getOrderScenesByPermissionLayer,a237ah as getOrderScenesByReversibility,a237ai as getOrderFieldDef,a237aj as getOrderMutableFields,a237ak as getOrderImmutableFields,a237al as getOrderFrozenAfterProgressFields,a237am as getOrderOneTimeSetFields,a237an as inferOrderSceneFromIntent,a237ao as getOrderEmittedEvents,a237ap as getOrderInferredEvents,getOrderScenesCount,a237aq as sdkToMoveOrderField,a237ar as moveToSdkOrderField};export{a237as as initOrderPuzzleFromIntent,a237at as checkOrderPuzzleCompleteness,a237au as validateOrderConstraints,a237av as generateOrderPuzzleConfirmationText,a237aw as verifyOrderSnapshotMechanism,a237ax as inferOrderLifecyclePhase,a237ay as matchOrderSceneFromPuzzle,a237az as listAllOrderScenes,a237aA as lookupOrderScene};export{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,a237aB as getOrderTemplateById,a237aC as getOrderTemplatesByScene,a237aD as getOrderTemplatesByIndustry,a237aE as getOrderTemplatesByPermissionLayer,a237aF as getIrreversibleOrderTemplates,a237aG as suggestOrderTemplateForScene,listOrderTemplates,a237aH as fillOrderTemplate,a237aI as suggestOrderTemplateFromIntent,a237aJ as getOrderTemplateParameters,a237aK as validateOrderTemplateParams};export{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules};export{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,a237aL as PROGRESS_BUILTIN_PERMISSIONS,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,a237aM as getProgressScenesByPhase,a237aN as findProgressSceneById,a237aO as getProgressScenesByIndustry,a237aP as getProgressBuiltinPermissionByIndex,isProgressBuiltinPermission,a237aQ as inferProgressSceneFromIntent,a237aR as getAllProgressBuiltinPermissions,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount};export{a237aS as initProgressPuzzleFromIntent,a237aT as checkProgressPuzzleCompleteness,a237aU as validateProgressConstraints,a237aV as generateProgressPuzzleConfirmationText,a237aW as resolveProgressBuiltinPermission,isOrderHolderForward,a237aX 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,a237aY as ARBITRATION_BUILTIN_PERMISSIONS,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,a237aZ as getArbitrationScenesByCategory,a237b0 as findArbitrationSceneById,a237b1 as findArbitrationSceneByPermissionIndex,a237b2 as getArbitrationPermissionByIndex,a237b3 as getArbitrationPermissionByName,a237b4 as isArbitrationReservedIndex,a237b5 as isArbitrationUsedPermissionIndex,a237b6 as getArbitrationActivePermissionCount,a237b7 as inferArbitrationSceneFromIntent,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,a237b8 as getArbitrationScenesProducingStatus,a237b9 as getArbitrationScenesRequiringStatus,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions};export{a237ba as initArbitrationPuzzleFromIntent,a237bb as checkArbitrationPuzzleCompleteness,a237bc as validateArbitrationConstraints,a237bd as generateArbitrationPuzzleConfirmationText};export{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,a237be as getAllArbitrationTemplates,a237bf as getArbitrationTemplateById,a237bg as getArbitrationTemplatesByScene,a237bh as getArbitrationTemplatesByIndustry,a237bi as suggestArbitrationTemplateForScene,a237bj as listArbitrationTemplates,a237bk as fillArbitrationTemplate};export{ARBITRATION_RISK_VERSION,assessArbitrationRisks,a237bl 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,a237bm as getRewardScenesByPhase,a237bn as findRewardSceneById,a237bo as getRewardScenesByIndustry,a237bp as getRewardBuiltinPermissionByIndex,isRewardBuiltinPermission,a237bq as getAllRewardBuiltinPermissions,getRewardScenesCount,a237br as getRewardGuardConstructorSpec,a237bs as resolveRewardGuardConstructor,getRewardErrorByCode,getRewardErrorByName,a237bt as validateRewardGuardCount,a237bu as validateRewardRecordCount,a237bv as inferRewardSceneFromIntent};export{REWARD_FIELD_MUTABILITY,a237bw as initRewardPuzzleFromIntent,a237bx as checkRewardPuzzleCompleteness,a237by as validateRewardConstraints,a237bz as generateRewardPuzzleConfirmationText,a237bA as resolveRewardBuiltinPermission,a237bB as requiresRewardGuardConfig,a237bC as requiresRewardPassport,a237bD as getRewardRelevantDimensions,a237bE as getRewardFieldMutability,a237bF as isRewardAdminMutableField,a237bG 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,a237bH as getAllPassportScenarios,a237bI as getPassportScenesCount,a237bJ as findPassportScenarioById,a237bK as getPassportScenariosByConsumer,a237bL as getPassportScenariosUsingRelies,a237bM as inferPassportScenarioFromIntent,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,a237bN as getPassportErrorName,a237bO as getPassportErrorDescription};export{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,a237bP as getAllPassportTemplates,a237bQ as getPassportTemplateById,a237bR as getPassportTemplatesByScenario,a237bS as getPassportTemplatesByIndustry,a237bT as suggestPassportTemplateForScenario,a237bU as listPassportTemplates,a237bV 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,a237bW 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':a237L()['length'],'allocation_templates_count':ALLOCATION_TEMPLATES['length'],'allocation_context_enabled':!![],'treasury_scenes_count':TREASURY_SCENES['length'],'treasury_builtin_permissions_count':a237T['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':a237aL['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':a237aY['length'],'arbitration_risk_rules_count':a237bl()['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,namedOperatorRosterNote};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{getFlywheelForIndustry,listIndustries as
|
|
1
|
+
import{getFlywheelForIndustry,listIndustries as a240a,_setRegistryLookup as a240b}from'./acquisition-flywheel.js';import{getIndustryRiskChecks,getIndustryNeeds,getIndustryTemplate,SUPPORTED_INDUSTRIES}from'../customer/index.js';import{_setRegistryLookup as a240c}from'../customer/industry-risks.js';import{_setRegistryLookup as a240d}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'},'licensing':{'has_logistics':![],'communication_heavy':![],'pure_digital':!![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':!![],'regulatory_intensity':'medium','trust_sensitivity':'high','consumption_frequency':'occasional','avg_ticket_size':'medium'},'crowdfunding':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':!![],'deposit_required':!![],'multi_tier_allocation':!![],'regulatory_intensity':'high','trust_sensitivity':'high','consumption_frequency':'one_time','avg_ticket_size':'medium'},'delivery':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'high','trust_sensitivity':'medium','consumption_frequency':'frequent','avg_ticket_size':'small'},'group_buy':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':!![],'multi_tier_allocation':!![],'regulatory_intensity':'medium','trust_sensitivity':'high','consumption_frequency':'frequent','avg_ticket_size':'small'}},BUILTIN_DISPLAY_NAMES={'freelance':'Freelance','rental':'Rental','education':'Education','travel':'Travel','subscription':'Subscription','retail':'Retail','licensing':'Licensing','crowdfunding':'Crowdfunding','delivery':'Local\x20Delivery','group_buy':'Community\x20Group-Buy','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','license':'licensing','licensing':'licensing','licence':'licensing','royalty':'licensing','royalties':'licensing','ip-licensing':'licensing','intellectual-property':'licensing','music-rights':'licensing','sync-licensing':'licensing','beat-licensing':'licensing','crowdfunding':'crowdfunding','crowdfund':'crowdfunding','crowd-funding':'crowdfunding','fundraising':'crowdfunding','pledge':'crowdfunding','all-or-nothing':'crowdfunding','threshold-campaign':'crowdfunding','backer':'crowdfunding','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','royalty-exchange':'licensing','royaltyexchange':'licensing','beatstars':'licensing','kickstarter':'crowdfunding','indiegogo':'crowdfunding','gofundme':'crowdfunding','meituan-waimai':'delivery','meituan':'delivery','shansong':'delivery','eleme':'delivery','doordash':'delivery','ubereats':'delivery','duoduo-maicai':'group_buy','pinduoduo':'group_buy','kuaituantuan':'group_buy','meituan-youxuan':'group_buy','bnb':'rental','homestay':'rental','shortstay':'rental','short-stay':'rental','short-term-rental':'rental','delivery':'delivery','food-delivery':'delivery','takeout':'delivery','takeaway':'delivery','errand':'delivery','on-demand':'delivery','courier':'delivery','rideshare-delivery':'delivery','group-buy':'group_buy','groupbuy':'group_buy','community-group-buy':'group_buy','team-purchase':'group_buy','neighborhood-buy':'group_buy'};export const INDUSTRY_REGISTRY_VERSION=0x2;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(){a240b(a=>{const b=registry['get'](a);return b?{'flywheel':b['flywheel']}:undefined;}),a240c(a=>{const b=registry['get'](a);return b?{'risk_checks':b['risk_checks'],'needs':b['needs']}:undefined;}),a240d(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'](),a240b(null),a240c(null),a240d(null),seedBuiltinIndustries(),injectRegistryLookup();}export function listBuiltinIndustryNames(){return a240a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createQueryCoverage,data2object,discoveryDataSource,ENTRYPOINT,extractGenericTypeArg,PackageAddress,query_arbs,query_demands,query_events,query_services,RemoteIndexClient,RemoteIndexError,remoteIndexUrl}from'@wowok/wowok';import{resolveChainIdentity}from'@wowok/wowok/w/local/chain-scope';import{batchQueryObjectsByIds as a241a}from'../graph/onchain/sdk-batch.js';import{projectionUpsert,projectionServe}from'./projection.js';function toStr(a){if(typeof a==='string')return a;if(typeof a==='number'||typeof a==='bigint')return String(a);return undefined;}const BUILTIN_INDEX_URL={[ENTRYPOINT['Testnet']]:'https://indexer.testnet.wowok.net'};export function indexUrlFor(a,b){return remoteIndexUrl(b)??BUILTIN_INDEX_URL[a];}const freshnessVerdicts=new Map(),FRESHNESS_TTL_MS=0xea60,FRESHNESS_FAIL_TTL_MS=0x3a98;async function indexReportsStale(a){const b=Date['now'](),c=freshnessVerdicts['get'](a);if(c&&c['expiresAt']>b)return c['stale'];try{const d=await fetch(new URL('/v1/status',a),{'method':'GET','headers':{'accept':'application/json'},'signal':AbortSignal['timeout'](0x1388)});if(!d['ok'])throw new Error('HTTP\x20'+d['status']);const e=await d['json'](),f=e?.['freshness']?.['stale']===!![];return freshnessVerdicts['set'](a,{'expiresAt':b+FRESHNESS_TTL_MS,'stale':f}),f;}catch{return freshnessVerdicts['set'](a,{'expiresAt':b+FRESHNESS_FAIL_TTL_MS,'stale':![]}),![];}}export function __resetIndexFreshnessCache(){freshnessVerdicts['clear']();}export function withDegradedReasons(a,b){return a['coverage']=createQueryCoverage({'mode':a['coverage']['mode'],'totalEnumerated':a['coverage']['total_enumerated'],'truncated':a['coverage']['truncated'],'chainId':a['coverage']['chain_id'],'degradedReasons':[...a['coverage']['degraded_reasons'],...b]}),a;}export function indexErrorCode(a){const b=a?.['code'];return typeof b==='string'&&/^INDEX_[A-Z_]+$/['test'](b)?b:'INDEX_UNAVAILABLE';}async function withRemoteIndex(a,b,c){const d=discoveryDataSource(),e=indexUrlFor(a);if(d==='legacy'||d==='auto'&&!e)return c();if(!e)throw new Error('INDEX_NOT_CONFIGURED:\x20WOWOK_INDEX_URL\x20is\x20required');if(d==='auto'&&await indexReportsStale(e))return withDegradedReasons(await c(),['REMOTE_INDEX_FALLBACK','INDEX_STALE_PROJECTION']);try{const f=await b(e);if(d==='auto'&&f['total_enumerated']===0x0)return withDegradedReasons(await c(),['REMOTE_INDEX_FALLBACK','INDEX_KIND_EMPTY']);return f;}catch(g){if(d==='remote')throw g;return withDegradedReasons(await c(),['REMOTE_INDEX_FALLBACK',indexErrorCode(g)]);}}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};}async function projectionChainId(a){try{return await resolveChainIdentity(a)??undefined;}catch{return undefined;}}function projectionCoverage(a,b,c){return createQueryCoverage({'mode':'event_window','totalEnumerated':b,'truncated':![],'chainId':a,'degradedReasons':['EVENT_BACKED_ENUMERATION','PROJECTION_CACHED','PROJECTION_REFRESHED_AT='+c]});}function weiString(a){return typeof a==='string'&&/^\d+$/['test'](a)?a:undefined;}function serviceProjectionRows(a){return a['map'](b=>{const c=b['json']??{},d=Array['isArray'](c['sales'])?c['sales']:[],e=d['map'](h=>weiString(h['price']))['filter'](h=>!!h)['sort'](),f=Array['isArray'](c['arbitrations'])?c['arbitrations']:[],g=weiString(c['compensation_fund']);return{'object_id':b['object'],'owner':typeof c['owner']==='string'?c['owner']:undefined,'type_raw':b['type_raw'],'name':b['name'],'location':b['location'],'description':typeof c['description']==='string'?c['description']:undefined,'coin_type':b['type_raw']?extractGenericTypeArg(b['type_raw']):undefined,'published':c['bPublished']===!![]?0x1:0x0,'paused':c['bPaused']===!![]?0x1:0x0,'price_min_wei':e[0x0],'price_max_wei':e['length']>0x0?e[e['length']-0x1]:undefined,'cap_arbitration':f['length']>0x0?0x1:0x0,'cap_compensation':g!==undefined&&g!=='0'?0x1:0x0,'cap_machine':c['machine']!=null?0x1:0x0,'cap_messenger':c['um']!=null?0x1:0x0,'cap_buy_guard':c['buy_guard']!=null?0x1:0x0,'cap_wip':d['some'](h=>typeof h['wip_hash']==='string'&&h['wip_hash']['length']>0x0)?0x1:0x0,'payload':JSON['stringify'](b)};});}function objectProjectionRows(a){return a['filter'](b=>typeof b?.['object']==='string')['map'](b=>({'object_id':String(b['object']),'owner':typeof b['owner']==='string'?b['owner']:undefined,'location':typeof b['location']==='string'?b['location']:undefined,'description':typeof b['description']==='string'?b['description']:undefined,'payload':JSON['stringify'](b)}));}async function projectionRecord(a,b,c,d,e){try{const f=await projectionChainId(b);if(f)projectionUpsert(f,a,c,{'hasMore':d,'maxObjects':e});}catch{}}async function serveFromProjectionServices(a,b){try{const c=await projectionChainId(a);if(!c)return undefined;const d=projectionServe(c,'Service',{'location_any':b['location_any'],'name_contains':b['name_contains'],'coin_type':b['coin_type']},b['max_objects']??0xc8);if(!d)return undefined;return{'services':d['items'],'total_enumerated':d['meta']['total_rows'],'has_more':![],'coverage':projectionCoverage(c,d['meta']['total_rows'],d['meta']['watermark']['refreshed_at'])};}catch{return undefined;}}async function enumerateServicesByEvent(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ServiceEvent',l=>typeof l?.['object']==='string'?l['object']:undefined,a,c,b['no_cache']),f=await a241a(d,a,b['no_cache']),g=(b['location_any']??[])['map'](l=>l['toLowerCase']()),h=b['name_contains']?.['toLowerCase'](),i=f['filter'](l=>(l?.['type']??'')==='Service'),j=i['map'](l=>({'object':String(l['object']),'type_raw':typeof l['type_raw']==='string'?l['type_raw']:undefined,'name':typeof l['name']==='string'?l['name']:undefined,'location':typeof l['location']==='string'?l['location']:'','json':{...l,'compensation_fund':toStr(l['compensation_fund']),'sales':Array['isArray'](l['sales'])?l['sales']['map'](m=>({...m,'price':toStr(m['price'])})):[]}}));await projectionRecord('Service',a,serviceProjectionRows(j),e,c);const k=j['filter'](l=>{if(b['coin_type']&&extractGenericTypeArg(l['type_raw']??'')!==b['coin_type'])return![];if(h&&!(typeof l['name']==='string'&&l['name']['toLowerCase']()['includes'](h)))return![];if(g['length']===0x0)return!![];const m=typeof l['location']==='string'?l['location']['toLowerCase']():'';return g['some'](n=>m['includes'](n));});return{'services':k,'total_enumerated':i['length'],'has_more':e,'coverage':createQueryCoverage({'mode':'event_window','totalEnumerated':i['length'],'truncated':e,'degradedReasons':['EVENT_BACKED_ENUMERATION']})};}async function enumerateDemandsByEvent(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 a241a(d,a,b['no_cache']),g=f['filter'](h=>(h?.['type']??'')==='Demand')['map'](h=>h);return await projectionRecord('Demand',a,objectProjectionRows(g),e,c),{'demands':g,'total_enumerated':g['length'],'has_more':e,'coverage':createQueryCoverage({'mode':'event_window','totalEnumerated':g['length'],'truncated':e,'degradedReasons':['EVENT_BACKED_ENUMERATION']})};}async function enumerateArbsByEvent(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ArbEvent',j=>typeof j?.['arb']==='string'?j['arb']:undefined,a,c,b['no_cache']),f=await a241a(d,a,b['no_cache']),g=b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']:[b['status']],h=f['filter'](j=>(j?.['type']??'')==='Arb')['map'](j=>j),i=h['filter'](j=>b['arbitration']?j['arbitration']===b['arbitration']:!![])['filter'](j=>b['order']?j['order']===b['order']:!![])['filter'](j=>g?g['includes'](Number(j['status'])):!![]);return await projectionRecord('Arb',a,objectProjectionRows(h),e,c),{'arbs':i,'total_enumerated':i['length'],'has_more':e,'coverage':createQueryCoverage({'mode':'event_window','totalEnumerated':h['length'],'truncated':e,'degradedReasons':['EVENT_BACKED_ENUMERATION']})};}export async function enumerateServices(a,b={}){return withRemoteIndex(a,c=>query_services({...b,'network':a,'data_source':'remote','index_url':c}),async()=>{if(!b['no_cache']){const d=await serveFromProjectionServices(a,b);if(d)return d;}const c=await enumerateServicesByEvent(a,b);return c;});}export async function enumerateDemands(a,b={}){return withRemoteIndex(a,c=>query_demands({...b,'network':a,'data_source':'remote','index_url':c}),async()=>{if(!b['no_cache'])try{const c=await projectionChainId(a),d=c?projectionServe(c,'Demand',{},b['max_objects']??0xc8):undefined;if(d)return{'demands':d['items'],'total_enumerated':d['meta']['total_rows'],'has_more':![],'coverage':projectionCoverage(c,d['meta']['total_rows'],d['meta']['watermark']['refreshed_at'])};}catch{}return enumerateDemandsByEvent(a,b);});}export async function enumerateArbs(a,b={}){const c=b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']['map'](Number):Number(b['status']);return withRemoteIndex(a,d=>query_arbs({...b,'status':c,'network':a,'data_source':'remote','index_url':d}),async()=>{if(!b['no_cache'])try{const d=await projectionChainId(a),e=d?projectionServe(d,'Arb',{'arbitration':b['arbitration'],'order':b['order'],'status':b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']['map'](Number):[Number(b['status'])]},b['max_objects']??0xc8):undefined;if(e)return{'arbs':e['items'],'total_enumerated':e['meta']['total_rows'],'has_more':![],'coverage':projectionCoverage(d,e['meta']['total_rows'],e['meta']['watermark']['refreshed_at'])};}catch{}return enumerateArbsByEvent(a,b);});}export function weiToWowDecimal(a){if(!/^\d+$/['test'](a))throw new Error('Not\x20a\x20wei\x20decimal\x20string:\x20'+a);const b=a['padStart'](0xa,'0'),c=b['slice'](0x0,-0x9)['replace'](/^0+(?=\d)/,''),d=b['slice'](-0x9)['replace'](/0+$/,'');return d?c+'.'+d:c;}async function matchViaIndex(a,b,c){const d=indexUrlFor(a,c['indexUrl']);if(!d)throw new RemoteIndexError('INDEX_NOT_CONFIGURED','WOWOK_INDEX_URL\x20or\x20index_url\x20is\x20required');if(discoveryDataSource()==='auto'&&await indexReportsStale(d))throw new RemoteIndexError('INDEX_STALE_PROJECTION','Remote\x20index\x20projection\x20is\x20behind\x20the\x20chain\x20head');const e=await resolveChainIdentity(a);if(!e)throw new RemoteIndexError('INDEX_CHAIN_IDENTITY_UNAVAILABLE','JSON-RPC\x20chain\x20identity\x20is\x20required\x20before\x20reading\x20a\x20remote\x20index');const f=new RemoteIndexClient(d);return f['match']({'kind':b,'expectedChainId':e,'q':c['q'],'location':c['location'],'budget':c['budgetWei']!==undefined?weiToWowDecimal(c['budgetWei']):undefined,'industry':c['industry'],'capabilities':c['capabilities'],'limit':c['limit'],'recallLimit':c['recallLimit'],'includePayload':!![]});}export async function matchServicesViaIndex(a,b={}){return matchViaIndex(a,'Service',b);}export async function matchDemandsViaIndex(a,b={}){const d=await matchViaIndex(a,'Demand',b),e=[];let f=0x0;for(const h of d['candidates']){if(!h['payloadJson']||h['verifiedKind']!=='Demand'){f+=0x1;continue;}try{const i=data2object({'objectId':h['objectId'],'version':h['objectVersion'],'type':PackageAddress+'::demand::Demand','content':{'fields':h['payloadJson']}});if(i['type']!=='Demand'){f+=0x1;continue;}typeof i['presenters_count']==='string'&&/^\d+$/['test'](i['presenters_count'])&&(i['presenters_count']=Number(i['presenters_count'])),e['push'](i);}catch{f+=0x1;}}const g=f>0x0?createQueryCoverage({'mode':d['coverage']['mode'],'totalEnumerated':d['coverage']['total_enumerated'],'truncated':d['coverage']['truncated'],'chainId':d['coverage']['chain_id'],'degradedReasons':[...d['coverage']['degraded_reasons'],'MATCH_PAYLOAD_MISSING='+f+'\x20of\x20'+d['candidates']['length']+'\x20candidates']}):d['coverage'];return{'demands':e,'total_enumerated':d['recall']['liveSet']??d['recall']['gated'],'has_more':d['truncated'],'coverage':g};}export async function aggregateOrdersViaIndex(a,b={}){const c=indexUrlFor(a,b['indexUrl']);if(!c)throw new RemoteIndexError('INDEX_NOT_CONFIGURED','WOWOK_INDEX_URL\x20or\x20index_url\x20is\x20required');if(discoveryDataSource()==='auto'&&await indexReportsStale(c))throw new RemoteIndexError('INDEX_STALE_PROJECTION','Remote\x20index\x20projection\x20is\x20behind\x20the\x20chain\x20head');const d=new URLSearchParams({'kind':'Order'});if(b['group'])d['set']('group',b['group']);if(b['groupId'])d['set']('group_id',b['groupId']);if(b['metric'])d['set']('metric',b['metric']);if(b['excludeClaimed'])d['set']('exclude_claimed','1');if(b['limit']!==undefined)d['set']('limit',String(b['limit']));let e;try{e=await fetch(new URL('/v1/aggregate?'+d,c),{'method':'GET','headers':{'accept':'application/json'},'signal':AbortSignal['timeout'](0x2710)});}catch(f){throw new RemoteIndexError('INDEX_UNAVAILABLE','Aggregate\x20read\x20failed:\x20'+f['message']);}if(!e['ok']){const g=await e['json']()['catch'](()=>null);throw new RemoteIndexError('INDEX_BAD_REQUEST',g?.['error']?.['message']??'HTTP\x20'+e['status']);}return await e['json']();}
|
|
1
|
+
import{createQueryCoverage,data2object,discoveryDataSource,ENTRYPOINT,extractGenericTypeArg,PackageAddress,query_arbs,query_demands,query_events,query_services,RemoteIndexClient,RemoteIndexError,remoteIndexUrl}from'@wowok/wowok';import{resolveChainIdentity}from'@wowok/wowok/w/local/chain-scope';import{batchQueryObjectsByIds as a244a}from'../graph/onchain/sdk-batch.js';import{projectionUpsert,projectionServe}from'./projection.js';function toStr(a){if(typeof a==='string')return a;if(typeof a==='number'||typeof a==='bigint')return String(a);return undefined;}const BUILTIN_INDEX_URL={[ENTRYPOINT['Testnet']]:'https://indexer.testnet.wowok.net'};export function indexUrlFor(a,b){return remoteIndexUrl(b)??BUILTIN_INDEX_URL[a];}const freshnessVerdicts=new Map(),FRESHNESS_TTL_MS=0xea60,FRESHNESS_FAIL_TTL_MS=0x3a98;async function indexReportsStale(a){const b=Date['now'](),c=freshnessVerdicts['get'](a);if(c&&c['expiresAt']>b)return c['stale'];try{const d=await fetch(new URL('/v1/status',a),{'method':'GET','headers':{'accept':'application/json'},'signal':AbortSignal['timeout'](0x1388)});if(!d['ok'])throw new Error('HTTP\x20'+d['status']);const e=await d['json'](),f=e?.['freshness']?.['stale']===!![];return freshnessVerdicts['set'](a,{'expiresAt':b+FRESHNESS_TTL_MS,'stale':f}),f;}catch{return freshnessVerdicts['set'](a,{'expiresAt':b+FRESHNESS_FAIL_TTL_MS,'stale':![]}),![];}}export function __resetIndexFreshnessCache(){freshnessVerdicts['clear']();}export function withDegradedReasons(a,b){return a['coverage']=createQueryCoverage({'mode':a['coverage']['mode'],'totalEnumerated':a['coverage']['total_enumerated'],'truncated':a['coverage']['truncated'],'chainId':a['coverage']['chain_id'],'degradedReasons':[...a['coverage']['degraded_reasons'],...b]}),a;}export function indexErrorCode(a){const b=a?.['code'];return typeof b==='string'&&/^INDEX_[A-Z_]+$/['test'](b)?b:'INDEX_UNAVAILABLE';}async function withRemoteIndex(a,b,c){const d=discoveryDataSource(),e=indexUrlFor(a);if(d==='legacy'||d==='auto'&&!e)return c();if(!e)throw new Error('INDEX_NOT_CONFIGURED:\x20WOWOK_INDEX_URL\x20is\x20required');if(d==='auto'&&await indexReportsStale(e))return withDegradedReasons(await c(),['REMOTE_INDEX_FALLBACK','INDEX_STALE_PROJECTION']);try{const f=await b(e);if(d==='auto'&&f['total_enumerated']===0x0)return withDegradedReasons(await c(),['REMOTE_INDEX_FALLBACK','INDEX_KIND_EMPTY']);return f;}catch(g){if(d==='remote')throw g;return withDegradedReasons(await c(),['REMOTE_INDEX_FALLBACK',indexErrorCode(g)]);}}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};}async function projectionChainId(a){try{return await resolveChainIdentity(a)??undefined;}catch{return undefined;}}function projectionCoverage(a,b,c){return createQueryCoverage({'mode':'event_window','totalEnumerated':b,'truncated':![],'chainId':a,'degradedReasons':['EVENT_BACKED_ENUMERATION','PROJECTION_CACHED','PROJECTION_REFRESHED_AT='+c]});}function weiString(a){return typeof a==='string'&&/^\d+$/['test'](a)?a:undefined;}function serviceProjectionRows(a){return a['map'](b=>{const c=b['json']??{},d=Array['isArray'](c['sales'])?c['sales']:[],e=d['map'](h=>weiString(h['price']))['filter'](h=>!!h)['sort'](),f=Array['isArray'](c['arbitrations'])?c['arbitrations']:[],g=weiString(c['compensation_fund']);return{'object_id':b['object'],'owner':typeof c['owner']==='string'?c['owner']:undefined,'type_raw':b['type_raw'],'name':b['name'],'location':b['location'],'description':typeof c['description']==='string'?c['description']:undefined,'coin_type':b['type_raw']?extractGenericTypeArg(b['type_raw']):undefined,'published':c['bPublished']===!![]?0x1:0x0,'paused':c['bPaused']===!![]?0x1:0x0,'price_min_wei':e[0x0],'price_max_wei':e['length']>0x0?e[e['length']-0x1]:undefined,'cap_arbitration':f['length']>0x0?0x1:0x0,'cap_compensation':g!==undefined&&g!=='0'?0x1:0x0,'cap_machine':c['machine']!=null?0x1:0x0,'cap_messenger':c['um']!=null?0x1:0x0,'cap_buy_guard':c['buy_guard']!=null?0x1:0x0,'cap_wip':d['some'](h=>typeof h['wip_hash']==='string'&&h['wip_hash']['length']>0x0)?0x1:0x0,'payload':JSON['stringify'](b)};});}function objectProjectionRows(a){return a['filter'](b=>typeof b?.['object']==='string')['map'](b=>({'object_id':String(b['object']),'owner':typeof b['owner']==='string'?b['owner']:undefined,'location':typeof b['location']==='string'?b['location']:undefined,'description':typeof b['description']==='string'?b['description']:undefined,'payload':JSON['stringify'](b)}));}async function projectionRecord(a,b,c,d,e){try{const f=await projectionChainId(b);if(f)projectionUpsert(f,a,c,{'hasMore':d,'maxObjects':e});}catch{}}async function serveFromProjectionServices(a,b){try{const c=await projectionChainId(a);if(!c)return undefined;const d=projectionServe(c,'Service',{'location_any':b['location_any'],'name_contains':b['name_contains'],'coin_type':b['coin_type']},b['max_objects']??0xc8);if(!d)return undefined;return{'services':d['items'],'total_enumerated':d['meta']['total_rows'],'has_more':![],'coverage':projectionCoverage(c,d['meta']['total_rows'],d['meta']['watermark']['refreshed_at'])};}catch{return undefined;}}async function enumerateServicesByEvent(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ServiceEvent',l=>typeof l?.['object']==='string'?l['object']:undefined,a,c,b['no_cache']),f=await a244a(d,a,b['no_cache']),g=(b['location_any']??[])['map'](l=>l['toLowerCase']()),h=b['name_contains']?.['toLowerCase'](),i=f['filter'](l=>(l?.['type']??'')==='Service'),j=i['map'](l=>({'object':String(l['object']),'type_raw':typeof l['type_raw']==='string'?l['type_raw']:undefined,'name':typeof l['name']==='string'?l['name']:undefined,'location':typeof l['location']==='string'?l['location']:'','json':{...l,'compensation_fund':toStr(l['compensation_fund']),'sales':Array['isArray'](l['sales'])?l['sales']['map'](m=>({...m,'price':toStr(m['price'])})):[]}}));await projectionRecord('Service',a,serviceProjectionRows(j),e,c);const k=j['filter'](l=>{if(b['coin_type']&&extractGenericTypeArg(l['type_raw']??'')!==b['coin_type'])return![];if(h&&!(typeof l['name']==='string'&&l['name']['toLowerCase']()['includes'](h)))return![];if(g['length']===0x0)return!![];const m=typeof l['location']==='string'?l['location']['toLowerCase']():'';return g['some'](n=>m['includes'](n));});return{'services':k,'total_enumerated':i['length'],'has_more':e,'coverage':createQueryCoverage({'mode':'event_window','totalEnumerated':i['length'],'truncated':e,'degradedReasons':['EVENT_BACKED_ENUMERATION']})};}async function enumerateDemandsByEvent(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 a244a(d,a,b['no_cache']),g=f['filter'](h=>(h?.['type']??'')==='Demand')['map'](h=>h);return await projectionRecord('Demand',a,objectProjectionRows(g),e,c),{'demands':g,'total_enumerated':g['length'],'has_more':e,'coverage':createQueryCoverage({'mode':'event_window','totalEnumerated':g['length'],'truncated':e,'degradedReasons':['EVENT_BACKED_ENUMERATION']})};}async function enumerateArbsByEvent(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ArbEvent',j=>typeof j?.['arb']==='string'?j['arb']:undefined,a,c,b['no_cache']),f=await a244a(d,a,b['no_cache']),g=b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']:[b['status']],h=f['filter'](j=>(j?.['type']??'')==='Arb')['map'](j=>j),i=h['filter'](j=>b['arbitration']?j['arbitration']===b['arbitration']:!![])['filter'](j=>b['order']?j['order']===b['order']:!![])['filter'](j=>g?g['includes'](Number(j['status'])):!![]);return await projectionRecord('Arb',a,objectProjectionRows(h),e,c),{'arbs':i,'total_enumerated':i['length'],'has_more':e,'coverage':createQueryCoverage({'mode':'event_window','totalEnumerated':h['length'],'truncated':e,'degradedReasons':['EVENT_BACKED_ENUMERATION']})};}export async function enumerateServices(a,b={}){return withRemoteIndex(a,c=>query_services({...b,'network':a,'data_source':'remote','index_url':c}),async()=>{if(!b['no_cache']){const d=await serveFromProjectionServices(a,b);if(d)return d;}const c=await enumerateServicesByEvent(a,b);return c;});}export async function enumerateDemands(a,b={}){return withRemoteIndex(a,c=>query_demands({...b,'network':a,'data_source':'remote','index_url':c}),async()=>{if(!b['no_cache'])try{const c=await projectionChainId(a),d=c?projectionServe(c,'Demand',{},b['max_objects']??0xc8):undefined;if(d)return{'demands':d['items'],'total_enumerated':d['meta']['total_rows'],'has_more':![],'coverage':projectionCoverage(c,d['meta']['total_rows'],d['meta']['watermark']['refreshed_at'])};}catch{}return enumerateDemandsByEvent(a,b);});}export async function enumerateArbs(a,b={}){const c=b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']['map'](Number):Number(b['status']);return withRemoteIndex(a,d=>query_arbs({...b,'status':c,'network':a,'data_source':'remote','index_url':d}),async()=>{if(!b['no_cache'])try{const d=await projectionChainId(a),e=d?projectionServe(d,'Arb',{'arbitration':b['arbitration'],'order':b['order'],'status':b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']['map'](Number):[Number(b['status'])]},b['max_objects']??0xc8):undefined;if(e)return{'arbs':e['items'],'total_enumerated':e['meta']['total_rows'],'has_more':![],'coverage':projectionCoverage(d,e['meta']['total_rows'],e['meta']['watermark']['refreshed_at'])};}catch{}return enumerateArbsByEvent(a,b);});}export function weiToWowDecimal(a){if(!/^\d+$/['test'](a))throw new Error('Not\x20a\x20wei\x20decimal\x20string:\x20'+a);const b=a['padStart'](0xa,'0'),c=b['slice'](0x0,-0x9)['replace'](/^0+(?=\d)/,''),d=b['slice'](-0x9)['replace'](/0+$/,'');return d?c+'.'+d:c;}async function matchViaIndex(a,b,c){const d=indexUrlFor(a,c['indexUrl']);if(!d)throw new RemoteIndexError('INDEX_NOT_CONFIGURED','WOWOK_INDEX_URL\x20or\x20index_url\x20is\x20required');if(discoveryDataSource()==='auto'&&await indexReportsStale(d))throw new RemoteIndexError('INDEX_STALE_PROJECTION','Remote\x20index\x20projection\x20is\x20behind\x20the\x20chain\x20head');const e=await resolveChainIdentity(a);if(!e)throw new RemoteIndexError('INDEX_CHAIN_IDENTITY_UNAVAILABLE','JSON-RPC\x20chain\x20identity\x20is\x20required\x20before\x20reading\x20a\x20remote\x20index');const f=new RemoteIndexClient(d);return f['match']({'kind':b,'expectedChainId':e,'q':c['q'],'location':c['location'],'budget':c['budgetWei']!==undefined?weiToWowDecimal(c['budgetWei']):undefined,'industry':c['industry'],'capabilities':c['capabilities'],'limit':c['limit'],'recallLimit':c['recallLimit'],'includePayload':!![]});}export async function matchServicesViaIndex(a,b={}){return matchViaIndex(a,'Service',b);}export async function matchDemandsViaIndex(a,b={}){const d=await matchViaIndex(a,'Demand',b),e=[];let f=0x0;for(const h of d['candidates']){if(!h['payloadJson']||h['verifiedKind']!=='Demand'){f+=0x1;continue;}try{const i=data2object({'objectId':h['objectId'],'version':h['objectVersion'],'type':PackageAddress+'::demand::Demand','content':{'fields':h['payloadJson']}});if(i['type']!=='Demand'){f+=0x1;continue;}typeof i['presenters_count']==='string'&&/^\d+$/['test'](i['presenters_count'])&&(i['presenters_count']=Number(i['presenters_count'])),e['push'](i);}catch{f+=0x1;}}const g=f>0x0?createQueryCoverage({'mode':d['coverage']['mode'],'totalEnumerated':d['coverage']['total_enumerated'],'truncated':d['coverage']['truncated'],'chainId':d['coverage']['chain_id'],'degradedReasons':[...d['coverage']['degraded_reasons'],'MATCH_PAYLOAD_MISSING='+f+'\x20of\x20'+d['candidates']['length']+'\x20candidates']}):d['coverage'];return{'demands':e,'total_enumerated':d['recall']['liveSet']??d['recall']['gated'],'has_more':d['truncated'],'coverage':g};}export async function aggregateOrdersViaIndex(a,b={}){const c=indexUrlFor(a,b['indexUrl']);if(!c)throw new RemoteIndexError('INDEX_NOT_CONFIGURED','WOWOK_INDEX_URL\x20or\x20index_url\x20is\x20required');if(discoveryDataSource()==='auto'&&await indexReportsStale(c))throw new RemoteIndexError('INDEX_STALE_PROJECTION','Remote\x20index\x20projection\x20is\x20behind\x20the\x20chain\x20head');const d=new URLSearchParams({'kind':'Order'});if(b['group'])d['set']('group',b['group']);if(b['groupId'])d['set']('group_id',b['groupId']);if(b['metric'])d['set']('metric',b['metric']);if(b['excludeClaimed'])d['set']('exclude_claimed','1');if(b['limit']!==undefined)d['set']('limit',String(b['limit']));let e;try{e=await fetch(new URL('/v1/aggregate?'+d,c),{'method':'GET','headers':{'accept':'application/json'},'signal':AbortSignal['timeout'](0x2710)});}catch(f){throw new RemoteIndexError('INDEX_UNAVAILABLE','Aggregate\x20read\x20failed:\x20'+f['message']);}if(!e['ok']){const g=await e['json']()['catch'](()=>null);throw new RemoteIndexError('INDEX_BAD_REQUEST',g?.['error']?.['message']??'HTTP\x20'+e['status']);}return await e['json']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const KNOB_UNIT_HINTS=[{'suffix':'_bps','doc':'basis\x20points\x20(1/10000\x20=\x200.01%)\x20of\x20the\x20amount\x20the\x20rate\x20applies\x20to'},{'suffix':'_days','doc':'days\x20—\x20relative\x20window/duration\x20measured\x20from\x20this\x20template\x27s\x20anchor\x20(see\x20the\x20notes\x20below)'},{'suffix':'_hours','doc':'hours\x20—\x20relative\x20window/duration'},{'suffix':'_months','doc':'months'},{'suffix':'_ms','doc':'epoch\x20milliseconds\x20—\x20ABSOLUTE\x20instant\x20(ms\x20since\x201970\x20UTC),\x20NOT\x20a\x20duration;\x20override\x20per\x20build'},{'suffix':'_usd','doc':'USD\x20figure\x20—\x20off-chain\x20reference/benchmark'}];const MERGED_LOCK_DOC='days\x20—\x20relative\x20window;\x20if\x20listed\x20in\x20this\x20template\x27s\x20settlement_window_merge,\x20it\x20folds\x20into\x20the\x20ONE\x20'+'settlement\x20time-lock\x20(the\x20compiled\x20release\x20instant\x20is\x20the\x20SUM\x20of\x20the\x20merged\x20windows\x20—\x20compile\x20refuses\x20'+'a\x20disagreeing\x20literal)',KNOB_DOCS={'review_reward_pool':'RAW\x20on-chain\x20smallest\x20units\x20(u64),\x20NOT\x20human\x20units\x20—\x20e.g.\x20a\x200.5\x20WOW\x20pool\x20is\x20500000000.\x20Pool\x20plan\x20'+'benchmark\x20(expected\x20claims\x20x\x20review_reward_per_claim);\x20funded\x20at\x20build\x20time\x20via\x20the\x20reward_funding\x20input','review_reward_per_claim':'RAW\x20on-chain\x20smallest\x20units\x20per\x20claim\x20—\x20the\x20pool\x20plan\x20=\x20expected\x20claims\x20x\x20this\x20value\x20'+'(e.g.\x200.02\x20WOW\x20=\x2020\x20claims\x20at\x200.001\x20WOW/claim)','courier_fee':'RAW\x20on-chain\x20smallest\x20units\x20per\x20order\x20(e.g.\x205\x20WOW\x20=\x20500000000)\x20—\x20a\x20disclosure-only\x20pricing\x20input\x20on\x20'+'this\x20template\x20(TPL-04)','min_sku_price':'floor-price\x20constraint\x20—\x20the\x20fixed\x20fulfillment\x20fee\x20must\x20stay\x20BELOW\x20the\x20cheapest\x20listed\x20SKU:\x20a\x20'+'sub-fee\x20order\x20deadlocks\x20(EINSUFFICIENT_BALANCE:\x20balance\x20>=\x20fix)','commission_rate_bps':'basis\x20points\x20of\x20the\x20order\x20total\x20(10000\x20=\x20100%);\x20whether\x20a\x20settlement\x20row\x20actually\x20reads\x20it\x20is\x20'+'template-specific\x20—\x20see\x20the\x20User\x20inputs\x20notes\x20below','platform_commission_bps':'basis\x20points\x20of\x20the\x20order\x20total\x20(10000\x20=\x20100%);\x20whether\x20a\x20platform\x20settlement\x20row\x20actually\x20reads\x20it\x20'+'is\x20template-specific\x20—\x20see\x20the\x20User\x20inputs\x20notes\x20below','merchant_service_fee_bps':'basis\x20points\x20of\x20the\x20order\x20total\x20(10000\x20=\x20100%)\x20—\x20the\x20merchant\x27s\x20own\x20fee;\x20its\x20recipient\x20Entity\x20must\x20'+'be\x20explicit\x20and\x20non-empty\x20(an\x20empty\x20Entity\x20recipient\x20burns\x20the\x20share\x20permanently)','settlement_days':MERGED_LOCK_DOC,'reserve_days':MERGED_LOCK_DOC,'return_window_days':MERGED_LOCK_DOC,'claim_window_days':'days\x20—\x20the\x20dispute-FILING\x20window:\x20filing\x20closes\x20at\x20window\x20entry\x20+\x20this\x20value;\x20the\x20merged\x20settlement\x20'+'duration\x20must\x20stay\x20>=\x20this\x20value\x20so\x20filing\x20always\x20shuts\x20before\x20the\x20release\x20opens','dispute_window_days':'days\x20—\x20post-settlement\x20arbitration\x20claim\x20window','auto_confirm_days':'days\x20after\x20shipment\x20—\x20buyer\x20silence\x20auto-confirms\x20delivery\x20(keeper\x20AutoConfirmDelivery);\x20a\x20silent\x20'+'buyer\x20can\x20never\x20strand\x20the\x20escrow','review_window_days':'days\x20after\x20delivery\x20—\x20reviews\x20are\x20accepted\x20only\x20WITHIN\x20this\x20window','reward_claim_closes_after_days':'days\x20after\x20the\x20review\x20node\x20entry\x20—\x20the\x20reward\x20claim\x20window\x20closes\x20then\x20(the\x20window\x20is\x20'+'opens_after_days\x20+\x20closes_after_days\x20where\x20both\x20are\x20declared)','experience_claim_closes_after_days':'days\x20after\x20the\x20claim-allowed\x20entry\x20—\x20the\x20experience-compensation\x20claim\x20window\x20closes\x20then\x20(K3\x20C-11:\x20'+'default\x207;\x20the\x20window\x20opens\x20after\x20the\x20after-sales\x20return\x20window\x20lapses\x20so\x20a\x20refunded\x20order\x20cannot\x20claim)','processing_time_days':'days\x20from\x20order\x20entry\x20—\x20the\x20ship\x20deadline;\x20lapsing\x20unshipped\x20=\x20keeper\x20force-cancel\x20with\x20a\x20full\x20'+'buyer\x20refund\x20(permission\x201002)','settlement_delay_days':'days\x20after\x20delivery\x20confirmation\x20—\x20the\x20fast\x20settlement\x20release\x20delay\x20(the\x200-3\x20day\x20lever\x20vs\x20the\x20'+'marketplace-length\x20cycle)','free_cancel_hours':'hours\x20from\x20order\x20entry\x20—\x20free\x20cancellation\x20closes\x20after\x20this\x20(benchmark:\x20processing_time_days\x20x\x2024,\x20'+'the\x20same\x20ship\x20deadline)','campaign_deadline_ms':'ABSOLUTE\x20epoch\x20milliseconds\x20(ms\x20since\x201970\x20UTC),\x20NOT\x20a\x20duration\x20—\x20ONE\x20shared\x20deadline\x20for\x20every\x20'+'order\x20of\x20the\x20round;\x20ALWAYS\x20override\x20per\x20build\x20(0\x20=\x20UNSET\x20where\x20allowed);\x20bind\x20'+'pattern.time_source_repository_oracle\x20for\x20a\x20real-world\x20calendar\x20date','service_start_ms':'ABSOLUTE\x20epoch\x20milliseconds\x20(ms\x20since\x201970\x20UTC),\x20NOT\x20a\x20duration\x20—\x20override\x20per\x20build','required_info_enforcement':'selector:\x20\x22off\x22\x20keeps\x20the\x20tracking-only\x20ship\x20gate;\x20\x22on\x22\x20mounts\x20the\x20composite\x20ship_enforced\x20'+'design\x20(required\x20buyer\x20info\x20demanded\x20before\x20shipping)','storefront_mode':'selector\x20for\x20the\x20storefront\x20shape;\x20the\x20declared\x20default\x20is\x20the\x20DROPPED\x20side\x20of\x20the\x20gated\x20variant\x20—\x20'+'a\x20caller\x20who\x20never\x20answers\x20the\x20wizard\x20question\x20gets\x20the\x20public\x20shape\x20(no\x20buy\x20gate)','deposit_exit_policy':'selector\x20for\x20what\x20happens\x20to\x20the\x20deposit\x20on\x20exit:\x20the\x20benchmark\x20default\x20is\x20\x22kill_fee\x22\x20and\x20it\x20'+'REMAINS\x20user-overridable\x20at\x20build\x20time\x20(a\x20MUST-ASK\x20input)\x20—\x20a\x20buyer-friendly\x20store\x20passes\x20'+'\x22refund\x22;\x20a\x20full\x20forfeit\x20(10000/0)\x20is\x20expressible\x20but\x20never\x20shipped\x20by\x20default','restock_on_refund':'declares\x20the\x20refund→replenish\x20policy:\x20whether/when\x20the\x20keeper\x20may\x20trigger\x20the\x20refund-driven\x20'+'restock.\x20The\x20chain\x20does\x20NOT\x20state-gate\x20restock\x20—\x20this\x20declaration\x20is\x20the\x20build-time\x20record','cancellation_policy':'string\x20enum\x20read\x20by\x20the\x20conditional_guards\x20family;\x20\x221\x22\x20=\x20flexible\x20(full\x20refund\x20until\x2024h\x20before\x20'+'check-in)\x20is\x20the\x20benchmark\x20default\x20the\x20wizard\x20ships\x20when\x20the\x20host\x20never\x20answers','errand_line':'selector\x20for\x20the\x20errand\x20evidence\x20line:\x20\x22carry\x22\x20(custody\x20evidence)\x20is\x20the\x20strongest\x20and\x20most\x20'+'common\x20line;\x20override\x20per\x20build\x20via\x20inputs.errand_line','point_type':'selector\x20for\x20the\x20community\x20point\x20shape:\x20\x22shelve_by_point\x22\x20(staffed\x20shelf)\x20is\x20the\x20benchmark\x20'+'community\x20design;\x20override\x20per\x20build\x20via\x20inputs.point_type','unclaimed_exit':'the\x20never-collected\x20terminal:\x20DEFAULT\x20\x22refund_buyer\x22\x20—\x20the\x20principal\x20returns\x20to\x20the\x20buyer;\x20'+'\x22settle_merchant\x22\x20is\x20the\x20explicit\x20opt-in\x20and\x20hard-carries\x20the\x20unclaimed_late_appeal\x20keeper\x20leg','arb_payout_pairing':'pairs\x20the\x20dispute\x20remedy\x20with\x20the\x20payout\x20rail:\x20default\x20\x22either\x22;\x20\x22stacked\x22\x20(refund\x20+\x20compensation)\x20'+'is\x20declared\x20but\x20its\x20money\x20rail\x20is\x20pending\x20protocol\x20approval\x20—\x20selecting\x20it\x20still\x20settles\x20under\x20'+'\x22either\x22,\x20with\x20the\x20intent\x20disclosed\x20on\x20the\x20quote/plan\x20faces','deposit_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20per-unit\x20DEPOSIT\x20captured\x20at\x20buy\x20(injected\x20at\x20build\x20time)','full_price':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20TOTAL\x20order\x20price,\x20declared\x20separately\x20from\x20the\x20deposit','balance_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20BALANCE\x20captured\x20at\x20the\x20balance_due→balance_paid\x20step','min_balance':'template\x20directive\x20\x22${full_price}\x22\x20—\x20lands\x20the\x20real\x20number\x20with\x20the\x20input;\x20with\x20NO\x20input\x20the\x20'+'directive\x20string\x20reaches\x20the\x20kernel\x20and\x20is\x20rejected\x20at\x20deploy\x20(fail-loud\x20—\x20never\x20a\x20silently\x20'+'open\x20fund\x20gate)','min_monthly_rent_usd':'DESPITE\x20the\x20_usd\x20suffix\x20this\x20is\x20a\x20directive\x20string,\x20NOT\x20a\x20USD\x20figure\x20—\x20a\x20hard\x20invariant:\x20the\x20'+'order\x20price\x20must\x20be\x20exactly\x20lease_months\x20×\x20monthly_rent_amount\x20+\x20deposit_amount\x20so\x20every\x20pinned\x20'+'Amount\x20leg\x20is\x20covered\x20by\x20construction','min_term_price_usd':'DESPITE\x20the\x20_usd\x20suffix\x20this\x20is\x20a\x20directive\x20string,\x20NOT\x20a\x20USD\x20figure\x20—\x20a\x20hard\x20invariant:\x20the\x20'+'price\x20must\x20cover\x20the\x20per-term\x20Amount\x20leg\x20(a\x20hard\x20subtraction\x20with\x20no\x20on-chain\x20floor)','min_booking_amount':'a\x20hard\x20invariant,\x20NOT\x20a\x20benchmark\x20value:\x20must\x20exceed\x20the\x20sum\x20of\x20the\x20per-segment\x20fixed\x20Amounts\x20—\x20'+'the\x20layer-2\x20per-segment\x20legs\x20must\x20fit\x20inside\x20the\x20escrowed\x20order\x20total','allocator_threshold':'the\x20POOL-GLOBAL\x20payout\x20threshold,\x20MUST\x20be\x20<=\x20deposit_amount\x20(the\x20minimum\x20payout\x20unit):\x20it\x20gates\x20'+'EVERY\x20alloc,\x20so\x20a\x20threshold\x20above\x20the\x20deposit\x20would\x20block\x20the\x20deposit-exit\x20refund\x20(stranding)','min_order_price':'RAW\x20smallest\x20units\x20(~a\x20floor\x20above\x20any\x20fixed\x20leg)\x20—\x20the\x20floor\x20sits\x20STRICTLY\x20ABOVE\x20any\x20fixed\x20'+'Amount\x20leg\x20a\x20builder\x20adds:\x20a\x20sub-fee\x20order\x20can\x20neither\x20settle\x20nor\x20refund\x20(alloc\x20asserts\x20'+'balance\x20>=\x20fix)','min_term_price':'hard\x20floor,\x20NOT\x20a\x20benchmark:\x20the\x20per-session\x20Amount\x20leg\x20fires\x20session_count\x20times,\x20so\x20the\x20pool\x20'+'must\x20cover\x20session_count\x20×\x20per_session_release\x20(shipped\x20pricing\x20has\x20zero\x20headroom)','membership_price':'RAW\x20base\x20units\x20(9-decimal)\x20—\x20the\x20membership\x20gate\x20amount;\x20a\x20template\x20knob\x20so\x20a\x20zero-input\x20catalog\x20'+'build\x20carries\x20a\x20REAL\x20amount\x20(override\x20per\x20build\x20via\x20the\x20membership_price\x20input)','session_count':'count\x20—\x20the\x20number\x20of\x20sessions;\x20the\x20per-session\x20Amount\x20leg\x20fires\x20this\x20many\x20times','per_session_release':'RAW\x20smallest\x20units\x20—\x20the\x20amount\x20released\x20per\x20session;\x20the\x20pool\x20must\x20cover\x20'+'session_count\x20×\x20per_session_release','term_price':'RAW\x20smallest\x20units\x20—\x20the\x20per-term\x20price\x20benchmark\x20(pinned\x20per-term\x20Amount\x20legs)','monthly_rent_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20monthly\x20rent;\x20the\x20order\x20price\x20locks\x20to\x20lease_months\x20×\x20this\x20+\x20'+'deposit_amount','damage_max_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20damage-charge\x20cap\x20of\x20the\x20lease','early_exit_penalty_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20early-termination\x20penalty\x20(benchmark:\x20one\x20month\x27s\x20rent)','max_discount_bps':'basis\x20points\x20—\x20the\x20maximum\x20discount\x20ceiling:\x20(min_term_price\x20−\x20session_count\x20×\x20per_session_release)\x20'+'/\x20min_term_price\x20×\x2010000;\x20above\x20it\x20a\x20mid-sequence\x20release\x20is\x20a\x20proven\x20EINSUFFICIENT_BALANCE\x20abort','digital_product_fee_bps':'basis\x20points\x20of\x20the\x20sale\x20—\x20the\x20digital-product\x20fee\x20share\x20(benchmark\x205%\x20=\x20500,\x20bounded\x20by\x20the\x20'+'min/max\x20tier\x20knobs;\x20natively\x20expressible)','contract_fee_small_usd':'USD\x20—\x20the\x20small-tier\x20contract\x20fee\x20(settle-tier\x20gate\x20pairing)','contract_fee_large_usd':'USD\x20—\x20the\x20large-tier\x20contract\x20fee;\x20the\x20tier\x20boundary\x20is\x20its\x20own\x20knob','contract_fee_tier_boundary_usd':'USD\x20—\x20orders\x20at/above\x20this\x20boundary\x20use\x20the\x20large-tier\x20fee','kill_fee_bps':'basis\x20points\x20of\x20the\x20at-stake\x20amount\x20kept\x20as\x20the\x20kill\x20fee\x20on\x20early\x20exit\x20(benchmark\x2030%;\x20a\x20full\x20'+'forfeit\x20is\x20expressible\x20but\x20never\x20shipped\x20by\x20default\x20—\x20forfeits\x20above\x20the\x20benchmark\x20are\x20'+'negotiated\x20via\x20the\x20quote\x20flow,\x20never\x20silently\x20executed)','kill_fee_buyer_bps':'basis\x20points\x20of\x20the\x20at-stake\x20amount\x20returned\x20to\x20the\x20buyer\x20on\x20exit\x20(complement\x20of\x20kill_fee_bps;\x20'+'the\x20pair\x20must\x20sum\x2010000)','arb_indemnity_floor_bps':'basis\x20points\x20—\x20the\x20ADVISORY\x20indemnity\x20floor\x20disclosed\x20at\x20build;\x20the\x20chain\x20pays\x20what\x20the\x20'+'arbitrator\x20ruled,\x20the\x20leg\x20only\x20re-gates\x20the\x20refund\x20edge','platform_rate_cap_bps':'basis\x20points\x20—\x20the\x20MCP-side\x20ADVISORY\x20ceiling\x20for\x20settlement\x20Rate\x20legs\x20a\x20builder\x20adds\x20(cap\x20'+'jurisdictions;\x20benchmark\x201500:\x20delivery-related\x20fees\x20<=\x2015%)','incumbent_take_bps':'basis\x20points\x20—\x20the\x20INCUMBENT\x20marketplace\x27s\x20take,\x20benchmark\x20DISCLOSURE\x20ONLY;\x20no\x20allocator\x20row\x20'+'reads\x20it\x20(this\x20template\x27s\x20own\x20take\x20is\x20its\x20platform\x20knobs)','courier_tip_bps':'basis\x20points\x20—\x20the\x20optional\x20courier\x20tip\x20leg\x20(expressible\x20on\x20the\x20payout\x20path);\x20domestic\x20default\x200,\x20'+'overseas\x20benchmark\x201500-2000\x20(15-20%)','host_rate_bps':'basis\x20points\x20—\x20the\x20host\x27s\x20share\x20of\x20the\x20booking\x20(complement\x20is\x20the\x20platform\x20rate;\x2010000\x20=\x20host\x20'+'keeps\x20everything)','institution_share_bps':'basis\x20points\x20—\x20the\x20institution\x20vs\x20platform\x20split\x20of\x20tuition\x20(the\x20pair\x20must\x20sum\x2010000)','creator_settlement_retain_bps':'basis\x20points\x20—\x20the\x20share\x20the\x20platform\x20RETAINS\x20from\x20creator\x20settlement;\x200\x20=\x20full\x20payout\x20to\x20the\x20creator','producer_bps':'basis\x20points\x20—\x20the\x20producer\x20vs\x20publisher\x20split\x20(the\x20pair\x20must\x20sum\x2010000;\x20a\x20sole\x20producer\x20sets\x2010000/0)','publisher_bps':'basis\x20points\x20—\x20the\x20publisher\x20side\x20of\x20the\x20producer/publisher\x20split\x20(the\x20pair\x20must\x20sum\x2010000)','primary_holder_bps':'basis\x20points\x20—\x20the\x20primary\x20holder\x27s\x20share\x20of\x20the\x20payout\x20(the\x20holder\x20pair\x20must\x20sum\x2010000)','co_holder_bps':'basis\x20points\x20—\x20the\x20co-holder\x27s\x20share\x20of\x20the\x20payout\x20(the\x20holder\x20pair\x20must\x20sum\x2010000)','partner_share_bps':'basis\x20points\x20—\x20the\x20partner\x27s\x20share\x20(the\x20complement\x20stays\x20with\x20the\x20house)','bounty_high_hunter_bps':'basis\x20points\x20of\x20the\x20bounty\x20pool\x20paid\x20for\x20the\x20top\x20severity\x20tier;\x20the\x20tiers\x20partition\x20the\x20pool\x20—\x20'+'a\x20partial\x20top\x20tier\x20would\x20need\x20a\x20remainder\x20leg\x20the\x20shipped\x20rows\x20do\x20not\x20declare','bounty_medium_hunter_bps':'basis\x20points\x20of\x20the\x20bounty\x20pool\x20paid\x20for\x20the\x20medium\x20severity\x20tier','bounty_low_hunter_bps':'basis\x20points\x20of\x20the\x20bounty\x20pool\x20paid\x20for\x20the\x20low\x20severity\x20tier','production_lead_days':'days\x20—\x20the\x20production\x20lead\x20time\x20before\x20the\x20ship\x20deadline','balance_window_days':'days\x20—\x20the\x20balance-due\x20payment\x20window\x20after\x20the\x20deposit\x20(deposit_balance\x20plans)','restock_confirm_days':'days\x20—\x20the\x20keeper\x27s\x20restock\x20confirmation\x20window\x20after\x20a\x20refund','escrow_release_days':'days\x20—\x20the\x20escrow\x20release\x20window:\x20settlement\x20fires\x20this\x20many\x20days\x20after\x20the\x20template\x27s\x20acceptance\x20anchor','dispute_timeout_days':'days\x20—\x20the\x20dispute-response\x20timeout\x20window','instant_cancel_hours':'hours\x20from\x20order\x20entry\x20—\x20the\x20instant-cancel\x20window\x20(full\x20refund);\x20after\x20it,\x20a\x20mid-work\x20exit\x20'+'rides\x20the\x20response_timeout\x20keeper\x20path','requirements_timeout_hours':'hours\x20—\x20the\x20buyer-requirements\x20submission\x20timeout','response_timeout_hours':'hours\x20—\x20the\x20keeper\x20resolves\x20the\x20request\x20in\x20the\x20buyer\x27s\x20favour\x20once\x20it\x20lapses:\x20the\x20buyer\x27s\x20'+'worst-case\x20wait\x20for\x20a\x20mid-work\x20exit\x20after\x20the\x20instant-cancel\x20window','defect_report_window_hours':'hours\x20from\x20the\x20LAST\x20delivery\x20entry\x20—\x20revising\x20entry\x20is\x20allowed\x20only\x20within\x20this\x20window;\x20a\x20'+'re-delivery\x20appends\x20a\x20fresh\x20entry\x20and\x20resets\x20it','acceptance_timeout_hours':'hours\x20—\x20the\x20acceptance\x20timeout\x20on\x20delivered\x20work','evaluation_window_days':'days\x20—\x20the\x20keeper\x20releases\x20escrow\x20to\x20the\x20provider\x20on\x20lapse\x20(agent-native\x20tasks\x20are\x20short-horizon,\x20'+'so\x20tighter\x20than\x20a\x20human\x20freelance\x20contract\x27s\x2014\x20days)','triage_window_days':'days\x20—\x20the\x20window\x20in\x20which\x20the\x20hunter\x20may\x20escalate\x20to\x20arbitration\x20(benchmarked\x20to\x20the\x20~5-workday\x20'+'mediation\x20incumbent;\x20a\x20keeper/dispute\x20anchor,\x20NOT\x20an\x20auto-pay\x20timer)','submission_window_days':'days\x20—\x20how\x20long\x20entries\x20are\x20accepted\x20before\x20the\x20judge\x20closes\x20submissions\x20(the\x20gate\x20on\x20'+'funded→judging)','appeal_window_days':'days\x20—\x20how\x20long\x20a\x20losing\x20entrant\x20may\x20contest\x20the\x20provisional\x20placement\x20(the\x20gate\x20on\x20'+'placement_provisional→placement_final)','delivery_window_days':'days\x20—\x20the\x20auto-accept\x20window\x20on\x20delivered\x20work:\x20silence\x20past\x20this\x20window\x20takes\x20the\x20designed\x20'+'default\x20path,\x20so\x20a\x20guaranteed\x20release\x20can\x20never\x20be\x20withheld\x20by\x20receiver\x20silence','stay_nights':'count\x20—\x20the\x20stay\x20length;\x20the\x20leg\x20measures\x20order\x20time\x20+\x20stay_nights\x20days\x20(the\x20booking-time\x20'+'approximation\x20of\x20the\x20missing\x20on-chain\x20departure\x20date)','segment_count':'count\x20—\x20the\x20number\x20of\x20itinerary\x20segments;\x20the\x20per-segment\x20fixed\x20Amount\x20legs\x20multiply\x20by\x20this','revision_rounds_max':'count\x20—\x20the\x20revision\x20rounds\x20included\x20before\x20extra\x20charges\x20(the\x20revision\x20loop\x20bound)','return_notice_days':'days\x20—\x20the\x20return\x20notice\x20window;\x20the\x20wizard\x20computes\x20the\x20window\x20from\x20this\x20knob\x20so\x20the\x20purpose\x20'+'prose\x20cannot\x20drift\x20(mainnet\x20lesson)','no_fault_exit_days':'days\x20—\x20the\x20no-fault\x20exit\x20notice\x20window','lease_months':'months\x20—\x20the\x20lease\x20term\x20length;\x20the\x20order\x20price\x20locks\x20to\x20lease_months\x20×\x20monthly_rent_amount\x20+\x20'+'deposit_amount','monthly_allocators':'count\x20—\x20the\x20monthly\x20payout\x20rows\x20of\x20the\x20lease\x20(12\x20=\x20one\x20per\x20lease\x20month)','early_exit_penalty_months':'months\x20of\x20rent\x20owed\x20as\x20the\x20early-exit\x20penalty','term_count':'count\x20—\x20the\x20number\x20of\x20tuition\x20terms\x20(the\x20pinned\x20per-term\x20Amount\x20legs\x20multiply)','period_days':'days\x20—\x20the\x20subscription\x20period\x20length:\x20the\x20expire\x20leg\x20measures\x20delivered\x20entry\x20+\x20period_days\x20+\x20grace_days','grace_days':'days\x20—\x20the\x20grace\x20period\x20added\x20after\x20period_days\x20before\x20the\x20expire\x20leg\x20fires','renewal_reminder_days':'days\x20before\x20period\x20end\x20—\x20the\x20renewal\x20reminder\x20anchor\x20(keeper\x20duty)','month_release_day':'day\x20of\x20month\x20(1-31)\x20—\x20the\x20monthly\x20release\x20anchor\x20for\x20the\x20subscription\x20payout','refund_window_days':'days\x20—\x20the\x20refund\x20window\x20on\x20the\x20course\x20purchase','confirm_window_hours':'hours\x20—\x20the\x20booking\x20confirmation\x20window','inspection_deadline_hours':'hours\x20—\x20the\x20move-in\x20inspection\x20deadline','objection_window_hours':'hours\x20—\x20the\x20objection\x20window\x20on\x20the\x20lease\x20outcome','inspection_window_days':'days\x20—\x20the\x20inspection\x20window\x20on\x20delivered\x20goods','confirm_timeout_hours':'hours\x20—\x20the\x20confirmation\x20timeout\x20before\x20the\x20designed\x20default\x20path\x20takes\x20over','campaign_duration_days':'days\x20—\x20the\x20campaign\x20duration\x20benchmark;\x20the\x20shared\x20cutoff\x20itself\x20is\x20campaign_deadline_ms\x20(absolute)','reward_claim_opens_after_days':'days\x20after\x20the\x20relevant\x20entry\x20—\x20an\x20explicit\x20bounty-opens\x20pin:\x20keeps\x20the\x20reward\x20claimable\x20from\x20day\x20'+'14\x20despite\x20a\x20longer\x20review\x20window\x20feeding\x20the\x20after-sales\x20derivation','auto_confirm_hours':'hours\x20after\x20shipment\x20—\x20the\x20perishable-goods\x20variant\x20of\x20buyer-silence\x20auto-confirm\x20(the\x20hours\x20'+'domain:\x20a\x2014-day\x20retail\x20window\x20on\x20a\x20meal\x20is\x20absurd)','claim_window_hours':'hours\x20—\x20the\x20dispute-filing\x20window\x20(hours\x20domain)','settle_hours':'hours\x20—\x20the\x20settlement\x20release\x20delay\x20(hours\x20domain)','pickup_window_hours':'hours\x20—\x20the\x20pickup\x20collection\x20window\x20at\x20the\x20point'};export function knobDocLines(a){const b=KNOB_DOCS[a]??KNOB_UNIT_HINTS['find'](c=>a['endsWith'](c['suffix']))?.['doc'];return b?['#\x20'+b]:[];}
|
|
1
|
+
export const KNOB_UNIT_HINTS=[{'suffix':'_bps','doc':'basis\x20points\x20(1/10000\x20=\x200.01%)\x20of\x20the\x20amount\x20the\x20rate\x20applies\x20to'},{'suffix':'_days','doc':'days\x20—\x20relative\x20window/duration\x20measured\x20from\x20this\x20template\x27s\x20anchor\x20(see\x20the\x20notes\x20below)'},{'suffix':'_hours','doc':'hours\x20—\x20relative\x20window/duration'},{'suffix':'_months','doc':'months'},{'suffix':'_ms','doc':'milliseconds\x20—\x20quantity\x20is\x20NOT\x20implied\x20by\x20the\x20suffix:\x20the\x20*_ms\x20twin\x20of\x20a\x20*_days/*_hours\x20window\x20is\x20a\x20DURATION\x20(a\x20length,\x20e.g.\x20duration_ms),\x20while\x20a\x20named-instant\x20key\x20(campaign_deadline_ms,\x20service_start_ms)\x20is\x20an\x20ABSOLUTE\x20epoch\x20instant\x20(ms\x20since\x201970\x20UTC).\x20The\x20per-key\x20line\x20above\x20states\x20the\x20truth;\x20if\x20no\x20per-key\x20line\x20exists,\x20check\x20the\x20template\x27s\x20own\x20notes\x20before\x20answering'},{'suffix':'_usd','doc':'USD\x20figure\x20—\x20off-chain\x20reference/benchmark'}];export const TIME_QUANTITY={'campaign_deadline_ms':'instant','service_start_ms':'instant','duration_ms':'duration','min_claim_interval_ms':'duration'};const DURATION_STEM_LAW=/(^|_)(duration|interval|window|timeout|delay|ttl|span)$/;export function timeQuantityOf(a){const b=TIME_QUANTITY[a];if(b!==undefined)return b;if(!/_ms$/['test'](a))return undefined;const c=a['slice'](0x0,-'_ms'['length']);if(DURATION_STEM_LAW['test'](c))return'duration';return undefined;}export function timeQuantityViolations(a){const b=[],c=new Set();for(const d of a){if(d===undefined||typeof d!=='object')continue;for(const [e,f]of Object['entries'](d)){const g=timeQuantityOf(e);if(g===undefined)continue;const h=typeof f==='number'?f:typeof f==='string'&&/^\d+(?:\.\d+)?$/['test'](f['trim']())?Number(f):NaN;if(!Number['isFinite'](h)||h<=0x0)continue;if(c['has'](e))continue;const i=g==='instant'?h<0xe8d4a51000:h>=0xe8d4a51000;if(!i)continue;c['add'](e),b['push']({'key':e,'value':h,'quantity':g,'remedy':g==='instant'?'an\x20ABSOLUTE\x20instant\x20knob\x20must\x20read\x20epoch\x20ms\x20since\x201970\x20UTC\x20(dates\x20after\x202001-09\x20exceed\x201e12)\x20—\x20this\x20value\x20looks\x20like\x20a\x20duration/relative\x20offset;\x20answer\x20the\x20epoch\x20instant\x20(or\x200\x20=\x20UNSET)':'a\x20DURATION\x20knob\x20must\x20read\x20a\x20LENGTH\x20in\x20ms\x20—\x20this\x20value\x20looks\x20like\x20an\x20epoch\x20instant\x20(>=\x201e12\x20ms\x20≈\x2031\x20years);\x20answer\x20the\x20length\x20(e.g.\x20600000\x20=\x2010\x20minutes)'});}}return b;}export function knobTimeDoc(a){const b=timeQuantityOf(a);if(b!==undefined)return b==='instant'?'ABSOLUTE\x20epoch\x20milliseconds\x20(ms\x20since\x201970\x20UTC),\x20NOT\x20a\x20duration\x20—\x20override\x20per\x20build\x20(0\x20=\x20UNSET\x20where\x20allowed)':'a\x20DURATION\x20(a\x20length\x20in\x20milliseconds\x20—\x20e.g.\x20600000\x20=\x2010\x20minutes),\x20NOT\x20an\x20absolute\x20epoch\x20instant';if(/_ms$/['test'](a))return'AMBIGUOUS\x20SUFFIX:\x20milliseconds\x20can\x20be\x20an\x20absolute\x20instant\x20OR\x20a\x20duration\x20—\x20this\x20key\x27s\x20quantity\x20is\x20not\x20declared;\x20check\x20the\x20template\x27s\x20own\x20notes\x20before\x20answering';return undefined;}const MERGED_LOCK_DOC='days\x20—\x20relative\x20window;\x20if\x20listed\x20in\x20this\x20template\x27s\x20settlement_window_merge,\x20it\x20folds\x20into\x20the\x20ONE\x20'+'settlement\x20time-lock\x20(the\x20compiled\x20release\x20instant\x20is\x20the\x20SUM\x20of\x20the\x20merged\x20windows\x20—\x20compile\x20refuses\x20'+'a\x20disagreeing\x20literal)',KNOB_DOCS={'review_reward_pool':'RAW\x20on-chain\x20smallest\x20units\x20(u64),\x20NOT\x20human\x20units\x20—\x20e.g.\x20a\x200.5\x20WOW\x20pool\x20is\x20500000000.\x20Pool\x20plan\x20'+'benchmark\x20(expected\x20claims\x20x\x20review_reward_per_claim);\x20funded\x20at\x20build\x20time\x20via\x20the\x20reward_funding\x20input','review_reward_per_claim':'RAW\x20on-chain\x20smallest\x20units\x20per\x20claim\x20—\x20the\x20pool\x20plan\x20=\x20expected\x20claims\x20x\x20this\x20value\x20'+'(e.g.\x200.02\x20WOW\x20=\x2020\x20claims\x20at\x200.001\x20WOW/claim)','courier_fee':'RAW\x20on-chain\x20smallest\x20units\x20per\x20order\x20(e.g.\x205\x20WOW\x20=\x20500000000)\x20—\x20a\x20disclosure-only\x20pricing\x20input\x20on\x20'+'this\x20template\x20(TPL-04)','min_sku_price':'floor-price\x20constraint\x20—\x20the\x20fixed\x20fulfillment\x20fee\x20must\x20stay\x20BELOW\x20the\x20cheapest\x20listed\x20SKU:\x20a\x20'+'sub-fee\x20order\x20deadlocks\x20(EINSUFFICIENT_BALANCE:\x20balance\x20>=\x20fix)','commission_rate_bps':'basis\x20points\x20of\x20the\x20order\x20total\x20(10000\x20=\x20100%);\x20whether\x20a\x20settlement\x20row\x20actually\x20reads\x20it\x20is\x20'+'template-specific\x20—\x20see\x20the\x20User\x20inputs\x20notes\x20below','platform_commission_bps':'basis\x20points\x20of\x20the\x20order\x20total\x20(10000\x20=\x20100%);\x20whether\x20a\x20platform\x20settlement\x20row\x20actually\x20reads\x20it\x20'+'is\x20template-specific\x20—\x20see\x20the\x20User\x20inputs\x20notes\x20below','merchant_service_fee_bps':'basis\x20points\x20of\x20the\x20order\x20total\x20(10000\x20=\x20100%)\x20—\x20the\x20merchant\x27s\x20own\x20fee;\x20its\x20recipient\x20Entity\x20must\x20'+'be\x20explicit\x20and\x20non-empty\x20(an\x20empty\x20Entity\x20recipient\x20burns\x20the\x20share\x20permanently)','settlement_days':MERGED_LOCK_DOC,'reserve_days':MERGED_LOCK_DOC,'return_window_days':MERGED_LOCK_DOC,'claim_window_days':'days\x20—\x20the\x20dispute-FILING\x20window:\x20filing\x20closes\x20at\x20window\x20entry\x20+\x20this\x20value;\x20the\x20merged\x20settlement\x20'+'duration\x20must\x20stay\x20>=\x20this\x20value\x20so\x20filing\x20always\x20shuts\x20before\x20the\x20release\x20opens','dispute_window_days':'days\x20—\x20post-settlement\x20arbitration\x20claim\x20window','auto_confirm_days':'days\x20after\x20shipment\x20—\x20buyer\x20silence\x20auto-confirms\x20delivery\x20(keeper\x20AutoConfirmDelivery);\x20a\x20silent\x20'+'buyer\x20can\x20never\x20strand\x20the\x20escrow','review_window_days':'days\x20after\x20delivery\x20—\x20reviews\x20are\x20accepted\x20only\x20WITHIN\x20this\x20window','reward_claim_closes_after_days':'days\x20after\x20the\x20review\x20node\x20entry\x20—\x20the\x20reward\x20claim\x20window\x20closes\x20then\x20(the\x20window\x20is\x20'+'opens_after_days\x20+\x20closes_after_days\x20where\x20both\x20are\x20declared)','experience_claim_closes_after_days':'days\x20after\x20the\x20claim-allowed\x20entry\x20—\x20the\x20experience-compensation\x20claim\x20window\x20closes\x20then\x20(K3\x20C-11:\x20'+'default\x207;\x20the\x20window\x20opens\x20after\x20the\x20after-sales\x20return\x20window\x20lapses\x20so\x20a\x20refunded\x20order\x20cannot\x20claim)','processing_time_days':'days\x20from\x20order\x20entry\x20—\x20the\x20ship\x20deadline;\x20lapsing\x20unshipped\x20=\x20keeper\x20force-cancel\x20with\x20a\x20full\x20'+'buyer\x20refund\x20(permission\x201002)','settlement_delay_days':'days\x20after\x20delivery\x20confirmation\x20—\x20the\x20fast\x20settlement\x20release\x20delay\x20(the\x200-3\x20day\x20lever\x20vs\x20the\x20'+'marketplace-length\x20cycle)','free_cancel_hours':'hours\x20from\x20order\x20entry\x20—\x20free\x20cancellation\x20closes\x20after\x20this\x20(benchmark:\x20processing_time_days\x20x\x2024,\x20'+'the\x20same\x20ship\x20deadline)','campaign_deadline_ms':'ABSOLUTE\x20epoch\x20milliseconds\x20(ms\x20since\x201970\x20UTC),\x20NOT\x20a\x20duration\x20—\x20ONE\x20shared\x20deadline\x20for\x20every\x20'+'order\x20of\x20the\x20round;\x20ALWAYS\x20override\x20per\x20build\x20(0\x20=\x20UNSET\x20where\x20allowed);\x20bind\x20'+'pattern.time_source_repository_oracle\x20for\x20a\x20real-world\x20calendar\x20date','service_start_ms':'ABSOLUTE\x20epoch\x20milliseconds\x20(ms\x20since\x201970\x20UTC),\x20NOT\x20a\x20duration\x20—\x20override\x20per\x20build','required_info_enforcement':'selector:\x20\x22off\x22\x20keeps\x20the\x20tracking-only\x20ship\x20gate;\x20\x22on\x22\x20mounts\x20the\x20composite\x20ship_enforced\x20'+'design\x20(required\x20buyer\x20info\x20demanded\x20before\x20shipping)','storefront_mode':'selector\x20for\x20the\x20storefront\x20shape;\x20the\x20declared\x20default\x20is\x20the\x20DROPPED\x20side\x20of\x20the\x20gated\x20variant\x20—\x20'+'a\x20caller\x20who\x20never\x20answers\x20the\x20wizard\x20question\x20gets\x20the\x20public\x20shape\x20(no\x20buy\x20gate)','deposit_exit_policy':'selector\x20for\x20what\x20happens\x20to\x20the\x20deposit\x20on\x20exit:\x20the\x20benchmark\x20default\x20is\x20\x22kill_fee\x22\x20and\x20it\x20'+'REMAINS\x20user-overridable\x20at\x20build\x20time\x20(a\x20MUST-ASK\x20input)\x20—\x20a\x20buyer-friendly\x20store\x20passes\x20'+'\x22refund\x22;\x20a\x20full\x20forfeit\x20(10000/0)\x20is\x20expressible\x20but\x20never\x20shipped\x20by\x20default','restock_on_refund':'declares\x20the\x20refund→replenish\x20policy:\x20whether/when\x20the\x20keeper\x20may\x20trigger\x20the\x20refund-driven\x20'+'restock.\x20The\x20chain\x20does\x20NOT\x20state-gate\x20restock\x20—\x20this\x20declaration\x20is\x20the\x20build-time\x20record','cancellation_policy':'string\x20enum\x20read\x20by\x20the\x20conditional_guards\x20family;\x20\x221\x22\x20=\x20flexible\x20(full\x20refund\x20until\x2024h\x20before\x20'+'check-in)\x20is\x20the\x20benchmark\x20default\x20the\x20wizard\x20ships\x20when\x20the\x20host\x20never\x20answers','errand_line':'selector\x20for\x20the\x20errand\x20evidence\x20line:\x20\x22carry\x22\x20(custody\x20evidence)\x20is\x20the\x20strongest\x20and\x20most\x20'+'common\x20line;\x20override\x20per\x20build\x20via\x20inputs.errand_line','point_type':'selector\x20for\x20the\x20community\x20point\x20shape:\x20\x22shelve_by_point\x22\x20(staffed\x20shelf)\x20is\x20the\x20benchmark\x20'+'community\x20design;\x20override\x20per\x20build\x20via\x20inputs.point_type','unclaimed_exit':'the\x20never-collected\x20terminal:\x20DEFAULT\x20\x22refund_buyer\x22\x20—\x20the\x20principal\x20returns\x20to\x20the\x20buyer;\x20'+'\x22settle_merchant\x22\x20is\x20the\x20explicit\x20opt-in\x20and\x20hard-carries\x20the\x20unclaimed_late_appeal\x20keeper\x20leg','arb_payout_pairing':'pairs\x20the\x20dispute\x20remedy\x20with\x20the\x20payout\x20rail:\x20default\x20\x22either\x22;\x20\x22stacked\x22\x20(refund\x20+\x20compensation)\x20'+'is\x20declared\x20but\x20its\x20money\x20rail\x20is\x20pending\x20protocol\x20approval\x20—\x20selecting\x20it\x20still\x20settles\x20under\x20'+'\x22either\x22,\x20with\x20the\x20intent\x20disclosed\x20on\x20the\x20quote/plan\x20faces','deposit_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20per-unit\x20DEPOSIT\x20captured\x20at\x20buy\x20(injected\x20at\x20build\x20time)','full_price':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20TOTAL\x20order\x20price,\x20declared\x20separately\x20from\x20the\x20deposit','balance_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20BALANCE\x20captured\x20at\x20the\x20balance_due→balance_paid\x20step','min_balance':'template\x20directive\x20\x22${full_price}\x22\x20—\x20lands\x20the\x20real\x20number\x20with\x20the\x20input;\x20with\x20NO\x20input\x20the\x20'+'directive\x20string\x20reaches\x20the\x20kernel\x20and\x20is\x20rejected\x20at\x20deploy\x20(fail-loud\x20—\x20never\x20a\x20silently\x20'+'open\x20fund\x20gate)','min_monthly_rent_usd':'DESPITE\x20the\x20_usd\x20suffix\x20this\x20is\x20a\x20directive\x20string,\x20NOT\x20a\x20USD\x20figure\x20—\x20a\x20hard\x20invariant:\x20the\x20'+'order\x20price\x20must\x20be\x20exactly\x20lease_months\x20×\x20monthly_rent_amount\x20+\x20deposit_amount\x20so\x20every\x20pinned\x20'+'Amount\x20leg\x20is\x20covered\x20by\x20construction','min_term_price_usd':'DESPITE\x20the\x20_usd\x20suffix\x20this\x20is\x20a\x20directive\x20string,\x20NOT\x20a\x20USD\x20figure\x20—\x20a\x20hard\x20invariant:\x20the\x20'+'price\x20must\x20cover\x20the\x20per-term\x20Amount\x20leg\x20(a\x20hard\x20subtraction\x20with\x20no\x20on-chain\x20floor)','min_booking_amount':'a\x20hard\x20invariant,\x20NOT\x20a\x20benchmark\x20value:\x20must\x20exceed\x20the\x20sum\x20of\x20the\x20per-segment\x20fixed\x20Amounts\x20—\x20'+'the\x20layer-2\x20per-segment\x20legs\x20must\x20fit\x20inside\x20the\x20escrowed\x20order\x20total','allocator_threshold':'the\x20POOL-GLOBAL\x20payout\x20threshold,\x20MUST\x20be\x20<=\x20deposit_amount\x20(the\x20minimum\x20payout\x20unit):\x20it\x20gates\x20'+'EVERY\x20alloc,\x20so\x20a\x20threshold\x20above\x20the\x20deposit\x20would\x20block\x20the\x20deposit-exit\x20refund\x20(stranding)','min_order_price':'RAW\x20smallest\x20units\x20(~a\x20floor\x20above\x20any\x20fixed\x20leg)\x20—\x20the\x20floor\x20sits\x20STRICTLY\x20ABOVE\x20any\x20fixed\x20'+'Amount\x20leg\x20a\x20builder\x20adds:\x20a\x20sub-fee\x20order\x20can\x20neither\x20settle\x20nor\x20refund\x20(alloc\x20asserts\x20'+'balance\x20>=\x20fix)','min_term_price':'hard\x20floor,\x20NOT\x20a\x20benchmark:\x20the\x20per-session\x20Amount\x20leg\x20fires\x20session_count\x20times,\x20so\x20the\x20pool\x20'+'must\x20cover\x20session_count\x20×\x20per_session_release\x20(shipped\x20pricing\x20has\x20zero\x20headroom)','membership_price':'RAW\x20base\x20units\x20(9-decimal)\x20—\x20the\x20membership\x20gate\x20amount;\x20a\x20template\x20knob\x20so\x20a\x20zero-input\x20catalog\x20'+'build\x20carries\x20a\x20REAL\x20amount\x20(override\x20per\x20build\x20via\x20the\x20membership_price\x20input)','session_count':'count\x20—\x20the\x20number\x20of\x20sessions;\x20the\x20per-session\x20Amount\x20leg\x20fires\x20this\x20many\x20times','per_session_release':'RAW\x20smallest\x20units\x20—\x20the\x20amount\x20released\x20per\x20session;\x20the\x20pool\x20must\x20cover\x20'+'session_count\x20×\x20per_session_release','term_price':'RAW\x20smallest\x20units\x20—\x20the\x20per-term\x20price\x20benchmark\x20(pinned\x20per-term\x20Amount\x20legs)','term_price_amount':'RAW\x20smallest\x20units\x20of\x20the\x20plan\x27s\x20payment\x20token\x20(WOW\x209dp,\x20bridged\x20USDT\x206dp\x20—\x20token-agnostic)\x20—\x20'+'the\x20per-term\x20tuition\x20Amount\x20leg.\x20A\x20dust-scale\x20DEFAULT\x20blocks\x20with\x20MONEY_SCALE_ANOMALY\x20until\x20'+'priced\x20explicitly\x20(A8\x20keep-default-gate-downgrade)','monthly_rent_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20monthly\x20rent;\x20the\x20order\x20price\x20locks\x20to\x20lease_months\x20×\x20this\x20+\x20'+'deposit_amount','damage_max_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20damage-charge\x20cap\x20of\x20the\x20lease','early_exit_penalty_amount':'RAW\x20on-chain\x20smallest\x20units\x20—\x20the\x20early-termination\x20penalty\x20(benchmark:\x20one\x20month\x27s\x20rent)','max_discount_bps':'basis\x20points\x20—\x20the\x20maximum\x20discount\x20ceiling:\x20(min_term_price\x20−\x20session_count\x20×\x20per_session_release)\x20'+'/\x20min_term_price\x20×\x2010000;\x20above\x20it\x20a\x20mid-sequence\x20release\x20is\x20a\x20proven\x20EINSUFFICIENT_BALANCE\x20abort','digital_product_fee_bps':'basis\x20points\x20of\x20the\x20sale\x20—\x20the\x20digital-product\x20fee\x20share\x20(benchmark\x205%\x20=\x20500,\x20bounded\x20by\x20the\x20'+'min/max\x20tier\x20knobs;\x20natively\x20expressible)','contract_fee_small_amount':'RAW\x20smallest\x20units\x20of\x20the\x20plan\x27s\x20payment\x20token\x20(WOW\x209dp,\x20bridged\x20USDT\x206dp\x20—\x20token-agnostic)\x20—\x20'+'the\x20small-tier\x20contract\x20fee\x20Amount\x20leg\x20(settle-tier\x20gate\x20pairing).\x20A\x20*_usd-named\x20source\x20on\x20an\x20'+'Amount\x20leg\x20is\x20a\x20compile\x20blocker\x20(AMOUNT_UNIT_CONTRACT);\x20a\x20dust-scale\x20DEFAULT\x20blocks\x20with\x20'+'MONEY_SCALE_ANOMALY\x20until\x20priced\x20explicitly','contract_fee_large_usd':'USD\x20—\x20the\x20large-tier\x20contract\x20fee;\x20the\x20tier\x20boundary\x20is\x20its\x20own\x20knob','contract_fee_tier_boundary_usd':'USD\x20—\x20orders\x20at/above\x20this\x20boundary\x20use\x20the\x20large-tier\x20fee','kill_fee_bps':'basis\x20points\x20of\x20the\x20at-stake\x20amount\x20kept\x20as\x20the\x20kill\x20fee\x20on\x20early\x20exit\x20(benchmark\x2030%;\x20a\x20full\x20'+'forfeit\x20is\x20expressible\x20but\x20never\x20shipped\x20by\x20default\x20—\x20forfeits\x20above\x20the\x20benchmark\x20are\x20'+'negotiated\x20via\x20the\x20quote\x20flow,\x20never\x20silently\x20executed)','kill_fee_buyer_bps':'basis\x20points\x20of\x20the\x20at-stake\x20amount\x20returned\x20to\x20the\x20buyer\x20on\x20exit\x20(complement\x20of\x20kill_fee_bps;\x20'+'the\x20pair\x20must\x20sum\x2010000)','arb_indemnity_floor_bps':'basis\x20points\x20—\x20the\x20ADVISORY\x20indemnity\x20floor\x20disclosed\x20at\x20build;\x20the\x20chain\x20pays\x20what\x20the\x20'+'arbitrator\x20ruled,\x20the\x20leg\x20only\x20re-gates\x20the\x20refund\x20edge','platform_rate_cap_bps':'basis\x20points\x20—\x20the\x20MCP-side\x20ADVISORY\x20ceiling\x20for\x20settlement\x20Rate\x20legs\x20a\x20builder\x20adds\x20(cap\x20'+'jurisdictions;\x20benchmark\x201500:\x20delivery-related\x20fees\x20<=\x2015%)','incumbent_take_bps':'basis\x20points\x20—\x20the\x20INCUMBENT\x20marketplace\x27s\x20take,\x20benchmark\x20DISCLOSURE\x20ONLY;\x20no\x20allocator\x20row\x20'+'reads\x20it\x20(this\x20template\x27s\x20own\x20take\x20is\x20its\x20platform\x20knobs)','courier_tip_bps':'basis\x20points\x20—\x20the\x20optional\x20courier\x20tip\x20leg\x20(expressible\x20on\x20the\x20payout\x20path);\x20domestic\x20default\x200,\x20'+'overseas\x20benchmark\x201500-2000\x20(15-20%)','host_rate_bps':'basis\x20points\x20—\x20the\x20host\x27s\x20share\x20of\x20the\x20booking\x20(complement\x20is\x20the\x20platform\x20rate;\x2010000\x20=\x20host\x20'+'keeps\x20everything)','institution_share_bps':'basis\x20points\x20—\x20the\x20institution\x20vs\x20platform\x20split\x20of\x20tuition\x20(the\x20pair\x20must\x20sum\x2010000)','creator_settlement_retain_bps':'basis\x20points\x20—\x20the\x20share\x20the\x20platform\x20RETAINS\x20from\x20creator\x20settlement;\x200\x20=\x20full\x20payout\x20to\x20the\x20creator','producer_bps':'basis\x20points\x20—\x20the\x20producer\x20vs\x20publisher\x20split\x20(the\x20pair\x20must\x20sum\x2010000;\x20a\x20sole\x20producer\x20sets\x2010000/0)','publisher_bps':'basis\x20points\x20—\x20the\x20publisher\x20side\x20of\x20the\x20producer/publisher\x20split\x20(the\x20pair\x20must\x20sum\x2010000)','primary_holder_bps':'basis\x20points\x20—\x20the\x20primary\x20holder\x27s\x20share\x20of\x20the\x20payout\x20(the\x20holder\x20pair\x20must\x20sum\x2010000)','co_holder_bps':'basis\x20points\x20—\x20the\x20co-holder\x27s\x20share\x20of\x20the\x20payout\x20(the\x20holder\x20pair\x20must\x20sum\x2010000)','partner_share_bps':'basis\x20points\x20—\x20the\x20partner\x27s\x20share\x20(the\x20complement\x20stays\x20with\x20the\x20house)','bounty_high_hunter_bps':'basis\x20points\x20of\x20the\x20bounty\x20pool\x20paid\x20for\x20the\x20top\x20severity\x20tier;\x20the\x20tiers\x20partition\x20the\x20pool\x20—\x20'+'a\x20partial\x20top\x20tier\x20would\x20need\x20a\x20remainder\x20leg\x20the\x20shipped\x20rows\x20do\x20not\x20declare','bounty_medium_hunter_bps':'basis\x20points\x20of\x20the\x20bounty\x20pool\x20paid\x20for\x20the\x20medium\x20severity\x20tier','bounty_low_hunter_bps':'basis\x20points\x20of\x20the\x20bounty\x20pool\x20paid\x20for\x20the\x20low\x20severity\x20tier','production_lead_days':'days\x20—\x20the\x20production\x20lead\x20time\x20before\x20the\x20ship\x20deadline','balance_window_days':'days\x20—\x20the\x20balance-due\x20payment\x20window\x20after\x20the\x20deposit\x20(deposit_balance\x20plans)','restock_confirm_days':'days\x20—\x20the\x20keeper\x27s\x20restock\x20confirmation\x20window\x20after\x20a\x20refund','escrow_release_days':'days\x20—\x20the\x20escrow\x20release\x20window:\x20settlement\x20fires\x20this\x20many\x20days\x20after\x20the\x20template\x27s\x20acceptance\x20anchor','dispute_timeout_days':'days\x20—\x20the\x20dispute-response\x20timeout\x20window','instant_cancel_hours':'hours\x20from\x20order\x20entry\x20—\x20the\x20instant-cancel\x20window\x20(full\x20refund);\x20after\x20it,\x20a\x20mid-work\x20exit\x20'+'rides\x20the\x20response_timeout\x20keeper\x20path','requirements_timeout_hours':'hours\x20—\x20the\x20buyer-requirements\x20submission\x20timeout','response_timeout_hours':'hours\x20—\x20the\x20keeper\x20resolves\x20the\x20request\x20in\x20the\x20buyer\x27s\x20favour\x20once\x20it\x20lapses:\x20the\x20buyer\x27s\x20'+'worst-case\x20wait\x20for\x20a\x20mid-work\x20exit\x20after\x20the\x20instant-cancel\x20window','defect_report_window_hours':'hours\x20from\x20the\x20LAST\x20delivery\x20entry\x20—\x20revising\x20entry\x20is\x20allowed\x20only\x20within\x20this\x20window;\x20a\x20'+'re-delivery\x20appends\x20a\x20fresh\x20entry\x20and\x20resets\x20it','acceptance_timeout_hours':'hours\x20—\x20the\x20acceptance\x20timeout\x20on\x20delivered\x20work','evaluation_window_days':'days\x20—\x20the\x20keeper\x20releases\x20escrow\x20to\x20the\x20provider\x20on\x20lapse\x20(agent-native\x20tasks\x20are\x20short-horizon,\x20'+'so\x20tighter\x20than\x20a\x20human\x20freelance\x20contract\x27s\x2014\x20days)','triage_window_days':'days\x20—\x20the\x20window\x20in\x20which\x20the\x20hunter\x20may\x20escalate\x20to\x20arbitration\x20(benchmarked\x20to\x20the\x20~5-workday\x20'+'mediation\x20incumbent;\x20a\x20keeper/dispute\x20anchor,\x20NOT\x20an\x20auto-pay\x20timer)','submission_window_days':'days\x20—\x20how\x20long\x20entries\x20are\x20accepted\x20before\x20the\x20judge\x20closes\x20submissions\x20(the\x20gate\x20on\x20'+'funded→judging)','appeal_window_days':'days\x20—\x20how\x20long\x20a\x20losing\x20entrant\x20may\x20contest\x20the\x20provisional\x20placement\x20(the\x20gate\x20on\x20'+'placement_provisional→placement_final)','delivery_window_days':'days\x20—\x20the\x20auto-accept\x20window\x20on\x20delivered\x20work:\x20silence\x20past\x20this\x20window\x20takes\x20the\x20designed\x20'+'default\x20path,\x20so\x20a\x20guaranteed\x20release\x20can\x20never\x20be\x20withheld\x20by\x20receiver\x20silence','stay_nights':'count\x20—\x20the\x20stay\x20length;\x20the\x20leg\x20measures\x20order\x20time\x20+\x20stay_nights\x20days\x20(the\x20booking-time\x20'+'approximation\x20of\x20the\x20missing\x20on-chain\x20departure\x20date)','segment_count':'count\x20—\x20the\x20number\x20of\x20itinerary\x20segments;\x20the\x20per-segment\x20fixed\x20Amount\x20legs\x20multiply\x20by\x20this','revision_rounds_max':'count\x20—\x20the\x20revision\x20rounds\x20included\x20before\x20extra\x20charges\x20(the\x20revision\x20loop\x20bound)','return_notice_days':'days\x20—\x20the\x20return\x20notice\x20window;\x20the\x20wizard\x20computes\x20the\x20window\x20from\x20this\x20knob\x20so\x20the\x20purpose\x20'+'prose\x20cannot\x20drift\x20(mainnet\x20lesson)','no_fault_exit_days':'days\x20—\x20the\x20no-fault\x20exit\x20notice\x20window','lease_months':'months\x20—\x20the\x20lease\x20term\x20length;\x20the\x20order\x20price\x20locks\x20to\x20lease_months\x20×\x20monthly_rent_amount\x20+\x20'+'deposit_amount','monthly_allocators':'count\x20—\x20the\x20monthly\x20payout\x20rows\x20of\x20the\x20lease\x20(12\x20=\x20one\x20per\x20lease\x20month)','early_exit_penalty_months':'months\x20of\x20rent\x20owed\x20as\x20the\x20early-exit\x20penalty','term_count':'count\x20—\x20the\x20number\x20of\x20tuition\x20terms\x20(the\x20pinned\x20per-term\x20Amount\x20legs\x20multiply)','period_days':'days\x20—\x20the\x20subscription\x20period\x20length:\x20the\x20expire\x20leg\x20measures\x20delivered\x20entry\x20+\x20period_days\x20+\x20grace_days','grace_days':'days\x20—\x20the\x20grace\x20period\x20added\x20after\x20period_days\x20before\x20the\x20expire\x20leg\x20fires','renewal_reminder_days':'days\x20before\x20period\x20end\x20—\x20the\x20renewal\x20reminder\x20anchor\x20(keeper\x20duty)','month_release_day':'day\x20of\x20month\x20(1-31)\x20—\x20the\x20monthly\x20release\x20anchor\x20for\x20the\x20subscription\x20payout','refund_window_days':'days\x20—\x20the\x20refund\x20window\x20on\x20the\x20course\x20purchase','confirm_window_hours':'hours\x20—\x20the\x20booking\x20confirmation\x20window','inspection_deadline_hours':'hours\x20—\x20the\x20move-in\x20inspection\x20deadline','objection_window_hours':'hours\x20—\x20the\x20objection\x20window\x20on\x20the\x20lease\x20outcome','inspection_window_days':'days\x20—\x20the\x20inspection\x20window\x20on\x20delivered\x20goods','confirm_timeout_hours':'hours\x20—\x20the\x20confirmation\x20timeout\x20before\x20the\x20designed\x20default\x20path\x20takes\x20over','campaign_duration_days':'days\x20—\x20the\x20campaign\x20duration\x20benchmark;\x20the\x20shared\x20cutoff\x20itself\x20is\x20campaign_deadline_ms\x20(absolute)','reward_claim_opens_after_days':'days\x20after\x20the\x20relevant\x20entry\x20—\x20an\x20explicit\x20bounty-opens\x20pin:\x20keeps\x20the\x20reward\x20claimable\x20from\x20day\x20'+'14\x20despite\x20a\x20longer\x20review\x20window\x20feeding\x20the\x20after-sales\x20derivation','auto_confirm_hours':'hours\x20after\x20shipment\x20—\x20the\x20perishable-goods\x20variant\x20of\x20buyer-silence\x20auto-confirm\x20(the\x20hours\x20'+'domain:\x20a\x2014-day\x20retail\x20window\x20on\x20a\x20meal\x20is\x20absurd)','claim_window_hours':'hours\x20—\x20the\x20dispute-filing\x20window\x20(hours\x20domain)','settle_hours':'hours\x20—\x20the\x20settlement\x20release\x20delay\x20(hours\x20domain)','pickup_window_hours':'hours\x20—\x20the\x20pickup\x20collection\x20window\x20at\x20the\x20point'};export function knobDocLines(a){const b=KNOB_DOCS[a]??knobTimeDoc(a)??KNOB_UNIT_HINTS['find'](c=>a['endsWith'](c['suffix']))?.['doc'];return b?['#\x20'+b]:[];}
|
|
@@ -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'](w=>w['name']),d=new Set(c),e=new Map(),f=new Map();for(const w of c){e['set'](w,[]),f['set'](w,[]);}for(const x of b){!e['has'](x['prev_node'])&&x['prev_node']!==''&&e['set'](x['prev_node'],[]),!f['has'](x['next_node'])&&f['set'](x['next_node'],[]),x['prev_node']!==''&&e['get'](x['prev_node'])['push'](x['next_node']),f['get'](x['next_node'])['push'](x['prev_node']);}const g=b['filter'](y=>y['prev_node']==='')['map'](y=>y['next_node'])['filter'](y=>d['has'](y)),h=c['filter'](y=>(e['get'](y)||[])['length']===0x0),i=c['filter'](y=>!g['includes'](y)&&(f['get'](y)||[])['length']===0x0),j=c['filter'](y=>(e['get'](y)||[])['length']===0x0&&!h['includes'](y)),{has_cycles:k,cycle_nodes:l}=detectCycles(c,b),m=new Map();for(const y of c)m['set'](y,[]);for(const z of b){z['prev_node']!==''&&z['forwards']['length']>0x0&&d['has'](z['next_node'])&&m['get'](z['prev_node'])['push'](z['next_node']);}const n=findTrappedNodes(c,m,g),o=l['filter'](A=>A['some'](B=>n['trap_nodes']['includes'](B))),p=analyzeDeadBranches(b),q=findUnachievableThresholds(b),r=computeReachability(c,b),s=b['reduce']((A,B)=>A+B['forwards']['length'],0x0),t=Math['max'](0x0,...b['map'](A=>A['forwards']['length'])),u=Math['max'](0x0,...b['flatMap'](A=>A['forwards']['map'](B=>countRetainedSubmissions(B['retained_submission'])))),v={'max_node_count':a['length']<=MAX_NODE_COUNT,'max_node_pair_count':b['length']<=MAX_NODE_PAIR_COUNT,'max_forward_count':t<=MAX_FORWARD_COUNT,'max_forward_order_count':u<=MAX_FORWARD_ORDER_COUNT,'threshold_achievable':q['length']===0x0};return{'entry_nodes':g,'terminal_nodes':h,'orphaned_nodes':i,'dead_end_nodes':j,'dead_branches':p,'unachievable_thresholds':q,'has_cycles':k,'cycle_nodes':l,'has_traps':n['trap_nodes']['length']>0x0,'trap_nodes':n['trap_nodes'],'trap_cycles':o,'reachability':r,'node_count':a['length'],'pair_count':b['length'],'forward_count':s,'within_limits':v};}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};}export function findTrappedNodes(a,b,c){const d=new Set(),f=[];for(const l of c){!d['has'](l)&&(d['add'](l),f['push'](l));}while(f['length']>0x0){const m=f['shift']();for(const n of b['get'](m)||[]){!d['has'](n)&&(d['add'](n),f['push'](n));}}const g=a['filter'](o=>(b['get'](o)||[])['length']===0x0),h=new Map();for(const o of a)h['set'](o,[]);for(const [q,r]of b){for(const s of r){if(h['has'](s))h['get'](s)['push'](q);}}const i=new Set(),j=[];for(const w of g){i['add'](w),j['push'](w);}while(j['length']>0x0){const x=j['shift']();for(const y of h['get'](x)||[]){!i['has'](y)&&(i['add'](y),j['push'](y));}}const k=[...d]['filter'](z=>!i['has'](z))['sort']();return{'trap_nodes':k,'entry_reachable':d,'exit_reaching':i};}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]of c){if(e['length']<=0x1)continue;const f=Math['min'](...e['map'](g=>g['threshold']));for(const g of e){g['threshold']>f*0x2&&b['push']({'pair':{'prev_node':g['prev_node'],'next_node':g['next_node']},'reason':'Threshold\x20'+g['threshold']+'\x20is\x20much\x20higher\x20than\x20competing\x20minimum\x20'+f+'.\x20Likely\x20always\x20loses.','competing_with':e['filter'](h=>h!==g)['map'](h=>h['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'],a['has_traps']?'TRAP\x20(entry-reachable,\x20no\x20exit\x20path):\x20YES\x20—\x20['+a['trap_nodes']['join'](',\x20')+']\x20❌\x20an\x20order\x20entering\x20these\x20nodes\x20can\x20never\x20reach\x20a\x20terminal':'Trap\x20(entry-reachable,\x20no\x20exit\x20path):\x20NO\x20✓\x20every\x20reachable\x20node\x20can\x20reach\x20a\x20terminal','Cycles:\x20'+(a['has_cycles']?a['cycle_nodes']['length']+'\x20found\x20(informational\x20—\x20allowed\x20on-chain;'+(a['has_traps']?'\x20a\x20trapped\x20loop\x20needs\x20a\x20cycle-breaking\x20exit':'\x20exit\x20reachability\x20verified')+')':'none'),'','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]of c){if(g['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,\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\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';
|
|
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'](w=>w['name']),d=new Set(c),e=new Map(),f=new Map();for(const w of c){e['set'](w,[]),f['set'](w,[]);}for(const x of b){!e['has'](x['prev_node'])&&x['prev_node']!==''&&e['set'](x['prev_node'],[]),!f['has'](x['next_node'])&&f['set'](x['next_node'],[]),x['prev_node']!==''&&e['get'](x['prev_node'])['push'](x['next_node']),f['get'](x['next_node'])['push'](x['prev_node']);}const g=b['filter'](y=>y['prev_node']==='')['map'](y=>y['next_node'])['filter'](y=>d['has'](y)),h=c['filter'](y=>(e['get'](y)||[])['length']===0x0),i=c['filter'](y=>!g['includes'](y)&&(f['get'](y)||[])['length']===0x0),j=c['filter'](y=>(e['get'](y)||[])['length']===0x0&&!h['includes'](y)),{has_cycles:k,cycle_nodes:l}=detectCycles(c,b),m=new Map();for(const y of c)m['set'](y,[]);for(const z of b){z['prev_node']!==''&&z['forwards']['length']>0x0&&d['has'](z['next_node'])&&m['get'](z['prev_node'])['push'](z['next_node']);}const n=findTrappedNodes(c,m,g),o=l['filter'](A=>A['some'](B=>n['trap_nodes']['includes'](B))),p=analyzeDeadBranches(b),q=findUnachievableThresholds(b),r=computeReachability(c,b),s=b['reduce']((A,B)=>A+B['forwards']['length'],0x0),t=Math['max'](0x0,...b['map'](A=>A['forwards']['length'])),u=Math['max'](0x0,...b['flatMap'](A=>A['forwards']['map'](B=>countRetainedSubmissions(B['retained_submission'])))),v={'max_node_count':a['length']<=MAX_NODE_COUNT,'max_node_pair_count':b['length']<=MAX_NODE_PAIR_COUNT,'max_forward_count':t<=MAX_FORWARD_COUNT,'max_forward_order_count':u<=MAX_FORWARD_ORDER_COUNT,'threshold_achievable':q['length']===0x0};return{'entry_nodes':g,'terminal_nodes':h,'orphaned_nodes':i,'dead_end_nodes':j,'dead_branches':p,'unachievable_thresholds':q,'has_cycles':k,'cycle_nodes':l,'has_traps':n['trap_nodes']['length']>0x0,'trap_nodes':n['trap_nodes'],'trap_cycles':o,'reachability':r,'node_count':a['length'],'pair_count':b['length'],'forward_count':s,'within_limits':v};}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};}export function findTrappedNodes(a,b,c){const d=new Set(),f=[];for(const l of c){!d['has'](l)&&(d['add'](l),f['push'](l));}while(f['length']>0x0){const m=f['shift']();for(const n of b['get'](m)||[]){!d['has'](n)&&(d['add'](n),f['push'](n));}}const g=a['filter'](o=>(b['get'](o)||[])['length']===0x0),h=new Map();for(const o of a)h['set'](o,[]);for(const [q,r]of b){for(const s of r){if(h['has'](s))h['get'](s)['push'](q);}}const i=new Set(),j=[];for(const w of g){i['add'](w),j['push'](w);}while(j['length']>0x0){const x=j['shift']();for(const y of h['get'](x)||[]){!i['has'](y)&&(i['add'](y),j['push'](y));}}const k=[...d]['filter'](z=>!i['has'](z))['sort']();return{'trap_nodes':k,'entry_reachable':d,'exit_reaching':i};}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]of c){if(e['length']<=0x1)continue;const f=Math['min'](...e['map'](g=>g['threshold']));for(const g of e){g['threshold']>f*0x2&&b['push']({'pair':{'prev_node':g['prev_node'],'next_node':g['next_node']},'reason':'Threshold\x20'+g['threshold']+'\x20is\x20much\x20higher\x20than\x20competing\x20minimum\x20'+f+'.\x20Likely\x20always\x20loses.','competing_with':e['filter'](h=>h!==g)['map'](h=>h['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'],a['has_traps']?'TRAP\x20(entry-reachable,\x20no\x20exit\x20path):\x20YES\x20—\x20['+a['trap_nodes']['join'](',\x20')+']\x20❌\x20an\x20order\x20entering\x20these\x20nodes\x20can\x20never\x20reach\x20a\x20terminal':'Trap\x20(entry-reachable,\x20no\x20exit\x20path):\x20NO\x20✓\x20every\x20reachable\x20node\x20can\x20reach\x20a\x20terminal','Cycles:\x20'+(a['has_cycles']?a['cycle_nodes']['length']+'\x20found\x20(informational\x20—\x20allowed\x20on-chain;'+(a['has_traps']?'\x20a\x20trapped\x20loop\x20needs\x20a\x20cycle-breaking\x20exit':'\x20exit\x20reachability\x20verified')+')':'none'),'','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]of c){if(g['length']>0x1)return'P-M-FORKMERGE';}return'P-M-LINEAR';}export function edgeOperatorRail(a,b,c){const d=typeof a?.['operator']==='string'&&a['operator']!==''?a['operator']:undefined,f=typeof b?.['operator']==='string'&&b['operator']!==''?b['operator']:undefined;return d??f??(c===''?'order_payer':'merchant');}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,\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\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';
|