Skip to content

Commit 045adcd

Browse files
committed
refactor(contracts): retire the platform/interaction compatibility façades
#1959 granularized the contracts entry surface but left the wide platform/interaction façades in place as a compatibility surface for ~490 type-only importers. This mechanically moves every importer (~350 files) onto the granular subpath each symbol actually lives on, deletes the two façade files, and removes the fallow ignoreExports entries and eager-closure-budget rows that existed only to cover them. Eight previously-unexported source files needed new package.json subpaths (clipboard, keyboard, network-traffic, platform-plugin, platform-providers, runner-lease-context, screen-recording-runtime-host), and ./interaction now points directly at src/interaction.ts instead of the deleted barrel. .oxlintrc.json's no-restricted-imports rules for the two façades are removed since there's no wide facade left to warn against value-importing.
1 parent 494f1c5 commit 045adcd

346 files changed

Lines changed: 830 additions & 1640 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.fallowrc.json‎

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,8 @@
171171
"exports": ["LimrunIosCommandExecution"]
172172
},
173173
{
174-
"comment": "#1959 gave every contracts vocabulary module its own entry subpath and moved all ~230 value-importers onto them, so `./platform` and `./interaction` now carry zero value consumers — every re-export on them reads as unused. They stay as the compatibility surface for the ~490 type-only importers the granularization deliberately left alone (type imports are erased, so they cost nothing to load). Scoped to these two façades rather than listed symbol-by-symbol because the property is per-file: nothing on them is value-consumed any more. Retiring them entirely — moving the type-only importers too and deleting the files — is the follow-up that makes this entry unnecessary.",
175-
"file": "packages/contracts/src/facades/{platform,interaction}.ts",
176-
"exports": ["*"]
177-
},
178-
{
179-
"comment": "Converting the contracts façades from `export *` to explicit named re-exports (the pin-table retirement) made these individually visible to --production analysis for the first time; a bare star previously hid them from this exact check. GESTURE_INITIAL_ANGLE_DEGREES/GESTURE_SAMPLE_INTERVAL_MS/INTERACTION_GUARANTEES/INTERACTION_PATH_IDS/parseAndroidInputMethodPackage/isRecordingExportQuality have same-package test-tree consumers (invisible to --production, mirroring the packages/{ad-script,maestro} entry above); the rest currently have none. Kept rather than narrowed here so the façade's re-export surface stays byte-identical to the symbol set the retired pin table asserted — narrowing the surface is a follow-up with its own review, not a side effect of this mechanical conversion. The last five (COORDINATE_GESTURE_KINDS, normalizePublicGesture, DEFAULT_DRAG_*) are #1567's drag vocabulary, surfaced the same way by the same conversion and kept for the same reason.",
180-
"file": "packages/contracts/src/facades/{client,command,divergence,interaction,platform,recording}.ts",
174+
"comment": "Converting the contracts façades from `export *` to explicit named re-exports (the pin-table retirement) made these individually visible to --production analysis for the first time; a bare star previously hid them from this exact check. isRecord/IOS_SAFARI_BUNDLE_ID/REPLAY_DIVERGENCE_* have no production consumer. Kept rather than narrowed here so the façade's re-export surface stays byte-identical to the symbol set the retired pin table asserted — narrowing the surface is a follow-up with its own review, not a side effect of this mechanical conversion.",
175+
"file": "packages/contracts/src/facades/{client,command,divergence,recording}.ts",
181176
"exports": [
182177
"isRecord",
183178
"IOS_SAFARI_BUNDLE_ID",
@@ -188,21 +183,7 @@
188183
"measureReplayDivergenceBytes",
189184
"sanitizeReplayDivergenceField",
190185
"truncateUtf8Field",
191-
"GESTURE_DURATION_MAX_MS",
192-
"GESTURE_INITIAL_ANGLE_DEGREES",
193-
"GESTURE_SAMPLE_INTERVAL_MS",
194-
"INTERACTION_GUARANTEES",
195-
"INTERACTION_PATH_IDS",
196-
"buildSwipePresetGesturePlan",
197-
"clampGestureCoordinate",
198-
"gestureDirectionDelta",
199-
"parseAndroidInputMethodPackage",
200-
"isRecordingExportQuality",
201-
"COORDINATE_GESTURE_KINDS",
202-
"normalizePublicGesture",
203-
"DEFAULT_DRAG_DESTINATION_HOLD_MS",
204-
"DEFAULT_DRAG_MOVE_MS",
205-
"DEFAULT_DRAG_SOURCE_HOLD_MS"
186+
"isRecordingExportQuality"
206187
]
207188
}
208189
],

‎.oxlintrc.json‎

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@
4646
{
4747
"name": "node:child_process",
4848
"message": "Use process helpers from src/utils/exec.ts instead of importing node:child_process directly."
49-
},
50-
{
51-
"name": "@agent-device/contracts/platform",
52-
"allowTypeImports": true,
53-
"message": "Value-importing this facade evaluates all 32 vocabulary modules it re-exports. Import the symbol from the module that owns it (@agent-device/contracts/<module>). `import type` stays fine \u2014 it is erased."
54-
},
55-
{
56-
"name": "@agent-device/contracts/interaction",
57-
"allowTypeImports": true,
58-
"message": "Value-importing this facade evaluates all 18 vocabulary modules it re-exports. Import the symbol from the module that owns it (@agent-device/contracts/<module>). `import type` stays fine \u2014 it is erased."
5949
}
6050
]
6151
}
@@ -65,45 +55,7 @@
6555
{
6656
"files": ["src/utils/exec.ts", "src/**/*.test.ts", "src/**/__tests__/**/*.ts"],
6757
"rules": {
68-
"eslint/no-restricted-imports": [
69-
"error",
70-
{
71-
"paths": [
72-
{
73-
"name": "@agent-device/contracts/platform",
74-
"allowTypeImports": true,
75-
"message": "Value-importing this facade evaluates all 32 vocabulary modules it re-exports. Import the symbol from the module that owns it (@agent-device/contracts/<module>). `import type` stays fine \u2014 it is erased."
76-
},
77-
{
78-
"name": "@agent-device/contracts/interaction",
79-
"allowTypeImports": true,
80-
"message": "Value-importing this facade evaluates all 18 vocabulary modules it re-exports. Import the symbol from the module that owns it (@agent-device/contracts/<module>). `import type` stays fine \u2014 it is erased."
81-
}
82-
]
83-
}
84-
]
85-
}
86-
},
87-
{
88-
"files": ["packages/*/src/**/*.ts"],
89-
"rules": {
90-
"eslint/no-restricted-imports": [
91-
"error",
92-
{
93-
"paths": [
94-
{
95-
"name": "@agent-device/contracts/platform",
96-
"allowTypeImports": true,
97-
"message": "Value-importing this facade evaluates all 32 vocabulary modules it re-exports. Import the symbol from the module that owns it (@agent-device/contracts/<module>). `import type` stays fine \u2014 it is erased."
98-
},
99-
{
100-
"name": "@agent-device/contracts/interaction",
101-
"allowTypeImports": true,
102-
"message": "Value-importing this facade evaluates all 18 vocabulary modules it re-exports. Import the symbol from the module that owns it (@agent-device/contracts/<module>). `import type` stays fine \u2014 it is erased."
103-
}
104-
]
105-
}
106-
]
58+
"eslint/no-restricted-imports": ["error", { "paths": [] }]
10759
}
10860
},
10961
{

‎packages/capture-kit/src/app-log-pid-monitor.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test, vi } from 'vitest';
2-
import type { AppLogBackgroundProcess } from '@agent-device/contracts/platform';
2+
import type { AppLogBackgroundProcess } from '@agent-device/contracts/app-log-runtime';
33
import { monitorPidScopedProcess } from './app-log-pid-monitor.ts';
44
import { controlledSleeps, deferred, processFixture } from './app-log-pid-process.fixtures.ts';
55

‎packages/capture-kit/src/app-log-pid-monitor.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import type { AppLogBackgroundProcess, AppLogLiveSnapshot } from '@agent-device/contracts/platform';
1+
import type {
2+
AppLogBackgroundProcess,
3+
AppLogLiveSnapshot,
4+
} from '@agent-device/contracts/app-log-runtime';
25

36
export type PidScopedProcess = Readonly<{
47
pid: string;

‎packages/capture-kit/src/app-log-pid-process.fixtures.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { vi } from 'vitest';
2-
import type { AppLogBackgroundProcess } from '@agent-device/contracts/platform';
2+
import type { AppLogBackgroundProcess } from '@agent-device/contracts/app-log-runtime';
33

44
export function deferred<T>() {
55
let resolve!: (value: T) => void;

‎packages/capture-kit/src/app-log-pid-process.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
AppLogBackgroundProcess,
44
AppLogOutputSink,
55
AppLogRuntimeHost,
6-
} from '@agent-device/contracts/platform';
6+
} from '@agent-device/contracts/app-log-runtime';
77
import { deferred, processFixture } from './app-log-pid-process.fixtures.ts';
88
import { createPidScopedAppLogProcess } from './app-log-pid-process.ts';
99

‎packages/capture-kit/src/app-log-pid-process.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
AppLogProcessStart,
77
AppLogProcessCommand,
88
AppLogRuntimeHost,
9-
} from '@agent-device/contracts/platform';
9+
} from '@agent-device/contracts/app-log-runtime';
1010
import { createAppLogLiveHandleFromFinish } from './app-log-live-handle.ts';
1111
import { monitorPidScopedProcess } from './app-log-pid-monitor.ts';
1212

‎packages/capture-kit/src/app-log-pid-runtime.ts‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@ import type {
88
AppLogSessionArtifacts,
99
AppLogStartInput,
1010
AppLogStartResult,
11-
DeviceBinding,
12-
DeviceRuntimeOwner,
11+
} from '@agent-device/contracts/app-log-runtime';
12+
import {
13+
type DeviceBinding,
14+
type DeviceRuntimeOwner,
15+
type RuntimeFacts,
16+
type RuntimeOwnerRef,
17+
localRuntimeOwner,
18+
sameRuntimeOwner,
19+
} from '@agent-device/contracts/platform-runtime';
20+
import type {
1321
DurableDescriptorCodec,
1422
DurableResourceEnvelope,
15-
HostCommandRequest,
16-
RuntimeFacts,
17-
RuntimeOwnerRef,
18-
} from '@agent-device/contracts/platform';
19-
import { localRuntimeOwner, sameRuntimeOwner } from '@agent-device/contracts/platform-runtime';
23+
} from '@agent-device/contracts/durable-resource-envelope';
24+
import type { HostCommandRequest } from '@agent-device/contracts/platform-runtime-host';
2025
import type { LogBackend } from '@agent-device/contracts/observability';
2126
import { createAppLogRecoveryOperations, createAppLogStartResult } from './app-log-runtime.ts';
2227
import {

‎packages/capture-kit/src/app-log-process-recovery.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { test, vi } from 'vitest';
33
import type {
44
AppLogProcessMarkerReadOutcome,
55
AppLogProcessOwnership,
6-
} from '@agent-device/contracts/platform';
6+
} from '@agent-device/contracts/app-log-runtime';
77
import {
88
cleanupManagedAppLogProcess,
99
reattachCleanupOnlyAppLogProcess,

‎packages/capture-kit/src/app-log-process-recovery.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import type {
33
AppLogLiveHandle,
44
AppLogProcessMarkerReadOutcome,
55
AppLogRuntimeHost,
6-
CleanupOutcome,
7-
ReattachOutcome,
8-
} from '@agent-device/contracts/platform';
6+
} from '@agent-device/contracts/app-log-runtime';
7+
import type { CleanupOutcome, ReattachOutcome } from '@agent-device/contracts/durable-resource';
98

109
type ManagedAppLogProcessHost = Readonly<{
1110
processes: Pick<

0 commit comments

Comments
 (0)