bleam 0.0.8 → 0.0.9
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.
- package/dist/cli.cjs +23 -4
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +23 -4
- package/dist/{ui-Ce-pnUUA.d.ts → ui-Bg11tvlc.d.ts} +7 -7
- package/dist/ui.d.ts +1 -1
- package/dist/window.d.ts +1 -1
- package/package.json +4 -1
- package/templates/image-generation/app/index.tsx +1 -1
- package/templates/native/.gitattributes +1 -0
- package/templates/native/App.tsx +26 -0
- package/templates/native/app.json +12 -0
- package/templates/native/index.ts +8 -0
- package/templates/native/ios/.xcode.env +11 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/Flux2Config.swift +288 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/MemoryConfig.swift +233 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/MemoryOptimizationConfig.swift +157 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/ModelRegistry.swift +425 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/QuantizationConfig.swift +138 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/TransformerRepoProfile.swift +59 -0
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/VAEConfig.swift +134 -0
- package/templates/native/ios/Bleam/AI/Flux2/Flux2Core.swift +55 -0
- package/templates/native/ios/Bleam/AI/Flux2/Loading/WeightLoader.swift +1192 -0
- package/templates/native/ios/Bleam/AI/Flux2/Pipeline/FluxImageRunner.swift +1282 -0
- package/templates/native/ios/Bleam/AI/Flux2/Pipeline/LatentUtils.swift +191 -0
- package/templates/native/ios/Bleam/AI/Flux2/Scheduler/FlowMatchEulerScheduler.swift +279 -0
- package/templates/native/ios/Bleam/AI/Flux2/Text/KleinTextEncoder.swift +380 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Attention.swift +379 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Embeddings.swift +159 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2FeedForward.swift +154 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2FusedKernels.swift +198 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2KVCache.swift +36 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Modulation.swift +193 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2ParallelAttention.swift +389 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2RoPE.swift +304 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2SingleBlock.swift +290 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2Transformer.swift +530 -0
- package/templates/native/ios/Bleam/AI/Flux2/Transformer/Flux2TransformerBlock.swift +362 -0
- package/templates/native/ios/Bleam/AI/Flux2/Utils/Flux2Debug.swift +101 -0
- package/templates/native/ios/Bleam/AI/Flux2/Utils/MLXCheckpoint.swift +118 -0
- package/templates/native/ios/Bleam/AI/Flux2/Utils/MemoryManager.swift +201 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/AutoencoderKL.swift +476 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/ResnetBlock.swift +316 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/VAEDecoder.swift +120 -0
- package/templates/native/ios/Bleam/AI/Flux2/VAE/VAEEncoder.swift +136 -0
- package/templates/native/ios/Bleam/AppDelegate.swift +373 -0
- package/templates/native/ios/Bleam/Appearance.swift +62 -0
- package/templates/native/ios/Bleam/Bridging-Header.h +3 -0
- package/templates/native/ios/Bleam/Images.xcassets/AppIcon.appiconset/Contents.json +13 -0
- package/templates/native/ios/Bleam/Images.xcassets/Contents.json +6 -0
- package/templates/native/ios/Bleam/Info.plist +76 -0
- package/templates/native/ios/Bleam/PrivacyInfo.xcprivacy +48 -0
- package/templates/native/ios/Bleam/SceneDelegate.swift +58 -0
- package/templates/native/ios/Bleam/SplashScreen.storyboard +47 -0
- package/templates/native/ios/Bleam/Supporting/Expo.plist +6 -0
- package/templates/native/ios/Bleam/bleam.entitlements +10 -0
- package/templates/native/ios/Bleam.xcodeproj/project.pbxproj +1146 -0
- package/templates/native/ios/Bleam.xcodeproj/xcshareddata/xcschemes/Bleam.xcscheme +88 -0
- package/templates/native/ios/GenerationService/GenerationService.entitlements +10 -0
- package/templates/native/ios/GenerationService/ImageGenerationRunner.swift +591 -0
- package/templates/native/ios/GenerationService/Info.plist +31 -0
- package/templates/native/ios/GenerationService/main.swift +165 -0
- package/templates/native/ios/PlatformHelper/Info.plist +29 -0
- package/templates/native/ios/PlatformHelper/main.swift +335 -0
- package/templates/native/ios/Podfile +198 -0
- package/templates/native/ios/Podfile.lock +2284 -0
- package/templates/native/ios/Podfile.properties.json +5 -0
- package/templates/native/ios/Shared/Generation/GenerationServiceProtocol.swift +12 -0
- package/templates/native/ios/Shared/Generation/GenerationWorkerProtocol.swift +124 -0
- package/templates/native/metro.config.js +6 -0
- package/templates/native/modules/bleam-runtime/BleamRuntime.podspec +14 -0
- package/templates/native/modules/bleam-runtime/expo-module.config.json +8 -0
- package/templates/native/modules/bleam-runtime/ios/AIModule.swift +1258 -0
- package/templates/native/modules/bleam-runtime/ios/GenerationContracts.swift +135 -0
- package/templates/native/modules/bleam-runtime/ios/PlatformModule.swift +313 -0
- package/templates/native/modules/bleam-runtime/package.json +5 -0
- package/templates/native/package.json +39 -0
- package/templates/native/scripts/build/mlx-frameworks.ts +421 -0
- package/templates/native/scripts/start/index.ts +474 -0
- package/templates/native/scripts/start/known-failures.ts +20 -0
- package/templates/native/scripts/start/loader.ts +76 -0
- package/templates/native/scripts/start/native-state.ts +242 -0
- package/templates/native/scripts/start/package.json +4 -0
- package/templates/native/scripts/start/swift-packages.ts +414 -0
- package/templates/native/scripts/start/xcode-formatter.ts +106 -0
- package/templates/native/tsconfig.json +14 -0
- package/templates/native/yarn.lock +3749 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const COLORS = {
|
|
2
|
+
yellow: '\x1b[33m',
|
|
3
|
+
red: '\x1b[31m',
|
|
4
|
+
dim: '\x1b[2m',
|
|
5
|
+
reset: '\x1b[0m',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const DIAGNOSTIC_LINE =
|
|
9
|
+
/(^|\s)(error):\s|^xcodebuild: error:|^clang: error:|^ld: error:|^Undefined symbols for architecture /
|
|
10
|
+
|
|
11
|
+
function colorize(line: string): string {
|
|
12
|
+
if (
|
|
13
|
+
/(^|\s)(error):\s|^xcodebuild: error:|^clang: error:|^ld: |^Undefined symbols for architecture /.test(
|
|
14
|
+
line,
|
|
15
|
+
)
|
|
16
|
+
) {
|
|
17
|
+
return `${COLORS.red}${line}${COLORS.reset}`
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return line
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class XcFormatter {
|
|
24
|
+
#pendingLine: string = ''
|
|
25
|
+
|
|
26
|
+
#lastPrintedLine: string | null = null
|
|
27
|
+
|
|
28
|
+
#failureLines: string[] = []
|
|
29
|
+
|
|
30
|
+
#pendingContextLines: number = 0
|
|
31
|
+
|
|
32
|
+
#output: NodeJS.WriteStream
|
|
33
|
+
|
|
34
|
+
constructor(output: NodeJS.WriteStream = process.stdout) {
|
|
35
|
+
this.#output = output
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
write(chunk: string) {
|
|
39
|
+
const text = this.#pendingLine + chunk
|
|
40
|
+
const lines = text.split(/\r?\n/)
|
|
41
|
+
this.#pendingLine = lines.pop() ?? ''
|
|
42
|
+
|
|
43
|
+
for (const line of lines) {
|
|
44
|
+
this.#handleLine(line)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
finish() {
|
|
49
|
+
if (!this.#pendingLine) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
this.#handleLine(this.#pendingLine)
|
|
54
|
+
this.#pendingLine = ''
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
getFailureSummary(): string[] {
|
|
58
|
+
return this.#failureLines.slice(-40)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#handleLine(rawLine: string) {
|
|
62
|
+
const line = rawLine.trimEnd()
|
|
63
|
+
if (!line) {
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (DIAGNOSTIC_LINE.test(line)) {
|
|
68
|
+
this.#emitLive(line, true)
|
|
69
|
+
this.#pendingContextLines = 2
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (this.#pendingContextLines > 0 && /^(\s+.*|\^+|~+)$/.test(line)) {
|
|
74
|
+
this.#emitLive(line, true)
|
|
75
|
+
this.#pendingContextLines -= 1
|
|
76
|
+
return
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
this.#pendingContextLines = 0
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
#emitLive(line: string, includeInFailureSummary: boolean = false) {
|
|
83
|
+
if (this.#lastPrintedLine === line) {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
this.#output.write(`${colorize(line)}\n`)
|
|
88
|
+
this.#lastPrintedLine = line
|
|
89
|
+
|
|
90
|
+
if (includeInFailureSummary) {
|
|
91
|
+
this.#pushFailureLine(line)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
#pushFailureLine(line: string) {
|
|
96
|
+
const colored = colorize(line)
|
|
97
|
+
if (this.#failureLines[this.#failureLines.length - 1] === colored) {
|
|
98
|
+
return
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
this.#failureLines.push(colored)
|
|
102
|
+
if (this.#failureLines.length > 80) {
|
|
103
|
+
this.#failureLines.splice(0, this.#failureLines.length - 80)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "expo/tsconfig.base",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"noEmit": true,
|
|
5
|
+
"strict": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"allowImportingTsExtensions": true,
|
|
9
|
+
"maxNodeModuleJsDepth": 0,
|
|
10
|
+
"types": ["node"]
|
|
11
|
+
},
|
|
12
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
13
|
+
"exclude": ["node_modules", "ios", ".expo", "build"]
|
|
14
|
+
}
|