Skip to content

refactor(luma): move the provider into its upstream file layout - #433

Merged
eric8810 merged 11 commits into
masterfrom
refactor/move-luma-into-its-upstream-layout
Nov 6, 2026
Merged

eric8810 merged 11 commits into
masterfrom
refactor/move-luma-into-its-upstream-layout

Conversation

@cunninghamcard-bit

@cunninghamcard-bit cunninghamcard-bit commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

RFC-0046 R7 的 Luma 搬移(#328)。叠在测试 PR #432 上(base 是 test/port-the-upstream-luma-tests;合并顺序 #431 → #432 → 本 PR,前一个合入后改基到 master)。

按 @ai-sdk/luma 的文件拆 luma.rs(RFC-0046 §4.4,去掉厂商前缀):

上游 Rust
src/index.ts luma/mod.rs(模块文档、子模块、re-export)
src/luma-provider.ts luma/provider.rs(LumaProviderSettings、create_luma、luma()、LumaProvider、两个 pub(crate) 常量)
src/luma-image-model.ts、src/luma-image-settings.ts luma/image_model.rs(LumaImageModel、错误处理、应答 schema、轮询常量;git 认作 luma.rs 的改名,保留历史)
src/luma-image-model-options.ts luma/options.rs(不改名:边界脚本规则 10b 只允许单模态厂商在自己的 options.rs 里写 providerOptions key,其他单模态厂商都用这个名字)
  • 代码原样搬移,只改了各文件的 use 和模块文档的首行;没有改逻辑。
  • 公开路径不变:luma::{LumaImageModel, LumaProvider, LumaProviderSettings, create_luma, luma} 由 luma/mod.rs re-export,lib.rs 的 pub use luma::… 不动;default_providers.rs 读的 luma::{API_KEY_ENV_VAR, DEFAULT_BASE_URL} 以 pub(crate) use 保留;luma::options 本来就是 pub(crate)。所以没有 Breaking,不需要 CHANGELOG 条目。
  • scripts/check_provider_boundaries.sh 规则 10:单模态厂商的路径表只在 <name>.rs 还存在时才加它(搬移后的厂商是目录,否则 find 报文件不存在)。refactor(deepgram): move the provider into its upstream file layout #439、refactor(fal): move the provider into its upstream file layout #443 是同一处改动,先合的那个带进 master,后合的不会冲突。
  • layout.toml 的 [luma] 改指新文件。
  • 测试不动:src/luma/tests/(30 个)、tests/luma_image_test.rs 的断言和数量与 test: port the upstream Luma tests #432 相同。
  • docs/plan/、docs/quality-audit/ 里提到 luma.rs 的是历史记录,不改。

本地跑了 scripts/check_provider_boundaries.sh(ok)和 cargo fmt;没有编译。CI 在 13953c5 上全绿。

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • New provider
  • New / updated binding
  • Docs / RFC

(重构:R7 目录与文件名。)

Checklist

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes(CI,13953c52)
  • cargo test --workspace passes(CI,13953c52)
  • Added or updated cassette tests / contract fixtures for behavior changes(无行为变化)
  • Updated relevant docs (CHANGELOG Unreleased)(公开路径不变)
  • Commit messages follow Conventional Commits

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGR3XTd9sDdXdYQV2TEyW8

Split luma.rs along the files of @ai-sdk/luma (RFC-0046 §4.4):
luma/mod.rs (index.ts), luma/provider.rs (luma-provider.ts),
luma/image_model.rs (luma-image-model.ts and luma-image-settings.ts) and
luma/image_model_options.rs (luma-image-model-options.ts, was
luma/options.rs). The code is moved as is; the public paths
(`luma::{LumaImageModel, LumaProvider, LumaProviderSettings, create_luma,
luma}`) are re-exported from luma/mod.rs and unchanged. layout.toml
points at the new files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JGR3XTd9sDdXdYQV2TEyW8
The boundary script (rule 10b) allows a single-modality package's
providerOptions key only in its `options.rs`, the name every other such
package uses, so luma/options.rs keeps its name and maps
luma-image-model-options.ts. Rule 10 now lists `<name>.rs` only when the
package still has one: a moved package is a directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JGR3XTd9sDdXdYQV2TEyW8
…s' into refactor/move-luma-into-its-upstream-layout
…s' into refactor/move-luma-into-its-upstream-layout
@cunninghamcard-bit
cunninghamcard-bit marked this pull request as ready for review November 1, 2026 14:07
…s' into refactor/move-luma-into-its-upstream-layout

# Conflicts:
#	aimux-providers/src/luma/image_model.rs
@cunninghamcard-bit cunninghamcard-bit mentioned this pull request Nov 1, 2026
3 of 12 tasks

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

move-only:image_model/provider 内容与旧 luma.rs 一致,公开导出和 30+16 tests 未变,layout 正确,CI 通过。Approve。

…s' into refactor/move-luma-into-its-upstream-layout
…uma-into-its-upstream-layout

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JGR3XTd9sDdXdYQV2TEyW8

Copy link
Copy Markdown
Contributor Author

approve 之后有一处改动,说明一下:#388 合并后,Credential/ProviderHeaders 从 crate::shared 挪到了 aimux_provider_utils。合入下游时 luma/provider.rs 的导入跟着改了。另外 git 的重命名检测把 #388 对旧 luma.rs 的导入改动套到了 luma/image_model.rs 上,那一行会是未使用的导入,已删掉。只动了 use,内容没变(5e94dfad)。


Generated by Claude Code

…s' into refactor/move-luma-into-its-upstream-layout

# Conflicts:
#	aimux-providers/src/luma/image_model.rs
@cunninghamcard-bit
cunninghamcard-bit marked this pull request as ready for review November 5, 2026 11:26
@eric8810
eric8810 changed the base branch from test/port-the-upstream-luma-tests to master November 6, 2026 05:58
@eric8810
eric8810 merged commit 59563e9 into master Nov 6, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants