@sensaiorg/adapter-ios 0.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * @sensai/adapter-ios — iOS platform adapter for SensAI.
4
+ *
5
+ * Provides debugging tools via xcrun simctl, Xcode instruments, and
6
+ * optionally an on-device debug agent for React Native inspection.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.IosAdapter = void 0;
10
+ var ios_adapter_js_1 = require("./ios-adapter.js");
11
+ Object.defineProperty(exports, "IosAdapter", { enumerable: true, get: function () { return ios_adapter_js_1.IosAdapter; } });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ios-adapter.d.ts","sourceRoot":"","sources":["../src/ios-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAKtB,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,UAAW,YAAW,gBAAgB;IACjD,QAAQ,CAAC,QAAQ,EAAG,KAAK,CAAU;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAUzC;IAEF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC,QAAQ,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAAQ;IACvC,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAQ;IAC1C,QAAQ,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAQ;IACzD,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IACjD,QAAQ,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAQ;IACzD,QAAQ,CAAC,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAQ;IACvD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;gBAEvC,MAAM,GAAE,gBAAqB;IAWnC,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAiB7C,QAAQ,IAAI,IAAI;IAIhB,WAAW,IAAI,OAAO;IAItB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;CAK/C"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * IosAdapter — implements IPlatformAdapter for iOS Simulator and devices.
4
+ *
5
+ * Uses:
6
+ * - xcrun simctl: screenshots, app lifecycle, UI hierarchy, status bar
7
+ * - Xcode instruments: performance profiling
8
+ * - Safari Web Inspector Protocol: WebView debugging
9
+ * - IDB (Facebook's iOS Development Bridge): advanced interactions
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IosAdapter = void 0;
13
+ const simctl_client_js_1 = require("./transport/simctl-client.js");
14
+ const ios_tools_js_1 = require("./tools/ios-tools.js");
15
+ class IosAdapter {
16
+ platform = "ios";
17
+ displayName;
18
+ capabilities = {
19
+ uiTree: true, // via XCUITest accessibility hierarchy
20
+ logs: true, // via os_log / simctl spawn log
21
+ interaction: true, // via simctl ui / idb
22
+ network: false, // Future: mitmproxy integration
23
+ performance: true, // via instruments
24
+ screenshot: true, // via simctl io screenshot
25
+ appState: false, // Future: on-device agent
26
+ hotReload: true, // Metro bundler (React Native)
27
+ evalCode: false,
28
+ };
29
+ config;
30
+ simctl;
31
+ ui = null; // TODO: SimctlUiProvider
32
+ logs = null; // TODO: OsLogProvider
33
+ interaction = null; // TODO: SimctlInteractionProvider
34
+ network = null;
35
+ performance = null; // TODO: InstrumentsProvider
36
+ screenshot = null; // TODO: SimctlScreenshotProvider
37
+ appState = null;
38
+ constructor(config = {}) {
39
+ this.config = {
40
+ simulatorId: config.simulatorId ?? "booted",
41
+ bundleId: config.bundleId ?? process.env.IOS_BUNDLE_ID ?? "com.chronocrew",
42
+ idbPath: config.idbPath ?? process.env.IDB_PATH ?? "idb",
43
+ };
44
+ this.displayName = `iOS Simulator (${this.config.simulatorId})`;
45
+ this.simctl = new simctl_client_js_1.SimctlClient(this.config.simulatorId);
46
+ }
47
+ async initialize() {
48
+ await this.simctl.initIdb();
49
+ const deviceInfo = await this.simctl.getDeviceInfo();
50
+ return {
51
+ platform: "ios",
52
+ device: deviceInfo.name ?? this.config.simulatorId,
53
+ connected: deviceInfo.booted,
54
+ capabilities: this.capabilities,
55
+ details: {
56
+ udid: deviceInfo.udid,
57
+ runtime: deviceInfo.runtime,
58
+ bundleId: this.config.bundleId,
59
+ },
60
+ };
61
+ }
62
+ shutdown() {
63
+ // No persistent connections to clean up for simctl
64
+ }
65
+ isConnected() {
66
+ return this.simctl.isBooted();
67
+ }
68
+ registerPlatformTools(server) {
69
+ // Use "ios_" prefix so tools don't clash with Android tool names
70
+ const prefix = "ios_";
71
+ (0, ios_tools_js_1.registerIosTools)(server, this.simctl, this.config.bundleId, prefix);
72
+ }
73
+ }
74
+ exports.IosAdapter = IosAdapter;
75
+ //# sourceMappingURL=ios-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ios-tools.d.ts","sourceRoot":"","sources":["../../src/tools/ios-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAkGlE,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,IAAI,CA+6BN"}