Skip to content

feat: dev tools for previewing animations and scenarios (Cursor + OpenCode) - #11

Open
jcendal wants to merge 41 commits into
sbugallo:mainfrom
jcendal:feat/vpet-dev-tools
Open

jcendal wants to merge 41 commits into
sbugallo:mainfrom
jcendal:feat/vpet-dev-tools

Conversation

@jcendal

@jcendal jcendal commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Adds dev tools to cursor-vpet and opencode-vpet for triggering animations and evolution scenarios without a real agent run. Code lives in src/dev/ per host; production only adds a minimal gate in extension.ts / tui.tsx.

Cursor (cursor-vpet)

  • Activation: vpet.devTools, CURSOR_VPET_DEV=1, or Extension Development Host (F5).
  • Command palette entry Cursor VPet: Dev Tools → Feed / Evolution Reveal / Evolution Battle.
  • setupBattlePending seeds a pending evolution battle in SQLite to exercise the full flow.

OpenCode (opencode-vpet)

  • Activation: OPENCODE_VPET_DEV=1.
  • Palette commands (category VPet Dev): feed, activity, evolution reveal, battle, defeat.
  • Build emits dist/dev/attach-dev-tools.js so the dynamic import works against the compiled package.
  • createSqliteVpetRepository exposes getSidebarSnapshot() (required for dev scenarios).

Documentation

  • Updated docs/monorepo.md (dev tools, removed broken link).

Fixes included

  • Dynamic import in dist uses .js extension (previously failed at runtime).
  • port-boundary fixture: strips workspace:* deps before bun pm pack.
  • Dev tests: unique battle timestamps to avoid event_id collisions (flaky in CI).

Test plan

  • bun run check (repo root)
  • bun run test (repo root) — opencode 323+, cursor 91
  • bun test tests/dev in opencode-vpet and cursor-vpet
  • bun run build in opencode-vpet and verify dist/dev/attach-dev-tools.js exists
  • OpenCode: OPENCODE_VPET_DEV=1 opencode → VPet Dev palette commands; try feed and evolution battle
  • Cursor: vpet.devTools: true or F5 → Cursor VPet: Dev Tools in palette; try feed and evolution battle

jcendal and others added 30 commits September 10, 2026 13:05
Extracts vpet-core as a shared package, moves the OpenCode plugin to
packages/opencode-vpet, and adds the cursor-vpet extension with its own
SQLite adapters and hooks. Updates CI/CD, workspaces, and monorepo documentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds walking, action, and sleep animation in the sidebar webview and copies
the root CHANGELOG.md when packing npm and VSIX artifacts, removing the local stub.

Co-authored-by: Cursor <cursoragent@cursor.com>
Calls nowMs as a function instead of passing unbound performance.now,
reorders partner sync after postMessage, and adds a regression test.

Co-authored-by: Cursor <cursoragent@cursor.com>
Converts pixel width to monospace columns based on the webview font so the
sprite fits without overflowing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rewrites the extension documentation with badges, guides, and usage sections,
and documents the author and contributor in the root README.

Co-authored-by: Cursor <cursoragent@cursor.com>
Colocates stage-changelog in each package, aligns the test fixture with the
monorepo layout, and fixes typecheck errors that blocked check.

Co-authored-by: Cursor <cursoragent@cursor.com>
…olds

Reuse the shared SQL.js runtime so the snapshot reader reloads the database
on each read instead of serving stale gauge values. Scale default evolution
thresholds 10× and document Open VSX publishing setup.

Co-authored-by: Cursor <cursoragent@cursor.com>
When a partner reaches a stage threshold, open a pending same-stage battle
instead of evolving immediately. Persist battle state in SQLite, notify via
toasts in OpenCode, and animate battles in the Cursor sidebar.

Co-authored-by: Cursor <cursoragent@cursor.com>
…nimations

Show a FIGlet BATTLE banner that blinks before combat, then play evolution or defeat animations based on the battle outcome.

Co-authored-by: Cursor <cursoragent@cursor.com>
Elimina el flag temporal, el comando de prueba y la lógica de preview automático para dejar solo el flujo real de batalla.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reload sql.js state when pet.db changes on disk and watch the file so the sidebar stays fresh when multiple Cursor windows share the same ledger.

Co-authored-by: Cursor <cursoragent@cursor.com>
…oks.

Wire battle animations, session orchestration, and sidebar updates into the OpenCode TUI so evolution now requires winning a battle before advancing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use a single repository snapshot, a shared battle session, and refresh coalescing so pending battles resolve once instead of replaying in a loop.

Co-authored-by: Cursor <cursoragent@cursor.com>
Digitama now crosses stages in the database without a pending battle, while later stages keep the battle flow. Cursor queues direct-evolution reveals from usage events, and OpenCode runs battle and reveal presentations in the sidebar poll loop.

Co-authored-by: Cursor <cursoragent@cursor.com>
Centralize pure helpers (sleep, random, assertNever, async refresh queue),
deduplicate SQLite options/errors, import CompletedUsage from vpet-core,
and remove unused sqljs-runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tation

Move animation, artwork, and session modules into a VS Code-free folder
to separate visual logic from host-specific webview wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce notification, scheduler, and webview messenger adapters plus
discriminated union message parsing; wire provider through AnimationSink.

Co-authored-by: Cursor <cursoragent@cursor.com>
Split VpetSidebarProvider into pure presenter, animation host, and
orchestrator modules under webview/sidebar for single-responsibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extract container wiring, command registration, sidebar setup, and usage
pipeline so extension.ts only orchestrates activation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Escape HTML in Dex and History panels and relocate panel modules to
match the recommended folder structure.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add exhaustive state-machine cases for walking, digitama, sleep, viewport, and activity transitions per architecture analysis.

Co-authored-by: Cursor <cursoragent@cursor.com>
Group imports as third-party, @sbugallo workspace packages, then relative paths across src and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cover sidebar orchestrator, animation host, and provider behavior with
fixtures and mocks so functional regressions are caught without changing
production code.

Co-authored-by: Cursor <cursoragent@cursor.com>
Normalize formatting across source and test files so biome ci passes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move repeated literals into shared/constants, add tsconfig.test.json so Bun
tests typecheck in the IDE, and cover game persistence, usage pipeline, and
domain evolution rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move duplicated monster animation, artwork sequences, and evolution battle
sessions into a workspace package consumed by OpenCode and Cursor hosts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Include the new package in root test/check scripts and exclude staged build
artifacts from biome formatting.

Co-authored-by: Cursor <cursoragent@cursor.com>
Consume the shared animation package from both hosts, stage sources for npm
publish, update tests and persistence expectations for schema migration 4, and
document the new monorepo layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop vpet-animation and cursor-extension planning docs now that the shared
animation package and Cursor extension are implemented.

Co-authored-by: Cursor <cursoragent@cursor.com>
…migration

Refresh PR status, architecture snapshot, acceptance criteria, and inventory
sections after extracting shared presentation into vpet-animation.

Co-authored-by: Cursor <cursoragent@cursor.com>
jcendal and others added 11 commits September 11, 2026 23:28
Drop the local setup doc now that publishing is configured; update monorepo
references to point at the live extension listing only.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add a feed event to vpet-animation that plays eat_1/eat_2 clips, trigger it
from OpenCode session idle after busy and from Cursor when usage is applied.

Co-authored-by: Cursor <cursoragent@cursor.com>
Expose gated dev command layers in cursor-vpet and opencode-vpet so feed, activity, evolution reveal, and battle flows can be triggered without real agent usage.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use a .js dynamic import path so OPENCODE_VPET_DEV works with the built
plugin, and cover dev layer registration, feed, and dist loading in tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Mirror prepack behavior in the port-boundary test fixture so bun pm pack
does not fail resolving workspace:* dependencies in an isolated copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use bracket access for package.json dependency fields so the script
typechecks when imported from the package fixture tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use unique createdAt values when resolving evolution battles in the
advance helper so parallel test runs do not collide on partner_events.

Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerate monster-action-policy after the source formatting change from
the dev tools work.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align Cursor/OpenCode extensions and shared core on digital-pet naming, refresh CI/release workflows, and adopt npm lockfile for the workspace.

Co-authored-by: Cursor <cursoragent@cursor.com>
Give the attach-dev-tools integration hook up to 60s to finish dist builds on slower CI machines.

Co-authored-by: Cursor <cursoragent@cursor.com>
Treat pet.db-wal watch events as database updates, inject directory watching for deterministic tests, and drop a stale presentation boundary scan.

Co-authored-by: Cursor <cursoragent@cursor.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.

1 participant