{"_id":"@appilot-labs/appilot-scheduler","_rev":"5-63f06a7be3af6790ce264697639ccd88","name":"@appilot-labs/appilot-scheduler","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@appilot-labs/appilot-scheduler","version":"1.0.0","_id":"@appilot-labs/appilot-scheduler@1.0.0","maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"bin":{"appilot-scheduler":"dist/cli.js"},"dist":{"shasum":"704e683854e033e97653bd6d9c12de9a1e093685","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-scheduler/-/appilot-scheduler-1.0.0.tgz","fileCount":19,"integrity":"sha512-ykkpEev4K4HRdjagb1nQmHAXDFLXHFu9SuAMzIXoDc/yo02+vQreUI1l7AcAH3JJAOhPdn91ckhCdNSYaEpwsg==","signatures":[{"sig":"MEUCIG5HRg+yt/f69KiqvZF+3KudFUYVlGYArAuuy+nz5PSrAiEA6Eb6U6OJMkXehs5KxRVQcdEVu0JszKGiR2fY/AxaIX0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54766},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./*":"./dist/*.js"},"gitHead":"d973350c62861ca25bb29788815a3d84a0a629c2","scripts":{"test":"tsx tests/*.test.ts","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json","prepublishOnly":"npm run build"},"_npmUser":{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"},"_npmVersion":"10.9.8","description":"Appilot 调度守护进程——独立常驻的唯一调度者（无 UI）。端侧（Electron/DSH）启动时确保它运行并与之通讯；守护进程从共享 DB 拉取到期任务实例执行。","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@appilot-labs/appilot-headless":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-scheduler_1.0.0_1788523037393_0.3641985468255462","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@appilot-labs/appilot-scheduler","version":"1.0.1","_id":"@appilot-labs/appilot-scheduler@1.0.1","maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"homepage":"https://github.com/wxy/appilot#readme","bugs":{"url":"https://github.com/wxy/appilot/issues"},"bin":{"appilot-scheduler":"dist/cli.js"},"dist":{"shasum":"63a1cbe868d6e1a54c8e349d6d49a62e6864910b","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-scheduler/-/appilot-scheduler-1.0.1.tgz","fileCount":19,"integrity":"sha512-84KGSYf1hB3xq9AD6cAj8yOi/ECj4NZL5l/DWoNoyAnQPSY643RHRbYJJLD8Q0UMzruuqii7sUsIV8sXggfvQA==","signatures":[{"sig":"MEYCIQCxhHFntURSTZra3X922zOyb7wQryddlwru3qX+21okbgIhAOUWWQxlZVVsXgO8l0DT2pfoQpvZD1KoA9yeImDi9a2k","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-scheduler@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54860},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./*":"./dist/*.js"},"gitHead":"5c252be4290d90c830b0c155364397374b8d9a49","scripts":{"test":"tsx tests/*.test.ts","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f8962215-c8e1-40c9-8595-7f7f63a77157"}},"repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot 调度守护进程——独立常驻的唯一调度者（无 UI）。端侧（Electron/DSH）启动时确保它运行并与之通讯；守护进程从共享 DB 拉取到期任务实例执行。","directories":{},"_nodeVersion":"24.20.0","dependencies":{"@appilot-labs/appilot-headless":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-scheduler_1.0.1_1788528561575_0.2977509518611947","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@appilot-labs/appilot-scheduler","version":"1.1.0","_id":"@appilot-labs/appilot-scheduler@1.1.0","maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"homepage":"https://github.com/wxy/appilot#readme","bugs":{"url":"https://github.com/wxy/appilot/issues"},"bin":{"appilot-scheduler":"dist/cli.js"},"dist":{"shasum":"1d2570784ad055c7c94f19e1689993328a17f7f6","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-scheduler/-/appilot-scheduler-1.1.0.tgz","fileCount":21,"integrity":"sha512-pwW7B5YoBO0v6RHKNyWKhpYP7f9+QPIRCGPaXJ5R+3naa3bjgDaQXl5hO2ASHBXhEYXDVyJ2qhNgV19C8FlNyQ==","signatures":[{"sig":"MEYCIQC8glXdFvbVlbDAqSdYh4B4hCEdFMKAt3feZqGU/kCYlAIhAPOi6JF9wy9QHwE2h9kApsJ3X4PYxYVBwDW5WI1D69zt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCuJWXnxhaxF6zIyINNDMr9QvwY+xtxPK8wvezFDRQbIwIgBZmeUGLChc8yWZ0sxsQYY2bTbJAkg5Qn1sqyS/BaXtY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-scheduler@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70512},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./*":"./dist/*.js"},"gitHead":"64558c1cc40ae87223257e92cafd77c298c2ec34","scripts":{"test":"for f in tests/*.test.ts; do echo \"== $f\"; tsx \"$f\" || exit 1; done","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f8962215-c8e1-40c9-8595-7f7f63a77157"}},"repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot 调度守护进程——独立常驻的唯一调度者（无 UI）。端侧（Electron/DSH）启动时确保它运行并与之通讯；守护进程从共享 DB 拉取到期任务实例执行。","directories":{},"_nodeVersion":"24.20.0","dependencies":{"@appilot-labs/appilot-headless":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-scheduler_1.1.0_1789095266607_0.011115722788358706","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@appilot-labs/appilot-scheduler","version":"1.2.0","_id":"@appilot-labs/appilot-scheduler@1.2.0","maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"homepage":"https://github.com/wxy/appilot#readme","bugs":{"url":"https://github.com/wxy/appilot/issues"},"bin":{"appilot-scheduler":"dist/cli.js"},"dist":{"shasum":"61134e1f5b13d96e0bec82ac22cf7775b4e3a868","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-scheduler/-/appilot-scheduler-1.2.0.tgz","fileCount":25,"integrity":"sha512-4JpqvCmly3xmJ/rLXiBbhdOJH936tOHQ2Oqjha2vWZd0z/g7D+VDRC58GLnhW8PLerI3rJ/uNOrbDOsOVA7i1w==","signatures":[{"sig":"MEUCIQCR7SQkVfJKT6HHb3jU2yhnPguryRih5xqwji3Xmn/zUAIgJr/rmOEYhsacSg8Lv751JK8CiFKA4qjv5QIb8+buPLA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQD24TsYeWIkX4B/fdFRkPqp1LhbqTAaq/4tSpxDjCp3bwIhANB6D0NyVJbJ8bzlTtTbkhzQyPKHK3nkSGMVwkxlvNZe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-scheduler@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":75511},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./*":"./dist/*.js"},"gitHead":"3ea1abe5c6936110f705374bfab423fbd7c63d78","scripts":{"test":"for f in tests/*.test.ts; do echo \"== $f\"; tsx \"$f\" || exit 1; done","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f8962215-c8e1-40c9-8595-7f7f63a77157"}},"repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot 调度守护进程——独立常驻的唯一调度者（无 UI）。端侧（Electron/DSH）启动时确保它运行并与之通讯；守护进程从共享 DB 拉取到期任务实例执行。","directories":{},"_nodeVersion":"24.20.0","dependencies":{"@appilot-labs/appilot-headless":"^1.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-scheduler_1.2.0_1789293968203_0.4798583872229889","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"_id":"@appilot-labs/appilot-scheduler@1.3.0","bin":{"appilot-scheduler":"dist/cli.js"},"bugs":{"url":"https://github.com/wxy/appilot/issues"},"dist":{"shasum":"7f3258418c43bbc837262bd241507673dc2fb98d","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-scheduler/-/appilot-scheduler-1.3.0.tgz","fileCount":25,"integrity":"sha512-WgWyHO0H16pnA6d1JVg5+7Jg1lUN6CoVTYpWU6ncPFko/ZFAu0X3dYiLT0tM1b6tzjvkP5y/MB+9RWK2gbEcYA==","signatures":[{"sig":"MEYCIQCikbBCkKGVhMyL9ZjJiEGHqoGKKdUqam7sjZzmao7lEQIhAMjIFjSwViYhmiapopIpPSEGKhylO4jPh6YxJ4kMZgK5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDnOqLubRePB5iUvQJdu+IRLjYcCC/j/QDTF1RoX36xaQIhAImZNawJMeY/hai4y/WqGxFVsn1DhMLFp4C8nk++vYOO"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-scheduler@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":83397},"main":"./dist/index.js","name":"@appilot-labs/appilot-scheduler","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./*":"./dist/*.js"},"gitHead":"882db82752073f5736d32ae6b116e3c97d3ac87e","license":"GPL-3.0-or-later","scripts":{"test":"for f in tests/*.test.ts; do echo \"== $f\"; tsx \"$f\" || exit 1; done","build":"tsc -p tsconfig.json","typecheck":"tsc --noEmit -p tsconfig.json","prepublishOnly":"npm run build"},"version":"1.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f8962215-c8e1-40c9-8595-7f7f63a77157"}},"homepage":"https://github.com/wxy/appilot#readme","repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot 调度守护进程——独立常驻的唯一调度者（无 UI）。端侧（Electron/DSH）启动时确保它运行并与之通讯；守护进程从共享 DB 拉取到期任务实例执行。","directories":{},"maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"@appilot-labs/appilot-headless":"^1.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/appilot-scheduler_1.3.0_1790422489106_0.4984457480496449"}}},"time":{"created":"2026-09-04T11:57:17.261Z","modified":"2026-09-26T11:34:49.511Z","1.0.0":"2026-09-04T11:57:17.531Z","1.0.1":"2026-09-04T13:29:21.712Z","1.1.0":"2026-09-11T02:54:26.747Z","1.2.0":"2026-09-13T10:06:08.286Z","1.3.0":"2026-09-26T11:34:49.190Z"},"bugs":{"url":"https://github.com/wxy/appilot/issues"},"homepage":"https://github.com/wxy/appilot#readme","repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"description":"Appilot 调度守护进程——独立常驻的唯一调度者（无 UI）。端侧（Electron/DSH）启动时确保它运行并与之通讯；守护进程从共享 DB 拉取到期任务实例执行。","maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"readme":"<!-- 中文版说明（仓库内提供）。English: [README.md](./README.md) -->\n# @appilot-labs/appilot-scheduler\n\nApp Store 任务调度守护进程：即使没有任何壳 UI 打开，也从共享 DB 持续运行\n定时任务实例（github-sync / rank…），并与其他壳仲裁出唯一调度主。\n\n## 亮点\n\n- **Headless 常驻** — 无 UI 也能采集；支持 launchd `install` 保活\n- **租约单主** — 仅租约主执行 tick；壳与 daemon 之间单例仲裁\n- **Socket 控制面** — Unix socket JSON-RPC：status / runNow / accelerate /\n  shutdown / checkUpdate（壳用 `ensureScheduler`，CLI 见下）\n- **代码自更新** — 监控自身与 `headless`/`core` 的 dist；文件变化自动重启加载\n  （部署后 ≤60s 生效）\n- **韧性** — 403/429 限流指数退避与执行并发上限\n\n## 安装与运行\n\n```bash\nnpm i @appilot-labs/appilot-scheduler\n# 启动守护进程（默认共享 DB）\nnpx appilot-scheduler\n```\n\n## CLI\n\n```bash\nappilot-scheduler            # 运行 daemon\nappilot-scheduler status     # 当前调度主是谁\nappilot-scheduler stop       # 经 socket 优雅停止\nappilot-scheduler accel on|off [seconds]   # 临时加速清积压\nappilot-scheduler checkUpdate   # 手动触发代码自检\nappilot-scheduler install|uninstall   # launchd 保活（macOS）\n```\n\n守护进程收到 `SIGHUP` 后，会先关闭控制 socket、释放调度租约，再启动继任进程：\n\n```bash\nkill -HUP <daemon-pid>\n```\n\n## 壳内嵌入\n\n```ts\nimport { ensureScheduler, defaultSocketPath } from '@appilot-labs/appilot-scheduler';\nawait ensureScheduler({ socketPath: defaultSocketPath(), timeoutMs: 3000 });\n```\n\n## 环境变量\n\n| 变量 | 含义 |\n| --- | --- |\n| `APPILOT_DB_FILE` | 共享库路径 |\n| `APPILOT_SCHEDULER_INCLUDE_RANK` | `0` 关闭 rank 执行器 |\n| `APPILOT_SCHEDULER_UPDATE_CHECK_MS` | 代码自检周期（默认 60s） |\n| `APPILOT_SCHEDULER_MONITOR_DIRS` | 覆盖监控目录（测试用） |\n\n## 相关\n\n- `@appilot-labs/appilot-headless` — 本守护进程驱动的数据与任务引擎\n- 仓库文档：`docs/architecture-scheduler-daemon.md`\n","readmeFilename":"README.zh.md","license":"GPL-3.0-or-later"}