KQ-2087 · REPLAN/DIFF
Replan Diff
The moment an agent revises its plan mid-run, shown as a diff of the old plan and the new: completed steps stay locked, a weighted longest common subsequence picks out the steps that moved, dropped steps stay where they were as struck ghosts, new steps are marked, and every change carries the agent's one-line reason while the run waits paused for review. When first seen it shows the old plan for a beat, then kept steps glide to their new places on springs.glide (motion layout over a stable DOM order), a strike sweeps across each dropped title on glide before it fades, and new steps slide in with their badges landing on springs.snap, all on one cascade; a revert replays the same physics for that step. Up and Down walk the changes, Enter opens one with Revert and Ask why, R reverts or restores it, and under 34rem the old plan hides behind a toggle.
Gaugeworks agent · revision 2
Vendor table cleanup
- 1Profile the vendor table
- 2Find duplicate vendor keys
- 3Merge duplicates by tax ID→ 4
- 4Backfill missing countries→ 6
- 5Archive idle vendors
- 6Send the cleanup report→ 5
Old plan
- 1Profile the vendor table
- 2Find duplicate vendor keys
- 3Merge duplicates by tax ID→ 4
- 4Backfill missing countries→ 6
- 5Archive idle vendors
- 6Send the cleanup report→ 5
Up and Down walk the changes. Enter opens a change, R reverts it.
- Profile the vendor table
- Find duplicate vendor keys
- Merge duplicates by tax ID
- 4Backfill missing countries
paused for review · 3 changes · gaugeworks cleanup
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/replan-diff
Props
- diffStyle
- "tint" | "gutter" | "ledger"
- default "tint"
- How changes are marked: washed rows with badges, a coloured +/−/↕ gutter with an edge bar, or a ledger of hairline rows with old → new positions.
- reasonPlacement
- "below" | "side" | "toggle"
- default "below"
- Where the agent's reasons sit: under each change, in a column beside the list on wide containers (under it when narrow), or hidden until a change is opened.
- accent
- string
- default "var(--accent-bright)"
- New-step marks, the open change's ring and Accept — any CSS colour.
- before
- ReplanStep[]
- default defaultReplanBefore
- The plan before the agent changed its mind: id, title and an optional minutes estimate per step.
- after
- ReplanStep[]
- default defaultReplanAfter
- The plan it wants to run now.
- reasons
- Record<string, string>
- default defaultReplanReasons
- The agent's one-line reason for each changed step, by step id.
- completed
- string[]
- default ["profile", "find-dupes"]
- Steps already finished; drawn with a check and locked at the top.
- current
- string
- default "merge"
- The step that was running when the agent replanned; drawn paused while the plan is under review.
- reviewing / defaultReviewing
- boolean
- default — / true
- Whether the run is paused until the new plan is accepted, controlled or initial.
- reverted / defaultReverted
- string[]
- default — / []
- Change ids sent back to the old plan, controlled or initial.
- onRevertStep
- (id: string, reverted: boolean) => void
- default —
- Fires from the key or button that reverted a change or put it back.
- onAcceptReplan
- (plan: ReplanStep[]) => void
- default —
- Accept was pressed: the plan that will run, with reverts applied.
- onAskWhy
- (id: string) => void
- default —
- Ask why was pressed on a change.
- intro
- boolean
- default true
- Show the old plan for a beat when the surface is first seen, then play the change.
- agent
- string
- default "Gaugeworks agent"
- Who replanned, shown above the title.
- title
- string
- default "Vendor table cleanup"
- The run's name; also the surface's accessible name.
- status
- "ready" | "loading" | "error"
- default "ready"
- Whether the plans have arrived: loading draws placeholder rows, error offers Try again. Identical plans show the no-change state.
- onRetry
- () => void
- default —
- Try again was pressed after the plans failed to load.
- disabled
- boolean
- default false
- Read only: nothing can be reverted, asked or accepted.
- className
- string
- default —
- Classes for the outer surface.
| Prop | Type | Default | Description |
|---|---|---|---|
| diffStyle | "tint" | "gutter" | "ledger" | "tint" | How changes are marked: washed rows with badges, a coloured +/−/↕ gutter with an edge bar, or a ledger of hairline rows with old → new positions. |
| reasonPlacement | "below" | "side" | "toggle" | "below" | Where the agent's reasons sit: under each change, in a column beside the list on wide containers (under it when narrow), or hidden until a change is opened. |
| accent | string | "var(--accent-bright)" | New-step marks, the open change's ring and Accept — any CSS colour. |
| before | ReplanStep[] | defaultReplanBefore | The plan before the agent changed its mind: id, title and an optional minutes estimate per step. |
| after | ReplanStep[] | defaultReplanAfter | The plan it wants to run now. |
| reasons | Record<string, string> | defaultReplanReasons | The agent's one-line reason for each changed step, by step id. |
| completed | string[] | ["profile", "find-dupes"] | Steps already finished; drawn with a check and locked at the top. |
| current | string | "merge" | The step that was running when the agent replanned; drawn paused while the plan is under review. |
| reviewing / defaultReviewing | boolean | — / true | Whether the run is paused until the new plan is accepted, controlled or initial. |
| reverted / defaultReverted | string[] | — / [] | Change ids sent back to the old plan, controlled or initial. |
| onRevertStep | (id: string, reverted: boolean) => void | — | Fires from the key or button that reverted a change or put it back. |
| onAcceptReplan | (plan: ReplanStep[]) => void | — | Accept was pressed: the plan that will run, with reverts applied. |
| onAskWhy | (id: string) => void | — | Ask why was pressed on a change. |
| intro | boolean | true | Show the old plan for a beat when the surface is first seen, then play the change. |
| agent | string | "Gaugeworks agent" | Who replanned, shown above the title. |
| title | string | "Vendor table cleanup" | The run's name; also the surface's accessible name. |
| status | "ready" | "loading" | "error" | "ready" | Whether the plans have arrived: loading draws placeholder rows, error offers Try again. Identical plans show the no-change state. |
| onRetry | () => void | — | Try again was pressed after the plans failed to load. |
| disabled | boolean | false | Read only: nothing can be reverted, asked or accepted. |
| className | string | — | Classes for the outer surface. |