From 5d6281c58b0ef2e8c2093b64c8d9db280a248b83 Mon Sep 17 00:00:00 2001 From: Joris Neuteboom Date: Tue, 20 Oct 2026 10:03:07 +0200 Subject: [PATCH 1/6] fix(preset-nuxt4): header actions slot, longer prompts, e2e chat model, Mastra listAgents Points 1 to 4 of #102. --- CHANGELOG.md | 11 +++++++++++ .../src/features/ai-tool-config.ts | 2 +- packages/preset-nuxt4/src/features/mastra.ts | 2 +- packages/preset-nuxt4/src/features/prompts.ts | 2 +- .../.claude/skills/battlestack-ui/SKILL.md | 2 ++ .../landing-shell/app/layouts/default.vue | 13 +++++++++++-- .../mastra-admin/test/e2e/api/ai.test.ts | 9 ++++++--- .../server/plugins/10-sync-ai-on-boot.ts | 11 ++++++----- .../prompts/app/pages/dashboard/prompts.vue | 10 ++-------- .../server/api/prompts/[id]/index.put.ts | 11 +++++++++-- .../prompts/test/e2e/api/prompts.test.ts | 18 ++++++++++++++++++ 11 files changed, 68 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7279b1f0..b0c919b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,17 @@ skips lint and `db:generate`, and lists the fix in `REPORT.md`: `pnpm clean --lockfile && pnpm install`, then lint, the tests and `db:generate` if the schema changed. +- The landing layout has a `#header-actions` target in its header, shown at + every width, so a page can add an action such as "New chat" with + `` instead of editing the layout. +- A prompt can be up to 100,000 characters instead of 10,000, and a prompt that + cannot be saved shows the reason in the toast instead of a bare 400. +- The AI settings e2e test sets the model from `NUXT_AI_GATEWAY_CHAT_MODEL` + instead of a hard-coded one, so a run against a dev server no longer leaves a + model the gateway key may not be allowed to use. +- The project's own Mastra agents are registered on boot again: Mastra 1.x + renamed `getAgents()` to `listAgents()`, so only `default` showed up in the AI + settings. Boot now warns when it finds no agents. - A feature whose plugin did not load keeps its manifest record on `pull` instead of being dropped, so its files stay managed. - `shared:github` drops its records of the deploy workflows it no longer ships. diff --git a/packages/preset-nuxt4/src/features/ai-tool-config.ts b/packages/preset-nuxt4/src/features/ai-tool-config.ts index 3dcd8f13..eb18d674 100644 --- a/packages/preset-nuxt4/src/features/ai-tool-config.ts +++ b/packages/preset-nuxt4/src/features/ai-tool-config.ts @@ -16,7 +16,7 @@ const SUPPORTED: AiTool[] = ['claude-code', 'gemini-cli', 'cursor', 'codex'] /** AI coding tool rules + MCP server scaffolding. Selection via `state.aiTool` (default: `claude-code`). */ export const aiToolConfigFeature: Feature = { id: 'shared:ai-tool-config', - version: '1.3.0', + version: '1.3.1', label: 'AI coding tool config', stage: STAGE.AI_TOOL_CONFIG, diff --git a/packages/preset-nuxt4/src/features/mastra.ts b/packages/preset-nuxt4/src/features/mastra.ts index dafe31c7..0bfbfe3b 100644 --- a/packages/preset-nuxt4/src/features/mastra.ts +++ b/packages/preset-nuxt4/src/features/mastra.ts @@ -30,7 +30,7 @@ import { /** Mastra AI runtime. Talks to an OpenAI-compatible AI gateway (sluis.ai preset, or any compatible URL) via `@ai-sdk/openai-compatible`. */ export const mastraFeature: Feature = { id: 'nuxt4:mastra', - version: '2.1.7', + version: '2.1.8', label: 'Mastra AI runtime', frameworks: ['nuxt4'], stage: STAGE.AI_CORE, diff --git a/packages/preset-nuxt4/src/features/prompts.ts b/packages/preset-nuxt4/src/features/prompts.ts index 41b0b184..84e0737e 100644 --- a/packages/preset-nuxt4/src/features/prompts.ts +++ b/packages/preset-nuxt4/src/features/prompts.ts @@ -6,7 +6,7 @@ import type { Feature } from '@battlestack/core' /** Admin-editable AI agent prompts. */ export const promptsFeature: Feature = { id: 'nuxt4:prompts', - version: '1.2.3', + version: '1.2.4', label: 'AI prompt management', description: 'Admin-editable agent prompts with shipped registry defaults.', frameworks: ['nuxt4'], diff --git a/packages/preset-nuxt4/templates/ai-tool-config/claude-code/.claude/skills/battlestack-ui/SKILL.md b/packages/preset-nuxt4/templates/ai-tool-config/claude-code/.claude/skills/battlestack-ui/SKILL.md index 203a6cc8..91738ede 100644 --- a/packages/preset-nuxt4/templates/ai-tool-config/claude-code/.claude/skills/battlestack-ui/SKILL.md +++ b/packages/preset-nuxt4/templates/ai-tool-config/claude-code/.claude/skills/battlestack-ui/SKILL.md @@ -28,6 +28,8 @@ description: Apply the Battlestack design system when building, modifying, revie State the classification in one line before implementing. For 6–7, read `references/component-selection.md`. +A page that needs an action in the app header, such as "New chat", teleports it into the layout's `#header-actions` target instead of editing the layout: ``. Render it client-side only (`` or a `v-if` on client state), because Nuxt teleports only to `body` during SSR. The layout is the project's shell, and editing it makes every later `battlestack pull` merge into it. + ### 3. Implement with tokens - Semantic utilities only in screens: `text-muted`, `bg-elevated`, `border-default`, `text-primary`, `rounded-md`. Never raw hex, arbitrary px, or Tailwind palette classes (`text-blue-600`) where a semantic name exists. diff --git a/packages/preset-nuxt4/templates/landing-shell/app/layouts/default.vue b/packages/preset-nuxt4/templates/landing-shell/app/layouts/default.vue index 099db314..9a1a48bc 100644 --- a/packages/preset-nuxt4/templates/landing-shell/app/layouts/default.vue +++ b/packages/preset-nuxt4/templates/landing-shell/app/layouts/default.vue @@ -3,7 +3,8 @@ - + + - +