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

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 +49 -32
  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 +67 -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-'));
@@ -2230,14 +2240,12 @@ async function statusCommandV8InSession(options) {
2230
2240
  ? 'conflict'
2231
2241
  : extensionComponents.some((component) => component.error?.code === 'artifactCollision')
2232
2242
  ? 'conflict'
2233
- : observedTargets.some((candidate) => candidate.state === 'partial' || candidate.state === 'error')
2243
+ : extensionComponents.some((component) => component.state === 'partial' || component.state === 'error')
2234
2244
  ? 'drifted'
2235
- : extensionComponents.some((component) => component.state === 'partial' || component.state === 'error')
2236
- ? 'drifted'
2237
- : desired.scopes.length > 0 && (extensionComponents.length === 0
2238
- || extensionComponents.every((component) => component.state === 'absent'))
2239
- ? 'missing'
2240
- : 'ready',
2245
+ : desired.scopes.length > 0 && (extensionComponents.length === 0
2246
+ || extensionComponents.every((component) => component.state === 'absent'))
2247
+ ? 'missing'
2248
+ : 'ready',
2241
2249
  kinds: codex.extensionKinds,
2242
2250
  };
2243
2251
  const desiredEnabled = desired.scopes.length > 0;
@@ -2288,38 +2296,44 @@ async function statusCommandV8InSession(options) {
2288
2296
  ? 'blocked'
2289
2297
  : sharedNative?.state === 'replaceable' && sharedNative.reason === 'damaged'
2290
2298
  ? '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'
2299
+ : projectDisablesUserActivation
2300
+ ? 'needsSync'
2301
+ : redundantProjectActivation && sharedNative?.state === 'usable' && !hasScopedExtensionResidue
2302
+ ? 'ready'
2303
+ : !desiredEnabled
2304
+ ? (target.platform === 'codex'
2305
+ ? actualScopeEnabled || hasScopedExtensionResidue
2306
+ : ownershipState !== 'absent')
2307
+ || desired.relation === 'managed'
2308
+ ? 'orphaned'
2309
+ : 'absent'
2310
+ : dependencyMoves.length > 0
2305
2311
  ? 'needsSync'
2306
- : activationDrift || extensions?.state === 'drifted'
2312
+ : dependencyNotReady
2307
2313
  ? 'needsSync'
2308
- : extensions?.state === 'missing'
2309
- || (target.platform !== 'codex' && ownershipState === 'absent')
2314
+ : sharedNative?.state === 'missing'
2315
+ || sharedNative?.state === 'replaceable'
2316
+ || sharedNative?.state === 'unobserved'
2310
2317
  ? 'needsSync'
2311
- : ownershipState === 'partial' || ownershipState === 'error'
2318
+ : activationDrift || extensions?.state === 'drifted'
2312
2319
  ? 'needsSync'
2313
- : 'ready';
2320
+ : extensions?.state === 'missing'
2321
+ || (target.platform !== 'codex' && ownershipState === 'absent')
2322
+ ? 'needsSync'
2323
+ : ownershipState === 'partial' || ownershipState === 'error'
2324
+ ? 'needsSync'
2325
+ : 'ready';
2314
2326
  const stableErrors = [
2315
2327
  ...projectStatusSharedNativeReasons(sharedNative, baseTargetErrors.map((error) => error.code), desiredEnabled),
2316
2328
  ...(desiredOverlapConflict
2317
2329
  ? [blocking('codexExtensionScopeConflict', `${target.pluginId} has AW extensions desired at user and project scope.`)]
2318
2330
  : []),
2319
2331
  ...(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'}.`)]
2332
+ ? [warning('codexActivationDrift', projectDisablesUserActivation
2333
+ ? `${target.pluginId} is enabled for the user but disabled by the current project.`
2334
+ : `${target.pluginId} activation differs from desired intent: `
2335
+ + `${target.scope} expected=${expectedEnabled}, `
2336
+ + `actual=${activation?.[target.scope] ?? 'unset'}.`)]
2323
2337
  : []),
2324
2338
  ...(extensions?.state === 'drifted'
2325
2339
  ? [warning('codexExtensionDrift', `${target.pluginId} extension projection has drifted.`)]
@@ -2432,7 +2446,10 @@ async function statusCommandV8InSession(options) {
2432
2446
  state,
2433
2447
  components,
2434
2448
  reasons: dedupedErrors,
2435
- recoveryActions: statusRecovery({
2449
+ recoveryActions: projectDisablesUserActivation && state === 'needsSync' ? [{
2450
+ command: 'sync', scope: 'user',
2451
+ description: '移除当前项目的关闭设置,恢复使用所有项目已启用的插件。',
2452
+ }] : statusRecovery({
2436
2453
  state,
2437
2454
  desired,
2438
2455
  platform: target.platform,