ai.muna.muna 0.0.42

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 (185) hide show
  1. package/Editor/Build/AndroidBuildHandler.cs +96 -0
  2. package/Editor/Build/AndroidBuildHandler.cs.meta +11 -0
  3. package/Editor/Build/BuildHandler.cs +128 -0
  4. package/Editor/Build/BuildHandler.cs.meta +11 -0
  5. package/Editor/Build/LinuxBuildHandler.cs +26 -0
  6. package/Editor/Build/LinuxBuildHandler.cs.meta +11 -0
  7. package/Editor/Build/WebGLBuildHandler.cs +69 -0
  8. package/Editor/Build/WebGLBuildHandler.cs.meta +11 -0
  9. package/Editor/Build/WindowsBuildHandler.cs +24 -0
  10. package/Editor/Build/WindowsBuildHandler.cs.meta +11 -0
  11. package/Editor/Build/iOSBuildHandler.cs +119 -0
  12. package/Editor/Build/iOSBuildHandler.cs.meta +11 -0
  13. package/Editor/Build/macOSBuildHandler.cs +133 -0
  14. package/Editor/Build/macOSBuildHandler.cs.meta +11 -0
  15. package/Editor/Build.meta +8 -0
  16. package/Editor/Muna.Editor.asmdef +18 -0
  17. package/Editor/Muna.Editor.asmdef.meta +7 -0
  18. package/Editor/MunaMenu.cs +32 -0
  19. package/Editor/MunaMenu.cs.meta +11 -0
  20. package/Editor/MunaProjectSettings.cs +43 -0
  21. package/Editor/MunaProjectSettings.cs.meta +11 -0
  22. package/Editor/MunaSettingsProvider.cs +27 -0
  23. package/Editor/MunaSettingsProvider.cs.meta +11 -0
  24. package/Editor.meta +8 -0
  25. package/LICENSE +201 -0
  26. package/LICENSE.meta +7 -0
  27. package/Plugins/Android/Function.aar +0 -0
  28. package/Plugins/Android/Function.aar.meta +32 -0
  29. package/Plugins/Android.meta +8 -0
  30. package/Plugins/Linux/arm64/libFunction.so +0 -0
  31. package/Plugins/Linux/arm64/libFunction.so.meta +62 -0
  32. package/Plugins/Linux/arm64.meta +8 -0
  33. package/Plugins/Linux/x86_64/libFunction.so +0 -0
  34. package/Plugins/Linux/x86_64/libFunction.so.meta +82 -0
  35. package/Plugins/Linux/x86_64.meta +8 -0
  36. package/Plugins/Linux.meta +8 -0
  37. package/Plugins/Web/libFunction.a +0 -0
  38. package/Plugins/Web/libFunction.a.meta +87 -0
  39. package/Plugins/Web.meta +8 -0
  40. package/Plugins/Windows/arm64/Function.dll +0 -0
  41. package/Plugins/Windows/arm64/Function.dll.meta +58 -0
  42. package/Plugins/Windows/arm64.meta +8 -0
  43. package/Plugins/Windows/x86_64/Function.dll +0 -0
  44. package/Plugins/Windows/x86_64/Function.dll.meta +82 -0
  45. package/Plugins/Windows/x86_64.meta +8 -0
  46. package/Plugins/Windows.meta +8 -0
  47. package/Plugins/iOS/Function.xcframework/Info.plist +75 -0
  48. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Function +0 -0
  49. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNConfiguration.h +313 -0
  50. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNPrediction.h +165 -0
  51. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNPredictionStream.h +63 -0
  52. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNPredictor.h +108 -0
  53. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNStatus.h +42 -0
  54. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNValue.h +395 -0
  55. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNValueMap.h +148 -0
  56. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/FXNVersion.h +26 -0
  57. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Headers/Function.h +18 -0
  58. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Info.plist +0 -0
  59. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/Modules/module.modulemap +6 -0
  60. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/PrivacyInfo.xcprivacy +36 -0
  61. package/Plugins/iOS/Function.xcframework/ios-arm64/Function.framework/_CodeSignature/CodeResources +223 -0
  62. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Function +0 -0
  63. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNConfiguration.h +313 -0
  64. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNPrediction.h +165 -0
  65. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNPredictionStream.h +63 -0
  66. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNPredictor.h +108 -0
  67. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNStatus.h +42 -0
  68. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNValue.h +395 -0
  69. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNValueMap.h +148 -0
  70. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/FXNVersion.h +26 -0
  71. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Headers/Function.h +18 -0
  72. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Info.plist +0 -0
  73. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/Modules/module.modulemap +6 -0
  74. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/PrivacyInfo.xcprivacy +36 -0
  75. package/Plugins/iOS/Function.xcframework/ios-arm64_x86_64-simulator/Function.framework/_CodeSignature/CodeResources +223 -0
  76. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Function +0 -0
  77. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNConfiguration.h +313 -0
  78. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNPrediction.h +165 -0
  79. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNPredictionStream.h +63 -0
  80. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNPredictor.h +108 -0
  81. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNStatus.h +42 -0
  82. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNValue.h +395 -0
  83. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNValueMap.h +148 -0
  84. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/FXNVersion.h +26 -0
  85. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Headers/Function.h +18 -0
  86. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Info.plist +0 -0
  87. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/Modules/module.modulemap +6 -0
  88. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/PrivacyInfo.xcprivacy +36 -0
  89. package/Plugins/iOS/Function.xcframework/xros-arm64/Function.framework/_CodeSignature/CodeResources +223 -0
  90. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Function +0 -0
  91. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNConfiguration.h +313 -0
  92. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNPrediction.h +165 -0
  93. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNPredictionStream.h +63 -0
  94. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNPredictor.h +108 -0
  95. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNStatus.h +42 -0
  96. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNValue.h +395 -0
  97. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNValueMap.h +148 -0
  98. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/FXNVersion.h +26 -0
  99. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Headers/Function.h +18 -0
  100. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Info.plist +0 -0
  101. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/Modules/module.modulemap +6 -0
  102. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/PrivacyInfo.xcprivacy +36 -0
  103. package/Plugins/iOS/Function.xcframework/xros-arm64_x86_64-simulator/Function.framework/_CodeSignature/CodeResources +223 -0
  104. package/Plugins/iOS/Function.xcframework.meta +83 -0
  105. package/Plugins/iOS.meta +8 -0
  106. package/Plugins/macOS/Function.dylib +0 -0
  107. package/Plugins/macOS/Function.dylib.meta +82 -0
  108. package/Plugins/macOS.meta +8 -0
  109. package/Plugins.meta +8 -0
  110. package/README.md +79 -0
  111. package/README.md.meta +7 -0
  112. package/Runtime/API/DotNetClient.cs +106 -0
  113. package/Runtime/API/DotNetClient.cs.meta +11 -0
  114. package/Runtime/API/MunaClient.cs +96 -0
  115. package/Runtime/API/MunaClient.cs.meta +11 -0
  116. package/Runtime/API.meta +8 -0
  117. package/Runtime/Beta/BetaClient.cs +33 -0
  118. package/Runtime/Beta/BetaClient.cs.meta +11 -0
  119. package/Runtime/Beta/PredictionService.cs +32 -0
  120. package/Runtime/Beta/PredictionService.cs.meta +11 -0
  121. package/Runtime/Beta/RemoteAcceleration.cs +38 -0
  122. package/Runtime/Beta/RemoteAcceleration.cs.meta +11 -0
  123. package/Runtime/Beta/RemotePredictionService.cs +187 -0
  124. package/Runtime/Beta/RemotePredictionService.cs.meta +11 -0
  125. package/Runtime/Beta/Value.cs +92 -0
  126. package/Runtime/Beta/Value.cs.meta +11 -0
  127. package/Runtime/Beta.meta +8 -0
  128. package/Runtime/C/Configuration.cs +139 -0
  129. package/Runtime/C/Configuration.cs.meta +11 -0
  130. package/Runtime/C/Function.cs +294 -0
  131. package/Runtime/C/Function.cs.meta +11 -0
  132. package/Runtime/C/Prediction.cs +70 -0
  133. package/Runtime/C/Prediction.cs.meta +11 -0
  134. package/Runtime/C/PredictionStream.cs +36 -0
  135. package/Runtime/C/PredictionStream.cs.meta +11 -0
  136. package/Runtime/C/Predictor.cs +42 -0
  137. package/Runtime/C/Predictor.cs.meta +11 -0
  138. package/Runtime/C/Value.cs +194 -0
  139. package/Runtime/C/Value.cs.meta +11 -0
  140. package/Runtime/C/ValueMap.cs +50 -0
  141. package/Runtime/C/ValueMap.cs.meta +11 -0
  142. package/Runtime/C.meta +8 -0
  143. package/Runtime/Muna.Runtime.asmdef +27 -0
  144. package/Runtime/Muna.Runtime.asmdef.meta +7 -0
  145. package/Runtime/Muna.cs +109 -0
  146. package/Runtime/Muna.cs.meta +11 -0
  147. package/Runtime/Services/Prediction.cs +247 -0
  148. package/Runtime/Services/Prediction.cs.meta +11 -0
  149. package/Runtime/Services/Predictor.cs +44 -0
  150. package/Runtime/Services/Predictor.cs.meta +11 -0
  151. package/Runtime/Services/User.cs +43 -0
  152. package/Runtime/Services/User.cs.meta +11 -0
  153. package/Runtime/Services.meta +8 -0
  154. package/Runtime/Types/Dtype.cs +118 -0
  155. package/Runtime/Types/Dtype.cs.meta +11 -0
  156. package/Runtime/Types/Image.cs +93 -0
  157. package/Runtime/Types/Image.cs.meta +11 -0
  158. package/Runtime/Types/Prediction.cs +113 -0
  159. package/Runtime/Types/Prediction.cs.meta +11 -0
  160. package/Runtime/Types/Predictor.cs +193 -0
  161. package/Runtime/Types/Predictor.cs.meta +11 -0
  162. package/Runtime/Types/Tensor.cs +58 -0
  163. package/Runtime/Types/Tensor.cs.meta +11 -0
  164. package/Runtime/Types/User.cs +54 -0
  165. package/Runtime/Types/User.cs.meta +11 -0
  166. package/Runtime/Types.meta +8 -0
  167. package/Runtime.meta +8 -0
  168. package/Unity/API/PredictionCacheClient.cs +144 -0
  169. package/Unity/API/PredictionCacheClient.cs.meta +11 -0
  170. package/Unity/API/UnityClient.cs +147 -0
  171. package/Unity/API/UnityClient.cs.meta +11 -0
  172. package/Unity/API.meta +8 -0
  173. package/Unity/Internal/MunaSettings.cs +59 -0
  174. package/Unity/Internal/MunaSettings.cs.meta +11 -0
  175. package/Unity/Internal.meta +8 -0
  176. package/Unity/Muna.Unity.asmdef +29 -0
  177. package/Unity/Muna.Unity.asmdef.meta +7 -0
  178. package/Unity/MunaUnity.cs +130 -0
  179. package/Unity/MunaUnity.cs.meta +11 -0
  180. package/Unity/Types/CachedPrediction.cs +36 -0
  181. package/Unity/Types/CachedPrediction.cs.meta +11 -0
  182. package/Unity/Types.meta +8 -0
  183. package/Unity.meta +8 -0
  184. package/package.json +38 -0
  185. package/package.json.meta +7 -0
@@ -0,0 +1,395 @@
1
+ //
2
+ // FXNValue.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 5/27/2023.
6
+ // Copyright © 2025 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <stdint.h>
12
+ #include <Function/FXNStatus.h>
13
+
14
+ #pragma region --Enumerations--
15
+ /*!
16
+ @enum FXNDtype
17
+
18
+ @abstract Value data type.
19
+
20
+ @constant FXN_DTYPE_NULL
21
+ Null or undefined.
22
+
23
+ @constant FXN_DTYPE_FLOAT16
24
+ IEEE 754 half precision 16-bit float.
25
+
26
+ @constant FXN_DTYPE_FLOAT32
27
+ IEEE 754 single precision 32-bit float.
28
+
29
+ @constant FXN_DTYPE_FLOAT64
30
+ IEEE 754 double precision 64-bit float.
31
+
32
+ @constant FXN_DTYPE_INT8
33
+ Signed 8-bit integer.
34
+
35
+ @constant FXN_DTYPE_INT16
36
+ Signed 16-bit integer.
37
+
38
+ @constant FXN_DTYPE_INT32
39
+ Signed 32-bit integer.
40
+
41
+ @constant FXN_DTYPE_INT64
42
+ Signed 64-bit integer.
43
+
44
+ @constant FXN_DTYPE_UINT8
45
+ Unsigned 8-bit integer.
46
+
47
+ @constant FXN_DTYPE_UINT16
48
+ Unsigned 16-bit integer.
49
+
50
+ @constant FXN_DTYPE_UINT32
51
+ Unsigned 32-bit integer.
52
+
53
+ @constant FXN_DTYPE_UINT64
54
+ Unsigned 64-bit integer.
55
+
56
+ @constant FXN_DTYPE_BOOL
57
+ 8-bit boolean where zero is `false` and non-zero is `true`.
58
+
59
+ @constant FXN_DTYPE_STRING
60
+ UTF-8 encoded string.
61
+
62
+ @constant FXN_DTYPE_LIST
63
+ JSON-serializable list.
64
+
65
+ @constant FXN_DTYPE_DICT
66
+ JSON-serializable dictionary.
67
+
68
+ @constant FXN_DTYPE_IMAGE
69
+ Pixel buffer with 8 bits per intensity, interleaved by channel.
70
+
71
+ @constant FXN_DTYPE_BINARY
72
+ Binary blob.
73
+
74
+ @constant FXN_DTYPE_BFLOAT16
75
+ 16-bit brain float.
76
+ */
77
+ enum FXNDtype {
78
+ FXN_DTYPE_NULL = 0,
79
+ FXN_DTYPE_FLOAT16 = 1,
80
+ FXN_DTYPE_FLOAT32 = 2,
81
+ FXN_DTYPE_FLOAT64 = 3,
82
+ FXN_DTYPE_INT8 = 4,
83
+ FXN_DTYPE_INT16 = 5,
84
+ FXN_DTYPE_INT32 = 6,
85
+ FXN_DTYPE_INT64 = 7,
86
+ FXN_DTYPE_UINT8 = 8,
87
+ FXN_DTYPE_UINT16 = 9,
88
+ FXN_DTYPE_UINT32 = 10,
89
+ FXN_DTYPE_UINT64 = 11,
90
+ FXN_DTYPE_BOOL = 12,
91
+ FXN_DTYPE_STRING = 13,
92
+ FXN_DTYPE_LIST = 14,
93
+ FXN_DTYPE_DICT = 15,
94
+ FXN_DTYPE_IMAGE = 16,
95
+ FXN_DTYPE_BINARY = 17,
96
+ FXN_DTYPE_BFLOAT16 = 18,
97
+ };
98
+ typedef enum FXNDtype FXNDtype;
99
+
100
+ /*!
101
+ @enum FXNValueFlags
102
+
103
+ @abstract Value flags.
104
+
105
+ @constant FXN_VALUE_FLAG_NONE
106
+ No flags.
107
+
108
+ @constant FXN_VALUE_FLAG_COPY_DATA
109
+ Copy input data when creating the value.
110
+ When this flag is not set, the value data MUST remain valid for the lifetime of the created value.
111
+ */
112
+ enum FXNValueFlags {
113
+ FXN_VALUE_FLAG_NONE = 0,
114
+ FXN_VALUE_FLAG_COPY_DATA = 1,
115
+ };
116
+ typedef enum FXNValueFlags FXNValueFlags;
117
+ #pragma endregion
118
+
119
+
120
+ #pragma region --Types--
121
+ /*!
122
+ @struct FXNValue
123
+
124
+ @abstract Prediction input or output value.
125
+
126
+ @discussion Prediction input or output value.
127
+ */
128
+ struct FXNValue;
129
+ typedef struct FXNValue FXNValue;
130
+ #pragma endregion
131
+
132
+
133
+ #pragma region --Lifecycle--
134
+ /*!
135
+ @function FXNValueRelease
136
+
137
+ @abstract Release a value.
138
+
139
+ @discussion Release a value.
140
+
141
+ @param value
142
+ Value.
143
+ */
144
+ FXN_API FXNStatus FXNValueRelease (FXNValue* value);
145
+ #pragma endregion
146
+
147
+
148
+ #pragma region --Operations--
149
+ /*!
150
+ @function FXNValueGetData
151
+
152
+ @abstract Get the value data.
153
+
154
+ @discussion Get the value data.
155
+
156
+ @param value
157
+ Value.
158
+
159
+ @param data
160
+ Opaque pointer to value data.
161
+ */
162
+ FXN_API FXNStatus FXNValueGetData (
163
+ FXNValue* value,
164
+ void** data
165
+ );
166
+
167
+ /*!
168
+ @function FXNValueGetType
169
+
170
+ @abstract Get the data type of a given value.
171
+
172
+ @discussion Get the data type of a given valuie.
173
+
174
+ @param value
175
+ Value.
176
+
177
+ @param type
178
+ Value data type.
179
+ */
180
+ FXN_API FXNStatus FXNValueGetType (
181
+ FXNValue* value,
182
+ FXNDtype* type
183
+ );
184
+
185
+ /*!
186
+ @function FXNValueGetDimensions
187
+
188
+ @abstract Get the number of dimensions for a given value.
189
+
190
+ @discussion Get the number of dimensions for a given value.
191
+ If the type is not a tensor, this function will return zero.
192
+
193
+ @param value
194
+ Value.
195
+
196
+ @param dimensions
197
+ Number of dimensions for a given value.
198
+ */
199
+ FXN_API FXNStatus FXNValueGetDimensions (
200
+ FXNValue* value,
201
+ int32_t* dimensions
202
+ );
203
+
204
+ /*!
205
+ @function FXNValueGetShape
206
+
207
+ @abstract Get the shape of a given value.
208
+
209
+ @discussion Get the shape of a given value.
210
+
211
+ @param value
212
+ Value.
213
+
214
+ @param shape
215
+ Destination shape array.
216
+
217
+ @param shapeLen
218
+ Length of the destination array in elements.
219
+ */
220
+ FXN_API FXNStatus FXNValueGetShape (
221
+ FXNValue* value,
222
+ int32_t* shape,
223
+ int32_t shapeLen
224
+ );
225
+ #pragma endregion
226
+
227
+
228
+ #pragma region --Constructors--
229
+ /*!
230
+ @function FXNValueCreateArray
231
+
232
+ @abstract Create an array value from a data buffer.
233
+
234
+ @discussion Create an array value from a data buffer.
235
+
236
+ @param data
237
+ Array data.
238
+ Can be `NULL` in which case the value will allocate its own memory.
239
+
240
+ @param shape
241
+ Array shape.
242
+ Can be `NULL` for scalar values.
243
+
244
+ @param dims
245
+ Number of dimensions in `shape`.
246
+ Zero dims indicates a scalar value.
247
+
248
+ @param dtype
249
+ Value data type.
250
+
251
+ @param flags
252
+ Value creation flags.
253
+
254
+ @param value
255
+ Created value.
256
+ */
257
+ FXN_API FXNStatus FXNValueCreateArray (
258
+ void* data,
259
+ const int32_t* shape,
260
+ int32_t dims,
261
+ FXNDtype dtype,
262
+ FXNValueFlags flags,
263
+ FXNValue** value
264
+ );
265
+
266
+ /*!
267
+ @function FXNValueCreateString
268
+
269
+ @abstract Create a string value from a UTF-8 encoded string.
270
+
271
+ @discussion Create a string value from a UTF-8 encoded string.
272
+
273
+ @param data
274
+ UTF-8 encoded string.
275
+
276
+ @param value
277
+ Created value.
278
+ */
279
+ FXN_API FXNStatus FXNValueCreateString (
280
+ const char* data,
281
+ FXNValue** value
282
+ );
283
+
284
+ /*!
285
+ @function FXNValueCreateList
286
+
287
+ @abstract Create a list value from a JSON-encoded list.
288
+
289
+ @discussion Create a list value from a JSON-encoded list.
290
+
291
+ @param data
292
+ JSON-encoded list.
293
+
294
+ @param value
295
+ Created value.
296
+ */
297
+ FXN_API FXNStatus FXNValueCreateList (
298
+ const char* data,
299
+ FXNValue** value
300
+ );
301
+
302
+ /*!
303
+ @function FXNValueCreateDict
304
+
305
+ @abstract Create a dictionary value from a JSON-encoded dictionary.
306
+
307
+ @discussion Create a dictionary value from a JSON-encoded dictionary.
308
+
309
+ @param data
310
+ JSON-encoded dictionary.
311
+
312
+ @param value
313
+ Created value.
314
+ */
315
+ FXN_API FXNStatus FXNValueCreateDict (
316
+ const char* data,
317
+ FXNValue** value
318
+ );
319
+
320
+ /*!
321
+ @function FXNValueCreateImage
322
+
323
+ @abstract Create an image value from a pixel buffer.
324
+
325
+ @discussion Create an image value from a pixel buffer.
326
+ The pixel buffer MUST have an interleaved R8 (8bpp), RGB888 (24bpp), or RGBA8888 layout (32bpp).
327
+
328
+ @param pixelBuffer
329
+ Pixel buffer.
330
+
331
+ @param width
332
+ Pixel buffer width.
333
+
334
+ @param height
335
+ Pixel buffer height.
336
+
337
+ @param channels
338
+ Pixel buffer channels.
339
+ MUST be 1, 3, or 4.
340
+
341
+ @param flags
342
+ Value creation flags.
343
+
344
+ @param value
345
+ Created value.
346
+ The value `type` will be `FXN_DTYPE_IMAGE`.
347
+ The value `shape` will be `(H,W,C)`.
348
+ */
349
+ FXN_API FXNStatus FXNValueCreateImage (
350
+ const uint8_t* pixelBuffer,
351
+ int32_t width,
352
+ int32_t height,
353
+ int32_t channels,
354
+ FXNValueFlags flags,
355
+ FXNValue** value
356
+ );
357
+
358
+ /*!
359
+ @function FXNValueCreateBinary
360
+
361
+ @abstract Create a binary value from a raw buffer.
362
+
363
+ @discussion Create a binary value from a raw buffer.
364
+
365
+ @param buffer
366
+ Buffer.
367
+
368
+ @param bufferLen
369
+ Buffer length in bytes.
370
+
371
+ @param flags
372
+ Value creation flags.
373
+
374
+ @param value
375
+ Created value.
376
+ */
377
+ FXN_API FXNStatus FXNValueCreateBinary (
378
+ void* buffer,
379
+ int32_t bufferLen, // CHECK // max buffer size becomes 2GB
380
+ FXNValueFlags flags,
381
+ FXNValue** value
382
+ );
383
+
384
+ /*!
385
+ @function FXNValueCreateNull
386
+
387
+ @abstract Create a null value.
388
+
389
+ @discussion Create a null value.
390
+
391
+ @param value
392
+ Created value.
393
+ */
394
+ FXN_API FXNStatus FXNValueCreateNull (FXNValue** value);
395
+ #pragma endregion
@@ -0,0 +1,148 @@
1
+ //
2
+ // FXNValueMap.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 10/14/2023.
6
+ // Copyright © 2025 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <stdbool.h>
12
+ #include <Function/FXNValue.h>
13
+
14
+ #pragma region --Types--
15
+ /*!
16
+ @struct FXNValueMap
17
+
18
+ @abstract Predictor value map.
19
+
20
+ @discussion Predictor value map.
21
+ */
22
+ struct FXNValueMap;
23
+ typedef struct FXNValueMap FXNValueMap;
24
+ #pragma endregion
25
+
26
+
27
+ #pragma region --Lifecycle--
28
+ /*!
29
+ @function FXNValueMapCreate
30
+
31
+ @abstract Create a prediction value map.
32
+
33
+ @discussion Create a prediction value map.
34
+
35
+ @param map
36
+ Created value map. MUST NOT be `NULL`.
37
+ */
38
+ FXN_API FXNStatus FXNValueMapCreate (FXNValueMap** map);
39
+
40
+ /*!
41
+ @function FXNValueMapRelease
42
+
43
+ @abstract Release the prediction value map.
44
+
45
+ @discussion Release the prediction value map.
46
+ This releases all values currently within the map.
47
+
48
+ @param map
49
+ Prediction value map.
50
+ */
51
+ FXN_API FXNStatus FXNValueMapRelease (FXNValueMap* map);
52
+ #pragma endregion
53
+
54
+
55
+ #pragma region --Operations--
56
+ /*!
57
+ @function FXNValueMapGetSize
58
+
59
+ @abstract Get the size of the value map.
60
+
61
+ @discussion Get the size of the value map.
62
+
63
+ @param map
64
+ Prediction value map.
65
+
66
+ @param size
67
+ Output size. MUST NOT be `NULL`.
68
+ */
69
+ FXN_API FXNStatus FXNValueMapGetSize (
70
+ FXNValueMap* map,
71
+ int32_t* size
72
+ );
73
+
74
+ /*!
75
+ @function FXNValueMapGetKey
76
+
77
+ @abstract Get the key at a given index in the value map.
78
+
79
+ @discussion Get the key at a given index in the value map.
80
+
81
+ @param map
82
+ Prediction value map.
83
+
84
+ @param index
85
+ Key index. Must be less than the value map size.
86
+
87
+ @param key
88
+ Destination UTF-8 encoded key string.
89
+
90
+ @param size
91
+ Size of destination buffer.
92
+ */
93
+ FXN_API FXNStatus FXNValueMapGetKey (
94
+ FXNValueMap* map,
95
+ int32_t index,
96
+ char* key,
97
+ int32_t size
98
+ );
99
+
100
+ /*!
101
+ @function FXNValueMapGetValue
102
+
103
+ @abstract Get the value for a given key in the value map.
104
+
105
+ @discussion Get the value for a given key in the value map.
106
+
107
+ @param map
108
+ Prediction value map.
109
+
110
+ @param key
111
+ Value key.
112
+
113
+ @param value
114
+ Output value. MUST NOT be `NULL`.
115
+
116
+ @returns `FXN_OK` if the value map contains a value for the given key else `FXN_ERROR_INVALID_ARGUMENT`.
117
+ */
118
+ FXN_API FXNStatus FXNValueMapGetValue (
119
+ FXNValueMap* map,
120
+ const char* key,
121
+ FXNValue** value
122
+ );
123
+
124
+ /*!
125
+ @function FXNValueMapSetValue
126
+
127
+ @abstract Set the value for a given key in the value map.
128
+
129
+ @discussion Set the value for a given key in the value map.
130
+
131
+ NOTE: The value map takes ownership of the value.
132
+ As such, you must not call `FXNValueRelease` on the value.
133
+
134
+ @param map
135
+ Prediction value map.
136
+
137
+ @param key
138
+ Value key.
139
+
140
+ @param value
141
+ Value. Pass `NULL` to remove the value from the map if present.
142
+ */
143
+ FXN_API FXNStatus FXNValueMapSetValue (
144
+ FXNValueMap* map,
145
+ const char* key,
146
+ FXNValue* value
147
+ );
148
+ #pragma endregion
@@ -0,0 +1,26 @@
1
+ //
2
+ // FXNVersion.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 10/14/2023.
6
+ // Copyright © 2025 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <Function/FXNStatus.h>
12
+
13
+ #define FXN_VERSION_MAJOR 0
14
+ #define FXN_VERSION_MINOR 0
15
+ #define FXN_VERSION_PATCH 36
16
+
17
+ /*!
18
+ @function FXNGetVersion
19
+
20
+ @abstract Get the Function version.
21
+
22
+ @discussion Get the Function version.
23
+
24
+ @returns Function version string.
25
+ */
26
+ FXN_API const char* FXNGetVersion ();
@@ -0,0 +1,18 @@
1
+ //
2
+ // Function.h
3
+ // Function
4
+ //
5
+ // Created by Yusuf Olokoba on 5/27/2023.
6
+ // Copyright © 2025 NatML Inc. All rights reserved.
7
+ //
8
+
9
+ #pragma once
10
+
11
+ #include <Function/FXNStatus.h>
12
+ #include <Function/FXNValue.h>
13
+ #include <Function/FXNValueMap.h>
14
+ #include <Function/FXNConfiguration.h>
15
+ #include <Function/FXNPrediction.h>
16
+ #include <Function/FXNPredictionStream.h>
17
+ #include <Function/FXNPredictor.h>
18
+ #include <Function/FXNVersion.h>
@@ -0,0 +1,6 @@
1
+ framework module Function {
2
+ umbrella header "Function.h"
3
+ export *
4
+
5
+ module * { export * }
6
+ }
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>NSPrivacyCollectedDataTypes</key>
6
+ <array>
7
+ <dict>
8
+ <key>NSPrivacyCollectedDataType</key>
9
+ <string>NSPrivacyCollectedDataTypeDeviceID</string>
10
+ <key>NSPrivacyCollectedDataTypeLinked</key>
11
+ <false/>
12
+ <key>NSPrivacyCollectedDataTypeTracking</key>
13
+ <false/>
14
+ <key>NSPrivacyCollectedDataTypePurposes</key>
15
+ <array>
16
+ <string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
17
+ </array>
18
+ </dict>
19
+ </array>
20
+ <key>NSPrivacyAccessedAPITypes</key>
21
+ <array>
22
+ <dict>
23
+ <key>NSPrivacyAccessedAPITypeReasons</key>
24
+ <array>
25
+ <string>35F9.1</string>
26
+ </array>
27
+ <key>NSPrivacyAccessedAPIType</key>
28
+ <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
29
+ </dict>
30
+ </array>
31
+ <key>NSPrivacyTrackingDomains</key>
32
+ <array/>
33
+ <key>NSPrivacyTracking</key>
34
+ <false/>
35
+ </dict>
36
+ </plist>