@lesliechan721/aw 0.1.0-beta.60 → 0.1.0-beta.62

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 (74) hide show
  1. package/dist/authoring/scripts/validate-plugin.mjs +56 -9
  2. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  3. package/dist/scripts/aw-skill-eval-materializer.js +3 -0
  4. package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
  5. package/dist/scripts/test-plugin-scripts.js +20 -1
  6. package/dist/scripts/test-plugin-scripts.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/rebuild-command.js +25 -26
  11. package/dist/src/commands/rebuild-command.js.map +1 -1
  12. package/dist/src/commands/rebuild-integration.d.ts +2 -0
  13. package/dist/src/commands/rebuild-integration.js +23 -7
  14. package/dist/src/commands/rebuild-integration.js.map +1 -1
  15. package/dist/src/commands/review-inspection.js +38 -5
  16. package/dist/src/commands/review-inspection.js.map +1 -1
  17. package/dist/src/commands/review-preparation.js +1 -0
  18. package/dist/src/commands/review-preparation.js.map +1 -1
  19. package/dist/src/generators/local-plugin.js +7 -5
  20. package/dist/src/generators/local-plugin.js.map +1 -1
  21. package/dist/src/portable/materializer.js +3 -0
  22. package/dist/src/portable/materializer.js.map +1 -1
  23. package/dist/src/review/review-profile.d.ts +1 -0
  24. package/dist/src/review/review-profile.js +44 -8
  25. package/dist/src/review/review-profile.js.map +1 -1
  26. package/dist/src/review/review-selection.js +19 -6
  27. package/dist/src/review/review-selection.js.map +1 -1
  28. package/dist/src/review/skill-materialization.d.ts +1 -0
  29. package/dist/src/review/skill-materialization.js +2 -0
  30. package/dist/src/review/skill-materialization.js.map +1 -1
  31. package/dist/src/review/source-binding.d.ts +5 -0
  32. package/dist/src/review/source-binding.js +83 -22
  33. package/dist/src/review/source-binding.js.map +1 -1
  34. package/dist/src/tui/config-leaf-editor.d.ts +24 -0
  35. package/dist/src/tui/config-leaf-editor.js +19 -7
  36. package/dist/src/tui/config-leaf-editor.js.map +1 -1
  37. package/dist/src/tui/config-references.d.ts +1 -0
  38. package/dist/src/tui/config-references.js +8 -1
  39. package/dist/src/tui/config-references.js.map +1 -1
  40. package/dist/src/tui/console-app-v4.js +77 -17
  41. package/dist/src/tui/console-app-v4.js.map +1 -1
  42. package/dist/src/tui/controller-runtime.d.ts +1 -1
  43. package/dist/src/tui/controller-runtime.js +119 -91
  44. package/dist/src/tui/controller-runtime.js.map +1 -1
  45. package/dist/src/tui/controller.d.ts +3 -0
  46. package/dist/src/tui/controller.js +19 -0
  47. package/dist/src/tui/controller.js.map +1 -1
  48. package/dist/src/tui/model.js +1 -1
  49. package/dist/src/tui/model.js.map +1 -1
  50. package/dist/src/tui/operation-review-planner.js +13 -8
  51. package/dist/src/tui/operation-review-planner.js.map +1 -1
  52. package/dist/src/utils/artifact-renderer.d.ts +8 -1
  53. package/dist/src/utils/artifact-renderer.js +25 -7
  54. package/dist/src/utils/artifact-renderer.js.map +1 -1
  55. package/dist/src/utils/managed-command-materialization.d.ts +2 -0
  56. package/dist/src/utils/managed-command-materialization.js +2 -1
  57. package/dist/src/utils/managed-command-materialization.js.map +1 -1
  58. package/dist/src/utils/plugin-config-impact.d.ts +15 -0
  59. package/dist/src/utils/plugin-config-impact.js +132 -24
  60. package/dist/src/utils/plugin-config-impact.js.map +1 -1
  61. package/dist/src/utils/plugin-config-references.d.ts +80 -0
  62. package/dist/src/utils/plugin-config-references.js +340 -0
  63. package/dist/src/utils/plugin-config-references.js.map +1 -0
  64. package/dist/src/utils/plugin-config-write.js +148 -31
  65. package/dist/src/utils/plugin-config-write.js.map +1 -1
  66. package/dist/src/utils/plugin-config.d.ts +10 -2
  67. package/dist/src/utils/plugin-config.js +53 -4
  68. package/dist/src/utils/plugin-config.js.map +1 -1
  69. package/dist/src/utils/plugin-scripts.d.ts +1 -0
  70. package/dist/src/utils/plugin-scripts.js +1 -1
  71. package/dist/src/utils/plugin-scripts.js.map +1 -1
  72. package/dist/src/utils/runtime-config.js +1 -0
  73. package/dist/src/utils/runtime-config.js.map +1 -1
  74. package/package.json +3 -3
@@ -52,6 +52,7 @@ export declare class CodexActivationPostcheckError extends Error {
52
52
  constructor(codexPluginIds: string | readonly string[], detail: string);
53
53
  }
54
54
  export interface RebuildExecutionContext {
55
+ referencePlugins?: readonly PluginMeta[];
55
56
  env: NodeJS.ProcessEnv;
56
57
  nativeCliRunner: NativeCliRunner;
57
58
  codexManager?: CodexManager;
@@ -169,6 +170,7 @@ export interface MaterializedReviewNativeSkills {
169
170
  * The caller owns outputRoot and is responsible for its cleanup.
170
171
  */
171
172
  export declare function materializeReviewNativeSkills(options: {
173
+ plugins?: readonly PluginMeta[];
172
174
  plugin: PluginMeta;
173
175
  platform: 'codex' | 'claude';
174
176
  scope: Scope;
@@ -73,11 +73,12 @@ function withoutVerifiedRequirementsReceipt(plugin, files) {
73
73
  }
74
74
  const commandPackagePreparationCaches = new WeakMap();
75
75
  const staticCommandPreparationCaches = new WeakMap();
76
+ const dynamicArtifactPreparationCaches = new WeakMap();
76
77
  async function prepareStaticCommandArtifacts(options) {
77
78
  const targets = getManagedCommandArtifactTargets(options.plugin.manifest).filter((target) => target.producer.kind === 'static-skill' && target.platform === options.platform);
78
79
  if (!targets.length)
79
80
  return [];
80
- const config = await resolveArtifactRenderConfig({ sourceId: options.plugin.sourceId, sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity, pluginName: options.plugin.manifest.name, manifest: options.plugin.manifest, scope: 'user', cwd: options.cwd, env: options.env });
81
+ const config = await resolveArtifactRenderConfig({ sourceId: options.plugin.sourceId, sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity, pluginName: options.plugin.manifest.name, manifest: options.plugin.manifest, scope: 'user', cwd: options.cwd, env: options.env, referencePlugins: options.context.referencePlugins });
81
82
  const key = JSON.stringify([options.plugin.rootDir, options.platform, config]);
82
83
  let cache = staticCommandPreparationCaches.get(options.context);
83
84
  if (!cache) {
@@ -87,7 +88,7 @@ async function prepareStaticCommandArtifacts(options) {
87
88
  let prepared = cache.get(key);
88
89
  if (!prepared) {
89
90
  prepared = (async () => {
90
- const rendered = await runArtifactRenderer({ plugin: options.plugin, event: 'install', platform: options.platform, scope: 'user', configScope: 'user', cwd: options.cwd, commandEnv: options.env, requestedArtifactIds: targets.map((target) => target.id) });
91
+ const rendered = await runArtifactRenderer({ plugin: options.plugin, referencePlugins: options.context.referencePlugins, event: 'install', platform: options.platform, scope: 'user', configScope: 'user', cwd: options.cwd, commandEnv: options.env, requestedArtifactIds: targets.map((target) => target.id) });
91
92
  return validateArtifactPlan({ manifest: options.plugin.manifest, plan: rendered.plan, platform: options.platform, scope: 'user', requestedArtifactIds: rendered.context.requestedArtifactIds, renderConfig: rendered.context.config, rendererDigest: rendered.target.rendererDigest, manifestDigest: rendered.target.manifestDigest }).artifacts;
92
93
  })();
93
94
  cache.set(key, prepared);
@@ -127,7 +128,7 @@ async function commandPackageActions(options) {
127
128
  let preparation = cache.get(getCommandPackageId(producer));
128
129
  if (!preparation) {
129
130
  preparation = (async () => {
130
- const prepared = await prepareManagedCommandPackage({ ...options, packageKey: declaration.key, scope: declaration.scope });
131
+ const prepared = await prepareManagedCommandPackage({ ...options, referencePlugins: options.context.referencePlugins, packageKey: declaration.key, scope: declaration.scope });
131
132
  try {
132
133
  const files = [];
133
134
  async function visit(directory, prefix) {
@@ -1140,11 +1141,17 @@ async function resolveDynamicArtifacts(options) {
1140
1141
  return { artifacts: [], sourceDirs: () => [], sensitiveValues: [] };
1141
1142
  }
1142
1143
  const previousArtifacts = [...options.previousArtifacts];
1144
+ let preparedResults = options.context && dynamicArtifactPreparationCaches.get(options.context);
1145
+ if (options.context && !preparedResults) {
1146
+ preparedResults = new Map();
1147
+ dynamicArtifactPreparationCaches.set(options.context, preparedResults);
1148
+ }
1143
1149
  const renders = [];
1144
1150
  for (const requestedArtifactIds of requestBatches) {
1145
1151
  renders.push(await runArtifactRenderer({
1146
1152
  event: options.event,
1147
1153
  plugin: options.plugin,
1154
+ referencePlugins: options.referencePlugins ?? options.context?.referencePlugins,
1148
1155
  platform: options.platform,
1149
1156
  scope: options.scope,
1150
1157
  cwd: options.cwd,
@@ -1152,6 +1159,7 @@ async function resolveDynamicArtifacts(options) {
1152
1159
  previousArtifacts,
1153
1160
  requestedArtifactIds,
1154
1161
  scriptTimeoutMs: options.scriptTimeoutMs,
1162
+ preparedResults,
1155
1163
  }));
1156
1164
  }
1157
1165
  const config = await resolveArtifactRenderConfig({
@@ -1160,6 +1168,7 @@ async function resolveDynamicArtifacts(options) {
1160
1168
  logicalIdentity: options.plugin.catalogLogicalIdentity,
1161
1169
  pluginName: options.plugin.manifest.name,
1162
1170
  manifest: options.plugin.manifest,
1171
+ referencePlugins: options.referencePlugins ?? options.context?.referencePlugins,
1163
1172
  scope: options.scope,
1164
1173
  cwd: options.cwd,
1165
1174
  env: options.env,
@@ -2806,7 +2815,7 @@ function pluginHasCodexNativeSkillSurface(plugin) {
2806
2815
  return plugin.manifest.skills !== undefined
2807
2816
  || codexNativeRenderTargets(plugin).length > 0;
2808
2817
  }
2809
- async function resolveSensitiveUserConfigValues(plugin, env) {
2818
+ async function resolveSensitiveUserConfigValues(plugin, env, referencePlugins) {
2810
2819
  const hasSensitiveFields = Object.values(plugin.manifest.config?.fields ?? {}).some((field) => field.sensitive === true);
2811
2820
  if (!hasSensitiveFields)
2812
2821
  return [];
@@ -2815,6 +2824,7 @@ async function resolveSensitiveUserConfigValues(plugin, env) {
2815
2824
  sourceIdentity: plugin.sourceIdentity,
2816
2825
  pluginName: plugin.manifest.name,
2817
2826
  manifest: plugin.manifest,
2827
+ referencePlugins,
2818
2828
  scope: 'user',
2819
2829
  cwd: plugin.rootDir,
2820
2830
  env,
@@ -2930,6 +2940,7 @@ async function prepareCodexNativeRender(options) {
2930
2940
  if (!group || group.length === 0)
2931
2941
  continue;
2932
2942
  const rendered = await runArtifactRenderer({
2943
+ referencePlugins: options.referencePlugins,
2933
2944
  event: 'install',
2934
2945
  plugin: options.plugin,
2935
2946
  platform: 'codex',
@@ -3035,6 +3046,7 @@ function prepareCodexNativeRenderCached(options) {
3035
3046
  let preparation = cache.get(options.plugin);
3036
3047
  if (!preparation) {
3037
3048
  preparation = prepareCodexNativeRender({
3049
+ referencePlugins: options.context.referencePlugins,
3038
3050
  plugin: options.plugin,
3039
3051
  env: options.context.env,
3040
3052
  scriptTimeoutMs: options.scriptTimeoutMs,
@@ -3138,6 +3150,7 @@ export async function materializeReviewNativeSkills(options) {
3138
3150
  .map((target) => target.id);
3139
3151
  if (directTargetIds.length > 0) {
3140
3152
  const dynamic = await resolveDynamicArtifacts({
3153
+ referencePlugins: options.plugins,
3141
3154
  plugin: options.plugin,
3142
3155
  platform: options.platform,
3143
3156
  scope: options.scope,
@@ -3218,6 +3231,7 @@ export async function materializeReviewNativeSkills(options) {
3218
3231
  dereference: false,
3219
3232
  });
3220
3233
  const prepared = await prepareCodexNativeRender({
3234
+ referencePlugins: options.plugins,
3221
3235
  plugin: options.plugin,
3222
3236
  env: options.env,
3223
3237
  requestedArtifactIds: nativeTargetIds,
@@ -3239,7 +3253,7 @@ export async function materializeReviewNativeSkills(options) {
3239
3253
  plugin: options.plugin,
3240
3254
  payloadRoot,
3241
3255
  allowedRoot: marketplaceRoot,
3242
- sensitiveValues: await resolveSensitiveUserConfigValues(options.plugin, options.env),
3256
+ sensitiveValues: await resolveSensitiveUserConfigValues(options.plugin, options.env, options.plugins),
3243
3257
  verifiedRenderReceipt: staged.receipt,
3244
3258
  });
3245
3259
  const presentSkillKeys = new Set(staged.presentSkillKeys);
@@ -3767,7 +3781,7 @@ function createNativeDriver(options) {
3767
3781
  plugin: candidate.plugin,
3768
3782
  payloadRoot: path.join(stagingRoot, 'plugins', candidate.identity.pluginName),
3769
3783
  allowedRoot: stagingRoot,
3770
- sensitiveValues: await resolveSensitiveUserConfigValues(candidate.plugin, options.context.env),
3784
+ sensitiveValues: await resolveSensitiveUserConfigValues(candidate.plugin, options.context.env, options.context.referencePlugins),
3771
3785
  ...(nativeRender ? { verifiedRenderReceipt: nativeRender.receipt } : {}),
3772
3786
  });
3773
3787
  }
@@ -4169,7 +4183,7 @@ function createNativeDriver(options) {
4169
4183
  && !target.codexNativeSensitivePreflightRequired)
4170
4184
  return;
4171
4185
  const sensitiveValues = pluginHasCodexNativeSkillSurface(target.plugin)
4172
- ? await resolveSensitiveUserConfigValues(target.plugin, options.context.env)
4186
+ ? await resolveSensitiveUserConfigValues(target.plugin, options.context.env, options.context.referencePlugins)
4173
4187
  : [];
4174
4188
  if (sensitiveValues.length > 0) {
4175
4189
  await assertNoSensitiveValuesInCanonicalCodexNativePayload({
@@ -4561,6 +4575,7 @@ function createNativeDriver(options) {
4561
4575
  scope: invocation.target.identity.scope,
4562
4576
  cwd: invocation.target.identity.cwd,
4563
4577
  context: options.context,
4578
+ referencePlugins: options.context.referencePlugins,
4564
4579
  scriptTimeoutMs: options.scriptTimeoutMs,
4565
4580
  });
4566
4581
  const cache = options.context.preApplyExecutionCache;
@@ -4692,6 +4707,7 @@ export function createRebuildIntegration(options) {
4692
4707
  scriptTimeoutMs: options.scriptTimeoutMs,
4693
4708
  commandCandidates: commands.candidates,
4694
4709
  nativeSkillActions,
4710
+ context: options.context,
4695
4711
  });
4696
4712
  }
4697
4713
  }