Logo Xapps

Xapps

Tổ chức
Cognigy
xapps

Use when the user wants to add xApps to a Cognigy flow — interactive HTML / Adaptive Card mini-apps rendered to the user, with the submitted data flowing back into the conversation. Covers the xApp flow nodes, the Init Session rule, and accessing xApp data.

Tổng quan

Nhà phát hànhCognigy
Kho mãcognigy-plugin
Tên kỹ năngxapps
Sao
20
Bản fork
14
Tệp đi kèm
6
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Cognigy công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Xapps trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/Cognigy/cognigy-plugin/tree/main/plugin/skills/xapps
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Cognigy/cognigy-plugin.git /tmp/cognigy-plugin
mkdir -p .claude/skills
cp -r /tmp/cognigy-plugin/plugin/skills/xapps .claude/skills/xapps
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Xapps trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Xapps ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Xapps không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

xApps

xApps are interactive in-conversation mini-apps: you render an HTML page or an Adaptive Card to the user, they interact, and their submitted data flows back into the conversation. xApps are built as flow nodes managed with manage_flow_nodes (extension @cognigy/basic-nodes).

Two hard rules

  1. xApp: Init Session (initAppSession) must run before any other xApp node. It creates the session and populates input.apps.url (session URL) and input.apps.baseUrl. Every other xApp node depends on a live session. Creating an xApp node without a preceding initAppSession in the flow returns a _hints.warning — add Init Session first.
  2. Data comes back via input/context, not a return value — see "Accessing xApp data".

Where xApp nodes go

Like all manage_flow_nodes nodes, xApp nodes live inside a tool branch — never before the AI Agent Job node (see the flow-nodes guide). "Init Session at the beginning" means the beginning of the xApp sequence inside the tool branch, not the flow's absolute start.

Typical chain inside a tool:

tool node ──appendChild──▶ initAppSession
          ──append──────▶ showXAppAdaptiveCard { waitForInput: true, storeResultInContext: true, contextKey: "result" }
          ──append──────▶ code / say  (reads context.result or input.data._cognigy._app.payload)
                          ▶ Resolve Tool Action

Workflow

1. Create a tool — create_tool { aiAgentId, toolType: 'tool', name: 'Collect Details', config: { toolId: 'collect_details', description: 'Collect details via an xApp' } } → toolNodeId
2. Init the session — manage_flow_nodes { operation: 'create', flowId, parentNodeId: '<toolNodeId>', mode: 'appendChild', nodeType: 'initAppSession', label: 'xApp: Init Session' }
3. Show a UI + wait — manage_flow_nodes { operation: 'create', flowId, parentNodeId: '<initSessionNodeId>', mode: 'append', nodeType: 'showXAppAdaptiveCard', label: 'xApp: Show Card', config: { card: { ... }, waitForInput: true, storeResultInContext: true, contextKey: 'result' } }
4. Use the result — add a code/say node after it that reads context.result or input.data._cognigy._app.payload
5. List nodes — manage_flow_nodes { operation: 'list', flowId }

To let the user open the xApp from a button (rather than an inline overlay), add a say node with a web_url button after step 2 — see "Rendering an Open-xApp button" below.

Node types

initAppSession — xApp: Init Session

Creates the session. Place first among the xApp nodes. All fields optional.

FieldTypeDescription
backgroundColor / textColorstringCSS color for the shell page
logo"default" | "none" | "custom"Shell logo. custom requires logoUrl
logoUrlstringCustom logo URL (when logo: "custom")
faviconUrlstringBrowser-tab icon URL
pageTitlestringBrowser-tab title
appLoadingText / appLaunchErrorText / appErrorTextstringScreen texts
intermediateScreenCustomizationType"none" | "override" | "app"Intermediate screen mode
intermediateScreenOverrideTextstringWhen ...Type: "override"
intermediateScreenAppTemplateId / intermediateScreenAppTemplateDatastring / objectWhen ...Type: "app"
connectionScreenCustomizationType"none" | "override" | "app"Connection screen mode
connectionScreenOverrideConnectingText / ...InvalidText / ...UnavailableTextstringWhen ...Type: "override"
connectionScreenAppTemplateId / connectionScreenAppTemplateDatastring / objectWhen ...Type: "app"
json
{
  "operation": "create",
  "flowId": "<flowId>",
  "parentNodeId": "<toolNodeId>",
  "mode": "appendChild",
  "nodeType": "initAppSession",
  "label": "xApp: Init Session",
  "config": { "pageTitle": "Booking", "logo": "default" }
}

showXAppAdaptiveCard — xApp: Show Adaptive Card

Render an Adaptive Card. card is required.

FieldTypeRequiredDescription
cardobjectYesAdaptive Card JSON (build with the Adaptive Card Designer)
primaryColor / primaryContrastColorstringNoStyle overrides
waitForInputbooleanNoPause the flow until the user submits
storeResultInContextbooleanNoStore the submit payload in context (needs waitForInput)
contextKeystringNoContext key for the result (default "result")
autoOpen, closeOnSubmit, feedbackMessage, screenTitle, sendEventOnCloseIconClick, showCloseIcon—NoWebchat v3 overlay settings
json
{
  "operation": "create",
  "flowId": "<flowId>",
  "parentNodeId": "<initSessionNodeId>",
  "mode": "append",
  "nodeType": "showXAppAdaptiveCard",
  "label": "xApp: Show Card",
  "config": {
    "card": { "type": "AdaptiveCard", "version": "1.5", "body": [{ "type": "Input.Text", "id": "nickname", "label": "Nickname" }], "actions": [{ "type": "Action.Submit", "title": "Submit" }] },
    "waitForInput": true,
    "storeResultInContext": true,
    "contextKey": "result"
  }
}

showXAppHtml — xApp: Show HTML

Render custom HTML. All fields optional (mode defaults to body).

FieldTypeDescription
mode"body" | "full"body = HTML body only (Cognigy wraps it + injects the xApp SDK). full = full HTML document (you must include the SDK yourself)
bodystringHTML body (when mode: "body")
htmlstringFull HTML document (when mode: "full")
waitForInput / storeResultInContext / contextKeyboolean / boolean / stringSame waiting behavior as above
autoOpen, closeOnSubmit, feedbackMessage, screenTitle, sendEventOnCloseIconClick, showCloseIcon—Webchat v3 overlay settings

In HTML, return data to the flow via the injected SDK global: <button onclick="SDK.submit({ variant: 'a' })">A</button>, or submit the first <form>.

setXAppState — xApp: Set State

Render a Cognigy App Template by id. appTemplateId required.

FieldTypeRequiredDescription
appTemplateIdstringYesReference id of the App Template
appTemplateDataobjectNoData passed to the template (default {})

getXAppSessionPin — xApp: Get Session PIN

No config. Populates input.apps.session.pin and the PIN page URL into input.apps.baseUrl, so the user can open the xApp on another device via a PIN.

Accessing xApp data

  • Session URL — input.apps.url. Render it as a button so the user opens the xApp with a tap instead of a bare link — see "Rendering an Open-xApp button" below.
  • Session PIN — input.apps.session.pin (after getXAppSessionPin); PIN page at input.apps.baseUrl.
  • Submitted data — input.data._cognigy._app.payload. When the show node has waitForInput + storeResultInContext, it's also written to context.<contextKey> (default context.result).

Rendering an Open-xApp button

To give the user a tappable button into the xApp (instead of a plain link), add a say node with buttons after initAppSession — the button carries {{input.apps.url}}.

Use a web_url button, not an openXApp button. The dedicated "Open xApp" button type is unreliable in practice; a plain URL button pointing at {{input.apps.url}} renders as a button and opens the xApp as expected. Set the button title to something relevant to the app ("Open booking", "Pick your seats", "Upload document", …) — not a generic "Open".

manage_flow_nodes {
  operation: 'create',
  flowId,
  parentNodeId: '<initSessionNodeId>',
  mode: 'append',
  nodeType: 'say',
  label: 'Open xApp button',
  config: {
    text: 'Tap below to get started.',
    buttons: [
      { title: 'Pick your seats', type: 'web_url', url: '{{input.apps.url}}' }
    ]
  }
}

Button config keys: title (label), type: 'web_url', url: '{{input.apps.url}}'. Order this node after initAppSession so input.apps.url is populated by the time it runs.

Use-case templates

Ready-made starting points live in templates/ next to this file. For a matching request, read the template file, then pass its contents into the node config — HTML into config.body (with mode: "body") or config.html (with mode: "full" — all HTML templates here are full documents that include the SDK, so use mode: "full"); AdaptiveCard JSON into config.card. Adapt the file to the user's specifics before sending; treat it as a scaffold, not a fixed asset.

Use-caseTemplateNodeData in (context)Result payload
Signaturetemplates/signature.htmlshowXAppHtml (mode: "full")—{ signature: "<PNG dataURL>", signed: true }
Seat pickertemplates/seat-picker.htmlshowXAppHtml (mode: "full")context.seatMap = { rows, cols, unavailable[], maxSelect? }{ seats: ["R1C4", …] }
Document uploadtemplates/document-upload.htmlshowXAppHtml (mode: "full")context.uploadConfig = { accept?, maxFiles?, maxSizeMB? }{ files: [{ name, type, size, dataUrl }] }
Google Mapstemplates/google-maps.htmlshowXAppHtml (mode: "full")context.mapConfig = { center?, zoom? }{ lat, lng, address }
Appointment bookingtemplates/appointment-booking.card.jsonshowXAppAdaptiveCard— (inputs are user-entered){ appointmentDate, appointmentTime, service, notes, action: "book" }
Order summarytemplates/order-summary.card.jsonshowXAppAdaptiveCarditems rendered into the card (see note){ confirmed: true | false }

Every use-case follows the same chain: initAppSession → show node (waitForInput: true, storeResultInContext: true, contextKey) → code/say reading the result. Pass "data in" by setting the named context key before the show node (e.g. a setSessionContext or code node populating context.seatMap); the template reads it via CognigyScript.

Per-template notes:

  • Google Maps — replace __MAPS_API_KEY__ in the HTML with the user's Google Maps JS API key (needs Maps JavaScript API + Geocoding API; restrict by HTTP referrer). No key → the map won't load. Ask the user for the key.
  • Document upload — the template submits files as base64 dataUrls (payload grows ~33%; default cap 5 MB/file). For large files, don't submit base64: add an httpRequest tool to push each file to storage and submit only the returned URL.
  • Order summary — the card ships with one placeholder item row and $0.00 totals. Populate real rows before showing it: either build the card object in a code node from context.order and pass that as config.card, or interpolate values with CognigyScript. Adaptive Cards have no loop, so dynamic item lists must be assembled in code.
  • Signature / Seat picker — self-contained, no data-in required (seat picker falls back to a 5×8 grid if context.seatMap is unset).

Prerequisite

Rendering requires an xApp-capable endpoint (Cognigy App Session Manager / Webchat v3). Node creation succeeds regardless, but the xApp only renders end-to-end on a supported endpoint.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Xapps làm được gì?

Use when the user wants to add xApps to a Cognigy flow — interactive HTML / Adaptive Card mini-apps rendered to the user, with the submitted data flowing back into the conversation. Covers the xApp flow nodes, the Init Session rule, and accessing xApp data.

Vì sao nên dùng Xapps trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Xapps là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Xapps trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Cognigy/cognigy-plugin/tree/main/plugin/skills/xapps. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Xapps?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Xapps với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Xapps với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Xapps có miễn phí không?

Có. Kỹ năng này được Cognigy phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇