@routinecrew/routinecode 2.31.77 → 2.31.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/cli.sh +23 -0
- package/bin/prompt-vault.dat +1 -0
- package/bin/prompt-vault.js +51 -1
- package/bin/rc-board.js +58 -0
- package/bin/rc-config.js +756 -1
- package/bin/rc-credit-turn.js +2 -1
- package/bin/rc-grant.js +2 -1
- package/bin/rc-login.js +2 -0
- package/bin/rc-map.js +132 -0
- package/bin/rc-privacy.js +200 -0
- package/bin/rc-skills.js +31 -0
- package/bin/rc-team.js +2 -1
- package/bin/setup.js +4 -0
- package/hooks/cc-compat-watch.js +2 -1
- package/hooks/claim-questions.json +40 -0
- package/hooks/hooks-config.json +108 -1
- package/hooks/lib/agent_budget.py +122 -0
- package/hooks/lib/agent_telemetry.py +143 -0
- package/hooks/lib/attest_reader.py +15 -6
- package/hooks/lib/attribution_judge.py +109 -0
- package/hooks/lib/board-golden.json +268 -0
- package/hooks/lib/board.py +503 -0
- package/hooks/lib/board_sync.py +535 -0
- package/hooks/lib/cc-surface.json +1 -1
- package/hooks/lib/claim_structure.py +412 -0
- package/hooks/lib/completion_log.py +12 -5
- package/hooks/lib/config_bash_track.py +114 -28
- package/hooks/lib/config_guard.py +137 -5
- package/hooks/lib/edit_tracker.py +182 -0
- package/hooks/lib/error_line.py +94 -0
- package/hooks/lib/escalation_restore.py +66 -0
- package/hooks/lib/i18n.py +37 -15
- package/hooks/lib/knowledge_items.py +1407 -0
- package/hooks/lib/knowledge_scope.py +123 -0
- package/hooks/lib/known_solution.py +37 -9
- package/hooks/lib/log_compact.py +85 -0
- package/hooks/lib/metacog_signals.py +228 -0
- package/hooks/lib/orch_decision.py +690 -0
- package/hooks/lib/premise-golden.json +96 -0
- package/hooks/lib/presence.py +10 -3
- package/hooks/lib/privacy_log.py +35 -0
- package/hooks/lib/receipt.py +137 -14
- package/hooks/lib/review_gate.py +83 -0
- package/hooks/lib/routine_skill_eval.py +213 -0
- package/hooks/lib/secret_filter.py +2 -1
- package/hooks/lib/skill_drafts.py +188 -0
- package/hooks/lib/sync_manager.py +121 -26
- package/hooks/lib/usage_v2.py +680 -0
- package/hooks/lib/work_kind.py +198 -0
- package/hooks/lib/work_kind_events.py +361 -0
- package/hooks/pending-drainer.sh +28 -0
- package/hooks/post-agent-budget.sh +50 -0
- package/hooks/post-agent-return.sh +89 -3
- package/hooks/post-bash-failure.sh +39 -0
- package/hooks/post-bash-knowledge.sh +15 -34
- package/hooks/post-bash-verify.sh +33 -16
- package/hooks/post-build-check.sh +16 -18
- package/hooks/post-config-context.sh +13 -0
- package/hooks/post-delegation-nudge.sh +12 -1
- package/hooks/post-edit-track.sh +19 -28
- package/hooks/post-orch-decision.sh +35 -0
- package/hooks/post-read-config-context.sh +20 -0
- package/hooks/pre-account-guard.sh +1 -1
- package/hooks/pre-agent-spawn.mjs +2 -1
- package/hooks/pre-agent-spawn.sh +12 -1
- package/hooks/pre-bash-guard.sh +61 -3
- package/hooks/pre-bash-knowledge.sh +46 -0
- package/hooks/pre-credit-guard.sh +1 -1
- package/hooks/pre-edit-board.sh +44 -0
- package/hooks/pre-edit-check.sh +29 -5
- package/hooks/pre-edit-config-gate.sh +1 -1
- package/hooks/pre-edit-domain-gate.sh +23 -22
- package/hooks/pre-mark-complete.sh +32 -4
- package/hooks/pre-read-knowledge-inject.sh +34 -24
- package/hooks/pre-review-gate.sh +17 -0
- package/hooks/recorder-runner.sh +25 -2
- package/hooks/session-start-compact.sh +28 -0
- package/hooks/session-start.sh +167 -19
- package/hooks/skill-knowledge.sh +37 -0
- package/hooks/stop-claim-check.v3.sh +21 -3
- package/hooks/stop-usage-metrics.sh +138 -83
- package/hooks/subagent-stop-usage.sh +25 -0
- package/hooks/user-prompt-submit.sh +10 -4
- package/mcp-db-manager/dist/analyzers/duplicate-detector.js +1 -1
- package/mcp-db-manager/dist/core/model-parser.js +1 -1
- package/mcp-db-manager/dist/core/schema-reader.js +1 -1
- package/mcp-db-manager/dist/executors/migration-executor.js +1 -1
- package/mcp-db-manager/dist/generators/migration-generator.js +1 -1
- package/mcp-db-manager/dist/index.js +1 -1
- package/mcp-db-manager/dist/validators/schema-validator.js +1 -1
- package/mcp-dev-tester/dist/analyzers/auth-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/analyzers/backend-analyzer.js +1 -1
- package/mcp-dev-tester/dist/analyzers/endpoint-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/analyzers/frontend-analyzer.js +1 -1
- package/mcp-dev-tester/dist/analyzers/runtime-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/analyzers/type-comparator.js +1 -1
- package/mcp-dev-tester/dist/analyzers/validation-diagnoser.js +1 -1
- package/mcp-dev-tester/dist/attestation.js +1 -1
- package/mcp-dev-tester/dist/browser/playwright-manager.js +1 -1
- package/mcp-dev-tester/dist/browser/ui-tester.js +1 -1
- package/mcp-dev-tester/dist/config/project-config.js +1 -1
- package/mcp-dev-tester/dist/index.js +1 -1
- package/mcp-dev-tester/dist/testers/api-tester.js +1 -1
- package/mcp-doc-fetcher/dist/index.js +1 -1
- package/mcp-html-renderer/dist/index.js +1 -1
- package/mcp-html-renderer/dist/preview.js +1 -1
- package/mcp-html-renderer/dist/template-engine.js +1 -1
- package/mcp-intelligence/dist/concept-catalog.js +1 -1
- package/mcp-intelligence/dist/concept-server-proxy.js +1 -1
- package/mcp-intelligence/dist/config-auth.js +1 -1
- package/mcp-intelligence/dist/contracts.generated.js +1 -1
- package/mcp-intelligence/dist/domain-templates.js +1 -1
- package/mcp-intelligence/dist/grounding.js +1 -1
- package/mcp-intelligence/dist/handlers.js +1 -1
- package/mcp-intelligence/dist/index.js +1 -1
- package/mcp-intelligence/dist/intelligence-file.js +1 -1
- package/mcp-intelligence/dist/knowledge-critic.js +1 -1
- package/mcp-intelligence/dist/knowledge-guide.js +1 -0
- package/mcp-intelligence/dist/knowledge-handlers.js +1 -1
- package/mcp-intelligence/dist/knowledge-migrate.js +1 -0
- package/mcp-intelligence/dist/knowledge-record.js +1 -0
- package/mcp-intelligence/dist/knowledge-scope.js +1 -0
- package/mcp-intelligence/dist/mention-extractor.js +1 -1
- package/mcp-intelligence/dist/provenance.js +1 -1
- package/mcp-intelligence/dist/sanitize.generated.js +242 -0
- package/mcp-intelligence/dist/semantic-embedder.js +1 -1
- package/mcp-log-watcher/dist/config-auth.js +1 -1
- package/mcp-log-watcher/dist/file-watcher.js +1 -1
- package/mcp-log-watcher/dist/index.js +1 -1
- package/mcp-log-watcher/dist/known-solutions.js +1 -1
- package/mcp-log-watcher/dist/log-store.js +1 -1
- package/mcp-log-watcher/dist/sanitize.generated.js +242 -0
- package/mcp-log-watcher/dist/websocket-server.js +1 -1
- package/mcp-log-watcher/package.json +1 -1
- package/mcp-plan-manager/dist/__tests__/file-ops-knowledge-dir.test.js +1 -1
- package/mcp-plan-manager/dist/__tests__/plan-parser.test.js +1 -1
- package/mcp-plan-manager/dist/file-ops.js +1 -1
- package/mcp-plan-manager/dist/index.js +1 -1
- package/mcp-plan-manager/dist/plan-parser.js +1 -1
- package/mcp-project-context/dist/git-ops.js +1 -1
- package/mcp-project-context/dist/index.js +1 -1
- package/mcp-project-context/dist/project-analysis.js +1 -1
- package/mcp-routinecode/dist/agent-tracker.js +1 -1
- package/mcp-routinecode/dist/analysis-ledger.js +590 -0
- package/mcp-routinecode/dist/attestation.js +1 -1
- package/mcp-routinecode/dist/blast-radius.js +1 -1
- package/mcp-routinecode/dist/board.js +1 -0
- package/mcp-routinecode/dist/build-id.js +1 -0
- package/mcp-routinecode/dist/changeset.js +1 -1
- package/mcp-routinecode/dist/config-auth.js +1 -1
- package/mcp-routinecode/dist/config-map/applied.js +1 -0
- package/mcp-routinecode/dist/config-map/arch-graph.js +1 -1
- package/mcp-routinecode/dist/config-map/architect-store.js +1132 -1
- package/mcp-routinecode/dist/config-map/assign.js +1 -1
- package/mcp-routinecode/dist/config-map/audit-cli.js +1 -1
- package/mcp-routinecode/dist/config-map/audit.js +1 -1
- package/mcp-routinecode/dist/config-map/blocks.js +1 -1
- package/mcp-routinecode/dist/config-map/briefing.js +541 -1
- package/mcp-routinecode/dist/config-map/certify.js +10 -5
- package/mcp-routinecode/dist/config-map/const-use.js +1 -1
- package/mcp-routinecode/dist/config-map/context.js +219 -0
- package/mcp-routinecode/dist/config-map/convention-candidates.js +1 -0
- package/mcp-routinecode/dist/config-map/decisions.js +1 -1
- package/mcp-routinecode/dist/config-map/decls.js +1 -1
- package/mcp-routinecode/dist/config-map/drift.js +1 -1
- package/mcp-routinecode/dist/config-map/dup-safety.js +1 -1
- package/mcp-routinecode/dist/config-map/extract.js +1 -1
- package/mcp-routinecode/dist/config-map/field-contract.js +1 -1
- package/mcp-routinecode/dist/config-map/gate.js +796 -1
- package/mcp-routinecode/dist/config-map/hash.js +1 -1
- package/mcp-routinecode/dist/config-map/ident-norm.js +1 -1
- package/mcp-routinecode/dist/config-map/index-store.js +1051 -1
- package/mcp-routinecode/dist/config-map/light-eval.js +253 -1
- package/mcp-routinecode/dist/config-map/link.js +1 -1
- package/mcp-routinecode/dist/config-map/linked-repos.js +1 -1
- package/mcp-routinecode/dist/config-map/lookup.js +1 -1
- package/mcp-routinecode/dist/config-map/louvain.js +1 -1
- package/mcp-routinecode/dist/config-map/maintenance-cli.js +1 -1
- package/mcp-routinecode/dist/config-map/names.js +1 -1
- package/mcp-routinecode/dist/config-map/post-bash-eval.js +105 -0
- package/mcp-routinecode/dist/config-map/proposals.js +1 -1
- package/mcp-routinecode/dist/config-map/ratchet.js +148 -0
- package/mcp-routinecode/dist/config-map/recheck.js +148 -1
- package/mcp-routinecode/dist/config-map/repo-id.js +1 -1
- package/mcp-routinecode/dist/config-map/route-security.js +1 -1
- package/mcp-routinecode/dist/config-map/rule-import.js +1 -1
- package/mcp-routinecode/dist/config-map/scc.js +1 -1
- package/mcp-routinecode/dist/config-map/shape-eval.js +1 -1
- package/mcp-routinecode/dist/config-map/shape.js +1 -1
- package/mcp-routinecode/dist/config-map/snapshot.js +1 -1
- package/mcp-routinecode/dist/config-map/sole-impl.js +1 -1
- package/mcp-routinecode/dist/config-map/stable-id.js +1 -1
- package/mcp-routinecode/dist/config-map/store.js +1 -1
- package/mcp-routinecode/dist/config-map/swagger-check.js +1 -1
- package/mcp-routinecode/dist/config-map/task-eval.js +369 -1
- package/mcp-routinecode/dist/config-map/templates.js +1 -1
- package/mcp-routinecode/dist/contracts.generated.js +1 -1
- package/mcp-routinecode/dist/coverage.js +1 -1
- package/mcp-routinecode/dist/edit-tracker.js +1 -0
- package/mcp-routinecode/dist/explorer-advisor.js +1 -1
- package/mcp-routinecode/dist/failure-tracker.js +1 -1
- package/mcp-routinecode/dist/file-lock-registry.js +1 -1
- package/mcp-routinecode/dist/file-risk-scorer.js +1 -1
- package/mcp-routinecode/dist/index.js +1 -1
- package/mcp-routinecode/dist/known-solutions.js +1 -1
- package/mcp-routinecode/dist/ledger-miner.js +1 -1
- package/mcp-routinecode/dist/normalize-sig.js +1 -0
- package/mcp-routinecode/dist/observed-draft.js +1 -1
- package/mcp-routinecode/dist/observed-escalation.js +1 -0
- package/mcp-routinecode/dist/pattern-matcher.js +1 -1
- package/mcp-routinecode/dist/route-match.js +1 -1
- package/mcp-routinecode/dist/routines.js +1 -1
- package/mcp-routinecode/dist/rule-engine.js +1 -1
- package/mcp-routinecode/dist/rule-promoter.js +1 -1
- package/mcp-routinecode/dist/sanitize.generated.js +242 -0
- package/mcp-routinecode/dist/session-registry.js +1 -0
- package/mcp-routinecode/dist/skill-pack/sync.js +629 -0
- package/mcp-routinecode/dist/skill-pack/validate.js +278 -0
- package/mcp-routinecode/dist/telemetry-analyzer.js +1 -1
- package/mcp-routinecode/dist/test-runner.js +1 -1
- package/mcp-routinecode/dist/verification.js +1 -1
- package/mcp-routinecode/dist/viral-loop.js +1 -1
- package/mcp-routinecode/package.json +1 -1
- package/package.json +3 -3
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/agents/analyzer.md.sealed +1 -1
- package/plugin/agents/architect.md.sealed +1 -1
- package/plugin/agents/crawler.md.sealed +1 -1
- package/plugin/agents/explorer.md.sealed +1 -1
- package/plugin/agents/implementor.md.sealed +1 -1
- package/plugin/agents/looker.md.sealed +1 -1
- package/plugin/agents/planner.md.sealed +1 -1
- package/plugin/agents/recorder.md.sealed +1 -1
- package/plugin/agents/reviewer.md.sealed +1 -1
- package/plugin/agents/verifier.md.sealed +1 -1
- package/plugin/commands/analyze.md.sealed +1 -1
- package/plugin/commands/plan.md.sealed +1 -1
- package/plugin/commands/rc.md.sealed +1 -1
- package/plugin/commands/receipt.md.sealed +1 -1
- package/plugin/commands/recharge.md.sealed +1 -1
- package/plugin/commands/routines.md.sealed +1 -1
- package/plugin/commands/share.md.sealed +1 -1
- package/plugin/routinecode-prompt.md.sealed +1 -1
|
@@ -1 +1,253 @@
|
|
|
1
|
-
const a23_0x804811=a23_0x1c0e;(function(_0x445c56,_0x4e6220){const _0x2c0239=a23_0x1c0e,_0x567d5d=_0x445c56();while(!![]){try{const _0x7acb75=-parseInt(_0x2c0239(0x12f,'A6Bd'))/(-0x13b4+-0x2e7*0x1+0x169c)*(parseInt(_0x2c0239(0x19e,'Jft]'))/(0x208c+0x143a+0x1*-0x34c4))+parseInt(_0x2c0239(0x17a,'A@sL'))/(0x26c8+-0xa4f*-0x3+-0x16*0x32b)*(-parseInt(_0x2c0239(0x1ce,'rLLn'))/(-0x44a*0x5+-0x15df+0x2b55))+-parseInt(_0x2c0239(0x199,'didJ'))/(0x1c*-0xd0+-0x2659+0x3d1e)*(parseInt(_0x2c0239(0x153,'bGGL'))/(0x532*-0x6+0x565+0x19cd))+parseInt(_0x2c0239(0x19f,'@K%j'))/(0x226a+0x23f6+-0x4659)*(parseInt(_0x2c0239(0x157,'k9M]'))/(-0x9f1*0x2+0x15e6+-0x1fc))+-parseInt(_0x2c0239(0x1e5,'T1Co'))/(-0x35*-0x16+-0x575*0x3+0xbda)+-parseInt(_0x2c0239(0x15b,'Y2X['))/(0x3e*-0x58+-0x86f*0x2+-0x4c7*-0x8)*(parseInt(_0x2c0239(0x1a6,'T1Co'))/(0x1f96+0x290*-0xe+-0x455*-0x1))+-parseInt(_0x2c0239(0x146,'NlV6'))/(0x2331+-0xf8b+-0x1*0x139a)*(-parseInt(_0x2c0239(0x189,'Llc*'))/(-0x2*0xb56+-0x148e+0x4cf*0x9));if(_0x7acb75===_0x4e6220)break;else _0x567d5d['push'](_0x567d5d['shift']());}catch(_0x10d2da){_0x567d5d['push'](_0x567d5d['shift']());}}}(a23_0x2f6a,0xcc791*-0x1+0x19f*-0x413+0x1*0x1ad1eb));import*as a23_0x326afc from'fs';function a23_0x2f6a(){const _0x22c57f=['iIbBWQS','wce/dL7cLmkpW7q','W6jFW67dJmkF','b8kdW4S','WPCkWQe','W6LqW6FdPCksamo4','WR4oWRRcNSojxmkOW6vfcK3cRmoF','WOaTWOeccH/cQmk0WOa','zSoGxWS','FSkepmogrfmgfYG','WOzVWRWaBvFcRfDp','WPbGWRKbBeNcOq','swrNySoMW5q','W6vnW4xdGmkxcW','WOOPWOOgdapcVCkzWOtcLmk/','nSoXhcff','W6fFW7ddGSkEcG','WPtcKgNcHw1kaq','EsRcRa','utZcQmovmSohaW9K','aqfHtJyHAXi1W74','mN/cN8ko','W6bsWQZdTG','cCkyWOnM','WPqkWRX0','EauNWQimW7JcISo8','yetdLIxcKa','W7RdT0SQ','WRjbBvRdHWBcUxlcTW','F8ofCCogWQK','o8oyW7BdQW','W65rW6FdKmkZd8oUW4a','t0Cbc8kF','m3tcJSklW4pdSmosteJdM1W','g1FcSG','nmoYesDtbwZcSSoN','oIxcSZLI','DLufma','v8khWPC','vxr6Bq','y8ouW4TN','kNVcNSkFW4tdMSkz','WOTVWR8k','BqaSWQi','omkukCklW7VcSCoZDSoCWOb/','o8o9ubS','oSoIwr3cUq','EfldHshcS8kCW4e6','W6fiWRldPW','ihBcHSkoW7VdTmkp','nmoBW6NdQSoS','eK7cV3TJ','sd0PcMtcLSkxW4pdUKGX','a8kMv8odlW','pmkmiG','g8oDtq3cI07dHa','WPGeWRvOW44YWQpdGq','WQTffmohWPjhha','wSo6WPe','aaT7wq','oIpcVJ0','a8ohuGe','WPlcPeKbrG','AmoAASkfoJ0','iCoxW5z6','pCkipmofvum','wvCoaG','yCkbWRRcS8k5W5VdOCofW7W7nmol','ECk/bKRcRJVdISkyWRZdQG','rWv/rseTiai','nmoDW6tdRG','qGL2tYe','F8oeW75oW6ddHCkF','FIFcPmk+WRRdTG','xsrqfIlcVueWcCoTW5C','W4RcOM8Y','WQddOmk1W5S','jGhcTNDTcKO','ESobAq','uuBcQhP0tSo1W7aPW4W','WOq6jCo8tsBcIZtcNsXKEue','k8oaW6VdUCo0WPRdVCoEW4O3','gmkhW4VdN8kgpai','W4f0z8kVm3VdKWO','W7TAlSoRWQnKgq','WQ1lfCogWPm','c8kItCoklG','EIhcRmkZWPFdPCotmq','WRRcTSo6WONcJSoIzWJcPSoyqG','W6z1W4jMgW','f8kneMe','lSovW6BdVSoL','n8kepSohgW','qG1HtsCX','WQ3dQSkO','WOBdMKNcGW','q8o6WOq','qCoQWPVdRa','WOtcOKKq','aJu7ga','kKOA','nxhcJSkkW7ldSmkptq','nJRcUW','qg9T','mhVcI8kpW5m','WPJcLNFcJ2LvfW','WPz6WRmDD03cMf9xfa','rSo+WPaF','axWy','lSoIrXRcOZNcRmkgWRddKx7dKYb8','qSoRWONdShL+WPNdRa','gCkhggpdUq','pSoxW4j6','v2rL','z8keb27dTSoxx2aDWRtdSCkMiG','iSo3hdbtgG','W6rFW7a','W6zVW4jN','WOldK1DArhVdVmoRqSkmeG','mXuEgINdPXr6','W6/dO8kRW5xdJq','aNiAtNxcKfSqhG','WQ7dQSk/W5NdUW','W7H7W5XQbW','s8kjWP55WPHO','BGu6WQK','r8oVcG','BrldQSk7WQ8ylCoCW7C','oCohW4H6W67dMSkyWQ0','WOZdNetcHLW','ttqMcMlcQSkrW6JdVuWSzZ8','FcVcQ8kMWQW','W4RcPMSJiq','oSoOwq','amkSW5JdJuDlWPRdJCka','CvBdPsCOxG7dGSkQWRjUa8om','W6jJW4fQ','FMRcSCkYW6ldHmkj','nSo7ha','dCkhW48','WPykWQH0W7q','kCoHxbNcUq3dS8ktWRFdJhldKYe','iSoAW7xcUmoB','pSouW7/cTmor','lmo/aW','W5DIC8kZnhtdJbS','W6brW6ddImkx','w8oWWOhdQG','WP8fWRvDW689WRu','o8ovW6tdPmoUWOddICowW5i','mCogyCkGlYldHG','a8kpW4VdNmkvkWiQ','W6nrWR/dOurLcWFdMq','Eru9','Bu4korRdUZHX','xMCUCLxcJvK','nCoAwZ7cTCk/huWyWPRdGSkLmG','o8oyW7BcVSorcrO','W4v4zmkI','xc08aW','nCkinSouF2BcHbxcSmkjW6HYvW','tX/dSIyMuCkZW6ajW64t','AKeema','WR0mWRdcM8kFcmowW4zXeW','gv14zruHdb4','w8oVWPGz','jdreWRBcTq','W4hcJaOE','Eb87WQmrW7xdImo2WOjaWQDPW5zSeSomW5O','kSorW6y','W6r/W50','WOfRWRqoDLlcU3HceCkV','pColW4T3','fhBdQmo5','W6JdO0SNW4VcPCkAW6u','lWxcOa','n8oNhx4','xYeIcx7cLG','jSomW7BcTmoSeWxdQW','tuSoe8kjpq','WOLNWRWk','W4dcLWqyaa','geBcQNSR','pJrrWQBcOG','AmowASkh','vCkjWPW','WPBcKgZcJW','ASkbagO','nGhcQgi','smkQwSoloCkhW7JcGX4','rmoxsZFcS3RcQHZcLSoVW4rS','W6tdO1uNW5BcTmkwW6mq','w1CrdW','gCkhhw7dVYtcLsdcTCoMW40','kmogW4W','W7HhW7pdJa','mrdcSwrS','rmo2WPmF','AIhcPmkV','WR/dU10aW4tcS8kb','jIXyWQBcN8oRxd4','rSoVa8kTW6y','o8oFW5rQW4q','WQieW6BcTXDjhtpdN8kOWQW','mbmJWRi','ESk9de/dUg/cTmk7WOJdS13dTZ4','aCkSrSonnCkBW7VcMqZcGCoTWO/dQh4','W6BdP1yLW5hcRa','nmoCW6RcPCogdW','WOGJWP4feaVdPmkZWOdcICk/xCkBBtCJvq','WOPGWR4wsLpcV1Lrcmk5','r0mBaSkE','mHhcO34','WQldRSkV','deRcT2T4rmk+','BH86WQGa','W7VdS8k7W5e','iCkciColwq','WPlcNMJcHa','lmonW7RdRSopWOFdHSoo'];a23_0x2f6a=function(){return _0x22c57f;};return a23_0x2f6a();}import*as a23_0x200788 from'path';import{packageName}from'./decls.js';import{tokenize,maskSource,shortHash}from'./hash.js';import{evalForbidDependency,evalForbidPattern,evalUniqueRole,evalPlacement}from'./shape-eval.js';function a23_0x1c0e(_0x3c4827,_0x43c63b){_0x3c4827=_0x3c4827-(0x97c+0x1cd4+0x1d*-0x148);const _0x92fe27=a23_0x2f6a();let _0x4ba56a=_0x92fe27[_0x3c4827];if(a23_0x1c0e['CcHEOA']===undefined){var _0x1bce15=function(_0x284652){const _0x464db6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5c6ae0='',_0x5732d1='';for(let _0x583ad0=-0xe97+-0x23a7*0x1+-0x191f*-0x2,_0x30394d,_0x1477ab,_0x2f6538=-0x706+-0x247a+0x2b80;_0x1477ab=_0x284652['charAt'](_0x2f6538++);~_0x1477ab&&(_0x30394d=_0x583ad0%(0x223f+-0xc41*0x3+0x288)?_0x30394d*(0x2*-0x94a+-0xd*-0xf6+0x656)+_0x1477ab:_0x1477ab,_0x583ad0++%(-0x218+0x1*0x22e5+-0x20c9))?_0x5c6ae0+=String['fromCharCode'](-0x1eba+0xb*0x34+0x1d7d&_0x30394d>>(-(-0x1561+0xc*-0x61+-0x1*-0x19ef)*_0x583ad0&0x85d*0x3+-0x13cd*-0x1+-0x2cde)):-0x358+-0xdd6*0x2+0x1f04){_0x1477ab=_0x464db6['indexOf'](_0x1477ab);}for(let _0x2909b2=-0x1*-0x60d+-0x2*-0xca+-0x7a1,_0x5bffa5=_0x5c6ae0['length'];_0x2909b2<_0x5bffa5;_0x2909b2++){_0x5732d1+='%'+('00'+_0x5c6ae0['charCodeAt'](_0x2909b2)['toString'](-0x2*-0x23c+-0xc0d+-0x13*-0x67))['slice'](-(0x63e+-0x1*-0x1b1+-0x7ed));}return decodeURIComponent(_0x5732d1);};const _0x4debdd=function(_0x170ca0,_0x169ee8){let _0x466705=[],_0x618872=-0xa39+-0xdc*-0x1e+-0xf8f,_0xa2a634,_0x42c664='';_0x170ca0=_0x1bce15(_0x170ca0);let _0x188d4d;for(_0x188d4d=0x1034+-0xc38+0x66*-0xa;_0x188d4d<0xd0c+-0x1af8+0x5*0x2fc;_0x188d4d++){_0x466705[_0x188d4d]=_0x188d4d;}for(_0x188d4d=0xb*-0x1a1+-0x2*0xce6+0x2bb7;_0x188d4d<-0x14b*-0xb+0x4e7*-0x3+0x17c;_0x188d4d++){_0x618872=(_0x618872+_0x466705[_0x188d4d]+_0x169ee8['charCodeAt'](_0x188d4d%_0x169ee8['length']))%(-0x571+-0x6c+-0x1*-0x6dd),_0xa2a634=_0x466705[_0x188d4d],_0x466705[_0x188d4d]=_0x466705[_0x618872],_0x466705[_0x618872]=_0xa2a634;}_0x188d4d=-0x494+0xd*0x2aa+-0x2*0xf07,_0x618872=0x262+-0x134f*-0x2+-0xa4*0x40;for(let _0x17c356=-0x1de9+0x1c3b*-0x1+-0x1*-0x3a24;_0x17c356<_0x170ca0['length'];_0x17c356++){_0x188d4d=(_0x188d4d+(-0x9*-0xe3+0x1883+-0x207d))%(0x1527+-0x1*-0x896+-0x7*0x41b),_0x618872=(_0x618872+_0x466705[_0x188d4d])%(-0x2614*-0x1+-0xcc1+-0x1853),_0xa2a634=_0x466705[_0x188d4d],_0x466705[_0x188d4d]=_0x466705[_0x618872],_0x466705[_0x618872]=_0xa2a634,_0x42c664+=String['fromCharCode'](_0x170ca0['charCodeAt'](_0x17c356)^_0x466705[(_0x466705[_0x188d4d]+_0x466705[_0x618872])%(0x2f4+-0x270a+0x2516*0x1)]);}return _0x42c664;};a23_0x1c0e['nHOuZB']=_0x4debdd,a23_0x1c0e['QkjbPX']={},a23_0x1c0e['CcHEOA']=!![];}const _0x569bc5=_0x92fe27[0x1b2+0x202f+-0x21e1*0x1],_0x3d0386=_0x3c4827+_0x569bc5,_0x5325a0=a23_0x1c0e['QkjbPX'][_0x3d0386];return!_0x5325a0?(a23_0x1c0e['aCVaSR']===undefined&&(a23_0x1c0e['aCVaSR']=!![]),_0x4ba56a=a23_0x1c0e['nHOuZB'](_0x4ba56a,_0x43c63b),a23_0x1c0e['QkjbPX'][_0x3d0386]=_0x4ba56a):_0x4ba56a=_0x5325a0,_0x4ba56a;}export const GATE_TYPES=new Set([a23_0x804811(0x1ab,'aDUh'),a23_0x804811(0x170,'LbNF'),a23_0x804811(0x200,'MwC8'),a23_0x804811(0x202,'Q#lr')]);const RESOLVE_EXT=['',a23_0x804811(0x169,'W1C1'),a23_0x804811(0x1f6,'lIQ)'),a23_0x804811(0x167,'A@sL'),a23_0x804811(0x12b,'1MM]'),a23_0x804811(0x1e7,'LbNF'),a23_0x804811(0x1cf,'aDUh'),a23_0x804811(0x166,'9VN('),a23_0x804811(0x13e,'u%]A'),a23_0x804811(0x1e8,'L$En'),a23_0x804811(0x1f3,'u%]A'),a23_0x804811(0x1c0,'8!rT'),a23_0x804811(0x152,'Lkl*')];export function resolveRelative(_0x52a2f1,_0x3bdecb,_0x192451){const _0x124a53=a23_0x804811;if(!_0x192451[_0x124a53(0x16d,'q#yV')]('.'))return null;const _0x1598d3=a23_0x200788[_0x124a53(0x1dc,'L$En')][_0x124a53(0x17c,'Jft]')](a23_0x200788[_0x124a53(0x15c,'a9bj')][_0x124a53(0x15d,'od&b')](a23_0x200788[_0x124a53(0x191,'dKWA')][_0x124a53(0x16c,'wuuo')](_0x3bdecb),_0x192451));if(_0x1598d3[_0x124a53(0x154,'NlV6')]('..'))return null;const _0x2a239e=_0x1598d3[_0x124a53(0x155,'cBL4')](/\.(m|c)?js$/,'');for(const _0xdef5b7 of[_0x1598d3,...RESOLVE_EXT[_0x124a53(0x1e2,'cBL4')](_0x2fdf35=>_0x2a239e+_0x2fdf35)]){if(!_0xdef5b7)continue;try{if(a23_0x326afc[_0x124a53(0x171,'Llc*')](a23_0x200788[_0x124a53(0x196,'Llc*')](_0x52a2f1,_0xdef5b7))[_0x124a53(0x1ec,'T1Co')]())return _0xdef5b7;}catch{}}return null;}export function importKey(_0x45bb31){const _0x5d65f0=a23_0x804811;return _0x45bb31[_0x5d65f0(0x130,'LbNF')]+'|'+(_0x45bb31[_0x5d65f0(0x1ae,'q#yV')]??'')+'|'+(_0x45bb31[_0x5d65f0(0x1fb,'n[9v')]??'')+'|'+_0x45bb31[_0x5d65f0(0x17e,'a9bj')][_0x5d65f0(0x1b2,'9@Yr')](_0x47ad1f=>_0x47ad1f[_0x5d65f0(0x203,'Z7G^')])[_0x5d65f0(0x1f5,'rLLn')]()[_0x5d65f0(0x14f,'HNFD')](',');}export function ownersOf(_0x2af80a,_0x4e4f70,_0x47dad0){const _0x5f316c=a23_0x804811,_0x5ec1ac=new Map();if(!_0x47dad0[_0x5f316c(0x142,'didJ')])return _0x5ec1ac;const _0x49ef58=new Set(_0x47dad0),_0x33efd7=tokenize(_0x2af80a);for(let _0x449d1e=-0x1b2b+0x120f+0x91c;_0x449d1e<_0x33efd7[_0x5f316c(0x160,'u%]A')];_0x449d1e++){const _0x17a5cf=_0x33efd7[_0x449d1e];if(_0x17a5cf[_0x5f316c(0x18b,'a9bj')]!=='id'||!_0x49ef58[_0x5f316c(0x1d8,'HNFD')](_0x17a5cf[_0x5f316c(0x16b,'MwC8')]))continue;const _0x2b9b4d=_0x33efd7[_0x449d1e-(-0x23+-0xb27*0x1+0xb4b)];if(_0x2b9b4d&&(_0x2b9b4d[_0x5f316c(0x1a9,'kLW&')]==='.'||_0x2b9b4d[_0x5f316c(0x1cd,'1MM]')]==='?.'))continue;const _0xde99f2=_0x4e4f70[_0x5f316c(0x186,'W1C1')][_0x5f316c(0x162,'!N$2')](_0x4a4299=>_0x4a4299[_0x5f316c(0x187,'JLtw')]<=_0x17a5cf[_0x5f316c(0x1c7,'9@Yr')]&&_0x17a5cf[_0x5f316c(0x1b8,'jqhL')]<_0x4a4299[_0x5f316c(0x16a,'nnK@')]);if(!_0xde99f2)continue;const _0x1e0409=_0x5ec1ac[_0x5f316c(0x18e,'cBL4')](_0x17a5cf[_0x5f316c(0x15e,'NlV6')])??[];if(!_0x1e0409[_0x5f316c(0x19d,'A@sL')](_0xde99f2))_0x1e0409[_0x5f316c(0x164,'Llc*')](_0xde99f2);_0x5ec1ac[_0x5f316c(0x151,'A6Bd')](_0x17a5cf[_0x5f316c(0x1fc,'A6Bd')],_0x1e0409);}return _0x5ec1ac;}export function depsOf(_0x21a6cf,_0x1cd6c9,_0x3712e1,_0x319d25=null){const _0x4f0276=a23_0x804811,_0x5e3ac6=[],_0x199457=_0x3712e1[_0x4f0276(0x1a0,'dKWA')][_0x4f0276(0x14c,'W1C1')](_0x22f1cc=>!_0x319d25||_0x319d25[_0x4f0276(0x177,'T1Co')](importKey(_0x22f1cc)));if(!_0x199457[_0x4f0276(0x144,'L$En')])return _0x5e3ac6;const _0x3f1fe2=_0x199457[_0x4f0276(0x134,'MwC8')](_0x352460=>[_0x352460[_0x4f0276(0x1c4,'od&b')],_0x352460[_0x4f0276(0x1c2,'zJm0')],..._0x352460[_0x4f0276(0x1e1,'T1Co')][_0x4f0276(0x181,'FEqR')](_0x20fb79=>_0x20fb79[_0x4f0276(0x203,'Z7G^')])][_0x4f0276(0x1b6,'D3Vh')](_0x4ccbab=>!!_0x4ccbab)),_0x24fa3d=ownersOf(_0x1cd6c9,_0x3712e1,_0x3f1fe2);for(const _0x2bec64 of _0x199457){const _0x1716b6=packageName(_0x2bec64[_0x4f0276(0x14e,'JLtw')],_0x21a6cf[_0x4f0276(0x175,'@K%j')]&&_0x21a6cf[_0x4f0276(0x190,'LbNF')][_0x4f0276(0x17f,'lIQ)')]?_0x21a6cf[_0x4f0276(0x185,'9VN(')]:undefined),_0x32924b=[];if(_0x2bec64[_0x4f0276(0x137,'9VN(')])_0x32924b[_0x4f0276(0x12a,'nnK@')]({'local':_0x2bec64[_0x4f0276(0x1ed,'Dr4n')],'imported':_0x2bec64[_0x4f0276(0x1d9,'Lkl*')]?'*':_0x4f0276(0x150,'9@Yr'),'typeOnly':_0x2bec64[_0x4f0276(0x1b5,'dKWA')]});if(_0x2bec64[_0x4f0276(0x182,'k5((')])_0x32924b[_0x4f0276(0x178,'a9bj')]({'local':_0x2bec64[_0x4f0276(0x1e6,'Dr4n')],'imported':'*','typeOnly':_0x2bec64[_0x4f0276(0x156,'bGGL')]});for(const _0xbabe82 of _0x2bec64[_0x4f0276(0x158,'k9M]')])_0x32924b[_0x4f0276(0x140,'j*4x')]({'local':_0xbabe82[_0x4f0276(0x184,'!N$2')],'imported':_0xbabe82[_0x4f0276(0x148,'u%]A')],'typeOnly':_0x2bec64[_0x4f0276(0x1de,'NlV6')]||!!_0xbabe82[_0x4f0276(0x1b5,'dKWA')]});const _0x1b647e=_0x4f0276(0x1fd,'dKWA')+shortHash(_0x2bec64[_0x4f0276(0x165,'G3EW')]+'|'+_0x32924b[_0x4f0276(0x16f,'Jft]')](_0x4db237=>_0x4db237[_0x4f0276(0x135,'NlV6')])[_0x4f0276(0x1bd,'wuuo')](','));if(_0x1716b6){const _0x2b3b3b={'kind':_0x4f0276(0x129,'lIQ)'),'pkg':_0x1716b6},_0x255974=_0x2bec64[_0x4f0276(0x1b5,'dKWA')]||_0x32924b[_0x4f0276(0x144,'L$En')]>0x2248+-0x19b2+0xe*-0x9d&&_0x32924b[_0x4f0276(0x141,'G3EW')](_0x4f2749=>_0x4f2749[_0x4f0276(0x1e0,'9VN(')]),_0x233620=new Set();for(const _0xe3bd2c of _0x32924b)for(const _0x5440d4 of _0x24fa3d[_0x4f0276(0x19c,'aDUh')](_0xe3bd2c[_0x4f0276(0x1f9,'*(p@')])??[])_0x233620[_0x4f0276(0x1f1,'W1C1')](_0x5440d4);if(_0x233620[_0x4f0276(0x173,'1MM]')]===0x57b+0x9f2+-0xf6d)_0x5e3ac6[_0x4f0276(0x1fa,'zJm0')]({'fromFile':_0x21a6cf[_0x4f0276(0x163,'Llc*')],'fromLayer':_0x21a6cf[_0x4f0276(0x1cc,'FEqR')],'fromHash':_0x1b647e,'line':_0x2bec64[_0x4f0276(0x1be,'@K%j')],'typeOnly':_0x255974,'to':_0x2b3b3b});for(const _0xf95cd2 of _0x233620)_0x5e3ac6[_0x4f0276(0x1c3,'D3Vh')]({'fromFile':_0x21a6cf[_0x4f0276(0x13d,'qAvW')],'fromLayer':_0x21a6cf[_0x4f0276(0x1d6,'D3Vh')],'fromCI':_0xf95cd2[_0x4f0276(0x12d,'q#yV')],'fromHash':_0xf95cd2[_0x4f0276(0x194,'bGGL')],'line':_0x2bec64[_0x4f0276(0x13f,'Z7G^')],'typeOnly':_0x255974,'to':_0x2b3b3b});continue;}const _0x374e75=resolveRelative(_0x21a6cf[_0x4f0276(0x1aa,'jqhL')],_0x21a6cf[_0x4f0276(0x1bc,'lIQ)')],_0x2bec64[_0x4f0276(0x12e,'aDUh')]);if(!_0x374e75){const _0x1f57a4={'kind':_0x4f0276(0x1ea,'q#yV'),'spec':_0x2bec64[_0x4f0276(0x1a8,'qAvW')]};_0x5e3ac6[_0x4f0276(0x1af,'1MM]')]({'fromFile':_0x21a6cf[_0x4f0276(0x174,'nnK@')],'fromLayer':_0x21a6cf[_0x4f0276(0x136,'Lkl*')],'fromHash':_0x1b647e,'line':_0x2bec64[_0x4f0276(0x1b7,'q#yV')],'typeOnly':_0x2bec64[_0x4f0276(0x132,'*(p@')],'to':_0x1f57a4});continue;}const _0x31c039=_0x21a6cf[_0x4f0276(0x12c,'MwC8')](_0x374e75);if(!_0x32924b[_0x4f0276(0x142,'didJ')]){_0x5e3ac6[_0x4f0276(0x1a2,'9VN(')]({'fromFile':_0x21a6cf[_0x4f0276(0x1ac,'NlV6')],'fromLayer':_0x21a6cf[_0x4f0276(0x1ba,'kLW&')],'fromHash':_0x1b647e,'line':_0x2bec64[_0x4f0276(0x13f,'Z7G^')],'typeOnly':![],'to':{'kind':'ci','id':_0x4f0276(0x15f,'L$En')+_0x374e75,'file':_0x374e75,'layer':_0x31c039,'name':a23_0x200788[_0x4f0276(0x1da,'aDUh')][_0x4f0276(0x1b1,'zJm0')](_0x374e75)}});continue;}for(const _0x43775a of _0x32924b){const _0x20c6e1={'kind':'ci','id':_0x4f0276(0x1b9,'Lkl*')+_0x374e75,'file':_0x374e75,'layer':_0x31c039,'name':_0x43775a[_0x4f0276(0x19a,'cBL4')]},_0x22897d=_0x24fa3d[_0x4f0276(0x161,'HNFD')](_0x43775a[_0x4f0276(0x195,'T1Co')])??[];if(!_0x22897d[_0x4f0276(0x1eb,'nnK@')])_0x5e3ac6[_0x4f0276(0x1df,'kLW&')]({'fromFile':_0x21a6cf[_0x4f0276(0x163,'Llc*')],'fromLayer':_0x21a6cf[_0x4f0276(0x14a,'u%]A')],'fromHash':_0x1b647e,'line':_0x2bec64[_0x4f0276(0x143,'1MM]')],'typeOnly':_0x43775a[_0x4f0276(0x183,'1MM]')],'to':_0x20c6e1});for(const _0x174a9e of _0x22897d)_0x5e3ac6[_0x4f0276(0x12a,'nnK@')]({'fromFile':_0x21a6cf[_0x4f0276(0x18d,'Q#lr')],'fromLayer':_0x21a6cf[_0x4f0276(0x192,'dKWA')],'fromCI':_0x174a9e[_0x4f0276(0x16e,'qAvW')],'fromHash':_0x174a9e[_0x4f0276(0x1fe,'T1Co')],'line':_0x2bec64[_0x4f0276(0x149,'NlV6')],'typeOnly':_0x43775a[_0x4f0276(0x1cb,'kLW&')],'to':_0x20c6e1});}}return _0x5e3ac6;}export function evalCIsOf(_0x52685e,_0x52d615,_0x3f9cef){const _0x256f61=a23_0x804811;return _0x3f9cef[_0x256f61(0x1ff,'D3Vh')][_0x256f61(0x1d3,'dKWA')](_0xec5360=>_0xec5360[_0x256f61(0x201,'Lkl*')][_0x256f61(0x144,'L$En')]>0x1*0x22e5+-0x1799+-0xb4c)[_0x256f61(0x139,'L$En')](_0x148290=>({'id':_0x256f61(0x1b3,'Q#lr')+_0x52685e+'#'+_0x148290[_0x256f61(0x1f7,'4Muz')],'kind':_0x256f61(0x1b4,'9VN('),'file':_0x52685e,'name':_0x148290[_0x256f61(0x1dd,'wuuo')],'line':_0x148290[_0x256f61(0x1c8,'qAvW')],'endLine':_0x148290[_0x256f61(0x1e4,'T1Co')],'layer':_0x52d615,'bodyHash':_0x148290[_0x256f61(0x13b,'4Muz')],'ext':_0x148290[_0x256f61(0x1c5,'1MM]')]}));}export function evalFileOf(_0x2e9569,_0x3e8c47,_0x3cad18,_0x19d1e0){const _0x501a15=a23_0x804811;return{'file':_0x2e9569,'layer':_0x3e8c47,'masked':maskSource(_0x3cad18)[_0x501a15(0x1ef,'T1Co')],'decls':_0x19d1e0[_0x501a15(0x17d,'HNFD')][_0x501a15(0x1e3,'4Muz')](_0x103400=>({'name':_0x103400[_0x501a15(0x1a5,'A@sL')],'line':_0x103400[_0x501a15(0x1bb,'didJ')],'endLine':_0x103400[_0x501a15(0x197,'4Muz')],'bodyHash':_0x103400[_0x501a15(0x15a,'W1C1')]}))};}export function fileFindings(_0x3d1c3d,_0x3f0a04){const _0x564eed=a23_0x804811,_0x5b65be=_0x3d1c3d[_0x564eed(0x176,'Q#lr')](_0x4394ea=>_0x4394ea&&_0x4394ea[_0x564eed(0x145,'D3Vh')]&&GATE_TYPES[_0x564eed(0x193,'Q#lr')](_0x4394ea[_0x564eed(0x133,'rLLn')][_0x564eed(0x1c6,'T1Co')])),_0x2b0b9d=[];if(!_0x5b65be[_0x564eed(0x1d2,'zJm0')])return _0x2b0b9d;const {ctx:_0x269379}=_0x3f0a04;let _0x410cbe=null,_0x1dbd52=null,_0x455007=null,_0x178f69=null;for(const _0x58f1df of _0x5b65be){switch(_0x58f1df[_0x564eed(0x133,'rLLn')][_0x564eed(0x1b0,'H#AT')]){case _0x564eed(0x1d4,'Dr4n'):if(_0x3f0a04[_0x564eed(0x168,'MwC8')])break;_0x410cbe??=depsOf(_0x269379,_0x3f0a04[_0x564eed(0x1bf,'9@Yr')],_0x3f0a04[_0x564eed(0x138,'8!rT')],_0x3f0a04[_0x564eed(0x1d5,'q#yV')]??null),_0x2b0b9d[_0x564eed(0x1db,'Y2X[')](...evalForbidDependency(_0x58f1df,_0x410cbe));break;case _0x564eed(0x1d1,'8!rT'):_0x1dbd52??=evalFileOf(_0x269379[_0x564eed(0x188,'LbNF')],_0x269379[_0x564eed(0x159,'8!rT')],_0x3f0a04[_0x564eed(0x1f4,'MwC8')],_0x3f0a04[_0x564eed(0x172,'od&b')]),_0x2b0b9d[_0x564eed(0x1a1,'bGGL')](...evalForbidPattern(_0x58f1df,[_0x1dbd52]));break;case _0x564eed(0x200,'MwC8'):{_0x455007??=evalCIsOf(_0x269379[_0x564eed(0x163,'Llc*')],_0x269379[_0x564eed(0x159,'8!rT')],_0x3f0a04[_0x564eed(0x138,'8!rT')]),_0x178f69??=typeof _0x3f0a04[_0x564eed(0x1f0,'wuuo')]===_0x564eed(0x1f8,'aDUh')?_0x3f0a04[_0x564eed(0x13c,'k9M]')]():_0x3f0a04[_0x564eed(0x13a,'j*4x')]??[];const _0x1756c4=_0x58f1df[_0x564eed(0x128,'A@sL')][_0x564eed(0x1c9,'W1C1')];_0x2b0b9d[_0x564eed(0x1d7,'9@Yr')](...evalUniqueRole(_0x58f1df,[..._0x178f69,..._0x455007],_0x3f0a04[_0x564eed(0x1ee,'Q#lr')],_0x3f0a04[_0x564eed(0x1e9,'q#yV')]?_0x3f0a04[_0x564eed(0x198,'NlV6')](_0x1756c4):[]));break;}case _0x564eed(0x19b,'rLLn'):_0x455007??=evalCIsOf(_0x269379[_0x564eed(0x1ad,'a9bj')],_0x269379[_0x564eed(0x18f,'4Muz')],_0x3f0a04[_0x564eed(0x17b,'Y2X[')]),_0x2b0b9d[_0x564eed(0x180,'aDUh')](...evalPlacement(_0x58f1df,_0x455007,_0x3f0a04[_0x564eed(0x131,'LbNF')]));break;}}return _0x2b0b9d;}
|
|
1
|
+
/**
|
|
2
|
+
* config-map/light-eval — 경량층 파일 단위 제약 평가 입력 구성 + 평가 (설계 10 §4.1·§5.2).
|
|
3
|
+
*
|
|
4
|
+
* 훅 gate(②)와 태스크 평가(④⑤ task-eval)의 **pre(편집 전) 위반**을 같은 함수로 만든다 — 레거시 판정 단일화
|
|
5
|
+
* (shape-eval.legacySig: 같은 선언·같은 제약·같은 대상의 위반이 pre 에도 있으면 레거시, 본문 수정만으로 새 위반이 아니다).
|
|
6
|
+
* - depsOf: import 바인딩 단위 의존(정밀층 link.ts 와 같은 단위 — 바인딩마다 to.name = imported 이름·'default'·'*')
|
|
7
|
+
* - evalCIsOf: 외부 생성자·호출(ext)을 가진 선언 → EvalCI
|
|
8
|
+
* - fileFindings: 4종(forbid-dependency·forbid-pattern·unique-role·placement) 파일 평가
|
|
9
|
+
* 상대 import 와 tsconfig paths 별칭을 파일로 해석한다(해석 못 하면 unknown = 통과, §4.1).
|
|
10
|
+
*
|
|
11
|
+
* 의존: fs/path + ./decls ./hash ./shape-eval 만 (scripts/check-imports.mjs — 훅 핫패스).
|
|
12
|
+
*/
|
|
13
|
+
import * as fs from 'fs';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
import { packageName } from './decls.js';
|
|
16
|
+
import { tokenize, maskSource, shortHash } from './hash.js';
|
|
17
|
+
import { evalForbidDependency, evalForbidPattern, evalUniqueRole, evalPlacement, } from './shape-eval.js';
|
|
18
|
+
export const GATE_TYPES = new Set(['forbid-dependency', 'forbid-pattern', 'unique-role', 'placement']);
|
|
19
|
+
const RESOLVE_EXT = ['', '.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs', '.mts', '.cts', '/index.ts', '/index.tsx', '/index.js', '/index.jsx'];
|
|
20
|
+
/** 상대 import → 지도 루트 기준 파일 (없으면 null = unknown). 별칭은 풀지 않는다(§4.1 unknown = 통과) */
|
|
21
|
+
export function resolveRelative(root, fromRel, spec) {
|
|
22
|
+
if (!spec.startsWith('.'))
|
|
23
|
+
return null;
|
|
24
|
+
const base = path.posix.normalize(path.posix.join(path.posix.dirname(fromRel), spec));
|
|
25
|
+
if (base.startsWith('..'))
|
|
26
|
+
return null;
|
|
27
|
+
const stripped = base.replace(/\.(m|c)?js$/, '');
|
|
28
|
+
for (const cand of [base, ...RESOLVE_EXT.map(e => stripped + e)]) {
|
|
29
|
+
if (!cand)
|
|
30
|
+
continue;
|
|
31
|
+
try {
|
|
32
|
+
if (fs.statSync(path.join(root, cand)).isFile())
|
|
33
|
+
return cand;
|
|
34
|
+
}
|
|
35
|
+
catch { /* next */ }
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const lightPathsCache = new Map();
|
|
40
|
+
function readJsoncLight(abs) {
|
|
41
|
+
try {
|
|
42
|
+
const raw = fs.readFileSync(abs, 'utf-8');
|
|
43
|
+
// 문자열 밖의 주석과 뒤따르는 쉼표만 제거한다(경로 문자열의 /* 는 그대로 둔다)
|
|
44
|
+
const text = raw.replace(/("(?:\\.|[^"\\])*")|\/\/[^\n]*|\/\*[\s\S]*?\*\//g, (m, str) => str ?? '').replace(/,(\s*[}\]])/g, '$1');
|
|
45
|
+
return JSON.parse(text);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function loadLightPaths(abs, depth = 0) {
|
|
52
|
+
const cfg = readJsoncLight(abs);
|
|
53
|
+
if (!cfg || depth > 5)
|
|
54
|
+
return {};
|
|
55
|
+
const dir = path.dirname(abs);
|
|
56
|
+
let out = {};
|
|
57
|
+
const ext = cfg.extends;
|
|
58
|
+
for (const e of (Array.isArray(ext) ? ext : ext ? [ext] : [])) {
|
|
59
|
+
if (typeof e !== 'string' || !e.startsWith('.'))
|
|
60
|
+
continue;
|
|
61
|
+
let p = path.resolve(dir, e);
|
|
62
|
+
if (!p.endsWith('.json'))
|
|
63
|
+
p += '.json';
|
|
64
|
+
if (fs.existsSync(p))
|
|
65
|
+
out = { ...out, ...loadLightPaths(p, depth + 1) };
|
|
66
|
+
}
|
|
67
|
+
const co = (cfg.compilerOptions ?? {});
|
|
68
|
+
if (typeof co.baseUrl === 'string')
|
|
69
|
+
out.baseUrlAbs = path.resolve(dir, co.baseUrl);
|
|
70
|
+
if (co.paths && typeof co.paths === 'object') {
|
|
71
|
+
out.paths = co.paths;
|
|
72
|
+
out.pathsBaseAbs = out.baseUrlAbs ?? dir;
|
|
73
|
+
}
|
|
74
|
+
else if (out.paths && typeof co.baseUrl === 'string')
|
|
75
|
+
out.pathsBaseAbs = out.baseUrlAbs;
|
|
76
|
+
return out;
|
|
77
|
+
}
|
|
78
|
+
function lightPathsFor(root, fromRel) {
|
|
79
|
+
for (let dir = path.posix.dirname(fromRel);; dir = path.posix.dirname(dir)) {
|
|
80
|
+
const key = `${root}\0${dir}`;
|
|
81
|
+
if (lightPathsCache.has(key))
|
|
82
|
+
return lightPathsCache.get(key) ?? null;
|
|
83
|
+
const abs = path.join(root, dir === '.' ? '' : dir, 'tsconfig.json');
|
|
84
|
+
if (fs.existsSync(abs)) {
|
|
85
|
+
const c = loadLightPaths(abs);
|
|
86
|
+
const v = c.paths ? { paths: c.paths, baseAbs: c.pathsBaseAbs ?? path.dirname(abs) } : null;
|
|
87
|
+
lightPathsCache.set(key, v);
|
|
88
|
+
return v;
|
|
89
|
+
}
|
|
90
|
+
if (dir === '.' || dir === '' || dir === '/')
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** tsconfig paths 별칭 → 레포 상대 파일. TS 규칙대로 정확 일치 우선, 그다음 접두가 가장 긴 패턴. */
|
|
95
|
+
export function resolveAlias(root, fromRel, spec) {
|
|
96
|
+
const cfg = lightPathsFor(root, fromRel);
|
|
97
|
+
if (!cfg)
|
|
98
|
+
return null;
|
|
99
|
+
let best = null;
|
|
100
|
+
for (const key of Object.keys(cfg.paths)) {
|
|
101
|
+
if (!key.includes('*')) {
|
|
102
|
+
if (key === spec) {
|
|
103
|
+
best = { key, star: '', len: Infinity };
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const [pre, suf] = key.split('*');
|
|
109
|
+
if (spec.startsWith(pre) && spec.endsWith(suf) && spec.length >= pre.length + suf.length && (!best || pre.length > best.len)) {
|
|
110
|
+
best = { key, star: spec.slice(pre.length, spec.length - suf.length), len: pre.length };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (!best)
|
|
114
|
+
return null;
|
|
115
|
+
for (const t of cfg.paths[best.key] ?? []) {
|
|
116
|
+
const rel = path.relative(root, path.resolve(cfg.baseAbs, t.replace('*', best.star))).split(path.sep).join('/');
|
|
117
|
+
if (rel.startsWith('..'))
|
|
118
|
+
continue;
|
|
119
|
+
const hit = resolveRelative(root, 'x.ts', `./${rel}`);
|
|
120
|
+
if (hit)
|
|
121
|
+
return hit;
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
export function importKey(im) {
|
|
126
|
+
return `${im.spec}|${im.defaultName ?? ''}|${im.namespace ?? ''}|${im.named.map(n => n.local).sort().join(',')}`;
|
|
127
|
+
}
|
|
128
|
+
/** import 바인딩 사용 owner 선언 (경량: 토큰 위치가 선언 스팬 안) */
|
|
129
|
+
export function ownersOf(text, d, locals) {
|
|
130
|
+
const out = new Map();
|
|
131
|
+
if (!locals.length)
|
|
132
|
+
return out;
|
|
133
|
+
const want = new Set(locals);
|
|
134
|
+
const toks = tokenize(text);
|
|
135
|
+
for (let i = 0; i < toks.length; i++) {
|
|
136
|
+
const t = toks[i];
|
|
137
|
+
if (t.type !== 'id' || !want.has(t.value))
|
|
138
|
+
continue;
|
|
139
|
+
const prev = toks[i - 1];
|
|
140
|
+
if (prev && (prev.value === '.' || prev.value === '?.'))
|
|
141
|
+
continue;
|
|
142
|
+
const owner = d.decls.find(x => x.start <= t.start && t.start < x.end);
|
|
143
|
+
if (!owner)
|
|
144
|
+
continue;
|
|
145
|
+
const arr = out.get(t.value) ?? [];
|
|
146
|
+
if (!arr.includes(owner))
|
|
147
|
+
arr.push(owner);
|
|
148
|
+
out.set(t.value, arr);
|
|
149
|
+
}
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 의존(EvalDep) — 패키지 import 는 문장 단위(owner 마다), 내부 파일 import 는 **바인딩 단위**(owner 마다, to.name = 바인딩의
|
|
154
|
+
* imported 이름: named → 원래 이름, default → 'default', namespace → '*') — 정밀층 link.ts 와 같은 단위·이름.
|
|
155
|
+
* onlyNew = importKey 집합이면 그 import 만.
|
|
156
|
+
*/
|
|
157
|
+
export function depsOf(ctx, text, d, onlyNew = null) {
|
|
158
|
+
const out = [];
|
|
159
|
+
const ims = d.imports.filter(im => !onlyNew || onlyNew.has(importKey(im)));
|
|
160
|
+
if (!ims.length)
|
|
161
|
+
return out;
|
|
162
|
+
const locals = ims.flatMap(im => [im.defaultName, im.namespace, ...im.named.map(n => n.local)].filter((x) => !!x));
|
|
163
|
+
const owners = ownersOf(text, d, locals);
|
|
164
|
+
for (const im of ims) {
|
|
165
|
+
const pkg = packageName(im.spec, ctx.aliasPrefixes && ctx.aliasPrefixes.length ? ctx.aliasPrefixes : undefined);
|
|
166
|
+
const binds = [];
|
|
167
|
+
if (im.defaultName)
|
|
168
|
+
binds.push({ local: im.defaultName, imported: im.require ? '*' : 'default', typeOnly: im.typeOnly });
|
|
169
|
+
if (im.namespace)
|
|
170
|
+
binds.push({ local: im.namespace, imported: '*', typeOnly: im.typeOnly });
|
|
171
|
+
for (const n of im.named)
|
|
172
|
+
binds.push({ local: n.local, imported: n.imported, typeOnly: im.typeOnly || !!n.typeOnly });
|
|
173
|
+
const stmt = 'imp:' + shortHash(`${im.spec}|${binds.map(b => b.local).join(',')}`);
|
|
174
|
+
if (pkg) {
|
|
175
|
+
const to = { kind: 'pkg', pkg };
|
|
176
|
+
const typeOnly = im.typeOnly || (binds.length > 0 && binds.every(b => b.typeOnly));
|
|
177
|
+
const os = new Set();
|
|
178
|
+
for (const b of binds)
|
|
179
|
+
for (const o of owners.get(b.local) ?? [])
|
|
180
|
+
os.add(o);
|
|
181
|
+
if (os.size === 0)
|
|
182
|
+
out.push({ fromFile: ctx.rel, fromLayer: ctx.layer, fromHash: stmt, line: im.line, typeOnly, to });
|
|
183
|
+
for (const o of os)
|
|
184
|
+
out.push({ fromFile: ctx.rel, fromLayer: ctx.layer, fromCI: o.name, fromHash: o.bodyHash, line: im.line, typeOnly, to });
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const target = resolveRelative(ctx.root, ctx.rel, im.spec) ?? resolveAlias(ctx.root, ctx.rel, im.spec);
|
|
188
|
+
if (!target) {
|
|
189
|
+
const to = { kind: 'unknown', spec: im.spec };
|
|
190
|
+
out.push({ fromFile: ctx.rel, fromLayer: ctx.layer, fromHash: stmt, line: im.line, typeOnly: im.typeOnly, to });
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const toLayer = ctx.layerOf(target);
|
|
194
|
+
if (!binds.length) {
|
|
195
|
+
// 부수효과 import — 바인딩 없음
|
|
196
|
+
out.push({ fromFile: ctx.rel, fromLayer: ctx.layer, fromHash: stmt, line: im.line, typeOnly: false, to: { kind: 'ci', id: 'file:' + target, file: target, layer: toLayer, name: path.posix.basename(target) } });
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
for (const b of binds) {
|
|
200
|
+
const to = { kind: 'ci', id: 'file:' + target, file: target, layer: toLayer, name: b.imported };
|
|
201
|
+
const os = owners.get(b.local) ?? [];
|
|
202
|
+
if (!os.length)
|
|
203
|
+
out.push({ fromFile: ctx.rel, fromLayer: ctx.layer, fromHash: stmt, line: im.line, typeOnly: b.typeOnly, to });
|
|
204
|
+
for (const o of os)
|
|
205
|
+
out.push({ fromFile: ctx.rel, fromLayer: ctx.layer, fromCI: o.name, fromHash: o.bodyHash, line: im.line, typeOnly: b.typeOnly, to });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return out;
|
|
209
|
+
}
|
|
210
|
+
export function evalCIsOf(rel, layer, d) {
|
|
211
|
+
return d.decls.filter(x => x.ext.length > 0).map(x => ({ id: `sym:${rel}#${x.name}`, kind: 'symbol', file: rel, name: x.name, line: x.line, endLine: x.endLine, layer, bodyHash: x.bodyHash, ext: x.ext }));
|
|
212
|
+
}
|
|
213
|
+
export function evalFileOf(rel, layer, text, d) {
|
|
214
|
+
return { file: rel, layer, masked: maskSource(text).masked, decls: d.decls.map(x => ({ name: x.name, line: x.line, endLine: x.endLine, bodyHash: x.bodyHash })) };
|
|
215
|
+
}
|
|
216
|
+
/** 한 파일 텍스트의 제약 위반(violated·unknown) — gate pre/post, task-eval pre 공용 */
|
|
217
|
+
export function fileFindings(constraints, inp) {
|
|
218
|
+
const cs = constraints.filter(c => c && c.rule && GATE_TYPES.has(c.rule.type));
|
|
219
|
+
const out = [];
|
|
220
|
+
if (!cs.length)
|
|
221
|
+
return out;
|
|
222
|
+
const { ctx } = inp;
|
|
223
|
+
let deps = null;
|
|
224
|
+
let file = null;
|
|
225
|
+
let cis = null;
|
|
226
|
+
let holders = null;
|
|
227
|
+
for (const c of cs) {
|
|
228
|
+
switch (c.rule.type) {
|
|
229
|
+
case 'forbid-dependency':
|
|
230
|
+
if (inp.skipDeps)
|
|
231
|
+
break;
|
|
232
|
+
deps ??= depsOf(ctx, inp.text, inp.decls, inp.onlyImports ?? null);
|
|
233
|
+
out.push(...evalForbidDependency(c, deps));
|
|
234
|
+
break;
|
|
235
|
+
case 'forbid-pattern':
|
|
236
|
+
file ??= evalFileOf(ctx.rel, ctx.layer, inp.text, inp.decls);
|
|
237
|
+
out.push(...evalForbidPattern(c, [file]));
|
|
238
|
+
break;
|
|
239
|
+
case 'unique-role': {
|
|
240
|
+
cis ??= evalCIsOf(ctx.rel, ctx.layer, inp.decls);
|
|
241
|
+
holders ??= typeof inp.holders === 'function' ? inp.holders() : (inp.holders ?? []);
|
|
242
|
+
const role = c.rule.role;
|
|
243
|
+
out.push(...evalUniqueRole(c, [...holders, ...cis], inp.roles, inp.canonical ? inp.canonical(role) : []));
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
case 'placement':
|
|
247
|
+
cis ??= evalCIsOf(ctx.rel, ctx.layer, inp.decls);
|
|
248
|
+
out.push(...evalPlacement(c, cis, inp.roles));
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return out;
|
|
253
|
+
}
|