Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Store pages lead with prompts beside what they made

dee6c7d7257308b
diff --git a/cli/scripts/lib/dshRegistry.mjs b/cli/scripts/lib/dshRegistry.mjs
index cfe95eb3d..1c26fe236 100644
--- a/cli/scripts/lib/dshRegistry.mjs
+++ b/cli/scripts/lib/dshRegistry.mjs
@@ -14,7 +14,7 @@ export function storeEntry(path, manifest, facts) {
if (manifest.kind !== undefined) entry.kind = manifest.kind
for (const key of ['name', 'category', 'author', 'description']) if (manifest[key] !== undefined) entry[key] = manifest[key]
Object.assign(entry, { repo: HARNESS_MONOREPO, ref: 'main', path })
- for (const key of ['homepage', 'upstream', 'license', 'screenshots']) if (facts[key] !== undefined) entry[key] = facts[key]
+ for (const key of ['homepage', 'upstream', 'license', 'screenshots', 'examples']) if (facts[key] !== undefined) entry[key] = facts[key]
if (manifest.engine !== undefined) entry.engine = manifest.engine
if (typeof manifest.viewer?.use === 'string') entry.viewerUse = manifest.viewer.use
entry.tier = manifest.viewer ? 2 : manifest.verdict ? 1 : 0
diff --git a/cli/src/dsh/catalogPublisher.spec.ts b/cli/src/dsh/catalogPublisher.spec.ts
index a3a738e40..350a07aad 100644
--- a/cli/src/dsh/catalogPublisher.spec.ts
+++ b/cli/src/dsh/catalogPublisher.spec.ts
@@ -34,6 +34,25 @@ describe('Store publication', () => {
expect(() => createStoreCatalog(root, ref)).toThrow()
})
+ it('publishes a package\'s examples as written, and refuses one without a prompt, with an http picture, an overlong caption or an unknown field', () => {
+ const root = fixture()
+ const examples = [{ prompt: 'A brick breaker.', image: 'https://example.com/game.jpg', caption: 'Brick breaker · playable' }]
+ writeFileSync(join(root, 'agents', 'game', 'store.json'), JSON.stringify({ examples }))
+ const [entry] = createStoreCatalog(root, ref).entries
+ expect(entry.examples).toEqual(examples)
+ expect(parseStoreCatalog(createStoreCatalog(root, ref)).entries[0]!.examples).toEqual(examples)
+ for (const [bad, message] of [
+ [[{ image: 'https://example.com/a.jpg' }], /needs a prompt/],
+ [[{ prompt: 'x', image: 'http://example.com/a.jpg' }], /https URL/],
+ [[{ prompt: 'x', caption: 'c'.repeat(121) }], /invalid example caption/],
+ [[{ prompt: 'x', video: 'https://example.com/a.mp4' }], /unknown example field video/],
+ [Array.from({ length: 9 }, () => ({ prompt: 'x' })), /invalid examples/],
+ ] as const) {
+ writeFileSync(join(root, 'agents', 'game', 'store.json'), JSON.stringify({ examples: bad }))
+ expect(() => createStoreCatalog(root, ref)).toThrow(message)
+ }
+ })
+
it('rejects a new harness whose shared viewer is not also published', () => {
const root = fixture()
const manifest = { spec: 1, id: 'autonomous/game', name: 'Game', engine: 'claude', viewer: { use: 'acme/not-listed' } }
diff --git a/cli/src/dsh/registry.spec.ts b/cli/src/dsh/registry.spec.ts
index 84d42882d..8f5f482fc 100644
--- a/cli/src/dsh/registry.spec.ts
+++ b/cli/src/dsh/registry.spec.ts
@@ -9,7 +9,7 @@ import { pathToFileURL } from 'node:url'
import { env } from '../config/env.js'
import {
bundledDshRegistry, HARNESS_MONOREPO, readRegistryDir, readStoreDir, registryEntry, registrySourceUrl,
- resetBundledDshRegistry, storeEntry,
+ resetBundledDshRegistry, storeEntry, StoreExampleSchema, StoreFactsSchema,
} from './registry.js'
// @ts-expect-error — plain ESM with no declaration file, imported to hold the build to the runtime
@@ -23,12 +23,26 @@ const write = (path: string, body: string): void => {
writeFileSync(path, body)
}
+describe('StoreExampleSchema: what a product page example may hold', () => {
+ it('takes a prompt, an https picture and a caption; a catalog entry drops unknown fields, store.json refuses them', () => {
+ expect(StoreExampleSchema.parse({ prompt: ' A desk lamp. ', image: 'https://example.com/a.jpg', caption: 'Lamp', later: 1 }))
+ .toEqual({ prompt: 'A desk lamp.', image: 'https://example.com/a.jpg', caption: 'Lamp' })
+ expect(StoreExampleSchema.safeParse({ prompt: 'x', image: 'http://example.com/a.jpg' }).success).toBe(false)
+ expect(StoreExampleSchema.safeParse({ prompt: ' ' }).success).toBe(false)
+ expect(StoreExampleSchema.safeParse({ prompt: 'x'.repeat(601) }).success).toBe(false)
+ expect(StoreFactsSchema.safeParse({ examples: [{ prompt: 'x', later: 1 }] }).success).toBe(false)
+ expect(StoreFactsSchema.safeParse({ examples: Array.from({ length: 9 }, () => ({ prompt: 'x' })) }).success).toBe(false)
+ expect(StoreFactsSchema.parse({ examples: [{ prompt: 'x' }] })).toEqual({ examples: [{ prompt: 'x' }] })
+ })
+})
+
describe('storeEntry', () => {
const cases: Array<[string, Record<string, unknown>, Record<string, unknown>]> = [
['a bare agent: tier 0, only what the manifest says', { spec: 1, id: 'autonomous/bare', name: 'Bare', engine: 'claude' }, {}],
['a verdict: tier 1', { spec: 1, id: 'autonomous/checked', name: 'Checked', engine: 'codex', verdict: '.harness/verdict.json' }, {}],
['a used viewer: tier 2 and its dependency', { spec: 1, id: 'autonomous/cad', name: 'CAD', category: 'CAD', author: 'Autonomous', description: 'd', engine: 'claude', viewer: { use: 'autonomous/cad-viewer' } }, { homepage: 'https://example.com', license: 'MIT' }],
['a viewer package: its kind and no engine', { spec: 1, kind: 'viewer', id: 'autonomous/pane', name: 'Pane', viewer: { command: 'v.sh', url: 'http://127.0.0.1:${port}/' } }, { upstream: 'https://example.com/up', screenshots: ['https://example.com/1.png'] }],
+ ['examples: carried as written', { spec: 1, id: 'autonomous/lamp', name: 'Lamp', engine: 'claude', viewer: { use: 'autonomous/model-viewer' } }, { examples: [{ prompt: 'A desk lamp.', image: 'https://example.com/lamp.jpg', caption: 'Lamp · glTF' }] }],
]
for (const [what, manifest, facts] of cases) {
it(`${what}, the same from the build`, () => {
@@ -39,7 +53,8 @@ describe('storeEntry', () => {
}
it('says exactly what each case ships', () => {
- const [bare, checked, cad, pane] = cases.map(([, manifest, facts]) => storeEntry('p', manifest, facts))
+ const [bare, checked, cad, pane, lamp] = cases.map(([, manifest, facts]) => storeEntry('p', manifest, facts))
+ expect(lamp.examples).toEqual([{ prompt: 'A desk lamp.', image: 'https://example.com/lamp.jpg', caption: 'Lamp · glTF' }])
expect(bare).toEqual({ id: 'autonomous/bare', name: 'Bare', repo: HARNESS_MONOREPO, ref: 'main', path: 'p', engine: 'claude', tier: 0, verified: true })
expect(checked.tier).toBe(1)
expect(cad).toMatchObject({ category: 'CAD', author: 'Autonomous', description: 'd', homepage: 'https://example.com', license: 'MIT', viewerUse: 'autonomous/cad-viewer', tier: 2 })
diff --git a/cli/src/dsh/registry.ts b/cli/src/dsh/registry.ts
index 83804d1a6..fd3b7d32f 100644
--- a/cli/src/dsh/registry.ts
+++ b/cli/src/dsh/registry.ts
@@ -25,6 +25,19 @@ declare const __DSH_REGISTRY__: string | undefined
/** The repo the built-in shelf lives in; its packages are `store/<agents|viewers>/<name>` folders. */
export const HARNESS_MONOREPO = 'https://github.com/autonomous-ai/openharness'
+/**
+ * One example on a package's product page: the prompt a person types and a picture of what the harness
+ * made from it, with a line naming the result ("Desk lamp · 9 parts · glTF"). The picture is an HTTPS
+ * URL — a built-in's lives under store/showcase/ — so a catalog carries it without carrying bytes.
+ */
+export const StoreExampleSchema = z.object({
+ prompt: z.string().trim().min(1).max(600),
+ image: z.string().url().max(2048).refine((url) => url.startsWith('https://'), 'an example image is an https URL').optional(),
+ caption: z.string().trim().min(1).max(120).optional(),
+})
+
+export type StoreExample = z.infer<typeof StoreExampleSchema>
+
/** A folder inside a repo: relative, forward slashes, no `.`/`..` segments, no trailing slash. */
export const PACKAGE_PATH_RE = /^(?!\/)(?!.*\/$)(?!.*\/\/)(?!(?:.*\/)?\.{1,2}(?:\/|$))[A-Za-z0-9._\-/]+$/
@@ -57,6 +70,8 @@ export const DshRegistryEntrySchema = z.strictObject({
license: z.string().min(1).max(40).optional(),
/** Pictures for the product page, in order; absent while a package has none yet. */
screenshots: z.array(z.string().url().max(2048)).max(8).optional(),
+ /** What a person types and what comes out, for the product page — see StoreExampleSchema. */
+ examples: z.array(StoreExampleSchema).max(8).optional(),
}).refine((entry) => entry.kind === 'viewer' || entry.engine !== undefined, { path: ['engine'], message: 'an agent entry needs an engine' })
export type DshRegistryEntry = z.infer<typeof DshRegistryEntrySchema>
@@ -67,6 +82,7 @@ export const StoreFactsSchema = z.strictObject({
upstream: z.string().url().max(2048).optional(),
license: z.string().min(1).max(40).optional(),
screenshots: z.array(z.string().url().max(2048)).max(8).optional(),
+ examples: z.array(StoreExampleSchema.strict()).max(8).optional(),
})
export type StoreFacts = z.infer<typeof StoreFactsSchema>
@@ -86,7 +102,7 @@ export function storeEntry(path: string, manifest: Record<string, unknown>, fact
if (manifest.kind !== undefined) entry.kind = manifest.kind
for (const key of ['name', 'category', 'author', 'description']) if (manifest[key] !== undefined) entry[key] = manifest[key]
Object.assign(entry, { repo: HARNESS_MONOREPO, ref: 'main', path })
- for (const key of ['homepage', 'upstream', 'license', 'screenshots']) if (facts[key] !== undefined) entry[key] = facts[key]
+ for (const key of ['homepage', 'upstream', 'license', 'screenshots', 'examples']) if (facts[key] !== undefined) entry[key] = facts[key]
if (manifest.engine !== undefined) entry.engine = manifest.engine
const viewer = manifest.viewer as { use?: unknown } | undefined
if (typeof viewer?.use === 'string') entry.viewerUse = viewer.use
diff --git a/cli/src/dsh/wire.spec.ts b/cli/src/dsh/wire.spec.ts
index c17152ac1..a780a8c82 100644
--- a/cli/src/dsh/wire.spec.ts
+++ b/cli/src/dsh/wire.spec.ts
@@ -20,6 +20,7 @@ describe('dshListRows', () => {
id: 'autonomous/typst', name: 'Typst', category: 'Documents', author: 'Autonomous', description: 'Typeset.', engine: 'claude',
repo: HARNESS_MONOREPO, ref: 'main', path: 'store/agents/typst', tier: 2, verified: true, viewerUse: 'autonomous/doc-viewer',
homepage: 'https://typst.example.com', upstream: 'https://example.com/typst', license: 'MIT', screenshots: ['https://example.com/1.png'],
+ examples: [{ prompt: 'A spec sheet for an M3 standoff.', image: 'https://example.com/spec.jpg', caption: 'Spec sheet · PDF' }],
},
{ id: 'autonomous/doc-viewer', kind: 'viewer', name: 'Doc Viewer', repo: HARNESS_MONOREPO, ref: 'main', path: 'store/viewers/doc-viewer', tier: 2, verified: true },
{ id: 'acme/bare', name: 'Bare', repo: 'https://example.com/bare.git', engine: 'codex' },
@@ -36,21 +37,22 @@ describe('dshListRows', () => {
installed: true, linked: true, viewer: true, viewerUse: 'autonomous/doc-viewer', tier: 2,
verified: true, repo: `${HARNESS_MONOREPO}/tree/main/store/agents/typst`, homepage: 'https://typst.example.com',
upstream: 'https://example.com/typst', license: 'MIT', screenshots: ['https://example.com/1.png'],
+ examples: [{ prompt: 'A spec sheet for an M3 standoff.', image: 'https://example.com/spec.jpg', caption: 'Spec sheet · PDF' }],
},
{
id: 'acme/private', kind: 'viewer', name: 'Private', description: null, category: null, author: null, engine: null,
installed: true, linked: false, viewer: true, viewerUse: null, tier: 2,
- verified: false, repo: null, homepage: null, upstream: null, license: null, screenshots: [],
+ verified: false, repo: null, homepage: null, upstream: null, license: null, screenshots: [], examples: [],
},
{
id: 'autonomous/doc-viewer', kind: 'viewer', name: 'Doc Viewer', description: null, category: null, author: null, engine: null,
installed: false, linked: false, viewer: true, viewerUse: null, tier: 2,
- verified: true, repo: `${HARNESS_MONOREPO}/tree/main/store/viewers/doc-viewer`, homepage: null, upstream: null, license: null, screenshots: [],
+ verified: true, repo: `${HARNESS_MONOREPO}/tree/main/store/viewers/doc-viewer`, homepage: null, upstream: null, license: null, screenshots: [], examples: [],
},
{
id: 'acme/bare', kind: 'agent', name: 'Bare', description: null, category: null, author: null, engine: 'codex',
installed: false, linked: false, viewer: false, viewerUse: null, tier: 0,
- verified: false, repo: 'https://example.com/bare.git', homepage: null, upstream: null, license: null, screenshots: [],
+ verified: false, repo: 'https://example.com/bare.git', homepage: null, upstream: null, license: null, screenshots: [], examples: [],
},
])
})
diff --git a/cli/src/dsh/wire.ts b/cli/src/dsh/wire.ts
index f0cc226cf..43d9fcfd3 100644
--- a/cli/src/dsh/wire.ts
+++ b/cli/src/dsh/wire.ts
@@ -29,6 +29,7 @@ export function dshListRows(
upstream: known?.upstream ?? null,
license: known?.license ?? null,
screenshots: known?.screenshots ?? [],
+ examples: known?.examples ?? [],
}
}
const seen = new Set<string>()
diff --git a/desktop/lib/core/dsh_catalog.dart b/desktop/lib/core/dsh_catalog.dart
index 2d5846591..4e95f2012 100644
--- a/desktop/lib/core/dsh_catalog.dart
+++ b/desktop/lib/core/dsh_catalog.dart
@@ -9,6 +9,42 @@
/// on a machine that has never heard of it and say "Harness will install".
library;
+/// One example on a product page: the prompt, a picture of what the harness made from it, and a line
+/// naming the result. Read defensively — it arrives from any machine's catalog.
+class StoreExample {
+ const StoreExample({required this.prompt, this.image, this.caption});
+
+ final String prompt;
+
+ /// An https picture of the output, or null when the package has none for this prompt.
+ final String? image;
+ final String? caption;
+
+ static StoreExample? fromJson(Object? raw) {
+ if (raw is! Map) return null;
+ final prompt = raw['prompt'];
+ if (prompt is! String || prompt.trim().isEmpty || prompt.length > 600) {
+ return null;
+ }
+ final image = raw['image'];
+ final uri = image is String ? Uri.tryParse(image.trim()) : null;
+ final caption = raw['caption'];
+ return StoreExample(
+ prompt: prompt.trim(),
+ image:
+ uri != null &&
+ uri.scheme == 'https' &&
+ uri.hasAuthority &&
+ (image as String).length <= 2048
+ ? image.trim()
+ : null,
+ caption: caption is String && caption.trim().isNotEmpty
+ ? caption.trim().substring(0, caption.trim().length.clamp(0, 120))
+ : null,
+ );
+ }
+}
+
class DshEntry {
const DshEntry({
required this.id,
@@ -27,6 +63,7 @@ class DshEntry {
this.upstream,
this.license,
this.screenshots = const [],
+ this.examples = const [],
this.linked = false,
});
@@ -72,6 +109,9 @@ class DshEntry {
final String? license;
final List<String> screenshots;
+ /// What a person types and what comes out — the product page is built around these.
+ final List<StoreExample> examples;
+
/// Installed as a link to a checkout (`--link`) rather than a clone: a
/// developer's own working copy, which Remove would only unlink.
final bool linked;
@@ -105,6 +145,13 @@ class DshEntry {
.take(8)
.toList(growable: false)
: const [],
+ examples: raw['examples'] is List
+ ? (raw['examples'] as List)
+ .map(StoreExample.fromJson)
+ .whereType<StoreExample>()
+ .take(8)
+ .toList(growable: false)
+ : const [],
linked: raw['linked'] == true,
name: name is String && name.trim().isNotEmpty
? name.trim().substring(0, name.trim().length.clamp(0, 40))
diff --git a/desktop/lib/store/store_screen.dart b/desktop/lib/store/store_screen.dart
index 4c0c4ccaa..c3e820593 100644
--- a/desktop/lib/store/store_screen.dart
+++ b/desktop/lib/store/store_screen.dart
@@ -19,6 +19,7 @@ import 'store_controller.dart';
import 'store_discover.dart';
import 'store_editorial.dart';
import 'store_models.dart';
+import 'store_showcase.dart';
import 'store_viewers.dart';
/// The Harness Store, the content of its tab: every harness the registry
@@ -677,8 +678,9 @@ Future<void> _openStoreAgent(
BuildContext context,
AppNotifier notifier,
DshEntry entry,
- String machineId,
-) async {
+ String machineId, {
+ String? prompt,
+}) async {
final origin = notifier.activeSwarmId;
notifier.newSwarm(draft: true);
final target = notifier.activeSwarmId;
@@ -688,6 +690,7 @@ Future<void> _openStoreAgent(
machineId,
source: 'store',
initialEngine: entry.id,
+ initialPrompt: prompt,
swarmId: target,
);
if (result != null) return;
@@ -788,12 +791,19 @@ class _ProductPageState extends State<_ProductPage> {
/// Open (or Get) from the store: the harness needs a tab of its own, since
/// a pane never lands in the store tab. A draft tab is opened for it and
- /// abandoned — back to the store — if the dialog is dismissed.
- Future<void> _open(String machineId) async {
+ /// abandoned — back to the store — if the dialog is dismissed. [prompt] is
+ /// an example's, and becomes the new harness's first message.
+ Future<void> _open(String machineId, {String? prompt}) async {
if (widget.notifier.localMachineState?.machine.machineId != machineId) {
return;
}
- await _openStoreAgent(context, widget.notifier, widget.entry, machineId);
+ await _openStoreAgent(
+ context,
+ widget.notifier,
+ widget.entry,
+ machineId,
+ prompt: prompt,
+ );
}
Future<void> _review() async {
@@ -830,13 +840,23 @@ class _ProductPageState extends State<_ProductPage> {
? entry.engine
: (knownHarnessBase[entry.id] ?? '');
final baseLabel = base.isEmpty ? null : engineIdentity(base).label;
+ // New Harness installs a harness the machine lacks before it creates, so
+ // an example can be tried from here whether or not Get was pressed.
+ final canTry =
+ !entry.isViewerPackage &&
+ local != null &&
+ !_busy.contains(local.machine.machineId) &&
+ local.dsh.runs[entry.id]?.inProgress != true &&
+ (localInstalled || _canGetOnMachine(local, entry));
return SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(32, 12, 32, 48),
child: Align(
alignment: Alignment.topLeft,
child: ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 820),
+ constraints: BoxConstraints(
+ maxWidth: entry.examples.isEmpty ? 820 : 1080,
+ ),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -935,6 +955,17 @@ class _ProductPageState extends State<_ProductPage> {
),
],
),
+ if (entry.examples.isNotEmpty) ...[
+ const SizedBox(height: 28),
+ StoreShowcase(
+ entry: entry,
+ examples: entry.examples,
+ onTry: canTry
+ ? (prompt) =>
+ _open(local.machine.machineId, prompt: prompt)
+ : null,
+ ),
+ ],
const SizedBox(height: 24),
if (entry.description != null)
Text(
@@ -945,10 +976,11 @@ class _ProductPageState extends State<_ProductPage> {
color: grid.AppPalette.textPrimary,
),
),
- if (storeStories[entry.id] case final story?) ...[
- const SizedBox(height: 24),
- StoreProductStory(story: story),
- ],
+ if (entry.examples.isEmpty)
+ if (storeStories[entry.id] case final story?) ...[
+ const SizedBox(height: 24),
+ StoreProductStory(story: story),
+ ],
if (entry.screenshots.isNotEmpty) ...[
const SizedBox(height: 20),
SizedBox(
diff --git a/desktop/lib/store/store_showcase.dart b/desktop/lib/store/store_showcase.dart
new file mode 100644
index 000000000..bcc139ad9
--- /dev/null
+++ b/desktop/lib/store/store_showcase.dart
@@ -0,0 +1,602 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:lucide_icons_flutter/lucide_icons.dart';
+
+import '../core/dsh_catalog.dart';
+import '../core/test_run.dart';
+import '../shared/theme/app_theme.dart' as grid;
+import '../shared/widgets/app_icon_button.dart';
+import '../widgets/engine_identity.dart';
+
+/// The product page's centrepiece: what you ask, and what the harness makes of it.
+///
+/// A store page that lists features tells a person what a harness is; this shows them what it does.
+/// One example at a time fills a stage — the prompt types itself out on the left, a line sweeps
+/// across while the harness "works", and the picture of the real output settles in on the right —
+/// then the next example follows. A strip under the stage picks one directly, and "Try this prompt"
+/// opens New Harness with that prompt as its first message, so the thing that made someone lean in is
+/// one click from happening on their own machine.
+///
+/// Reduce Motion (and `flutter test`) shows each example whole and does not advance on its own.
+class StoreShowcase extends StatefulWidget {
+ const StoreShowcase({
+ super.key,
+ required this.entry,
+ required this.examples,
+ this.onTry,
+ this.autoAdvance,
+ });
+
+ final DshEntry entry;
+ final List<StoreExample> examples;
+
+ /// Opens New Harness with the prompt; null when there is no machine to open it on.
+ final ValueChanged<String>? onTry;
+
+ /// Types, reveals and moves on to the next example; off under `flutter test` unless asked for.
+ final bool? autoAdvance;
+
+ @override
+ State<StoreShowcase> createState() => _StoreShowcaseState();
+}
+
+class _StoreShowcaseState extends State<StoreShowcase>
+ with TickerProviderStateMixin {
+ static const _dwell = Duration(seconds: 7);
+
+ late final AnimationController _type = AnimationController(vsync: this);
+ late final AnimationController _reveal = AnimationController(
+ vsync: this,
+ duration: const Duration(milliseconds: 650),
+ );
+ late final AnimationController _dwellClock = AnimationController(
+ vsync: this,
+ duration: _dwell,
+ );
+ var _index = 0;
+ var _hovering = false;
+
+ bool get _animate =>
+ (widget.autoAdvance ?? !kUnderTest) &&
+ !(MediaQuery.maybeDisableAnimationsOf(context) ?? false);
+
+ StoreExample get _example => widget.examples[_index];
+
+ @override
+ void initState() {
+ super.initState();
+ _type.addStatusListener((status) {
+ if (status == AnimationStatus.completed) _reveal.forward(from: 0);
+ });
+ _reveal.addStatusListener((status) {
+ if (status == AnimationStatus.completed && _animate && !_hovering) {
+ _dwellClock.forward(from: 0);
+ }
+ });
+ _dwellClock.addStatusListener((status) {
+ if (status == AnimationStatus.completed && mounted) {
+ _select((_index + 1) % widget.examples.length);
+ }
+ });
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted) _play();
+ });
+ }
+
+ @override
+ void didUpdateWidget(StoreShowcase old) {
+ super.didUpdateWidget(old);
+ if (_index >= widget.examples.length) _select(0);
+ }
+
+ @override
+ void dispose() {
+ _type.dispose();
+ _reveal.dispose();
+ _dwellClock.dispose();
+ super.dispose();
+ }
+
+ void _select(int index) {
+ setState(() => _index = index);
+ _play();
+ }
+
+ /// Type the prompt, then reveal the output; shown whole at once when nothing may move.
+ void _play() {
+ _dwellClock.stop();
+ _dwellClock.value = 0;
+ if (!_animate) {
+ _type.value = 1;
+ _reveal.value = 1;
+ return;
+ }
+ final chars = _example.prompt.length;
+ _type.duration = Duration(milliseconds: (chars * 22).clamp(600, 2600));
+ _reveal.value = 0;
+ _type.forward(from: 0);
+ }
+
+ void _hover(bool hovering) {
+ _hovering = hovering;
+ if (!_animate) return;
+ if (hovering) {
+ _dwellClock.stop();
+ } else if (_reveal.isCompleted) {
+ _dwellClock.forward();
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ grid.AppTheme.watch(context);
+ if (widget.examples.isEmpty) return const SizedBox.shrink();
+ return LayoutBuilder(
+ builder: (context, constraints) {
+ final wide = constraints.maxWidth >= 760;
+ final prompt = _PromptPane(
+ entry: widget.entry,
+ example: _example,
+ typing: _type,
+ large: wide,
+ onTry: widget.onTry,
+ );
+ final output = _OutputPane(
+ entry: widget.entry,
+ example: _example,
+ typing: _type,
+ reveal: _reveal,
+ );
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ MouseRegion(
+ onEnter: (_) => _hover(true),
+ onExit: (_) => _hover(false),
+ child: Container(
+ key: const ValueKey('store-showcase-stage'),
+ padding: EdgeInsets.all(wide ? 28 : 20),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(22),
+ gradient: LinearGradient(
+ begin: Alignment.topLeft,
+ end: Alignment.bottomRight,
+ colors: [
+ grid.AppPalette.cardBg,
+ Color.alphaBlend(
+ grid.AppPalette.accent.withValues(alpha: 0.10),
+ grid.AppPalette.cardBg,
+ ),
+ ],
+ ),
+ border: Border.all(color: grid.AppPalette.divider),
+ ),
+ child: wide
+ ? Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ SizedBox(
+ width: constraints.maxWidth * 0.34,
+ child: prompt,
+ ),
+ const SizedBox(width: 28),
+ Expanded(child: output),
+ ],
+ )
+ : Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [prompt, const SizedBox(height: 20), output],
+ ),
+ ),
+ ),
+ if (widget.examples.length > 1) ...[
+ const SizedBox(height: 14),
+ SizedBox(
+ height: 72,
+ child: ListView.separated(
+ scrollDirection: Axis.horizontal,
+ itemCount: widget.examples.length,
+ separatorBuilder: (_, _) => const SizedBox(width: 10),
+ itemBuilder: (context, i) => _ExampleChip(
+ key: ValueKey('store-example:$i'),
+ entry: widget.entry,
+ example: widget.examples[i],
+ selected: i == _index,
+ progress: _dwellClock,
+ onTap: i == _index ? null : () => _select(i),
+ ),
+ ),
+ ),
+ ],
+ ],
+ );
+ },
+ );
+ }
+}
+
+class _Eyebrow extends StatelessWidget {
+ const _Eyebrow(this.text, {this.trailing});
+ final String text;
+ final String? trailing;
+
+ @override
+ Widget build(BuildContext context) {
+ // Const where it is used, so it must ask for the theme itself to follow a flip.
+ grid.AppTheme.watch(context);
+ return Row(
+ children: [
+ Text(
+ text,
+ style: TextStyle(
+ fontSize: 11,
+ fontWeight: FontWeight.w700,
+ letterSpacing: 1.4,
+ color: grid.AppPalette.accentOnSurface,
+ ),
+ ),
+ if (trailing != null) ...[
+ const SizedBox(width: 10),
+ Expanded(
+ child: Text(
+ trailing!,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(
+ fontSize: 12.5,
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ ),
+ ],
+ ],
+ );
+ }
+}
+
+class _PromptPane extends StatelessWidget {
+ const _PromptPane({
+ required this.entry,
+ required this.example,
+ required this.typing,
+ required this.large,
+ required this.onTry,
+ });
+
+ final DshEntry entry;
+ final StoreExample example;
+ final Animation<double> typing;
+ final bool large;
+ final ValueChanged<String>? onTry;
+
+ @override
+ Widget build(BuildContext context) => Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const _Eyebrow('YOU ASK'),
+ const SizedBox(height: 14),
+ AnimatedBuilder(
+ animation: typing,
+ builder: (context, _) {
+ final prompt = example.prompt;
+ final shown = (prompt.length * typing.value).round().clamp(
+ 0,
+ prompt.length,
+ );
+ final typingNow = shown < prompt.length;
+ return Semantics(
+ label: prompt,
+ excludeSemantics: true,
+ child: Text.rich(
+ key: const ValueKey('store-showcase-prompt'),
+ TextSpan(
+ children: [
+ TextSpan(text: '“${prompt.substring(0, shown)}'),
+ // The rest is laid out but unseen, so the pane does not grow as it types.
+ TextSpan(
+ text: '${prompt.substring(shown)}”',
+ style: TextStyle(
+ color: typingNow
+ ? Colors.transparent
+ : grid.AppPalette.textPrimary,
+ ),
+ ),
+ ],
+ ),
+ style: TextStyle(
+ fontSize: large ? 24 : 20,
+ height: 1.32,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.3,
+ color: grid.AppPalette.textPrimary,
+ ),
+ ),
+ );
+ },
+ ),
+ const SizedBox(height: 18),
+ Row(
+ children: [
+ EngineMark(engine: entry.id, displayName: entry.name, size: 18),
+ const SizedBox(width: 8),
+ Flexible(
+ child: Text(
+ '${entry.name} harness',
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(
+ fontSize: 13,
+ fontWeight: FontWeight.w500,
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ ),
+ const SizedBox(width: 6),
+ Icon(
+ LucideIcons.arrowRight300,
+ size: 14,
+ color: grid.AppPalette.textFaint,
+ ),
+ ],
+ ),
+ const SizedBox(height: 22),
+ Wrap(
+ spacing: 8,
+ runSpacing: 8,
+ crossAxisAlignment: WrapCrossAlignment.center,
+ children: [
+ FilledButton.icon(
+ key: const ValueKey('store-try-prompt'),
+ onPressed: onTry == null ? null : () => onTry!(example.prompt),
+ icon: const Icon(LucideIcons.sparkles300, size: 16),
+ label: const Text('Try this prompt'),
+ style: FilledButton.styleFrom(
+ backgroundColor: grid.AppPalette.accent,
+ foregroundColor: Colors.white,
+ minimumSize: const Size(0, 40),
+ padding: const EdgeInsets.symmetric(horizontal: 18),
+ shape: const StadiumBorder(),
+ ),
+ ),
+ AppIconButton(
+ key: const ValueKey('store-copy-prompt'),
+ icon: LucideIcons.copy300,
+ tooltip: 'Copy prompt',
+ onPressed: () async {
+ await Clipboard.setData(ClipboardData(text: example.prompt));
+ if (context.mounted) {
+ ScaffoldMessenger.of(
+ context,
+ ).showSnackBar(const SnackBar(content: Text('Prompt copied')));
+ }
+ },
+ ),
+ ],
+ ),
+ ],
+ );
+}
+
+class _OutputPane extends StatelessWidget {
+ const _OutputPane({
+ required this.entry,
+ required this.example,
+ required this.typing,
+ required this.reveal,
+ });
+
+ final DshEntry entry;
+ final StoreExample example;
+ final Animation<double> typing;
+ final Animation<double> reveal;
+
+ @override
+ Widget build(BuildContext context) => Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ _Eyebrow('IT MAKES', trailing: example.caption),
+ const SizedBox(height: 14),
+ AspectRatio(
+ aspectRatio: 16 / 10,
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(14),
+ child: DecoratedBox(
+ decoration: const BoxDecoration(color: Color(0xFF111316)),
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ AnimatedBuilder(
+ animation: reveal,
+ builder: (context, child) => Opacity(
+ opacity: Curves.easeOut.transform(reveal.value),
+ child: Transform.scale(
+ scale:
+ 1.04 -
+ 0.04 * Curves.easeOutCubic.transform(reveal.value),
+ child: child,
+ ),
+ ),
+ child: _OutputPicture(entry: entry, example: example),
+ ),
+ // The harness at work: a light sweeping across while the prompt is still arriving.
+ AnimatedBuilder(
+ animation: Listenable.merge([typing, reveal]),
+ builder: (context, _) {
+ final working = typing.value > 0 && reveal.value == 0;
+ if (!working) return const SizedBox.shrink();
+ return Align(
+ alignment: Alignment(-1.2 + 2.4 * typing.value, 0),
+ child: FractionallySizedBox(
+ widthFactor: 0.35,
+ heightFactor: 1,
+ child: DecoratedBox(
+ decoration: BoxDecoration(
+ gradient: LinearGradient(
+ colors: [
+ Colors.transparent,
+ grid.AppPalette.accent.withValues(alpha: 0.18),
+ Colors.transparent,
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ },
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ],
+ );
+}
+
+class _OutputPicture extends StatelessWidget {
+ const _OutputPicture({required this.entry, required this.example});
+ final DshEntry entry;
+ final StoreExample example;
+
+ @override
+ Widget build(BuildContext context) {
+ final image = example.image;
+ final placeholder = _OutputPlaceholder(entry: entry);
+ if (image == null) return placeholder;
+ return Image.network(
+ image,
+ key: ValueKey('store-showcase-image:$image'),
+ fit: BoxFit.contain,
+ filterQuality: FilterQuality.medium,
+ semanticLabel: example.caption ?? 'What ${entry.name} made',
+ loadingBuilder: (context, child, progress) =>
+ progress == null ? child : placeholder,
+ errorBuilder: (_, _, _) => placeholder,
+ );
+ }
+}
+
+class _OutputPlaceholder extends StatelessWidget {
+ const _OutputPlaceholder({required this.entry});
+ final DshEntry entry;
+
+ @override
+ Widget build(BuildContext context) => Center(
+ child: Opacity(
+ opacity: 0.55,
+ child: EngineMark(engine: entry.id, displayName: entry.name, size: 64),
+ ),
+ );
+}
+
+class _ExampleChip extends StatelessWidget {
+ const _ExampleChip({
+ super.key,
+ required this.entry,
+ required this.example,
+ required this.selected,
+ required this.progress,
+ required this.onTap,
+ });
+
+ final DshEntry entry;
+ final StoreExample example;
+ final bool selected;
+ final Animation<double> progress;
+ final VoidCallback? onTap;
+
+ @override
+ Widget build(BuildContext context) => Semantics(
+ button: true,
+ selected: selected,
+ label: example.prompt,
+ excludeSemantics: true,
+ child: InkWell(
+ onTap: onTap,
+ borderRadius: BorderRadius.circular(12),
+ child: Container(
+ width: 240,
+ padding: const EdgeInsets.all(8),
+ decoration: BoxDecoration(
+ color: selected
+ ? grid.AppSurface.selectedFill
+ : grid.AppPalette.cardBg,
+ borderRadius: BorderRadius.circular(12),
+ border: Border.all(
+ color: selected
+ ? grid.AppPalette.accent.withValues(alpha: 0.6)
+ : grid.AppPalette.divider,
+ ),
+ ),
+ child: Stack(
+ children: [
+ Row(
+ children: [
+ ClipRRect(
+ borderRadius: BorderRadius.circular(8),
+ child: SizedBox(
+ width: 72,
+ height: 54,
+ child: ColoredBox(
+ color: const Color(0xFF111316),
+ child: example.image == null
+ ? Center(
+ child: EngineMark(
+ engine: entry.id,
+ displayName: entry.name,
+ size: 22,
+ ),
+ )
+ : Image.network(
+ example.image!,
+ fit: BoxFit.cover,
+ errorBuilder: (_, _, _) => Center(
+ child: EngineMark(
+ engine: entry.id,
+ displayName: entry.name,
+ size: 22,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(width: 10),
+ Expanded(
+ child: Text(
+ example.prompt,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(
+ fontSize: 12.5,
+ height: 1.35,
+ color: selected
+ ? grid.AppPalette.textPrimary
+ : grid.AppPalette.textSecondary,
+ ),
+ ),
+ ),
+ ],
+ ),
+ if (selected)
+ Positioned(
+ left: 0,
+ right: 0,
+ bottom: -8,
+ child: AnimatedBuilder(
+ animation: progress,
+ builder: (context, _) => FractionallySizedBox(
+ alignment: Alignment.centerLeft,
+ widthFactor: progress.value,
+ child: Container(height: 2, color: grid.AppPalette.accent),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+}
diff --git a/desktop/lib/widgets/new_agent_dialog.dart b/desktop/lib/widgets/new_agent_dialog.dart
index 025cd358a..28e3b1878 100644
--- a/desktop/lib/widgets/new_agent_dialog.dart
+++ b/desktop/lib/widgets/new_agent_dialog.dart
@@ -15,6 +15,7 @@ import '../core/project_folder.dart';
import '../core/repository_clone.dart';
import '../shared/theme/app_theme.dart' as grid;
import '../shared/widgets/app_checkbox.dart';
+import '../shared/widgets/app_icon_button.dart';
import '../shared/widgets/app_choice_picker.dart';
import '../shared/widgets/app_dialog.dart';
import '../shared/widgets/app_select_field.dart';
@@ -65,6 +66,8 @@ Future<NewAgentDialogResult?> showNewAgentDialog(
/// Open with this engine or harness already chosen — the store's Get and
/// Open buttons, which know exactly which one the person is looking at.
String? initialEngine,
+ /// The harness's first message, sent as it starts — the store's "Try this prompt".
+ String? initialPrompt,
}) {
// Reported here rather than at each call site: the doors are four and
// growing, and one that forgets to track is a hole in the funnel that only
@@ -77,6 +80,7 @@ Future<NewAgentDialogResult?> showNewAgentDialog(
builder: (context) => _NewAgentDialog(
notifier: notifier,
initialEngine: initialEngine,
+ initialPrompt: initialPrompt,
machineId: machineId,
initialFolder: initialFolder,
swarmId: swarmId ?? notifier.activeSwarmId,
@@ -108,17 +112,25 @@ class _NewAgentDialog extends StatefulWidget {
required this.offerFindExisting,
required this.offerBackToSearch,
this.initialEngine,
+ this.initialPrompt,
});
/// An engine or harness to open on, chosen elsewhere (the store); null lets
/// the remembered or first installed engine win.
final String? initialEngine;
+ /// A first message to start the harness with (the store's "Try this prompt").
+ final String? initialPrompt;
+
@override
State<_NewAgentDialog> createState() => _NewAgentDialogState();
}
class _NewAgentDialogState extends State<_NewAgentDialog> {
+ /// Sent as the harness's first message; the person can drop it before creating.
+ late String? _firstPrompt = widget.initialPrompt?.trim().isEmpty == true
+ ? null
+ : widget.initialPrompt?.trim();
final _folderFocus = FocusNode(debugLabel: 'Working folder');
final _actionFocus = FocusNode(debugLabel: 'Create or check agent');
GitHubRepository? _repository;
@@ -510,6 +522,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
// The notifier must reject a now-remote target, never use its default login.
codexHome: engine == 'codex' ? profile?.path : null,
dsh: harness,
+ prompt: _firstPrompt,
attempt: _creation,
);
if (!mounted) return;
@@ -650,6 +663,10 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
),
),
),
+ if (_firstPrompt case final prompt?) ...[
+ const SizedBox(height: _gapBlock),
+ _firstMessage(prompt),
+ ],
// Under everything chosen, and OUTSIDE the AbsorbPointer
// above: the choices lock while the install runs, and a
// panel inside that lock cannot be clicked (owner,
@@ -1058,6 +1075,62 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
],
);
+ /// The message the harness starts on, quoted, with a way to start without it.
+ Widget _firstMessage(String prompt) => Container(
+ key: const Key('new-agent-first-message'),
+ padding: const EdgeInsets.fromLTRB(16, 12, 8, 12),
+ decoration: BoxDecoration(
+ color: grid.AppPalette.cardBg,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(top: 2),
+ child: Icon(
+ LucideIcons.messageSquareText300,
+ size: 16,
+ color: grid.AppPalette.accentOnSurface,
+ ),
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ 'Starts with',
+ style: TextStyle(
+ fontSize: 12,
+ fontWeight: FontWeight.w600,
+ color: grid.AppPalette.textSecondary,
+ ),
+ ),
+ const SizedBox(height: 4),
+ Text(
+ prompt,
+ style: TextStyle(
+ fontSize: 14,
+ height: 1.45,
+ color: grid.AppPalette.textPrimary,
+ ),
+ ),
+ ],
+ ),
+ ),
+ AppIconButton(
+ key: const Key('new-agent-first-message-remove'),
+ icon: LucideIcons.x300,
+ tooltip: 'Start without this message',
+ onPressed: _choicesLocked
+ ? null
+ : () => setState(() => _firstPrompt = null),
+ ),
+ ],
+ ),
+ );
+
Widget _settingsRow(String? bypassFlag) => Wrap(
spacing: 12,
runSpacing: 8,
diff --git a/desktop/test/store_showcase_test.dart b/desktop/test/store_showcase_test.dart
new file mode 100644
index 000000000..485df1904
--- /dev/null
+++ b/desktop/test/store_showcase_test.dart
@@ -0,0 +1,492 @@
+// A store product page shows what a harness does: an example's prompt beside a picture of what it
+// made, and "Try this prompt" opens New Harness with that prompt as the first message.
+import 'package:file_selector_platform_interface/file_selector_platform_interface.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/auth/auth_session.dart';
+import 'package:harness/core/config.dart';
+import 'package:harness/core/dsh_catalog.dart';
+import 'package:harness/core/engine_availability.dart';
+import 'package:harness/core/models.dart';
+import 'package:harness/core/project_folder.dart';
+import 'package:harness/screens/swarm_screen.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/app_state.dart';
+import 'package:harness/state/pane_arrangement.dart';
+import 'package:harness/store/store_showcase.dart';
+import 'package:harness/widgets/new_agent_dialog.dart';
+
+import 'swarm_state_test.dart' show createApp;
+
+const _lamp = StoreExample(
+ prompt: 'A desk lamp with a weighted base and an arm that folds flat.',
+ image: 'https://example.com/lamp.jpg',
+ caption: 'Desk lamp · 9 parts',
+);
+const _gear = StoreExample(
+ prompt: 'A planetary gearbox, 5:1, printable without supports.',
+ caption: 'Gearbox · STEP',
+);
+
+const _blender = DshEntry(
+ id: 'autonomous/blender',
+ name: 'Blender',
+ engine: 'claude',
+ installed: true,
+ category: '3D',
+ tier: 2,
+ examples: [_lamp, _gear],
+);
+
+class _Folders extends FileSelectorPlatform {
+ @override
+ Future<String?> getDirectoryPath({
+ String? initialDirectory,
+ String? confirmButtonText,
+ }) async => '/work/lamp';
+}
+
+class _Notifier extends AppNotifier {
+ _Notifier()
+ : super(
+ config: AppConfig.dev,
+ authSession: AuthSession(),
+ configStore: null,
+ );
+
+ final prompts = <String?>[];
+
+ @override
+ Future<void> probeEngines(String machineId, {bool force = false}) async {}
+
+ @override
+ Future<void> probeDsh(String machineId, {bool force = false}) async {}
+
+ @override
+ Future<Map<String, dynamic>> listCodexProfiles(
+ String machineId, {
+ Set<String> observedPaths = const {},
+ }) async => {'profiles': <dynamic>[]};
+
+ @override
+ Future<String?> createAgent(
+ String machineId, {
+ required String engine,
+ required String folder,
+ bool bypassPermission = false,
+ String? codexHome,
+ String? dsh,
+ String? prompt,
+ String? name,
+ String? agent,
+ ProjectFolderRequest? projectFolder,
+ String? swarmId,
+ PaneSplitRequest? split,
+ AgentCreationAttempt? attempt,
+ }) async {
+ prompts.add(prompt);
+ return 'Test launch refused.';
+ }
+}
+
+String _promptText(WidgetTester tester) => tester
+ .widget<Text>(find.byKey(const ValueKey('store-showcase-prompt')))
+ .textSpan!
+ .toPlainText();
+
+/// What has been typed so far: the rest of the prompt is laid out but transparent.
+String _typedText(WidgetTester tester) =>
+ (tester
+ .widget<Text>(
+ find.byKey(const ValueKey('store-showcase-prompt')),
+ )
+ .textSpan!
+ as TextSpan)
+ .children!
+ .first
+ .toPlainText();
+
+Future<void> _pumpShowcase(
+ WidgetTester tester, {
+ ValueChanged<String>? onTry,
+ bool? autoAdvance,
+ List<StoreExample> examples = const [_lamp, _gear],
+}) async {
+ tester.view.devicePixelRatio = 1;
+ tester.view.physicalSize = const Size(1200, 900);
+ addTearDown(tester.view.reset);
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: Scaffold(
+ body: SingleChildScrollView(
+ child: StoreShowcase(
+ entry: _blender,
+ examples: examples,
+ onTry: onTry,
+ autoAdvance: autoAdvance,
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.pump();
+}
+
+void main() {
+ group('StoreExample', () {
+ test('keeps a prompt, an https picture and a short caption', () {
+ final example = StoreExample.fromJson({
+ 'prompt': ' A lamp ',
+ 'image': 'https://example.com/lamp.jpg',
+ 'caption': 'x' * 200,
+ })!;
+ expect(example.prompt, 'A lamp');
+ expect(example.image, 'https://example.com/lamp.jpg');
+ expect(example.caption, hasLength(120));
+ });
+
+ test(
+ 'drops a picture that is not https, and an example with no prompt',
+ () {
+ expect(
+ StoreExample.fromJson({
+ 'prompt': 'A lamp',
+ 'image': 'http://example.com/lamp.jpg',
+ })!.image,
+ isNull,
+ );
+ expect(
+ StoreExample.fromJson({
+ 'prompt': 'A lamp',
+ 'image': 'file:///etc/passwd',
+ })!.image,
+ isNull,
+ );
+ expect(StoreExample.fromJson({'prompt': ' '}), isNull);
+ expect(
+ StoreExample.fromJson({'image': 'https://example.com/a.jpg'}),
+ isNull,
+ );
+ expect(StoreExample.fromJson('A lamp'), isNull);
+ },
+ );
+
+ test('a catalog row carries at most eight examples and skips bad ones', () {
+ final entry = DshEntry.fromJson({
+ 'id': 'autonomous/blender',
+ 'name': 'Blender',
+ 'engine': 'claude',
+ 'examples': [
+ {'prompt': 'One'},
+ 'nonsense',
+ for (var i = 0; i < 10; i++) {'prompt': 'More $i'},
+ ],
+ })!;
+ expect(entry.examples, hasLength(8));
+ expect(entry.examples.first.prompt, 'One');
+ expect(entry.examples[1].prompt, 'More 0');
+ });
+ });
+
+ testWidgets('shows the first example whole, and a strip picks another', (
+ tester,
+ ) async {
+ await _pumpShowcase(tester);
+ expect(_promptText(tester), '“${_lamp.prompt}”');
+ expect(find.text('Desk lamp · 9 parts'), findsOneWidget);
+ expect(find.text('YOU ASK'), findsOneWidget);
+ expect(find.text('IT MAKES'), findsOneWidget);
+ expect(find.text('Blender harness'), findsOneWidget);
+
+ await tester.tap(find.byKey(const ValueKey('store-example:1')));
+ await tester.pumpAndSettle();
+ expect(_promptText(tester), '“${_gear.prompt}”');
+ expect(find.text('Gearbox · STEP'), findsOneWidget);
+ expect(tester.takeException(), isNull);
+ });
+
+ testWidgets('one example needs no strip', (tester) async {
+ await _pumpShowcase(tester, examples: const [_lamp]);
+ expect(find.byKey(const ValueKey('store-example:0')), findsNothing);
+ });
+
+ testWidgets('Try this prompt hands over the prompt on screen', (
+ tester,
+ ) async {
+ final tried = <String>[];
+ await _pumpShowcase(tester, onTry: tried.add);
+ await tester.tap(find.byKey(const ValueKey('store-try-prompt')));
+ await tester.tap(find.byKey(const ValueKey('store-example:1')));
+ await tester.pumpAndSettle();
+ await tester.tap(find.byKey(const ValueKey('store-try-prompt')));
+ expect(tried, [_lamp.prompt, _gear.prompt]);
+ });
+
+ testWidgets('Try this prompt is off with nowhere to open it', (tester) async {
+ await _pumpShowcase(tester);
+ final button = tester.widget<ButtonStyleButton>(
+ find.ancestor(
+ of: find.text('Try this prompt'),
+ matching: find.bySubtype<ButtonStyleButton>(),
+ ),
+ );
+ expect(button.onPressed, isNull);
+ });
+
+ testWidgets('Copy puts the prompt on the clipboard', (tester) async {
+ String? copied;
+ tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
+ SystemChannels.platform,
+ (call) async {
+ if (call.method == 'Clipboard.setData') {
+ copied = (call.arguments as Map)['text'] as String;
+ }
+ return null;
+ },
+ );
+ addTearDown(
+ () => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(
+ SystemChannels.platform,
+ null,
+ ),
+ );
+ await _pumpShowcase(tester);
+ await tester.tap(find.byKey(const ValueKey('store-copy-prompt')));
+ await tester.pump();
+ expect(copied, _lamp.prompt);
+ });
+
+ testWidgets(
+ 'playing, it types the prompt, then moves on to the next example',
+ (tester) async {
+ await _pumpShowcase(tester, autoAdvance: true);
+ await tester.pump(const Duration(milliseconds: 300));
+ final typing = _typedText(tester);
+ expect(
+ typing.length,
+ lessThan('“${_lamp.prompt}”'.length),
+ reason: 'still typing',
+ );
+ expect(typing, startsWith('“A desk'));
+
+ await tester.pump(const Duration(seconds: 3)); // typed and revealed
+ await tester.pump(const Duration(seconds: 1));
+ expect(_promptText(tester), '“${_lamp.prompt}”');
+ await tester.pump(const Duration(seconds: 7)); // seen for a while
+ await tester.pump(const Duration(seconds: 3));
+ await tester.pump(const Duration(seconds: 1));
+ expect(_promptText(tester), '“${_gear.prompt}”');
+
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
+
+ testWidgets('Reduce Motion shows it whole and stays put', (tester) async {
+ tester.view.devicePixelRatio = 1;
+ tester.view.physicalSize = const Size(1200, 900);
+ addTearDown(tester.view.reset);
+ await tester.pumpWidget(
+ MaterialApp(
+ home: MediaQuery(
+ data: const MediaQueryData(disableAnimations: true),
+ child: Scaffold(
+ body: SingleChildScrollView(
+ child: StoreShowcase(
+ entry: _blender,
+ examples: const [_lamp, _gear],
+ autoAdvance: true,
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.pump();
+ expect(_promptText(tester), '“${_lamp.prompt}”');
+ await tester.pump(const Duration(seconds: 30));
+ expect(_promptText(tester), '“${_lamp.prompt}”');
+ });
+
+ testWidgets('narrow, the prompt sits above the picture', (tester) async {
+ tester.view.devicePixelRatio = 1;
+ tester.view.physicalSize = const Size(520, 1200);
+ addTearDown(tester.view.reset);
+ await tester.pumpWidget(
+ const MaterialApp(
+ home: Scaffold(
+ body: SingleChildScrollView(
+ child: StoreShowcase(entry: _blender, examples: [_lamp, _gear]),
+ ),
+ ),
+ ),
+ );
+ await tester.pump();
+ final prompt = tester.getRect(
+ find.byKey(const ValueKey('store-showcase-prompt')),
+ );
+ final picture = tester.getRect(find.text('IT MAKES'));
+ expect(picture.top, greaterThan(prompt.bottom));
+ expect(tester.takeException(), isNull);
+ });
+
+ group('New Harness with a first message', () {
+ setUp(() => FileSelectorPlatform.instance = _Folders());
+
+ Future<_Notifier> open(WidgetTester tester) async {
+ final notifier = _Notifier();
+ addTearDown(notifier.dispose);
+ const machine = Machine(
+ machineId: 'machine-1',
+ authMode: MachineAuthMode.remote,
+ name: 'harness-remote-box',
+ );
+ final state = MachineState(machine)..localOnly = true;
+ state.engines.replace(const [
+ EngineAvailability(engine: 'claude', installed: true),
+ ]);
+ state.dsh.replace(const [_blender]);
+ notifier.machineStates['machine-1'] = state;
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Builder(
+ builder: (context) => Scaffold(
+ body: TextButton(
+ onPressed: () => showNewAgentDialog(
+ context,
+ notifier,
+ 'machine-1',
+ source: 'store',
+ initialEngine: 'autonomous/blender',
+ initialPrompt: ' ${_lamp.prompt}\n',
+ ),
+ child: const Text('open'),
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.tap(find.text('open'));
+ await tester.pumpAndSettle();
+ final newProject = find.byKey(
+ const ValueKey('new-agent-folder-newProject'),
+ );
+ await tester.ensureVisible(newProject);
+ await tester.tap(newProject);
+ await tester.pumpAndSettle();
+ return notifier;
+ }
+
+ Future<void> create(WidgetTester tester) async {
+ await tester.ensureVisible(
+ find.byKey(const ValueKey('create-agent-submit')),
+ );
+ await tester.tap(find.byKey(const ValueKey('create-agent-submit')));
+ await tester.pump();
+ }
+
+ testWidgets('says what it starts with and sends it', (tester) async {
+ final app = await open(tester);
+ expect(
+ find.descendant(
+ of: find.byKey(const ValueKey('new-agent-first-message')),
+ matching: find.text(_lamp.prompt),
+ ),
+ findsOneWidget,
+ );
+ await create(tester);
+ expect(app.prompts, [_lamp.prompt]);
+ expect(tester.takeException(), isNull);
+ });
+
+ testWidgets('starts without it once removed', (tester) async {
+ final app = await open(tester);
+ await tester.ensureVisible(
+ find.byKey(const ValueKey('new-agent-first-message-remove')),
+ );
+ await tester.tap(
+ find.byKey(const ValueKey('new-agent-first-message-remove')),
+ );
+ await tester.pumpAndSettle();
+ expect(
+ find.byKey(const ValueKey('new-agent-first-message')),
+ findsNothing,
+ );
+ await create(tester);
+ expect(app.prompts, [null]);
+ });
+ });
+
+ testWidgets(
+ 'the product page leads with the examples and tries one in New Harness',
+ (tester) async {
+ tester.view.devicePixelRatio = 1;
+ tester.view.physicalSize = const Size(1400, 1000);
+ addTearDown(tester.view.reset);
+ final app = createApp();
+ final state = app.machineStates['m']!
+ ..localOnly = true
+ ..nodeOnline = true
+ ..connectionStatus = ConnectionStatus.connected;
+ state.dsh.replace(const [_blender]);
+ await app.addAgentToSwarm('m', 'a0');
+ app.newSwarm(name: 'Other work');
+ app.openStore();
+ final storeTab = app.activeSwarm;
+
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: SwarmScreen(notifier: app, nativeTabs: false),
+ ),
+ );
+ await tester.pumpAndSettle();
+ await tester.enterText(
+ find.byKey(const ValueKey('store-search')),
+ 'blender',
+ );
+ await tester.pumpAndSettle();
+ await tester.tap(
+ find.byKey(const ValueKey('store-card:autonomous/blender')).first,
+ );
+ await tester.pumpAndSettle();
+
+ expect(
+ find.byKey(const ValueKey('store-showcase-stage')),
+ findsOneWidget,
+ );
+ expect(
+ find.text('Start with an idea'),
+ findsNothing,
+ reason: 'the examples replace the bare prompt list',
+ );
+ await tester.tap(find.byKey(const ValueKey('store-example:1')));
+ await tester.pumpAndSettle();
+ await tester.tap(find.byKey(const ValueKey('store-try-prompt')));
+ await tester.pumpAndSettle();
+ expect(
+ find.byKey(const ValueKey('create-agent-submit')),
+ findsOneWidget,
+ reason: 'New Harness is open',
+ );
+ expect(
+ find.descendant(
+ of: find.byKey(const ValueKey('new-agent-first-message')),
+ matching: find.text(_gear.prompt),
+ ),
+ findsOneWidget,
+ );
+
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pumpAndSettle();
+ expect(
+ app.activeSwarm,
+ same(storeTab),
+ reason: 'dismissed, back on the store',
+ );
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ },
+ );
+}
diff --git a/store/README.md b/store/README.md
index 2217079ed..0887fcb19 100644
--- a/store/README.md
+++ b/store/README.md
@@ -131,9 +131,17 @@ that a manifest does not know. The catalog publisher lists every such folder; th
```json
{ "homepage": "https://typst.app", "upstream": "https://github.com/typst/typst", "license": "MIT",
- "screenshots": [] }
+ "screenshots": [],
+ "examples": [{ "prompt": "A one-page invoice for Studio Nord, due in 30 days.",
+ "image": "https://raw.githubusercontent.com/autonomous-ai/openharness/main/store/showcase/typst/invoice.jpg",
+ "caption": "Invoice · 1 page PDF" }] }
```
+`examples` (≤ 8) is what the product page leads with: a prompt, a picture of what the harness really
+made from it, and a line naming the result. The page types the prompt out, reveals the picture, and
+"Try this prompt" opens New Harness with the prompt as the first message. Pictures live in
+`store/showcase/<name>/`, 1600×1000 JPEG under 350 KB, and are real output — never a mock-up.
+
**In a repository of its own**: add `store/registry/<owner>/<name>.json` in a pull request.
```json
@@ -250,7 +258,8 @@ its own and gets an entry in `registry/` instead. Nothing changes for the people
The app's start page has a door to the store: every harness as a card, and a page per harness — its
mark, who made it (`author`), its category and description, where it lives (`repo` and `path`,
-`homepage`, `upstream`), what it is licensed under (`license`), pictures (`screenshots`), ratings and
+`homepage`, `upstream`), what it is licensed under (`license`), prompts beside what they made
+(`examples`), pictures (`screenshots`), ratings and
reviews, and a row per machine with Get, Open or Remove. Installing is still what it always was — a
clone (for a built-in package, of its one folder) under `~/.harness/dsh` on one machine, its toolchain
set up beside it — so the page is honest about that: a harness is on a machine, not on an account.
diff --git a/store/spec/CHANGES.md b/store/spec/CHANGES.md
index d8cd4a99d..1cd513c53 100644
--- a/store/spec/CHANGES.md
+++ b/store/spec/CHANGES.md
@@ -139,3 +139,18 @@ Initial contract. Lifted from the `.board.json` (Circuit) and `.episode.json` (T
and clients accept catalogs from older daemons without dependency information.
- **Mechanism:** the registry builder and runtime reader, `backendSocket.ts`, and the desktop
`DshEntry` model. Viewer install, sharing, and launch behavior are unchanged.
+
+## 2026-09-17 — `examples` on the store page
+
+- **Change:** registry entries and `store.json` may include `examples` (≤ 8):
+ `[{ prompt, image?, caption? }]` — a prompt (≤ 600 chars), an https picture of what the harness made
+ from it, and a line naming the result (≤ 120). `dsh_list` forwards them like `screenshots`; the
+ product page leads with them, and "Try this prompt" opens New Harness with the prompt as its first
+ message.
+- **Why:** a list of features says what a harness is; a prompt beside its real output shows what it
+ does, which is what makes someone try it.
+- **Backward compatible:** yes. The field is optional; an app that predates it ignores it, and a page
+ without examples keeps its editorial prompt list. A daemon that predates it forwards none.
+- **Mechanism:** `StoreExampleSchema` in `cli/src/dsh/registry.ts`, `cli/scripts/lib/dshRegistry.mjs`,
+ `cli/src/dsh/wire.ts`, the publisher's checks in `store/tools/catalog.mjs`, and the desktop
+ `StoreExample` / `StoreShowcase`.
diff --git a/store/spec/README.md b/store/spec/README.md
index a5f7680ed..e9706525c 100644
--- a/store/spec/README.md
+++ b/store/spec/README.md
@@ -121,7 +121,7 @@ writes it beside the sidecar in `circuitpy.generation`; Workshop writes it from
### The store's facts
-A registry entry may also carry `homepage`, `upstream`, `license` and `screenshots` (see
+A registry entry may also carry `homepage`, `upstream`, `license`, `screenshots` and `examples` (see
`cli/src/dsh/registry.ts`); a built-in package keeps them in `store.json` beside its manifest. They are
the store page's, not the package's: a manifest never has them,
and `dsh_list` rows forward them from the registry whether or not the package is installed, with
diff --git a/store/tools/catalog.mjs b/store/tools/catalog.mjs
index b9295ed6c..eb058df0d 100644
--- a/store/tools/catalog.mjs
+++ b/store/tools/catalog.mjs
@@ -27,6 +27,7 @@ export function createStoreCatalog(storeDir, ref) {
if(entry.viewerUse!==undefined&&!ID.test(entry.viewerUse))throw new Error(`${entry.id}: invalid viewer dependency`);
if(entry.tier!==undefined&&![0,1,2].includes(entry.tier))throw new Error(`${entry.id}: invalid tier`);
for(const key of ['homepage','upstream'])if(entry[key]!==undefined)new URL(entry[key]);
+ if(entry.examples!==undefined){if(!Array.isArray(entry.examples)||entry.examples.length>8)throw new Error(`${entry.id}: invalid examples`);for(const ex of entry.examples){if(!ex||typeof ex!=='object'||typeof ex.prompt!=='string'||!ex.prompt.trim()||ex.prompt.length>600)throw new Error(`${entry.id}: an example needs a prompt`);if(ex.image!==undefined&&(typeof ex.image!=='string'||ex.image.length>2048||new URL(ex.image).protocol!=='https:'))throw new Error(`${entry.id}: an example image is an https URL`);if(ex.caption!==undefined&&(typeof ex.caption!=='string'||ex.caption.length>120))throw new Error(`${entry.id}: invalid example caption`);for(const key of Object.keys(ex))if(!['prompt','image','caption'].includes(key))throw new Error(`${entry.id}: unknown example field ${key}`);}}
if(entry.screenshots!==undefined){if(!Array.isArray(entry.screenshots)||entry.screenshots.length>8)throw new Error(`${entry.id}: invalid screenshots`);for(const shot of entry.screenshots){if(typeof shot!=='string'||shot.length>2048)throw new Error(`${entry.id}: invalid screenshot`);new URL(shot);}}
const builtIn=entry.repo.replace(/\.git$/,'')===MONOREPO&&entry.path===`store/${entry.kind==='viewer'?'viewers':'agents'}/${entry.id.slice('autonomous/'.length)}`&&entry.id.startsWith('autonomous/');
if(entry.id.startsWith('autonomous/')&&!builtIn)throw new Error(`${entry.id}: autonomous IDs belong to built-in packages`);