|
1 | | -import type { ReplayFormat } from '@agent-device/ad-script'; |
| 1 | +import type { getReplayPluginInstallation, ReplayFormat } from '@agent-device/ad-script'; |
2 | 2 | import type { ReplayBackendDeclaration } from '@agent-device/contracts/replay-backend'; |
3 | 3 |
|
4 | 4 | export const MAESTRO_COMPAT_SUPPORTED_CAPABILITIES = [ |
@@ -34,60 +34,34 @@ function formatMaestroCompatibilityReference(): string { |
34 | 34 | ].join('\n'); |
35 | 35 | } |
36 | 36 |
|
37 | | -const maestroPackage = '@agent-device/maestro'; |
38 | | -const nativePackage = '@agent-device/replay'; |
39 | | - |
40 | | -const maestroReplayBackendDeclaration: ReplayBackendDeclaration<'maestro'> = { |
41 | | - id: 'maestro', |
42 | | - package: maestroPackage, |
43 | | - installationHint: |
44 | | - 'Install on the client for source collection/export and on the daemon host for Maestro execution.', |
45 | | - help: { |
46 | | - summary: 'Supported Maestro YAML commands, grammar, and runtime boundaries', |
47 | | - body: `agent-device help maestro |
| 37 | +/** Full compatibility help is composed only by help consumers, from the vetted installation. */ |
| 38 | +export function getReplayBackendDeclaration( |
| 39 | + installation: ReturnType<typeof getReplayPluginInstallation>, |
| 40 | +): ReplayBackendDeclaration<ReplayFormat> { |
| 41 | + const body = |
| 42 | + installation.id === 'ad' |
| 43 | + ? `Run agent-device plugins add ${installation.package} on the daemon host for native .ad replay and all test suites. Existing scripts and arguments stay the same. Ordinary open/close --save-script recording stays in core. Restart the daemon after changing plugins, then retry the original invocation with all its arguments.` |
| 44 | + : `agent-device help maestro |
48 | 45 |
|
49 | | -Install with agent-device plugins add ${maestroPackage} on the client and daemon host. Restart the daemon after installation. |
| 46 | +Install with agent-device plugins add ${installation.package} on the client and daemon host. Restart the daemon after installation. |
50 | 47 |
|
51 | 48 | Run Maestro compatibility flows with replay <flow.yaml> --maestro or test <path> --maestro. Bind an iOS or Android target with --platform or an existing session. |
52 | 49 |
|
53 | 50 | ${formatMaestroCompatibilityReference()} |
54 | 51 |
|
55 | 52 | Unsupported syntax fails loudly rather than being skipped. Architecture, performance tradeoffs, and declared conformance divergences: ${MAESTRO_COMPATIBILITY_ADR_URL} |
56 | | -Focused compatibility request: ${MAESTRO_COMPATIBILITY_ISSUE_URL}`, |
57 | | - }, |
58 | | -}; |
59 | | - |
60 | | -/** |
61 | | - * The engine-free half of every registered replay backend (#3377), as `help` lists it. Kept apart |
62 | | - * from the registry so reading a declaration adds nothing to the closure of the daemon routes |
63 | | - * that only load backends. Keys come from the format grammar's vocabulary, and each declaration's |
64 | | - * `id` is typed to its key, as each plugin's is in the registry, so help cannot describe a backend |
65 | | - * other than the one its id loads. |
66 | | - */ |
67 | | -const REPLAY_BACKEND_DECLARATIONS: { |
68 | | - readonly [TId in ReplayFormat]: ReplayBackendDeclaration<TId>; |
69 | | -} = { |
70 | | - ad: { |
71 | | - id: 'ad', |
72 | | - package: nativePackage, |
73 | | - installationHint: |
74 | | - 'Install on the daemon host for native .ad replay and all test suites. Core clients can read and send native .ad sources without this plugin.', |
75 | | - help: { |
76 | | - summary: 'Native .ad replay and test suites', |
77 | | - body: `Run agent-device plugins add ${nativePackage} on the daemon host for native .ad replay and all test suites. Existing scripts and arguments stay the same. Ordinary open/close --save-script recording stays in core. Restart the daemon after changing plugins, then retry the original invocation with all its arguments.`, |
78 | | - }, |
79 | | - }, |
80 | | - maestro: maestroReplayBackendDeclaration, |
81 | | -}; |
82 | | - |
83 | | -export function getReplayBackendDeclaration( |
84 | | - id: ReplayFormat, |
85 | | -): ReplayBackendDeclaration<ReplayFormat> { |
86 | | - return REPLAY_BACKEND_DECLARATIONS[id]; |
| 53 | +Focused compatibility request: ${MAESTRO_COMPATIBILITY_ISSUE_URL}`; |
| 54 | + return { |
| 55 | + id: installation.id, |
| 56 | + package: installation.package, |
| 57 | + installationHint: installation.installationHint, |
| 58 | + help: { summary: installation.summary, body }, |
| 59 | + }; |
87 | 60 | } |
88 | 61 |
|
89 | 62 | /** Installation guidance uses the same vetted package declaration as missing-plugin errors. */ |
90 | | -export function replayPluginInstallHelp(id: ReplayFormat): string { |
91 | | - const declaration = getReplayBackendDeclaration(id); |
92 | | - return `${declaration.help.summary} (plugin, install separately). Run agent-device plugins add ${declaration.package}.`; |
| 63 | +export function replayPluginInstallHelp( |
| 64 | + installation: ReturnType<typeof getReplayPluginInstallation>, |
| 65 | +): string { |
| 66 | + return `${installation.summary} (plugin, install separately). Run agent-device plugins add ${installation.package}.`; |
93 | 67 | } |
0 commit comments