@agimon-ai/po-ios 0.0.1-alpha.95 → 0.0.1-alpha.96

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.
Files changed (2) hide show
  1. package/README.md +35 -70
  2. package/package.json +12 -12
package/README.md CHANGED
@@ -1,115 +1,80 @@
1
1
  # @agimon-ai/po-ios
2
2
 
3
- Leased iOS simulators from a machine-wide pool, with app install, launch, accessibility-driven taps and typing, screenshots and logs for Po sessions.
3
+ Lease iOS simulators from a machine-wide pool, install and launch apps, inspect accessibility, interact, capture screenshots and read logs. Paired physical phones support a narrower, explicitly approved workflow.
4
4
 
5
- This package is a composable [Po](https://www.npmjs.com/package/@agimon-ai/po) subsystem. Use it through native server composition in the distribution.
5
+ Requires Node.js 24 or newer, macOS, Xcode and an installed iOS simulator runtime.
6
6
 
7
- ## Requirements
7
+ ## Enable and use
8
8
 
9
- - Node.js 24 or newer
10
- - macOS with Xcode and at least one iOS simulator runtime
9
+ Define an `ios` layer with `packages: ['@agimon-ai/po-ios']` in your modes file, include it in a major mode, then run `po sync`. The package is opt-in and absent from starter configs.
11
10
 
12
- ## Install
13
-
14
- The package is opt-in and intentionally absent from init templates. Define an `ios` layer with `packages: ['@agimon-ai/po-ios']` in your modes file, then select that layer in a major mode. The package declares server, web and native discovery metadata.
15
-
16
- ## Use
17
-
18
- In a code-mode `exec` script:
11
+ Read the [iOS guide](src/prompts/codemode-how-to-ios/SKILL.md), discover `ios`, then use code mode:
19
12
 
20
13
  ```ts
21
14
  await ios.acquire({ label: 'login flow' });
22
- const { bundleId } = await ios.install({ path: '/abs/Build/Products/Debug-iphonesimulator/App.app' });
23
- await ios.launch({ bundleId });
24
- await ios.screenshot();
25
- await ios.release();
15
+ try {
16
+ const { bundleId } = await ios.install({ path: '/abs/Build/Products/Debug-iphonesimulator/App.app' });
17
+ await ios.launch({ bundleId });
18
+ await ios.screenshot();
19
+ } finally {
20
+ await ios.release();
21
+ }
26
22
  ```
27
23
 
28
- ## Activity, viewer and Settings
24
+ Input acknowledgement is not UI completion. Use `waitFor` after actions and release the lease when finished.
29
25
 
30
- Web/native UI contributions shipped in `0.0.1-alpha.5`:
26
+ Activity shows devices, lease ownership and the latest registered build. **View screen** opens the session's leased simulator without replacing the composer. Capture is authenticated and visible-only; release or ownership loss clears the image. Physical-device screen capture is unsupported.
31
27
 
32
- - In an iOS-enabled session, Activity shows real devices, lease ownership and the latest registered build. View screen opens the current session's leased simulator in an internal tab and keeps the composer available. Capture is authenticated, serial and visible-only; release or ownership loss clears the image. Physical-device screen capture is unsupported.
33
- - Global Settings > iOS edits the development Team ID, per-phone availability and simulator pool settings. Conflicts retain drafts. Saving does not restart an active service or interrupt a lease; pending settings require an explicit iOS service restart. A saved Team ID does not establish signing or IPA installation eligibility.
34
- - Registered build handoff reuses artifact storage and guarded streaming. Download and copy-link actions require available remote sharing and mint ephemeral bearer access; remote access is never enabled implicitly. Open in Po uses the internal artifact tab. A downloaded ZIP or IPA is not an installation success.
28
+ Registered-build download and copy-link actions need available remote sharing and mint ephemeral bearer access. They never enable remote access implicitly. Downloading a ZIP or IPA does not establish installation success.
35
29
 
36
- Isolated packed-source web acceptance verified a real 552 × 1200 simulator PNG, release clearing, Settings persistence and concurrent-save conflict handling on source `9595ac8`. The later release repair changed only a system-test fixture. The twelve current r2 story visuals were explicitly approved separately; native-app UI execution remains unverified. Earlier-candidate build handoff and large-streaming checks are separate evidence, not final-release acceptance.
30
+ ## Simulator pool
37
31
 
38
- ## Package behavior
32
+ Each server elects one host-wide owner. Servers sharing a Po home coordinate leases through `po/db`; Po's simulators live under `<po home>/ios/devices`, not in the person's default set.
39
33
 
40
- Each server elects one host-wide pool owner, including when a workspace selects the iOS layer. Servers using the same Po home share pool state through `po/db` (`ios_*` tables); simulators live at `<po home>/ios/devices`, never in the person's default set. Size it in `<po home>/config.yaml` (global only, read once per activation):
34
+ Configure the pool in the host's `<po home>/config.yaml`:
41
35
 
42
36
  ```yaml
43
37
  ios:
44
38
  pool:
45
- maxBooted: 2 # simulators booted at once, machine-wide (the smallest value among running servers wins)
46
- maxDevices: 4 # simulators Po creates in total
47
- minBooted: 0 # kept booted while idle
39
+ maxBooted: 2
40
+ maxDevices: 4
41
+ minBooted: 0
48
42
  idleShutdownMinutes: 10
49
43
  waitTimeoutSeconds: 120
50
44
  ```
51
45
 
52
- Release uninstalls the apps a session installed and keeps the device warm. Devices of a dead server are erased before reuse.
53
-
54
- Accessibility and touch (`observe`, `tap`, `type`, `swipe`, `pressButton`, `waitFor`, `settle`) go through a resident Swift helper in `native/sim-helper`. The server builds it on first use with the person's Xcode (`xcrun swift build`) into `<po home>/ios/native/<hash>/`; set `ios.helperPath` to use a prebuilt one instead. On Xcode 27.1 (27A9275) and iOS 26.5, direct native-protocol trials verified observation, taps, timed swipes, US-layout ASCII typing (including shifted punctuation and return), home and lock. Arbitrary Unicode text, touches on a landscape app interface and Siri/volume buttons explicitly return `IOS_HELPER_UNAVAILABLE`, with no clipboard or AX-value fallback. Unsupported text is rejected before any keys are emitted. Missing or changed private API shapes also fail explicitly. See `native/sim-helper/PRIVATE_APIS.md` for evidence and limits.
55
-
56
- This is a partial implementation, not completion of the full iOS plan. Built-layer trials verified the supported simulator workflow, stale refs, fail-closed Unicode rejection, release/warm reuse, crash reclaim and unchanged helper-binary cache reuse. Three immediate release/reinstall/launch cycles passed after fixing zero-frame window readiness. Separate native trials verified A-only tap/text and B-only taps across two portrait simulators. Observation follows an app's landscape interface, but no tested touch mapping reached it, so landscape taps and swipes are refused. The child borrowed-lease check remains unverified; the inline child reported no `exec` tool. Input acknowledgment is not UI completion: use `waitFor` after actions. A lock transition took about three seconds to appear in AX observations.
57
-
58
- Physical devices: `ios.devices()` lists what CoreDevice sees (`xcrun devicectl list devices`), and `ios.acquireDevice({ udid })` leases a paired, reachable phone after the person approves it. An idle disconnected tunnel is checked with a bounded device-info request rather than rejected solely by its listed state. A phone lease shares the `ios_lease` table (`kind = 'device'`) so two sessions never hold one phone, but it has no `ios_device` row: the pool never boots, erases or counts it against `maxBooted`. Signed app install, uninstall, launch and console logs work without a runner. Phone `logs` is partial: `launch` keeps `devicectl device process launch --console` attached and buffers the app's stdout, stderr and NSLog lines (last 5000, 12 hours at most), because `log collect --device-udid` requires root. The unified system log, `process` and `subsystem` are not available on a phone.
59
-
60
- For phone accessibility and input, set `ios.device.developmentTeam` in the admitted host config (`~/.po/config.yaml`) and connect the phone by USB. First use builds and installs Po's own signed XCUITest runner with automatic provisioning. It binds only a USB IPv4 link-local address (`169.254.*`), requires a random per-run token and reuses the helper protocol. No WDA, Appium or iproxy is used. Observation selects a foreground app launched under this lease, otherwise SpringBoard. Release stops the runner and uninstalls its test host before freeing the lease, leaving the person's other apps installed. Cleanup failure holds the lease and can be retried. Phone screenshots, terminate and openUrl remain unavailable through `ios`; home, lock and Siri fail explicitly. Volume and rotation are unverified. An explicit bottom-edge swipe can leave an app.
46
+ The smallest `maxBooted` among running servers wins. Configuration is read at activation. Settings saves do not interrupt leases or restart services; pending changes require an explicit iOS service restart.
61
47
 
62
- Live phone evidence (iPhone 15 Pro, iOS 26.6.2, Xcode 27.1): listing by CoreDevice identifier and UDID, a wildcard development-profile build installed, launched and uninstalled, and `createDeviceCtl` console capture returned the sample app's stderr, stdout, NSLog and tick lines, then nothing after `forgetConsole`. Separate native runner trials verified probe, observation, tap, swipe and focused typing over USB. Home acknowledged without navigation, so it is now refused. A direct `devicectl` screenshot confirmed the typed text without submitting it; this does not establish `ios.screenshot` support. The probe runner was uninstalled. Automated service tests cover signing gates, protocol/authentication, cancellation and retryable cleanup. The initial built-layer phone run timed out waiting for launch status and was cleaned up separately. After the buffering fix, the approved built-layer rerun passed install, automatic runner observation, launch, waitFor, tap/count change, exact typing, secure-value exclusion, app console capture, explicit home refusal, sample uninstall and lease release. No lease or matching sample/runner app remained. Its keyboard-up swipe changed visible rows, but content scrolling was not established; the stronger scrolling result belongs to the separate platform-shell trial.
48
+ Release uninstalls apps installed by the session and keeps the simulator warm. A dead server's devices are erased before reuse.
63
49
 
64
- Automatic startup passed after the phone was unlocked: signed build/start, token handshake, a 53-element observation, explicit home refusal and runner cleanup completed in about 12 seconds. A real injected-platform-shell trial then exposed buffered `devicectl` status output: app logs streamed, but `launch` waited until timeout for its success line. Console launches now set `NSUnbufferedIO=YES`. The same platform-shell pipeline passed install, runner startup, launch, tap/count change, exact typed text, secure-value exclusion, visible-row swipe changes, app console and cleanup in about 19 seconds. The subsequent built-layer result is recorded separately above. Keep the phone unlocked and awake during startup.
50
+ Accessibility and input use the resident Swift helper in `native/sim-helper`. First use builds it with `xcrun swift build` into `<po home>/ios/native/<hash>/`; `ios.helperPath` can select a prebuilt helper. Unsupported private API shapes fail explicitly. See [private API evidence and limits](native/sim-helper/PRIVATE_APIS.md).
65
51
 
66
- ## Help
52
+ Supported simulator trials covered portrait taps, timed swipes, US-layout ASCII typing, home and lock. Arbitrary Unicode, landscape-app touches, Siri and volume buttons return `IOS_HELPER_UNAVAILABLE`, with no clipboard or accessibility-value fallback. Unsupported text is rejected before emitting keys. An accessibility observation of a landscape interface is not proof that touch mapping works.
67
53
 
68
- The published package includes `llms.txt` and `src/prompts/codemode-how-to-ios/SKILL.md`, served by `resource/codemode-how-to-ios.server.ts`.
54
+ ## Physical phones
69
55
 
70
- ## Public API
56
+ `ios.devices()` lists CoreDevice-visible devices. `ios.acquireDevice({ udid })` requires a paired, reachable phone and the person's approval. Phone leases share the lease table but are never booted, erased, or counted against simulator limits.
71
57
 
72
- ```ts
73
- import { IOS_POOL_CONTRACT, type IosPool } from '@agimon-ai/po-ios';
74
- ```
58
+ Signed app install, uninstall, launch and console capture work without a UI runner. Console logs retain at most 5,000 lines for 12 hours from a process launched with `--console`; unified system logs and process/subsystem filtering are unavailable.
75
59
 
76
- The native server entry is also available at:
77
-
78
- ```text
79
- @agimon-ai/po-ios/extensions/server
80
- ```
60
+ For accessibility and input, set `ios.device.developmentTeam` in host configuration and connect by USB. Keep the phone unlocked and awake during startup. First use builds and installs Po's signed XCUITest runner with automatic provisioning. A saved Team ID alone does not prove signing or IPA eligibility.
81
61
 
82
- The build generates host entrypoints in `generated/` from named `src/extensions` routes. Pure re-export modules in `src/exports` expose selected public capabilities. Keep typed authoring helpers in a dedicated subpath with no host/runtime imports so repository modules can bundle them cheaply.
62
+ The runner binds only a USB IPv4 link-local address (`169.254.*`) and requires a random per-run token. It observes the foreground app launched under the lease, otherwise SpringBoard. Release stops the runner and removes its test host before freeing the lease, leaving other apps installed. Cleanup failure retains the lease for retry.
83
63
 
84
- ## Structure and lifecycle
64
+ Phone screenshots, terminate, openUrl, home, lock and Siri are unavailable through `ios`. Volume and rotation are unverified. A swipe may leave an app; visible-row changes alone do not establish content scrolling.
85
65
 
86
- - `extensions/`: path-routed host contracts. Every scanned file default-exports one typed `define*` declaration.
87
- - `services/{serviceName}/`: package logic, with `index.ts` and `type.ts`.
88
- - `models/`: host-neutral state and transitions.
89
- - `constants/`, `schemas/`, and `types/`: shared metadata, validation, and contracts.
90
- - Private `_lib/` and `_components/` folders beside routes hold surface-private implementation and are not scanned.
66
+ ## Evidence boundaries
91
67
 
92
- Use scoped `root.server.ts` `defineRoot` factories for shared dependencies, Cordis services and lifecycle. Put each tool, command, hook, method, API, resource, and presentation contribution in its own named routed file. Do not use catch-all entries, named exports in routes, or freeform route implementation.
68
+ Earlier packed-source web acceptance on source `9595ac8` covered a real simulator PNG, release clearing, Settings persistence and save conflicts. Twelve r2 story visuals were explicitly approved separately. Native-app UI execution remains unverified; approved images are not runtime acceptance.
93
69
 
94
- Give each event one owner. Server plugins own session hooks and shared runtime services.
95
-
96
- The lifecycle is construct, register, `onStart`, run, `onStop`, unregister, `onDispose`. All hooks are optional and receive one typed context. The helper awaits startup before readiness. Shutdown aborts the context signal, stops work, removes registrations in reverse order, and performs final cleanup. Failed startup awaits rollback. Optional provider replacement rebinds contributions without restarting the plugin. Minor-mode actions are independent of mounting.
97
-
98
- Factories construct state; `onStart` begins external work. `onStop` runs when the start stage was reached, including a failed `onStart`. Use `onDispose` only for remaining instance resources. Do not add empty hooks or manual registration cleanup.
70
+ Recorded simulator and iPhone trials cover selected installation, input, logs and cleanup paths, not the full iOS plan. Borrowed child leases remain unverified. Consult the helper evidence before relying on a platform operation; this README review did not rerun physical-device or simulator trials.
99
71
 
100
72
  ## Development
101
73
 
102
74
  ```bash
103
- pnpm build
104
- pnpm typecheck
105
- pnpm test
106
- pnpm lint
107
- pnpm exec vibe-lint check .
108
- npm pack --dry-run
75
+ pnpm exec nx run-many -t lint typecheck build test -p @agimon-ai/po-ios
109
76
  ```
110
77
 
111
- Maintained by [Agimon](https://agimon.ai/about).
112
-
113
78
  ## License
114
79
 
115
80
  Business Source License 1.1: free for personal use, organisations under USD 1M revenue, non-profits and education. See [LICENSE](LICENSE) and https://agimon.ai/licensing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-ios",
3
- "version": "0.0.1-alpha.95",
3
+ "version": "0.0.1-alpha.96",
4
4
  "description": "Leased iOS simulators and accessibility-first app control for Po sessions",
5
5
  "keywords": [
6
6
  "coding-agent",
@@ -68,23 +68,23 @@
68
68
  "access": "public"
69
69
  },
70
70
  "dependencies": {
71
- "@agimon-ai/po-artifact": "0.0.0-alpha.159",
72
- "@agimon-ai/po-config": "0.0.0-alpha.160",
73
- "@agimon-ai/po-core": "0.0.0-alpha.160",
74
- "@agimon-ai/po-db": "0.0.0-alpha.160",
75
- "@agimon-ai/po-web-components": "0.0.0-alpha.160",
71
+ "@agimon-ai/po-artifact": "0.0.0-alpha.160",
72
+ "@agimon-ai/po-config": "0.0.0-alpha.161",
73
+ "@agimon-ai/po-core": "0.0.0-alpha.161",
74
+ "@agimon-ai/po-db": "0.0.0-alpha.161",
75
+ "@agimon-ai/po-web-components": "0.0.0-alpha.161",
76
76
  "@deepseek-ai/cordis": "4.0.5",
77
77
  "@tanstack/react-store": "0.11.2",
78
78
  "react": "19.3.1",
79
79
  "typebox": "1.4.2"
80
80
  },
81
81
  "devDependencies": {
82
- "@agimon-ai/po-build": "0.0.0-alpha.160",
83
- "@agimon-ai/po-native-components": "0.0.0-alpha.160",
84
- "@agimon-ai/po-profile": "0.0.0-alpha.160",
85
- "@agimon-ai/po-vault": "0.0.0-alpha.160",
86
- "@agimon-ai/vibe-lint-plugin-po-extension": "0.0.0-alpha.160",
87
- "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.160",
82
+ "@agimon-ai/po-build": "0.0.0-alpha.161",
83
+ "@agimon-ai/po-native-components": "0.0.0-alpha.161",
84
+ "@agimon-ai/po-profile": "0.0.0-alpha.161",
85
+ "@agimon-ai/po-vault": "0.0.0-alpha.161",
86
+ "@agimon-ai/vibe-lint-plugin-po-extension": "0.0.0-alpha.161",
87
+ "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.161",
88
88
  "@earendil-works/pi-coding-agent": "1.5.1",
89
89
  "@types/node": "26.6.5",
90
90
  "@types/react": "19.3.0",