Skip to content

Interactor examples - #3

Open
Hassan-Kittany wants to merge 62 commits into
mainfrom
interactor-examples
Open

Interactor examples#3
Hassan-Kittany wants to merge 62 commits into
mainfrom
interactor-examples

Conversation

@Hassan-Kittany

Copy link
Copy Markdown

No description provided.

hassankettany and others added 30 commits June 29, 2026 12:36
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… option-aware self-check, robust html extraction

- apply/discard endpoints now process each path independently and always return 200 with {results:[{path,ok,error?}]}
- app.js applyOrDiscard only clears state.drafts for ok:true paths, reports failures in fixStatus
- /api/fix reads each path defensively, collecting readFailures separately, never aborts whole batch
- fixFile clean check now respects optionIds: convertCustomEffect/removeExtraJs requested but still present => needsReview
- extractHtml regex changed from anchored to non-anchored, extracts first fenced block even with surrounding prose
- Added 4 new tests (server partial batch, fix option-aware needsReview, agent prose-fence, agent no-fence trim)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the @wix/interact Agent SDK call with a spawn of the local
`claude -p --output-format json` CLI (reuses `claude login`, no API key),
matching the proven interact-xp playground pattern. Parse the result from
the message array. Verified end-to-end live (1.79.0 -> 2.4.0 rewrite).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Minimal, tight visual system: SF system font, neutral grays + single blue
accent, translucent app bar, segmented tabs, status dots, restyled checkboxes,
stat chips, thin scrollbars. Add a file filter box and full HTML escaping in
the diff/list rendering.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The server runs with root = repo root, so drafts land in <repo>/.drafts/,
not validator/.drafts/. Ignore the root location so generated drafts are
never accidentally committed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Redesign to explorer.html's dark floating-glass aesthetic (translucent
  blurred panels over a full-bleed preview, Inter, rounded corners).
- Stream /api/fix per-file results via SSE; UI shows a live list with
  spinners → ✓/⚠/✗, a done/total count and an elapsed timer (no more
  opaque "fixing…"). JSON path preserved for non-streaming callers.
- Add a Compare tab: Original vs Draft rendered side by side.
- Tooltips on the scan summary chips explaining each category.
- Rename Apply/Discard buttons to "Apply selected" / "Discard selected".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the single tab row / side-by-side compare with two independent
toggle groups: mode (Preview | Code | Diff) and version (Current | Draft).
Toggle either to navigate — e.g. pick Code then flip Current<->Draft to
compare source, or Preview then flip to compare renders. The version group
hides for Diff (which inherently compares both).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- A #placeholder { display:flex } rule overrode the [hidden] attribute, so
  the "Select a file" overlay stayed on top of the viewport and swallowed
  pointer events from the animation. Add [hidden]{display:none!important}.
- Code/Diff were full-bleed (inset:0), starting under the left panel. Inset
  them into the central column as a floating glass panel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The updateVersion fragment and a new system-prompt VERSION RULE now require
every @wix/interact import to be pinned to the exact latest version — an
unpinned esm.sh import was slipping through and tripping the version check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…S flags

Replace the single category dot with independent indicators: a version dot
(green=latest, yellow=old version/syntax, red=no interact) plus additive
flags — a purple dot for customEffect usage and a blue "JS" badge for
JavaScript animation not tied to a customEffect. A file can show several
(e.g. yellow + purple, or yellow + JS). Summary chips and tooltips updated
to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a deterministic codemod pass (codemod.js) for the mechanical fixes —
pin @wix/interact@2.4.0, rename wix-interact-element→interact-element, fix
the useCutsomElement typo, and rename range-offset type→unit (unit-guarded).
fixFile now runs codemods first and only calls the agent when there's real
semantic work: a semantic option (convert customEffect / remove JS / convert
to interact), a custom prompt, or leftover structural markers (params.type/
method play-mode) after the codemod. Version-only / trivial-rename fixes are
now instant, free, and deterministic — no LLM. Each result reports whether it
was done via 'script' or 'agent', shown per file in the live progress list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The old <wix-interact-element> binds via data-wix-path; the public
<interact-element> binds via data-interact-key. The tag-rename codemod left
data-wix-path in place, so migrated elements had no key and bound to nothing
— the animation silently died (CardSpread). The codemod now renames
data-wix-path → data-interact-key alongside the tag, and detect.js flags a
lingering data-wix-path as an old-syntax marker so the self-check catches it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bump target to 2.5.1 and require the /web subpath (exports the
<interact-element> custom element). The pin codemod now normalizes any
@wix/interact import — versioned, unpinned, or with another subpath — to
exactly @wix/interact@2.5.1/web, and uses a lookbehind so prose mentions in
comments are left alone. Tests updated to the new target.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
runAgent now drives `claude --output-format stream-json --include-partial-
messages`, forwarding text/thinking deltas via an onDelta callback. fixFile
threads it as onLog(path,text,kind); the /api/fix SSE stream emits per-token
`log` events so the UI can show the model working live.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- File list is now a collapsible folder tree (folder names + nested files)
  instead of full slash-paths; folders toggle open/closed, filter auto-expands.
- Edge toggles collapse the left/right glass panels off-screen for an
  unobstructed view of the animation.
- "Agent activity" button opens a modal that live-prints the model's
  streamed reasoning/output per file (CLI-style), with a file picker;
  mechanical codemod fixes show a note explaining they produced no LLM output.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add a folder icon to each folder row in the file tree.
- The agent-activity modal now distinguishes "waiting for the model to
  stream" (during an in-flight run) from "no agent output" (idle), and hints
  to restart a stale server if nothing streams — instead of always showing
  the misleading mechanical-fix note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
extractHtml now clamps output to the <!DOCTYPE html>/<html> … </html>
boundaries, dropping any preamble ("per the output contract, here it is:")
or trailing remarks the model sometimes adds — which were leaking into the
draft and rendering in the preview. Fragments without those markers are
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a /api/convert flow that runs the convert-interact-demo-example skill
headlessly (SKILL.md + bundled exemplar as the system prompt) over selected
files and writes each structured guideline to "Ani-Mate Prompts/<path>.md"
(mirroring the source tree). Streams per-token log + per-file result over SSE
like /api/fix. New endpoints: GET /api/prompts (list) and GET /api/prompt
(read). Path-safe, tested.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add Examples ↔ Prompts view tabs under the search box. Examples shows the
  animation tree (as before); Prompts shows the generated guideline tree from
  "Ani-Mate Prompts".
- "Convert to prompt" button runs the selected examples through the skill with
  the same live streaming progress + agent-activity modal.
- Selecting a prompt renders it as formatted markdown (mode tabs become
  Rendered / Raw); includes a small dependency-free markdown renderer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- The agent-activity modal only auto-scrolls to the bottom when you're
  already there, so you can scroll up and read while it streams.
- Up/Down arrows move the selection through the visible tree rows (examples
  or prompts), skipping collapsed folders, and scroll the row into view.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
hassankettany and others added 30 commits July 6, 2026 10:36
6 tasks: vendor build (renderer+schema, GATE) → playground client → loop
history store → guideline refiner → loop endpoints → loop UI. TDD on the
pure/backend units; live playground + render covered by a manual smoke.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… schema

Bundles @wix/interact-experience-renderer into a browser ESM module and
emits the canonical experience JSON Schema, both read directly from the
interact-xp source tree (read-only) via esbuild. Required aliasing
`@wix/interact-experience` to its `src/index.ts` since that workspace
package's `dist/` (referenced by its package.json `exports`) is never
built in this checkout — mirrors the alias interact-xp's own Vite
configs already use.
… config

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…viewRound sections, refine error, stale grid)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s, redesigned feedback dock

- listSections now returns raw section.html for rendering and the sanitized
  copy as promptHtml for the model (mirrors the playground app) — previews no
  longer show redacted text/image placeholders
- loop previews: one full-width card per section, stacked, tall iframes
- section picker docks sticky at top; feedback (score | notes | actions)
  docks sticky at bottom; empty/generating states with spinner

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…iew on pill select

- clicking a section pill now renders its original (static) layout in the grid
  before generating — /api/playground/sections returns raw html+css, and
  buildRenderDoc renders statically when no config is given
- each preview cell has an expand button opening a full-screen overlay (Esc /
  backdrop / ✕ to close); cells are tagged 'original' vs 'animated'

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ing modal button

- Refine/Generate buttons show an inline spinner + disable while the agent runs
- status line reports 'Refining the guideline…' → 'refined — regenerating…'
- new 'Agent thinking' button in the loop bar pulses while streaming and opens
  the live reasoning modal (refine already streams to appendLog); modal follows
  the active stream

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rrent, prompt diff

- sticky loop header shows 'Round N' (or amber 'Viewing round K of N') with an
  inline status line; loop messages no longer land in the far-away right panel
- rounds rail gains a 'Current · round N' row; viewing a past round snapshots
  the live state and 'Back to current →' restores it
- 'Δ Prompt diff' modal diffs the original .md against the working guideline
  (or the viewed round's) via new GET /api/loop/diff (+ tests)
- consistency: refine/generate/section picks locked while viewing history or
  mid-run; Esc closes any open modal; rollback message says what it did

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…iff data loss

- topbar agent bar: model select (CLI default/opus/sonnet/haiku) applied to
  every agent call (fix, convert, refine, playground generate via provider+
  model in the request); context chip shows last-call tokens as % of the
  window + session totals with a reset button (GET/POST /api/agent/*)
- agent.js captures the CLI resolved model + usage from the stream
- prompt diff root cause: rounds only stored the guideline they ran WITH, so
  a rollback silently destroyed refined outputs and diffs showed no changes.
  recordRound now stores the refined output; round diffs use roundRefined()
  (with a legacy fallback); rollback needs a second confirming click; the
  diff modal explains an identical result instead of looking broken, and
  surfaces errors

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pure core of the autonomous refinement engine: decide() implements the
stop rule (green at threshold, amber on plateau/cap — checking cap
before plateau so a stall that coincides with hitting the iteration
cap reports 'cap' rather than 'plateau'), historyBlock() renders
compact per-iteration summaries, and extractTriggers() pulls unique
trigger types out of example HTML for judge context.
Adds validator/lib/capture.js: scrollPositions (pure), makeGif (gifenc +
fast-png), and captureSweep (headless chromium scroll sweep -> PNG frames
+ animated GIF). Reused Chromium download was stale (build 1208 cached,
1228 required by playwright 1.61.1); ran `npx playwright install chromium`
once to bring it current so the real-browser smoke test actually executes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…oute, boot recovery

Wires the Task 6 createRefinery engine into server.js with real deps
(listSections, generate, captureSweep, judgeIteration, refineGuideline),
mounts /runs and /repo statics, adds all /api/refinery/* endpoints plus
GET /render/:jobId/:iter/:sectionId, and runs markInterrupted() on boot
to recover jobs orphaned by a prior process death.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t, job view, approve flow

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…bound port to capture

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…job toggle

1. Delete a job (button in the job bar, two-step confirm) → removes the record
   + all frames/gifs via new POST /api/refinery/delete + deleteJob store fn
   (guarded against running/queued); the prompt drops back to a fresh start.
2. Fix preview flashing: renderJobView now rebuilds #jobBody only when the
   viewed iteration's content key changes, so 4s polls / SSE refreshes no longer
   recreate the <iframe>s (which reloaded and flashed). Same guard on #jobBar
   preserves the notes textarea mid-typing; subscribeJob no longer tears down
   and reopens the SSE on every poll.
3. Prompt↔job toggle: a 'Refinery' mode tab appears when a prompt has jobs;
   Prompt/Raw show the guideline md, Refinery shows the job view — no longer
   force-locked into the job view with no way back.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
/api/refinery/diff now also returns a steps array — one diff per iteration
that produced a refinement (guideline to refined = next iterations guideline);
stopping iterations (refined=null) contribute none. The diff modal renders the
overall original-to-final diff, then a captioned section per iteration
("Iteration N to N+1") so you can see exactly what each round changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants