mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-27 09:26:23 +02:00
Blocks (#439)
Added blocks to notes and updated assistant skill with this. Image blocks — images with alt text and captions Embed blocks — inline YouTube videos, Figma designs, or link cards Chart blocks — line, bar, and pie charts from inline data or JSON files Table blocks — styled data tables with named columns
This commit is contained in:
parent
a10e97110d
commit
91030a5fca
11 changed files with 1016 additions and 0 deletions
36
apps/x/packages/shared/src/blocks.ts
Normal file
36
apps/x/packages/shared/src/blocks.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
export const ImageBlockSchema = z.object({
|
||||
src: z.string(),
|
||||
alt: z.string().optional(),
|
||||
caption: z.string().optional(),
|
||||
});
|
||||
|
||||
export type ImageBlock = z.infer<typeof ImageBlockSchema>;
|
||||
|
||||
export const EmbedBlockSchema = z.object({
|
||||
provider: z.enum(['youtube', 'figma', 'generic']),
|
||||
url: z.string().url(),
|
||||
caption: z.string().optional(),
|
||||
});
|
||||
|
||||
export type EmbedBlock = z.infer<typeof EmbedBlockSchema>;
|
||||
|
||||
export const ChartBlockSchema = z.object({
|
||||
chart: z.enum(['line', 'bar', 'pie']),
|
||||
title: z.string().optional(),
|
||||
data: z.array(z.record(z.string(), z.unknown())).optional(),
|
||||
source: z.string().optional(),
|
||||
x: z.string(),
|
||||
y: z.string(),
|
||||
});
|
||||
|
||||
export type ChartBlock = z.infer<typeof ChartBlockSchema>;
|
||||
|
||||
export const TableBlockSchema = z.object({
|
||||
columns: z.array(z.string()),
|
||||
data: z.array(z.record(z.string(), z.unknown())),
|
||||
title: z.string().optional(),
|
||||
});
|
||||
|
||||
export type TableBlock = z.infer<typeof TableBlockSchema>;
|
||||
|
|
@ -8,6 +8,7 @@ export * as agentSchedule from './agent-schedule.js';
|
|||
export * as agentScheduleState from './agent-schedule-state.js';
|
||||
export * as serviceEvents from './service-events.js'
|
||||
export * as inlineTask from './inline-task.js';
|
||||
export * as blocks from './blocks.js';
|
||||
export * as frontmatter from './frontmatter.js';
|
||||
export * as bases from './bases.js';
|
||||
export { PrefixLogger };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue