@askexenow/exe-os 0.9.255 → 0.9.259
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/.env.customer.example +13 -13
- package/deploy/compose/.env.example +8 -8
- package/deploy/compose/docker-compose.yml +18 -18
- package/deploy/compose/generate-env.ts +22 -18
- package/deploy/compose/init-db.sql +221 -20
- package/deploy/stack-manifests/v0.9.json +1207 -1136
- package/dist/{active-agent-DTZ6VJIR.js → active-agent-IGZXTTV4.js} +3 -3
- package/dist/{active-agent-7QNK5CJZ.js → active-agent-OYUXMTHS.js} +3 -3
- package/dist/{agentic-ontology-UZK33N6I.js → agentic-ontology-5WT23SLZ.js} +1 -1
- package/dist/{backfill-metadata-R7PNZ5TX.js → backfill-metadata-EG52U3GF.js} +4 -4
- package/dist/{behaviors-G6QHSQBN.js → behaviors-2TZCFJLU.js} +3 -3
- package/dist/bin/age-ontology-load.js +2 -2
- package/dist/bin/agentic-ontology-backfill.js +5 -5
- package/dist/bin/agentic-reflection-backfill.js +6 -6
- package/dist/bin/agentic-semantic-label.js +5 -5
- package/dist/bin/backfill-conversations.js +6 -5
- package/dist/bin/backfill-responses.js +6 -5
- package/dist/bin/backfill-vectors.js +7 -6
- package/dist/bin/bulk-sync-postgres.js +6 -6
- package/dist/bin/cleanup-stale-review-tasks.js +9 -9
- package/dist/bin/cli.js +17 -17
- package/dist/bin/deferred-daemon-restart.js +4 -1
- package/dist/bin/exe-agent-config.js +2 -2
- package/dist/bin/exe-agent.js +4 -4
- package/dist/bin/exe-assign.js +8 -7
- package/dist/bin/exe-boot.js +16 -16
- package/dist/bin/exe-call.js +4 -4
- package/dist/bin/exe-cloud.js +4 -4
- package/dist/bin/exe-dispatch.js +9 -9
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +7 -7
- package/dist/bin/exe-forget.js +6 -6
- package/dist/bin/exe-gateway.js +9 -9
- package/dist/bin/exe-heartbeat.js +9 -9
- package/dist/bin/exe-kill.js +12 -12
- package/dist/bin/exe-launch-agent.js +16 -16
- package/dist/bin/exe-new-employee.js +6 -6
- package/dist/bin/exe-pending-messages.js +11 -10
- package/dist/bin/exe-pending-notifications.js +9 -9
- package/dist/bin/exe-pending-reviews.js +11 -9
- package/dist/bin/exe-rename.js +4 -4
- package/dist/bin/exe-review.js +11 -11
- package/dist/bin/exe-search.js +5 -5
- package/dist/bin/exe-session-cleanup.js +14 -14
- package/dist/bin/exe-settings.js +4 -4
- package/dist/bin/exe-start-codex.js +11 -11
- package/dist/bin/exe-start-opencode.js +8 -8
- package/dist/bin/exe-status.js +10 -10
- package/dist/bin/exe-support.js +3 -1
- package/dist/bin/exe-team.js +3 -3
- package/dist/bin/git-sweep.js +71 -11
- package/dist/bin/graph-backfill.js +4 -4
- package/dist/bin/graph-export.js +5 -5
- package/dist/bin/graph-layer-benchmark.js +7 -7
- package/dist/bin/import-history.js +7 -7
- package/dist/bin/install.js +12 -9
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +4 -4
- package/dist/bin/postgres-agentic-reflection-backfill.js +7 -7
- package/dist/bin/postgres-agentic-semantic-backfill.js +7 -7
- package/dist/bin/scan-tasks.js +9 -9
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +4 -4
- package/dist/bin/stack-update.js +20 -3
- package/dist/bin/vps-health-gate.js +1 -1
- package/dist/{capacity-monitor-QMKII67L.js → capacity-monitor-CTFWWTCR.js} +10 -10
- package/dist/{catchup-brief-CNISNLV7.js → catchup-brief-UML47LXI.js} +11 -11
- package/dist/{chunk-QP4FHME2.js → chunk-235ZCOYB.js} +18 -6
- package/dist/{chunk-2NEQQCRC.js → chunk-25JAXHON.js} +1 -1
- package/dist/{chunk-MU6ESLYL.js → chunk-2PFNATXD.js} +1 -1
- package/dist/chunk-2XZ6X3PJ.js +13 -0
- package/dist/chunk-3XX3CDKF.js +9 -0
- package/dist/{chunk-ZTB6E2ZL.js → chunk-4FGTT26Q.js} +1 -1
- package/dist/{chunk-YYSQAM4W.js → chunk-4TYAHVDI.js} +8 -8
- package/dist/{chunk-2QKNXGII.js → chunk-4VECWOUO.js} +2 -2
- package/dist/{chunk-YXMXP45V.js → chunk-57C3MZPQ.js} +2 -2
- package/dist/{chunk-FTNNNAMH.js → chunk-5JYCTIQD.js} +1 -1
- package/dist/{chunk-CS267UMH.js → chunk-5LDTCWYX.js} +79 -19
- package/dist/{chunk-FQVITYVF.js → chunk-6D2IZ5MB.js} +2 -2
- package/dist/{chunk-ZG3HADWE.js → chunk-7UJRF4WF.js} +1 -1
- package/dist/{chunk-JFVITKXI.js → chunk-A2UPDE3J.js} +1 -1
- package/dist/{chunk-KOCQAMAM.js → chunk-ANYOAZCZ.js} +238 -5
- package/dist/{chunk-PSQNT5DS.js → chunk-AQS2B3HC.js} +8 -8
- package/dist/{chunk-ABNALOLM.js → chunk-BGEXTWGR.js} +3 -3
- package/dist/{chunk-LPK5JPME.js → chunk-BPZL5YOM.js} +1 -1
- package/dist/{chunk-RLDOG7DI.js → chunk-C6SSCNOC.js} +2516 -2289
- package/dist/{chunk-JGEGEOVP.js → chunk-COKTAJUZ.js} +1 -1
- package/dist/{chunk-MRZE5IOP.js → chunk-CXOX7TRG.js} +1 -1
- package/dist/{chunk-6LFFIEDM.js → chunk-DU64OESH.js} +1 -1
- package/dist/{chunk-LYIUESG2.js → chunk-DYURFBPS.js} +10 -10
- package/dist/{chunk-X3SS45PO.js → chunk-FPXZY3FY.js} +1 -1
- package/dist/{chunk-TVTRMINO.js → chunk-FUGZF7VR.js} +1 -1
- package/dist/{chunk-O7SFCX5B.js → chunk-GB4FI66P.js} +2 -2
- package/dist/{chunk-VGWQBI76.js → chunk-GBR4MAAK.js} +1 -1
- package/dist/chunk-GH4LVBQM.js +371 -0
- package/dist/{chunk-AIXZ5O7U.js → chunk-GIHMDOSK.js} +1 -1
- package/dist/{chunk-RDCE652I.js → chunk-HDWVXSGO.js} +1 -1
- package/dist/{chunk-RF54NGPJ.js → chunk-IJ7R3MXE.js} +3 -5
- package/dist/{chunk-R7FBOZT5.js → chunk-ISL3NSVX.js} +1 -1
- package/dist/{chunk-5B2AEXVA.js → chunk-IVSRRIRG.js} +1 -1
- package/dist/{chunk-SD2R3SEA.js → chunk-J3YNCJ4A.js} +1 -1
- package/dist/{chunk-5IZYSS3M.js → chunk-JE4C74EE.js} +4 -4
- package/dist/{chunk-VRVHIVUE.js → chunk-KSR2PNRW.js} +2 -2
- package/dist/{chunk-LL2ARYTZ.js → chunk-L3PY4NFQ.js} +1 -1
- package/dist/{chunk-VFATLVRX.js → chunk-L5VPUOB6.js} +1 -1
- package/dist/{chunk-3VLFVOM7.js → chunk-LRKJGSNH.js} +2 -2
- package/dist/{chunk-4FT3SQAS.js → chunk-LVY74L2J.js} +2 -2
- package/dist/{chunk-X4T7LR2X.js → chunk-M7PZFYHE.js} +2 -2
- package/dist/{chunk-CIX64N7D.js → chunk-MGTVPIEZ.js} +1 -1
- package/dist/{chunk-MXCBORCC.js → chunk-MKTEGZ37.js} +3 -3
- package/dist/chunk-MMRUBN3I.js +36 -0
- package/dist/{chunk-4MONXPWR.js → chunk-MPXLF7TA.js} +1 -1
- package/dist/{chunk-6QMXKKFD.js → chunk-N27CTUFU.js} +1 -1
- package/dist/{chunk-YDHPC4PX.js → chunk-N4ES27RI.js} +3 -3
- package/dist/{chunk-WIRJ574R.js → chunk-NGQQRGLP.js} +2 -2
- package/dist/{chunk-AQOCHSIR.js → chunk-OCJ5GZKV.js} +4 -4
- package/dist/{chunk-O477L4LV.js → chunk-OSPS5N2I.js} +1 -1
- package/dist/{chunk-5WEH43HH.js → chunk-PQHA6X6Y.js} +1 -1
- package/dist/{chunk-DJYIBHN5.js → chunk-PQQTSNXS.js} +3 -3
- package/dist/{chunk-LGFB67MY.js → chunk-Q3GLQDZI.js} +1 -1
- package/dist/{chunk-7GR7VBBW.js → chunk-QUC27OCW.js} +1 -1
- package/dist/{chunk-5NBOFYJG.js → chunk-QYNFWFFH.js} +4 -4
- package/dist/{chunk-X7I6NLIA.js → chunk-T2EUNNUX.js} +5 -5
- package/dist/{chunk-VRWOLLKN.js → chunk-T4NFOOPB.js} +2 -2
- package/dist/{chunk-2YJSDJEH.js → chunk-TZPHTI5Q.js} +1 -1
- package/dist/{chunk-CQSFIQGN.js → chunk-UOZ5KUNN.js} +1 -1
- package/dist/{chunk-5R4R743Q.js → chunk-V2UVWYHO.js} +17 -15
- package/dist/{chunk-VKCZ3OGM.js → chunk-VD676VIC.js} +4 -4
- package/dist/{chunk-USLVSLQ5.js → chunk-VDCPKJUQ.js} +1 -1
- package/dist/{chunk-Y7NMPQXZ.js → chunk-VLX6AHTD.js} +8 -8
- package/dist/{chunk-ITPIBVSG.js → chunk-WMZTSHNX.js} +83 -1
- package/dist/{chunk-5U7WB4YG.js → chunk-WVBZ3QBR.js} +2 -2
- package/dist/{chunk-3EMZZZNU.js → chunk-X2RKYKTP.js} +1 -1
- package/dist/{chunk-XTIHYH64.js → chunk-YY2BCIAP.js} +2 -2
- package/dist/{chunk-Z6GHDYQI.js → chunk-Z2AEOVEZ.js} +30 -6
- package/dist/{chunk-PHTRZQR4.js → chunk-ZBDAFYDD.js} +4 -4
- package/dist/{chunk-E4CCKWZN.js → chunk-ZKFTDL4M.js} +1 -1
- package/dist/{co-activation-AIVMI5U2.js → co-activation-UNVL5JCP.js} +2 -2
- package/dist/{co-occurrence-L6QOQTJB.js → co-occurrence-ETAVWYVE.js} +2 -2
- package/dist/{code-context-index-DYHYVJHX.js → code-context-index-DCQYAYA2.js} +3 -2
- package/dist/{crdt-sync-YBMDPFNT.js → crdt-sync-AH7N6QOE.js} +1 -1
- package/dist/{crm-webhook-QO3ZESKR.js → crm-webhook-R6546T3Y.js} +2 -2
- package/dist/{cto-delegation-gate-UFPVFLIW.js → cto-delegation-gate-VB4TMZ3I.js} +8 -8
- package/dist/{daemon-orchestration-6XAISQ7B.js → daemon-orchestration-YAJKIL6Q.js} +12 -12
- package/dist/{db-backup-7UMCTS44.js → db-backup-2RG6VHT7.js} +11 -3
- package/dist/{dreaming-FJ75QVGZ.js → dreaming-WMBTSXGD.js} +9 -9
- package/dist/{exe-drift-OH3WV2ZQ.js → exe-drift-MQZGYHEN.js} +3 -3
- package/dist/{exe-export-UYKYNVBU.js → exe-export-E4BDIHOC.js} +5 -5
- package/dist/{exe-import-Q4FNSMLJ.js → exe-import-IWAD4HN6.js} +5 -5
- package/dist/{exe-key-22LOIIUX.js → exe-key-L2RV7XJX.js} +2 -2
- package/dist/{exe-snapshot-J7CL6QEL.js → exe-snapshot-IOGN4ARV.js} +12 -12
- package/dist/{fast-db-init-QXGL2PKQ.js → fast-db-init-GCY3F74H.js} +1 -1
- package/dist/gateway/index.js +8 -8
- package/dist/{git-staleness-YVWDCFIE.js → git-staleness-BQIFNZIU.js} +2 -2
- package/dist/{git-task-sweep-RRCOTTIS.js → git-task-sweep-GSKS6WKR.js} +9 -9
- package/dist/{global-procedures-FCGWAFES.js → global-procedures-3DJUA5OX.js} +3 -3
- package/dist/{graph-auto-extract-RUQC5IIS.js → graph-auto-extract-2I44WRDY.js} +2 -2
- package/dist/hooks/bug-report-worker.js +11 -11
- package/dist/hooks/codex-stop-task-finalizer.js +11 -11
- package/dist/hooks/commit-complete.js +11 -11
- package/dist/hooks/error-recall.js +6 -6
- package/dist/hooks/exe-heartbeat-hook.js +3 -3
- package/dist/hooks/ingest-worker.js +3 -2
- package/dist/hooks/ingest.js +6 -6
- package/dist/hooks/instructions-loaded.js +4 -4
- package/dist/hooks/manifest.json +20 -20
- package/dist/hooks/notification.js +4 -4
- package/dist/hooks/post-compact.js +10 -10
- package/dist/hooks/post-tool-combined.js +6 -6
- package/dist/hooks/pre-compact.js +14 -13
- package/dist/hooks/pre-tool-use.js +14 -14
- package/dist/hooks/prompt-submit.js +22 -22
- package/dist/hooks/session-end.js +19 -18
- package/dist/hooks/session-start.js +11 -11
- package/dist/hooks/stop.js +70 -17
- package/dist/hooks/subagent-stop.js +10 -10
- package/dist/hooks/summary-worker.js +17 -16
- package/dist/index.js +17 -17
- package/dist/{installer-7SMJC3SX.js → installer-6MQCAHUG.js} +5 -5
- package/dist/{installer-GFZVC43I.js → installer-TCMPFSSP.js} +5 -5
- package/dist/{installer-34DCTB5B.js → installer-ZY2BKTEO.js} +5 -5
- package/dist/lib/cloud-sync.js +4 -4
- package/dist/lib/consolidation.js +5 -5
- package/dist/lib/database.js +2 -2
- package/dist/lib/db-daemon-client.js +58 -13
- package/dist/lib/db.js +2 -2
- package/dist/lib/embedder.js +3 -2
- package/dist/lib/employee-templates.js +4 -4
- package/dist/lib/employees.js +2 -2
- package/dist/lib/exe-daemon-client.js +2 -1
- package/dist/lib/exe-daemon.js +255 -104
- package/dist/lib/hybrid-search.js +5 -5
- package/dist/lib/identity.js +2 -2
- package/dist/lib/messaging.js +9 -9
- package/dist/lib/reminders.js +3 -3
- package/dist/lib/schedules.js +5 -5
- package/dist/lib/session-registry.js +4 -4
- package/dist/lib/skill-learning.js +4 -4
- package/dist/lib/store.js +4 -4
- package/dist/lib/task-router.js +3 -3
- package/dist/lib/tasks.js +10 -10
- package/dist/lib/tmux-routing.js +8 -8
- package/dist/lib/token-spend.js +3 -3
- package/dist/mcp/register-tools.js +59 -56
- package/dist/mcp/server.js +60 -57
- package/dist/mcp/tools/complete-reminder.js +4 -4
- package/dist/mcp/tools/create-reminder.js +4 -4
- package/dist/mcp/tools/create-task.js +12 -12
- package/dist/mcp/tools/deactivate-behavior.js +5 -5
- package/dist/mcp/tools/list-reminders.js +4 -4
- package/dist/mcp/tools/list-tasks.js +12 -12
- package/dist/mcp/tools/send-message.js +11 -11
- package/dist/mcp/tools/update-task.js +11 -11
- package/dist/{mcp-http-config-MZMHKMJC.js → mcp-http-config-VUDZ3D5D.js} +3 -3
- package/dist/{memory-cards-3SFXU6IP.js → memory-cards-ZOOPC2WF.js} +2 -2
- package/dist/{memory-graph-extractor-T57YQQCW.js → memory-graph-extractor-RRQMUBMI.js} +3 -3
- package/dist/{memory-poisoning-defense-O53AHMTZ.js → memory-poisoning-defense-UQMNLG6H.js} +2 -2
- package/dist/{memory-queue-client-ITWQIFSD.js → memory-queue-client-TPQDAA4D.js} +3 -2
- package/dist/{memory-reflection-YPP2JC2S.js → memory-reflection-GSGXAGXV.js} +2 -2
- package/dist/{notifications-BETWD6EK.js → notifications-ZKGLZVCU.js} +8 -8
- package/dist/{orchestration-events-A5D52NXX.js → orchestration-events-7RMWC5SS.js} +3 -3
- package/dist/{orchestrator-X564XCWC.js → orchestrator-A6MX2OHA.js} +10 -10
- package/dist/{pipeline-router-RVHLL7UA.js → pipeline-router-6ZBYJD2U.js} +3 -3
- package/dist/{plan-limits-ANAVC6PM.js → plan-limits-4XH4A7IA.js} +3 -3
- package/dist/{project-boot-ENMCAL7G.js → project-boot-7ZEIDWUG.js} +3 -2
- package/dist/{projection-worker-O3HBG5QK.js → projection-worker-YKKBNQZT.js} +130 -51
- package/dist/{reranker-SRJL4IWB.js → reranker-DN2A3H6O.js} +1 -1
- package/dist/{review-polling-5JTTHHEO.js → review-polling-PK3CY4NI.js} +9 -9
- package/dist/runtime/index.js +11 -11
- package/dist/{session-events-RCSYHQQ2.js → session-events-IYU6FYHH.js} +9 -9
- package/dist/{session-kill-telemetry-AL3H4ELS.js → session-kill-telemetry-G2VV4CAH.js} +3 -3
- package/dist/{session-scope-ZB4SR3AX.js → session-scope-DHTVH3D4.js} +8 -8
- package/dist/{setup-wizard-HXTADFXI.js → setup-wizard-IA5ISHQ2.js} +1 -1
- package/dist/{skill-refinement-TT4VDYYW.js → skill-refinement-6PBAFLWP.js} +2 -2
- package/dist/{stack-release-7WDKQOCO.js → stack-release-NW7MV3WV.js} +41 -11
- package/dist/{stack-update-F4CQWMGV.js → stack-update-5SM62R3O.js} +3 -1
- package/dist/{steward-gate-HSV67KLF.js → steward-gate-EQV6CZKY.js} +3 -3
- package/dist/support-outbox-SZVLHHZG.js +295 -0
- package/dist/{task-enforcement-A6AZTYAN.js → task-enforcement-2LS5DOXK.js} +8 -8
- package/dist/{task-scope-XKNAY5S7.js → task-scope-AKF3CSWO.js} +8 -8
- package/dist/{tasks-crud-F732BVOE.js → tasks-crud-KOIA5SAH.js} +8 -8
- package/dist/{tasks-notify-LJ65U7DF.js → tasks-notify-7ZTE4ZQM.js} +9 -9
- package/dist/{tasks-review-Y5F4HRAR.js → tasks-review-VMMMAK2Y.js} +8 -8
- package/dist/{telemetry-upload-HVYO6FL3.js → telemetry-upload-YLW4NAUF.js} +15 -8
- package/dist/{token-budget-VODGJYKX.js → token-budget-NA4OLFNP.js} +2 -2
- package/dist/{tool-capability-index-PZWWVABO.js → tool-capability-index-C73KVY5O.js} +1 -1
- package/dist/{tool-telemetry-5BSTF3P6.js → tool-telemetry-OVI5KL4S.js} +1 -1
- package/dist/tui/App.js +16 -16
- package/dist/{tui-data-EHJWRNRZ.js → tui-data-5NT24CC5.js} +8 -8
- package/dist/{worker-gate-4AS4K7G4.js → worker-gate-AQLJUQ5G.js} +1 -1
- package/dist/{workflow-engine-BXGNFNUW.js → workflow-engine-TRGGUNIZ.js} +2 -2
- package/dist/{worktree-3N5BPITS.js → worktree-NK7GZNEA.js} +4 -4
- package/dist/worktree-sweep-5XVZCH6A.js +18 -0
- package/package.json +3 -2
- package/release-notes.json +32 -33
- package/stack.release.json +48 -48
- package/dist/prediction-log-DOEOHDHS.js +0 -120
- package/dist/support-outbox-KEJ73I3F.js +0 -206
- /package/dist/{chunk-AWVDA2FL.js → chunk-2H3FVAN3.js} +0 -0
- /package/dist/{chunk-VPHOOQLR.js → chunk-3GHTBVZO.js} +0 -0
- /package/dist/{chunk-CCPCIW4Z.js → chunk-BBPRL2MP.js} +0 -0
- /package/dist/{chunk-X2E6W3DB.js → chunk-BRSI3FD6.js} +0 -0
- /package/dist/{chunk-Y2FVN7CX.js → chunk-EYLQRPHF.js} +0 -0
- /package/dist/{chunk-4S5TEBXD.js → chunk-H6QJT5O5.js} +0 -0
- /package/dist/{chunk-FCII2MMI.js → chunk-J5CAYOJU.js} +0 -0
- /package/dist/{chunk-LY2DYTDL.js → chunk-RFJESVEL.js} +0 -0
- /package/dist/{chunk-GBHQ5TXO.js → chunk-UOOCGJUE.js} +0 -0
- /package/dist/{core-memory-WFP2L52F.js → core-memory-VZFTGOFE.js} +0 -0
- /package/dist/{entity-boost-RTYXAOWV.js → entity-boost-OAB2PZQP.js} +0 -0
- /package/dist/{message-queue-client-2CACBUA4.js → message-queue-client-YTKTHAYO.js} +0 -0
- /package/dist/{wiki-acl-MS7QLQCR.js → wiki-acl-UCPOROPR.js} +0 -0
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import "./chunk-MLKGABMK.js";
|
|
2
|
-
|
|
3
|
-
// src/lib/support-outbox.ts
|
|
4
|
-
import { readdirSync, readFileSync, writeFileSync, existsSync } from "fs";
|
|
5
|
-
import path from "path";
|
|
6
|
-
import os from "os";
|
|
7
|
-
var EXE_DIR = path.join(os.homedir(), ".exe-os");
|
|
8
|
-
var BUG_DIR = path.join(EXE_DIR, "bug-reports");
|
|
9
|
-
var FEATURE_DIR = path.join(EXE_DIR, "feature-requests");
|
|
10
|
-
var SENT_MARKER = "upstream_sent: true";
|
|
11
|
-
var SKIPPED_MARKER = "upstream_skipped: ttl_expired";
|
|
12
|
-
var TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
13
|
-
var BUG_ENDPOINT = "https://api.askexe.com/v1/support/bug-reports";
|
|
14
|
-
var FEATURE_ENDPOINT = "https://api.askexe.com/v1/support/feature-requests";
|
|
15
|
-
var DEFAULT_MAX_PER_FLUSH = 3;
|
|
16
|
-
var consecutiveFailures = 0;
|
|
17
|
-
var lastFailureTime = 0;
|
|
18
|
-
var MAX_BACKOFF_S = 300;
|
|
19
|
-
var sentIds = /* @__PURE__ */ new Set();
|
|
20
|
-
function loadLicenseKey() {
|
|
21
|
-
try {
|
|
22
|
-
const configPath = path.join(EXE_DIR, "config.json");
|
|
23
|
-
const config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
24
|
-
return config.cloud?.apiKey || config.license?.key;
|
|
25
|
-
} catch {
|
|
26
|
-
return void 0;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function extractField(content, field) {
|
|
30
|
-
const match = content.match(new RegExp(`^${field}:\\s*(.+)$`, "m"));
|
|
31
|
-
return match?.[1]?.trim();
|
|
32
|
-
}
|
|
33
|
-
function shouldBackoff() {
|
|
34
|
-
if (consecutiveFailures === 0) return false;
|
|
35
|
-
const backoffMs = Math.min(Math.pow(2, consecutiveFailures), MAX_BACKOFF_S) * 1e3;
|
|
36
|
-
return Date.now() - lastFailureTime < backoffMs;
|
|
37
|
-
}
|
|
38
|
-
function onNetworkSuccess() {
|
|
39
|
-
consecutiveFailures = 0;
|
|
40
|
-
}
|
|
41
|
-
function onNetworkFailure() {
|
|
42
|
-
consecutiveFailures++;
|
|
43
|
-
lastFailureTime = Date.now();
|
|
44
|
-
}
|
|
45
|
-
function isTtlExpired(content) {
|
|
46
|
-
const createdAt = extractField(content, "created_at");
|
|
47
|
-
if (!createdAt) return false;
|
|
48
|
-
try {
|
|
49
|
-
const created = new Date(createdAt).getTime();
|
|
50
|
-
if (isNaN(created)) return false;
|
|
51
|
-
return Date.now() - created > TTL_MS;
|
|
52
|
-
} catch {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
async function flushDir(dir, endpoint, kind, licenseKey, maxPerFlush) {
|
|
57
|
-
let sent = 0;
|
|
58
|
-
let errors = 0;
|
|
59
|
-
let skipped = 0;
|
|
60
|
-
if (!existsSync(dir)) return { sent, errors, skipped };
|
|
61
|
-
let files;
|
|
62
|
-
try {
|
|
63
|
-
files = readdirSync(dir).filter((f) => f.endsWith(".md"));
|
|
64
|
-
} catch {
|
|
65
|
-
return { sent, errors, skipped };
|
|
66
|
-
}
|
|
67
|
-
if (files.length === 0) return { sent, errors, skipped };
|
|
68
|
-
for (const file of files.slice(0, maxPerFlush + 10)) {
|
|
69
|
-
if (sent >= maxPerFlush) break;
|
|
70
|
-
if (shouldBackoff()) break;
|
|
71
|
-
const filePath = path.join(dir, file);
|
|
72
|
-
let content;
|
|
73
|
-
try {
|
|
74
|
-
content = readFileSync(filePath, "utf-8");
|
|
75
|
-
} catch {
|
|
76
|
-
skipped++;
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
if (content.includes(SENT_MARKER)) {
|
|
80
|
-
skipped++;
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
if (content.includes(SKIPPED_MARKER)) {
|
|
84
|
-
skipped++;
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
const id = extractField(content, "id") ?? file.replace(".md", "");
|
|
88
|
-
if (sentIds.has(id)) {
|
|
89
|
-
skipped++;
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
if (isTtlExpired(content)) {
|
|
93
|
-
try {
|
|
94
|
-
writeFileSync(filePath, content + `
|
|
95
|
-
${SKIPPED_MARKER}
|
|
96
|
-
`);
|
|
97
|
-
} catch {
|
|
98
|
-
}
|
|
99
|
-
skipped++;
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
let payload;
|
|
103
|
-
if (kind === "bug") {
|
|
104
|
-
const titleMatch = content.match(/^#\s*(.+)$/m);
|
|
105
|
-
const severityMatch = content.match(/^severity:\s*(.+)$/m);
|
|
106
|
-
payload = {
|
|
107
|
-
id,
|
|
108
|
-
title: titleMatch?.[1]?.trim() ?? file,
|
|
109
|
-
severity: severityMatch?.[1]?.trim() ?? "p1",
|
|
110
|
-
markdown: content,
|
|
111
|
-
source: "outbox-flusher",
|
|
112
|
-
package_version: process.env.npm_package_version ?? "unknown"
|
|
113
|
-
};
|
|
114
|
-
} else {
|
|
115
|
-
const titleMatch = content.match(/^#\s*Feature Request\s*[—–-]\s*(.+)$/m);
|
|
116
|
-
payload = {
|
|
117
|
-
id,
|
|
118
|
-
title: titleMatch?.[1]?.trim() ?? extractField(content, "title") ?? file,
|
|
119
|
-
category: extractField(content, "category") ?? "unclear",
|
|
120
|
-
priority: extractField(content, "priority") ?? "p2",
|
|
121
|
-
product: extractField(content, "product") ?? "exe-os",
|
|
122
|
-
description: content,
|
|
123
|
-
source: "outbox-flusher",
|
|
124
|
-
package_version: extractField(content, "package_version") ?? process.env.npm_package_version ?? "unknown"
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
try {
|
|
128
|
-
const resp = await fetch(endpoint, {
|
|
129
|
-
method: "POST",
|
|
130
|
-
headers: {
|
|
131
|
-
"content-type": "application/json",
|
|
132
|
-
...licenseKey ? { "x-exe-license-key": licenseKey } : {}
|
|
133
|
-
},
|
|
134
|
-
body: JSON.stringify(payload),
|
|
135
|
-
signal: AbortSignal.timeout(5e3)
|
|
136
|
-
});
|
|
137
|
-
if (resp.ok || resp.status === 409) {
|
|
138
|
-
writeFileSync(filePath, content + `
|
|
139
|
-
${SENT_MARKER}
|
|
140
|
-
`);
|
|
141
|
-
sentIds.add(id);
|
|
142
|
-
onNetworkSuccess();
|
|
143
|
-
sent++;
|
|
144
|
-
} else {
|
|
145
|
-
onNetworkFailure();
|
|
146
|
-
errors++;
|
|
147
|
-
}
|
|
148
|
-
} catch {
|
|
149
|
-
onNetworkFailure();
|
|
150
|
-
errors++;
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return { sent, errors, skipped };
|
|
155
|
-
}
|
|
156
|
-
async function flushSupportOutbox(opts) {
|
|
157
|
-
const maxPerFlush = opts?.maxPerFlush ?? DEFAULT_MAX_PER_FLUSH;
|
|
158
|
-
const licenseKey = loadLicenseKey();
|
|
159
|
-
const [bugs, features] = await Promise.all([
|
|
160
|
-
flushDir(BUG_DIR, BUG_ENDPOINT, "bug", licenseKey, maxPerFlush),
|
|
161
|
-
flushDir(FEATURE_DIR, FEATURE_ENDPOINT, "feature", licenseKey, maxPerFlush)
|
|
162
|
-
]);
|
|
163
|
-
return {
|
|
164
|
-
bugsSent: bugs.sent,
|
|
165
|
-
featuresSent: features.sent,
|
|
166
|
-
errors: bugs.errors + features.errors,
|
|
167
|
-
skipped: bugs.skipped + features.skipped
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
async function getOutboxStatus() {
|
|
171
|
-
return {
|
|
172
|
-
bugReports: scanDir(BUG_DIR),
|
|
173
|
-
featureRequests: scanDir(FEATURE_DIR)
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function scanDir(dir) {
|
|
177
|
-
if (!existsSync(dir)) return { total: 0, unsent: 0 };
|
|
178
|
-
let files;
|
|
179
|
-
try {
|
|
180
|
-
files = readdirSync(dir).filter((f) => f.endsWith(".md"));
|
|
181
|
-
} catch {
|
|
182
|
-
return { total: 0, unsent: 0 };
|
|
183
|
-
}
|
|
184
|
-
let unsent = 0;
|
|
185
|
-
let oldest;
|
|
186
|
-
for (const file of files) {
|
|
187
|
-
try {
|
|
188
|
-
const content = readFileSync(path.join(dir, file), "utf-8");
|
|
189
|
-
if (!content.includes(SENT_MARKER) && !content.includes(SKIPPED_MARKER)) {
|
|
190
|
-
unsent++;
|
|
191
|
-
const createdAt = extractField(content, "created_at");
|
|
192
|
-
if (createdAt && (!oldest || createdAt < oldest)) {
|
|
193
|
-
oldest = createdAt;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
} catch {
|
|
197
|
-
unsent++;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return { total: files.length, unsent, oldest };
|
|
201
|
-
}
|
|
202
|
-
export {
|
|
203
|
-
flushSupportOutbox as flushBugReportOutbox,
|
|
204
|
-
flushSupportOutbox,
|
|
205
|
-
getOutboxStatus
|
|
206
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|