Skip to content

AI: Powered Document (4 modes: article / from list / from article / research URL) #15

Description

@Adron

feature: "powered_document" drafts a full markdown document. Four modes, set in context.mode:

context.mode Also requires Source
article (default) — drafts from the topic in input alone
from_list context.listId loads your list's schema + up to 50 rows server-side
from_article context.documentId loads your document's title + body server-side
research_url context.url fetches the page (http/https, SSRF-guarded), extracts title/description/text, cites the URL

You pass a reference, not source text. Derived modes are IDOR-guarded — a missing or non-owned reference returns 422 invalid_input. Server-fetched context is truncated before it reaches the model.

  • /suggest → kind: "document"; /generate → {documentId}.

Acceptance criteria

  • "Powered Document" action on Views/DocumentsView.xaml, gated on IsAiAvailable.
  • Mode picker; from_list / from_article pick their source from the user's own lists/documents; research_url takes a URL with http/https validation.
  • Rendered markdown preview, editable before confirming.
  • Confirm calls /api/ai/generate and opens the created document from a fresh GET.
  • 422 invalid_input on a missing/non-owned reference is reported against the source field, not as a generic failure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Table stakesarea:aiArea: aiparityWeb/API feature-parity work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions