capacitor-native-agent 0.9.0 → 0.9.2
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/README.md +26 -23
- package/android/src/main/java/com/t6x/plugins/nativeagent/NativeAgentPlugin.kt +8 -0
- package/android/src/main/java/uniffi/native_agent_ffi/native_agent_ffi.kt +22 -2
- package/android/src/main/jniLibs/arm64-v8a/libnative_agent_ffi.so +0 -0
- package/dist/esm/definitions.d.ts +22 -0
- package/dist/esm/definitions.d.ts.map +1 -1
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffi/native_agent_ffi.swift +399 -17
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffi/native_agent_ffiFFI.h +109 -2
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/libnative_agent_ffi.a +0 -0
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffi/native_agent_ffi.swift +399 -17
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffi/native_agent_ffiFFI.h +109 -2
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/libnative_agent_ffi.a +0 -0
- package/ios/Sources/NativeAgentPlugin/Generated/native_agent_ffi.swift +360 -9
- package/ios/Sources/NativeAgentPlugin/Generated/native_agent_ffiFFI.h +107 -0
- package/ios/Sources/NativeAgentPlugin/NativeAgentPlugin.swift +10 -2
- package/package.json +1 -1
|
@@ -250,6 +250,48 @@ typedef struct UniffiForeignFutureStructVoid {
|
|
|
250
250
|
typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStructVoid
|
|
251
251
|
);
|
|
252
252
|
|
|
253
|
+
#endif
|
|
254
|
+
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD0
|
|
255
|
+
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD0
|
|
256
|
+
typedef void (*UniffiCallbackInterfaceGovernanceProviderMethod0)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull,
|
|
257
|
+
RustCallStatus *_Nonnull uniffiCallStatus
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
#endif
|
|
261
|
+
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD1
|
|
262
|
+
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD1
|
|
263
|
+
typedef void (*UniffiCallbackInterfaceGovernanceProviderMethod1)(uint64_t, RustBuffer, RustBuffer, RustBuffer, RustBuffer* _Nonnull,
|
|
264
|
+
RustCallStatus *_Nonnull uniffiCallStatus
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
#endif
|
|
268
|
+
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD2
|
|
269
|
+
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD2
|
|
270
|
+
typedef void (*UniffiCallbackInterfaceGovernanceProviderMethod2)(uint64_t, RustBuffer, RustBuffer, RustBuffer, RustBuffer, void* _Nonnull,
|
|
271
|
+
RustCallStatus *_Nonnull uniffiCallStatus
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
#endif
|
|
275
|
+
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD3
|
|
276
|
+
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD3
|
|
277
|
+
typedef void (*UniffiCallbackInterfaceGovernanceProviderMethod3)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull,
|
|
278
|
+
RustCallStatus *_Nonnull uniffiCallStatus
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
#endif
|
|
282
|
+
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD4
|
|
283
|
+
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD4
|
|
284
|
+
typedef void (*UniffiCallbackInterfaceGovernanceProviderMethod4)(uint64_t, void* _Nonnull,
|
|
285
|
+
RustCallStatus *_Nonnull uniffiCallStatus
|
|
286
|
+
);
|
|
287
|
+
|
|
288
|
+
#endif
|
|
289
|
+
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD5
|
|
290
|
+
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER_METHOD5
|
|
291
|
+
typedef void (*UniffiCallbackInterfaceGovernanceProviderMethod5)(uint64_t, RustBuffer, uint32_t, uint32_t, void* _Nonnull,
|
|
292
|
+
RustCallStatus *_Nonnull uniffiCallStatus
|
|
293
|
+
);
|
|
294
|
+
|
|
253
295
|
#endif
|
|
254
296
|
#ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_MEMORY_PROVIDER_METHOD0
|
|
255
297
|
#define UNIFFI_FFIDEF_CALLBACK_INTERFACE_MEMORY_PROVIDER_METHOD0
|
|
@@ -299,6 +341,19 @@ typedef void (*UniffiCallbackInterfaceNativeNotifierMethod0)(uint64_t, RustBuffe
|
|
|
299
341
|
RustCallStatus *_Nonnull uniffiCallStatus
|
|
300
342
|
);
|
|
301
343
|
|
|
344
|
+
#endif
|
|
345
|
+
#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER
|
|
346
|
+
#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_GOVERNANCE_PROVIDER
|
|
347
|
+
typedef struct UniffiVTableCallbackInterfaceGovernanceProvider {
|
|
348
|
+
UniffiCallbackInterfaceGovernanceProviderMethod0 _Nonnull checkLoop;
|
|
349
|
+
UniffiCallbackInterfaceGovernanceProviderMethod1 _Nonnull recordOutcome;
|
|
350
|
+
UniffiCallbackInterfaceGovernanceProviderMethod2 _Nonnull recordAudit;
|
|
351
|
+
UniffiCallbackInterfaceGovernanceProviderMethod3 _Nonnull checkSink;
|
|
352
|
+
UniffiCallbackInterfaceGovernanceProviderMethod4 _Nonnull reset;
|
|
353
|
+
UniffiCallbackInterfaceGovernanceProviderMethod5 _Nonnull recordUsage;
|
|
354
|
+
UniffiCallbackInterfaceFree _Nonnull uniffiFree;
|
|
355
|
+
} UniffiVTableCallbackInterfaceGovernanceProvider;
|
|
356
|
+
|
|
302
357
|
#endif
|
|
303
358
|
#ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MEMORY_PROVIDER
|
|
304
359
|
#define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_MEMORY_PROVIDER
|
|
@@ -528,6 +583,11 @@ void uniffi_native_agent_ffi_fn_method_nativeagenthandle_set_auth_key(void*_Nonn
|
|
|
528
583
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_set_event_callback(void*_Nonnull ptr, uint64_t callback, RustCallStatus *_Nonnull out_status
|
|
529
584
|
);
|
|
530
585
|
#endif
|
|
586
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SET_GOVERNANCE_PROVIDER
|
|
587
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SET_GOVERNANCE_PROVIDER
|
|
588
|
+
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_set_governance_provider(void*_Nonnull ptr, uint64_t provider, RustCallStatus *_Nonnull out_status
|
|
589
|
+
);
|
|
590
|
+
#endif
|
|
531
591
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SET_HEARTBEAT_CONFIG
|
|
532
592
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SET_HEARTBEAT_CONFIG
|
|
533
593
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_set_heartbeat_config(void*_Nonnull ptr, RustBuffer config_json, RustCallStatus *_Nonnull out_status
|
|
@@ -578,6 +638,11 @@ void uniffi_native_agent_ffi_fn_method_nativeagenthandle_update_cron_job(void*_N
|
|
|
578
638
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_update_skill(void*_Nonnull ptr, RustBuffer id, RustBuffer patch_json, RustCallStatus *_Nonnull out_status
|
|
579
639
|
);
|
|
580
640
|
#endif
|
|
641
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_INIT_CALLBACK_VTABLE_GOVERNANCEPROVIDER
|
|
642
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_INIT_CALLBACK_VTABLE_GOVERNANCEPROVIDER
|
|
643
|
+
void uniffi_native_agent_ffi_fn_init_callback_vtable_governanceprovider(UniffiVTableCallbackInterfaceGovernanceProvider* _Nonnull vtable
|
|
644
|
+
);
|
|
645
|
+
#endif
|
|
581
646
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_INIT_CALLBACK_VTABLE_MEMORYPROVIDER
|
|
582
647
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_INIT_CALLBACK_VTABLE_MEMORYPROVIDER
|
|
583
648
|
void uniffi_native_agent_ffi_fn_init_callback_vtable_memoryprovider(UniffiVTableCallbackInterfaceMemoryProvider* _Nonnull vtable
|
|
@@ -1115,6 +1180,12 @@ uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_set_auth_key(
|
|
|
1115
1180
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SET_EVENT_CALLBACK
|
|
1116
1181
|
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_set_event_callback(void
|
|
1117
1182
|
|
|
1183
|
+
);
|
|
1184
|
+
#endif
|
|
1185
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SET_GOVERNANCE_PROVIDER
|
|
1186
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SET_GOVERNANCE_PROVIDER
|
|
1187
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_set_governance_provider(void
|
|
1188
|
+
|
|
1118
1189
|
);
|
|
1119
1190
|
#endif
|
|
1120
1191
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SET_HEARTBEAT_CONFIG
|
|
@@ -1181,6 +1252,42 @@ uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_update_skill(
|
|
|
1181
1252
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_CONSTRUCTOR_NATIVEAGENTHANDLE_NEW
|
|
1182
1253
|
uint16_t uniffi_native_agent_ffi_checksum_constructor_nativeagenthandle_new(void
|
|
1183
1254
|
|
|
1255
|
+
);
|
|
1256
|
+
#endif
|
|
1257
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_CHECK_LOOP
|
|
1258
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_CHECK_LOOP
|
|
1259
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_governanceprovider_check_loop(void
|
|
1260
|
+
|
|
1261
|
+
);
|
|
1262
|
+
#endif
|
|
1263
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RECORD_OUTCOME
|
|
1264
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RECORD_OUTCOME
|
|
1265
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_governanceprovider_record_outcome(void
|
|
1266
|
+
|
|
1267
|
+
);
|
|
1268
|
+
#endif
|
|
1269
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RECORD_AUDIT
|
|
1270
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RECORD_AUDIT
|
|
1271
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_governanceprovider_record_audit(void
|
|
1272
|
+
|
|
1273
|
+
);
|
|
1274
|
+
#endif
|
|
1275
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_CHECK_SINK
|
|
1276
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_CHECK_SINK
|
|
1277
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_governanceprovider_check_sink(void
|
|
1278
|
+
|
|
1279
|
+
);
|
|
1280
|
+
#endif
|
|
1281
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RESET
|
|
1282
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RESET
|
|
1283
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_governanceprovider_reset(void
|
|
1284
|
+
|
|
1285
|
+
);
|
|
1286
|
+
#endif
|
|
1287
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RECORD_USAGE
|
|
1288
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_GOVERNANCEPROVIDER_RECORD_USAGE
|
|
1289
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_governanceprovider_record_usage(void
|
|
1290
|
+
|
|
1184
1291
|
);
|
|
1185
1292
|
#endif
|
|
1186
1293
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_MEMORYPROVIDER_STORE
|
|
@@ -121,6 +121,8 @@ public class NativeAgentPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
121
121
|
guard let authProfilesPath = call.getString("authProfilesPath") else {
|
|
122
122
|
return call.reject("authProfilesPath is required")
|
|
123
123
|
}
|
|
124
|
+
let defaultProvider = call.getString("defaultProvider")
|
|
125
|
+
let defaultModel = call.getString("defaultModel")
|
|
124
126
|
|
|
125
127
|
DispatchQueue.global(qos: .userInitiated).async { [self] in
|
|
126
128
|
do {
|
|
@@ -128,7 +130,9 @@ public class NativeAgentPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
128
130
|
config: InitConfig(
|
|
129
131
|
dbPath: self.resolvePath(dbPath),
|
|
130
132
|
workspacePath: self.resolvePath(workspacePath),
|
|
131
|
-
authProfilesPath: self.resolvePath(authProfilesPath)
|
|
133
|
+
authProfilesPath: self.resolvePath(authProfilesPath),
|
|
134
|
+
defaultProvider: defaultProvider,
|
|
135
|
+
defaultModel: defaultModel
|
|
132
136
|
)
|
|
133
137
|
)
|
|
134
138
|
call.resolve()
|
|
@@ -148,6 +152,8 @@ public class NativeAgentPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
148
152
|
guard let authProfilesPath = call.getString("authProfilesPath") else {
|
|
149
153
|
return call.reject("authProfilesPath is required")
|
|
150
154
|
}
|
|
155
|
+
let defaultProvider = call.getString("defaultProvider")
|
|
156
|
+
let defaultModel = call.getString("defaultModel")
|
|
151
157
|
|
|
152
158
|
DispatchQueue.global(qos: .userInitiated).async { [self] in
|
|
153
159
|
do {
|
|
@@ -155,7 +161,9 @@ public class NativeAgentPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
155
161
|
let config = InitConfig(
|
|
156
162
|
dbPath: self.resolvePath(dbPath),
|
|
157
163
|
workspacePath: resolvedWorkspacePath,
|
|
158
|
-
authProfilesPath: self.resolvePath(authProfilesPath)
|
|
164
|
+
authProfilesPath: self.resolvePath(authProfilesPath),
|
|
165
|
+
defaultProvider: defaultProvider,
|
|
166
|
+
defaultModel: defaultModel
|
|
159
167
|
)
|
|
160
168
|
let h = try NativeAgentHandle(config: config)
|
|
161
169
|
try h.setEventCallback(callback: NativeAgentEventBridge(plugin: self))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-native-agent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Native AI agent loop for Capacitor — runs LLM completions, tool execution, and cron jobs in native Rust, enabling background execution.",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|