Skip to content

[2/2] feat: let a host annotate the generate action - #171

Draft
dazzatronus wants to merge 8 commits into
derk/lift-generation-type-helpersfrom
derk/eng-898-generation-status
Draft

[2/2] feat: let a host annotate the generate action#171
dazzatronus wants to merge 8 commits into
derk/lift-generation-type-helpersfrom
derk/eng-898-generation-status

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

Stacked PR [2/2]. The mechanical extraction is already split out into #170 (refactor: lift generation type and prompt helpers into shared utils), which is this PR's base branch. This PR contains no refactoring: git diff <base>...HEAD touches nine files, src/core/shared/ai-asset-utils.ts is not among them, and the refactor commit is not in this PR's commit range. Merge #170 first, then retarget this to main.

Studio renders a clip's model and options but the host has no way to say anything about them. This adds one event out and one method in.

Edit emits generation:configChanged when the selected prompt-bearing clip's model, options, length or prompt changes, carrying { clipId, type, model?, options, length, prompt }. The host replies with edit.setGenerationStatus(clipId, { text, tone }), rendered beside Generate.

Non-obvious:

  • length is a required key typed number | undefined. It is undefined only for auto, where the duration comes from media that does not exist yet; the resolver's placeholder would otherwise be reported as fact.
  • Only tone: "error" disables Generate. A stale host value should not block work the backend would accept.
  • A status for a clip that is not selected is stored but not shown, so a late reply cannot paint the wrong clip.
  • The note slot already carried "Generates on render"; with no generator registered that copy still wins over any host status.
  • TimelineUpdated is a trigger so a live merge-field edit re-announces the resolved prompt.

Verify: npm run verify:ci

Risk: 393 lines, roughly half tests. Inert until a host opts in — no behaviour changes without a registered handler and a status call.

@dazzatronus
dazzatronus force-pushed the derk/eng-898-generation-status branch from a302571 to 254eef6 Compare August 28, 2026 10:45
@dazzatronus
dazzatronus marked this pull request as draft August 28, 2026 10:48
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.

1 participant