{"_id":"@civaapple/qi-scheduler","_rev":"2-19adbe349513c1a84f316ec4c601071f","name":"@civaapple/qi-scheduler","dist-tags":{"latest":"0.5.1"},"versions":{"0.5.0":{"name":"@civaapple/qi-scheduler","version":"0.5.0","license":"MIT","_id":"@civaapple/qi-scheduler@0.5.0","maintainers":[{"name":"civaapple","email":"civaapple@gmail.com"}],"homepage":"https://github.com/civaapple-alt/qi#readme","bugs":{"url":"https://github.com/civaapple-alt/qi/issues"},"dist":{"shasum":"6547bb19836b40131c7d8b9f9969c8fa6d98acd8","tarball":"https://registry.npmjs.org/@civaapple/qi-scheduler/-/qi-scheduler-0.5.0.tgz","fileCount":12,"integrity":"sha512-yVRX7mJ1qaJ9n1+aF4L5bq4c3dRtlHNSHwyBlwYlom0GtV//vCu7pAVlyOEe6OvJRkXgVdri+pzV1jzYlGaf2w==","signatures":[{"sig":"MEUCIGsV28GDRhkWhuf5DM4JHHQNbjWCimf9gyapR3mgPv0YAiEAkk5SiZ2uvLEIfMIMP1ZXt952IGamFKKeGxi6z3EwWs0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@civaapple%2fqi-scheduler@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":145138},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"9ae76a92cdcce130958d3f93c6ab5ba20149d424","_npmUser":{"name":"civaapple","email":"civaapple@gmail.com"},"repository":{"url":"git+https://github.com/civaapple-alt/qi.git","type":"git","directory":"packages/scheduler"},"_npmVersion":"11.16.0","description":"Durable bounded proactive watchers with attention policy and idempotent Session triggers","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@civaapple/qi-loop":"0.5.0","@civaapple/qi-kernel":"0.5.0","@civaapple/qi-protocol":"0.5.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/qi-scheduler_0.5.0_1785137697586_0.3055015803508667","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@civaapple/qi-scheduler","version":"0.5.1","description":"Durable bounded proactive watchers with attention policy and idempotent Session triggers","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"engines":{"node":">=22.19.0"},"dependencies":{"@civaapple/qi-kernel":"0.5.1","@civaapple/qi-loop":"0.5.1","@civaapple/qi-protocol":"0.5.1"},"repository":{"type":"git","url":"git+https://github.com/civaapple-alt/qi.git","directory":"packages/scheduler"},"homepage":"https://github.com/civaapple-alt/qi#readme","bugs":{"url":"https://github.com/civaapple-alt/qi/issues"},"license":"MIT","publishConfig":{"access":"public","provenance":true},"gitHead":"8b042be6fb43eda223b619286e9b3e5cb1e1c439","_id":"@civaapple/qi-scheduler@0.5.1","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-OwewDm92nESbT/pLZTYXgl4V5Rhoy2/8m93ZZP+DVwldZv+juGzAMQK7o2J3QstXTycjfdQnAzykwfKTQP8vhA==","shasum":"ad74ca4eeb0c21c1da1c211187bff00739fb5942","tarball":"https://registry.npmjs.org/@civaapple/qi-scheduler/-/qi-scheduler-0.5.1.tgz","fileCount":12,"unpackedSize":145138,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@civaapple%2fqi-scheduler@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2aH4rHC0gap5tAO9C+HcAZxkBbYUlyugaO99TmfHx3QIhALCZMRxSkW4gMHyVJ/Y/+I85mid/5uqzLYoWkxJVBLNK"}]},"_npmUser":{"name":"civaapple","email":"civaapple@gmail.com"},"directories":{},"maintainers":[{"name":"civaapple","email":"civaapple@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/qi-scheduler_0.5.1_1785149355504_0.8539852815292361"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-27T07:34:57.380Z","modified":"2026-07-27T10:49:16.160Z","0.5.0":"2026-07-27T07:34:57.736Z","0.5.1":"2026-07-27T10:49:15.638Z"},"bugs":{"url":"https://github.com/civaapple-alt/qi/issues"},"license":"MIT","homepage":"https://github.com/civaapple-alt/qi#readme","repository":{"type":"git","url":"git+https://github.com/civaapple-alt/qi.git","directory":"packages/scheduler"},"description":"Durable bounded proactive watchers with attention policy and idempotent Session triggers","maintainers":[{"name":"civaapple","email":"civaapple@gmail.com"}],"readme":"# `@civaapple/qi-scheduler`\n\nDurable, bounded proactive watchers with attention policy and idempotent Session triggers.\n\n## Purpose\n\nThe Scheduler supports time- and event-based continuation without granting unbounded background autonomy. A\nwatcher has explicit lifetime, state, delivery identity, attention checks, and external completion conditions.\n\n## Non-goals\n\n- A watcher is not an immortal daemon or a hidden Agent loop.\n- External events do not bypass Session trigger and capability boundaries.\n- Suppressed attention is not silently converted into successful delivery.\n\n## Core model\n\n`SqliteWatcherScheduler` persists watcher definitions and delivery records. `SessionEventTriggerSink` appends a\nstable Run trigger. External event IDs and stable Run IDs make delivery replayable after crashes.\n\n## Behavioral invariants\n\n- A stopped watcher cannot emit another Run.\n- Every watcher has a hard maximum lifetime.\n- External completion can close a watcher automatically.\n- Event delivery is idempotent by external event ID.\n- Attention policy is checked before proactive interruption.\n- Stopping an in-flight watcher aborts before trigger commit.\n\n## Failure semantics\n\nDurable watcher states are `active`, `stopped`, `completed`, and `expired`. Attention denial produces no delivery;\na duplicate occurrence produces no second Run; and a trigger failure leaves the reserved occurrence pending for\nrecovery with the same stable Run ID. These outcomes are observable without inventing extra watcher states.\n\n## Install and minimal use\n\n```sh\nnpm install @civaapple/qi-scheduler\n```\n\n```ts\nimport { SqliteWatcherScheduler } from \"@civaapple/qi-scheduler\";\n\nconst scheduler = new SqliteWatcherScheduler(\":memory:\", {\n  async trigger({ runId }) {\n    return runId;\n  },\n});\ntry {\n  console.log(scheduler.get(\"missing\")); // undefined\n} finally {\n  scheduler.close();\n}\n```\n\n## Public API\n\nWatcher types, `SqliteWatcherScheduler`, attention and external condition ports, `TriggerSink`, and\n`SessionEventTriggerSink`.\n\n## Change guide\n\nNew trigger modes must define lifetime, deduplication key, cancellation boundary, attention policy, external\ncompletion, and crash replay before implementation.\n\n## Verification\n\n`tests/watcher-scheduler.test.mjs` covers lifecycle, idempotency, attention, crash replay, and in-flight stop.\n\n## Further reading\n\n- [Watcher lifecycle](docs/watcher-lifecycle.md)\n- [Delivery semantics](docs/delivery-semantics.md)\n- [Extension and scheduling design](../../design/system-design.md#8-extensions-skills-mcp-codeact-graph-delegation-scheduling-and-introspection)\n","readmeFilename":"README.md"}