Commit graph

5 commits

Author SHA1 Message Date
RAIT-09
5cf53b1c9f fix(embed): address code review findings on the embeddable blocks
- ensureEmbedId: require a live agent-client/agent fence and re-validate the
  body via parseAgentBlock before injecting an id, so a stale section can't
  splice an id into an unrelated fence
- restore embedded persist sessions by embedId (independent of agent/cwd) and
  relaunch under the saved agent when it differs
- honor a right-pane quick-action button regardless of the chatViewLocation
  default
- queue pre-mount quick-action prompts instead of overwriting
- subscribe the chat panel to agent settings (built-in + custom) so labels and
  the agent list refresh on edit; clear staged attachments when a prompt is
  injected
- reject present-but-invalid block fields instead of silently defaulting
- widen the embed id to 16 hex; use overflow-wrap in the embedded blocks
- cover the block parser and session storage with unit tests
2026-07-02 00:51:39 +09:00
RAIT-09
ad10484aad chore(embed): drop internal group notation from a comment and test name
Remove the leftover "G1" references that are not meaningful to a reader:
one ChatPanelProps comment and one parser-test describe title.
2026-06-28 23:32:49 +09:00
RAIT-09
2a5d263ac4 refactor(embed): drop the agent-block parse cache
parseAgentBlock is a cheap pure function and embedded blocks are not
re-processed on re-render, so the LRU parse cache rarely hit while adding
module-level mutable state and an immutability contract on its result.
Remove the cache and fold parseDedentedBlock back into parseAgentBlock,
along with the clearParseBlockCache export and its tests.
2026-06-28 23:07:16 +09:00
RAIT-09
13f24d5730 refactor(embed): remove the image/avatar settings
The per-agent avatar only appeared on embedded chats and quick-action
buttons, not in the sidebar/floating chat or header, so it was
asymmetric with the rest of the agent UI. Remove it entirely: the
per-agent avatarImage setting (type, settings UI, normalization), the
chat block `image:` option and its render path, the button avatar, the
backing image-resolver service and its test, the avatar CSS, and the
related docs and parser-test coverage.

The separate floating-button image is unchanged.
2026-06-28 21:31:04 +09:00
RAIT-09
f9c6526003 test(embed): cover the block parser and image resolver; document blocks
Add vitest suites for parseAgentBlock and resolveImageSrc, including the
path-traversal guard that shipped without coverage: chat/button parsing,
the lenient boolean spellings (true/false/yes/no/on/off/1/0 and bare
numeric 1/0), height normalization, every viewType alias, structural
errors, the parse cache's reference identity, URL/data passthrough, and
rejection of vault-escaping image paths (.. / absolute / drive-letter /
~). Extend the obsidian test stub with parseYaml, FileSystemAdapter, and
a ..-preserving normalizePath, and promote yaml to an explicit
devDependency.

Add a usage page documenting the fence languages, all chat/button
options, the device-local persistence model and id auto-injection, and
the validation and warning behavior, with a sidebar entry.
2026-06-28 15:19:36 +09:00