@lesliechan721/aw 0.1.0-beta.86 → 0.1.0-beta.88

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 (127) hide show
  1. package/dist/authoring/assets/command-runtime-config.mjs +40 -12
  2. package/dist/authoring/assets/command-runtime-config.mjs.map +1 -1
  3. package/dist/authoring/scripts/validate-plugin.mjs +14 -3
  4. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  5. package/dist/scripts/aw-skill-eval-materializer.js +10 -2
  6. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  7. package/dist/src/commands/aw-capabilities.d.ts +1 -1
  8. package/dist/src/commands/aw-capabilities.js +1 -0
  9. package/dist/src/commands/aw-capabilities.js.map +1 -1
  10. package/dist/src/commands/catalog-source.js +1 -1
  11. package/dist/src/commands/catalog-source.js.map +1 -1
  12. package/dist/src/commands/lifecycle-command-package.d.ts +1 -0
  13. package/dist/src/commands/lifecycle-command-package.js +14 -10
  14. package/dist/src/commands/lifecycle-command-package.js.map +1 -1
  15. package/dist/src/commands/managed-commands.js +8 -16
  16. package/dist/src/commands/managed-commands.js.map +1 -1
  17. package/dist/src/commands/plugin-capabilities.js +4 -0
  18. package/dist/src/commands/plugin-capabilities.js.map +1 -1
  19. package/dist/src/commands/public-lifecycle-result.js +2 -1
  20. package/dist/src/commands/public-lifecycle-result.js.map +1 -1
  21. package/dist/src/commands/rebuild-command.js +29 -56
  22. package/dist/src/commands/rebuild-command.js.map +1 -1
  23. package/dist/src/commands/rebuild-integration.d.ts +6 -3
  24. package/dist/src/commands/rebuild-integration.js +29 -19
  25. package/dist/src/commands/rebuild-integration.js.map +1 -1
  26. package/dist/src/generators/local-plugin.js +6 -0
  27. package/dist/src/generators/local-plugin.js.map +1 -1
  28. package/dist/src/generators/permissions.d.ts +2 -1
  29. package/dist/src/generators/permissions.js +5 -5
  30. package/dist/src/generators/permissions.js.map +1 -1
  31. package/dist/src/index.js +82 -9
  32. package/dist/src/index.js.map +1 -1
  33. package/dist/src/output/command-receipt.js +4 -2
  34. package/dist/src/output/command-receipt.js.map +1 -1
  35. package/dist/src/output/public-result.js +16 -4
  36. package/dist/src/output/public-result.js.map +1 -1
  37. package/dist/src/output/receipt-projection.js +5 -4
  38. package/dist/src/output/receipt-projection.js.map +1 -1
  39. package/dist/src/platforms/grok-permission-config.d.ts +2 -1
  40. package/dist/src/platforms/grok-permission-config.js +4 -4
  41. package/dist/src/platforms/grok-permission-config.js.map +1 -1
  42. package/dist/src/platforms/layout.d.ts +1 -0
  43. package/dist/src/platforms/layout.js +7 -3
  44. package/dist/src/platforms/layout.js.map +1 -1
  45. package/dist/src/platforms/projection.js +2 -2
  46. package/dist/src/platforms/projection.js.map +1 -1
  47. package/dist/src/recovery/status.js +2 -2
  48. package/dist/src/recovery/status.js.map +1 -1
  49. package/dist/src/review/skill-materialization.d.ts +1 -0
  50. package/dist/src/review/skill-materialization.js +5 -1
  51. package/dist/src/review/skill-materialization.js.map +1 -1
  52. package/dist/src/tui/config-array-draft.d.ts +2 -1
  53. package/dist/src/tui/config-array-draft.js +3 -0
  54. package/dist/src/tui/config-array-draft.js.map +1 -1
  55. package/dist/src/tui/config-leaf-editor.d.ts +2 -1
  56. package/dist/src/tui/config-leaf-editor.js +7 -4
  57. package/dist/src/tui/config-leaf-editor.js.map +1 -1
  58. package/dist/src/tui/config-suggestions.d.ts +22 -0
  59. package/dist/src/tui/config-suggestions.js +54 -0
  60. package/dist/src/tui/config-suggestions.js.map +1 -0
  61. package/dist/src/tui/config-value-presentation.d.ts +1 -0
  62. package/dist/src/tui/config-value-presentation.js +26 -1
  63. package/dist/src/tui/config-value-presentation.js.map +1 -1
  64. package/dist/src/tui/console-app-v4.js +284 -87
  65. package/dist/src/tui/console-app-v4.js.map +1 -1
  66. package/dist/src/tui/controller-runtime.js +14 -0
  67. package/dist/src/tui/controller-runtime.js.map +1 -1
  68. package/dist/src/tui/controller.d.ts +4 -0
  69. package/dist/src/tui/controller.js +46 -4
  70. package/dist/src/tui/controller.js.map +1 -1
  71. package/dist/src/tui/operation-review-planner.js +2 -2
  72. package/dist/src/tui/operation-review-planner.js.map +1 -1
  73. package/dist/src/tui/router.d.ts +17 -18
  74. package/dist/src/tui/router.js.map +1 -1
  75. package/dist/src/tui/screen-registry.d.ts +2 -8
  76. package/dist/src/types.d.ts +1 -0
  77. package/dist/src/types.js.map +1 -1
  78. package/dist/src/utils/bundle-layout.js +7 -0
  79. package/dist/src/utils/bundle-layout.js.map +1 -1
  80. package/dist/src/utils/component-command-preparation.js +2 -3
  81. package/dist/src/utils/component-command-preparation.js.map +1 -1
  82. package/dist/src/utils/managed-command-cli-review.d.ts +11 -1
  83. package/dist/src/utils/managed-command-cli-review.js +82 -40
  84. package/dist/src/utils/managed-command-cli-review.js.map +1 -1
  85. package/dist/src/utils/managed-command-materialization.js +2 -2
  86. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  87. package/dist/src/utils/managed-command-review.js +2 -2
  88. package/dist/src/utils/managed-command-review.js.map +1 -1
  89. package/dist/src/utils/managed-command-runtime.d.ts +2 -0
  90. package/dist/src/utils/managed-command-runtime.js +5 -3
  91. package/dist/src/utils/managed-command-runtime.js.map +1 -1
  92. package/dist/src/utils/managed-command-snapshots.d.ts +8 -1
  93. package/dist/src/utils/managed-command-snapshots.js +16 -11
  94. package/dist/src/utils/managed-command-snapshots.js.map +1 -1
  95. package/dist/src/utils/managed-command-store.d.ts +6 -1
  96. package/dist/src/utils/managed-command-store.js +47 -8
  97. package/dist/src/utils/managed-command-store.js.map +1 -1
  98. package/dist/src/utils/native-cli.d.ts +10 -0
  99. package/dist/src/utils/native-cli.js +24 -18
  100. package/dist/src/utils/native-cli.js.map +1 -1
  101. package/dist/src/utils/platform-empty-state.js +3 -2
  102. package/dist/src/utils/platform-empty-state.js.map +1 -1
  103. package/dist/src/utils/plugin-config-command-apply.js +7 -5
  104. package/dist/src/utils/plugin-config-command-apply.js.map +1 -1
  105. package/dist/src/utils/plugin-config-impact.d.ts +1 -0
  106. package/dist/src/utils/plugin-config-impact.js +2 -1
  107. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  108. package/dist/src/utils/plugin-config-references.d.ts +2 -0
  109. package/dist/src/utils/plugin-config-references.js +12 -2
  110. package/dist/src/utils/plugin-config-references.js.map +1 -1
  111. package/dist/src/utils/plugin-config-suggestion-runner.d.ts +50 -0
  112. package/dist/src/utils/plugin-config-suggestion-runner.js +167 -0
  113. package/dist/src/utils/plugin-config-suggestion-runner.js.map +1 -0
  114. package/dist/src/utils/plugin-config-suggestions.d.ts +47 -0
  115. package/dist/src/utils/plugin-config-suggestions.js +274 -0
  116. package/dist/src/utils/plugin-config-suggestions.js.map +1 -0
  117. package/dist/src/utils/plugin-config.d.ts +5 -1
  118. package/dist/src/utils/plugin-config.js +48 -22
  119. package/dist/src/utils/plugin-config.js.map +1 -1
  120. package/dist/src/utils/plugin-scripts.d.ts +2 -0
  121. package/dist/src/utils/plugin-scripts.js +101 -28
  122. package/dist/src/utils/plugin-scripts.js.map +1 -1
  123. package/dist/src/utils/rendered-contract.js +2 -2
  124. package/dist/src/utils/rendered-contract.js.map +1 -1
  125. package/dist/vitest.config.js +1 -0
  126. package/dist/vitest.config.js.map +1 -1
  127. package/package.json +3 -3
@@ -1,4 +1,6 @@
1
1
  import type { ConfigReferenceContext, ConfigReferenceDraft } from './config-references.js';
2
+ import type { ConfigSuggestionLookup } from './config-suggestions.js';
3
+ import type { ConfigSuggestionsResponseV1, PreparedConfigSuggestions } from '../utils/plugin-config-suggestions.js';
2
4
  import type { CatalogActivationMode, CatalogSource, CatalogGenerationActiveV1, CatalogGenerationCandidateEvidence, CatalogGenerationSyncResult, CatalogSourceImpact, CommandProducerResult, ConfigApplyResult, DependencyScopeOverride, PlatformName, PlatformTarget, Scope } from '../types.js';
3
5
  import type { PortableReview, PortableInstallReceipt, PortableRetryReview } from '../portable/commands.js';
4
6
  import type { CatalogSourceUpdate } from '../utils/catalog-sources.js';
@@ -798,6 +800,7 @@ export interface TuiControllerDependencies {
798
800
  getConfigGroups?: (pluginId: string, options: ConfigReadOptions, signal: AbortSignal) => Promise<ConfigGroupViewModel[]>;
799
801
  getConfigPage?: (pluginId: string, options: ConfigReadOptions, signal: AbortSignal) => Promise<ConfigPageViewModel>;
800
802
  getConfigReferenceContext?: (pluginId: string, options: ConfigProfileOptions, draft: ConfigReferenceDraft, signal: AbortSignal) => Promise<ConfigReferenceContext>;
803
+ getConfigSuggestions?: (lookup: ConfigSuggestionLookup, run: (prepared: Pick<PreparedConfigSuggestions, 'cacheKey' | 'project' | 'run'>) => Promise<ConfigSuggestionsResponseV1>, signal: AbortSignal) => Promise<ConfigSuggestionsResponseV1>;
801
804
  getConfigResetAvailability?: (pluginId: string, options: ConfigProfileOptions, signal: AbortSignal) => Promise<ConfigResetAvailability>;
802
805
  logError?: (error: unknown, code: string, context?: {
803
806
  privateConfigOperation: boolean;
@@ -1023,6 +1026,7 @@ export declare class TuiController {
1023
1026
  getConfigGroups(pluginId: string, options: ConfigReadOptions): Promise<ConfigGroupViewModel[]>;
1024
1027
  getConfigPage(pluginId: string, options: ConfigReadOptions, signal?: AbortSignal): Promise<ConfigPageViewModel>;
1025
1028
  getConfigReferenceContext(pluginId: string, options: ConfigProfileOptions, draft: ConfigReferenceDraft, signal?: AbortSignal): Promise<ConfigReferenceContext>;
1029
+ getConfigSuggestions(lookup: ConfigSuggestionLookup, refresh: boolean, signal: AbortSignal): Promise<ConfigSuggestionsResponseV1>;
1026
1030
  saveConfigDraft(request: Extract<OperationIntent, {
1027
1031
  kind: 'configSave' | 'configSaveBatch';
1028
1032
  }>, signal?: AbortSignal): Promise<ConfigDraftSaveResult>;
@@ -698,6 +698,7 @@ export class TuiController {
698
698
  #taskRetryIntent;
699
699
  #operationHistory = new OperationHistoryStore();
700
700
  #sessionEpoch = 0;
701
+ #configSuggestions = new Map();
701
702
  #lastRecordedResultId;
702
703
  #operationDiagnostics = new Map();
703
704
  constructor(dependencies, progressFeed) {
@@ -820,6 +821,8 @@ export class TuiController {
820
821
  return structuredClone(this.#externalDrafts);
821
822
  }
822
823
  attachOperationHistory(history, epoch) {
824
+ if (epoch !== this.#sessionEpoch)
825
+ this.#configSuggestions.clear();
823
826
  this.#operationHistory = history;
824
827
  this.#sessionEpoch = epoch;
825
828
  }
@@ -1547,9 +1550,13 @@ export class TuiController {
1547
1550
  this.#project();
1548
1551
  this.#normalizeCurrentRoute();
1549
1552
  }
1553
+ #beginCatalogSession(options) {
1554
+ this.#configSuggestions.clear();
1555
+ this.dependencies.beginCatalogSession?.(options);
1556
+ }
1550
1557
  async load() {
1551
1558
  this.#assertAcceptingActions();
1552
- this.dependencies.beginCatalogSession?.();
1559
+ this.#beginCatalogSession();
1553
1560
  const generation = ++this.#generation;
1554
1561
  this.#scopedRefreshToken.user += 1;
1555
1562
  this.#scopedRefreshToken.project += 1;
@@ -3119,7 +3126,7 @@ export class TuiController {
3119
3126
  this.#assertAcceptingActions();
3120
3127
  if (this.catalogActivationBlockReason())
3121
3128
  return false;
3122
- this.dependencies.beginCatalogSession?.();
3129
+ this.#beginCatalogSession();
3123
3130
  const generation = ++this.#generation;
3124
3131
  this.#phase = 'loading';
3125
3132
  this.#publish();
@@ -3187,6 +3194,40 @@ export class TuiController {
3187
3194
  const combined = signal ? AbortSignal.any([this.#abort.signal, signal]) : this.#abort.signal;
3188
3195
  return cloneFrozen(await this.#trackRead(this.dependencies.getConfigReferenceContext(pluginId, structuredClone(options), structuredClone(draft), combined)));
3189
3196
  }
3197
+ async getConfigSuggestions(lookup, refresh, signal) {
3198
+ this.#assertAcceptingActions();
3199
+ if (!this.dependencies.getConfigSuggestions)
3200
+ return { schemaVersion: 1, status: 'unavailable', items: [] };
3201
+ const combined = AbortSignal.any([this.#abort.signal, signal]);
3202
+ const frameId = this.#router.snapshot.currentFrameId;
3203
+ const epoch = this.#sessionEpoch;
3204
+ const generation = this.#generation;
3205
+ const verifyRequest = () => {
3206
+ combined.throwIfAborted();
3207
+ if (generation !== this.#generation || epoch !== this.#sessionEpoch || frameId !== this.#router.snapshot.currentFrameId) {
3208
+ throw new DOMException('Config field changed', 'AbortError');
3209
+ }
3210
+ };
3211
+ return this.#trackRead(this.dependencies.getConfigSuggestions(structuredClone(lookup), async (prepared) => {
3212
+ verifyRequest();
3213
+ if (!refresh) {
3214
+ const cached = this.#configSuggestions.get(prepared.cacheKey);
3215
+ if (cached) {
3216
+ // Once a value is recognized as sensitive, keep it out of this shared cache entry.
3217
+ const redacted = cloneFrozen(prepared.project(cached, 'cache'));
3218
+ this.#configSuggestions.set(prepared.cacheKey, redacted);
3219
+ return cloneFrozen(prepared.project(redacted));
3220
+ }
3221
+ }
3222
+ else
3223
+ this.#configSuggestions.delete(prepared.cacheKey);
3224
+ const response = cloneFrozen(await prepared.run(combined));
3225
+ verifyRequest();
3226
+ if (response.status === 'ok')
3227
+ this.#configSuggestions.set(prepared.cacheKey, response);
3228
+ return cloneFrozen(prepared.project(response));
3229
+ }, combined));
3230
+ }
3190
3231
  async saveConfigDraft(request, signal) {
3191
3232
  this.#assertAcceptingActions();
3192
3233
  if (this.hasActiveWrite)
@@ -3880,7 +3921,7 @@ export class TuiController {
3880
3921
  generation = ++this.#generation;
3881
3922
  if (ticket.intent.kind === 'sourceMutation' || ticket.intent.kind === 'catalogGeneration'
3882
3923
  || ticket.intent.kind === 'catalogSourcesRecovery') {
3883
- this.dependencies.beginCatalogSession?.(ticket.intent.kind === 'sourceMutation' ? {
3924
+ this.#beginCatalogSession(ticket.intent.kind === 'sourceMutation' ? {
3884
3925
  reuseValidatedGenerations: true,
3885
3926
  } : undefined);
3886
3927
  try {
@@ -4318,7 +4359,7 @@ export class TuiController {
4318
4359
  });
4319
4360
  }
4320
4361
  async #rebuildStaleReview(ticket, operationId, currentEvidence, generation = this.#generation) {
4321
- this.dependencies.beginCatalogSession?.();
4362
+ this.#beginCatalogSession();
4322
4363
  generation = ++this.#generation;
4323
4364
  try {
4324
4365
  const refreshed = await this.dependencies.loadStatus(this.#abort.signal);
@@ -4472,6 +4513,7 @@ export class TuiController {
4472
4513
  this.#cancelInstallPlacementRequest();
4473
4514
  this.#catalogSourcesSession.dispose();
4474
4515
  this.#abort.abort();
4516
+ this.#configSuggestions.clear();
4475
4517
  this.#progressUnsubscribe?.();
4476
4518
  this.#tickets.clear();
4477
4519
  this.#phase = 'disposed';