@agimon-ai/po-ios 0.0.1-alpha.8 → 0.0.1-alpha.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/apiContracts.cjs +2 -2
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +2 -2
- package/dist/apiContracts.mjs +2 -2
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/{contracts-EZxEDrrj.cjs → contracts-CBAI3LG6.cjs} +30 -4
- package/dist/contracts-CBAI3LG6.cjs.map +1 -0
- package/dist/{contracts-BQjfOjy0.mjs → contracts-S4ze8Upx.mjs} +13 -5
- package/dist/contracts-S4ze8Upx.mjs.map +1 -0
- package/dist/extensions/native.mjs +102 -127
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +584 -115
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.mjs +584 -115
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +146 -149
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +44 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/native/device-runner/PoRunnerUITests/Runner.swift +27 -9
- package/native/sim-helper/Sources/PoIosCore/Compaction.swift +25 -20
- package/native/sim-helper/Sources/PoIosCore/Protocol.swift +31 -3
- package/native/sim-helper/Sources/PoIosSimHelper/Backends.swift +41 -12
- package/native/sim-helper/Sources/PoIosSimHelper/PrivateApis.swift +5 -0
- package/native/sim-helper/Sources/PoIosSimHelper/ScreenRecorder.swift +102 -0
- package/native/sim-helper/Sources/PoIosSimHelper/main.swift +12 -3
- package/native/sim-helper/Tests/PoIosCoreTests/CompactionTests.swift +41 -18
- package/native/sim-helper/Tests/PoIosCoreTests/ProtocolTests.swift +36 -0
- package/package.json +76 -18
- package/src/prompts/codemode-how-to-ios/SKILL.md +35 -4
- package/dist/contracts-BQjfOjy0.mjs.map +0 -1
- package/dist/contracts-EZxEDrrj.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Isolated packed-source web acceptance verified a real 552 × 1200 simulator PNG,
|
|
|
37
37
|
|
|
38
38
|
## Package behavior
|
|
39
39
|
|
|
40
|
-
Each server elects one
|
|
40
|
+
Each server elects one host-wide pool owner, including when a workspace selects the iOS layer. Servers using the same Po home share pool state through `po/db` (`ios_*` tables); simulators live at `<po home>/ios/devices`, never in the person's default set. Size it in `<po home>/config.yaml` (global only, read once per activation):
|
|
41
41
|
|
|
42
42
|
```yaml
|
|
43
43
|
ios:
|
|
@@ -57,7 +57,7 @@ This is a partial implementation, not completion of the full iOS plan. Built-lay
|
|
|
57
57
|
|
|
58
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
59
|
|
|
60
|
-
For phone accessibility and input, set `ios.device.developmentTeam` in the admitted
|
|
60
|
+
For phone accessibility and input, set `ios.device.developmentTeam` in the admitted host config (`~/.po/config.yaml`) and connect the phone by USB. First use builds and installs Po's own signed XCUITest runner with automatic provisioning. It binds only a USB IPv4 link-local address (`169.254.*`), requires a random per-run token and reuses the helper protocol. No WDA, Appium or iproxy is used. Observation selects a foreground app launched under this lease, otherwise SpringBoard. Release stops the runner and uninstalls its test host before freeing the lease, leaving the person's other apps installed. Cleanup failure holds the lease and can be retried. Phone screenshots, terminate and openUrl remain unavailable through `ios`; home, lock and Siri fail explicitly. Volume and rotation are unverified. An explicit bottom-edge swipe can leave an app.
|
|
61
61
|
|
|
62
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.
|
|
63
63
|
|
package/dist/apiContracts.cjs
CHANGED
|
@@ -24,7 +24,7 @@ const Pool = typebox.Type.Object({
|
|
|
24
24
|
const iosSettingsMethod = (0, _agimon_ai_po_core_pluginProtocol.definePoPluginMethod)({
|
|
25
25
|
service: "ios",
|
|
26
26
|
method: "settings",
|
|
27
|
-
scope: "
|
|
27
|
+
scope: "host",
|
|
28
28
|
direction: "client-to-server",
|
|
29
29
|
input: typebox.Type.Object({}, { additionalProperties: false }),
|
|
30
30
|
output: typebox.Type.Object({
|
|
@@ -175,7 +175,7 @@ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
|
|
|
175
175
|
})),
|
|
176
176
|
{
|
|
177
177
|
id: "ios.settings",
|
|
178
|
-
scope: "
|
|
178
|
+
scope: "host",
|
|
179
179
|
service: iosSettingsMethod.service,
|
|
180
180
|
member: iosSettingsMethod.method,
|
|
181
181
|
kind: "method",
|
|
@@ -1 +1 @@
|
|
|
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,QAAQA,QAAAA,KAAK,M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P,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
|
+
{"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: 'host',\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: 'host',\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,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,MAAM,CACjBA,QAAAA,KAAK,OAAO;EAAE,IAAIA,QAAAA,KAAK,QAAQ,IAAI;EAAG,KAAKA,QAAAA,KAAK,OAAO;EAAG,WAAWA,QAAAA,KAAK,OAAO;CAAE,CAAC,GACpFA,QAAAA,KAAK,OAAO;EACV,IAAIA,QAAAA,KAAK,QAAQ,KAAK;EACtB,QAAQA,QAAAA,KAAK,MAAM;GACjBA,QAAAA,KAAK,QAAQ,YAAY;GACzBA,QAAAA,KAAK,QAAQ,SAAS;GACtBA,QAAAA,KAAK,QAAQ,SAAS;GACtBA,QAAAA,KAAK,QAAQ,aAAa;EAC5B,CAAC;EACD,SAASA,QAAAA,KAAK,OAAO;CACvB,CAAC,CACH,CAAC;AACH,CAAC;;;AC9ED,MAAa,gBAAA,GAAeE,gCAAAA,kBAAAA,CAAkB;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"}
|
package/dist/apiContracts.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const apiContracts: {
|
|
|
5
5
|
schemas?: Record<string, boolean | object> | undefined;
|
|
6
6
|
http: {
|
|
7
7
|
id: string;
|
|
8
|
-
scope: "
|
|
8
|
+
scope: "host" | "session" | "workspace";
|
|
9
9
|
basePath?: string | undefined;
|
|
10
10
|
path: string;
|
|
11
11
|
method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
|
|
@@ -33,7 +33,7 @@ export declare const apiContracts: {
|
|
|
33
33
|
}[];
|
|
34
34
|
sockets: {
|
|
35
35
|
id: string;
|
|
36
|
-
scope: "
|
|
36
|
+
scope: "host" | "session" | "workspace";
|
|
37
37
|
description: string;
|
|
38
38
|
availability?: string | undefined;
|
|
39
39
|
service: string;
|
package/dist/apiContracts.mjs
CHANGED
|
@@ -20,7 +20,7 @@ const Pool = Type.Object({
|
|
|
20
20
|
const iosSettingsMethod = definePoPluginMethod({
|
|
21
21
|
service: "ios",
|
|
22
22
|
method: "settings",
|
|
23
|
-
scope: "
|
|
23
|
+
scope: "host",
|
|
24
24
|
direction: "client-to-server",
|
|
25
25
|
input: Type.Object({}, { additionalProperties: false }),
|
|
26
26
|
output: Type.Object({
|
|
@@ -171,7 +171,7 @@ const apiContracts = defineApiContract({
|
|
|
171
171
|
})),
|
|
172
172
|
{
|
|
173
173
|
id: "ios.settings",
|
|
174
|
-
scope: "
|
|
174
|
+
scope: "host",
|
|
175
175
|
service: iosSettingsMethod.service,
|
|
176
176
|
member: iosSettingsMethod.method,
|
|
177
177
|
kind: "method",
|
|
@@ -1 +1 @@
|
|
|
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,OA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;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
|
+
{"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: 'host',\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: 'host',\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,KA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|
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";
|
|
@@ -48,6 +49,7 @@ const HELPER_SOURCES = [
|
|
|
48
49
|
"Sources/PoIosSimHelper/main.swift",
|
|
49
50
|
"Sources/PoIosSimHelper/PrivateApis.swift",
|
|
50
51
|
"Sources/PoIosSimHelper/Backends.swift",
|
|
52
|
+
"Sources/PoIosSimHelper/ScreenRecorder.swift",
|
|
51
53
|
"Tests/PoIosCoreTests/ProtocolTests.swift",
|
|
52
54
|
"Tests/PoIosCoreTests/CompactionTests.swift"
|
|
53
55
|
];
|
|
@@ -60,11 +62,17 @@ const HELPER_MAX_LINE_CHARS = 8388608;
|
|
|
60
62
|
const WAIT_MAX_POLL_MS = 1e3;
|
|
61
63
|
const WAIT_DEFAULT_MS = 1e4;
|
|
62
64
|
const SETTLE_DEFAULT_MS = 5e3;
|
|
65
|
+
/** Observe results above this many UTF-8 bytes go to a line file unless the caller picks an output. */
|
|
66
|
+
const OBSERVE_INLINE_MAX_BYTES = 1e4;
|
|
67
|
+
/** A recorder that exits this soon after starting failed to start. */
|
|
68
|
+
const RECORDING_EARLY_EXIT_MS = 2e3;
|
|
69
|
+
/** How long a stopped recorder may take to finalize its file before it is killed. */
|
|
70
|
+
const RECORDING_FINALIZE_MS = 1e4;
|
|
63
71
|
//#endregion
|
|
64
72
|
//#region src/schemas/contracts.ts
|
|
65
73
|
/** Bound once at the global level; every session leases from the same pool. */
|
|
66
|
-
const IOS_POOL_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)(IOS_POOL_SERVICE, { scope: "
|
|
67
|
-
const IOS_SETTINGS_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)("po/ios-settings", { scope: "
|
|
74
|
+
const IOS_POOL_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)(IOS_POOL_SERVICE, { scope: "host" });
|
|
75
|
+
const IOS_SETTINGS_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)("po/ios-settings", { scope: "host" });
|
|
68
76
|
//#endregion
|
|
69
77
|
Object.defineProperty(exports, "BOOT_TIMEOUT_MS", {
|
|
70
78
|
enumerable: true,
|
|
@@ -204,12 +212,30 @@ Object.defineProperty(exports, "MAX_COMMAND_OUTPUT_CHARS", {
|
|
|
204
212
|
return MAX_COMMAND_OUTPUT_CHARS;
|
|
205
213
|
}
|
|
206
214
|
});
|
|
215
|
+
Object.defineProperty(exports, "OBSERVE_INLINE_MAX_BYTES", {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: function() {
|
|
218
|
+
return OBSERVE_INLINE_MAX_BYTES;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
207
221
|
Object.defineProperty(exports, "ORPHAN_GRACE_MS", {
|
|
208
222
|
enumerable: true,
|
|
209
223
|
get: function() {
|
|
210
224
|
return ORPHAN_GRACE_MS;
|
|
211
225
|
}
|
|
212
226
|
});
|
|
227
|
+
Object.defineProperty(exports, "RECORDING_EARLY_EXIT_MS", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function() {
|
|
230
|
+
return RECORDING_EARLY_EXIT_MS;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperty(exports, "RECORDING_FINALIZE_MS", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function() {
|
|
236
|
+
return RECORDING_FINALIZE_MS;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
213
239
|
Object.defineProperty(exports, "SCREENSHOT_MAX_PIXELS", {
|
|
214
240
|
enumerable: true,
|
|
215
241
|
get: function() {
|
|
@@ -241,4 +267,4 @@ Object.defineProperty(exports, "WAIT_MAX_POLL_MS", {
|
|
|
241
267
|
}
|
|
242
268
|
});
|
|
243
269
|
|
|
244
|
-
//# sourceMappingURL=contracts-
|
|
270
|
+
//# sourceMappingURL=contracts-CBAI3LG6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts-CBAI3LG6.cjs","names":["defineServiceContract"],"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 'Sources/PoIosSimHelper/ScreenRecorder.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: 'host' });\n\nexport const IOS_SETTINGS_CONTRACT = defineServiceContract<IosSettingsRuntime>('po/ios-settings', { scope: 'host' });\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;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;;;;AClFrC,MAAa,qBAAA,GAAoBA,iCAAAA,sBAAAA,CAA+B,kBAAkB,EAAE,OAAO,OAAO,CAAC;AAEnG,MAAa,yBAAA,GAAwBA,iCAAAA,sBAAAA,CAA0C,mBAAmB,EAAE,OAAO,OAAO,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";
|
|
@@ -48,6 +49,7 @@ const HELPER_SOURCES = [
|
|
|
48
49
|
"Sources/PoIosSimHelper/main.swift",
|
|
49
50
|
"Sources/PoIosSimHelper/PrivateApis.swift",
|
|
50
51
|
"Sources/PoIosSimHelper/Backends.swift",
|
|
52
|
+
"Sources/PoIosSimHelper/ScreenRecorder.swift",
|
|
51
53
|
"Tests/PoIosCoreTests/ProtocolTests.swift",
|
|
52
54
|
"Tests/PoIosCoreTests/CompactionTests.swift"
|
|
53
55
|
];
|
|
@@ -60,12 +62,18 @@ const HELPER_MAX_LINE_CHARS = 8388608;
|
|
|
60
62
|
const WAIT_MAX_POLL_MS = 1e3;
|
|
61
63
|
const WAIT_DEFAULT_MS = 1e4;
|
|
62
64
|
const SETTLE_DEFAULT_MS = 5e3;
|
|
65
|
+
/** Observe results above this many UTF-8 bytes go to a line file unless the caller picks an output. */
|
|
66
|
+
const OBSERVE_INLINE_MAX_BYTES = 1e4;
|
|
67
|
+
/** A recorder that exits this soon after starting failed to start. */
|
|
68
|
+
const RECORDING_EARLY_EXIT_MS = 2e3;
|
|
69
|
+
/** How long a stopped recorder may take to finalize its file before it is killed. */
|
|
70
|
+
const RECORDING_FINALIZE_MS = 1e4;
|
|
63
71
|
//#endregion
|
|
64
72
|
//#region src/schemas/contracts.ts
|
|
65
73
|
/** Bound once at the global level; every session leases from the same pool. */
|
|
66
|
-
const IOS_POOL_CONTRACT = defineServiceContract(IOS_POOL_SERVICE, { scope: "
|
|
67
|
-
const IOS_SETTINGS_CONTRACT = defineServiceContract("po/ios-settings", { scope: "
|
|
74
|
+
const IOS_POOL_CONTRACT = defineServiceContract(IOS_POOL_SERVICE, { scope: "host" });
|
|
75
|
+
const IOS_SETTINGS_CONTRACT = defineServiceContract("po/ios-settings", { scope: "host" });
|
|
68
76
|
//#endregion
|
|
69
|
-
export { MAX_COMMAND_OUTPUT_CHARS as C,
|
|
77
|
+
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 };
|
|
70
78
|
|
|
71
|
-
//# sourceMappingURL=contracts-
|
|
79
|
+
//# sourceMappingURL=contracts-S4ze8Upx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts-S4ze8Upx.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 'Sources/PoIosSimHelper/ScreenRecorder.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: 'host' });\n\nexport const IOS_SETTINGS_CONTRACT = defineServiceContract<IosSettingsRuntime>('po/ios-settings', { scope: 'host' });\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;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;;;;AClFrC,MAAa,oBAAoB,sBAA+B,kBAAkB,EAAE,OAAO,OAAO,CAAC;AAEnG,MAAa,wBAAwB,sBAA0C,mBAAmB,EAAE,OAAO,OAAO,CAAC"}
|
|
@@ -218,7 +218,7 @@ function useIosSettings({ request, requestWithStepUp }, invoke) {
|
|
|
218
218
|
let current;
|
|
219
219
|
if (invoke) try {
|
|
220
220
|
current = parseSettingsStatus(await invoke({
|
|
221
|
-
mount: { scope: "
|
|
221
|
+
mount: { scope: "host" },
|
|
222
222
|
service: "ios",
|
|
223
223
|
method: "settings",
|
|
224
224
|
input: {}
|
|
@@ -807,129 +807,112 @@ function deviceDetail(device) {
|
|
|
807
807
|
//#region src/extensions/workspaces/sessions/(frontend)/_components/IosActivityView.native.tsx
|
|
808
808
|
function IosActivityView({ devices, build, details, install, notice, footer, installExpanded = false, busy = false, canOpen = false, onView, onDownload, onCopy, onOpen, onInstall }) {
|
|
809
809
|
const [installation, setInstallation] = useState(installExpanded);
|
|
810
|
-
return /* @__PURE__ */ jsx(ScrollView, {
|
|
811
|
-
|
|
812
|
-
children:
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
810
|
+
return /* @__PURE__ */ jsx(ScrollView, { children: /* @__PURE__ */ jsxs(View, {
|
|
811
|
+
style: styles$2.content,
|
|
812
|
+
children: [
|
|
813
|
+
devices.length === 0 ? /* @__PURE__ */ jsx(Text, {
|
|
814
|
+
style: styles$2.dim,
|
|
815
|
+
children: "No device is leased to this session."
|
|
816
|
+
}) : devices.map((device) => /* @__PURE__ */ jsxs(View, {
|
|
817
|
+
style: styles$2.group,
|
|
818
|
+
children: [
|
|
819
|
+
/* @__PURE__ */ jsx(Text, {
|
|
820
|
+
style: styles$2.title,
|
|
821
|
+
children: device.name
|
|
822
|
+
}),
|
|
823
|
+
/* @__PURE__ */ jsx(Text, {
|
|
824
|
+
style: styles$2.dim,
|
|
825
|
+
children: device.detail
|
|
826
|
+
}),
|
|
827
|
+
device.canView && /* @__PURE__ */ jsx(Button, {
|
|
828
|
+
style: styles$2.touch,
|
|
829
|
+
onPress: () => onView(device.id),
|
|
830
|
+
children: "View screen"
|
|
831
|
+
})
|
|
832
|
+
]
|
|
833
|
+
}, device.id)),
|
|
834
|
+
build && /* @__PURE__ */ jsxs(View, {
|
|
835
|
+
style: styles$2.build,
|
|
836
|
+
children: [
|
|
837
|
+
/* @__PURE__ */ jsx(Text, {
|
|
838
|
+
accessibilityRole: "header",
|
|
839
|
+
style: styles$2.title,
|
|
840
|
+
children: "Latest build"
|
|
841
|
+
}),
|
|
842
|
+
/* @__PURE__ */ jsx(Text, {
|
|
843
|
+
style: styles$2.literal,
|
|
844
|
+
children: build.name
|
|
845
|
+
}),
|
|
846
|
+
/* @__PURE__ */ jsx(Text, {
|
|
847
|
+
style: styles$2.dim,
|
|
848
|
+
children: build.detail
|
|
849
|
+
}),
|
|
850
|
+
/* @__PURE__ */ jsx(Text, {
|
|
851
|
+
style: styles$2.dim,
|
|
852
|
+
children: details.note
|
|
853
|
+
}),
|
|
854
|
+
!details.blocked && /* @__PURE__ */ jsx(Text, {
|
|
855
|
+
style: styles$2.dim,
|
|
856
|
+
children: "Links expire after 10 minutes. Anyone with the link can download."
|
|
857
|
+
}),
|
|
858
|
+
/* @__PURE__ */ jsx(Button, {
|
|
859
|
+
style: styles$2.touch,
|
|
860
|
+
variant: "primary",
|
|
861
|
+
disabled: details.blocked,
|
|
862
|
+
loading: busy,
|
|
863
|
+
onPress: onDownload,
|
|
864
|
+
children: details.action
|
|
865
|
+
}),
|
|
866
|
+
/* @__PURE__ */ jsx(Button, {
|
|
867
|
+
style: styles$2.touch,
|
|
868
|
+
variant: "link",
|
|
869
|
+
disabled: details.blocked,
|
|
870
|
+
onPress: onCopy,
|
|
871
|
+
children: "Copy download link"
|
|
872
|
+
}),
|
|
873
|
+
/* @__PURE__ */ jsx(Button, {
|
|
874
|
+
style: styles$2.touch,
|
|
875
|
+
variant: "link",
|
|
876
|
+
disabled: !canOpen,
|
|
877
|
+
onPress: onOpen,
|
|
878
|
+
children: "Open in Po"
|
|
879
|
+
}),
|
|
880
|
+
/* @__PURE__ */ jsx(Button, {
|
|
881
|
+
style: styles$2.touch,
|
|
882
|
+
variant: "ghost",
|
|
883
|
+
"aria-expanded": installation,
|
|
884
|
+
onPress: () => setInstallation(!installation),
|
|
885
|
+
children: "Install on iPhone"
|
|
886
|
+
}),
|
|
887
|
+
installation && /* @__PURE__ */ jsxs(View, {
|
|
888
|
+
style: styles$2.group,
|
|
889
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
862
890
|
style: styles$2.dim,
|
|
863
|
-
children:
|
|
864
|
-
}),
|
|
865
|
-
/* @__PURE__ */ jsx(Button, {
|
|
866
|
-
style: styles$2.touch,
|
|
867
|
-
variant: "primary",
|
|
868
|
-
disabled: details.blocked,
|
|
869
|
-
loading: busy,
|
|
870
|
-
onPress: onDownload,
|
|
871
|
-
children: details.action
|
|
872
|
-
}),
|
|
873
|
-
/* @__PURE__ */ jsx(Button, {
|
|
874
|
-
style: styles$2.touch,
|
|
875
|
-
variant: "link",
|
|
876
|
-
disabled: details.blocked,
|
|
877
|
-
onPress: onCopy,
|
|
878
|
-
children: "Copy download link"
|
|
879
|
-
}),
|
|
880
|
-
/* @__PURE__ */ jsx(Button, {
|
|
891
|
+
children: install.note
|
|
892
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
881
893
|
style: styles$2.touch,
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
style: styles$2.touch,
|
|
901
|
-
disabled: install.blocked,
|
|
902
|
-
onPress: onInstall,
|
|
903
|
-
children: install.action
|
|
904
|
-
})]
|
|
905
|
-
})
|
|
906
|
-
]
|
|
907
|
-
}),
|
|
908
|
-
notice && /* @__PURE__ */ jsx(Text, {
|
|
909
|
-
accessibilityLiveRegion: "polite",
|
|
910
|
-
style: styles$2.notice,
|
|
911
|
-
children: notice
|
|
912
|
-
}),
|
|
913
|
-
footer && /* @__PURE__ */ jsx(Text, {
|
|
914
|
-
style: styles$2.dim,
|
|
915
|
-
children: footer
|
|
916
|
-
})
|
|
917
|
-
]
|
|
918
|
-
})
|
|
919
|
-
});
|
|
894
|
+
disabled: install.blocked,
|
|
895
|
+
onPress: onInstall,
|
|
896
|
+
children: install.action
|
|
897
|
+
})]
|
|
898
|
+
})
|
|
899
|
+
]
|
|
900
|
+
}),
|
|
901
|
+
notice && /* @__PURE__ */ jsx(Text, {
|
|
902
|
+
accessibilityLiveRegion: "polite",
|
|
903
|
+
style: styles$2.notice,
|
|
904
|
+
children: notice
|
|
905
|
+
}),
|
|
906
|
+
footer && /* @__PURE__ */ jsx(Text, {
|
|
907
|
+
style: styles$2.dim,
|
|
908
|
+
children: footer
|
|
909
|
+
})
|
|
910
|
+
]
|
|
911
|
+
}) });
|
|
920
912
|
}
|
|
921
913
|
const styles$2 = StyleSheet.create((theme) => ({
|
|
922
914
|
content: {
|
|
923
|
-
padding: theme.spacing(4),
|
|
924
|
-
uni__dependencies: [0]
|
|
925
|
-
},
|
|
926
|
-
card: {
|
|
927
|
-
padding: theme.spacing(4),
|
|
928
915
|
gap: theme.spacing(4),
|
|
929
|
-
borderWidth: 1,
|
|
930
|
-
borderColor: theme.colors.border,
|
|
931
|
-
borderRadius: theme.borderRadius.md,
|
|
932
|
-
backgroundColor: theme.colors.rail,
|
|
933
916
|
uni__dependencies: [0]
|
|
934
917
|
},
|
|
935
918
|
group: {
|
|
@@ -944,14 +927,6 @@ const styles$2 = StyleSheet.create((theme) => ({
|
|
|
944
927
|
uni__dependencies: [0]
|
|
945
928
|
},
|
|
946
929
|
touch: { minHeight: 44 },
|
|
947
|
-
heading: {
|
|
948
|
-
fontFamily: fontOf(theme.fontFamily.sans),
|
|
949
|
-
fontSize: theme.fontSize.lg,
|
|
950
|
-
lineHeight: theme.lineHeight.lg,
|
|
951
|
-
fontWeight: "600",
|
|
952
|
-
color: theme.colors.hi,
|
|
953
|
-
uni__dependencies: [0]
|
|
954
|
-
},
|
|
955
930
|
title: {
|
|
956
931
|
fontFamily: fontOf(theme.fontFamily.sans),
|
|
957
932
|
fontSize: theme.fontSize.base,
|
|
@@ -1278,7 +1253,7 @@ const via = (identity, value) => value === void 0 ? void 0 : {
|
|
|
1278
1253
|
};
|
|
1279
1254
|
const nativePlugin = defineNativePlugin({
|
|
1280
1255
|
id: "ios",
|
|
1281
|
-
|
|
1256
|
+
host: {
|
|
1282
1257
|
get settingsPanels() {
|
|
1283
1258
|
return [via({ id: "ios" }, ios_panel_native_default)];
|
|
1284
1259
|
},
|