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:
Charles YaoandClaude Opus 5 committed 2026-09-17 17:55:38 -07:00
1 parent cc9ca8b1dd
commit aa2b4fe4ab
30 files changed
+1163 -18

No files matched your search

+38 -1
View File
@@ -16452,6 +16452,19 @@ snapshot must reconstruct the same canvas.
| session_id | string | | Yes |
| stage_id | string | | Yes |
#### CardOption
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| canvas_event | string | | No |
| description | string | | No |
| id | string | | Yes |
| input | [OptionInput](#optioninput) | | No |
| is_default | boolean | | No |
| label | string | | Yes |
| next_state | string | | No |
| tone | string, <br>**Default:** neutral | | No |
#### ChallengeCard
| Name | Type | Description | Required |
@@ -17080,7 +17093,8 @@ Enum class for configurate method of provider model.
| icon_background | string | Icon background color | No |
| icon_type | [IconType](#icontype) | Icon type | No |
| mode | string, <br>**Available values:** "advanced-chat", "agent-chat", "chat", "completion", "workflow" | App mode<br>*Enum:* `"advanced-chat"`, `"agent-chat"`, `"chat"`, `"completion"`, `"workflow"` | Yes |
| name | string | App name | Yes |
| name | string | App name; derived from prompt when omitted | No |
| prompt | string | Goal prompt the app was created from; used to derive the name | No |
#### CreateSnippetPayload
@@ -17813,6 +17827,15 @@ Enum class for datasource provider
| start_node_id | string | | Yes |
| start_node_title | string | | Yes |
#### Decision
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| cancel | [Action](#action) | | No |
| confirm | [Action](#action) | | No |
| default_option_id | string | | No |
| options | [ [CardOption](#cardoption) ] | | No |
#### DecisionItem
| Name | Type | Description | Required |
@@ -18044,6 +18067,7 @@ Enum representing the deployment edition of the platform.
| canvas_read_only | boolean | | Yes |
| checkpoint | [CheckpointRef](#checkpointref) | | No |
| conversation_last_seq | integer | | Yes |
| decision | [Decision](#decision) | | No |
| entry_mode | [EntryMode](#entrymode) | | No |
| interrupted | boolean | | Yes |
| kind | string, <br>**Default:** command_started | | No |
@@ -18105,6 +18129,7 @@ Enum representing the deployment edition of the platform.
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| app_id | string | | Yes |
| derive_app_name | boolean | | No |
| goal_text | string | | Yes |
| model_config | [SessionModel](#sessionmodel) | | No |
| scenario | string | | Yes |
@@ -18273,6 +18298,7 @@ Create a Build, Edit, failed-run Fix, or checklist Fix session.
| canvas_read_only | boolean | | Yes |
| checkpoint | [CheckpointRef](#checkpointref) | | No |
| conversation_last_seq | integer | | Yes |
| decision | [Decision](#decision) | | No |
| entry_mode | [EntryMode](#entrymode) | | No |
| interrupted | boolean | | Yes |
| model | [SessionModel](#sessionmodel) | | No |
@@ -18294,6 +18320,7 @@ Create a Build, Edit, failed-run Fix, or checklist Fix session.
| canvas_read_only | boolean | | Yes |
| checkpoint | [CheckpointRef](#checkpointref) | | No |
| conversation_last_seq | integer | | Yes |
| decision | [Decision](#decision) | | No |
| entry_mode | [EntryMode](#entrymode) | | No |
| interrupted | boolean | | Yes |
| kind | string, <br>**Default:** state | | No |
@@ -18930,6 +18957,7 @@ declaration of an endpoint group
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| body | string | | Yes |
| diagnostics | [ object ] | | No |
| node_id | string | | No |
| title | string | | Yes |
| tone | string, <br>**Default:** danger | | No |
@@ -20853,6 +20881,15 @@ OAuth schema
| label | [I18nObject](#i18nobject) | The label of the option | Yes |
| value | string | The value of the option | Yes |
#### OptionInput
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| max_length | integer, <br>**Default:** 100 | | No |
| min_length | integer | | No |
| placeholder | string | | No |
| required | boolean, <br>**Default:** true | | No |
#### OutputErrorStrategy
Per-output failure handling strategy.