bleam 0.0.6 → 0.0.8

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 (86) hide show
  1. package/dist/ai.cjs +3984 -25
  2. package/dist/ai.d.cts +503 -20
  3. package/dist/ai.d.ts +503 -20
  4. package/dist/ai.js +3946 -26
  5. package/dist/animated.cjs +1 -1
  6. package/dist/animated.js +1 -1
  7. package/dist/app.cjs +92 -0
  8. package/dist/app.js +92 -0
  9. package/dist/cli.cjs +653 -86
  10. package/dist/cli.d.cts +89 -1
  11. package/dist/cli.d.ts +89 -1
  12. package/dist/cli.js +654 -88
  13. package/dist/{config-ClDGHNb3.d.ts → config-Cms0rvqg.d.ts} +1 -0
  14. package/dist/{config-D3gPaVMb.d.cts → config-CufOVJV3.d.cts} +1 -0
  15. package/dist/config.d.cts +1 -1
  16. package/dist/config.d.ts +1 -1
  17. package/dist/crypto.d.cts +0 -2
  18. package/dist/crypto.d.ts +1 -1
  19. package/dist/dev-protocol.d.cts +14 -1
  20. package/dist/dev-protocol.d.ts +14 -1
  21. package/dist/files-Bo7h9fik.cjs +468 -0
  22. package/dist/files-Ds1wT8C2.js +445 -0
  23. package/dist/files-DwA7pzr3.d.cts +99 -0
  24. package/dist/files-VrkQlKIT.d.ts +99 -0
  25. package/dist/files.cjs +7 -0
  26. package/dist/files.d.cts +2 -0
  27. package/dist/files.d.ts +2 -0
  28. package/dist/files.js +4 -0
  29. package/dist/index.d.cts +1 -1
  30. package/dist/index.d.ts +1 -1
  31. package/dist/native-sqlite-xcGdamRD.js +64 -0
  32. package/dist/native-sqlite-yQLD5s9i.cjs +66 -0
  33. package/dist/platform.cjs +27 -0
  34. package/dist/platform.d.cts +39 -0
  35. package/dist/platform.d.ts +39 -0
  36. package/dist/platform.js +21 -0
  37. package/dist/runtime.d.cts +1 -6
  38. package/dist/runtime.d.ts +1 -6
  39. package/dist/{schema-ipsECAso.d.ts → schema-DOOjfXvs.d.ts} +1 -1
  40. package/dist/{schema-BOuUHcqo.d.cts → schema-ENSMX_1t.d.cts} +1 -1
  41. package/dist/schema.cjs +1 -1
  42. package/dist/schema.d.cts +1 -1
  43. package/dist/schema.d.ts +1 -1
  44. package/dist/schema.js +1 -1
  45. package/dist/state-Bx0VlTlO.cjs +852 -0
  46. package/dist/state-CAwe-Vw1.js +767 -0
  47. package/dist/state.cjs +17 -763
  48. package/dist/state.d.cts +107 -77
  49. package/dist/state.d.ts +107 -77
  50. package/dist/state.js +4 -745
  51. package/dist/ui-1WepaMS4.d.cts +92 -0
  52. package/dist/ui-Ce-pnUUA.d.ts +92 -0
  53. package/dist/ui.cjs +286 -35
  54. package/dist/ui.d.cts +2 -30
  55. package/dist/ui.d.ts +2 -30
  56. package/dist/ui.js +283 -36
  57. package/dist/window.cjs +596 -0
  58. package/dist/window.d.cts +63 -0
  59. package/dist/window.d.ts +63 -0
  60. package/dist/window.js +589 -0
  61. package/package.json +16 -14
  62. package/templates/basic/app/index.tsx +8 -5
  63. package/templates/foundation-models/app/index.tsx +32 -0
  64. package/templates/foundation-models/app.config.ts +5 -0
  65. package/templates/image-generation/app/index.tsx +39 -0
  66. package/templates/image-generation/app.config.ts +5 -0
  67. package/templates/state/app/index.tsx +30 -0
  68. package/templates/state/app.config.ts +5 -0
  69. package/dist/chrome.cjs +0 -265
  70. package/dist/chrome.d.cts +0 -19
  71. package/dist/chrome.d.ts +0 -19
  72. package/dist/chrome.js +0 -262
  73. package/dist/fs.cjs +0 -13
  74. package/dist/fs.d.cts +0 -8
  75. package/dist/fs.d.ts +0 -8
  76. package/dist/fs.js +0 -12
  77. package/dist/native-macos-D6p2SmUj.js +0 -20
  78. package/dist/native-macos-DLwo_ii9.cjs +0 -31
  79. package/dist/native-runtime-CbPzrs8j.d.cts +0 -33
  80. package/dist/native-runtime-DxHSrsTX.d.ts +0 -33
  81. package/dist/native.cjs +0 -135
  82. package/dist/native.d.cts +0 -34
  83. package/dist/native.d.ts +0 -34
  84. package/dist/native.js +0 -135
  85. /package/dist/{schema-DVmoD9JL.js → schema-Bo5Jvqus.js} +0 -0
  86. /package/dist/{schema-bxeeCyLn.cjs → schema-rQ13mrpD.cjs} +0 -0
@@ -0,0 +1,64 @@
1
+ import "./native-runtime-C85Nuc4F.js";
2
+ import { openOrCreate } from "@nativescript-community/sqlite";
3
+
4
+ //#region src/native-sqlite.ts
5
+ const databases = /* @__PURE__ */ new Map();
6
+ function documentsDirectory() {
7
+ const path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.Document, NSSearchPathDomainMask.UserDomain, true).objectAtIndex(0);
8
+ if (!path) throw new Error("Could not resolve documents directory");
9
+ return String(path);
10
+ }
11
+ function ensureDirectory(path) {
12
+ const fileManager = NSFileManager.defaultManager;
13
+ if (fileManager.fileExistsAtPath(path)) return;
14
+ fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(path, true, null, null);
15
+ }
16
+ function databasePath(name) {
17
+ const directory = `${documentsDirectory()}/bleam`;
18
+ ensureDirectory(directory);
19
+ return `${directory}/${name}`;
20
+ }
21
+ function toPluginParameters(parameters) {
22
+ return parameters;
23
+ }
24
+ function toSQLiteValue(value) {
25
+ if (typeof value === "string" || typeof value === "number" || value === null) return value;
26
+ throw new Error("SQLite blobs are not supported by Bleam state yet");
27
+ }
28
+ function toSQLiteRow(row) {
29
+ const output = {};
30
+ for (const [key, value] of Object.entries(row)) output[key] = toSQLiteValue(value);
31
+ return output;
32
+ }
33
+ var NativeSQLiteDatabase = class {
34
+ constructor(database) {
35
+ this.database = database;
36
+ }
37
+ execute(query, parameters) {
38
+ return this.database.execute(query, toPluginParameters(parameters));
39
+ }
40
+ async select(query, parameters) {
41
+ return (await this.database.select(query, toPluginParameters(parameters))).map(toSQLiteRow);
42
+ }
43
+ async get(query, parameters) {
44
+ const row = await this.database.get(query, toPluginParameters(parameters));
45
+ return row ? toSQLiteRow(row) : void 0;
46
+ }
47
+ transaction(action) {
48
+ return this.database.transaction(action);
49
+ }
50
+ close() {
51
+ this.database.close();
52
+ }
53
+ };
54
+ function openNativeSQLiteDatabase(name = "bleam.sqlite3") {
55
+ const path = databasePath(name);
56
+ const existing = databases.get(path);
57
+ if (existing) return new NativeSQLiteDatabase(existing);
58
+ const database = openOrCreate(path);
59
+ databases.set(path, database);
60
+ return new NativeSQLiteDatabase(database);
61
+ }
62
+
63
+ //#endregion
64
+ export { NativeSQLiteDatabase, openNativeSQLiteDatabase };
@@ -0,0 +1,66 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ require('./native-runtime-CsXnXkQn.cjs');
3
+ let __nativescript_community_sqlite = require("@nativescript-community/sqlite");
4
+ __nativescript_community_sqlite = require_chunk.__toESM(__nativescript_community_sqlite);
5
+
6
+ //#region src/native-sqlite.ts
7
+ const databases = /* @__PURE__ */ new Map();
8
+ function documentsDirectory() {
9
+ const path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.Document, NSSearchPathDomainMask.UserDomain, true).objectAtIndex(0);
10
+ if (!path) throw new Error("Could not resolve documents directory");
11
+ return String(path);
12
+ }
13
+ function ensureDirectory(path) {
14
+ const fileManager = NSFileManager.defaultManager;
15
+ if (fileManager.fileExistsAtPath(path)) return;
16
+ fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(path, true, null, null);
17
+ }
18
+ function databasePath(name) {
19
+ const directory = `${documentsDirectory()}/bleam`;
20
+ ensureDirectory(directory);
21
+ return `${directory}/${name}`;
22
+ }
23
+ function toPluginParameters(parameters) {
24
+ return parameters;
25
+ }
26
+ function toSQLiteValue(value) {
27
+ if (typeof value === "string" || typeof value === "number" || value === null) return value;
28
+ throw new Error("SQLite blobs are not supported by Bleam state yet");
29
+ }
30
+ function toSQLiteRow(row) {
31
+ const output = {};
32
+ for (const [key, value] of Object.entries(row)) output[key] = toSQLiteValue(value);
33
+ return output;
34
+ }
35
+ var NativeSQLiteDatabase = class {
36
+ constructor(database) {
37
+ this.database = database;
38
+ }
39
+ execute(query, parameters) {
40
+ return this.database.execute(query, toPluginParameters(parameters));
41
+ }
42
+ async select(query, parameters) {
43
+ return (await this.database.select(query, toPluginParameters(parameters))).map(toSQLiteRow);
44
+ }
45
+ async get(query, parameters) {
46
+ const row = await this.database.get(query, toPluginParameters(parameters));
47
+ return row ? toSQLiteRow(row) : void 0;
48
+ }
49
+ transaction(action) {
50
+ return this.database.transaction(action);
51
+ }
52
+ close() {
53
+ this.database.close();
54
+ }
55
+ };
56
+ function openNativeSQLiteDatabase(name = "bleam.sqlite3") {
57
+ const path = databasePath(name);
58
+ const existing = databases.get(path);
59
+ if (existing) return new NativeSQLiteDatabase(existing);
60
+ const database = (0, __nativescript_community_sqlite.openOrCreate)(path);
61
+ databases.set(path, database);
62
+ return new NativeSQLiteDatabase(database);
63
+ }
64
+
65
+ //#endregion
66
+ exports.openNativeSQLiteDatabase = openNativeSQLiteDatabase;
@@ -0,0 +1,27 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ let expo = require("expo");
3
+ expo = require_chunk.__toESM(expo);
4
+
5
+ //#region src/platform.ts
6
+ function getHelperStatus() {
7
+ return (0, expo.requireNativeModule)("Platform").helperStatus();
8
+ }
9
+ function downloadPlatformUpdate() {
10
+ return (0, expo.requireNativeModule)("Platform").downloadPlatformUpdate();
11
+ }
12
+ function updateAndRelaunch(releaseId) {
13
+ return (0, expo.requireNativeModule)("Platform").updateAndRelaunch(releaseId);
14
+ }
15
+ function getPermissionState(capability) {
16
+ return (0, expo.requireNativeModule)("Platform").permissionState(capability);
17
+ }
18
+ function getPermissionStates() {
19
+ return (0, expo.requireNativeModule)("Platform").permissionStates();
20
+ }
21
+
22
+ //#endregion
23
+ exports.downloadPlatformUpdate = downloadPlatformUpdate;
24
+ exports.getHelperStatus = getHelperStatus;
25
+ exports.getPermissionState = getPermissionState;
26
+ exports.getPermissionStates = getPermissionStates;
27
+ exports.updateAndRelaunch = updateAndRelaunch;
@@ -0,0 +1,39 @@
1
+ //#region src/platform.d.ts
2
+ type HelperCapability = 'platform-updates';
3
+ type PermissionCapability = 'camera' | 'microphone' | 'photos' | 'contacts' | 'calendars' | 'reminders' | 'location';
4
+ type PermissionStatus = 'not-determined' | 'denied' | 'restricted' | 'limited' | 'granted' | 'unsupported';
5
+ interface PermissionState {
6
+ capability: PermissionCapability;
7
+ status: PermissionStatus;
8
+ granted: boolean;
9
+ canAskAgain: boolean;
10
+ expires: 'never';
11
+ }
12
+ interface HelperStatus {
13
+ healthy: boolean;
14
+ protocolVersion: 1;
15
+ helperVersion: string;
16
+ platformVersion: string;
17
+ capabilities: HelperCapability[];
18
+ updatesSupported: boolean;
19
+ installPath: string;
20
+ reason?: 'reinstall_required';
21
+ }
22
+ interface PlatformDownload {
23
+ releaseId: string;
24
+ appVersion: string;
25
+ buildNumber: string;
26
+ platformVersion: string;
27
+ artifactPath: string;
28
+ appPath: string;
29
+ sizeBytes: number;
30
+ sha256: string;
31
+ verified: true;
32
+ }
33
+ declare function getHelperStatus(): Promise<HelperStatus>;
34
+ declare function downloadPlatformUpdate(): Promise<PlatformDownload>;
35
+ declare function updateAndRelaunch(releaseId: string): Promise<void>;
36
+ declare function getPermissionState(capability: PermissionCapability): Promise<PermissionState>;
37
+ declare function getPermissionStates(): Promise<PermissionState[]>;
38
+ //#endregion
39
+ export { HelperCapability, HelperStatus, PermissionCapability, PermissionState, PermissionStatus, PlatformDownload, downloadPlatformUpdate, getHelperStatus, getPermissionState, getPermissionStates, updateAndRelaunch };
@@ -0,0 +1,39 @@
1
+ //#region src/platform.d.ts
2
+ type HelperCapability = 'platform-updates';
3
+ type PermissionCapability = 'camera' | 'microphone' | 'photos' | 'contacts' | 'calendars' | 'reminders' | 'location';
4
+ type PermissionStatus = 'not-determined' | 'denied' | 'restricted' | 'limited' | 'granted' | 'unsupported';
5
+ interface PermissionState {
6
+ capability: PermissionCapability;
7
+ status: PermissionStatus;
8
+ granted: boolean;
9
+ canAskAgain: boolean;
10
+ expires: 'never';
11
+ }
12
+ interface HelperStatus {
13
+ healthy: boolean;
14
+ protocolVersion: 1;
15
+ helperVersion: string;
16
+ platformVersion: string;
17
+ capabilities: HelperCapability[];
18
+ updatesSupported: boolean;
19
+ installPath: string;
20
+ reason?: 'reinstall_required';
21
+ }
22
+ interface PlatformDownload {
23
+ releaseId: string;
24
+ appVersion: string;
25
+ buildNumber: string;
26
+ platformVersion: string;
27
+ artifactPath: string;
28
+ appPath: string;
29
+ sizeBytes: number;
30
+ sha256: string;
31
+ verified: true;
32
+ }
33
+ declare function getHelperStatus(): Promise<HelperStatus>;
34
+ declare function downloadPlatformUpdate(): Promise<PlatformDownload>;
35
+ declare function updateAndRelaunch(releaseId: string): Promise<void>;
36
+ declare function getPermissionState(capability: PermissionCapability): Promise<PermissionState>;
37
+ declare function getPermissionStates(): Promise<PermissionState[]>;
38
+ //#endregion
39
+ export { HelperCapability, HelperStatus, PermissionCapability, PermissionState, PermissionStatus, PlatformDownload, downloadPlatformUpdate, getHelperStatus, getPermissionState, getPermissionStates, updateAndRelaunch };
@@ -0,0 +1,21 @@
1
+ import { requireNativeModule } from "expo";
2
+
3
+ //#region src/platform.ts
4
+ function getHelperStatus() {
5
+ return requireNativeModule("Platform").helperStatus();
6
+ }
7
+ function downloadPlatformUpdate() {
8
+ return requireNativeModule("Platform").downloadPlatformUpdate();
9
+ }
10
+ function updateAndRelaunch(releaseId) {
11
+ return requireNativeModule("Platform").updateAndRelaunch(releaseId);
12
+ }
13
+ function getPermissionState(capability) {
14
+ return requireNativeModule("Platform").permissionState(capability);
15
+ }
16
+ function getPermissionStates() {
17
+ return requireNativeModule("Platform").permissionStates();
18
+ }
19
+
20
+ //#endregion
21
+ export { downloadPlatformUpdate, getHelperStatus, getPermissionState, getPermissionStates, updateAndRelaunch };
@@ -1,13 +1,8 @@
1
1
  //#region src/runtime.d.ts
2
- interface RuntimeCapability {
3
- name: string;
4
- version?: string;
5
- }
6
2
  interface RuntimeSession {
7
3
  id: string;
8
4
  projectName: string;
9
5
  manifestUrl: string;
10
- capabilities: RuntimeCapability[];
11
6
  }
12
7
  //#endregion
13
- export { RuntimeCapability, RuntimeSession };
8
+ export { RuntimeSession };
package/dist/runtime.d.ts CHANGED
@@ -1,13 +1,8 @@
1
1
  //#region src/runtime.d.ts
2
- interface RuntimeCapability {
3
- name: string;
4
- version?: string;
5
- }
6
2
  interface RuntimeSession {
7
3
  id: string;
8
4
  projectName: string;
9
5
  manifestUrl: string;
10
- capabilities: RuntimeCapability[];
11
6
  }
12
7
  //#endregion
13
- export { RuntimeCapability, RuntimeSession };
8
+ export { RuntimeSession };
@@ -19,7 +19,7 @@ type SchemaResult<Output> = {
19
19
  interface StandardSchema<Input = unknown, Output = Input> {
20
20
  readonly '~standard': {
21
21
  readonly version: 1;
22
- readonly vendor: 'bleam';
22
+ readonly vendor: string;
23
23
  readonly validate: (value: unknown) => SchemaResult<Output>;
24
24
  readonly types?: {
25
25
  readonly input: Input;
@@ -19,7 +19,7 @@ type SchemaResult<Output> = {
19
19
  interface StandardSchema<Input = unknown, Output = Input> {
20
20
  readonly '~standard': {
21
21
  readonly version: 1;
22
- readonly vendor: 'bleam';
22
+ readonly vendor: string;
23
23
  readonly validate: (value: unknown) => SchemaResult<Output>;
24
24
  readonly types?: {
25
25
  readonly input: Input;
package/dist/schema.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_schema = require('./schema-bxeeCyLn.cjs');
1
+ const require_schema = require('./schema-rQ13mrpD.cjs');
2
2
 
3
3
  exports.SchemaError = require_schema.SchemaError;
4
4
  exports.schema = require_schema.schema;
package/dist/schema.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as FieldValue, c as SchemaError, d as SchemaJSONSchema, f as SchemaOutput, g as schema, h as StandardSchema, i as FieldToken, l as SchemaInput, m as SchemaShape, n as FieldDefault, o as InferInput, p as SchemaResult, r as FieldSchema, s as InferOutput, t as BleamSchema, u as SchemaIssue } from "./schema-BOuUHcqo.cjs";
1
+ import { a as FieldValue, c as SchemaError, d as SchemaJSONSchema, f as SchemaOutput, g as schema, h as StandardSchema, i as FieldToken, l as SchemaInput, m as SchemaShape, n as FieldDefault, o as InferInput, p as SchemaResult, r as FieldSchema, s as InferOutput, t as BleamSchema, u as SchemaIssue } from "./schema-ENSMX_1t.cjs";
2
2
  export { BleamSchema, FieldDefault, FieldSchema, FieldToken, FieldValue, InferInput, InferOutput, SchemaError, SchemaInput, SchemaIssue, SchemaJSONSchema, SchemaOutput, SchemaResult, SchemaShape, StandardSchema, schema };
package/dist/schema.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as FieldValue, c as SchemaError, d as SchemaJSONSchema, f as SchemaOutput, g as schema, h as StandardSchema, i as FieldToken, l as SchemaInput, m as SchemaShape, n as FieldDefault, o as InferInput, p as SchemaResult, r as FieldSchema, s as InferOutput, t as BleamSchema, u as SchemaIssue } from "./schema-ipsECAso.js";
1
+ import { a as FieldValue, c as SchemaError, d as SchemaJSONSchema, f as SchemaOutput, g as schema, h as StandardSchema, i as FieldToken, l as SchemaInput, m as SchemaShape, n as FieldDefault, o as InferInput, p as SchemaResult, r as FieldSchema, s as InferOutput, t as BleamSchema, u as SchemaIssue } from "./schema-DOOjfXvs.js";
2
2
  export { BleamSchema, FieldDefault, FieldSchema, FieldToken, FieldValue, InferInput, InferOutput, SchemaError, SchemaInput, SchemaIssue, SchemaJSONSchema, SchemaOutput, SchemaResult, SchemaShape, StandardSchema, schema };
package/dist/schema.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as schema, t as SchemaError } from "./schema-DVmoD9JL.js";
1
+ import { n as schema, t as SchemaError } from "./schema-Bo5Jvqus.js";
2
2
 
3
3
  export { SchemaError, schema };