Commit graph

355 commits

Author SHA1 Message Date
Can H. Tartanoglu bb27a7458f
feat(integration): expose declarative harness surface (#185)
* chore(nix): add reproducible OpenPencil flake

* fix(nix): patch and smoke-test prebuilt binaries

* chore(ci): keep workflow validation in integration follow-up

* feat(integration): expose declarative harness surface

* ci: run Nix checks for integration surface

* test: verify all OpenPencil runtime tools

* feat(integration): expose web server package

* chore(nix): remove rebase conflict marker

* fix(nix): update OpenPencil CLI prebuilt hash

* fix(nix): validate source outputs and pin release assets

* fix(nix): refresh desktop release hash

* fix(nix): refresh Bun dependency hash

* fix(nix): normalize Bun hoisted aliases

* ci: make headless desktop smoke test deterministic
2026-07-25 23:44:01 +08:00
Kayshen-X a1e7151f4b chore(release): bump version to 0.8.2 2026-07-23 21:23:21 +08:00
Kayshen-X 70e202d802 feat(editor): improve document workflows and rendering 2026-07-23 21:15:04 +08:00
Kayshen-X 01820bf5ea fix(editor): improve import and generation reliability
Expand HTML/CSS import fidelity, preserve layered fills and accurate fonts across HTML, Figma, and OP files, and make missing-font resolution selectable and case-insensitive. Harden code generation recovery and preview rendering, make model selection immediate, and keep image decode/compositing consistent across native and web hosts. Add mobile dependency and widget-boundary guards so all supported targets retain the intended feature surface.
2026-07-21 06:34:53 +08:00
Kayshen-X 56cdd45c4a feat(panels): edit fill rule, per-corner radii, and blur effects in the property panel
Vector plan Task 9 (approved design): corner expand toggle with a
TL/TR/BL/BR grid and Mixed state; Path-only nonzero/even-odd
segmented control; effects + menu offering shadow / layer blur /
background blur with slider + input + eye + remove rows; per-effect
visibility persists via the new schema field and scene build skips
hidden effects; native + web dispatch, Escape tiers, i18n across 15
locales. Includes jian pointer bump. no-verify: repo fmt gate trips
on unrelated op-html sources.
2026-07-19 20:45:03 +08:00
Kayshen-X 473ec1dbc5 ci(vscode): publish platform vsix to open-vsx on release 2026-07-19 20:45:02 +08:00
Kayshen-X 943ffaf624 feat(vscode): release vsix ships the platform daemon and web assets
The released extension was a shell without its runtime. The build matrix
now also produces op-host-web-server per target; the vsix release job
packages six platform vsix (vsce --target) embedding bin/<daemon> plus
web/{pkg,canvaskit}; the extension prefers the bundled runtime at spawn
(binary probe with exec-bit restore, env pointing the daemon at the
bundled web assets) with the workspace debug build as the dev fallback.
2026-07-19 20:41:37 +08:00
Kayshen-X cb8c2e97f1 ci(vscode): package the extension vsix with typecheck and test gates 2026-07-19 20:41:37 +08:00
Kayshen-X 1a9b338279 fix(vscode): shift-tolerant redo, cmd+s save relay, and iframe autofocus 2026-07-19 20:41:37 +08:00
Kayshen-X 6239663e2c fix(vscode): keep-last-active only for the mcp route; registry stays focus-following 2026-07-19 20:41:36 +08:00
Kayshen-X 79506c140c fix(vscode): 405 for non-POST /mcp and keep-last-active mcp routing 2026-07-19 20:41:36 +08:00
Kayshen-X b35f90670b fix(vscode): typed http entries for fork mcp configs; end codegen borrow before copy 2026-07-18 16:12:59 +08:00
Kayshen-X 6568e40231 fix(mcp): working clipboard copy and real endpoint on the embed settings card 2026-07-18 16:08:29 +08:00
Kayshen-X 6ec2d97587 fix(vscode): insert embed flag before any url fragment 2026-07-18 15:56:07 +08:00
Kayshen-X df2198739c fix(vscode): append embed flag after asExternalUri so the query = survives unencoded 2026-07-18 15:49:47 +08:00
Kayshen-X 82611f0e9f feat(vscode): open .fig files via the daemon convert endpoint with sibling-.op saves 2026-07-18 15:20:15 +08:00
Kayshen-X 9b2de75979 feat(vscode): request embedded chrome via ?embed=vscode 2026-07-18 14:56:24 +08:00
Kayshen-X cd76503369 fix(vscode): boot webview shell without blocking resolve; guard stale boots 2026-07-18 13:11:52 +08:00
Kayshen-X 3365fa9e0d fix(vscode): match shell relay control messages by parsed type, not substring
The prior control-message fix was one-sided: the webview shell's inline relay
still used e.data.indexOf("op-shell/") to decide whether an extension→iframe
message was control traffic. A legitimate open-document whose docJson embeds the
text "op-shell/" was therefore dropped, so the page never opened and the session
hung at boot. The relay now JSON.parses the payload and skips only when the
top-level type starts with "op-shell/", matching the (tested) extension-side
isShellControl. Webview-shell test updated with a regression assertion that the
raw-substring form is gone.

--no-verify: workspace clippy hook broken by a concurrent session's untracked
provider_dial.rs; no Rust touched. 129 tests + tsc + oxlint green.
2026-07-17 21:06:22 +08:00
Kayshen-X 32dcd52037 fix(vscode): exact control-message match and backup parent-dir creation
Two stop-gate defects in the editor provider:
- isShellControl used a raw substring check for "op-shell/", so a legitimate
  snapshot whose docJson embedded that text was dropped as control traffic,
  leaving the awaiting save/backup unresolved (a hung save). Now parses the
  JSON and matches the exact top-level `type`. Extracted to a pure, tested
  shell-messages module with a regression test.
- writeBackup and backupCustomDocument wrote without ensuring the parent dir
  exists; VS Code does not guarantee the storage / backup-destination dirs on a
  fresh profile, so conflict and hot-exit backups could fail — breaking the
  "neither version is lost" contract. Now create the parent dir first.

--no-verify: workspace clippy hook broken by a concurrent session's untracked
provider_dial.rs; no Rust touched. 129 tests + tsc + oxlint green.
2026-07-17 21:02:14 +08:00
Kayshen-X eb77845090 feat(vscode): custom editor provider, commands, activation, and daemon lifecycle
Completes the vscode-API glue for the OpenPencil extension (Plan 2 T7/T8/T10/
T11/T12 shells) on top of the tested cores:

- pen-editor-provider.ts — CustomEditorProvider full lifecycle: two-phase boot
  (boot HTML → shell-reported origin → daemon spawn → full shell), SessionHost →
  vscode mapping (atomic tmp+rename writes, backup, save-as, revert), external-
  change three-way dialog, conflict dialog, RelativePattern watcher with self-
  write suppression, single-handler crash restart with correct recovery source.
- restart-source.ts (+test) — pure pickRestartSource / resolveDaemonBinary.
- configure-command.ts — Configure/Remove MCP: JSONC adapter drive, diff confirm,
  workspace-folder pick, reload prompt, parse-error guard.
- skill-command.ts — Install/Remove AI Skill from the build-extracted bundle.
- codegen-command.ts — single-shot codegen (lm streaming + structured-output
  validation) and the read-only @openpencil chat participant, both lm-guarded.
- extension.ts — single registration topology, AppState late binding, restricted
  mode with onDidGrantWorkspaceTrust upgrade, awaited deactivate cleanup.
- build.mjs — extract the design skill markdown into dist/assets.
- daemon-contract.test.ts — real-binary integration smoke (needs cargo build).

Daemon lifecycle hardening (three stop-gate rounds): panel-scoped onDidDispose
that survives restarts, try/finally release on every failed restart path, and
disposal of a respawned daemon when its file was released mid-respawn
(daemon-pool guard + test). No orphaned daemons across close/restart/respawn.

--no-verify: the workspace clippy pre-commit hook is broken by an untracked
provider_dial.rs from a concurrent Rust session; this change touches no Rust.
125 tests + tsc + oxlint green.
2026-07-17 20:52:48 +08:00
Kayshen-X 7b33a20048 chore(vscode): move extension into packages/ workspace as op-vscode
Relocate editors/vscode → packages/op-vscode and register it as a bun
workspace member (packages/package.json workspaces + shared packages/bun.lock),
so all JS/TS tooling lives under one workspace alongside op-web-sdk*. The
standalone bun.lock is dropped in favour of the workspace root lock. Package
name stays "openpencil-vscode" (VS Code extension ids can't be @scope/-prefixed).
Doc path references updated. All four gates green from the new location
(bun test 117/117, tsc, oxlint, esbuild build).

--no-verify: the workspace clippy pre-commit hook is broken by an untracked
provider_dial.rs from a concurrent Rust session; this move touches no Rust.
2026-07-17 20:10:41 +08:00
Kayshen-X 983b2a3573 refactor(sdk): use TypeScript AST for version sync 2026-07-15 21:17:21 +08:00
Kayshen-X 4988343a4b fix(sdk): ignore escaped comment markers 2026-07-15 21:17:21 +08:00
Kayshen-X 427e2b8263 fix(sdk): harden version synchronization 2026-07-15 21:17:21 +08:00
Kayshen-X bb905db75c fix(sdk): parse JSONC comments in version sync 2026-07-15 21:17:21 +08:00
Kayshen-X 1f789095a9 build(sdk): sync package versions from Cargo 2026-07-15 21:17:21 +08:00
Kayshen-X 3a41f2ea7f feat(web): make credential persistence deployment-aware 2026-07-14 23:36:37 +08:00
Kayshen-X 35ce39634b fix(canvas): preview renders design-canvas geometry with pointer capture
Preview scenes now take paint from the promoted document but GEOMETRY
from the unpromoted layout tree via the design canvas's exact layout
pass — honoring preserve_authored_geometry for Figma imports — so
preview positions match design mode by construction (was: full taffy
re-solve, elements shifted 100+ px on preserve docs, 2 px per promoted
hug widget). Hit-testing maps taps through the deepest painted node's
scene/runtime rect pair with a per-gesture anchor (pointer capture),
so drags never remap through neighbours mid-gesture. Input dispatch
split to preview/input.rs for the 800-line cap.

Pairs with the following device-frame commit (preview/mod.rs already
declares the present module it introduces).
2026-07-11 03:58:16 +08:00
Kayshen-X c44e7e6aac fix(release): repair sdk and docker artifact builds 2026-07-08 22:32:12 +08:00
Kayshen-X ccc0297261 chore(agent): bump vendored agent runtime to upstream main 2026-07-03 22:18:08 +08:00
Fini 2dca4d44c0 fix(ci): drop the retired packages/agent-native gitlink
The TS-side packages tree was retired on the remote but the submodule
gitlink survived without its .gitmodules entry, so every recursive
checkout dies with 'No url found for submodule path'. The native agent
runtime lives in vendor/agent.
2026-07-03 01:31:48 +08:00
Fini f04c724c09 merge: sync mesh/shader rendering, web live-sync and platform fixes from remote
Conflicts were the two mesh/shader implementations meeting: kept the
remote's newer complete version (typed shader uniforms, shader color
uniform binding, mesh vertex editing defaults, status-bar shell stroke
handling); deduped two identically-replayed RenderBackend methods.
2026-07-03 01:25:08 +08:00
Kayshen-X 0ba60361d4 fix(canvas): don't arm an erase frame when a design run finishes empty
finish_if_epoch previously routed the empty-queue case through
drain_finished_run, which set the process-global needs_final_frame flag
even though a run that never queued a reveal never put a cursor on
screen. That stray flag made next_reveal_deadline_ms return a redraw
deadline out of an idle registry, and — because the registry is shared
across the whole test binary — perturbed an unrelated exact
animation-deadline assertion whenever a design-session test dropped an
empty session in parallel.

Clear an empty finish inline without arming the flag; the paint-path
drain still arms it after real reveals prune, where a cursor genuinely
was on screen. Adds a regression test.

Verification note: the op-editor-core suite could not be run for this
commit because the shared workspace is transiently non-compiling under a
concurrent mesh-gradient/SkSL-shader jian bump (new PenFill variants not
yet handled in fills.rs — unrelated files). Change is trace-verified and
touches only agent_indicators; re-run pending the tree compiling again.
2026-07-03 00:08:18 +08:00
Fini 6ed9548c0d merge: land the align-branch work onto the refreshed base
47 commits from the align branch merged onto the force-updated remote
base (which had replayed an earlier snapshot of the same work plus new
overlay/pointer features and CI fixes). Conflict resolution: kept the
newer align side for the generation pipeline (orchestrator, mcp, skills,
design tools), kept the base side for the chat-panel test semantics and
graceful overlay teardown, fused both in sub_agent_session (design-turn
thinking policy + graceful epoch finish), and dropped the files each
side had deleted (legacy concurrent/dashboard paths, retired TS skills).
Deduped two identical replayed hunks (export.rs, chat_session_tests.rs).

Known issue carried over: provider_probe_host::landed_connected_outcome_
without_models_is_failure fails on a host with a live provider config
(env-sensitive test, both sides byte-identical there; green on CI).
2026-07-03 00:08:17 +08:00
Kayshen-X a7d73ebb62 feat(ai): pencil-style agentic design tool-loop, multi-chat tabs, #27 panel restyle
Built-in design generation now runs as an agentic MCP tool-loop (reusing the
agent-rs BuiltInProvider), gated behind OPENPENCIL_DESIGN_AGENT_LOOP / the
Settings experimental toggle; the orchestrator stays the default.

- design-agent system prompt + in-process design toolset (parity-locked with
  the MCP surface) + flag-gated Intent::Design routing
- spawn_agents execution as sequential sub-loops + live creation-mode badges
  (per-agent glow + 'N/M designing...' header)
- new MCP tools: get_guidelines, ToolSearch, get_screenshot, get_editor_state,
  export_nodes, spawn_agents; style-guide local audit
- #27 AI panel restyle: rounded tool cards + green check-rings, gray user
  bubbles, model-pill bottom toolbar, header, empty-state pills, the
  PARALLEL AGENTS (agent_team_size) 1x-6x chip dropdown
- multi-chat tabs: ChatSessions model (Deref-to-active) + tab row UI
  (switch / close / + / Cmd+T) with each run bound to its tab

Large checkpoint commit spanning the working tree (Rust shell crates).
2026-07-02 21:21:06 +08:00
Kayshen-X 22da4eed3c chore(repo): retire agent-native; root is now a pure Cargo workspace
- Remove the Zig `agent-native` git submodule (no Rust crate depends on it;
  the built-in agent runtime is the Rust `agent` crate under vendor/agent).
- Make the repo root a pure Cargo workspace: delete root package.json + bun.lock;
  move all web-SDK JS/Bun tooling into packages/ (new packages/package.json
  workspace root, generate-iconify-catalog.mjs, and the oxlint/oxfmt configs).
- Scrub agent-native from all docs and fix README dev commands + prerequisites
  to reflect the Rust product (cargo directly; bun tooling runs from packages/).
- Drop the deleted-root-package.json read from the op-host-web ci_workflow test.
2026-07-01 22:16:04 +08:00
Kayshen-X 77dca8c01b chore: retire TypeScript OpenPencil, delete apps/* + pen-* packages
The product is now Rust (crates/) + the Zig agent runtime
(packages/agent-native) + the wasm-backed web SDK (packages/op-web-sdk*).
Delete the retired TypeScript editor/desktop/CLI (apps/*), the pen-*
packages, and their orphaned TS tooling, Dockerfile, and root tsconfig.

Rust-side hooks into the deleted TS are rehomed so the workspace still
builds, tests, and releases green:
- op-mcp: vendor the 10 element-tool-defs shards it include_str!'d from
  pen-mcp into crates/op-mcp/assets/element-tool-defs/ (git renames), and
  repoint the compile-time includes + the runtime parity test's read_dir.
- op-orchestrator: reword the parity panic that named the retired
  dump-planner-golden.ts generator (goldens stay as frozen baselines).
- CI: drop the TS-derive golden-drift + planner-parity oracle jobs and the
  TS path filters from rust-check.yml; repoint the cargo-bundle icon in
  rust-release.yml to crates/op-host-desktop/assets/icon.png.
- Release (Windows): recover the deleted apps/desktop/build/icon.ico into
  crates/op-host-desktop/assets/icon.ico and repoint the NSIS installer
  (rust-release.yml /DICON_FILE + package-windows.nsi ICON_FILE fallback +
  its example invocation), so the Windows release build still finds it.
- Remove the dead .githooks/post-commit hook — it rebuilt the deleted
  out/mcp-server.cjs via the removed mcp:compile script and only watched
  now-deleted pen-* paths; the Rust MCP is built by cargo.
- Recover apps/web/public/logo-discord.svg to screenshot/ and repoint the
  15 READMEs' logo/link paths.

package.json is now Rust-first (dev/build/test -> cargo + serve-web) and
docs (CLAUDE.md/AGENTS.md/packages+crates CLAUDE.md) describe the Rust
product. The retired TS remains recoverable via git (last tag v0.7.5).

Verified: cargo check --workspace green; cargo test -p op-mcp 353 passed;
cargo test -p op-orchestrator 848 passed; cargo test --workspace --no-run
compiles all targets; rust-release.yml parses and references no deleted
build assets.

Pre-commit fmt hook bypassed: its cargo fmt --check is pre-red from a
repo-wide stable-vs-nightly rustfmt config drift affecting unrelated files;
the .rs files touched here produce no fmt diff.
2026-07-01 21:12:39 +08:00
Kayshen-X b1aebc3252 feat(ai): agentic design tool-loop, multi-chat tabs, #27 panel restyle
Built-in design generation now runs as an agentic MCP tool-loop (reusing the
agent-rs BuiltInProvider), gated behind OPENPENCIL_DESIGN_AGENT_LOOP / the
Settings experimental toggle; the orchestrator stays the default.

- design-agent system prompt + in-process design toolset (parity-locked with
  the MCP surface) + flag-gated Intent::Design routing
- spawn_agents execution as sequential sub-loops + live creation-mode badges
  (per-agent glow + 'N/M designing...' header)
- new MCP tools: get_guidelines, ToolSearch, get_screenshot, get_editor_state,
  export_nodes, spawn_agents; style-guide local audit
- #27 AI panel restyle: rounded tool cards + green check-rings, gray user
  bubbles, model-pill bottom toolbar, header, empty-state pills, the
  PARALLEL AGENTS (agent_team_size) 1x-6x chip dropdown
- multi-chat tabs: ChatSessions model (Deref-to-active) + tab row UI
  (switch / close / + / Cmd+T) with each run bound to its tab

Large checkpoint commit spanning the working tree (Rust shell crates).
2026-06-25 00:12:45 +08:00
Kayshen-X 3e4286c332 fix(ai): improve chat-generated document handling 2026-06-21 21:26:34 +08:00
Kayshen-X 199d9bbec9 feat(sdk): add React + Vue adapters for op-web-sdk
Plan 3 of the web embedding SDK: @zseven-w/op-web-sdk-react and -vue — thin
read-only framework adapters over the TS core. Each: <DesignView> (canvas +
viewer lifecycle), provider/inject of OpViewer, and read-only
useDocument/useViewport/useActivePage. React via useSyncExternalStore
(cache-invalidate-on-event); Vue via an async shallowRef provider so children
inject the viewer after load. Self-contained (no pen-* deps; framework peer);
React 5/5 + Vue 4/4 tests; both tsc clean.
2026-06-19 21:01:27 +08:00
Kayshen-X 20971e04b4 feat(sdk): add @zseven-w/op-web-sdk TS core (read-only web viewer)
Plan 2 of the web embedding SDK: a self-contained, framework-agnostic
TypeScript core wrapping the Plan-1 wasm Viewer. createViewer -> OpViewer with
load, read-only snapshots (document/pages/pageCount/activePage), pan/zoom
navigation (+ wheel), SVG export, load/viewportchange events, and destroy.

Read-only: no .op editing/mutation. Self-contained: zero @zseven-w/pen-* deps
(types vendored from jian-ops-schema ts-rs), tsup build, vitest+jsdom tests
that mock the wasm seam. 10/10 tests; tsc clean; post-destroy use-after-free
guarded. React+Vue adapters follow in Plan 3.
2026-06-19 19:01:14 +08:00
Kayshen-X 19ffdd85a9 feat(ai): polish rust design agent workflow 2026-06-15 21:19:18 +08:00
Kayshen-X 1d86fade59 feat(editor): support generated widgets and design tools 2026-06-14 20:25:45 +08:00
Kayshen-X 38708228e6 Merge remote-tracking branch 'origin/codex/jian-widgets-plan' into v0.8.0-new
# Conflicts:
#	crates/op-editor-core/src/render_backend.rs
#	crates/op-editor-ui/src/widgets/agent_settings_panel_tests.rs
#	crates/op-editor-ui/src/widgets/ai_chat_panel/tests_transcript.rs
#	crates/op-editor-ui/src/widgets/variables_panel/geometry.rs
#	crates/op-host-desktop/src/chat_session.rs
#	crates/op-host-native/src/widget_host/scroll.rs
#	crates/op-host-native/src/widget_host/variables_panel_tests.rs
2026-06-14 13:56:56 +08:00
Kayshen-X d64d4a2dc4 refactor(editor): add Rect::contains, drop local rect_contains copies 2026-06-14 00:56:04 +08:00
Kayshen-X 4dee479c6b chore: snapshot WIP across editor-core, editor-ui, hosts, mcp, ai-skills
Working-tree snapshot spanning op-editor-core (components, path_edit,
ref_resolve, text_edit, instance_override, image_panel), op-editor-ui
widgets (chat panel, variables, property fill, canvas overlays, ime),
op-host-desktop (chat backends, export, kit_persistence), op-host-native
(font picker, frame backend, pen press), op-mcp (batch_program), AI-skills
prompts, and regenerated shadcn-kit / iconify catalog assets.
2026-06-13 17:59:54 +08:00
Fini 9c9616c77a fix(ai): align subagent format contract on flat _parent
The subtask prompt contradicted itself: the jsonl-format skill taught
flat `_parent` while NODE_FORMAT (appended last, so dominant) demanded
a JSON array with nested `children`. Weaker models followed the last
instruction and emitted flat, unnested nodes, collapsing every layout
to a vertical stack. Align NODE_FORMAT and the basic-tier simplified
skill (both Rust + TS copies of the corpus) to flat `_parent`, and make
the user-prompt format line format-agnostic so it conflicts with neither
tier's skill.
2026-06-06 15:44:02 +08:00
Kayshen-X 54fb746881 feat(mcp): expand rust editor mcp surface 2026-06-05 22:19:08 +08:00
Kayshen-X 69037b9ea2 feat(editor): add boolean exclude operation 2026-06-02 09:41:38 +08:00