CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
index.ts
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| fc1817a | 1 | import { mkdir } from "fs/promises"; |
| 2 | import app from "./app"; | |
| 3 | import { config } from "./lib/config"; | |
| eafe8c6 | 4 | import { startWorker } from "./lib/workflow-runner"; |
| 2b821b7 | 5 | import { startAutopilot } from "./lib/autopilot"; |
| 988380a | 6 | import { ensureDemoContent } from "./lib/demo-seed"; |
| 2d985e5 | 7 | import { ensureEnvSiteAdmin } from "./lib/admin-bootstrap"; |
| fc1817a | 8 | |
| 9 | // Ensure repos directory exists | |
| 10 | await mkdir(config.gitReposPath, { recursive: true }); | |
| 11 | ||
| eafe8c6 | 12 | // Start the Actions-equivalent workflow worker (Block C1). Polls |
| 13 | // workflow_runs for queued rows and executes them sequentially. | |
| 14 | startWorker(); | |
| 15 | ||
| 2b821b7 | 16 | // Autopilot: periodic mirror sync, merge-queue progress, weekly digests, |
| 17 | // advisory rescans. No-op when AUTOPILOT_DISABLED=1. | |
| 18 | startAutopilot(); | |
| 19 | ||
| 2d985e5 | 20 | // Site-admin bootstrap from env (SITE_ADMIN_USERNAME). Idempotent — if the |
| 21 | // user exists, they get a row in site_admins; if not, logged and retried | |
| 22 | // on next boot. Background-fired so a slow DB doesn't block startup. | |
| 23 | void ensureEnvSiteAdmin().catch(() => {}); | |
| 24 | ||
| 988380a | 25 | // Opt-in demo content seed on boot (DEMO_SEED_ON_BOOT=1). Idempotent, never |
| 26 | // throws — safe to run on every start. | |
| 27 | if (process.env.DEMO_SEED_ON_BOOT === "1") { | |
| 28 | void ensureDemoContent().catch(() => {}); | |
| 29 | } | |
| 30 | ||
| fc1817a | 31 | console.log(` |
| 32 | gluecron v0.1.0 | |
| 33 | ────────────────────── | |
| 34 | http://localhost:${config.port} | |
| 35 | repos: ${config.gitReposPath} | |
| 36 | `); | |
| 37 | ||
| 38 | export default { | |
| 39 | port: config.port, | |
| 40 | fetch: app.fetch, | |
| 41 | }; |