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

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 (179) 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/src/commands/console.js +1 -0
  4. package/dist/src/commands/console.js.map +1 -1
  5. package/dist/src/commands/intent-command.d.ts +1 -0
  6. package/dist/src/commands/intent-command.js +6 -2
  7. package/dist/src/commands/intent-command.js.map +1 -1
  8. package/dist/src/commands/plugin-capabilities.js +3 -3
  9. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  10. package/dist/src/commands/public-lifecycle-result.d.ts +11 -5
  11. package/dist/src/commands/public-lifecycle-result.js +131 -46
  12. package/dist/src/commands/public-lifecycle-result.js.map +1 -1
  13. package/dist/src/commands/public-lifecycle.d.ts +1 -2
  14. package/dist/src/commands/public-lifecycle.js +56 -34
  15. package/dist/src/commands/public-lifecycle.js.map +1 -1
  16. package/dist/src/commands/public-plugin-query.js +28 -11
  17. package/dist/src/commands/public-plugin-query.js.map +1 -1
  18. package/dist/src/commands/rebuild-command.d.ts +13 -3
  19. package/dist/src/commands/rebuild-command.js +647 -286
  20. package/dist/src/commands/rebuild-command.js.map +1 -1
  21. package/dist/src/commands/rebuild-integration.d.ts +5 -2
  22. package/dist/src/commands/rebuild-integration.js +55 -29
  23. package/dist/src/commands/rebuild-integration.js.map +1 -1
  24. package/dist/src/commands/rebuild-operations.d.ts +1 -0
  25. package/dist/src/commands/rebuild-operations.js +23 -4
  26. package/dist/src/commands/rebuild-operations.js.map +1 -1
  27. package/dist/src/commands/rebuild-platform-integration.d.ts +13 -3
  28. package/dist/src/commands/rebuild-platform-integration.js +229 -133
  29. package/dist/src/commands/rebuild-platform-integration.js.map +1 -1
  30. package/dist/src/index.js +105 -50
  31. package/dist/src/index.js.map +1 -1
  32. package/dist/src/output/public-result.d.ts +2 -0
  33. package/dist/src/output/public-result.js +43 -6
  34. package/dist/src/output/public-result.js.map +1 -1
  35. package/dist/src/output/rebuild-progress.d.ts +3 -0
  36. package/dist/src/output/rebuild-progress.js +12 -2
  37. package/dist/src/output/rebuild-progress.js.map +1 -1
  38. package/dist/src/output/receipt-projection.js +55 -18
  39. package/dist/src/output/receipt-projection.js.map +1 -1
  40. package/dist/src/output/skill-invocation-notices.d.ts +16 -0
  41. package/dist/src/output/skill-invocation-notices.js +48 -0
  42. package/dist/src/output/skill-invocation-notices.js.map +1 -0
  43. package/dist/src/platforms/capabilities.d.ts +2 -0
  44. package/dist/src/platforms/capabilities.js +73 -34
  45. package/dist/src/platforms/capabilities.js.map +1 -1
  46. package/dist/src/platforms/contracts.d.ts +9 -9
  47. package/dist/src/platforms/discovery.d.ts +0 -7
  48. package/dist/src/platforms/discovery.js +13 -53
  49. package/dist/src/platforms/discovery.js.map +1 -1
  50. package/dist/src/platforms/inspection-native.js +1 -80
  51. package/dist/src/platforms/inspection-native.js.map +1 -1
  52. package/dist/src/platforms/inspection-query.d.ts +2 -3
  53. package/dist/src/platforms/inspection-query.js +7 -18
  54. package/dist/src/platforms/inspection-query.js.map +1 -1
  55. package/dist/src/platforms/inspection.js +2 -2
  56. package/dist/src/platforms/inspection.js.map +1 -1
  57. package/dist/src/platforms/layout.js +1 -5
  58. package/dist/src/platforms/layout.js.map +1 -1
  59. package/dist/src/platforms/lifecycle-native-services.d.ts +1 -1
  60. package/dist/src/platforms/lifecycle-native-services.js +14 -14
  61. package/dist/src/platforms/lifecycle-native-services.js.map +1 -1
  62. package/dist/src/platforms/lifecycle-native.js +4 -88
  63. package/dist/src/platforms/lifecycle-native.js.map +1 -1
  64. package/dist/src/platforms/lifecycle.js +56 -56
  65. package/dist/src/platforms/lifecycle.js.map +1 -1
  66. package/dist/src/platforms/projection-code-extension.js +7 -3
  67. package/dist/src/platforms/projection-code-extension.js.map +1 -1
  68. package/dist/src/platforms/projection.d.ts +3 -0
  69. package/dist/src/platforms/projection.js +86 -54
  70. package/dist/src/platforms/projection.js.map +1 -1
  71. package/dist/src/portable/materializer.js +2 -2
  72. package/dist/src/portable/materializer.js.map +1 -1
  73. package/dist/src/portable/recovery.d.ts +29 -3
  74. package/dist/src/portable/recovery.js +220 -78
  75. package/dist/src/portable/recovery.js.map +1 -1
  76. package/dist/src/recovery/coordinator.d.ts +18 -4
  77. package/dist/src/recovery/coordinator.js +357 -165
  78. package/dist/src/recovery/coordinator.js.map +1 -1
  79. package/dist/src/recovery/install-concurrency.d.ts +48 -0
  80. package/dist/src/recovery/install-concurrency.js +195 -0
  81. package/dist/src/recovery/install-concurrency.js.map +1 -0
  82. package/dist/src/recovery/interruption.d.ts +19 -0
  83. package/dist/src/recovery/interruption.js +43 -0
  84. package/dist/src/recovery/interruption.js.map +1 -0
  85. package/dist/src/recovery/joint-coordinator.d.ts +11 -4
  86. package/dist/src/recovery/joint-coordinator.js +671 -333
  87. package/dist/src/recovery/joint-coordinator.js.map +1 -1
  88. package/dist/src/recovery/joint-demand.d.ts +8 -0
  89. package/dist/src/recovery/joint-demand.js +52 -1
  90. package/dist/src/recovery/joint-demand.js.map +1 -1
  91. package/dist/src/recovery/joint-install-execution.d.ts +19 -0
  92. package/dist/src/recovery/joint-install-execution.js +307 -0
  93. package/dist/src/recovery/joint-install-execution.js.map +1 -0
  94. package/dist/src/recovery/joint-install-native-rebase.d.ts +4 -0
  95. package/dist/src/recovery/joint-install-native-rebase.js +67 -0
  96. package/dist/src/recovery/joint-install-native-rebase.js.map +1 -0
  97. package/dist/src/recovery/receipt.d.ts +20 -0
  98. package/dist/src/recovery/receipt.js +67 -1
  99. package/dist/src/recovery/receipt.js.map +1 -1
  100. package/dist/src/recovery/retirement.js +1 -1
  101. package/dist/src/recovery/retirement.js.map +1 -1
  102. package/dist/src/recovery/status.js +26 -27
  103. package/dist/src/recovery/status.js.map +1 -1
  104. package/dist/src/review/platform-profile.d.ts +4 -1
  105. package/dist/src/review/platform-profile.js +13 -4
  106. package/dist/src/review/platform-profile.js.map +1 -1
  107. package/dist/src/review/skill-materialization.d.ts +1 -0
  108. package/dist/src/review/skill-materialization.js +28 -16
  109. package/dist/src/review/skill-materialization.js.map +1 -1
  110. package/dist/src/review/source-binding.js +6 -4
  111. package/dist/src/review/source-binding.js.map +1 -1
  112. package/dist/src/tui/console-app-v4.d.ts +1 -1
  113. package/dist/src/tui/console-app-v4.js +137 -57
  114. package/dist/src/tui/console-app-v4.js.map +1 -1
  115. package/dist/src/tui/controller-runtime.js +45 -9
  116. package/dist/src/tui/controller-runtime.js.map +1 -1
  117. package/dist/src/tui/controller.d.ts +13 -4
  118. package/dist/src/tui/controller.js +233 -102
  119. package/dist/src/tui/controller.js.map +1 -1
  120. package/dist/src/tui/deployment-view.js +6 -1
  121. package/dist/src/tui/deployment-view.js.map +1 -1
  122. package/dist/src/tui/diagnostic-projection.d.ts +4 -2
  123. package/dist/src/tui/diagnostic-projection.js +40 -4
  124. package/dist/src/tui/diagnostic-projection.js.map +1 -1
  125. package/dist/src/tui/operation-diagnostic-screens.d.ts +1 -1
  126. package/dist/src/tui/operation-diagnostic-screens.js +3 -1
  127. package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
  128. package/dist/src/tui/operation-history.d.ts +6 -3
  129. package/dist/src/tui/operation-history.js +15 -2
  130. package/dist/src/tui/operation-history.js.map +1 -1
  131. package/dist/src/tui/scoped-flow.d.ts +3 -1
  132. package/dist/src/tui/scoped-flow.js +99 -1
  133. package/dist/src/tui/scoped-flow.js.map +1 -1
  134. package/dist/src/tui/session-console-app.d.ts +2 -0
  135. package/dist/src/tui/session-console-app.js +11 -0
  136. package/dist/src/tui/session-console-app.js.map +1 -1
  137. package/dist/src/types.d.ts +8 -1
  138. package/dist/src/types.js.map +1 -1
  139. package/dist/src/utils/aw-home-mutation-lock.js +2 -1
  140. package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
  141. package/dist/src/utils/catalog-source-references.js +2 -14
  142. package/dist/src/utils/catalog-source-references.js.map +1 -1
  143. package/dist/src/utils/component-resources.js +1 -1
  144. package/dist/src/utils/component-resources.js.map +1 -1
  145. package/dist/src/utils/managed-command-materialization.d.ts +2 -1
  146. package/dist/src/utils/managed-command-materialization.js +3 -3
  147. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  148. package/dist/src/utils/managed-command-store.d.ts +6 -0
  149. package/dist/src/utils/managed-command-store.js +90 -18
  150. package/dist/src/utils/managed-command-store.js.map +1 -1
  151. package/dist/src/utils/multi-source-catalog.d.ts +2 -0
  152. package/dist/src/utils/multi-source-catalog.js +3 -2
  153. package/dist/src/utils/multi-source-catalog.js.map +1 -1
  154. package/dist/src/utils/native-cli.d.ts +0 -19
  155. package/dist/src/utils/native-cli.js +2 -42
  156. package/dist/src/utils/native-cli.js.map +1 -1
  157. package/dist/src/utils/ownership.js +1 -1
  158. package/dist/src/utils/ownership.js.map +1 -1
  159. package/dist/src/utils/platform-empty-state.d.ts +1 -3
  160. package/dist/src/utils/platform-empty-state.js +1 -6
  161. package/dist/src/utils/platform-empty-state.js.map +1 -1
  162. package/dist/src/utils/plugin-config-write.d.ts +8 -0
  163. package/dist/src/utils/plugin-config-write.js +89 -25
  164. package/dist/src/utils/plugin-config-write.js.map +1 -1
  165. package/dist/src/utils/plugin-scripts.js +5 -0
  166. package/dist/src/utils/plugin-scripts.js.map +1 -1
  167. package/dist/src/utils/skill-invocation-warning.d.ts +15 -0
  168. package/dist/src/utils/skill-invocation-warning.js +42 -0
  169. package/dist/src/utils/skill-invocation-warning.js.map +1 -0
  170. package/package.json +3 -3
  171. package/dist/src/output/native-consent.d.ts +0 -2
  172. package/dist/src/output/native-consent.js +0 -5
  173. package/dist/src/output/native-consent.js.map +0 -1
  174. package/dist/src/platforms/gemini-activation.d.ts +0 -36
  175. package/dist/src/platforms/gemini-activation.js +0 -331
  176. package/dist/src/platforms/gemini-activation.js.map +0 -1
  177. package/dist/src/platforms/gemini-consent.d.ts +0 -8
  178. package/dist/src/platforms/gemini-consent.js +0 -81
  179. package/dist/src/platforms/gemini-consent.js.map +0 -1
@@ -18,6 +18,7 @@ export interface RebuildIntegration {
18
18
  driver: RebuildTargetDriver;
19
19
  setNativeMarketplaceEligibleTargets(targets: readonly DesiredTarget[]): void;
20
20
  prepareNativeMarketplaceGroup(target: DesiredTarget): Promise<void>;
21
+ postcheckCodexProvider(target: DesiredTarget): Promise<void>;
21
22
  captureCodexPostMutationSnapshots(marketplaceNames?: readonly string[]): Promise<void>;
22
23
  buildTarget(options: {
23
24
  sourceId?: string;
@@ -32,6 +33,8 @@ export interface RebuildIntegration {
32
33
  command: 'install' | 'sync' | 'reinstall' | 'cleanup' | 'uninstall';
33
34
  catalog: CatalogResolution;
34
35
  readOnlyInspectionPlan?: boolean;
36
+ /** Fresh read window for peers undergoing the same placement check or plan verification. */
37
+ observationBatch?: import('../platforms/inspection-query.js').NativeObservationBatch;
35
38
  readOnlyShallowInspectionPlan?: boolean;
36
39
  includeNativeCleanupCandidate?: boolean;
37
40
  codexActivationCleanup?: Array<{
@@ -50,11 +53,11 @@ export declare class CodexActivationPostcheckError extends Error {
50
53
  constructor(codexPluginIds: string | readonly string[], detail: string);
51
54
  }
52
55
  export interface RebuildExecutionContext {
53
- /** Explicit --native-consent for this request, independent of AW confirmation. */
54
- nativeConsent?: boolean;
55
56
  recoveryCandidates?: readonly import('../platforms/contracts.js').RecoveryCandidate[];
56
57
  sharedReferenceView?: import('../utils/native-demand.js').NativeSharedReferenceView;
57
58
  platformRebuildSession?: PlatformRebuildSession;
59
+ /** Concurrent native groups share a session across scopes of the same platform. */
60
+ batchInstallPlatform?: PlatformName;
58
61
  packagePreparationCache?: Map<string, Promise<PreparedManagedCommandPackage>>;
59
62
  interruption?: import('./public-interruption.js').PublicCommandInterruption;
60
63
  /** Validated renderer process output shared only by preparations of this operation. */
@@ -32,15 +32,16 @@ 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();
36
37
  }
37
38
  export async function disposePreparedPlatformRebuildSession(results) {
38
- const session = platformRebuildSessions.get(results);
39
+ const sessions = platformRebuildSessions.get(results);
39
40
  platformRebuildSessions.delete(results);
40
41
  const packages = commandPackageCandidates.get(results);
41
42
  commandPackageCandidates.delete(results);
42
43
  try {
43
- await session?.dispose();
44
+ await Promise.all([...(sessions?.values() ?? [])].map((session) => session.dispose()));
44
45
  }
45
46
  finally {
46
47
  if (packages)
@@ -60,7 +61,7 @@ async function commandPackageActions(options) {
60
61
  commandPackagePreparationCaches.set(options.context, cache);
61
62
  }
62
63
  for (const declaration of options.plugin.manifest.managedCommands?.packages ?? []) {
63
- if (!declaration.platforms.includes(options.platform))
64
+ if (!declaration.platforms.includes(options.platform) || options.scope === 'user' && declaration.scope === 'project')
64
65
  continue;
65
66
  const producer = await managedCommandProducerIdentity({ ...options, scope: declaration.scope,
66
67
  producer: { kind: 'package', packageKey: declaration.key } });
@@ -1105,6 +1106,31 @@ function createNativeDriver(options) {
1105
1106
  path.normalize(path.resolve(target.identity.marketplaceRoot ?? resolveAwHome(options.context.env))),
1106
1107
  ].join('\0');
1107
1108
  const observationScopeFor = (target) => codexObservationScope(options.context, target.identity.marketplaceName ?? MARKETPLACE_NAME, target.identity.scope);
1109
+ const checkCodexInstalledVersion = async (target, pluginId, marketplaceName) => {
1110
+ const scope = codexObservationScope(options.context, marketplaceName, target.identity.scope);
1111
+ const registration = await inspectCodexPluginRegistrationLive({
1112
+ pluginId,
1113
+ cwd: target.identity.cwd,
1114
+ env: options.context.env,
1115
+ nativeCliRunner: runner,
1116
+ manager: currentCodexManager(),
1117
+ scope,
1118
+ observationSession: options.context.codexObservationSession,
1119
+ });
1120
+ const state = requireObservedCodexNativeState(registration.observation, 'native install postcheck');
1121
+ requireCodexObservationCoverage(registration, scope, 'native install postcheck');
1122
+ if (state !== 'installed') {
1123
+ throw new Error(`codexNativeInstallIncomplete: ${pluginId} is absent from Codex plugin list.`);
1124
+ }
1125
+ const installedEntry = registration.observation.state === 'observed'
1126
+ && registration.observation.value === 'installed'
1127
+ ? registration.observation.entry
1128
+ : undefined;
1129
+ if (installedEntry?.version !== undefined
1130
+ && installedEntry.version !== target.identity.pluginVersion) {
1131
+ throw new Error(`codexNativeInstallIncomplete: ${pluginId} version is ${installedEntry.version}; expected ${target.identity.pluginVersion}.`);
1132
+ }
1133
+ };
1108
1134
  const groupTargets = (target) => {
1109
1135
  if (!options.operationScopedNativePhases)
1110
1136
  return [target];
@@ -1416,6 +1442,25 @@ function createNativeDriver(options) {
1416
1442
  nativeMarketplaceEligibleTargets = new Set(eligibleTargets);
1417
1443
  },
1418
1444
  prepareNativeMarketplaceGroup: prepareNativeGroup,
1445
+ postcheckCodexProvider: async (target) => {
1446
+ const pending = deferredPostchecks.filter((entry) => entry.target === target);
1447
+ deferredPostchecks = deferredPostchecks.filter((entry) => entry.target !== target);
1448
+ // A dependent can write as soon as this returns. Read a new Codex list
1449
+ // after the provider's writes, even when its install receipt was healthy.
1450
+ const marketplaces = new Set((target.platformDeployment?.plans ?? []).flatMap((plan) => plan.evidence.layout.marketplaceName && plan.projections.some((projection) => projection.bundle)
1451
+ ? [plan.evidence.layout.marketplaceName] : []));
1452
+ if (target.requiresNative)
1453
+ marketplaces.add(target.identity.marketplaceName ?? MARKETPLACE_NAME);
1454
+ for (const name of marketplaces)
1455
+ options.context.codexObservationSession?.invalidate(name);
1456
+ if (!pending.length)
1457
+ await target.platformDeployment?.verify();
1458
+ for (const entry of pending)
1459
+ await entry.postcheck();
1460
+ for (const name of marketplaces) {
1461
+ await checkCodexInstalledVersion(target, `${target.identity.pluginName}@${name}`, name);
1462
+ }
1463
+ },
1419
1464
  ...(options.operationScopedNativePhases ? {
1420
1465
  deferPostcheck: (target, postcheck) => {
1421
1466
  if (target.identity.platform !== 'codex')
@@ -1425,29 +1470,7 @@ function createNativeDriver(options) {
1425
1470
  postcheck: async () => {
1426
1471
  if (target.requiresNative) {
1427
1472
  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
- }
1473
+ await checkCodexInstalledVersion(target, `${target.identity.pluginName}@${marketplaceName}`, marketplaceName);
1451
1474
  }
1452
1475
  await postcheck();
1453
1476
  },
@@ -1753,10 +1776,12 @@ export function createRebuildIntegration(options) {
1753
1776
  ?? commandPackageCandidates.get(renderResults) ?? new Map();
1754
1777
  commandPackageCandidates.set(renderResults, packageCache);
1755
1778
  options.context.packagePreparationCache = packageCache;
1779
+ const sessions = platformRebuildSessions.get(renderResults) ?? new Map();
1780
+ platformRebuildSessions.set(renderResults, sessions);
1756
1781
  const platformSession = options.context.platformRebuildSession
1757
- ?? platformRebuildSessions.get(renderResults)
1782
+ ?? sessions.get(options.context.batchInstallPlatform)
1758
1783
  ?? new PlatformRebuildSession(options.context);
1759
- platformRebuildSessions.set(renderResults, platformSession);
1784
+ sessions.set(options.context.batchInstallPlatform, platformSession);
1760
1785
  options.context.platformRebuildSession = platformSession;
1761
1786
  platformSession.updateContext(options.context);
1762
1787
  platformSession.setOwnershipExecutor(driver.ownership);
@@ -1766,6 +1791,7 @@ export function createRebuildIntegration(options) {
1766
1791
  driver,
1767
1792
  setNativeMarketplaceEligibleTargets: driver.setNativeMarketplaceEligibleTargets,
1768
1793
  prepareNativeMarketplaceGroup: driver.prepareNativeMarketplaceGroup,
1794
+ postcheckCodexProvider: driver.postcheckCodexProvider,
1769
1795
  captureCodexPostMutationSnapshots: driver.captureCodexPostMutationSnapshots,
1770
1796
  buildTarget: async (input) => {
1771
1797
  const target = await platformSession.buildTarget(input);