@xybrid/react-native 0.10.0-rc1
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/LICENSE +201 -0
- package/README.md +298 -0
- package/android/build.gradle +61 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/ai/xybrid/reactnative/XybridCodec.kt +481 -0
- package/android/src/main/java/ai/xybrid/reactnative/XybridHandles.kt +139 -0
- package/android/src/main/java/ai/xybrid/reactnative/XybridModule.kt +665 -0
- package/android/src/main/java/ai/xybrid/reactnative/XybridPackage.kt +27 -0
- package/ios/XybridCodec.swift +508 -0
- package/ios/XybridHandles.swift +191 -0
- package/ios/XybridModule.mm +494 -0
- package/ios/XybridModuleImpl.swift +887 -0
- package/ios/XybridSwift/Xybrid.swift +1401 -0
- package/ios/XybridSwift/xybrid_bolt.swift +3198 -0
- package/ios/xybrid_natives.rb +178 -0
- package/lib/commonjs/NativeXybrid.js +24 -0
- package/lib/commonjs/base64.js +45 -0
- package/lib/commonjs/cancel.js +35 -0
- package/lib/commonjs/context.js +67 -0
- package/lib/commonjs/envelope.js +79 -0
- package/lib/commonjs/errors.js +61 -0
- package/lib/commonjs/index.js +59 -0
- package/lib/commonjs/model.js +307 -0
- package/lib/commonjs/pipeline.js +55 -0
- package/lib/commonjs/presets.js +32 -0
- package/lib/commonjs/session.js +76 -0
- package/lib/commonjs/types.js +10 -0
- package/lib/commonjs/wire.js +285 -0
- package/lib/commonjs/xybrid.js +133 -0
- package/lib/module/NativeXybrid.js +22 -0
- package/lib/module/base64.js +41 -0
- package/lib/module/cancel.js +29 -0
- package/lib/module/context.js +60 -0
- package/lib/module/envelope.js +73 -0
- package/lib/module/errors.js +56 -0
- package/lib/module/index.js +36 -0
- package/lib/module/model.js +298 -0
- package/lib/module/pipeline.js +48 -0
- package/lib/module/presets.js +27 -0
- package/lib/module/session.js +69 -0
- package/lib/module/types.js +9 -0
- package/lib/module/wire.js +271 -0
- package/lib/module/xybrid.js +127 -0
- package/lib/typescript/NativeXybrid.d.ts +68 -0
- package/lib/typescript/NativeXybrid.d.ts.map +1 -0
- package/lib/typescript/base64.d.ts +5 -0
- package/lib/typescript/base64.d.ts.map +1 -0
- package/lib/typescript/cancel.d.ts +24 -0
- package/lib/typescript/cancel.d.ts.map +1 -0
- package/lib/typescript/context.d.ts +40 -0
- package/lib/typescript/context.d.ts.map +1 -0
- package/lib/typescript/envelope.d.ts +51 -0
- package/lib/typescript/envelope.d.ts.map +1 -0
- package/lib/typescript/errors.d.ts +12 -0
- package/lib/typescript/errors.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +28 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/model.d.ts +211 -0
- package/lib/typescript/model.d.ts.map +1 -0
- package/lib/typescript/pipeline.d.ts +35 -0
- package/lib/typescript/pipeline.d.ts.map +1 -0
- package/lib/typescript/presets.d.ts +21 -0
- package/lib/typescript/presets.d.ts.map +1 -0
- package/lib/typescript/session.d.ts +50 -0
- package/lib/typescript/session.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +313 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/wire.d.ts +130 -0
- package/lib/typescript/wire.d.ts.map +1 -0
- package/lib/typescript/xybrid.d.ts +89 -0
- package/lib/typescript/xybrid.d.ts.map +1 -0
- package/package.json +88 -0
- package/react-native-xybrid.podspec +50 -0
- package/src/NativeXybrid.ts +131 -0
- package/src/base64.ts +43 -0
- package/src/cancel.ts +47 -0
- package/src/context.ts +70 -0
- package/src/envelope.ts +115 -0
- package/src/errors.ts +67 -0
- package/src/index.ts +91 -0
- package/src/model.ts +408 -0
- package/src/pipeline.ts +66 -0
- package/src/presets.ts +36 -0
- package/src/session.ts +76 -0
- package/src/types.ts +362 -0
- package/src/wire.ts +408 -0
- package/src/xybrid.ts +176 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
#import <RNXybridSpec/RNXybridSpec.h>
|
|
2
|
+
#import "react_native_xybrid-Swift.h"
|
|
3
|
+
|
|
4
|
+
// Thin ObjC++ forwarder: Codegen dispatches JS calls by the selectors of the
|
|
5
|
+
// generated `NativeXybridSpec` protocol, and each one below hands its
|
|
6
|
+
// arguments unchanged to the Swift `XybridModuleImpl`, which has the same
|
|
7
|
+
// selector. The split exists because the protocol header is ObjC++ (Swift
|
|
8
|
+
// cannot import it) and `getTurboModule:` returns a C++ type.
|
|
9
|
+
//
|
|
10
|
+
// Every selector must match the generated protocol exactly — a mismatch
|
|
11
|
+
// compiles (as a warning) but crashes at the first call, since the TurboModule
|
|
12
|
+
// builds an NSInvocation from the protocol's selector. The podspec makes that
|
|
13
|
+
// warning an error and tests/spec-conformance.test.mjs checks the list
|
|
14
|
+
// against src/NativeXybrid.ts. New Architecture only.
|
|
15
|
+
//
|
|
16
|
+
// There is deliberately no public header: the Codegen header is ObjC++, and
|
|
17
|
+
// a public header importing it would land in the pod's umbrella header, which
|
|
18
|
+
// Swift then fails to import ("This file must be compiled as Obj-C++").
|
|
19
|
+
|
|
20
|
+
@interface XybridModule : NSObject <NativeXybridSpec>
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
@implementation XybridModule {
|
|
24
|
+
XybridModuleImpl *_impl;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// React Native 0.77+ finds the module through `codegenConfig.ios.modulesProvider`
|
|
28
|
+
// in package.json; RCT_EXPORT_MODULE keeps 0.76 working.
|
|
29
|
+
RCT_EXPORT_MODULE(RNXybrid)
|
|
30
|
+
|
|
31
|
+
+ (BOOL)requiresMainQueueSetup
|
|
32
|
+
{
|
|
33
|
+
return NO;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (instancetype)init
|
|
37
|
+
{
|
|
38
|
+
if ((self = [super init])) {
|
|
39
|
+
_impl = [XybridModuleImpl new];
|
|
40
|
+
}
|
|
41
|
+
return self;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
45
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
46
|
+
{
|
|
47
|
+
return std::make_shared<facebook::react::NativeXybridSpecJSI>(params);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Reload / teardown: stop in-flight work and free every native object.
|
|
51
|
+
- (void)invalidate
|
|
52
|
+
{
|
|
53
|
+
[_impl invalidate];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
- (void)initialize:(NSDictionary * _Nullable)options
|
|
57
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
58
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
59
|
+
{
|
|
60
|
+
[_impl initialize:options resolve:resolve reject:reject];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
- (void)sdkVersion:(RCTPromiseResolveBlock)resolve
|
|
64
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
65
|
+
{
|
|
66
|
+
[_impl sdkVersion:resolve reject:reject];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
- (void)hasApiKey:(RCTPromiseResolveBlock)resolve
|
|
70
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
71
|
+
{
|
|
72
|
+
[_impl hasApiKey:resolve reject:reject];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
- (void)setProviderApiKey:(NSString *)provider
|
|
76
|
+
apiKey:(NSString *)apiKey
|
|
77
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
78
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
79
|
+
{
|
|
80
|
+
[_impl setProviderApiKey:provider apiKey:apiKey resolve:resolve reject:reject];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
- (void)setPlatformUrl:(NSString *)url
|
|
84
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
85
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
86
|
+
{
|
|
87
|
+
[_impl setPlatformUrl:url resolve:resolve reject:reject];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
- (void)setSpeculativeCloud:(BOOL)enabled
|
|
91
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
92
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
93
|
+
{
|
|
94
|
+
[_impl setSpeculativeCloud:enabled resolve:resolve reject:reject];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
- (void)isSpeculativeCloudEnabled:(RCTPromiseResolveBlock)resolve
|
|
98
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
99
|
+
{
|
|
100
|
+
[_impl isSpeculativeCloudEnabled:resolve reject:reject];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
- (void)willSpeculate:(NSString *)modelId
|
|
104
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
105
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
106
|
+
{
|
|
107
|
+
[_impl willSpeculate:modelId resolve:resolve reject:reject];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
- (void)releaseMemory:(RCTPromiseResolveBlock)resolve
|
|
111
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
112
|
+
{
|
|
113
|
+
[_impl releaseMemory:resolve reject:reject];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
- (void)setAutoRelease:(BOOL)enabled
|
|
117
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
118
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
119
|
+
{
|
|
120
|
+
[_impl setAutoRelease:enabled resolve:resolve reject:reject];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
- (void)isAutoReleaseEnabled:(RCTPromiseResolveBlock)resolve
|
|
124
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
125
|
+
{
|
|
126
|
+
[_impl isAutoReleaseEnabled:resolve reject:reject];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
- (void)setBatteryLevel:(double)percent
|
|
130
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
131
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
132
|
+
{
|
|
133
|
+
[_impl setBatteryLevel:percent resolve:resolve reject:reject];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
- (void)clearBatteryLevel:(RCTPromiseResolveBlock)resolve
|
|
137
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
138
|
+
{
|
|
139
|
+
[_impl clearBatteryLevel:resolve reject:reject];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
- (void)setThermalState:(NSString *)state
|
|
143
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
144
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
145
|
+
{
|
|
146
|
+
[_impl setThermalState:state resolve:resolve reject:reject];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
- (void)clearThermalState:(RCTPromiseResolveBlock)resolve
|
|
150
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
151
|
+
{
|
|
152
|
+
[_impl clearThermalState:resolve reject:reject];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
- (void)cacheStatus:(RCTPromiseResolveBlock)resolve
|
|
156
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
157
|
+
{
|
|
158
|
+
[_impl cacheStatus:resolve reject:reject];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
- (void)cacheEntries:(RCTPromiseResolveBlock)resolve
|
|
162
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
163
|
+
{
|
|
164
|
+
[_impl cacheEntries:resolve reject:reject];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
- (void)cacheIsModelCached:(NSString *)modelId
|
|
168
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
169
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
170
|
+
{
|
|
171
|
+
[_impl cacheIsModelCached:modelId resolve:resolve reject:reject];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
- (void)cacheModelPath:(NSString *)modelId
|
|
175
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
176
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
177
|
+
{
|
|
178
|
+
[_impl cacheModelPath:modelId resolve:resolve reject:reject];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
- (void)cacheExtractedModelIds:(RCTPromiseResolveBlock)resolve
|
|
182
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
183
|
+
{
|
|
184
|
+
[_impl cacheExtractedModelIds:resolve reject:reject];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
- (void)cacheRemoveModel:(NSString *)modelId
|
|
188
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
189
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
190
|
+
{
|
|
191
|
+
[_impl cacheRemoveModel:modelId resolve:resolve reject:reject];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
- (void)cacheClear:(RCTPromiseResolveBlock)resolve
|
|
195
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
196
|
+
{
|
|
197
|
+
[_impl cacheClear:resolve reject:reject];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
- (void)jsonSchemaToGbnf:(NSString *)schemaJson
|
|
201
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
202
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
203
|
+
{
|
|
204
|
+
[_impl jsonSchemaToGbnf:schemaJson resolve:resolve reject:reject];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
- (void)toolResultsEnvelope:(NSString *)userText
|
|
208
|
+
priorAssistantText:(NSString *)priorAssistantText
|
|
209
|
+
results:(NSArray *)results
|
|
210
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
211
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
212
|
+
{
|
|
213
|
+
[_impl toolResultsEnvelope:userText priorAssistantText:priorAssistantText results:results resolve:resolve reject:reject];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
- (void)dispose:(NSString *)handle
|
|
217
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
218
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
219
|
+
{
|
|
220
|
+
[_impl dispose:handle resolve:resolve reject:reject];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
- (void)loadModel:(NSDictionary *)source
|
|
224
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
225
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
226
|
+
{
|
|
227
|
+
[_impl loadModel:source resolve:resolve reject:reject];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
- (void)modelInfo:(NSString *)model
|
|
231
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
232
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
233
|
+
{
|
|
234
|
+
[_impl modelInfo:model resolve:resolve reject:reject];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
- (void)isLoaded:(NSString *)model
|
|
238
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
239
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
240
|
+
{
|
|
241
|
+
[_impl isLoaded:model resolve:resolve reject:reject];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
- (void)warmup:(NSString *)model
|
|
245
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
246
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
247
|
+
{
|
|
248
|
+
[_impl warmup:model resolve:resolve reject:reject];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
- (void)unload:(NSString *)model
|
|
252
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
253
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
254
|
+
{
|
|
255
|
+
[_impl unload:model resolve:resolve reject:reject];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
- (void)isCloudServing:(NSString *)model
|
|
259
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
260
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
261
|
+
{
|
|
262
|
+
[_impl isCloudServing:model resolve:resolve reject:reject];
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
- (void)downloadStatus:(NSString *)model
|
|
266
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
267
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
268
|
+
{
|
|
269
|
+
[_impl downloadStatus:model resolve:resolve reject:reject];
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
- (void)awaitDownload:(NSString *)model
|
|
273
|
+
timeoutMs:(double)timeoutMs
|
|
274
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
275
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
276
|
+
{
|
|
277
|
+
[_impl awaitDownload:model timeoutMs:timeoutMs resolve:resolve reject:reject];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
- (void)voices:(NSString *)model
|
|
281
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
282
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
283
|
+
{
|
|
284
|
+
[_impl voices:model resolve:resolve reject:reject];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
- (void)defaultVoice:(NSString *)model
|
|
288
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
289
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
290
|
+
{
|
|
291
|
+
[_impl defaultVoice:model resolve:resolve reject:reject];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
- (void)voice:(NSString *)model
|
|
295
|
+
voiceId:(NSString *)voiceId
|
|
296
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
297
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
298
|
+
{
|
|
299
|
+
[_impl voice:model voiceId:voiceId resolve:resolve reject:reject];
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
- (void)run:(NSString *)model
|
|
303
|
+
envelope:(NSDictionary *)envelope
|
|
304
|
+
options:(NSDictionary * _Nullable)options
|
|
305
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
306
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
307
|
+
{
|
|
308
|
+
[_impl run:model envelope:envelope options:options resolve:resolve reject:reject];
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
- (void)streamStart:(NSString *)model
|
|
312
|
+
envelope:(NSDictionary *)envelope
|
|
313
|
+
options:(NSDictionary * _Nullable)options
|
|
314
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
315
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
316
|
+
{
|
|
317
|
+
[_impl streamStart:model envelope:envelope options:options resolve:resolve reject:reject];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
- (void)streamNext:(NSString *)stream
|
|
321
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
322
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
323
|
+
{
|
|
324
|
+
[_impl streamNext:stream resolve:resolve reject:reject];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
- (void)createCancelToken:(RCTPromiseResolveBlock)resolve
|
|
328
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
329
|
+
{
|
|
330
|
+
[_impl createCancelToken:resolve reject:reject];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
- (void)cancel:(NSString *)token
|
|
334
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
335
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
336
|
+
{
|
|
337
|
+
[_impl cancel:token resolve:resolve reject:reject];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
- (void)createContext:(NSString * _Nullable)contextId
|
|
341
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
342
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
343
|
+
{
|
|
344
|
+
[_impl createContext:contextId resolve:resolve reject:reject];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
- (void)contextPush:(NSString *)context
|
|
348
|
+
envelope:(NSDictionary *)envelope
|
|
349
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
350
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
351
|
+
{
|
|
352
|
+
[_impl contextPush:context envelope:envelope resolve:resolve reject:reject];
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
- (void)contextSetSystem:(NSString *)context
|
|
356
|
+
envelope:(NSDictionary *)envelope
|
|
357
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
358
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
359
|
+
{
|
|
360
|
+
[_impl contextSetSystem:context envelope:envelope resolve:resolve reject:reject];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
- (void)contextClear:(NSString *)context
|
|
364
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
365
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
366
|
+
{
|
|
367
|
+
[_impl contextClear:context resolve:resolve reject:reject];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
- (void)contextInfo:(NSString *)context
|
|
371
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
372
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
373
|
+
{
|
|
374
|
+
[_impl contextInfo:context resolve:resolve reject:reject];
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
- (void)contextHistory:(NSString *)context
|
|
378
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
379
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
380
|
+
{
|
|
381
|
+
[_impl contextHistory:context resolve:resolve reject:reject];
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
- (void)contextSetMaxHistoryLength:(NSString *)context
|
|
385
|
+
length:(double)length
|
|
386
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
387
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
388
|
+
{
|
|
389
|
+
[_impl contextSetMaxHistoryLength:context length:length resolve:resolve reject:reject];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
- (void)startDownload:(NSString *)modelId
|
|
393
|
+
platform:(NSString * _Nullable)platform
|
|
394
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
395
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
396
|
+
{
|
|
397
|
+
[_impl startDownload:modelId platform:platform resolve:resolve reject:reject];
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
- (void)downloadHandleStatus:(NSString *)download
|
|
401
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
402
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
403
|
+
{
|
|
404
|
+
[_impl downloadHandleStatus:download resolve:resolve reject:reject];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
- (void)downloadHandleError:(NSString *)download
|
|
408
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
409
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
410
|
+
{
|
|
411
|
+
[_impl downloadHandleError:download resolve:resolve reject:reject];
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
- (void)cancelDownload:(NSString *)download
|
|
415
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
416
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
417
|
+
{
|
|
418
|
+
[_impl cancelDownload:download resolve:resolve reject:reject];
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
- (void)loadPipeline:(NSDictionary *)source
|
|
422
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
423
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
424
|
+
{
|
|
425
|
+
[_impl loadPipeline:source resolve:resolve reject:reject];
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
- (void)pipelineInfo:(NSString *)pipeline
|
|
429
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
430
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
431
|
+
{
|
|
432
|
+
[_impl pipelineInfo:pipeline resolve:resolve reject:reject];
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
- (void)runPipeline:(NSString *)pipeline
|
|
436
|
+
envelope:(NSDictionary *)envelope
|
|
437
|
+
options:(NSDictionary * _Nullable)options
|
|
438
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
439
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
440
|
+
{
|
|
441
|
+
[_impl runPipeline:pipeline envelope:envelope options:options resolve:resolve reject:reject];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
- (void)openStreamingSession:(NSString *)model
|
|
445
|
+
config:(NSDictionary * _Nullable)config
|
|
446
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
447
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
448
|
+
{
|
|
449
|
+
[_impl openStreamingSession:model config:config resolve:resolve reject:reject];
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
- (void)sessionFeed:(NSString *)session
|
|
453
|
+
samplesBase64:(NSString *)samplesBase64
|
|
454
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
455
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
456
|
+
{
|
|
457
|
+
[_impl sessionFeed:session samplesBase64:samplesBase64 resolve:resolve reject:reject];
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
- (void)sessionNextPartial:(NSString *)session
|
|
461
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
462
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
463
|
+
{
|
|
464
|
+
[_impl sessionNextPartial:session resolve:resolve reject:reject];
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
- (void)sessionFlush:(NSString *)session
|
|
468
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
469
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
470
|
+
{
|
|
471
|
+
[_impl sessionFlush:session resolve:resolve reject:reject];
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
- (void)sessionReset:(NSString *)session
|
|
475
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
476
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
477
|
+
{
|
|
478
|
+
[_impl sessionReset:session resolve:resolve reject:reject];
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
- (void)sessionCancel:(NSString *)session
|
|
482
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
483
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
484
|
+
{
|
|
485
|
+
[_impl sessionCancel:session resolve:resolve reject:reject];
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
- (void)sessionIsRunning:(NSString *)session
|
|
489
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
490
|
+
reject:(RCTPromiseRejectBlock)reject
|
|
491
|
+
{
|
|
492
|
+
[_impl sessionIsRunning:session resolve:resolve reject:reject];
|
|
493
|
+
}
|
|
494
|
+
@end
|