native-blocks
БесплатноБез исполняемых скриптовНе проверенAdd or change a native message block (agent cards such as plans, approvals, reviews, task suggestions, questionnaires) across proto, server, bridge, macOS and…
от inline-chat★ 915 звёзд на GitHubОб этом скилле
Native message blocks
Inline draws agent surfaces (plans, approvals, review notes, task suggestions, next steps, prompt chips, questionnaires) as typed protocol blocks with native views on macOS and iOS. HTML widgets are not a substitute. Each upstream surface gets its own block kind when it has its own look or behaviour.
Contract every block keeps
- Every user-visible string in a block is a
BlockTextUTF-16 range intoMessage.message. That text is the complete readable fallback for older clients, notifications, search and copy. Machine strings (ids, composer text, categories) are plain fields. - Ranges of top-level blocks are ascending and don't overlap. The server enforces this.
- A client that can't draw a block shows the text it covers and draws everything else (
BlockContentSpanin InlineKit). A kind newer than the build shows the text between its neighbours; inside a container,BlockContentSpan.childBoundsstands in for missing neighbours, so pass it to nested layouts of any new container kind (and add the kind there). List items get theirs fromBlockContentSpan.itemBounds. Never fail a whole message because of one block. - Buttons are ordinary
Message.actionsreferenced by id (action_ids). Clients draw them inside the block and drop them from the action rows (BlockInlineActions). Older clients keep them in the rows, still working. - State that changes (decision state, step status, who decided) lives in the block. The sender edits the message. Edits are realtime-only: no push, and "edited" shows only in the context menu.
BLOCK_DECISION_STATE_UNSPECIFIEDmeans "no state to show": no chip or note, buttons stay live. Bridges close a card answered outside Inline this way, so never draw it as pending. - A closed card keeps what it showed: a question keeps its prompts and the answers sent (secrets never), not just "Answered by X". Clients keep a submitted form's non-secret answers (
MessageFormDraftStore.markSubmitted) until the sender closes it. - Composer text goes through
MessageActionCompose/MessageComposeRequests. It is appended to the draft and never sent by itself. Post it withpost(_:from:isThreadAnchor:): a message shown as a thread's anchor fills that thread's composer, not the parent chat's.
Adding a surface: the order of work
- Is it a recipe or a new kind? If an existing block draws it faithfully, add only a bridge recipe (step 7). Otherwise add a kind.
- Proto: add the kind to
Block.kindinproto/core.proto(next free number), with its message and a comment saying what its fallback text carries. Runbun run generate:proto, thenbun run proto:sync-rust. Call out the proto change before committing. - InlineKit (every switch is exhaustive, so the build lists each place):
BlockContentSpan.span(of:): every text range of the kind.BlockContentReconciler: aBlockContentNodeKindcase; flatten children.BlockContentDirection:declaredDirectionandresolveif it hasis_rtl.Message.materializeBlockPhotosif it can hold images.BlockInlineActions.collectif it hasaction_ids.- Tests in
apple/InlineKit/Tests/InlineKitTests/BlockContentSpanTests.swift.
- Server: validation (ranges, caps,
action_idsexist, span order) and the bot API encode/decode inserver/src/controllers/bot/richContent.tsandpackages/bot-api-types. TS switches end insatisfies never. - macOS:
- A plan node in
RichBlockAgentPlan.swiftplusRichBlockLayoutPlan.NodeKindandRichBlockRenderKind. - Layout in
RichBlockLayoutPlanner+AgentCards.swift(or+Agent.swift) with manual measured layout. Card-shaped blocks reusebeginCard/appendActions/endCard. - A node view in
RichBlockAgentCardNodeViews.swift, registered inRichBlockViewFactory. - Text parts are
RichBlockTextSurfaces listed inorderedTextSurfaces, so selection and copy work.
- A plan node in
- iOS: the builder in
apple/InlineIOS/Features/MessageView/MessageRichContent.swift, theRichBlocknode inapple/InlineMessageLayout, and the view inMessageRichView.swift. Match macOS: light and dark, RTL, Dynamic Type, VoiceOver. Interactive state that isn't in the message (expansion, form answers) lives in a store the builder reads; a tap updates the store and rebuilds the message (onContentStateChange). Forms work this way: card rows for choices, an editor sheet for typed answers (MessageFormController), answers inMessageFormDraftStoreviaMessageFormAnswers. - Bridge recipe:
cli/src/bridge/v2/blocks/<surface>.rsmaps the native tool call or item to the block. Add a native sample inblocks/fixtures/<surface>/and a golden test of blocks plus fallback text. Register it in the table inblocks/mod.rs. If the surface is a host tool in Claude or ChatGPT desktop, add an Inline tool incli/src/bridge/v2/tools.rs. - Check:
swift testin InlineKit and InlineMessageLayout.- Server tests for the validation
Установить native-blocks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл native-blocks?
Add or change a native message block (agent cards such as plans, approvals, reviews, task suggestions, questionnaires) across proto, server, bridge, macOS and iOS. Use when Claude, ChatGPT or Codex clients ship a new card, or a block needs a new field.
Как установить скилл native-blocks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл native-blocks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic