Logo Dust Webhook Source

Dust Webhook Source

Tổ chứcPhổ biến
dust-tt
dust-webhook-source

Triển khai nhà cung cấp nguồn webhook tích hợp mới trong `front`. Dùng khi thêm nhà cung cấp webhook như Linear, GitHub hoặc Fathom, bao gồm tìm hiểu về nhà cung cấp, các yêu cầu OAuth, kiểu dữ liệu và mã client riêng, đăng ký cấu hình sẵn, component giao diện và kiểm thử đầu cuối.

Add to TypingMind

Tổng quan

Nhà phát hànhdust-tt
Kho mãdust
Tên kỹ năngdust-webhook-source
Sao
1.5K
Bản fork
370
Tệp đi kèm
Chỉ có hướng dẫn
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 dùng hướng dẫn viết bằng Markdown thay vì 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ộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được dust-tt công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Dust Webhook Source 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 của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/dust-tt/dust/tree/main/.claude/skills/dust-webhook-source
  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/dust-tt/dust.git /tmp/dust
mkdir -p .claude/skills
cp -r /tmp/dust/.claude/skills/dust-webhook-source .claude/skills/dust-webhook-source
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 Dust Webhook Source 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ự nạp Dust Webhook Source 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 bạn có thể dùng Dust Webhook Source với cả những mô hình khác ngoài mô hình ban đầu. 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 khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổ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.

Front Webhook Sources

Implement built-in webhook providers across two trees:

  • front/lib/triggers/built-in-webhooks/<provider>/ — UI-safe: presets, schemas, types, React components
  • front/lib/api/triggers/built-in-webhooks/<provider>/ — server-only: service + provider HTTP client

The boundary is load-bearing. Anything reached from the UI must never transitively import @app/lib/api/config, OAuthAPI, or other backend modules — putting server code under lib/api/ is how we enforce that. Do not re-introduce a webhookService field on the preset or instantiate the service from preset.ts: the leak that motivated the split will come right back.

The work spans provider research, OAuth prerequisites, typed remote metadata, a provider client, the remote webhook service, preset registration, services-map registration, and the setup/details UI.

Hard Prerequisites

Do not start implementation until both of these already exist:

  • front/lib/api/oauth/providers/<provider>.ts
  • core/src/oauth/providers/<provider>.rs

The provider must support the webhooks use case and have scopes that can manage webhooks.

If the provider only allows webhooks to be created manually in its UI, stop. It is not a fit for a built-in webhook source.

Research First

Before writing code, document these answers from the provider docs:

  • how to create a webhook programmatically
  • required auth method and OAuth scopes
  • request and response payloads for create and delete
  • available event types and sample payloads
  • how the incoming event type is identified: header or body field
  • what user-configurable metadata is required, such as team or repository selection
  • whether webhook signatures exist and how to verify them

This research determines the metadata types, client methods, event schemas, and UI.

Files To Touch

Minimal implementation:

  • front/types/triggers/webhooks.ts
  • front/types/triggers/webhooks_client_side.ts
  • front/lib/api/triggers/built-in-webhooks/services.ts (register the service instance)
  • front/lib/api/triggers/built-in-webhooks/<provider>/<provider>_client.ts (server-only)
  • front/lib/api/triggers/built-in-webhooks/<provider>/service.ts (server-only)
  • front/lib/triggers/built-in-webhooks/<provider>/types.ts
  • front/lib/triggers/built-in-webhooks/<provider>/preset.ts
  • front/lib/triggers/built-in-webhooks/<provider>/client_side.ts
  • front/lib/triggers/built-in-webhooks/<provider>/schemas/*
  • front/lib/triggers/built-in-webhooks/<provider>/components/*

Use existing providers as templates:

  • fathom for the simplest shape
  • linear for team-scoped webhook creation
  • github for repository-driven configuration

Workflow

1. Register the provider

In front/types/triggers/webhooks.ts:

  • add the provider to WEBHOOK_PROVIDERS
  • extend WebhookProviderServiceDataMap if the provider needs extra OAuth-fetched data
  • register the preset in WEBHOOK_PRESETS

In front/types/triggers/webhooks_client_side.ts:

  • import the provider client-side preset
  • register it in CLIENT_SIDE_WEBHOOK_PRESETS

In front/lib/api/triggers/built-in-webhooks/services.ts:

  • import the provider service class (from lib/api/..., not lib/...)
  • register an instance in WEBHOOK_SERVICES. This map is the server-only dispatch used by webhook create/delete/service-data endpoints. It must never be imported from UI code.

2. Define metadata and type guards

In types.ts, define:

  • create-time metadata entered by the user
  • persisted metadata that also includes provider webhook ids
  • runtime type guards for both
  • optional additional OAuth data such as teams or repositories

Always keep remote metadata serializable. No functions or class instances.

3. Implement the provider client

<provider>_client.ts lives under front/lib/api/triggers/built-in-webhooks/<provider>/ and should be a thin wrapper over the provider API. It is server-only; do not import it from UI code.

Typical methods:

  • createWebhook(...)
  • deleteWebhook(...)
  • getTeams() / getRepositories() / similar when setup requires selection data

Return typed results and map the provider response into the local metadata shape.

4. Implement the remote webhook service

In front/lib/api/triggers/built-in-webhooks/<provider>/service.ts, implement RemoteWebhookService<"<provider>">. This file is server-only — it will import OAuthAPI and @app/lib/api/config, which must never reach the client bundle.

Core responsibilities:

  • getServiceData(oauthToken) fetches setup data for the form
  • createWebhooks(...) validates metadata, creates provider-side webhooks, and returns updatedRemoteMetadata including webhook ids
  • deleteWebhooks(...) removes provider-side webhooks using the persisted ids

When multiple webhooks may be created, handle partial success explicitly and return user-facing errors without losing the successfully created ids.

5. Define event schemas

Create one schema file per event, or one per coherent event family, under schemas/.

Each event entry should provide:

  • the event name/value exposed in the UI
  • a JSON schema for the payload
  • an optional sample payload when it clarifies the shape

6. Build the presets

Split preset code correctly:

  • preset.ts exports a BaseWebhookPreset — data-only, UI-safe, worker-safe. Do not import React, icons, or the service here. The service is registered separately in WEBHOOK_SERVICES (see step 1).
  • client_side.ts exports a ClientSideWebhookPreset — it spreads the base preset and adds the provider icon plus React components.

Set on the base preset (preset.ts):

  • eventCheck to match how the provider exposes event type
  • the full list of supported events
  • optional webhookPageUrl

Set on the client-side preset (client_side.ts):

  • icon
  • the React components (detailsComponent, createFormComponent, and optionally oauthExtraConfigInput)

7. Build the UI components

Create:

  • CreateWebhook<Provider>Connection.tsx
  • WebhookSource<Provider>Details.tsx

The create form should:

  • rely on front/components/triggers/CreateWebhookSourceWithProviderForm.tsx for the OAuth connection flow via setupOAuthConnection(...)
  • treat connectionId as an input prop; do not recreate the OAuth flow inside the provider-specific form
  • fetch provider-specific setup data with useWebhookServiceData({ owner, connectionId, provider })
  • call onDataToCreateWebhookChange({ connectionId, remoteMetadata })
  • call onReadyToSubmitChange(true) only when configuration is complete

The details component should stay read-only and summarize the persisted remote metadata.

Common Gotchas

  • forgetting to register the data preset in WEBHOOK_PRESETS or the client-side preset in CLIENT_SIDE_WEBHOOK_PRESETS
  • forgetting to register the service in WEBHOOK_SERVICES
  • putting the service or provider client under lib/triggers/... instead of lib/api/triggers/... (leaks OAuthAPI and backend config into the client bundle)
  • importing React, icons, or the service from preset.ts (any of those turn BaseWebhookPreset into a client-only module and reintroduces the bundle leak)
  • putting the icon on the base preset rather than the client-side preset
  • storing non-serializable remote metadata
  • skipping type guards before using remoteMetadata
  • assuming a single webhook when the provider needs one per team or repository
  • ignoring partial success during multi-webhook creation
  • forgetting to make local webhook URLs public during manual testing

Testing

For local testing, expose the local app publicly and set DUST_WEBHOOKS_PUBLIC_URL.

Manual checklist:

  • complete the OAuth flow successfully
  • create the webhook source in the UI without errors
  • verify the webhook exists in the provider dashboard
  • trigger a real provider event and inspect local logs
  • confirm the incoming payload matches the registered schema and event detection logic
  • delete the source and verify the provider-side webhook is removed

References

  • front/lib/resources/webhook_source_resource.ts
  • front/types/triggers/remote_webhook_service.ts
  • front/types/triggers/webhooks_source_preset.ts

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

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

Triển khai nhà cung cấp nguồn webhook tích hợp mới trong `front`. Dùng khi thêm nhà cung cấp webhook như Linear, GitHub hoặc Fathom, bao gồm tìm hiểu về nhà cung cấp, các yêu cầu OAuth, kiểu dữ liệu và mã client riêng, đăng ký cấu hình sẵn, component giao diện và kiểm thử đầu cuối.

Vì sao nên dùng Dust Webhook Source 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. Dust Webhook Source 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 Dust Webhook Source trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/dust-tt/dust/tree/main/.claude/skills/dust-webhook-source. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để 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 Dust Webhook Source?

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.

Có thể dùng Dust Webhook Source 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 Dust Webhook Source 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 Dust Webhook Source có miễn phí không?

Có. Kỹ năng này được dust-tt 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 các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công 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à những tiêu chí mà kết quả cần đáp ứng. 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 👇