mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 00:51:20 +00:00
refactor: rename aris to aelis (#59)
Rename all references across the codebase: package names, imports, source IDs, directory names, docs, and configs. Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# @aris/core
|
||||
# @aelis/core
|
||||
|
||||
Core orchestration layer for ARIS feed reconciliation.
|
||||
Core orchestration layer for AELIS feed reconciliation.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -63,7 +63,7 @@ A source may:
|
||||
Each package exports typed context keys for type-safe access:
|
||||
|
||||
```ts
|
||||
import { contextKey, type ContextKey } from "@aris/core"
|
||||
import { contextKey, type ContextKey } from "@aelis/core"
|
||||
|
||||
interface Location {
|
||||
lat: number
|
||||
@@ -78,7 +78,7 @@ export const LocationKey: ContextKey<Location> = contextKey("location")
|
||||
### Define a Context-Only Source
|
||||
|
||||
```ts
|
||||
import type { FeedSource } from "@aris/core"
|
||||
import type { FeedSource } from "@aelis/core"
|
||||
|
||||
const locationSource: FeedSource = {
|
||||
id: "location",
|
||||
@@ -104,8 +104,8 @@ const locationSource: FeedSource = {
|
||||
### Define a Source with Dependencies
|
||||
|
||||
```ts
|
||||
import type { FeedSource, FeedItem } from "@aris/core"
|
||||
import { contextValue } from "@aris/core"
|
||||
import type { FeedSource, FeedItem } from "@aelis/core"
|
||||
import { contextValue } from "@aelis/core"
|
||||
|
||||
type WeatherItem = FeedItem<"weather", { temp: number; condition: string }>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aris/core",
|
||||
"name": "@aelis/core",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
@@ -5,7 +5,7 @@ import type { StandardSchemaV1 } from "@standard-schema/spec"
|
||||
*
|
||||
* Action IDs use descriptive verb-noun kebab-case (e.g., "update-location", "play-track").
|
||||
* Combined with the source's reverse-domain ID, they form a globally unique identifier:
|
||||
* `<sourceId>/<actionId>` (e.g., "aris.location/update-location").
|
||||
* `<sourceId>/<actionId>` (e.g., "aelis.location/update-location").
|
||||
*/
|
||||
export class UnknownActionError extends Error {
|
||||
readonly actionId: string
|
||||
@@ -12,8 +12,8 @@ interface NextEvent {
|
||||
title: string
|
||||
}
|
||||
|
||||
const WeatherKey: ContextKey<Weather> = contextKey("aris.weather", "current")
|
||||
const NextEventKey: ContextKey<NextEvent> = contextKey("aris.google-calendar", "nextEvent")
|
||||
const WeatherKey: ContextKey<Weather> = contextKey("aelis.weather", "current")
|
||||
const NextEventKey: ContextKey<NextEvent> = contextKey("aelis.google-calendar", "nextEvent")
|
||||
|
||||
describe("Context", () => {
|
||||
describe("get", () => {
|
||||
@@ -66,10 +66,10 @@ describe("Context", () => {
|
||||
})
|
||||
|
||||
test("prefix match returns multiple instances", () => {
|
||||
const workKey = contextKey<NextEvent>("aris.google-calendar", "nextEvent", {
|
||||
const workKey = contextKey<NextEvent>("aelis.google-calendar", "nextEvent", {
|
||||
account: "work",
|
||||
})
|
||||
const personalKey = contextKey<NextEvent>("aris.google-calendar", "nextEvent", {
|
||||
const personalKey = contextKey<NextEvent>("aelis.google-calendar", "nextEvent", {
|
||||
account: "personal",
|
||||
})
|
||||
|
||||
@@ -79,7 +79,7 @@ describe("Context", () => {
|
||||
[personalKey, { title: "Dentist" }],
|
||||
])
|
||||
|
||||
const prefix = contextKey<NextEvent>("aris.google-calendar", "nextEvent")
|
||||
const prefix = contextKey<NextEvent>("aelis.google-calendar", "nextEvent")
|
||||
const results = ctx.find(prefix)
|
||||
|
||||
expect(results).toHaveLength(2)
|
||||
@@ -88,8 +88,8 @@ describe("Context", () => {
|
||||
})
|
||||
|
||||
test("prefix match includes exact match and longer keys", () => {
|
||||
const baseKey = contextKey<NextEvent>("aris.google-calendar", "nextEvent")
|
||||
const instanceKey = contextKey<NextEvent>("aris.google-calendar", "nextEvent", {
|
||||
const baseKey = contextKey<NextEvent>("aelis.google-calendar", "nextEvent")
|
||||
const instanceKey = contextKey<NextEvent>("aelis.google-calendar", "nextEvent", {
|
||||
account: "work",
|
||||
})
|
||||
|
||||
@@ -104,8 +104,8 @@ describe("Context", () => {
|
||||
})
|
||||
|
||||
test("does not match keys that share a string prefix but differ at segment boundary", () => {
|
||||
const keyA = contextKey<string>("aris.calendar", "next")
|
||||
const keyB = contextKey<string>("aris.calendar", "nextEvent")
|
||||
const keyA = contextKey<string>("aelis.calendar", "next")
|
||||
const keyB = contextKey<string>("aelis.calendar", "nextEvent")
|
||||
|
||||
const ctx = new Context()
|
||||
ctx.set([
|
||||
@@ -137,20 +137,20 @@ describe("Context", () => {
|
||||
test("single-segment prefix matches all keys starting with that segment", () => {
|
||||
const ctx = new Context()
|
||||
ctx.set([
|
||||
[contextKey("aris.weather", "current"), { temperature: 20 }],
|
||||
[contextKey("aris.weather", "forecast"), { high: 25 }],
|
||||
[contextKey("aris.calendar", "nextEvent"), { title: "Meeting" }],
|
||||
[contextKey("aelis.weather", "current"), { temperature: 20 }],
|
||||
[contextKey("aelis.weather", "forecast"), { high: 25 }],
|
||||
[contextKey("aelis.calendar", "nextEvent"), { title: "Meeting" }],
|
||||
])
|
||||
|
||||
const results = ctx.find(contextKey("aris.weather"))
|
||||
const results = ctx.find(contextKey("aelis.weather"))
|
||||
expect(results).toHaveLength(2)
|
||||
})
|
||||
|
||||
test("does not match shorter keys", () => {
|
||||
const ctx = new Context()
|
||||
ctx.set([[contextKey("aris.weather"), "short"]])
|
||||
ctx.set([[contextKey("aelis.weather"), "short"]])
|
||||
|
||||
const results = ctx.find(contextKey("aris.weather", "current"))
|
||||
const results = ctx.find(contextKey("aelis.weather", "current"))
|
||||
expect(results).toHaveLength(0)
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Tuple-keyed context system inspired by React Query's query keys.
|
||||
*
|
||||
* Context keys are arrays that form a hierarchy. Sources write to specific
|
||||
* keys (e.g., ["aris.google-calendar", "nextEvent", { account: "work" }])
|
||||
* keys (e.g., ["aelis.google-calendar", "nextEvent", { account: "work" }])
|
||||
* and consumers can query by exact match or prefix match to get all values
|
||||
* of a given type across source instances.
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ function calendarItem(id: string, title: string): CalendarItem {
|
||||
|
||||
function createWeatherSource(items: WeatherItem[]) {
|
||||
return {
|
||||
id: "aris.weather",
|
||||
id: "aelis.weather",
|
||||
...noActions,
|
||||
async fetchContext() {
|
||||
return null
|
||||
@@ -55,7 +55,7 @@ function createWeatherSource(items: WeatherItem[]) {
|
||||
|
||||
function createCalendarSource(items: CalendarItem[]) {
|
||||
return {
|
||||
id: "aris.calendar",
|
||||
id: "aelis.calendar",
|
||||
...noActions,
|
||||
async fetchContext() {
|
||||
return null
|
||||
@@ -480,7 +480,7 @@ describe("FeedPostProcessor", () => {
|
||||
let triggerUpdate: ((entries: readonly ContextEntry[]) => void) | null = null
|
||||
|
||||
const source: FeedSource = {
|
||||
id: "aris.reactive",
|
||||
id: "aelis.reactive",
|
||||
...noActions,
|
||||
async fetchContext() {
|
||||
return null
|
||||
@@ -522,7 +522,7 @@ describe("FeedPostProcessor", () => {
|
||||
let triggerItemsUpdate: ((items: FeedItem[]) => void) | null = null
|
||||
|
||||
const source: FeedSource = {
|
||||
id: "aris.reactive",
|
||||
id: "aelis.reactive",
|
||||
...noActions,
|
||||
async fetchContext() {
|
||||
return null
|
||||
@@ -9,7 +9,7 @@ import type { FeedItem } from "./feed"
|
||||
* it depends on, and the graph ensures dependencies are resolved before
|
||||
* dependents run.
|
||||
*
|
||||
* Source IDs use reverse domain notation. Built-in sources use `aris.<name>`,
|
||||
* Source IDs use reverse domain notation. Built-in sources use `aelis.<name>`,
|
||||
* third parties use their own domain (e.g., `com.spotify`).
|
||||
*
|
||||
* Every method maps to a protocol operation for remote source support:
|
||||
@@ -24,7 +24,7 @@ import type { FeedItem } from "./feed"
|
||||
* @example
|
||||
* ```ts
|
||||
* const locationSource: FeedSource = {
|
||||
* id: "aris.location",
|
||||
* id: "aelis.location",
|
||||
* async listActions() { return { "update-location": { id: "update-location" } } },
|
||||
* async executeAction(actionId) { throw new UnknownActionError(actionId) },
|
||||
* async fetchContext() { ... },
|
||||
@@ -1,11 +1,11 @@
|
||||
# @aris/data-source-weatherkit
|
||||
# @aelis/data-source-weatherkit
|
||||
|
||||
Weather data source using Apple WeatherKit REST API.
|
||||
|
||||
## Usage
|
||||
|
||||
```typescript
|
||||
import { WeatherKitDataSource, Units } from "@aris/data-source-weatherkit"
|
||||
import { WeatherKitDataSource, Units } from "@aelis/data-source-weatherkit"
|
||||
|
||||
const dataSource = new WeatherKitDataSource({
|
||||
credentials: {
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aris/source-google-calendar",
|
||||
"name": "@aelis/data-source-weatherkit",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
@@ -8,7 +8,7 @@
|
||||
"test": "bun test ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@aris/core": "workspace:*",
|
||||
"@aelis/core": "workspace:*",
|
||||
"arktype": "^2.1.0"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ContextKey } from "@aris/core"
|
||||
import type { ContextKey } from "@aelis/core"
|
||||
|
||||
import { Context, contextKey } from "@aris/core"
|
||||
import { Context, contextKey } from "@aelis/core"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import type { WeatherKitClient, WeatherKitResponse } from "./weatherkit"
|
||||
@@ -22,7 +22,7 @@ interface LocationData {
|
||||
accuracy: number
|
||||
}
|
||||
|
||||
const LocationKey: ContextKey<LocationData> = contextKey("aris.location", "location")
|
||||
const LocationKey: ContextKey<LocationData> = contextKey("aelis.location", "location")
|
||||
|
||||
const createMockClient = (response: WeatherKitResponse): WeatherKitClient => ({
|
||||
fetch: async () => response,
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Context, ContextKey, DataSource, FeedItemSignals } from "@aris/core"
|
||||
import type { Context, ContextKey, DataSource, FeedItemSignals } from "@aelis/core"
|
||||
|
||||
import { TimeRelevance, contextKey } from "@aris/core"
|
||||
import { TimeRelevance, contextKey } from "@aelis/core"
|
||||
|
||||
import {
|
||||
WeatherFeedItemType,
|
||||
@@ -45,7 +45,7 @@ interface LocationData {
|
||||
lng: number
|
||||
}
|
||||
|
||||
const LocationKey: ContextKey<LocationData> = contextKey("aris.location", "location")
|
||||
const LocationKey: ContextKey<LocationData> = contextKey("aelis.location", "location")
|
||||
|
||||
export class WeatherKitDataSource implements DataSource<WeatherFeedItem, WeatherKitQueryConfig> {
|
||||
private readonly DEFAULT_HOURLY_LIMIT = 12
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FeedItem } from "@aris/core"
|
||||
import type { FeedItem } from "@aelis/core"
|
||||
|
||||
import type { Certainty, ConditionCode, PrecipitationType, Severity, Urgency } from "./weatherkit"
|
||||
|
||||
17
packages/aelis-feed-enhancers/package.json
Normal file
17
packages/aelis-feed-enhancers/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@aelis/feed-enhancers",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"test": "bun test src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aelis/core": "workspace:*",
|
||||
"@aelis/source-caldav": "workspace:*",
|
||||
"@aelis/source-google-calendar": "workspace:*",
|
||||
"@aelis/source-tfl": "workspace:*",
|
||||
"@aelis/source-weatherkit": "workspace:*"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { FeedItem, FeedItemSignals } from "@aris/core"
|
||||
import type { FeedItem, FeedItemSignals } from "@aelis/core"
|
||||
|
||||
import { Context, TimeRelevance } from "@aris/core"
|
||||
import { CalDavFeedItemType } from "@aris/source-caldav"
|
||||
import { CalendarFeedItemType } from "@aris/source-google-calendar"
|
||||
import { TflFeedItemType } from "@aris/source-tfl"
|
||||
import { WeatherFeedItemType } from "@aris/source-weatherkit"
|
||||
import { Context, 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"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import {
|
||||
@@ -1,15 +1,15 @@
|
||||
import type { Context, FeedEnhancement, FeedItem, FeedPostProcessor } from "@aris/core"
|
||||
import type { Context, FeedEnhancement, FeedItem, FeedPostProcessor } from "@aelis/core"
|
||||
|
||||
import { TimeRelevance } from "@aris/core"
|
||||
import { TimeRelevance } from "@aelis/core"
|
||||
|
||||
import type { CalDavEventData } from "@aris/source-caldav"
|
||||
import type { CalendarEventData } from "@aris/source-google-calendar"
|
||||
import type { CurrentWeatherData } from "@aris/source-weatherkit"
|
||||
import type { CalDavEventData } from "@aelis/source-caldav"
|
||||
import type { CalendarEventData } from "@aelis/source-google-calendar"
|
||||
import type { CurrentWeatherData } from "@aelis/source-weatherkit"
|
||||
|
||||
import { CalDavFeedItemType } from "@aris/source-caldav"
|
||||
import { CalendarFeedItemType } from "@aris/source-google-calendar"
|
||||
import { TflFeedItemType } from "@aris/source-tfl"
|
||||
import { WeatherFeedItemType } from "@aris/source-weatherkit"
|
||||
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 = {
|
||||
@@ -1,11 +1,11 @@
|
||||
# @aris/source-caldav
|
||||
# @aelis/source-caldav
|
||||
|
||||
A FeedSource that fetches calendar events from any CalDAV server.
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { CalDavSource } from "@aris/source-caldav"
|
||||
import { CalDavSource } from "@aelis/source-caldav"
|
||||
|
||||
// Basic auth (Nextcloud, Radicale, Baikal, iCloud, etc.)
|
||||
const source = new CalDavSource({
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aris/source-caldav",
|
||||
"name": "@aelis/source-caldav",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
@@ -9,7 +9,7 @@
|
||||
"test:live": "bun run scripts/test-live.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aris/core": "workspace:*",
|
||||
"@aelis/core": "workspace:*",
|
||||
"ical.js": "^2.1.0",
|
||||
"tsdav": "^2.1.7"
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
import { mkdirSync, writeFileSync } from "node:fs"
|
||||
import { join } from "node:path"
|
||||
|
||||
import { Context } from "@aris/core"
|
||||
import { Context } from "@aelis/core"
|
||||
|
||||
import { CalDavSource } from "../src/index.ts"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ContextEntry } from "@aris/core"
|
||||
import type { ContextEntry } from "@aelis/core"
|
||||
|
||||
import { Context, TimeRelevance } from "@aris/core"
|
||||
import { Context, TimeRelevance } from "@aelis/core"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { readFileSync } from "node:fs"
|
||||
import { join } from "node:path"
|
||||
@@ -76,7 +76,7 @@ describe("CalDavSource", () => {
|
||||
test("has correct id", () => {
|
||||
const client = new MockDAVClient([], {})
|
||||
const source = createSource(client)
|
||||
expect(source.id).toBe("aris.caldav")
|
||||
expect(source.id).toBe("aelis.caldav")
|
||||
})
|
||||
|
||||
test("returns empty array when no calendars exist", async () => {
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aris/core"
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aelis/core"
|
||||
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aris/core"
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aelis/core"
|
||||
import { DAVClient } from "tsdav"
|
||||
|
||||
import type { CalDavDAVClient, CalDavEventData, CalDavFeedItem } from "./types.ts"
|
||||
@@ -68,7 +68,7 @@ const DEFAULT_LOOK_AHEAD_DAYS = 0
|
||||
* ```
|
||||
*/
|
||||
export class CalDavSource implements FeedSource<CalDavFeedItem> {
|
||||
readonly id = "aris.caldav"
|
||||
readonly id = "aelis.caldav"
|
||||
|
||||
private options: CalDavSourceOptions | null
|
||||
private readonly lookAheadDays: number
|
||||
@@ -177,7 +177,7 @@ export class CalDavSource implements FeedSource<CalDavFeedItem> {
|
||||
const allEvents: CalDavEventData[] = []
|
||||
for (const result of results) {
|
||||
if (result.status === "rejected") {
|
||||
console.warn("[aris.caldav] Failed to fetch calendar:", result.reason)
|
||||
console.warn("[aelis.caldav] Failed to fetch calendar:", result.reason)
|
||||
continue
|
||||
}
|
||||
const { objects, calendarName } = result.value
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ContextKey } from "@aris/core"
|
||||
import type { ContextKey } from "@aelis/core"
|
||||
|
||||
import { contextKey } from "@aris/core"
|
||||
import { contextKey } from "@aelis/core"
|
||||
|
||||
import type { CalDavEventData } from "./types.ts"
|
||||
|
||||
@@ -21,4 +21,4 @@ export interface CalendarContext {
|
||||
todayEventCount: number
|
||||
}
|
||||
|
||||
export const CalDavCalendarKey: ContextKey<CalendarContext> = contextKey("aris.caldav", "calendar")
|
||||
export const CalDavCalendarKey: ContextKey<CalendarContext> = contextKey("aelis.caldav", "calendar")
|
||||
@@ -125,7 +125,7 @@ export function parseICalEvents(
|
||||
while (next) {
|
||||
if (++iterations > MAX_RECURRENCE_ITERATIONS) {
|
||||
console.warn(
|
||||
`[aris.caldav] Recurrence expansion for "${masterEvent.uid}" hit iteration limit (${MAX_RECURRENCE_ITERATIONS}), stopping`,
|
||||
`[aelis.caldav] Recurrence expansion for "${masterEvent.uid}" hit iteration limit (${MAX_RECURRENCE_ITERATIONS}), stopping`,
|
||||
)
|
||||
break
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FeedItem } from "@aris/core"
|
||||
import type { FeedItem } from "@aelis/core"
|
||||
|
||||
// -- Event status --
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aris/data-source-weatherkit",
|
||||
"name": "@aelis/source-google-calendar",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
@@ -8,7 +8,7 @@
|
||||
"test": "bun test ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@aris/core": "workspace:*",
|
||||
"@aelis/core": "workspace:*",
|
||||
"arktype": "^2.1.0"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ContextKey } from "@aris/core"
|
||||
import type { ContextKey } from "@aelis/core"
|
||||
|
||||
import { contextKey } from "@aris/core"
|
||||
import { contextKey } from "@aelis/core"
|
||||
|
||||
export interface NextEvent {
|
||||
title: string
|
||||
@@ -10,4 +10,4 @@ export interface NextEvent {
|
||||
location: string | null
|
||||
}
|
||||
|
||||
export const NextEventKey: ContextKey<NextEvent> = contextKey("aris.google-calendar", "nextEvent")
|
||||
export const NextEventKey: ContextKey<NextEvent> = contextKey("aelis.google-calendar", "nextEvent")
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FeedItem } from "@aris/core"
|
||||
import type { FeedItem } from "@aelis/core"
|
||||
|
||||
import type { CalendarEventData } from "./types"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Context, TimeRelevance } from "@aris/core"
|
||||
import { Context, TimeRelevance } from "@aelis/core"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import type { ApiCalendarEvent, GoogleCalendarClient, ListEventsOptions } from "./types"
|
||||
@@ -45,7 +45,7 @@ describe("GoogleCalendarSource", () => {
|
||||
describe("constructor", () => {
|
||||
test("has correct id", () => {
|
||||
const source = new GoogleCalendarSource({ client: defaultMockClient() })
|
||||
expect(source.id).toBe("aris.google-calendar")
|
||||
expect(source.id).toBe("aelis.google-calendar")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aris/core"
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aelis/core"
|
||||
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aris/core"
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aelis/core"
|
||||
|
||||
import type {
|
||||
ApiCalendarEvent,
|
||||
@@ -65,7 +65,7 @@ const URGENCY_ALL_DAY = 0.4
|
||||
* ```
|
||||
*/
|
||||
export class GoogleCalendarSource implements FeedSource<CalendarFeedItem> {
|
||||
readonly id = "aris.google-calendar"
|
||||
readonly id = "aelis.google-calendar"
|
||||
|
||||
private readonly client: GoogleCalendarClient
|
||||
private readonly calendarIds: string[] | undefined
|
||||
@@ -1,6 +1,6 @@
|
||||
# @aris/source-location
|
||||
# @aelis/source-location
|
||||
|
||||
A FeedSource that provides location context to the ARIS feed graph.
|
||||
A FeedSource that provides location context to the AELIS feed graph.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -9,14 +9,14 @@ This source accepts external location pushes and does not query location itself.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @aris/source-location
|
||||
bun add @aelis/source-location
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { LocationSource, LocationKey, type Location } from "@aris/source-location"
|
||||
import { contextValue } from "@aris/core"
|
||||
import { LocationSource, LocationKey, type Location } from "@aelis/source-location"
|
||||
import { contextValue } from "@aelis/core"
|
||||
|
||||
// Create source with default history size (1)
|
||||
const locationSource = new LocationSource()
|
||||
@@ -42,8 +42,8 @@ locationSource.locationHistory // readonly Location[]
|
||||
### With FeedController
|
||||
|
||||
```ts
|
||||
import { FeedController } from "@aris/core"
|
||||
import { LocationSource } from "@aris/source-location"
|
||||
import { FeedController } from "@aelis/core"
|
||||
import { LocationSource } from "@aelis/source-location"
|
||||
|
||||
const locationSource = new LocationSource()
|
||||
|
||||
@@ -63,8 +63,8 @@ locationSource.pushLocation({
|
||||
### Reading Location in Downstream Sources
|
||||
|
||||
```ts
|
||||
import { contextValue, type FeedSource } from "@aris/core"
|
||||
import { LocationKey } from "@aris/source-location"
|
||||
import { contextValue, type FeedSource } from "@aelis/core"
|
||||
import { LocationKey } from "@aelis/source-location"
|
||||
|
||||
const weatherSource: FeedSource = {
|
||||
id: "weather",
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aris/source-location",
|
||||
"name": "@aelis/source-location",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
@@ -8,7 +8,7 @@
|
||||
"test": "bun test src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aris/core": "workspace:*",
|
||||
"@aelis/core": "workspace:*",
|
||||
"arktype": "^2.1.0"
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ describe("LocationSource", () => {
|
||||
describe("FeedSource interface", () => {
|
||||
test("has correct id", () => {
|
||||
const source = new LocationSource()
|
||||
expect(source.id).toBe("aris.location")
|
||||
expect(source.id).toBe("aelis.location")
|
||||
})
|
||||
|
||||
test("fetchItems always returns empty array", async () => {
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { ActionDefinition, ContextEntry, FeedSource } from "@aris/core"
|
||||
import type { ActionDefinition, ContextEntry, FeedSource } from "@aelis/core"
|
||||
|
||||
import { Context, UnknownActionError, contextKey, type ContextKey } from "@aris/core"
|
||||
import { Context, UnknownActionError, contextKey, type ContextKey } from "@aelis/core"
|
||||
import { type } from "arktype"
|
||||
|
||||
import { Location, type LocationSourceOptions } from "./types.ts"
|
||||
|
||||
export const LocationKey: ContextKey<Location> = contextKey("aris.location", "location")
|
||||
export const LocationKey: ContextKey<Location> = contextKey("aelis.location", "location")
|
||||
|
||||
/**
|
||||
* A FeedSource that provides location context.
|
||||
@@ -16,7 +16,7 @@ export const LocationKey: ContextKey<Location> = contextKey("aris.location", "lo
|
||||
* Does not produce feed items - always returns empty array from `fetchItems`.
|
||||
*/
|
||||
export class LocationSource implements FeedSource {
|
||||
readonly id = "aris.location"
|
||||
readonly id = "aelis.location"
|
||||
|
||||
private readonly historySize: number
|
||||
private locations: Location[] = []
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aris/source-tfl",
|
||||
"name": "@aelis/source-tfl",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
@@ -9,8 +9,8 @@
|
||||
"fetch-fixtures": "bun run scripts/fetch-fixtures.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aris/core": "workspace:*",
|
||||
"@aris/source-location": "workspace:*",
|
||||
"@aelis/core": "workspace:*",
|
||||
"@aelis/source-location": "workspace:*",
|
||||
"arktype": "^2.1.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Context } from "@aris/core"
|
||||
import { LocationKey, type Location } from "@aris/source-location"
|
||||
import { Context } from "@aelis/core"
|
||||
import { LocationKey, type Location } from "@aelis/source-location"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import type {
|
||||
@@ -93,12 +93,12 @@ describe("TflSource", () => {
|
||||
describe("interface", () => {
|
||||
test("has correct id", () => {
|
||||
const source = new TflSource({ client: api })
|
||||
expect(source.id).toBe("aris.tfl")
|
||||
expect(source.id).toBe("aelis.tfl")
|
||||
})
|
||||
|
||||
test("depends on location", () => {
|
||||
const source = new TflSource({ client: api })
|
||||
expect(source.dependencies).toEqual(["aris.location"])
|
||||
expect(source.dependencies).toEqual(["aelis.location"])
|
||||
})
|
||||
|
||||
test("implements fetchItems", () => {
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aris/core"
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aelis/core"
|
||||
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aris/core"
|
||||
import { LocationKey } from "@aris/source-location"
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aelis/core"
|
||||
import { LocationKey } from "@aelis/source-location"
|
||||
import { type } from "arktype"
|
||||
|
||||
import type {
|
||||
@@ -73,8 +73,8 @@ export class TflSource implements FeedSource<TflAlertFeedItem> {
|
||||
"elizabeth",
|
||||
]
|
||||
|
||||
readonly id = "aris.tfl"
|
||||
readonly dependencies = ["aris.location"]
|
||||
readonly id = "aelis.tfl"
|
||||
readonly dependencies = ["aelis.location"]
|
||||
|
||||
private readonly client: ITflApi
|
||||
private lines: TflLineId[]
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FeedItem } from "@aris/core"
|
||||
import type { FeedItem } from "@aelis/core"
|
||||
|
||||
import type { TflLineId } from "./tfl-api.ts"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# @aris/source-weatherkit
|
||||
# @aelis/source-weatherkit
|
||||
|
||||
Weather feed source using Apple WeatherKit API.
|
||||
|
||||
@@ -7,7 +7,7 @@ Weather feed source using Apple WeatherKit API.
|
||||
### Basic Setup
|
||||
|
||||
```ts
|
||||
import { WeatherSource, Units } from "@aris/source-weatherkit"
|
||||
import { WeatherSource, Units } from "@aelis/source-weatherkit"
|
||||
|
||||
const weatherSource = new WeatherSource({
|
||||
credentials: {
|
||||
@@ -23,8 +23,8 @@ const weatherSource = new WeatherSource({
|
||||
### With Feed Source Graph
|
||||
|
||||
```ts
|
||||
import { LocationSource } from "@aris/source-location"
|
||||
import { WeatherSource } from "@aris/source-weatherkit"
|
||||
import { LocationSource } from "@aelis/source-location"
|
||||
import { WeatherSource } from "@aelis/source-weatherkit"
|
||||
|
||||
const locationSource = new LocationSource()
|
||||
const weatherSource = new WeatherSource({ credentials })
|
||||
@@ -38,8 +38,8 @@ const sources = [locationSource, weatherSource]
|
||||
Downstream sources can access weather data:
|
||||
|
||||
```ts
|
||||
import { contextValue } from "@aris/core"
|
||||
import { WeatherKey } from "@aris/source-weatherkit"
|
||||
import { contextValue } from "@aelis/core"
|
||||
import { WeatherKey } from "@aelis/source-weatherkit"
|
||||
|
||||
async function fetchContext(context: Context) {
|
||||
const weather = contextValue(context, WeatherKey)
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aris/source-weatherkit",
|
||||
"name": "@aelis/source-weatherkit",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
@@ -8,8 +8,8 @@
|
||||
"test": "bun test ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@aris/core": "workspace:*",
|
||||
"@aris/source-location": "workspace:*",
|
||||
"@aelis/core": "workspace:*",
|
||||
"@aelis/source-location": "workspace:*",
|
||||
"arktype": "^2.1.0"
|
||||
}
|
||||
}
|
||||
@@ -6,15 +6,15 @@
|
||||
* then prints the raw API response and processed feed items.
|
||||
* Caches credentials locally and writes response JSON to a file.
|
||||
*
|
||||
* Usage: bun packages/aris-source-weatherkit/scripts/query.ts
|
||||
* Usage: bun packages/aelis-source-weatherkit/scripts/query.ts
|
||||
*/
|
||||
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"
|
||||
import { join } from "node:path"
|
||||
import { createInterface } from "node:readline/promises"
|
||||
|
||||
import { Context } from "@aris/core"
|
||||
import { LocationKey } from "@aris/source-location"
|
||||
import { Context } from "@aelis/core"
|
||||
import { LocationKey } from "@aelis/source-location"
|
||||
|
||||
import { DefaultWeatherKitClient } from "../src/weatherkit"
|
||||
import { WeatherSource, Units } from "../src/weather-source"
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FeedItem } from "@aris/core"
|
||||
import type { FeedItem } from "@aelis/core"
|
||||
|
||||
import type { Certainty, ConditionCode, PrecipitationType, Severity, Urgency } from "./weatherkit"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ContextKey } from "@aris/core"
|
||||
import type { ContextKey } from "@aelis/core"
|
||||
|
||||
import { contextKey } from "@aris/core"
|
||||
import { contextKey } from "@aelis/core"
|
||||
|
||||
import type { ConditionCode } from "./weatherkit"
|
||||
|
||||
@@ -24,4 +24,4 @@ export interface Weather {
|
||||
daylight: boolean
|
||||
}
|
||||
|
||||
export const WeatherKey: ContextKey<Weather> = contextKey("aris.weather", "weather")
|
||||
export const WeatherKey: ContextKey<Weather> = contextKey("aelis.weather", "weather")
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { FeedSource } from "@aris/core"
|
||||
import type { FeedSource } from "@aelis/core"
|
||||
|
||||
import { Context } from "@aris/core"
|
||||
import { LocationKey } from "@aris/source-location"
|
||||
import { Context } from "@aelis/core"
|
||||
import { LocationKey } from "@aelis/source-location"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
|
||||
import type { WeatherKitClient, WeatherKitResponse } from "./weatherkit"
|
||||
@@ -36,12 +36,12 @@ describe("WeatherSource", () => {
|
||||
describe("properties", () => {
|
||||
test("has correct id", () => {
|
||||
const source = new WeatherSource({ credentials: mockCredentials })
|
||||
expect(source.id).toBe("aris.weather")
|
||||
expect(source.id).toBe("aelis.weather")
|
||||
})
|
||||
|
||||
test("depends on location", () => {
|
||||
const source = new WeatherSource({ credentials: mockCredentials })
|
||||
expect(source.dependencies).toEqual(["aris.location"])
|
||||
expect(source.dependencies).toEqual(["aelis.location"])
|
||||
})
|
||||
|
||||
test("throws error if neither client nor credentials provided", () => {
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aris/core"
|
||||
import type { ActionDefinition, ContextEntry, FeedItemSignals, FeedSource } from "@aelis/core"
|
||||
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aris/core"
|
||||
import { LocationKey } from "@aris/source-location"
|
||||
import { Context, TimeRelevance, UnknownActionError } from "@aelis/core"
|
||||
import { LocationKey } from "@aelis/source-location"
|
||||
|
||||
import { WeatherFeedItemType, type WeatherFeedItem } from "./feed-items"
|
||||
import currentWeatherInsightPrompt from "./prompts/current-weather-insight.txt"
|
||||
@@ -94,8 +94,8 @@ const MODERATE_CONDITIONS = new Set<ConditionCode>([
|
||||
* ```
|
||||
*/
|
||||
export class WeatherSource implements FeedSource<WeatherFeedItem> {
|
||||
readonly id = "aris.weather"
|
||||
readonly dependencies = ["aris.location"]
|
||||
readonly id = "aelis.weather"
|
||||
readonly dependencies = ["aelis.location"]
|
||||
|
||||
private readonly client: WeatherKitClient
|
||||
private readonly hourlyLimit: number
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "@aris/feed-enhancers",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"test": "bun test src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aris/core": "workspace:*",
|
||||
"@aris/source-caldav": "workspace:*",
|
||||
"@aris/source-google-calendar": "workspace:*",
|
||||
"@aris/source-tfl": "workspace:*",
|
||||
"@aris/source-weatherkit": "workspace:*"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user