@askexenow/exe-os 0.9.288 → 0.9.290
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/deploy/compose/README.md +6 -0
- package/deploy/compose/docker-compose.yml +48 -53
- package/dist/active-agent-DVMG6WVY.js +27 -0
- package/dist/active-agent-JJVXXRZV.js +26 -0
- package/dist/active-agent-L22OENGJ.js +26 -0
- package/dist/active-agent-SVG6F6HY.js +27 -0
- package/dist/agentic-ontology-2LJST3BE.js +25 -0
- package/dist/agentic-ontology-3GHJHLDY.js +25 -0
- package/dist/backfill-metadata-HJNVBORD.js +599 -0
- package/dist/backfill-metadata-W7PJ6YGP.js +599 -0
- package/dist/background-jobs-YTYZRTCM.js +25 -0
- package/dist/behaviors-EM5KZSHT.js +39 -0
- package/dist/behaviors-ROOZS234.js +39 -0
- package/dist/bin/age-ontology-load.js +2 -2
- package/dist/bin/agentic-ontology-backfill.js +8 -8
- package/dist/bin/agentic-reflection-backfill.js +9 -9
- package/dist/bin/agentic-semantic-label.js +8 -8
- package/dist/bin/backfill-conversations.js +8 -8
- package/dist/bin/backfill-responses.js +8 -8
- package/dist/bin/backfill-vectors.js +104 -19
- package/dist/bin/bulk-sync-postgres.js +9 -9
- package/dist/bin/cc-doctor.js +7 -7
- package/dist/bin/cleanup-stale-review-tasks.js +13 -13
- package/dist/bin/cli.js +56 -20
- package/dist/bin/deferred-daemon-restart.js +1 -1
- package/dist/bin/exe-agent-config.js +5 -5
- package/dist/bin/exe-agent.js +6 -6
- package/dist/bin/exe-assign.js +10 -10
- package/dist/bin/exe-boot.js +20 -20
- package/dist/bin/exe-call.js +6 -6
- package/dist/bin/exe-cloud.js +27 -9
- package/dist/bin/exe-dispatch.js +13 -13
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +9 -9
- package/dist/bin/exe-forget.js +8 -8
- package/dist/bin/exe-gateway.js +9 -9
- package/dist/bin/exe-healthcheck.js +7 -7
- package/dist/bin/exe-heartbeat.js +13 -13
- package/dist/bin/exe-kill.js +16 -16
- package/dist/bin/exe-launch-agent.js +20 -20
- package/dist/bin/exe-new-employee.js +9 -9
- package/dist/bin/exe-pending-messages.js +14 -14
- package/dist/bin/exe-pending-notifications.js +13 -13
- package/dist/bin/exe-pending-reviews.js +13 -13
- package/dist/bin/exe-rename.js +6 -6
- package/dist/bin/exe-review.js +15 -15
- package/dist/bin/exe-search.js +7 -7
- package/dist/bin/exe-session-cleanup.js +18 -18
- package/dist/bin/exe-settings.js +8 -8
- package/dist/bin/exe-start-codex.js +13 -13
- package/dist/bin/exe-start-opencode.js +10 -10
- package/dist/bin/exe-start.sh +29 -7
- package/dist/bin/exe-status.js +14 -14
- package/dist/bin/exe-support.js +3 -3
- package/dist/bin/exe-team.js +5 -5
- package/dist/bin/git-sweep.js +14 -14
- package/dist/bin/graph-backfill.js +7 -7
- package/dist/bin/graph-export.js +7 -7
- package/dist/bin/import-history.js +9 -9
- package/dist/bin/install-launchd.js +24 -1
- package/dist/bin/install.js +36 -12
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +6 -6
- package/dist/bin/postgres-agentic-reflection-backfill.js +4 -4
- package/dist/bin/postgres-agentic-semantic-backfill.js +3 -3
- package/dist/bin/scan-tasks.js +13 -13
- package/dist/bin/setup.js +2 -2
- package/dist/bin/shard-migrate.js +7 -7
- package/dist/bin/stack-update.js +7 -6
- package/dist/bin/vps-health-gate.js +1 -1
- package/dist/branding-PCLBJ3EP.js +97 -0
- package/dist/capability-cards-O6XB2AU4.js +88 -0
- package/dist/capability-cards-OEL47N2B.js +88 -0
- package/dist/capacity-monitor-UGMHVSUD.js +50 -0
- package/dist/capacity-monitor-ZE7CFVWH.js +50 -0
- package/dist/catchup-brief-3NONSIMA.js +174 -0
- package/dist/catchup-brief-HNEUKB7X.js +174 -0
- package/dist/chunk-232DHK5C.js +1119 -0
- package/dist/chunk-272SJ4RN.js +129 -0
- package/dist/chunk-2F5SG3CE.js +230 -0
- package/dist/chunk-2QMWIGJK.js +197 -0
- package/dist/chunk-2ZAOSGBX.js +668 -0
- package/dist/chunk-32K5NWMR.js +42 -0
- package/dist/chunk-32VOJ4GK.js +181 -0
- package/dist/chunk-3AUM4JVV.js +127 -0
- package/dist/chunk-3Q4UEXDE.js +297 -0
- package/dist/chunk-3RZNDPPW.js +2113 -0
- package/dist/chunk-3X2ZT5FN.js +3276 -0
- package/dist/chunk-44CP7NR2.js +333 -0
- package/dist/chunk-4FMNDJMY.js +50 -0
- package/dist/chunk-4NMTGHUE.js +127 -0
- package/dist/chunk-5J2L25OK.js +203 -0
- package/dist/chunk-5NQOIKAB.js +214 -0
- package/dist/chunk-5P3HOBZX.js +487 -0
- package/dist/chunk-5PLW3QL6.js +668 -0
- package/dist/chunk-5VAARLQR.js +58 -0
- package/dist/chunk-64GBV67L.js +1068 -0
- package/dist/chunk-66EIYAF2.js +157 -0
- package/dist/chunk-6IPJF5QD.js +630 -0
- package/dist/chunk-6MFM4N37.js +574 -0
- package/dist/chunk-6NSJTOXE.js +122 -0
- package/dist/chunk-6TLURATK.js +4318 -0
- package/dist/chunk-6WEETM7D.js +81 -0
- package/dist/chunk-6ZD3MW7T.js +97 -0
- package/dist/chunk-73JAJQRY.js +85 -0
- package/dist/chunk-73ORCJNJ.js +231 -0
- package/dist/chunk-75GH76GO.js +129 -0
- package/dist/chunk-7CHKD5IP.js +38 -0
- package/dist/chunk-7FTKXL5A.js +286 -0
- package/dist/chunk-7GTKCVVG.js +735 -0
- package/dist/chunk-7IRQSO3F.js +735 -0
- package/dist/chunk-7K4YVOAK.js +76 -0
- package/dist/chunk-7LOYIUOF.js +456 -0
- package/dist/chunk-7MINWZ3J.js +214 -0
- package/dist/chunk-7T5PS5DG.js +14439 -0
- package/dist/chunk-7XUJF3LZ.js +284 -0
- package/dist/chunk-A74WXY4S.js +227 -0
- package/dist/chunk-AVD5C3NG.js +197 -0
- package/dist/chunk-B36MRLEP.js +58 -0
- package/dist/chunk-B4TCZ3PS.js +373 -0
- package/dist/chunk-BJYLTU2G.js +621 -0
- package/dist/chunk-BPLEJ3EU.js +411 -0
- package/dist/chunk-BR2OA4AZ.js +123 -0
- package/dist/chunk-BTDPLFGK.js +221 -0
- package/dist/chunk-BTP3LPMP.js +210 -0
- package/dist/chunk-BU45UYTK.js +185 -0
- package/dist/chunk-BYOEIN37.js +176 -0
- package/dist/chunk-CCAA6XOZ.js +284 -0
- package/dist/chunk-CMDKYYFK.js +630 -0
- package/dist/chunk-D6LUKYKM.js +731 -0
- package/dist/chunk-DBQ6I6K2.js +3276 -0
- package/dist/chunk-DDWFHEPG.js +345 -0
- package/dist/chunk-DFSI6HFJ.js +2078 -0
- package/dist/chunk-DJLDKRXK.js +30 -0
- package/dist/chunk-DSOKTUTT.js +167 -0
- package/dist/chunk-EESAZNRC.js +348 -0
- package/dist/chunk-EQY6GDVD.js +369 -0
- package/dist/chunk-ETCARC76.js +836 -0
- package/dist/chunk-EYLU6MJT.js +192 -0
- package/dist/chunk-EZHTLPOS.js +280 -0
- package/dist/chunk-F23GFLKY.js +4318 -0
- package/dist/chunk-F3DQ3HDH.js +333 -0
- package/dist/chunk-F5SADWWW.js +240 -0
- package/dist/chunk-F6ZCUDCN.js +244 -0
- package/dist/chunk-FE6HKM2N.js +157 -0
- package/dist/chunk-FI5Q6F5S.js +382 -0
- package/dist/chunk-FNQZGNSG.js +1094 -0
- package/dist/chunk-FTG36JG5.js +280 -0
- package/dist/chunk-FVKTXXKK.js +128 -0
- package/dist/chunk-FZDW76SH.js +89 -0
- package/dist/chunk-G6GC2YSP.js +262 -0
- package/dist/chunk-HH2JVSKL.js +1157 -0
- package/dist/chunk-HHR5NB6N.js +377 -0
- package/dist/chunk-HJQQ7746.js +185 -0
- package/dist/chunk-HLFNLJSB.js +271 -0
- package/dist/chunk-HRZLGHT6.js +290 -0
- package/dist/chunk-HSSRWMVA.js +68 -0
- package/dist/chunk-HX735WX7.js +33 -0
- package/dist/chunk-I3NVB5MG.js +85 -0
- package/dist/chunk-I7Z6MK2B.js +240 -0
- package/dist/chunk-ID4SMRYX.js +2078 -0
- package/dist/chunk-IUQBMSBI.js +1350 -0
- package/dist/chunk-J6PDP2GY.js +221 -0
- package/dist/chunk-JGOGSH55.js +14378 -0
- package/dist/chunk-JRZ47IFL.js +82 -0
- package/dist/chunk-JXGHDROV.js +546 -0
- package/dist/chunk-JZEROVAU.js +546 -0
- package/dist/chunk-KFHAVF6J.js +97 -0
- package/dist/chunk-KJALZ6F6.js +128 -0
- package/dist/chunk-KMAIBYV3.js +402 -0
- package/dist/chunk-KMTNAXIB.js +54 -0
- package/dist/chunk-KQY4QIEN.js +731 -0
- package/dist/chunk-LHW7TZGJ.js +244 -0
- package/dist/chunk-LIH36DXG.js +159 -0
- package/dist/chunk-LRSU2ZU2.js +38 -0
- package/dist/chunk-M3VHV2RV.js +106 -0
- package/dist/chunk-MFCL4GAN.js +2113 -0
- package/dist/chunk-MFGMVKGM.js +150 -0
- package/dist/chunk-MFTGN7KN.js +411 -0
- package/dist/chunk-MUHKJCF7.js +128 -0
- package/dist/chunk-NHGBVLCD.js +210 -0
- package/dist/chunk-NOEBJMNN.js +33 -0
- package/dist/chunk-NQ2VNTGL.js +538 -0
- package/dist/chunk-NV5SSKZE.js +171 -0
- package/dist/chunk-NXJ2CP2C.js +290 -0
- package/dist/chunk-O4PZPM6H.js +204 -0
- package/dist/chunk-O5OW3YGQ.js +262 -0
- package/dist/chunk-OJQTONDJ.js +171 -0
- package/dist/chunk-OKZGUHE5.js +76 -0
- package/dist/chunk-OOH5M36Q.js +448 -0
- package/dist/chunk-OXUHCIGV.js +1352 -0
- package/dist/chunk-P5ARTZP2.js +128 -0
- package/dist/chunk-PKRSYS7F.js +402 -0
- package/dist/chunk-PNQDP3OA.js +800 -0
- package/dist/chunk-PQWO5D3F.js +348 -0
- package/dist/chunk-PYTSVZWG.js +377 -0
- package/dist/chunk-Q2R3WUW4.js +448 -0
- package/dist/chunk-Q6MJIJ2O.js +1352 -0
- package/dist/chunk-QFGJERAP.js +1119 -0
- package/dist/chunk-QKDRYZ2N.js +231 -0
- package/dist/chunk-QO7M774X.js +1094 -0
- package/dist/chunk-QODXLGH2.js +70 -0
- package/dist/chunk-RAV356E6.js +30 -0
- package/dist/chunk-RHC57KVT.js +85 -0
- package/dist/chunk-RHE7SHZJ.js +345 -0
- package/dist/chunk-RJY45A5J.js +133 -0
- package/dist/chunk-RK7EAA53.js +1157 -0
- package/dist/chunk-RSLVAYWS.js +192 -0
- package/dist/chunk-RVOPNDGY.js +150 -0
- package/dist/chunk-S3QEHFGE.js +373 -0
- package/dist/chunk-SCQEAMO3.js +299 -0
- package/dist/chunk-SL6WJP2Q.js +123 -0
- package/dist/chunk-SYOGNG2R.js +379 -0
- package/dist/chunk-T57DOVGE.js +97 -0
- package/dist/chunk-TEOJ63HX.js +362 -0
- package/dist/chunk-TMCKL43Q.js +181 -0
- package/dist/chunk-TMV5LCTC.js +167 -0
- package/dist/chunk-TO5ZXGDF.js +190 -0
- package/dist/chunk-TQZABASE.js +97 -0
- package/dist/chunk-U5RKF7MQ.js +836 -0
- package/dist/chunk-UBWBEY6I.js +81 -0
- package/dist/chunk-UDMFABWN.js +510 -0
- package/dist/chunk-UKS5CXQU.js +382 -0
- package/dist/chunk-UP7DNYG7.js +456 -0
- package/dist/chunk-V2OOLS63.js +41 -0
- package/dist/chunk-V5MGYIZS.js +70 -0
- package/dist/chunk-VBAY3OA7.js +604 -0
- package/dist/chunk-VK4KORCQ.js +204 -0
- package/dist/chunk-XCPVYQVK.js +336 -0
- package/dist/chunk-XWVBLZRP.js +50 -0
- package/dist/chunk-Y4ZA4GCQ.js +85 -0
- package/dist/chunk-YBTN5F2U.js +1068 -0
- package/dist/chunk-YMMYZXVZ.js +55 -0
- package/dist/chunk-Z5RXZRUC.js +227 -0
- package/dist/chunk-Z772TGD2.js +54 -0
- package/dist/chunk-ZAMPIXLH.js +1350 -0
- package/dist/chunk-ZPILUBWK.js +2142 -0
- package/dist/chunk-ZYEOHGU5.js +362 -0
- package/dist/co-activation-WCLF766F.js +73 -0
- package/dist/co-activation-WJTFJOTK.js +73 -0
- package/dist/co-occurrence-KFP6ZS7G.js +94 -0
- package/dist/co-occurrence-LPHW6UTZ.js +94 -0
- package/dist/code-context-index-QR5PAXM4.js +30 -0
- package/dist/conversation-wiki-populator-IMHNWKEU.js +105 -0
- package/dist/core-memory-3LSCC75D.js +110 -0
- package/dist/core-memory-DBZJ72TV.js +110 -0
- package/dist/crdt-sync-6DVGRMTV.js +33 -0
- package/dist/crdt-sync-UQ3PXFRB.js +33 -0
- package/dist/crm-webhook-55T4Z6XJ.js +10 -0
- package/dist/crm-webhook-VONTDB3M.js +10 -0
- package/dist/cto-delegation-gate-B7AKO7FX.js +279 -0
- package/dist/cto-delegation-gate-SPM6LAL2.js +279 -0
- package/dist/daemon-auth-55T2DI6G.js +13 -0
- package/dist/daemon-orchestration-XZLWWIV4.js +138 -0
- package/dist/daemon-orchestration-ZBDBRKVR.js +138 -0
- package/dist/db-backup-JHCI47JQ.js +37 -0
- package/dist/db-backup-LPCCZYIL.js +33 -0
- package/dist/db-restore-events-QF3KCGVZ.js +76 -0
- package/dist/doc-graph-extractor-4X23NP4I.js +132 -0
- package/dist/doc-graph-extractor-IOSZSDDW.js +132 -0
- package/dist/dreaming-KA3SN53N.js +33 -0
- package/dist/dreaming-TFZDGA72.js +33 -0
- package/dist/entity-boost-YFIFLE6N.js +375 -0
- package/dist/exe-drift-CLJ74KCO.js +69 -0
- package/dist/exe-drift-TEM7ELNY.js +69 -0
- package/dist/exe-export-CRCA4T4S.js +75 -0
- package/dist/exe-export-QF5V54XC.js +75 -0
- package/dist/exe-import-M4VYXCJZ.js +78 -0
- package/dist/exe-import-UZMMWNHJ.js +78 -0
- package/dist/exe-key-7PDQ72W2.js +580 -0
- package/dist/exe-key-NQQXEDUA.js +672 -0
- package/dist/exe-org-VAUMR7TL.js +73 -0
- package/dist/exe-snapshot-P7PUAJTV.js +337 -0
- package/dist/exe-snapshot-W5IVP6VF.js +337 -0
- package/dist/fast-db-init-G63PRINQ.js +7 -0
- package/dist/fast-db-init-MZOQZ2BW.js +7 -0
- package/dist/founder-context-QGKRISJH.js +96 -0
- package/dist/gateway/index.js +10 -10
- package/dist/git-staleness-42TTCFDP.js +111 -0
- package/dist/git-staleness-U7ADZARV.js +111 -0
- package/dist/git-task-sweep-4LW5RYYO.js +41 -0
- package/dist/git-task-sweep-T27IFHBH.js +41 -0
- package/dist/global-procedures-BVFRWJAV.js +21 -0
- package/dist/global-procedures-VJUQAYZ5.js +21 -0
- package/dist/graph-auto-extract-4ZA7UC6C.js +182 -0
- package/dist/graph-auto-extract-ZTZ44VKT.js +182 -0
- package/dist/hook-integrity-YPMNLP7B.js +89 -0
- package/dist/hooks/bug-report-worker.js +15 -15
- package/dist/hooks/codex-stop-task-finalizer.js +15 -15
- package/dist/hooks/commit-complete.js +16 -16
- package/dist/hooks/error-recall.js +9 -9
- package/dist/hooks/exe-heartbeat-hook.js +6 -6
- package/dist/hooks/ingest-worker.js +5 -5
- package/dist/hooks/ingest.js +13 -13
- package/dist/hooks/instructions-loaded.js +7 -7
- package/dist/hooks/manifest.json +20 -20
- package/dist/hooks/notification.js +7 -7
- package/dist/hooks/post-compact.js +15 -15
- package/dist/hooks/post-tool-combined.js +7 -7
- package/dist/hooks/pre-compact.js +20 -20
- package/dist/hooks/pre-tool-use.js +19 -19
- package/dist/hooks/prompt-submit.js +27 -27
- package/dist/hooks/session-end.js +25 -25
- package/dist/hooks/session-start.js +24 -18
- package/dist/hooks/stop.js +22 -22
- package/dist/hooks/subagent-stop.js +15 -15
- package/dist/hooks/summary-worker.js +22 -22
- package/dist/index.js +21 -21
- package/dist/installer-2MDIUMZS.js +343 -0
- package/dist/installer-CBGRTGIF.js +297 -0
- package/dist/installer-DGU4WZKJ.js +39 -0
- package/dist/installer-DS7H47GB.js +297 -0
- package/dist/installer-JSUC44TR.js +39 -0
- package/dist/installer-WTWEOSEK.js +343 -0
- package/dist/key-backup-status-X5CBECJ3.js +39 -0
- package/dist/lib/agent-config.js +2 -2
- package/dist/lib/cloud-sync.js +7 -7
- package/dist/lib/config.js +7 -1
- package/dist/lib/consolidation.js +9 -7
- package/dist/lib/database.js +4 -4
- package/dist/lib/db-daemon-client.js +3 -3
- package/dist/lib/db.js +4 -4
- package/dist/lib/device-registry.js +1 -1
- package/dist/lib/embed-worker.js +18 -7
- package/dist/lib/embedder.js +4 -4
- package/dist/lib/employee-templates.js +6 -6
- package/dist/lib/employees.js +4 -4
- package/dist/lib/exe-daemon-client.js +3 -3
- package/dist/lib/exe-daemon.js +165 -67
- package/dist/lib/hybrid-search.js +7 -7
- package/dist/lib/identity-templates.js +1 -1
- package/dist/lib/identity.js +4 -4
- package/dist/lib/license.js +2 -2
- package/dist/lib/messaging.js +13 -13
- package/dist/lib/reminders.js +5 -5
- package/dist/lib/schedules.js +7 -7
- package/dist/lib/session-registry.js +6 -6
- package/dist/lib/skill-learning.js +8 -8
- package/dist/lib/store.js +6 -6
- package/dist/lib/task-router.js +5 -5
- package/dist/lib/tasks.js +14 -14
- package/dist/lib/tmux-routing.js +12 -12
- package/dist/lib/token-spend.js +5 -5
- package/dist/lib/ws-client.js +5 -0
- package/dist/license-gate-OSPA2OD7.js +16 -0
- package/dist/license-gate-R5EZ7HD3.js +14 -0
- package/dist/mcp/register-tools.js +67 -67
- package/dist/mcp/server.js +128 -84
- package/dist/mcp/tools/complete-reminder.js +6 -6
- package/dist/mcp/tools/create-reminder.js +6 -6
- package/dist/mcp/tools/create-task.js +16 -16
- package/dist/mcp/tools/deactivate-behavior.js +9 -9
- package/dist/mcp/tools/list-reminders.js +6 -6
- package/dist/mcp/tools/list-tasks.js +16 -16
- package/dist/mcp/tools/send-message.js +15 -15
- package/dist/mcp/tools/update-task.js +15 -15
- package/dist/mcp-http-config-DV6S22TF.js +28 -0
- package/dist/mcp-http-config-OGFPLJYH.js +28 -0
- package/dist/memory-cards-AUWC6FN6.js +179 -0
- package/dist/memory-cards-GJ3VHKAM.js +179 -0
- package/dist/memory-graph-extractor-7OWSK2ON.js +21 -0
- package/dist/memory-graph-extractor-TCTCM7PZ.js +21 -0
- package/dist/memory-poisoning-defense-FVLGA35X.js +223 -0
- package/dist/memory-poisoning-defense-TLVXFY43.js +223 -0
- package/dist/memory-queue-4QU434ZH.js +19 -0
- package/dist/memory-queue-client-6KTL3U3I.js +16 -0
- package/dist/memory-reflection-BYJFIFSV.js +243 -0
- package/dist/memory-reflection-C52FI4W2.js +243 -0
- package/dist/message-queue-client-DFXF7LJD.js +92 -0
- package/dist/notifications-AQKZFSR3.js +46 -0
- package/dist/notifications-U3NJYMXX.js +46 -0
- package/dist/oauth-server-NR3XEPA4.js +437 -0
- package/dist/orchestration-events-RDSYLFXZ.js +26 -0
- package/dist/orchestration-events-TKODYRYP.js +26 -0
- package/dist/orchestration-phase-UCTFU32J.js +23 -0
- package/dist/orchestrator-2JTJQLPG.js +34 -0
- package/dist/orchestrator-GNI5PCA6.js +34 -0
- package/dist/pipeline-router-HBSTKHG5.js +14 -0
- package/dist/pipeline-router-P2QAQHUY.js +14 -0
- package/dist/plan-limits-GQENSNTG.js +27 -0
- package/dist/plan-limits-UDKZ2O7W.js +27 -0
- package/dist/project-boot-5R3GLCVN.js +299 -0
- package/dist/project-boot-W2LTP7WW.js +299 -0
- package/dist/projection-worker-7EWWMJHG.js +1034 -0
- package/dist/projection-worker-ZMT5KNJJ.js +1084 -0
- package/dist/prospective-memory-7B65EHWB.js +231 -0
- package/dist/prospective-memory-LANRNOJX.js +231 -0
- package/dist/push-notifications-X7E7GSC7.js +15 -0
- package/dist/reranker-EUG4XM44.js +19 -0
- package/dist/reranker-QGJO6EHO.js +19 -0
- package/dist/retrieval-health-JE66LJ3I.js +11 -0
- package/dist/retrieval-health-WLNAPJCX.js +11 -0
- package/dist/review-polling-IXJ57M6Q.js +125 -0
- package/dist/review-polling-WHPJUENR.js +125 -0
- package/dist/runtime/index.js +15 -15
- package/dist/session-events-WMK6FCKZ.js +37 -0
- package/dist/session-events-XKG66APL.js +37 -0
- package/dist/session-kill-telemetry-2BU72YXD.js +30 -0
- package/dist/session-kill-telemetry-VTU7YBII.js +30 -0
- package/dist/session-scope-RYBNHQ43.js +87 -0
- package/dist/session-scope-TQZONLZL.js +87 -0
- package/dist/setup-wizard-NID5EPDN.js +12 -0
- package/dist/setup-wizard-PXK6SC2D.js +12 -0
- package/dist/shard-manager-F3YYEG5S.js +30 -0
- package/dist/skill-refinement-KRMGOT5M.js +158 -0
- package/dist/skill-refinement-Y6LLKYRL.js +158 -0
- package/dist/stack-update-3LZQWW3G.js +80 -0
- package/dist/steward-gate-KC4NOULU.js +14 -0
- package/dist/steward-gate-QV2APBFB.js +14 -0
- package/dist/task-enforcement-AI433TPY.js +439 -0
- package/dist/task-enforcement-GLDD2W5D.js +505 -0
- package/dist/task-scope-HMPIP6XB.js +36 -0
- package/dist/task-scope-XRH4KDJB.js +36 -0
- package/dist/tasks-crud-2KYGDJG2.js +78 -0
- package/dist/tasks-crud-FH2SFCNQ.js +78 -0
- package/dist/tasks-notify-3ZW2GLCS.js +39 -0
- package/dist/tasks-notify-AJSRQHLZ.js +39 -0
- package/dist/tasks-review-ISSCHGTG.js +48 -0
- package/dist/tasks-review-XERV6KZD.js +48 -0
- package/dist/telemetry-upload-R77W7I7G.js +740 -0
- package/dist/telemetry-upload-VZ3A6EPD.js +740 -0
- package/dist/token-budget-NA4WQAY6.js +85 -0
- package/dist/token-budget-SIXJ7ED5.js +85 -0
- package/dist/tool-capability-index-TK5K76RB.js +10 -0
- package/dist/tool-telemetry-D4Q76LAS.js +17 -0
- package/dist/tool-telemetry-NTFTPF3L.js +17 -0
- package/dist/tui/App.js +25 -25
- package/dist/tui-data-2LNENF36.js +259 -0
- package/dist/tui-data-NJSEIA2Q.js +259 -0
- package/dist/webhook-pipe-VQMOLXMW.js +114 -0
- package/dist/wiki-acl-33D5QTU4.js +111 -0
- package/dist/wiki-acl-RE5IR5VV.js +111 -0
- package/dist/wiki-client-XZ6VZTH6.js +157 -0
- package/dist/worker-gate-NCEAKLJE.js +21 -0
- package/dist/worker-gate-VN2POPFL.js +21 -0
- package/dist/workflow-engine-D7ALMSDM.js +28 -0
- package/dist/workflow-engine-WFN3HPAZ.js +28 -0
- package/dist/worktree-6I45JV5N.js +27 -0
- package/dist/worktree-O66YDTSF.js +27 -0
- package/dist/worktree-sweep-IMDR3XHT.js +20 -0
- package/dist/worktree-sweep-M2ENRTY6.js +20 -0
- package/package.json +1 -1
- package/release-notes.json +127 -127
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getClient
|
|
3
|
+
} from "./chunk-DBQ6I6K2.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/session-kill-telemetry.ts
|
|
6
|
+
import crypto from "crypto";
|
|
7
|
+
import { appendFileSync } from "fs";
|
|
8
|
+
import path from "path";
|
|
9
|
+
import os from "os";
|
|
10
|
+
var KILL_FILE_LOG = path.join(os.homedir(), ".exe-os", "logs", "session-kills.jsonl");
|
|
11
|
+
var TOKENS_PER_IDLE_MINUTE = 50;
|
|
12
|
+
async function recordSessionKill(input) {
|
|
13
|
+
const killedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
14
|
+
const id = crypto.randomUUID();
|
|
15
|
+
try {
|
|
16
|
+
const logEntry = JSON.stringify({
|
|
17
|
+
id,
|
|
18
|
+
timestamp: killedAt,
|
|
19
|
+
session: input.sessionName,
|
|
20
|
+
agent: input.agentId,
|
|
21
|
+
reason: input.reason,
|
|
22
|
+
ticksIdle: input.ticksIdle ?? null,
|
|
23
|
+
tokensSaved: input.estimatedTokensSaved ?? null
|
|
24
|
+
});
|
|
25
|
+
appendFileSync(KILL_FILE_LOG, logEntry + "\n");
|
|
26
|
+
} catch {
|
|
27
|
+
process.stderr.write(
|
|
28
|
+
`[session-kill-telemetry] file log write failed for ${input.sessionName}
|
|
29
|
+
`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const client = getClient();
|
|
34
|
+
await client.execute({
|
|
35
|
+
sql: `INSERT INTO session_kills
|
|
36
|
+
(id, session_name, agent_id, killed_at, reason,
|
|
37
|
+
ticks_idle, estimated_tokens_saved)
|
|
38
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)`,
|
|
39
|
+
args: [
|
|
40
|
+
id,
|
|
41
|
+
input.sessionName,
|
|
42
|
+
input.agentId,
|
|
43
|
+
killedAt,
|
|
44
|
+
input.reason,
|
|
45
|
+
input.ticksIdle ?? null,
|
|
46
|
+
input.estimatedTokensSaved ?? null
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
} catch (err) {
|
|
50
|
+
process.stderr.write(
|
|
51
|
+
`[session-kill-telemetry] DB write failed: ${err instanceof Error ? err.message : String(err)}
|
|
52
|
+
`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function countKillsSince(sinceISO) {
|
|
57
|
+
try {
|
|
58
|
+
const client = getClient();
|
|
59
|
+
const result = await client.execute({
|
|
60
|
+
sql: `SELECT COUNT(*) AS n FROM session_kills WHERE killed_at >= ?`,
|
|
61
|
+
args: [sinceISO]
|
|
62
|
+
});
|
|
63
|
+
const row = result.rows[0];
|
|
64
|
+
return row ? Number(row.n) : 0;
|
|
65
|
+
} catch {
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
var IDLE_KILL_STREAK_META_KEY = "idle_kill_suspect_streak";
|
|
70
|
+
var IDLE_KILL_SUSPECT_DAY_THRESHOLD = 3;
|
|
71
|
+
var IDLE_KILL_MIN_LIVE_SESSIONS = 5;
|
|
72
|
+
function parseStreakState(raw) {
|
|
73
|
+
if (!raw) return { lastDate: null, streak: 0 };
|
|
74
|
+
try {
|
|
75
|
+
const parsed = JSON.parse(raw);
|
|
76
|
+
return {
|
|
77
|
+
lastDate: typeof parsed.lastDate === "string" ? parsed.lastDate : null,
|
|
78
|
+
streak: typeof parsed.streak === "number" ? parsed.streak : 0
|
|
79
|
+
};
|
|
80
|
+
} catch {
|
|
81
|
+
return { lastDate: null, streak: 0 };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function nextStreakState(prev, qualifiesToday, todayDate) {
|
|
85
|
+
if (!qualifiesToday) return { lastDate: todayDate, streak: 0 };
|
|
86
|
+
if (prev.lastDate === todayDate) return prev;
|
|
87
|
+
return { lastDate: todayDate, streak: prev.streak + 1 };
|
|
88
|
+
}
|
|
89
|
+
function computeIdleKillSuspectStreak(prev, killsToday, liveSessions, todayDate) {
|
|
90
|
+
const qualifies = killsToday === 0 && liveSessions >= IDLE_KILL_MIN_LIVE_SESSIONS;
|
|
91
|
+
const state = nextStreakState(prev, qualifies, todayDate);
|
|
92
|
+
return {
|
|
93
|
+
state,
|
|
94
|
+
suspect: state.streak >= IDLE_KILL_SUSPECT_DAY_THRESHOLD
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async function sumTokensSavedSince(sinceISO) {
|
|
98
|
+
try {
|
|
99
|
+
const client = getClient();
|
|
100
|
+
const result = await client.execute({
|
|
101
|
+
sql: `SELECT COALESCE(SUM(estimated_tokens_saved), 0) AS total
|
|
102
|
+
FROM session_kills
|
|
103
|
+
WHERE killed_at >= ?`,
|
|
104
|
+
args: [sinceISO]
|
|
105
|
+
});
|
|
106
|
+
const row = result.rows[0];
|
|
107
|
+
return row ? Number(row.total) : 0;
|
|
108
|
+
} catch {
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export {
|
|
114
|
+
TOKENS_PER_IDLE_MINUTE,
|
|
115
|
+
recordSessionKill,
|
|
116
|
+
countKillsSince,
|
|
117
|
+
IDLE_KILL_STREAK_META_KEY,
|
|
118
|
+
IDLE_KILL_SUSPECT_DAY_THRESHOLD,
|
|
119
|
+
IDLE_KILL_MIN_LIVE_SESSIONS,
|
|
120
|
+
parseStreakState,
|
|
121
|
+
computeIdleKillSuspectStreak,
|
|
122
|
+
sumTokensSavedSince
|
|
123
|
+
};
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EXE_AI_DIR
|
|
3
|
+
} from "./chunk-5P3HOBZX.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/license.ts
|
|
6
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, statSync } from "fs";
|
|
7
|
+
import { randomUUID } from "crypto";
|
|
8
|
+
import path from "path";
|
|
9
|
+
import { jwtVerify, importSPKI } from "jose";
|
|
10
|
+
var LICENSE_PATH = path.join(EXE_AI_DIR, "license.key");
|
|
11
|
+
var CACHE_PATH = path.join(EXE_AI_DIR, "license-cache.json");
|
|
12
|
+
var DEVICE_ID_PATH = path.join(EXE_AI_DIR, "device-id");
|
|
13
|
+
var API_BASE = process.env.EXE_CLOUD_ENDPOINT ?? "https://api.askexe.com";
|
|
14
|
+
var RETRY_DELAY_MS = 500;
|
|
15
|
+
async function fetchRetry(url, init) {
|
|
16
|
+
try {
|
|
17
|
+
return await fetch(url, init);
|
|
18
|
+
} catch {
|
|
19
|
+
await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
|
|
20
|
+
return fetch(url, { ...init, signal: AbortSignal.timeout(1e4) });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var LICENSE_PUBLIC_KEY_PEM = `-----BEGIN PUBLIC KEY-----
|
|
24
|
+
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeHztAMOpR/ZMh+rWuOASjEZ54CGY
|
|
25
|
+
4uj+UqeKCcvtgNHKmOK278HJaJcANe9xAeji8AFYu27q3WtzCi04pHudow==
|
|
26
|
+
-----END PUBLIC KEY-----`;
|
|
27
|
+
var LICENSE_PUBLIC_KEY_PEM_PREV = `-----BEGIN PUBLIC KEY-----
|
|
28
|
+
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEVlMxzSQraFaXp+qRyRwDNg25R4qH
|
|
29
|
+
sV3p1+vXy1GH/9W2VQyq3pUvOlAeeDMMT+hbL5kbtwCl7daoaZZ8Tv8acw==
|
|
30
|
+
-----END PUBLIC KEY-----`;
|
|
31
|
+
var LICENSE_PUBLIC_KEY_PEM_2026_06_17 = `-----BEGIN PUBLIC KEY-----
|
|
32
|
+
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYdtXo668/3uHX+8DY9MOgm0HzVrP
|
|
33
|
+
oR8NJBuiITKaerulCXiSiJMX1HP0+h5dHBVfCWQfIVk5BMdsheAMaP806w==
|
|
34
|
+
-----END PUBLIC KEY-----`;
|
|
35
|
+
var LICENSE_PUBLIC_KEYS = [LICENSE_PUBLIC_KEY_PEM_2026_06_17, LICENSE_PUBLIC_KEY_PEM, LICENSE_PUBLIC_KEY_PEM_PREV];
|
|
36
|
+
var LICENSE_JWT_ALG = "ES256";
|
|
37
|
+
var PLAN_LIMITS = {
|
|
38
|
+
free: { devices: 1, employees: 1, memories: 5e3 },
|
|
39
|
+
pro: { devices: 3, employees: 5, memories: 1e5 },
|
|
40
|
+
team: { devices: 10, employees: 20, memories: 1e6 },
|
|
41
|
+
agency: { devices: 50, employees: 100, memories: 1e7 },
|
|
42
|
+
enterprise: { devices: -1, employees: -1, memories: -1 }
|
|
43
|
+
};
|
|
44
|
+
var FREE_LICENSE = {
|
|
45
|
+
valid: true,
|
|
46
|
+
plan: "free",
|
|
47
|
+
email: "",
|
|
48
|
+
expiresAt: null,
|
|
49
|
+
deviceLimit: 1,
|
|
50
|
+
employeeLimit: 1,
|
|
51
|
+
memoryLimit: 5e3
|
|
52
|
+
};
|
|
53
|
+
function loadDeviceId() {
|
|
54
|
+
const deviceJsonPath = path.join(EXE_AI_DIR, "device.json");
|
|
55
|
+
try {
|
|
56
|
+
if (existsSync(deviceJsonPath)) {
|
|
57
|
+
const data = JSON.parse(readFileSync(deviceJsonPath, "utf8"));
|
|
58
|
+
if (data.deviceId) return data.deviceId;
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
if (existsSync(DEVICE_ID_PATH)) {
|
|
64
|
+
const id2 = readFileSync(DEVICE_ID_PATH, "utf8").trim();
|
|
65
|
+
if (id2) return id2;
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
const id = randomUUID();
|
|
70
|
+
mkdirSync(EXE_AI_DIR, { recursive: true });
|
|
71
|
+
writeFileSync(DEVICE_ID_PATH, id, "utf8");
|
|
72
|
+
return id;
|
|
73
|
+
}
|
|
74
|
+
function loadLicense() {
|
|
75
|
+
try {
|
|
76
|
+
if (!existsSync(LICENSE_PATH)) return null;
|
|
77
|
+
return readFileSync(LICENSE_PATH, "utf8").trim();
|
|
78
|
+
} catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function saveLicense(apiKey) {
|
|
83
|
+
mkdirSync(EXE_AI_DIR, { recursive: true });
|
|
84
|
+
writeFileSync(LICENSE_PATH, apiKey.trim(), { encoding: "utf8", mode: 384 });
|
|
85
|
+
}
|
|
86
|
+
async function verifyLicenseJwt(token) {
|
|
87
|
+
for (const pem of LICENSE_PUBLIC_KEYS) {
|
|
88
|
+
try {
|
|
89
|
+
const key = await importSPKI(pem, LICENSE_JWT_ALG);
|
|
90
|
+
const { payload } = await jwtVerify(token, key, {
|
|
91
|
+
algorithms: [LICENSE_JWT_ALG]
|
|
92
|
+
});
|
|
93
|
+
const plan = payload.plan ?? "free";
|
|
94
|
+
const email = payload.sub ?? "";
|
|
95
|
+
const limits = PLAN_LIMITS[plan] ?? PLAN_LIMITS.free;
|
|
96
|
+
return {
|
|
97
|
+
valid: true,
|
|
98
|
+
plan,
|
|
99
|
+
email,
|
|
100
|
+
expiresAt: payload.exp ? new Date(payload.exp * 1e3).toISOString() : null,
|
|
101
|
+
deviceLimit: limits.devices,
|
|
102
|
+
employeeLimit: limits.employees,
|
|
103
|
+
memoryLimit: limits.memories
|
|
104
|
+
};
|
|
105
|
+
} catch {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
async function getCachedLicense() {
|
|
112
|
+
try {
|
|
113
|
+
if (!existsSync(CACHE_PATH)) return null;
|
|
114
|
+
const raw = JSON.parse(readFileSync(CACHE_PATH, "utf8"));
|
|
115
|
+
if (!raw.token || typeof raw.token !== "string") return null;
|
|
116
|
+
return await verifyLicenseJwt(raw.token);
|
|
117
|
+
} catch {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function getGraceVerifiedLicense(graceDays = 7) {
|
|
122
|
+
try {
|
|
123
|
+
const token = readCachedLicenseToken();
|
|
124
|
+
if (!token) return null;
|
|
125
|
+
const payloadB64 = token.split(".")[1];
|
|
126
|
+
if (!payloadB64) return null;
|
|
127
|
+
const payload = JSON.parse(Buffer.from(payloadB64, "base64url").toString());
|
|
128
|
+
const expMs = (payload.exp ?? 0) * 1e3;
|
|
129
|
+
if (Date.now() >= expMs + graceDays * 24 * 60 * 60 * 1e3) return null;
|
|
130
|
+
let verified = null;
|
|
131
|
+
for (const pem of LICENSE_PUBLIC_KEYS) {
|
|
132
|
+
try {
|
|
133
|
+
const key = await importSPKI(pem, LICENSE_JWT_ALG);
|
|
134
|
+
const result = await jwtVerify(token, key, {
|
|
135
|
+
algorithms: [LICENSE_JWT_ALG],
|
|
136
|
+
clockTolerance: graceDays * 24 * 60 * 60
|
|
137
|
+
});
|
|
138
|
+
verified = result.payload;
|
|
139
|
+
break;
|
|
140
|
+
} catch {
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (!verified) return null;
|
|
145
|
+
const plan = verified.plan ?? "free";
|
|
146
|
+
const limits = PLAN_LIMITS[plan] ?? PLAN_LIMITS.free;
|
|
147
|
+
process.stderr.write(
|
|
148
|
+
`[license] Offline grace: verified cached plan "${plan}" (expired, within ${graceDays}d grace).
|
|
149
|
+
`
|
|
150
|
+
);
|
|
151
|
+
return {
|
|
152
|
+
valid: true,
|
|
153
|
+
plan,
|
|
154
|
+
email: verified.sub ?? "",
|
|
155
|
+
expiresAt: verified.exp ? new Date(verified.exp * 1e3).toISOString() : null,
|
|
156
|
+
deviceLimit: limits.devices,
|
|
157
|
+
employeeLimit: limits.employees,
|
|
158
|
+
memoryLimit: limits.memories
|
|
159
|
+
};
|
|
160
|
+
} catch {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function readCachedLicenseToken() {
|
|
165
|
+
try {
|
|
166
|
+
if (!existsSync(CACHE_PATH)) return null;
|
|
167
|
+
const raw = JSON.parse(readFileSync(CACHE_PATH, "utf8"));
|
|
168
|
+
return typeof raw.token === "string" ? raw.token : null;
|
|
169
|
+
} catch {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function cacheResponse(token) {
|
|
174
|
+
try {
|
|
175
|
+
writeFileSync(CACHE_PATH, JSON.stringify({ token }), "utf8");
|
|
176
|
+
} catch {
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async function validateViaCFWorker(apiKey, deviceId) {
|
|
180
|
+
try {
|
|
181
|
+
const res = await fetchRetry(`${API_BASE}/auth/activate`, {
|
|
182
|
+
method: "POST",
|
|
183
|
+
headers: { "Content-Type": "application/json" },
|
|
184
|
+
body: JSON.stringify({ apiKey, deviceId }),
|
|
185
|
+
signal: AbortSignal.timeout(1e4)
|
|
186
|
+
});
|
|
187
|
+
if (!res.ok) return null;
|
|
188
|
+
const data = await res.json();
|
|
189
|
+
if (data.error === "device_limit_exceeded") return null;
|
|
190
|
+
if (!data.valid) return null;
|
|
191
|
+
if (data.token) {
|
|
192
|
+
cacheResponse(data.token);
|
|
193
|
+
const verified = await verifyLicenseJwt(data.token);
|
|
194
|
+
if (verified) return verified;
|
|
195
|
+
}
|
|
196
|
+
const limits = PLAN_LIMITS[data.plan] ?? PLAN_LIMITS.free;
|
|
197
|
+
return {
|
|
198
|
+
valid: data.valid,
|
|
199
|
+
plan: data.plan,
|
|
200
|
+
email: data.email,
|
|
201
|
+
expiresAt: data.expiresAt,
|
|
202
|
+
deviceLimit: limits.devices,
|
|
203
|
+
employeeLimit: limits.employees,
|
|
204
|
+
memoryLimit: limits.memories
|
|
205
|
+
};
|
|
206
|
+
} catch {
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
async function validateLicense(apiKey, deviceId) {
|
|
211
|
+
const did = deviceId ?? loadDeviceId();
|
|
212
|
+
const cfResult = await validateViaCFWorker(apiKey, did);
|
|
213
|
+
if (cfResult) return cfResult;
|
|
214
|
+
const cached = await getCachedLicense();
|
|
215
|
+
if (cached) return cached;
|
|
216
|
+
const graced = await getGraceVerifiedLicense();
|
|
217
|
+
if (graced) return graced;
|
|
218
|
+
return { ...FREE_LICENSE, valid: false };
|
|
219
|
+
}
|
|
220
|
+
var CACHE_MAX_AGE_MS = 36e5;
|
|
221
|
+
function getCacheAgeMs() {
|
|
222
|
+
try {
|
|
223
|
+
const s = statSync(CACHE_PATH);
|
|
224
|
+
return Date.now() - s.mtimeMs;
|
|
225
|
+
} catch {
|
|
226
|
+
return Infinity;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
async function checkLicense() {
|
|
230
|
+
let key = loadLicense();
|
|
231
|
+
if (!key) {
|
|
232
|
+
try {
|
|
233
|
+
const configPath = path.join(EXE_AI_DIR, "config.json");
|
|
234
|
+
if (existsSync(configPath)) {
|
|
235
|
+
const raw = JSON.parse(readFileSync(configPath, "utf8"));
|
|
236
|
+
const cloud = raw.cloud;
|
|
237
|
+
if (cloud?.apiKey) {
|
|
238
|
+
key = cloud.apiKey;
|
|
239
|
+
saveLicense(key);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
} catch {
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (!key) return FREE_LICENSE;
|
|
246
|
+
const cached = await getCachedLicense();
|
|
247
|
+
if (cached && getCacheAgeMs() < CACHE_MAX_AGE_MS) return cached;
|
|
248
|
+
const deviceId = loadDeviceId();
|
|
249
|
+
return validateLicense(key, deviceId);
|
|
250
|
+
}
|
|
251
|
+
function isFeatureAllowed(license, feature) {
|
|
252
|
+
switch (feature) {
|
|
253
|
+
case "cloud_sync":
|
|
254
|
+
case "external_agents":
|
|
255
|
+
case "wiki":
|
|
256
|
+
return license.plan !== "free";
|
|
257
|
+
case "unlimited_employees":
|
|
258
|
+
return license.plan === "team" || license.plan === "agency" || license.plan === "enterprise";
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function mirrorLicenseKey(apiKey) {
|
|
262
|
+
const trimmed = apiKey.trim();
|
|
263
|
+
if (!trimmed) return;
|
|
264
|
+
saveLicense(trimmed);
|
|
265
|
+
}
|
|
266
|
+
async function assertVpsLicense(opts) {
|
|
267
|
+
const env = opts?.env ?? process.env;
|
|
268
|
+
const inProduction = env.NODE_ENV === "production";
|
|
269
|
+
if (!opts?.force && !inProduction) {
|
|
270
|
+
return { ...FREE_LICENSE, plan: "free" };
|
|
271
|
+
}
|
|
272
|
+
const envKey = env.EXE_LICENSE_KEY?.trim();
|
|
273
|
+
if (envKey) {
|
|
274
|
+
saveLicense(envKey);
|
|
275
|
+
}
|
|
276
|
+
const apiKey = envKey ?? loadLicense();
|
|
277
|
+
if (!apiKey) {
|
|
278
|
+
throw new Error(
|
|
279
|
+
"License required: set EXE_LICENSE_KEY env var with your exe_sk_* key. Purchase at https://askexe.com. This VPS image refuses to boot without a valid license."
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
const deviceId = loadDeviceId();
|
|
283
|
+
let backendResponse = null;
|
|
284
|
+
let explicitRejection = false;
|
|
285
|
+
let transientFailure = false;
|
|
286
|
+
try {
|
|
287
|
+
const res = await fetchRetry(`${API_BASE}/auth/activate`, {
|
|
288
|
+
method: "POST",
|
|
289
|
+
headers: { "Content-Type": "application/json" },
|
|
290
|
+
body: JSON.stringify({ apiKey, deviceId }),
|
|
291
|
+
signal: AbortSignal.timeout(1e4)
|
|
292
|
+
});
|
|
293
|
+
if (res.ok) {
|
|
294
|
+
backendResponse = await res.json();
|
|
295
|
+
if (!backendResponse.valid) explicitRejection = true;
|
|
296
|
+
} else if (res.status === 401 || res.status === 403) {
|
|
297
|
+
explicitRejection = true;
|
|
298
|
+
} else {
|
|
299
|
+
transientFailure = true;
|
|
300
|
+
}
|
|
301
|
+
} catch {
|
|
302
|
+
transientFailure = true;
|
|
303
|
+
}
|
|
304
|
+
if (backendResponse?.valid) {
|
|
305
|
+
if (backendResponse.token) {
|
|
306
|
+
cacheResponse(backendResponse.token);
|
|
307
|
+
const verified = await verifyLicenseJwt(backendResponse.token);
|
|
308
|
+
if (verified) return verified;
|
|
309
|
+
}
|
|
310
|
+
const limits = PLAN_LIMITS[backendResponse.plan] ?? PLAN_LIMITS.free;
|
|
311
|
+
return {
|
|
312
|
+
valid: true,
|
|
313
|
+
plan: backendResponse.plan,
|
|
314
|
+
email: backendResponse.email,
|
|
315
|
+
expiresAt: backendResponse.expiresAt,
|
|
316
|
+
deviceLimit: limits.devices,
|
|
317
|
+
employeeLimit: limits.employees,
|
|
318
|
+
memoryLimit: limits.memories
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
if (explicitRejection) {
|
|
322
|
+
throw new Error(
|
|
323
|
+
`License invalid or expired. Renew at https://askexe.com, then restart. Backend rejected key ending in ...${apiKey.slice(-4)}.`
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
if (!transientFailure) {
|
|
327
|
+
throw new Error(
|
|
328
|
+
"License validation failed: unknown backend state. Restore network connectivity to https://api.askexe.com and retry."
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
const fresh = await getCachedLicense();
|
|
332
|
+
if (fresh && fresh.valid) return fresh;
|
|
333
|
+
const graceDays = opts?.offlineGraceDays ?? 7;
|
|
334
|
+
const graced = await getGraceVerifiedLicense(graceDays);
|
|
335
|
+
if (graced) return graced;
|
|
336
|
+
throw new Error(
|
|
337
|
+
`License validation unreachable for more than ${graceDays} days. Restore network connectivity to https://api.askexe.com and retry. This VPS image refuses to boot after the offline grace window.`
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
var _revalTimer = null;
|
|
341
|
+
function startLicenseRevalidation(intervalMs = 36e5) {
|
|
342
|
+
if (_revalTimer) return;
|
|
343
|
+
_revalTimer = setInterval(async () => {
|
|
344
|
+
try {
|
|
345
|
+
const license = await checkLicense();
|
|
346
|
+
if (!license.valid) {
|
|
347
|
+
process.stderr.write("[exe-os] License expired or invalid \u2014 features may be restricted\n");
|
|
348
|
+
}
|
|
349
|
+
} catch {
|
|
350
|
+
}
|
|
351
|
+
}, intervalMs);
|
|
352
|
+
if (_revalTimer && typeof _revalTimer === "object" && "unref" in _revalTimer) {
|
|
353
|
+
_revalTimer.unref();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
function stopLicenseRevalidation() {
|
|
357
|
+
if (_revalTimer) {
|
|
358
|
+
clearInterval(_revalTimer);
|
|
359
|
+
_revalTimer = null;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export {
|
|
364
|
+
LICENSE_PUBLIC_KEY_PEM,
|
|
365
|
+
PLAN_LIMITS,
|
|
366
|
+
loadDeviceId,
|
|
367
|
+
loadLicense,
|
|
368
|
+
saveLicense,
|
|
369
|
+
getCachedLicense,
|
|
370
|
+
getGraceVerifiedLicense,
|
|
371
|
+
readCachedLicenseToken,
|
|
372
|
+
validateLicense,
|
|
373
|
+
checkLicense,
|
|
374
|
+
isFeatureAllowed,
|
|
375
|
+
mirrorLicenseKey,
|
|
376
|
+
assertVpsLicense,
|
|
377
|
+
startLicenseRevalidation,
|
|
378
|
+
stopLicenseRevalidation
|
|
379
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listBehaviors
|
|
3
|
+
} from "./chunk-7FTKXL5A.js";
|
|
4
|
+
import {
|
|
5
|
+
loadConfigSync
|
|
6
|
+
} from "./chunk-5P3HOBZX.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/behaviors-export.ts
|
|
9
|
+
import os from "os";
|
|
10
|
+
import path from "path";
|
|
11
|
+
import {
|
|
12
|
+
existsSync,
|
|
13
|
+
mkdirSync,
|
|
14
|
+
readdirSync,
|
|
15
|
+
statSync,
|
|
16
|
+
unlinkSync,
|
|
17
|
+
writeFileSync
|
|
18
|
+
} from "fs";
|
|
19
|
+
var BEHAVIORS_EXPORT_DIR = path.join(
|
|
20
|
+
os.homedir(),
|
|
21
|
+
".exe-os",
|
|
22
|
+
"behaviors-export"
|
|
23
|
+
);
|
|
24
|
+
var STALE_EXPORT_AGE_MS = 60 * 60 * 1e3;
|
|
25
|
+
var DEFAULT_BEHAVIOR_LIMIT = 30;
|
|
26
|
+
function getBehaviorLimit() {
|
|
27
|
+
try {
|
|
28
|
+
const cfg = loadConfigSync();
|
|
29
|
+
return cfg.behaviorExportLimit ?? DEFAULT_BEHAVIOR_LIMIT;
|
|
30
|
+
} catch {
|
|
31
|
+
return DEFAULT_BEHAVIOR_LIMIT;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function sweepStaleBehaviorExports(now = Date.now()) {
|
|
35
|
+
if (!existsSync(BEHAVIORS_EXPORT_DIR)) return;
|
|
36
|
+
let entries;
|
|
37
|
+
try {
|
|
38
|
+
entries = readdirSync(BEHAVIORS_EXPORT_DIR);
|
|
39
|
+
} catch {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
for (const entry of entries) {
|
|
43
|
+
const filePath = path.join(BEHAVIORS_EXPORT_DIR, entry);
|
|
44
|
+
try {
|
|
45
|
+
const stat = statSync(filePath);
|
|
46
|
+
if (now - stat.mtimeMs > STALE_EXPORT_AGE_MS) {
|
|
47
|
+
unlinkSync(filePath);
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function renderBehaviorLine(row) {
|
|
54
|
+
const tag = row.domain ? `[${row.domain}] ` : "";
|
|
55
|
+
const scope = row.project_name ? ` (${row.project_name})` : "";
|
|
56
|
+
return `- ${tag}${row.content}${scope}`;
|
|
57
|
+
}
|
|
58
|
+
function renderBehaviorExport(behaviors) {
|
|
59
|
+
if (behaviors.length === 0) {
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
const lines = behaviors.map(renderBehaviorLine);
|
|
63
|
+
return [
|
|
64
|
+
"<system-reminder>",
|
|
65
|
+
"## Your Behavioral Memory",
|
|
66
|
+
"Validated patterns and corrections for this session. Follow them.",
|
|
67
|
+
"Sourced from exe-os Layer 2 (Expertise). Changes apply on next spawn.",
|
|
68
|
+
"",
|
|
69
|
+
...lines,
|
|
70
|
+
"</system-reminder>",
|
|
71
|
+
""
|
|
72
|
+
].join("\n");
|
|
73
|
+
}
|
|
74
|
+
function exportFilePath(agentId, projectName, sessionKey) {
|
|
75
|
+
if (!sessionKey) {
|
|
76
|
+
return path.join(BEHAVIORS_EXPORT_DIR, `${agentId}.md`);
|
|
77
|
+
}
|
|
78
|
+
const safeProject = projectName.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
79
|
+
return path.join(
|
|
80
|
+
BEHAVIORS_EXPORT_DIR,
|
|
81
|
+
`${agentId}-${safeProject}-${sessionKey}.md`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
async function exportBehaviorsForAgent(agentId, projectName, sessionKey) {
|
|
85
|
+
mkdirSync(BEHAVIORS_EXPORT_DIR, { recursive: true });
|
|
86
|
+
sweepStaleBehaviorExports();
|
|
87
|
+
const behaviors = await listBehaviors(agentId, projectName, getBehaviorLimit());
|
|
88
|
+
if (behaviors.length === 0) return null;
|
|
89
|
+
const body = renderBehaviorExport(behaviors);
|
|
90
|
+
const target = exportFilePath(agentId, projectName, sessionKey);
|
|
91
|
+
writeFileSync(target, body, "utf-8");
|
|
92
|
+
return target;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
exportBehaviorsForAgent
|
|
97
|
+
};
|