Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
490fd56
Initial policies
alidavut Feb 12, 2026
46fe811
Update docs
alidavut Feb 12, 2026
b81f133
Reshape project structure
alidavut Feb 12, 2026
9b3f438
Deduplicate shared helpers and clean up stale naming
alidavut Feb 12, 2026
b2582b3
Services to operations
alidavut Feb 12, 2026
3fadd31
Rename some imports
alidavut Feb 12, 2026
5bc2218
Initial services and bookings
alidavut Feb 12, 2026
3cfbb91
Update docs
alidavut Feb 12, 2026
a14b579
Fix some small issues
alidavut Feb 12, 2026
51a11c2
Add buffers to allocations
alidavut Feb 12, 2026
1923ca2
Refactor insert allocation
alidavut Feb 12, 2026
2fe3b1e
Update docs
alidavut Feb 12, 2026
f392d9d
Add service availability
alidavut Feb 12, 2026
499202c
Update docs
alidavut Feb 12, 2026
1c39b68
Fix some small issues
alidavut Feb 12, 2026
82bf9f5
Add policy to bookings
alidavut Feb 12, 2026
d911634
Update some variable name
alidavut Feb 12, 2026
03f8040
Fix some small bugs
alidavut Feb 12, 2026
c655a4f
Rename some variables
alidavut Feb 12, 2026
e2dfeea
Fix some naming conventions
alidavut Feb 13, 2026
bd1bdbd
Fix remaning naming issues
alidavut Feb 13, 2026
4d74df5
Update docs
alidavut Feb 13, 2026
9b0486a
Make timezone required
alidavut Feb 13, 2026
a358c01
Fix some small issues
alidavut Feb 13, 2026
1f40074
Fix typo in docs
alidavut Feb 13, 2026
d96d352
Optimize expiration worker
alidavut Feb 13, 2026
54ea64b
Fix some small issues
alidavut Feb 13, 2026
6919646
Fix some lint issues
alidavut Feb 13, 2026
56b3440
Fix some lint errors
alidavut Feb 13, 2026
30af799
Fix some edge cases
alidavut Feb 13, 2026
7248762
Remove scalar
alidavut Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

> **Dev Preview** - APIs may change. Not recommended for production use yet.

Headless booking infrastructure for AI agents.
Booking engine for AI agents.

- **Services & Policies** - Define bookable offerings with scheduling rules
- **Hold → Confirm** - Two-phase booking for async workflows
- **Race-safe** - Database-level conflict detection
- **Retry-friendly** - Idempotent operations with automatic deduplication
Expand All @@ -22,21 +23,29 @@ Floyd handles all of this so you can focus on your agent.
## Example

```bash
# 1. Create a hold (reserves the slot until confirmed or expired)
curl -X POST http://localhost:4000/v1/ledgers/$LEDGER_ID/allocations \
# 1. Create a service (groups resources with a policy)
curl -X POST http://localhost:4000/v1/ledgers/$LEDGER_ID/services \
-H "Content-Type: application/json" \
-d '{
"resourceId": "doctor-alice",
"startAt": "2024-01-15T10:00:00Z",
"endAt": "2024-01-15T11:00:00Z",
"expiresAt": "2024-01-15T09:55:00Z"
"name": "Haircut",
"resourceIds": ["rsc_stylist1"]
}'

# 2. Confirm when user says "yes"
curl -X POST http://localhost:4000/v1/ledgers/$LEDGER_ID/allocations/$ALLOC_ID/confirm
# 2. Create a hold (reserves the slot until confirmed or expired)
curl -X POST http://localhost:4000/v1/ledgers/$LEDGER_ID/bookings \
-H "Content-Type: application/json" \
-d '{
"serviceId": "svc_...",
"resourceId": "rsc_stylist1",
"startAt": "2026-01-15T10:00:00Z",
"endAt": "2026-01-15T11:00:00Z"
}'

# 3. Confirm when user says "yes"
curl -X POST http://localhost:4000/v1/ledgers/$LEDGER_ID/bookings/$BOOKING_ID/confirm

# 3. Or cancel if they change their mind
curl -X POST http://localhost:4000/v1/ledgers/$LEDGER_ID/allocations/$ALLOC_ID/cancel
# 4. Or cancel if they change their mind
curl -X POST http://localhost:4000/v1/ledgers/$LEDGER_ID/bookings/$BOOKING_ID/cancel

# Overlapping requests get 409 Conflict - double-booking is impossible
```
Expand Down
20 changes: 19 additions & 1 deletion apps/server/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
import app from "@floyd-run/eslint/app";

export default app;
export default [
...app,
{
files: ["src/domain/**/*.ts"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["database/*", "infra/*", "operations/*", "config/*", "routes/*", "workers/*"],
message: "domain/ must be pure — no imports from app infrastructure layers.",
},
],
},
],
},
},
];
Loading