feat: seed default user sources (#128)

This commit is contained in:
2026-06-14 14:26:10 +01:00
committed by GitHub
parent 112d482d55
commit 789b6a285b
10 changed files with 220 additions and 8 deletions

View File

@@ -5,8 +5,6 @@ import { type } from "arktype"
import { Location, type LocationSourceOptions } from "./types.ts"
export const LocationKey: ContextKey<Location> = contextKey("freya.location", "location")
/**
* A FeedSource that provides location context.
*
@@ -16,7 +14,9 @@ export const LocationKey: ContextKey<Location> = contextKey("freya.location", "l
* Does not produce feed items - always returns empty array from `fetchItems`.
*/
export class LocationSource implements FeedSource {
readonly id = "freya.location"
static readonly id = "freya.location"
readonly id = LocationSource.id
private readonly historySize: number
private locations: Location[] = []
@@ -97,3 +97,5 @@ export class LocationSource implements FeedSource {
return []
}
}
export const LocationKey: ContextKey<Location> = contextKey(LocationSource.id, "location")