pi-design-deck 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/index.ts +15 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Design Deck
6
6
 
7
- A tool for [Pi coding agent](https://github.com/badlogic/pi-mono/) that presents multi-slide visual decision decks in the browser. Each slide shows 2-4 high-fidelity previews — code diffs, architecture diagrams, UI mockups — and you pick one per slide. The agent gets back a clean selection map and moves on to implementation.
7
+ A tool for [Pi coding agent](https://github.com/badlogic/pi-mono/) that presents multi-slide visual decision decks. On macOS, uses [Glimpse](https://github.com/nicobailon/glimpseui) to render in a native WKWebView window; falls back to a browser tab on other platforms. Each slide shows 2-4 high-fidelity previews — code diffs, architecture diagrams, UI mockups — and you pick one per slide. The agent gets back a clean selection map and moves on to implementation.
8
8
 
9
9
  <img width="1340" alt="Design Deck screenshot" src="https://github.com/user-attachments/assets/20864ac6-9223-4e2e-ba3c-db3eaae0abd8" />
10
10
 
@@ -41,7 +41,7 @@ Restart pi to load the extension and the bundled `design-deck` skill.
41
41
 
42
42
  **Requirements:**
43
43
  - pi-agent v0.35.0 or later (extensions API)
44
- - Optional on macOS: `glimpseui` for native window launch (`npm install -g glimpseui`)
44
+ - For native macOS window: `pi install npm:glimpseui` (optional, falls back to browser if not installed)
45
45
 
46
46
  https://github.com/user-attachments/assets/aff1bac6-8bc2-461a-8828-f588ce655f7f
47
47
 
package/index.ts CHANGED
@@ -411,11 +411,24 @@ export default function (pi: ExtensionAPI) {
411
411
  "When the user requests more options, tool returns generate-more instructions — " +
412
412
  'call design_deck with action:"add-options" to push all new options at once. ' +
413
413
  "previewBlocks for code/architecture comparisons, previewHtml for custom UI mockups.",
414
+ promptSnippet:
415
+ "Use this to present architecture/UI/code choices visually. Start with {slides: <deck-json-string>} and wait for completion. " +
416
+ "If it returns generate-more instructions, call design_deck with action:\"add-options\" and slideId to push all new options.",
414
417
  parameters: DeckParams,
415
418
 
416
419
  async execute(_toolCallId, params, signal, onUpdate, ctx) {
417
420
  const p = params as Record<string, unknown>;
418
421
 
422
+ if (!p.action && typeof p.slides === "string") {
423
+ try {
424
+ const parsed = JSON.parse(p.slides);
425
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed) && typeof parsed.action === "string") {
426
+ Object.assign(p, parsed);
427
+ delete p.slides;
428
+ }
429
+ } catch {}
430
+ }
431
+
419
432
  if (!ctx.hasUI && p.action !== "list" && p.action !== "export") {
420
433
  throw new Error(
421
434
  "design_deck requires interactive mode with browser support. " +
@@ -1057,6 +1070,8 @@ export default function (pi: ExtensionAPI) {
1057
1070
  pi.registerTool({
1058
1071
  name: "deck_generate",
1059
1072
  description: "Generate text using a specific model (for design deck option generation). Use this when the generate-more prompt specifies a model override.",
1073
+ promptSnippet:
1074
+ "Use when design_deck generate-more/regenerate asks for a specific model. Provide {model: \"provider/model-id\", task: \"prompt\"} and return the raw generated text.",
1060
1075
  parameters: Type.Object({
1061
1076
  model: Type.String({ description: "Full model ID in 'provider/model-id' format (e.g., 'anthropic/claude-haiku-4-5')" }),
1062
1077
  task: Type.String({ description: "The generation task/prompt" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-design-deck",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Visual design deck for presenting multi-slide options with high-fidelity previews",
5
5
  "author": "Nico Bailon",
6
6
  "license": "MIT",