fix: add .ona and drizzle to oxfmt ignore

oxfmt was reformatting generated drizzle migration snapshots and
crashing on .ona/review/comments.json. Also runs the formatter
across the full codebase.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-04-12 17:26:55 +00:00
parent 62c8dfe0b1
commit 33edc5c9f1
40 changed files with 1776 additions and 377 deletions

View File

@@ -7,11 +7,11 @@
"scripts": {
"test": "bun test ."
},
"peerDependencies": {
"@nym.sh/jrx": "*",
"@json-render/core": "*"
},
"dependencies": {
"@standard-schema/spec": "^1.1.0"
},
"peerDependencies": {
"@json-render/core": "*",
"@nym.sh/jrx": "*"
}
}

View File

@@ -1,17 +1,14 @@
import type { Context, FeedEnhancement, FeedItem, FeedPostProcessor } from "@aelis/core"
import { TimeRelevance } from "@aelis/core"
import type { CalDavEventData } from "@aelis/source-caldav"
import type { CalendarEventData } from "@aelis/source-google-calendar"
import type { CurrentWeatherData } from "@aelis/source-weatherkit"
import { TimeRelevance } from "@aelis/core"
import { CalDavFeedItemType } from "@aelis/source-caldav"
import { CalendarFeedItemType } from "@aelis/source-google-calendar"
import { TflFeedItemType } from "@aelis/source-tfl"
import { WeatherFeedItemType } from "@aelis/source-weatherkit"
export const TimePeriod = {
Morning: "morning",
Afternoon: "afternoon",
@@ -28,7 +25,6 @@ export const DayType = {
export type DayType = (typeof DayType)[keyof typeof DayType]
const PRE_MEETING_WINDOW_MS = 30 * 60 * 1000
const TRANSITION_WINDOW_MS = 30 * 60 * 1000
@@ -144,7 +140,6 @@ export function createTimeOfDayEnhancer(options?: TimeOfDayEnhancerOptions): Fee
return timeOfDayEnhancer
}
export function getTimePeriod(date: Date): TimePeriod {
const hour = date.getHours()
if (hour >= 22 || hour < 6) return TimePeriod.Night
@@ -182,7 +177,9 @@ function getNextPeriodBoundary(date: Date): { period: TimePeriod; msUntil: numbe
* Google Calendar uses `startTime`, CalDAV uses `startDate`.
*/
function getEventStartTime(data: CalendarEventData | CalDavEventData): Date {
return "startTime" in data ? (data as CalendarEventData).startTime : (data as CalDavEventData).startDate
return "startTime" in data
? (data as CalendarEventData).startTime
: (data as CalDavEventData).startDate
}
/**
@@ -196,7 +193,6 @@ function hasPrecipitationOrExtreme(item: FeedItem): boolean {
return false
}
interface PreMeetingInfo {
/** IDs of calendar items starting within the pre-meeting window */
upcomingMeetingIds: Set<string>
@@ -225,7 +221,6 @@ function detectPreMeetingItems(items: FeedItem[], now: Date): PreMeetingInfo {
return { upcomingMeetingIds, hasLocationMeeting }
}
function findFirstEventOfDay(items: FeedItem[], now: Date): string | null {
let earliest: { id: string; time: number } | null = null
@@ -252,7 +247,6 @@ function findFirstEventOfDay(items: FeedItem[], now: Date): string | null {
return earliest?.id ?? null
}
function applyMorningWeekday(
items: FeedItem[],
boost: Record<string, number>,
@@ -415,7 +409,6 @@ function applyNight(items: FeedItem[], boost: Record<string, number>, suppress:
}
}
function applyPreMeetingOverrides(
items: FeedItem[],
preMeeting: PreMeetingInfo,
@@ -487,7 +480,6 @@ function applyWindDown(
}
}
function applyTransitionLookahead(
items: FeedItem[],
now: Date,
@@ -544,7 +536,6 @@ function getNextPeriodBoostTargets(period: TimePeriod, dayType: DayType): Readon
return targets
}
function applyWeatherTimeCorrelation(
items: FeedItem[],
period: TimePeriod,
@@ -562,7 +553,11 @@ function applyWeatherTimeCorrelation(
break
}
case WeatherFeedItemType.Current:
if (period === TimePeriod.Morning && dayType === DayType.Weekday && hasPrecipitationOrExtreme(item)) {
if (
period === TimePeriod.Morning &&
dayType === DayType.Weekday &&
hasPrecipitationOrExtreme(item)
) {
boost[item.id] = (boost[item.id] ?? 0) + 0.1
}
if (period === TimePeriod.Evening && hasEveningEventWithLocation) {
@@ -591,5 +586,3 @@ function hasEveningCalendarEventWithLocation(items: FeedItem[], now: Date): bool
return false
}

View File

@@ -7,11 +7,10 @@
* Writes feed items (with slots) to scripts/.cache/feed-items.json for inspection.
*/
import { Context } from "@aelis/core"
import { mkdirSync, writeFileSync } from "node:fs"
import { join } from "node:path"
import { Context } from "@aelis/core"
import { CalDavSource } from "../src/index.ts"
const serverUrl = prompt("CalDAV server URL:")

View File

@@ -9,8 +9,8 @@
"fetch-fixtures": "bun run scripts/fetch-fixtures.ts"
},
"dependencies": {
"@aelis/core": "workspace:*",
"@aelis/components": "workspace:*",
"@aelis/core": "workspace:*",
"@aelis/source-location": "workspace:*",
"arktype": "^2.1.0"
},

View File

@@ -9,15 +9,14 @@
* Usage: bun packages/aelis-source-weatherkit/scripts/query.ts
*/
import { Context } from "@aelis/core"
import { LocationKey } from "@aelis/source-location"
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"
import { join } from "node:path"
import { createInterface } from "node:readline/promises"
import { Context } from "@aelis/core"
import { LocationKey } from "@aelis/source-location"
import { DefaultWeatherKitClient } from "../src/weatherkit"
import { WeatherSource, Units } from "../src/weather-source"
import { DefaultWeatherKitClient } from "../src/weatherkit"
const SCRIPT_DIR = import.meta.dirname
const CACHE_DIR = join(SCRIPT_DIR, ".cache")

View File

@@ -4,7 +4,12 @@ import { Context } from "@aelis/core"
import { LocationKey } from "@aelis/source-location"
import { describe, expect, test } from "bun:test"
import type { WeatherKitClient, WeatherKitResponse, HourlyForecast, DailyForecast } from "./weatherkit"
import type {
WeatherKitClient,
WeatherKitResponse,
HourlyForecast,
DailyForecast,
} from "./weatherkit"
import fixture from "../fixtures/san-francisco.json"
import { WeatherFeedItemType, type DailyWeatherData, type HourlyWeatherData } from "./feed-items"

View File

@@ -3,7 +3,12 @@ import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from
import { Context, TimeRelevance, UnknownActionError } from "@aelis/core"
import { LocationKey } from "@aelis/source-location"
import { WeatherFeedItemType, type DailyWeatherEntry, type HourlyWeatherEntry, type WeatherFeedItem } from "./feed-items"
import {
WeatherFeedItemType,
type DailyWeatherEntry,
type HourlyWeatherEntry,
type WeatherFeedItem,
} from "./feed-items"
import currentWeatherInsightPrompt from "./prompts/current-weather-insight.txt"
import { WeatherKey, type Weather } from "./weather-context"
import {