Skip to content

Commit bf0da83

Browse files
committed
fix(contracts): keep the fold coordinate-space constant off the CLI closure
FOLD_SCREEN_COORDINATE_SPACE lived in fold-runtime.ts, a module the CLI closure did not otherwise load. Importing it directly from src/commands/system/index.ts pulled fold-runtime.ts (and its own dependents) into cli.ts's eager import graph, tripping the eager-closure-budgets gate (295 -> 296 modules). Move the constant to device-rotation.ts, which the same file already loads via the @agent-device/contracts/device facade for DEVICE_ROTATIONS/FOLD_POSES, and re-export it from fold-runtime.ts and the device facade so existing importers (packages/platform-apple's fold pose runtime) are unaffected.
1 parent 110cb57 commit bf0da83

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/contracts/src/device-rotation.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { AppError } from '@agent-device/kernel/errors';
22

3+
/** Single source of truth for the discriminator the Apple owner sets and the MCP schema advertises. */
4+
export const FOLD_SCREEN_COORDINATE_SPACE = 'native-panel' as const;
5+
36
export const DEVICE_ROTATIONS = [
47
'portrait',
58
'portrait-upside-down',

‎packages/contracts/src/facades/device.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export type {
3131
export {
3232
DEVICE_ROTATIONS,
3333
DEVICE_ROTATION_SURFACE_INDEX,
34+
FOLD_SCREEN_COORDINATE_SPACE,
3435
MAX_FOLD_DURATION_MS,
3536
MAX_FOLD_KEYFRAMES,
3637
parseFoldInput,

‎packages/contracts/src/fold-runtime.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { FoldPose, SetFoldPoseInput } from './device-rotation.ts';
2+
import { FOLD_SCREEN_COORDINATE_SPACE } from './device-rotation.ts';
23
import type { RuntimeOperationFact } from './platform-runtime.ts';
34

4-
/** Single source of truth for the discriminator the Apple owner sets and the MCP schema advertises. */
5-
export const FOLD_SCREEN_COORDINATE_SPACE = 'native-panel' as const;
5+
export { FOLD_SCREEN_COORDINATE_SPACE };
66

77
/**
88
* The panel the device lights after the pose settled, in that panel's own native points: its pixel

0 commit comments

Comments
 (0)