feat(tui): refresh agents after update events
This commit is contained in:
parent
4ce830a919
commit
02cb350880
17 changed files with 576 additions and 30 deletions
|
|
@ -1,12 +1,15 @@
|
|||
export * as Agent from "./agent"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { define, inventory } from "./event"
|
||||
import { optional } from "./schema"
|
||||
import { Model } from "./model"
|
||||
import { Permission } from "./permission"
|
||||
import { Provider } from "./provider"
|
||||
import { PositiveInt, statics } from "./schema"
|
||||
|
||||
const Updated = define({ type: "agent.updated", schema: {} })
|
||||
|
||||
export const ID = Schema.String.pipe(Schema.brand("AgentV2.ID"))
|
||||
export type ID = typeof ID.Type
|
||||
|
||||
|
|
@ -33,6 +36,20 @@ export const Info = Schema.Struct({
|
|||
.pipe(
|
||||
statics((schema) => ({
|
||||
empty: (id: ID) =>
|
||||
schema.make({ id, request: { headers: {}, body: {} }, mode: "all", hidden: false, permissions: [] }),
|
||||
schema.make({
|
||||
id,
|
||||
request: { headers: {}, body: {} },
|
||||
mode: "all",
|
||||
hidden: false,
|
||||
permissions: [
|
||||
{ action: "*", resource: "*", effect: "allow" },
|
||||
{ action: "external_directory", resource: "*", effect: "ask" },
|
||||
],
|
||||
}),
|
||||
})),
|
||||
)
|
||||
|
||||
export const Event = {
|
||||
Updated,
|
||||
Definitions: inventory(Updated),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
export * as EventManifest from "./event-manifest"
|
||||
|
||||
import { Agent } from "./agent"
|
||||
import { Catalog } from "./catalog"
|
||||
import { Durable } from "./durable-event-manifest"
|
||||
import { Event } from "./event"
|
||||
|
|
@ -41,6 +42,7 @@ const foundationDefinitions = Event.inventory(
|
|||
...ModelsDev.Event.Definitions,
|
||||
...Integration.Event.Definitions,
|
||||
...Catalog.Event.Definitions,
|
||||
...Agent.Event.Definitions,
|
||||
...coreDefinitions,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue