Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-6698: feat(agents): make conversation starters discoverable from the chat they run in (#7573)
Bohan Jiang26c04803c8d1
diff --git a/apps/docs/content/docs/agents-create.ja.mdx b/apps/docs/content/docs/agents-create.ja.mdxindex 556c7f8c73..5ac129ba91 100644--- a/apps/docs/content/docs/agents-create.ja.mdx+++ b/apps/docs/content/docs/agents-create.ja.mdx@@ -63,11 +63,13 @@ Build with AI には、Builder との対話のためにオンラインのランスキルは、エージェント間で再利用できる手法や資料の保存に向いています。このエージェントだけの長期的な要件は、指示に書いてください。-## おすすめの最初のアクション+## 会話の開始例-最初のチャットメッセージを送る前に、このエージェントが得意なことを伝える**おすすめの最初のアクション**を3件まで追加できます。各候補には短いラベルと完全なプロンプトがあります。選ぶと送信せずに入力欄へ入り、ユーザーが確認・編集できます。+最初のチャットメッセージを送る前に、このエージェントが得意なことを伝える**会話の開始例**を3件まで追加できます。新しいチャットを開いたときに、入力欄の上へ表示されます。各候補には短いラベルと完全なプロンプトがあります。選ぶと送信せずに入力欄へ入り、ユーザーが確認・編集できます。-空のままなら、チャットにはローカライズされた汎用候補が表示されます。エージェントの役割と境界に合わせた例のほうが通常は役立ちます。+エディターのすぐ下で、新しいチャットでの見え方をそのままプレビューできます。エージェントを編集できる人には、その空の状態に**開始例をカスタマイズ**のリンクが表示され、ここへ直接戻れます。++空のままなら、チャットにはローカライズされた汎用の初期値が表示されます。エージェントの役割と境界に合わせた例のほうが通常は役立ちます。## ランタイム・モデル・思考レベルの選択@@ -133,7 +135,7 @@ MCP 構成にはトークンが含まれることがあり、保存と表示の## エージェントの複製-複製すると、名前以外のほとんどの作業構成が引き継がれます。指示、おすすめの最初のアクション、スキル、カスタム引数、アバター、同時実行上限、Access 設定が含まれます。モデル、思考レベル、サービスティアも一緒に引き継がれますが、元のランタイムが利用できず、複製がやむを得ず別のランタイムに移る場合、この 3 つはクリアされるため選び直しが必要です。+複製すると、名前以外のほとんどの作業構成が引き継がれます。指示、会話の開始例、スキル、カスタム引数、アバター、同時実行上限、Access 設定が含まれます。モデル、思考レベル、サービスティアも一緒に引き継がれますが、元のランタイムが利用できず、複製がやむを得ず別のランタイムに移る場合、この 3 つはクリアされるため選び直しが必要です。環境変数の値と MCP 構成は、どんな場合も複製されません。新しいエージェントで設定し直してください。複製では、元のエージェントのランタイム紐づけと Access 設定が保持されます。diff --git a/apps/docs/content/docs/agents-create.ko.mdx b/apps/docs/content/docs/agents-create.ko.mdxindex 13e929c8bb..cf105f6984 100644--- a/apps/docs/content/docs/agents-create.ko.mdx+++ b/apps/docs/content/docs/agents-create.ko.mdx@@ -63,11 +63,13 @@ AI로 만들려면 Builder 대화를 진행할 온라인 런타임이 필요합스킬은 여러 에이전트가 재사용할 수 있는 방법과 자료를 저장하기에 적합합니다. 이 에이전트에만 적용되는 장기 요구 사항은 지시문에 작성하세요.-## 추천 첫 작업+## 대화 시작 예시-첫 채팅 메시지를 보내기 전에 이 에이전트가 잘하는 일을 보여 주는 **추천 첫 작업**을 최대 3개 추가할 수 있습니다. 각 추천에는 짧은 라벨과 전체 프롬프트가 있습니다. 선택하면 전송하지 않고 입력창에 채워져 사용자가 먼저 확인하거나 수정할 수 있습니다.+첫 채팅 메시지를 보내기 전에 이 에이전트가 잘하는 일을 보여 주는 **대화 시작 예시**를 최대 3개 추가할 수 있습니다. 새 채팅을 열면 입력창 위에 표시됩니다. 각 예시에는 짧은 라벨과 전체 프롬프트가 있습니다. 선택하면 전송하지 않고 입력창에 채워져 사용자가 먼저 확인하거나 수정할 수 있습니다.-목록을 비워 두면 채팅에 현지화된 범용 추천이 표시됩니다. 에이전트의 역할과 경계에 맞춘 예시가 보통 더 유용합니다.+편집기 바로 아래에서 새 채팅에 표시될 실제 모습을 미리 볼 수 있습니다. 에이전트를 편집할 수 있는 사람에게는 그 빈 화면에 **시작 예시 편집** 링크가 표시되어 이 설정으로 바로 이동합니다.++목록을 비워 두면 채팅에 현지화된 범용 기본값이 표시됩니다. 에이전트의 역할과 경계에 맞춘 예시가 보통 더 유용합니다.## 런타임, 모델, 사고 강도 선택@@ -133,7 +135,7 @@ MCP 설정에는 token이 포함될 수 있으며 저장 및 표시 규칙은## 에이전트 복사-복사하면 이름을 제외한 대부분의 작업 설정이 포함됩니다. 지시문, 추천 첫 작업, 스킬, 사용자 지정 인수, 아바타, 동시 실행 상한, Access 설정이 복사됩니다. 모델, 사고 강도, 속도 단계도 함께 복사되지만 원래 런타임을 사용할 수 없어 다른 런타임으로 바꿔야 하면 이 세 항목이 비워지므로 다시 선택해야 합니다.+복사하면 이름을 제외한 대부분의 작업 설정이 포함됩니다. 지시문, 대화 시작 예시, 스킬, 사용자 지정 인수, 아바타, 동시 실행 상한, Access 설정이 복사됩니다. 모델, 사고 강도, 속도 단계도 함께 복사되지만 원래 런타임을 사용할 수 없어 다른 런타임으로 바꿔야 하면 이 세 항목이 비워지므로 다시 선택해야 합니다.환경 변수 값과 MCP 설정은 어떤 경우에도 복사되지 않으며 새 에이전트에서 다시 설정해야 합니다. 복사본은 원래 에이전트의 런타임 연결과 Access 설정을 유지합니다.diff --git a/apps/docs/content/docs/agents-create.mdx b/apps/docs/content/docs/agents-create.mdxindex 19e0a544fc..be418f6bca 100644--- a/apps/docs/content/docs/agents-create.mdx+++ b/apps/docs/content/docs/agents-create.mdx@@ -63,11 +63,13 @@ During creation you can pick one or more [skills](/skills) from the workspace.Skills suit methods and material reused across agents; long-lived requirements that belong only to this agent go in the instructions.-## Suggested first actions+## Conversation starters-Add up to three **suggested first actions** to show people what this agent is good at before they send a first chat message. Each suggestion has a short label and a complete prompt. Selecting one fills the composer so the user can review or edit it; it never starts a run automatically.+Add up to three **conversation starters** to show people what this agent is good at before they send a first chat message. They appear when someone opens a new chat with the agent, above the composer. Each starter has a short label and a complete prompt. Selecting one fills the composer so the user can review or edit it; it never starts a run automatically.-If you leave the list empty, Chat shows localized general-purpose suggestions. Agent-specific examples are usually more useful because they can reflect the role and boundaries in the instructions.+The editor previews exactly what a new chat will show, and anyone who can edit the agent gets a **Customize starters** link in that empty state that deep-links back here.++If you leave the list empty, Chat shows localized general-purpose defaults. Agent-specific examples are usually more useful because they can reflect the role and boundaries in the instructions.## Runtime, model, and thinking level@@ -133,7 +135,7 @@ MCP configuration may contain tokens; its storage and display rules match enviro## Duplicating an agent-Duplicating carries over most working configuration except the name, including instructions, suggested first actions, skills, custom arguments, avatar, concurrency limit, and Access settings. The model, thinking level, and service tier come along too; if the original runtime is unavailable and the copy is forced onto another runtime, those three are cleared and must be re-selected.+Duplicating carries over most working configuration except the name, including instructions, conversation starters, skills, custom arguments, avatar, concurrency limit, and Access settings. The model, thinking level, and service tier come along too; if the original runtime is unavailable and the copy is forced onto another runtime, those three are cleared and must be re-selected.Environment variable values and MCP configuration are never copied and must be set again on the new agent. Duplication keeps the original agent's runtime binding and Access settings.diff --git a/apps/docs/content/docs/agents-create.zh.mdx b/apps/docs/content/docs/agents-create.zh.mdxindex 466796e54b..be586ae789 100644--- a/apps/docs/content/docs/agents-create.zh.mdx+++ b/apps/docs/content/docs/agents-create.zh.mdx@@ -63,11 +63,13 @@ import { Callout } from "fumadocs-ui/components/callout";Skill 适合保存可以跨智能体复用的方法和资料;只属于这名智能体的长期要求写在指令中。-## 推荐的初始操作+## 对话开场建议-最多添加三个**推荐的初始操作**,让用户在发送第一条对话消息前了解这个智能体擅长什么。每项包含一个简短标题和一条完整提示词。选择后只会填入输入框,用户可以先检查或修改,不会自动开始执行。+最多添加三条**对话开场建议**,让用户在发送第一条消息前了解这个智能体擅长什么。它们出现在别人与该智能体开始新对话时,位于输入框上方。每项包含一个简短标题和一条完整提示词。选择后只会填入输入框,用户可以先检查或修改,不会自动开始执行。-留空时,对话页会显示本地化的通用建议。针对智能体职责和边界编写的示例通常更有帮助。+编辑器下方会预览新对话的实际效果;有编辑权限的人还会在那个空状态里看到**自定义开场建议**入口,点击可直接跳回这里。++留空时,对话页会显示本地化的通用默认值。针对智能体职责和边界编写的示例通常更有帮助。## 选择运行时、模型和思考强度@@ -133,7 +135,7 @@ MCP 配置可能包含 token,保存与展示规则和环境变量相同。只## 复制智能体-复制会带上名称之外的大部分工作配置,包括指令、推荐的初始操作、skill、自定义参数、头像、并发上限和 Access 设置。模型、思考强度和速度档也会一并带走;如果原运行时不可用、复制被迫换到其他运行时,这三项会清空,需要重新选择。+复制会带上名称之外的大部分工作配置,包括指令、对话开场建议、skill、自定义参数、头像、并发上限和 Access 设置。模型、思考强度和速度档也会一并带走;如果原运行时不可用、复制被迫换到其他运行时,这三项会清空,需要重新选择。环境变量的值和 MCP 配置在任何情况下都不会复制,需要在新智能体中重新设置。复制会保留原智能体的运行时绑定和 Access 设置。diff --git a/apps/docs/content/docs/agents.ja.mdx b/apps/docs/content/docs/agents.ja.mdxindex 4792593b4e..62eec0646b 100644--- a/apps/docs/content/docs/agents.ja.mdx+++ b/apps/docs/content/docs/agents.ja.mdx@@ -15,7 +15,7 @@ import { Callout } from "fumadocs-ui/components/callout";|---|---|| **名前・アバター・説明** | それが誰で、何に向いているかをチームに伝えます。説明は表示専用で、実行プロンプトには入りません。 || **指示** | 職責、仕事の進め方、境界、成果物の要件を定めます。毎回の実行で使われます。 |-| **おすすめの最初のアクション** | エージェント別のチャット開始例を3件まで提示します。選ぶと送信せずに入力欄へ入ります。 |+| **会話の開始例** | エージェント別の例を3件まで提示し、新しいチャットを開いたときに表示します。選ぶと送信せずに入力欄へ入ります。 || **スキル** | 再利用できる手法、参考資料、補助ファイルを提供します。 || **ランタイム・モデル・思考レベル** | どのランタイムで、どの AI コーディングツールとモデルで実行するかを決めます。一部のツール(Codex など)ではサービスティアも選べます。 || **Access** | どのメンバーが実行できるかを決めます。 |diff --git a/apps/docs/content/docs/agents.ko.mdx b/apps/docs/content/docs/agents.ko.mdxindex e5912cc685..07409bdf75 100644--- a/apps/docs/content/docs/agents.ko.mdx+++ b/apps/docs/content/docs/agents.ko.mdx@@ -15,7 +15,7 @@ import { Callout } from "fumadocs-ui/components/callout";|---|---|| **이름, 아바타, 설명** | 팀에 에이전트가 누구이며 어떤 작업에 적합한지 알려 줍니다. 설명은 표시용이며 실행 프롬프트에 포함되지 않습니다. || **지시문** | 역할, 작업 방식, 경계, 결과물 요구 사항을 규정합니다. 모든 실행에서 사용됩니다. |-| **추천 첫 작업** | 에이전트별 채팅 시작 예시를 최대 3개 제공합니다. 선택하면 전송하지 않고 입력창에 채웁니다. |+| **대화 시작 예시** | 에이전트별 예시를 최대 3개 제공하며, 새 채팅을 열 때 표시됩니다. 선택하면 전송하지 않고 입력창에 채웁니다. || **스킬** | 재사용 가능한 방법, 참고 자료, 지원 파일을 제공합니다. || **런타임, 모델, 사고 강도** | 어느 런타임에서 어떤 AI 코딩 도구와 모델을 사용할지 결정합니다. Codex 같은 일부 도구에서는 속도 단계도 선택할 수 있습니다. || **Access** | 어떤 멤버가 에이전트를 실행할 수 있는지 결정합니다. |diff --git a/apps/docs/content/docs/agents.mdx b/apps/docs/content/docs/agents.mdxindex 52ed453202..458ac643d0 100644--- a/apps/docs/content/docs/agents.mdx+++ b/apps/docs/content/docs/agents.mdx@@ -15,7 +15,7 @@ An agent is not a continuously running process. It is a reusable identity and co|---|---|| **Name, avatar, and description** | Tell the team who the agent is and what it is good at. The description is display-only and never enters the execution prompt. || **Instructions** | Define its responsibilities, working style, boundaries, and delivery requirements. Used on every run. |-| **Suggested first actions** | Give people up to three agent-specific examples for starting a chat. Selecting one fills the composer without sending. |+| **Conversation starters** | Give people up to three agent-specific examples, shown when they open a new chat with the agent. Selecting one fills the composer without sending. || **Skills** | Provide reusable methods, reference material, and supporting files. || **Runtime, model, and thinking level** | Decide which runtime, AI coding tool, and model it runs on; some tools (such as Codex) also offer a service tier. || **Access** | Decides which members can run it. |diff --git a/apps/docs/content/docs/agents.zh.mdx b/apps/docs/content/docs/agents.zh.mdxindex eccc510408..4b3195914f 100644--- a/apps/docs/content/docs/agents.zh.mdx+++ b/apps/docs/content/docs/agents.zh.mdx@@ -15,7 +15,7 @@ import { Callout } from "fumadocs-ui/components/callout";|---|---|| **名称、头像和描述** | 让团队知道它是谁、适合做什么。描述只用于展示,不会进入执行提示。 || **指令** | 规定它的职责、工作方式、边界和交付要求。每次执行都会使用。 |-| **推荐的初始操作** | 提供最多三个针对该智能体的对话起步示例。选择后只会填入输入框,不会发送。 |+| **对话开场建议** | 提供最多三条针对该智能体的示例,出现在别人与该智能体开始新对话时。选择后只会填入输入框,不会发送。 || **Skills** | 提供可以复用的方法、参考资料和支持文件。 || **运行时、模型和思考强度** | 决定在哪个运行时、用哪款 AI 编程工具和哪个模型执行;部分工具(如 Codex)还可选择速度档。 || **Access** | 决定哪些成员可以运行它。 |diff --git a/packages/core/agents/index.ts b/packages/core/agents/index.tsindex e22fa7070b..8143c18810 100644--- a/packages/core/agents/index.ts+++ b/packages/core/agents/index.ts@@ -12,6 +12,8 @@ export * from "./use-update-agent-allowlist";export * from "./use-agent-activity";export * from "./use-workspace-presence-prefetch";export * from "./constants";+export * from "./starter-prompts";+export * from "./use-customize-starter-prompts-href";export * from "./visibility-label";export * from "./use-workspace-agent-availability";export * from "./mcp-support";diff --git a/packages/core/agents/starter-prompts.test.ts b/packages/core/agents/starter-prompts.test.tsnew file mode 100644index 0000000000..619b00b6ba--- /dev/null+++ b/packages/core/agents/starter-prompts.test.ts@@ -0,0 +1,81 @@+// @vitest-environment node++import { describe, expect, it } from "vitest";+import {+ canCustomizeStarterPrompts,+ selectStarterPrompts,+} from "./starter-prompts";++const fallback = [+ { label: "Fallback one", prompt: "Fallback prompt one." },+ { label: "Fallback two", prompt: "Fallback prompt two." },+];++describe("selectStarterPrompts", () => {+ it("falls back when the agent configured nothing", () => {+ expect(selectStarterPrompts([], fallback)).toEqual({+ prompts: fallback,+ isFallback: true,+ });+ expect(selectStarterPrompts(undefined, fallback).isFallback).toBe(true);+ expect(selectStarterPrompts(null, fallback).isFallback).toBe(true);+ });++ it("keeps only rows where both halves carry text", () => {+ const result = selectStarterPrompts(+ [+ { label: "Review the release PR", prompt: "Review it and list risks." },+ { label: " ", prompt: "Orphan prompt." },+ { label: "Orphan label", prompt: " " },+ ],+ fallback,+ );++ expect(result).toEqual({+ prompts: [+ { label: "Review the release PR", prompt: "Review it and list risks." },+ ],+ isFallback: false,+ });+ });++ it("falls back when every configured row is half-filled", () => {+ expect(+ selectStarterPrompts([{ label: "Orphan", prompt: "" }], fallback),+ ).toEqual({ prompts: fallback, isFallback: true });+ });+});++describe("canCustomizeStarterPrompts", () => {+ const live = { archived_at: null };+ const allowed = { starterPromptsSupported: true, canEditAgent: true };++ it("offers the editor to someone who may edit a live agent", () => {+ expect(canCustomizeStarterPrompts(live, allowed)).toBe(true);+ });++ it("stays silent for a reader", () => {+ expect(+ canCustomizeStarterPrompts(live, { ...allowed, canEditAgent: false }),+ ).toBe(false);+ });++ it("stays silent on a backend that drops starter prompts", () => {+ expect(+ canCustomizeStarterPrompts(live, {+ ...allowed,+ starterPromptsSupported: false,+ }),+ ).toBe(false);+ });++ it("stays silent for an archived agent, editor or not", () => {+ expect(+ canCustomizeStarterPrompts({ archived_at: "2026-08-01T00:00:00Z" }, allowed),+ ).toBe(false);+ });++ it("stays silent while no agent is resolved", () => {+ expect(canCustomizeStarterPrompts(null, allowed)).toBe(false);+ });+});diff --git a/packages/core/agents/starter-prompts.ts b/packages/core/agents/starter-prompts.tsnew file mode 100644index 0000000000..fb07006e53--- /dev/null+++ b/packages/core/agents/starter-prompts.ts@@ -0,0 +1,48 @@+import type { Agent, AgentStarterPrompt } from "../types";++/**+ * Resolve what a new chat with this agent actually shows.+ *+ * A configured suggestion only counts once BOTH halves carry text: the editor+ * lets an author add a row and save is blocked while it is half-filled, but a+ * malformed payload from an older client must not render a blank button.+ *+ * When nothing complete survives, the caller's localized fallbacks are used+ * and `isFallback` says so — the settings preview needs to tell an author+ * "these are the defaults" rather than implying they configured them.+ */+export function selectStarterPrompts(+ configured: AgentStarterPrompt[] | undefined | null,+ fallback: AgentStarterPrompt[],+): { prompts: AgentStarterPrompt[]; isFallback: boolean } {+ const complete = (configured ?? []).filter(+ (item) => item.label.trim() !== "" && item.prompt.trim() !== "",+ );+ return complete.length > 0+ ? { prompts: complete, isFallback: false }+ : { prompts: fallback, isFallback: true };+}++/**+ * Whether this viewer should be offered a way to edit the agent's starter+ * prompts from the chat empty state those prompts render in.+ *+ * Three independent reasons to stay silent, each of which would otherwise+ * produce a link that lies:+ *+ * - no agent, or an archived one: its conversations are read-only, so+ * editing its starters changes nothing anyone will see,+ * - a backend that does not persist starter prompts: the Instructions tab+ * renders no editor there, so the link lands somewhere that cannot honour+ * it,+ * - a viewer who cannot edit the agent: a reader would arrive at a page they+ * have no write access to.+ */+export function canCustomizeStarterPrompts(+ agent: Pick<Agent, "archived_at"> | null,+ opts: { starterPromptsSupported: boolean; canEditAgent: boolean },+): boolean {+ if (!agent || agent.archived_at) return false;+ if (!opts.starterPromptsSupported) return false;+ return opts.canEditAgent;+}diff --git a/packages/core/agents/use-customize-starter-prompts-href.ts b/packages/core/agents/use-customize-starter-prompts-href.tsnew file mode 100644index 0000000000..968a884dc3--- /dev/null+++ b/packages/core/agents/use-customize-starter-prompts-href.ts@@ -0,0 +1,36 @@+"use client";++import type { Agent } from "../types";+import { useConfigStore } from "../config";+import { useWorkspacePaths } from "../paths";+import { useAgentPermissions } from "../permissions";+import { canCustomizeStarterPrompts } from "./starter-prompts";++/**+ * Where the "customize" affordance in a chat's empty state should point, or+ * `null` when this viewer should not see one at all.+ *+ * Both chat surfaces render that empty state from separate call sites, so the+ * wiring lives here and the rule itself in `canCustomizeStarterPrompts`.+ */+export function useCustomizeStarterPromptsHref(+ agent: Agent | null,+ wsId: string,+): string | null {+ const starterPromptsSupported = useConfigStore(+ (state) => state.agentStarterPromptsSupported,+ );+ const paths = useWorkspacePaths();+ const { canEdit } = useAgentPermissions(agent, wsId);++ if (+ !agent ||+ !canCustomizeStarterPrompts(agent, {+ starterPromptsSupported,+ canEditAgent: canEdit.allowed,+ })+ ) {+ return null;+ }+ return paths.agentStarterPrompts(agent.id);+}diff --git a/packages/core/paths/index.ts b/packages/core/paths/index.tsindex f89d529304..01d154ac31 100644--- a/packages/core/paths/index.ts+++ b/packages/core/paths/index.ts@@ -1,4 +1,8 @@-export { paths, isGlobalPath } from "./paths";+export {+ paths,+ isGlobalPath,+ AGENT_FOCUS_STARTER_PROMPTS,+} from "./paths";export type { WorkspacePaths } from "./paths";export { RESERVED_SLUGS, isReservedSlug } from "./reserved-slugs";export {diff --git a/packages/core/paths/paths.ts b/packages/core/paths/paths.tsindex 862b37f08e..460b1b1020 100644--- a/packages/core/paths/paths.ts+++ b/packages/core/paths/paths.ts@@ -14,6 +14,14 @@const encode = (id: string) => encodeURIComponent(id);+/**+ * `?focus=` token that scrolls the agent's Instructions tab to its+ * conversation-starters editor and flashes it. Lives here because it is URL+ * vocabulary: `agentStarterPrompts()` writes it and the tab reads it, and a+ * shared constant is what stops the two from drifting apart.+ */+export const AGENT_FOCUS_STARTER_PROMPTS = "starter_prompts";+function workspaceScoped(slug: string) {const ws = `/${encode(slug)}`;return {@@ -37,6 +45,11 @@ function workspaceScoped(slug: string) {newAgentAiSession: (sessionId: string) =>`${ws}/agents/new/ai/${encode(sessionId)}`,agentDetail: (id: string) => `${ws}/agents/${encode(id)}`,+ // Deep link behind "customize" in a chat's empty state: the agent's+ // Instructions tab, scrolled to the conversation starters that produced+ // the buttons the viewer just looked at.+ agentStarterPrompts: (id: string) =>+ `${ws}/agents/${encode(id)}?view=instructions&focus=${AGENT_FOCUS_STARTER_PROMPTS}`,memberDetail: (id: string) => `${ws}/members/${encode(id)}`,squads: () => `${ws}/squads`,squadDetail: (id: string) => `${ws}/squads/${encode(id)}`,diff --git a/packages/views/agents/components/starter-prompts-editor.test.tsx b/packages/views/agents/components/starter-prompts-editor.test.tsxnew file mode 100644index 0000000000..496ee934f0--- /dev/null+++ b/packages/views/agents/components/starter-prompts-editor.test.tsx@@ -0,0 +1,66 @@+// @vitest-environment jsdom++import { cleanup, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it, vi } from "vitest";+import { I18nProvider } from "@multica/core/i18n/react";+import type { AgentStarterPrompt } from "@multica/core/types";+import enAgents from "../../locales/en/agents.json";+import enChat from "../../locales/en/chat.json";+import { StarterPromptsEditor } from "./starter-prompts-editor";++// The selection matrix (which rows count, when the fallback wins) is covered+// once in packages/core/agents/starter-prompts.test.ts. This suite only+// proves the editor previews what a new chat would actually show.+function renderEditor(value: AgentStarterPrompt[]) {+ render(+ <I18nProvider+ locale="en"+ resources={{ en: { agents: enAgents, chat: enChat } }}+ >+ <StarterPromptsEditor value={value} onChange={vi.fn()} />+ </I18nProvider>,+ );+}++describe("StarterPromptsEditor preview", () => {+ afterEach(cleanup);++ it("previews the built-in defaults and says so when nothing is configured", () => {+ renderEditor([]);++ expect(screen.getByText("Preview of a new chat")).toBeInTheDocument();+ expect(screen.getByText("What can you help with?")).toBeInTheDocument();+ expect(+ screen.getByText(+ "These are the built-in defaults. Add a suggestion above to replace all three.",+ ),+ ).toBeInTheDocument();+ });++ it("previews the configured labels and drops the defaults note", () => {+ renderEditor([+ { label: "Review the release PR", prompt: "Review it and list risks." },+ ]);++ // Twice: once as the editable label input's value, once in the preview.+ expect(+ screen.getByDisplayValue("Review the release PR"),+ ).toBeInTheDocument();+ expect(screen.getByText("Review the release PR")).toBeInTheDocument();+ expect(screen.queryByText("What can you help with?")).toBeNull();+ expect(+ screen.queryByText(/These are the built-in defaults/),+ ).toBeNull();+ });++ it("keeps previewing the defaults while a row is still half-filled", () => {+ renderEditor([{ label: "Draft a plan", prompt: "" }]);++ expect(screen.getByText("What can you help with?")).toBeInTheDocument();+ expect(+ screen.getByText(+ "Complete or remove each suggestion before saving.",+ ),+ ).toBeInTheDocument();+ });+});diff --git a/packages/views/agents/components/starter-prompts-editor.tsx b/packages/views/agents/components/starter-prompts-editor.tsxindex ba6f544376..18a4220cb0 100644--- a/packages/views/agents/components/starter-prompts-editor.tsx+++ b/packages/views/agents/components/starter-prompts-editor.tsx@@ -5,11 +5,16 @@ import {AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH,AGENT_STARTER_PROMPT_MAX_LENGTH,AGENT_STARTER_PROMPTS_MAX,+ selectStarterPrompts,} from "@multica/core/agents";import type { AgentStarterPrompt } from "@multica/core/types";import { Button } from "@multica/ui/components/ui/button";import { Input } from "@multica/ui/components/ui/input";import { Textarea } from "@multica/ui/components/ui/textarea";+import {+ StarterPromptList,+ useFallbackStarterPrompts,+} from "../../chat/components/starter-prompt-list";import { useT } from "../../i18n";export function StarterPromptsEditor({@@ -25,6 +30,12 @@ export function StarterPromptsEditor({const hasIncompletePrompt = value.some((item) => !item.label.trim() || !item.prompt.trim(),);+ // Rendered through the same component and the same resolver the chat empty+ // state uses, so the preview cannot drift from what it previews — including+ // the fallback rule, which is how an author learns that the three+ // suggestions they never configured are defaults they can replace.+ const fallbackPrompts = useFallbackStarterPrompts();+ const preview = selectStarterPrompts(value, fallbackPrompts);const update = (index: number,@@ -110,6 +121,21 @@ export function StarterPromptsEditor({{t(($) => $.starter_prompts.incomplete)}</p>) : null}++ <div className="rounded-lg border border-dashed bg-muted/20 px-3 py-3">+ <p className="text-caption font-medium text-muted-foreground">+ {t(($) => $.starter_prompts.preview_label)}+ </p>+ <StarterPromptList+ className="mt-2 max-w-sm"+ prompts={preview.prompts}+ />+ {preview.isFallback ? (+ <p className="mt-2 text-caption leading-5 text-muted-foreground">+ {t(($) => $.starter_prompts.preview_defaults)}+ </p>+ ) : null}+ </div></div>);}diff --git a/packages/views/agents/components/tabs/instructions-tab.test.tsx b/packages/views/agents/components/tabs/instructions-tab.test.tsxindex f29122d99e..f32c2c9d23 100644--- a/packages/views/agents/components/tabs/instructions-tab.test.tsx+++ b/packages/views/agents/components/tabs/instructions-tab.test.tsx@@ -8,9 +8,16 @@ import { I18nProvider } from "@multica/core/i18n/react";import type { Agent } from "@multica/core/types";import enCommon from "../../../locales/en/common.json";import enAgents from "../../../locales/en/agents.json";+// The starter-prompt editor previews the chat empty state, so it reads the+// chat namespace for the built-in defaults it renders when nothing is set.+import enChat from "../../../locales/en/chat.json";+import { NavigationProvider } from "../../../navigation";+import type { NavigationAdapter } from "../../../navigation";import { InstructionsTab } from "./instructions-tab";-const TEST_RESOURCES = { en: { common: enCommon, agents: enAgents } };+const TEST_RESOURCES = {+ en: { common: enCommon, agents: enAgents, chat: enChat },+};const persistedPrompt = {label: "Review a PR",prompt: "Review the open pull request.",@@ -157,7 +164,7 @@ describe("InstructionsTab persisted-state synchronization", () => {render(tab(baseAgent, onSave));expect(- screen.queryByText("Suggested first actions"),+ screen.queryByText("Conversation starters"),).not.toBeInTheDocument();const instructions = screen.getByLabelText("System prompt");await user.clear(instructions);@@ -169,3 +176,136 @@ describe("InstructionsTab persisted-state synchronization", () => {});});});++// The "customize" link in a chat's empty state lands here with ?focus=. The+// tab must bring the editor into view and then clear the param, so a refresh+// or a later tab switch does not replay the flash.+describe("InstructionsTab starter-prompts deep link", () => {+ // Mirrors FOCUS_FLASH_MS in instructions-tab.tsx.+ const FLASH_MS = 1600;++ beforeEach(() => {+ configStore.getState().setAgentStarterPromptsSupported(true);+ });++ afterEach(() => {+ act(() => {+ configStore.getState().setAgentStarterPromptsSupported(false);+ });+ });++ // A fresh adapter object per render — what the web platform actually hands+ // down, and the condition the flash-timer regression below depends on.+ const adapter = (search: string, replace = vi.fn()): NavigationAdapter => ({+ push: vi.fn(),+ replace,+ back: vi.fn(),+ pathname: "/acme/agents/agent-1",+ searchParams: new URLSearchParams(search),+ getShareableUrl: (path: string) => `https://app.test${path}`,+ });++ function renderWithSearch(search: string) {+ const replace = vi.fn();+ const scrollIntoView = vi.fn();+ // jsdom has no layout, so the method does not exist at all.+ Element.prototype.scrollIntoView = scrollIntoView;+ const tree = (value: NavigationAdapter, agent: Agent) => (+ <I18nProvider locale="en" resources={TEST_RESOURCES}>+ <NavigationProvider value={value}>+ <InstructionsTab agent={agent} onSave={vi.fn()} />+ </NavigationProvider>+ </I18nProvider>+ );+ const { rerender } = render(tree(adapter(search, replace), baseAgent));+ return {+ replace,+ scrollIntoView,+ /**+ * Re-render as the platform does: a new adapter object every time, and+ * optionally a different agent for an in-place navigation between two+ * agent pages on the same route.+ */+ settleUrl: (next: string, agent: Agent = baseAgent) =>+ rerender(tree(adapter(next, replace), agent)),+ };+ }++ const ringed = () =>+ document.querySelector<HTMLElement>("[class*='ring-brand']");++ it("scrolls to the editor and drops the focus param, keeping the view", () => {+ const { replace, scrollIntoView } = renderWithSearch(+ "view=instructions&focus=starter_prompts",+ );++ expect(scrollIntoView).toHaveBeenCalledWith({ block: "nearest" });+ expect(replace).toHaveBeenCalledWith(+ "/acme/agents/agent-1?view=instructions",+ );+ });++ // Regression: the flash timer must not hang off the effect's cleanup. The+ // navigation adapter is not referentially stable, so React would run that+ // cleanup on the very next render and cancel the timeout, leaving the ring+ // on the editor permanently.+ it("ends the flash instead of ringing the editor forever", () => {+ vi.useFakeTimers();+ try {+ const { settleUrl } = renderWithSearch(+ "view=instructions&focus=starter_prompts",+ );+ expect(ringed()).not.toBeNull();++ // The stripped URL arrives on a new adapter object, re-running the+ // effect. A flash timer owned by that effect's cleanup dies here.+ act(() => settleUrl("view=instructions"));+ act(() => {+ vi.advanceTimersByTime(FLASH_MS + 400);+ });++ expect(ringed()).toBeNull();+ } finally {+ vi.useRealTimers();+ }+ });++ // Regression: the guard against re-firing before the stripped URL lands must+ // not become a one-shot-per-mount latch. A chat window left open beside this+ // page can send the very same link again, and it has to land again.+ it("focuses again when the link is clicked a second time", () => {+ const { replace, scrollIntoView, settleUrl } = renderWithSearch(+ "view=instructions&focus=starter_prompts",+ );+ expect(scrollIntoView).toHaveBeenCalledTimes(1);++ act(() => settleUrl("view=instructions"));+ act(() => settleUrl("view=instructions&focus=starter_prompts"));++ expect(scrollIntoView).toHaveBeenCalledTimes(2);+ expect(replace).toHaveBeenCalledTimes(2);+ expect(ringed()).not.toBeNull();+ });++ // Regression: the same guard is keyed by agent, so navigating between two+ // agent pages on this route does not swallow the second agent's link.+ it("focuses a link aimed at a different agent", () => {+ const other: Agent = { ...baseAgent, id: "agent-2" };+ const { scrollIntoView, settleUrl } = renderWithSearch(+ "view=instructions&focus=starter_prompts",+ );+ expect(scrollIntoView).toHaveBeenCalledTimes(1);++ // The URL still carries focus — it is the NEXT agent's deep link.+ act(() => settleUrl("view=instructions&focus=starter_prompts", other));++ expect(scrollIntoView).toHaveBeenCalledTimes(2);+ });++ it("ignores an ordinary visit", () => {+ const { replace, scrollIntoView } = renderWithSearch("view=instructions");++ expect(scrollIntoView).not.toHaveBeenCalled();+ expect(replace).not.toHaveBeenCalled();+ });+});diff --git a/packages/views/agents/components/tabs/instructions-tab.tsx b/packages/views/agents/components/tabs/instructions-tab.tsxindex cce8c4361e..7df25615fe 100644--- a/packages/views/agents/components/tabs/instructions-tab.tsx+++ b/packages/views/agents/components/tabs/instructions-tab.tsx@@ -3,13 +3,19 @@import { useEffect, useRef, useState } from "react";import { Loader2, Save } from "lucide-react";import { useConfigStore } from "@multica/core/config";+import { AGENT_FOCUS_STARTER_PROMPTS } from "@multica/core/paths";import type { Agent, AgentStarterPrompt } from "@multica/core/types";import { Button } from "@multica/ui/components/ui/button";import { Textarea } from "@multica/ui/components/ui/textarea";+import { cn } from "@multica/ui/lib/utils";import { useT } from "../../../i18n";+import { useOptionalNavigation } from "../../../navigation";import { StarterPromptsEditor } from "../starter-prompts-editor";+/** How long the deep-linked starter-prompts editor stays ringed. */+const FOCUS_FLASH_MS = 1600;+export function InstructionsTab({agent,onSave,@@ -23,6 +29,10 @@ export function InstructionsTab({onDirtyChange?: (dirty: boolean) => void;}) {const { t } = useT("agents");+ // Optional read: this tab is a leaf that tests mount in isolation, and its+ // only navigation-dependent behaviour (the deep-link focus below) degrades+ // to "no highlight" when there is no adapter.+ const navigation = useOptionalNavigation();const starterPromptsSupported = useConfigStore((state) => state.agentStarterPromptsSupported,);@@ -31,6 +41,10 @@ export function InstructionsTab({agent.starter_prompts ?? [],);const [saving, setSaving] = useState(false);+ const [starterPromptsFocused, setStarterPromptsFocused] = useState(false);+ const starterPromptsRef = useRef<HTMLDivElement | null>(null);+ const focusHandledForAgentRef = useRef<string | null>(null);+ const focusFlashTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);const [systemOpen, setSystemOpen] = useState(false);const persistedStarterPromptsKey = JSON.stringify(agent.starter_prompts ?? [],@@ -99,6 +113,59 @@ export function InstructionsTab({}}, [agent.id, agent.instructions, persistedStarterPromptsKey, saving]);+ // Arriving from "customize" in a chat's empty state: bring the starter+ // prompts into view and flash them, so the deep link lands ON the setting+ // rather than on a long page that happens to contain it. The param is+ // consumed on arrival, so a refresh never replays an animation nobody asked+ // for — but every fresh click must land, including a second one from a chat+ // window still open beside this page, and one aimed at a different agent.+ useEffect(() => {+ if (!navigation || !starterPromptsSupported) return;++ if (navigation.searchParams.get("focus") !== AGENT_FOCUS_STARTER_PROMPTS) {+ // The param is gone: either this is an ordinary visit, or the `replace`+ // below has landed. Re-arm so the next click focuses again.+ focusHandledForAgentRef.current = null;+ return;+ }+ // Guard against re-running before the stripped URL arrives — the adapter+ // object is not referentially stable, so this effect re-runs on renders+ // the `replace` below itself causes. Keyed by agent so a deep link aimed+ // at a DIFFERENT agent is never swallowed by this latch.+ if (focusHandledForAgentRef.current === agent.id) return;+ focusHandledForAgentRef.current = agent.id;++ // `block: "nearest"` deliberately: native scrollIntoView scrolls every+ // scrollable ancestor, which on desktop drags the shell itself (#3929).+ starterPromptsRef.current?.scrollIntoView?.({ block: "nearest" });+ setStarterPromptsFocused(true);++ const params = new URLSearchParams(navigation.searchParams);+ params.delete("focus");+ const query = params.toString();+ navigation.replace(+ query ? `${navigation.pathname}?${query}` : navigation.pathname,+ );++ // The timer is held in a ref, NOT returned as this effect's cleanup: the+ // adapter object is unstable, so a cleanup would be invoked on the very+ // next render and cancel the flash before it ever ended, leaving the ring+ // on permanently. Unmount clears it below. A repeat focus restarts the+ // window rather than inheriting the previous one's remaining time.+ if (focusFlashTimerRef.current) clearTimeout(focusFlashTimerRef.current);+ focusFlashTimerRef.current = setTimeout(+ () => setStarterPromptsFocused(false),+ FOCUS_FLASH_MS,+ );+ }, [agent.id, navigation, starterPromptsSupported]);++ useEffect(+ () => () => {+ if (focusFlashTimerRef.current) clearTimeout(focusFlashTimerRef.current);+ },+ [],+ );+// Report dirty state up so the parent can guard tab switches.useEffect(() => {onDirtyChange?.(isDirty);@@ -183,10 +250,18 @@ export function InstructionsTab({</div>{starterPromptsSupported ? (- <StarterPromptsEditor- value={starterPrompts}- onChange={setStarterPrompts}- />+ <div+ ref={starterPromptsRef}+ className={cn(+ "scroll-mt-4 rounded-lg transition-shadow duration-500",+ starterPromptsFocused && "ring-2 ring-brand/50 ring-offset-2 ring-offset-background",+ )}+ >+ <StarterPromptsEditor+ value={starterPrompts}+ onChange={setStarterPrompts}+ />+ </div>) : null}<div className="flex items-center justify-end gap-3">diff --git a/packages/views/chat/chat-page.tsx b/packages/views/chat/chat-page.tsxindex 49b0261e22..11b11d2f30 100644--- a/packages/views/chat/chat-page.tsx+++ b/packages/views/chat/chat-page.tsx@@ -287,6 +287,7 @@ export function ChatPage() {agent={c.activeAgent}hasSessions={c.sessions.length > 0}onPickPrompt={c.prefillStarterPrompt}+ customizeHref={c.customizeStarterPromptsHref}/>)}diff --git a/packages/views/chat/components/chat-empty-state.test.tsx b/packages/views/chat/components/chat-empty-state.test.tsxindex 8afe8059b1..2f26ef21c2 100644--- a/packages/views/chat/components/chat-empty-state.test.tsx+++ b/packages/views/chat/components/chat-empty-state.test.tsx@@ -5,6 +5,8 @@ import { afterEach, describe, expect, it, vi } from "vitest";import { I18nProvider } from "@multica/core/i18n/react";import type { Agent } from "@multica/core/types";import enChat from "../../locales/en/chat.json";+import { NavigationProvider } from "../../navigation";+import type { NavigationAdapter } from "../../navigation";vi.mock("../../common/actor-avatar", () => ({ActorAvatar: () => <div data-testid="agent-avatar" />,@@ -20,15 +22,27 @@ const agent = (starterPrompts: Agent["starter_prompts"] = []): Agent =>starter_prompts: starterPrompts,}) as Agent;-function renderEmptyState(value: Agent) {+const adapter = (): NavigationAdapter => ({+ push: vi.fn(),+ replace: vi.fn(),+ back: vi.fn(),+ pathname: "/acme/chat",+ searchParams: new URLSearchParams(),+ getShareableUrl: (path: string) => `https://app.test${path}`,+});++function renderEmptyState(value: Agent, customizeHref: string | null = null) {const onPickPrompt = vi.fn();render(<I18nProvider locale="en" resources={{ en: { chat: enChat } }}>- <EmptyState- agent={value}- hasSessions={false}- onPickPrompt={onPickPrompt}- />+ <NavigationProvider value={adapter()}>+ <EmptyState+ agent={value}+ hasSessions={false}+ onPickPrompt={onPickPrompt}+ customizeHref={customizeHref}+ />+ </NavigationProvider></I18nProvider>,);return onPickPrompt;@@ -69,3 +83,28 @@ describe("chat empty-state starter prompts", () => {);});});++// Who may see "customize" is decided by the container (chat-window reads the+// agent permission and the backend capability); this suite only proves the+// empty state renders the affordance exactly when it is handed a target.+describe("chat empty-state customize affordance", () => {+ afterEach(cleanup);++ const href = "/acme/agents/agent-1?view=instructions&focus=starter_prompts";++ it("links a viewer who may edit the agent to its starter prompts", () => {+ renderEmptyState(agent(), href);++ expect(+ screen.getByRole("link", { name: "Customize starters" }),+ ).toHaveAttribute("href", href);+ });++ it("stays out of the DOM for a viewer who may not edit the agent", () => {+ renderEmptyState(agent());++ expect(+ screen.queryByRole("link", { name: "Customize starters" }),+ ).toBeNull();+ });+});diff --git a/packages/views/chat/components/chat-empty-state.tsx b/packages/views/chat/components/chat-empty-state.tsxindex 5d3c8a2375..918490c7f5 100644--- a/packages/views/chat/components/chat-empty-state.tsx+++ b/packages/views/chat/components/chat-empty-state.tsx@@ -1,41 +1,42 @@"use client";-import type { Agent, AgentStarterPrompt } from "@multica/core/types";+import { Settings2 } from "lucide-react";+import { selectStarterPrompts } from "@multica/core/agents";+import type { Agent } from "@multica/core/types";import { ActorAvatar } from "../../common/actor-avatar";import { useT } from "../../i18n";+import { AppLink } from "../../navigation";+import {+ StarterPromptList,+ useFallbackStarterPrompts,+} from "./starter-prompt-list";/** Empty compose placeholder shown before the first user message. */export function EmptyState({agent,hasSessions = true,onPickPrompt,+ customizeHref = null,}: {agent: Agent | null;hasSessions?: boolean;onPickPrompt: (prompt: string) => void;+ /**+ * Where "customize" sends this viewer, or `null` to hide the affordance.+ * The container resolves it: only someone who may edit THIS agent on a+ * backend that persists starter prompts gets a link. Keeping it a prop+ * leaves this component presentational — and keeps the link out of the DOM+ * entirely for readers, rather than rendering a disabled tease.+ */+ customizeHref?: string | null;}) {const { t } = useT("chat");const description = agent?.description?.trim();-- const fallbackPrompts: AgentStarterPrompt[] = [- {- label: t(($) => $.starter_prompts.capabilities.label),- prompt: t(($) => $.starter_prompts.capabilities.prompt),- },- {- label: t(($) => $.starter_prompts.first_task.label),- prompt: t(($) => $.starter_prompts.first_task.prompt),- },- {- label: t(($) => $.starter_prompts.recommend.label),- prompt: t(($) => $.starter_prompts.recommend.prompt),- },- ];- const configuredPrompts = (agent?.starter_prompts ?? []).filter(- (item) => item.label.trim() && item.prompt.trim(),+ const fallbackPrompts = useFallbackStarterPrompts();+ const { prompts } = selectStarterPrompts(+ agent?.starter_prompts,+ fallbackPrompts,);- const prompts =- configuredPrompts.length > 0 ? configuredPrompts : fallbackPrompts;return (<div className="flex min-h-0 flex-1 flex-col items-center justify-center-safe gap-5 overflow-y-auto px-6 py-8">@@ -67,16 +68,18 @@ export function EmptyState({className="w-full max-w-sm space-y-2"aria-label={t(($) => $.starter_prompts.aria_label)}>- {prompts.map((item, index) => (- <button- key={index}- type="button"- onClick={() => onPickPrompt(item.prompt)}- className="w-full rounded-lg border border-border bg-card px-3 py-2.5 text-left text-body text-foreground transition-colors hover:border-brand/40 hover:bg-accent"- >- {item.label}- </button>- ))}+ <StarterPromptList prompts={prompts} onPick={onPickPrompt} />+ {customizeHref ? (+ <div className="flex justify-center pt-1">+ <AppLink+ href={customizeHref}+ className="inline-flex items-center gap-1.5 text-caption text-muted-foreground transition-colors hover:text-foreground"+ >+ <Settings2 className="size-3.5" aria-hidden="true" />+ {t(($) => $.starter_prompts.customize)}+ </AppLink>+ </div>+ ) : null}</div>) : null}</div>diff --git a/packages/views/chat/components/chat-window.tsx b/packages/views/chat/components/chat-window.tsxindex c45859a50d..71f41e91ee 100644--- a/packages/views/chat/components/chat-window.tsx+++ b/packages/views/chat/components/chat-window.tsx@@ -22,6 +22,7 @@ import { api, dispatchReasonCode } from "@multica/core/api";import {isAgentRuntimeBound,useAgentPresenceDetail,+ useCustomizeStarterPromptsHref,useWorkspaceAgentAvailability,} from "@multica/core/agents";import { ActorAvatar } from "../../common/actor-avatar";@@ -271,6 +272,13 @@ export function ChatWindow() {const isAgentAccessRevoked =!!activeAgent && !canAssignAgent(activeAgent, user?.id, memberRole);+ // "Customize" under the starter buttons — the only place the empty state+ // admits that those buttons are configuration at all.+ const customizeStarterPromptsHref = useCustomizeStarterPromptsHref(+ activeAgent,+ wsId,+ );+const projectContextSupport = useChatProjectContextSupport(wsId, activeAgent);// Three-state availability — "loading" stays neutral (no banner, no@@ -941,6 +949,7 @@ export function ChatWindow() {agent={activeAgent}hasSessions={sessions.length > 0}onPickPrompt={prefillStarterPrompt}+ customizeHref={customizeStarterPromptsHref}/>)}diff --git a/packages/views/chat/components/starter-prompt-list.tsx b/packages/views/chat/components/starter-prompt-list.tsxnew file mode 100644index 0000000000..0e956980e0--- /dev/null+++ b/packages/views/chat/components/starter-prompt-list.tsx@@ -0,0 +1,79 @@+"use client";++import type { AgentStarterPrompt } from "@multica/core/types";+import { cn } from "@multica/ui/lib/utils";+import { useT } from "../../i18n";++/**+ * The generic suggestions a new chat shows for an agent whose owner+ * configured none. This is the ONLY definition of them: the settings preview+ * renders the same hook, so an author configuring an agent sees exactly what+ * a real new chat will show rather than a hand-maintained mock of it.+ */+export function useFallbackStarterPrompts(): AgentStarterPrompt[] {+ const { t } = useT("chat");+ return [+ {+ label: t(($) => $.starter_prompts.capabilities.label),+ prompt: t(($) => $.starter_prompts.capabilities.prompt),+ },+ {+ label: t(($) => $.starter_prompts.first_task.label),+ prompt: t(($) => $.starter_prompts.first_task.prompt),+ },+ {+ label: t(($) => $.starter_prompts.recommend.label),+ prompt: t(($) => $.starter_prompts.recommend.prompt),+ },+ ];+}++const ROW_CLASS =+ "w-full rounded-lg border border-border bg-card px-3 py-2.5 text-left text-body text-foreground";++/**+ * The stack of starter buttons in a chat's empty state.+ *+ * Omit `onPick` to render the same rows as inert presentation — that is the+ * settings preview, which must look like the real thing without offering a+ * second, non-functional way to "send" a prompt from a settings page.+ */+export function StarterPromptList({+ prompts,+ onPick,+ className,+}: {+ prompts: AgentStarterPrompt[];+ onPick?: (prompt: string) => void;+ className?: string;+}) {+ if (!onPick) {+ return (+ <div className={cn("w-full space-y-2", className)} aria-hidden="true">+ {prompts.map((item, index) => (+ <div key={index} className={cn(ROW_CLASS, "truncate")}>+ {item.label}+ </div>+ ))}+ </div>+ );+ }++ return (+ <div className={cn("w-full space-y-2", className)}>+ {prompts.map((item, index) => (+ <button+ key={index}+ type="button"+ onClick={() => onPick(item.prompt)}+ className={cn(+ ROW_CLASS,+ "transition-colors hover:border-brand/40 hover:bg-accent",+ )}+ >+ {item.label}+ </button>+ ))}+ </div>+ );+}diff --git a/packages/views/chat/components/use-chat-controller.test.tsx b/packages/views/chat/components/use-chat-controller.test.tsxindex f54e9ca658..f2f434d454 100644--- a/packages/views/chat/components/use-chat-controller.test.tsx+++ b/packages/views/chat/components/use-chat-controller.test.tsx@@ -126,6 +126,7 @@ vi.mock("@multica/core/agents", () => ({isAgentRuntimeBound: (agent: { runtime_id: string; runtime_bound?: boolean }) =>agent.runtime_bound !== false && agent.runtime_id.length > 0,useAgentPresenceDetail: () => ({ availability: "online" }),+ useCustomizeStarterPromptsHref: () => null,useWorkspaceAgentAvailability: () => "available",}));vi.mock("@multica/core/hooks/use-file-upload", () => ({diff --git a/packages/views/chat/components/use-chat-controller.ts b/packages/views/chat/components/use-chat-controller.tsindex 95deab6423..509464dd95 100644--- a/packages/views/chat/components/use-chat-controller.ts+++ b/packages/views/chat/components/use-chat-controller.ts@@ -16,6 +16,7 @@ import { api, dispatchReasonCode } from "@multica/core/api";import {isAgentRuntimeBound as hasAgentRuntime,useAgentPresenceDetail,+ useCustomizeStarterPromptsHref,useWorkspaceAgentAvailability,} from "@multica/core/agents";import {@@ -370,6 +371,14 @@ export function useChatController(opts?: { isActive?: boolean }) {const isAgentAccessRevoked =!!activeAgent && !canAssignAgent(activeAgent, user?.id, memberRole);+ // "Customize" under the starter buttons in the empty state — the only place+ // that admits those buttons are configuration. Resolved here so the full+ // page and the floating window cannot disagree about who sees it.+ const customizeStarterPromptsHref = useCustomizeStarterPromptsHref(+ activeAgent,+ wsId,+ );+const agentAvailability = useWorkspaceAgentAvailability();const noAgent = agentAvailability === "none";@@ -834,6 +843,7 @@ export function useChatController(opts?: { isActive?: boolean }) {isAgentAccessRevoked,isAgentRuntimeBound,activeAgent,+ customizeStarterPromptsHref,noAgent,availability,// messagesdiff --git a/packages/views/locales/en/agents.json b/packages/views/locales/en/agents.jsonindex f4c44c0b46..93f1a61ab6 100644--- a/packages/views/locales/en/agents.json+++ b/packages/views/locales/en/agents.json@@ -445,15 +445,17 @@}},"starter_prompts": {- "label": "Suggested first actions",- "hint": "Add up to three examples that show people how to start with this agent. Selecting one fills the composer without sending it.",+ "label": "Conversation starters",+ "hint": "Up to three examples, shown when someone opens a new chat with this agent. Selecting one fills the composer without sending it.","add": "Add suggestion","item_label": "Suggestion {{number}} label","prompt_label": "Suggestion {{number}} prompt","label_placeholder": "Review a pull request","prompt_placeholder": "Review the open pull request, summarize the risks, and recommend next steps.","incomplete": "Complete or remove each suggestion before saving.",- "remove": "Remove suggestion {{number}}"+ "remove": "Remove suggestion {{number}}",+ "preview_label": "Preview of a new chat",+ "preview_defaults": "These are the built-in defaults. Add a suggestion above to replace all three."},"tab_body": {"common": {diff --git a/packages/views/locales/en/chat.json b/packages/views/locales/en/chat.jsonindex cc9b372047..6dc4bbb18f 100644--- a/packages/views/locales/en/chat.json+++ b/packages/views/locales/en/chat.json@@ -151,7 +151,7 @@"chat_with_named": "Chat with {{name}}"},"starter_prompts": {- "aria_label": "Suggested first actions",+ "aria_label": "Conversation starters","capabilities": {"label": "What can you help with?","prompt": "What are you best at helping with? Give me a concise overview."@@ -163,7 +163,8 @@"recommend": {"label": "Recommend an action","prompt": "Review what you know about my workspace and recommend a useful first action."- }+ },+ "customize": "Customize starters"},"onboarding_cards": {"aria_label": "Ways to start",diff --git a/packages/views/locales/ja/agents.json b/packages/views/locales/ja/agents.jsonindex 96f8ebf92b..32dbb1b1b5 100644--- a/packages/views/locales/ja/agents.json+++ b/packages/views/locales/ja/agents.json@@ -328,15 +328,17 @@}},"starter_prompts": {- "label": "おすすめの最初のアクション",- "hint": "このエージェントの使い始め方が伝わる例を3件まで追加できます。選ぶと送信せずに入力欄へ入ります。",+ "label": "会話の開始例",+ "hint": "このエージェントで新しいチャットを開いたときに表示される例(最大3件)。選ぶと送信せずに入力欄へ入ります。","add": "候補を追加","item_label": "候補 {{number}} のラベル","prompt_label": "候補 {{number}} のプロンプト","label_placeholder": "プルリクエストをレビュー","prompt_placeholder": "開いているプルリクエストをレビューし、リスクと次の手順をまとめてください。","incomplete": "各候補を完成させるか削除してから保存してください。",- "remove": "候補 {{number}} を削除"+ "remove": "候補 {{number}} を削除",+ "preview_label": "新しいチャットのプレビュー",+ "preview_defaults": "これは組み込みの初期値です。上で候補を1件追加すると3件すべて置き換わります。"},"tab_body": {"common": {diff --git a/packages/views/locales/ja/chat.json b/packages/views/locales/ja/chat.jsonindex 6eaca37217..6886531eb1 100644--- a/packages/views/locales/ja/chat.json+++ b/packages/views/locales/ja/chat.json@@ -147,7 +147,7 @@"chat_with_named": "{{name}} とチャット"},"starter_prompts": {- "aria_label": "おすすめの最初のアクション",+ "aria_label": "会話の開始例","capabilities": {"label": "何を手伝えますか?","prompt": "あなたが得意な支援を簡潔に教えてください。"@@ -159,7 +159,8 @@"recommend": {"label": "アクションを提案","prompt": "私のワークスペースについて知っていることを踏まえ、最初に役立つアクションを提案してください。"- }+ },+ "customize": "開始例をカスタマイズ"},"onboarding_cards": {"aria_label": "はじめ方",diff --git a/packages/views/locales/ko/agents.json b/packages/views/locales/ko/agents.jsonindex 27e33f4311..98f69a181c 100644--- a/packages/views/locales/ko/agents.json+++ b/packages/views/locales/ko/agents.json@@ -336,15 +336,17 @@}},"starter_prompts": {- "label": "추천 첫 작업",- "hint": "이 에이전트를 어떻게 시작할지 보여주는 예시를 최대 3개 추가하세요. 선택하면 전송하지 않고 입력창에 채웁니다.",+ "label": "대화 시작 예시",+ "hint": "이 에이전트로 새 채팅을 열 때 표시되는 예시입니다(최대 3개). 선택하면 전송하지 않고 입력창에 채웁니다.","add": "추천 추가","item_label": "추천 {{number}} 라벨","prompt_label": "추천 {{number}} 프롬프트","label_placeholder": "풀 리퀘스트 리뷰","prompt_placeholder": "열린 풀 리퀘스트를 리뷰하고 위험과 다음 단계를 요약해 주세요.","incomplete": "각 제안을 완성하거나 삭제한 후 저장하세요.",- "remove": "추천 {{number}} 삭제"+ "remove": "추천 {{number}} 삭제",+ "preview_label": "새 채팅 미리보기",+ "preview_defaults": "지금은 기본 예시입니다. 위에서 하나를 추가하면 세 개 모두 교체됩니다."},"tab_body": {"common": {diff --git a/packages/views/locales/ko/chat.json b/packages/views/locales/ko/chat.jsonindex f1e3e483fc..50bc716f57 100644--- a/packages/views/locales/ko/chat.json+++ b/packages/views/locales/ko/chat.json@@ -147,7 +147,7 @@"chat_with_named": "{{name}}와 채팅"},"starter_prompts": {- "aria_label": "추천 첫 작업",+ "aria_label": "대화 시작 예시","capabilities": {"label": "어떤 일을 도와줄 수 있나요?","prompt": "가장 잘 도울 수 있는 일을 간단히 알려 주세요."@@ -159,7 +159,8 @@"recommend": {"label": "작업 추천","prompt": "내 워크스페이스에 대해 알고 있는 내용을 바탕으로 유용한 첫 작업을 추천해 주세요."- }+ },+ "customize": "시작 예시 편집"},"onboarding_cards": {"aria_label": "시작 방법",diff --git a/packages/views/locales/zh-Hans/agents.json b/packages/views/locales/zh-Hans/agents.jsonindex 7c79e4a5d9..dc26e54a40 100644--- a/packages/views/locales/zh-Hans/agents.json+++ b/packages/views/locales/zh-Hans/agents.json@@ -435,15 +435,17 @@}},"starter_prompts": {- "label": "推荐的初始操作",- "hint": "最多添加三个示例,帮助用户开始使用此智能体。选择后只会填入输入框,不会立即发送。",+ "label": "对话开场建议",+ "hint": "最多三条示例,出现在别人与该智能体开始新对话时。选择后只会填入输入框,不会立即发送。","add": "添加建议","item_label": "建议 {{number}} 的标题","prompt_label": "建议 {{number}} 的提示词","label_placeholder": "审查拉取请求","prompt_placeholder": "审查当前拉取请求,总结风险并建议下一步。","incomplete": "请填写完整或移除每条建议后再保存。",- "remove": "移除建议 {{number}}"+ "remove": "移除建议 {{number}}",+ "preview_label": "新对话预览",+ "preview_defaults": "以上是内置的默认值。在上方添加一条建议即可整组替换。"},"tab_body": {"common": {diff --git a/packages/views/locales/zh-Hans/chat.json b/packages/views/locales/zh-Hans/chat.jsonindex ec03263429..a6b87e0061 100644--- a/packages/views/locales/zh-Hans/chat.json+++ b/packages/views/locales/zh-Hans/chat.json@@ -147,7 +147,7 @@"chat_with_named": "与 {{name}} 对话"},"starter_prompts": {- "aria_label": "推荐的初始操作",+ "aria_label": "对话开场建议","capabilities": {"label": "你能帮我做什么?","prompt": "你最擅长帮我做什么?请简要介绍。"@@ -159,7 +159,8 @@"recommend": {"label": "推荐一个操作","prompt": "根据你对我的工作区的了解,推荐一个有用的初始操作。"- }+ },+ "customize": "自定义开场建议"},"onboarding_cards": {"aria_label": "开始方式",