slotlock 0.2.0 → 0.5.0

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +582 -0
  2. package/CONTRIBUTING.md +35 -8
  3. package/GOVERNANCE.md +4 -2
  4. package/MAINTAINERS.md +3 -2
  5. package/NOTICE +4 -4
  6. package/README.md +498 -65
  7. package/SECURITY.md +31 -2
  8. package/SPEC.md +142 -15
  9. package/agent-server.d.ts +62 -10
  10. package/agent-server.js +577 -105
  11. package/agent-store-backend.d.ts +12 -0
  12. package/agent-store-backend.js +1115 -55
  13. package/api-keys.d.ts +11 -3
  14. package/api-keys.js +29 -6
  15. package/application-api.d.ts +35 -1
  16. package/application-api.js +683 -12
  17. package/booking-rules.d.ts +84 -0
  18. package/booking-rules.js +149 -0
  19. package/config.d.ts +112 -0
  20. package/config.js +225 -0
  21. package/dashboard.d.ts +67 -5
  22. package/dashboard.js +1012 -140
  23. package/ddl.d.ts +45 -3
  24. package/ddl.js +1124 -13
  25. package/engine.d.ts +5 -0
  26. package/engine.js +23 -6
  27. package/event-feed.d.ts +178 -0
  28. package/event-feed.js +435 -0
  29. package/event-schema.d.ts +59 -0
  30. package/event-schema.js +85 -0
  31. package/ical-worker-thread.js +4 -2
  32. package/ical-worker.d.ts +8 -5
  33. package/ical-worker.js +9 -2
  34. package/index.d.ts +12 -6
  35. package/index.js +9 -4
  36. package/interop.d.ts +117 -0
  37. package/interop.js +356 -0
  38. package/maintenance.d.ts +27 -5
  39. package/maintenance.js +92 -28
  40. package/mcp-app.d.ts +7 -1
  41. package/mcp-app.js +259 -40
  42. package/metrics.d.ts +24 -0
  43. package/metrics.js +167 -0
  44. package/node-server.d.ts +9 -1
  45. package/node-server.js +7 -2
  46. package/openapi.json +10970 -0
  47. package/package.json +3 -2
  48. package/rate-limit.d.ts +80 -0
  49. package/rate-limit.js +741 -0
  50. package/rest-api.d.ts +22 -0
  51. package/rest-api.js +166 -11
  52. package/rules.js +6 -3
  53. package/self-host.d.ts +45 -8
  54. package/self-host.js +616 -46
  55. package/slotlock-manifest.schema.json +7 -1
  56. package/slotlock.manifest.json +8 -2
  57. package/store.d.ts +647 -28
  58. package/store.js +2982 -327
  59. package/sync.d.ts +43 -2
  60. package/sync.js +1515 -323
  61. package/timezone.d.ts +58 -3
  62. package/timezone.js +249 -20
  63. package/types.d.ts +300 -9
  64. package/types.js +0 -2
  65. package/webhooks.d.ts +91 -0
  66. package/webhooks.js +300 -0
package/CONTRIBUTING.md CHANGED
@@ -6,8 +6,8 @@ listed in [MAINTAINERS.md](./MAINTAINERS.md).
6
6
 
7
7
  ## Development
8
8
 
9
- You need Node.js 22.12 or newer and, for the database suites, PostgreSQL 16. From the repository
10
- root:
9
+ You need Node.js 22.12 or newer and, for the database suites, PostgreSQL 16 or newer (CI runs them
10
+ on 16, 17 and 18). From the repository root:
11
11
 
12
12
  ```sh
13
13
  npm ci
@@ -15,7 +15,7 @@ npm run typecheck # the package, then examples/ as a consumer compiles them
15
15
  npm test # tests, build, then the packed-artifact verification
16
16
  ```
17
17
 
18
- Database suites (`*.integration.test.ts`) run when `DATABASE_URL` points at a PostgreSQL 16
18
+ Database suites (`*.integration.test.ts`) run when `DATABASE_URL` points at a PostgreSQL 16 or newer
19
19
  database whose connecting role can create roles, databases and extensions, and are skipped
20
20
  otherwise (the upgrade suite builds a database of its own and drops it):
21
21
 
@@ -65,6 +65,11 @@ Edit the example, not the README copy: `readme-examples.test.ts` fails when they
65
65
  - Run typecheck, tests, build, and package verification.
66
66
  - Call out database, tenancy, privacy, sync, or supply-chain risk explicitly.
67
67
  - Do not add provider credentials, product-specific authorization, or network calls to the core.
68
+ - `NOTICE` is written by `node scripts/notice.mjs --write`. A dependency bump needs no edit to it,
69
+ unless it adds or removes a runtime dependency in `package.json` or a dependency changes its
70
+ licence: then CI fails with "NOTICE is not what scripts/notice.mjs writes". Read the new
71
+ licence, then run that command. A licence `scripts/notice.mjs` has not reviewed stops the build
72
+ until it is added to `LICENSE_NAMES` there.
68
73
 
69
74
  Changes to exclusion constraints, RLS, identity/idempotency, retention, iCalendar trust boundaries,
70
75
  protocol error contracts, or release automation require a security review; while the project has
@@ -78,10 +83,11 @@ that section becomes the release notes.
78
83
  To release, run **Actions > Release a version** with the version (for example `0.1.1`). It sets the
79
84
  version in `package.json`, `package-lock.json`, `server.json` and `slotlock.manifest.json` and dates
80
85
  the `## Unreleased` heading (`scripts/prepare-release.sh`), opens the pull request, merges it once CI
81
- and DCO pass on it, and `tag-release.yml` tags the release commit. The tag starts `release.yml` (the
82
- suite, then npm and the GitHub release) and `image.yml` (the image, then the MCP Registry). npm holds
83
- each staged version until a maintainer approves it with two-factor authentication (GOVERNANCE.md);
84
- the Release run's summary gives the command. A version merged to `main` by hand, with its heading
86
+ and DCO pass on it, and `tag-release.yml` tags the release commit. The tag starts `release.yml`: the
87
+ suite, then npm and the GitHub release, and, only once the suite has passed, `image.yml` (the image,
88
+ then the MCP Registry). The image and the registry entry each wait for a maintainer to approve their
89
+ environment (`ghcr`, `mcp-registry`), and npm holds each staged version until a maintainer approves
90
+ it with two-factor authentication (GOVERNANCE.md); the Release run's summary gives the command. A version merged to `main` by hand, with its heading
85
91
  dated, is released the same way. After a failed run, run it again with the same version: it keeps
86
92
  the release branch the failed run left when that already holds this release, so checks already run
87
93
  there still count, replaces it otherwise, and reuses its pull request (`scripts/open-release-pr.sh`).
@@ -94,7 +100,28 @@ which only `main` can use. Without the app, the workflow opens the pull request
94
100
  github-actions[bot], whose checks GitHub holds until someone with write access approves them on the
95
101
  pull request (**Approve workflows to run**). GitHub lets a workflow open pull requests at all only
96
102
  once an admin allows it (Settings > Actions > General > Workflow permissions);
97
- `scripts/configure-github.sh` sets it, and the run says so when it is off.
103
+ `scripts/configure-github.sh --allow-actions-pull-requests` sets it, and the run says so when it is
104
+ off. By default the script leaves it off, since the same switch lets GITHUB_TOKEN approve pull
105
+ requests.
106
+
107
+ Before the first release through the app, or after replacing it, run **Release a version** with
108
+ **dry_run**: it mints the app's token and prepares the release as a real run would, checks the token
109
+ can read the repository and push the release branch (`scripts/release-dry-run.sh`), and stops
110
+ without pushing, opening, merging or tagging anything. Its summary says which identity a real run
111
+ would use.
112
+
113
+ Nobody, the admin included, can merge into `main` past a failing or missing required check ("CI
114
+ passed" and "Signed-off-by"): a change whose checks cannot pass is fixed in another pull request
115
+ first. The npm, `ghcr` and `mcp-registry` environments wait for a maintainer's approval in every
116
+ Release run.
117
+
118
+ Approving a stage publishes the tarball the tag's run built, however long ago that was. Before
119
+ `npm stage approve`, run `scripts/check-stage.sh <stage-id>` from a checkout, logged in to npm and
120
+ gh. It refuses a stage whose tarball is not the one the release tested (the GitHub release's
121
+ `SHA256SUMS`), whose dist-tag would move `latest` backwards, or whose runtime dependencies, as a
122
+ consumer installs them that day, have a high or critical advisory (`npm audit --omit=dev`). Reject
123
+ such a stage and release a version that fixes it; accept a named advisory with
124
+ `--allow <GHSA id>` only when the release notes say why. It approves nothing itself.
98
125
 
99
126
  When a run needs a step npm or GitHub keeps for a person (the first npm version, the npm trusted
100
127
  publisher, the image's visibility, and the deploy key `tag-release.yml` pushes tags with), the
package/GOVERNANCE.md CHANGED
@@ -42,8 +42,10 @@ Releases follow semantic versioning and are built only by the repository release
42
42
  protected `v<version>` tag on `main`. The tag must match `package.json` and a `CHANGELOG.md`
43
43
  heading. The workflow stages the tested artifact to npm with trusted publishing (short-lived OIDC
44
44
  credentials and provenance); a maintainer then approves the staged version with two-factor
45
- authentication. Long-lived npm tokens are not accepted. Release artifacts must pass the
46
- package-content and consumer checks.
45
+ authentication. The same run publishes the server image and the MCP Registry entry only after its
46
+ suite has passed, and each waits for a maintainer to approve it. Long-lived npm tokens are not
47
+ accepted. Release artifacts must pass the package-content and consumer checks. Required checks
48
+ apply to maintainers too: nobody merges into `main` past a failing or missing one.
47
49
 
48
50
  ## Project changes
49
51
 
package/MAINTAINERS.md CHANGED
@@ -13,8 +13,9 @@ normally need two maintainer approvals are made until a second maintainer joins.
13
13
  [SECURITY.md](./SECURITY.md). Never a public issue.
14
14
  - **Code of conduct concerns:** [clever.eziogor@pylota.io](mailto:clever.eziogor@pylota.io), as described in
15
15
  [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md#reporting).
16
- - **Everything else:** an issue or discussion on
17
- [github.com/PILOTAAI/slotlock](https://github.com/PILOTAAI/slotlock).
16
+ - **Hosted Slotlock** (support, abuse, privacy): the addresses in
17
+ [.github/SUPPORT.md](.github/SUPPORT.md).
18
+ - **Everything else:** an issue on [github.com/PILOTAAI/slotlock](https://github.com/PILOTAAI/slotlock).
18
19
 
19
20
  ## Becoming a maintainer
20
21
 
package/NOTICE CHANGED
@@ -5,16 +5,16 @@ This product includes software developed by TREFT LTD and the Slotlock contribut
5
5
  under the Apache License 2.0.
6
6
 
7
7
  Runtime dependencies are not bundled into the Slotlock artifact; npm installs them alongside it and
8
- each retains its own license:
8
+ each retains its own license. This release was built with these versions:
9
9
 
10
10
  - ical.js 2.2.1, Mozilla Public License 2.0, https://github.com/kewisch/ical.js
11
11
  - rrule 2.8.1, BSD 3-Clause License, https://github.com/jakubroztocil/rrule
12
- - tslib (via rrule), BSD Zero Clause License (0BSD), https://github.com/microsoft/tslib
13
- - zod 4.6.5, MIT License, https://github.com/colinhacks/zod
12
+ - tslib (via rrule), BSD Zero Clause License (0BSD), https://github.com/Microsoft/tslib
13
+ - zod 4.6.7, MIT License, https://github.com/colinhacks/zod
14
14
 
15
15
  Peer dependency, installed and versioned by the application that embeds Slotlock:
16
16
 
17
- - Postgres.js (postgres) ^3.4.5, The Unlicense, https://github.com/porsager/postgres
17
+ - postgres ^3.4.5, The Unlicense, https://github.com/porsager/postgres
18
18
 
19
19
  If Slotlock distributes a modified MPL-covered ical.js file in the future, that file and its source
20
20
  must remain available under MPL-2.0. Slotlock currently imports the unmodified external dependency.