Skip to content

feat(nats): add native integration and MQ console - #6419

Open
onenewcode wants to merge 23 commits into
t8y2:mainfrom
onenewcode:nats
Open

feat(nats): add native integration and MQ console#6419
onenewcode wants to merge 23 commits into
t8y2:mainfrom
onenewcode:nats

Conversation

@onenewcode

@onenewcode onenewcode commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

变更说明

本 PR 为 DBX 增加 NATS 原生驱动及桌面端 MQ 控制台,并修复 NATS 控制台的交互、异步生命周期和连接复用问题。

  • 新增 NATS agent,并接入 core、web、MCP、Tauri 后端,包括连接处理、密钥、驱动元数据和 NATS 类型。
  • 新增 NATS agent 打包、版本管理、发布流程、驱动产物及相关说明。
  • 新增桌面端 NATS 控制台,包含 Publish、Subscribe、JetStream、Consumers、消息详情、实时渲染、侧边栏、连接对话框、图标和多语言文案。
  • 对齐 Kafka 消息面板布局测试夹具,并将 NATS 控制台接入共享 MQ shell。
  • 移除 subject、payload 等输入框的默认示例内容,保留用户填写的 JetStream history start sequence。
  • 防止旧的 history、stream、consumer、capture、publish 请求覆盖当前连接或当前页面。
  • 串行化 NATS connection 的 start、stop、close 生命周期,避免卸载、切换连接或停止竞态产生孤儿订阅。
  • 为 NATS live Agent runtime 增加事件隔离标识,阻止旧 runtime 的缓存事件进入重启后的同名订阅。
  • 对 Agent timeout 做边界保护,避免异常配置造成 duration 溢出,并等待 Agent 进程退出回收。
  • 兼容历史 NATS 配置中的 system_kind 字段。
  • 删除整个 docs/superpowers 文件夹,避免无关设计和计划文件进入本 PR。

变更类型

  • 新功能
  • Bug 修复
  • 性能优化
  • 代码重构
  • 文档更新
  • CI / 构建

涉及前端

  • 本 PR 涉及前端改动,已附截图/录屏(见下方)
NATS console NATS subscribe NATS publish NATS JetStream NATS messages

验证

  • make check
  • make cargo-check-fast
  • 相关测试通过(GitHub Actions:32001339847

本 PR 不以本地测试结果作为验证依据;提交钩子已完成必要格式化,最终以 GitHub Actions 为准。

关联 Issue

Restructure NATS into the shared MQ admin toolbar/tabs/content interaction,
split subject/publish/message/JetStream panels, label the sidebar as NATS
Console instead of Topics, and route user-facing copy through nats/mqAdmin
locale keys.
Split Core NATS into dedicated publish and multi-subscription tabs, collapse
JetStream into a single list-to-detail workspace (overview/messages/consumers)
aligned with NUI, restore Kafka send-first messages layout, and clean up i18n.
@github-actions github-actions Bot added area/multiple Touches more than three repository areas dependencies/backend Adds a backend dependency ui-change Changes user-visible interface, text, or visual assets labels Aug 17, 2026
@onenewcode onenewcode changed the title [codex] Rebase NATS feature onto latest main feat(nats): add native integration and MQ console Aug 17, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Aug 17, 2026
@onenewcode
onenewcode marked this pull request as ready for review August 17, 2026 03:37

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes: the latest head fixes the unreaped NATS Agent process, but two release/protocol blockers remain.

  1. agents/drivers/nats/go.mod:3 requires Go 1.23, while .github/workflows/agents-release.yml:380 still installs Go 1.22.x. The native-agent Release job therefore fails before tests or cross-compilation with go.mod requires go >= 1.23.0. Please align the release toolchain and validate the NATS release job.

  2. JetStream sequence values are u64 in Rust/NATS, but the frontend contract still uses JavaScript number (apps/desktop/src/types/nats.ts:71, :72, :86-89, :103, :114), and Go request parameters are decoded through map[string]any, turning JSON numbers into float64. Values above Number.MAX_SAFE_INTEGER are silently rounded; for example 9007199254740993 becomes 9007199254740992. Please carry sequences as decimal strings across Go/Rust/TypeScript, or reject values outside the safe integer range explicitly.

These require a release-toolchain change and a cross-language protocol decision, so they are not safe maintainer-side patches.

@onenewcode
onenewcode requested a review from t8y2 August 17, 2026 07:39

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two blocking findings from the previous review are resolved on this head.

  • The NATS release job now uses Go 1.23, matching agents/drivers/nats/go.mod. I also verified the exact code with Go 1.23.12: go test ./... passed and all six release targets cross-compiled successfully.
  • JetStream stream, consumer, continuation, and input sequence values now cross the Go/Rust/MCP/TypeScript boundaries as decimal strings. The regression coverage preserves 9007199254740993 exactly and rejects numeric startSequence values at the agent boundary.

Additional focused validation passed: 6 Rust NATS type tests, locked dbx-mcp check, 5 JetStream panel tests, and frontend typecheck.

The current Rust CI failure is the same unrelated minimax_china_stream_keeps_incremental_fragments_that_share_a_prefix baseline failure already present on main; it does not touch this PR's NATS changes.

@onenewcode
onenewcode requested a review from t8y2 August 17, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/multiple Touches more than three repository areas dependencies/backend Adds a backend dependency enhancement New feature or request ui-change Changes user-visible interface, text, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants