@gui-chat-plugin/sequence 0.5.4 → 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 +14 -0
- package/README.md +16 -1
- package/dist/core/definitions.d.ts +8 -4
- package/dist/core/index.d.ts +1 -1
- package/dist/core/slideHtml.d.ts +10 -0
- package/dist/{core-BYk8F8Fi.js → core-BCDyutCB.js} +284 -235
- package/dist/core-BVG-aDg8.cjs +245 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +43 -43
- package/package.json +1 -1
- package/dist/core-DlvNLaFp.cjs +0 -236
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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, `` 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
|
+
|
|
3
17
|
## 0.5.4
|
|
4
18
|
|
|
5
19
|
- **A story is told aloud, panel by panel.** Asked to tell a panel and call the next one in the same
|
package/README.md
CHANGED
|
@@ -74,6 +74,21 @@ small tables; HTML for designed layouts, comparisons, timelines and diagrams. Pi
|
|
|
74
74
|
words, numbers and math badly. A slide sent with more than one is one kind: `html` first, then
|
|
75
75
|
`markdown`, then `chart`, then the picture.
|
|
76
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="…">`, ``).
|
|
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
|
+
|
|
77
92
|
### Markdown slides
|
|
78
93
|
|
|
79
94
|
`markdown` is GitHub-flavored Markdown with TeX math between `$…$` (inline) or `$$…$$` (a
|
|
@@ -135,7 +150,7 @@ that an HTML step is on the screen; a guide step asked for again is then shown a
|
|
|
135
150
|
|
|
136
151
|
Saved through `files.artifacts`, with their pictures' paths:
|
|
137
152
|
|
|
138
|
-
- `slideshows/<id>.json`: `{ id, title, mode, totalSlides, slides: { "1": { title, imagePrompt, imagePath } } }`; a slide that isn't a picture has
|
|
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}}`
|
|
139
154
|
- `storyboards/<id>.json`: `{ id, title, style, totalPanels, interactive, characters: [{ name, description, imagePath }], panels: { "1": { caption, characters, imagePrompt, imagePath, choices } } }`
|
|
140
155
|
|
|
141
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
|
|
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
|
|
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
|
|
69
|
+
/** The picture's prompt; "" for a slide without a picture. */
|
|
66
70
|
prompt: string;
|
|
67
71
|
slideshowId: string;
|
|
68
72
|
slide: number;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -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";
|
package/dist/core/slideHtml.d.ts
CHANGED
|
@@ -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;
|