Skip to content

Add native Swift SDK for OpenUI Lang and SwiftUI - #1517

Closed
zyfn wants to merge 2 commits into
thesysdev:mainfrom
zyfn:codex/swift-sdk-refinement-20261030
Closed

zyfn wants to merge 2 commits into
thesysdev:mainfrom
zyfn:codex/swift-sdk-refinement-20261030

Conversation

@zyfn

@zyfn zyfn commented Oct 30, 2026 •

Copy link
Copy Markdown

What

Add an Apple-platform SDK for consuming OpenUI Lang and rendering responses with native SwiftUI components. Applications add this repository through Swift Package Manager and select OpenUISwiftUI; its OpenUILang dependency is included automatically. Language-only consumers can select OpenUILang directly.

The SDK uses the shared lang-core runtime through Foundation/JavaScriptCore. It requires Swift 6 tools, builds in Swift 5 language mode, and targets iOS 16+ and macOS 13+.

Changes

  • Add a repository-root Package.swift exposing OpenUILang and OpenUISwiftUI. Targets reuse the sources and resources under packages/swift-lang and packages/swift-ui; the nested manifests remain local development entry points.
  • Provide Swift APIs for parsing, streaming, evaluation, library authoring, schema/prompt generation, state, actions, queries and mutations. Applications supply tool transports and handle application actions.
  • Implement the 82 pinned standard component registrations and their positional contracts with native layouts, forms, charts, media and resource handling. OpenUIState, OpenUIRenderer and the registry connect the language runtime to views.
  • Include Map, Popover, SVG and WebView as explicit opt-in extensions in OpenUISwiftUI. They add no Lang syntax. Embedded content needs no separate product or module import; WebView JavaScript remains an application policy, disabled by default.
  • Preserve mounted controls/media and allow source-complete components to become interactive during streaming. Card backgrounds and media keep their own shapes without clipping text at unpadded container corners.
  • Support packaged resource lookup for both the root distribution and nested development packages; include English/Chinese localizations, bundled runtime/catalog resources and third-party notices. Consumers do not need Node or remote script downloads.
  • Add root-package CI and installation guidance. This contribution does not publish a semantic-version tag; maintainers can select the release version after review.

Business/demo scenes, preview applications, synthetic tools, games and acceptance captures are excluded. Existing JavaScript packages and upstream source files are unchanged.

Runtime and presentation boundaries

The runtime is pinned to f08a660535e55b5b2a24a0eb68568edaf9e4fe4b. Documented compatibility corrections cover serializer grouping/lossless keys, materialization limits and bounded native pattern execution. Source-readiness instrumentation supplies presentation metadata and action gating without changing model-facing grammar.

Native presentation uses system fonts/Dynamic Type, neutral actions, width-derived 3:2 photo covers, capsule tags and platform interactions. See the installation/API documentation, native mapping, and runtime provenance.

Test Plan

Results below are saved local evidence for d6b3ec80d7f5e9ad5256ef8c40d855f793765e80; they do not represent GitHub Actions results.

Check Result
Independent SwiftPM consumer selecting only OpenUISwiftUI Built and ran successfully
Semantic-version resolution from an isolated local Git fixture Passed; fixture tag 0.1.0 was not published
Relocated macOS app loading its packaged runtime/UI resources Passed
Root-package resource, embedded-content and ownership regressions 19 passed, 0 failures
iOS 16 Simulator compilation of OpenUISwiftUI Passed
Saved terminal excerpts
Single UI product; language API; 82 standard components; 84 opt-in components; JavaScript disabled: OK
Relocated application resources: OK
Test Suite 'Selected tests' passed at 2026-10-30 16:58:02.509.
Executed 19 tests, with 0 failures (0 unexpected) in 2.333 (2.337) seconds
Build of target: 'OpenUISwiftUI' complete! (18.60s)

The earlier full UI suite passed 219 tests on the frozen implementation baseline; subsequent map and Card checks passed 4 and 1 tests respectively. These historical results are not a fresh full-suite run on the current PR head. Screenshots and complete logs were prepared locally but were not attached to this closed PR.

Checklist

  • I linked a related issue, if applicable — no related issue was provided.
  • I updated docs/README and documented native deviations and compatibility corrections.
  • I considered backwards compatibility: existing JavaScript packages and standard component contracts are unchanged. Trial consumers remove import OpenUIWeb and its product dependency; the registration and policy APIs are now in OpenUISwiftUI.

lizhu added 2 commits October 30, 2026 14:28
Add OpenUILang, OpenUISwiftUI and OpenUIWeb, matching the pinned OpenUI contracts. Include source-readiness metadata, native resource ownership, adaptive components and SDK regressions.

Keep business scenes, preview hosts and external acceptance outputs outside this SDK-only branch.
Move embedded SVG/WebView presentation into OpenUISwiftUI, retaining explicit registration and application policy. Add a repository-root manifest, packaged resource lookup and installation guidance.
@vercel

vercel Bot commented Oct 30, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the thesys-devs Team on Vercel.

A member of the Team first needs to authorize it.

@zyfn zyfn closed this Oct 30, 2026
@zyfn
zyfn deleted the codex/swift-sdk-refinement-20261030 branch October 30, 2026 10:26
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.

1 participant