capacitor-native-agent 0.5.2 → 0.6.1
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/android/src/main/java/com/t6x/plugins/nativeagent/NativeAgentPlugin.kt +10 -0
- package/android/src/main/java/uniffi/native_agent_ffi/native_agent_ffi.kt +30 -0
- package/dist/esm/definitions.d.ts +5 -0
- package/dist/esm/definitions.d.ts.map +1 -1
- package/dist/esm/plugin.d.ts.map +1 -1
- package/dist/esm/plugin.js +1 -0
- package/dist/esm/plugin.js.map +1 -1
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffi/native_agent_ffi.swift +109 -2
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffi/native_agent_ffiFFI.h +55 -0
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffi/native_agent_ffi.swift +109 -2
- package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffi/native_agent_ffiFFI.h +55 -0
- package/ios/Sources/NativeAgentPlugin/Generated/native_agent_ffi.swift +109 -2
- package/ios/Sources/NativeAgentPlugin/Generated/native_agent_ffiFFI.h +55 -0
- package/ios/Sources/NativeAgentPlugin/NativeAgentPlugin.swift +14 -0
- package/package.json +1 -1
|
@@ -438,11 +438,21 @@ RustBuffer uniffi_native_agent_ffi_fn_method_nativeagenthandle_list_sessions(voi
|
|
|
438
438
|
RustBuffer uniffi_native_agent_ffi_fn_method_nativeagenthandle_list_skills(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
|
|
439
439
|
);
|
|
440
440
|
#endif
|
|
441
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_LIST_TOOL_PERMISSIONS
|
|
442
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_LIST_TOOL_PERMISSIONS
|
|
443
|
+
RustBuffer uniffi_native_agent_ffi_fn_method_nativeagenthandle_list_tool_permissions(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
|
|
444
|
+
);
|
|
445
|
+
#endif
|
|
441
446
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_LOAD_SESSION
|
|
442
447
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_LOAD_SESSION
|
|
443
448
|
RustBuffer uniffi_native_agent_ffi_fn_method_nativeagenthandle_load_session(void*_Nonnull ptr, RustBuffer session_key, RustCallStatus *_Nonnull out_status
|
|
444
449
|
);
|
|
445
450
|
#endif
|
|
451
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_LOAD_SURFACED_MESSAGES
|
|
452
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_LOAD_SURFACED_MESSAGES
|
|
453
|
+
RustBuffer uniffi_native_agent_ffi_fn_method_nativeagenthandle_load_surfaced_messages(void*_Nonnull ptr, int64_t limit, RustCallStatus *_Nonnull out_status
|
|
454
|
+
);
|
|
455
|
+
#endif
|
|
446
456
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_PERSIST_CONFIG
|
|
447
457
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_PERSIST_CONFIG
|
|
448
458
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_persist_config(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
|
|
@@ -463,6 +473,11 @@ void uniffi_native_agent_ffi_fn_method_nativeagenthandle_remove_cron_job(void*_N
|
|
|
463
473
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_remove_skill(void*_Nonnull ptr, RustBuffer id, RustCallStatus *_Nonnull out_status
|
|
464
474
|
);
|
|
465
475
|
#endif
|
|
476
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_RESET_TOOL_PERMISSIONS
|
|
477
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_RESET_TOOL_PERMISSIONS
|
|
478
|
+
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_reset_tool_permissions(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
|
|
479
|
+
);
|
|
480
|
+
#endif
|
|
466
481
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_RESPOND_TO_APPROVAL
|
|
467
482
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_RESPOND_TO_APPROVAL
|
|
468
483
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_respond_to_approval(void*_Nonnull ptr, RustBuffer tool_call_id, int8_t approved, RustBuffer reason, RustCallStatus *_Nonnull out_status
|
|
@@ -493,6 +508,11 @@ void uniffi_native_agent_ffi_fn_method_nativeagenthandle_resume_session(void*_No
|
|
|
493
508
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_run_cron_job(void*_Nonnull ptr, RustBuffer job_id, RustCallStatus *_Nonnull out_status
|
|
494
509
|
);
|
|
495
510
|
#endif
|
|
511
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SEED_TOOL_PERMISSIONS
|
|
512
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SEED_TOOL_PERMISSIONS
|
|
513
|
+
uint32_t uniffi_native_agent_ffi_fn_method_nativeagenthandle_seed_tool_permissions(void*_Nonnull ptr, RustBuffer defaults_json, RustCallStatus *_Nonnull out_status
|
|
514
|
+
);
|
|
515
|
+
#endif
|
|
496
516
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SEND_MESSAGE
|
|
497
517
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SEND_MESSAGE
|
|
498
518
|
RustBuffer uniffi_native_agent_ffi_fn_method_nativeagenthandle_send_message(void*_Nonnull ptr, RustBuffer params, RustCallStatus *_Nonnull out_status
|
|
@@ -528,6 +548,11 @@ void uniffi_native_agent_ffi_fn_method_nativeagenthandle_set_notifier(void*_Nonn
|
|
|
528
548
|
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_set_scheduler_config(void*_Nonnull ptr, RustBuffer config_json, RustCallStatus *_Nonnull out_status
|
|
529
549
|
);
|
|
530
550
|
#endif
|
|
551
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SET_TOOL_PERMISSION
|
|
552
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_SET_TOOL_PERMISSION
|
|
553
|
+
void uniffi_native_agent_ffi_fn_method_nativeagenthandle_set_tool_permission(void*_Nonnull ptr, RustBuffer tool_name, RustBuffer permission, int8_t enabled, RustCallStatus *_Nonnull out_status
|
|
554
|
+
);
|
|
555
|
+
#endif
|
|
531
556
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_START_MCP
|
|
532
557
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_FN_METHOD_NATIVEAGENTHANDLE_START_MCP
|
|
533
558
|
uint32_t uniffi_native_agent_ffi_fn_method_nativeagenthandle_start_mcp(void*_Nonnull ptr, RustBuffer tools_json, RustCallStatus *_Nonnull out_status
|
|
@@ -982,12 +1007,24 @@ uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_list_sessions
|
|
|
982
1007
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_LIST_SKILLS
|
|
983
1008
|
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_list_skills(void
|
|
984
1009
|
|
|
1010
|
+
);
|
|
1011
|
+
#endif
|
|
1012
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_LIST_TOOL_PERMISSIONS
|
|
1013
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_LIST_TOOL_PERMISSIONS
|
|
1014
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_list_tool_permissions(void
|
|
1015
|
+
|
|
985
1016
|
);
|
|
986
1017
|
#endif
|
|
987
1018
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_LOAD_SESSION
|
|
988
1019
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_LOAD_SESSION
|
|
989
1020
|
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_load_session(void
|
|
990
1021
|
|
|
1022
|
+
);
|
|
1023
|
+
#endif
|
|
1024
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_LOAD_SURFACED_MESSAGES
|
|
1025
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_LOAD_SURFACED_MESSAGES
|
|
1026
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_load_surfaced_messages(void
|
|
1027
|
+
|
|
991
1028
|
);
|
|
992
1029
|
#endif
|
|
993
1030
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_PERSIST_CONFIG
|
|
@@ -1012,6 +1049,12 @@ uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_remove_cron_j
|
|
|
1012
1049
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_REMOVE_SKILL
|
|
1013
1050
|
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_remove_skill(void
|
|
1014
1051
|
|
|
1052
|
+
);
|
|
1053
|
+
#endif
|
|
1054
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_RESET_TOOL_PERMISSIONS
|
|
1055
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_RESET_TOOL_PERMISSIONS
|
|
1056
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_reset_tool_permissions(void
|
|
1057
|
+
|
|
1015
1058
|
);
|
|
1016
1059
|
#endif
|
|
1017
1060
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_RESPOND_TO_APPROVAL
|
|
@@ -1048,6 +1091,12 @@ uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_resume_sessio
|
|
|
1048
1091
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_RUN_CRON_JOB
|
|
1049
1092
|
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_run_cron_job(void
|
|
1050
1093
|
|
|
1094
|
+
);
|
|
1095
|
+
#endif
|
|
1096
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SEED_TOOL_PERMISSIONS
|
|
1097
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SEED_TOOL_PERMISSIONS
|
|
1098
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_seed_tool_permissions(void
|
|
1099
|
+
|
|
1051
1100
|
);
|
|
1052
1101
|
#endif
|
|
1053
1102
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SEND_MESSAGE
|
|
@@ -1090,6 +1139,12 @@ uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_set_notifier(
|
|
|
1090
1139
|
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SET_SCHEDULER_CONFIG
|
|
1091
1140
|
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_set_scheduler_config(void
|
|
1092
1141
|
|
|
1142
|
+
);
|
|
1143
|
+
#endif
|
|
1144
|
+
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SET_TOOL_PERMISSION
|
|
1145
|
+
#define UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_SET_TOOL_PERMISSION
|
|
1146
|
+
uint16_t uniffi_native_agent_ffi_checksum_method_nativeagenthandle_set_tool_permission(void
|
|
1147
|
+
|
|
1093
1148
|
);
|
|
1094
1149
|
#endif
|
|
1095
1150
|
#ifndef UNIFFI_FFIDEF_UNIFFI_NATIVE_AGENT_FFI_CHECKSUM_METHOD_NATIVEAGENTHANDLE_START_MCP
|
|
@@ -38,6 +38,7 @@ public class NativeAgentPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
38
38
|
CAPPluginMethod(name: "listCronJobs", returnType: CAPPluginReturnPromise),
|
|
39
39
|
CAPPluginMethod(name: "runCronJob", returnType: CAPPluginReturnPromise),
|
|
40
40
|
CAPPluginMethod(name: "listCronRuns", returnType: CAPPluginReturnPromise),
|
|
41
|
+
CAPPluginMethod(name: "loadSurfacedMessages", returnType: CAPPluginReturnPromise),
|
|
41
42
|
CAPPluginMethod(name: "handleWake", returnType: CAPPluginReturnPromise),
|
|
42
43
|
CAPPluginMethod(name: "getSchedulerConfig", returnType: CAPPluginReturnPromise),
|
|
43
44
|
CAPPluginMethod(name: "setSchedulerConfig", returnType: CAPPluginReturnPromise),
|
|
@@ -536,6 +537,19 @@ public class NativeAgentPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
536
537
|
}
|
|
537
538
|
}
|
|
538
539
|
|
|
540
|
+
@objc func loadSurfacedMessages(_ call: CAPPluginCall) {
|
|
541
|
+
withHandle(call) { h in
|
|
542
|
+
do {
|
|
543
|
+
let json = try h.loadSurfacedMessages(
|
|
544
|
+
limit: Int64(call.getInt("limit") ?? 50)
|
|
545
|
+
)
|
|
546
|
+
call.resolve(["messagesJson": json])
|
|
547
|
+
} catch {
|
|
548
|
+
call.reject("loadSurfacedMessages failed: \(error.localizedDescription)")
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
539
553
|
@objc func handleWake(_ call: CAPPluginCall) {
|
|
540
554
|
withHandle(call) { h in
|
|
541
555
|
do {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-native-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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",
|