FN-5850: add AI goal description drafting

Add AI-assisted goal description drafting from the Goals view add form.

- add a readonly AI drafting flow for goal descriptions with title validation and shared rate limiting
- expose a new /api/ai/draft-goal-description endpoint and dashboard API helper for requesting drafts
- add Goals view UI, styling, tests, and dashboard docs covering the draft workflow

Files changed:
 docs/dashboard-guide.md                            |   6 +
 packages/dashboard/app/api/legacy.ts               |  24 +++-
 packages/dashboard/app/components/GoalsView.css    |  14 ++
 packages/dashboard/app/components/GoalsView.tsx    |  46 +++++-
 packages/dashboard/app/components/__tests__/GoalsView.test.tsx    |  50 +++++++
 packages/dashboard/src/__tests__/ai-refine.test.ts |  75 ++++++++++
 packages/dashboard/src/__tests__/routes-agents.test.ts  |  92 ++++++++++++
 packages/dashboard/src/ai-refine.ts                | 155 ++++++++++++++++++---
 packages/dashboard/src/routes.ts                   |  58 ++++++++
 9 files changed, 489 insertions(+), 31 deletions(-)

Fusion-Task-Id: FN-5850

Fusion-Task-Lineage: $#%
!

This commit is contained in:
gsxdsm
2026-06-01 22:50:41 -07:00
parent 70e7a6b30a
commit 41c891d7d8
9 changed files with 489 additions and 31 deletions

View File

@@ -63,6 +63,20 @@
color: var(--text-muted);
}
.goals-form-label-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-sm);
}
.goals-form-draft-button {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
align-self: flex-start;
}
.goals-form textarea.input {
min-height: calc(var(--space-2xl) * 2);
resize: vertical;