paseo-plugin-genui 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/OVERVIEW.md +21 -0
- package/README.md +77 -2
- package/assets/fonts/Excalifont-OFL.txt +109 -0
- package/assets/fonts/Excalifont-Regular-latin.woff2 +0 -0
- package/assets/icon.png +0 -0
- package/assets/icon.svg +1 -0
- package/assets/screenshot-chat.png +0 -0
- package/assets/screenshot-gallery.png +0 -0
- package/assets/screenshot-playground.png +0 -0
- package/client/components/content.tsx +468 -0
- package/client/components/data.tsx +967 -0
- package/client/components/dev.tsx +998 -0
- package/client/components/diagram.tsx +513 -0
- package/client/components/inputs.tsx +994 -0
- package/client/components/layout.tsx +239 -0
- package/client/components/media.tsx +428 -0
- package/client/components/project.tsx +641 -0
- package/client/components/widgets.tsx +836 -0
- package/client/gallery.tsx +449 -0
- package/client/live-ui.tsx +525 -0
- package/client/loaders.ts +342 -0
- package/client/markdown.tsx +172 -0
- package/client/node-renderer.tsx +149 -0
- package/client/render.tsx +186 -0
- package/client/runtime.ts +103 -0
- package/client/settings.tsx +57 -0
- package/client/web.ts +186 -0
- package/gallery/Acceptance-baseline.ui +1 -0
- package/gallery/Acceptance-checklist.ui +14 -0
- package/gallery/Acceptance-evidence.ui +9 -0
- package/gallery/Acceptance.ui +1 -0
- package/gallery/Badge.ui +3 -0
- package/gallery/Benchmark-context.ui +8 -0
- package/gallery/Benchmark-hyperfine.ui +1 -0
- package/gallery/Benchmark-runs-list.ui +9 -0
- package/gallery/Benchmark-runs.ui +1 -0
- package/gallery/Benchmark-vitest.ui +1 -0
- package/gallery/Benchmark.ui +9 -0
- package/gallery/Board-bb-tasks.ui +1 -0
- package/gallery/Board-gh-issues.ui +1 -0
- package/gallery/Board-gh-prs.ui +1 -0
- package/gallery/Board.ui +12 -0
- package/gallery/Button-destructive.ui +4 -0
- package/gallery/Button.ui +5 -0
- package/gallery/Calendar.ui +15 -0
- package/gallery/CalendarHeatmap-short.ui +11 -0
- package/gallery/CalendarHeatmap.ui +4 -0
- package/gallery/Callout.ui +4 -0
- package/gallery/Card.ui +4 -0
- package/gallery/Carousel.ui +8 -0
- package/gallery/Changes-paths.ui +1 -0
- package/gallery/Changes-uncommitted.ui +1 -0
- package/gallery/Changes.ui +1 -0
- package/gallery/Chart-area.ui +3 -0
- package/gallery/Chart-funnel.ui +3 -0
- package/gallery/Chart-heatmap.ui +11 -0
- package/gallery/Chart-pie.ui +3 -0
- package/gallery/Chart-radar.ui +3 -0
- package/gallery/Chart-scatter.ui +4 -0
- package/gallery/Chart-stacked.ui +5 -0
- package/gallery/Chart.ui +3 -0
- package/gallery/Checklist.ui +6 -0
- package/gallery/Choice.ui +8 -0
- package/gallery/Code.ui +3 -0
- package/gallery/Commits-limit.ui +1 -0
- package/gallery/Commits.ui +1 -0
- package/gallery/Compare-conditions.ui +4 -0
- package/gallery/Compare-three.ui +7 -0
- package/gallery/Compare.ui +4 -0
- package/gallery/Coverage-go.ui +1 -0
- package/gallery/Coverage-lcov.ui +1 -0
- package/gallery/Coverage-python.ui +1 -0
- package/gallery/Coverage.ui +1 -0
- package/gallery/DateInput.ui +5 -0
- package/gallery/Decision-percent.ui +10 -0
- package/gallery/Decision.ui +12 -0
- package/gallery/Dependencies-audit.ui +1 -0
- package/gallery/Dependencies-both.ui +1 -0
- package/gallery/Dependencies-list.ui +7 -0
- package/gallery/Dependencies-pip.ui +1 -0
- package/gallery/Dependencies-pnpm.ui +1 -0
- package/gallery/Dependencies.ui +1 -0
- package/gallery/Details.ui +4 -0
- package/gallery/Diagram-flow.ui +16 -0
- package/gallery/Diagram-sequence.ui +15 -0
- package/gallery/Diagram.ui +16 -0
- package/gallery/Diff.ui +3 -0
- package/gallery/Divider.ui +5 -0
- package/gallery/EditableTable.ui +9 -0
- package/gallery/Entity-list.ui +6 -0
- package/gallery/Entity.ui +8 -0
- package/gallery/Environments.ui +1 -0
- package/gallery/Estimate-points.ui +6 -0
- package/gallery/Estimate.ui +8 -0
- package/gallery/File.ui +4 -0
- package/gallery/Findings-biome.ui +1 -0
- package/gallery/Findings-eslint.ui +1 -0
- package/gallery/Findings-oxlint.ui +1 -0
- package/gallery/Findings-review.ui +1 -0
- package/gallery/Findings-ruff.ui +1 -0
- package/gallery/Findings-sarif.ui +1 -0
- package/gallery/Findings-ship.ui +11 -0
- package/gallery/Findings-tsc.ui +1 -0
- package/gallery/Findings.ui +7 -0
- package/gallery/Flashcards.ui +3 -0
- package/gallery/FollowUps.ui +4 -0
- package/gallery/Form.ui +8 -0
- package/gallery/Gallery-links.ui +8 -0
- package/gallery/Gallery-strip.ui +14 -0
- package/gallery/Gallery.ui +10 -0
- package/gallery/Gauge.ui +7 -0
- package/gallery/Grid.ui +8 -0
- package/gallery/Hotspots-photo.ui +8 -0
- package/gallery/Hotspots.ui +11 -0
- package/gallery/Icon.ui +5 -0
- package/gallery/Image.ui +4 -0
- package/gallery/ImageSearch-aspects.ui +6 -0
- package/gallery/ImageSearch.ui +4 -0
- package/gallery/Input.ui +5 -0
- package/gallery/Json-api.ui +1 -0
- package/gallery/Json.ui +8 -0
- package/gallery/KeyValue.ui +3 -0
- package/gallery/List-dots.ui +8 -0
- package/gallery/List.ui +8 -0
- package/gallery/ListEditor.ui +5 -0
- package/gallery/Logs-jsonl.ui +1 -0
- package/gallery/Logs-lines.ui +11 -0
- package/gallery/Logs-python.ui +1 -0
- package/gallery/Logs.ui +1 -0
- package/gallery/Map-city.ui +8 -0
- package/gallery/Map.ui +8 -0
- package/gallery/Metric.ui +3 -0
- package/gallery/OptionCards-multi.ui +10 -0
- package/gallery/OptionCards.ui +10 -0
- package/gallery/Pipeline-checks.ui +1 -0
- package/gallery/Pipeline-passed.ui +1 -0
- package/gallery/Pipeline-running.ui +1 -0
- package/gallery/Pipeline-stages.ui +13 -0
- package/gallery/Pipeline.ui +1 -0
- package/gallery/Plan.ui +9 -0
- package/gallery/Progress.ui +4 -0
- package/gallery/Provenance-deploy.ui +6 -0
- package/gallery/Provenance-no-receipt.ui +1 -0
- package/gallery/Provenance.ui +1 -0
- package/gallery/PullRequest.ui +1 -0
- package/gallery/Quiz.ui +6 -0
- package/gallery/Radio.ui +5 -0
- package/gallery/Rating.ui +5 -0
- package/gallery/Roadmap-sprint.ui +8 -0
- package/gallery/Roadmap-year.ui +9 -0
- package/gallery/Roadmap.ui +12 -0
- package/gallery/Row.ui +3 -0
- package/gallery/SegmentedBar-status.ui +8 -0
- package/gallery/SegmentedBar.ui +8 -0
- package/gallery/Select.ui +5 -0
- package/gallery/Slider.ui +7 -0
- package/gallery/Snippet.ui +3 -0
- package/gallery/Sources-chips.ui +4 -0
- package/gallery/Sources.ui +8 -0
- package/gallery/Sparkline.ui +6 -0
- package/gallery/Stack.ui +7 -0
- package/gallery/StackTrace-aggregate.ui +1 -0
- package/gallery/StackTrace-browser.ui +1 -0
- package/gallery/StackTrace-go.ui +1 -0
- package/gallery/StackTrace-java.ui +1 -0
- package/gallery/StackTrace-python.ui +1 -0
- package/gallery/StackTrace-rust.ui +1 -0
- package/gallery/StackTrace.ui +1 -0
- package/gallery/Status.ui +9 -0
- package/gallery/Stepper.ui +5 -0
- package/gallery/Steps.ui +8 -0
- package/gallery/Swatches-long-names.ui +4 -0
- package/gallery/Swatches-picker.ui +5 -0
- package/gallery/Swatches.ui +10 -0
- package/gallery/Table.ui +7 -0
- package/gallery/Tabs.ui +8 -0
- package/gallery/Tests-junit.ui +1 -0
- package/gallery/Tests-vitest-junit.ui +1 -0
- package/gallery/Tests-vitest.ui +1 -0
- package/gallery/Tests.ui +9 -0
- package/gallery/Text.ui +4 -0
- package/gallery/TextArea.ui +5 -0
- package/gallery/Threads-ids.ui +1 -0
- package/gallery/Threads.ui +1 -0
- package/gallery/Timeline.ui +8 -0
- package/gallery/Timer.ui +4 -0
- package/gallery/Toggle.ui +5 -0
- package/gallery/Transcript-text.ui +1 -0
- package/gallery/Transcript-untimed.ui +1 -0
- package/gallery/Transcript-whisper.ui +1 -0
- package/gallery/Transcript.ui +1 -0
- package/gallery/Tree.ui +3 -0
- package/gallery/Treemap-du.ui +1 -0
- package/gallery/Treemap-esbuild.ui +1 -0
- package/gallery/Treemap-tree.ui +7 -0
- package/gallery/Treemap.ui +18 -0
- package/gallery/Walkthrough.ui +9 -0
- package/gallery/Waterfall-har.ui +1 -0
- package/gallery/Waterfall-trace.ui +1 -0
- package/gallery/Waterfall.ui +11 -0
- package/gallery/data/acceptance/coil/viewport-lifecycle.json +25 -0
- package/gallery/data/acceptance/coil-gate.json +153 -0
- package/gallery/data/acceptance/orbit-baseline.json +163 -0
- package/gallery/data/acceptance/shots/gate-cell-opened.png +0 -0
- package/gallery/data/acceptance/shots/gate-light.png +0 -0
- package/gallery/data/acceptance/shots/gate-phone-dark.png +0 -0
- package/gallery/data/activity.json +1 -0
- package/gallery/data/bb-tasks-orb.json +420 -0
- package/gallery/data/biome.json +229 -0
- package/gallery/data/compare/status-after.png +0 -0
- package/gallery/data/compare/status-before.png +0 -0
- package/gallery/data/compare/status-dark-2x.png +0 -0
- package/gallery/data/compare/status-rerender.png +0 -0
- package/gallery/data/coverage-py.json +1 -0
- package/gallery/data/coverage-summary.json +1 -0
- package/gallery/data/coverage.out +23 -0
- package/gallery/data/deploys.json +1 -0
- package/gallery/data/device-runs.json +285 -0
- package/gallery/data/du-node-modules.txt +359 -0
- package/gallery/data/esbuild-meta.json +292 -0
- package/gallery/data/eslint.json +266 -0
- package/gallery/data/eslint.sarif +343 -0
- package/gallery/data/findings-review.json +76 -0
- package/gallery/data/gh-issues-nextjs.json +293 -0
- package/gallery/data/gh-pr-checks.json +272 -0
- package/gallery/data/gh-prs-nextjs.json +419 -0
- package/gallery/data/gh-run-failed.json +1 -0
- package/gallery/data/gh-run-passed.json +1 -0
- package/gallery/data/gh-run-running.json +1 -0
- package/gallery/data/github-release.json +57 -0
- package/gallery/data/hyperfine-startup.json +187 -0
- package/gallery/data/lcov.info +234 -0
- package/gallery/data/logs/media-sync.log +127 -0
- package/gallery/data/logs/thumbnailer.jsonl +17 -0
- package/gallery/data/logs/vitest-run.log +89 -0
- package/gallery/data/npm-audit.json +672 -0
- package/gallery/data/npm-outdated.json +179 -0
- package/gallery/data/oxlint.json +156 -0
- package/gallery/data/pip-outdated.json +68 -0
- package/gallery/data/pnpm-outdated.json +58 -0
- package/gallery/data/provenance/devicectl-install.json +35 -0
- package/gallery/data/provenance/install-timeout.log +4 -0
- package/gallery/data/provenance/iphone-install.json +72 -0
- package/gallery/data/provenance/iphone-no-receipt.json +57 -0
- package/gallery/data/provenance/live-home.jpg +0 -0
- package/gallery/data/provenance/live-probe.txt +10 -0
- package/gallery/data/provenance/xcodebuild-2811.log +19 -0
- package/gallery/data/provenance/xcodebuild-4712.log +19 -0
- package/gallery/data/pytest-junit.xml +64 -0
- package/gallery/data/python-org-trace.json +35 -0
- package/gallery/data/python-org.har +31 -0
- package/gallery/data/retry.ts +13 -0
- package/gallery/data/ruff.json +261 -0
- package/gallery/data/src/durations.py +63 -0
- package/gallery/data/src/json-logic.ts +156 -0
- package/gallery/data/src/mapMath.ts +135 -0
- package/gallery/data/src/semver/bump.go +73 -0
- package/gallery/data/traces/browser-error.json +5 -0
- package/gallery/data/traces/go/main.go +27 -0
- package/gallery/data/traces/go-panic.txt +16 -0
- package/gallery/data/traces/java-caused-by.txt +15 -0
- package/gallery/data/traces/node-aggregate.txt +30 -0
- package/gallery/data/traces/node-cause.txt +21 -0
- package/gallery/data/traces/py/deploy.json +5 -0
- package/gallery/data/traces/py/deploy.py +17 -0
- package/gallery/data/traces/py/settings.py +19 -0
- package/gallery/data/traces/python-chain.txt +30 -0
- package/gallery/data/traces/rust/main.rs +11 -0
- package/gallery/data/traces/rust-panic.txt +16 -0
- package/gallery/data/traces/shop/cart.mjs +19 -0
- package/gallery/data/traces/shop/pricing.mjs +12 -0
- package/gallery/data/traces/shop/status.mjs +9 -0
- package/gallery/data/traces/web/app.js +11 -0
- package/gallery/data/traces/web/index.html +1 -0
- package/gallery/data/traces/web/search.js +10 -0
- package/gallery/data/transcript/call-noisy.wav +0 -0
- package/gallery/data/transcript/call.json +362 -0
- package/gallery/data/transcript/call.wav +0 -0
- package/gallery/data/transcript/mlx-whisper-tiny.en-noisy.json +1 -0
- package/gallery/data/transcript/whisper-cpp-base.en-noisy.json +658 -0
- package/gallery/data/transcript/whisper-cpp-base.en.json +658 -0
- package/gallery/data/transcript/whisper-cpp-base.en.srt +16 -0
- package/gallery/data/transcript/whisper-cpp-tiny.en-noisy.json +619 -0
- package/gallery/data/tsc.txt +4 -0
- package/gallery/data/vitest-bench.json +119 -0
- package/gallery/data/vitest-junit.xml +133 -0
- package/gallery/data/vitest-report.json +612 -0
- package/gallery/images/bell.svg +10 -0
- package/gallery/images/bike.svg +47 -0
- package/gallery/images/footer-planet.webp +0 -0
- package/gallery/images/front-light.svg +13 -0
- package/gallery/images/golden-hour.webp +0 -0
- package/gallery/images/option-flowers.webp +0 -0
- package/gallery/images/option-hilltop.webp +0 -0
- package/gallery/images/option-meadow.webp +0 -0
- package/gallery/images/option-sky.webp +0 -0
- package/gallery/images/u-lock.svg +10 -0
- package/index.client.tsx +164 -0
- package/index.server.ts +216 -0
- package/package.json +50 -4
- package/paseo-plugin.json +14 -0
- package/server/data-source.ts +407 -0
- package/server/project.ts +981 -0
- package/server/web/address.ts +57 -0
- package/server/web/cache.ts +85 -0
- package/server/web/commons.ts +126 -0
- package/server/web/geocode.ts +40 -0
- package/server/web/image.ts +35 -0
- package/server/web/lookups.ts +248 -0
- package/server/web/net.ts +210 -0
- package/shared/core/acceptance.ts +744 -0
- package/shared/core/ast.ts +76 -0
- package/shared/core/benchmark.ts +743 -0
- package/shared/core/catalog.ts +733 -0
- package/shared/core/compare.ts +225 -0
- package/shared/core/coverage.ts +456 -0
- package/shared/core/data.ts +334 -0
- package/shared/core/decisions.ts +527 -0
- package/shared/core/dependencies.ts +604 -0
- package/shared/core/diagnostics.ts +24 -0
- package/shared/core/environments.ts +212 -0
- package/shared/core/evaluate.ts +737 -0
- package/shared/core/fields.ts +66 -0
- package/shared/core/findings.ts +1172 -0
- package/shared/core/form.ts +69 -0
- package/shared/core/index.ts +44 -0
- package/shared/core/junit.ts +252 -0
- package/shared/core/lexer.ts +275 -0
- package/shared/core/logs.ts +496 -0
- package/shared/core/markdown.ts +2374 -0
- package/shared/core/parser.ts +355 -0
- package/shared/core/perf-units.ts +228 -0
- package/shared/core/pipeline.ts +679 -0
- package/shared/core/project.ts +472 -0
- package/shared/core/provenance.ts +725 -0
- package/shared/core/stack-trace.ts +718 -0
- package/shared/core/streaming.ts +136 -0
- package/shared/core/test-results.ts +562 -0
- package/shared/core/thread-activity.ts +203 -0
- package/shared/core/tracking.ts +887 -0
- package/shared/core/transcript.ts +1364 -0
- package/shared/core/treemap.ts +446 -0
- package/shared/core/types.ts +70 -0
- package/shared/core/validate.ts +574 -0
- package/shared/core/waterfall.ts +536 -0
- package/shared/diagram/flowchart.ts +205 -0
- package/shared/diagram/layout.ts +440 -0
- package/shared/diagram/markdown.ts +135 -0
- package/shared/diagram/sequence.ts +122 -0
- package/shared/diagram/zoom.ts +114 -0
- package/shared/fallback.ts +120 -0
- package/shared/genui.test.ts +122 -0
- package/shared/instructions.ts +144 -0
- package/shared/logic/calendarMath.ts +130 -0
- package/shared/logic/chartMath.ts +289 -0
- package/shared/logic/choose-logic.ts +196 -0
- package/shared/logic/compare-logic.ts +270 -0
- package/shared/logic/content-model.ts +227 -0
- package/shared/logic/environments-logic.ts +53 -0
- package/shared/logic/explain-logic.ts +315 -0
- package/shared/logic/fieldLogic.ts +138 -0
- package/shared/logic/gallery-search.ts +71 -0
- package/shared/logic/icons.ts +322 -0
- package/shared/logic/json-logic.ts +153 -0
- package/shared/logic/mapMath.ts +133 -0
- package/shared/logic/project-logic.ts +39 -0
- package/shared/logic/references-model.ts +201 -0
- package/shared/logic/sketch.ts +165 -0
- package/shared/logic/supersession.ts +77 -0
- package/shared/logic/values.ts +133 -0
- package/shared/logic/widget-logic.ts +163 -0
- package/shared/rpc.ts +252 -0
- package/shared/segment.ts +81 -0
- package/shared/settings.ts +12 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300">
|
|
2
|
+
<rect width="400" height="300" fill="#e9f0f6"/>
|
|
3
|
+
<path d="M276 118 L392 58 V242 L276 182 Z" fill="#fde68a" opacity="0.55"/>
|
|
4
|
+
<path d="M276 132 L392 104 V196 L276 168 Z" fill="#fef3c7" opacity="0.8"/>
|
|
5
|
+
<ellipse cx="190" cy="236" rx="100" ry="8" fill="#d6e0ea"/>
|
|
6
|
+
<rect x="96" y="112" width="176" height="76" rx="30" fill="#262a31"/>
|
|
7
|
+
<rect x="110" y="122" width="120" height="10" rx="5" fill="#4b5260"/>
|
|
8
|
+
<circle cx="150" cy="168" r="5" fill="#34d399"/>
|
|
9
|
+
<circle cx="168" cy="168" r="5" fill="#34d399"/>
|
|
10
|
+
<circle cx="186" cy="168" r="5" fill="#4b5260"/>
|
|
11
|
+
<ellipse cx="270" cy="150" rx="16" ry="38" fill="#f8fafc" stroke="#cbd5e1" stroke-width="4"/>
|
|
12
|
+
<rect x="150" y="186" width="44" height="34" rx="8" fill="#4b5260"/>
|
|
13
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300">
|
|
2
|
+
<rect width="400" height="300" fill="#f4efe6"/>
|
|
3
|
+
<ellipse cx="200" cy="246" rx="110" ry="8" fill="#e3dccf"/>
|
|
4
|
+
<path d="M140 168 V104 a60 60 0 0 1 120 0 V168" fill="none" stroke="#8a929c" stroke-width="26" stroke-linecap="round"/>
|
|
5
|
+
<path d="M134 104 a66 66 0 0 1 40 -58" fill="none" stroke="#c3c9cf" stroke-width="6" stroke-linecap="round"/>
|
|
6
|
+
<rect x="98" y="158" width="204" height="56" rx="18" fill="#e4572e"/>
|
|
7
|
+
<rect x="98" y="158" width="204" height="18" rx="9" fill="#ef7b55"/>
|
|
8
|
+
<circle cx="200" cy="186" r="9" fill="#5a2516"/>
|
|
9
|
+
<rect x="196" y="190" width="8" height="14" rx="3" fill="#5a2516"/>
|
|
10
|
+
</svg>
|
package/index.client.tsx
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { PluginClientContext } from "@getpaseo/plugin/client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { buildFullInstructions } from "./shared/instructions";
|
|
4
|
+
import {
|
|
5
|
+
appendDemoRpc,
|
|
6
|
+
genuiBlockDataSchema,
|
|
7
|
+
genuiTextDataSchema,
|
|
8
|
+
} from "./shared/rpc";
|
|
9
|
+
import {
|
|
10
|
+
GENUI_BLOCK_KIND,
|
|
11
|
+
GENUI_TEXT_KIND,
|
|
12
|
+
splitTimelineMessage,
|
|
13
|
+
} from "./shared/segment";
|
|
14
|
+
import {
|
|
15
|
+
GalleryScreen,
|
|
16
|
+
GallerySidebarItem,
|
|
17
|
+
GalleryWorkspacePanel,
|
|
18
|
+
} from "./client/gallery";
|
|
19
|
+
import { TimelineBlockItem, TimelineTextItem } from "./client/live-ui";
|
|
20
|
+
import { GenUiSettingsScreen } from "./client/settings";
|
|
21
|
+
|
|
22
|
+
export default function contribute(client: PluginClientContext) {
|
|
23
|
+
const playAudio = async (dataUrl: string) => {
|
|
24
|
+
const comma = dataUrl.indexOf(",");
|
|
25
|
+
if (comma === -1) return;
|
|
26
|
+
const header = dataUrl.slice(0, comma);
|
|
27
|
+
const mimeMatch = /^data:([^;]+);base64$/i.exec(header);
|
|
28
|
+
const mimeType = mimeMatch?.[1] ?? "audio/wav";
|
|
29
|
+
const base64 = dataUrl.slice(comma + 1);
|
|
30
|
+
await client.playAudio({ base64, mimeType });
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
client.addTimelineTransformer({
|
|
34
|
+
id: "genui-assistant",
|
|
35
|
+
query: { itemType: "assistant_message" },
|
|
36
|
+
transform({ item, phase }) {
|
|
37
|
+
return splitTimelineMessage(item.text, phase, item.messageId);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
client.addTimelineRenderer({
|
|
42
|
+
kind: GENUI_BLOCK_KIND,
|
|
43
|
+
version: 1,
|
|
44
|
+
schema: genuiBlockDataSchema,
|
|
45
|
+
Component: (props) => <TimelineBlockItem {...props} playAudio={playAudio} />,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
client.addTimelineRenderer({
|
|
49
|
+
kind: GENUI_TEXT_KIND,
|
|
50
|
+
version: 1,
|
|
51
|
+
schema: genuiTextDataSchema,
|
|
52
|
+
Component: TimelineTextItem,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
client.addScreen({
|
|
56
|
+
id: "gallery",
|
|
57
|
+
title: "Gen-UI Gallery",
|
|
58
|
+
Component: (props) => <GalleryScreen {...props} playAudio={playAudio} />,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
client.addSidebarHeaderItem({
|
|
62
|
+
id: "gallery",
|
|
63
|
+
title: "Gen-UI Gallery",
|
|
64
|
+
Component: GallerySidebarItem,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
client.addWorkspacePanel({
|
|
68
|
+
id: "gallery",
|
|
69
|
+
title: "Gen-UI Gallery",
|
|
70
|
+
icon: "LayoutGrid",
|
|
71
|
+
context: "workspace",
|
|
72
|
+
locations: ["workspace", "explorer"],
|
|
73
|
+
Component: (props) => <GalleryWorkspacePanel {...props} playAudio={playAudio} />,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
client.addSettingsScreen({
|
|
77
|
+
id: "preferences",
|
|
78
|
+
title: "Generative UI",
|
|
79
|
+
icon: "LayoutGrid",
|
|
80
|
+
Component: GenUiSettingsScreen,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
client.addSlashCommand({
|
|
84
|
+
name: "genui",
|
|
85
|
+
description: "Enable Generative UI inline components for this agent",
|
|
86
|
+
argumentHint: "[prompt]",
|
|
87
|
+
context: "agent",
|
|
88
|
+
async onSubmit({ args, paseo, agent }) {
|
|
89
|
+
const prompt = args.trim()
|
|
90
|
+
? `${buildFullInstructions(true)}\n\n${args.trim()}`
|
|
91
|
+
: `${buildFullInstructions(true)}\n\nAcknowledge briefly and use \`\`\`ui blocks in your replies from now on.`;
|
|
92
|
+
await paseo.agents.ref(agent.id).send(prompt);
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
client.addSlashCommand({
|
|
97
|
+
name: "genui-demo",
|
|
98
|
+
description: "Insert a live interactive Gen-UI block into this chat",
|
|
99
|
+
argumentHint: "[ComponentName]",
|
|
100
|
+
context: "agent",
|
|
101
|
+
async onSubmit({ args, rpc, agent }) {
|
|
102
|
+
await rpc(appendDemoRpc, {
|
|
103
|
+
agentId: agent.id,
|
|
104
|
+
...(args.trim() ? { component: args.trim() } : {}),
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
client.addSlashCommand({
|
|
110
|
+
name: "genui-gallery",
|
|
111
|
+
description: "Open the Gen-UI Gallery (86 components, 170+ examples)",
|
|
112
|
+
argumentHint: "",
|
|
113
|
+
context: "workspace",
|
|
114
|
+
onSubmit({ openScreen }) {
|
|
115
|
+
openScreen({ screenId: "gallery" });
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
client.addCommandCenterItem({
|
|
120
|
+
id: "open-gallery",
|
|
121
|
+
title: "Gen-UI: Open Component Gallery",
|
|
122
|
+
icon: "LayoutGrid",
|
|
123
|
+
keywords: ["genui", "gallery", "charts", "diagrams", "ui"],
|
|
124
|
+
context: "global",
|
|
125
|
+
onSelect({ openScreen }) {
|
|
126
|
+
openScreen({ screenId: "gallery" });
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
client.addCommandCenterItem({
|
|
131
|
+
id: "open-workspace-gallery",
|
|
132
|
+
title: "Gen-UI: Open Gallery Panel in Workspace",
|
|
133
|
+
icon: "LayoutGrid",
|
|
134
|
+
keywords: ["genui", "panel", "playground"],
|
|
135
|
+
context: "workspace",
|
|
136
|
+
onSelect({ openPanel }) {
|
|
137
|
+
openPanel("gallery");
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
client.addCommandCenterItem({
|
|
142
|
+
id: "insert-demo",
|
|
143
|
+
title: "Gen-UI: Insert Interactive Demo Block",
|
|
144
|
+
icon: "Sparkles",
|
|
145
|
+
keywords: ["genui", "demo", "ui"],
|
|
146
|
+
context: "agent",
|
|
147
|
+
async onSelect({ rpc, agent }) {
|
|
148
|
+
await rpc(appendDemoRpc, { agentId: agent.id });
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
client.addCommandCenterItem({
|
|
153
|
+
id: "open-settings",
|
|
154
|
+
title: "Gen-UI: Open Settings",
|
|
155
|
+
icon: "Settings",
|
|
156
|
+
keywords: ["genui", "settings", "web lookups"],
|
|
157
|
+
context: "global",
|
|
158
|
+
onSelect({ openSettings }) {
|
|
159
|
+
openSettings("preferences");
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
return () => {};
|
|
164
|
+
}
|
package/index.server.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import type { PluginServerContext } from "@getpaseo/plugin/server";
|
|
3
|
+
import { checkSpec, renderReplyMarkdown } from "./shared/fallback";
|
|
4
|
+
import { buildFullInstructions, GENUI_MARKER } from "./shared/instructions";
|
|
5
|
+
import {
|
|
6
|
+
appendDemoRpc,
|
|
7
|
+
checkUiRpc,
|
|
8
|
+
galleryAudioRpc,
|
|
9
|
+
galleryDataRpc,
|
|
10
|
+
galleryGetRpc,
|
|
11
|
+
galleryImageRpc,
|
|
12
|
+
galleryListRpc,
|
|
13
|
+
loadAudioRpc,
|
|
14
|
+
loadDataRpc,
|
|
15
|
+
loadImageRpc,
|
|
16
|
+
projectChangesRpc,
|
|
17
|
+
projectCommitsRpc,
|
|
18
|
+
projectEnvironmentRpc,
|
|
19
|
+
projectEnvironmentsRpc,
|
|
20
|
+
projectPatchesRpc,
|
|
21
|
+
projectPullRequestRpc,
|
|
22
|
+
projectThreadsRpc,
|
|
23
|
+
renderMarkdownRpc,
|
|
24
|
+
sketchFontRpc,
|
|
25
|
+
uiExamplesRpc,
|
|
26
|
+
webGeocodeRpc,
|
|
27
|
+
webImageRpc,
|
|
28
|
+
webSearchRpc,
|
|
29
|
+
webTileRpc,
|
|
30
|
+
} from "./shared/rpc";
|
|
31
|
+
import { GENUI_BLOCK_KIND } from "./shared/segment";
|
|
32
|
+
import { genuiSettings } from "./shared/settings";
|
|
33
|
+
import {
|
|
34
|
+
agentStorageDir,
|
|
35
|
+
examplesReport,
|
|
36
|
+
listGallery,
|
|
37
|
+
loadAgentAudio,
|
|
38
|
+
loadAgentFile,
|
|
39
|
+
loadAgentImage,
|
|
40
|
+
loadGalleryAudio,
|
|
41
|
+
loadGalleryFile,
|
|
42
|
+
loadGalleryImage,
|
|
43
|
+
readGallerySpec,
|
|
44
|
+
sketchFontDataUrl,
|
|
45
|
+
} from "./server/data-source";
|
|
46
|
+
import {
|
|
47
|
+
createProjectReader,
|
|
48
|
+
readProjectChanges,
|
|
49
|
+
readProjectCommits,
|
|
50
|
+
readProjectEnvironment,
|
|
51
|
+
readProjectEnvironments,
|
|
52
|
+
readProjectPatches,
|
|
53
|
+
readProjectPullRequest,
|
|
54
|
+
readProjectThreads,
|
|
55
|
+
} from "./server/project";
|
|
56
|
+
import { createWebLookups } from "./server/web/lookups";
|
|
57
|
+
|
|
58
|
+
const DEFAULT_DEMO_SPEC = `$seats = 10
|
|
59
|
+
$plan = "Pro"
|
|
60
|
+
price = $plan == "Pro" ? 29 : 12
|
|
61
|
+
Card("Estimate", [
|
|
62
|
+
Row([Choice($plan, ["Basic", "Pro"]), Slider($seats, 1, 50, label: "Seats")]),
|
|
63
|
+
Metric("Total", "$" + fmt(price * $seats), note: $seats + " seats on " + $plan),
|
|
64
|
+
Button("Go with " + $plan, Send("Go with " + $plan + " (" + $seats + " seats)"), variant: "primary")
|
|
65
|
+
])`;
|
|
66
|
+
|
|
67
|
+
export default function contribute(server: PluginServerContext) {
|
|
68
|
+
const settings = server.registerSettings(genuiSettings);
|
|
69
|
+
let webLookupsEnabled = true;
|
|
70
|
+
|
|
71
|
+
void settings.read().then((state) => {
|
|
72
|
+
if (state.status === "ready") webLookupsEnabled = state.values.webLookups;
|
|
73
|
+
});
|
|
74
|
+
const unsubscribeSettings = settings.subscribe((state) => {
|
|
75
|
+
if (state.status === "ready") webLookupsEnabled = state.values.webLookups;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const web = createWebLookups(
|
|
79
|
+
async () => {
|
|
80
|
+
const current = await settings.read();
|
|
81
|
+
return current.status === "ready" ? current.values.webLookups : true;
|
|
82
|
+
},
|
|
83
|
+
() => webLookupsEnabled,
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const findImage = async (query: string) => {
|
|
87
|
+
const found = await web.search(query);
|
|
88
|
+
return found.ok ? found.image : null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
server.before("agent.create", async ({ request }) => {
|
|
92
|
+
const current = await settings.read();
|
|
93
|
+
if (current.status === "ready" && !current.values.autoInstructions) return;
|
|
94
|
+
const webOn = current.status === "ready" ? current.values.webLookups : true;
|
|
95
|
+
const existing = request.config.systemPrompt ?? "";
|
|
96
|
+
if (existing.includes(GENUI_MARKER)) return;
|
|
97
|
+
return {
|
|
98
|
+
...request,
|
|
99
|
+
config: {
|
|
100
|
+
...request.config,
|
|
101
|
+
systemPrompt: [existing, buildFullInstructions(webOn)].filter(Boolean).join("\n\n"),
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
server.before("agent.session_open", async ({ request }) => {
|
|
107
|
+
const storageDir = agentStorageDir(request.agentId);
|
|
108
|
+
await mkdir(storageDir, { recursive: true }).catch(() => undefined);
|
|
109
|
+
return {
|
|
110
|
+
...request,
|
|
111
|
+
env: {
|
|
112
|
+
...request.env,
|
|
113
|
+
BB_THREAD_STORAGE: storageDir,
|
|
114
|
+
PASEO_THREAD_STORAGE: storageDir,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
server.handle(loadDataRpc, ({ agentId, path, raw }, { paseo }) =>
|
|
120
|
+
loadAgentFile(paseo, agentId, path, { raw }),
|
|
121
|
+
);
|
|
122
|
+
server.handle(loadImageRpc, ({ agentId, path }, { paseo }) =>
|
|
123
|
+
loadAgentImage(paseo, agentId, path),
|
|
124
|
+
);
|
|
125
|
+
server.handle(loadAudioRpc, ({ agentId, path }, { paseo }) =>
|
|
126
|
+
loadAgentAudio(paseo, agentId, path),
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
server.handle(renderMarkdownRpc, async ({ agentId, text }, { paseo }) => {
|
|
130
|
+
const markdown = await renderReplyMarkdown(
|
|
131
|
+
text,
|
|
132
|
+
(req) => loadAgentFile(paseo, agentId, req.path, req),
|
|
133
|
+
findImage,
|
|
134
|
+
createProjectReader(paseo, agentId),
|
|
135
|
+
);
|
|
136
|
+
return { markdown };
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
server.handle(checkUiRpc, ({ agentId, spec }, { paseo }) =>
|
|
140
|
+
checkSpec(
|
|
141
|
+
spec,
|
|
142
|
+
(req) => loadAgentFile(paseo, agentId, req.path, req),
|
|
143
|
+
findImage,
|
|
144
|
+
createProjectReader(paseo, agentId),
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
server.handle(uiExamplesRpc, ({ components }) => examplesReport(components));
|
|
149
|
+
|
|
150
|
+
server.handle(galleryListRpc, async () => ({ names: await listGallery() }));
|
|
151
|
+
server.handle(galleryGetRpc, async ({ name }) => ({ source: await readGallerySpec(name) }));
|
|
152
|
+
server.handle(galleryDataRpc, ({ path, raw }) => loadGalleryFile(path, { raw }));
|
|
153
|
+
server.handle(galleryImageRpc, ({ path }) => loadGalleryImage(path));
|
|
154
|
+
server.handle(galleryAudioRpc, ({ path }) => loadGalleryAudio(path));
|
|
155
|
+
server.handle(sketchFontRpc, async () => ({ dataUrl: await sketchFontDataUrl() }));
|
|
156
|
+
|
|
157
|
+
server.handle(webImageRpc, ({ url }) => web.image(url));
|
|
158
|
+
server.handle(webSearchRpc, ({ query }) => web.search(query));
|
|
159
|
+
server.handle(webGeocodeRpc, ({ name, near }) => web.geocode(name, near));
|
|
160
|
+
server.handle(webTileRpc, ({ z, x, y }) => web.tile(z, x, y));
|
|
161
|
+
|
|
162
|
+
server.handle(projectChangesRpc, ({ agentId, target, paths }, { paseo }) =>
|
|
163
|
+
readProjectChanges(paseo, agentId, target, paths),
|
|
164
|
+
);
|
|
165
|
+
server.handle(projectPatchesRpc, ({ agentId, target, paths }, { paseo }) =>
|
|
166
|
+
readProjectPatches(paseo, agentId, target, paths),
|
|
167
|
+
);
|
|
168
|
+
server.handle(projectCommitsRpc, ({ agentId }, { paseo }) =>
|
|
169
|
+
readProjectCommits(paseo, agentId),
|
|
170
|
+
);
|
|
171
|
+
server.handle(projectPullRequestRpc, ({ agentId }, { paseo }) =>
|
|
172
|
+
readProjectPullRequest(paseo, agentId),
|
|
173
|
+
);
|
|
174
|
+
server.handle(projectThreadsRpc, ({ agentId, ids }, { paseo }) =>
|
|
175
|
+
readProjectThreads(paseo, agentId, ids),
|
|
176
|
+
);
|
|
177
|
+
server.handle(projectEnvironmentsRpc, ({ agentId }, { paseo }) =>
|
|
178
|
+
readProjectEnvironments(paseo, agentId, false),
|
|
179
|
+
);
|
|
180
|
+
server.handle(projectEnvironmentRpc, ({ agentId, environmentId }, { paseo }) =>
|
|
181
|
+
readProjectEnvironment(paseo, agentId, environmentId),
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
let demoSeq = 0;
|
|
185
|
+
server.handle(appendDemoRpc, async ({ agentId, component }, { paseo }) => {
|
|
186
|
+
let code = DEFAULT_DEMO_SPEC;
|
|
187
|
+
let name = "Estimate";
|
|
188
|
+
if (component && component.trim() !== "") {
|
|
189
|
+
try {
|
|
190
|
+
code = await readGallerySpec(component.trim());
|
|
191
|
+
name = component.trim();
|
|
192
|
+
} catch {
|
|
193
|
+
// Fall back to default demo spec if the named gallery file doesn't exist
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const id = `genui-demo-${Date.now()}-${++demoSeq}`;
|
|
197
|
+
await paseo.agents.ref(agentId).timeline.append({
|
|
198
|
+
type: "plugin",
|
|
199
|
+
id,
|
|
200
|
+
kind: GENUI_BLOCK_KIND,
|
|
201
|
+
version: 1,
|
|
202
|
+
data: {
|
|
203
|
+
language: "ui",
|
|
204
|
+
code,
|
|
205
|
+
complete: true,
|
|
206
|
+
fenceIndex: 0,
|
|
207
|
+
messageId: id,
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
return { appended: true, name };
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
return () => {
|
|
214
|
+
unsubscribeSettings();
|
|
215
|
+
};
|
|
216
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paseo-plugin-genui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Paseo plugin: agents answer with charts, diagrams, maps, plans and forms rendered inline in the chat.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"paseo",
|
|
7
|
+
"paseo-plugin",
|
|
8
|
+
"generative-ui",
|
|
9
|
+
"inline-ui",
|
|
10
|
+
"charts",
|
|
11
|
+
"diagrams",
|
|
12
|
+
"maps"
|
|
13
|
+
],
|
|
14
|
+
"author": "anh-chu",
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"homepage": "https://github.com/anh-chu/paseo-plugin-genui#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/anh-chu/paseo-plugin-genui.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": "https://github.com/anh-chu/paseo-plugin-genui/issues",
|
|
22
|
+
"files": [
|
|
23
|
+
"paseo-plugin.json",
|
|
24
|
+
"OVERVIEW.md",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"index.client.ts",
|
|
28
|
+
"index.client.tsx",
|
|
29
|
+
"index.server.ts",
|
|
30
|
+
"index.server.tsx",
|
|
31
|
+
"client/",
|
|
32
|
+
"server/",
|
|
33
|
+
"shared/",
|
|
34
|
+
"gallery/",
|
|
35
|
+
"assets/"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"test": "vitest run"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@getpaseo/plugin": "0.11.2",
|
|
43
|
+
"@tanstack/react-query": "^5.90.11",
|
|
44
|
+
"@types/node": "^24.19.2",
|
|
45
|
+
"@types/react": "~19.2.0",
|
|
46
|
+
"react": "19.1.0",
|
|
47
|
+
"react-native": "0.81.5",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vitest": "^4.1.11",
|
|
50
|
+
"zod": "^4.4.3"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "genui",
|
|
3
|
+
"name": "Generative UI",
|
|
4
|
+
"description": "Agents answer with charts, diagrams, maps, plans and forms rendered inline in the chat.",
|
|
5
|
+
"icon": "assets/icon.png",
|
|
6
|
+
"media": [
|
|
7
|
+
"assets/screenshot-chat.png",
|
|
8
|
+
"assets/screenshot-gallery.png",
|
|
9
|
+
"assets/screenshot-playground.png"
|
|
10
|
+
],
|
|
11
|
+
"requirements": {
|
|
12
|
+
"paseo": ">=0.11.2"
|
|
13
|
+
}
|
|
14
|
+
}
|