{"id":22785777,"url":"https://github.com/rubriclab/blocks","last_synced_at":"2025-09-10T18:46:40.016Z","repository":{"id":229881978,"uuid":"777877440","full_name":"RubricLab/blocks","owner":"RubricLab","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-18T00:52:54.000Z","size":71,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-18T05:29:49.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubricLab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-26T17:07:35.000Z","updated_at":"2025-07-18T00:52:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"8c38d7ee-0761-44e3-a897-c22fd81c4abe","html_url":"https://github.com/RubricLab/blocks","commit_stats":null,"previous_names":["rubriclab/genuine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RubricLab/blocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubricLab%2Fblocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubricLab%2Fblocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubricLab%2Fblocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubricLab%2Fblocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubricLab","download_url":"https://codeload.github.com/RubricLab/blocks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubricLab%2Fblocks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266231762,"owners_count":23896472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T23:07:42.523Z","updated_at":"2025-07-21T03:02:41.766Z","avatar_url":"https://github.com/RubricLab.png","language":"TypeScript","readme":"# @rubriclab/actions\nThe Blocks package aims to provide a powerful and simple way to define blocks (which are essentially UI primitives) and execute them safely with JSON serializable payloads.\n\nIt is part of Rubric's architecture for Generative UI when used with:\n- [@rubriclab/actions](https://github.com/rubriclab/actions)\n- [@rubriclab/blocks](https://github.com/rubriclab/blocks)\n- [@rubriclab/chains](https://github.com/rubriclab/chains)\n- [@rubriclab/agents](https://github.com/rubriclab/agents)\n- [@rubriclab/events](https://github.com/rubriclab/events)\n\n[Demo](https://chat.rubric.sh)\n\n## Get Started\n### Installation\n`bun add @rubriclab/blocks`\n\n\u003e @rubriclab scope packages are not built, they are all raw typescript. If using in a next.js app, make sure to transpile.\n\n```ts\n// next.config.ts\nimport type { NextConfig } from  'next' \nexport default {\n\ttranspilePackages: ['@rubriclab/blocks'],\n\treactStrictMode: true\n} satisfies  NextConfig\n```\n\n\u003e If using inside the monorepo (@rubric), simply add `{\"@rubriclab/blocks\": \"*\"}` to dependencies and then run `bun i`\n\n### Define Blocks\nTo get started, define a few blocks.\n\n```tsx\nimport { createBlock } from '@rubriclab/blocks'\nimport { Heading } from '~/ui/heading'\nimport { z } from 'zod'\n\nconst heading = createBlock({\n\tschema: {\n\t\tinput: {\n\t\t\ttext: z.string()\n\t\t},\n\t\toutput: z.undefined\n\t},\n\trender: ({ text }) =\u003e \u003ch1\u003e{text}\u003c/h1\u003e\n})\n\nexport const blocks = { heading }\n```\n\n### Create a Renderer\nPass all your blocks into an render to get a function to render it.\n\n```ts\n'use client'\n\nimport { createBlockRenderer } from '@rubriclab/blocks'\nimport { blocks } from './blocks'\n\nexport const { render } = createBlockRenderer({ blocks })\n```\n\n### Render a Block\n\n```ts\nconst block = await render({\n    block: 'heading',\n    props: {\n        text: 'Hello World'\n    }\n})\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubriclab%2Fblocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubriclab%2Fblocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubriclab%2Fblocks/lists"}