@lesliechan721/aw 0.1.0-beta.10
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.
- package/dist/authoring/assets/aw-config.d.mts +51 -0
- package/dist/authoring/assets/aw-config.mjs +1025 -0
- package/dist/authoring/assets/aw-config.mjs.map +1 -0
- package/dist/authoring/scripts/add-skill.d.mts +2 -0
- package/dist/authoring/scripts/add-skill.mjs +355 -0
- package/dist/authoring/scripts/add-skill.mjs.map +1 -0
- package/dist/authoring/scripts/init-plugin.d.mts +2 -0
- package/dist/authoring/scripts/init-plugin.mjs +487 -0
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -0
- package/dist/authoring/scripts/lib/javascript-import-scanner.d.mts +4 -0
- package/dist/authoring/scripts/lib/javascript-import-scanner.mjs +261 -0
- package/dist/authoring/scripts/lib/javascript-import-scanner.mjs.map +1 -0
- package/dist/authoring/scripts/lib/plugin-root.d.mts +26 -0
- package/dist/authoring/scripts/lib/plugin-root.mjs +125 -0
- package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -0
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +69 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +563 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -0
- package/dist/authoring/scripts/lib/semver.d.mts +9 -0
- package/dist/authoring/scripts/lib/semver.mjs +63 -0
- package/dist/authoring/scripts/lib/semver.mjs.map +1 -0
- package/dist/authoring/scripts/lib/skill-scaffold.d.mts +111 -0
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +353 -0
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -0
- package/dist/authoring/scripts/plugin-status.d.mts +2 -0
- package/dist/authoring/scripts/plugin-status.mjs +93 -0
- package/dist/authoring/scripts/plugin-status.mjs.map +1 -0
- package/dist/authoring/scripts/remove-plugin.d.mts +2 -0
- package/dist/authoring/scripts/remove-plugin.mjs +367 -0
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -0
- package/dist/authoring/scripts/validate-plugin.d.mts +2 -0
- package/dist/authoring/scripts/validate-plugin.mjs +3465 -0
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -0
- package/dist/authoring/scripts/validate-skill.d.mts +2 -0
- package/dist/authoring/scripts/validate-skill.mjs +126 -0
- package/dist/authoring/scripts/validate-skill.mjs.map +1 -0
- package/dist/authoring/templates/aw-config-runtime.d.mts +2 -0
- package/dist/authoring/templates/aw-config-runtime.mjs +407 -0
- package/dist/authoring/templates/aw-config-runtime.mjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/scripts/aw-skill-eval-materializer.d.ts +24 -0
- package/dist/scripts/aw-skill-eval-materializer.js +309 -0
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
- package/dist/scripts/bundle-plugins.d.ts +17 -0
- package/dist/scripts/bundle-plugins.js +126 -0
- package/dist/scripts/bundle-plugins.js.map +1 -0
- package/dist/scripts/plugin-staging.d.ts +26 -0
- package/dist/scripts/plugin-staging.js +76 -0
- package/dist/scripts/plugin-staging.js.map +1 -0
- package/dist/scripts/test-plugin-scripts.d.ts +7 -0
- package/dist/scripts/test-plugin-scripts.js +610 -0
- package/dist/scripts/test-plugin-scripts.js.map +1 -0
- package/dist/src/adapters/helpers.d.ts +44 -0
- package/dist/src/adapters/helpers.js +95 -0
- package/dist/src/adapters/helpers.js.map +1 -0
- package/dist/src/authoring/workspace-commands.d.ts +70 -0
- package/dist/src/authoring/workspace-commands.js +158 -0
- package/dist/src/authoring/workspace-commands.js.map +1 -0
- package/dist/src/commands/aw-capabilities.d.ts +78 -0
- package/dist/src/commands/aw-capabilities.js +254 -0
- package/dist/src/commands/aw-capabilities.js.map +1 -0
- package/dist/src/commands/catalog-dev-source.d.ts +120 -0
- package/dist/src/commands/catalog-dev-source.js +434 -0
- package/dist/src/commands/catalog-dev-source.js.map +1 -0
- package/dist/src/commands/catalog-generation.d.ts +16 -0
- package/dist/src/commands/catalog-generation.js +9 -0
- package/dist/src/commands/catalog-generation.js.map +1 -0
- package/dist/src/commands/catalog-publication-inspection.d.ts +138 -0
- package/dist/src/commands/catalog-publication-inspection.js +711 -0
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -0
- package/dist/src/commands/catalog-publication-journal.d.ts +56 -0
- package/dist/src/commands/catalog-publication-journal.js +215 -0
- package/dist/src/commands/catalog-publication-journal.js.map +1 -0
- package/dist/src/commands/catalog-publication-target.d.ts +18 -0
- package/dist/src/commands/catalog-publication-target.js +95 -0
- package/dist/src/commands/catalog-publication-target.js.map +1 -0
- package/dist/src/commands/catalog-publish.d.ts +103 -0
- package/dist/src/commands/catalog-publish.js +804 -0
- package/dist/src/commands/catalog-publish.js.map +1 -0
- package/dist/src/commands/catalog-source.d.ts +134 -0
- package/dist/src/commands/catalog-source.js +377 -0
- package/dist/src/commands/catalog-source.js.map +1 -0
- package/dist/src/commands/catalog-status.d.ts +56 -0
- package/dist/src/commands/catalog-status.js +217 -0
- package/dist/src/commands/catalog-status.js.map +1 -0
- package/dist/src/commands/catalog-store.d.ts +80 -0
- package/dist/src/commands/catalog-store.js +348 -0
- package/dist/src/commands/catalog-store.js.map +1 -0
- package/dist/src/commands/catalog-workspace-resolution.d.ts +13 -0
- package/dist/src/commands/catalog-workspace-resolution.js +42 -0
- package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
- package/dist/src/commands/console.d.ts +3 -0
- package/dist/src/commands/console.js +44 -0
- package/dist/src/commands/console.js.map +1 -0
- package/dist/src/commands/dependency-operation-plan.d.ts +58 -0
- package/dist/src/commands/dependency-operation-plan.js +261 -0
- package/dist/src/commands/dependency-operation-plan.js.map +1 -0
- package/dist/src/commands/init.d.ts +25 -0
- package/dist/src/commands/init.js +42 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/offline-cleanup-evidence.d.ts +59 -0
- package/dist/src/commands/offline-cleanup-evidence.js +163 -0
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -0
- package/dist/src/commands/operation-plan.d.ts +126 -0
- package/dist/src/commands/operation-plan.js +47 -0
- package/dist/src/commands/operation-plan.js.map +1 -0
- package/dist/src/commands/operation-planner.d.ts +46 -0
- package/dist/src/commands/operation-planner.js +139 -0
- package/dist/src/commands/operation-planner.js.map +1 -0
- package/dist/src/commands/options.d.ts +70 -0
- package/dist/src/commands/options.js +194 -0
- package/dist/src/commands/options.js.map +1 -0
- package/dist/src/commands/plugin-capabilities.d.ts +22 -0
- package/dist/src/commands/plugin-capabilities.js +159 -0
- package/dist/src/commands/plugin-capabilities.js.map +1 -0
- package/dist/src/commands/rebuild-command.d.ts +88 -0
- package/dist/src/commands/rebuild-command.js +3626 -0
- package/dist/src/commands/rebuild-command.js.map +1 -0
- package/dist/src/commands/rebuild-integration.d.ts +190 -0
- package/dist/src/commands/rebuild-integration.js +4439 -0
- package/dist/src/commands/rebuild-integration.js.map +1 -0
- package/dist/src/commands/rebuild-operations.d.ts +100 -0
- package/dist/src/commands/rebuild-operations.js +625 -0
- package/dist/src/commands/rebuild-operations.js.map +1 -0
- package/dist/src/commands/reconcile-operation-plan.d.ts +26 -0
- package/dist/src/commands/reconcile-operation-plan.js +28 -0
- package/dist/src/commands/reconcile-operation-plan.js.map +1 -0
- package/dist/src/commands/review-publication.d.ts +99 -0
- package/dist/src/commands/review-publication.js +904 -0
- package/dist/src/commands/review-publication.js.map +1 -0
- package/dist/src/commands/runtime.d.ts +172 -0
- package/dist/src/commands/runtime.js +720 -0
- package/dist/src/commands/runtime.js.map +1 -0
- package/dist/src/commands/skill-eval.d.ts +33 -0
- package/dist/src/commands/skill-eval.js +363 -0
- package/dist/src/commands/skill-eval.js.map +1 -0
- package/dist/src/commands/status-v6.d.ts +206 -0
- package/dist/src/commands/status-v6.js +2175 -0
- package/dist/src/commands/status-v6.js.map +1 -0
- package/dist/src/commands/sync-command.d.ts +23 -0
- package/dist/src/commands/sync-command.js +242 -0
- package/dist/src/commands/sync-command.js.map +1 -0
- package/dist/src/commands/wizard.d.ts +56 -0
- package/dist/src/commands/wizard.js +58 -0
- package/dist/src/commands/wizard.js.map +1 -0
- package/dist/src/commands/write-commands.d.ts +7 -0
- package/dist/src/commands/write-commands.js +190 -0
- package/dist/src/commands/write-commands.js.map +1 -0
- package/dist/src/constants.d.ts +31 -0
- package/dist/src/constants.js +32 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/eval/manifest-v1.d.ts +67 -0
- package/dist/src/eval/manifest-v1.js +347 -0
- package/dist/src/eval/manifest-v1.js.map +1 -0
- package/dist/src/generators/agents.d.ts +3 -0
- package/dist/src/generators/agents.js +46 -0
- package/dist/src/generators/agents.js.map +1 -0
- package/dist/src/generators/hooks.d.ts +15 -0
- package/dist/src/generators/hooks.js +76 -0
- package/dist/src/generators/hooks.js.map +1 -0
- package/dist/src/generators/instructions.d.ts +13 -0
- package/dist/src/generators/instructions.js +66 -0
- package/dist/src/generators/instructions.js.map +1 -0
- package/dist/src/generators/local-plugin.d.ts +56 -0
- package/dist/src/generators/local-plugin.js +1373 -0
- package/dist/src/generators/local-plugin.js.map +1 -0
- package/dist/src/generators/permissions.d.ts +10 -0
- package/dist/src/generators/permissions.js +37 -0
- package/dist/src/generators/permissions.js.map +1 -0
- package/dist/src/generators/shared.d.ts +2 -0
- package/dist/src/generators/shared.js +15 -0
- package/dist/src/generators/shared.js.map +1 -0
- package/dist/src/index.d.ts +41 -0
- package/dist/src/index.js +3327 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/output/command-receipt.d.ts +87 -0
- package/dist/src/output/command-receipt.js +302 -0
- package/dist/src/output/command-receipt.js.map +1 -0
- package/dist/src/output/debug-log.d.ts +4 -0
- package/dist/src/output/debug-log.js +97 -0
- package/dist/src/output/debug-log.js.map +1 -0
- package/dist/src/output/equivalent-command.d.ts +9 -0
- package/dist/src/output/equivalent-command.js +39 -0
- package/dist/src/output/equivalent-command.js.map +1 -0
- package/dist/src/output/model.d.ts +76 -0
- package/dist/src/output/model.js +2 -0
- package/dist/src/output/model.js.map +1 -0
- package/dist/src/output/rebuild-progress.d.ts +21 -0
- package/dist/src/output/rebuild-progress.js +128 -0
- package/dist/src/output/rebuild-progress.js.map +1 -0
- package/dist/src/output/redact.d.ts +3 -0
- package/dist/src/output/redact.js +39 -0
- package/dist/src/output/redact.js.map +1 -0
- package/dist/src/output/reporter.d.ts +9 -0
- package/dist/src/output/reporter.js +133 -0
- package/dist/src/output/reporter.js.map +1 -0
- package/dist/src/portable/commands.d.ts +124 -0
- package/dist/src/portable/commands.js +557 -0
- package/dist/src/portable/commands.js.map +1 -0
- package/dist/src/portable/materializer.d.ts +50 -0
- package/dist/src/portable/materializer.js +462 -0
- package/dist/src/portable/materializer.js.map +1 -0
- package/dist/src/portable/skills-cli.d.ts +43 -0
- package/dist/src/portable/skills-cli.js +148 -0
- package/dist/src/portable/skills-cli.js.map +1 -0
- package/dist/src/tui/catalog-freshness.d.ts +1 -0
- package/dist/src/tui/catalog-freshness.js +2 -0
- package/dist/src/tui/catalog-freshness.js.map +1 -0
- package/dist/src/tui/catalog-generation.d.ts +21 -0
- package/dist/src/tui/catalog-generation.js +116 -0
- package/dist/src/tui/catalog-generation.js.map +1 -0
- package/dist/src/tui/catalog-sources/projection.d.ts +4 -0
- package/dist/src/tui/catalog-sources/projection.js +17 -0
- package/dist/src/tui/catalog-sources/projection.js.map +1 -0
- package/dist/src/tui/catalog-sources/review.d.ts +3 -0
- package/dist/src/tui/catalog-sources/review.js +13 -0
- package/dist/src/tui/catalog-sources/review.js.map +1 -0
- package/dist/src/tui/catalog-sources/screens.d.ts +12 -0
- package/dist/src/tui/catalog-sources/screens.js +33 -0
- package/dist/src/tui/catalog-sources/screens.js.map +1 -0
- package/dist/src/tui/catalog-sources/session.d.ts +22 -0
- package/dist/src/tui/catalog-sources/session.js +225 -0
- package/dist/src/tui/catalog-sources/session.js.map +1 -0
- package/dist/src/tui/catalog-sources/types.d.ts +41 -0
- package/dist/src/tui/catalog-sources/types.js +2 -0
- package/dist/src/tui/catalog-sources/types.js.map +1 -0
- package/dist/src/tui/components.d.ts +102 -0
- package/dist/src/tui/components.js +184 -0
- package/dist/src/tui/components.js.map +1 -0
- package/dist/src/tui/console-app-v4.d.ts +20 -0
- package/dist/src/tui/console-app-v4.js +5066 -0
- package/dist/src/tui/console-app-v4.js.map +1 -0
- package/dist/src/tui/controller-runtime.d.ts +23 -0
- package/dist/src/tui/controller-runtime.js +2011 -0
- package/dist/src/tui/controller-runtime.js.map +1 -0
- package/dist/src/tui/controller.d.ts +557 -0
- package/dist/src/tui/controller.js +2120 -0
- package/dist/src/tui/controller.js.map +1 -0
- package/dist/src/tui/diagnostics.d.ts +30 -0
- package/dist/src/tui/diagnostics.js +71 -0
- package/dist/src/tui/diagnostics.js.map +1 -0
- package/dist/src/tui/index.d.ts +17 -0
- package/dist/src/tui/index.js +17 -0
- package/dist/src/tui/index.js.map +1 -0
- package/dist/src/tui/input-display.d.ts +8 -0
- package/dist/src/tui/input-display.js +36 -0
- package/dist/src/tui/input-display.js.map +1 -0
- package/dist/src/tui/keys.d.ts +12 -0
- package/dist/src/tui/keys.js +22 -0
- package/dist/src/tui/keys.js.map +1 -0
- package/dist/src/tui/layout.d.ts +12 -0
- package/dist/src/tui/layout.js +19 -0
- package/dist/src/tui/layout.js.map +1 -0
- package/dist/src/tui/model.d.ts +424 -0
- package/dist/src/tui/model.js +1493 -0
- package/dist/src/tui/model.js.map +1 -0
- package/dist/src/tui/operation-review-planner.d.ts +21 -0
- package/dist/src/tui/operation-review-planner.js +622 -0
- package/dist/src/tui/operation-review-planner.js.map +1 -0
- package/dist/src/tui/prompt.d.ts +8 -0
- package/dist/src/tui/prompt.js +231 -0
- package/dist/src/tui/prompt.js.map +1 -0
- package/dist/src/tui/router.d.ts +206 -0
- package/dist/src/tui/router.js +137 -0
- package/dist/src/tui/router.js.map +1 -0
- package/dist/src/tui/runner.d.ts +11 -0
- package/dist/src/tui/runner.js +71 -0
- package/dist/src/tui/runner.js.map +1 -0
- package/dist/src/tui/source-ref-presets.d.ts +3 -0
- package/dist/src/tui/source-ref-presets.js +11 -0
- package/dist/src/tui/source-ref-presets.js.map +1 -0
- package/dist/src/tui/theme.d.ts +26 -0
- package/dist/src/tui/theme.js +28 -0
- package/dist/src/tui/theme.js.map +1 -0
- package/dist/src/tui/viewport.d.ts +20 -0
- package/dist/src/tui/viewport.js +29 -0
- package/dist/src/tui/viewport.js.map +1 -0
- package/dist/src/tui/views.d.ts +57 -0
- package/dist/src/tui/views.js +201 -0
- package/dist/src/tui/views.js.map +1 -0
- package/dist/src/tui/wizard.d.ts +11 -0
- package/dist/src/tui/wizard.js +323 -0
- package/dist/src/tui/wizard.js.map +1 -0
- package/dist/src/types.d.ts +474 -0
- package/dist/src/types.js +34 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/agent-version.d.ts +19 -0
- package/dist/src/utils/agent-version.js +205 -0
- package/dist/src/utils/agent-version.js.map +1 -0
- package/dist/src/utils/artifact-plan.d.ts +27 -0
- package/dist/src/utils/artifact-plan.js +453 -0
- package/dist/src/utils/artifact-plan.js.map +1 -0
- package/dist/src/utils/artifact-renderer.d.ts +129 -0
- package/dist/src/utils/artifact-renderer.js +400 -0
- package/dist/src/utils/artifact-renderer.js.map +1 -0
- package/dist/src/utils/artifact-request.d.ts +16 -0
- package/dist/src/utils/artifact-request.js +42 -0
- package/dist/src/utils/artifact-request.js.map +1 -0
- package/dist/src/utils/artifact-sources.d.ts +8 -0
- package/dist/src/utils/artifact-sources.js +10 -0
- package/dist/src/utils/artifact-sources.js.map +1 -0
- package/dist/src/utils/aw-home-mutation-lock.d.ts +11 -0
- package/dist/src/utils/aw-home-mutation-lock.js +83 -0
- package/dist/src/utils/aw-home-mutation-lock.js.map +1 -0
- package/dist/src/utils/bundle-integrity.d.ts +2 -0
- package/dist/src/utils/bundle-integrity.js +63 -0
- package/dist/src/utils/bundle-integrity.js.map +1 -0
- package/dist/src/utils/bundle-layout.d.ts +4 -0
- package/dist/src/utils/bundle-layout.js +531 -0
- package/dist/src/utils/bundle-layout.js.map +1 -0
- package/dist/src/utils/catalog-digests.d.ts +18 -0
- package/dist/src/utils/catalog-digests.js +156 -0
- package/dist/src/utils/catalog-digests.js.map +1 -0
- package/dist/src/utils/catalog-generation-control-snapshot.d.ts +11 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js +45 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js.map +1 -0
- package/dist/src/utils/catalog-generation-error.d.ts +16 -0
- package/dist/src/utils/catalog-generation-error.js +30 -0
- package/dist/src/utils/catalog-generation-error.js.map +1 -0
- package/dist/src/utils/catalog-generation-resolver.d.ts +32 -0
- package/dist/src/utils/catalog-generation-resolver.js +251 -0
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -0
- package/dist/src/utils/catalog-generation-service.d.ts +161 -0
- package/dist/src/utils/catalog-generation-service.js +1237 -0
- package/dist/src/utils/catalog-generation-service.js.map +1 -0
- package/dist/src/utils/catalog-generation-state.d.ts +22 -0
- package/dist/src/utils/catalog-generation-state.js +192 -0
- package/dist/src/utils/catalog-generation-state.js.map +1 -0
- package/dist/src/utils/catalog-generation-store.d.ts +57 -0
- package/dist/src/utils/catalog-generation-store.js +397 -0
- package/dist/src/utils/catalog-generation-store.js.map +1 -0
- package/dist/src/utils/catalog-manifest-v7.d.ts +5 -0
- package/dist/src/utils/catalog-manifest-v7.js +98 -0
- package/dist/src/utils/catalog-manifest-v7.js.map +1 -0
- package/dist/src/utils/catalog-operation-context.d.ts +20 -0
- package/dist/src/utils/catalog-operation-context.js +141 -0
- package/dist/src/utils/catalog-operation-context.js.map +1 -0
- package/dist/src/utils/catalog-public-error.d.ts +19 -0
- package/dist/src/utils/catalog-public-error.js +100 -0
- package/dist/src/utils/catalog-public-error.js.map +1 -0
- package/dist/src/utils/catalog-runtime-projection.d.ts +33 -0
- package/dist/src/utils/catalog-runtime-projection.js +77 -0
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -0
- package/dist/src/utils/catalog-snapshot.d.ts +10 -0
- package/dist/src/utils/catalog-snapshot.js +20 -0
- package/dist/src/utils/catalog-snapshot.js.map +1 -0
- package/dist/src/utils/catalog-source-identity.d.ts +5 -0
- package/dist/src/utils/catalog-source-identity.js +137 -0
- package/dist/src/utils/catalog-source-identity.js.map +1 -0
- package/dist/src/utils/catalog-source-impact.d.ts +20 -0
- package/dist/src/utils/catalog-source-impact.js +222 -0
- package/dist/src/utils/catalog-source-impact.js.map +1 -0
- package/dist/src/utils/catalog-source-presentation.d.ts +1 -0
- package/dist/src/utils/catalog-source-presentation.js +32 -0
- package/dist/src/utils/catalog-source-presentation.js.map +1 -0
- package/dist/src/utils/catalog-source-references.d.ts +66 -0
- package/dist/src/utils/catalog-source-references.js +1180 -0
- package/dist/src/utils/catalog-source-references.js.map +1 -0
- package/dist/src/utils/catalog-sources.d.ts +53 -0
- package/dist/src/utils/catalog-sources.js +456 -0
- package/dist/src/utils/catalog-sources.js.map +1 -0
- package/dist/src/utils/codex-config.d.ts +126 -0
- package/dist/src/utils/codex-config.js +1032 -0
- package/dist/src/utils/codex-config.js.map +1 -0
- package/dist/src/utils/codex-manager.d.ts +81 -0
- package/dist/src/utils/codex-manager.js +810 -0
- package/dist/src/utils/codex-manager.js.map +1 -0
- package/dist/src/utils/codex-marketplace-path.d.ts +5 -0
- package/dist/src/utils/codex-marketplace-path.js +45 -0
- package/dist/src/utils/codex-marketplace-path.js.map +1 -0
- package/dist/src/utils/codex-native-observation.d.ts +16 -0
- package/dist/src/utils/codex-native-observation.js +22 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -0
- package/dist/src/utils/codex-native-render-receipt.d.ts +40 -0
- package/dist/src/utils/codex-native-render-receipt.js +205 -0
- package/dist/src/utils/codex-native-render-receipt.js.map +1 -0
- package/dist/src/utils/codex-reconciler.d.ts +128 -0
- package/dist/src/utils/codex-reconciler.js +294 -0
- package/dist/src/utils/codex-reconciler.js.map +1 -0
- package/dist/src/utils/codex-roles.d.ts +71 -0
- package/dist/src/utils/codex-roles.js +257 -0
- package/dist/src/utils/codex-roles.js.map +1 -0
- package/dist/src/utils/codex-shared-native.d.ts +63 -0
- package/dist/src/utils/codex-shared-native.js +142 -0
- package/dist/src/utils/codex-shared-native.js.map +1 -0
- package/dist/src/utils/codex-skill-staging.d.ts +11 -0
- package/dist/src/utils/codex-skill-staging.js +8 -0
- package/dist/src/utils/codex-skill-staging.js.map +1 -0
- package/dist/src/utils/codex-surface-analysis.d.ts +45 -0
- package/dist/src/utils/codex-surface-analysis.js +245 -0
- package/dist/src/utils/codex-surface-analysis.js.map +1 -0
- package/dist/src/utils/config-value.d.ts +3 -0
- package/dist/src/utils/config-value.js +23 -0
- package/dist/src/utils/config-value.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +36 -0
- package/dist/src/utils/dynamic-skill-tree.js +466 -0
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -0
- package/dist/src/utils/file-rules.d.ts +1 -0
- package/dist/src/utils/file-rules.js +2 -0
- package/dist/src/utils/file-rules.js.map +1 -0
- package/dist/src/utils/git-catalog-provider.d.ts +22 -0
- package/dist/src/utils/git-catalog-provider.js +497 -0
- package/dist/src/utils/git-catalog-provider.js.map +1 -0
- package/dist/src/utils/hooks-contract.d.ts +1 -0
- package/dist/src/utils/hooks-contract.js +2 -0
- package/dist/src/utils/hooks-contract.js.map +1 -0
- package/dist/src/utils/json.d.ts +4 -0
- package/dist/src/utils/json.js +29 -0
- package/dist/src/utils/json.js.map +1 -0
- package/dist/src/utils/local-marketplace.d.ts +41 -0
- package/dist/src/utils/local-marketplace.js +316 -0
- package/dist/src/utils/local-marketplace.js.map +1 -0
- package/dist/src/utils/manifest.d.ts +11 -0
- package/dist/src/utils/manifest.js +33 -0
- package/dist/src/utils/manifest.js.map +1 -0
- package/dist/src/utils/marketplace.d.ts +3 -0
- package/dist/src/utils/marketplace.js +76 -0
- package/dist/src/utils/marketplace.js.map +1 -0
- package/dist/src/utils/multi-source-catalog.d.ts +66 -0
- package/dist/src/utils/multi-source-catalog.js +345 -0
- package/dist/src/utils/multi-source-catalog.js.map +1 -0
- package/dist/src/utils/native-cli.d.ts +118 -0
- package/dist/src/utils/native-cli.js +518 -0
- package/dist/src/utils/native-cli.js.map +1 -0
- package/dist/src/utils/orphan-marketplace-cleanup.d.ts +18 -0
- package/dist/src/utils/orphan-marketplace-cleanup.js +198 -0
- package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -0
- package/dist/src/utils/ownership.d.ts +194 -0
- package/dist/src/utils/ownership.js +723 -0
- package/dist/src/utils/ownership.js.map +1 -0
- package/dist/src/utils/path-catalog-provider.d.ts +7 -0
- package/dist/src/utils/path-catalog-provider.js +74 -0
- package/dist/src/utils/path-catalog-provider.js.map +1 -0
- package/dist/src/utils/paths.d.ts +40 -0
- package/dist/src/utils/paths.js +137 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/platform-entries.d.ts +1 -0
- package/dist/src/utils/platform-entries.js +2 -0
- package/dist/src/utils/platform-entries.js.map +1 -0
- package/dist/src/utils/platform-support.d.ts +1 -0
- package/dist/src/utils/platform-support.js +2 -0
- package/dist/src/utils/platform-support.js.map +1 -0
- package/dist/src/utils/plugin-config-write.d.ts +110 -0
- package/dist/src/utils/plugin-config-write.js +773 -0
- package/dist/src/utils/plugin-config-write.js.map +1 -0
- package/dist/src/utils/plugin-config.d.ts +389 -0
- package/dist/src/utils/plugin-config.js +1642 -0
- package/dist/src/utils/plugin-config.js.map +1 -0
- package/dist/src/utils/plugin-dependencies.d.ts +12 -0
- package/dist/src/utils/plugin-dependencies.js +162 -0
- package/dist/src/utils/plugin-dependencies.js.map +1 -0
- package/dist/src/utils/plugin-intent-state.d.ts +34 -0
- package/dist/src/utils/plugin-intent-state.js +289 -0
- package/dist/src/utils/plugin-intent-state.js.map +1 -0
- package/dist/src/utils/plugin-script-contract.d.ts +1 -0
- package/dist/src/utils/plugin-script-contract.js +2 -0
- package/dist/src/utils/plugin-script-contract.js.map +1 -0
- package/dist/src/utils/plugin-scripts.d.ts +101 -0
- package/dist/src/utils/plugin-scripts.js +253 -0
- package/dist/src/utils/plugin-scripts.js.map +1 -0
- package/dist/src/utils/process-lock.d.ts +47 -0
- package/dist/src/utils/process-lock.js +532 -0
- package/dist/src/utils/process-lock.js.map +1 -0
- package/dist/src/utils/process-tree.d.ts +2 -0
- package/dist/src/utils/process-tree.js +2 -0
- package/dist/src/utils/process-tree.js.map +1 -0
- package/dist/src/utils/project-boundary.d.ts +9 -0
- package/dist/src/utils/project-boundary.js +67 -0
- package/dist/src/utils/project-boundary.js.map +1 -0
- package/dist/src/utils/rendered-contract.d.ts +8 -0
- package/dist/src/utils/rendered-contract.js +134 -0
- package/dist/src/utils/rendered-contract.js.map +1 -0
- package/dist/src/utils/runtime-skill-closure.d.ts +13 -0
- package/dist/src/utils/runtime-skill-closure.js +863 -0
- package/dist/src/utils/runtime-skill-closure.js.map +1 -0
- package/dist/src/utils/safe-fs.d.ts +21 -0
- package/dist/src/utils/safe-fs.js +111 -0
- package/dist/src/utils/safe-fs.js.map +1 -0
- package/dist/src/utils/skill-authoring.d.ts +1 -0
- package/dist/src/utils/skill-authoring.js +2 -0
- package/dist/src/utils/skill-authoring.js.map +1 -0
- package/dist/src/utils/skill-validation.d.ts +37 -0
- package/dist/src/utils/skill-validation.js +326 -0
- package/dist/src/utils/skill-validation.js.map +1 -0
- package/dist/src/utils/slash-commands.d.ts +1 -0
- package/dist/src/utils/slash-commands.js +2 -0
- package/dist/src/utils/slash-commands.js.map +1 -0
- package/dist/src/utils/state-paths.d.ts +14 -0
- package/dist/src/utils/state-paths.js +139 -0
- package/dist/src/utils/state-paths.js.map +1 -0
- package/dist/src/utils/target-eligibility.d.ts +13 -0
- package/dist/src/utils/target-eligibility.js +35 -0
- package/dist/src/utils/target-eligibility.js.map +1 -0
- package/dist/src/utils/target-order.d.ts +7 -0
- package/dist/src/utils/target-order.js +10 -0
- package/dist/src/utils/target-order.js.map +1 -0
- package/dist/src/utils/template-engine.d.ts +1 -0
- package/dist/src/utils/template-engine.js +2 -0
- package/dist/src/utils/template-engine.js.map +1 -0
- package/dist/src/utils/test-path-fence.d.ts +12 -0
- package/dist/src/utils/test-path-fence.js +31 -0
- package/dist/src/utils/test-path-fence.js.map +1 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +16 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
import { stablePluginConfigStringify } from '@lesliechan721/aw-plugin-core/manifest';
|
|
2
|
+
import { statusCommandV7, statusTargetIntent, } from '../commands/status-v6.js';
|
|
3
|
+
import { syncWriteCommand } from '../commands/write-commands.js';
|
|
4
|
+
import { CONFIG_MUTATION_RECEIPT_SCHEMA_VERSION, } from '../types.js';
|
|
5
|
+
import { getDefaultNativeCliRunner } from './native-cli.js';
|
|
6
|
+
import { assertReadyPluginConfigStore, assertSafePluginConfigSegment, codexNativeRefreshKeys, coercePluginConfigUpdates, patchPluginConfigStore, readPluginConfigStore, readNamespacedPluginConfigStoreIdentity, resetPluginConfigStore, resolveConfigRead, resolveEffectivePluginConfig, resolvePluginConfigStorePath, resolvePluginConfigSchemaAccess, summarizeEffectivePluginConfig, } from './plugin-config.js';
|
|
7
|
+
import { collectSensitivePluginConfigValues, redactPluginScriptOutput, } from './plugin-scripts.js';
|
|
8
|
+
import { resolveClaudeProjectKey, resolveCodexProjectKey } from './paths.js';
|
|
9
|
+
import { withAwHomeMutationLock, } from './aw-home-mutation-lock.js';
|
|
10
|
+
export function buildConfigMutationReceipt(command, receipt) {
|
|
11
|
+
return {
|
|
12
|
+
...receipt,
|
|
13
|
+
receiptSchemaVersion: CONFIG_MUTATION_RECEIPT_SCHEMA_VERSION,
|
|
14
|
+
command,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function uniqueInOrder(values) {
|
|
18
|
+
return [...new Set(values)];
|
|
19
|
+
}
|
|
20
|
+
function collectRemovedConfigKeys(values) {
|
|
21
|
+
return uniqueInOrder(Object.keys(values));
|
|
22
|
+
}
|
|
23
|
+
function targetKey(target) {
|
|
24
|
+
return `${target.platform}:${target.scope}:${target.projectKey ?? '-'}`;
|
|
25
|
+
}
|
|
26
|
+
function dedupeTargets(targets) {
|
|
27
|
+
const deduped = new Map();
|
|
28
|
+
for (const target of targets)
|
|
29
|
+
deduped.set(targetKey(target), target);
|
|
30
|
+
return [...deduped.values()];
|
|
31
|
+
}
|
|
32
|
+
async function resolveProjectKey(platform, cwd) {
|
|
33
|
+
return platform === 'codex'
|
|
34
|
+
? resolveCodexProjectKey(cwd)
|
|
35
|
+
: resolveClaudeProjectKey(cwd);
|
|
36
|
+
}
|
|
37
|
+
async function createCandidateTarget(options) {
|
|
38
|
+
return {
|
|
39
|
+
pluginName: options.pluginName,
|
|
40
|
+
platform: options.platform,
|
|
41
|
+
scope: options.scope,
|
|
42
|
+
...(options.scope === 'project'
|
|
43
|
+
? { projectKey: await resolveProjectKey(options.platform, options.cwd) }
|
|
44
|
+
: {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function discoverVisibleTargets(options) {
|
|
48
|
+
const targets = [];
|
|
49
|
+
const failures = [];
|
|
50
|
+
const selector = options.plugin.pluginId ?? options.pluginName;
|
|
51
|
+
const status = await statusCommandV7({
|
|
52
|
+
plugins: [selector],
|
|
53
|
+
cwd: options.cwd,
|
|
54
|
+
env: options.env,
|
|
55
|
+
nativeCliRunner: options.nativeCliRunner,
|
|
56
|
+
...(options.scope === 'project' ? { scope: 'project' } : {}),
|
|
57
|
+
...(options.rebuildRuntime?.catalogOperationContext
|
|
58
|
+
? { catalogOperationContext: options.rebuildRuntime.catalogOperationContext }
|
|
59
|
+
: {}),
|
|
60
|
+
});
|
|
61
|
+
for (const statusTarget of status.payload.targets) {
|
|
62
|
+
const intent = statusTargetIntent(statusTarget);
|
|
63
|
+
if ((statusTarget.pluginId !== selector && statusTarget.pluginName !== options.pluginName)
|
|
64
|
+
|| !intent.enabled)
|
|
65
|
+
continue;
|
|
66
|
+
for (const scope of intent.scopes) {
|
|
67
|
+
if (options.scope === 'project' && scope !== 'project')
|
|
68
|
+
continue;
|
|
69
|
+
targets.push(await createCandidateTarget({
|
|
70
|
+
pluginName: options.pluginName,
|
|
71
|
+
platform: statusTarget.platform,
|
|
72
|
+
scope,
|
|
73
|
+
cwd: options.cwd,
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { targets: dedupeTargets(targets), failures };
|
|
78
|
+
}
|
|
79
|
+
async function reinstallVisibleTargets(options) {
|
|
80
|
+
const nativeCliRunner = options.nativeCliRunner ?? getDefaultNativeCliRunner();
|
|
81
|
+
const discovered = options.discovered ?? (options.applyTargets === undefined
|
|
82
|
+
? await discoverVisibleTargets({
|
|
83
|
+
pluginName: options.plugin.manifest.name,
|
|
84
|
+
plugin: options.plugin,
|
|
85
|
+
scope: options.scope,
|
|
86
|
+
cwd: options.cwd,
|
|
87
|
+
env: options.env,
|
|
88
|
+
nativeCliRunner,
|
|
89
|
+
rebuildRuntime: options.rebuildRuntime,
|
|
90
|
+
})
|
|
91
|
+
: { targets: dedupeTargets(options.applyTargets), failures: [] });
|
|
92
|
+
const targetResults = [...discovered.failures];
|
|
93
|
+
let runtimeFailed = discovered.failures.length > 0;
|
|
94
|
+
const reinstall = options.reinstallCommandImpl ?? syncWriteCommand;
|
|
95
|
+
if (options.plugin.sourceId && !options.plugin.pluginId) {
|
|
96
|
+
throw new Error(`Plugin "${options.plugin.manifest.name}" is missing its namespaced plugin ID.`);
|
|
97
|
+
}
|
|
98
|
+
const selector = options.plugin.sourceId
|
|
99
|
+
? options.plugin.pluginId
|
|
100
|
+
: options.plugin.manifest.name;
|
|
101
|
+
const sanitizeFailure = async (message, target) => {
|
|
102
|
+
let sensitiveValues = [];
|
|
103
|
+
try {
|
|
104
|
+
const effective = await resolveEffectivePluginConfig({
|
|
105
|
+
...(options.plugin.sourceId ? {
|
|
106
|
+
sourceId: options.plugin.sourceId,
|
|
107
|
+
sourceIdentity: options.plugin.sourceIdentity,
|
|
108
|
+
} : {}),
|
|
109
|
+
pluginName: options.plugin.manifest.name,
|
|
110
|
+
manifest: options.plugin.manifest,
|
|
111
|
+
targetScope: target.scope,
|
|
112
|
+
cwd: options.cwd,
|
|
113
|
+
env: options.env,
|
|
114
|
+
});
|
|
115
|
+
sensitiveValues = collectSensitivePluginConfigValues(options.plugin.manifest, effective.values);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// Generic credential redaction and known config paths still apply.
|
|
119
|
+
}
|
|
120
|
+
let sanitized = redactPluginScriptOutput(message, sensitiveValues);
|
|
121
|
+
for (const scope of ['user', 'project']) {
|
|
122
|
+
const configPath = resolvePluginConfigStorePath({
|
|
123
|
+
sourceId: options.plugin.sourceId,
|
|
124
|
+
pluginName: options.plugin.manifest.name,
|
|
125
|
+
scope,
|
|
126
|
+
cwd: options.cwd,
|
|
127
|
+
env: options.env,
|
|
128
|
+
});
|
|
129
|
+
const safeTarget = `${scope}/plugin-config/${[
|
|
130
|
+
options.plugin.sourceId,
|
|
131
|
+
options.plugin.manifest.name,
|
|
132
|
+
'config.json',
|
|
133
|
+
].filter(Boolean).join('/')}`;
|
|
134
|
+
sanitized = sanitized.split(configPath).join(safeTarget);
|
|
135
|
+
}
|
|
136
|
+
return sanitized;
|
|
137
|
+
};
|
|
138
|
+
const sanitizeProjection = async (value, target, freeText = false) => {
|
|
139
|
+
if (typeof value === 'string')
|
|
140
|
+
return freeText ? sanitizeFailure(value, target) : value;
|
|
141
|
+
if (value === null || typeof value !== 'object')
|
|
142
|
+
return value;
|
|
143
|
+
if (Array.isArray(value)) {
|
|
144
|
+
return Promise.all(value.map((entry) => sanitizeProjection(entry, target, freeText)));
|
|
145
|
+
}
|
|
146
|
+
return Object.fromEntries(await Promise.all(Object.entries(value).map(async ([key, entry]) => [
|
|
147
|
+
key,
|
|
148
|
+
await sanitizeProjection(entry, target, typeof entry === 'string'
|
|
149
|
+
? /^(?:message|error|stack|stdout|stderr|output|warning)$/u.test(key)
|
|
150
|
+
: Array.isArray(entry) && /^(?:messages|warnings)$/u.test(key)),
|
|
151
|
+
])));
|
|
152
|
+
};
|
|
153
|
+
for (const target of discovered.targets) {
|
|
154
|
+
try {
|
|
155
|
+
const debugLogger = options.rebuildRuntime?.debugLogger;
|
|
156
|
+
const reporter = options.rebuildRuntime?.reporter;
|
|
157
|
+
const result = await reinstall([selector], {
|
|
158
|
+
cwd: options.cwd,
|
|
159
|
+
platform: target.platform,
|
|
160
|
+
scope: target.scope,
|
|
161
|
+
}, {
|
|
162
|
+
...options.rebuildRuntime,
|
|
163
|
+
env: options.env,
|
|
164
|
+
nativeCliRunner,
|
|
165
|
+
...(debugLogger ? {
|
|
166
|
+
debugLogger: {
|
|
167
|
+
...debugLogger,
|
|
168
|
+
log: async (value) => debugLogger.log(await sanitizeProjection(value, target)),
|
|
169
|
+
},
|
|
170
|
+
} : {}),
|
|
171
|
+
...(reporter ? {
|
|
172
|
+
reporter: {
|
|
173
|
+
event: async (value) => reporter.event(await sanitizeProjection(value, target)),
|
|
174
|
+
notice: async (value) => reporter.notice(await sanitizeProjection(value, target)),
|
|
175
|
+
},
|
|
176
|
+
} : {}),
|
|
177
|
+
});
|
|
178
|
+
if (result.overallState === 'failed')
|
|
179
|
+
runtimeFailed = true;
|
|
180
|
+
targetResults.push(...await Promise.all(result.targetResults.map(async (entry) => ({
|
|
181
|
+
...entry,
|
|
182
|
+
...(entry.message ? { message: await sanitizeFailure(entry.message, entry.target) } : {}),
|
|
183
|
+
}))));
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
runtimeFailed = true;
|
|
187
|
+
const message = await sanitizeFailure(error instanceof Error ? error.message : String(error), target);
|
|
188
|
+
targetResults.push({
|
|
189
|
+
target,
|
|
190
|
+
action: 'reinstall',
|
|
191
|
+
state: 'failed',
|
|
192
|
+
message,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const overallState = runtimeFailed || targetResults.some((entry) => entry.state === 'failed')
|
|
197
|
+
? 'partial' : 'succeeded';
|
|
198
|
+
return {
|
|
199
|
+
overallState,
|
|
200
|
+
targetResults,
|
|
201
|
+
...(discovered.targets.length === 0 && discovered.failures.length === 0
|
|
202
|
+
? { applySkippedReason: 'noVisibleTarget' }
|
|
203
|
+
: {}),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
async function resolveConfigApplyTargets(options) {
|
|
207
|
+
if (options.applyTargets !== undefined) {
|
|
208
|
+
return { targets: dedupeTargets(options.applyTargets), failures: [] };
|
|
209
|
+
}
|
|
210
|
+
return discoverVisibleTargets({
|
|
211
|
+
pluginName: options.plugin.manifest.name,
|
|
212
|
+
plugin: options.plugin,
|
|
213
|
+
scope: options.scope,
|
|
214
|
+
cwd: options.cwd,
|
|
215
|
+
env: options.env,
|
|
216
|
+
nativeCliRunner: options.nativeCliRunner ?? getDefaultNativeCliRunner(),
|
|
217
|
+
rebuildRuntime: options.rebuildRuntime,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
async function configApplyHasIssues(options) {
|
|
221
|
+
const scopes = [...new Set(options.targets.map((target) => target.scope))];
|
|
222
|
+
for (const scope of scopes) {
|
|
223
|
+
if (options.knownValidScopes?.includes(scope))
|
|
224
|
+
continue;
|
|
225
|
+
const effective = await resolveEffectivePluginConfig({
|
|
226
|
+
...(options.plugin.sourceId ? {
|
|
227
|
+
sourceId: options.plugin.sourceId,
|
|
228
|
+
sourceIdentity: options.plugin.sourceIdentity,
|
|
229
|
+
} : {}),
|
|
230
|
+
pluginName: options.plugin.manifest.name,
|
|
231
|
+
manifest: options.plugin.manifest,
|
|
232
|
+
targetScope: scope,
|
|
233
|
+
cwd: options.cwd,
|
|
234
|
+
env: options.env,
|
|
235
|
+
});
|
|
236
|
+
if (effective.issues.length > 0)
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
function otherProjectsWarning(scope) {
|
|
242
|
+
return scope === 'user'
|
|
243
|
+
? ['其它项目不会由本次命令扫描或更新。请在每个项目目录中运行对应的 aw reinstall 命令。']
|
|
244
|
+
: [];
|
|
245
|
+
}
|
|
246
|
+
function buildReceiptFieldEntry(options) {
|
|
247
|
+
return {
|
|
248
|
+
key: options.key,
|
|
249
|
+
title: options.title,
|
|
250
|
+
kind: options.kind,
|
|
251
|
+
reserved: options.reserved,
|
|
252
|
+
action: options.action,
|
|
253
|
+
scope: options.scope,
|
|
254
|
+
...(options.valueState ? { valueState: options.valueState } : {}),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
export async function replayConfigRuntimeWrites(options) {
|
|
258
|
+
return withAwHomeMutationLock({
|
|
259
|
+
env: options.env,
|
|
260
|
+
token: options.awHomeMutationToken,
|
|
261
|
+
action: async (awHomeMutationToken) => {
|
|
262
|
+
const env = options.env ?? process.env;
|
|
263
|
+
const rebuildRuntime = { ...options.rebuildRuntime, awHomeMutationToken };
|
|
264
|
+
const discovered = await resolveConfigApplyTargets({
|
|
265
|
+
plugin: options.plugin,
|
|
266
|
+
scope: options.scope,
|
|
267
|
+
cwd: options.cwd,
|
|
268
|
+
env,
|
|
269
|
+
applyTargets: options.applyTargets,
|
|
270
|
+
nativeCliRunner: options.nativeCliRunner,
|
|
271
|
+
rebuildRuntime,
|
|
272
|
+
});
|
|
273
|
+
const applied = await configApplyHasIssues({
|
|
274
|
+
plugin: options.plugin,
|
|
275
|
+
targets: discovered.targets,
|
|
276
|
+
cwd: options.cwd,
|
|
277
|
+
env,
|
|
278
|
+
}) ? {
|
|
279
|
+
overallState: 'partial',
|
|
280
|
+
targetResults: [],
|
|
281
|
+
applySkippedReason: 'invalidConfig',
|
|
282
|
+
} : await reinstallVisibleTargets({
|
|
283
|
+
plugin: options.plugin,
|
|
284
|
+
scope: options.scope,
|
|
285
|
+
cwd: options.cwd,
|
|
286
|
+
env,
|
|
287
|
+
applyTargets: options.applyTargets,
|
|
288
|
+
nativeCliRunner: options.nativeCliRunner,
|
|
289
|
+
reinstallCommandImpl: options.reinstallCommandImpl,
|
|
290
|
+
rebuildRuntime,
|
|
291
|
+
discovered,
|
|
292
|
+
});
|
|
293
|
+
return {
|
|
294
|
+
configWrite: 'succeeded',
|
|
295
|
+
overallState: applied.overallState,
|
|
296
|
+
targetResults: applied.targetResults,
|
|
297
|
+
...(applied.applySkippedReason ? { applySkippedReason: applied.applySkippedReason } : {}),
|
|
298
|
+
otherProjectsRequireReinstall: options.scope === 'user',
|
|
299
|
+
};
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
function changedKeysAffectSharedNativeTarget(options) {
|
|
304
|
+
const changedKeys = new Set(options.changedKeys);
|
|
305
|
+
return (options.plugin.manifest.artifacts?.targets ?? []).some((target) => target.platform === 'codex'
|
|
306
|
+
&& target.target === 'codex.skill'
|
|
307
|
+
&& target.delivery?.mode === 'codex-native'
|
|
308
|
+
&& target.refreshKeys.some((key) => changedKeys.has(key)));
|
|
309
|
+
}
|
|
310
|
+
async function applyPluginConfigWriteUnlocked(options) {
|
|
311
|
+
const requestedPluginName = options.pluginName ?? options.plugin?.manifest.name;
|
|
312
|
+
if (!requestedPluginName)
|
|
313
|
+
throw new Error('Plugin name is required for config write.');
|
|
314
|
+
const pluginName = assertSafePluginConfigSegment(requestedPluginName);
|
|
315
|
+
const configIdentity = options.plugin?.sourceId ? {
|
|
316
|
+
sourceId: options.plugin.sourceId,
|
|
317
|
+
sourceIdentity: options.plugin.sourceIdentity,
|
|
318
|
+
} : {};
|
|
319
|
+
const requestedUpdates = options.request.updates ?? {};
|
|
320
|
+
const requestedRemoveKeys = uniqueInOrder(options.request.removeKeys ?? []);
|
|
321
|
+
const duplicateKeys = requestedRemoveKeys.filter((key) => Object.hasOwn(requestedUpdates, key));
|
|
322
|
+
if (duplicateKeys.length > 0) {
|
|
323
|
+
throw new Error(`Config write cannot update and remove the same key: ${duplicateKeys.join(', ')}.`);
|
|
324
|
+
}
|
|
325
|
+
const schemaAccess = await resolvePluginConfigSchemaAccess({
|
|
326
|
+
pluginName,
|
|
327
|
+
currentPlugin: options.plugin,
|
|
328
|
+
currentPluginError: options.pluginError,
|
|
329
|
+
scope: options.scope,
|
|
330
|
+
cwd: options.cwd,
|
|
331
|
+
env: options.env,
|
|
332
|
+
});
|
|
333
|
+
const schemaPlugin = schemaAccess.plugin;
|
|
334
|
+
const schema = schemaPlugin?.manifest.config?.fields;
|
|
335
|
+
if (!schema || !schemaPlugin) {
|
|
336
|
+
throw new Error(`configSchemaUnavailable: Plugin "${pluginName}" does not declare an AW config schema.`);
|
|
337
|
+
}
|
|
338
|
+
if (options.scope === 'project') {
|
|
339
|
+
const userStore = await readPluginConfigStore({
|
|
340
|
+
...configIdentity,
|
|
341
|
+
pluginName,
|
|
342
|
+
scope: 'user',
|
|
343
|
+
cwd: options.cwd,
|
|
344
|
+
env: options.env,
|
|
345
|
+
schema,
|
|
346
|
+
});
|
|
347
|
+
assertReadyPluginConfigStore(userStore);
|
|
348
|
+
}
|
|
349
|
+
for (const key of requestedRemoveKeys) {
|
|
350
|
+
if (!schema[key])
|
|
351
|
+
throw new Error(`Unknown config key "${key}".`);
|
|
352
|
+
}
|
|
353
|
+
if (options.scope === 'project') {
|
|
354
|
+
const userOnlyKeys = codexNativeRefreshKeys(schemaPlugin.manifest);
|
|
355
|
+
const rejectedKeys = Object.keys(requestedUpdates).filter((key) => userOnlyKeys.has(key));
|
|
356
|
+
if (rejectedKeys.length > 0) {
|
|
357
|
+
const error = new Error(`sharedNativeConfigUserScopeRequired: Codex native Skill refresh keys can only be set in user scope: ${rejectedKeys.join(', ')}.`);
|
|
358
|
+
error.code = 'sharedNativeConfigUserScopeRequired';
|
|
359
|
+
throw error;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const updates = await coercePluginConfigUpdates({ schema, updates: requestedUpdates, cwd: options.cwd });
|
|
363
|
+
const store = await readPluginConfigStore({
|
|
364
|
+
...configIdentity,
|
|
365
|
+
pluginName,
|
|
366
|
+
scope: options.scope,
|
|
367
|
+
cwd: options.cwd,
|
|
368
|
+
env: options.env,
|
|
369
|
+
schema,
|
|
370
|
+
});
|
|
371
|
+
assertReadyPluginConfigStore(store);
|
|
372
|
+
const warnings = [];
|
|
373
|
+
const removedKeys = requestedRemoveKeys.filter((key) => Object.hasOwn(store.values, key));
|
|
374
|
+
const updatedKeys = Object.entries(updates)
|
|
375
|
+
.filter(([key, value]) => !Object.hasOwn(store.values, key)
|
|
376
|
+
|| stablePluginConfigStringify(store.values[key]) !== stablePluginConfigStringify(value))
|
|
377
|
+
.map(([key]) => key);
|
|
378
|
+
const changedKeys = [...updatedKeys, ...removedKeys];
|
|
379
|
+
let applyTargets = options.applyTargets;
|
|
380
|
+
const sharedNativeAffected = changedKeysAffectSharedNativeTarget({
|
|
381
|
+
plugin: schemaPlugin,
|
|
382
|
+
changedKeys,
|
|
383
|
+
});
|
|
384
|
+
if (options.apply !== false
|
|
385
|
+
&& options.scope === 'user'
|
|
386
|
+
&& options.sharedNativeApplyConfirmed === false
|
|
387
|
+
&& sharedNativeAffected) {
|
|
388
|
+
applyTargets ??= (await discoverVisibleTargets({
|
|
389
|
+
plugin: schemaPlugin,
|
|
390
|
+
pluginName,
|
|
391
|
+
scope: options.scope,
|
|
392
|
+
cwd: options.cwd,
|
|
393
|
+
env: options.env ?? process.env,
|
|
394
|
+
nativeCliRunner: options.nativeCliRunner ?? getDefaultNativeCliRunner(),
|
|
395
|
+
rebuildRuntime: options.rebuildRuntime,
|
|
396
|
+
})).targets;
|
|
397
|
+
if (applyTargets.some((target) => target.platform === 'codex')) {
|
|
398
|
+
const error = new Error('sharedNativeConfigApplyConfirmationRequired: Applying this user config changes a shared Codex native artifact. Re-run with --yes.');
|
|
399
|
+
error.code = 'sharedNativeConfigApplyConfirmationRequired';
|
|
400
|
+
throw error;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
if (changedKeys.length > 0) {
|
|
404
|
+
await patchPluginConfigStore({
|
|
405
|
+
...configIdentity,
|
|
406
|
+
pluginName,
|
|
407
|
+
scope: options.scope,
|
|
408
|
+
cwd: options.cwd,
|
|
409
|
+
env: options.env,
|
|
410
|
+
updates: Object.fromEntries(updatedKeys.map((key) => [key, updates[key]])),
|
|
411
|
+
removeKeys: requestedRemoveKeys,
|
|
412
|
+
schema,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
const effective = summarizeEffectivePluginConfig(await resolveEffectivePluginConfig({
|
|
416
|
+
...configIdentity,
|
|
417
|
+
pluginName,
|
|
418
|
+
manifest: schemaPlugin.manifest,
|
|
419
|
+
targetScope: options.scope,
|
|
420
|
+
cwd: options.cwd,
|
|
421
|
+
env: options.env,
|
|
422
|
+
}));
|
|
423
|
+
let applied;
|
|
424
|
+
if (changedKeys.length === 0) {
|
|
425
|
+
applied = {
|
|
426
|
+
overallState: 'succeeded',
|
|
427
|
+
targetResults: [],
|
|
428
|
+
applySkippedReason: 'noConfigChange',
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
else if (effective.issues.length > 0) {
|
|
432
|
+
applied = {
|
|
433
|
+
overallState: 'partial',
|
|
434
|
+
targetResults: [],
|
|
435
|
+
applySkippedReason: 'invalidConfig',
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
else if (options.apply === false) {
|
|
439
|
+
applied = {
|
|
440
|
+
overallState: 'succeeded',
|
|
441
|
+
targetResults: [],
|
|
442
|
+
applySkippedReason: 'notRequested',
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
const discovered = await resolveConfigApplyTargets({
|
|
447
|
+
plugin: schemaPlugin,
|
|
448
|
+
scope: options.scope,
|
|
449
|
+
cwd: options.cwd,
|
|
450
|
+
env: options.env ?? process.env,
|
|
451
|
+
applyTargets: options.applyTargets,
|
|
452
|
+
nativeCliRunner: options.nativeCliRunner,
|
|
453
|
+
rebuildRuntime: options.rebuildRuntime,
|
|
454
|
+
});
|
|
455
|
+
applied = await configApplyHasIssues({
|
|
456
|
+
plugin: schemaPlugin,
|
|
457
|
+
targets: discovered.targets,
|
|
458
|
+
cwd: options.cwd,
|
|
459
|
+
env: options.env,
|
|
460
|
+
knownValidScopes: [options.scope],
|
|
461
|
+
}) ? {
|
|
462
|
+
overallState: 'partial',
|
|
463
|
+
targetResults: [],
|
|
464
|
+
applySkippedReason: 'invalidConfig',
|
|
465
|
+
} : await reinstallVisibleTargets({
|
|
466
|
+
plugin: schemaPlugin,
|
|
467
|
+
scope: options.scope,
|
|
468
|
+
cwd: options.cwd,
|
|
469
|
+
env: options.env ?? process.env,
|
|
470
|
+
applyTargets,
|
|
471
|
+
nativeCliRunner: options.nativeCliRunner,
|
|
472
|
+
reinstallCommandImpl: options.reinstallCommandImpl,
|
|
473
|
+
rebuildRuntime: options.rebuildRuntime,
|
|
474
|
+
discovered,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
const otherProjectsRequireReinstall = options.scope === 'user'
|
|
478
|
+
&& changedKeys.length > 0
|
|
479
|
+
&& effective.issues.length === 0
|
|
480
|
+
&& applied.applySkippedReason !== 'invalidConfig';
|
|
481
|
+
if (otherProjectsRequireReinstall)
|
|
482
|
+
warnings.push(...otherProjectsWarning(options.scope));
|
|
483
|
+
return {
|
|
484
|
+
plugin: pluginName,
|
|
485
|
+
scope: options.scope,
|
|
486
|
+
...(schemaAccess.schema ? { schema: schemaAccess.schema } : {}),
|
|
487
|
+
updatedKeys,
|
|
488
|
+
removedKeys,
|
|
489
|
+
effective,
|
|
490
|
+
configWrite: 'succeeded',
|
|
491
|
+
overallState: applied.overallState,
|
|
492
|
+
targetResults: applied.targetResults,
|
|
493
|
+
...(applied.applySkippedReason ? { applySkippedReason: applied.applySkippedReason } : {}),
|
|
494
|
+
otherProjectsRequireReinstall,
|
|
495
|
+
warnings,
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
export async function applyPluginConfigWrite(options) {
|
|
499
|
+
const requestedPluginName = options.pluginName ?? options.plugin?.manifest.name;
|
|
500
|
+
if (!requestedPluginName)
|
|
501
|
+
throw new Error('Plugin name is required for config write.');
|
|
502
|
+
assertSafePluginConfigSegment(requestedPluginName);
|
|
503
|
+
return withAwHomeMutationLock({
|
|
504
|
+
env: options.env,
|
|
505
|
+
token: options.awHomeMutationToken,
|
|
506
|
+
action: async (awHomeMutationToken) => {
|
|
507
|
+
await options.reviewPreflight?.();
|
|
508
|
+
try {
|
|
509
|
+
return await applyPluginConfigWriteUnlocked({
|
|
510
|
+
...options,
|
|
511
|
+
awHomeMutationToken,
|
|
512
|
+
rebuildRuntime: { ...options.rebuildRuntime, awHomeMutationToken },
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
catch (error) {
|
|
516
|
+
let sensitiveValues = options.plugin
|
|
517
|
+
? collectSensitivePluginConfigValues(options.plugin.manifest, (options.request.updates ?? {}))
|
|
518
|
+
: [];
|
|
519
|
+
if (options.plugin) {
|
|
520
|
+
try {
|
|
521
|
+
const effective = await resolveEffectivePluginConfig({
|
|
522
|
+
...(options.plugin.sourceId ? {
|
|
523
|
+
sourceId: options.plugin.sourceId,
|
|
524
|
+
sourceIdentity: options.plugin.sourceIdentity,
|
|
525
|
+
} : {}),
|
|
526
|
+
pluginName: options.plugin.manifest.name,
|
|
527
|
+
manifest: options.plugin.manifest,
|
|
528
|
+
targetScope: options.scope,
|
|
529
|
+
cwd: options.cwd,
|
|
530
|
+
env: options.env,
|
|
531
|
+
});
|
|
532
|
+
sensitiveValues = [
|
|
533
|
+
...sensitiveValues,
|
|
534
|
+
...collectSensitivePluginConfigValues(options.plugin.manifest, effective.values),
|
|
535
|
+
];
|
|
536
|
+
}
|
|
537
|
+
catch {
|
|
538
|
+
// Requested sensitive values and generic credential redaction remain available.
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
let message = redactPluginScriptOutput(error instanceof Error ? error.message : String(error), sensitiveValues);
|
|
542
|
+
for (const scope of ['user', 'project']) {
|
|
543
|
+
const configPath = resolvePluginConfigStorePath({
|
|
544
|
+
sourceId: options.plugin?.sourceId,
|
|
545
|
+
pluginName: requestedPluginName,
|
|
546
|
+
scope,
|
|
547
|
+
cwd: options.cwd,
|
|
548
|
+
env: options.env,
|
|
549
|
+
});
|
|
550
|
+
message = message.split(configPath).join(`${scope}/plugin-config/${[
|
|
551
|
+
options.plugin?.sourceId,
|
|
552
|
+
requestedPluginName,
|
|
553
|
+
'config.json',
|
|
554
|
+
].filter(Boolean).join('/')}`);
|
|
555
|
+
}
|
|
556
|
+
const safeError = new Error(message);
|
|
557
|
+
const code = error.code;
|
|
558
|
+
safeError.code = typeof code === 'string' ? code : 'configApplyFailed';
|
|
559
|
+
throw safeError;
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
async function resetPluginConfigWithHelperUnlocked(options) {
|
|
565
|
+
const pluginName = assertSafePluginConfigSegment(options.pluginName);
|
|
566
|
+
const schemaAccess = options.plugin ? await resolvePluginConfigSchemaAccess({
|
|
567
|
+
pluginName,
|
|
568
|
+
currentPlugin: options.plugin,
|
|
569
|
+
scope: options.scope,
|
|
570
|
+
cwd: options.cwd,
|
|
571
|
+
env: options.env,
|
|
572
|
+
}) : undefined;
|
|
573
|
+
let configIdentity = options.plugin?.sourceId ? {
|
|
574
|
+
sourceId: options.plugin.sourceId,
|
|
575
|
+
sourceIdentity: options.plugin.sourceIdentity,
|
|
576
|
+
} : options.sourceId ? {
|
|
577
|
+
sourceId: options.sourceId,
|
|
578
|
+
sourceIdentity: options.sourceIdentity,
|
|
579
|
+
} : {};
|
|
580
|
+
if (options.sourceId && !options.sourceIdentity) {
|
|
581
|
+
try {
|
|
582
|
+
const identity = await readNamespacedPluginConfigStoreIdentity({
|
|
583
|
+
sourceId: options.sourceId,
|
|
584
|
+
pluginName,
|
|
585
|
+
scope: options.scope,
|
|
586
|
+
cwd: options.cwd,
|
|
587
|
+
env: options.env,
|
|
588
|
+
});
|
|
589
|
+
if (identity)
|
|
590
|
+
configIdentity = {
|
|
591
|
+
sourceId: options.sourceId,
|
|
592
|
+
sourceIdentity: identity.sourceIdentity,
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
catch {
|
|
596
|
+
// Reset does not require a readable or valid envelope.
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
let removedKeys = [];
|
|
600
|
+
try {
|
|
601
|
+
const store = await readPluginConfigStore({
|
|
602
|
+
...configIdentity,
|
|
603
|
+
pluginName,
|
|
604
|
+
scope: options.scope,
|
|
605
|
+
cwd: options.cwd,
|
|
606
|
+
env: options.env,
|
|
607
|
+
});
|
|
608
|
+
removedKeys = collectRemovedConfigKeys(store.values);
|
|
609
|
+
}
|
|
610
|
+
catch {
|
|
611
|
+
// Reset is the final recovery boundary and does not require a readable store.
|
|
612
|
+
}
|
|
613
|
+
const warnings = [];
|
|
614
|
+
const reset = await resetPluginConfigStore({
|
|
615
|
+
...configIdentity,
|
|
616
|
+
pluginName,
|
|
617
|
+
scope: options.scope,
|
|
618
|
+
cwd: options.cwd,
|
|
619
|
+
env: options.env,
|
|
620
|
+
});
|
|
621
|
+
let applied = {
|
|
622
|
+
overallState: 'succeeded',
|
|
623
|
+
targetResults: [],
|
|
624
|
+
applySkippedReason: reset.deleted ? 'notRequested' : 'noConfigChange',
|
|
625
|
+
};
|
|
626
|
+
let effective;
|
|
627
|
+
if (schemaAccess?.plugin) {
|
|
628
|
+
if (schemaAccess.plugin.manifest.config?.fields) {
|
|
629
|
+
try {
|
|
630
|
+
effective = summarizeEffectivePluginConfig(await resolveEffectivePluginConfig({
|
|
631
|
+
...configIdentity,
|
|
632
|
+
pluginName,
|
|
633
|
+
manifest: schemaAccess.plugin.manifest,
|
|
634
|
+
targetScope: options.scope,
|
|
635
|
+
cwd: options.cwd,
|
|
636
|
+
env: options.env,
|
|
637
|
+
}));
|
|
638
|
+
}
|
|
639
|
+
catch {
|
|
640
|
+
if (options.apply !== false) {
|
|
641
|
+
applied = {
|
|
642
|
+
overallState: 'partial',
|
|
643
|
+
targetResults: [],
|
|
644
|
+
applySkippedReason: 'invalidConfig',
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if (reset.deleted && effective && effective.issues.length > 0) {
|
|
650
|
+
applied = {
|
|
651
|
+
overallState: 'partial',
|
|
652
|
+
targetResults: [],
|
|
653
|
+
applySkippedReason: 'invalidConfig',
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
else if (reset.deleted && options.apply !== false && applied.applySkippedReason !== 'invalidConfig') {
|
|
657
|
+
const discovered = await resolveConfigApplyTargets({
|
|
658
|
+
plugin: schemaAccess.plugin,
|
|
659
|
+
scope: options.scope,
|
|
660
|
+
cwd: options.cwd,
|
|
661
|
+
env: options.env ?? process.env,
|
|
662
|
+
applyTargets: options.applyTargets,
|
|
663
|
+
nativeCliRunner: options.nativeCliRunner,
|
|
664
|
+
rebuildRuntime: options.rebuildRuntime,
|
|
665
|
+
});
|
|
666
|
+
applied = await configApplyHasIssues({
|
|
667
|
+
plugin: schemaAccess.plugin,
|
|
668
|
+
targets: discovered.targets,
|
|
669
|
+
cwd: options.cwd,
|
|
670
|
+
env: options.env,
|
|
671
|
+
knownValidScopes: effective ? [options.scope] : undefined,
|
|
672
|
+
}) ? {
|
|
673
|
+
overallState: 'partial',
|
|
674
|
+
targetResults: [],
|
|
675
|
+
applySkippedReason: 'invalidConfig',
|
|
676
|
+
} : await reinstallVisibleTargets({
|
|
677
|
+
plugin: schemaAccess.plugin,
|
|
678
|
+
scope: options.scope,
|
|
679
|
+
cwd: options.cwd,
|
|
680
|
+
env: options.env ?? process.env,
|
|
681
|
+
applyTargets: options.applyTargets,
|
|
682
|
+
nativeCliRunner: options.nativeCliRunner,
|
|
683
|
+
reinstallCommandImpl: options.reinstallCommandImpl,
|
|
684
|
+
rebuildRuntime: options.rebuildRuntime,
|
|
685
|
+
discovered,
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
const otherProjectsRequireReinstall = Boolean(schemaAccess?.plugin)
|
|
690
|
+
&& options.scope === 'user'
|
|
691
|
+
&& reset.deleted
|
|
692
|
+
&& (effective?.issues.length ?? 0) === 0
|
|
693
|
+
&& applied.applySkippedReason !== 'invalidConfig';
|
|
694
|
+
if (otherProjectsRequireReinstall)
|
|
695
|
+
warnings.push(...otherProjectsWarning(options.scope));
|
|
696
|
+
return {
|
|
697
|
+
plugin: pluginName,
|
|
698
|
+
scope: options.scope,
|
|
699
|
+
...(schemaAccess?.schema ? { schema: schemaAccess.schema } : {}),
|
|
700
|
+
existed: reset.existed,
|
|
701
|
+
deleted: reset.deleted,
|
|
702
|
+
resetDisposition: reset.resetDisposition,
|
|
703
|
+
...(reset.quarantineBasename ? { quarantineBasename: reset.quarantineBasename } : {}),
|
|
704
|
+
removedKeys,
|
|
705
|
+
...(effective ? { effective } : {}),
|
|
706
|
+
configWrite: 'succeeded',
|
|
707
|
+
overallState: applied.overallState,
|
|
708
|
+
targetResults: applied.targetResults,
|
|
709
|
+
...(applied.applySkippedReason ? { applySkippedReason: applied.applySkippedReason } : {}),
|
|
710
|
+
otherProjectsRequireReinstall,
|
|
711
|
+
warnings,
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
export async function resetPluginConfigWithHelper(options) {
|
|
715
|
+
assertSafePluginConfigSegment(options.pluginName);
|
|
716
|
+
return withAwHomeMutationLock({
|
|
717
|
+
env: options.env,
|
|
718
|
+
token: options.awHomeMutationToken,
|
|
719
|
+
action: async (awHomeMutationToken) => {
|
|
720
|
+
await options.reviewPreflight?.();
|
|
721
|
+
return resetPluginConfigWithHelperUnlocked({
|
|
722
|
+
...options,
|
|
723
|
+
awHomeMutationToken,
|
|
724
|
+
rebuildRuntime: { ...options.rebuildRuntime, awHomeMutationToken },
|
|
725
|
+
});
|
|
726
|
+
},
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
export async function describeResetAffectedFields(options) {
|
|
730
|
+
try {
|
|
731
|
+
const resolved = await resolveConfigRead({
|
|
732
|
+
pluginName: options.pluginName,
|
|
733
|
+
plugin: options.plugin,
|
|
734
|
+
...(options.pluginError ? { pluginError: options.pluginError } : {}),
|
|
735
|
+
scope: options.scope,
|
|
736
|
+
cwd: options.cwd,
|
|
737
|
+
env: options.env,
|
|
738
|
+
});
|
|
739
|
+
return resolved.fields.map((field) => buildReceiptFieldEntry({
|
|
740
|
+
key: field.key,
|
|
741
|
+
title: field.title,
|
|
742
|
+
kind: field.kind,
|
|
743
|
+
reserved: field.reserved,
|
|
744
|
+
action: 'reset',
|
|
745
|
+
scope: options.scope,
|
|
746
|
+
valueState: field.valueState,
|
|
747
|
+
}));
|
|
748
|
+
}
|
|
749
|
+
catch {
|
|
750
|
+
const store = await readPluginConfigStore({
|
|
751
|
+
...(options.plugin?.sourceId ? {
|
|
752
|
+
sourceId: options.plugin.sourceId,
|
|
753
|
+
sourceIdentity: options.plugin.sourceIdentity,
|
|
754
|
+
} : options.sourceId ? {
|
|
755
|
+
sourceId: options.sourceId,
|
|
756
|
+
sourceIdentity: options.sourceIdentity,
|
|
757
|
+
} : {}),
|
|
758
|
+
pluginName: options.pluginName,
|
|
759
|
+
scope: options.scope,
|
|
760
|
+
cwd: options.cwd,
|
|
761
|
+
env: options.env,
|
|
762
|
+
});
|
|
763
|
+
return collectRemovedConfigKeys(store.values).map((key) => buildReceiptFieldEntry({
|
|
764
|
+
key,
|
|
765
|
+
title: key,
|
|
766
|
+
kind: 'manifest',
|
|
767
|
+
reserved: false,
|
|
768
|
+
action: 'reset',
|
|
769
|
+
scope: options.scope,
|
|
770
|
+
}));
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
//# sourceMappingURL=plugin-config-write.js.map
|