@agimon-ai/po-ios 0.0.1-alpha.1 → 0.0.1-alpha.11

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 (35) hide show
  1. package/README.md +21 -5
  2. package/dist/apiContracts.cjs +190 -4
  3. package/dist/apiContracts.cjs.map +1 -1
  4. package/dist/apiContracts.d.mts +0 -1
  5. package/dist/apiContracts.d.mts.map +1 -1
  6. package/dist/apiContracts.mjs +188 -3
  7. package/dist/apiContracts.mjs.map +1 -1
  8. package/dist/{contracts-D41ZfB5m.mjs → contracts-BQjfOjy0.mjs} +6 -2
  9. package/dist/contracts-BQjfOjy0.mjs.map +1 -0
  10. package/dist/{contracts-C54pSczx.cjs → contracts-EZxEDrrj.cjs} +23 -1
  11. package/dist/contracts-EZxEDrrj.cjs.map +1 -0
  12. package/dist/extensions/native.mjs +1310 -0
  13. package/dist/extensions/native.mjs.map +1 -0
  14. package/dist/extensions/server.cjs +1505 -240
  15. package/dist/extensions/server.cjs.map +1 -1
  16. package/dist/extensions/server.d.mts.map +1 -1
  17. package/dist/extensions/server.mjs +1510 -245
  18. package/dist/extensions/server.mjs.map +1 -1
  19. package/dist/extensions/web.mjs +1025 -0
  20. package/dist/extensions/web.mjs.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.mts +78 -3
  23. package/dist/index.d.mts.map +1 -1
  24. package/dist/index.mjs +1 -1
  25. package/native/device-runner/PoRunner.xcodeproj/project.pbxproj +204 -0
  26. package/native/device-runner/PoRunner.xcodeproj/xcshareddata/xcschemes/PoRunner.xcscheme +20 -0
  27. package/native/device-runner/PoRunnerUITests/Runner.swift +231 -0
  28. package/native/sim-helper/PRIVATE_APIS.md +15 -2
  29. package/native/sim-helper/Sources/PoIosCore/Protocol.swift +24 -0
  30. package/native/sim-helper/Sources/PoIosSimHelper/Backends.swift +26 -39
  31. package/native/sim-helper/Sources/PoIosSimHelper/PrivateApis.swift +2 -4
  32. package/package.json +61 -8
  33. package/src/prompts/codemode-how-to-ios/SKILL.md +28 -7
  34. package/dist/contracts-C54pSczx.cjs.map +0 -1
  35. package/dist/contracts-D41ZfB5m.mjs.map +0 -1
package/README.md CHANGED
@@ -11,7 +11,7 @@ This package is a composable [Po](https://www.npmjs.com/package/@agimon-ai/po) s
11
11
 
12
12
  ## Install
13
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 poServer metadata for native server discovery.
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
15
 
16
16
  ## Use
17
17
 
@@ -25,9 +25,19 @@ await ios.screenshot();
25
25
  await ios.release();
26
26
  ```
27
27
 
28
+ ## Activity, viewer and Settings
29
+
30
+ Web/native UI contributions shipped in `0.0.1-alpha.5`:
31
+
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.
35
+
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.
37
+
28
38
  ## Package behavior
29
39
 
30
- One pool serves every Po server on the machine. Pool state lives in the shared `po/db` (`ios_*` tables); simulators live in Po's own device set at `<po home>/ios/devices`, never in the person's default set. Size it in `~/.po/config.yaml` (global only, read once per server):
40
+ Each server elects one global 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):
31
41
 
32
42
  ```yaml
33
43
  ios:
@@ -41,11 +51,17 @@ ios:
41
51
 
42
52
  Release uninstalls the apps a session installed and keeps the device warm. Devices of a dead server are erased before reuse.
43
53
 
44
- 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 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.
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 global config 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.
45
61
 
46
- This is a documented partial implementation, not completed acceptance of the full iOS plan. Rotation, two-device isolation and built-layer smoke remain unverified. Input acknowledgment does not mean the UI transition has finished; a lock transition took about three seconds to appear in AX observations.
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.
47
63
 
48
- 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`. On a phone only `install` (a device-signed `.app`), `uninstall`, `launch` and `release` work; release only drops the lease. Phone console capture and the XCUITest runner are not implemented. Other phone calls explicitly return `IOS_UNSUPPORTED_HOST`. Live signed-app and runner acceptance is still pending.
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.
49
65
 
50
66
  ## Help
51
67
 
@@ -2,13 +2,199 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
+ let _agimon_ai_po_core_apiContracts = require("@agimon-ai/po-core/apiContracts");
6
+ let _agimon_ai_po_core_pluginProtocol = require("@agimon-ai/po-core/pluginProtocol");
7
+ let typebox = require("typebox");
8
+ //#region src/types/iosUi.ts
9
+ /** JSON-only iOS UI contracts. Lease ownership and paths are resolved by the server. */
10
+ const iosActivityChannel = "ios_activity";
11
+ //#endregion
12
+ //#region src/schemas/iosSettingsMethods.ts
13
+ const Availability = typebox.Type.Union([typebox.Type.Literal("available"), typebox.Type.Literal("excluded")]);
14
+ const Pool = typebox.Type.Object({
15
+ minBooted: typebox.Type.Number(),
16
+ maxBooted: typebox.Type.Number(),
17
+ maxDevices: typebox.Type.Number(),
18
+ idleShutdownMinutes: typebox.Type.Number(),
19
+ waitTimeoutSeconds: typebox.Type.Number(),
20
+ deviceType: typebox.Type.Optional(typebox.Type.String()),
21
+ runtime: typebox.Type.Optional(typebox.Type.String())
22
+ });
23
+ /** Read-only activation snapshot and discovered inventory. Never starts signing, leases or runtimes. */
24
+ const iosSettingsMethod = (0, _agimon_ai_po_core_pluginProtocol.definePoPluginMethod)({
25
+ service: "ios",
26
+ method: "settings",
27
+ scope: "global",
28
+ direction: "client-to-server",
29
+ input: typebox.Type.Object({}, { additionalProperties: false }),
30
+ output: typebox.Type.Object({
31
+ active: typebox.Type.Boolean(),
32
+ configFile: typebox.Type.String(),
33
+ applied: typebox.Type.Optional(typebox.Type.Object({
34
+ pool: Pool,
35
+ developmentTeam: typebox.Type.Optional(typebox.Type.String()),
36
+ availability: typebox.Type.Record(typebox.Type.String(), Availability)
37
+ })),
38
+ phones: typebox.Type.Array(typebox.Type.Object({
39
+ udid: typebox.Type.String(),
40
+ name: typebox.Type.String(),
41
+ paired: typebox.Type.Boolean(),
42
+ connected: typebox.Type.Boolean(),
43
+ leased: typebox.Type.Boolean(),
44
+ availability: Availability
45
+ })),
46
+ runtimes: typebox.Type.Array(typebox.Type.Object({
47
+ identifier: typebox.Type.String(),
48
+ name: typebox.Type.String(),
49
+ isAvailable: typebox.Type.Boolean(),
50
+ models: typebox.Type.Array(typebox.Type.Object({
51
+ identifier: typebox.Type.String(),
52
+ name: typebox.Type.String()
53
+ }))
54
+ })),
55
+ inventoryError: typebox.Type.Optional(typebox.Type.String()),
56
+ runtimeError: typebox.Type.Optional(typebox.Type.String())
57
+ })
58
+ });
59
+ //#endregion
60
+ //#region src/schemas/iosUiMethods.ts
61
+ const address = {
62
+ service: "ios",
63
+ scope: "session",
64
+ direction: "client-to-server"
65
+ };
66
+ const Hash = typebox.Type.String({ pattern: "^[a-f0-9]{64}$" });
67
+ const CapturedAt = typebox.Type.Number({ minimum: 0 });
68
+ const IosActivitySchema = typebox.Type.Object({
69
+ supported: typebox.Type.Boolean(),
70
+ devices: typebox.Type.Array(typebox.Type.Object({
71
+ id: typebox.Type.String(),
72
+ name: typebox.Type.String(),
73
+ kind: typebox.Type.Union([typebox.Type.Literal("simulator"), typebox.Type.Literal("device")]),
74
+ detail: typebox.Type.String(),
75
+ state: typebox.Type.Union([
76
+ typebox.Type.Literal("owned"),
77
+ typebox.Type.Literal("other-session"),
78
+ typebox.Type.Literal("available"),
79
+ typebox.Type.Literal("disconnected")
80
+ ]),
81
+ leaseId: typebox.Type.Optional(typebox.Type.String()),
82
+ capture: typebox.Type.Union([typebox.Type.Literal("available"), typebox.Type.Literal("unsupported")])
83
+ })),
84
+ build: typebox.Type.Optional(typebox.Type.Object({
85
+ id: typebox.Type.String(),
86
+ name: typebox.Type.String(),
87
+ size: typebox.Type.Integer({ minimum: 0 }),
88
+ artifactPath: typebox.Type.String(),
89
+ registeredAt: typebox.Type.String()
90
+ })),
91
+ error: typebox.Type.Optional(typebox.Type.String())
92
+ });
93
+ const iosStatusMethod = (0, _agimon_ai_po_core_pluginProtocol.definePoPluginMethod)({
94
+ ...address,
95
+ method: "status",
96
+ input: typebox.Type.Object({}, { additionalProperties: false }),
97
+ output: IosActivitySchema
98
+ });
99
+ const iosFrameMethod = (0, _agimon_ai_po_core_pluginProtocol.definePoPluginMethod)({
100
+ ...address,
101
+ method: "frame",
102
+ input: typebox.Type.Object({
103
+ leaseId: typebox.Type.String({
104
+ minLength: 1,
105
+ maxLength: 128
106
+ }),
107
+ since: typebox.Type.Optional(Hash)
108
+ }, { additionalProperties: false }),
109
+ output: typebox.Type.Union([
110
+ typebox.Type.Object({
111
+ state: typebox.Type.Literal("ok"),
112
+ src: typebox.Type.String({ maxLength: 6291456 }),
113
+ hash: Hash,
114
+ capturedAt: CapturedAt
115
+ }),
116
+ typebox.Type.Object({
117
+ state: typebox.Type.Literal("unchanged"),
118
+ hash: Hash,
119
+ capturedAt: CapturedAt
120
+ }),
121
+ typebox.Type.Object({ state: typebox.Type.Literal("released") }),
122
+ typebox.Type.Object({
123
+ state: typebox.Type.Literal("capture-unavailable"),
124
+ message: typebox.Type.String()
125
+ }),
126
+ typebox.Type.Object({
127
+ state: typebox.Type.Literal("error"),
128
+ message: typebox.Type.String()
129
+ })
130
+ ])
131
+ });
132
+ const iosShareBuildMethod = (0, _agimon_ai_po_core_pluginProtocol.definePoPluginMethod)({
133
+ ...address,
134
+ method: "shareBuild",
135
+ input: typebox.Type.Object({ buildId: typebox.Type.String({
136
+ minLength: 16,
137
+ maxLength: 128
138
+ }) }, { additionalProperties: false }),
139
+ output: typebox.Type.Union([typebox.Type.Object({
140
+ ok: typebox.Type.Literal(true),
141
+ url: typebox.Type.String(),
142
+ expiresAt: typebox.Type.Number()
143
+ }), typebox.Type.Object({
144
+ ok: typebox.Type.Literal(false),
145
+ reason: typebox.Type.Union([
146
+ typebox.Type.Literal("remote-off"),
147
+ typebox.Type.Literal("changed"),
148
+ typebox.Type.Literal("missing"),
149
+ typebox.Type.Literal("unavailable")
150
+ ]),
151
+ message: typebox.Type.String()
152
+ })])
153
+ });
154
+ //#endregion
5
155
  //#region src/schemas/apiContracts.ts
6
- /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
7
- const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
156
+ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
8
157
  version: 1,
9
158
  http: [],
10
- sockets: [],
11
- dynamic: []
159
+ dynamic: [],
160
+ sockets: [
161
+ ...[
162
+ iosStatusMethod,
163
+ iosFrameMethod,
164
+ iosShareBuildMethod
165
+ ].map((method) => ({
166
+ id: `ios.${method.method}`,
167
+ scope: "session",
168
+ service: method.service,
169
+ member: method.method,
170
+ kind: "method",
171
+ direction: "client-to-server",
172
+ description: `Session-owned iOS ${method.method}.`,
173
+ input: method.input,
174
+ output: method.output
175
+ })),
176
+ {
177
+ id: "ios.settings",
178
+ scope: "global",
179
+ service: iosSettingsMethod.service,
180
+ member: iosSettingsMethod.method,
181
+ kind: "method",
182
+ direction: "client-to-server",
183
+ description: "Applied iOS configuration and discovered inventory.",
184
+ input: iosSettingsMethod.input,
185
+ output: iosSettingsMethod.output
186
+ },
187
+ {
188
+ id: "ios.activity",
189
+ scope: "session",
190
+ service: "po.hub",
191
+ member: iosActivityChannel,
192
+ kind: "channel",
193
+ direction: "server-to-client",
194
+ description: "Real session iOS devices and registered build metadata.",
195
+ input: IosActivitySchema
196
+ }
197
+ ]
12
198
  });
13
199
  //#endregion
14
200
  exports.apiContracts = apiContracts;
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
1
+ {"version":3,"file":"apiContracts.cjs","names":["Type","definePoPluginMethod","Type","definePoPluginMethod","defineApiContract"],"sources":["../src/types/iosUi.ts","../src/schemas/iosSettingsMethods.ts","../src/schemas/iosUiMethods.ts","../src/schemas/apiContracts.ts"],"sourcesContent":["/** JSON-only iOS UI contracts. Lease ownership and paths are resolved by the server. */\nexport const iosActivityChannel = 'ios_activity';\nexport const iosUiService = 'ios';\nexport const iosActivityReaderEvent = 'po-ios:activity-reader';\n\nexport interface IosDeviceView {\n id: string;\n name: string;\n kind: 'simulator' | 'device';\n detail: string;\n state: 'owned' | 'other-session' | 'available' | 'disconnected';\n /** Only present for a lease owned by this session's root. */\n leaseId?: string;\n capture: 'available' | 'unsupported';\n}\n\nexport interface IosBuildView {\n id: string;\n name: string;\n size: number;\n /** Durable artifact-relative path, never a bearer URL. */\n artifactPath: string;\n registeredAt: string;\n}\n\nexport interface IosActivityPayload {\n supported: boolean;\n devices: IosDeviceView[];\n build?: IosBuildView;\n error?: string;\n}\n\nexport type IosFrameReply =\n | { state: 'ok'; src: string; hash: string; capturedAt: number }\n | { state: 'unchanged'; hash: string; capturedAt: number }\n | { state: 'released' }\n | { state: 'capture-unavailable'; message: string }\n | { state: 'error'; message: string };\n\nexport type IosBuildShareReply =\n | { ok: true; url: string; expiresAt: number }\n | { ok: false; reason: 'remote-off' | 'changed' | 'missing' | 'unavailable'; message: string };\n","import { definePoPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport { Type } from 'typebox';\n\nconst Availability = Type.Union([Type.Literal('available'), Type.Literal('excluded')]);\nconst Pool = Type.Object({\n minBooted: Type.Number(),\n maxBooted: Type.Number(),\n maxDevices: Type.Number(),\n idleShutdownMinutes: Type.Number(),\n waitTimeoutSeconds: Type.Number(),\n deviceType: Type.Optional(Type.String()),\n runtime: Type.Optional(Type.String()),\n});\n\n/** Read-only activation snapshot and discovered inventory. Never starts signing, leases or runtimes. */\nexport const iosSettingsMethod = definePoPluginMethod({\n service: 'ios',\n method: 'settings',\n scope: 'global',\n direction: 'client-to-server',\n input: Type.Object({}, { additionalProperties: false }),\n output: Type.Object({\n active: Type.Boolean(),\n configFile: Type.String(),\n applied: Type.Optional(\n Type.Object({\n pool: Pool,\n developmentTeam: Type.Optional(Type.String()),\n availability: Type.Record(Type.String(), Availability),\n }),\n ),\n phones: Type.Array(\n Type.Object({\n udid: Type.String(),\n name: Type.String(),\n paired: Type.Boolean(),\n connected: Type.Boolean(),\n leased: Type.Boolean(),\n availability: Availability,\n }),\n ),\n runtimes: Type.Array(\n Type.Object({\n identifier: Type.String(),\n name: Type.String(),\n isAvailable: Type.Boolean(),\n models: Type.Array(Type.Object({ identifier: Type.String(), name: Type.String() })),\n }),\n ),\n inventoryError: Type.Optional(Type.String()),\n runtimeError: Type.Optional(Type.String()),\n }),\n});\n","import { definePoPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport { Type } from 'typebox';\n\nimport { iosUiService } from '../types/iosUi';\n\nconst address = { service: iosUiService, scope: 'session', direction: 'client-to-server' } as const;\nconst Hash = Type.String({ pattern: '^[a-f0-9]{64}$' });\nconst CapturedAt = Type.Number({ minimum: 0 });\n\nexport const IosActivitySchema = Type.Object({\n supported: Type.Boolean(),\n devices: Type.Array(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n kind: Type.Union([Type.Literal('simulator'), Type.Literal('device')]),\n detail: Type.String(),\n state: Type.Union([\n Type.Literal('owned'),\n Type.Literal('other-session'),\n Type.Literal('available'),\n Type.Literal('disconnected'),\n ]),\n leaseId: Type.Optional(Type.String()),\n capture: Type.Union([Type.Literal('available'), Type.Literal('unsupported')]),\n }),\n ),\n build: Type.Optional(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n size: Type.Integer({ minimum: 0 }),\n artifactPath: Type.String(),\n registeredAt: Type.String(),\n }),\n ),\n error: Type.Optional(Type.String()),\n});\n\nexport const iosStatusMethod = definePoPluginMethod({\n ...address,\n method: 'status',\n input: Type.Object({}, { additionalProperties: false }),\n output: IosActivitySchema,\n});\n\nexport const iosFrameMethod = definePoPluginMethod({\n ...address,\n method: 'frame',\n input: Type.Object(\n { leaseId: Type.String({ minLength: 1, maxLength: 128 }), since: Type.Optional(Hash) },\n { additionalProperties: false },\n ),\n output: Type.Union([\n Type.Object({\n state: Type.Literal('ok'),\n src: Type.String({ maxLength: 6 * 1024 * 1024 }),\n hash: Hash,\n capturedAt: CapturedAt,\n }),\n Type.Object({ state: Type.Literal('unchanged'), hash: Hash, capturedAt: CapturedAt }),\n Type.Object({ state: Type.Literal('released') }),\n Type.Object({ state: Type.Literal('capture-unavailable'), message: Type.String() }),\n Type.Object({ state: Type.Literal('error'), message: Type.String() }),\n ]),\n});\n\nexport const iosShareBuildMethod = definePoPluginMethod({\n ...address,\n method: 'shareBuild',\n input: Type.Object({ buildId: Type.String({ minLength: 16, maxLength: 128 }) }, { additionalProperties: false }),\n output: Type.Union([\n Type.Object({ ok: Type.Literal(true), url: Type.String(), expiresAt: Type.Number() }),\n Type.Object({\n ok: Type.Literal(false),\n reason: Type.Union([\n Type.Literal('remote-off'),\n Type.Literal('changed'),\n Type.Literal('missing'),\n Type.Literal('unavailable'),\n ]),\n message: Type.String(),\n }),\n ]),\n});\n","import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\nimport { iosActivityChannel } from '../types/iosUi';\nimport { iosSettingsMethod } from './iosSettingsMethods';\nimport { IosActivitySchema, iosFrameMethod, iosShareBuildMethod, iosStatusMethod } from './iosUiMethods';\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [],\n dynamic: [],\n sockets: [\n ...[iosStatusMethod, iosFrameMethod, iosShareBuildMethod].map((method) => ({\n id: `ios.${method.method}`,\n scope: 'session' as const,\n service: method.service,\n member: method.method,\n kind: 'method' as const,\n direction: 'client-to-server' as const,\n description: `Session-owned iOS ${method.method}.`,\n input: method.input,\n output: method.output,\n })),\n {\n id: 'ios.settings',\n scope: 'global',\n service: iosSettingsMethod.service,\n member: iosSettingsMethod.method,\n kind: 'method',\n direction: 'client-to-server',\n description: 'Applied iOS configuration and discovered inventory.',\n input: iosSettingsMethod.input,\n output: iosSettingsMethod.output,\n },\n {\n id: 'ios.activity',\n scope: 'session',\n service: 'po.hub',\n member: iosActivityChannel,\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Real session iOS devices and registered build metadata.',\n input: IosActivitySchema,\n },\n ],\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;;;AACA,MAAa,qBAAqB;;;ACElC,MAAM,eAAeA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,QAAQ,WAAW,GAAGA,QAAAA,KAAK,QAAQ,UAAU,CAAC,CAAC;AACrF,MAAM,OAAOA,QAAAA,KAAK,OAAO;CACvB,WAAWA,QAAAA,KAAK,OAAO;CACvB,WAAWA,QAAAA,KAAK,OAAO;CACvB,YAAYA,QAAAA,KAAK,OAAO;CACxB,qBAAqBA,QAAAA,KAAK,OAAO;CACjC,oBAAoBA,QAAAA,KAAK,OAAO;CAChC,YAAYA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;CACvC,SAASA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;AACtC,CAAC;;AAGD,MAAa,qBAAA,GAAoBC,kCAAAA,qBAAAA,CAAqB;CACpD,SAAS;CACT,QAAQ;CACR,OAAO;CACP,WAAW;CACX,OAAOD,QAAAA,KAAK,OAAO,CAAC,GAAG,EAAE,sBAAsB,MAAM,CAAC;CACtD,QAAQA,QAAAA,KAAK,OAAO;EAClB,QAAQA,QAAAA,KAAK,QAAQ;EACrB,YAAYA,QAAAA,KAAK,OAAO;EACxB,SAASA,QAAAA,KAAK,SACZA,QAAAA,KAAK,OAAO;GACV,MAAM;GACN,iBAAiBA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;GAC5C,cAAcA,QAAAA,KAAK,OAAOA,QAAAA,KAAK,OAAO,GAAG,YAAY;EACvD,CAAC,CACH;EACA,QAAQ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T,MAAM,CAAC;CACP,SAAS,CAAC;CACV,SAAS;EACP,GAAG;GAAC;GAAiB;GAAgB;EAAmB,CAAC,CAAC,KAAK,YAAY;GACzE,IAAI,OAAO,OAAO;GAClB,OAAO;GACP,SAAS,OAAO;GAChB,QAAQ,OAAO;GACf,MAAM;GACN,WAAW;GACX,aAAa,qBAAqB,OAAO,OAAO;GAChD,OAAO,OAAO;GACd,QAAQ,OAAO;EACjB,EAAE;EACF;GACE,IAAI;GACJ,OAAO;GACP,SAAS,kBAAkB;GAC3B,QAAQ,kBAAkB;GAC1B,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO,kBAAkB;GACzB,QAAQ,kBAAkB;EAC5B;EACA;GACE,IAAI;GACJ,OAAO;GACP,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;CACF;AACF,CAAC"}
@@ -1,5 +1,4 @@
1
1
  //#region src/schemas/apiContracts.d.ts
2
- /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
2
  export declare const apiContracts: {
4
3
  version: 1;
5
4
  protocols?: Record<string, string> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";qBAMa"}
@@ -1,11 +1,196 @@
1
1
  import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
2
+ import { definePoPluginMethod } from "@agimon-ai/po-core/pluginProtocol";
3
+ import { Type } from "typebox";
4
+ //#region src/types/iosUi.ts
5
+ /** JSON-only iOS UI contracts. Lease ownership and paths are resolved by the server. */
6
+ const iosActivityChannel = "ios_activity";
7
+ //#endregion
8
+ //#region src/schemas/iosSettingsMethods.ts
9
+ const Availability = Type.Union([Type.Literal("available"), Type.Literal("excluded")]);
10
+ const Pool = Type.Object({
11
+ minBooted: Type.Number(),
12
+ maxBooted: Type.Number(),
13
+ maxDevices: Type.Number(),
14
+ idleShutdownMinutes: Type.Number(),
15
+ waitTimeoutSeconds: Type.Number(),
16
+ deviceType: Type.Optional(Type.String()),
17
+ runtime: Type.Optional(Type.String())
18
+ });
19
+ /** Read-only activation snapshot and discovered inventory. Never starts signing, leases or runtimes. */
20
+ const iosSettingsMethod = definePoPluginMethod({
21
+ service: "ios",
22
+ method: "settings",
23
+ scope: "global",
24
+ direction: "client-to-server",
25
+ input: Type.Object({}, { additionalProperties: false }),
26
+ output: Type.Object({
27
+ active: Type.Boolean(),
28
+ configFile: Type.String(),
29
+ applied: Type.Optional(Type.Object({
30
+ pool: Pool,
31
+ developmentTeam: Type.Optional(Type.String()),
32
+ availability: Type.Record(Type.String(), Availability)
33
+ })),
34
+ phones: Type.Array(Type.Object({
35
+ udid: Type.String(),
36
+ name: Type.String(),
37
+ paired: Type.Boolean(),
38
+ connected: Type.Boolean(),
39
+ leased: Type.Boolean(),
40
+ availability: Availability
41
+ })),
42
+ runtimes: Type.Array(Type.Object({
43
+ identifier: Type.String(),
44
+ name: Type.String(),
45
+ isAvailable: Type.Boolean(),
46
+ models: Type.Array(Type.Object({
47
+ identifier: Type.String(),
48
+ name: Type.String()
49
+ }))
50
+ })),
51
+ inventoryError: Type.Optional(Type.String()),
52
+ runtimeError: Type.Optional(Type.String())
53
+ })
54
+ });
55
+ //#endregion
56
+ //#region src/schemas/iosUiMethods.ts
57
+ const address = {
58
+ service: "ios",
59
+ scope: "session",
60
+ direction: "client-to-server"
61
+ };
62
+ const Hash = Type.String({ pattern: "^[a-f0-9]{64}$" });
63
+ const CapturedAt = Type.Number({ minimum: 0 });
64
+ const IosActivitySchema = Type.Object({
65
+ supported: Type.Boolean(),
66
+ devices: Type.Array(Type.Object({
67
+ id: Type.String(),
68
+ name: Type.String(),
69
+ kind: Type.Union([Type.Literal("simulator"), Type.Literal("device")]),
70
+ detail: Type.String(),
71
+ state: Type.Union([
72
+ Type.Literal("owned"),
73
+ Type.Literal("other-session"),
74
+ Type.Literal("available"),
75
+ Type.Literal("disconnected")
76
+ ]),
77
+ leaseId: Type.Optional(Type.String()),
78
+ capture: Type.Union([Type.Literal("available"), Type.Literal("unsupported")])
79
+ })),
80
+ build: Type.Optional(Type.Object({
81
+ id: Type.String(),
82
+ name: Type.String(),
83
+ size: Type.Integer({ minimum: 0 }),
84
+ artifactPath: Type.String(),
85
+ registeredAt: Type.String()
86
+ })),
87
+ error: Type.Optional(Type.String())
88
+ });
89
+ const iosStatusMethod = definePoPluginMethod({
90
+ ...address,
91
+ method: "status",
92
+ input: Type.Object({}, { additionalProperties: false }),
93
+ output: IosActivitySchema
94
+ });
95
+ const iosFrameMethod = definePoPluginMethod({
96
+ ...address,
97
+ method: "frame",
98
+ input: Type.Object({
99
+ leaseId: Type.String({
100
+ minLength: 1,
101
+ maxLength: 128
102
+ }),
103
+ since: Type.Optional(Hash)
104
+ }, { additionalProperties: false }),
105
+ output: Type.Union([
106
+ Type.Object({
107
+ state: Type.Literal("ok"),
108
+ src: Type.String({ maxLength: 6291456 }),
109
+ hash: Hash,
110
+ capturedAt: CapturedAt
111
+ }),
112
+ Type.Object({
113
+ state: Type.Literal("unchanged"),
114
+ hash: Hash,
115
+ capturedAt: CapturedAt
116
+ }),
117
+ Type.Object({ state: Type.Literal("released") }),
118
+ Type.Object({
119
+ state: Type.Literal("capture-unavailable"),
120
+ message: Type.String()
121
+ }),
122
+ Type.Object({
123
+ state: Type.Literal("error"),
124
+ message: Type.String()
125
+ })
126
+ ])
127
+ });
128
+ const iosShareBuildMethod = definePoPluginMethod({
129
+ ...address,
130
+ method: "shareBuild",
131
+ input: Type.Object({ buildId: Type.String({
132
+ minLength: 16,
133
+ maxLength: 128
134
+ }) }, { additionalProperties: false }),
135
+ output: Type.Union([Type.Object({
136
+ ok: Type.Literal(true),
137
+ url: Type.String(),
138
+ expiresAt: Type.Number()
139
+ }), Type.Object({
140
+ ok: Type.Literal(false),
141
+ reason: Type.Union([
142
+ Type.Literal("remote-off"),
143
+ Type.Literal("changed"),
144
+ Type.Literal("missing"),
145
+ Type.Literal("unavailable")
146
+ ]),
147
+ message: Type.String()
148
+ })])
149
+ });
150
+ //#endregion
2
151
  //#region src/schemas/apiContracts.ts
3
- /** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
4
152
  const apiContracts = defineApiContract({
5
153
  version: 1,
6
154
  http: [],
7
- sockets: [],
8
- dynamic: []
155
+ dynamic: [],
156
+ sockets: [
157
+ ...[
158
+ iosStatusMethod,
159
+ iosFrameMethod,
160
+ iosShareBuildMethod
161
+ ].map((method) => ({
162
+ id: `ios.${method.method}`,
163
+ scope: "session",
164
+ service: method.service,
165
+ member: method.method,
166
+ kind: "method",
167
+ direction: "client-to-server",
168
+ description: `Session-owned iOS ${method.method}.`,
169
+ input: method.input,
170
+ output: method.output
171
+ })),
172
+ {
173
+ id: "ios.settings",
174
+ scope: "global",
175
+ service: iosSettingsMethod.service,
176
+ member: iosSettingsMethod.method,
177
+ kind: "method",
178
+ direction: "client-to-server",
179
+ description: "Applied iOS configuration and discovered inventory.",
180
+ input: iosSettingsMethod.input,
181
+ output: iosSettingsMethod.output
182
+ },
183
+ {
184
+ id: "ios.activity",
185
+ scope: "session",
186
+ service: "po.hub",
187
+ member: iosActivityChannel,
188
+ kind: "channel",
189
+ direction: "server-to-client",
190
+ description: "Real session iOS devices and registered build metadata.",
191
+ input: IosActivitySchema
192
+ }
193
+ ]
9
194
  });
10
195
  //#endregion
11
196
  export { apiContracts, apiContracts as default };
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
1
+ {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/types/iosUi.ts","../src/schemas/iosSettingsMethods.ts","../src/schemas/iosUiMethods.ts","../src/schemas/apiContracts.ts"],"sourcesContent":["/** JSON-only iOS UI contracts. Lease ownership and paths are resolved by the server. */\nexport const iosActivityChannel = 'ios_activity';\nexport const iosUiService = 'ios';\nexport const iosActivityReaderEvent = 'po-ios:activity-reader';\n\nexport interface IosDeviceView {\n id: string;\n name: string;\n kind: 'simulator' | 'device';\n detail: string;\n state: 'owned' | 'other-session' | 'available' | 'disconnected';\n /** Only present for a lease owned by this session's root. */\n leaseId?: string;\n capture: 'available' | 'unsupported';\n}\n\nexport interface IosBuildView {\n id: string;\n name: string;\n size: number;\n /** Durable artifact-relative path, never a bearer URL. */\n artifactPath: string;\n registeredAt: string;\n}\n\nexport interface IosActivityPayload {\n supported: boolean;\n devices: IosDeviceView[];\n build?: IosBuildView;\n error?: string;\n}\n\nexport type IosFrameReply =\n | { state: 'ok'; src: string; hash: string; capturedAt: number }\n | { state: 'unchanged'; hash: string; capturedAt: number }\n | { state: 'released' }\n | { state: 'capture-unavailable'; message: string }\n | { state: 'error'; message: string };\n\nexport type IosBuildShareReply =\n | { ok: true; url: string; expiresAt: number }\n | { ok: false; reason: 'remote-off' | 'changed' | 'missing' | 'unavailable'; message: string };\n","import { definePoPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport { Type } from 'typebox';\n\nconst Availability = Type.Union([Type.Literal('available'), Type.Literal('excluded')]);\nconst Pool = Type.Object({\n minBooted: Type.Number(),\n maxBooted: Type.Number(),\n maxDevices: Type.Number(),\n idleShutdownMinutes: Type.Number(),\n waitTimeoutSeconds: Type.Number(),\n deviceType: Type.Optional(Type.String()),\n runtime: Type.Optional(Type.String()),\n});\n\n/** Read-only activation snapshot and discovered inventory. Never starts signing, leases or runtimes. */\nexport const iosSettingsMethod = definePoPluginMethod({\n service: 'ios',\n method: 'settings',\n scope: 'global',\n direction: 'client-to-server',\n input: Type.Object({}, { additionalProperties: false }),\n output: Type.Object({\n active: Type.Boolean(),\n configFile: Type.String(),\n applied: Type.Optional(\n Type.Object({\n pool: Pool,\n developmentTeam: Type.Optional(Type.String()),\n availability: Type.Record(Type.String(), Availability),\n }),\n ),\n phones: Type.Array(\n Type.Object({\n udid: Type.String(),\n name: Type.String(),\n paired: Type.Boolean(),\n connected: Type.Boolean(),\n leased: Type.Boolean(),\n availability: Availability,\n }),\n ),\n runtimes: Type.Array(\n Type.Object({\n identifier: Type.String(),\n name: Type.String(),\n isAvailable: Type.Boolean(),\n models: Type.Array(Type.Object({ identifier: Type.String(), name: Type.String() })),\n }),\n ),\n inventoryError: Type.Optional(Type.String()),\n runtimeError: Type.Optional(Type.String()),\n }),\n});\n","import { definePoPluginMethod } from '@agimon-ai/po-core/pluginProtocol';\nimport { Type } from 'typebox';\n\nimport { iosUiService } from '../types/iosUi';\n\nconst address = { service: iosUiService, scope: 'session', direction: 'client-to-server' } as const;\nconst Hash = Type.String({ pattern: '^[a-f0-9]{64}$' });\nconst CapturedAt = Type.Number({ minimum: 0 });\n\nexport const IosActivitySchema = Type.Object({\n supported: Type.Boolean(),\n devices: Type.Array(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n kind: Type.Union([Type.Literal('simulator'), Type.Literal('device')]),\n detail: Type.String(),\n state: Type.Union([\n Type.Literal('owned'),\n Type.Literal('other-session'),\n Type.Literal('available'),\n Type.Literal('disconnected'),\n ]),\n leaseId: Type.Optional(Type.String()),\n capture: Type.Union([Type.Literal('available'), Type.Literal('unsupported')]),\n }),\n ),\n build: Type.Optional(\n Type.Object({\n id: Type.String(),\n name: Type.String(),\n size: Type.Integer({ minimum: 0 }),\n artifactPath: Type.String(),\n registeredAt: Type.String(),\n }),\n ),\n error: Type.Optional(Type.String()),\n});\n\nexport const iosStatusMethod = definePoPluginMethod({\n ...address,\n method: 'status',\n input: Type.Object({}, { additionalProperties: false }),\n output: IosActivitySchema,\n});\n\nexport const iosFrameMethod = definePoPluginMethod({\n ...address,\n method: 'frame',\n input: Type.Object(\n { leaseId: Type.String({ minLength: 1, maxLength: 128 }), since: Type.Optional(Hash) },\n { additionalProperties: false },\n ),\n output: Type.Union([\n Type.Object({\n state: Type.Literal('ok'),\n src: Type.String({ maxLength: 6 * 1024 * 1024 }),\n hash: Hash,\n capturedAt: CapturedAt,\n }),\n Type.Object({ state: Type.Literal('unchanged'), hash: Hash, capturedAt: CapturedAt }),\n Type.Object({ state: Type.Literal('released') }),\n Type.Object({ state: Type.Literal('capture-unavailable'), message: Type.String() }),\n Type.Object({ state: Type.Literal('error'), message: Type.String() }),\n ]),\n});\n\nexport const iosShareBuildMethod = definePoPluginMethod({\n ...address,\n method: 'shareBuild',\n input: Type.Object({ buildId: Type.String({ minLength: 16, maxLength: 128 }) }, { additionalProperties: false }),\n output: Type.Union([\n Type.Object({ ok: Type.Literal(true), url: Type.String(), expiresAt: Type.Number() }),\n Type.Object({\n ok: Type.Literal(false),\n reason: Type.Union([\n Type.Literal('remote-off'),\n Type.Literal('changed'),\n Type.Literal('missing'),\n Type.Literal('unavailable'),\n ]),\n message: Type.String(),\n }),\n ]),\n});\n","import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\nimport { iosActivityChannel } from '../types/iosUi';\nimport { iosSettingsMethod } from './iosSettingsMethods';\nimport { IosActivitySchema, iosFrameMethod, iosShareBuildMethod, iosStatusMethod } from './iosUiMethods';\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [],\n dynamic: [],\n sockets: [\n ...[iosStatusMethod, iosFrameMethod, iosShareBuildMethod].map((method) => ({\n id: `ios.${method.method}`,\n scope: 'session' as const,\n service: method.service,\n member: method.method,\n kind: 'method' as const,\n direction: 'client-to-server' as const,\n description: `Session-owned iOS ${method.method}.`,\n input: method.input,\n output: method.output,\n })),\n {\n id: 'ios.settings',\n scope: 'global',\n service: iosSettingsMethod.service,\n member: iosSettingsMethod.method,\n kind: 'method',\n direction: 'client-to-server',\n description: 'Applied iOS configuration and discovered inventory.',\n input: iosSettingsMethod.input,\n output: iosSettingsMethod.output,\n },\n {\n id: 'ios.activity',\n scope: 'session',\n service: 'po.hub',\n member: iosActivityChannel,\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Real session iOS devices and registered build metadata.',\n input: IosActivitySchema,\n },\n ],\n});\nexport default apiContracts;\n"],"mappings":";;;;;AACA,MAAa,qBAAqB;;;ACElC,MAAM,eAAe,KAAK,MAAM,CAAC,KAAK,QAAQ,WAAW,GAAG,KAAK,QAAQ,UAAU,CAAC,CAAC;AACrF,MAAM,OAAO,KAAK,OAAO;CACvB,WAAW,KAAK,OAAO;CACvB,WAAW,KAAK,OAAO;CACvB,YAAY,KAAK,OAAO;CACxB,qBAAqB,KAAK,OAAO;CACjC,oBAAoB,KAAK,OAAO;CAChC,YAAY,KAAK,SAAS,KAAK,OAAO,CAAC;CACvC,SAAS,KAAK,SAAS,KAAK,OAAO,CAAC;AACtC,CAAC;;AAGD,MAAa,oBAAoB,qBAAqB;CACpD,SAAS;CACT,QAAQ;CACR,OAAO;CACP,WAAW;CACX,OAAO,KAAK,OAAO,CAAC,GAAG,EAAE,sBAAsB,MAAM,CAAC;CACtD,QAAQ,KAAK,OAAO;EAClB,QAAQ,KAAK,QAAQ;EACrB,YAAY,KAAK,OAAO;EACxB,SAAS,KAAK,SACZ,KAAK,OAAO;GACV,MAAM;GACN,iBAAiB,KAAK,SAAS,KAAK,OAAO,CAAC;GAC5C,cAAc,KAAK,OAAO,KAAK,OAAO,GAAG,YAAY;EACvD,CAAC,CACH;EACA,QAAQ,KAAK,MACX,KAAK,OAAO;GACV,MAAM,KAAK,OAAO;GAClB,MAAM,KAAK,OAAO;GAClB,QAAQ,KAAK,QAAQ;GACrB,WAAW,KAAK,QAAQ;GACxB,QAAQ,KAAK,QAAQ;GACrB,cAAc;EACh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AC,GACpF,KAAK,OAAO;EACV,IAAI,KAAK,QAAQ,KAAK;EACtB,QAAQ,KAAK,MAAM;GACjB,KAAK,QAAQ,YAAY;GACzB,KAAK,QAAQ,SAAS;GACtB,KAAK,QAAQ,SAAS;GACtB,KAAK,QAAQ,aAAa;EAC5B,CAAC;EACD,SAAS,KAAK,OAAO;CACvB,CAAC,CACH,CAAC;AACH,CAAC;;;AC9ED,MAAa,eAAe,kBAAkB;CAC5C,SAAS;CACT,MAAM,CAAC;CACP,SAAS,CAAC;CACV,SAAS;EACP,GAAG;GAAC;GAAiB;GAAgB;EAAmB,CAAC,CAAC,KAAK,YAAY;GACzE,IAAI,OAAO,OAAO;GAClB,OAAO;GACP,SAAS,OAAO;GAChB,QAAQ,OAAO;GACf,MAAM;GACN,WAAW;GACX,aAAa,qBAAqB,OAAO,OAAO;GAChD,OAAO,OAAO;GACd,QAAQ,OAAO;EACjB,EAAE;EACF;GACE,IAAI;GACJ,OAAO;GACP,SAAS,kBAAkB;GAC3B,QAAQ,kBAAkB;GAC1B,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO,kBAAkB;GACzB,QAAQ,kBAAkB;EAC5B;EACA;GACE,IAAI;GACJ,OAAO;GACP,SAAS;GACT,QAAQ;GACR,MAAM;GACN,WAAW;GACX,aAAa;GACb,OAAO;EACT;CACF;AACF,CAAC"}
@@ -18,6 +18,9 @@ const SIMCTL_TIMEOUT_MS = 12e4;
18
18
  const BOOT_TIMEOUT_MS = 3e5;
19
19
  const MAX_COMMAND_OUTPUT_CHARS = 8388608;
20
20
  const SCREENSHOT_MAX_PIXELS = 1200;
21
+ /** A phone app's console: lines kept per device, and how long devicectl stays attached before it is stopped. */
22
+ const CONSOLE_MAX_LINES = 5e3;
23
+ const CONSOLE_MAX_MS = 432e5;
21
24
  /** Fixed tool path: never the server's own PATH. */
22
25
  const IOS_TOOL_PATH = "/usr/bin:/bin:/usr/sbin:/sbin";
23
26
  const IOS_ERROR_CODES = [
@@ -61,7 +64,8 @@ const SETTLE_DEFAULT_MS = 5e3;
61
64
  //#region src/schemas/contracts.ts
62
65
  /** Bound once at the global level; every session leases from the same pool. */
63
66
  const IOS_POOL_CONTRACT = defineServiceContract(IOS_POOL_SERVICE, { scope: "global" });
67
+ const IOS_SETTINGS_CONTRACT = defineServiceContract("po/ios-settings", { scope: "global" });
64
68
  //#endregion
65
- export { SETTLE_DEFAULT_MS as C, WAIT_MAX_POLL_MS as E, SCREENSHOT_MAX_PIXELS as S, WAIT_DEFAULT_MS as T, IOS_POOL_SERVICE as _, HELPER_MAX_LINE_CHARS as a, MAX_COMMAND_OUTPUT_CHARS as b, HELPER_RESTART_WINDOW_MS as c, HELPER_TIMEOUT_MS as d, IOS_DEVICE_NAME_PREFIX as f, IOS_POOL_DEFAULTS as g, IOS_PACKAGE as h, HELPER_BUILD_TIMEOUT_MS as i, HELPER_SOURCES as l, IOS_ERROR_CODES as m, BOOT_TIMEOUT_MS as n, HELPER_NATIVE_DIRECTORY as o, IOS_DEVICE_SET_DIRECTORY as p, HELPER_BUILD_LOCK as r, HELPER_PRODUCT as s, IOS_POOL_CONTRACT as t, HELPER_SOURCE_DIRECTORY as u, IOS_TOOL_PATH as v, SIMCTL_TIMEOUT_MS as w, ORPHAN_GRACE_MS as x, JANITOR_INTERVAL_MS as y };
69
+ export { MAX_COMMAND_OUTPUT_CHARS as C, SIMCTL_TIMEOUT_MS as D, SETTLE_DEFAULT_MS as E, WAIT_DEFAULT_MS as O, JANITOR_INTERVAL_MS as S, SCREENSHOT_MAX_PIXELS as T, IOS_ERROR_CODES as _, CONSOLE_MAX_MS as a, IOS_POOL_SERVICE as b, HELPER_MAX_LINE_CHARS as c, HELPER_RESTART_WINDOW_MS as d, HELPER_SOURCES as f, IOS_DEVICE_SET_DIRECTORY as g, IOS_DEVICE_NAME_PREFIX as h, CONSOLE_MAX_LINES as i, WAIT_MAX_POLL_MS as k, HELPER_NATIVE_DIRECTORY as l, HELPER_TIMEOUT_MS as m, IOS_SETTINGS_CONTRACT as n, HELPER_BUILD_LOCK as o, HELPER_SOURCE_DIRECTORY as p, BOOT_TIMEOUT_MS as r, HELPER_BUILD_TIMEOUT_MS as s, IOS_POOL_CONTRACT as t, HELPER_PRODUCT as u, IOS_PACKAGE as v, ORPHAN_GRACE_MS as w, IOS_TOOL_PATH as x, IOS_POOL_DEFAULTS as y };
66
70
 
67
- //# sourceMappingURL=contracts-D41ZfB5m.mjs.map
71
+ //# sourceMappingURL=contracts-BQjfOjy0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts-BQjfOjy0.mjs","names":[],"sources":["../src/constants/ios.ts","../src/schemas/contracts.ts"],"sourcesContent":["export const IOS_NAMESPACE = 'ios';\nexport const IOS_PACKAGE = '@agimon-ai/po-ios';\nexport const IOS_POOL_SERVICE = 'po/ios-pool';\n\n/** Table prefix in the shared `po/db`. */\nexport const IOS_DB_PREFIX = 'ios';\n/** `<po home>/ios/devices` is the simulator device set Po owns; the person's own simulators live elsewhere. */\nexport const IOS_DIRECTORY = 'ios';\nexport const IOS_DEVICE_SET_DIRECTORY = 'devices';\nexport const IOS_DEVICE_NAME_PREFIX = 'po-pool-';\n\nexport const IOS_POOL_DEFAULTS = {\n minBooted: 0,\n maxBooted: 2,\n maxDevices: 4,\n idleShutdownMinutes: 10,\n waitTimeoutSeconds: 120,\n} as const;\n\nexport const JANITOR_INTERVAL_MS = 60_000;\nexport const QUEUE_POLL_MS = 750;\n/** A set member with no row must stay orphaned this long before it is deleted, so a create in flight survives. */\nexport const ORPHAN_GRACE_MS = 5 * 60_000;\nexport const SIMCTL_TIMEOUT_MS = 120_000;\nexport const BOOT_TIMEOUT_MS = 300_000;\nexport const MAX_COMMAND_OUTPUT_CHARS = 8 * 1024 * 1024;\nexport const SCREENSHOT_MAX_PIXELS = 1200;\nexport const LOG_DEFAULT_SECONDS = 60;\nexport const LOG_DEFAULT_LINES = 200;\n/** A phone app's console: lines kept per device, and how long devicectl stays attached before it is stopped. */\nexport const CONSOLE_MAX_LINES = 5000;\nexport const CONSOLE_MAX_MS = 12 * 60 * 60_000;\n\n/** Fixed tool path: never the server's own PATH. */\nexport const IOS_TOOL_PATH = '/usr/bin:/bin:/usr/sbin:/sbin';\n\nexport const IOS_ERROR_CODES = [\n 'IOS_UNSUPPORTED_HOST',\n 'IOS_NO_XCODE',\n 'IOS_NO_RUNTIME',\n 'IOS_POOL_BUSY',\n 'IOS_NO_LEASE',\n 'IOS_LEASE_LOST',\n 'IOS_COMMAND_FAILED',\n 'IOS_INVALID_ARGUMENT',\n 'IOS_HELPER_UNAVAILABLE',\n 'IOS_ELEMENT_STALE',\n 'IOS_AMBIGUOUS',\n 'IOS_NO_MATCH',\n] as const;\n\n/** The resident Swift helper that reads accessibility and sends touches; built from source on first use. */\nexport const HELPER_PRODUCT = 'po-ios-sim-helper';\nexport const HELPER_PROTOCOL_VERSION = 1;\nexport const HELPER_SOURCE_DIRECTORY = 'native/sim-helper';\n/** Every file the helper build reads; their contents key the build cache. A contract test keeps this list complete. */\nexport const HELPER_SOURCES = [\n 'Package.swift',\n 'Sources/PoIosCore/Protocol.swift',\n 'Sources/PoIosCore/Compaction.swift',\n 'Sources/PoIosSimHelper/main.swift',\n 'Sources/PoIosSimHelper/PrivateApis.swift',\n 'Sources/PoIosSimHelper/Backends.swift',\n 'Tests/PoIosCoreTests/ProtocolTests.swift',\n 'Tests/PoIosCoreTests/CompactionTests.swift',\n] as const;\nexport const HELPER_NATIVE_DIRECTORY = 'native';\nexport const HELPER_BUILD_LOCK = 'helper-build';\nexport const HELPER_TIMEOUT_MS = 15_000;\nexport const HELPER_BUILD_TIMEOUT_MS = 10 * 60_000;\nexport const HELPER_MAX_RESTARTS = 3;\nexport const HELPER_RESTART_WINDOW_MS = 5 * 60_000;\nexport const HELPER_MAX_LINE_CHARS = 8 * 1024 * 1024;\n\nexport const WAIT_POLL_MS = 250;\nexport const WAIT_MAX_POLL_MS = 1000;\nexport const WAIT_DEFAULT_MS = 10_000;\nexport const SETTLE_DEFAULT_MS = 5000;\nexport const SETTLE_QUIET_MS = 500;\nexport const AMBIGUOUS_CANDIDATES = 5;\nexport const SWIPE_DEFAULT_MS = 300;\nexport const HARDWARE_BUTTONS = ['home', 'lock', 'siri', 'volumeUp', 'volumeDown'] as const;\n","import { defineServiceContract } from '@agimon-ai/po-core/extensionFile';\n\nimport { IOS_POOL_SERVICE } from '../constants/ios';\nimport type { IosPool } from '../services/devicePool/type';\nimport type { IosSettingsRuntime } from '../types/iosSettings';\n\n/** Bound once at the global level; every session leases from the same pool. */\nexport const IOS_POOL_CONTRACT = defineServiceContract<IosPool>(IOS_POOL_SERVICE, { scope: 'global' });\n\nexport const IOS_SETTINGS_CONTRACT = defineServiceContract<IosSettingsRuntime>('po/ios-settings', { scope: 'global' });\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/ios-pool': IosPool;\n 'po/ios-settings': IosSettingsRuntime;\n }\n}\n"],"mappings":";;AACA,MAAa,cAAc;AAC3B,MAAa,mBAAmB;AAMhC,MAAa,2BAA2B;AACxC,MAAa,yBAAyB;AAEtC,MAAa,oBAAoB;CAC/B,WAAW;CACX,WAAW;CACX,YAAY;CACZ,qBAAqB;CACrB,oBAAoB;AACtB;AAEA,MAAa,sBAAsB;;AAGnC,MAAa,kBAAkB;AAC/B,MAAa,oBAAoB;AACjC,MAAa,kBAAkB;AAC/B,MAAa,2BAA2B;AACxC,MAAa,wBAAwB;;AAIrC,MAAa,oBAAoB;AACjC,MAAa,iBAAiB;;AAG9B,MAAa,gBAAgB;AAE7B,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAa,iBAAiB;AAE9B,MAAa,0BAA0B;;AAEvC,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAa,0BAA0B;AACvC,MAAa,oBAAoB;AACjC,MAAa,oBAAoB;AACjC,MAAa,0BAA0B;AAEvC,MAAa,2BAA2B;AACxC,MAAa,wBAAwB;AAGrC,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,oBAAoB;;;;ACtEjC,MAAa,oBAAoB,sBAA+B,kBAAkB,EAAE,OAAO,SAAS,CAAC;AAErG,MAAa,wBAAwB,sBAA0C,mBAAmB,EAAE,OAAO,SAAS,CAAC"}
@@ -18,6 +18,9 @@ const SIMCTL_TIMEOUT_MS = 12e4;
18
18
  const BOOT_TIMEOUT_MS = 3e5;
19
19
  const MAX_COMMAND_OUTPUT_CHARS = 8388608;
20
20
  const SCREENSHOT_MAX_PIXELS = 1200;
21
+ /** A phone app's console: lines kept per device, and how long devicectl stays attached before it is stopped. */
22
+ const CONSOLE_MAX_LINES = 5e3;
23
+ const CONSOLE_MAX_MS = 432e5;
21
24
  /** Fixed tool path: never the server's own PATH. */
22
25
  const IOS_TOOL_PATH = "/usr/bin:/bin:/usr/sbin:/sbin";
23
26
  const IOS_ERROR_CODES = [
@@ -61,6 +64,7 @@ const SETTLE_DEFAULT_MS = 5e3;
61
64
  //#region src/schemas/contracts.ts
62
65
  /** Bound once at the global level; every session leases from the same pool. */
63
66
  const IOS_POOL_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)(IOS_POOL_SERVICE, { scope: "global" });
67
+ const IOS_SETTINGS_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)("po/ios-settings", { scope: "global" });
64
68
  //#endregion
65
69
  Object.defineProperty(exports, "BOOT_TIMEOUT_MS", {
66
70
  enumerable: true,
@@ -68,6 +72,18 @@ Object.defineProperty(exports, "BOOT_TIMEOUT_MS", {
68
72
  return BOOT_TIMEOUT_MS;
69
73
  }
70
74
  });
75
+ Object.defineProperty(exports, "CONSOLE_MAX_LINES", {
76
+ enumerable: true,
77
+ get: function() {
78
+ return CONSOLE_MAX_LINES;
79
+ }
80
+ });
81
+ Object.defineProperty(exports, "CONSOLE_MAX_MS", {
82
+ enumerable: true,
83
+ get: function() {
84
+ return CONSOLE_MAX_MS;
85
+ }
86
+ });
71
87
  Object.defineProperty(exports, "HELPER_BUILD_LOCK", {
72
88
  enumerable: true,
73
89
  get: function() {
@@ -164,6 +180,12 @@ Object.defineProperty(exports, "IOS_POOL_SERVICE", {
164
180
  return IOS_POOL_SERVICE;
165
181
  }
166
182
  });
183
+ Object.defineProperty(exports, "IOS_SETTINGS_CONTRACT", {
184
+ enumerable: true,
185
+ get: function() {
186
+ return IOS_SETTINGS_CONTRACT;
187
+ }
188
+ });
167
189
  Object.defineProperty(exports, "IOS_TOOL_PATH", {
168
190
  enumerable: true,
169
191
  get: function() {
@@ -219,4 +241,4 @@ Object.defineProperty(exports, "WAIT_MAX_POLL_MS", {
219
241
  }
220
242
  });
221
243
 
222
- //# sourceMappingURL=contracts-C54pSczx.cjs.map
244
+ //# sourceMappingURL=contracts-EZxEDrrj.cjs.map