@lesliechan721/aw 0.1.0-beta.83 → 0.1.0-beta.85

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.
Files changed (250) hide show
  1. package/dist/authoring/assets/aw-runtime-config.mjs +1 -1
  2. package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
  3. package/dist/index.js +2 -6
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/commands/console.js +1 -0
  6. package/dist/src/commands/console.js.map +1 -1
  7. package/dist/src/commands/intent-command.d.ts +1 -0
  8. package/dist/src/commands/intent-command.js +6 -2
  9. package/dist/src/commands/intent-command.js.map +1 -1
  10. package/dist/src/commands/plugin-capabilities.js +3 -3
  11. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  12. package/dist/src/commands/public-lifecycle-result.d.ts +14 -13
  13. package/dist/src/commands/public-lifecycle-result.js +204 -64
  14. package/dist/src/commands/public-lifecycle-result.js.map +1 -1
  15. package/dist/src/commands/public-lifecycle.d.ts +1 -2
  16. package/dist/src/commands/public-lifecycle.js +56 -34
  17. package/dist/src/commands/public-lifecycle.js.map +1 -1
  18. package/dist/src/commands/public-plugin-query.js +44 -11
  19. package/dist/src/commands/public-plugin-query.js.map +1 -1
  20. package/dist/src/commands/rebuild-command.d.ts +13 -3
  21. package/dist/src/commands/rebuild-command.js +665 -288
  22. package/dist/src/commands/rebuild-command.js.map +1 -1
  23. package/dist/src/commands/rebuild-integration.d.ts +6 -2
  24. package/dist/src/commands/rebuild-integration.js +60 -29
  25. package/dist/src/commands/rebuild-integration.js.map +1 -1
  26. package/dist/src/commands/rebuild-operations.d.ts +1 -0
  27. package/dist/src/commands/rebuild-operations.js +28 -6
  28. package/dist/src/commands/rebuild-operations.js.map +1 -1
  29. package/dist/src/commands/rebuild-platform-integration.d.ts +20 -5
  30. package/dist/src/commands/rebuild-platform-integration.js +752 -182
  31. package/dist/src/commands/rebuild-platform-integration.js.map +1 -1
  32. package/dist/src/generators/permissions.d.ts +7 -1
  33. package/dist/src/generators/permissions.js +56 -0
  34. package/dist/src/generators/permissions.js.map +1 -1
  35. package/dist/src/index.d.ts +1 -0
  36. package/dist/src/index.js +112 -54
  37. package/dist/src/index.js.map +1 -1
  38. package/dist/src/intent/scope-context.d.ts +4 -2
  39. package/dist/src/intent/scope-context.js +37 -7
  40. package/dist/src/intent/scope-context.js.map +1 -1
  41. package/dist/src/output/component-delivery.d.ts +21 -0
  42. package/dist/src/output/component-delivery.js +82 -0
  43. package/dist/src/output/component-delivery.js.map +1 -0
  44. package/dist/src/output/public-result.d.ts +4 -0
  45. package/dist/src/output/public-result.js +85 -15
  46. package/dist/src/output/public-result.js.map +1 -1
  47. package/dist/src/output/rebuild-progress.d.ts +3 -0
  48. package/dist/src/output/rebuild-progress.js +12 -2
  49. package/dist/src/output/rebuild-progress.js.map +1 -1
  50. package/dist/src/output/receipt-projection.js +64 -19
  51. package/dist/src/output/receipt-projection.js.map +1 -1
  52. package/dist/src/output/skill-invocation-notices.d.ts +18 -0
  53. package/dist/src/output/skill-invocation-notices.js +84 -0
  54. package/dist/src/output/skill-invocation-notices.js.map +1 -0
  55. package/dist/src/platforms/capabilities.d.ts +6 -1
  56. package/dist/src/platforms/capabilities.js +161 -38
  57. package/dist/src/platforms/capabilities.js.map +1 -1
  58. package/dist/src/platforms/contracts.d.ts +45 -10
  59. package/dist/src/platforms/discovery.d.ts +11 -7
  60. package/dist/src/platforms/discovery.js +176 -76
  61. package/dist/src/platforms/discovery.js.map +1 -1
  62. package/dist/src/platforms/inspection-grok.js +121 -9
  63. package/dist/src/platforms/inspection-grok.js.map +1 -1
  64. package/dist/src/platforms/inspection-native.js +53 -97
  65. package/dist/src/platforms/inspection-native.js.map +1 -1
  66. package/dist/src/platforms/inspection-pi.d.ts +7 -1
  67. package/dist/src/platforms/inspection-pi.js +295 -95
  68. package/dist/src/platforms/inspection-pi.js.map +1 -1
  69. package/dist/src/platforms/inspection-query.d.ts +6 -5
  70. package/dist/src/platforms/inspection-query.js +30 -25
  71. package/dist/src/platforms/inspection-query.js.map +1 -1
  72. package/dist/src/platforms/inspection.d.ts +4 -1
  73. package/dist/src/platforms/inspection.js +38 -6
  74. package/dist/src/platforms/inspection.js.map +1 -1
  75. package/dist/src/platforms/layout.d.ts +6 -0
  76. package/dist/src/platforms/layout.js +45 -12
  77. package/dist/src/platforms/layout.js.map +1 -1
  78. package/dist/src/platforms/lifecycle-native-services.d.ts +1 -1
  79. package/dist/src/platforms/lifecycle-native-services.js +14 -14
  80. package/dist/src/platforms/lifecycle-native-services.js.map +1 -1
  81. package/dist/src/platforms/lifecycle-native.d.ts +1 -0
  82. package/dist/src/platforms/lifecycle-native.js +29 -89
  83. package/dist/src/platforms/lifecycle-native.js.map +1 -1
  84. package/dist/src/platforms/lifecycle.d.ts +2 -0
  85. package/dist/src/platforms/lifecycle.js +120 -69
  86. package/dist/src/platforms/lifecycle.js.map +1 -1
  87. package/dist/src/platforms/projection-code-extension.js +9 -4
  88. package/dist/src/platforms/projection-code-extension.js.map +1 -1
  89. package/dist/src/platforms/projection.d.ts +3 -0
  90. package/dist/src/platforms/projection.js +152 -72
  91. package/dist/src/platforms/projection.js.map +1 -1
  92. package/dist/src/platforms/supplement-layout.d.ts +5 -1
  93. package/dist/src/platforms/supplement-layout.js +23 -1
  94. package/dist/src/platforms/supplement-layout.js.map +1 -1
  95. package/dist/src/platforms/supplement-state.d.ts +1 -1
  96. package/dist/src/platforms/supplement-state.js +18 -7
  97. package/dist/src/platforms/supplement-state.js.map +1 -1
  98. package/dist/src/portable/commands.js +1 -1
  99. package/dist/src/portable/commands.js.map +1 -1
  100. package/dist/src/portable/materializer.d.ts +4 -0
  101. package/dist/src/portable/materializer.js +9 -2
  102. package/dist/src/portable/materializer.js.map +1 -1
  103. package/dist/src/portable/recovery.d.ts +31 -3
  104. package/dist/src/portable/recovery.js +261 -82
  105. package/dist/src/portable/recovery.js.map +1 -1
  106. package/dist/src/recovery/coordinator.d.ts +19 -5
  107. package/dist/src/recovery/coordinator.js +433 -174
  108. package/dist/src/recovery/coordinator.js.map +1 -1
  109. package/dist/src/recovery/install-concurrency.d.ts +48 -0
  110. package/dist/src/recovery/install-concurrency.js +196 -0
  111. package/dist/src/recovery/install-concurrency.js.map +1 -0
  112. package/dist/src/recovery/interruption.d.ts +19 -0
  113. package/dist/src/recovery/interruption.js +43 -0
  114. package/dist/src/recovery/interruption.js.map +1 -0
  115. package/dist/src/recovery/joint-coordinator.d.ts +18 -4
  116. package/dist/src/recovery/joint-coordinator.js +829 -341
  117. package/dist/src/recovery/joint-coordinator.js.map +1 -1
  118. package/dist/src/recovery/joint-demand.d.ts +22 -2
  119. package/dist/src/recovery/joint-demand.js +104 -6
  120. package/dist/src/recovery/joint-demand.js.map +1 -1
  121. package/dist/src/recovery/joint-install-execution.d.ts +19 -0
  122. package/dist/src/recovery/joint-install-execution.js +307 -0
  123. package/dist/src/recovery/joint-install-execution.js.map +1 -0
  124. package/dist/src/recovery/joint-install-native-rebase.d.ts +4 -0
  125. package/dist/src/recovery/joint-install-native-rebase.js +67 -0
  126. package/dist/src/recovery/joint-install-native-rebase.js.map +1 -0
  127. package/dist/src/recovery/receipt.d.ts +35 -4
  128. package/dist/src/recovery/receipt.js +90 -1
  129. package/dist/src/recovery/receipt.js.map +1 -1
  130. package/dist/src/recovery/retirement.js +1 -1
  131. package/dist/src/recovery/retirement.js.map +1 -1
  132. package/dist/src/recovery/status.d.ts +20 -8
  133. package/dist/src/recovery/status.js +405 -116
  134. package/dist/src/recovery/status.js.map +1 -1
  135. package/dist/src/review/platform-profile.d.ts +4 -1
  136. package/dist/src/review/platform-profile.js +14 -4
  137. package/dist/src/review/platform-profile.js.map +1 -1
  138. package/dist/src/review/skill-materialization.d.ts +2 -0
  139. package/dist/src/review/skill-materialization.js +68 -50
  140. package/dist/src/review/skill-materialization.js.map +1 -1
  141. package/dist/src/review/source-binding.js +11 -5
  142. package/dist/src/review/source-binding.js.map +1 -1
  143. package/dist/src/tui/console-app-v4.d.ts +1 -1
  144. package/dist/src/tui/console-app-v4.js +180 -63
  145. package/dist/src/tui/console-app-v4.js.map +1 -1
  146. package/dist/src/tui/controller-runtime.js +46 -10
  147. package/dist/src/tui/controller-runtime.js.map +1 -1
  148. package/dist/src/tui/controller.d.ts +15 -5
  149. package/dist/src/tui/controller.js +246 -102
  150. package/dist/src/tui/controller.js.map +1 -1
  151. package/dist/src/tui/deployment-view.d.ts +6 -3
  152. package/dist/src/tui/deployment-view.js +43 -9
  153. package/dist/src/tui/deployment-view.js.map +1 -1
  154. package/dist/src/tui/diagnostic-projection.d.ts +11 -3
  155. package/dist/src/tui/diagnostic-projection.js +85 -4
  156. package/dist/src/tui/diagnostic-projection.js.map +1 -1
  157. package/dist/src/tui/entity-cards.d.ts +2 -1
  158. package/dist/src/tui/entity-cards.js +34 -11
  159. package/dist/src/tui/entity-cards.js.map +1 -1
  160. package/dist/src/tui/glossary.js +5 -0
  161. package/dist/src/tui/glossary.js.map +1 -1
  162. package/dist/src/tui/model.js +2 -1
  163. package/dist/src/tui/model.js.map +1 -1
  164. package/dist/src/tui/operation-diagnostic-screens.d.ts +1 -1
  165. package/dist/src/tui/operation-diagnostic-screens.js +6 -2
  166. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
  167. package/dist/src/tui/operation-history.d.ts +12 -3
  168. package/dist/src/tui/operation-history.js +34 -3
  169. package/dist/src/tui/operation-history.js.map +1 -1
  170. package/dist/src/tui/plugin-detail.d.ts +4 -1
  171. package/dist/src/tui/plugin-detail.js +9 -2
  172. package/dist/src/tui/plugin-detail.js.map +1 -1
  173. package/dist/src/tui/scoped-flow.d.ts +3 -1
  174. package/dist/src/tui/scoped-flow.js +117 -1
  175. package/dist/src/tui/scoped-flow.js.map +1 -1
  176. package/dist/src/tui/scoped-inventory.d.ts +6 -2
  177. package/dist/src/tui/scoped-inventory.js +29 -7
  178. package/dist/src/tui/scoped-inventory.js.map +1 -1
  179. package/dist/src/tui/session-console-app.d.ts +2 -0
  180. package/dist/src/tui/session-console-app.js +11 -0
  181. package/dist/src/tui/session-console-app.js.map +1 -1
  182. package/dist/src/types.d.ts +10 -2
  183. package/dist/src/types.js.map +1 -1
  184. package/dist/src/utils/artifact-plan.js +5 -1
  185. package/dist/src/utils/artifact-plan.js.map +1 -1
  186. package/dist/src/utils/artifact-renderer.d.ts +1 -1
  187. package/dist/src/utils/artifact-renderer.js +29 -8
  188. package/dist/src/utils/artifact-renderer.js.map +1 -1
  189. package/dist/src/utils/aw-home-mutation-lock.js +2 -1
  190. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
  191. package/dist/src/utils/catalog-source-references.js +14 -17
  192. package/dist/src/utils/catalog-source-references.js.map +1 -1
  193. package/dist/src/utils/codex-native-observation.d.ts +6 -0
  194. package/dist/src/utils/codex-native-observation.js +32 -3
  195. package/dist/src/utils/codex-native-observation.js.map +1 -1
  196. package/dist/src/utils/component-command-preparation.d.ts +2 -0
  197. package/dist/src/utils/component-command-preparation.js +23 -4
  198. package/dist/src/utils/component-command-preparation.js.map +1 -1
  199. package/dist/src/utils/component-gap.d.ts +4 -0
  200. package/dist/src/utils/component-gap.js +20 -0
  201. package/dist/src/utils/component-gap.js.map +1 -0
  202. package/dist/src/utils/component-resources.js +2 -4
  203. package/dist/src/utils/component-resources.js.map +1 -1
  204. package/dist/src/utils/dynamic-skill-tree.js +2 -32
  205. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  206. package/dist/src/utils/managed-command-materialization.d.ts +2 -1
  207. package/dist/src/utils/managed-command-materialization.js +3 -3
  208. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  209. package/dist/src/utils/managed-command-store.d.ts +6 -0
  210. package/dist/src/utils/managed-command-store.js +90 -18
  211. package/dist/src/utils/managed-command-store.js.map +1 -1
  212. package/dist/src/utils/multi-source-catalog.d.ts +2 -0
  213. package/dist/src/utils/multi-source-catalog.js +3 -2
  214. package/dist/src/utils/multi-source-catalog.js.map +1 -1
  215. package/dist/src/utils/native-cli-interruption.d.ts +8 -0
  216. package/dist/src/utils/native-cli-interruption.js +65 -0
  217. package/dist/src/utils/native-cli-interruption.js.map +1 -0
  218. package/dist/src/utils/native-cli.d.ts +5 -19
  219. package/dist/src/utils/native-cli.js +168 -95
  220. package/dist/src/utils/native-cli.js.map +1 -1
  221. package/dist/src/utils/ownership.d.ts +1 -0
  222. package/dist/src/utils/ownership.js +18 -4
  223. package/dist/src/utils/ownership.js.map +1 -1
  224. package/dist/src/utils/package-content.d.ts +7 -0
  225. package/dist/src/utils/package-content.js +70 -0
  226. package/dist/src/utils/package-content.js.map +1 -0
  227. package/dist/src/utils/platform-empty-state.d.ts +32 -9
  228. package/dist/src/utils/platform-empty-state.js +135 -70
  229. package/dist/src/utils/platform-empty-state.js.map +1 -1
  230. package/dist/src/utils/plugin-config-write.d.ts +8 -0
  231. package/dist/src/utils/plugin-config-write.js +93 -25
  232. package/dist/src/utils/plugin-config-write.js.map +1 -1
  233. package/dist/src/utils/plugin-scripts.js +24 -8
  234. package/dist/src/utils/plugin-scripts.js.map +1 -1
  235. package/dist/src/utils/process-tree.d.ts +1 -1
  236. package/dist/src/utils/process-tree.js +1 -1
  237. package/dist/src/utils/process-tree.js.map +1 -1
  238. package/dist/src/utils/skill-invocation-warning.d.ts +20 -0
  239. package/dist/src/utils/skill-invocation-warning.js +68 -0
  240. package/dist/src/utils/skill-invocation-warning.js.map +1 -0
  241. package/package.json +3 -3
  242. package/dist/src/output/native-consent.d.ts +0 -2
  243. package/dist/src/output/native-consent.js +0 -5
  244. package/dist/src/output/native-consent.js.map +0 -1
  245. package/dist/src/platforms/gemini-activation.d.ts +0 -36
  246. package/dist/src/platforms/gemini-activation.js +0 -331
  247. package/dist/src/platforms/gemini-activation.js.map +0 -1
  248. package/dist/src/platforms/gemini-consent.d.ts +0 -8
  249. package/dist/src/platforms/gemini-consent.js +0 -81
  250. package/dist/src/platforms/gemini-consent.js.map +0 -1
@@ -11,6 +11,7 @@ import type { OperationAction } from './operation-plan.js';
11
11
  import type { DesiredTarget, RebuildTargetDriver, RebuildTargetIdentity } from './rebuild-operations.js';
12
12
  import { PlatformRebuildSession } from './rebuild-platform-integration.js';
13
13
  export declare function finalizePreparedPlatformRebuildSession(results: Map<string, PluginProcessResult>): void;
14
+ export declare function recordPreparedGrokProjectRetirement(results: Map<string, PluginProcessResult>, ...retirement: Parameters<PlatformRebuildSession['recordGrokProjectRetirement']>): void;
14
15
  export declare function disposePreparedPlatformRebuildSession(results: Map<string, PluginProcessResult>): Promise<void>;
15
16
  export interface RebuildIntegration {
16
17
  resolvePlatformTargets(inputs: readonly Parameters<RebuildIntegration['buildTarget']>[0][]): Promise<void>;
@@ -18,6 +19,7 @@ export interface RebuildIntegration {
18
19
  driver: RebuildTargetDriver;
19
20
  setNativeMarketplaceEligibleTargets(targets: readonly DesiredTarget[]): void;
20
21
  prepareNativeMarketplaceGroup(target: DesiredTarget): Promise<void>;
22
+ postcheckCodexProvider(target: DesiredTarget): Promise<void>;
21
23
  captureCodexPostMutationSnapshots(marketplaceNames?: readonly string[]): Promise<void>;
22
24
  buildTarget(options: {
23
25
  sourceId?: string;
@@ -32,6 +34,8 @@ export interface RebuildIntegration {
32
34
  command: 'install' | 'sync' | 'reinstall' | 'cleanup' | 'uninstall';
33
35
  catalog: CatalogResolution;
34
36
  readOnlyInspectionPlan?: boolean;
37
+ /** Fresh read window for peers undergoing the same placement check or plan verification. */
38
+ observationBatch?: import('../platforms/inspection-query.js').NativeObservationBatch;
35
39
  readOnlyShallowInspectionPlan?: boolean;
36
40
  includeNativeCleanupCandidate?: boolean;
37
41
  codexActivationCleanup?: Array<{
@@ -50,11 +54,11 @@ export declare class CodexActivationPostcheckError extends Error {
50
54
  constructor(codexPluginIds: string | readonly string[], detail: string);
51
55
  }
52
56
  export interface RebuildExecutionContext {
53
- /** Explicit --native-consent for this request, independent of AW confirmation. */
54
- nativeConsent?: boolean;
55
57
  recoveryCandidates?: readonly import('../platforms/contracts.js').RecoveryCandidate[];
56
58
  sharedReferenceView?: import('../utils/native-demand.js').NativeSharedReferenceView;
57
59
  platformRebuildSession?: PlatformRebuildSession;
60
+ /** Concurrent native groups share a session across scopes of the same platform. */
61
+ batchInstallPlatform?: PlatformName;
58
62
  packagePreparationCache?: Map<string, Promise<PreparedManagedCommandPackage>>;
59
63
  interruption?: import('./public-interruption.js').PublicCommandInterruption;
60
64
  /** Validated renderer process output shared only by preparations of this operation. */
@@ -32,15 +32,21 @@ const commandPackagePreparationCaches = new WeakMap();
32
32
  const platformRebuildSessions = new WeakMap();
33
33
  const commandPackageCandidates = new WeakMap();
34
34
  export function finalizePreparedPlatformRebuildSession(results) {
35
- platformRebuildSessions.get(results)?.freezeMarketplaceCandidates();
35
+ for (const session of platformRebuildSessions.get(results)?.values() ?? [])
36
+ session.freezeMarketplaceCandidates();
37
+ }
38
+ export function recordPreparedGrokProjectRetirement(results, ...retirement) {
39
+ const sessions = platformRebuildSessions.get(results);
40
+ sessions?.get('grok')?.recordGrokProjectRetirement(...retirement);
41
+ sessions?.get(undefined)?.recordGrokProjectRetirement(...retirement);
36
42
  }
37
43
  export async function disposePreparedPlatformRebuildSession(results) {
38
- const session = platformRebuildSessions.get(results);
44
+ const sessions = platformRebuildSessions.get(results);
39
45
  platformRebuildSessions.delete(results);
40
46
  const packages = commandPackageCandidates.get(results);
41
47
  commandPackageCandidates.delete(results);
42
48
  try {
43
- await session?.dispose();
49
+ await Promise.all([...(sessions?.values() ?? [])].map((session) => session.dispose()));
44
50
  }
45
51
  finally {
46
52
  if (packages)
@@ -60,7 +66,7 @@ async function commandPackageActions(options) {
60
66
  commandPackagePreparationCaches.set(options.context, cache);
61
67
  }
62
68
  for (const declaration of options.plugin.manifest.managedCommands?.packages ?? []) {
63
- if (!declaration.platforms.includes(options.platform))
69
+ if (!declaration.platforms.includes(options.platform) || options.scope === 'user' && declaration.scope === 'project')
64
70
  continue;
65
71
  const producer = await managedCommandProducerIdentity({ ...options, scope: declaration.scope,
66
72
  producer: { kind: 'package', packageKey: declaration.key } });
@@ -1105,6 +1111,31 @@ function createNativeDriver(options) {
1105
1111
  path.normalize(path.resolve(target.identity.marketplaceRoot ?? resolveAwHome(options.context.env))),
1106
1112
  ].join('\0');
1107
1113
  const observationScopeFor = (target) => codexObservationScope(options.context, target.identity.marketplaceName ?? MARKETPLACE_NAME, target.identity.scope);
1114
+ const checkCodexInstalledVersion = async (target, pluginId, marketplaceName) => {
1115
+ const scope = codexObservationScope(options.context, marketplaceName, target.identity.scope);
1116
+ const registration = await inspectCodexPluginRegistrationLive({
1117
+ pluginId,
1118
+ cwd: target.identity.cwd,
1119
+ env: options.context.env,
1120
+ nativeCliRunner: runner,
1121
+ manager: currentCodexManager(),
1122
+ scope,
1123
+ observationSession: options.context.codexObservationSession,
1124
+ });
1125
+ const state = requireObservedCodexNativeState(registration.observation, 'native install postcheck');
1126
+ requireCodexObservationCoverage(registration, scope, 'native install postcheck');
1127
+ if (state !== 'installed') {
1128
+ throw new Error(`codexNativeInstallIncomplete: ${pluginId} is absent from Codex plugin list.`);
1129
+ }
1130
+ const installedEntry = registration.observation.state === 'observed'
1131
+ && registration.observation.value === 'installed'
1132
+ ? registration.observation.entry
1133
+ : undefined;
1134
+ if (installedEntry?.version !== undefined
1135
+ && installedEntry.version !== target.identity.pluginVersion) {
1136
+ throw new Error(`codexNativeInstallIncomplete: ${pluginId} version is ${installedEntry.version}; expected ${target.identity.pluginVersion}.`);
1137
+ }
1138
+ };
1108
1139
  const groupTargets = (target) => {
1109
1140
  if (!options.operationScopedNativePhases)
1110
1141
  return [target];
@@ -1416,6 +1447,25 @@ function createNativeDriver(options) {
1416
1447
  nativeMarketplaceEligibleTargets = new Set(eligibleTargets);
1417
1448
  },
1418
1449
  prepareNativeMarketplaceGroup: prepareNativeGroup,
1450
+ postcheckCodexProvider: async (target) => {
1451
+ const pending = deferredPostchecks.filter((entry) => entry.target === target);
1452
+ deferredPostchecks = deferredPostchecks.filter((entry) => entry.target !== target);
1453
+ // A dependent can write as soon as this returns. Read a new Codex list
1454
+ // after the provider's writes, even when its install receipt was healthy.
1455
+ const marketplaces = new Set((target.platformDeployment?.plans ?? []).flatMap((plan) => plan.evidence.layout.marketplaceName && plan.projections.some((projection) => projection.bundle)
1456
+ ? [plan.evidence.layout.marketplaceName] : []));
1457
+ if (target.requiresNative)
1458
+ marketplaces.add(target.identity.marketplaceName ?? MARKETPLACE_NAME);
1459
+ for (const name of marketplaces)
1460
+ options.context.codexObservationSession?.invalidate(name);
1461
+ if (!pending.length)
1462
+ await target.platformDeployment?.verify();
1463
+ for (const entry of pending)
1464
+ await entry.postcheck();
1465
+ for (const name of marketplaces) {
1466
+ await checkCodexInstalledVersion(target, `${target.identity.pluginName}@${name}`, name);
1467
+ }
1468
+ },
1419
1469
  ...(options.operationScopedNativePhases ? {
1420
1470
  deferPostcheck: (target, postcheck) => {
1421
1471
  if (target.identity.platform !== 'codex')
@@ -1425,29 +1475,7 @@ function createNativeDriver(options) {
1425
1475
  postcheck: async () => {
1426
1476
  if (target.requiresNative) {
1427
1477
  const marketplaceName = target.identity.marketplaceName ?? MARKETPLACE_NAME;
1428
- const pluginId = `${target.identity.pluginName}@${marketplaceName}`;
1429
- const registration = await inspectCodexPluginRegistrationLive({
1430
- pluginId,
1431
- cwd: target.identity.cwd,
1432
- env: options.context.env,
1433
- nativeCliRunner: runner,
1434
- manager: currentCodexManager(),
1435
- scope: observationScopeFor(target),
1436
- observationSession: options.context.codexObservationSession,
1437
- });
1438
- const state = requireObservedCodexNativeState(registration.observation, 'native install postcheck');
1439
- requireCodexObservationCoverage(registration, observationScopeFor(target), 'native install postcheck');
1440
- if (state !== 'installed') {
1441
- throw new Error(`codexNativeInstallIncomplete: ${pluginId} is absent from Codex plugin list.`);
1442
- }
1443
- const installedEntry = registration.observation.state === 'observed'
1444
- && registration.observation.value === 'installed'
1445
- ? registration.observation.entry
1446
- : undefined;
1447
- if (installedEntry?.version !== undefined
1448
- && installedEntry.version !== target.identity.pluginVersion) {
1449
- throw new Error(`codexNativeInstallIncomplete: ${pluginId} version is ${installedEntry.version}; expected ${target.identity.pluginVersion}.`);
1450
- }
1478
+ await checkCodexInstalledVersion(target, `${target.identity.pluginName}@${marketplaceName}`, marketplaceName);
1451
1479
  }
1452
1480
  await postcheck();
1453
1481
  },
@@ -1753,10 +1781,12 @@ export function createRebuildIntegration(options) {
1753
1781
  ?? commandPackageCandidates.get(renderResults) ?? new Map();
1754
1782
  commandPackageCandidates.set(renderResults, packageCache);
1755
1783
  options.context.packagePreparationCache = packageCache;
1784
+ const sessions = platformRebuildSessions.get(renderResults) ?? new Map();
1785
+ platformRebuildSessions.set(renderResults, sessions);
1756
1786
  const platformSession = options.context.platformRebuildSession
1757
- ?? platformRebuildSessions.get(renderResults)
1787
+ ?? sessions.get(options.context.batchInstallPlatform)
1758
1788
  ?? new PlatformRebuildSession(options.context);
1759
- platformRebuildSessions.set(renderResults, platformSession);
1789
+ sessions.set(options.context.batchInstallPlatform, platformSession);
1760
1790
  options.context.platformRebuildSession = platformSession;
1761
1791
  platformSession.updateContext(options.context);
1762
1792
  platformSession.setOwnershipExecutor(driver.ownership);
@@ -1766,6 +1796,7 @@ export function createRebuildIntegration(options) {
1766
1796
  driver,
1767
1797
  setNativeMarketplaceEligibleTargets: driver.setNativeMarketplaceEligibleTargets,
1768
1798
  prepareNativeMarketplaceGroup: driver.prepareNativeMarketplaceGroup,
1799
+ postcheckCodexProvider: driver.postcheckCodexProvider,
1769
1800
  captureCodexPostMutationSnapshots: driver.captureCodexPostMutationSnapshots,
1770
1801
  buildTarget: async (input) => {
1771
1802
  const target = await platformSession.buildTarget(input);