@mobileaidev/ai-app-bridge 0.2.15 → 0.3.0-rc.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/LICENSE +201 -0
- package/NOTICE +7 -0
- package/README.md +306 -53
- package/bin/ai-app-bridge.js +51 -4504
- package/bin/android-permissions.js +152 -0
- package/bin/android-uia-xml.js +74 -0
- package/bin/artifact-paths.js +127 -1
- package/bin/bridge-forward.js +56 -0
- package/bin/command-discovery.js +86 -0
- package/bin/command-errors.js +60 -0
- package/bin/command-registry.js +504 -0
- package/bin/command-request.js +14 -0
- package/bin/command-router.js +80 -0
- package/bin/connection-cache.js +119 -0
- package/bin/device-provider.js +2934 -0
- package/bin/execution-host.js +596 -0
- package/bin/execution-runtime.js +101 -0
- package/bin/fact-codec.js +321 -0
- package/bin/fact-recorder.js +691 -0
- package/bin/fact-store.js +226 -0
- package/bin/feedback-probe.js +285 -0
- package/bin/intent/install-intent.js +267 -0
- package/bin/intent/intent-action-executor.js +129 -0
- package/bin/intent/intent-autonomous-adapter.js +46 -0
- package/bin/intent/intent-capture-port.js +64 -0
- package/bin/intent/intent-entry.js +226 -0
- package/bin/intent/intent-errors.js +28 -0
- package/bin/intent/intent-evidence-store.js +121 -0
- package/bin/intent/intent-lifetime.js +62 -0
- package/bin/intent/intent-observation-target.js +33 -0
- package/bin/intent/intent-observer.js +194 -0
- package/bin/intent/intent-production-adapter.js +334 -0
- package/bin/intent/intent-provider.js +27 -0
- package/bin/intent/intent-runtime.js +63 -0
- package/bin/intent/intent-worker.js +432 -0
- package/bin/intent/ios-intent-adapter.js +90 -0
- package/bin/intent/permission-intent.js +239 -0
- package/bin/intent/web-intent-adapter.js +31 -0
- package/bin/ios-device-outcome.js +47 -0
- package/bin/ios-execution.js +108 -0
- package/bin/ios-provider.js +497 -583
- package/bin/ios-runtime-binding.js +54 -0
- package/bin/ios-wda-execution.js +70 -0
- package/bin/ios-wda-port.js +98 -0
- package/bin/ios-wda-project.js +79 -0
- package/bin/mcp-server.js +83 -1040
- package/bin/mmap-scan-index.js +329 -0
- package/bin/observation-collector.js +862 -0
- package/bin/runtime-client.js +154 -0
- package/bin/runtime-directory.js +107 -0
- package/bin/runtime-protocol.js +36 -0
- package/bin/script/bounded-script-registry.js +103 -0
- package/bin/script/node-runtime-adapter.js +233 -0
- package/bin/script/progress-projector.js +63 -0
- package/bin/script/python-runtime-adapter.js +111 -0
- package/bin/script/rolling-summary.js +134 -0
- package/bin/script/script-agent-port.js +40 -0
- package/bin/script/script-assert.js +95 -0
- package/bin/script/script-capture-port.js +76 -0
- package/bin/script/script-catalog.js +85 -0
- package/bin/script/script-durable-restore.js +195 -0
- package/bin/script/script-entry-code.js +26 -0
- package/bin/script/script-entry-route.js +38 -0
- package/bin/script/script-entry.js +3 -0
- package/bin/script/script-errors.js +29 -0
- package/bin/script/script-evidence-store.js +22 -0
- package/bin/script/script-format-removed.js +26 -0
- package/bin/script/script-host-port.js +397 -0
- package/bin/script/script-ledger.js +64 -0
- package/bin/script/script-result.js +57 -0
- package/bin/script/script-sdk.js +152 -0
- package/bin/script/script-sdk.py +153 -0
- package/bin/script/script-session-channel.js +127 -0
- package/bin/script/script-spec.js +86 -0
- package/bin/script/script-supervisor.js +919 -0
- package/bin/script/templates/checkpoint-reentry.js +13 -0
- package/bin/segment-index.js +481 -0
- package/bin/segmented-fact-store.js +1571 -0
- package/bin/shared-kernel/android-h5-target.js +10 -0
- package/bin/shared-kernel/android-install-execution.js +176 -0
- package/bin/shared-kernel/android-sdk-endpoint.js +42 -0
- package/bin/shared-kernel/android-shell-execution.js +195 -0
- package/bin/shared-kernel/argument-schema.js +117 -0
- package/bin/shared-kernel/canonical-path.js +17 -0
- package/bin/shared-kernel/device-acknowledgements.js +53 -0
- package/bin/shared-kernel/device-completion-history.js +52 -0
- package/bin/shared-kernel/device-mutation-lease.js +219 -0
- package/bin/shared-kernel/device-ownership-recovery.js +95 -0
- package/bin/shared-kernel/device-ownership-store.js +94 -0
- package/bin/shared-kernel/evidence-adapters.js +251 -0
- package/bin/shared-kernel/evidence-archive.js +329 -0
- package/bin/shared-kernel/evidence-recording.js +131 -0
- package/bin/shared-kernel/evidence-schema.js +194 -0
- package/bin/shared-kernel/evidence-store.js +190 -0
- package/bin/shared-kernel/execution-admission.js +22 -0
- package/bin/shared-kernel/execution-contracts.js +171 -0
- package/bin/shared-kernel/execution-io.js +106 -0
- package/bin/shared-kernel/execution-ledger.js +125 -0
- package/bin/shared-kernel/execution-scope.js +87 -0
- package/bin/shared-kernel/execution-target.js +115 -0
- package/bin/shared-kernel/flutter-execution.js +13 -0
- package/bin/shared-kernel/flutter-h5-port.js +60 -0
- package/bin/shared-kernel/flutter-h5-target.js +9 -0
- package/bin/shared-kernel/flutter-target.js +75 -0
- package/bin/shared-kernel/h5-execution.js +11 -0
- package/bin/shared-kernel/h5-target.js +31 -0
- package/bin/shared-kernel/host-fact-store.js +49 -0
- package/bin/shared-kernel/ios-h5-target.js +9 -0
- package/bin/shared-kernel/ios-native-target.js +71 -0
- package/bin/shared-kernel/live-capture-query.js +115 -0
- package/bin/shared-kernel/managed-sdk-execution.js +78 -0
- package/bin/shared-kernel/native-execution.js +13 -0
- package/bin/shared-kernel/native-target.js +156 -0
- package/bin/shared-kernel/provider-command-contracts.js +55 -0
- package/bin/shared-kernel/recorded-payload-archive.js +195 -0
- package/bin/shared-kernel/request-context.js +35 -0
- package/bin/shared-kernel/semantic-node.js +55 -0
- package/bin/shared-kernel/summary-transformer.js +352 -0
- package/bin/shared-kernel/target-lease-protocol.js +47 -0
- package/bin/shared-kernel/text-wait.js +111 -0
- package/bin/shared-kernel/uia-execution.js +96 -0
- package/bin/shared-kernel/uia-protocol.js +214 -0
- package/bin/shared-kernel/uia-runtime-port.js +377 -0
- package/bin/shared-kernel/uia-target.js +39 -0
- package/bin/shared-kernel/web-dom-target.js +44 -0
- package/bin/shared-kernel/xml-attributes.js +25 -0
- package/bin/target-execution.js +275 -0
- package/bin/web/command-schema.js +60 -0
- package/bin/web/session-store.js +157 -0
- package/bin/web-provider.js +334 -553
- package/docs/COMMAND_CONTRACT.md +1563 -0
- package/docs/EVIDENCE_ARCHIVE.md +214 -0
- package/docs/INTENT_FOREGROUND.md +71 -0
- package/docs/INTENT_NATIVE_EDITING.md +79 -0
- package/docs/RELEASE.md +59 -0
- package/docs/SCRIPT_AUTHORING.md +489 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/LICENSE +201 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/NOTICE +7 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/binding.gyp +36 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/bindings/node/sfs_node.c +597 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/include/sfs.h +178 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/index.js +5 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/package.json +24 -0
- package/node_modules/@mobileaidev/segmented-fact-store-native/src/sfs.c +2349 -0
- package/package.json +60 -5
- package/runtime/ios-wda/AABWDABinding.h +19 -0
- package/runtime/ios-wda/AABWDABinding.m +97 -0
- package/runtime/ios-wda/AABWDAExecution.h +26 -0
- package/runtime/ios-wda/AABWDAExecution.m +172 -0
- package/runtime/ios-wda/AABWDAIntegration.h +71 -0
- package/runtime/ios-wda/AABWDAManagedRoutes.h +392 -0
- package/runtime/ios-wda/AABWDAReceiptStore.h +10 -0
- package/runtime/ios-wda/AABWDAReceiptStore.m +116 -0
- package/runtime/uia/ai-app-bridge-uia.jar +0 -0
- package/runtime/uia/manifest.json +22 -0
- package/skills/ai-app-bridge-use/SKILL.md +23 -360
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#ifndef SFS_H
|
|
2
|
+
#define SFS_H
|
|
3
|
+
|
|
4
|
+
#include <stddef.h>
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
|
|
7
|
+
#ifdef __cplusplus
|
|
8
|
+
extern "C" {
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
#if defined(_WIN32) && defined(SFS_SHARED)
|
|
12
|
+
#if defined(SFS_BUILDING_LIBRARY)
|
|
13
|
+
#define SFS_API __declspec(dllexport)
|
|
14
|
+
#else
|
|
15
|
+
#define SFS_API __declspec(dllimport)
|
|
16
|
+
#endif
|
|
17
|
+
#else
|
|
18
|
+
#define SFS_API
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#define SFS_FORMAT_VERSION 1u
|
|
22
|
+
#define SFS_SEGMENT_HEADER_SIZE 64u
|
|
23
|
+
#define SFS_DEFAULT_SEGMENT_SIZE (1024u * 1024u)
|
|
24
|
+
#define SFS_MAX_PARTITIONS 8u
|
|
25
|
+
#define SFS_PARTITION_ALL UINT32_MAX
|
|
26
|
+
|
|
27
|
+
typedef struct sfs_store sfs_store_t;
|
|
28
|
+
|
|
29
|
+
typedef int32_t sfs_result_t;
|
|
30
|
+
enum {
|
|
31
|
+
SFS_OK = 0,
|
|
32
|
+
SFS_END = 1,
|
|
33
|
+
SFS_BUFFER_TOO_SMALL = 2,
|
|
34
|
+
SFS_ERR_INVALID_ARGUMENT = -1,
|
|
35
|
+
SFS_ERR_IO = -2,
|
|
36
|
+
SFS_ERR_FORMAT_VERSION = -3,
|
|
37
|
+
SFS_ERR_CORRUPT = -4,
|
|
38
|
+
SFS_ERR_FULL = -5,
|
|
39
|
+
SFS_ERR_BUSY = -6,
|
|
40
|
+
SFS_ERR_NOMEM = -7,
|
|
41
|
+
SFS_ERR_CLOSED = -8,
|
|
42
|
+
SFS_ERR_PARTITION_DISABLED = -9
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
typedef uint32_t sfs_open_flags_t;
|
|
46
|
+
enum {
|
|
47
|
+
SFS_OPEN_CREATE = 1u << 0
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
typedef int32_t sfs_durability_t;
|
|
51
|
+
enum {
|
|
52
|
+
SFS_DURABILITY_MEMORY = 0,
|
|
53
|
+
SFS_DURABILITY_SYNC = 1
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
typedef uint32_t sfs_status_flags_t;
|
|
57
|
+
enum {
|
|
58
|
+
SFS_STATUS_RECOVERED_TAIL = 1u << 0
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
typedef uint32_t sfs_partition_status_flags_t;
|
|
62
|
+
enum {
|
|
63
|
+
SFS_PARTITION_ENABLED = 1u << 0
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
typedef uint32_t sfs_record_flags_t;
|
|
67
|
+
enum {
|
|
68
|
+
SFS_RECORD_GAP_BEFORE = 1u << 0
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
typedef struct sfs_open_options {
|
|
72
|
+
uint32_t struct_size;
|
|
73
|
+
uint32_t flags;
|
|
74
|
+
const char *directory;
|
|
75
|
+
uint64_t segment_size;
|
|
76
|
+
uint64_t partition_quotas[SFS_MAX_PARTITIONS];
|
|
77
|
+
} sfs_open_options_t;
|
|
78
|
+
|
|
79
|
+
typedef struct sfs_cursor {
|
|
80
|
+
uint32_t partition_id;
|
|
81
|
+
uint32_t flags;
|
|
82
|
+
uint64_t after_sequence;
|
|
83
|
+
uint64_t segment_id;
|
|
84
|
+
uint64_t offset;
|
|
85
|
+
} sfs_cursor_t;
|
|
86
|
+
|
|
87
|
+
#define SFS_CURSOR_BEGIN \
|
|
88
|
+
{ SFS_PARTITION_ALL, 0u, 0u, 0u, 0u }
|
|
89
|
+
|
|
90
|
+
#define SFS_CURSOR_PARTITION(partition) \
|
|
91
|
+
{ (partition), 0u, 0u, 0u, 0u }
|
|
92
|
+
|
|
93
|
+
typedef struct sfs_record_info {
|
|
94
|
+
uint32_t struct_size;
|
|
95
|
+
uint32_t payload_length;
|
|
96
|
+
uint32_t partition_id;
|
|
97
|
+
uint32_t flags;
|
|
98
|
+
uint64_t sequence;
|
|
99
|
+
uint64_t segment_id;
|
|
100
|
+
uint64_t frame_offset;
|
|
101
|
+
uint64_t gap_first_sequence;
|
|
102
|
+
uint64_t gap_last_sequence;
|
|
103
|
+
} sfs_record_info_t;
|
|
104
|
+
|
|
105
|
+
typedef struct sfs_partition_status {
|
|
106
|
+
uint32_t partition_id;
|
|
107
|
+
uint32_t flags;
|
|
108
|
+
uint64_t quota_bytes;
|
|
109
|
+
uint64_t allocated_bytes;
|
|
110
|
+
uint64_t segment_count;
|
|
111
|
+
uint64_t first_segment_id;
|
|
112
|
+
uint64_t active_segment_id;
|
|
113
|
+
uint64_t active_write_offset;
|
|
114
|
+
uint64_t record_count;
|
|
115
|
+
uint64_t payload_bytes;
|
|
116
|
+
uint64_t first_sequence;
|
|
117
|
+
uint64_t last_sequence;
|
|
118
|
+
uint64_t evicted_segments;
|
|
119
|
+
uint64_t evicted_records;
|
|
120
|
+
uint64_t evicted_payload_bytes;
|
|
121
|
+
} sfs_partition_status_t;
|
|
122
|
+
|
|
123
|
+
typedef struct sfs_status {
|
|
124
|
+
uint32_t struct_size;
|
|
125
|
+
uint32_t format_version;
|
|
126
|
+
uint32_t flags;
|
|
127
|
+
uint32_t reserved;
|
|
128
|
+
uint64_t segment_size;
|
|
129
|
+
uint64_t segment_count;
|
|
130
|
+
uint64_t record_count;
|
|
131
|
+
uint64_t payload_bytes;
|
|
132
|
+
uint64_t next_sequence;
|
|
133
|
+
uint32_t recovery_partition_id;
|
|
134
|
+
uint32_t recovery_reserved;
|
|
135
|
+
uint64_t recovery_segment_id;
|
|
136
|
+
uint64_t recovery_offset;
|
|
137
|
+
uint64_t recovery_discarded_bytes;
|
|
138
|
+
sfs_partition_status_t partitions[SFS_MAX_PARTITIONS];
|
|
139
|
+
} sfs_status_t;
|
|
140
|
+
|
|
141
|
+
typedef struct sfs_error {
|
|
142
|
+
int32_t code;
|
|
143
|
+
int32_t system_code;
|
|
144
|
+
char message[160];
|
|
145
|
+
} sfs_error_t;
|
|
146
|
+
|
|
147
|
+
SFS_API sfs_result_t sfs_open(const sfs_open_options_t *options,
|
|
148
|
+
sfs_store_t **out_store,
|
|
149
|
+
sfs_error_t *error);
|
|
150
|
+
|
|
151
|
+
SFS_API sfs_result_t sfs_append(sfs_store_t *store,
|
|
152
|
+
uint32_t partition_id,
|
|
153
|
+
const void *payload,
|
|
154
|
+
uint32_t payload_length,
|
|
155
|
+
sfs_durability_t durability,
|
|
156
|
+
sfs_record_info_t *out_record,
|
|
157
|
+
sfs_error_t *error);
|
|
158
|
+
|
|
159
|
+
SFS_API sfs_result_t sfs_scan(sfs_store_t *store,
|
|
160
|
+
sfs_cursor_t *cursor,
|
|
161
|
+
void *buffer,
|
|
162
|
+
uint32_t buffer_capacity,
|
|
163
|
+
sfs_record_info_t *out_record,
|
|
164
|
+
sfs_error_t *error);
|
|
165
|
+
|
|
166
|
+
SFS_API sfs_result_t sfs_status(sfs_store_t *store,
|
|
167
|
+
sfs_status_t *out_status,
|
|
168
|
+
sfs_error_t *error);
|
|
169
|
+
|
|
170
|
+
SFS_API sfs_result_t sfs_flush(sfs_store_t *store, sfs_error_t *error);
|
|
171
|
+
|
|
172
|
+
SFS_API sfs_result_t sfs_close(sfs_store_t *store, sfs_error_t *error);
|
|
173
|
+
|
|
174
|
+
#ifdef __cplusplus
|
|
175
|
+
}
|
|
176
|
+
#endif
|
|
177
|
+
|
|
178
|
+
#endif
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mobileaidev/segmented-fact-store-native",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Portable segmented mmap fact-store core and Node-API binding for AI App Bridge.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"gypfile": true,
|
|
7
|
+
"files": [
|
|
8
|
+
"binding.gyp",
|
|
9
|
+
"index.js",
|
|
10
|
+
"include",
|
|
11
|
+
"src",
|
|
12
|
+
"bindings/node/sfs_node.c",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"NOTICE"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "node-gyp rebuild",
|
|
18
|
+
"test": "node --test bindings/node/test/*.test.js"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"license": "Apache-2.0"
|
|
24
|
+
}
|