feat(core): reload config on filesystem changes

This commit is contained in:
Dax Raad 2026-07-03 20:34:29 -04:00
commit c9b24ef027
48 changed files with 596 additions and 510 deletions

View file

@ -0,0 +1,10 @@
export * as Config from "./config.js"
import { ephemeral, inventory } from "./event.js"
const Updated = ephemeral({
type: "config.updated",
schema: {},
})
export const Event = { Updated, Definitions: inventory(Updated) }

View file

@ -3,10 +3,11 @@ export * as EventManifest from "./event-manifest.js"
import { Agent } from "./agent.js"
import { Catalog } from "./catalog.js"
import { Command } from "./command.js"
import { Config } from "./config.js"
import { Durable } from "./durable-event-manifest.js"
import { Event } from "./event.js"
import { FileSystem } from "./filesystem.js"
import { FileSystemWatcher } from "./filesystem-watcher.js"
import { FileSystemV1 } from "./filesystem-v1.js"
import { Form } from "./form.js"
import { InstallationEvent } from "./installation-event.js"
import { Integration } from "./integration.js"
@ -60,8 +61,8 @@ const featureDefinitions = Event.inventory(
...Plugin.Event.Definitions,
...ProjectDirectories.Event.Definitions,
...Command.Event.Definitions,
...Config.Event.Definitions,
...Skill.Event.Definitions,
...FileSystemWatcher.Event.Definitions,
...Pty.Event.Definitions,
...Shell.Event.Definitions,
...Question.Event.Definitions,
@ -97,6 +98,7 @@ export const Definitions = Event.inventory(
...TuiEvent.Definitions,
...McpEvent.Definitions,
...LegacyEvent.Definitions,
...FileSystemV1.Event.Definitions,
...Project.Event.Definitions,
...SessionStatusEvent.Definitions,
...QuestionV1.Event.Definitions,

View file

@ -0,0 +1 @@
export * from "./v1/filesystem.js"

View file

@ -1,13 +0,0 @@
export * as FileSystemWatcher from "./filesystem-watcher.js"
import { Schema } from "effect"
import { ephemeral, inventory } from "./event.js"
const Updated = ephemeral({
type: "file.watcher.updated",
schema: {
file: Schema.String,
event: Schema.Literals(["add", "change", "unlink"]),
},
})
export const Event = { Updated, Definitions: inventory(Updated) }

View file

@ -5,11 +5,14 @@ import { optional } from "./schema.js"
import { ephemeral, inventory } from "./event.js"
import { NonNegativeInt, PositiveInt, RelativePath } from "./schema.js"
const Edited = ephemeral({
type: "file.edited",
schema: { file: Schema.String },
const Changed = ephemeral({
type: "filesystem.changed",
schema: {
file: Schema.String,
event: Schema.Literals(["add", "change", "unlink"]),
},
})
export const Event = { Edited, Definitions: inventory(Edited) }
export const Event = { Changed, Definitions: inventory(Changed) }
export interface Entry extends Schema.Schema.Type<typeof Entry> {}
export const Entry = Schema.Struct({

View file

@ -1,5 +1,6 @@
export { Agent } from "./agent.js"
export { Command } from "./command.js"
export { Config } from "./config.js"
export { Connection } from "./connection.js"
export { Credential } from "./credential.js"
export { Event } from "./event.js"

View file

@ -0,0 +1,11 @@
export * as FileSystemV1 from "./filesystem.js"
import { Schema } from "effect"
import { ephemeral, inventory } from "../event.js"
const Edited = ephemeral({
type: "file.edited",
schema: { file: Schema.String },
})
export const Event = { Edited, Definitions: inventory(Edited) }