mirror of
https://github.com/kennethnym/aris.git
synced 2026-06-16 12:31:17 +01:00
feat: add agent query API (#130)
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { FeedEngine, type FeedItem, type FeedResult, type FeedSource } from "@freya/core"
|
||||
import {
|
||||
FeedEngine,
|
||||
type ActionDefinition,
|
||||
type FeedItem,
|
||||
type FeedResult,
|
||||
type FeedSource,
|
||||
} from "@freya/core"
|
||||
|
||||
import type { FeedEnhancer } from "../enhancement/enhance-feed.ts"
|
||||
|
||||
@@ -73,6 +79,21 @@ export class UserSession {
|
||||
return this.sources.has(sourceId)
|
||||
}
|
||||
|
||||
async listActions(): Promise<
|
||||
Array<{ sourceId: string; actions: Record<string, ActionDefinition> }>
|
||||
> {
|
||||
const result: Array<{ sourceId: string; actions: Record<string, ActionDefinition> }> = []
|
||||
|
||||
for (const [sourceId, source] of this.sources) {
|
||||
result.push({
|
||||
sourceId,
|
||||
actions: await source.listActions(),
|
||||
})
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new source in the engine and invalidates all caches.
|
||||
* Stops and restarts the engine to establish reactive subscriptions.
|
||||
|
||||
Reference in New Issue
Block a user