@lesliechan721/aw 0.1.0-beta.20 → 0.1.0-beta.21

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 (38) hide show
  1. package/dist/src/commands/status-v6.js +44 -25
  2. package/dist/src/commands/status-v6.js.map +1 -1
  3. package/dist/src/tui/components.d.ts +1 -0
  4. package/dist/src/tui/components.js +3 -1
  5. package/dist/src/tui/components.js.map +1 -1
  6. package/dist/src/tui/console-app-v4.d.ts +1 -1
  7. package/dist/src/tui/console-app-v4.js +756 -1127
  8. package/dist/src/tui/console-app-v4.js.map +1 -1
  9. package/dist/src/tui/controller-runtime.js +65 -42
  10. package/dist/src/tui/controller-runtime.js.map +1 -1
  11. package/dist/src/tui/controller.d.ts +4 -30
  12. package/dist/src/tui/controller.js +7 -219
  13. package/dist/src/tui/controller.js.map +1 -1
  14. package/dist/src/tui/dependency-graph.d.ts +3 -3
  15. package/dist/src/tui/dependency-graph.js +15 -14
  16. package/dist/src/tui/dependency-graph.js.map +1 -1
  17. package/dist/src/tui/glossary.d.ts +1 -1
  18. package/dist/src/tui/glossary.js +1 -1
  19. package/dist/src/tui/glossary.js.map +1 -1
  20. package/dist/src/tui/model.d.ts +2 -0
  21. package/dist/src/tui/model.js +63 -30
  22. package/dist/src/tui/model.js.map +1 -1
  23. package/dist/src/tui/operation-review-planner.js +8 -195
  24. package/dist/src/tui/operation-review-planner.js.map +1 -1
  25. package/dist/src/tui/plugin-write-task.js +4 -0
  26. package/dist/src/tui/plugin-write-task.js.map +1 -1
  27. package/dist/src/tui/router.d.ts +4 -16
  28. package/dist/src/tui/router.js.map +1 -1
  29. package/dist/src/tui/screen-registry.d.ts +10 -57
  30. package/dist/src/tui/screen-registry.js +1 -15
  31. package/dist/src/tui/screen-registry.js.map +1 -1
  32. package/package.json +3 -3
  33. package/dist/src/tui/catalog-management-screens.d.ts +0 -45
  34. package/dist/src/tui/catalog-management-screens.js +0 -25
  35. package/dist/src/tui/catalog-management-screens.js.map +0 -1
  36. package/dist/src/tui/catalog-management.d.ts +0 -240
  37. package/dist/src/tui/catalog-management.js +0 -856
  38. package/dist/src/tui/catalog-management.js.map +0 -1
@@ -1747,7 +1747,7 @@ async function statusCommandV8InSession(options) {
1747
1747
  ...(userActivation !== undefined ? { user: userActivation } : {}),
1748
1748
  ...(projectActivation !== undefined ? { project: projectActivation } : {}),
1749
1749
  ...((userActivation !== undefined || projectActivation !== undefined)
1750
- ? { effective: projectActivation === true || userActivation === true }
1750
+ ? { effective: (projectActivation ?? userActivation) === true }
1751
1751
  : {}),
1752
1752
  evidence: activationObserved ? 'observed' : 'assumed',
1753
1753
  },
@@ -2213,11 +2213,21 @@ async function statusCommandV8InSession(options) {
2213
2213
  && desired.scopes.includes('user')
2214
2214
  && desired.scopes.includes('project');
2215
2215
  const expectedEnabled = desired.scopes.includes(target.scope);
2216
+ const inheritedUserActivation = target.platform === 'codex'
2217
+ && target.scope === 'project'
2218
+ && !expectedEnabled
2219
+ && desiredAll.scopes.includes('user')
2220
+ && activation?.user === true
2221
+ && (codex?.nativeKinds.length ?? 0) > 0;
2222
+ const projectDisablesUserActivation = inheritedUserActivation && activation?.project === false;
2223
+ const redundantProjectActivation = inheritedUserActivation && activation?.project === true
2224
+ && (codex?.extensionKinds.length ?? 0) === 0;
2216
2225
  const activationDrift = target.platform === 'codex'
2217
2226
  && (codexConfigErrors.some((error) => error.scope === 'user' || observationScopes.includes(error.scope))
2218
2227
  || ((codex?.nativeKinds.length ?? 0) > 0
2219
2228
  && (expectedEnabled && activation?.[target.scope] !== true
2220
- || !expectedEnabled && activation?.[target.scope] === true)));
2229
+ || !expectedEnabled && activation?.[target.scope] === true && !redundantProjectActivation
2230
+ || projectDisablesUserActivation)));
2221
2231
  const extensionComponents = observedTargets.flatMap((candidate) => candidate.components).filter((component) => component.key !== 'native'
2222
2232
  && !component.key.startsWith('activation-')
2223
2233
  && !component.key.startsWith('marketplace-'));
@@ -2288,38 +2298,44 @@ async function statusCommandV8InSession(options) {
2288
2298
  ? 'blocked'
2289
2299
  : sharedNative?.state === 'replaceable' && sharedNative.reason === 'damaged'
2290
2300
  ? 'needsSync'
2291
- : !desiredEnabled
2292
- ? (target.platform === 'codex'
2293
- ? actualScopeEnabled || hasScopedExtensionResidue
2294
- : ownershipState !== 'absent')
2295
- || desired.relation === 'managed'
2296
- ? 'orphaned'
2297
- : 'absent'
2298
- : dependencyMoves.length > 0
2299
- ? 'needsSync'
2300
- : dependencyNotReady
2301
- ? 'needsSync'
2302
- : sharedNative?.state === 'missing'
2303
- || sharedNative?.state === 'replaceable'
2304
- || sharedNative?.state === 'unobserved'
2301
+ : projectDisablesUserActivation
2302
+ ? 'needsSync'
2303
+ : redundantProjectActivation && sharedNative?.state === 'usable' && !hasScopedExtensionResidue
2304
+ ? 'ready'
2305
+ : !desiredEnabled
2306
+ ? (target.platform === 'codex'
2307
+ ? actualScopeEnabled || hasScopedExtensionResidue
2308
+ : ownershipState !== 'absent')
2309
+ || desired.relation === 'managed'
2310
+ ? 'orphaned'
2311
+ : 'absent'
2312
+ : dependencyMoves.length > 0
2305
2313
  ? 'needsSync'
2306
- : activationDrift || extensions?.state === 'drifted'
2314
+ : dependencyNotReady
2307
2315
  ? 'needsSync'
2308
- : extensions?.state === 'missing'
2309
- || (target.platform !== 'codex' && ownershipState === 'absent')
2316
+ : sharedNative?.state === 'missing'
2317
+ || sharedNative?.state === 'replaceable'
2318
+ || sharedNative?.state === 'unobserved'
2310
2319
  ? 'needsSync'
2311
- : ownershipState === 'partial' || ownershipState === 'error'
2320
+ : activationDrift || extensions?.state === 'drifted'
2312
2321
  ? 'needsSync'
2313
- : 'ready';
2322
+ : extensions?.state === 'missing'
2323
+ || (target.platform !== 'codex' && ownershipState === 'absent')
2324
+ ? 'needsSync'
2325
+ : ownershipState === 'partial' || ownershipState === 'error'
2326
+ ? 'needsSync'
2327
+ : 'ready';
2314
2328
  const stableErrors = [
2315
2329
  ...projectStatusSharedNativeReasons(sharedNative, baseTargetErrors.map((error) => error.code), desiredEnabled),
2316
2330
  ...(desiredOverlapConflict
2317
2331
  ? [blocking('codexExtensionScopeConflict', `${target.pluginId} has AW extensions desired at user and project scope.`)]
2318
2332
  : []),
2319
2333
  ...(activationDrift && sharedNative?.state !== 'missing' && sharedNative?.state !== 'unobserved'
2320
- ? [warning('codexActivationDrift', `${target.pluginId} activation differs from desired intent: `
2321
- + `${target.scope} expected=${expectedEnabled}, `
2322
- + `actual=${activation?.[target.scope] ?? 'unset'}.`)]
2334
+ ? [warning('codexActivationDrift', projectDisablesUserActivation
2335
+ ? `${target.pluginId} is enabled for the user but disabled by the current project.`
2336
+ : `${target.pluginId} activation differs from desired intent: `
2337
+ + `${target.scope} expected=${expectedEnabled}, `
2338
+ + `actual=${activation?.[target.scope] ?? 'unset'}.`)]
2323
2339
  : []),
2324
2340
  ...(extensions?.state === 'drifted'
2325
2341
  ? [warning('codexExtensionDrift', `${target.pluginId} extension projection has drifted.`)]
@@ -2432,7 +2448,10 @@ async function statusCommandV8InSession(options) {
2432
2448
  state,
2433
2449
  components,
2434
2450
  reasons: dedupedErrors,
2435
- recoveryActions: statusRecovery({
2451
+ recoveryActions: projectDisablesUserActivation && state === 'needsSync' ? [{
2452
+ command: 'sync', scope: 'user',
2453
+ description: '移除当前项目的关闭设置,恢复使用所有项目已启用的插件。',
2454
+ }] : statusRecovery({
2436
2455
  state,
2437
2456
  desired,
2438
2457
  platform: target.platform,