Compare commits
33 Commits
refactor/r
...
a26e35cc2f
| Author | SHA1 | Date | |
|---|---|---|---|
|
a26e35cc2f
|
|||
| 31d5aa8d50 | |||
| de29e44a08 | |||
| caf48484bf | |||
| ac80e0cdac | |||
| 96e22e227c | |||
| 8ca8a0d1d2 | |||
| 4c9ac2c61a | |||
| be3fc41a00 | |||
| 2e9c600e93 | |||
| d616fd52d3 | |||
| 2d7544500d | |||
| 9dc0cc3d2f | |||
| fe1d261f56 | |||
| 40ad90aa2d | |||
| 82ac2b577d | |||
| ffea38b986 | |||
| 28d26b3c87 | |||
| 78b0ed94bd | |||
| ee957ea7b1 | |||
| 6ae0ad1d40 | |||
|
941acb826c
|
|||
| 3d492a5d56 | |||
|
08dd437952
|
|||
| 2fc20759dd | |||
| 769e2d4eb0 | |||
|
5e9094710d
|
|||
|
5556f3fbf9
|
|||
|
0176979925
|
|||
|
971aba0932
|
|||
|
68e319e4b8
|
|||
| c042af88f3 | |||
|
0608f2ac61
|
43
.claude/skills/gpg-commit-signing/SKILL.md
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
name: gpg-commit-signing
|
||||||
|
description: Sign git commits with GPG in non-interactive environments. Use when committing code and the `GPG_PRIVATE_KEY_PASSPHRASE` environment variable is available. Triggers on "commit", "sign commit", "GPG", "git commit -S", or any git operation requiring signed commits.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GPG Commit Signing
|
||||||
|
|
||||||
|
Sign commits in headless/non-interactive environments where `/dev/tty` is unavailable.
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
1. Check whether `GPG_PRIVATE_KEY_PASSPHRASE` is set:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
test -n "$GPG_PRIVATE_KEY_PASSPHRASE" && echo "available" || echo "not set"
|
||||||
|
```
|
||||||
|
|
||||||
|
If not set, skip signing — commit without `-S`.
|
||||||
|
|
||||||
|
2. Try a direct signed commit first — the environment may already have loopback pinentry configured:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git commit -S -m "message"
|
||||||
|
```
|
||||||
|
|
||||||
|
If this succeeds, no further steps are needed.
|
||||||
|
|
||||||
|
3. If step 2 fails with a `/dev/tty` error, use `--pinentry-mode loopback` via a wrapper script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
printf '#!/bin/sh\ngpg --batch --pinentry-mode loopback --passphrase "$GPG_PRIVATE_KEY_PASSPHRASE" "$@"\n' > /tmp/gpg-sign.sh
|
||||||
|
chmod +x /tmp/gpg-sign.sh
|
||||||
|
git -c gpg.program=/tmp/gpg-sign.sh commit -S -m "message"
|
||||||
|
rm /tmp/gpg-sign.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
This passes the passphrase directly to gpg on each signing invocation, bypassing the need for a configured gpg-agent.
|
||||||
|
|
||||||
|
## Anti-patterns
|
||||||
|
|
||||||
|
- Do not echo or log `GPG_PRIVATE_KEY_PASSPHRASE`.
|
||||||
|
- Do not commit without `-S` when the passphrase is available — the project expects signed commits.
|
||||||
|
- Do not leave wrapper scripts on disk after committing.
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
expo:
|
expo:
|
||||||
name: Expo Dev Server
|
name: Expo Dev Server
|
||||||
description: Expo development server for aris-client
|
description: Expo development server for aelis-client
|
||||||
triggeredBy:
|
triggeredBy:
|
||||||
- postDevcontainerStart
|
- postDevcontainerStart
|
||||||
commands:
|
commands:
|
||||||
start: cd apps/aris-client && ./scripts/run-dev-server.sh
|
start: cd apps/aelis-client && ./scripts/run-dev-server.sh
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Project
|
## Project
|
||||||
|
|
||||||
ARIS is an AI-powered personal assistant that aggregates data from various sources into a contextual feed. Monorepo with `packages/` (shared libraries) and `apps/` (applications).
|
AELIS is an AI-powered personal assistant that aggregates data from various sources into a contextual feed. Monorepo with `packages/` (shared libraries) and `apps/` (applications).
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# aris
|
# aelis
|
||||||
|
|
||||||
To install dependencies:
|
To install dependencies:
|
||||||
|
|
||||||
@@ -8,14 +8,14 @@ bun install
|
|||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
### @aris/source-tfl
|
### @aelis/source-tfl
|
||||||
|
|
||||||
TfL (Transport for London) feed source for tube, overground, and Elizabeth line alerts.
|
TfL (Transport for London) feed source for tube, overground, and Elizabeth line alerts.
|
||||||
|
|
||||||
#### Testing
|
#### Testing
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd packages/aris-source-tfl
|
cd packages/aelis-source-tfl
|
||||||
bun run test
|
bun run test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@aris/backend",
|
"name": "@aelis/backend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/server.ts",
|
"main": "src/server.ts",
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
"test": "bun test src/"
|
"test": "bun test src/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aris/core": "workspace:*",
|
"@aelis/core": "workspace:*",
|
||||||
"@aris/source-location": "workspace:*",
|
"@aelis/source-location": "workspace:*",
|
||||||
"@aris/source-tfl": "workspace:*",
|
"@aelis/source-tfl": "workspace:*",
|
||||||
"@aris/source-weatherkit": "workspace:*",
|
"@aelis/source-weatherkit": "workspace:*",
|
||||||
"arktype": "^2.1.29",
|
"arktype": "^2.1.29",
|
||||||
"better-auth": "^1",
|
"better-auth": "^1",
|
||||||
"hono": "^4",
|
"hono": "^4",
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Context, Next } from "hono"
|
import type { Context, MiddlewareHandler, Next } from "hono"
|
||||||
|
|
||||||
import type { AuthSession, AuthUser } from "./session.ts"
|
import type { AuthSession, AuthUser } from "./session.ts"
|
||||||
|
|
||||||
@@ -9,6 +9,10 @@ export interface SessionVariables {
|
|||||||
session: AuthSession | null
|
session: AuthSession | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AuthSessionEnv = { Variables: SessionVariables }
|
||||||
|
|
||||||
|
export type AuthSessionMiddleware = MiddlewareHandler<AuthSessionEnv>
|
||||||
|
|
||||||
declare module "hono" {
|
declare module "hono" {
|
||||||
interface ContextVariableMap extends SessionVariables {}
|
interface ContextVariableMap extends SessionVariables {}
|
||||||
}
|
}
|
||||||
@@ -55,3 +59,18 @@ export async function getSessionFromHeaders(
|
|||||||
const session = await auth.api.getSession({ headers })
|
const session = await auth.api.getSession({ headers })
|
||||||
return session
|
return session
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test-only middleware that injects a fake user and session.
|
||||||
|
* Pass userId to simulate an authenticated request, or omit to get 401.
|
||||||
|
*/
|
||||||
|
export function mockAuthSessionMiddleware(userId?: string): AuthSessionMiddleware {
|
||||||
|
return async (c: Context, next: Next): Promise<Response | void> => {
|
||||||
|
if (!userId) {
|
||||||
|
return c.json({ error: "Unauthorized" }, 401)
|
||||||
|
}
|
||||||
|
c.set("user", { id: userId } as AuthUser)
|
||||||
|
c.set("session", { id: "mock-session" } as AuthSession)
|
||||||
|
await next()
|
||||||
|
}
|
||||||
|
}
|
||||||
140
apps/aelis-backend/src/feed/http.test.ts
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
import type { ActionDefinition, ContextEntry, FeedItem, FeedSource } from "@aelis/core"
|
||||||
|
|
||||||
|
import { describe, expect, test } from "bun:test"
|
||||||
|
import { Hono } from "hono"
|
||||||
|
|
||||||
|
import { mockAuthSessionMiddleware } from "../auth/session-middleware.ts"
|
||||||
|
import { UserSessionManager } from "../session/index.ts"
|
||||||
|
import { registerFeedHttpHandlers } from "./http.ts"
|
||||||
|
|
||||||
|
interface FeedResponse {
|
||||||
|
items: Array<{
|
||||||
|
id: string
|
||||||
|
type: string
|
||||||
|
priority: number
|
||||||
|
timestamp: string
|
||||||
|
data: Record<string, unknown>
|
||||||
|
}>
|
||||||
|
errors: Array<{ sourceId: string; error: string }>
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStubSource(id: string, items: FeedItem[] = []): FeedSource {
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
async listActions(): Promise<Record<string, ActionDefinition>> {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
async executeAction(): Promise<unknown> {
|
||||||
|
return undefined
|
||||||
|
},
|
||||||
|
async fetchContext(): Promise<readonly ContextEntry[] | null> {
|
||||||
|
return null
|
||||||
|
},
|
||||||
|
async fetchItems() {
|
||||||
|
return items
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildTestApp(sessionManager: UserSessionManager, userId?: string) {
|
||||||
|
const app = new Hono()
|
||||||
|
registerFeedHttpHandlers(app, {
|
||||||
|
sessionManager,
|
||||||
|
authSessionMiddleware: mockAuthSessionMiddleware(userId),
|
||||||
|
})
|
||||||
|
return app
|
||||||
|
}
|
||||||
|
|
||||||
|
describe("GET /api/feed", () => {
|
||||||
|
test("returns 401 without auth", async () => {
|
||||||
|
const manager = new UserSessionManager([])
|
||||||
|
const app = buildTestApp(manager)
|
||||||
|
|
||||||
|
const res = await app.request("/api/feed")
|
||||||
|
|
||||||
|
expect(res.status).toBe(401)
|
||||||
|
})
|
||||||
|
|
||||||
|
test("returns cached feed when available", async () => {
|
||||||
|
const items: FeedItem[] = [
|
||||||
|
{
|
||||||
|
id: "item-1",
|
||||||
|
type: "test",
|
||||||
|
priority: 0.8,
|
||||||
|
timestamp: new Date("2025-01-01T00:00:00.000Z"),
|
||||||
|
data: { value: 42 },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
const manager = new UserSessionManager([() => createStubSource("test", items)])
|
||||||
|
const app = buildTestApp(manager, "user-1")
|
||||||
|
|
||||||
|
// Prime the cache
|
||||||
|
const session = manager.getOrCreate("user-1")
|
||||||
|
await session.engine.refresh()
|
||||||
|
expect(session.engine.lastFeed()).not.toBeNull()
|
||||||
|
|
||||||
|
const res = await app.request("/api/feed")
|
||||||
|
|
||||||
|
expect(res.status).toBe(200)
|
||||||
|
const body = (await res.json()) as FeedResponse
|
||||||
|
expect(body.items).toHaveLength(1)
|
||||||
|
expect(body.items[0]!.id).toBe("item-1")
|
||||||
|
expect(body.items[0]!.type).toBe("test")
|
||||||
|
expect(body.items[0]!.priority).toBe(0.8)
|
||||||
|
expect(body.items[0]!.timestamp).toBe("2025-01-01T00:00:00.000Z")
|
||||||
|
expect(body.errors).toHaveLength(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
test("forces refresh when no cached feed", async () => {
|
||||||
|
const items: FeedItem[] = [
|
||||||
|
{
|
||||||
|
id: "fresh-1",
|
||||||
|
type: "test",
|
||||||
|
priority: 0.5,
|
||||||
|
timestamp: new Date("2025-06-01T12:00:00.000Z"),
|
||||||
|
data: { fresh: true },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
const manager = new UserSessionManager([() => createStubSource("test", items)])
|
||||||
|
const app = buildTestApp(manager, "user-1")
|
||||||
|
|
||||||
|
// No prior refresh — lastFeed() returns null, handler should call refresh()
|
||||||
|
const res = await app.request("/api/feed")
|
||||||
|
|
||||||
|
expect(res.status).toBe(200)
|
||||||
|
const body = (await res.json()) as FeedResponse
|
||||||
|
expect(body.items).toHaveLength(1)
|
||||||
|
expect(body.items[0]!.id).toBe("fresh-1")
|
||||||
|
expect(body.items[0]!.data.fresh).toBe(true)
|
||||||
|
expect(body.errors).toHaveLength(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
test("serializes source errors as message strings", async () => {
|
||||||
|
const failingSource: FeedSource = {
|
||||||
|
id: "failing",
|
||||||
|
async listActions() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
async executeAction() {
|
||||||
|
return undefined
|
||||||
|
},
|
||||||
|
async fetchContext() {
|
||||||
|
return null
|
||||||
|
},
|
||||||
|
async fetchItems() {
|
||||||
|
throw new Error("connection timeout")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
const manager = new UserSessionManager([() => failingSource])
|
||||||
|
const app = buildTestApp(manager, "user-1")
|
||||||
|
|
||||||
|
const res = await app.request("/api/feed")
|
||||||
|
|
||||||
|
expect(res.status).toBe(200)
|
||||||
|
const body = (await res.json()) as FeedResponse
|
||||||
|
expect(body.items).toHaveLength(0)
|
||||||
|
expect(body.errors).toHaveLength(1)
|
||||||
|
expect(body.errors[0]!.sourceId).toBe("failing")
|
||||||
|
expect(body.errors[0]!.error).toBe("connection timeout")
|
||||||
|
})
|
||||||
|
})
|
||||||
41
apps/aelis-backend/src/feed/http.ts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import type { Context, Hono } from "hono"
|
||||||
|
|
||||||
|
import { createMiddleware } from "hono/factory"
|
||||||
|
|
||||||
|
import type { AuthSessionMiddleware } from "../auth/session-middleware.ts"
|
||||||
|
import type { UserSessionManager } from "../session/index.ts"
|
||||||
|
|
||||||
|
type Env = { Variables: { sessionManager: UserSessionManager } }
|
||||||
|
|
||||||
|
interface FeedHttpHandlersDeps {
|
||||||
|
sessionManager: UserSessionManager
|
||||||
|
authSessionMiddleware: AuthSessionMiddleware
|
||||||
|
}
|
||||||
|
|
||||||
|
export function registerFeedHttpHandlers(
|
||||||
|
app: Hono,
|
||||||
|
{ sessionManager, authSessionMiddleware }: FeedHttpHandlersDeps,
|
||||||
|
) {
|
||||||
|
const inject = createMiddleware<Env>(async (c, next) => {
|
||||||
|
c.set("sessionManager", sessionManager)
|
||||||
|
await next()
|
||||||
|
})
|
||||||
|
|
||||||
|
app.get("/api/feed", inject, authSessionMiddleware, handleGetFeed)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleGetFeed(c: Context<Env>) {
|
||||||
|
const user = c.get("user")!
|
||||||
|
const sessionManager = c.get("sessionManager")
|
||||||
|
const session = sessionManager.getOrCreate(user.id)
|
||||||
|
|
||||||
|
const feed = session.engine.lastFeed() ?? (await session.engine.refresh())
|
||||||
|
|
||||||
|
return c.json({
|
||||||
|
items: feed.items,
|
||||||
|
errors: feed.errors.map((e) => ({
|
||||||
|
sourceId: e.sourceId,
|
||||||
|
error: e.error.message,
|
||||||
|
})),
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ async function handleUpdateLocation(c: Context<Env>) {
|
|||||||
const user = c.get("user")!
|
const user = c.get("user")!
|
||||||
const sessionManager = c.get("sessionManager")
|
const sessionManager = c.get("sessionManager")
|
||||||
const session = sessionManager.getOrCreate(user.id)
|
const session = sessionManager.getOrCreate(user.id)
|
||||||
await session.engine.executeAction("aris.location", "update-location", {
|
await session.engine.executeAction("aelis.location", "update-location", {
|
||||||
lat: result.lat,
|
lat: result.lat,
|
||||||
lng: result.lng,
|
lng: result.lng,
|
||||||
accuracy: result.accuracy,
|
accuracy: result.accuracy,
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
import { LocationSource } from "@aris/source-location"
|
import { LocationSource } from "@aelis/source-location"
|
||||||
import { Hono } from "hono"
|
import { Hono } from "hono"
|
||||||
|
|
||||||
import { registerAuthHandlers } from "./auth/http.ts"
|
import { registerAuthHandlers } from "./auth/http.ts"
|
||||||
|
import { requireSession } from "./auth/session-middleware.ts"
|
||||||
|
import { registerFeedHttpHandlers } from "./feed/http.ts"
|
||||||
import { registerLocationHttpHandlers } from "./location/http.ts"
|
import { registerLocationHttpHandlers } from "./location/http.ts"
|
||||||
import { UserSessionManager } from "./session/index.ts"
|
import { UserSessionManager } from "./session/index.ts"
|
||||||
import { WeatherSourceProvider } from "./weather/provider.ts"
|
import { WeatherSourceProvider } from "./weather/provider.ts"
|
||||||
@@ -24,6 +26,7 @@ function main() {
|
|||||||
app.get("/health", (c) => c.json({ status: "ok" }))
|
app.get("/health", (c) => c.json({ status: "ok" }))
|
||||||
|
|
||||||
registerAuthHandlers(app)
|
registerAuthHandlers(app)
|
||||||
|
registerFeedHttpHandlers(app, { sessionManager, authSessionMiddleware: requireSession })
|
||||||
registerLocationHttpHandlers(app, { sessionManager })
|
registerLocationHttpHandlers(app, { sessionManager })
|
||||||
|
|
||||||
return app
|
return app
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FeedSource } from "@aris/core"
|
import type { FeedSource } from "@aelis/core"
|
||||||
|
|
||||||
export interface FeedSourceProvider {
|
export interface FeedSourceProvider {
|
||||||
feedSourceForUser(userId: string): FeedSource
|
feedSourceForUser(userId: string): FeedSource
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { WeatherKitClient, WeatherKitResponse } from "@aris/source-weatherkit"
|
import type { WeatherKitClient, WeatherKitResponse } from "@aelis/source-weatherkit"
|
||||||
|
|
||||||
import { LocationSource } from "@aris/source-location"
|
import { LocationSource } from "@aelis/source-location"
|
||||||
import { describe, expect, mock, test } from "bun:test"
|
import { describe, expect, mock, test } from "bun:test"
|
||||||
|
|
||||||
import { WeatherSourceProvider } from "../weather/provider.ts"
|
import { WeatherSourceProvider } from "../weather/provider.ts"
|
||||||
@@ -44,8 +44,8 @@ describe("UserSessionManager", () => {
|
|||||||
const session1 = manager.getOrCreate("user-1")
|
const session1 = manager.getOrCreate("user-1")
|
||||||
const session2 = manager.getOrCreate("user-2")
|
const session2 = manager.getOrCreate("user-2")
|
||||||
|
|
||||||
const source1 = session1.getSource<LocationSource>("aris.location")
|
const source1 = session1.getSource<LocationSource>("aelis.location")
|
||||||
const source2 = session2.getSource<LocationSource>("aris.location")
|
const source2 = session2.getSource<LocationSource>("aelis.location")
|
||||||
|
|
||||||
expect(source1).not.toBe(source2)
|
expect(source1).not.toBe(source2)
|
||||||
})
|
})
|
||||||
@@ -81,7 +81,7 @@ describe("UserSessionManager", () => {
|
|||||||
|
|
||||||
const session = manager.getOrCreate("user-1")
|
const session = manager.getOrCreate("user-1")
|
||||||
|
|
||||||
expect(session.getSource("aris.weather")).toBeDefined()
|
expect(session.getSource("aelis.weather")).toBeDefined()
|
||||||
})
|
})
|
||||||
|
|
||||||
test("accepts mixed providers", () => {
|
test("accepts mixed providers", () => {
|
||||||
@@ -90,8 +90,8 @@ describe("UserSessionManager", () => {
|
|||||||
|
|
||||||
const session = manager.getOrCreate("user-1")
|
const session = manager.getOrCreate("user-1")
|
||||||
|
|
||||||
expect(session.getSource("aris.location")).toBeDefined()
|
expect(session.getSource("aelis.location")).toBeDefined()
|
||||||
expect(session.getSource("aris.weather")).toBeDefined()
|
expect(session.getSource("aelis.weather")).toBeDefined()
|
||||||
})
|
})
|
||||||
|
|
||||||
test("refresh returns feed result through session", async () => {
|
test("refresh returns feed result through session", async () => {
|
||||||
@@ -110,14 +110,14 @@ describe("UserSessionManager", () => {
|
|||||||
const manager = new UserSessionManager([() => new LocationSource()])
|
const manager = new UserSessionManager([() => new LocationSource()])
|
||||||
|
|
||||||
const session = manager.getOrCreate("user-1")
|
const session = manager.getOrCreate("user-1")
|
||||||
await session.engine.executeAction("aris.location", "update-location", {
|
await session.engine.executeAction("aelis.location", "update-location", {
|
||||||
lat: 51.5074,
|
lat: 51.5074,
|
||||||
lng: -0.1278,
|
lng: -0.1278,
|
||||||
accuracy: 10,
|
accuracy: 10,
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const source = session.getSource<LocationSource>("aris.location")
|
const source = session.getSource<LocationSource>("aelis.location")
|
||||||
expect(source?.lastLocation?.lat).toBe(51.5074)
|
expect(source?.lastLocation?.lat).toBe(51.5074)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ describe("UserSessionManager", () => {
|
|||||||
const session = manager.getOrCreate("user-1")
|
const session = manager.getOrCreate("user-1")
|
||||||
session.engine.subscribe(callback)
|
session.engine.subscribe(callback)
|
||||||
|
|
||||||
await session.engine.executeAction("aris.location", "update-location", {
|
await session.engine.executeAction("aelis.location", "update-location", {
|
||||||
lat: 51.5074,
|
lat: 51.5074,
|
||||||
lng: -0.1278,
|
lng: -0.1278,
|
||||||
accuracy: 10,
|
accuracy: 10,
|
||||||
@@ -152,7 +152,7 @@ describe("UserSessionManager", () => {
|
|||||||
|
|
||||||
// Create new session and push location — old callback should not fire
|
// Create new session and push location — old callback should not fire
|
||||||
const session2 = manager.getOrCreate("user-1")
|
const session2 = manager.getOrCreate("user-1")
|
||||||
await session2.engine.executeAction("aris.location", "update-location", {
|
await session2.engine.executeAction("aelis.location", "update-location", {
|
||||||
lat: 51.5074,
|
lat: 51.5074,
|
||||||
lng: -0.1278,
|
lng: -0.1278,
|
||||||
accuracy: 10,
|
accuracy: 10,
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { ActionDefinition, Context, FeedSource } from "@aris/core"
|
import type { ActionDefinition, ContextEntry, FeedSource } from "@aelis/core"
|
||||||
|
|
||||||
import { LocationSource } from "@aris/source-location"
|
import { LocationSource } from "@aelis/source-location"
|
||||||
import { describe, expect, test } from "bun:test"
|
import { describe, expect, test } from "bun:test"
|
||||||
|
|
||||||
import { UserSession } from "./user-session.ts"
|
import { UserSession } from "./user-session.ts"
|
||||||
@@ -14,7 +14,7 @@ function createStubSource(id: string): FeedSource {
|
|||||||
async executeAction(): Promise<unknown> {
|
async executeAction(): Promise<unknown> {
|
||||||
return undefined
|
return undefined
|
||||||
},
|
},
|
||||||
async fetchContext(): Promise<Partial<Context> | null> {
|
async fetchContext(): Promise<readonly ContextEntry[] | null> {
|
||||||
return null
|
return null
|
||||||
},
|
},
|
||||||
async fetchItems() {
|
async fetchItems() {
|
||||||
@@ -36,7 +36,7 @@ describe("UserSession", () => {
|
|||||||
const location = new LocationSource()
|
const location = new LocationSource()
|
||||||
const session = new UserSession([location])
|
const session = new UserSession([location])
|
||||||
|
|
||||||
const result = session.getSource<LocationSource>("aris.location")
|
const result = session.getSource<LocationSource>("aelis.location")
|
||||||
|
|
||||||
expect(result).toBe(location)
|
expect(result).toBe(location)
|
||||||
})
|
})
|
||||||
@@ -59,7 +59,7 @@ describe("UserSession", () => {
|
|||||||
const location = new LocationSource()
|
const location = new LocationSource()
|
||||||
const session = new UserSession([location])
|
const session = new UserSession([location])
|
||||||
|
|
||||||
await session.engine.executeAction("aris.location", "update-location", {
|
await session.engine.executeAction("aelis.location", "update-location", {
|
||||||
lat: 51.5,
|
lat: 51.5,
|
||||||
lng: -0.1,
|
lng: -0.1,
|
||||||
accuracy: 10,
|
accuracy: 10,
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FeedEngine, type FeedSource } from "@aris/core"
|
import { FeedEngine, type FeedSource } from "@aelis/core"
|
||||||
|
|
||||||
export class UserSession {
|
export class UserSession {
|
||||||
readonly engine: FeedEngine
|
readonly engine: FeedEngine
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { TflSource, type ITflApi } from "@aris/source-tfl"
|
import { TflSource, type ITflApi } from "@aelis/source-tfl"
|
||||||
|
|
||||||
import type { FeedSourceProvider } from "../session/feed-source-provider.ts"
|
import type { FeedSourceProvider } from "../session/feed-source-provider.ts"
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { WeatherSource, type WeatherSourceOptions } from "@aris/source-weatherkit"
|
import { WeatherSource, type WeatherSourceOptions } from "@aelis/source-weatherkit"
|
||||||
|
|
||||||
import type { FeedSourceProvider } from "../session/feed-source-provider.ts"
|
import type { FeedSourceProvider } from "../session/feed-source-provider.ts"
|
||||||
|
|
||||||
152
apps/aelis-client/app.json
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
{
|
||||||
|
"expo": {
|
||||||
|
"name": "Aelis",
|
||||||
|
"slug": "aelis-client",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"icon": "./assets/images/icon.png",
|
||||||
|
"scheme": "aelis",
|
||||||
|
"userInterfaceStyle": "automatic",
|
||||||
|
"newArchEnabled": true,
|
||||||
|
"ios": {
|
||||||
|
"infoPlist": {
|
||||||
|
"NSAppTransportSecurity": {
|
||||||
|
"NSAllowsArbitraryLoads": true
|
||||||
|
},
|
||||||
|
"ITSAppUsesNonExemptEncryption": false
|
||||||
|
},
|
||||||
|
"bundleIdentifier": "sh.nym.aelis"
|
||||||
|
},
|
||||||
|
"android": {
|
||||||
|
"adaptiveIcon": {
|
||||||
|
"backgroundColor": "#E6F4FE",
|
||||||
|
"foregroundImage": "./assets/images/android-icon-foreground.png",
|
||||||
|
"backgroundImage": "./assets/images/android-icon-background.png",
|
||||||
|
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
||||||
|
},
|
||||||
|
"edgeToEdgeEnabled": true,
|
||||||
|
"predictiveBackGestureEnabled": false,
|
||||||
|
"package": "sh.nym.aelis"
|
||||||
|
},
|
||||||
|
"web": {
|
||||||
|
"output": "static",
|
||||||
|
"favicon": "./assets/images/favicon.png"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"expo-router",
|
||||||
|
[
|
||||||
|
"expo-splash-screen",
|
||||||
|
{
|
||||||
|
"image": "./assets/images/splash-icon.png",
|
||||||
|
"imageWidth": 200,
|
||||||
|
"resizeMode": "contain",
|
||||||
|
"backgroundColor": "#ffffff",
|
||||||
|
"dark": {
|
||||||
|
"backgroundColor": "#000000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"expo-font",
|
||||||
|
{
|
||||||
|
"android": {
|
||||||
|
"fonts": [
|
||||||
|
{
|
||||||
|
"fontFamily": "Inter",
|
||||||
|
"fontDefinitions": [
|
||||||
|
{ "path": "./assets/fonts/Inter_100Thin.ttf", "weight": 100 },
|
||||||
|
{ "path": "./assets/fonts/Inter_100Thin_Italic.ttf", "weight": 100, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_200ExtraLight.ttf", "weight": 200 },
|
||||||
|
{ "path": "./assets/fonts/Inter_200ExtraLight_Italic.ttf", "weight": 200, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_300Light.ttf", "weight": 300 },
|
||||||
|
{ "path": "./assets/fonts/Inter_300Light_Italic.ttf", "weight": 300, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_400Regular.ttf", "weight": 400 },
|
||||||
|
{ "path": "./assets/fonts/Inter_400Regular_Italic.ttf", "weight": 400, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_500Medium.ttf", "weight": 500 },
|
||||||
|
{ "path": "./assets/fonts/Inter_500Medium_Italic.ttf", "weight": 500, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_600SemiBold.ttf", "weight": 600 },
|
||||||
|
{ "path": "./assets/fonts/Inter_600SemiBold_Italic.ttf", "weight": 600, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_700Bold.ttf", "weight": 700 },
|
||||||
|
{ "path": "./assets/fonts/Inter_700Bold_Italic.ttf", "weight": 700, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_800ExtraBold.ttf", "weight": 800 },
|
||||||
|
{ "path": "./assets/fonts/Inter_800ExtraBold_Italic.ttf", "weight": 800, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/Inter_900Black.ttf", "weight": 900 },
|
||||||
|
{ "path": "./assets/fonts/Inter_900Black_Italic.ttf", "weight": 900, "style": "italic" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fontFamily": "Source Serif 4",
|
||||||
|
"fontDefinitions": [
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_200ExtraLight.ttf", "weight": 200 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_200ExtraLight_Italic.ttf", "weight": 200, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_300Light.ttf", "weight": 300 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_300Light_Italic.ttf", "weight": 300, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_400Regular.ttf", "weight": 400 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_400Regular_Italic.ttf", "weight": 400, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_500Medium.ttf", "weight": 500 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_500Medium_Italic.ttf", "weight": 500, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_600SemiBold.ttf", "weight": 600 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_600SemiBold_Italic.ttf", "weight": 600, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_700Bold.ttf", "weight": 700 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_700Bold_Italic.ttf", "weight": 700, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_800ExtraBold.ttf", "weight": 800 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_800ExtraBold_Italic.ttf", "weight": 800, "style": "italic" },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_900Black.ttf", "weight": 900 },
|
||||||
|
{ "path": "./assets/fonts/SourceSerif4_900Black_Italic.ttf", "weight": 900, "style": "italic" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"fonts": [
|
||||||
|
"./assets/fonts/Inter_100Thin.ttf",
|
||||||
|
"./assets/fonts/Inter_100Thin_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_200ExtraLight.ttf",
|
||||||
|
"./assets/fonts/Inter_200ExtraLight_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_300Light.ttf",
|
||||||
|
"./assets/fonts/Inter_300Light_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_400Regular.ttf",
|
||||||
|
"./assets/fonts/Inter_400Regular_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_500Medium.ttf",
|
||||||
|
"./assets/fonts/Inter_500Medium_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_600SemiBold.ttf",
|
||||||
|
"./assets/fonts/Inter_600SemiBold_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_700Bold.ttf",
|
||||||
|
"./assets/fonts/Inter_700Bold_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_800ExtraBold.ttf",
|
||||||
|
"./assets/fonts/Inter_800ExtraBold_Italic.ttf",
|
||||||
|
"./assets/fonts/Inter_900Black.ttf",
|
||||||
|
"./assets/fonts/Inter_900Black_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_200ExtraLight.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_200ExtraLight_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_300Light.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_300Light_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_400Regular.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_400Regular_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_500Medium.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_500Medium_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_600SemiBold.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_600SemiBold_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_700Bold.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_700Bold_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_800ExtraBold.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_800ExtraBold_Italic.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_900Black.ttf",
|
||||||
|
"./assets/fonts/SourceSerif4_900Black_Italic.ttf"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"experiments": {
|
||||||
|
"typedRoutes": true,
|
||||||
|
"reactCompiler": true
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"router": {},
|
||||||
|
"eas": {
|
||||||
|
"projectId": "61092d23-36aa-418e-929d-ea40dc912e8f"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
apps/aelis-client/assets/fonts/Inter_100Thin.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_100Thin_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_200ExtraLight.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_200ExtraLight_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_300Light.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_300Light_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_400Regular.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_400Regular_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_500Medium.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_500Medium_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_600SemiBold.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_600SemiBold_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_700Bold.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_700Bold_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_800ExtraBold.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_800ExtraBold_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_900Black.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/Inter_900Black_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_200ExtraLight.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_300Light.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_300Light_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_400Regular.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_500Medium.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_500Medium_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_600SemiBold.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_700Bold.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_700Bold_Italic.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_800ExtraBold.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_900Black.ttf
Normal file
BIN
apps/aelis-client/assets/fonts/SourceSerif4_900Black_Italic.ttf
Normal file
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 384 KiB After Width: | Height: | Size: 384 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@@ -8,6 +8,12 @@
|
|||||||
"developmentClient": true,
|
"developmentClient": true,
|
||||||
"distribution": "internal"
|
"distribution": "internal"
|
||||||
},
|
},
|
||||||
|
"development-simulator": {
|
||||||
|
"extends": "development",
|
||||||
|
"ios": {
|
||||||
|
"simulator": "true"
|
||||||
|
}
|
||||||
|
},
|
||||||
"preview": {
|
"preview": {
|
||||||
"distribution": "internal"
|
"distribution": "internal"
|
||||||
},
|
},
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "aris-client",
|
"name": "aelis-client",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "expo-router/entry",
|
"main": "expo-router/entry",
|
||||||
@@ -11,10 +11,12 @@
|
|||||||
"web": "expo start --web",
|
"web": "expo start --web",
|
||||||
"lint": "expo lint",
|
"lint": "expo lint",
|
||||||
"build:ios": "eas build --profile development --platform ios --non-interactive",
|
"build:ios": "eas build --profile development --platform ios --non-interactive",
|
||||||
|
"build:ios-simulator": "eas build --profile development-simulator --platform ios --non-interactive",
|
||||||
"debugger": "bun run scripts/open-debugger.ts"
|
"debugger": "bun run scripts/open-debugger.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo-google-fonts/inter": "^0.4.2",
|
"@expo-google-fonts/inter": "^0.4.2",
|
||||||
|
"@expo-google-fonts/source-serif-4": "^0.4.1",
|
||||||
"@expo/vector-icons": "^15.0.3",
|
"@expo/vector-icons": "^15.0.3",
|
||||||
"@react-navigation/bottom-tabs": "^7.4.0",
|
"@react-navigation/bottom-tabs": "^7.4.0",
|
||||||
"@react-navigation/elements": "^2.6.3",
|
"@react-navigation/elements": "^2.6.3",
|
||||||