@gui-chat-plugin/sequence 0.5.3 → 0.6.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0
4
+
5
+ - **An HTML or Markdown slide can hold a generated picture.** Give `imagePrompt` with `html` or
6
+ `markdown`, and mark where the picture goes with `{{image}}`: `<img src="{{image}}" class="…">` in
7
+ HTML, `![what it shows]({{image}})` in Markdown. The picture is drawn (one per slide) and put in
8
+ place when the slide is shown (`withSlideImage`, a `data:` URL, which the slide's policy allows);
9
+ the saved HTML keeps the mark, and the picture is saved apart (`imagePath`). A Markdown slide
10
+ with the picture on a line of its own is two columns, the text on the left and the picture on
11
+ the right, filling the slide's height. Without `{{image}}`, an `imagePrompt` sent with `html` or
12
+ `markdown` is still left out; `{{image}}` without `imagePrompt` is refused. A picture that can't
13
+ be drawn leaves the slide shown without it, and the model is told. A host that makes a movie of
14
+ a slideshow puts the saved picture in the same way (`withSlideImage` with the file as a `data:`
15
+ URL).
16
+
17
+ ## 0.5.4
18
+
19
+ - **A story is told aloud, panel by panel.** Asked to tell a panel and call the next one in the same
20
+ reply, OpenAI's Realtime and Grok called it without a word: six panels went by in 25 seconds,
21
+ silent, while the pictures were drawn. The cast and each panel are now told in a reply of their
22
+ own, and the host's sequence keeper asks for the next panel when it ends, as slides have been since
23
+ 0.5.3. Checked in MulmoChat (Storyteller role, mock images): every panel told aloud, 52–73 words
24
+ a panel on OpenAI's Realtime, 57–69 on Grok, 28–38 on Gemini Live. Interactive panels (with
25
+ choices) and the last panel are unchanged. A host needs `createSequenceKeeper` for a story to go
26
+ on by itself, as for a slideshow.
27
+
3
28
  ## 0.5.3
4
29
 
5
30
  - **A slide is explained in a reply of its own, and the host's sequence keeper asks for the next
package/README.md CHANGED
@@ -47,9 +47,10 @@ asks the model to go on when it ends a reply mid-slideshow, and passes `keeper.u
47
47
  `context.userSpokeAt`. A slideshow needs it: a slide's instructions ask the model only to explain
48
48
  the slide, in a reply of its own, and the keeper asks for the next one when that reply ends (asked
49
49
  for both in one reply, voice models announced the next slide instead of explaining this one).
50
- Without a keeper the slideshow stops after each slide until the user says to go on. Stories and
51
- step-by-step guides go on without it: a panel's instructions ask for the next panel, and a guide
52
- waits for the user anyway.
50
+ Stories work the same way: the cast and each panel are told in a reply of their own, and the keeper
51
+ asks for the next panel. Without a keeper, a slideshow or a story stops after each step until the
52
+ user says to go on. Step-by-step guides and interactive panels (with choices) wait for the user
53
+ anyway.
53
54
 
54
55
  Step results also set `instructionsRequired`, so a turn-based host (text chat) takes a turn for the
55
56
  model to explain the step.
@@ -73,6 +74,21 @@ small tables; HTML for designed layouts, comparisons, timelines and diagrams. Pi
73
74
  words, numbers and math badly. A slide sent with more than one is one kind: `html` first, then
74
75
  `markdown`, then `chart`, then the picture.
75
76
 
77
+ ### A picture on an HTML or Markdown slide
78
+
79
+ An HTML or Markdown slide can hold one generated picture: `imagePrompt` with `html` or `markdown`,
80
+ and `{{image}}` where the picture goes (`<img src="{{image}}" class="…">`, `![what it shows]({{image}})`).
81
+ `execute()` draws it with the host's `generateImage` and returns it as for a picture slide
82
+ (`imageData`, `imagePath`); the slide's `html` keeps `{{image}}`, in the result and the record.
83
+ `withSlideImage(html, imageData)` (core entry) puts the picture in its place, a `data:` URL, which
84
+ the slide's policy allows; the View does this, and so must a host that shows or films the saved
85
+ HTML itself (reading `imagePath` as a `data:` URL). A Markdown slide whose picture is on a line of
86
+ its own is laid out in two columns: the text on the left, the picture on the right, filling the
87
+ slide's height (`object-fit: cover`, so the picture is asked to keep its subject in the middle).
88
+ Without `{{image}}`, an `imagePrompt` sent with `html` or `markdown` is left out; `{{image}}`
89
+ without `imagePrompt` is refused. When the picture can't be drawn, the slide is shown without it
90
+ and the model is told.
91
+
76
92
  ### Markdown slides
77
93
 
78
94
  `markdown` is GitHub-flavored Markdown with TeX math between `$…$` (inline) or `$$…$$` (a
@@ -134,7 +150,7 @@ that an HTML step is on the screen; a guide step asked for again is then shown a
134
150
 
135
151
  Saved through `files.artifacts`, with their pictures' paths:
136
152
 
137
- - `slideshows/<id>.json`: `{ id, title, mode, totalSlides, slides: { "1": { title, imagePrompt, imagePath } } }`; a slide that isn't a picture has an `imagePrompt` of `""` and no `imagePath`, and has `html` (an HTML slide), `html` and `markdown` (a Markdown slide) or `chart` (a chart slide)
153
+ - `slideshows/<id>.json`: `{ id, title, mode, totalSlides, slides: { "1": { title, imagePrompt, imagePath } } }`; a slide that isn't a picture has `html` (an HTML slide), `html` and `markdown` (a Markdown slide) or `chart` (a chart slide), and an `imagePrompt` of `""` and no `imagePath` unless its `html` places a picture at `{{image}}`
138
154
  - `storyboards/<id>.json`: `{ id, title, style, totalPanels, interactive, characters: [{ name, description, imagePath }], panels: { "1": { caption, characters, imagePrompt, imagePath, choices } } }`
139
155
 
140
156
  IDs are 12 hex digits. The results name them, so a later tool call can refer to a slideshow or a
@@ -14,7 +14,8 @@ export interface SlideArgs {
14
14
  slide: number;
15
15
  totalSlides: number;
16
16
  title: string;
17
- /** The picture's prompt; "" for a slide that isn't a picture. */
17
+ /** The picture's prompt: a picture slide's, or the picture an HTML or
18
+ * Markdown slide places at {{image}}; "" for a slide without one. */
18
19
  imagePrompt: string;
19
20
  /** An HTML slide's body. */
20
21
  html?: string;
@@ -26,6 +27,7 @@ export interface SlideArgs {
26
27
  }
27
28
  export declare const SLIDE_ARGS_ERROR = "presentSlide needs slide and totalSlides (whole numbers, slide from 1 to totalSlides), and one of imagePrompt, html, markdown or chart";
28
29
  export declare const SLIDE_HTML_TOO_LONG = "presentSlide's slide is too long: keep its html, markdown or chart under 60000 characters";
30
+ export declare const SLIDE_IMAGE_WITHOUT_PROMPT = "presentSlide's slide has {{image}} but no imagePrompt: give imagePrompt for the picture that goes there, or take {{image}} out";
29
31
  export declare const SLIDE_CHART_INVALID: string;
30
32
  /** The slide arguments, or what is wrong with them (said to the model). A
31
33
  * slide is one kind: html first, then markdown, then chart, then a
@@ -42,11 +44,13 @@ export interface Slideshow {
42
44
  totalSlides: number;
43
45
  slides: Record<string, {
44
46
  title: string;
45
- /** "" for a slide that isn't a picture. */
47
+ /** "" for a slide without a picture. */
46
48
  imagePrompt: string;
49
+ /** A picture slide's picture, or the one an HTML or Markdown slide
50
+ * places at {{image}} (withSlideImage). */
47
51
  imagePath?: string;
48
52
  /** An HTML slide's body (slideHtmlDocument makes it a page); for a
49
- * Markdown slide, the HTML made of it. */
53
+ * Markdown slide, the HTML made of it. Keeps {{image}}. */
50
54
  html?: string;
51
55
  /** A Markdown slide's text, as the model wrote it. */
52
56
  markdown?: string;
@@ -62,7 +66,7 @@ export interface SlideData {
62
66
  html?: string;
63
67
  markdown?: string;
64
68
  chart?: SlideChart;
65
- /** The picture's prompt; "" for a slide that isn't a picture. */
69
+ /** The picture's prompt; "" for a slide without a picture. */
66
70
  prompt: string;
67
71
  slideshowId: string;
68
72
  slide: number;
@@ -110,7 +114,7 @@ export interface StoryboardArgs {
110
114
  }
111
115
  /** The arguments, or what is wrong with them (said to the model). */
112
116
  export declare function parseStoryboardArgs(args: Record<string, unknown>): StoryboardArgs | string;
113
- export declare const castShownInstructions: ({ title, id }: Storyboard) => string;
117
+ export declare const castShownInstructions: ({ title }: Storyboard) => string;
114
118
  /** The cast's result data. */
115
119
  export interface CastData {
116
120
  storyboardId: string;
@@ -4,7 +4,7 @@ export declare const presentSlidePluginCore: SequencePluginCore;
4
4
  export declare const defineStoryboardPluginCore: SequencePluginCore;
5
5
  export declare const presentPanelPluginCore: SequencePluginCore;
6
6
  export * from "./definitions";
7
- export { MAX_SLIDE_HTML, SLIDE_ANIMATION_KINDS, SLIDE_AUTO_END_SECONDS, SLIDE_CSS_ANIMATIONS_FINISHED, SLIDE_FIT_SCRIPT, SLIDE_HEIGHT, SLIDE_WIDTH, slideHtmlDocument, } from "./slideHtml";
7
+ export { MAX_SLIDE_HTML, SLIDE_ANIMATION_KINDS, SLIDE_AUTO_END_SECONDS, SLIDE_CSS_ANIMATIONS_FINISHED, SLIDE_FIT_SCRIPT, SLIDE_HEIGHT, SLIDE_WIDTH, slideHtmlDocument, SLIDE_IMAGE_MARK, hasSlideImageMark, withSlideImage, } from "./slideHtml";
8
8
  export { SLIDE_CHART_TYPES, chartSlideDocument, type SlideChart, } from "./chartSlide";
9
9
  export { markdownSlideHtml } from "./markdownSlide";
10
10
  export { SLIDESHOWS_DIR, STORYBOARDS_DIR, loadRecord } from "./records";
@@ -39,5 +39,15 @@ export declare const neutralizeSlideHtml: (html: string) => string;
39
39
  * that frame, so a host that makes a movie of the slide adds these to the
40
40
  * HTML it passes on (a zero-length animation is at its end even paused). */
41
41
  export declare const SLIDE_CSS_ANIMATIONS_FINISHED = "*, *::before, *::after { animation-play-state: paused !important; animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; animation-fill-mode: both !important; transition: none !important; }";
42
+ export declare const SLIDE_IMAGE_MARK = "{{image}}";
43
+ /** Whether a slide's HTML has a place for a picture: an src or a CSS url()
44
+ * of {{image}} outside <pre> and <code>, where withSlideImage puts it. A
45
+ * Markdown slide is asked about the HTML made of it, so the answer is
46
+ * marked's reading of the Markdown. */
47
+ export declare const hasSlideImageMark: (html: string) => boolean;
48
+ /** The slide's HTML with its picture in place of {{image}}, outside <pre>
49
+ * and <code>: imageData when it is a data: URL of an image, else a
50
+ * transparent pixel. */
51
+ export declare const withSlideImage: (html: string, imageData?: string) => string;
42
52
  /** The page an HTML slide is shown as. */
43
53
  export declare function slideHtmlDocument(html: string): string;