bleam 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/ai.cjs +608 -59
  2. package/dist/ai.d.cts +217 -89
  3. package/dist/ai.d.ts +217 -89
  4. package/dist/ai.js +601 -59
  5. package/dist/cli.cjs +3 -183
  6. package/dist/cli.d.cts +2 -46
  7. package/dist/cli.d.ts +2 -46
  8. package/dist/cli.js +3 -183
  9. package/dist/files.d.cts +1 -1
  10. package/dist/files.d.ts +1 -1
  11. package/dist/platform.cjs +1 -13
  12. package/dist/platform.d.cts +1 -28
  13. package/dist/platform.d.ts +1 -28
  14. package/dist/platform.js +1 -10
  15. package/dist/schema.d.cts +1 -1
  16. package/dist/schema.d.ts +1 -1
  17. package/dist/state.d.cts +1 -1
  18. package/dist/state.d.ts +1 -1
  19. package/dist/{ui-Bg11tvlc.d.ts → ui-1WepaMS4.d.cts} +1 -1
  20. package/dist/{ui-Dd7SXdbg.d.cts → ui-CHc4xEs_.d.ts} +7 -7
  21. package/dist/ui.d.cts +1 -1
  22. package/dist/ui.d.ts +1 -1
  23. package/dist/window.d.cts +1 -1
  24. package/dist/window.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/templates/image-generation/app/index.tsx +3 -1
  27. package/templates/native/ios/Bleam/AI/Flux2/Configuration/ModelRegistry.swift +1 -1
  28. package/templates/native/ios/Bleam/AI/Flux2/Pipeline/FluxImageRunner.swift +7 -2
  29. package/templates/native/ios/Bleam/AI/TextGeneration/Bonsai/BonsaiTextGenerator.swift +46 -0
  30. package/templates/native/ios/Bleam/AI/TextGeneration/Bonsai/BonsaiTextModel.swift +107 -0
  31. package/templates/native/ios/Bleam/AI/TextGeneration/Bonsai/BonsaiTextSnapshotValidator.swift +201 -0
  32. package/templates/native/ios/Bleam/AI/TextGeneration/Core/GenerationTypes.swift +85 -0
  33. package/templates/native/ios/Bleam/AI/TextGeneration/Core/ModelCapabilities.swift +21 -0
  34. package/templates/native/ios/Bleam/AI/TextGeneration/Core/TextKVCache.swift +23 -0
  35. package/templates/native/ios/Bleam/AI/TextGeneration/Core/TokenSampler.swift +79 -0
  36. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3CheckpointLoader.swift +161 -0
  37. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3Configuration.swift +119 -0
  38. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3InferenceSession.swift +84 -0
  39. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3Layers.swift +197 -0
  40. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3Model.swift +130 -0
  41. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Checkpoint.swift +102 -0
  42. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Configuration.swift +140 -0
  43. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Model.swift +112 -0
  44. package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Session.swift +121 -0
  45. package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridCache.swift +42 -0
  46. package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridFullAttention.swift +57 -0
  47. package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridLayers.swift +58 -0
  48. package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridLinearAttention.swift +111 -0
  49. package/templates/native/ios/Bleam/AppDelegate.swift +0 -206
  50. package/templates/native/ios/Bleam.xcodeproj/project.pbxproj +128 -122
  51. package/templates/native/ios/GenerationService/BonsaiTextGenerationRunner.swift +103 -0
  52. package/templates/native/ios/GenerationService/ImageGenerationRunner.swift +19 -7
  53. package/templates/native/ios/GenerationService/main.swift +174 -48
  54. package/templates/native/ios/Shared/Generation/GenerationServiceProtocol.swift +3 -0
  55. package/templates/native/ios/Shared/Generation/GenerationWorkerProtocol.swift +44 -0
  56. package/templates/native/modules/bleam-runtime/ios/AIModule.swift +225 -5
  57. package/templates/native/modules/bleam-runtime/ios/GenerationContracts.swift +47 -0
  58. package/templates/native/modules/bleam-runtime/ios/PlatformModule.swift +0 -191
  59. package/templates/text-generation/app/index.tsx +93 -0
  60. package/templates/text-generation/app.config.ts +5 -0
  61. package/templates/updates/README.md +43 -199
  62. package/templates/updates/src/index.ts +5 -98
  63. package/templates/updates/src/schema.ts +18 -173
  64. package/templates/native/ios/PlatformHelper/main.swift +0 -726
  65. /package/dist/{files-DwA7pzr3.d.cts → files-4ZEoAWiv.d.ts} +0 -0
  66. /package/dist/{files-VrkQlKIT.d.ts → files-Dt5mbzLq.d.cts} +0 -0
  67. /package/dist/{schema-DOOjfXvs.d.ts → schema-CYh6n8GS.d.ts} +0 -0
  68. /package/dist/{schema-ENSMX_1t.d.cts → schema-oeOrd3i1.d.cts} +0 -0
@@ -4,7 +4,6 @@ import ReactAppDependencyProvider
4
4
  import UIKit
5
5
  import CryptoKit
6
6
  import Darwin
7
- import Security
8
7
 
9
8
  func launchArgument(_ name: String) -> String? {
10
9
  let arguments = ProcessInfo.processInfo.arguments
@@ -22,17 +21,6 @@ func launchArgument(_ name: String) -> String? {
22
21
 
23
22
  @main
24
23
  class AppDelegate: ExpoAppDelegate {
25
- public override func application(
26
- _ application: UIApplication,
27
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
28
- ) -> Bool {
29
- let launched = super.application(application, didFinishLaunchingWithOptions: launchOptions)
30
- if launched {
31
- PlatformHelperInstaller.refreshIfInstalledApp()
32
- }
33
- return launched
34
- }
35
-
36
24
  public func application(
37
25
  _ application: UIApplication,
38
26
  configurationForConnecting connectingSceneSession: UISceneSession,
@@ -63,200 +51,6 @@ class AppDelegate: ExpoAppDelegate {
63
51
  }
64
52
  }
65
53
 
66
- private enum PlatformHelperInstaller {
67
- static func refreshIfInstalledApp() {
68
- #if targetEnvironment(macCatalyst)
69
- let homeDirectory = URL(fileURLWithPath: NSHomeDirectory(), isDirectory: true)
70
- let homeApplications = homeDirectory
71
- .appendingPathComponent("Applications", isDirectory: true)
72
- .standardizedFileURL.path + "/"
73
- guard Bundle.main.bundleURL.standardizedFileURL.path.hasPrefix(homeApplications) else {
74
- return
75
- }
76
- guard let bundleIdentifier = Bundle.main.bundleIdentifier else { return }
77
-
78
- let serviceName = "PlatformHelper"
79
- let bundledHelper = Bundle.main.bundleURL
80
- .appendingPathComponent("Contents/Helpers/\(serviceName)")
81
- guard FileManager.default.isExecutableFile(atPath: bundledHelper.path) else {
82
- NSLog("Bleam helper unavailable: bundled executable is missing")
83
- return
84
- }
85
- guard
86
- let teamIdentifier = Bundle.main.object(forInfoDictionaryKey: "BleamTeamIdentifier") as? String,
87
- let platformVersion = Bundle.main.object(forInfoDictionaryKey: "BleamRuntimeVersion") as? String,
88
- validSignature(at: bundledHelper, teamIdentifier: teamIdentifier)
89
- else {
90
- NSLog("Bleam helper unavailable: bundled executable has an invalid identity")
91
- return
92
- }
93
-
94
- let label = "\(bundleIdentifier).PlatformHelper"
95
- let domain = "gui/\(getuid())"
96
- let helperRoot = homeDirectory
97
- .appendingPathComponent("Library/Application Support/Bleam/Helpers", isDirectory: true)
98
- .appendingPathComponent(bundleIdentifier, isDirectory: true)
99
- let installedHelper = helperRoot.appendingPathComponent(serviceName)
100
- let stagedHelper = helperRoot.appendingPathComponent(".\(serviceName).\(UUID().uuidString)")
101
- let backupHelper = helperRoot.appendingPathComponent(".\(serviceName).previous.\(UUID().uuidString)")
102
- let failedHelper = helperRoot.appendingPathComponent(".\(serviceName).failed.\(UUID().uuidString)")
103
- let pendingApply = homeDirectory
104
- .appendingPathComponent("Library/Application Support/Bleam/Updates", isDirectory: true)
105
- .appendingPathComponent(bundleIdentifier, isDirectory: true)
106
- .appendingPathComponent("platform-apply.pending")
107
- let launchAgents = homeDirectory
108
- .appendingPathComponent("Library/LaunchAgents", isDirectory: true)
109
- let plistURL = launchAgents.appendingPathComponent("\(label).plist")
110
- let propertyList: [String: Any] = [
111
- "Label": label,
112
- "ProgramArguments": [installedHelper.path],
113
- "ProcessType": "Background",
114
- "MachServices": [label: true],
115
- "KeepAlive": [
116
- "SuccessfulExit": false,
117
- "PathState": [pendingApply.path: true],
118
- ],
119
- "EnvironmentVariables": [
120
- "XPC_SERVICE_NAME": label,
121
- "BLEAM_BUNDLE_IDENTIFIER": bundleIdentifier,
122
- "BLEAM_TEAM_IDENTIFIER": teamIdentifier,
123
- "BLEAM_HELPER_VERSION": platformVersion,
124
- "BLEAM_PLATFORM_VERSION": platformVersion,
125
- ],
126
- ]
127
-
128
- do {
129
- defer { try? FileManager.default.removeItem(at: stagedHelper) }
130
- try FileManager.default.createDirectory(
131
- at: helperRoot,
132
- withIntermediateDirectories: true
133
- )
134
- try FileManager.default.copyItem(at: bundledHelper, to: stagedHelper)
135
- guard
136
- FileManager.default.isExecutableFile(atPath: stagedHelper.path),
137
- validSignature(at: stagedHelper, teamIdentifier: teamIdentifier)
138
- else {
139
- throw HelperInstallError.invalidSignature
140
- }
141
- try FileManager.default.createDirectory(
142
- at: launchAgents,
143
- withIntermediateDirectories: true
144
- )
145
- let data = try PropertyListSerialization.data(
146
- fromPropertyList: propertyList,
147
- format: .xml,
148
- options: 0
149
- )
150
- let previousPlist = try? Data(contentsOf: plistURL)
151
- let wasRegistered = runLaunchctl(["print", "\(domain)/\(label)"]) == 0
152
- if wasRegistered, runLaunchctl(["bootout", "\(domain)/\(label)"]) != 0 {
153
- throw HelperInstallError.registrationFailed
154
- }
155
-
156
- do {
157
- if FileManager.default.fileExists(atPath: installedHelper.path),
158
- rename(installedHelper.path, backupHelper.path) != 0
159
- {
160
- throw HelperInstallError.replacementFailed
161
- }
162
- guard rename(stagedHelper.path, installedHelper.path) == 0 else {
163
- throw HelperInstallError.replacementFailed
164
- }
165
- try data.write(to: plistURL, options: .atomic)
166
- let bootstrapStatus = runLaunchctl(["bootstrap", domain, plistURL.path])
167
- guard
168
- bootstrapStatus == 0 || runLaunchctl(["print", "\(domain)/\(label)"]) == 0
169
- else {
170
- throw HelperInstallError.registrationFailed
171
- }
172
- try? FileManager.default.removeItem(at: backupHelper)
173
- try? FileManager.default.removeItem(
174
- at: helperRoot.appendingPathComponent("PlatformHelper.xpc", isDirectory: true)
175
- )
176
- } catch let installError {
177
- do {
178
- let newJobRegistered = runLaunchctl(["print", "\(domain)/\(label)"]) == 0
179
- if newJobRegistered,
180
- runLaunchctl(["bootout", "\(domain)/\(label)"]) != 0
181
- {
182
- throw HelperInstallError.rollbackFailed
183
- }
184
- if FileManager.default.fileExists(atPath: installedHelper.path),
185
- rename(installedHelper.path, failedHelper.path) != 0
186
- {
187
- throw HelperInstallError.rollbackFailed
188
- }
189
- if FileManager.default.fileExists(atPath: backupHelper.path),
190
- rename(backupHelper.path, installedHelper.path) != 0
191
- {
192
- throw HelperInstallError.rollbackFailed
193
- }
194
- if let previousPlist {
195
- try previousPlist.write(to: plistURL, options: .atomic)
196
- if wasRegistered,
197
- runLaunchctl(["bootstrap", domain, plistURL.path]) != 0
198
- {
199
- throw HelperInstallError.rollbackFailed
200
- }
201
- } else {
202
- try? FileManager.default.removeItem(at: plistURL)
203
- }
204
- try? FileManager.default.removeItem(at: failedHelper)
205
- } catch {
206
- NSLog("Bleam helper rollback failed: %@", error.localizedDescription)
207
- throw error
208
- }
209
- throw installError
210
- }
211
- } catch {
212
- NSLog("Bleam helper install failed: %@", error.localizedDescription)
213
- return
214
- }
215
- #endif
216
- }
217
-
218
- private static func validSignature(at url: URL, teamIdentifier: String) -> Bool {
219
- var staticCode: SecStaticCode?
220
- guard
221
- SecStaticCodeCreateWithPath(url as CFURL, [], &staticCode) == errSecSuccess,
222
- let staticCode,
223
- SecStaticCodeCheckValidity(
224
- staticCode,
225
- SecCSFlags(rawValue: kSecCSStrictValidate),
226
- nil
227
- ) == errSecSuccess
228
- else { return false }
229
-
230
- var signingInfo: CFDictionary?
231
- guard
232
- SecCodeCopySigningInformation(
233
- staticCode,
234
- SecCSFlags(rawValue: kSecCSSigningInformation),
235
- &signingInfo
236
- ) == errSecSuccess
237
- else { return false }
238
- return (signingInfo as? [String: Any])?[kSecCodeInfoTeamIdentifier as String] as? String == teamIdentifier
239
- }
240
-
241
- private static func runLaunchctl(_ arguments: [String]) -> Int32 {
242
- let values = ["launchctl"] + arguments
243
- var argv = values.map { strdup($0) }
244
- argv.append(nil)
245
- defer { argv.compactMap { $0 }.forEach { free($0) } }
246
-
247
- var pid: pid_t = 0
248
- let result = posix_spawn(&pid, "/bin/launchctl", nil, nil, &argv, environ)
249
- guard result == 0 else { return Int32(result) }
250
- var status: Int32 = 0
251
- guard waitpid(pid, &status, 0) == pid else { return -1 }
252
- return status
253
- }
254
- }
255
-
256
- private enum HelperInstallError: Error {
257
- case invalidSignature, registrationFailed, replacementFailed, rollbackFailed
258
- }
259
-
260
54
  class ReactNativeDelegate: ExpoReactNativeFactoryDelegate {
261
55
  private let bundleOverrideURL: URL?
262
56
 
@@ -61,8 +61,27 @@
61
61
  D63D5719C5F6BEF2642A0627 /* GenerationWorkerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C1C083A847A6F08154A7655 /* GenerationWorkerProtocol.swift */; };
62
62
  F11748422D0307B40044C1D9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F11748412D0307B40044C1D9 /* AppDelegate.swift */; };
63
63
  F3E19B0AABF791129F5C2531 /* Flux2KVCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D1000122F00000000000012 /* Flux2KVCache.swift */; };
64
- A10000000000000000000001 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A10000000000000000000005 /* main.swift */; };
65
- A10000000000000000000002 /* PlatformHelper in Embed Platform Helper */ = {isa = PBXBuildFile; fileRef = A10000000000000000000006 /* PlatformHelper */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
64
+ C30000000000000000000001 /* ModelCapabilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000001 /* ModelCapabilities.swift */; };
65
+ C30000000000000000000002 /* GenerationTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000002 /* GenerationTypes.swift */; };
66
+ C30000000000000000000003 /* TokenSampler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000003 /* TokenSampler.swift */; };
67
+ C30000000000000000000004 /* TextKVCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000004 /* TextKVCache.swift */; };
68
+ C30000000000000000000005 /* Qwen3CheckpointLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000005 /* Qwen3CheckpointLoader.swift */; };
69
+ C30000000000000000000006 /* Qwen3Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000006 /* Qwen3Configuration.swift */; };
70
+ C30000000000000000000007 /* Qwen3Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000007 /* Qwen3Model.swift */; };
71
+ C30000000000000000000008 /* Qwen3InferenceSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000008 /* Qwen3InferenceSession.swift */; };
72
+ C30000000000000000000009 /* Qwen3Layers.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000009 /* Qwen3Layers.swift */; };
73
+ C3000000000000000000000A /* QwenHybridFullAttention.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2000000000000000000000A /* QwenHybridFullAttention.swift */; };
74
+ C3000000000000000000000B /* QwenHybridLayers.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2000000000000000000000B /* QwenHybridLayers.swift */; };
75
+ C3000000000000000000000C /* QwenHybridLinearAttention.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2000000000000000000000C /* QwenHybridLinearAttention.swift */; };
76
+ C3000000000000000000000D /* QwenHybridCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2000000000000000000000D /* QwenHybridCache.swift */; };
77
+ C3000000000000000000000E /* Qwen35Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2000000000000000000000E /* Qwen35Session.swift */; };
78
+ C3000000000000000000000F /* Qwen35Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2000000000000000000000F /* Qwen35Configuration.swift */; };
79
+ C30000000000000000000010 /* Qwen35Checkpoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000010 /* Qwen35Checkpoint.swift */; };
80
+ C30000000000000000000011 /* Qwen35Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000011 /* Qwen35Model.swift */; };
81
+ C30000000000000000000012 /* BonsaiTextSnapshotValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000012 /* BonsaiTextSnapshotValidator.swift */; };
82
+ C30000000000000000000013 /* BonsaiTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000013 /* BonsaiTextModel.swift */; };
83
+ C30000000000000000000014 /* BonsaiTextGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000014 /* BonsaiTextGenerator.swift */; };
84
+ C30000000000000000000015 /* BonsaiTextGenerationRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20000000000000000000015 /* BonsaiTextGenerationRunner.swift */; };
66
85
  /* End PBXBuildFile section */
67
86
 
68
87
  /* Begin PBXContainerItemProxy section */
@@ -73,13 +92,6 @@
73
92
  remoteGlobalIDString = 8F04CB76A01E93A4B73D67A5;
74
93
  remoteInfo = GenerationService;
75
94
  };
76
- A10000000000000000000003 /* PBXContainerItemProxy */ = {
77
- isa = PBXContainerItemProxy;
78
- containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
79
- proxyType = 1;
80
- remoteGlobalIDString = A1000000000000000000000A;
81
- remoteInfo = PlatformHelper;
82
- };
83
95
  /* End PBXContainerItemProxy section */
84
96
 
85
97
  /* Begin PBXCopyFilesBuildPhase section */
@@ -108,17 +120,6 @@
108
120
  name = "Embed XPC Services";
109
121
  runOnlyForDeploymentPostprocessing = 0;
110
122
  };
111
- A10000000000000000000010 /* Embed Platform Helper */ = {
112
- isa = PBXCopyFilesBuildPhase;
113
- buildActionMask = 2147483647;
114
- dstPath = "$(CONTENTS_FOLDER_PATH)/Helpers";
115
- dstSubfolderSpec = 16;
116
- files = (
117
- A10000000000000000000002 /* PlatformHelper in Embed Platform Helper */,
118
- );
119
- name = "Embed Platform Helper";
120
- runOnlyForDeploymentPostprocessing = 0;
121
- };
122
123
  /* End PBXCopyFilesBuildPhase section */
123
124
 
124
125
  /* Begin PBXFileReference section */
@@ -182,18 +183,30 @@
182
183
  F11748412D0307B40044C1D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = bleam/AppDelegate.swift; sourceTree = "<group>"; };
183
184
  F11748442D0722820044C1D9 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Bridging-Header.h"; path = "bleam/Bridging-Header.h"; sourceTree = "<group>"; };
184
185
  FB433ED9D990D1F5BEAC2C93 /* GenerationService.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; name = GenerationService.xpc; path = GenerationService.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
185
- A10000000000000000000005 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
186
- A10000000000000000000006 /* PlatformHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = PlatformHelper; sourceTree = BUILT_PRODUCTS_DIR; };
186
+ C20000000000000000000001 /* ModelCapabilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelCapabilities.swift; sourceTree = "<group>"; };
187
+ C20000000000000000000002 /* GenerationTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenerationTypes.swift; sourceTree = "<group>"; };
188
+ C20000000000000000000003 /* TokenSampler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenSampler.swift; sourceTree = "<group>"; };
189
+ C20000000000000000000004 /* TextKVCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextKVCache.swift; sourceTree = "<group>"; };
190
+ C20000000000000000000005 /* Qwen3CheckpointLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen3CheckpointLoader.swift; sourceTree = "<group>"; };
191
+ C20000000000000000000006 /* Qwen3Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen3Configuration.swift; sourceTree = "<group>"; };
192
+ C20000000000000000000007 /* Qwen3Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen3Model.swift; sourceTree = "<group>"; };
193
+ C20000000000000000000008 /* Qwen3InferenceSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen3InferenceSession.swift; sourceTree = "<group>"; };
194
+ C20000000000000000000009 /* Qwen3Layers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen3Layers.swift; sourceTree = "<group>"; };
195
+ C2000000000000000000000A /* QwenHybridFullAttention.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QwenHybridFullAttention.swift; sourceTree = "<group>"; };
196
+ C2000000000000000000000B /* QwenHybridLayers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QwenHybridLayers.swift; sourceTree = "<group>"; };
197
+ C2000000000000000000000C /* QwenHybridLinearAttention.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QwenHybridLinearAttention.swift; sourceTree = "<group>"; };
198
+ C2000000000000000000000D /* QwenHybridCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QwenHybridCache.swift; sourceTree = "<group>"; };
199
+ C2000000000000000000000E /* Qwen35Session.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen35Session.swift; sourceTree = "<group>"; };
200
+ C2000000000000000000000F /* Qwen35Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen35Configuration.swift; sourceTree = "<group>"; };
201
+ C20000000000000000000010 /* Qwen35Checkpoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen35Checkpoint.swift; sourceTree = "<group>"; };
202
+ C20000000000000000000011 /* Qwen35Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Qwen35Model.swift; sourceTree = "<group>"; };
203
+ C20000000000000000000012 /* BonsaiTextSnapshotValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BonsaiTextSnapshotValidator.swift; sourceTree = "<group>"; };
204
+ C20000000000000000000013 /* BonsaiTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BonsaiTextModel.swift; sourceTree = "<group>"; };
205
+ C20000000000000000000014 /* BonsaiTextGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BonsaiTextGenerator.swift; sourceTree = "<group>"; };
206
+ C20000000000000000000015 /* BonsaiTextGenerationRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BonsaiTextGenerationRunner.swift; sourceTree = "<group>"; };
187
207
  /* End PBXFileReference section */
188
208
 
189
209
  /* Begin PBXFrameworksBuildPhase section */
190
- A10000000000000000000007 /* Frameworks */ = {
191
- isa = PBXFrameworksBuildPhase;
192
- buildActionMask = 2147483647;
193
- files = (
194
- );
195
- runOnlyForDeploymentPostprocessing = 0;
196
- };
197
210
  0656BC11F02F0C51B3DC5EE0 /* Frameworks */ = {
198
211
  isa = PBXFrameworksBuildPhase;
199
212
  buildActionMask = 2147483647;
@@ -225,6 +238,7 @@
225
238
  8C3E6C6922B84B0C9F49B001 /* SceneDelegate.swift */,
226
239
  8C3E6C7822B84B0C9F49B001 /* bleam.entitlements */,
227
240
  8D1001002F00000000000100 /* Flux2 */,
241
+ C40000000000000000000001 /* TextGeneration */,
228
242
  F11748442D0722820044C1D9 /* Bridging-Header.h */,
229
243
  BB2F792B24A3F905000567C9 /* Supporting */,
230
244
  13B07FB51A68108700A75B9A /* Images.xcassets */,
@@ -277,7 +291,6 @@
277
291
  C304F306F23C790312DB9DC3 /* ExpoModulesProviders */,
278
292
  B895E2E16B0B07754F5B5D83 /* Shared */,
279
293
  AB7C58FE1F91CA4ED0C60825 /* GenerationService */,
280
- A1000000000000000000000F /* PlatformHelper */,
281
294
  );
282
295
  indentWidth = 2;
283
296
  sourceTree = "<group>";
@@ -289,7 +302,6 @@
289
302
  children = (
290
303
  13B07F961A680F5B00A75B9A /* bleam.app */,
291
304
  FB433ED9D990D1F5BEAC2C93 /* GenerationService.xpc */,
292
- A10000000000000000000006 /* PlatformHelper */,
293
305
  );
294
306
  name = Products;
295
307
  sourceTree = "<group>";
@@ -339,17 +351,78 @@
339
351
  7DFD85F313B4BAB889F5FECF /* GenerationService.entitlements */,
340
352
  E72903DB5F3C7D30AA5ED70B /* main.swift */,
341
353
  A4485061CD0366330F3F5BE0 /* ImageGenerationRunner.swift */,
354
+ C20000000000000000000015 /* BonsaiTextGenerationRunner.swift */,
342
355
  );
343
356
  name = GenerationService;
344
357
  path = GenerationService;
345
358
  sourceTree = "<group>";
346
359
  };
347
- A1000000000000000000000F /* PlatformHelper */ = {
360
+ C40000000000000000000001 /* TextGeneration */ = {
361
+ isa = PBXGroup;
362
+ children = (
363
+ C40000000000000000000002 /* Core */,
364
+ C40000000000000000000003 /* Qwen3 */,
365
+ C40000000000000000000004 /* QwenHybrid */,
366
+ C40000000000000000000005 /* Qwen35 */,
367
+ C40000000000000000000006 /* Bonsai */,
368
+ );
369
+ name = TextGeneration;
370
+ path = bleam/AI/TextGeneration;
371
+ sourceTree = "<group>";
372
+ };
373
+ C40000000000000000000002 /* Core */ = {
374
+ isa = PBXGroup;
375
+ children = (
376
+ C20000000000000000000001 /* ModelCapabilities.swift */,
377
+ C20000000000000000000002 /* GenerationTypes.swift */,
378
+ C20000000000000000000003 /* TokenSampler.swift */,
379
+ C20000000000000000000004 /* TextKVCache.swift */,
380
+ );
381
+ path = Core;
382
+ sourceTree = "<group>";
383
+ };
384
+ C40000000000000000000003 /* Qwen3 */ = {
348
385
  isa = PBXGroup;
349
386
  children = (
350
- A10000000000000000000005 /* main.swift */,
387
+ C20000000000000000000005 /* Qwen3CheckpointLoader.swift */,
388
+ C20000000000000000000006 /* Qwen3Configuration.swift */,
389
+ C20000000000000000000007 /* Qwen3Model.swift */,
390
+ C20000000000000000000008 /* Qwen3InferenceSession.swift */,
391
+ C20000000000000000000009 /* Qwen3Layers.swift */,
351
392
  );
352
- path = PlatformHelper;
393
+ path = Qwen3;
394
+ sourceTree = "<group>";
395
+ };
396
+ C40000000000000000000004 /* QwenHybrid */ = {
397
+ isa = PBXGroup;
398
+ children = (
399
+ C2000000000000000000000A /* QwenHybridFullAttention.swift */,
400
+ C2000000000000000000000B /* QwenHybridLayers.swift */,
401
+ C2000000000000000000000C /* QwenHybridLinearAttention.swift */,
402
+ C2000000000000000000000D /* QwenHybridCache.swift */,
403
+ );
404
+ path = QwenHybrid;
405
+ sourceTree = "<group>";
406
+ };
407
+ C40000000000000000000005 /* Qwen35 */ = {
408
+ isa = PBXGroup;
409
+ children = (
410
+ C2000000000000000000000E /* Qwen35Session.swift */,
411
+ C2000000000000000000000F /* Qwen35Configuration.swift */,
412
+ C20000000000000000000010 /* Qwen35Checkpoint.swift */,
413
+ C20000000000000000000011 /* Qwen35Model.swift */,
414
+ );
415
+ path = Qwen35;
416
+ sourceTree = "<group>";
417
+ };
418
+ C40000000000000000000006 /* Bonsai */ = {
419
+ isa = PBXGroup;
420
+ children = (
421
+ C20000000000000000000012 /* BonsaiTextSnapshotValidator.swift */,
422
+ C20000000000000000000013 /* BonsaiTextModel.swift */,
423
+ C20000000000000000000014 /* BonsaiTextGenerator.swift */,
424
+ );
425
+ path = Bonsai;
353
426
  sourceTree = "<group>";
354
427
  };
355
428
  B895E2E16B0B07754F5B5D83 /* Shared */ = {
@@ -422,13 +495,11 @@
422
495
  84C420C0881684F1F1EB77FB /* [bleam] Normalize Catalyst prebuilt frameworks */,
423
496
  BEC473809D63946EDB256C9A /* [CP] Embed Pods Frameworks */,
424
497
  CA12AFD569B8A5A458B4F36A /* Embed XPC Services */,
425
- A10000000000000000000010 /* Embed Platform Helper */,
426
498
  );
427
499
  buildRules = (
428
500
  );
429
501
  dependencies = (
430
502
  6E20F2C4EC850BB2D3853EAD /* PBXTargetDependency */,
431
- A1000000000000000000000B /* PBXTargetDependency */,
432
503
  );
433
504
  name = bleam;
434
505
  productName = bleam;
@@ -453,23 +524,6 @@
453
524
  productReference = FB433ED9D990D1F5BEAC2C93 /* GenerationService.xpc */;
454
525
  productType = "com.apple.product-type.xpc-service";
455
526
  };
456
- A1000000000000000000000A /* PlatformHelper */ = {
457
- isa = PBXNativeTarget;
458
- buildConfigurationList = A1000000000000000000000E /* Build configuration list for PBXNativeTarget "PlatformHelper" */;
459
- buildPhases = (
460
- A10000000000000000000009 /* Sources */,
461
- A10000000000000000000007 /* Frameworks */,
462
- A10000000000000000000008 /* Resources */,
463
- );
464
- buildRules = (
465
- );
466
- dependencies = (
467
- );
468
- name = PlatformHelper;
469
- productName = PlatformHelper;
470
- productReference = A10000000000000000000006 /* PlatformHelper */;
471
- productType = "com.apple.product-type.tool";
472
- };
473
527
  /* End PBXNativeTarget section */
474
528
 
475
529
  /* Begin PBXProject section */
@@ -484,9 +538,6 @@
484
538
  8F04CB76A01E93A4B73D67A5 = {
485
539
  LastSwiftMigration = 1250;
486
540
  };
487
- A1000000000000000000000A = {
488
- LastSwiftMigration = 1250;
489
- };
490
541
  };
491
542
  };
492
543
  buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Bleam" */;
@@ -504,7 +555,6 @@
504
555
  targets = (
505
556
  13B07F861A680F5B00A75B9A /* bleam */,
506
557
  8F04CB76A01E93A4B73D67A5 /* GenerationService */,
507
- A1000000000000000000000A /* PlatformHelper */,
508
558
  );
509
559
  };
510
560
  /* End PBXProject section */
@@ -528,13 +578,6 @@
528
578
  );
529
579
  runOnlyForDeploymentPostprocessing = 0;
530
580
  };
531
- A10000000000000000000008 /* Resources */ = {
532
- isa = PBXResourcesBuildPhase;
533
- buildActionMask = 2147483647;
534
- files = (
535
- );
536
- runOnlyForDeploymentPostprocessing = 0;
537
- };
538
581
  /* End PBXResourcesBuildPhase section */
539
582
 
540
583
  /* Begin PBXShellScriptBuildPhase section */
@@ -696,6 +739,27 @@
696
739
  D63D5719C5F6BEF2642A0627 /* GenerationWorkerProtocol.swift in Sources */,
697
740
  90AAAF98423C82ED52385571 /* main.swift in Sources */,
698
741
  B23B4E23A940CE8F6FD4B85A /* ImageGenerationRunner.swift in Sources */,
742
+ C30000000000000000000015 /* BonsaiTextGenerationRunner.swift in Sources */,
743
+ C30000000000000000000001 /* ModelCapabilities.swift in Sources */,
744
+ C30000000000000000000002 /* GenerationTypes.swift in Sources */,
745
+ C30000000000000000000003 /* TokenSampler.swift in Sources */,
746
+ C30000000000000000000004 /* TextKVCache.swift in Sources */,
747
+ C30000000000000000000005 /* Qwen3CheckpointLoader.swift in Sources */,
748
+ C30000000000000000000006 /* Qwen3Configuration.swift in Sources */,
749
+ C30000000000000000000007 /* Qwen3Model.swift in Sources */,
750
+ C30000000000000000000008 /* Qwen3InferenceSession.swift in Sources */,
751
+ C30000000000000000000009 /* Qwen3Layers.swift in Sources */,
752
+ C3000000000000000000000A /* QwenHybridFullAttention.swift in Sources */,
753
+ C3000000000000000000000B /* QwenHybridLayers.swift in Sources */,
754
+ C3000000000000000000000C /* QwenHybridLinearAttention.swift in Sources */,
755
+ C3000000000000000000000D /* QwenHybridCache.swift in Sources */,
756
+ C3000000000000000000000E /* Qwen35Session.swift in Sources */,
757
+ C3000000000000000000000F /* Qwen35Configuration.swift in Sources */,
758
+ C30000000000000000000010 /* Qwen35Checkpoint.swift in Sources */,
759
+ C30000000000000000000011 /* Qwen35Model.swift in Sources */,
760
+ C30000000000000000000012 /* BonsaiTextSnapshotValidator.swift in Sources */,
761
+ C30000000000000000000013 /* BonsaiTextModel.swift in Sources */,
762
+ C30000000000000000000014 /* BonsaiTextGenerator.swift in Sources */,
699
763
  5224DF2286EAF50159491DCA /* Flux2Config.swift in Sources */,
700
764
  814C5B6310C5000E9B289C59 /* MemoryConfig.swift in Sources */,
701
765
  9819B5258147130BD109E6CD /* MemoryOptimizationConfig.swift in Sources */,
@@ -730,14 +794,6 @@
730
794
  );
731
795
  runOnlyForDeploymentPostprocessing = 0;
732
796
  };
733
- A10000000000000000000009 /* Sources */ = {
734
- isa = PBXSourcesBuildPhase;
735
- buildActionMask = 2147483647;
736
- files = (
737
- A10000000000000000000001 /* main.swift in Sources */,
738
- );
739
- runOnlyForDeploymentPostprocessing = 0;
740
- };
741
797
  /* End PBXSourcesBuildPhase section */
742
798
 
743
799
  /* Begin PBXTargetDependency section */
@@ -747,12 +803,6 @@
747
803
  target = 8F04CB76A01E93A4B73D67A5 /* GenerationService */;
748
804
  targetProxy = 0B3BB0ECB863062C83BCE9B3 /* PBXContainerItemProxy */;
749
805
  };
750
- A1000000000000000000000B /* PBXTargetDependency */ = {
751
- isa = PBXTargetDependency;
752
- name = PlatformHelper;
753
- target = A1000000000000000000000A /* PlatformHelper */;
754
- targetProxy = A10000000000000000000003 /* PBXContainerItemProxy */;
755
- };
756
806
  /* End PBXTargetDependency section */
757
807
 
758
808
  /* Begin XCBuildConfiguration section */
@@ -1067,41 +1117,6 @@
1067
1117
  };
1068
1118
  name = Debug;
1069
1119
  };
1070
- A1000000000000000000000C /* Debug */ = {
1071
- isa = XCBuildConfiguration;
1072
- buildSettings = {
1073
- ARCHS = arm64;
1074
- CODE_SIGN_STYLE = Automatic;
1075
- DEAD_CODE_STRIPPING = YES;
1076
- DEVELOPMENT_TEAM = 5SZ3H5P69M;
1077
- ENABLE_APP_SANDBOX = NO;
1078
- ENABLE_HARDENED_RUNTIME = YES;
1079
- MACOSX_DEPLOYMENT_TARGET = 13.4;
1080
- PRODUCT_NAME = "$(TARGET_NAME)";
1081
- SDKROOT = macosx;
1082
- SKIP_INSTALL = YES;
1083
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1084
- SWIFT_VERSION = 5.0;
1085
- };
1086
- name = Debug;
1087
- };
1088
- A1000000000000000000000D /* Release */ = {
1089
- isa = XCBuildConfiguration;
1090
- buildSettings = {
1091
- ARCHS = arm64;
1092
- CODE_SIGN_STYLE = Automatic;
1093
- DEAD_CODE_STRIPPING = YES;
1094
- DEVELOPMENT_TEAM = 5SZ3H5P69M;
1095
- ENABLE_APP_SANDBOX = NO;
1096
- ENABLE_HARDENED_RUNTIME = YES;
1097
- MACOSX_DEPLOYMENT_TARGET = 13.4;
1098
- PRODUCT_NAME = "$(TARGET_NAME)";
1099
- SDKROOT = macosx;
1100
- SKIP_INSTALL = YES;
1101
- SWIFT_VERSION = 5.0;
1102
- };
1103
- name = Release;
1104
- };
1105
1120
  /* End XCBuildConfiguration section */
1106
1121
 
1107
1122
  /* Begin XCConfigurationList section */
@@ -1132,15 +1147,6 @@
1132
1147
  defaultConfigurationIsVisible = 0;
1133
1148
  defaultConfigurationName = Release;
1134
1149
  };
1135
- A1000000000000000000000E /* Build configuration list for PBXNativeTarget "PlatformHelper" */ = {
1136
- isa = XCConfigurationList;
1137
- buildConfigurations = (
1138
- A1000000000000000000000C /* Debug */,
1139
- A1000000000000000000000D /* Release */,
1140
- );
1141
- defaultConfigurationIsVisible = 0;
1142
- defaultConfigurationName = Release;
1143
- };
1144
1150
  /* End XCConfigurationList section */
1145
1151
  };
1146
1152
  rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;