refactor: remove todo tool (#35989)
This commit is contained in:
parent
d4155f2906
commit
7feefb697f
250 changed files with 237 additions and 4755 deletions
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
## Module Shape
|
||||
|
||||
- Use one canonical exported value for each contract. Avoid bridge aliases such as `PluginID`, `PluginEvent`, `PtyInfo`, `PtyEvent`, and `SessionTodoInfo`.
|
||||
- Prefer importing the schema module namespace and reading canonical members, for example `Plugin.ID` or `SessionTodo.Info`.
|
||||
- Use one canonical exported value for each contract. Avoid bridge aliases such as `PluginID`, `PluginEvent`, `PtyInfo`, and `PtyEvent`.
|
||||
- Prefer importing the schema module namespace and reading canonical members, for example `Plugin.ID` or `Question.Info`.
|
||||
- Core may compose Schema contracts with runtime behavior into a deliberate domain facade, but the facade must re-export the exact canonical Schema value. Do not create a second schema identity.
|
||||
- Use flat top-level exports plus the package's existing namespace projection pattern, for example `export * as SessionMessage from "./session-message"`.
|
||||
- Keep standalone ID modules only when they prevent real cycles or heavy dependency edges. Inline one-off IDs into their owning contract module when no cycle exists.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import { Skill } from "./skill.js"
|
|||
import { SessionCompactionEvent } from "./session-compaction-event.js"
|
||||
import { SessionEvent } from "./session-event.js"
|
||||
import { SessionStatusEvent } from "./session-status-event.js"
|
||||
import { SessionTodo } from "./session-todo.js"
|
||||
import { SessionV1 } from "./session-v1.js"
|
||||
import { TuiEvent } from "./tui-event.js"
|
||||
import { VcsEvent } from "./vcs-event.js"
|
||||
|
|
@ -73,7 +72,6 @@ const featureDefinitions = Event.inventory(
|
|||
export const ServerDefinitions = Event.inventory(
|
||||
...foundationDefinitions,
|
||||
...featureDefinitions,
|
||||
...SessionTodo.Event.Definitions,
|
||||
// Current events the TUI consumes from the public stream.
|
||||
...SessionStatusEvent.Definitions,
|
||||
...TuiEvent.Definitions,
|
||||
|
|
@ -97,7 +95,6 @@ export const Definitions = Event.inventory(
|
|||
...sessionV1LiveDefinitions,
|
||||
...InstallationEvent.Definitions,
|
||||
...featureDefinitions,
|
||||
...SessionTodo.Event.Definitions,
|
||||
...LspEvent.Definitions,
|
||||
...PermissionV1.Event.Definitions,
|
||||
...TuiEvent.Definitions,
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
export * as SessionTodo from "./session-todo.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { ephemeral, inventory } from "./event.js"
|
||||
import { SessionID } from "./session-id.js"
|
||||
|
||||
export const Info = Schema.Struct({
|
||||
content: Schema.String.annotate({ description: "Brief description of the task" }),
|
||||
status: Schema.String.annotate({
|
||||
description: "Current status of the task: pending, in_progress, completed, cancelled",
|
||||
}),
|
||||
priority: Schema.String.annotate({
|
||||
description: "Priority level of the task: high, medium, low",
|
||||
}),
|
||||
}).annotate({ identifier: "Todo" })
|
||||
export interface Info extends Schema.Schema.Type<typeof Info> {}
|
||||
|
||||
const Updated = ephemeral({
|
||||
type: "todo.updated",
|
||||
schema: {
|
||||
sessionID: SessionID,
|
||||
todos: Schema.Array(Info),
|
||||
},
|
||||
})
|
||||
export const Event = { Updated, Definitions: inventory(Updated) }
|
||||
|
|
@ -16,7 +16,6 @@ import { Money } from "../src/money.js"
|
|||
import { Skill } from "../src/skill.js"
|
||||
import { Shell } from "../src/shell.js"
|
||||
import { PersistedRevert } from "../src/session-revert.js"
|
||||
import { SessionTodo } from "../src/session-todo.js"
|
||||
import { optional } from "../src/schema.js"
|
||||
|
||||
describe("contract hygiene", () => {
|
||||
|
|
@ -61,15 +60,6 @@ describe("contract hygiene", () => {
|
|||
).toThrow()
|
||||
})
|
||||
|
||||
test("todo status and priority preserve arbitrary strings", () => {
|
||||
const decode = Schema.decodeUnknownSync(SessionTodo.Info)
|
||||
expect(decode({ content: "ship", status: "waiting", priority: "urgent" })).toEqual({
|
||||
content: "ship",
|
||||
status: "waiting",
|
||||
priority: "urgent",
|
||||
})
|
||||
})
|
||||
|
||||
test("current ID constructors expose create", () => {
|
||||
expect(Question.ID.create()).toStartWith("que_")
|
||||
expect(Pty.ID.create()).toStartWith("pty_")
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import { Plugin } from "../src/plugin.js"
|
|||
import { SessionEvent } from "../src/session-event.js"
|
||||
import { SessionID } from "../src/session-id.js"
|
||||
import { SessionMessage } from "../src/session-message.js"
|
||||
import { SessionTodo } from "../src/session-todo.js"
|
||||
import { SessionV1 } from "../src/session-v1.js"
|
||||
import { WorkspaceEvent } from "../src/workspace-event.js"
|
||||
|
||||
|
|
@ -64,7 +63,6 @@ describe("public event manifest", () => {
|
|||
expect(Workspace.Event).toBe(WorkspaceEvent)
|
||||
expect(Workspace.Event.Definitions).toBe(WorkspaceEvent.Definitions)
|
||||
expect(EventManifest.Latest.get("session.step.ended")).toBe(SessionEvent.Step.Ended)
|
||||
expect(EventManifest.Latest.get("todo.updated")).toBe(SessionTodo.Event.Updated)
|
||||
expect(EventManifest.Latest.get("agent.updated")).toBe(Agent.Event.Updated)
|
||||
expect(EventManifest.Latest.get("project.updated")).toBe(Project.Event.Updated)
|
||||
expect(Agent.Event.Definitions).toEqual([Agent.Event.Updated])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue