Skip to content

Add Risuai.readInlay(id) to plugin API v3#1454

Open
ak45231-cyber wants to merge 1 commit into
kwaroran:mainfrom
ak45231-cyber:feature/plugin-readInlay
Open

Add Risuai.readInlay(id) to plugin API v3#1454
ak45231-cyber wants to merge 1 commit into
kwaroran:mainfrom
ak45231-cyber:feature/plugin-readInlay

Conversation

@ak45231-cyber
Copy link
Copy Markdown

Exposes the existing host-side getInlayAsset(id) (from src/ts/process/files/inlays.ts) to plugin sandboxes. Plugins can now read user-attached inlay images/audio/video by the UUID found in {{inlayed::}} placeholders inside raw message text.

Use case: custom-provider plugins that proxy chats to external endpoints need access to attached images to forward them in multi-modal API calls. The current plugin API exposes only sanitized text prompt_chat, leaving inlay binaries unreachable.

PR Checklist

  • Required Checks
    • Have you added type definitions?
    • Have you tested your changes?
    • Have you checked that it won't break any existing features?
  • If your PR uses models1, check the following:
    • Have you checked if it works normally in all models?
    • Have you checked if it works normally in all web, local, and node-hosted versions? If it doesn't, have you blocked it in those versions?
  • If your PR is highly AI generated2, check the following:
    • Have you understood what the code does?
    • Have you cleaned up any unnecessary or redundant code?
    • Is it not a huge change?
      • We currently do not accept highly AI generated PRs that are large changes.

Summary

Please provide a brief summary of the changes made in this pull request.

Related Issues

Please list any related issues or pull requests that this PR addresses.
If there are none, please write "None".

Changes

Please describe the changes made in this pull request in detail.

Impact

Please describe any potential impacts this PR may have on existing functionality or users.

Additional Notes

Footnotes

  1. Modifies the behavior of prompting, requesting, or handling responses from AI models.

  2. Over 80% of the code is AI generated.

Exposes the existing host-side getInlayAsset(id) (from
src/ts/process/files/inlays.ts) to plugin sandboxes. Plugins can now
read user-attached inlay images/audio/video by the UUID found in
{{inlayed::<uuid>}} placeholders inside raw message text.

Use case: custom-provider plugins that proxy chats to external
endpoints need access to attached images to forward them in
multi-modal API calls. The current plugin API exposes only sanitized
text prompt_chat, leaving inlay binaries unreachable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@cubicj cubicj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the plugin API path. It exposes the existing inlay read path to v3 plugins without adding any inlay write or delete behavior.

Check, tests, and build pass locally.

Approving — thanks for the contribution!

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