bleam 0.0.10 → 0.0.12
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/ai.cjs +1872 -1182
- package/dist/ai.d.cts +267 -234
- package/dist/ai.d.ts +267 -234
- package/dist/ai.js +1859 -1167
- package/dist/cli.cjs +3 -183
- package/dist/cli.d.cts +3 -47
- package/dist/cli.d.ts +3 -47
- package/dist/cli.js +3 -183
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{files-Ds1wT8C2.js → files-BXVkPrPN.js} +6 -1
- package/dist/{files-Bo7h9fik.cjs → files-DxaQ-Nv0.cjs} +11 -0
- package/dist/files.cjs +1 -1
- package/dist/files.js +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/platform.cjs +1 -13
- package/dist/platform.d.cts +1 -28
- package/dist/platform.d.ts +1 -28
- package/dist/platform.js +1 -10
- package/dist/schema-B5BfdswF.js +226 -0
- package/dist/schema-BnVZOXfu.cjs +286 -0
- package/dist/schema-D5eImHxu.d.cts +125 -0
- package/dist/schema-SSjokbtw.d.ts +125 -0
- package/dist/schema.cjs +10 -2
- package/dist/schema.d.cts +2 -2
- package/dist/schema.d.ts +2 -2
- package/dist/schema.js +2 -2
- package/dist/state-Dh3HLixb.js +874 -0
- package/dist/state-LssDgpff.cjs +973 -0
- package/dist/state.cjs +16 -12
- package/dist/state.d.cts +144 -140
- package/dist/state.d.ts +145 -140
- package/dist/state.js +3 -3
- package/dist/{ui-Bg11tvlc.d.ts → ui-1WepaMS4.d.cts} +1 -1
- package/dist/{ui-Dd7SXdbg.d.cts → ui-D7bRLYee.d.ts} +7 -7
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/window.d.cts +1 -1
- package/dist/window.d.ts +1 -1
- package/package.json +3 -1
- package/templates/foundation-models/app/index.tsx +77 -15
- package/templates/image-generation/app/index.tsx +4 -2
- package/templates/native/ios/Bleam/AI/Flux2/Configuration/ModelRegistry.swift +1 -1
- package/templates/native/ios/Bleam/AI/Flux2/Pipeline/FluxImageRunner.swift +7 -2
- package/templates/native/ios/Bleam/AI/TextGeneration/Bonsai/BonsaiTextGenerator.swift +46 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Bonsai/BonsaiTextModel.swift +107 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Bonsai/BonsaiTextSnapshotValidator.swift +201 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Core/GenerationTypes.swift +85 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Core/ModelCapabilities.swift +21 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Core/TextKVCache.swift +23 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Core/TokenSampler.swift +79 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3CheckpointLoader.swift +161 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3Configuration.swift +119 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3InferenceSession.swift +84 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3Layers.swift +197 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen3/Qwen3Model.swift +130 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Checkpoint.swift +102 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Configuration.swift +140 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Model.swift +112 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/Qwen35/Qwen35Session.swift +121 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridCache.swift +42 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridFullAttention.swift +57 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridLayers.swift +58 -0
- package/templates/native/ios/Bleam/AI/TextGeneration/QwenHybrid/QwenHybridLinearAttention.swift +111 -0
- package/templates/native/ios/Bleam/AppDelegate.swift +0 -206
- package/templates/native/ios/Bleam.xcodeproj/project.pbxproj +135 -129
- package/templates/native/ios/GenerationService/BonsaiTextGenerationRunner.swift +103 -0
- package/templates/native/ios/GenerationService/ImageGenerationRunner.swift +19 -7
- package/templates/native/ios/GenerationService/main.swift +174 -48
- package/templates/native/ios/Podfile.lock +173 -173
- package/templates/native/ios/Shared/Generation/GenerationServiceProtocol.swift +3 -0
- package/templates/native/ios/Shared/Generation/GenerationWorkerProtocol.swift +44 -0
- package/templates/native/modules/bleam-runtime/ios/AIModule.swift +239 -341
- package/templates/native/modules/bleam-runtime/ios/GenerationContracts.swift +47 -0
- package/templates/native/modules/bleam-runtime/ios/PlatformModule.swift +0 -191
- package/templates/text-generation/app/index.tsx +124 -0
- package/templates/text-generation/app.config.ts +5 -0
- package/templates/updates/README.md +43 -199
- package/templates/updates/src/index.ts +5 -98
- package/templates/updates/src/schema.ts +18 -173
- package/dist/schema-Bo5Jvqus.js +0 -90
- package/dist/schema-DOOjfXvs.d.ts +0 -58
- package/dist/schema-ENSMX_1t.d.cts +0 -58
- package/dist/schema-rQ13mrpD.cjs +0 -102
- package/dist/state-Bx0VlTlO.cjs +0 -852
- package/dist/state-CAwe-Vw1.js +0 -767
- package/templates/native/ios/PlatformHelper/main.swift +0 -726
- /package/dist/{config-Cms0rvqg.d.ts → config-COcRnn5a.d.cts} +0 -0
- /package/dist/{config-CufOVJV3.d.cts → config-Chi-flpJ.d.ts} +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
//#region src/schema.d.ts
|
|
2
|
+
type JSONValue = string | number | boolean | {
|
|
3
|
+
[key: string]: JSONValue;
|
|
4
|
+
} | JSONValue[];
|
|
5
|
+
type FieldValue = JSONValue;
|
|
6
|
+
type FieldToken = 'string' | 'number' | 'boolean';
|
|
7
|
+
type PrimitiveValue = string | number | boolean;
|
|
8
|
+
interface SchemaIssue {
|
|
9
|
+
message: string;
|
|
10
|
+
path?: ReadonlyArray<PropertyKey | {
|
|
11
|
+
key: PropertyKey;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
type SchemaResult<Output> = {
|
|
15
|
+
value: Output;
|
|
16
|
+
issues?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
issues: ReadonlyArray<SchemaIssue>;
|
|
19
|
+
};
|
|
20
|
+
interface StandardSchema<Input = unknown, Output = Input> {
|
|
21
|
+
readonly '~standard': {
|
|
22
|
+
readonly version: 1;
|
|
23
|
+
readonly vendor: string;
|
|
24
|
+
readonly validate: (value: unknown) => SchemaResult<Output>;
|
|
25
|
+
readonly types?: {
|
|
26
|
+
readonly input: Input;
|
|
27
|
+
readonly output: Output;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface FieldBase<Kind extends 'string' | 'number' | 'boolean' | 'literal' | 'object' | 'array', HasDefault$1 extends boolean> {
|
|
32
|
+
readonly kind: Kind;
|
|
33
|
+
readonly hasDefault: HasDefault$1;
|
|
34
|
+
}
|
|
35
|
+
interface StringField<HasDefault$1 extends boolean = boolean> extends FieldBase<'string', HasDefault$1> {
|
|
36
|
+
readonly defaultValue?: string;
|
|
37
|
+
}
|
|
38
|
+
interface NumberField<HasDefault$1 extends boolean = boolean> extends FieldBase<'number', HasDefault$1> {
|
|
39
|
+
readonly defaultValue?: number;
|
|
40
|
+
}
|
|
41
|
+
interface BooleanField<HasDefault$1 extends boolean = boolean> extends FieldBase<'boolean', HasDefault$1> {
|
|
42
|
+
readonly defaultValue?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface LiteralField<Value$1 extends PrimitiveValue = PrimitiveValue, HasDefault$1 extends boolean = boolean> extends FieldBase<'literal', HasDefault$1> {
|
|
45
|
+
readonly value: Value$1;
|
|
46
|
+
readonly defaultValue?: Value$1;
|
|
47
|
+
}
|
|
48
|
+
interface ObjectField<Shape$1 extends SchemaShape = SchemaShape, HasDefault$1 extends boolean = boolean> extends FieldBase<'object', HasDefault$1> {
|
|
49
|
+
readonly shape: Shape$1;
|
|
50
|
+
readonly defaultFactory?: () => SchemaInput<Shape$1>;
|
|
51
|
+
}
|
|
52
|
+
interface ArrayField<Item$1 extends FieldSchema = FieldSchema, HasDefault$1 extends boolean = boolean> extends FieldBase<'array', HasDefault$1> {
|
|
53
|
+
readonly item: Item$1;
|
|
54
|
+
readonly defaultFactory?: () => ReadonlyArray<FieldInput<Item$1>>;
|
|
55
|
+
}
|
|
56
|
+
type FieldSchema = StringField | NumberField | BooleanField | LiteralField | ObjectField | ArrayField;
|
|
57
|
+
type SchemaShape = Readonly<Record<string, FieldSchema>>;
|
|
58
|
+
type HasDefault<Field extends FieldSchema> = Field extends FieldBase<Field['kind'], infer Default> ? Default : false;
|
|
59
|
+
type FieldInput<Field extends FieldSchema> = Field extends StringField ? string : Field extends NumberField ? number : Field extends BooleanField ? boolean : Field extends LiteralField<infer Value> ? Value : Field extends ObjectField<infer Shape> ? SchemaInput<Shape> : Field extends ArrayField<infer Item> ? Array<FieldInput<Item>> : never;
|
|
60
|
+
type FieldOutput<Field extends FieldSchema> = Field extends StringField ? string : Field extends NumberField ? number : Field extends BooleanField ? boolean : Field extends LiteralField<infer Value> ? Value : Field extends ObjectField<infer Shape> ? SchemaOutput<Shape> : Field extends ArrayField<infer Item> ? Array<FieldOutput<Item>> : never;
|
|
61
|
+
type DefaultKeys<Shape$1 extends SchemaShape> = { [Key in keyof Shape$1]-?: HasDefault<Shape$1[Key]> extends true ? Key : never }[keyof Shape$1];
|
|
62
|
+
type OptionalKeys<Shape$1 extends SchemaShape> = Exclude<keyof Shape$1, DefaultKeys<Shape$1>>;
|
|
63
|
+
type SchemaInput<Shape$1 extends SchemaShape> = { [Key in keyof Shape$1]?: FieldInput<Shape$1[Key]> };
|
|
64
|
+
type SchemaOutput<Shape$1 extends SchemaShape> = { [Key in DefaultKeys<Shape$1>]: FieldOutput<Shape$1[Key]> } & { [Key in OptionalKeys<Shape$1>]?: FieldOutput<Shape$1[Key]> };
|
|
65
|
+
type DeepPartial<Value$1> = Value$1 extends ReadonlyArray<infer Item> ? Array<DeepPartial<Item>> : Value$1 extends object ? { [Key in keyof Value$1]?: DeepPartial<Value$1[Key]> } : Value$1;
|
|
66
|
+
type SchemaPatch<Shape$1 extends SchemaShape> = DeepPartial<SchemaInput<Shape$1>>;
|
|
67
|
+
type NestedFieldPath<Prefix extends string, Field extends FieldSchema> = Field extends ObjectField<infer Shape> ? `${Prefix}.${FieldPath<Shape>}` : never;
|
|
68
|
+
type FieldPath<Shape$1 extends SchemaShape> = { [Key in Extract<keyof Shape$1, string>]: Key | NestedFieldPath<Key, Shape$1[Key]> }[Extract<keyof Shape$1, string>];
|
|
69
|
+
type ValueAtPath<Shape$1 extends SchemaShape, Path extends string> = Path extends `${infer Key}.${infer Rest}` ? Key extends keyof Shape$1 ? Shape$1[Key] extends ObjectField<infer NestedShape> ? ValueAtPath<NestedShape, Rest> | (HasDefault<Shape$1[Key]> extends true ? never : undefined) : never : never : Path extends keyof Shape$1 ? FieldOutput<Shape$1[Path]> | (HasDefault<Shape$1[Path]> extends true ? never : undefined) : never;
|
|
70
|
+
type ValueAtFieldPath<Shape$1 extends SchemaShape, Path extends FieldPath<Shape$1>> = ValueAtPath<Shape$1, Path>;
|
|
71
|
+
type FieldAtPath<Shape$1 extends SchemaShape, Path extends string> = Path extends `${infer Key}.${infer Rest}` ? Key extends keyof Shape$1 ? Shape$1[Key] extends ObjectField<infer NestedShape> ? FieldAtPath<NestedShape, Rest> : never : never : Path extends keyof Shape$1 ? Shape$1[Path] : never;
|
|
72
|
+
type FieldAtFieldPath<Shape$1 extends SchemaShape, Path extends FieldPath<Shape$1>> = FieldAtPath<Shape$1, Path>;
|
|
73
|
+
type InferInput<Value$1 extends StandardSchema> = NonNullable<Value$1['~standard']['types']>['input'];
|
|
74
|
+
type InferOutput<Value$1 extends StandardSchema> = NonNullable<Value$1['~standard']['types']>['output'];
|
|
75
|
+
declare class SchemaError extends Error {
|
|
76
|
+
readonly issues: ReadonlyArray<SchemaIssue>;
|
|
77
|
+
constructor(issues: ReadonlyArray<SchemaIssue>);
|
|
78
|
+
}
|
|
79
|
+
type SchemaJSONSchema = {
|
|
80
|
+
type: FieldToken;
|
|
81
|
+
default?: PrimitiveValue;
|
|
82
|
+
} | {
|
|
83
|
+
type: FieldToken;
|
|
84
|
+
const: PrimitiveValue;
|
|
85
|
+
default?: PrimitiveValue;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'array';
|
|
88
|
+
items: SchemaJSONSchema;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'object';
|
|
91
|
+
properties: Record<string, SchemaJSONSchema>;
|
|
92
|
+
required: string[];
|
|
93
|
+
additionalProperties: false;
|
|
94
|
+
};
|
|
95
|
+
interface BleamSchema<Input, Output> extends StandardSchema<Input, Output> {
|
|
96
|
+
parse(value: unknown): Output;
|
|
97
|
+
safeParse(value: unknown): SchemaResult<Output>;
|
|
98
|
+
toJSONSchema(): Extract<SchemaJSONSchema, {
|
|
99
|
+
type: 'object';
|
|
100
|
+
}>;
|
|
101
|
+
transform<NextOutput>(transform: (value: Output) => NextOutput): BleamSchema<Input, NextOutput>;
|
|
102
|
+
}
|
|
103
|
+
type PrimitiveOptions<Value$1 extends PrimitiveValue> = {
|
|
104
|
+
default: Value$1;
|
|
105
|
+
};
|
|
106
|
+
type FactoryOptions<Value$1> = {
|
|
107
|
+
default: () => Value$1;
|
|
108
|
+
};
|
|
109
|
+
declare function string(): StringField<false>;
|
|
110
|
+
declare function string(options: PrimitiveOptions<string>): StringField<true>;
|
|
111
|
+
declare function number(): NumberField<false>;
|
|
112
|
+
declare function number(options: PrimitiveOptions<number>): NumberField<true>;
|
|
113
|
+
declare function boolean(): BooleanField<false>;
|
|
114
|
+
declare function boolean(options: PrimitiveOptions<boolean>): BooleanField<true>;
|
|
115
|
+
declare function literal<const Value$1 extends PrimitiveValue>(value: Value$1): LiteralField<Value$1, false>;
|
|
116
|
+
declare function literal<const Value$1 extends PrimitiveValue>(value: Value$1, options: PrimitiveOptions<Value$1>): LiteralField<Value$1, true>;
|
|
117
|
+
declare function object<const Shape$1 extends SchemaShape>(shape: Shape$1): ObjectField<Shape$1, false>;
|
|
118
|
+
declare function object<const Shape$1 extends SchemaShape>(shape: Shape$1, options: FactoryOptions<SchemaInput<Shape$1>>): ObjectField<Shape$1, true>;
|
|
119
|
+
declare function array<const Item$1 extends FieldSchema>(item: Item$1): ArrayField<Item$1, false>;
|
|
120
|
+
declare function array<const Item$1 extends FieldSchema>(item: Item$1, options: FactoryOptions<ReadonlyArray<FieldInput<Item$1>>>): ArrayField<Item$1, true>;
|
|
121
|
+
declare function schema<const Shape$1 extends SchemaShape>(shape: Shape$1): BleamSchema<SchemaInput<Shape$1>, SchemaOutput<Shape$1>>;
|
|
122
|
+
declare function getFieldSchema<Shape$1 extends SchemaShape, Path extends FieldPath<Shape$1>>(shape: Shape$1, path: Path): FieldAtFieldPath<Shape$1, Path>;
|
|
123
|
+
declare function getValueAtPath<Shape$1 extends SchemaShape, Path extends FieldPath<Shape$1>>(value: SchemaOutput<Shape$1>, path: Path): ValueAtFieldPath<Shape$1, Path>;
|
|
124
|
+
//#endregion
|
|
125
|
+
export { array as A, SchemaOutput as C, StandardSchema as D, SchemaShape as E, number as F, object as I, schema as L, getFieldSchema as M, getValueAtPath as N, StringField as O, literal as P, string as R, SchemaJSONSchema as S, SchemaResult as T, ObjectField as _, FieldAtFieldPath as a, SchemaInput as b, FieldPath as c, FieldValue as d, InferInput as f, NumberField as g, LiteralField as h, DeepPartial as i, boolean as j, ValueAtFieldPath as k, FieldSchema as l, JSONValue as m, BleamSchema as n, FieldInput as o, InferOutput as p, BooleanField as r, FieldOutput as s, ArrayField as t, FieldToken as u, PrimitiveValue as v, SchemaPatch as w, SchemaIssue as x, SchemaError as y };
|
package/dist/schema.cjs
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
const require_schema = require('./schema-
|
|
1
|
+
const require_schema = require('./schema-BnVZOXfu.cjs');
|
|
2
2
|
|
|
3
3
|
exports.SchemaError = require_schema.SchemaError;
|
|
4
|
-
exports.
|
|
4
|
+
exports.array = require_schema.array;
|
|
5
|
+
exports.boolean = require_schema.boolean;
|
|
6
|
+
exports.getFieldSchema = require_schema.getFieldSchema;
|
|
7
|
+
exports.getValueAtPath = require_schema.getValueAtPath;
|
|
8
|
+
exports.literal = require_schema.literal;
|
|
9
|
+
exports.number = require_schema.number;
|
|
10
|
+
exports.object = require_schema.object;
|
|
11
|
+
exports.schema = require_schema.schema;
|
|
12
|
+
exports.string = require_schema.string;
|
package/dist/schema.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { BleamSchema,
|
|
1
|
+
import { A as array, C as SchemaOutput, D as StandardSchema, E as SchemaShape, F as number, I as object, L as schema, M as getFieldSchema, N as getValueAtPath, O as StringField, P as literal, R as string, S as SchemaJSONSchema, T as SchemaResult, _ as ObjectField, a as FieldAtFieldPath, b as SchemaInput, c as FieldPath, d as FieldValue, f as InferInput, g as NumberField, h as LiteralField, i as DeepPartial, j as boolean, k as ValueAtFieldPath, l as FieldSchema, m as JSONValue, n as BleamSchema, o as FieldInput, p as InferOutput, r as BooleanField, s as FieldOutput, t as ArrayField, u as FieldToken, v as PrimitiveValue, w as SchemaPatch, x as SchemaIssue, y as SchemaError } from "./schema-D5eImHxu.cjs";
|
|
2
|
+
export { ArrayField, BleamSchema, BooleanField, DeepPartial, FieldAtFieldPath, FieldInput, FieldOutput, FieldPath, FieldSchema, FieldToken, FieldValue, InferInput, InferOutput, JSONValue, LiteralField, NumberField, ObjectField, PrimitiveValue, SchemaError, SchemaInput, SchemaIssue, SchemaJSONSchema, SchemaOutput, SchemaPatch, SchemaResult, SchemaShape, StandardSchema, StringField, ValueAtFieldPath, array, boolean, getFieldSchema, getValueAtPath, literal, number, object, schema, string };
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { BleamSchema,
|
|
1
|
+
import { A as array, C as SchemaOutput, D as StandardSchema, E as SchemaShape, F as number, I as object, L as schema, M as getFieldSchema, N as getValueAtPath, O as StringField, P as literal, R as string, S as SchemaJSONSchema, T as SchemaResult, _ as ObjectField, a as FieldAtFieldPath, b as SchemaInput, c as FieldPath, d as FieldValue, f as InferInput, g as NumberField, h as LiteralField, i as DeepPartial, j as boolean, k as ValueAtFieldPath, l as FieldSchema, m as JSONValue, n as BleamSchema, o as FieldInput, p as InferOutput, r as BooleanField, s as FieldOutput, t as ArrayField, u as FieldToken, v as PrimitiveValue, w as SchemaPatch, x as SchemaIssue, y as SchemaError } from "./schema-SSjokbtw.js";
|
|
2
|
+
export { ArrayField, BleamSchema, BooleanField, DeepPartial, FieldAtFieldPath, FieldInput, FieldOutput, FieldPath, FieldSchema, FieldToken, FieldValue, InferInput, InferOutput, JSONValue, LiteralField, NumberField, ObjectField, PrimitiveValue, SchemaError, SchemaInput, SchemaIssue, SchemaJSONSchema, SchemaOutput, SchemaPatch, SchemaResult, SchemaShape, StandardSchema, StringField, ValueAtFieldPath, array, boolean, getFieldSchema, getValueAtPath, literal, number, object, schema, string };
|
package/dist/schema.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as getValueAtPath, c as object, i as getFieldSchema, l as schema, n as array, o as literal, r as boolean, s as number, t as SchemaError, u as string } from "./schema-B5BfdswF.js";
|
|
2
2
|
|
|
3
|
-
export { SchemaError, schema };
|
|
3
|
+
export { SchemaError, array, boolean, getFieldSchema, getValueAtPath, literal, number, object, schema, string };
|