@wowok/agent-mcp 3.2.6 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/communication/wts-attestation.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +3 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +17 -0
- package/dist/composition/inflight.js +1 -0
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/customer/account-events.js +1 -1
- package/dist/customer/order-monitor.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/constraint-registry.d.ts +6 -1
- package/dist/extensions/constraint-registry.js +1 -1
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/industry-pack.d.ts +5 -0
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/mode-evaluator.d.ts +3 -2
- package/dist/extensions/mode-evaluator.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/anti-cheat.d.ts +32 -2
- package/dist/graph/onchain/anti-cheat.js +1 -1
- package/dist/graph/onchain/anti-cheat.spec.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/extract.js +1 -1
- package/dist/graph/onchain/graph-policy.spec.js +1 -1
- package/dist/graph/onchain/index.d.ts +2 -2
- package/dist/graph/onchain/index.js +1 -1
- package/dist/graph/onchain/project-relationship.js +1 -1
- package/dist/graph/onchain/table-ledger.spec.js +1 -1
- package/dist/graph/onchain/types.d.ts +3 -0
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/arbitration-venue-order.d.ts +25 -0
- package/dist/knowledge/arbitration-venue-order.js +1 -0
- package/dist/knowledge/audit-rules.d.ts +10 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/risk-baselines.spec.js +1 -1
- package/dist/knowledge/baselines/rules/graph.json +81 -0
- package/dist/knowledge/baselines/rules/machine.json +3 -3
- package/dist/knowledge/baselines/rules/plan.json +80 -2
- package/dist/knowledge/builtin-templates.d.ts +17 -2
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +4 -0
- package/dist/knowledge/guard-node-gates.js +1 -0
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-submission-prompt.d.ts +1 -0
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-topology.d.ts +6 -0
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/reputation-rules.d.ts +3 -9
- package/dist/knowledge/reputation-rules.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +10 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/settlement-semantics.d.ts +1 -0
- package/dist/knowledge/settlement-semantics.js +1 -0
- package/dist/knowledge/template-loader.d.ts +22 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +14 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +1 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/allocation-advice.js +1 -1
- package/dist/participation/customer-interest.js +1 -1
- package/dist/participation/radar-core.d.ts +6 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +38 -15
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +7 -0
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/pipeline-actions.d.ts +1 -1
- package/dist/playbooks/service-build/pipeline-actions.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/risk-aggregator.d.ts +1 -1
- package/dist/playbooks/service-build/risk-aggregator.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/relationship/derivation.d.ts +1 -0
- package/dist/review/index.js +1 -1
- package/dist/runtime/instance-registry.d.ts +8 -0
- package/dist/runtime/instance-registry.js +1 -0
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +14 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +109 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +14 -0
- package/dist/schema/call/contact.js +1 -1
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.d.ts +7 -0
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +7 -0
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/payment.js +1 -1
- package/dist/schema/call/permission-handler.js +1 -1
- package/dist/schema/call/progress.d.ts +46 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +8 -8
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/index.d.ts +11 -0
- package/dist/schema/goal/planning.d.ts +32 -1
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +40 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +13 -0
- package/dist/schema/local/index.d.ts +75 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +17 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +39 -2
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +64 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +94 -0
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.d.ts +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/permission-machine-check.js +1 -1
- package/dist/schema/workspace/index.d.ts +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +45 -0
- package/dist/schemas/benchmark_migration_operation.output.json +24 -4
- package/dist/schemas/benchmark_migration_operation.schema.json +70 -0
- package/dist/schemas/bridge_operation.output.json +45 -0
- package/dist/schemas/goal_operation.schema.json +78 -0
- package/dist/schemas/guard2file.output.json +6 -1
- package/dist/schemas/guard2file.schema.json +9 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +91 -0
- package/dist/schemas/industry_pack_operation.schema.json +19 -1
- package/dist/schemas/keeper_operation.output.json +44 -0
- package/dist/schemas/local_cache_operation.output.json +45 -0
- package/dist/schemas/local_history_operation.output.json +45 -0
- package/dist/schemas/local_info_operation.output.json +45 -0
- package/dist/schemas/local_mark_operation.output.json +45 -0
- package/dist/schemas/machineNode2file.output.json +6 -1
- package/dist/schemas/machineNode2file.schema.json +9 -0
- package/dist/schemas/messenger_operation.output.json +52 -0
- package/dist/schemas/monitor_events.output.json +44 -0
- package/dist/schemas/monitor_subscription.output.json +44 -0
- package/dist/schemas/onchain_events.output.json +44 -0
- package/dist/schemas/onchain_operations.output.json +133 -0
- package/dist/schemas/onchain_operations.schema.json +73 -16
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
- package/dist/schemas/onchain_operations_contact.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_progress.schema.json +57 -0
- package/dist/schemas/onchain_operations_service.schema.json +7 -8
- package/dist/schemas/onchain_table_data.output.json +81 -13
- package/dist/schemas/onchain_table_data.schema.json +21 -21
- package/dist/schemas/query_toolkit.output.json +218 -9
- package/dist/schemas/query_toolkit.schema.json +50 -26
- package/dist/schemas/wowok_buildin_info.output.json +80 -1
- package/dist/schemas/wowok_buildin_info.schema.json +1 -1
- package/dist/tools/handlers/benchmark-migration.d.ts +1 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/file-export.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +22 -0
- package/dist/tools/handlers/review-chain.js +1 -0
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/config.js +1 -1
- package/dist/tools/registry/evaluation.js +1 -1
- package/dist/tools/registry/files.js +1 -1
- package/dist/tools/registry/identity.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/registry/messenger.js +1 -1
- package/dist/tools/registry/monitor.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/rules-hook.js +1 -1
- package/dist/tools/runtime-health.d.ts +10 -0
- package/dist/tools/runtime-health.js +1 -0
- package/dist/tools/upgrade-check.d.ts +10 -1
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wrap.d.ts +3 -0
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
package/dist/knowledge/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind}from'./workflow-guidance.js';import{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules}from'./safety-rules.js';import{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations}from'./tool-constraints.js';import{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate}from'./reward-templates.js';import{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./audit-rules.js';import{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION}from'./dynamic-pricing.js';import{buildReviewRepositorySetup,computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION}from'./reputation-rules.js';import{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION}from'./acquisition-flywheel.js';import{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames}from'./industry-registry.js';import{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries}from'./industry-generalizer.js';import{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline}from'./industry-evolution.js';import{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext}from'./flywheel-loop.js';import{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole}from'./intent-metrics.js';import{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes}from'./guard-ledger.js';import{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory}from'./guard-translation.js';import{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP}from'./guard-puzzle.js';import{runGuardRulePack,assembleGuardAssessment,getRiskRulesCount}from'./guard-risk.js';import{evaluateGuardDraft}from'./guard-eval.js';import{GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding}from'./guard-bindings.js';import{SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects}from'./scenario-topology.js';import{GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams}from'./guard-templates.js';import{lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult}from'./guard-lint.js';import{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,findScene as a197a,getScenesByIndustry as a197b,getScenesByPattern,inferSceneFromFlow}from'./machine-ledger.js';import{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,getAllTemplates as a197c,getTemplateById as a197d,getTemplatesByScene as a197e,getTemplatesByIndustry as a197f,suggestTemplateForIntent,walkDecisionTree,fillTemplate as a197g,forkTemplate as a197h,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 a197i,identifyExecutionMode,identifyTopology,explainForwardPermission,getConstraintsByCategory as a197j,getConstraintById,getOnChainConstraints as a197k,getOffChainConstraints as a197l}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 a197m,initPuzzleFromTemplate,checkPuzzleCompleteness as a197n,recommendNextStep as a197o,derivePuzzleFromMachineJson,generateConfirmationText as a197p,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 a197q,findSceneById as a197r,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,inferSceneFromIntent as a197s,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,getCrossObjectBindings as a197t}from'./service-ledger.js';import{initPuzzleFromIntent as a197u,checkPuzzleCompleteness as a197v,validateConstraints as a197w,generateConfirmationText as a197x,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 a197y,getScenesByMode as a197z,getScenesByStrategy as a197A,findSceneById as a197B,inferSceneFromIntent as a197C,getAllScenes as a197D,getScenesCount as a197E,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,getErrorName as a197F,getErrorDescription as a197G}from'./allocation-ledger.js';import{initPuzzleFromIntent as a197H,checkPuzzleCompleteness as a197I,validateConstraints as a197J,generateConfirmationText as a197K,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION}from'./allocation-puzzle.js';import{ALLOCATION_RISK_VERSION,assessAllocationRisks,getAllRiskRules as a197L}from'./allocation-risk.js';import{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,getAllTemplates as a197M,getTemplateById as a197N,getTemplatesByScene as a197O,getTemplatesByIndustry as a197P,suggestTemplateForScene as a197Q,listTemplates as a197R,fillTemplate as a197S}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 a197T,getScenesByHostObject as a197U,findSceneById as a197V,findSceneByPermissionIndex as a197W,getBuiltinPermissionByIndex as a197X,isBuiltinTreasuryPermission,getActiveBuiltinPermissions as a197Y,getReservedBuiltinPermissions as a197Z,inferSceneFromIntent as a197a0,getTreasuryScenesCount,getGovernedOperationsForPermissionIndex as a197a1}from'./treasury-ledger.js';import{initPuzzleFromIntent as a197a2,checkPuzzleCompleteness as a197a3,validateConstraints as a197a4,generateConfirmationText as a197a5,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,MAX_DESCRIPTION_LENGTH as a197a6}from'./treasury-puzzle.js';import{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,getTemplateById as a197a7,getTemplatesByScene as a197a8,getTemplatesByIndustry as a197a9,suggestTemplateForScene as a197aa,listTemplates as a197ab,fillTemplate as a197ac}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 a197ad,findSceneById as a197ae,findSceneByMoveEntry as a197af,getScenesByPermissionLayer as a197ag,getScenesByReversibility as a197ah,getFieldDef as a197ai,getMutableFields as a197aj,getImmutableFields as a197ak,getFrozenAfterProgressFields as a197al,getOneTimeSetFields as a197am,inferSceneFromIntent as a197an,getEmittedEvents as a197ao,getInferredEvents as a197ap,getOrderScenesCount,sdkToMoveField as a197aq,moveToSdkField as a197ar}from'./order-ledger.js';import{initPuzzleFromIntent as a197as,checkPuzzleCompleteness as a197at,validateConstraints as a197au,generateConfirmationText as a197av,verifySnapshotMechanism as a197aw,inferLifecyclePhase as a197ax,matchSceneFromPuzzle as a197ay,listAllScenes as a197az,lookupScene as a197aA}from'./order-puzzle.js';import{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,getTemplateById as a197aB,getTemplatesByScene as a197aC,getTemplatesByIndustry as a197aD,getTemplatesByPermissionLayer as a197aE,getIrreversibleTemplates as a197aF,suggestTemplateForScene as a197aG,listOrderTemplates,fillTemplate as a197aH,suggestTemplateFromIntent as a197aI,getTemplateParameters as a197aJ,validateTemplateParams as a197aK}from'./order-templates.js';import{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules}from'./order-risk.js';import{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,PROGRESS_PERMISSIONS as a197aL,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,getScenesByPhase as a197aM,findSceneById as a197aN,getScenesByIndustry as a197aO,getBuiltinPermissionByIndex as a197aP,isProgressBuiltinPermission,inferSceneFromIntent as a197aQ,getAllBuiltinPermissions as a197aR,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount}from'./progress-ledger.js';import{initPuzzleFromIntent as a197aS,checkPuzzleCompleteness as a197aT,validateConstraints as a197aU,generateConfirmationText as a197aV,resolveBuiltinPermission as a197aW,isOrderHolderForward,getRelevantDimensions as a197aX}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 a197aY,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,getScenesByCategory as a197aZ,findSceneById as a197b0,findSceneByPermissionIndex as a197b1,getPermissionByIndex as a197b2,getPermissionByName as a197b3,isReservedIndex as a197b4,isUsedPermissionIndex as a197b5,getActivePermissionCount as a197b6,inferSceneFromIntent as a197b7,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,getScenesProducingStatus as a197b8,getScenesRequiringStatus as a197b9,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions}from'./arbitration-ledger.js';import{initPuzzleFromIntent as a197ba,checkPuzzleCompleteness as a197bb,validateConstraints as a197bc,generateConfirmationText as a197bd}from'./arbitration-puzzle.js';import{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,getAllTemplates as a197be,getTemplateById as a197bf,getTemplatesByScene as a197bg,getTemplatesByIndustry as a197bh,suggestTemplateForScene as a197bi,listTemplates as a197bj,fillTemplate as a197bk}from'./arbitration-templates.js';import{ARBITRATION_RISK_VERSION,assessArbitrationRisks,getAllRiskRules as a197bl}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 a197bm,findSceneById as a197bn,getScenesByIndustry as a197bo,getBuiltinPermissionByIndex as a197bp,isRewardBuiltinPermission,getAllBuiltinPermissions as a197bq,getRewardScenesCount,getGuardConstructorSpec as a197br,resolveGuardConstructor as a197bs,getRewardErrorByCode,getRewardErrorByName,validateGuardCount as a197bt,validateRecordCount as a197bu,inferSceneFromIntent as a197bv}from'./reward-ledger.js';import{REWARD_FIELD_MUTABILITY,initPuzzleFromIntent as a197bw,checkPuzzleCompleteness as a197bx,validateConstraints as a197by,generateConfirmationText as a197bz,resolveBuiltinPermission as a197bA,requiresGuardConfig as a197bB,requiresPassport as a197bC,getRelevantDimensions as a197bD,getFieldMutability as a197bE,isAdminMutableField as a197bF,getFieldPermissionIndex as a197bG}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 a197bH,getScenariosCount as a197bI,findScenarioById as a197bJ,getScenariosByConsumer as a197bK,getScenariosUsingRelies as a197bL,inferScenarioFromIntent as a197bM,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,getErrorName as a197bN,getErrorDescription as a197bO}from'./passport-ledger.js';import{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,getAllTemplates as a197bP,getTemplateById as a197bQ,getTemplatesByScenario as a197bR,getTemplatesByIndustry as a197bS,suggestTemplateForScenario as a197bT,listTemplates as a197bU,fillTemplate as a197bV}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 a197bW,parseTemplateFile,renderTemplateFile,loadAndValidate,TemplateFrontmatterSchema}from'./template-loader.js';import{scanTemplate}from'./template-scanner.js';import{GUARD_DESIGN_PATTERNS,GUARD_DESIGN_PATTERNS_VERSION,VERIFIER_LEVEL_GUIDANCE,getGuardDesignPattern,searchGuardDesignPatterns,getPatternsByHost,getPatternsByIndustry,getPatternsByDataSourceClass,getVerifierLevelGuidance,suggestPatternForRequirement}from'./guard-design-patterns.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules};export{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations};export{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate};export{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings};export{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION};export{buildReviewRepositorySetup,computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION};export{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION};export{STRATEGY_MANUAL_FILENAME,STRATEGY_MANUAL_VERSION,renderStrategyManual,parseManualSentinel,classifyManualFile,getBuiltinStrategyManual,listBuiltinStrategyManualIndustries}from'./strategy-manuals.js';export{INDUSTRY_STRATEGIES,getIndustryStrategy,listIndustryStrategies,registerIndustryStrategy,unregisterIndustryStrategy,recommendStrategy,stageFromOrderCount,validateStrategyLevers}from'./industry-strategy.js';export{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,listIndustries as listRegistryIndustries,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames};export{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries};export{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline};export{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext};export{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole};export{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes};export{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory};export{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP};export{runGuardRulePack,assembleGuardAssessment,evaluateGuardDraft,getRiskRulesCount,GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams,GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding,SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects,lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult};export{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,a197a as findMachineScene,a197b as getMachineScenesByIndustry,getScenesByPattern,inferSceneFromFlow};export{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,a197c as getAllMachineTemplates,a197d as getMachineTemplateById,a197e as getMachineTemplatesByScene,a197f as getMachineTemplatesByIndustry,suggestTemplateForIntent,walkDecisionTree,a197g as fillMachineTemplate,a197h as forkMachineTemplate,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds};export{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,a197i as matchMachinePattern,identifyExecutionMode,identifyTopology,explainForwardPermission,a197j as getMachineConstraintsByCategory,getConstraintById,a197k as getOnChainMachineConstraints,a197l 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{a197m as initMachinePuzzleFromIntent,initPuzzleFromTemplate,a197n as checkMachinePuzzleCompleteness,a197o as recommendMachineNextStep,derivePuzzleFromMachineJson,a197p as generateMachineConfirmationText,MACHINE_PUZZLE_VERSION};export{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,a197q as getServiceScenesByCategory,a197r as findServiceSceneById,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,a197s as inferServiceSceneFromIntent,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,a197t as getServiceCrossObjectBindings};export{a197u as initServicePuzzleFromIntent,a197v as checkServicePuzzleCompleteness,a197w as validateServiceConstraints,a197x 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,a197y as getAllocationScenesByTriggerSource,a197z as getAllocationScenesByMode,a197A as getAllocationScenesByStrategy,a197B as findAllocationSceneById,a197C as inferAllocationSceneFromIntent,a197D as getAllAllocationScenes,a197E as getAllocationScenesCount,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,a197F as getAllocationErrorName,a197G as getAllocationErrorDescription};export{a197H as initAllocationPuzzleFromIntent,a197I as checkAllocationPuzzleCompleteness,a197J as validateAllocationConstraints,a197K as generateAllocationPuzzleConfirmationText,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION};export{ALLOCATION_RISK_VERSION,assessAllocationRisks,a197L as getAllAllocationRiskRules};export{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,a197M as getAllAllocationTemplates,a197N as getAllocationTemplateById,a197O as getAllocationTemplatesByScene,a197P as getAllocationTemplatesByIndustry,a197Q as suggestAllocationTemplateForScene,a197R as listAllocationTemplates,a197S 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,a197T as TREASURY_BUILTIN_PERMISSIONS,a197U as getTreasuryScenesByHostObject,a197V as findTreasurySceneById,a197W as findTreasurySceneByPermissionIndex,a197X as getTreasuryBuiltinPermissionByIndex,isBuiltinTreasuryPermission,a197Y as getActiveTreasuryBuiltinPermissions,a197Z as getReservedTreasuryBuiltinPermissions,a197a0 as inferTreasurySceneFromIntent,getTreasuryScenesCount,a197a1 as getTreasuryGovernedOperationsForPermissionIndex};export{a197a2 as initTreasuryPuzzleFromIntent,a197a3 as checkTreasuryPuzzleCompleteness,a197a4 as validateTreasuryConstraints,a197a5 as generateTreasuryPuzzleConfirmationText,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,a197a6 as TREASURY_MAX_DESCRIPTION_LENGTH};export{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,a197a7 as getTreasuryTemplateById,a197a8 as getTreasuryTemplatesByScene,a197a9 as getTreasuryTemplatesByIndustry,a197aa as suggestTreasuryTemplateForScene,a197ab as listTreasuryTemplates,a197ac 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,a197ad as getOrderScenesByOperationField,a197ae as findOrderSceneById,a197af as findOrderSceneByMoveEntry,a197ag as getOrderScenesByPermissionLayer,a197ah as getOrderScenesByReversibility,a197ai as getOrderFieldDef,a197aj as getOrderMutableFields,a197ak as getOrderImmutableFields,a197al as getOrderFrozenAfterProgressFields,a197am as getOrderOneTimeSetFields,a197an as inferOrderSceneFromIntent,a197ao as getOrderEmittedEvents,a197ap as getOrderInferredEvents,getOrderScenesCount,a197aq as sdkToMoveOrderField,a197ar as moveToSdkOrderField};export{a197as as initOrderPuzzleFromIntent,a197at as checkOrderPuzzleCompleteness,a197au as validateOrderConstraints,a197av as generateOrderPuzzleConfirmationText,a197aw as verifyOrderSnapshotMechanism,a197ax as inferOrderLifecyclePhase,a197ay as matchOrderSceneFromPuzzle,a197az as listAllOrderScenes,a197aA as lookupOrderScene};export{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,a197aB as getOrderTemplateById,a197aC as getOrderTemplatesByScene,a197aD as getOrderTemplatesByIndustry,a197aE as getOrderTemplatesByPermissionLayer,a197aF as getIrreversibleOrderTemplates,a197aG as suggestOrderTemplateForScene,listOrderTemplates,a197aH as fillOrderTemplate,a197aI as suggestOrderTemplateFromIntent,a197aJ as getOrderTemplateParameters,a197aK as validateOrderTemplateParams};export{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules};export{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,a197aL as PROGRESS_BUILTIN_PERMISSIONS,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,a197aM as getProgressScenesByPhase,a197aN as findProgressSceneById,a197aO as getProgressScenesByIndustry,a197aP as getProgressBuiltinPermissionByIndex,isProgressBuiltinPermission,a197aQ as inferProgressSceneFromIntent,a197aR as getAllProgressBuiltinPermissions,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount};export{a197aS as initProgressPuzzleFromIntent,a197aT as checkProgressPuzzleCompleteness,a197aU as validateProgressConstraints,a197aV as generateProgressPuzzleConfirmationText,a197aW as resolveProgressBuiltinPermission,isOrderHolderForward,a197aX 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,a197aY as ARBITRATION_BUILTIN_PERMISSIONS,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,a197aZ as getArbitrationScenesByCategory,a197b0 as findArbitrationSceneById,a197b1 as findArbitrationSceneByPermissionIndex,a197b2 as getArbitrationPermissionByIndex,a197b3 as getArbitrationPermissionByName,a197b4 as isArbitrationReservedIndex,a197b5 as isArbitrationUsedPermissionIndex,a197b6 as getArbitrationActivePermissionCount,a197b7 as inferArbitrationSceneFromIntent,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,a197b8 as getArbitrationScenesProducingStatus,a197b9 as getArbitrationScenesRequiringStatus,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions};export{a197ba as initArbitrationPuzzleFromIntent,a197bb as checkArbitrationPuzzleCompleteness,a197bc as validateArbitrationConstraints,a197bd as generateArbitrationPuzzleConfirmationText};export{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,a197be as getAllArbitrationTemplates,a197bf as getArbitrationTemplateById,a197bg as getArbitrationTemplatesByScene,a197bh as getArbitrationTemplatesByIndustry,a197bi as suggestArbitrationTemplateForScene,a197bj as listArbitrationTemplates,a197bk as fillArbitrationTemplate};export{ARBITRATION_RISK_VERSION,assessArbitrationRisks,a197bl 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,a197bm as getRewardScenesByPhase,a197bn as findRewardSceneById,a197bo as getRewardScenesByIndustry,a197bp as getRewardBuiltinPermissionByIndex,isRewardBuiltinPermission,a197bq as getAllRewardBuiltinPermissions,getRewardScenesCount,a197br as getRewardGuardConstructorSpec,a197bs as resolveRewardGuardConstructor,getRewardErrorByCode,getRewardErrorByName,a197bt as validateRewardGuardCount,a197bu as validateRewardRecordCount,a197bv as inferRewardSceneFromIntent};export{REWARD_FIELD_MUTABILITY,a197bw as initRewardPuzzleFromIntent,a197bx as checkRewardPuzzleCompleteness,a197by as validateRewardConstraints,a197bz as generateRewardPuzzleConfirmationText,a197bA as resolveRewardBuiltinPermission,a197bB as requiresRewardGuardConfig,a197bC as requiresRewardPassport,a197bD as getRewardRelevantDimensions,a197bE as getRewardFieldMutability,a197bF as isRewardAdminMutableField,a197bG 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,a197bH as getAllPassportScenarios,a197bI as getPassportScenesCount,a197bJ as findPassportScenarioById,a197bK as getPassportScenariosByConsumer,a197bL as getPassportScenariosUsingRelies,a197bM as inferPassportScenarioFromIntent,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,a197bN as getPassportErrorName,a197bO as getPassportErrorDescription};export{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,a197bP as getAllPassportTemplates,a197bQ as getPassportTemplateById,a197bR as getPassportTemplatesByScenario,a197bS as getPassportTemplatesByIndustry,a197bT as suggestPassportTemplateForScenario,a197bU as listPassportTemplates,a197bV 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,a197bW 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':a197L()['length'],'allocation_templates_count':ALLOCATION_TEMPLATES['length'],'allocation_context_enabled':!![],'treasury_scenes_count':TREASURY_SCENES['length'],'treasury_builtin_permissions_count':a197T['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':a197aL['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':a197aY['length'],'arbitration_risk_rules_count':a197bl()['length'],'arbitration_templates_count':ARBITRATION_TEMPLATES['length'],'arbitration_context_enabled':!![],'reward_scenes_count':REWARD_SCENES['length'],'reward_builtin_permissions_count':REWARD_PERMISSIONS['length'],'reward_fields_count':REWARD_FIELDS['length'],'reward_guard_constructors_count':REWARD_GUARD_CONSTRUCTORS['length'],'reward_error_codes_count':REWARD_ERROR_CODES['length'],'reward_risk_rules_count':getAllRewardRiskRules()['length'],'reward_context_enabled':!![],'passport_scenarios_count':PASSPORT_SCENARIOS['length'],'passport_max_guard_count':MAX_GUARD_COUNT_PASSPORT,'passport_max_submission_size':MAX_SUBMISSION_SIZE_PASSPORT,'passport_templates_count':PASSPORT_TEMPLATES['length'],'passport_context_enabled':!![],'proof_risk_rules_count':PROOF_RISK_RULES['length'],'repository_risk_rules_count':REPOSITORY_RISK_RULES['length'],'demand_risk_rules_count':DEMAND_RISK_RULES['length'],'contact_risk_rules_count':CONTACT_RISK_RULES['length'],'resource_risk_rules_count':RESOURCE_RISK_RULES['length'],'payment_risk_rules_count':PAYMENT_RISK_RULES['length'],'arb_risk_rules_count':ARB_RISK_RULES['length'],'personal_risk_rules_count':PERSONAL_RISK_RULES['length'],'util_risk_rules_count':UTIL_RISK_RULES['length'],'registrar_risk_rules_count':REGISTRAR_RISK_RULES['length'],'bridge_risk_rules_count':BRIDGE_RISK_RULES['length'],'tools_reference_count':TOOLS_REFERENCE['length'],'scenario_modes_count':SCENARIO_MODES['length'],'scenario_mode_compositions_count':MODE_COMPOSITIONS['length'],'builtin_templates_count':BUILTIN_TEMPLATES['length'],'guard_design_patterns_count':GUARD_DESIGN_PATTERNS['length'],'verifier_level_guidance_count':VERIFIER_LEVEL_GUIDANCE['length']};}export{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind};export{buildWorkspaceLists}from'./workspace-lists.js';export{resolveSupplyChainGraph}from'./supply-chain.js';export{enumerateObjectOperations,operationCategoryOf,operationComplexityOf,isPermissionIndexType}from'./operation-dictionary.js';export{enumerateServices,enumerateDemands,enumerateArbs}from'./jsonrpc-enum.js';export{FIELD_MUTABILITY_RULES,LOCK_CONSTRAINTS,IRREVERSIBLE_OPERATIONS,STATE_MACHINE_TERMINALS,NUMERIC_LIMIT_CONSTRAINTS,EXTERNAL_ACCESS_MECHANISMS,fieldMutabilityOf,isActionForbidden,lockConstraintOf,numericLimitOf,externalAccessOf}from'./contract-invariants.js';export{GUARD_FIELD_COGNITION_VERSION,GUARD_FIELD_SITES,VALUE_ORIGIN_SEMANTICS,GUARD_PASSPORT_DOCTRINE,guardSitesFor,guardCognitionDoctrine,REPOSITORY_WRITE_ROUTE_MATRIX,repositoryRouteSlotConflicts}from'./guard-field-cognition.js';
|
|
1
|
+
import{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind}from'./workflow-guidance.js';import{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules}from'./safety-rules.js';import{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations}from'./tool-constraints.js';import{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate}from'./reward-templates.js';import{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./audit-rules.js';import{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION}from'./dynamic-pricing.js';import{computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION}from'./reputation-rules.js';import{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION}from'./acquisition-flywheel.js';import{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames}from'./industry-registry.js';import{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries}from'./industry-generalizer.js';import{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline}from'./industry-evolution.js';import{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext}from'./flywheel-loop.js';import{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole}from'./intent-metrics.js';import{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes}from'./guard-ledger.js';import{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory}from'./guard-translation.js';import{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP}from'./guard-puzzle.js';import{runGuardRulePack,assembleGuardAssessment,getRiskRulesCount}from'./guard-risk.js';import{evaluateGuardDraft}from'./guard-eval.js';import{GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding}from'./guard-bindings.js';import{SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects}from'./scenario-topology.js';import{GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams}from'./guard-templates.js';import{lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult}from'./guard-lint.js';import{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,findScene as a200a,getScenesByIndustry as a200b,getScenesByPattern,inferSceneFromFlow}from'./machine-ledger.js';import{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,getAllTemplates as a200c,getTemplateById as a200d,getTemplatesByScene as a200e,getTemplatesByIndustry as a200f,suggestTemplateForIntent,walkDecisionTree,fillTemplate as a200g,forkTemplate as a200h,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds}from'./machine-templates.js';import{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,matchSemanticPattern as a200i,identifyExecutionMode,identifyTopology,explainForwardPermission,getConstraintsByCategory as a200j,getConstraintById,getOnChainConstraints as a200k,getOffChainConstraints as a200l}from'./machine-translation.js';import{MACHINE_RISK_RULES,MACHINE_RISK_VERSION,assessMachineRisks}from'./machine-risk.js';import{analyzeTopology,identifyTopologyPattern,formatTopologySummary,MACHINE_TOPOLOGY_VERSION,MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT}from'./machine-topology.js';import{initPuzzleFromIntent as a200m,initPuzzleFromTemplate,checkPuzzleCompleteness as a200n,recommendNextStep as a200o,derivePuzzleFromMachineJson,generateConfirmationText as a200p,MACHINE_PUZZLE_VERSION}from'./machine-puzzle.js';import{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,getScenesByCategory as a200q,findSceneById as a200r,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,inferSceneFromIntent as a200s,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,getCrossObjectBindings as a200t}from'./service-ledger.js';import{initPuzzleFromIntent as a200u,checkPuzzleCompleteness as a200v,validateConstraints as a200w,generateConfirmationText as a200x,initOrderFlowPuzzle,checkOrderFlowCompleteness}from'./service-puzzle.js';import{SERVICE_RISK_VERSION,assessServiceRisks,getAllServiceRiskRules}from'./service-risk.js';import{SERVICE_TEMPLATES,SERVICE_TEMPLATES_VERSION,getServiceTemplateById,getServiceTemplatesByScene,getServiceTemplatesByIndustry,suggestServiceTemplateForScene,listServiceTemplates,fillServiceTemplate,getAllServiceTemplates}from'./service-templates.js';import{ALLOCATION_SCENES,ALLOCATION_LEDGER_VERSION,MAX_ALLOCATOR_COUNT,ALLOCATION_MAX_SHARING_COUNT,ALLOCATION_MODE_AMOUNT,ALLOCATION_MODE_RATE,ALLOCATION_MODE_SURPLUS,RATE_TOTAL_FULL,ALLOCATION_ERROR_CODES,getScenesByTriggerSource as a200y,getScenesByMode as a200z,getScenesByStrategy as a200A,findSceneById as a200B,inferSceneFromIntent as a200C,getAllScenes as a200D,getScenesCount as a200E,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,getErrorName as a200F,getErrorDescription as a200G}from'./allocation-ledger.js';import{initPuzzleFromIntent as a200H,checkPuzzleCompleteness as a200I,validateConstraints as a200J,generateConfirmationText as a200K,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION}from'./allocation-puzzle.js';import{ALLOCATION_RISK_VERSION,assessAllocationRisks,getAllRiskRules as a200L}from'./allocation-risk.js';import{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,getAllTemplates as a200M,getTemplateById as a200N,getTemplatesByScene as a200O,getTemplatesByIndustry as a200P,suggestTemplateForScene as a200Q,listTemplates as a200R,fillTemplate as a200S}from'./allocation-templates.js';import{RECIPIENT_CONSTRAINT_VERSION,classifyRecipient,analyzeRecipientConstraints,isUnboundSignerTheft,canonicalDoctrine,recipientDesignGuidance,derivePayoffFromSharing,OBJECT_DRIVEABILITY,driveabilityOf,RECIPIENT_DESIGN_OPTIONS}from'./recipient-constraint.js';import{paymentRelations,scanRecentPaymentEvents,resolveBeneficialOwners,extractionPlanForHolder,pendingWrappersAt,trackAccountPayments}from'./payment-tracker.js';import{TREASURY_LEDGER_VERSION,TREASURY_SCENES,TREASURY_PERMISSIONS as a200T,getScenesByHostObject as a200U,findSceneById as a200V,findSceneByPermissionIndex as a200W,getBuiltinPermissionByIndex as a200X,isBuiltinTreasuryPermission,getActiveBuiltinPermissions as a200Y,getReservedBuiltinPermissions as a200Z,inferSceneFromIntent as a200a0,getTreasuryScenesCount,getGovernedOperationsForPermissionIndex as a200a1}from'./treasury-ledger.js';import{initPuzzleFromIntent as a200a2,checkPuzzleCompleteness as a200a3,validateConstraints as a200a4,generateConfirmationText as a200a5,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,MAX_DESCRIPTION_LENGTH as a200a6}from'./treasury-puzzle.js';import{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,getTemplateById as a200a7,getTemplatesByScene as a200a8,getTemplatesByIndustry as a200a9,suggestTemplateForScene as a200aa,listTemplates as a200ab,fillTemplate as a200ac}from'./treasury-templates.js';import{TREASURY_RISK_VERSION,assessTreasuryRisks,getAllTreasuryRiskRules}from'./treasury-risk.js';import{ORDER_LEDGER_VERSION,ORDER_SCENES,ORDER_FIELDS,ORDER_STATES,ORDER_STATE_TRANSITIONS,ORDER_LIFECYCLE_EVENTS,ORDER_PERMISSION_MATRIX,ORDER_AUDIT_FORMULAS,getScenesByOperationField as a200ad,findSceneById as a200ae,findSceneByMoveEntry as a200af,getScenesByPermissionLayer as a200ag,getScenesByReversibility as a200ah,getFieldDef as a200ai,getMutableFields as a200aj,getImmutableFields as a200ak,getFrozenAfterProgressFields as a200al,getOneTimeSetFields as a200am,inferSceneFromIntent as a200an,getEmittedEvents as a200ao,getInferredEvents as a200ap,getOrderScenesCount,sdkToMoveField as a200aq,moveToSdkField as a200ar}from'./order-ledger.js';import{initPuzzleFromIntent as a200as,checkPuzzleCompleteness as a200at,validateConstraints as a200au,generateConfirmationText as a200av,verifySnapshotMechanism as a200aw,inferLifecyclePhase as a200ax,matchSceneFromPuzzle as a200ay,listAllScenes as a200az,lookupScene as a200aA}from'./order-puzzle.js';import{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,getTemplateById as a200aB,getTemplatesByScene as a200aC,getTemplatesByIndustry as a200aD,getTemplatesByPermissionLayer as a200aE,getIrreversibleTemplates as a200aF,suggestTemplateForScene as a200aG,listOrderTemplates,fillTemplate as a200aH,suggestTemplateFromIntent as a200aI,getTemplateParameters as a200aJ,validateTemplateParams as a200aK}from'./order-templates.js';import{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules}from'./order-risk.js';import{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,PROGRESS_PERMISSIONS as a200aL,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,getScenesByPhase as a200aM,findSceneById as a200aN,getScenesByIndustry as a200aO,getBuiltinPermissionByIndex as a200aP,isProgressBuiltinPermission,inferSceneFromIntent as a200aQ,getAllBuiltinPermissions as a200aR,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount}from'./progress-ledger.js';import{initPuzzleFromIntent as a200aS,checkPuzzleCompleteness as a200aT,validateConstraints as a200aU,generateConfirmationText as a200aV,resolveBuiltinPermission as a200aW,isOrderHolderForward,getRelevantDimensions as a200aX}from'./progress-puzzle.js';import{PROGRESS_TEMPLATES,PROGRESS_TEMPLATES_VERSION,getAllProgressTemplates,getProgressTemplateById,getProgressTemplatesByScene,getProgressTemplatesByIndustry,suggestProgressTemplateForScene,listProgressTemplates,fillProgressTemplate}from'./progress-templates.js';import{PROGRESS_RISK_VERSION,assessProgressRisks,getAllProgressRiskRules}from'./progress-risk.js';import{ARBITRATION_LEDGER_VERSION,ARBITRATION_SCENES,ARBITRATION_PERMISSIONS as a200aY,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,getScenesByCategory as a200aZ,findSceneById as a200b0,findSceneByPermissionIndex as a200b1,getPermissionByIndex as a200b2,getPermissionByName as a200b3,isReservedIndex as a200b4,isUsedPermissionIndex as a200b5,getActivePermissionCount as a200b6,inferSceneFromIntent as a200b7,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,getScenesProducingStatus as a200b8,getScenesRequiringStatus as a200b9,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions}from'./arbitration-ledger.js';import{initPuzzleFromIntent as a200ba,checkPuzzleCompleteness as a200bb,validateConstraints as a200bc,generateConfirmationText as a200bd}from'./arbitration-puzzle.js';import{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,getAllTemplates as a200be,getTemplateById as a200bf,getTemplatesByScene as a200bg,getTemplatesByIndustry as a200bh,suggestTemplateForScene as a200bi,listTemplates as a200bj,fillTemplate as a200bk}from'./arbitration-templates.js';import{ARBITRATION_RISK_VERSION,assessArbitrationRisks,getAllRiskRules as a200bl}from'./arbitration-risk.js';import{REWARD_LEDGER_VERSION,REWARD_SCENES,REWARD_PERMISSIONS,REWARD_FIELDS,REWARD_GUARD_CONSTRUCTORS,REWARD_ERROR_CODES,REWARD_CROSS_OBJECT_REFS,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,getScenesByPhase as a200bm,findSceneById as a200bn,getScenesByIndustry as a200bo,getBuiltinPermissionByIndex as a200bp,isRewardBuiltinPermission,getAllBuiltinPermissions as a200bq,getRewardScenesCount,getGuardConstructorSpec as a200br,resolveGuardConstructor as a200bs,getRewardErrorByCode,getRewardErrorByName,validateGuardCount as a200bt,validateRecordCount as a200bu,inferSceneFromIntent as a200bv}from'./reward-ledger.js';import{REWARD_FIELD_MUTABILITY,initPuzzleFromIntent as a200bw,checkPuzzleCompleteness as a200bx,validateConstraints as a200by,generateConfirmationText as a200bz,resolveBuiltinPermission as a200bA,requiresGuardConfig as a200bB,requiresPassport as a200bC,getRelevantDimensions as a200bD,getFieldMutability as a200bE,isAdminMutableField as a200bF,getFieldPermissionIndex as a200bG}from'./reward-puzzle.js';import{REWARD_RISK_VERSION,assessRewardRisks,getAllRewardRiskRules}from'./reward-risk.js';import{PASSPORT_LEDGER_VERSION,PASSPORT_ERROR_CODES,PASSPORT_SCENARIOS,MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT,getAllScenarios as a200bH,getScenariosCount as a200bI,findScenarioById as a200bJ,getScenariosByConsumer as a200bK,getScenariosUsingRelies as a200bL,inferScenarioFromIntent as a200bM,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,getErrorName as a200bN,getErrorDescription as a200bO}from'./passport-ledger.js';import{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,getAllTemplates as a200bP,getTemplateById as a200bQ,getTemplatesByScenario as a200bR,getTemplatesByIndustry as a200bS,suggestTemplateForScenario as a200bT,listTemplates as a200bU,fillTemplate as a200bV}from'./passport-templates.js';import{PROOF_RISK_RULES,checkProofRisks}from'./proof-risk.js';import{REPOSITORY_RISK_RULES,checkRepositoryRisks,parseIdFromForRiskCheck}from'./repository-risk.js';import{DEMAND_RISK_RULES,checkDemandRisks}from'./demand-risk.js';import{CONTACT_RISK_RULES,CONTACT_RISK_VERSION,checkContactRisks}from'./contact-risk.js';import{RESOURCE_RISK_RULES,RESOURCE_RISK_VERSION,checkResourceRisks}from'./resource-risk.js';import{PAYMENT_RISK_RULES,PAYMENT_RISK_VERSION,checkPaymentRisks}from'./payment-risk.js';import{ARB_RISK_RULES,ARB_RISK_VERSION,checkArbRisks}from'./arb-risk.js';import{PERSONAL_RISK_RULES,PERSONAL_RISK_VERSION,checkPersonalRisks}from'./personal-risk.js';import{UTIL_RISK_RULES,UTIL_RISK_VERSION,checkUtilRisks}from'./util-risk.js';import{REGISTRAR_RISK_RULES,REGISTRAR_RISK_VERSION,checkRegistrarRisks}from'./registrar-risk.js';import{BRIDGE_RISK_RULES,BRIDGE_RISK_VERSION,checkBridgeRisks}from'./bridge-risk.js';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'./tools-reference.js';import{SCENARIO_MODES,SCENARIO_MODES_VERSION,MODE_COMPOSITIONS,matchScenarioMode,inferScenarioTraits,getScenarioMode,listScenarioModes,getShippedModes,getModeCompositions}from'./scenario-modes.js';import{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION,getBuiltinTemplate,listBuiltinTemplates,TEMPLATE_KEYWORDS}from'./builtin-templates.js';import{resolveTemplatesDir,seedBuiltinTemplates,reloadTemplates,listTemplates,getTemplate,getTemplatesByIndustry as a200bW,parseTemplateFile,renderTemplateFile,loadAndValidate,TemplateFrontmatterSchema}from'./template-loader.js';import{scanTemplate}from'./template-scanner.js';import{GUARD_DESIGN_PATTERNS,GUARD_DESIGN_PATTERNS_VERSION,VERIFIER_LEVEL_GUIDANCE,getGuardDesignPattern,searchGuardDesignPatterns,getPatternsByHost,getPatternsByIndustry,getPatternsByDataSourceClass,getVerifierLevelGuidance,suggestPatternForRequirement}from'./guard-design-patterns.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,classifyTool,NAMING_CONVENTIONS,checkObjectReuseRules,checkImmutabilityRules};export{TOOL_CONSTRAINTS,TOOL_CONSTRAINTS_VERSION,validateOperation,hasBlockingViolations,getWarningViolations};export{REWARD_TEMPLATES,REWARD_TEMPLATES_VERSION,getRewardTemplate,listRewardTemplates,suggestRewardTemplate};export{AUDIT_RULES,AUDIT_RULES_VERSION,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings};export{suggestPricing,MUTABLE_FIELDS,DYNAMIC_PRICING_VERSION};export{computeReviewStats,isVerifiedReview,filterVerifiedReviews,detectReviewManipulation,REPUTATION_RULES_VERSION};export{INDUSTRY_FLYWHEELS,getFlywheelForIndustry,listIndustries,suggestAcquisitionActions,generateTrustDescription,buildAcquisitionDashboard,ACQUISITION_FLYWHEEL_VERSION};export{STRATEGY_MANUAL_FILENAME,STRATEGY_MANUAL_VERSION,renderStrategyManual,parseManualSentinel,classifyManualFile,getBuiltinStrategyManual,listBuiltinStrategyManualIndustries}from'./strategy-manuals.js';export{INDUSTRY_STRATEGIES,getIndustryStrategy,listIndustryStrategies,registerIndustryStrategy,unregisterIndustryStrategy,recommendStrategy,stageFromOrderCount,validateStrategyLevers}from'./industry-strategy.js';export{INDUSTRY_REGISTRY_VERSION,getIndustryProfile,listIndustries as listRegistryIndustries,registerIndustry,getIndustryTraits,resolveIndustryName,isRegisteredIndustry,getRegistrySize,listBuiltinIndustryNames};export{DEFAULT_TRAITS,inferTraitsFromDescription,synthesizeProfile,findSimilarIndustries,composeIndustries,INDUSTRY_REQUIRED_TRAITS,DOMAIN_PRIORS,detectDomainPriors,traitContradictions,filterConsistentIndustries};export{INDUSTRY_EVOLUTION_THRESHOLDS,aggregateIndustryMetrics,evaluateIndustryHealth,suggestIndustryUpdate,applyIndustryUpdate,runIndustryHealthPipeline};export{FLYWHEEL_LOOP_VERSION,FLYWHEEL_LOOP_MIN_SIGNALS,recordIndustrySignal,updateIndustryCognition,injectEvolutionContext};export{BUILTIN_INTENT_SPECS,registerIntentProfile,getIntentProfile,listIntents,evaluateIndustryHealthByIntent,suggestIndustryUpdateByIntent,evaluateIndustryHealthMultiIntent,getRoleAdvice,filterSuggestionsByRole};export{GUARD_SCENES,findScene,inferSceneFromAction,getImmutableScenes,getNumericIdentifierScenes};export{SEMANTIC_TO_SCHEMA_RULES,SCHEMA_TO_SEMANTIC_RULES,GUARD_CONSTRAINT_RULES,matchSemanticPattern,explainNode,explainWitness,getConstraintsByCategory};export{checkPuzzleCompleteness,generateConfirmationText,initPuzzleFromIntent,inferBindingFromAction,emptyDataSources,getWitnessInfo,WITNESS_NAME_MAP};export{runGuardRulePack,assembleGuardAssessment,evaluateGuardDraft,getRiskRulesCount,GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT,getTemplatesByScene,getTemplateById,getTemplatesByIndustry,getTemplatesByPattern,listGuardTemplates,suggestTemplateForScene,getTemplateParameters,validateTemplateParams,GUARD_BINDING_REGISTRY,GUARD_BINDINGS_VERSION,OWNER_RECEIVE_COGNITION,getGuardBindingsByObject,getGuardBinding,summarizeGuardBinding,SCENARIO_BRIDGE_REGISTRY,SCENARIO_CHAINS,SCENARIO_TOPOLOGY_VERSION,getBridgeById,getBridgeByCode,getBridgesByObject,getBridgesForEdge,detectBridgesForEdges,getChainById,summarizeBridge,detectBridgesForObjects,lintGuard,autoFixGuard,isGuardReady,getGuardErrors,formatLintResult};export{MACHINE_SCENES,MACHINE_LEDGER_VERSION,MACHINE_SCENES_COUNT,a200a as findMachineScene,a200b as getMachineScenesByIndustry,getScenesByPattern,inferSceneFromFlow};export{MACHINE_TEMPLATES,MACHINE_TEMPLATES_VERSION,MACHINE_TEMPLATES_COUNT,a200c as getAllMachineTemplates,a200d as getMachineTemplateById,a200e as getMachineTemplatesByScene,a200f as getMachineTemplatesByIndustry,suggestTemplateForIntent,walkDecisionTree,a200g as fillMachineTemplate,a200h as forkMachineTemplate,verifyTemplateSceneReferences,getReferencedGuardTemplateIds,getReferencedRiskIds};export{SEMANTIC_TO_MACHINE_RULES,MACHINE_CONSTRAINT_RULES,MACHINE_TRANSLATION_VERSION,MACHINE_PATTERNS_COUNT,MACHINE_CONSTRAINTS_COUNT,a200i as matchMachinePattern,identifyExecutionMode,identifyTopology,explainForwardPermission,a200j as getMachineConstraintsByCategory,getConstraintById,a200k as getOnChainMachineConstraints,a200l as getOffChainMachineConstraints};export{MACHINE_RISK_RULES,MACHINE_RISK_VERSION,assessMachineRisks};export{analyzeTopology,identifyTopologyPattern,formatTopologySummary,MACHINE_TOPOLOGY_VERSION,MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT};export{a200m as initMachinePuzzleFromIntent,initPuzzleFromTemplate,a200n as checkMachinePuzzleCompleteness,a200o as recommendMachineNextStep,derivePuzzleFromMachineJson,a200p as generateMachineConfirmationText,MACHINE_PUZZLE_VERSION};export{SERVICE_SCENES,SERVICE_LEDGER_VERSION,SERVICE_PERMISSIONS,SERVICE_ORDER_FLOW_STAGES,SERVICE_CROSS_OBJECT_BINDINGS,a200q as getServiceScenesByCategory,a200r as findServiceSceneById,getServicePermissionByIndex,isServicePermission,getPermissionsByMutability,getImmutablePostPublishPermissions,getLockedByDurationPermissions,a200s as inferServiceSceneFromIntent,getAllServiceScenes,getServiceScenesCount,getServicePermissionsCount,getOrderFlowStage,a200t as getServiceCrossObjectBindings};export{a200u as initServicePuzzleFromIntent,a200v as checkServicePuzzleCompleteness,a200w as validateServiceConstraints,a200x as generateServicePuzzleConfirmationText,initOrderFlowPuzzle,checkOrderFlowCompleteness};export{SERVICE_RISK_VERSION,assessServiceRisks,getAllServiceRiskRules};export{SERVICE_TEMPLATES,SERVICE_TEMPLATES_VERSION,getServiceTemplateById,getServiceTemplatesByScene,getServiceTemplatesByIndustry,suggestServiceTemplateForScene,listServiceTemplates,fillServiceTemplate,getAllServiceTemplates};export{ALLOCATION_SCENES,ALLOCATION_LEDGER_VERSION,MAX_ALLOCATOR_COUNT,ALLOCATION_MAX_SHARING_COUNT,ALLOCATION_MODE_AMOUNT,ALLOCATION_MODE_RATE,ALLOCATION_MODE_SURPLUS,RATE_TOTAL_FULL,ALLOCATION_ERROR_CODES,a200y as getAllocationScenesByTriggerSource,a200z as getAllocationScenesByMode,a200A as getAllocationScenesByStrategy,a200B as findAllocationSceneById,a200C as inferAllocationSceneFromIntent,a200D as getAllAllocationScenes,a200E as getAllocationScenesCount,allocationModeToNumber,allocationModeFromNumber,getRecipientType,isSignerRecipient,isEntityRecipient,isGuardIdentifierRecipient,a200F as getAllocationErrorName,a200G as getAllocationErrorDescription};export{a200H as initAllocationPuzzleFromIntent,a200I as checkAllocationPuzzleCompleteness,a200J as validateAllocationConstraints,a200K as generateAllocationPuzzleConfirmationText,buildDefaultAllocFlow,buildDefaultRecipientRules,buildDefaultLogicPuzzle,ALLOCATION_PUZZLE_VERSION};export{ALLOCATION_RISK_VERSION,assessAllocationRisks,a200L as getAllAllocationRiskRules};export{ALLOCATION_TEMPLATES,ALLOCATION_TEMPLATES_VERSION,a200M as getAllAllocationTemplates,a200N as getAllocationTemplateById,a200O as getAllocationTemplatesByScene,a200P as getAllocationTemplatesByIndustry,a200Q as suggestAllocationTemplateForScene,a200R as listAllocationTemplates,a200S as fillAllocationTemplate};export{RECIPIENT_CONSTRAINT_VERSION,classifyRecipient,analyzeRecipientConstraints,isUnboundSignerTheft,canonicalDoctrine,recipientDesignGuidance,derivePayoffFromSharing,OBJECT_DRIVEABILITY,driveabilityOf,RECIPIENT_DESIGN_OPTIONS};export{paymentRelations,scanRecentPaymentEvents,resolveBeneficialOwners,extractionPlanForHolder,pendingWrappersAt,trackAccountPayments};export{TREASURY_LEDGER_VERSION,TREASURY_SCENES,a200T as TREASURY_BUILTIN_PERMISSIONS,a200U as getTreasuryScenesByHostObject,a200V as findTreasurySceneById,a200W as findTreasurySceneByPermissionIndex,a200X as getTreasuryBuiltinPermissionByIndex,isBuiltinTreasuryPermission,a200Y as getActiveTreasuryBuiltinPermissions,a200Z as getReservedTreasuryBuiltinPermissions,a200a0 as inferTreasurySceneFromIntent,getTreasuryScenesCount,a200a1 as getTreasuryGovernedOperationsForPermissionIndex};export{a200a2 as initTreasuryPuzzleFromIntent,a200a3 as checkTreasuryPuzzleCompleteness,a200a4 as validateTreasuryConstraints,a200a5 as generateTreasuryPuzzleConfirmationText,MAX_EXTERNAL_DEPOSIT_GUARD_COUNT,MAX_EXTERNAL_WITHDRAW_GUARD_COUNT,a200a6 as TREASURY_MAX_DESCRIPTION_LENGTH};export{TREASURY_TEMPLATES,TREASURY_TEMPLATES_VERSION,getAllTreasuryTemplates,a200a7 as getTreasuryTemplateById,a200a8 as getTreasuryTemplatesByScene,a200a9 as getTreasuryTemplatesByIndustry,a200aa as suggestTreasuryTemplateForScene,a200ab as listTreasuryTemplates,a200ac as fillTreasuryTemplate};export{TREASURY_RISK_VERSION,assessTreasuryRisks,getAllTreasuryRiskRules};export{ORDER_LEDGER_VERSION,ORDER_SCENES,ORDER_FIELDS,ORDER_STATES,ORDER_STATE_TRANSITIONS,ORDER_LIFECYCLE_EVENTS,ORDER_PERMISSION_MATRIX,ORDER_AUDIT_FORMULAS,a200ad as getOrderScenesByOperationField,a200ae as findOrderSceneById,a200af as findOrderSceneByMoveEntry,a200ag as getOrderScenesByPermissionLayer,a200ah as getOrderScenesByReversibility,a200ai as getOrderFieldDef,a200aj as getOrderMutableFields,a200ak as getOrderImmutableFields,a200al as getOrderFrozenAfterProgressFields,a200am as getOrderOneTimeSetFields,a200an as inferOrderSceneFromIntent,a200ao as getOrderEmittedEvents,a200ap as getOrderInferredEvents,getOrderScenesCount,a200aq as sdkToMoveOrderField,a200ar as moveToSdkOrderField};export{a200as as initOrderPuzzleFromIntent,a200at as checkOrderPuzzleCompleteness,a200au as validateOrderConstraints,a200av as generateOrderPuzzleConfirmationText,a200aw as verifyOrderSnapshotMechanism,a200ax as inferOrderLifecyclePhase,a200ay as matchOrderSceneFromPuzzle,a200az as listAllOrderScenes,a200aA as lookupOrderScene};export{ORDER_TEMPLATES,ORDER_TEMPLATES_VERSION,ORDER_TEMPLATES_COUNT,getAllOrderTemplates,a200aB as getOrderTemplateById,a200aC as getOrderTemplatesByScene,a200aD as getOrderTemplatesByIndustry,a200aE as getOrderTemplatesByPermissionLayer,a200aF as getIrreversibleOrderTemplates,a200aG as suggestOrderTemplateForScene,listOrderTemplates,a200aH as fillOrderTemplate,a200aI as suggestOrderTemplateFromIntent,a200aJ as getOrderTemplateParameters,a200aK as validateOrderTemplateParams};export{ORDER_RISK_VERSION,assessOrderRisks,getAllOrderRiskRules};export{PROGRESS_LEDGER_VERSION,PROGRESS_SCENES,a200aL as PROGRESS_BUILTIN_PERMISSIONS,PROGRESS_NEW,PROGRESS_NAMED_OPERATOR,PROGRESS_TASK,PROGRESS_CONTEXT_REPOSITORY,PROGRESS_UNHOLD,PROGRESS_OWNER_RECEIVE,PROGRESS_CROSS_OBJECT_REFS,a200aM as getProgressScenesByPhase,a200aN as findProgressSceneById,a200aO as getProgressScenesByIndustry,a200aP as getProgressBuiltinPermissionByIndex,isProgressBuiltinPermission,a200aQ as inferProgressSceneFromIntent,a200aR as getAllProgressBuiltinPermissions,getProgressScenesCount,validateNamedOperatorAddressList,validateNamedOperatorCount,validateContextRepositoryCount};export{a200aS as initProgressPuzzleFromIntent,a200aT as checkProgressPuzzleCompleteness,a200aU as validateProgressConstraints,a200aV as generateProgressPuzzleConfirmationText,a200aW as resolveProgressBuiltinPermission,isOrderHolderForward,a200aX as getProgressRelevantDimensions};export{PROGRESS_TEMPLATES,PROGRESS_TEMPLATES_VERSION,getAllProgressTemplates,getProgressTemplateById,getProgressTemplatesByScene,getProgressTemplatesByIndustry,suggestProgressTemplateForScene,listProgressTemplates,fillProgressTemplate};export{PROGRESS_RISK_VERSION,assessProgressRisks,getAllProgressRiskRules};export{ARBITRATION_LEDGER_VERSION,ARBITRATION_SCENES,a200aY as ARBITRATION_BUILTIN_PERMISSIONS,ARB_STATUS_CODE,ARB_TERMINAL_STATUSES,ARB_STATUS_ALIASES,DUAL_GUARD_MATRIX,a200aZ as getArbitrationScenesByCategory,a200b0 as findArbitrationSceneById,a200b1 as findArbitrationSceneByPermissionIndex,a200b2 as getArbitrationPermissionByIndex,a200b3 as getArbitrationPermissionByName,a200b4 as isArbitrationReservedIndex,a200b5 as isArbitrationUsedPermissionIndex,a200b6 as getArbitrationActivePermissionCount,a200b7 as inferArbitrationSceneFromIntent,getDualGuardMatrixEntry,isValidArbStatusTransition,isTerminalArbStatus,a200b8 as getArbitrationScenesProducingStatus,a200b9 as getArbitrationScenesRequiringStatus,getArbitrationScenesCount,getAllArbitrationPermissions,getActiveArbitrationPermissions};export{a200ba as initArbitrationPuzzleFromIntent,a200bb as checkArbitrationPuzzleCompleteness,a200bc as validateArbitrationConstraints,a200bd as generateArbitrationPuzzleConfirmationText};export{ARBITRATION_TEMPLATES,ARBITRATION_TEMPLATES_VERSION,a200be as getAllArbitrationTemplates,a200bf as getArbitrationTemplateById,a200bg as getArbitrationTemplatesByScene,a200bh as getArbitrationTemplatesByIndustry,a200bi as suggestArbitrationTemplateForScene,a200bj as listArbitrationTemplates,a200bk as fillArbitrationTemplate};export{ARBITRATION_RISK_VERSION,assessArbitrationRisks,a200bl as getAllArbitrationRiskRules};export{REWARD_LEDGER_VERSION,REWARD_SCENES,REWARD_PERMISSIONS,REWARD_FIELDS,REWARD_GUARD_CONSTRUCTORS,REWARD_ERROR_CODES,REWARD_CROSS_OBJECT_REFS,MAX_GUARD_COUNT_REWARD,MAX_RECORD_COUNT_REWARD,a200bm as getRewardScenesByPhase,a200bn as findRewardSceneById,a200bo as getRewardScenesByIndustry,a200bp as getRewardBuiltinPermissionByIndex,isRewardBuiltinPermission,a200bq as getAllRewardBuiltinPermissions,getRewardScenesCount,a200br as getRewardGuardConstructorSpec,a200bs as resolveRewardGuardConstructor,getRewardErrorByCode,getRewardErrorByName,a200bt as validateRewardGuardCount,a200bu as validateRewardRecordCount,a200bv as inferRewardSceneFromIntent};export{REWARD_FIELD_MUTABILITY,a200bw as initRewardPuzzleFromIntent,a200bx as checkRewardPuzzleCompleteness,a200by as validateRewardConstraints,a200bz as generateRewardPuzzleConfirmationText,a200bA as resolveRewardBuiltinPermission,a200bB as requiresRewardGuardConfig,a200bC as requiresRewardPassport,a200bD as getRewardRelevantDimensions,a200bE as getRewardFieldMutability,a200bF as isRewardAdminMutableField,a200bG as getRewardFieldPermissionIndex};export{REWARD_RISK_VERSION,assessRewardRisks,getAllRewardRiskRules};export{PASSPORT_LEDGER_VERSION,PASSPORT_ERROR_CODES,PASSPORT_SCENARIOS,MAX_GUARD_COUNT_PASSPORT,MAX_SUBMISSION_SIZE_PASSPORT,a200bH as getAllPassportScenarios,a200bI as getPassportScenesCount,a200bJ as findPassportScenarioById,a200bK as getPassportScenariosByConsumer,a200bL as getPassportScenariosUsingRelies,a200bM as inferPassportScenarioFromIntent,impackRoleFromBoolean,impackRoleToBoolean,reliesLogicFromBoolean,reliesLogicToBoolean,a200bN as getPassportErrorName,a200bO as getPassportErrorDescription};export{PASSPORT_TEMPLATES,PASSPORT_TEMPLATES_VERSION,a200bP as getAllPassportTemplates,a200bQ as getPassportTemplateById,a200bR as getPassportTemplatesByScenario,a200bS as getPassportTemplatesByIndustry,a200bT as suggestPassportTemplateForScenario,a200bU as listPassportTemplates,a200bV as fillPassportTemplate};export{PROOF_RISK_RULES,checkProofRisks};export{REPOSITORY_RISK_RULES,checkRepositoryRisks,parseIdFromForRiskCheck};export{assessEvidenceReview,reviewEvidenceList}from'./evidence-review.js';export{DEMAND_RISK_RULES,checkDemandRisks};export{CONTACT_RISK_RULES,CONTACT_RISK_VERSION,checkContactRisks};export{RESOURCE_RISK_RULES,RESOURCE_RISK_VERSION,checkResourceRisks};export{PAYMENT_RISK_RULES,PAYMENT_RISK_VERSION,checkPaymentRisks};export{ARB_RISK_RULES,ARB_RISK_VERSION,checkArbRisks};export{PERSONAL_RISK_RULES,PERSONAL_RISK_VERSION,checkPersonalRisks};export{UTIL_RISK_RULES,UTIL_RISK_VERSION,checkUtilRisks};export{REGISTRAR_RISK_RULES,REGISTRAR_RISK_VERSION,checkRegistrarRisks};export{BRIDGE_RISK_RULES,BRIDGE_RISK_VERSION,checkBridgeRisks};export{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence};export{SCENARIO_MODES,SCENARIO_MODES_VERSION,MODE_COMPOSITIONS,matchScenarioMode,inferScenarioTraits,getScenarioMode,listScenarioModes,getShippedModes,getModeCompositions};export{BUILTIN_TEMPLATES,BUILTIN_TEMPLATES_VERSION,getBuiltinTemplate,listBuiltinTemplates,TEMPLATE_KEYWORDS};export{resolveTemplatesDir,seedBuiltinTemplates,reloadTemplates,listTemplates,getTemplate,a200bW as getIndustryTemplates,parseTemplateFile,renderTemplateFile,loadAndValidate,TemplateFrontmatterSchema};export{scanTemplate};export{GUARD_DESIGN_PATTERNS,GUARD_DESIGN_PATTERNS_VERSION,VERIFIER_LEVEL_GUIDANCE,getGuardDesignPattern,searchGuardDesignPatterns,getPatternsByHost,getPatternsByIndustry,getPatternsByDataSourceClass,getVerifierLevelGuidance,suggestPatternForRequirement};export function getKnowledgeBase(){return{'version':{'safety':SAFETY_RULES_VERSION,'tool_constraints':TOOL_CONSTRAINTS_VERSION,'reward_templates':REWARD_TEMPLATES_VERSION,'audit_rules':AUDIT_RULES_VERSION,'dynamic_pricing':DYNAMIC_PRICING_VERSION,'reputation_rules':REPUTATION_RULES_VERSION,'acquisition_flywheel':ACQUISITION_FLYWHEEL_VERSION,'industry_registry':INDUSTRY_REGISTRY_VERSION,'flywheel_loop':FLYWHEEL_LOOP_VERSION,'machine_ledger':MACHINE_LEDGER_VERSION,'machine_templates':MACHINE_TEMPLATES_VERSION,'machine_translation':MACHINE_TRANSLATION_VERSION,'machine_risk':MACHINE_RISK_VERSION,'machine_topology':MACHINE_TOPOLOGY_VERSION,'machine_puzzle':MACHINE_PUZZLE_VERSION,'service_ledger':SERVICE_LEDGER_VERSION,'service_risk':SERVICE_RISK_VERSION,'service_templates':SERVICE_TEMPLATES_VERSION,'allocation_ledger':ALLOCATION_LEDGER_VERSION,'allocation_puzzle':ALLOCATION_PUZZLE_VERSION,'allocation_risk':ALLOCATION_RISK_VERSION,'allocation_templates':ALLOCATION_TEMPLATES_VERSION,'treasury_ledger':TREASURY_LEDGER_VERSION,'treasury_templates':TREASURY_TEMPLATES_VERSION,'treasury_risk':TREASURY_RISK_VERSION,'order_ledger':ORDER_LEDGER_VERSION,'order_templates':ORDER_TEMPLATES_VERSION,'order_risk':ORDER_RISK_VERSION,'progress_ledger':PROGRESS_LEDGER_VERSION,'progress_templates':PROGRESS_TEMPLATES_VERSION,'progress_risk':PROGRESS_RISK_VERSION,'arbitration_ledger':ARBITRATION_LEDGER_VERSION,'arbitration_templates':ARBITRATION_TEMPLATES_VERSION,'arbitration_risk':ARBITRATION_RISK_VERSION,'reward_ledger':REWARD_LEDGER_VERSION,'reward_risk':REWARD_RISK_VERSION,'passport_ledger':PASSPORT_LEDGER_VERSION,'passport_templates':PASSPORT_TEMPLATES_VERSION,'contact_risk':CONTACT_RISK_VERSION,'resource_risk':RESOURCE_RISK_VERSION,'payment_risk':PAYMENT_RISK_VERSION,'arb_risk':ARB_RISK_VERSION,'personal_risk':PERSONAL_RISK_VERSION,'util_risk':UTIL_RISK_VERSION,'registrar_risk':REGISTRAR_RISK_VERSION,'bridge_risk':BRIDGE_RISK_VERSION,'scenario_modes':SCENARIO_MODES_VERSION,'guard_design_patterns':GUARD_DESIGN_PATTERNS_VERSION,'builtin_templates':BUILTIN_TEMPLATES_VERSION},'confirmation_rules':CONFIRMATION_RULES['length'],'confirmation_rule_ids':CONFIRMATION_RULES['map'](a=>a['id']),'tool_constraints_count':TOOL_CONSTRAINTS['length'],'reward_templates_count':REWARD_TEMPLATES['length'],'audit_rules_count':AUDIT_RULES['length'],'mutable_fields_count':MUTABLE_FIELDS['length'],'industry_flywheels_count':INDUSTRY_FLYWHEELS['length'],'industry_registry_count':getRegistrySize(),'intent_count':listIntents()['length'],'guard_scenes_count':GUARD_SCENES['length'],'guard_semantic_rules_count':SEMANTIC_TO_SCHEMA_RULES['length'],'guard_schema_rules_count':SCHEMA_TO_SEMANTIC_RULES['length'],'guard_constraint_rules_count':GUARD_CONSTRAINT_RULES['length'],'guard_risk_rules_count':getRiskRulesCount(),'guard_templates_count':GUARD_TEMPLATES_COUNT,'guard_lint_enabled':!![],'machine_scenes_count':MACHINE_SCENES_COUNT,'machine_templates_count':MACHINE_TEMPLATES['length'],'machine_patterns_count':SEMANTIC_TO_MACHINE_RULES['length'],'machine_constraint_rules_count':MACHINE_CONSTRAINT_RULES['length'],'machine_risk_rules_count':MACHINE_RISK_RULES['length'],'machine_on_chain_limits':{'max_node_count':MAX_NODE_COUNT,'max_node_pair_count':MAX_NODE_PAIR_COUNT,'max_forward_count':MAX_FORWARD_COUNT},'service_scenes_count':SERVICE_SCENES['length'],'service_permissions_count':SERVICE_PERMISSIONS['length'],'service_order_flow_stages_count':SERVICE_ORDER_FLOW_STAGES['length'],'service_cross_object_bindings_count':SERVICE_CROSS_OBJECT_BINDINGS['length'],'service_risk_rules_count':getAllServiceRiskRules()['length'],'service_templates_count':SERVICE_TEMPLATES['length'],'service_context_enabled':!![],'allocation_scenes_count':ALLOCATION_SCENES['length'],'allocation_risk_rules_count':a200L()['length'],'allocation_templates_count':ALLOCATION_TEMPLATES['length'],'allocation_context_enabled':!![],'treasury_scenes_count':TREASURY_SCENES['length'],'treasury_builtin_permissions_count':a200T['length'],'treasury_risk_rules_count':getAllTreasuryRiskRules()['length'],'treasury_templates_count':TREASURY_TEMPLATES['length'],'treasury_context_enabled':!![],'order_scenes_count':ORDER_SCENES['length'],'order_fields_count':ORDER_FIELDS['length'],'order_states_count':ORDER_STATES['length'],'order_lifecycle_events_count':ORDER_LIFECYCLE_EVENTS['length'],'order_risk_rules_count':getAllOrderRiskRules()['length'],'order_templates_count':ORDER_TEMPLATES['length'],'order_context_enabled':!![],'progress_scenes_count':PROGRESS_SCENES['length'],'progress_builtin_permissions_count':a200aL['length'],'progress_risk_rules_count':getAllProgressRiskRules()['length'],'progress_templates_count':PROGRESS_TEMPLATES['length'],'progress_context_enabled':!![],'arbitration_scenes_count':ARBITRATION_SCENES['length'],'arbitration_builtin_permissions_count':a200aY['length'],'arbitration_risk_rules_count':a200bl()['length'],'arbitration_templates_count':ARBITRATION_TEMPLATES['length'],'arbitration_context_enabled':!![],'reward_scenes_count':REWARD_SCENES['length'],'reward_builtin_permissions_count':REWARD_PERMISSIONS['length'],'reward_fields_count':REWARD_FIELDS['length'],'reward_guard_constructors_count':REWARD_GUARD_CONSTRUCTORS['length'],'reward_error_codes_count':REWARD_ERROR_CODES['length'],'reward_risk_rules_count':getAllRewardRiskRules()['length'],'reward_context_enabled':!![],'passport_scenarios_count':PASSPORT_SCENARIOS['length'],'passport_max_guard_count':MAX_GUARD_COUNT_PASSPORT,'passport_max_submission_size':MAX_SUBMISSION_SIZE_PASSPORT,'passport_templates_count':PASSPORT_TEMPLATES['length'],'passport_context_enabled':!![],'proof_risk_rules_count':PROOF_RISK_RULES['length'],'repository_risk_rules_count':REPOSITORY_RISK_RULES['length'],'demand_risk_rules_count':DEMAND_RISK_RULES['length'],'contact_risk_rules_count':CONTACT_RISK_RULES['length'],'resource_risk_rules_count':RESOURCE_RISK_RULES['length'],'payment_risk_rules_count':PAYMENT_RISK_RULES['length'],'arb_risk_rules_count':ARB_RISK_RULES['length'],'personal_risk_rules_count':PERSONAL_RISK_RULES['length'],'util_risk_rules_count':UTIL_RISK_RULES['length'],'registrar_risk_rules_count':REGISTRAR_RISK_RULES['length'],'bridge_risk_rules_count':BRIDGE_RISK_RULES['length'],'tools_reference_count':TOOLS_REFERENCE['length'],'scenario_modes_count':SCENARIO_MODES['length'],'scenario_mode_compositions_count':MODE_COMPOSITIONS['length'],'builtin_templates_count':BUILTIN_TEMPLATES['length'],'guard_design_patterns_count':GUARD_DESIGN_PATTERNS['length'],'verifier_level_guidance_count':VERIFIER_LEVEL_GUIDANCE['length']};}export{buildWorkflowGuidance,buildWorkflowReceipt,enrichWorkflowGuidance,mergeGuidanceIntoOutput,resolvePermissionRole,resolveLocalNamesFor,listLocalAccounts,accountCanExecuteForward,enumerateActionableForwards,forwardOperatorKind};export{buildWorkspaceLists}from'./workspace-lists.js';export{resolveSupplyChainGraph}from'./supply-chain.js';export{enumerateObjectOperations,operationCategoryOf,operationComplexityOf,isPermissionIndexType}from'./operation-dictionary.js';export{enumerateServices,enumerateDemands,enumerateArbs}from'./jsonrpc-enum.js';export{FIELD_MUTABILITY_RULES,LOCK_CONSTRAINTS,IRREVERSIBLE_OPERATIONS,STATE_MACHINE_TERMINALS,NUMERIC_LIMIT_CONSTRAINTS,EXTERNAL_ACCESS_MECHANISMS,fieldMutabilityOf,isActionForbidden,lockConstraintOf,numericLimitOf,externalAccessOf}from'./contract-invariants.js';export{GUARD_FIELD_COGNITION_VERSION,GUARD_FIELD_SITES,VALUE_ORIGIN_SEMANTICS,GUARD_PASSPORT_DOCTRINE,guardSitesFor,guardCognitionDoctrine,REPOSITORY_WRITE_ROUTE_MATRIX,repositoryRouteSlotConflicts}from'./guard-field-cognition.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFlywheelForIndustry,listIndustries as
|
|
1
|
+
import{getFlywheelForIndustry,listIndustries as a203a,_setRegistryLookup as a203b}from'./acquisition-flywheel.js';import{getIndustryRiskChecks,getIndustryNeeds,getIndustryTemplate,SUPPORTED_INDUSTRIES}from'../customer/index.js';import{_setRegistryLookup as a203c}from'../customer/industry-risks.js';import{_setRegistryLookup as a203d}from'../customer/user-preferences.js';export function isRegisteredIndustry(a){if(!a)return![];const b=resolveIndustryName(a)??a['toLowerCase']();return b==='general'||registry['has'](b);}const BUILTIN_TRAITS={'freelance':{'has_logistics':![],'communication_heavy':!![],'pure_digital':!![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'high','consumption_frequency':'occasional','avg_ticket_size':'medium'},'rental':{'has_logistics':!![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':!![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'high','consumption_frequency':'occasional','avg_ticket_size':'medium'},'education':{'has_logistics':![],'communication_heavy':!![],'pure_digital':![],'long_cycle':!![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'medium','trust_sensitivity':'high','consumption_frequency':'one_time','avg_ticket_size':'large'},'travel':{'has_logistics':!![],'communication_heavy':!![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':!![],'regulatory_intensity':'medium','trust_sensitivity':'high','consumption_frequency':'one_time','avg_ticket_size':'large'},'subscription':{'has_logistics':![],'communication_heavy':![],'pure_digital':!![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'frequent','avg_ticket_size':'small'},'retail':{'has_logistics':!![],'communication_heavy':![],'pure_digital':![],'long_cycle':![],'deposit_required':![],'multi_tier_allocation':![],'regulatory_intensity':'low','trust_sensitivity':'medium','consumption_frequency':'frequent','avg_ticket_size':'small'}},BUILTIN_DISPLAY_NAMES={'freelance':'Freelance','rental':'Rental','education':'Education','travel':'Travel','subscription':'Subscription','retail':'Retail','general':'General','custom':'Custom'},INDUSTRY_ALIASES={'outsourcing':'freelance','design':'freelance','development':'freelance','consulting':'freelance','rent':'rental','lease':'rental','course':'education','training':'education','tourism':'travel','itinerary':'travel','membership':'subscription','ecommerce':'retail','goods':'retail','freelancer':'freelance','gig':'freelance','edu':'education','trip':'travel','tour':'travel','subscribe':'subscription','shop':'retail','general_industry':'general','amazon':'retail','etsy':'retail','upwork':'freelance','fiverr':'freelance','contra':'freelance','airbnb':'rental','ziroom':'rental','turo':'rental','getaround':'rental','coursera':'education','udemy':'education','yuanfudao':'education','booking':'travel','klook':'travel','patreon':'subscription','onlyfans':'subscription','substack':'subscription','bnb':'rental','homestay':'rental','shortstay':'rental','short-stay':'rental','short-term-rental':'rental'};export const INDUSTRY_REGISTRY_VERSION=0x1;const registry=new Map();function seedBuiltinProfile(a){const b=BUILTIN_TRAITS[a];if(!b)return undefined;const c=getFlywheelForIndustry(a);if(!c)return undefined;const d=getIndustryRiskChecks(a),e=getIndustryNeeds(a),f=getIndustryTemplate(a);return{'name':a,'display_name':BUILTIN_DISPLAY_NAMES[a]??a,'traits':b,'source':'builtin','version':'v1','flywheel':c,'risk_checks':d,'preference_template':f,'needs':e};}function seedBuiltinIndustries(){for(const a of SUPPORTED_INDUSTRIES){const b=seedBuiltinProfile(a);b&®istry['set'](a,b);}}seedBuiltinIndustries(),injectRegistryLookup();function injectRegistryLookup(){a203b(a=>{const b=registry['get'](a);return b?{'flywheel':b['flywheel']}:undefined;}),a203c(a=>{const b=registry['get'](a);return b?{'risk_checks':b['risk_checks'],'needs':b['needs']}:undefined;}),a203d(a=>{const b=registry['get'](a);return b?{'preference_template':b['preference_template']}:undefined;});}export function getIndustryProfile(a){const b=registry['get'](a);return b?JSON['parse'](JSON['stringify'](b)):undefined;}export function listIndustries(a){const b=Array['from'](registry['values']());if(a?.['source'])return b['filter'](c=>c['source']===a['source']);return b;}export function registerIndustry(a){if(!a['name']||!a['traits']||!a['flywheel'])return![];return registry['set'](a['name'],a),!![];}export function getIndustryTraits(a){return registry['get'](a)?.['traits'];}export function resolveIndustryName(a){if(!a||typeof a!=='string')return undefined;const b=a['trim']();if(!b)return undefined;const c=b['toLowerCase']();if(INDUSTRY_ALIASES[b])return INDUSTRY_ALIASES[b];if(INDUSTRY_ALIASES[c])return INDUSTRY_ALIASES[c];if(registry['has'](b))return b;if(registry['has'](c))return c;return undefined;}export function getRegistrySize(){return registry['size'];}export function _resetRegistryForTest(){registry['clear'](),a203b(null),a203c(null),a203d(null),seedBuiltinIndustries(),injectRegistryLookup();}export function listBuiltinIndustryNames(){return a203a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{query_events}from'@wowok/wowok';import{batchQueryObjectsByIds as
|
|
1
|
+
import{query_events}from'@wowok/wowok';import{batchQueryObjectsByIds as a207a}from'../graph/onchain/sdk-batch.js';function toStr(a){if(typeof a==='string')return a;if(typeof a==='number'||typeof a==='bigint')return String(a);return undefined;}async function collectObjectIdsByEvent(a,b,c,d,e){const f=new Set();let g=null,h=![];while(f['size']<d){const i=await query_events({'type':a,'cursor':g,'limit':0x32,'order':'descending','no_cache':e,'network':c}),j=i?.['data']??[];if(j['length']===0x0)break;for(const k of j){const l=b(k);if(l)f['add'](l);}h=!!(i?.['hasNextPage']&&i?.['nextCursor']);if(!h)break;g=i?.['nextCursor']??null;}return{'ids':Array['from'](f)['slice'](0x0,d),'hasMore':h};}export async function enumerateServices(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ServiceEvent',i=>typeof i?.['object']==='string'?i['object']:undefined,a,c,b['no_cache']),f=await a207a(d,a,b['no_cache']),g=(b['location_any']??[])['map'](i=>i['toLowerCase']()),h=f['filter'](i=>(i?.['type']??'')==='Service')['filter'](i=>{if(g['length']===0x0)return!![];const j=typeof i?.['location']==='string'?i['location']['toLowerCase']():'';return g['some'](k=>j['includes'](k));})['map'](i=>({'object':String(i['object']),'name':typeof i['name']==='string'?i['name']:undefined,'location':typeof i['location']==='string'?i['location']:'','json':{...i,'compensation_fund':toStr(i['compensation_fund']),'sales':Array['isArray'](i['sales'])?i['sales']['map'](j=>({...j,'price':toStr(j['price'])})):[]}}));return{'services':h,'total_enumerated':h['length'],'has_more':e};}export async function enumerateDemands(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('DemandChangedEvent',h=>typeof h?.['object']==='string'?h['object']:undefined,a,c,b['no_cache']),f=await a207a(d,a,b['no_cache']),g=f['filter'](h=>(h?.['type']??'')==='Demand')['map'](h=>h);return{'demands':g,'total_enumerated':g['length'],'has_more':e};}export async function enumerateArbs(a,b={}){const c=b['max_objects']??0xc8,{ids:d,hasMore:e}=await collectObjectIdsByEvent('ArbEvent',i=>typeof i?.['arb']==='string'?i['arb']:undefined,a,c,b['no_cache']),f=await a207a(d,a,b['no_cache']),g=b['status']===undefined?undefined:Array['isArray'](b['status'])?b['status']:[b['status']],h=f['filter'](i=>(i?.['type']??'')==='Arb')['map'](i=>i)['filter'](i=>b['arbitration']?i['arbitration']===b['arbitration']:!![])['filter'](i=>b['order']?i['order']===b['order']:!![])['filter'](i=>g?g['includes'](Number(i['status'])):!![]);return{'arbs':h,'total_enumerated':h['length'],'has_more':e};}
|
|
@@ -99,4 +99,10 @@ export interface AmbiguityLint {
|
|
|
99
99
|
warnings: string[];
|
|
100
100
|
}
|
|
101
101
|
export declare function lintForwardAmbiguity(nodes: unknown[], context?: string): AmbiguityLint;
|
|
102
|
+
export interface LoopCycle {
|
|
103
|
+
from: string;
|
|
104
|
+
to: string;
|
|
105
|
+
cycle: string[];
|
|
106
|
+
}
|
|
107
|
+
export declare function findLoopCycles(adjacency: Map<string, string[]>): LoopCycle[];
|
|
102
108
|
export declare const MACHINE_TOPOLOGY_VERSION = "1.0.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT}from'./onchain-constants.js';export{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT};export function analyzeTopology(a,b){const c=a['map'](t=>t['name']),d=new Set(c),e=new Map(),f=new Map();for(const t of c){e['set'](t,[]),f['set'](t,[]);}for(const u of b){!e['has'](u['prev_node'])&&u['prev_node']!==''&&e['set'](u['prev_node'],[]),!f['has'](u['next_node'])&&f['set'](u['next_node'],[]),u['prev_node']!==''&&e['get'](u['prev_node'])['push'](u['next_node']),f['get'](u['next_node'])['push'](u['prev_node']);}const g=b['filter'](v=>v['prev_node']==='')['map'](v=>v['next_node'])['filter'](v=>d['has'](v)),h=c['filter'](v=>(e['get'](v)||[])['length']===0x0),i=c['filter'](v=>!g['includes'](v)&&(f['get'](v)||[])['length']===0x0),j=c['filter'](v=>(e['get'](v)||[])['length']===0x0&&!h['includes'](v)),{has_cycles:k,cycle_nodes:l}=detectCycles(c,b),m=analyzeDeadBranches(b),n=findUnachievableThresholds(b),o=computeReachability(c,b),p=b['reduce']((v,w)=>v+w['forwards']['length'],0x0),q=Math['max'](0x0,...b['map'](v=>v['forwards']['length'])),r=Math['max'](0x0,...b['flatMap'](v=>v['forwards']['map'](w=>countRetainedSubmissions(w['retained_submission'])))),s={'max_node_count':a['length']<=MAX_NODE_COUNT,'max_node_pair_count':b['length']<=MAX_NODE_PAIR_COUNT,'max_forward_count':q<=MAX_FORWARD_COUNT,'max_forward_order_count':r<=MAX_FORWARD_ORDER_COUNT,'threshold_achievable':n['length']===0x0};return{'entry_nodes':g,'terminal_nodes':h,'orphaned_nodes':i,'dead_end_nodes':j,'dead_branches':m,'unachievable_thresholds':n,'has_cycles':k,'cycle_nodes':l,'reachability':o,'node_count':a['length'],'pair_count':b['length'],'forward_count':p,'within_limits':s};}export function findUnachievableThresholds(a){const b=[];for(const c of a){const d=c['forwards']['length'],e=c['forwards']['reduce']((g,h)=>g+Number(h['weight']||0x0),0x0);if(e<c['threshold']){const f=c['threshold']>0x1&&d<c['threshold'];b['push']({'prev_node':c['prev_node'],'next_node':c['next_node'],'threshold':c['threshold'],'max_achievable':e,'distinct_forwards':d,'reason':f?'Threshold\x20'+c['threshold']+'\x20needs\x20'+c['threshold']+'\x20distinct\x20forwards\x20(each\x20forward\x20is\x20single-operator-locked\x20and\x20contributes\x20its\x20weight\x20at\x20most\x20once);\x20this\x20Pair\x20has\x20'+d+'\x20forward(s)\x20summing\x20to\x20'+e+'.\x20Add\x20more\x20parallel\x20forwards\x20or\x20lower\x20the\x20threshold.':'Threshold\x20'+c['threshold']+'\x20exceeds\x20max\x20achievable\x20weight\x20'+e+'\x20(sum\x20of\x20distinct\x20forward\x20weights).\x20The\x20transition\x20can\x20never\x20migrate.'});}}return b;}function countRetainedSubmissions(a){if(a===undefined||a===null)return 0x0;if(Array['isArray'](a))return a['length'];if(typeof a==='string')return a['length']>0x0?0x1:0x0;return 0x0;}export function detectCycle(a,b){const c=a['map'](d=>d['name']);return detectCycles(c,b);}function detectCycles(a,b){const c=new Map();for(const k of a)c['set'](k,[]);for(const l of b){l['prev_node']!==''&&c['has'](l['prev_node'])&&c['get'](l['prev_node'])['push'](l['next_node']);}const d=0x0,e=0x1,f=0x2,g=new Map();for(const m of a)g['set'](m,d);const h=[],i=[];function j(n){g['set'](n,e),i['push'](n);for(const o of c['get'](n)||[]){if(g['get'](o)===e){const p=i['indexOf'](o);return h['push'](i['slice'](p)),!![];}if(g['get'](o)===d){if(j(o))return!![];}}return i['pop'](),g['set'](n,f),![];}for(const n of a){g['get'](n)===d&&j(n);}return{'has_cycles':h['length']>0x0,'cycle_nodes':h};}function analyzeDeadBranches(a){const b=[],c=new Map();for(const d of a){if(!c['has'](d['prev_node']))c['set'](d['prev_node'],[]);c['get'](d['prev_node'])['push'](d);}for(const [e,f]of c){if(f['length']<=0x1)continue;const g=Math['min'](...f['map'](h=>h['threshold']));for(const h of f){h['threshold']>g*0x2&&b['push']({'pair':{'prev_node':h['prev_node'],'next_node':h['next_node']},'reason':'Threshold\x20'+h['threshold']+'\x20is\x20much\x20higher\x20than\x20competing\x20minimum\x20'+g+'.\x20Likely\x20always\x20loses.','competing_with':f['filter'](i=>i!==h)['map'](i=>i['next_node'])});}}return b;}function computeReachability(a,b){const c=new Map();for(const e of a)c['set'](e,[]);for(const f of b){if(f['prev_node']!==''){if(!c['has'](f['prev_node']))c['set'](f['prev_node'],[]);c['get'](f['prev_node'])['push'](f['next_node']);}}const d=new Map();for(const g of a){const h=new Set(),i=[g];while(i['length']>0x0){const j=i['shift']();for(const k of c['get'](j)||[]){!h['has'](k)&&(h['add'](k),i['push'](k));}}d['set'](g,h);}return d;}export function isReachableFromEntry(a,b){for(const c of b['entry_nodes']){if(c===a)return!![];if(b['reachability']['get'](c)?.['has'](a))return!![];}return![];}export function getNodesReachingTerminals(a){const b=new Set();for(const [c,d]of a['reachability']){for(const e of a['terminal_nodes']){if(d['has'](e)){b['add'](c);break;}}}return b;}export function formatTopologySummary(a){const b=['Nodes:\x20'+a['node_count']+'\x20(max\x20100)','Pairs:\x20'+a['pair_count']+'\x20(max\x2040)','Forwards:\x20'+a['forward_count']+'\x20(max\x2020\x20per\x20Pair)','','Entry\x20nodes:\x20'+(a['entry_nodes']['join'](',\x20')||'(none)'),'Terminal\x20nodes:\x20'+(a['terminal_nodes']['join'](',\x20')||'(none)'),'Orphaned\x20nodes:\x20'+(a['orphaned_nodes']['join'](',\x20')||'(none)'),'Dead\x20branches:\x20'+a['dead_branches']['length'],'Unachievable\x20thresholds:\x20'+a['unachievable_thresholds']['length'],'Cycles:\x20'+(a['has_cycles']?'YES\x20(❌\x20invalid\x20DAG)':'NO\x20(✓\x20valid\x20DAG)'),'','Within\x20on-chain\x20limits:\x20'+(a['within_limits']['max_node_count']&&a['within_limits']['max_node_pair_count']&&a['within_limits']['max_forward_count']&&a['within_limits']['max_forward_order_count']&&a['within_limits']['threshold_achievable']?'YES\x20✓':'NO\x20❌')];return b['join']('\x0a');}export function identifyTopologyPattern(a){const b=new Map(),c=new Map();for(const d of a){if(!b['has'](d['prev_node']))b['set'](d['prev_node'],[]);b['get'](d['prev_node'])['push'](d['next_node']);if(!c['has'](d['next_node']))c['set'](d['next_node'],[]);c['get'](d['next_node'])['push'](d['prev_node']);}for(const [e,f]of b){if(f['length']>0x1&&e!=='')return'P-M-COMPETING';}for(const [g,h]of c){if(h['length']>0x1)return'P-M-FORKMERGE';}return'P-M-LINEAR';}const FUND_REVERSING_NODE_RE=/(^|_)(cancel(led)?|refund(ed)?|return(ed|_approved)?|expired)(_|$)/i;export function flattenMachineNodeEdges(a){const b=[];for(const c of Array['isArray'](a)?a:[]){const d=c,e=typeof d?.['name']==='string'?d['name']:'';for(const g of Array['isArray'](d?.['pairs'])?d['pairs']:[]){const h=typeof g?.['prev_node']==='string'?g['prev_node']:'',i=typeof g?.['next_node']==='string'&&g['next_node']?g['next_node']:e,j=typeof g?.['threshold']==='number'?g['threshold']:undefined;for(const k of Array['isArray'](g?.['forwards'])?g['forwards']:[]){const l=k,m=typeof l?.['name']==='string'?l['name']:'';if(!m||!i)continue;const n=l?.['namedOperator']??l?.['named_operator'],o=l?.['permissionIndex']??l?.['permission_index'];b['push']({'prev_node':h,'next_node':i,'forward':m,'weight':typeof l?.['weight']==='number'?l['weight']:undefined,'threshold':j,'guard':typeof l?.['guard']==='string'?l['guard']:null,'operator':typeof n==='string'?n:null,'permission_index':typeof o==='number'?o:null});}}}return b;}function bindingKey(a){return(a['threshold']??0x0)+'|'+(a['weight']??0x0)+'|'+(a['guard']??'')+'|'+(a['operator']??'')+'|'+(a['permission_index']??'');}export function findForwardAmbiguities(a){const b=new Map();for(const d of a){const f=d['prev_node']+'\x00'+d['forward'],h=b['get'](f);if(h)h['push'](d);else b['set'](f,[d]);}const c=[];for(const [,i]of b){const j=[...new Set(i['map'](p=>p['next_node']))];if(j['length']<0x2)continue;const k=j['filter'](p=>FUND_REVERSING_NODE_RE['test'](p)),l=k['length']>0x0&&k['length']<j['length'],m=new Set(i['map'](bindingKey)),n=m['size']>0x1,o=j['filter'](p=>!FUND_REVERSING_NODE_RE['test'](p));c['push']({'prev_node':i[0x0]['prev_node'],'forward':i[0x0]['forward'],'destinations':j['sort'](),'fund_conflict':l,'binding_differs':n,'severity':l?'critical':'warning','reason':l?'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20both\x20refund\x20node(s)\x20['+k['join'](',\x20')+']\x20and\x20continue\x20node(s)\x20['+o['join'](',\x20')+'].\x20The\x20destination\x20is\x20a\x20CALLER\x20argument\x20(progress.move:540),\x20so\x20the\x20wrong\x20pick\x20puts\x20the\x20order\x20in\x20a\x20node\x20whose\x20Allocator\x20never\x20fires\x20—\x20the\x20escrow\x20strands.':'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20'+j['length']+'\x20destinations\x20['+j['join'](',\x20')+'];\x20the\x20caller\x20picks\x20which,\x20so\x20the\x20workflow\x20outcome\x20depends\x20on\x20an\x20argument\x20the\x20Machine\x20does\x20not\x20constrain'+(n?'\x20—\x20and\x20the\x20candidate\x20edges\x20carry\x20DIFFERENT\x20guard/operator/weight\x20bindings':'')+'.'});}return c['sort']((p,q)=>p['severity']===q['severity']?0x0:p['severity']==='critical'?-0x1:0x1);}export function findShadowedForwards(a){const b=new Set(),c=[];for(const d of a){const f=d['prev_node']+'\x00'+d['next_node']+'\x00'+d['forward'];b['has'](f)?c['push']({'prev_node':d['prev_node'],'next_node':d['next_node'],'forward':d['forward']}):b['add'](f);}return c;}export function lintForwardAmbiguity(b,c='machine'){const d=flattenMachineNodeEdges(b),e=findForwardAmbiguities(d),f=findShadowedForwards(d),g=[],h=[];for(const i of e){const j=c+':\x20P0-6\x20forward\x20ambiguity\x20—\x20'+i['reason'];i['severity']==='critical'?g['push'](j+'\x20Fix:\x20give\x20each\x20destination\x20its\x20own\x20forward\x20name\x20(e.g.\x20free_cancel\x20→\x20closed_cancel,\x20supplier_confirm\x20→\x20confirmed)\x20so\x20the\x20name\x20determines\x20the\x20node.'):h['push'](j+'\x20Recommended:\x20give\x20the\x20forward\x20a\x20destination-unique\x20name\x20unless\x20this\x20fork\x20is\x20intentional\x20and\x20the\x20caller\x20is\x20told\x20to\x20choose.');}for(const k of f){h['push'](c+':\x20duplicate\x20forward\x20\x22'+k['forward']+'\x22\x20in\x20the\x20'+(k['prev_node']||'(entry)')+'→'+k['next_node']+'\x20Pair\x20—\x20'+'the\x20destination\x20node\x27s\x20edge\x20lookup\x20(machine.move:284-296)\x20scans\x20forwards\x20in\x20order\x20and\x20returns\x20the\x20FIRST\x20match,\x20so\x20every\x20later\x20entry\x20with\x20that\x20name\x20is\x20unreachable\x20(dead\x20weight).\x20Rename\x20or\x20drop\x20it.');}return{'ambiguities':e,'shadowed':f,'critical':g,'warnings':h};}export const MACHINE_TOPOLOGY_VERSION='1.0.0';
|
|
1
|
+
import{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT}from'./onchain-constants.js';export{MAX_NODE_COUNT,MAX_NODE_PAIR_COUNT,MAX_FORWARD_COUNT,MAX_FORWARD_ORDER_COUNT};export function analyzeTopology(a,b){const c=a['map'](t=>t['name']),d=new Set(c),e=new Map(),f=new Map();for(const t of c){e['set'](t,[]),f['set'](t,[]);}for(const u of b){!e['has'](u['prev_node'])&&u['prev_node']!==''&&e['set'](u['prev_node'],[]),!f['has'](u['next_node'])&&f['set'](u['next_node'],[]),u['prev_node']!==''&&e['get'](u['prev_node'])['push'](u['next_node']),f['get'](u['next_node'])['push'](u['prev_node']);}const g=b['filter'](v=>v['prev_node']==='')['map'](v=>v['next_node'])['filter'](v=>d['has'](v)),h=c['filter'](v=>(e['get'](v)||[])['length']===0x0),i=c['filter'](v=>!g['includes'](v)&&(f['get'](v)||[])['length']===0x0),j=c['filter'](v=>(e['get'](v)||[])['length']===0x0&&!h['includes'](v)),{has_cycles:k,cycle_nodes:l}=detectCycles(c,b),m=analyzeDeadBranches(b),n=findUnachievableThresholds(b),o=computeReachability(c,b),p=b['reduce']((v,w)=>v+w['forwards']['length'],0x0),q=Math['max'](0x0,...b['map'](v=>v['forwards']['length'])),r=Math['max'](0x0,...b['flatMap'](v=>v['forwards']['map'](w=>countRetainedSubmissions(w['retained_submission'])))),s={'max_node_count':a['length']<=MAX_NODE_COUNT,'max_node_pair_count':b['length']<=MAX_NODE_PAIR_COUNT,'max_forward_count':q<=MAX_FORWARD_COUNT,'max_forward_order_count':r<=MAX_FORWARD_ORDER_COUNT,'threshold_achievable':n['length']===0x0};return{'entry_nodes':g,'terminal_nodes':h,'orphaned_nodes':i,'dead_end_nodes':j,'dead_branches':m,'unachievable_thresholds':n,'has_cycles':k,'cycle_nodes':l,'reachability':o,'node_count':a['length'],'pair_count':b['length'],'forward_count':p,'within_limits':s};}export function findUnachievableThresholds(a){const b=[];for(const c of a){const d=c['forwards']['length'],e=c['forwards']['reduce']((g,h)=>g+Number(h['weight']||0x0),0x0);if(e<c['threshold']){const f=c['threshold']>0x1&&d<c['threshold'];b['push']({'prev_node':c['prev_node'],'next_node':c['next_node'],'threshold':c['threshold'],'max_achievable':e,'distinct_forwards':d,'reason':f?'Threshold\x20'+c['threshold']+'\x20needs\x20'+c['threshold']+'\x20distinct\x20forwards\x20(each\x20forward\x20is\x20single-operator-locked\x20and\x20contributes\x20its\x20weight\x20at\x20most\x20once);\x20this\x20Pair\x20has\x20'+d+'\x20forward(s)\x20summing\x20to\x20'+e+'.\x20Add\x20more\x20parallel\x20forwards\x20or\x20lower\x20the\x20threshold.':'Threshold\x20'+c['threshold']+'\x20exceeds\x20max\x20achievable\x20weight\x20'+e+'\x20(sum\x20of\x20distinct\x20forward\x20weights).\x20The\x20transition\x20can\x20never\x20migrate.'});}}return b;}function countRetainedSubmissions(a){if(a===undefined||a===null)return 0x0;if(Array['isArray'](a))return a['length'];if(typeof a==='string')return a['length']>0x0?0x1:0x0;return 0x0;}export function detectCycle(a,b){const c=a['map'](d=>d['name']);return detectCycles(c,b);}function detectCycles(a,b){const c=new Map();for(const k of a)c['set'](k,[]);for(const l of b){l['prev_node']!==''&&c['has'](l['prev_node'])&&c['get'](l['prev_node'])['push'](l['next_node']);}const d=0x0,e=0x1,f=0x2,g=new Map();for(const m of a)g['set'](m,d);const h=[],i=[];function j(n){g['set'](n,e),i['push'](n);for(const o of c['get'](n)||[]){if(g['get'](o)===e){const p=i['indexOf'](o);return h['push'](i['slice'](p)),!![];}if(g['get'](o)===d){if(j(o))return!![];}}return i['pop'](),g['set'](n,f),![];}for(const n of a){g['get'](n)===d&&j(n);}return{'has_cycles':h['length']>0x0,'cycle_nodes':h};}function analyzeDeadBranches(a){const b=[],c=new Map();for(const d of a){if(!c['has'](d['prev_node']))c['set'](d['prev_node'],[]);c['get'](d['prev_node'])['push'](d);}for(const [e,f]of c){if(f['length']<=0x1)continue;const g=Math['min'](...f['map'](h=>h['threshold']));for(const h of f){h['threshold']>g*0x2&&b['push']({'pair':{'prev_node':h['prev_node'],'next_node':h['next_node']},'reason':'Threshold\x20'+h['threshold']+'\x20is\x20much\x20higher\x20than\x20competing\x20minimum\x20'+g+'.\x20Likely\x20always\x20loses.','competing_with':f['filter'](i=>i!==h)['map'](i=>i['next_node'])});}}return b;}function computeReachability(a,b){const c=new Map();for(const e of a)c['set'](e,[]);for(const f of b){if(f['prev_node']!==''){if(!c['has'](f['prev_node']))c['set'](f['prev_node'],[]);c['get'](f['prev_node'])['push'](f['next_node']);}}const d=new Map();for(const g of a){const h=new Set(),i=[g];while(i['length']>0x0){const j=i['shift']();for(const k of c['get'](j)||[]){!h['has'](k)&&(h['add'](k),i['push'](k));}}d['set'](g,h);}return d;}export function isReachableFromEntry(a,b){for(const c of b['entry_nodes']){if(c===a)return!![];if(b['reachability']['get'](c)?.['has'](a))return!![];}return![];}export function getNodesReachingTerminals(a){const b=new Set();for(const [c,d]of a['reachability']){for(const e of a['terminal_nodes']){if(d['has'](e)){b['add'](c);break;}}}return b;}export function formatTopologySummary(a){const b=['Nodes:\x20'+a['node_count']+'\x20(max\x20100)','Pairs:\x20'+a['pair_count']+'\x20(max\x2040)','Forwards:\x20'+a['forward_count']+'\x20(max\x2020\x20per\x20Pair)','','Entry\x20nodes:\x20'+(a['entry_nodes']['join'](',\x20')||'(none)'),'Terminal\x20nodes:\x20'+(a['terminal_nodes']['join'](',\x20')||'(none)'),'Orphaned\x20nodes:\x20'+(a['orphaned_nodes']['join'](',\x20')||'(none)'),'Dead\x20branches:\x20'+a['dead_branches']['length'],'Unachievable\x20thresholds:\x20'+a['unachievable_thresholds']['length'],'Cycles:\x20'+(a['has_cycles']?'YES\x20(❌\x20invalid\x20DAG)':'NO\x20(✓\x20valid\x20DAG)'),'','Within\x20on-chain\x20limits:\x20'+(a['within_limits']['max_node_count']&&a['within_limits']['max_node_pair_count']&&a['within_limits']['max_forward_count']&&a['within_limits']['max_forward_order_count']&&a['within_limits']['threshold_achievable']?'YES\x20✓':'NO\x20❌')];return b['join']('\x0a');}export function identifyTopologyPattern(a){const b=new Map(),c=new Map();for(const d of a){if(!b['has'](d['prev_node']))b['set'](d['prev_node'],[]);b['get'](d['prev_node'])['push'](d['next_node']);if(!c['has'](d['next_node']))c['set'](d['next_node'],[]);c['get'](d['next_node'])['push'](d['prev_node']);}for(const [e,f]of b){if(f['length']>0x1&&e!=='')return'P-M-COMPETING';}for(const [g,h]of c){if(h['length']>0x1)return'P-M-FORKMERGE';}return'P-M-LINEAR';}const FUND_REVERSING_NODE_RE=/(^|_)(cancel(led)?|refund(ed)?|return(ed|_approved)?|expired)(_|$)/i;export function flattenMachineNodeEdges(a){const b=[];for(const c of Array['isArray'](a)?a:[]){const d=c,e=typeof d?.['name']==='string'?d['name']:'';for(const g of Array['isArray'](d?.['pairs'])?d['pairs']:[]){const h=typeof g?.['prev_node']==='string'?g['prev_node']:'',i=typeof g?.['next_node']==='string'&&g['next_node']?g['next_node']:e,j=typeof g?.['threshold']==='number'?g['threshold']:undefined;for(const k of Array['isArray'](g?.['forwards'])?g['forwards']:[]){const l=k,m=typeof l?.['name']==='string'?l['name']:'';if(!m||!i)continue;const n=l?.['namedOperator']??l?.['named_operator'],o=l?.['permissionIndex']??l?.['permission_index'];b['push']({'prev_node':h,'next_node':i,'forward':m,'weight':typeof l?.['weight']==='number'?l['weight']:undefined,'threshold':j,'guard':typeof l?.['guard']==='string'?l['guard']:null,'operator':typeof n==='string'?n:null,'permission_index':typeof o==='number'?o:null});}}}return b;}function bindingKey(a){return(a['threshold']??0x0)+'|'+(a['weight']??0x0)+'|'+(a['guard']??'')+'|'+(a['operator']??'')+'|'+(a['permission_index']??'');}export function findForwardAmbiguities(a){const b=new Map();for(const d of a){const f=d['prev_node']+'\x00'+d['forward'],h=b['get'](f);if(h)h['push'](d);else b['set'](f,[d]);}const c=[];for(const [,i]of b){const j=[...new Set(i['map'](p=>p['next_node']))];if(j['length']<0x2)continue;const k=j['filter'](p=>FUND_REVERSING_NODE_RE['test'](p)),l=k['length']>0x0&&k['length']<j['length'],m=new Set(i['map'](bindingKey)),n=m['size']>0x1,o=j['filter'](p=>!FUND_REVERSING_NODE_RE['test'](p));c['push']({'prev_node':i[0x0]['prev_node'],'forward':i[0x0]['forward'],'destinations':j['sort'](),'fund_conflict':l,'binding_differs':n,'severity':l?'critical':'warning','reason':l?'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20both\x20refund\x20node(s)\x20['+k['join'](',\x20')+']\x20and\x20continue\x20node(s)\x20['+o['join'](',\x20')+'].\x20The\x20destination\x20is\x20a\x20CALLER\x20argument\x20(progress.move:540),\x20so\x20the\x20wrong\x20pick\x20puts\x20the\x20order\x20in\x20a\x20node\x20whose\x20Allocator\x20never\x20fires\x20—\x20the\x20escrow\x20strands.':'Forward\x20\x22'+i[0x0]['forward']+'\x22\x20from\x20\x22'+i[0x0]['prev_node']+'\x22\x20resolves\x20to\x20'+j['length']+'\x20destinations\x20['+j['join'](',\x20')+'];\x20the\x20caller\x20picks\x20which,\x20so\x20the\x20workflow\x20outcome\x20depends\x20on\x20an\x20argument\x20the\x20Machine\x20does\x20not\x20constrain'+(n?'\x20—\x20and\x20the\x20candidate\x20edges\x20carry\x20DIFFERENT\x20guard/operator/weight\x20bindings':'')+'.'});}return c['sort']((p,q)=>p['severity']===q['severity']?0x0:p['severity']==='critical'?-0x1:0x1);}export function findShadowedForwards(a){const b=new Set(),c=[];for(const d of a){const f=d['prev_node']+'\x00'+d['next_node']+'\x00'+d['forward'];b['has'](f)?c['push']({'prev_node':d['prev_node'],'next_node':d['next_node'],'forward':d['forward']}):b['add'](f);}return c;}export function lintForwardAmbiguity(b,c='machine'){const d=flattenMachineNodeEdges(b),e=findForwardAmbiguities(d),f=findShadowedForwards(d),g=[],h=[];for(const i of e){const j=c+':\x20P0-6\x20forward\x20ambiguity\x20—\x20'+i['reason'];i['severity']==='critical'?g['push'](j+'\x20Fix:\x20give\x20each\x20destination\x20its\x20own\x20forward\x20name\x20(e.g.\x20free_cancel\x20→\x20closed_cancel,\x20supplier_confirm\x20→\x20confirmed)\x20so\x20the\x20name\x20determines\x20the\x20node.'):h['push'](j+'\x20Recommended:\x20give\x20the\x20forward\x20a\x20destination-unique\x20name\x20unless\x20this\x20fork\x20is\x20intentional\x20and\x20the\x20caller\x20is\x20told\x20to\x20choose.');}for(const k of f){h['push'](c+':\x20duplicate\x20forward\x20\x22'+k['forward']+'\x22\x20in\x20the\x20'+(k['prev_node']||'(entry)')+'→'+k['next_node']+'\x20Pair\x20—\x20'+'the\x20destination\x20node\x27s\x20edge\x20lookup\x20(machine.move:284-296)\x20scans\x20forwards\x20in\x20order\x20and\x20returns\x20the\x20FIRST\x20match,\x20so\x20every\x20later\x20entry\x20with\x20that\x20name\x20is\x20unreachable\x20(dead\x20weight).\x20Rename\x20or\x20drop\x20it.');}return{'ambiguities':e,'shadowed':f,'critical':g,'warnings':h};}export function findLoopCycles(a){const b=0x0,c=0x1,d=0x2,e=new Map(),f=[],g=[],h=i=>{e['set'](i,c),f['push'](i);for(const j of a['get'](i)??[]){const k=e['get'](j)??b;if(k===c){const l=f['indexOf'](j);if(l>=0x0)g['push']({'from':i,'to':j,'cycle':f['slice'](l)});}else k===b&&h(j);}f['pop'](),e['set'](i,d);};for(const i of a['keys']()){if((e['get'](i)??b)===b)h(i);}return g;}export const MACHINE_TOPOLOGY_VERSION='1.0.0';
|
|
@@ -18,16 +18,10 @@ export interface ReviewStats {
|
|
|
18
18
|
count: number;
|
|
19
19
|
}>;
|
|
20
20
|
recentTrend: "improving" | "declining" | "stable";
|
|
21
|
+
bidirectionalRate: number | null;
|
|
21
22
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
guardName: string;
|
|
25
|
-
guardRules: string;
|
|
26
|
-
setupSteps: string[];
|
|
27
|
-
}
|
|
28
|
-
export declare const REPUTATION_RULES_VERSION = 1;
|
|
29
|
-
export declare function buildReviewRepositorySetup(serviceName: string): ReviewRepositorySetup;
|
|
30
|
-
export declare function computeReviewStats(reviews: Review[]): ReviewStats;
|
|
23
|
+
export declare const REPUTATION_RULES_VERSION = 2;
|
|
24
|
+
export declare function computeReviewStats(reviews: Review[], merchantReviews?: Review[]): ReviewStats;
|
|
31
25
|
export declare function isVerifiedReview(review: Review, orderHistory: Array<{
|
|
32
26
|
id: string;
|
|
33
27
|
status: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const REPUTATION_RULES_VERSION=
|
|
1
|
+
export const REPUTATION_RULES_VERSION=0x2;export function computeReviewStats(a,b){let c=null;if(b!==undefined){const p=new Set(b['map'](s=>s['orderRef'])['filter'](s=>s!=null)),q=a['filter'](s=>s['orderRef']!=null);c=q['length']===0x0?0x0:q['filter'](s=>p['has'](s['orderRef']))['length']/q['length'];}if(a['length']===0x0)return{'total':0x0,'likes':0x0,'dislikes':0x0,'likeRate':0x0,'verifiedCount':0x0,'topTags':[],'recentTrend':'stable','bidirectionalRate':c};const d=a['filter'](s=>s['rating']==='like')['length'],e=a['filter'](s=>s['rating']==='dislike')['length'],f=a['filter'](s=>s['verified'])['length'],g=new Map();for(const s of a){if(s['tags'])for(const u of s['tags']){g['set'](u,(g['get'](u)??0x0)+0x1);}}const h=Array['from'](g['entries']())['sort']((v,w)=>w[0x1]-v[0x1])['slice'](0x0,0x5)['map'](([v,w])=>({'tag':v,'count':w})),i=[...a]['sort']((v,w)=>(v['timestamp']??0x0)-(w['timestamp']??0x0)),j=Math['floor'](i['length']/0x2),k=i['slice'](0x0,j),l=i['slice'](j),m=k['length']>0x0?k['filter'](v=>v['rating']==='like')['length']/k['length']:0.5,n=l['length']>0x0?l['filter'](v=>v['rating']==='like')['length']/l['length']:0.5;let o='stable';if(n>m+0.15)o='improving';else{if(n<m-0.15)o='declining';}return{'total':a['length'],'likes':d,'dislikes':e,'likeRate':d/a['length'],'verifiedCount':f,'topTags':h,'recentTrend':o,'bidirectionalRate':c};}export function isVerifiedReview(a,b){if(!a['orderRef'])return![];const c=b['find'](d=>d['id']===a['orderRef']);return c?.['status']==='completed'||c?.['status']==='success';}export function filterVerifiedReviews(a,b){return a['map'](c=>({...c,'verified':isVerifiedReview(c,b)}));}export function detectReviewManipulation(a){const b=[],c=new Map();for(const g of a){c['set'](g['reviewer'],(c['get'](g['reviewer'])??0x0)+0x1);}const d=Array['from'](c['entries']())['filter'](([,h])=>h>0x1);d['length']>0x0&&b['push'](d['length']+'\x20address(es)\x20submitted\x20multiple\x20reviews');const e=a['every'](h=>h['rating']==='like'),f=a['every'](h=>!h['verified']);e&&a['length']>0x5&&f&&b['push']('All\x20likes\x20but\x20no\x20verified\x20reviews;\x20possible\x20review\x20spam');if(a['length']>0xa){const h=[...a]['sort']((j,k)=>(j['timestamp']??0x0)-(k['timestamp']??0x0)),i=(h[h['length']-0x1]['timestamp']??0x0)-(h[0x0]['timestamp']??0x0);i>0x0&&i<0xe10*0x3e8&&b['push'](a['length']+'\x20reviews\x20submitted\x20within\x201\x20hour;\x20abnormally\x20concentrated\x20timing');}return{'suspicious':b['length']>0x0,'reasons':b};}
|
|
@@ -64,6 +64,15 @@ export interface ImmutabilityRule {
|
|
|
64
64
|
message: string;
|
|
65
65
|
}
|
|
66
66
|
export declare const IMMUTABILITY_RULES: readonly ImmutabilityRule[];
|
|
67
|
+
export interface ProtocolSlotRule {
|
|
68
|
+
rule_id: string;
|
|
69
|
+
slot: number;
|
|
70
|
+
asserted_by: string[];
|
|
71
|
+
required_declaration: string;
|
|
72
|
+
violation: string;
|
|
73
|
+
message: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const PROTOCOL_SLOT_RULES: readonly ProtocolSlotRule[];
|
|
67
76
|
export type OperationClass = "LOCAL_ONLY" | "ONCHAIN" | "QUERY" | "ENCRYPTED";
|
|
68
77
|
export declare const OPERATION_TYPE_CLASSIFICATION: Record<OperationClass, readonly string[]>;
|
|
69
78
|
export interface OperationClassMeta {
|
|
@@ -121,4 +130,4 @@ export declare function checkImmutabilityRules(ops: readonly {
|
|
|
121
130
|
trigger: "create" | "publish";
|
|
122
131
|
name?: string;
|
|
123
132
|
}[]): SafetyRiskItem[];
|
|
124
|
-
export declare const SAFETY_RULES_VERSION =
|
|
133
|
+
export declare const SAFETY_RULES_VERSION = 3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatMist,GasTokenType,MAINNET_BRIDGE_CONFIG,formatUnits,isFundApprovalExempt}from'@wowok/wowok';export const DEFAULT_VALUE_WARNINGS={'defaultAccount':'Using\x20default\x20account\x20(env.account=\x22\x22)','mainnet':'Operating\x20on\x20mainnet\x20—\x20irreversible','replaceExistName':'replaceExistName=true\x20will\x20unbind\x20the\x20existing\x20name\x20(breaking\x20refs):\x20the\x20previously\x20named\x20object\x20stays\x20on-chain\x20but\x20becomes\x20unreachable\x20by\x20name\x20—\x20any\x20funds\x20it\x20holds\x20(e.g.\x20an\x20old\x20Order\x27s\x20Allocation)\x20are\x20orphaned.\x20Re-running\x20a\x20build\x20with\x20the\x20same\x20name\x20creates\x20a\x20SECOND\x20object,\x20not\x20a\x20replacement','defaultToken':'Using\x20default\x20token\x200x2::wow::WOW'};export const DEFAULT_AMOUNT_THRESHOLD=BigInt(0x174876e800);export function getAmountThreshold(){const a=process['env']['WOWOK_AMOUNT_THRESHOLD'];if(!a)return DEFAULT_AMOUNT_THRESHOLD;try{return BigInt(a);}catch{return DEFAULT_AMOUNT_THRESHOLD;}}export const DEFAULT_FUND_COVERAGE_MIN=0x1;export function getFundCoverageMin(){const a=process['env']['WOWOK_FUND_COVERAGE_MIN'];if(a===undefined||a['trim']()==='')return DEFAULT_FUND_COVERAGE_MIN;const b=Number(a);if(!Number['isFinite'](b)||b<0x0)return DEFAULT_FUND_COVERAGE_MIN;return b;}export function formatAmount(a){return formatMist(a);}function bestEffortTokenType(a){return a?.['object']?.['type_parameter']??a?.['type_parameter'];}function describeAmount(a,b){if(!b||b===GasTokenType)try{return formatMist(a);}catch{return a+'\x20raw\x20smallest\x20units\x20of\x20'+GasTokenType;}return a+'\x20raw\x20smallest\x20units\x20of\x20'+b;}function containsReplaceExistName(a,b,c){if(a===null||typeof a!=='object'||b>0x8)return![];const d=a;if(c['has'](d))return![];c['add'](d);if(d['replaceExistName']===!![])return!![];for(const e of Object['values'](d)){if(containsReplaceExistName(e,b+0x1,c))return!![];}return![];}export function collectDefaultWarnings(a,b){const c=[],d=a?.['account'];(d===undefined||d==='')&&c['push'](DEFAULT_VALUE_WARNINGS['defaultAccount']);const e=a?.['network'];e&&/mainnet/i['test'](String(e))&&c['push'](DEFAULT_VALUE_WARNINGS['mainnet']);const f=b?.['namedNew']??b?.['object'];return f&&typeof f==='object'&&f['replaceExistName']===!![]&&c['push'](DEFAULT_VALUE_WARNINGS['replaceExistName']),b&&typeof b==='object'&&containsReplaceExistName(b,0x0,new Set())&&c['push'](DEFAULT_VALUE_WARNINGS['replaceExistName']),[...new Set(c)];}export const BRIDGE_FUND_OPERATION_TYPES=['cross_chain_wow_to_evm','cross_chain_evm_to_wow','claim_wow_to_evm','resume_transfer','withdraw'];function describeBridgeAmount(a,b,c){if(b==='WOW'||!b&&c==='wow_to_evm')return formatMist(a);const d=MAINNET_BRIDGE_CONFIG?.['tokens']?.['find'](f=>f['symbol']?.['toUpperCase']()===b?.['toUpperCase']()),e=d?c==='wow_to_evm'?d['wowDecimals']:d['evmDecimals']:undefined;if(e===undefined)return a+'\x20raw\x20smallest\x20units\x20of\x20'+(b??'the\x20bridge\x20token');try{return formatUnits(BigInt(a),e)+'\x20'+b;}catch{return a+'\x20raw\x20smallest\x20units\x20of\x20'+b;}}export const CONFIRMATION_RULES=[{'id':'bridge_fund_movement','when':(a,b,c)=>BRIDGE_FUND_OPERATION_TYPES['includes'](a),'level':'irreversible','preview':(a,b,c)=>{const d=typeof b?.['amount']==='string'?b['amount']:undefined,e=typeof b?.['token']==='string'?b['token']:undefined,f=b?.['withdrawTo']??b?.['recipientWowAddress']??b?.['to']??(a==='claim_wow_to_evm'||a==='resume_transfer'?b?.['transferId']:undefined),g=a==='cross_chain_wow_to_evm'?'wow_to_evm':'evm_side';return{'level':'irreversible','operation':a,'irreversible':!![],'network':c?.['network'],'account':c?.['account']??'','amount':d!==undefined?{'value':d,'token':e??(g==='wow_to_evm'?GasTokenType:'ETH'),'human_readable':describeBridgeAmount(d,e,g),'recipient':f}:undefined,'warnings':[...collectDefaultWarnings(c,b),a==='withdraw'?'EVM\x20withdrawal\x20from\x20activeEvmAccount\x20—\x20funds\x20move\x20to\x20an\x20external\x20EVM\x20address;\x20irreversible.':'Cross-chain\x20bridge\x20transfer\x20—\x20funds\x20leave\x20the\x20source\x20chain;\x20recovery\x20(if\x20any)\x20requires\x20the\x20opposite-side\x20claim\x20or\x20resume_transfer,\x20never\x20a\x20rollback.']};},'bypass_on_explicit_intent':[]},{'id':'irreversible_fund_or_verdict','when':(a,b,c)=>{const d=c?.['network'],e=bestEffortTokenType(b)??GasTokenType;if(a==='payment'&&Array['isArray'](b?.['revenue'])&&b['revenue']['length']>0x0){const f=b['revenue']['map'](g=>g?.['amount']?.['balance'])['filter'](g=>typeof g==='string'||typeof g==='number');if(f['length']===b['revenue']['length']&&f['every'](g=>isFundApprovalExempt(d,e,String(g))))return![];return!![];}if(a==='treasury'&&b?.['withdraw']){const g=extractAmount(b);if(g!==null&&isFundApprovalExempt(d,e,g))return![];return!![];}if(a==='payment')return!![];if(a==='arbitration'&&b?.['arbitration']!==undefined)return!![];if(b?.['receive']!==undefined||b?.['owner_receive']!==undefined||b?.['received_coins']!==undefined||b?.['compensation_fund_receive']!==undefined)return!![];if(b?.['alloc_by_guard']!==undefined)return!![];if(a==='reward'&&b?.['claim']!==undefined)return!![];if(a==='service'&&b?.['compensation_fund_withdraw']!==undefined)return!![];if(a==='order'&&b?.['arb_claim_compensation']!==undefined)return!![];if(a==='arbitration'&&(b?.['arb_withdraw']!==undefined||b?.['fees_transfer']!==undefined))return!![];if(a==='treasury'){if(b?.['withdraw'])return!![];return![];}return![];},'level':'irreversible','preview':(a,b,c)=>{let d;if(a==='payment'&&Array['isArray'](b?.['revenue'])&&b['revenue']['length']>0x0){const f=b['revenue']['find'](g=>typeof g?.['amount']?.['balance']==='string'||typeof g?.['amount']?.['balance']==='number');if(f){const g=String(f['amount']['balance']);d={'value':g,'human_readable':describeAmount(g,bestEffortTokenType(b))};}else d={'value':'','human_readable':'entire\x20Coin\x20object(s)\x20(amount\x20resolved\x20by\x20the\x20fund\x20layer)'};}const e=[];return a==='reward'&&b?.['claim']!==undefined&&e['push']('Reward\x20claim\x20—\x20Guard-verified\x20payout\x20splits\x20the\x20pool\x20balance\x20and\x20transfers\x20coins\x20to\x20the\x20claimer;\x20the\x20exact\x20amount\x20is\x20determined\x20by\x20the\x20Reward\x27s\x20guard\x20config.'),a==='service'&&b?.['compensation_fund_withdraw']!==undefined&&e['push']('Compensation\x20fund\x20withdraw\x20—\x20withdraws\x20the\x20ENTIRE\x20compensation_fund\x20into\x20a\x20new\x20Payment\x20owned\x20by\x20\x27'+(b['compensation_fund_withdraw']?.['receipt']??'(recipient)')+'\x27.'),a==='order'&&b?.['arb_claim_compensation']!==undefined&&e['push']('Order\x20compensation\x20claim\x20—\x20splits\x20the\x20Service\x27s\x20compensation_fund\x20and\x20transfers\x20the\x20awarded\x20coins\x20to\x20the\x20caller;\x20irreversible.'),a==='arbitration'&&b?.['arb_withdraw']!==undefined&&e['push']('Arb\x20fee\x20withdraw\x20—\x20sweeps\x20the\x20Arb\x27s\x20fee\x20balance\x20into\x20the\x20Arbitration\x20object\x27s\x20balance.'),a==='arbitration'&&b?.['fees_transfer']!==undefined&&e['push']('Arbitration\x20fees\x20transfer\x20—\x20withdraws\x20the\x20ENTIRE\x20Arbitration\x20balance\x20into\x20a\x20new\x20Payment\x20for\x20the\x20target\x20Allocation/Treasury;\x20irreversible.'),{'level':'irreversible','operation':a,'irreversible':!![],'network':c?.['network'],'account':c?.['account']??'','warnings':[...collectDefaultWarnings(c,b),...e],'amount':a==='payment'&&d?{...d,'token':bestEffortTokenType(b)??GasTokenType,'recipient':b?.['revenue']?.[0x0]?.['recipient']}:undefined};},'bypass_on_explicit_intent':[]},{'id':'publish_immutable','when':(a,b,c)=>{if(a==='service'&&(b?.['publish']===!![]||b?.['bPublished']===!![]))return!![];if(a==='machine'&&b?.['publish']===!![])return!![];return![];},'level':'publish','preview':(a,b,c)=>({'level':'publish','operation':a,'object':b?.['object']??b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','immutable_after':a==='service'?['machine','order_allocators']:['nodes','pairs','forwards'],'warnings':collectDefaultWarnings(c,b)}),'bypass_on_explicit_intent':['force\x20publish','publish\x20now']},{'id':'amount_sensitive','when':(a,b,c)=>{const d=extractAmount(b);if(d!==null){if(isFundApprovalExempt(c?.['network'],bestEffortTokenType(b)??GasTokenType,d))return![];return!![];}if(a==='service'&&b?.['order_new'])return!![];if(a==='treasury'&&b?.['deposit']?.['coin']?.['coin'])return!![];if(a==='reward'&&b?.['coin_add']?.['coin'])return!![];if(a==='allocation'&&b?.['coin']?.['coin'])return!![];return![];},'level':'amount','preview':(a,b,c)=>{const d=extractAmount(b),e=bestEffortTokenType(b);return{'level':'amount','operation':a,'object':b?.['object']??b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','amount':d?{'value':d,'token':e??GasTokenType,'human_readable':describeAmount(d,e)}:{'value':'','token':e??GasTokenType,'human_readable':'entire\x20Coin\x20object\x20(amount\x20resolved\x20on-chain)'},'warnings':collectDefaultWarnings(c,b)};},'bypass_on_explicit_intent':[]},{'id':'default_values','when':(a,b,c)=>{return collectDefaultWarnings(c,b)['length']>0x0;},'level':'standard','preview':(a,b,c)=>({'level':'standard','operation':a,'object':b?.['object']??b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','warnings':collectDefaultWarnings(c,b)}),'bypass_on_explicit_intent':['use\x20default\x20account','default\x20account\x20is\x20fine','use\x20the\x20default\x20account','default\x20account\x20works\x20fine']},{'id':'guard_create_immutable','when':(a,b,c)=>{if(a==='guard')return!![];return![];},'level':'irreversible','preview':(a,b,c)=>{const d=b?.['table']??[],e=b?.['root'],f=b?.['rely'],g=typeof e==='object'&&e!==null&&'type'in e?e['type']:typeof e==='object'&&e!==null&&'type'in e&&e['type']==='file'?'file':'unknown',h=['table','root'];if(f)h['push']('rely');let i='';try{i=JSON['stringify'](e??{});}catch{i='';}const j=[],k=(Array['isArray'](d)?d:[])['filter'](l=>l&&l['b_submission']===!![]&&String(l['value_type'])['toLowerCase']()==='address');if(k['length']>0x0){const l=/order\.service|progress\.machine|arb\.service|order\.machine/i['test'](i);!l&&j['push']('PRE-LINT\x20R-C3-05:\x20submitted\x20Address\x20slot(s)\x20are\x20not\x20bound\x20to\x20this\x20project\x20in\x20the\x20root\x20(no\x20order.service/progress.machine\x20comparison)\x20—\x20a\x20cross-project\x20object\x20can\x20satisfy\x20this\x20Guard.\x20Add\x20the\x20binding\x20BEFORE\x20confirming:\x20the\x20Guard\x20is\x20immutable\x20after\x20creation'),!/signer/i['test'](i)&&j['push']('PRE-LINT\x20identity:\x20submitted\x20data\x20is\x20not\x20tied\x20to\x20the\x20transaction\x20signer\x20(no\x20context(Signer)\x20clause)\x20—\x20anyone\x20able\x20to\x20trigger\x20the\x20host\x20operation\x20can\x20submit\x20arbitrary\x20values.\x20Add\x20a\x20Signer\x20binding\x20if\x20the\x20submitter\x20must\x20be\x20authorized');}return{'level':'irreversible','operation':a,'object':b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','immutable_after':h,'irreversible':!![],'warnings':[...collectDefaultWarnings(c,b),'Guard\x20is\x20CREATE-only\x20and\x20immutable\x20—\x20cannot\x20be\x20edited\x20or\x20deleted\x20after\x20creation','Table\x20entries:\x20'+d['length']+'\x20(max\x20256)','Root\x20node\x20type:\x20'+g+'\x20(must\x20return\x20Bool)',...f?['Rely\x20dependencies:\x20'+(f['guards']?.['length']??0x0)+'\x20(max\x204,\x20AND/OR\x20logic)']:[],...j,'To\x20modify\x20later:\x20export\x20via\x20guard2file\x20→\x20edit\x20→\x20CREATE\x20new\x20→\x20rebind']};},'bypass_on_explicit_intent':[]},{'id':'guard_gen_passport_test','when':(a,b,c)=>{if(a==='gen_passport')return!![];return![];},'level':'standard','preview':(a,b,c)=>({'level':'standard','operation':a,'object':b?.['guard'],'network':c?.['network'],'account':c?.['account']??'','warnings':[...collectDefaultWarnings(c,b),'gen_passport\x20will\x20consume\x20gas\x20for\x20static\x20testing']}),'bypass_on_explicit_intent':['test\x20guard','testing\x20guard','gen\x20passport','generate\x20passport']},{'id':'progress_advance','when':(a,b,c)=>{if(a!=='progress')return![];return b?.['operate']?.['op']==='next'||b?.['owner_receive']!==undefined;},'level':'standard','preview':(a,b,c)=>({'level':'standard','operation':a,'object':b?.['object'],'network':c?.['network'],'account':c?.['account']??'','warnings':[...collectDefaultWarnings(c,b),'Advancing\x20the\x20progress\x20node\x20may\x20release\x20funds\x20per\x20the\x20machine\x20allocation']}),'bypass_on_explicit_intent':[]}];export function resolveOverrideId(a,b){if(a==='publish_immutable'){if(b==='service')return'service.publish';if(b==='machine')return'machine.publish';return undefined;}if(a==='progress_advance')return'node.advance';if(a==='default_values')return'confirm.default_values';if(a==='guard_gen_passport_test')return'confirm.gen_passport_test';return undefined;}export function extractAmount(a,b){if(!a)return null;const d=i=>{if(typeof i==='number')return String(i);if(typeof i==='string'&&i!=='')return i;return null;},e=[a?.['balance'],a?.['amount'],a?.['compensation_fund_add']?.['balance'],a?.['coin_add']?.['balance'],a?.['coin']?.['balance'],a?.['order_new']?.['buy']?.['total_pay']?.['balance'],a?.['dispute']?.['fee']?.['balance'],a?.['fee'],a?.['arbitration']?.['indemnity'],a?.['deposit']?.['coin']?.['balance'],a?.['withdraw']?.['amount']?.['fixed']],f=[];for(const i of e){const j=d(i);if(j!==null)f['push'](j);}if(Array['isArray'](a?.['revenue']))for(const k of a['revenue']){const l=d(k?.['amount']?.['balance']);if(l!==null)f['push'](l);}if(Array['isArray'](a?.['guard_add']))for(const m of a['guard_add']){if(m?.['amount']?.['type']==='Fixed'){const n=d(m['amount']['value']);if(n!==null)f['push'](n);}}if(!b?.['excludeConfigAmounts'])for(const o of[a?.['allocators'],a?.['order_allocators']]){if(!o||typeof o!=='object')continue;const p=d(o['threshold']);if(p!==null)f['push'](p);for(const q of Array['isArray'](o['allocators'])?o['allocators']:[]){if(Array['isArray'](q?.['sharing']))for(const u of q['sharing']){if(u?.['mode']==='Amount'){const w=d(u['sharing']);if(w!==null)f['push'](w);}}const t=d(q?.['max']);if(t!==null)f['push'](t);}}const h=f['filter'](x=>{try{return BigInt(x)!==0x0n;}catch{return!![];}});if(h['length']===0x0)return null;if(h['length']===0x1)return h[0x0];try{return h['reduce']((x,y)=>x+BigInt(y),0x0n)['toString']();}catch{return h[0x0];}}export const OBJECT_REUSE_RULES=[{'rule_id':'REUSE-001','object_type':'permission','recommendation':'strongly_recommended','reason':'Centralized\x20permission\x20control\x20across\x20all\x20services','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Permission\x20to\x20reuse?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-002','object_type':'machine','recommendation':'recommended','reason':'Save\x20design\x20time\x20for\x20similar\x20processes','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Machine\x20whose\x20workflow\x20fits?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-003','object_type':'guard','recommendation':'recommended','reason':'Avoid\x20redundant\x20validation\x20rules','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Guard\x20with\x20matching\x20validation\x20logic?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-004','object_type':'contact','recommendation':'recommended','reason':'Single\x20point\x20of\x20customer-service\x20management','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Contact\x20for\x20customer\x20service?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-005','object_type':'arbitration','recommendation':'always_reuse','reason':'Customers\x20choose\x20from\x20established\x20arbiters;\x20creating\x20a\x20new\x20Arbitration\x20is\x20an\x20operator-level\x20decision','ask_user':'Which\x20existing\x20Arbitration\x20service\x20should\x20disputes\x20route\x20to?\x20Provide\x20the\x20name\x20or\x20ID.'}];export const CREATE_VS_MODIFY_PATTERN={'reuse_form':'string','create_form':'object','resolution_api':'GetObjectExisted','note':'String\x20reference\x20=\x20REUSE\x20(name\x20resolution\x20failure\x20is\x20a\x20hard\x20error);\x20object\x20shape\x20=\x20CREATE\x20(always).'};export const IMMUTABILITY_RULES=[{'rule_id':'IMMUT-001','object_type':'machine','trigger':'publish','immutable_fields':['nodes','pairs','forwards'],'message':'Machine\x20topology\x20is\x20immutable\x20after\x20publish\x20—\x20verify\x20all\x20nodes/forwards\x20via\x20machineNode2file\x20BEFORE\x20publishing'},{'rule_id':'IMMUT-002','object_type':'service','trigger':'publish','immutable_fields':['machine','order_allocators'],'mutable_after':['arbitrations','rewards','sales'],'message':'Service.machine\x20and\x20order_allocators\x20are\x20PERMANENTLY\x20frozen\x20after\x20publish\x20(L1);\x20arbitrations/rewards\x20can\x20still\x20be\x20ADDED\x20but\x20remove/clear\x20is\x20time-locked\x20(L2:\x20pause\x20+\x20setting_lock_duration);\x20sales\x20remains\x20fully\x20modifiable\x20(L3)\x20without\x20pause'},{'rule_id':'IMMUT-003','object_type':'guard','trigger':'create','immutable_fields':['table','root','rely'],'message':'Guard\x20is\x20CREATE-only\x20and\x20immutable\x20—\x20cannot\x20be\x20edited\x20or\x20deleted\x20after\x20creation.\x20To\x20change:\x20export\x20via\x20guard2file\x20→\x20edit\x20→\x20CREATE\x20new\x20→\x20rebind'}];export const OPERATION_TYPE_CLASSIFICATION={'LOCAL_ONLY':['account_operation','local_mark_operation','local_info_operation','config_operation'],'ONCHAIN':['onchain_operations','wip_file','bridge_operation','messenger_operation'],'QUERY':['query_toolkit','onchain_table_data','onchain_events','guard2file','machineNode2file','schema_query','wowok_buildin_info'],'ENCRYPTED':['messenger_operation']};export const OPERATION_CLASS_META={'LOCAL_ONLY':{'gas':![],'confirmation_required':![],'note':'Local\x20state\x20only\x20—\x20no\x20gas,\x20no\x20confirmation\x20needed'},'ONCHAIN':{'gas':!![],'confirmation_required':!![],'note':'On-chain\x20write\x20—\x20gas\x20consumed,\x20explicit\x20user\x20confirmation\x20REQUIRED\x20before\x20execution'},'QUERY':{'gas':![],'confirmation_required':![],'note':'Read-only\x20—\x20no\x20gas,\x20no\x20confirmation\x20needed'},'ENCRYPTED':{'gas':![],'confirmation_required':![],'note':'Local\x20encryption\x20—\x20no\x20gas,\x20no\x20confirmation\x20needed'}};export function classifyTool(a){if(OPERATION_TYPE_CLASSIFICATION['ENCRYPTED']['includes'](a))return'ENCRYPTED';for(const b of['LOCAL_ONLY','ONCHAIN','QUERY']){if(OPERATION_TYPE_CLASSIFICATION[b]['includes'](a))return b;}return undefined;}export const NAMING_CONVENTIONS={'scheme':'<projectPrefix>_<type>_<purpose>_<version>','parts':{'project_prefix':{'example':'shopFunny_','purpose':'Prevents\x20cross-project\x20collisions'},'type_prefix':{'example':'machine_\x20/\x20guard_\x20/\x20service_','purpose':'Clarifies\x20object\x20type'},'purpose_suffix':{'example':'serviceWithdraw','purpose':'Describes\x20function'},'version_suffix':{'example':'_v2','purpose':'Enables\x20iteration\x20without\x20replaceExistName'}},'entry_id':{'pattern':'^<object_type>:<name>$','example':'service:myshop_service'},'replace_exist_name':{'default':![],'false_effect':'Throws\x20error\x20if\x20name\x20is\x20in\x20use\x20—\x20safe\x20default','true_effect':'Existing\x20object/account\x20with\x20the\x20same\x20name\x20is\x20suspended/unbound\x20to\x20free\x20the\x20name','account_default_forbidden':'replaceExistName:true\x20on\x20the\x20default\x20account\x20(name=\x27\x27)\x20is\x20FORBIDDEN\x20—\x20use\x20suspend()\x20explicitly','recommendation':'DISCOURAGED\x20—\x20prefer\x20versioned\x20names\x20(_v1,\x20_v2)\x20for\x20production'},'recommendations':['Always\x20provide\x20tags\x20on\x20object\x20creation\x20for\x20filtering\x20and\x20management','Use\x20names\x20as\x20primary\x20identifiers;\x20use\x20short\x20address\x20form\x20(0x1234...def)\x20only\x20for\x20display','All\x20cross-object\x20references\x20(Guard\x20tables,\x20Service\x20bindings,\x20Machine\x20forwards)\x20use\x20NAMES\x20—\x20resolved\x20per-network\x20at\x20build\x20time']};export function checkObjectReuseRules(a){const b=[];for(const c of a){if(!c['is_new'])continue;const d=OBJECT_REUSE_RULES['find'](e=>e['object_type']===c['object_type']);if(!d)continue;(d['recommendation']==='always_reuse'||d['recommendation']==='strongly_recommended')&&b['push']({'rule_id':d['rule_id'],'severity':d['recommendation']==='always_reuse'?'warn':'info','message':'Creating\x20NEW\x20'+c['object_type']+(c['name']?'\x20\x22'+c['name']+'\x22':'')+'\x20—\x20reuse\x20is\x20'+d['recommendation']+':\x20'+d['reason']+'.\x20'+d['ask_user']});}return b;}export function checkImmutabilityRules(a){const b=[];for(const c of a){const d=IMMUTABILITY_RULES['find'](e=>e['object_type']===c['object_type']&&e['trigger']===c['trigger']);if(!d)continue;b['push']({'rule_id':d['rule_id'],'severity':'warn','message':''+c['object_type']+(c['name']?'\x20\x22'+c['name']+'\x22':'')+'\x20'+c['trigger']+':\x20'+d['message']+'.\x20Immutable:\x20['+d['immutable_fields']['join'](',\x20')+']'+(d['mutable_after']?'.\x20Still\x20mutable:\x20['+d['mutable_after']['join'](',\x20')+']':'')});}return b;}export const SAFETY_RULES_VERSION=0x2;
|
|
1
|
+
import{formatMist,GasTokenType,MAINNET_BRIDGE_CONFIG,formatUnits,isFundApprovalExempt}from'@wowok/wowok';export const DEFAULT_VALUE_WARNINGS={'defaultAccount':'Using\x20default\x20account\x20(env.account=\x22\x22)','mainnet':'Operating\x20on\x20mainnet\x20—\x20irreversible','replaceExistName':'replaceExistName=true\x20will\x20unbind\x20the\x20existing\x20name\x20(breaking\x20refs):\x20the\x20previously\x20named\x20object\x20stays\x20on-chain\x20but\x20becomes\x20unreachable\x20by\x20name\x20—\x20any\x20funds\x20it\x20holds\x20(e.g.\x20an\x20old\x20Order\x27s\x20Allocation)\x20are\x20orphaned.\x20Re-running\x20a\x20build\x20with\x20the\x20same\x20name\x20creates\x20a\x20SECOND\x20object,\x20not\x20a\x20replacement','defaultToken':'Using\x20default\x20token\x200x2::wow::WOW'};export const DEFAULT_AMOUNT_THRESHOLD=BigInt(0x174876e800);export function getAmountThreshold(){const a=process['env']['WOWOK_AMOUNT_THRESHOLD'];if(!a)return DEFAULT_AMOUNT_THRESHOLD;try{return BigInt(a);}catch{return DEFAULT_AMOUNT_THRESHOLD;}}export const DEFAULT_FUND_COVERAGE_MIN=0x1;export function getFundCoverageMin(){const a=process['env']['WOWOK_FUND_COVERAGE_MIN'];if(a===undefined||a['trim']()==='')return DEFAULT_FUND_COVERAGE_MIN;const b=Number(a);if(!Number['isFinite'](b)||b<0x0)return DEFAULT_FUND_COVERAGE_MIN;return b;}export function formatAmount(a){return formatMist(a);}function bestEffortTokenType(a){return a?.['object']?.['type_parameter']??a?.['type_parameter'];}function describeAmount(a,b){if(!b||b===GasTokenType)try{return formatMist(a);}catch{return a+'\x20raw\x20smallest\x20units\x20of\x20'+GasTokenType;}return a+'\x20raw\x20smallest\x20units\x20of\x20'+b;}function containsReplaceExistName(a,b,c){if(a===null||typeof a!=='object'||b>0x8)return![];const d=a;if(c['has'](d))return![];c['add'](d);if(d['replaceExistName']===!![])return!![];for(const e of Object['values'](d)){if(containsReplaceExistName(e,b+0x1,c))return!![];}return![];}export function collectDefaultWarnings(a,b){const c=[],d=a?.['account'];(d===undefined||d==='')&&c['push'](DEFAULT_VALUE_WARNINGS['defaultAccount']);const e=a?.['network'];e&&/mainnet/i['test'](String(e))&&c['push'](DEFAULT_VALUE_WARNINGS['mainnet']);const f=b?.['namedNew']??b?.['object'];return f&&typeof f==='object'&&f['replaceExistName']===!![]&&c['push'](DEFAULT_VALUE_WARNINGS['replaceExistName']),b&&typeof b==='object'&&containsReplaceExistName(b,0x0,new Set())&&c['push'](DEFAULT_VALUE_WARNINGS['replaceExistName']),[...new Set(c)];}export const BRIDGE_FUND_OPERATION_TYPES=['cross_chain_wow_to_evm','cross_chain_evm_to_wow','claim_wow_to_evm','resume_transfer','withdraw'];function describeBridgeAmount(a,b,c){if(b==='WOW'||!b&&c==='wow_to_evm')return formatMist(a);const d=MAINNET_BRIDGE_CONFIG?.['tokens']?.['find'](f=>f['symbol']?.['toUpperCase']()===b?.['toUpperCase']()),e=d?c==='wow_to_evm'?d['wowDecimals']:d['evmDecimals']:undefined;if(e===undefined)return a+'\x20raw\x20smallest\x20units\x20of\x20'+(b??'the\x20bridge\x20token');try{return formatUnits(BigInt(a),e)+'\x20'+b;}catch{return a+'\x20raw\x20smallest\x20units\x20of\x20'+b;}}export const CONFIRMATION_RULES=[{'id':'bridge_fund_movement','when':(a,b,c)=>BRIDGE_FUND_OPERATION_TYPES['includes'](a),'level':'irreversible','preview':(a,b,c)=>{const d=typeof b?.['amount']==='string'?b['amount']:undefined,e=typeof b?.['token']==='string'?b['token']:undefined,f=b?.['withdrawTo']??b?.['recipientWowAddress']??b?.['to']??(a==='claim_wow_to_evm'||a==='resume_transfer'?b?.['transferId']:undefined),g=a==='cross_chain_wow_to_evm'?'wow_to_evm':'evm_side';return{'level':'irreversible','operation':a,'irreversible':!![],'network':c?.['network'],'account':c?.['account']??'','amount':d!==undefined?{'value':d,'token':e??(g==='wow_to_evm'?GasTokenType:'ETH'),'human_readable':describeBridgeAmount(d,e,g),'recipient':f}:undefined,'warnings':[...collectDefaultWarnings(c,b),a==='withdraw'?'EVM\x20withdrawal\x20from\x20activeEvmAccount\x20—\x20funds\x20move\x20to\x20an\x20external\x20EVM\x20address;\x20irreversible.':'Cross-chain\x20bridge\x20transfer\x20—\x20funds\x20leave\x20the\x20source\x20chain;\x20recovery\x20(if\x20any)\x20requires\x20the\x20opposite-side\x20claim\x20or\x20resume_transfer,\x20never\x20a\x20rollback.']};},'bypass_on_explicit_intent':[]},{'id':'irreversible_fund_or_verdict','when':(a,b,c)=>{const d=c?.['network'],e=bestEffortTokenType(b)??GasTokenType;if(a==='payment'&&Array['isArray'](b?.['revenue'])&&b['revenue']['length']>0x0){const f=b['revenue']['map'](g=>g?.['amount']?.['balance'])['filter'](g=>typeof g==='string'||typeof g==='number');if(f['length']===b['revenue']['length']&&f['every'](g=>isFundApprovalExempt(d,e,String(g))))return![];return!![];}if(a==='treasury'&&b?.['withdraw']){const g=extractAmount(b);if(g!==null&&isFundApprovalExempt(d,e,g))return![];return!![];}if(a==='payment')return!![];if(a==='arbitration'&&b?.['arbitration']!==undefined)return!![];if(b?.['receive']!==undefined||b?.['owner_receive']!==undefined||b?.['received_coins']!==undefined||b?.['compensation_fund_receive']!==undefined)return!![];if(b?.['alloc_by_guard']!==undefined)return!![];if(a==='reward'&&b?.['claim']!==undefined)return!![];if(a==='service'&&b?.['compensation_fund_withdraw']!==undefined)return!![];if(a==='order'&&b?.['arb_claim_compensation']!==undefined)return!![];if(a==='arbitration'&&(b?.['arb_withdraw']!==undefined||b?.['fees_transfer']!==undefined))return!![];if(a==='treasury'){if(b?.['withdraw'])return!![];return![];}return![];},'level':'irreversible','preview':(a,b,c)=>{let d;if(a==='payment'&&Array['isArray'](b?.['revenue'])&&b['revenue']['length']>0x0){const f=b['revenue']['find'](g=>typeof g?.['amount']?.['balance']==='string'||typeof g?.['amount']?.['balance']==='number');if(f){const g=String(f['amount']['balance']);d={'value':g,'human_readable':describeAmount(g,bestEffortTokenType(b))};}else d={'value':'','human_readable':'entire\x20Coin\x20object(s)\x20(amount\x20resolved\x20by\x20the\x20fund\x20layer)'};}const e=[];return a==='reward'&&b?.['claim']!==undefined&&e['push']('Reward\x20claim\x20—\x20Guard-verified\x20payout\x20splits\x20the\x20pool\x20balance\x20and\x20transfers\x20coins\x20to\x20the\x20claimer;\x20the\x20exact\x20amount\x20is\x20determined\x20by\x20the\x20Reward\x27s\x20guard\x20config.'),a==='service'&&b?.['compensation_fund_withdraw']!==undefined&&e['push']('Compensation\x20fund\x20withdraw\x20—\x20withdraws\x20the\x20ENTIRE\x20compensation_fund\x20into\x20a\x20new\x20Payment\x20owned\x20by\x20\x27'+(b['compensation_fund_withdraw']?.['receipt']??'(recipient)')+'\x27.'),a==='order'&&b?.['arb_claim_compensation']!==undefined&&e['push']('Order\x20compensation\x20claim\x20—\x20splits\x20the\x20Service\x27s\x20compensation_fund\x20and\x20transfers\x20the\x20awarded\x20coins\x20to\x20the\x20caller;\x20irreversible.'),a==='arbitration'&&b?.['arb_withdraw']!==undefined&&e['push']('Arb\x20fee\x20withdraw\x20—\x20sweeps\x20the\x20Arb\x27s\x20fee\x20balance\x20into\x20the\x20Arbitration\x20object\x27s\x20balance.'),a==='arbitration'&&b?.['fees_transfer']!==undefined&&e['push']('Arbitration\x20fees\x20transfer\x20—\x20withdraws\x20the\x20ENTIRE\x20Arbitration\x20balance\x20into\x20a\x20new\x20Payment\x20for\x20the\x20target\x20Allocation/Treasury;\x20irreversible.'),{'level':'irreversible','operation':a,'irreversible':!![],'network':c?.['network'],'account':c?.['account']??'','warnings':[...collectDefaultWarnings(c,b),...e],'amount':a==='payment'&&d?{...d,'token':bestEffortTokenType(b)??GasTokenType,'recipient':b?.['revenue']?.[0x0]?.['recipient']}:undefined};},'bypass_on_explicit_intent':[]},{'id':'publish_immutable','when':(a,b,c)=>{if(a==='service'&&(b?.['publish']===!![]||b?.['bPublished']===!![]))return!![];if(a==='machine'&&b?.['publish']===!![])return!![];return![];},'level':'publish','preview':(a,b,c)=>({'level':'publish','operation':a,'object':b?.['object']??b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','immutable_after':a==='service'?['machine','order_allocators']:['nodes','pairs','forwards'],'warnings':collectDefaultWarnings(c,b)}),'bypass_on_explicit_intent':['force\x20publish','publish\x20now']},{'id':'amount_sensitive','when':(a,b,c)=>{const d=extractAmount(b);if(d!==null){if(isFundApprovalExempt(c?.['network'],bestEffortTokenType(b)??GasTokenType,d))return![];return!![];}if(a==='service'&&b?.['order_new'])return!![];if(a==='treasury'&&b?.['deposit']?.['coin']?.['coin'])return!![];if(a==='reward'&&b?.['coin_add']?.['coin'])return!![];if(a==='allocation'&&b?.['coin']?.['coin'])return!![];return![];},'level':'amount','preview':(a,b,c)=>{const d=extractAmount(b),e=bestEffortTokenType(b);return{'level':'amount','operation':a,'object':b?.['object']??b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','amount':d?{'value':d,'token':e??GasTokenType,'human_readable':describeAmount(d,e)}:{'value':'','token':e??GasTokenType,'human_readable':'entire\x20Coin\x20object\x20(amount\x20resolved\x20on-chain)'},'warnings':collectDefaultWarnings(c,b)};},'bypass_on_explicit_intent':[]},{'id':'default_values','when':(a,b,c)=>{return collectDefaultWarnings(c,b)['length']>0x0;},'level':'standard','preview':(a,b,c)=>({'level':'standard','operation':a,'object':b?.['object']??b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','warnings':collectDefaultWarnings(c,b)}),'bypass_on_explicit_intent':['use\x20default\x20account','default\x20account\x20is\x20fine','use\x20the\x20default\x20account','default\x20account\x20works\x20fine']},{'id':'guard_create_immutable','when':(a,b,c)=>{if(a==='guard')return!![];return![];},'level':'irreversible','preview':(a,b,c)=>{const d=b?.['table']??[],e=b?.['root'],f=b?.['rely'],g=typeof e==='object'&&e!==null&&'type'in e?e['type']:typeof e==='object'&&e!==null&&'type'in e&&e['type']==='file'?'file':'unknown',h=['table','root'];if(f)h['push']('rely');let i='';try{i=JSON['stringify'](e??{});}catch{i='';}const j=[],k=(Array['isArray'](d)?d:[])['filter'](l=>l&&l['b_submission']===!![]&&String(l['value_type'])['toLowerCase']()==='address');if(k['length']>0x0){const l=/order\.service|progress\.machine|arb\.service|order\.machine/i['test'](i);!l&&j['push']('PRE-LINT\x20R-C3-05:\x20submitted\x20Address\x20slot(s)\x20are\x20not\x20bound\x20to\x20this\x20project\x20in\x20the\x20root\x20(no\x20order.service/progress.machine\x20comparison)\x20—\x20a\x20cross-project\x20object\x20can\x20satisfy\x20this\x20Guard.\x20Add\x20the\x20binding\x20BEFORE\x20confirming:\x20the\x20Guard\x20is\x20immutable\x20after\x20creation'),!/signer/i['test'](i)&&j['push']('PRE-LINT\x20identity:\x20submitted\x20data\x20is\x20not\x20tied\x20to\x20the\x20transaction\x20signer\x20(no\x20context(Signer)\x20clause)\x20—\x20anyone\x20able\x20to\x20trigger\x20the\x20host\x20operation\x20can\x20submit\x20arbitrary\x20values.\x20Add\x20a\x20Signer\x20binding\x20if\x20the\x20submitter\x20must\x20be\x20authorized');}return{'level':'irreversible','operation':a,'object':b?.['namedNew']?.['name'],'network':c?.['network'],'account':c?.['account']??'','immutable_after':h,'irreversible':!![],'warnings':[...collectDefaultWarnings(c,b),'Guard\x20is\x20CREATE-only\x20and\x20immutable\x20—\x20cannot\x20be\x20edited\x20or\x20deleted\x20after\x20creation','Table\x20entries:\x20'+d['length']+'\x20(max\x20256)','Root\x20node\x20type:\x20'+g+'\x20(must\x20return\x20Bool)',...f?['Rely\x20dependencies:\x20'+(f['guards']?.['length']??0x0)+'\x20(max\x204,\x20AND/OR\x20logic)']:[],...j,'To\x20modify\x20later:\x20export\x20via\x20guard2file\x20→\x20edit\x20→\x20CREATE\x20new\x20→\x20rebind']};},'bypass_on_explicit_intent':[]},{'id':'guard_gen_passport_test','when':(a,b,c)=>{if(a==='gen_passport')return!![];return![];},'level':'standard','preview':(a,b,c)=>({'level':'standard','operation':a,'object':b?.['guard'],'network':c?.['network'],'account':c?.['account']??'','warnings':[...collectDefaultWarnings(c,b),'gen_passport\x20will\x20consume\x20gas\x20for\x20static\x20testing']}),'bypass_on_explicit_intent':['test\x20guard','testing\x20guard','gen\x20passport','generate\x20passport']},{'id':'progress_advance','when':(a,b,c)=>{if(a!=='progress')return![];return b?.['operate']?.['op']==='next'||b?.['owner_receive']!==undefined;},'level':'standard','preview':(a,b,c)=>({'level':'standard','operation':a,'object':b?.['object'],'network':c?.['network'],'account':c?.['account']??'','warnings':[...collectDefaultWarnings(c,b),'Advancing\x20the\x20progress\x20node\x20may\x20release\x20funds\x20per\x20the\x20machine\x20allocation']}),'bypass_on_explicit_intent':[]}];export function resolveOverrideId(a,b){if(a==='publish_immutable'){if(b==='service')return'service.publish';if(b==='machine')return'machine.publish';return undefined;}if(a==='progress_advance')return'node.advance';if(a==='default_values')return'confirm.default_values';if(a==='guard_gen_passport_test')return'confirm.gen_passport_test';return undefined;}export function extractAmount(a,b){if(!a)return null;const d=i=>{if(typeof i==='number')return String(i);if(typeof i==='string'&&i!=='')return i;return null;},e=[a?.['balance'],a?.['amount'],a?.['compensation_fund_add']?.['balance'],a?.['coin_add']?.['balance'],a?.['coin']?.['balance'],a?.['order_new']?.['buy']?.['total_pay']?.['balance'],a?.['dispute']?.['fee']?.['balance'],a?.['fee'],a?.['arbitration']?.['indemnity'],a?.['deposit']?.['coin']?.['balance'],a?.['withdraw']?.['amount']?.['fixed']],f=[];for(const i of e){const j=d(i);if(j!==null)f['push'](j);}if(Array['isArray'](a?.['revenue']))for(const k of a['revenue']){const l=d(k?.['amount']?.['balance']);if(l!==null)f['push'](l);}if(Array['isArray'](a?.['guard_add']))for(const m of a['guard_add']){if(m?.['amount']?.['type']==='Fixed'){const n=d(m['amount']['value']);if(n!==null)f['push'](n);}}if(!b?.['excludeConfigAmounts'])for(const o of[a?.['allocators'],a?.['order_allocators']]){if(!o||typeof o!=='object')continue;const p=d(o['threshold']);if(p!==null)f['push'](p);for(const q of Array['isArray'](o['allocators'])?o['allocators']:[]){if(Array['isArray'](q?.['sharing']))for(const u of q['sharing']){if(u?.['mode']==='Amount'){const w=d(u['sharing']);if(w!==null)f['push'](w);}}const t=d(q?.['max']);if(t!==null)f['push'](t);}}const h=f['filter'](x=>{try{return BigInt(x)!==0x0n;}catch{return!![];}});if(h['length']===0x0)return null;if(h['length']===0x1)return h[0x0];try{return h['reduce']((x,y)=>x+BigInt(y),0x0n)['toString']();}catch{return h[0x0];}}export const OBJECT_REUSE_RULES=[{'rule_id':'REUSE-001','object_type':'permission','recommendation':'strongly_recommended','reason':'Centralized\x20permission\x20control\x20across\x20all\x20services','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Permission\x20to\x20reuse?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-002','object_type':'machine','recommendation':'recommended','reason':'Save\x20design\x20time\x20for\x20similar\x20processes','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Machine\x20whose\x20workflow\x20fits?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-003','object_type':'guard','recommendation':'recommended','reason':'Avoid\x20redundant\x20validation\x20rules','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Guard\x20with\x20matching\x20validation\x20logic?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-004','object_type':'contact','recommendation':'recommended','reason':'Single\x20point\x20of\x20customer-service\x20management','ask_user':'Do\x20you\x20have\x20an\x20existing\x20Contact\x20for\x20customer\x20service?\x20Provide\x20the\x20name\x20or\x20ID.'},{'rule_id':'REUSE-005','object_type':'arbitration','recommendation':'always_reuse','reason':'Customers\x20choose\x20from\x20established\x20arbiters;\x20creating\x20a\x20new\x20Arbitration\x20is\x20an\x20operator-level\x20decision','ask_user':'Which\x20existing\x20Arbitration\x20service\x20should\x20disputes\x20route\x20to?\x20Provide\x20the\x20name\x20or\x20ID.'}];export const CREATE_VS_MODIFY_PATTERN={'reuse_form':'string','create_form':'object','resolution_api':'GetObjectExisted','note':'String\x20reference\x20=\x20REUSE\x20(name\x20resolution\x20failure\x20is\x20a\x20hard\x20error);\x20object\x20shape\x20=\x20CREATE\x20(always).'};export const IMMUTABILITY_RULES=[{'rule_id':'IMMUT-001','object_type':'machine','trigger':'publish','immutable_fields':['nodes','pairs','forwards'],'message':'Machine\x20topology\x20is\x20immutable\x20after\x20publish\x20—\x20verify\x20all\x20nodes/forwards\x20via\x20machineNode2file\x20BEFORE\x20publishing'},{'rule_id':'IMMUT-002','object_type':'service','trigger':'publish','immutable_fields':['machine','order_allocators'],'mutable_after':['arbitrations','rewards','sales'],'message':'Service.machine\x20and\x20order_allocators\x20are\x20PERMANENTLY\x20frozen\x20after\x20publish\x20(L1);\x20arbitrations/rewards\x20can\x20still\x20be\x20ADDED\x20but\x20remove/clear\x20is\x20time-locked\x20(L2:\x20pause\x20+\x20setting_lock_duration);\x20sales\x20remains\x20fully\x20modifiable\x20(L3)\x20without\x20pause'},{'rule_id':'IMMUT-003','object_type':'guard','trigger':'create','immutable_fields':['table','root','rely'],'message':'Guard\x20is\x20CREATE-only\x20and\x20immutable\x20—\x20cannot\x20be\x20edited\x20or\x20deleted\x20after\x20creation.\x20To\x20change:\x20export\x20via\x20guard2file\x20→\x20edit\x20→\x20CREATE\x20new\x20→\x20rebind'}];export const PROTOCOL_SLOT_RULES=[{'rule_id':'TASKBIND-01','slot':0xfe,'asserted_by':['progress::assert_task_binding\x20—\x20every\x20guarded\x20forward\x20of\x20a\x20machine\x20running\x20on\x20an\x20order\x20Progress\x20requires\x20a\x20slot-254\x20passport\x20submission\x20(aborts\x20code\x2011)'],'required_declaration':'{\x20identifier:\x20254,\x20b_submission:\x20true,\x20value_type:\x20\x27Address\x27\x20}\x20—\x20the\x20passing\x20order\x20address\x20is\x20written\x20by\x20order\x20creation','violation':'A\x20Guard\x20bound\x20to\x20a\x20machine\x20forward\x20without\x20this\x20row\x20aborts\x20every\x20forward\x20traversal\x20once\x20an\x20order\x20drives\x20the\x20Progress;\x20the\x20table\x20is\x20frozen\x20at\x20creation,\x20so\x20the\x20path\x20strands\x20permanently.','message':'Any\x20Guard\x20bound\x20on\x20a\x20machine\x20forward\x20MUST\x20declare\x20protocol\x20slot\x20254\x20(task\x20binding)\x20as\x20a\x20b_submission\x20Address\x20row.\x20The\x20compile\x20kernel\x20auto-injects\x20the\x20row\x20for\x20edge-bound\x20guards;\x20guard\x20templates\x20ship\x20it\x20in\x20example_table.'},{'rule_id':'TASKBIND-02','slot':-0x1,'asserted_by':['allocation::assert\x20—\x20each\x20{GuardIdentifier:N}\x20allocator\x20leg\x20requires\x20a\x20passport\x20submission\x20at\x20slot\x20N\x20equal\x20to\x20payment_info.for_object\x20(aborts\x20with\x20funds\x20already\x20escrowed)'],'required_declaration':'{\x20identifier:\x20N,\x20b_submission:\x20true,\x20value_type:\x20\x27Address\x27,\x20object_type:\x20\x27Order\x27\x20}\x20for\x20EVERY\x20slot\x20N\x20named\x20by\x20a\x20GuardIdentifier\x20allocator\x20leg','violation':'A\x20static\x20Address\x20slot\x20in\x20the\x20same\x20position\x20passes\x20creation\x20but\x20fails\x20the\x20same\x20allocation\x20assertion\x20(N-11)\x20—\x20the\x20distribution\x20aborts\x20and\x20escrowed\x20funds\x20stay\x20stranded\x20(amz-7f3a2c91:\x200.98991\x20WOW).','message':'Every\x20allocator\x20{GuardIdentifier:N}\x20leg\x20MUST\x20point\x20at\x20a\x20Guard\x20table\x20slot\x20N\x20declared\x20as\x20a\x20b_submission\x20Address\x20row.\x20The\x20compile\x20kernel\x20blocks\x20publish\x20when\x20the\x20slot\x20is\x20undeclared\x20(GUARD_SLOT_UNKNOWN).'}];export const OPERATION_TYPE_CLASSIFICATION={'LOCAL_ONLY':['account_operation','local_mark_operation','local_info_operation','config_operation'],'ONCHAIN':['onchain_operations','wip_file','bridge_operation','messenger_operation'],'QUERY':['query_toolkit','onchain_table_data','onchain_events','guard2file','machineNode2file','schema_query','wowok_buildin_info'],'ENCRYPTED':['messenger_operation']};export const OPERATION_CLASS_META={'LOCAL_ONLY':{'gas':![],'confirmation_required':![],'note':'Local\x20state\x20only\x20—\x20no\x20gas,\x20no\x20confirmation\x20needed'},'ONCHAIN':{'gas':!![],'confirmation_required':!![],'note':'On-chain\x20write\x20—\x20gas\x20consumed,\x20explicit\x20user\x20confirmation\x20REQUIRED\x20before\x20execution'},'QUERY':{'gas':![],'confirmation_required':![],'note':'Read-only\x20—\x20no\x20gas,\x20no\x20confirmation\x20needed'},'ENCRYPTED':{'gas':![],'confirmation_required':![],'note':'Local\x20encryption\x20—\x20no\x20gas,\x20no\x20confirmation\x20needed'}};export function classifyTool(a){if(OPERATION_TYPE_CLASSIFICATION['ENCRYPTED']['includes'](a))return'ENCRYPTED';for(const b of['LOCAL_ONLY','ONCHAIN','QUERY']){if(OPERATION_TYPE_CLASSIFICATION[b]['includes'](a))return b;}return undefined;}export const NAMING_CONVENTIONS={'scheme':'<projectPrefix>_<type>_<purpose>_<version>','parts':{'project_prefix':{'example':'shopFunny_','purpose':'Prevents\x20cross-project\x20collisions'},'type_prefix':{'example':'machine_\x20/\x20guard_\x20/\x20service_','purpose':'Clarifies\x20object\x20type'},'purpose_suffix':{'example':'serviceWithdraw','purpose':'Describes\x20function'},'version_suffix':{'example':'_v2','purpose':'Enables\x20iteration\x20without\x20replaceExistName'}},'entry_id':{'pattern':'^<object_type>:<name>$','example':'service:myshop_service'},'replace_exist_name':{'default':![],'false_effect':'Throws\x20error\x20if\x20name\x20is\x20in\x20use\x20—\x20safe\x20default','true_effect':'Existing\x20object/account\x20with\x20the\x20same\x20name\x20is\x20suspended/unbound\x20to\x20free\x20the\x20name','account_default_forbidden':'replaceExistName:true\x20on\x20the\x20default\x20account\x20(name=\x27\x27)\x20is\x20FORBIDDEN\x20—\x20use\x20suspend()\x20explicitly','recommendation':'DISCOURAGED\x20—\x20prefer\x20versioned\x20names\x20(_v1,\x20_v2)\x20for\x20production'},'recommendations':['Always\x20provide\x20tags\x20on\x20object\x20creation\x20for\x20filtering\x20and\x20management','Use\x20names\x20as\x20primary\x20identifiers;\x20use\x20short\x20address\x20form\x20(0x1234...def)\x20only\x20for\x20display','All\x20cross-object\x20references\x20(Guard\x20tables,\x20Service\x20bindings,\x20Machine\x20forwards)\x20use\x20NAMES\x20—\x20resolved\x20per-network\x20at\x20build\x20time']};export function checkObjectReuseRules(a){const b=[];for(const c of a){if(!c['is_new'])continue;const d=OBJECT_REUSE_RULES['find'](e=>e['object_type']===c['object_type']);if(!d)continue;(d['recommendation']==='always_reuse'||d['recommendation']==='strongly_recommended')&&b['push']({'rule_id':d['rule_id'],'severity':d['recommendation']==='always_reuse'?'warn':'info','message':'Creating\x20NEW\x20'+c['object_type']+(c['name']?'\x20\x22'+c['name']+'\x22':'')+'\x20—\x20reuse\x20is\x20'+d['recommendation']+':\x20'+d['reason']+'.\x20'+d['ask_user']});}return b;}export function checkImmutabilityRules(a){const b=[];for(const c of a){const d=IMMUTABILITY_RULES['find'](e=>e['object_type']===c['object_type']&&e['trigger']===c['trigger']);if(!d)continue;b['push']({'rule_id':d['rule_id'],'severity':'warn','message':''+c['object_type']+(c['name']?'\x20\x22'+c['name']+'\x22':'')+'\x20'+c['trigger']+':\x20'+d['message']+'.\x20Immutable:\x20['+d['immutable_fields']['join'](',\x20')+']'+(d['mutable_after']?'.\x20Still\x20mutable:\x20['+d['mutable_after']['join'](',\x20')+']':'')});}return b;}export const SAFETY_RULES_VERSION=0x3;
|