Skip to content

Support iOS 15 and run the kwwk CLI on iOS - #196

Merged
Lakr233 merged 11 commits into
mainfrom
lakr/ios15-cli
Oct 14, 2026
Merged

Lakr233 merged 11 commits into
mainfrom
lakr/ios15-cli

Conversation

@Lakr233

@Lakr233 Lakr233 commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Lower the deployment floor to iOS 15 / Mac Catalyst 15 (was 17). macOS stays at 14.
  • Make the kwwk CLI build and run on iOS. This brings in owngoal-dev/kk's patches 0001–0006, which until now were applied on top of a pinned kwwk commit to ship kk on jailbroken iOS:
    • TUI (StdoutTerminal, TUIRunner) compiled on iOS
    • posix_spawn instead of the missing Process for the /login browser handoff (via uiopen); the git branch is read straight from .git/HEAD
    • Probe PATH and common bootstrap locations for sh on iOS
    • NSHomeDirectory() instead of homeDirectoryForCurrentUser, through one cliHomeDirectory() helper (also covers the MCP command/runtime call sites added since kk's pin)
    • Split Cursor ls entries with components(separatedBy:) instead of the iOS 16 split overload
  • Replace the two iOS 16 Regex literals in AnthropicProvider with static, precompiled NSRegularExpressions using the same patterns.
  • kk patch 0007 is not included. It drops resources: [.process("Resources")], which would break every SwiftPM/Xcode library consumer that relies on Bundle.module. kk can keep it as a packaging-only patch.

No regressions for library consumers

  • Every iOS-only path is behind #if os(iOS) (or || targetEnvironment(macCatalyst)). macOS and Linux code paths and the public API are unchanged.
  • kwwkDefaultShellPath stays a public let String. It is still "/bin/sh" outside iOS.

Warnings fixed along the way

These four Swift 6.4 warnings were already on main:

  • CursorConnectClient: the TLS handler is added through syncOperations inside the channel initializer, and the multiplexer is looked up and used on the connection's event loop. The handlers and their order are the same as before. One change: a missing multiplexer now closes the connection through the existing failure path instead of leaking it.
  • OAuthManager.refresh: the shared task's body is now an actor method, so its calls into the actor are synchronous whichever way the compiler infers the closure's isolation (Swift 6.1 and 6.4).

CI

New build-ios job on macos-15 (Xcode 16.4 / Swift 6.1) and macos-26:

  • cross-compiles the kwwk product for arm64-apple-ios15.0 and checks that the Mach-O says platform IOS / minos 15.0
  • builds the libraries for Mac Catalyst

Test plan

  • macOS swift build --build-tests: zero warnings from this repo's sources; swift test: 799 tests pass
  • iOS 15 cross-compile of kwwk: Mach-O platform IOS, minos 15.0, depends only on system libs plus the libswiftCompatibilitySpan shim
  • Mac Catalyst 15 build of the libraries
  • One-off live check of CursorConnect.open against api2.cursor.sh after the NIO change: TLS + h2 + stream come up and the server's end-stream arrives (temporary test, not committed)
  • CI on Swift 6.1 (no 6.1 toolchain locally)
  • Run kk --self-test on an iOS 15 device once kk repins to this commit and drops patches 0001–0006

🤖 Generated with Claude Code

Lakr233 and others added 11 commits October 14, 2026 23:52
From owngoal-dev/kk patches/0001-build-the-tui-on-ios.patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From owngoal-dev/kk patches/0002-replace-process-on-ios.patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From owngoal-dev/kk patches/0003-find-the-bootstrap-shell.patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From owngoal-dev/kk patches/0004-expand-tilde-on-ios.patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From owngoal-dev/kk patches/0006-split-without-the-ios-16-overload.patch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silences Swift 6.4's 'conformance to Sendable is unavailable' warnings
for NIOSSLHandler and HTTP2StreamMultiplexer. Same handlers, same order;
a missing multiplexer now closes the connection instead of leaking it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Swift 6.4 infers the refresh Task closure as actor-isolated and flags its
awaits on actor methods as unnecessary; older compilers may not. An actor
method makes the isolation explicit for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lakr233
Lakr233 merged commit be45027 into main Oct 14, 2026
7 checks passed
Lakr233 added a commit to owngoal-dev/kk that referenced this pull request Oct 14, 2026
yellowplushq/kwwk#196 lowers kwwk to iOS 15 and builds its CLI for iOS with what
patches 0001-0006 did. Only the catalog-sidecar patch is left, rebased onto
the current ModelsCatalog as 0001.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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