connect-widget
Operates the embeddable Connect widget iframe, client-side session UX, parent-child postMessage, OAuth popup recovery, theme updates, connection creation, folder selection, and sync progress handling.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- connect-widget
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Operates the embeddable Connect widget iframe, client-side session UX, parent-child postMessage, OAuth popup recovery, theme updates, connection creation, folder selection, and sync progress handling.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/messaging-contract.md3.0 KB
- 参考文档references/oauth-and-modes.md3.2 KB
- 参考文档references/troubleshooting.md5.7 KB
- 参考文档references/widget-overview.md3.6 KB
03 SKILL.md 正文
Connect Widget
Use this sub-skill when an Airweave task touches the embeddable Connect widget itself: iframe mount and shutdown, session token request and validation, parent-child messaging, live theme updates, OAuth popup recovery, connection creation, folder selection, or sync progress rendering.
Do not use this sub-skill for backend endpoint lifecycle, dashboard UI, MCP transport, or Monke orchestration. For route and schema details, cross-link to backend-api. For dashboard-hosted launch flows around the widget, cross-link to frontend-dashboard.
Route to the right reference
- Read references/widget-overview.md for the widget lifecycle, state machine, and module responsibility map.
- Read references/messaging-contract.md for
CONNECT_READY, token exchange, trusted-origin behavior,NAVIGATE,SET_THEME,STATUS_CHANGE,CONNECTION_CREATED, andCLOSE. - Read references/oauth-and-modes.md for session modes, source creation, OAuth popup and callback recovery, folder selection, reauth handling, and sync progress behavior.
- Read references/troubleshooting.md when the widget stalls, the parent origin is rejected, tokens time out, OAuth popups are blocked, callbacks fail, or sync state stops updating.
Operating rules
- Treat the widget as a child iframe app. It should announce readiness, wait for a parent session token, validate that token, and then switch into a valid or error state.
- Lock the parent origin after the first token response or token error. Later messages from a different origin are unsafe and should be ignored.
- Apply theme updates immediately. Initial theme can come from the iframe URL, token response, or later
SET_THEMEmessages, and the widget should keep rendering with the latest theme. - Honor session mode.
allandconnectcan launch new connections;manageandreauthfocus on existing connections and reauth flows. - Preserve OAuth claim-token recovery. Do not discard the claim token until verification succeeds, and surface popup-blocked or callback-loss cases as recoverable errors.
- Keep folder selection client-side until completion. If the user backs out of a freshly created connection, clean up the connection instead of leaving it stranded.
- Treat SSE sync progress as authoritative while a sync is active. Handle reconnecting, terminal success, and terminal failure separately from the connection list summary.
Quick decision map
| User intent | Start here | Notes |
|---|---|---|
| "How does the iframe handshake work?" | messaging-contract.md |
Covers CONNECT_READY → token exchange → status updates. |
| "Why did OAuth fail or reopen?" | oauth-and-modes.md |
Covers popup-blocked recovery, callback posting, and claim-token verification. |
| "How does folder selection behave?" | oauth-and-modes.md |
Covers the selection step and back-out cleanup. |
| "Why is sync progress missing or stale?" | oauth-and-modes.md and troubleshooting.md |
Covers SSE subscription, reconnecting, and terminal progress states. |
| "Why does the widget close or show an error?" | troubleshooting.md |
Covers origin mismatch, timeouts, session mismatch, and unsupported launch states. |
Validation anchors
Later verification should prioritize the native widget tests and unit anchors:
connect/tests/e2e/session.spec.tsconnect/tests/e2e/widget.spec.tsconnect/tests/e2e/sdk.spec.tsconnect/src/components/SyncProgressIndicator.test.tsxconnect/src/hooks/useSyncProgress.test.ts
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).