Commit Graph

121 Commits

Author SHA1 Message Date
bfdc5e67b7 chore: restore default comment on lookaheadHours
Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 15:43:00 +00:00
2cf6536e48 refactor: move source options into source file
Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 15:42:59 +00:00
c7a1048320 chore: remove obvious comments from types
Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 15:42:59 +00:00
512faf191e feat: add Google Calendar data source
Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 15:42:59 +00:00
e5d65816dc Merge pull request #24 from kennethnym/feat/apple-calendar-source
feat: add Apple Calendar source package
2026-02-14 15:42:04 +00:00
13c411c842 perf: cache fetched events within a refresh cycle
FeedEngine calls fetchContext then fetchItems with the same
context. Cache events by context.time reference to avoid
duplicate CalDAV round-trips.

Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 15:36:36 +00:00
e8ba49d7bb refactor: use switch/case in parser, move options
- Replace if/else chains with switch/case in ical-parser
- Move CalendarSourceOptions to calendar-source.ts

Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 15:29:49 +00:00
3010eb8990 refactor: replace Map with Record in tests
Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 15:20:23 +00:00
6c4982ae85 fix: use Promise.allSettled for calendar fetching
A transient error on one calendar (e.g. shared calendar
with permission issues) no longer discards results from
all other calendars.

Co-authored-by: Ona <no-reply@ona.com>
2026-02-14 00:44:47 +00:00
f557a0f967 feat: add Apple Calendar source package
Add @aris/source-apple-calendar for fetching iCloud
calendar events via CalDAV using tsdav and ical.js.

- CalendarSource implements FeedSource with fetchItems
  and fetchContext for downstream context
- CalendarCredentialProvider interface for token injection
- CalendarDAVClient interface for testability
- iCal parser extracts full event data including
  attendees, alarms, organizer, and recurrence
- Priority based on event proximity to current time

Co-authored-by: Ona <no-reply@ona.com>
2026-02-13 22:08:58 +00:00
1b2929c2b6 Merge pull request #22 from kennethnym/feat/weather-service
feat(backend): add WeatherService
2026-02-13 20:05:06 +00:00
e5f1273baf feat(backend): add WeatherService
Manage per-user WeatherSource instances via FeedSourceProvider,
following the same pattern as LocationService. Wire into
FeedEngineService so weather data is included in the feed.

Co-authored-by: Ona <no-reply@ona.com>
2026-02-13 20:02:58 +00:00
c3429e1a77 Merge pull request #23 from kennethnym/feat/tfl-service
feat(backend): add TflService
2026-02-13 20:01:03 +00:00
54e4b0dcf7 feat(backend): add TflService
Manages per-user TflSource instances with individual line
configuration. Implements FeedSourceProvider so it can be
wired into FeedEngineService.

Adds TflSource.setLines() so line config can be mutated
in place, keeping engine references valid.

Also exports ITflApi from @aris/source-tfl for testability.

Co-authored-by: Ona <no-reply@ona.com>
2026-02-13 19:38:21 +00:00
31a82c1d9f ci: run bun install in postCreateCommand
Co-authored-by: Ona <no-reply@ona.com>
2026-02-08 11:55:00 +00:00
d1102fe1ac Merge pull request #21 from kennethnym/feat/feed-engine-service
feat(backend): add FeedEngineService
2026-01-25 23:16:08 +00:00
db0c57f04b feat(backend): add FeedEngineService
Manages FeedEngine instances per user with auto-registration of
sources from FeedSourceProvider implementations.

- Add FeedSourceProvider interface
- Add FeedEngineService with providers array injection
- Update LocationService to implement FeedSourceProvider

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 23:12:48 +00:00
9e3fe2ea16 Merge pull request #20 from kennethnym/feat/location-router
feat(backend): add location router with tRPC factory pattern
2026-01-25 23:00:03 +00:00
949b7c8571 feat(backend): add location router with tRPC factory pattern
- Add createLocationRouter with location.update mutation
- Refactor tRPC to factory pattern (createTRPC, createTRPCRouter)
- Protected procedure by default (all routes require auth)
- Replace zod with arktype for input validation
- Wire location router in main() with dependency injection

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 22:58:32 +00:00
bd6cc3c963 Merge pull request #19 from kennethnym/feat/trpc
feat(backend): add tRPC with Hono adapter
2026-01-25 22:26:41 +00:00
aff9464245 feat(backend): add tRPC with Hono adapter
- Add @trpc/server, @hono/trpc-server, zod dependencies
- Create tRPC context with BetterAuth session
- Create router with publicProcedure and protectedProcedure
- Mount tRPC at /trpc/* via Hono adapter

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 22:19:05 +00:00
0db6cae82b Merge pull request #18 from kennethnym/feat/location-service
feat(backend): add LocationService
2026-01-25 19:41:26 +00:00
faad9e9736 feat(backend): add LocationService
- Add LocationService to manage LocationSource per user
- Add UserNotFoundError for generic user-related errors
- updateUserLocation throws if source not initialized

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 19:39:55 +00:00
da2c1b9ee7 Merge pull request #17 from kennethnym/feat/auth
feat(backend): add BetterAuth email/password authentication
2026-01-25 16:29:41 +00:00
c10c8a553a feat(backend): add BetterAuth email/password authentication
- Add PostgreSQL connection (src/db.ts)
- Configure BetterAuth with email/password (src/auth/index.ts)
- Add session middleware for route protection (src/auth/session-middleware.ts)
- Add registerAuthHandlers for mounting auth routes (src/auth/http.ts)
- Rename index.ts to server.ts
- Add .env.example with required environment variables

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 16:21:00 +00:00
fffcccc227 Merge pull request #16 from kennethnym/feat/aris-backend
feat(backend): init aris-backend with Hono
2026-01-25 14:55:17 +00:00
b744af9c51 feat(backend): init aris-backend with Hono
- Add apps/aris-backend package with Hono server
- Add /health endpoint
- Add backend-spec.md with design decisions

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 14:54:08 +00:00
13300fb6a6 Merge pull request #15 from kennethnym/feat/source-tfl
refactor: migrate aris-data-source-tfl to aris-source-tfl
2026-01-25 14:23:26 +00:00
66ee44b470 refactor: migrate aris-data-source-tfl to aris-source-tfl
Migrates TFL package from old DataSource interface to new FeedSource
interface for use with FeedEngine.

Changes:
- Rename package from @aris/data-source-tfl to @aris/source-tfl
- Replace TflDataSource class with TflSource implementing FeedSource
- Add dependency on @aris/source-location for LocationKey
- Use normalized priority values (0-1) instead of arbitrary numbers
- Update tests for FeedSource interface
- Update README.md with new package name

Co-authored-by: Ona <no-reply@ona.com>
2026-01-25 14:20:13 +00:00
1893c516f3 Merge pull request #14 from kennethnym/feat/feed-engine
feat(core): add FeedEngine for FeedSource orchestration
2026-01-24 23:07:41 +00:00
181160b018 feat(core): add FeedEngine for FeedSource orchestration
Introduces FeedEngine that consumes FeedSource instances and manages
the dependency graph for context flow and item collection.

- Validates dependency graph (missing deps, circular references)
- Topologically sorts sources for execution order
- Runs fetchContext() in dependency order, accumulating context
- Runs fetchItems() on all sources with final context
- Supports reactive updates via onContextUpdate/onItemsUpdate
- Graceful error handling (continues after source failures)

Marks DataSource, ContextProvider, ContextBridge, Reconciler, and
FeedController as deprecated in favor of FeedSource + FeedEngine.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-24 22:42:00 +00:00
559f82ce96 Merge pull request #13 from kennethnym/feat/source-weatherkit
feat: add @aris/source-weatherkit package
2026-01-19 00:56:32 +00:00
5e040470c7 feat: add @aris/source-weatherkit package
Implements FeedSource for WeatherKit API. Depends on location source,
provides weather context for downstream sources, and produces weather
feed items.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-19 00:50:13 +00:00
c2f2aeec1d Merge pull request #12 from kennethnym/feat/source-location
feat(source-location): add LocationSource for push-based location context
2026-01-19 00:38:28 +00:00
75ce06d39b feat(source-location): add LocationSource for push-based location context
Implements FeedSource interface. Accepts external location pushes,
provides context to downstream sources, does not produce feed items.

Supports configurable history size.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-19 00:37:35 +00:00
a7b6232058 Merge pull request #11 from kennethnym/fix/core-package-json-paths
fix(core): correct main and types paths in package.json
2026-01-19 00:29:50 +00:00
5df3dbd1b5 fix(core): correct main and types paths in package.json
Paths pointed to index.ts but actual file is at src/index.ts.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-19 00:08:04 +00:00
b7c7bcfc7c Merge pull request #9 from kennethnym/feat/feed-source-interface
feat(core): add FeedSource interface
2026-01-18 23:49:31 +00:00
9a47dda767 test(core): remove legacy integration tests
Tests were for DataSource/ContextProvider/ContextBridge which are now
deprecated in favor of FeedSource.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 23:46:38 +00:00
286a933d1e test(core): add FeedSource integration tests
Tests graph validation (dependency existence, cycle detection, topological
sort) and refresh behavior (context accumulation, item collection).

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 23:45:05 +00:00
1d9de2851a feat(core): add FeedSource interface
Unifies DataSource and ContextProvider into a single interface that
forms a dependency graph. Sources declare dependencies on other sources
and can provide context, feed items, or both.

Deprecates DataSource, ContextProvider, and ContextBridge.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 23:32:47 +00:00
80192c6dc1 Merge pull request #8 from kennethnym/docs/gpg-signing-instruction
docs: add GPG signing instruction to AGENTS.md
2026-01-18 20:41:06 +00:00
0eb77b73c6 docs: add GPG signing instruction to AGENTS.md
Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 20:39:26 +00:00
dfce846c9a Merge pull request #7 from kennethnym/feat/feed-controller-orchestration
feat(core): add FeedController orchestration layer
2026-01-18 20:30:27 +00:00
b73e603c90 feat(core): return RefreshResult from ContextBridge.refresh()
Surfaces provider errors through RefreshResult.errors instead of
silently ignoring them.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 20:28:54 +00:00
037589cf4f refactor(core): rename getCurrentValue to fetchCurrentValue
Also use Promise.allSettled in ContextBridge.refresh() to handle
provider errors gracefully.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 20:23:54 +00:00
3c16dd4275 feat(core): add FeedController orchestration layer
Adds orchestration for feed reconciliation with context-driven updates:

- FeedController: holds context, debounces updates, reconciles sources
- ContextBridge: bridges context providers to controller
- ContextProvider: reactive + on-demand context value interface
- Branded ContextKey<T> for type-safe context keys

Moves source files to src/ directory and consolidates tests into
integration test.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-18 00:58:29 +00:00
2eff7b49dc Merge pull request #6 from kennethnym/fix/oxfmt-ignore-patterns
fix: ignore .claude and fixtures in oxfmt
2026-01-17 16:11:31 +00:00
d9405a239a fix: ignore .claude and fixtures in oxfmt
Co-authored-by: Ona <no-reply@ona.com>
2026-01-17 16:03:12 +00:00
1ed335f783 Merge pull request #2 from kennethnym/feat/data-source-tfl
Add @aris/data-source-tfl package
2026-01-17 11:58:44 +00:00