@agimon-ai/po-ios 0.0.0-stage → 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +149 -0
- package/README.md +96 -2
- package/dist/apiContracts.cjs +17 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +13 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/contracts-C54pSczx.cjs +222 -0
- package/dist/contracts-C54pSczx.cjs.map +1 -0
- package/dist/contracts-D41ZfB5m.mjs +67 -0
- package/dist/contracts-D41ZfB5m.mjs.map +1 -0
- package/dist/extensions/server.cjs +2438 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +2410 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.mts +236 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1 -0
- package/llms.txt +13 -0
- package/native/sim-helper/PRIVATE_APIS.md +33 -0
- package/native/sim-helper/Package.swift +17 -0
- package/native/sim-helper/Sources/PoIosCore/Compaction.swift +136 -0
- package/native/sim-helper/Sources/PoIosCore/Protocol.swift +84 -0
- package/native/sim-helper/Sources/PoIosSimHelper/Backends.swift +75 -0
- package/native/sim-helper/Sources/PoIosSimHelper/PrivateApis.swift +62 -0
- package/native/sim-helper/Sources/PoIosSimHelper/main.swift +97 -0
- package/native/sim-helper/Tests/PoIosCoreTests/CompactionTests.swift +75 -0
- package/native/sim-helper/Tests/PoIosCoreTests/ProtocolTests.swift +47 -0
- package/package.json +106 -3
- package/src/prompts/codemode-how-to-ios/SKILL.md +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
2
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
3
|
+
|
|
4
|
+
Parameters
|
|
5
|
+
|
|
6
|
+
Licensor: Agimon Pty Ltd
|
|
7
|
+
Licensed Work: Po, the software in the Po source repository and the
|
|
8
|
+
packages released from it, in each version released by
|
|
9
|
+
the Licensor.
|
|
10
|
+
The Licensed Work is (c) 2026 Agimon Pty Ltd.
|
|
11
|
+
Material identified as third-party in the "Third-party
|
|
12
|
+
components" section at the end of this file or in a
|
|
13
|
+
NOTICE file, and any package or directory whose own
|
|
14
|
+
license file grants a different license, is not part of
|
|
15
|
+
the Licensed Work and remains under its own license.
|
|
16
|
+
Additional Use Grant: You may make production use of the Licensed Work if
|
|
17
|
+
your use is Eligible Use. "Eligible Use" is production use that falls
|
|
18
|
+
within at least one of the following:
|
|
19
|
+
|
|
20
|
+
(a) Personal Use. Use by an individual for their own personal purposes,
|
|
21
|
+
and not on behalf of, or for the benefit of, an employer, client, or
|
|
22
|
+
other Organization. Use by an individual in the course of employment
|
|
23
|
+
or engagement by an Organization is use by that Organization.
|
|
24
|
+
|
|
25
|
+
(b) Small Organization Use. Use by or on behalf of an Organization whose
|
|
26
|
+
Annual Revenue is less than USD 1,000,000.
|
|
27
|
+
|
|
28
|
+
(c) Non-profit, Education and Research Use. Use, regardless of Annual
|
|
29
|
+
Revenue, by (i) an Organization registered or recognized as a
|
|
30
|
+
non-profit or charitable organization under the laws of its
|
|
31
|
+
jurisdiction, for its non-profit purposes; (ii) an accredited school,
|
|
32
|
+
college, or university, for teaching, learning, or academic research;
|
|
33
|
+
or (iii) a publicly funded research institution, for its research.
|
|
34
|
+
|
|
35
|
+
(d) Service Provider Use. Use by a consultant, contractor, agency, or other
|
|
36
|
+
service provider, regardless of its own Annual Revenue, solely to
|
|
37
|
+
build, deploy, host, operate, or support the Licensed Work for a client
|
|
38
|
+
whose own use would be Eligible Use under (a), (b), or (c). A service
|
|
39
|
+
provider's use for its own purposes is Eligible Use only if the service
|
|
40
|
+
provider itself qualifies under (b) or (c).
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Hosted services. Offering the Licensed Work to third parties as a hosted
|
|
44
|
+
or managed service whose primary value is the Licensed Work is Eligible
|
|
45
|
+
Use only if each such third party's own use would be Eligible Use.
|
|
46
|
+
|
|
47
|
+
Definitions. "Organization" means any company, partnership, sole
|
|
48
|
+
proprietorship, trust, association, government body, or other entity, and
|
|
49
|
+
includes an individual acting in a business or professional capacity.
|
|
50
|
+
"Affiliate" means any entity that directly or indirectly controls, is
|
|
51
|
+
controlled by, or is under common control with an Organization, where
|
|
52
|
+
"control" means ownership of more than 50% of the voting interests of an
|
|
53
|
+
entity or the power to direct its management and policies by contract or
|
|
54
|
+
otherwise. "Annual Revenue" means the total gross revenue of an
|
|
55
|
+
Organization and all of its Affiliates combined, from all sources and
|
|
56
|
+
whether or not related to the Licensed Work, for its most recently
|
|
57
|
+
completed fiscal year, or, if it has not completed a fiscal year, for the
|
|
58
|
+
twelve months before the use (or since its formation, if shorter),
|
|
59
|
+
converted into US dollars at the average exchange rate for that period.
|
|
60
|
+
Proceeds of equity or debt financing are not revenue.
|
|
61
|
+
|
|
62
|
+
Threshold. If an Organization stops qualifying under (b), its existing
|
|
63
|
+
production use remains Eligible Use for 90 days after it stops
|
|
64
|
+
qualifying, after which it must obtain a commercial license or stop
|
|
65
|
+
production use. Use that was Eligible Use when it occurred never requires
|
|
66
|
+
a commercial license after the fact.
|
|
67
|
+
Change Date: Four years from the date a version of the Licensed Work
|
|
68
|
+
is first publicly released by the Licensor.
|
|
69
|
+
Change License: Apache License, Version 2.0
|
|
70
|
+
|
|
71
|
+
For information about alternative licensing arrangements for the Licensed
|
|
72
|
+
Work, please visit: https://agimon.ai/licensing
|
|
73
|
+
|
|
74
|
+
Notice
|
|
75
|
+
|
|
76
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
77
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
78
|
+
under an Open Source License, as stated in this License.
|
|
79
|
+
|
|
80
|
+
-----------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
Business Source License 1.1
|
|
83
|
+
|
|
84
|
+
Terms
|
|
85
|
+
|
|
86
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
87
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
88
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
89
|
+
production use.
|
|
90
|
+
|
|
91
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
92
|
+
available distribution of a specific version of the Licensed Work under this
|
|
93
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
94
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
95
|
+
above terminate.
|
|
96
|
+
|
|
97
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
98
|
+
currently in effect as described in this License, you must purchase a
|
|
99
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
100
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
101
|
+
|
|
102
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
103
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
104
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
105
|
+
for each version of the Licensed Work released by Licensor.
|
|
106
|
+
|
|
107
|
+
You must conspicuously display this License on each original or modified copy
|
|
108
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
109
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
110
|
+
License apply to your use of that work.
|
|
111
|
+
|
|
112
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
113
|
+
terminate your rights under this License for the current and all other
|
|
114
|
+
versions of the Licensed Work.
|
|
115
|
+
|
|
116
|
+
This License does not grant you any right in any trademark or logo of
|
|
117
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
118
|
+
Licensor as expressly required by this License).
|
|
119
|
+
|
|
120
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
121
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
122
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
123
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
124
|
+
TITLE.
|
|
125
|
+
|
|
126
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
127
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
128
|
+
as long as you comply with the Covenants of Licensor below.
|
|
129
|
+
|
|
130
|
+
Covenants of Licensor
|
|
131
|
+
|
|
132
|
+
In consideration of the right to use this License’s text and the “Business
|
|
133
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
134
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
135
|
+
|
|
136
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
137
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
138
|
+
where “compatible” means that software provided under the Change License can
|
|
139
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
140
|
+
later version. Licensor may specify additional Change Licenses without
|
|
141
|
+
limitation.
|
|
142
|
+
|
|
143
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
144
|
+
impose any additional restriction on the right granted in this License, as
|
|
145
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
146
|
+
|
|
147
|
+
3. To specify a Change Date.
|
|
148
|
+
|
|
149
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -1,3 +1,97 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @agimon-ai/po-ios
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Leased iOS simulators from a machine-wide pool, with app install, launch, accessibility-driven taps and typing, screenshots and logs for Po sessions.
|
|
4
|
+
|
|
5
|
+
This package is a composable [Po](https://www.npmjs.com/package/@agimon-ai/po) subsystem. Use it through native server composition in the distribution.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Node.js 24 or newer
|
|
10
|
+
- macOS with Xcode and at least one iOS simulator runtime
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
The layer is opt-in: select the `ios` layer in your Po modes. The package declares poServer metadata for native server discovery.
|
|
15
|
+
|
|
16
|
+
## Use
|
|
17
|
+
|
|
18
|
+
In a code-mode `exec` script:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
await ios.acquire({ label: 'login flow' });
|
|
22
|
+
const { bundleId } = await ios.install({ path: '/abs/Build/Products/Debug-iphonesimulator/App.app' });
|
|
23
|
+
await ios.launch({ bundleId });
|
|
24
|
+
await ios.screenshot();
|
|
25
|
+
await ios.release();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Package behavior
|
|
29
|
+
|
|
30
|
+
One pool serves every Po server on the machine. Pool state lives in the shared `po/db` (`ios_*` tables); simulators live in Po's own device set at `<po home>/ios/devices`, never in the person's default set. Size it in `~/.po/config.yaml` (global only, read once per server):
|
|
31
|
+
|
|
32
|
+
```yaml
|
|
33
|
+
ios:
|
|
34
|
+
pool:
|
|
35
|
+
maxBooted: 2 # simulators booted at once, machine-wide (the smallest value among running servers wins)
|
|
36
|
+
maxDevices: 4 # simulators Po creates in total
|
|
37
|
+
minBooted: 0 # kept booted while idle
|
|
38
|
+
idleShutdownMinutes: 10
|
|
39
|
+
waitTimeoutSeconds: 120
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Release uninstalls the apps a session installed and keeps the device warm. Devices of a dead server are erased before reuse.
|
|
43
|
+
|
|
44
|
+
Accessibility and touch (`observe`, `tap`, `type`, `swipe`, `pressButton`, `waitFor`, `settle`) go through a resident Swift helper in `native/sim-helper`. The server builds it on first use with the person's Xcode (`xcrun swift build`) into `<po home>/ios/native/<hash>/`; set `ios.helperPath` to use a prebuilt one instead. Its private framework calls are not recorded yet (see `native/sim-helper/PRIVATE_APIS.md`), so until then those calls return `IOS_HELPER_UNAVAILABLE`.
|
|
45
|
+
|
|
46
|
+
Physical devices: `ios.devices()` lists what CoreDevice sees (`xcrun devicectl list devices`), and `ios.acquireDevice({ udid })` leases a paired, connected phone after the person approves it. A phone lease shares the `ios_lease` table (`kind = 'device'`) so two sessions never hold one phone, but it has no `ios_device` row: the pool never boots, erases or counts it against `maxBooted`. On a phone only `install` (a device-signed `.app`), `uninstall`, `launch` and `release` work; release only drops the lease. Accessibility, screenshots and logs on phones need the XCUITest runner, which is not built yet.
|
|
47
|
+
|
|
48
|
+
## Help
|
|
49
|
+
|
|
50
|
+
The published package includes `llms.txt` and `src/prompts/codemode-how-to-ios/SKILL.md`, served by `resource/codemode-how-to-ios.server.ts`.
|
|
51
|
+
|
|
52
|
+
## Public API
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { IOS_POOL_CONTRACT, type IosPool } from '@agimon-ai/po-ios';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The native server entry is also available at:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
@agimon-ai/po-ios/extensions/server
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The build generates host entrypoints in `generated/` from named `src/extensions` routes. Pure re-export modules in `src/exports` expose selected public capabilities. Keep typed authoring helpers in a dedicated subpath with no host/runtime imports so repository modules can bundle them cheaply.
|
|
65
|
+
|
|
66
|
+
## Structure and lifecycle
|
|
67
|
+
|
|
68
|
+
- `extensions/`: path-routed host contracts. Every scanned file default-exports one typed `define*` declaration.
|
|
69
|
+
- `services/{serviceName}/`: package logic, with `index.ts` and `type.ts`.
|
|
70
|
+
- `models/`: host-neutral state and transitions.
|
|
71
|
+
- `constants/`, `schemas/`, and `types/`: shared metadata, validation, and contracts.
|
|
72
|
+
- Private `_lib/` and `_components/` folders beside routes hold surface-private implementation and are not scanned.
|
|
73
|
+
|
|
74
|
+
Use scoped `root.server.ts` `defineRoot` factories for shared dependencies, Cordis services and lifecycle. Put each tool, command, hook, method, API, resource, and presentation contribution in its own named routed file. Do not use catch-all entries, named exports in routes, or freeform route implementation.
|
|
75
|
+
|
|
76
|
+
Give each event one owner. Server plugins own session hooks and shared runtime services.
|
|
77
|
+
|
|
78
|
+
The lifecycle is construct, register, `onStart`, run, `onStop`, unregister, `onDispose`. All hooks are optional and receive one typed context. The helper awaits startup before readiness. Shutdown aborts the context signal, stops work, removes registrations in reverse order, and performs final cleanup. Failed startup awaits rollback. Optional provider replacement rebinds contributions without restarting the plugin. Minor-mode actions are independent of mounting.
|
|
79
|
+
|
|
80
|
+
Factories construct state; `onStart` begins external work. `onStop` runs when the start stage was reached, including a failed `onStart`. Use `onDispose` only for remaining instance resources. Do not add empty hooks or manual registration cleanup.
|
|
81
|
+
|
|
82
|
+
## Development
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm build
|
|
86
|
+
pnpm typecheck
|
|
87
|
+
pnpm test
|
|
88
|
+
pnpm lint
|
|
89
|
+
pnpm exec vibe-lint check .
|
|
90
|
+
npm pack --dry-run
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Maintained by [Agimon](https://agimon.ai/about).
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
Business Source License 1.1: free for personal use, organisations under USD 1M revenue, non-profits and education. See [LICENSE](LICENSE) and https://agimon.ai/licensing.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
//#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)({
|
|
8
|
+
version: 1,
|
|
9
|
+
http: [],
|
|
10
|
+
sockets: [],
|
|
11
|
+
dynamic: []
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.apiContracts = apiContracts;
|
|
15
|
+
exports.default = apiContracts;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=apiContracts.cjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
export declare const apiContracts: {
|
|
4
|
+
version: 1;
|
|
5
|
+
protocols?: Record<string, string> | undefined;
|
|
6
|
+
schemas?: Record<string, boolean | object> | undefined;
|
|
7
|
+
http: {
|
|
8
|
+
id: string;
|
|
9
|
+
scope: "global" | "session" | "workspace";
|
|
10
|
+
basePath?: string | undefined;
|
|
11
|
+
path: string;
|
|
12
|
+
method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
|
|
13
|
+
description: string;
|
|
14
|
+
availability?: string | undefined;
|
|
15
|
+
authentication: "device" | "none" | "owner";
|
|
16
|
+
parameters?: {
|
|
17
|
+
name: string;
|
|
18
|
+
in: "header" | "path" | "query";
|
|
19
|
+
required: boolean;
|
|
20
|
+
schema: boolean | object;
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
body?: {
|
|
23
|
+
contentType: string;
|
|
24
|
+
contentTypes?: string[] | undefined;
|
|
25
|
+
required: boolean;
|
|
26
|
+
schema: boolean | object;
|
|
27
|
+
} | undefined;
|
|
28
|
+
responses: Record<string, {
|
|
29
|
+
description: string;
|
|
30
|
+
contentType?: string | undefined;
|
|
31
|
+
schema?: boolean | object | undefined;
|
|
32
|
+
events?: Record<string, boolean | object> | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
}[];
|
|
35
|
+
sockets: {
|
|
36
|
+
id: string;
|
|
37
|
+
scope: "global" | "session" | "workspace";
|
|
38
|
+
description: string;
|
|
39
|
+
availability?: string | undefined;
|
|
40
|
+
service: string;
|
|
41
|
+
member: string;
|
|
42
|
+
direction: "client-to-server" | "server-to-client";
|
|
43
|
+
kind: "channel" | "method" | "state";
|
|
44
|
+
input: boolean | object;
|
|
45
|
+
output?: boolean | object | undefined;
|
|
46
|
+
errors?: boolean | object | undefined;
|
|
47
|
+
}[];
|
|
48
|
+
dynamic: string[];
|
|
49
|
+
gaps?: string[] | undefined;
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { apiContracts as default };
|
|
53
|
+
//# sourceMappingURL=apiContracts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
|
|
2
|
+
//#region src/schemas/apiContracts.ts
|
|
3
|
+
/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
4
|
+
const apiContracts = defineApiContract({
|
|
5
|
+
version: 1,
|
|
6
|
+
http: [],
|
|
7
|
+
sockets: [],
|
|
8
|
+
dynamic: []
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { apiContracts, apiContracts as default };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=apiContracts.mjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
|
|
2
|
+
//#region src/constants/ios.ts
|
|
3
|
+
const IOS_PACKAGE = "@agimon-ai/po-ios";
|
|
4
|
+
const IOS_POOL_SERVICE = "po/ios-pool";
|
|
5
|
+
const IOS_DEVICE_SET_DIRECTORY = "devices";
|
|
6
|
+
const IOS_DEVICE_NAME_PREFIX = "po-pool-";
|
|
7
|
+
const IOS_POOL_DEFAULTS = {
|
|
8
|
+
minBooted: 0,
|
|
9
|
+
maxBooted: 2,
|
|
10
|
+
maxDevices: 4,
|
|
11
|
+
idleShutdownMinutes: 10,
|
|
12
|
+
waitTimeoutSeconds: 120
|
|
13
|
+
};
|
|
14
|
+
const JANITOR_INTERVAL_MS = 6e4;
|
|
15
|
+
/** A set member with no row must stay orphaned this long before it is deleted, so a create in flight survives. */
|
|
16
|
+
const ORPHAN_GRACE_MS = 3e5;
|
|
17
|
+
const SIMCTL_TIMEOUT_MS = 12e4;
|
|
18
|
+
const BOOT_TIMEOUT_MS = 3e5;
|
|
19
|
+
const MAX_COMMAND_OUTPUT_CHARS = 8388608;
|
|
20
|
+
const SCREENSHOT_MAX_PIXELS = 1200;
|
|
21
|
+
/** Fixed tool path: never the server's own PATH. */
|
|
22
|
+
const IOS_TOOL_PATH = "/usr/bin:/bin:/usr/sbin:/sbin";
|
|
23
|
+
const IOS_ERROR_CODES = [
|
|
24
|
+
"IOS_UNSUPPORTED_HOST",
|
|
25
|
+
"IOS_NO_XCODE",
|
|
26
|
+
"IOS_NO_RUNTIME",
|
|
27
|
+
"IOS_POOL_BUSY",
|
|
28
|
+
"IOS_NO_LEASE",
|
|
29
|
+
"IOS_LEASE_LOST",
|
|
30
|
+
"IOS_COMMAND_FAILED",
|
|
31
|
+
"IOS_INVALID_ARGUMENT",
|
|
32
|
+
"IOS_HELPER_UNAVAILABLE",
|
|
33
|
+
"IOS_ELEMENT_STALE",
|
|
34
|
+
"IOS_AMBIGUOUS",
|
|
35
|
+
"IOS_NO_MATCH"
|
|
36
|
+
];
|
|
37
|
+
/** The resident Swift helper that reads accessibility and sends touches; built from source on first use. */
|
|
38
|
+
const HELPER_PRODUCT = "po-ios-sim-helper";
|
|
39
|
+
const HELPER_SOURCE_DIRECTORY = "native/sim-helper";
|
|
40
|
+
/** Every file the helper build reads; their contents key the build cache. A contract test keeps this list complete. */
|
|
41
|
+
const HELPER_SOURCES = [
|
|
42
|
+
"Package.swift",
|
|
43
|
+
"Sources/PoIosCore/Protocol.swift",
|
|
44
|
+
"Sources/PoIosCore/Compaction.swift",
|
|
45
|
+
"Sources/PoIosSimHelper/main.swift",
|
|
46
|
+
"Sources/PoIosSimHelper/PrivateApis.swift",
|
|
47
|
+
"Sources/PoIosSimHelper/Backends.swift",
|
|
48
|
+
"Tests/PoIosCoreTests/ProtocolTests.swift",
|
|
49
|
+
"Tests/PoIosCoreTests/CompactionTests.swift"
|
|
50
|
+
];
|
|
51
|
+
const HELPER_NATIVE_DIRECTORY = "native";
|
|
52
|
+
const HELPER_BUILD_LOCK = "helper-build";
|
|
53
|
+
const HELPER_TIMEOUT_MS = 15e3;
|
|
54
|
+
const HELPER_BUILD_TIMEOUT_MS = 6e5;
|
|
55
|
+
const HELPER_RESTART_WINDOW_MS = 3e5;
|
|
56
|
+
const HELPER_MAX_LINE_CHARS = 8388608;
|
|
57
|
+
const WAIT_MAX_POLL_MS = 1e3;
|
|
58
|
+
const WAIT_DEFAULT_MS = 1e4;
|
|
59
|
+
const SETTLE_DEFAULT_MS = 5e3;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/schemas/contracts.ts
|
|
62
|
+
/** Bound once at the global level; every session leases from the same pool. */
|
|
63
|
+
const IOS_POOL_CONTRACT = (0, _agimon_ai_po_core_extensionFile.defineServiceContract)(IOS_POOL_SERVICE, { scope: "global" });
|
|
64
|
+
//#endregion
|
|
65
|
+
Object.defineProperty(exports, "BOOT_TIMEOUT_MS", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function() {
|
|
68
|
+
return BOOT_TIMEOUT_MS;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(exports, "HELPER_BUILD_LOCK", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function() {
|
|
74
|
+
return HELPER_BUILD_LOCK;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "HELPER_BUILD_TIMEOUT_MS", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function() {
|
|
80
|
+
return HELPER_BUILD_TIMEOUT_MS;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, "HELPER_MAX_LINE_CHARS", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function() {
|
|
86
|
+
return HELPER_MAX_LINE_CHARS;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "HELPER_NATIVE_DIRECTORY", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function() {
|
|
92
|
+
return HELPER_NATIVE_DIRECTORY;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(exports, "HELPER_PRODUCT", {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: function() {
|
|
98
|
+
return HELPER_PRODUCT;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "HELPER_RESTART_WINDOW_MS", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function() {
|
|
104
|
+
return HELPER_RESTART_WINDOW_MS;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(exports, "HELPER_SOURCES", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function() {
|
|
110
|
+
return HELPER_SOURCES;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(exports, "HELPER_SOURCE_DIRECTORY", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function() {
|
|
116
|
+
return HELPER_SOURCE_DIRECTORY;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
Object.defineProperty(exports, "HELPER_TIMEOUT_MS", {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
get: function() {
|
|
122
|
+
return HELPER_TIMEOUT_MS;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(exports, "IOS_DEVICE_NAME_PREFIX", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
get: function() {
|
|
128
|
+
return IOS_DEVICE_NAME_PREFIX;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
Object.defineProperty(exports, "IOS_DEVICE_SET_DIRECTORY", {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function() {
|
|
134
|
+
return IOS_DEVICE_SET_DIRECTORY;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(exports, "IOS_ERROR_CODES", {
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: function() {
|
|
140
|
+
return IOS_ERROR_CODES;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
Object.defineProperty(exports, "IOS_PACKAGE", {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
get: function() {
|
|
146
|
+
return IOS_PACKAGE;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
Object.defineProperty(exports, "IOS_POOL_CONTRACT", {
|
|
150
|
+
enumerable: true,
|
|
151
|
+
get: function() {
|
|
152
|
+
return IOS_POOL_CONTRACT;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
Object.defineProperty(exports, "IOS_POOL_DEFAULTS", {
|
|
156
|
+
enumerable: true,
|
|
157
|
+
get: function() {
|
|
158
|
+
return IOS_POOL_DEFAULTS;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
Object.defineProperty(exports, "IOS_POOL_SERVICE", {
|
|
162
|
+
enumerable: true,
|
|
163
|
+
get: function() {
|
|
164
|
+
return IOS_POOL_SERVICE;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
Object.defineProperty(exports, "IOS_TOOL_PATH", {
|
|
168
|
+
enumerable: true,
|
|
169
|
+
get: function() {
|
|
170
|
+
return IOS_TOOL_PATH;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
Object.defineProperty(exports, "JANITOR_INTERVAL_MS", {
|
|
174
|
+
enumerable: true,
|
|
175
|
+
get: function() {
|
|
176
|
+
return JANITOR_INTERVAL_MS;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
Object.defineProperty(exports, "MAX_COMMAND_OUTPUT_CHARS", {
|
|
180
|
+
enumerable: true,
|
|
181
|
+
get: function() {
|
|
182
|
+
return MAX_COMMAND_OUTPUT_CHARS;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
Object.defineProperty(exports, "ORPHAN_GRACE_MS", {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
get: function() {
|
|
188
|
+
return ORPHAN_GRACE_MS;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
Object.defineProperty(exports, "SCREENSHOT_MAX_PIXELS", {
|
|
192
|
+
enumerable: true,
|
|
193
|
+
get: function() {
|
|
194
|
+
return SCREENSHOT_MAX_PIXELS;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
Object.defineProperty(exports, "SETTLE_DEFAULT_MS", {
|
|
198
|
+
enumerable: true,
|
|
199
|
+
get: function() {
|
|
200
|
+
return SETTLE_DEFAULT_MS;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
Object.defineProperty(exports, "SIMCTL_TIMEOUT_MS", {
|
|
204
|
+
enumerable: true,
|
|
205
|
+
get: function() {
|
|
206
|
+
return SIMCTL_TIMEOUT_MS;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
Object.defineProperty(exports, "WAIT_DEFAULT_MS", {
|
|
210
|
+
enumerable: true,
|
|
211
|
+
get: function() {
|
|
212
|
+
return WAIT_DEFAULT_MS;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
Object.defineProperty(exports, "WAIT_MAX_POLL_MS", {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: function() {
|
|
218
|
+
return WAIT_MAX_POLL_MS;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
//# sourceMappingURL=contracts-C54pSczx.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts-C54pSczx.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\n/** Fixed tool path: never the server's own PATH. */\nexport const IOS_TOOL_PATH = '/usr/bin:/bin:/usr/sbin:/sbin';\n\nexport const IOS_ERROR_CODES = [\n 'IOS_UNSUPPORTED_HOST',\n 'IOS_NO_XCODE',\n 'IOS_NO_RUNTIME',\n 'IOS_POOL_BUSY',\n 'IOS_NO_LEASE',\n 'IOS_LEASE_LOST',\n 'IOS_COMMAND_FAILED',\n 'IOS_INVALID_ARGUMENT',\n 'IOS_HELPER_UNAVAILABLE',\n 'IOS_ELEMENT_STALE',\n 'IOS_AMBIGUOUS',\n 'IOS_NO_MATCH',\n] as const;\n\n/** The resident Swift helper that reads accessibility and sends touches; built from source on first use. */\nexport const HELPER_PRODUCT = 'po-ios-sim-helper';\nexport const HELPER_PROTOCOL_VERSION = 1;\nexport const HELPER_SOURCE_DIRECTORY = 'native/sim-helper';\n/** Every file the helper build reads; their contents key the build cache. A contract test keeps this list complete. */\nexport const HELPER_SOURCES = [\n 'Package.swift',\n 'Sources/PoIosCore/Protocol.swift',\n 'Sources/PoIosCore/Compaction.swift',\n 'Sources/PoIosSimHelper/main.swift',\n 'Sources/PoIosSimHelper/PrivateApis.swift',\n 'Sources/PoIosSimHelper/Backends.swift',\n 'Tests/PoIosCoreTests/ProtocolTests.swift',\n 'Tests/PoIosCoreTests/CompactionTests.swift',\n] as const;\nexport const HELPER_NATIVE_DIRECTORY = 'native';\nexport const HELPER_BUILD_LOCK = 'helper-build';\nexport const HELPER_TIMEOUT_MS = 15_000;\nexport const HELPER_BUILD_TIMEOUT_MS = 10 * 60_000;\nexport const HELPER_MAX_RESTARTS = 3;\nexport const HELPER_RESTART_WINDOW_MS = 5 * 60_000;\nexport const HELPER_MAX_LINE_CHARS = 8 * 1024 * 1024;\n\nexport const WAIT_POLL_MS = 250;\nexport const WAIT_MAX_POLL_MS = 1000;\nexport const WAIT_DEFAULT_MS = 10_000;\nexport const SETTLE_DEFAULT_MS = 5000;\nexport const SETTLE_QUIET_MS = 500;\nexport const AMBIGUOUS_CANDIDATES = 5;\nexport const SWIPE_DEFAULT_MS = 300;\nexport const HARDWARE_BUTTONS = ['home', 'lock', 'siri', 'volumeUp', 'volumeDown'] as const;\n","import { defineServiceContract } from '@agimon-ai/po-core/extensionFile';\n\nimport { IOS_POOL_SERVICE } from '../constants/ios';\nimport type { IosPool } from '../services/devicePool/type';\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\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/ios-pool': IosPool;\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;;AAKrC,MAAa,gBAAgB;AAE7B,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAa,iBAAiB;AAE9B,MAAa,0BAA0B;;AAEvC,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAa,0BAA0B;AACvC,MAAa,oBAAoB;AACjC,MAAa,oBAAoB;AACjC,MAAa,0BAA0B;AAEvC,MAAa,2BAA2B;AACxC,MAAa,wBAAwB;AAGrC,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,oBAAoB;;;;ACpEjC,MAAa,qBAAA,GAAoBA,iCAAAA,sBAAAA,CAA+B,kBAAkB,EAAE,OAAO,SAAS,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineServiceContract } from "@agimon-ai/po-core/extensionFile";
|
|
2
|
+
//#region src/constants/ios.ts
|
|
3
|
+
const IOS_PACKAGE = "@agimon-ai/po-ios";
|
|
4
|
+
const IOS_POOL_SERVICE = "po/ios-pool";
|
|
5
|
+
const IOS_DEVICE_SET_DIRECTORY = "devices";
|
|
6
|
+
const IOS_DEVICE_NAME_PREFIX = "po-pool-";
|
|
7
|
+
const IOS_POOL_DEFAULTS = {
|
|
8
|
+
minBooted: 0,
|
|
9
|
+
maxBooted: 2,
|
|
10
|
+
maxDevices: 4,
|
|
11
|
+
idleShutdownMinutes: 10,
|
|
12
|
+
waitTimeoutSeconds: 120
|
|
13
|
+
};
|
|
14
|
+
const JANITOR_INTERVAL_MS = 6e4;
|
|
15
|
+
/** A set member with no row must stay orphaned this long before it is deleted, so a create in flight survives. */
|
|
16
|
+
const ORPHAN_GRACE_MS = 3e5;
|
|
17
|
+
const SIMCTL_TIMEOUT_MS = 12e4;
|
|
18
|
+
const BOOT_TIMEOUT_MS = 3e5;
|
|
19
|
+
const MAX_COMMAND_OUTPUT_CHARS = 8388608;
|
|
20
|
+
const SCREENSHOT_MAX_PIXELS = 1200;
|
|
21
|
+
/** Fixed tool path: never the server's own PATH. */
|
|
22
|
+
const IOS_TOOL_PATH = "/usr/bin:/bin:/usr/sbin:/sbin";
|
|
23
|
+
const IOS_ERROR_CODES = [
|
|
24
|
+
"IOS_UNSUPPORTED_HOST",
|
|
25
|
+
"IOS_NO_XCODE",
|
|
26
|
+
"IOS_NO_RUNTIME",
|
|
27
|
+
"IOS_POOL_BUSY",
|
|
28
|
+
"IOS_NO_LEASE",
|
|
29
|
+
"IOS_LEASE_LOST",
|
|
30
|
+
"IOS_COMMAND_FAILED",
|
|
31
|
+
"IOS_INVALID_ARGUMENT",
|
|
32
|
+
"IOS_HELPER_UNAVAILABLE",
|
|
33
|
+
"IOS_ELEMENT_STALE",
|
|
34
|
+
"IOS_AMBIGUOUS",
|
|
35
|
+
"IOS_NO_MATCH"
|
|
36
|
+
];
|
|
37
|
+
/** The resident Swift helper that reads accessibility and sends touches; built from source on first use. */
|
|
38
|
+
const HELPER_PRODUCT = "po-ios-sim-helper";
|
|
39
|
+
const HELPER_SOURCE_DIRECTORY = "native/sim-helper";
|
|
40
|
+
/** Every file the helper build reads; their contents key the build cache. A contract test keeps this list complete. */
|
|
41
|
+
const HELPER_SOURCES = [
|
|
42
|
+
"Package.swift",
|
|
43
|
+
"Sources/PoIosCore/Protocol.swift",
|
|
44
|
+
"Sources/PoIosCore/Compaction.swift",
|
|
45
|
+
"Sources/PoIosSimHelper/main.swift",
|
|
46
|
+
"Sources/PoIosSimHelper/PrivateApis.swift",
|
|
47
|
+
"Sources/PoIosSimHelper/Backends.swift",
|
|
48
|
+
"Tests/PoIosCoreTests/ProtocolTests.swift",
|
|
49
|
+
"Tests/PoIosCoreTests/CompactionTests.swift"
|
|
50
|
+
];
|
|
51
|
+
const HELPER_NATIVE_DIRECTORY = "native";
|
|
52
|
+
const HELPER_BUILD_LOCK = "helper-build";
|
|
53
|
+
const HELPER_TIMEOUT_MS = 15e3;
|
|
54
|
+
const HELPER_BUILD_TIMEOUT_MS = 6e5;
|
|
55
|
+
const HELPER_RESTART_WINDOW_MS = 3e5;
|
|
56
|
+
const HELPER_MAX_LINE_CHARS = 8388608;
|
|
57
|
+
const WAIT_MAX_POLL_MS = 1e3;
|
|
58
|
+
const WAIT_DEFAULT_MS = 1e4;
|
|
59
|
+
const SETTLE_DEFAULT_MS = 5e3;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/schemas/contracts.ts
|
|
62
|
+
/** Bound once at the global level; every session leases from the same pool. */
|
|
63
|
+
const IOS_POOL_CONTRACT = defineServiceContract(IOS_POOL_SERVICE, { scope: "global" });
|
|
64
|
+
//#endregion
|
|
65
|
+
export { SETTLE_DEFAULT_MS as C, WAIT_MAX_POLL_MS as E, SCREENSHOT_MAX_PIXELS as S, WAIT_DEFAULT_MS as T, IOS_POOL_SERVICE as _, HELPER_MAX_LINE_CHARS as a, MAX_COMMAND_OUTPUT_CHARS as b, HELPER_RESTART_WINDOW_MS as c, HELPER_TIMEOUT_MS as d, IOS_DEVICE_NAME_PREFIX as f, IOS_POOL_DEFAULTS as g, IOS_PACKAGE as h, HELPER_BUILD_TIMEOUT_MS as i, HELPER_SOURCES as l, IOS_ERROR_CODES as m, BOOT_TIMEOUT_MS as n, HELPER_NATIVE_DIRECTORY as o, IOS_DEVICE_SET_DIRECTORY as p, HELPER_BUILD_LOCK as r, HELPER_PRODUCT as s, IOS_POOL_CONTRACT as t, HELPER_SOURCE_DIRECTORY as u, IOS_TOOL_PATH as v, SIMCTL_TIMEOUT_MS as w, ORPHAN_GRACE_MS as x, JANITOR_INTERVAL_MS as y };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=contracts-D41ZfB5m.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts-D41ZfB5m.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\n/** Fixed tool path: never the server's own PATH. */\nexport const IOS_TOOL_PATH = '/usr/bin:/bin:/usr/sbin:/sbin';\n\nexport const IOS_ERROR_CODES = [\n 'IOS_UNSUPPORTED_HOST',\n 'IOS_NO_XCODE',\n 'IOS_NO_RUNTIME',\n 'IOS_POOL_BUSY',\n 'IOS_NO_LEASE',\n 'IOS_LEASE_LOST',\n 'IOS_COMMAND_FAILED',\n 'IOS_INVALID_ARGUMENT',\n 'IOS_HELPER_UNAVAILABLE',\n 'IOS_ELEMENT_STALE',\n 'IOS_AMBIGUOUS',\n 'IOS_NO_MATCH',\n] as const;\n\n/** The resident Swift helper that reads accessibility and sends touches; built from source on first use. */\nexport const HELPER_PRODUCT = 'po-ios-sim-helper';\nexport const HELPER_PROTOCOL_VERSION = 1;\nexport const HELPER_SOURCE_DIRECTORY = 'native/sim-helper';\n/** Every file the helper build reads; their contents key the build cache. A contract test keeps this list complete. */\nexport const HELPER_SOURCES = [\n 'Package.swift',\n 'Sources/PoIosCore/Protocol.swift',\n 'Sources/PoIosCore/Compaction.swift',\n 'Sources/PoIosSimHelper/main.swift',\n 'Sources/PoIosSimHelper/PrivateApis.swift',\n 'Sources/PoIosSimHelper/Backends.swift',\n 'Tests/PoIosCoreTests/ProtocolTests.swift',\n 'Tests/PoIosCoreTests/CompactionTests.swift',\n] as const;\nexport const HELPER_NATIVE_DIRECTORY = 'native';\nexport const HELPER_BUILD_LOCK = 'helper-build';\nexport const HELPER_TIMEOUT_MS = 15_000;\nexport const HELPER_BUILD_TIMEOUT_MS = 10 * 60_000;\nexport const HELPER_MAX_RESTARTS = 3;\nexport const HELPER_RESTART_WINDOW_MS = 5 * 60_000;\nexport const HELPER_MAX_LINE_CHARS = 8 * 1024 * 1024;\n\nexport const WAIT_POLL_MS = 250;\nexport const WAIT_MAX_POLL_MS = 1000;\nexport const WAIT_DEFAULT_MS = 10_000;\nexport const SETTLE_DEFAULT_MS = 5000;\nexport const SETTLE_QUIET_MS = 500;\nexport const AMBIGUOUS_CANDIDATES = 5;\nexport const SWIPE_DEFAULT_MS = 300;\nexport const HARDWARE_BUTTONS = ['home', 'lock', 'siri', 'volumeUp', 'volumeDown'] as const;\n","import { defineServiceContract } from '@agimon-ai/po-core/extensionFile';\n\nimport { IOS_POOL_SERVICE } from '../constants/ios';\nimport type { IosPool } from '../services/devicePool/type';\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\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/ios-pool': IosPool;\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;;AAKrC,MAAa,gBAAgB;AAE7B,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAa,iBAAiB;AAE9B,MAAa,0BAA0B;;AAEvC,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAa,0BAA0B;AACvC,MAAa,oBAAoB;AACjC,MAAa,oBAAoB;AACjC,MAAa,0BAA0B;AAEvC,MAAa,2BAA2B;AACxC,MAAa,wBAAwB;AAGrC,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,oBAAoB;;;;ACpEjC,MAAa,oBAAoB,sBAA+B,kBAAkB,EAAE,OAAO,SAAS,CAAC"}
|