@agimon-ai/po-ios 0.0.1-alpha.4 → 0.0.1-alpha.40

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 +13 -3
  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-DH0gdDYT.mjs → contracts-BqPFHpTp.mjs} +11 -3
  9. package/dist/contracts-BqPFHpTp.mjs.map +1 -0
  10. package/dist/{contracts-BsO_lEi8.cjs → contracts-CNgOvR5W.cjs} +34 -2
  11. package/dist/contracts-CNgOvR5W.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 +1198 -86
  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 +1201 -89
  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 +83 -2
  23. package/dist/index.d.mts.map +1 -1
  24. package/dist/index.mjs +1 -1
  25. package/native/device-runner/PoRunnerUITests/Runner.swift +14 -9
  26. package/native/sim-helper/Sources/PoIosCore/Compaction.swift +25 -20
  27. package/native/sim-helper/Sources/PoIosCore/Protocol.swift +26 -3
  28. package/native/sim-helper/Sources/PoIosSimHelper/Backends.swift +10 -12
  29. package/native/sim-helper/Sources/PoIosSimHelper/main.swift +4 -3
  30. package/native/sim-helper/Tests/PoIosCoreTests/CompactionTests.swift +41 -18
  31. package/native/sim-helper/Tests/PoIosCoreTests/ProtocolTests.swift +28 -0
  32. package/package.json +79 -14
  33. package/src/prompts/codemode-how-to-ios/SKILL.md +33 -3
  34. package/dist/contracts-BsO_lEi8.cjs.map +0 -1
  35. package/dist/contracts-DH0gdDYT.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,6 +25,16 @@ 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
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):
@@ -49,9 +59,9 @@ Physical devices: `ios.devices()` lists what CoreDevice sees (`xcrun devicectl l
49
59
 
50
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.
51
61
 
52
- 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 first built-layer phone run acquired and installed successfully, then timed out waiting for launch status; separate uninstall/release cleanup succeeded. Its repeated acceptance is pending after the fix below.
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.
53
63
 
54
- 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 built-layer phone check is separate. Keep the phone unlocked and awake during startup.
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.
55
65
 
56
66
  ## Help
57
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;;;ACEl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ACP,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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;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"}
@@ -35,7 +35,8 @@ const IOS_ERROR_CODES = [
35
35
  "IOS_HELPER_UNAVAILABLE",
36
36
  "IOS_ELEMENT_STALE",
37
37
  "IOS_AMBIGUOUS",
38
- "IOS_NO_MATCH"
38
+ "IOS_NO_MATCH",
39
+ "IOS_OBSERVE_TOO_LARGE"
39
40
  ];
40
41
  /** The resident Swift helper that reads accessibility and sends touches; built from source on first use. */
41
42
  const HELPER_PRODUCT = "po-ios-sim-helper";
@@ -60,11 +61,18 @@ const HELPER_MAX_LINE_CHARS = 8388608;
60
61
  const WAIT_MAX_POLL_MS = 1e3;
61
62
  const WAIT_DEFAULT_MS = 1e4;
62
63
  const SETTLE_DEFAULT_MS = 5e3;
64
+ /** Observe results above this many UTF-8 bytes go to a line file unless the caller picks an output. */
65
+ const OBSERVE_INLINE_MAX_BYTES = 1e4;
66
+ /** A recorder that exits this soon after starting failed to start. */
67
+ const RECORDING_EARLY_EXIT_MS = 2e3;
68
+ /** How long a stopped recorder may take to finalize its file before it is killed. */
69
+ const RECORDING_FINALIZE_MS = 1e4;
63
70
  //#endregion
64
71
  //#region src/schemas/contracts.ts
65
72
  /** Bound once at the global level; every session leases from the same pool. */
66
73
  const IOS_POOL_CONTRACT = defineServiceContract(IOS_POOL_SERVICE, { scope: "global" });
74
+ const IOS_SETTINGS_CONTRACT = defineServiceContract("po/ios-settings", { scope: "global" });
67
75
  //#endregion
68
- export { ORPHAN_GRACE_MS as C, WAIT_DEFAULT_MS as D, SIMCTL_TIMEOUT_MS as E, WAIT_MAX_POLL_MS as O, MAX_COMMAND_OUTPUT_CHARS as S, SETTLE_DEFAULT_MS as T, IOS_PACKAGE as _, HELPER_BUILD_LOCK as a, IOS_TOOL_PATH as b, HELPER_NATIVE_DIRECTORY as c, HELPER_SOURCES as d, HELPER_SOURCE_DIRECTORY as f, IOS_ERROR_CODES as g, IOS_DEVICE_SET_DIRECTORY as h, CONSOLE_MAX_MS as i, HELPER_PRODUCT as l, IOS_DEVICE_NAME_PREFIX as m, BOOT_TIMEOUT_MS as n, HELPER_BUILD_TIMEOUT_MS as o, HELPER_TIMEOUT_MS as p, CONSOLE_MAX_LINES as r, HELPER_MAX_LINE_CHARS as s, IOS_POOL_CONTRACT as t, HELPER_RESTART_WINDOW_MS as u, IOS_POOL_DEFAULTS as v, SCREENSHOT_MAX_PIXELS as w, JANITOR_INTERVAL_MS as x, IOS_POOL_SERVICE as y };
76
+ export { SIMCTL_TIMEOUT_MS as A, MAX_COMMAND_OUTPUT_CHARS as C, RECORDING_FINALIZE_MS as D, RECORDING_EARLY_EXIT_MS as E, WAIT_MAX_POLL_MS as M, SCREENSHOT_MAX_PIXELS as O, JANITOR_INTERVAL_MS as S, ORPHAN_GRACE_MS 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_DEFAULT_MS as j, SETTLE_DEFAULT_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, OBSERVE_INLINE_MAX_BYTES as w, IOS_TOOL_PATH as x, IOS_POOL_DEFAULTS as y };
69
77
 
70
- //# sourceMappingURL=contracts-DH0gdDYT.mjs.map
78
+ //# sourceMappingURL=contracts-BqPFHpTp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts-BqPFHpTp.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 'IOS_OBSERVE_TOO_LARGE',\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 = 2;\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;\n/** Observe results above this many UTF-8 bytes go to a line file unless the caller picks an output. */\nexport const OBSERVE_INLINE_MAX_BYTES = 10_000;\nexport const RECORDING_DEFAULT_SECONDS = 600;\n/** A recorder that exits this soon after starting failed to start. */\nexport const RECORDING_EARLY_EXIT_MS = 2000;\n/** How long a stopped recorder may take to finalize its file before it is killed. */\nexport const RECORDING_FINALIZE_MS = 10_000;\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;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;;AAKjC,MAAa,2BAA2B;;AAGxC,MAAa,0BAA0B;;AAEvC,MAAa,wBAAwB;;;;ACjFrC,MAAa,oBAAoB,sBAA+B,kBAAkB,EAAE,OAAO,SAAS,CAAC;AAErG,MAAa,wBAAwB,sBAA0C,mBAAmB,EAAE,OAAO,SAAS,CAAC"}
@@ -35,7 +35,8 @@ const IOS_ERROR_CODES = [
35
35
  "IOS_HELPER_UNAVAILABLE",
36
36
  "IOS_ELEMENT_STALE",
37
37
  "IOS_AMBIGUOUS",
38
- "IOS_NO_MATCH"
38
+ "IOS_NO_MATCH",
39
+ "IOS_OBSERVE_TOO_LARGE"
39
40
  ];
40
41
  /** The resident Swift helper that reads accessibility and sends touches; built from source on first use. */
41
42
  const HELPER_PRODUCT = "po-ios-sim-helper";
@@ -60,10 +61,17 @@ const HELPER_MAX_LINE_CHARS = 8388608;
60
61
  const WAIT_MAX_POLL_MS = 1e3;
61
62
  const WAIT_DEFAULT_MS = 1e4;
62
63
  const SETTLE_DEFAULT_MS = 5e3;
64
+ /** Observe results above this many UTF-8 bytes go to a line file unless the caller picks an output. */
65
+ const OBSERVE_INLINE_MAX_BYTES = 1e4;
66
+ /** A recorder that exits this soon after starting failed to start. */
67
+ const RECORDING_EARLY_EXIT_MS = 2e3;
68
+ /** How long a stopped recorder may take to finalize its file before it is killed. */
69
+ const RECORDING_FINALIZE_MS = 1e4;
63
70
  //#endregion
64
71
  //#region src/schemas/contracts.ts
65
72
  /** Bound once at the global level; every session leases from the same pool. */
66
73
  const IOS_POOL_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)(IOS_POOL_SERVICE, { scope: "global" });
74
+ const IOS_SETTINGS_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)("po/ios-settings", { scope: "global" });
67
75
  //#endregion
68
76
  Object.defineProperty(exports, "BOOT_TIMEOUT_MS", {
69
77
  enumerable: true,
@@ -179,6 +187,12 @@ Object.defineProperty(exports, "IOS_POOL_SERVICE", {
179
187
  return IOS_POOL_SERVICE;
180
188
  }
181
189
  });
190
+ Object.defineProperty(exports, "IOS_SETTINGS_CONTRACT", {
191
+ enumerable: true,
192
+ get: function() {
193
+ return IOS_SETTINGS_CONTRACT;
194
+ }
195
+ });
182
196
  Object.defineProperty(exports, "IOS_TOOL_PATH", {
183
197
  enumerable: true,
184
198
  get: function() {
@@ -197,12 +211,30 @@ Object.defineProperty(exports, "MAX_COMMAND_OUTPUT_CHARS", {
197
211
  return MAX_COMMAND_OUTPUT_CHARS;
198
212
  }
199
213
  });
214
+ Object.defineProperty(exports, "OBSERVE_INLINE_MAX_BYTES", {
215
+ enumerable: true,
216
+ get: function() {
217
+ return OBSERVE_INLINE_MAX_BYTES;
218
+ }
219
+ });
200
220
  Object.defineProperty(exports, "ORPHAN_GRACE_MS", {
201
221
  enumerable: true,
202
222
  get: function() {
203
223
  return ORPHAN_GRACE_MS;
204
224
  }
205
225
  });
226
+ Object.defineProperty(exports, "RECORDING_EARLY_EXIT_MS", {
227
+ enumerable: true,
228
+ get: function() {
229
+ return RECORDING_EARLY_EXIT_MS;
230
+ }
231
+ });
232
+ Object.defineProperty(exports, "RECORDING_FINALIZE_MS", {
233
+ enumerable: true,
234
+ get: function() {
235
+ return RECORDING_FINALIZE_MS;
236
+ }
237
+ });
206
238
  Object.defineProperty(exports, "SCREENSHOT_MAX_PIXELS", {
207
239
  enumerable: true,
208
240
  get: function() {
@@ -234,4 +266,4 @@ Object.defineProperty(exports, "WAIT_MAX_POLL_MS", {
234
266
  }
235
267
  });
236
268
 
237
- //# sourceMappingURL=contracts-BsO_lEi8.cjs.map
269
+ //# sourceMappingURL=contracts-CNgOvR5W.cjs.map