[feat] canvas: render model-generated interactive HTML with a controlled action bridge

Đang mở
#443 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
18/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
css, html, javascript, typescript
Lĩnh vực
api, frontend, security

Hướng nghiên cứu

The request centers on a sandboxed iframe that renders model-generated HTML on the canvas node, plus a controlled postMessage-style bridge to the host; the payload names no specific files, so start by locating the existing HTML canvas node and the project asset storage in the TypeScript codebase. Done means a generated page renders in isolation, a submitted interaction is validated and saved to project state, and it persists after reopening. The protocol itself is still open for discussion, so confirm the design with maintainers before writing code.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:agent area:canvas

中文总结:支持文本模型生成通用交互式 HTML,在画布内隔离运行,并通过受控接口保存交互结果或填入对话草稿。

Request

Allow text models to generate interactive HTML/CSS/JS and render the result directly in an HTML canvas node, rather than opening it in an external browser.

This should support general interactions—forms, candidate selection, sliders, quizzes, interactive charts, and custom interfaces—not a fixed card layout.

Proposed scope

  • Store generated HTML as a project asset and render it in a sandboxed iframe with configurable dimensions.
  • Allow page-local JavaScript interactions. Block network access and direct access to the filesystem, CLI, and host APIs.
  • Provide a controlled bridge for submitting structured interaction results to the host, for example:
await opendirector.request({
  action: "submit",
  payload: { selectedIds: ["candidate-b"], values: { durationSeconds: 15 } }
});

The host validates the source, allowed action, target scope, and payload, executes supported project operations, and returns success or failure. The API above is illustrative; the exact protocol is open for discussion.

Initial milestone

Generate an interactive HTML interface, use it on the canvas, and save its submitted results to project state or populate a visible assistant draft. Persist submitted state across reopening.

Candidate adoption and generation can be added later as explicitly authorized actions through existing business services.

Ngôn ngữ chính
TypeScript
Star
119
Fork
16
Merge trung bình
16 giờ 13 phút
Pull request đã merge (30 ngày)
195

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ThinkFlowLab/OpenDirector

Tất cả issue của ThinkFlowLab/OpenDirector

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.