mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
feat(dify-builder): name apps from their prompt, and turn gate actions into card options
Two App Builder spec changes that share the Builder session contract.
Naming (spec N1-N3): an app created from the homepage prompt is no longer named
by the user. core/dify_builder/naming.py cuts the prompt's opening clause at
create time -- instant and infallible, since it runs inside POST /apps -- and
CreateAppPayload.name becomes optional alongside a new prompt field. The Builder
then refines that name once during goal analysis, where a model and the detected
reply language are already in hand, so the judgement calls that are
English-shaped in pure Python (dropping an imperative lead-in, spotting a
contentless prompt) work in any language. Plan approval freezes the name.
Card options: SessionView gains a Decision carrying the gate's choice as options
inside the card plus a fixed confirm/cancel pair, replacing a button row whose
shape changed at every state. Option ids are the old action ids untouched, so
resolve_action_kind and the per-state legality check are unchanged, and
SessionView.actions keeps being populated -- the deployed web client goes on
working until it reads decision instead.
The regenerated console OpenAPI doc also picks up ErrorCard.diagnostics, missed
when cc9ca8b1dd landed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
cc9ca8b1dd
commit
aa2b4fe4ab
30 files changed
+1163
-18
No files matched your search
@@ -115,6 +115,11 @@ class Env:
|
||||
# MUST NOT raise: the engine does not guard this call, so the service-layer
|
||||
# implementation is responsible for swallowing its own errors and returning a safe fallback.
|
||||
localize_items: Callable[[list["ConversationItem"], str], list["ConversationItem"]] | None = None
|
||||
# Renames the session's app to a model-proposed title (spec N1). None -> no-op.
|
||||
# MUST NOT raise: the engine does not guard this call, so the service-layer
|
||||
# implementation swallows its own errors -- a failed rename leaves the
|
||||
# derived name in place and never blocks the build.
|
||||
rename_app: Callable[[str], None] | None = None
|
||||
# Correlation metadata for the handler transition currently running.
|
||||
# The runner resets it before every independently committed step.
|
||||
session_id: str = ""
|
||||
|
||||
Reference in new issue
Block a user