Skip to content

Commit 436ff2d

Browse files
committed
refactor(platforms): sink the shared src/platforms root files into their substrate homes (#2082 W3)
Eleven shared mechanics modules move to @agent-device/capture-kit (app-resolution-cache, boot-diagnostics, command-attempts, the install-source family, perf-utils, toolchain-probe) and three vocabulary modules to @agent-device/contracts (appearance, setting-state, unsupported-interactor), with their owning tests as package siblings. install-source-archive and install-source-download stay unexported (package-internal). Exports maps, package-boundaries pins, and measured eager-closure budget rows grow accordingly; capture-kit takes over the undici and ipaddr.js dependencies at the root-pinned ranges. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_018VngeKZH6zBuJzNBk5YzUH
1 parent e61846a commit 436ff2d

46 files changed

Lines changed: 131 additions & 44 deletions

Some content is hidden

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

‎packages/capture-kit/package.json‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77
"dependencies": {
88
"@agent-device/contracts": "workspace:*",
99
"@agent-device/kernel": "workspace:*",
10+
"ipaddr.js": "^2.5.0",
1011
"tar-stream": "^3.2.0",
12+
"undici": "7.29.0",
1113
"yauzl": "^3.4.0"
1214
},
1315
"exports": {
1416
".": {
1517
"types": "./src/index.ts",
1618
"default": "./src/index.ts"
1719
},
20+
"./app-resolution-cache": {
21+
"types": "./src/app-resolution-cache.ts",
22+
"default": "./src/app-resolution-cache.ts"
23+
},
1824
"./archive-extraction": {
1925
"types": "./src/archive-extraction.ts",
2026
"default": "./src/archive-extraction.ts"
@@ -31,10 +37,18 @@
3137
"types": "./src/atomic-file.ts",
3238
"default": "./src/atomic-file.ts"
3339
},
40+
"./boot-diagnostics": {
41+
"types": "./src/boot-diagnostics.ts",
42+
"default": "./src/boot-diagnostics.ts"
43+
},
3444
"./byte-limit-stream": {
3545
"types": "./src/byte-limit-stream.ts",
3646
"default": "./src/byte-limit-stream.ts"
3747
},
48+
"./command-attempts": {
49+
"types": "./src/command-attempts.ts",
50+
"default": "./src/command-attempts.ts"
51+
},
3852
"./device-isolation": {
3953
"types": "./src/device-isolation.ts",
4054
"default": "./src/device-isolation.ts"
@@ -55,6 +69,22 @@
5569
"types": "./src/host-process.ts",
5670
"default": "./src/host-process.ts"
5771
},
72+
"./install-artifact-archive-context": {
73+
"types": "./src/install-artifact-archive-context.ts",
74+
"default": "./src/install-artifact-archive-context.ts"
75+
},
76+
"./install-source": {
77+
"types": "./src/install-source.ts",
78+
"default": "./src/install-source.ts"
79+
},
80+
"./install-source-network": {
81+
"types": "./src/install-source-network.ts",
82+
"default": "./src/install-source-network.ts"
83+
},
84+
"./install-source-network-transport": {
85+
"types": "./src/install-source-network-transport.ts",
86+
"default": "./src/install-source-network-transport.ts"
87+
},
5888
"./location-coordinates": {
5989
"types": "./src/location-coordinates.ts",
6090
"default": "./src/location-coordinates.ts"
@@ -87,6 +117,10 @@
87117
"types": "./src/path-resolution.ts",
88118
"default": "./src/path-resolution.ts"
89119
},
120+
"./perf-utils": {
121+
"types": "./src/perf-utils.ts",
122+
"default": "./src/perf-utils.ts"
123+
},
90124
"./png": {
91125
"types": "./src/png.ts",
92126
"default": "./src/png.ts"
@@ -167,6 +201,10 @@
167201
"types": "./src/timeouts.ts",
168202
"default": "./src/timeouts.ts"
169203
},
204+
"./toolchain-probe": {
205+
"types": "./src/toolchain-probe.ts",
206+
"default": "./src/toolchain-probe.ts"
207+
},
170208
"./ttl-memo": {
171209
"types": "./src/ttl-memo.ts",
172210
"default": "./src/ttl-memo.ts"

src/platforms/__tests__/app-resolution-cache.test.ts renamed to packages/capture-kit/src/app-resolution-cache.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test } from 'vitest';
22
import assert from 'node:assert/strict';
3-
import { createAppResolutionCache } from '../app-resolution-cache.ts';
3+
import { createAppResolutionCache } from './app-resolution-cache.ts';
44

55
test('app resolution cache returns values until the expiry boundary', () => {
66
let nowMs = 1_000;
File renamed without changes.

src/platforms/__tests__/boot-diagnostics.test.ts renamed to packages/capture-kit/src/boot-diagnostics.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
bootFailureHint,
55
classifyBootFailure,
66
isInfrastructureBootFailureReason,
7-
} from '../boot-diagnostics.ts';
7+
} from './boot-diagnostics.ts';
88
import { AppError } from '@agent-device/kernel/errors';
99

1010
test('classifyBootFailure maps timeout errors', () => {

src/platforms/boot-diagnostics.ts renamed to packages/capture-kit/src/boot-diagnostics.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type BootDiagnosticContext = {
1414
phase?: 'boot' | 'connect' | 'transport';
1515
};
1616

17+
// fallow-ignore-next-line complexity
1718
export function classifyBootFailure(input: {
1819
error?: unknown;
1920
message?: string;
File renamed without changes.

src/platforms/install-artifact-archive-context.ts renamed to packages/capture-kit/src/install-artifact-archive-context.ts

File renamed without changes.
File renamed without changes.

src/platforms/__tests__/install-source-download.test.ts renamed to packages/capture-kit/src/install-source-download.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import dns from 'node:dns/promises';
33
import fs from 'node:fs/promises';
44
import { Readable } from 'node:stream';
55
import { test, vi } from 'vitest';
6-
import { mkdtempForTest } from '../../__tests__/test-utils/tmp-dir.ts';
7-
import { downloadInstallSource } from '../install-source-download.ts';
8-
import * as networkTransport from '../install-source-network-transport.ts';
6+
import { mkdtempForTest } from './tmp-dir.fixtures.ts';
7+
import { downloadInstallSource } from './install-source-download.ts';
8+
import * as networkTransport from './install-source-network-transport.ts';
99

1010
test('download redirects revalidate destinations and strip sensitive cross-origin headers', async () => {
1111
const tempRoot = await mkdtempForTest('agent-device-download-redirect-');
File renamed without changes.

0 commit comments

Comments
 (0)