{"_id":"@appilot-labs/appilot-headless","_rev":"5-c2c5b845d95d545014b63beb8322baef","name":"@appilot-labs/appilot-headless","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@appilot-labs/appilot-headless","version":"1.0.0","_id":"@appilot-labs/appilot-headless@1.0.0","maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"dist":{"shasum":"e80374b11c6a652850c41c53e9e0673f4752f134","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-headless/-/appilot-headless-1.0.0.tgz","fileCount":19,"integrity":"sha512-AkjJgERvpIIzs3s5cK17maLxbx8agpDsVuim6awwOKQXBcpHlJa31RiaLIr5YZDVpobaTnhU0jaYBA7PmHELDQ==","signatures":[{"sig":"MEUCIH9B8I1PAUjRL2fboqzbKYP1M75CIz3ojy5oLFt5QMwCAiEA3LGMacSK5GqYytXcMrBIcvNZ9vr9D9PxVI/Gw7u1uD0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85449},"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 headless core — SQLite store + scheduler lease, transport-agnostic; shared scheduled jobs. Embedded by Electron / DSH / CLI / MCP shells.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@appilot-labs/appilot-core":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-headless_1.0.0_1788523017873_0.7591988162416807","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@appilot-labs/appilot-headless","version":"1.0.1","_id":"@appilot-labs/appilot-headless@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"},"dist":{"shasum":"7ac6f972cf00886c542a00b3f814f1f384b8fabb","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-headless/-/appilot-headless-1.0.1.tgz","fileCount":19,"integrity":"sha512-RJvKyyXQrPHWr+z6gEserKJ1VLFUj4kZEgvuaRKtIseazvPTRt6lKoF2He6wFqt+cYAQbd0ki10MMIVicT7myQ==","signatures":[{"sig":"MEQCIAfd1yVepp4bdaOjmesuT6AeJ5PN8rFh8TacqexsscbnAiATBO1fgBYjrS5I+hlQ++9jN4EqIoMfRoCF5Qs0zYouyQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-headless@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":85543},"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:9db1ca65-a064-4e7b-92ba-2ae3a1e0ec01"}},"repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot headless core — SQLite store + scheduler lease, transport-agnostic; shared scheduled jobs. Embedded by Electron / DSH / CLI / MCP shells.","directories":{},"_nodeVersion":"24.20.0","dependencies":{"@appilot-labs/appilot-core":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-headless_1.0.1_1788528521731_0.8112235688376201","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@appilot-labs/appilot-headless","version":"1.1.0","_id":"@appilot-labs/appilot-headless@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"},"dist":{"shasum":"1882b7aa325f51dd42db235bd497aa44dea7a336","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-headless/-/appilot-headless-1.1.0.tgz","fileCount":27,"integrity":"sha512-33xRyXZml3NiQfSFcx2rk3W9ZWrCmWX+HNcNNqiwzeOry4IoiYhE+u7q3p2GmFcJbaaD7kMP3uK6/+IaJO3TiA==","signatures":[{"sig":"MEYCIQDR1Ni9OdpHLLhhTy/ds64HlbcjaJg6FTWzfeDzQS4NvgIhAJA8jIQgPlM5WCeNixQU/XemY9eiYyK3iwLqCBlRJxi9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-headless@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":173070},"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:9db1ca65-a064-4e7b-92ba-2ae3a1e0ec01"}},"repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot headless core — SQLite store + scheduler lease, transport-agnostic; shared scheduled jobs. Embedded by Electron / DSH / CLI / MCP shells.","directories":{},"_nodeVersion":"24.20.0","dependencies":{"@appilot-labs/appilot-core":"^1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-headless_1.1.0_1789095104496_0.5733847048164589","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@appilot-labs/appilot-headless","version":"1.2.0","_id":"@appilot-labs/appilot-headless@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"},"dist":{"shasum":"b940a8c0dd1e36732cd9400ebe9e444e16885dc8","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-headless/-/appilot-headless-1.2.0.tgz","fileCount":29,"integrity":"sha512-sECy0+uuW4grthV4jmaabmtQLkhzxmmvcf0h5X2f8BB7dg1WJ4XuoHnr/DHTQUUdhn0uqT1jVPPA4gjHw683/A==","signatures":[{"sig":"MEYCIQCMcdWLSpT5Bs98B5WlwcUQH8jr8nhZ6ZG7XfBryydU+gIhAPkdqAGPp/1RBjNNSSXSBJJQlttMr0GlFXj14lkjmRc2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-headless@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":182591},"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:9db1ca65-a064-4e7b-92ba-2ae3a1e0ec01"}},"repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot headless core — SQLite store + scheduler lease, transport-agnostic; shared scheduled jobs. Embedded by Electron / DSH / CLI / MCP shells.","directories":{},"_nodeVersion":"24.20.0","dependencies":{"@appilot-labs/appilot-core":"^1.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.1","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/appilot-headless_1.2.0_1789293876612_0.4018483638352781","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"_id":"@appilot-labs/appilot-headless@1.3.0","bugs":{"url":"https://github.com/wxy/appilot/issues"},"dist":{"shasum":"294f51fe7c44bc2a2adf167e95fb5175fd86386f","tarball":"https://registry.npmjs.org/@appilot-labs/appilot-headless/-/appilot-headless-1.3.0.tgz","fileCount":29,"integrity":"sha512-I+1pC2XiX+J7OZafOXMq0kdprTMLW4vTEyi4J2/1rwRUyJ/uKNs7U8AwjyPakbhrP0k9eEbBywwisIZbdji+uA==","signatures":[{"sig":"MEYCIQCN2t9w2LMsjMGiAc3Fvvih7775ScWj9BidqigKX4+ciAIhAOk9ykz843U0R1kBJW8QLKqiA4iNQZRh4BQH3ppxMNL/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDoeuxuSBfYZdKY4USeWE21eumCQYiAjHfbtei7g8bbSwIhAOKIlzZ88esp2HY1dEg4H059OdqulPrRlEBoO0TxU7Fb"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@appilot-labs%2fappilot-headless@1.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":194413},"main":"./dist/index.js","name":"@appilot-labs/appilot-headless","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:9db1ca65-a064-4e7b-92ba-2ae3a1e0ec01"}},"homepage":"https://github.com/wxy/appilot#readme","repository":{"url":"git+https://github.com/wxy/appilot.git","type":"git"},"_npmVersion":"11.19.0","description":"Appilot headless core — SQLite store + scheduler lease, transport-agnostic; shared scheduled jobs. Embedded by Electron / DSH / CLI / MCP shells.","directories":{},"maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"@appilot-labs/appilot-core":"^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-headless_1.3.0_1790422538256_0.640551163404913"}}},"time":{"created":"2026-09-04T11:56:57.686Z","modified":"2026-09-26T11:35:38.645Z","1.0.0":"2026-09-04T11:56:57.991Z","1.0.1":"2026-09-04T13:28:41.872Z","1.1.0":"2026-09-11T02:51:44.649Z","1.2.0":"2026-09-13T10:04:36.768Z","1.3.0":"2026-09-26T11:35:38.369Z"},"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 headless core — SQLite store + scheduler lease, transport-agnostic; shared scheduled jobs. Embedded by Electron / DSH / CLI / MCP shells.","maintainers":[{"name":"xingyu.wang","email":"xingyu.wang@gmail.com"}],"readme":"<!-- 中文版说明（仓库内提供）。English: [README.md](./README.md) -->\n# @appilot-labs/appilot-headless\n\n共享数据与调度核心：单一 SQLite（`appilot.db`，WAL）+ 实例任务引擎 +\n基于租约的单主调度。所有 Appilot 壳读写同一数据库、执行同一批任务实例。\n\n## 亮点\n\n- **单一共享库** — 默认路径 `~/Library/Application Support/Appilot/appilot.db`\n  （可用 `APPILOT_DB_FILE` 覆盖）；WAL + busy_timeout 保证多进程安全\n- **store 命名空间** — `projects`、`products`、`snapshots`、`tasks`、`lease`、\n  `meta`（repo 状态）、`releaseCache`\n- **稳定项目身份** — schema v14 以 `projects.id` 为主键；名称只是唯一展示名，\n  改名无需重写关联行\n- **租约单主** — `acquire / heartbeat / release`；心跳新鲜度决定接管；同 id 互斥\n  防双 daemon；TTL 窗口由调用方传入（各壳统一 60s）\n- **实例任务引擎** — DB 中 `kind + instance` 行（github-sync / rank…）由租约主通过\n  注册执行器运行；内置 403/429 限流退避与执行并发上限\n- **查询服务** — `createHeadlessService` 提供只读视图（任务、rank 进度…）\n- **旧版迁移** — `importLegacyRegistry` 一次性导入旧 JSON 注册表\n\n## 安装\n\n```bash\nnpm i @appilot-labs/appilot-headless\n```\n\n## 用法\n\n```ts\nimport { openStore, defaultDbPath } from '@appilot-labs/appilot-headless';\nconst store = openStore(process.env.APPILOT_DB_FILE || defaultDbPath());\n\nstore.lease.acquire('worker', 60_000);           // 成为主\nstore.lease.heartbeat('worker');                 // 主持续续租\nstore.projects.save({ id: 'demo-id', name: 'demo', path: '/x', githubUrl: null, platform: 'ios',\n  languages: ['en'], lastResolvedAt: new Date().toISOString(), artworkUrl: null,\n  updatedAt: new Date().toISOString() });\nstore.tasks.upsert({ id: 'github-sync:demo-id', title: 'GitHub 发布同步', intervalMinutes: 60,\n  lastRunAt: null, nextRunAt: new Date().toISOString(), lastStatus: 'never',\n  lastSummary: null, runCount: 0, source: 'worker', kind: 'github-sync',\n  instance: { projectId: 'demo-id', projectName: 'demo', path: '/x' } });\nstore.snapshots.add([{ projectId: 'demo-id', projectName: 'demo', productId: 'x:ios', keyword: 'kw',\n  language: 'en', storefront: 'us', rank: 1, totalResults: 9,\n  checkedAt: new Date().toISOString() }]);\nstore.lease.release('worker');\nstore.close();\n```\n\nCLI：`@appilot-labs/appilot-headless-cli`。\n\n## 相关\n\n- `@appilot-labs/appilot-scheduler` — 驱动本引擎的常驻守护进程\n- 仓库文档：`docs/headless-architecture.md`、`docs/architecture-scheduler-daemon.md`\n","readmeFilename":"README.zh.md","license":"GPL-3.0-or-later"}