@lesliechan721/aw 0.1.0-beta.4 → 0.1.0-beta.40
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.mjs +100 -501
- package/dist/authoring/assets/aw-config.mjs.map +1 -1
- package/dist/authoring/assets/aw-runtime-config.d.mts +13 -0
- package/dist/authoring/assets/aw-runtime-config.mjs +199 -0
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -0
- package/dist/authoring/scripts/add-skill.mjs +4 -4
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +67 -97
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +15 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +239 -232
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.d.mts +77 -90
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +99 -120
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/plugin-status.mjs +8 -11
- package/dist/authoring/scripts/plugin-status.mjs.map +1 -1
- 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.mjs +353 -1175
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/aw-skill-eval-materializer.d.ts +26 -0
- package/dist/scripts/aw-skill-eval-materializer.js +306 -0
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
- package/dist/scripts/bundle-plugins.d.ts +1 -2
- package/dist/scripts/bundle-plugins.js +24 -7
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +7 -24
- package/dist/scripts/plugin-staging.js +22 -142
- package/dist/scripts/plugin-staging.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.d.ts +2 -0
- package/dist/scripts/test-plugin-scripts.js +30 -75
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/adapters/helpers.js +2 -2
- package/dist/src/adapters/helpers.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +26 -2
- package/dist/src/authoring/workspace-commands.js +44 -19
- package/dist/src/authoring/workspace-commands.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +78 -0
- package/dist/src/commands/aw-capabilities.js +263 -0
- package/dist/src/commands/aw-capabilities.js.map +1 -0
- package/dist/src/commands/catalog-dev-source.d.ts +154 -0
- package/dist/src/commands/catalog-dev-source.js +655 -0
- package/dist/src/commands/catalog-dev-source.js.map +1 -0
- package/dist/src/commands/catalog-generation.d.ts +21 -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 +757 -0
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -0
- package/dist/src/commands/catalog-publication-journal.d.ts +68 -0
- package/dist/src/commands/catalog-publication-journal.js +292 -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 +77 -7
- package/dist/src/commands/catalog-publish.js +746 -316
- package/dist/src/commands/catalog-publish.js.map +1 -1
- package/dist/src/commands/catalog-source.d.ts +60 -22
- package/dist/src/commands/catalog-source.js +311 -91
- package/dist/src/commands/catalog-source.js.map +1 -1
- 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 +104 -0
- package/dist/src/commands/catalog-store.js +685 -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.js +28 -17
- package/dist/src/commands/console.js.map +1 -1
- package/dist/src/commands/dependency-operation-plan.d.ts +52 -15
- package/dist/src/commands/dependency-operation-plan.js +289 -7
- package/dist/src/commands/dependency-operation-plan.js.map +1 -1
- package/dist/src/commands/init.d.ts +5 -11
- package/dist/src/commands/init.js +30 -51
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/offline-cleanup-evidence.d.ts +67 -0
- package/dist/src/commands/offline-cleanup-evidence.js +181 -0
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -0
- package/dist/src/commands/operation-plan.d.ts +146 -0
- package/dist/src/commands/operation-plan.js +71 -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 +141 -0
- package/dist/src/commands/operation-planner.js.map +1 -0
- package/dist/src/commands/options.d.ts +9 -7
- package/dist/src/commands/options.js +83 -21
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.d.ts +22 -0
- package/dist/src/commands/plugin-capabilities.js +163 -0
- package/dist/src/commands/plugin-capabilities.js.map +1 -0
- package/dist/src/commands/rebuild-command.d.ts +78 -30
- package/dist/src/commands/rebuild-command.js +4877 -713
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +132 -21
- package/dist/src/commands/rebuild-integration.js +2853 -1327
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +58 -30
- package/dist/src/commands/rebuild-operations.js +260 -319
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/reconcile-operation-plan.d.ts +28 -0
- package/dist/src/commands/reconcile-operation-plan.js +47 -0
- package/dist/src/commands/reconcile-operation-plan.js.map +1 -0
- package/dist/src/commands/review-inspection.d.ts +228 -0
- package/dist/src/commands/review-inspection.js +1341 -0
- package/dist/src/commands/review-inspection.js.map +1 -0
- package/dist/src/commands/review-preparation.d.ts +49 -0
- package/dist/src/commands/review-preparation.js +427 -0
- package/dist/src/commands/review-preparation.js.map +1 -0
- package/dist/src/commands/runtime.d.ts +1 -5
- package/dist/src/commands/runtime.js +24 -50
- package/dist/src/commands/runtime.js.map +1 -1
- package/dist/src/commands/skill-eval.d.ts +39 -0
- package/dist/src/commands/skill-eval.js +400 -0
- package/dist/src/commands/skill-eval.js.map +1 -0
- package/dist/src/commands/status-v6.d.ts +279 -0
- package/dist/src/commands/status-v6.js +2787 -0
- package/dist/src/commands/status-v6.js.map +1 -0
- package/dist/src/commands/sync-command.d.ts +40 -0
- package/dist/src/commands/sync-command.js +250 -0
- package/dist/src/commands/sync-command.js.map +1 -0
- package/dist/src/commands/wizard.d.ts +8 -5
- package/dist/src/commands/wizard.js +6 -4
- package/dist/src/commands/wizard.js.map +1 -1
- package/dist/src/commands/write-commands.d.ts +9 -3
- package/dist/src/commands/write-commands.js +127 -31
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +7 -1
- package/dist/src/constants.js +7 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/eval/manifest-v1.d.ts +71 -0
- package/dist/src/eval/manifest-v1.js +370 -0
- package/dist/src/eval/manifest-v1.js.map +1 -0
- package/dist/src/generators/local-plugin.d.ts +5 -1
- package/dist/src/generators/local-plugin.js +228 -104
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.d.ts +10 -4
- package/dist/src/index.js +1835 -469
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/command-receipt.d.ts +43 -46
- package/dist/src/output/command-receipt.js +256 -80
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/model.d.ts +3 -44
- package/dist/src/output/model.js +1 -144
- package/dist/src/output/model.js.map +1 -1
- package/dist/src/output/rebuild-progress.js +1 -13
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/portable/commands.d.ts +46 -7
- package/dist/src/portable/commands.js +349 -37
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +17 -4
- package/dist/src/portable/materializer.js +179 -41
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/skills-cli.d.ts +15 -7
- package/dist/src/portable/skills-cli.js +66 -19
- package/dist/src/portable/skills-cli.js.map +1 -1
- package/dist/src/review/eval-source-input.d.ts +43 -0
- package/dist/src/review/eval-source-input.js +207 -0
- package/dist/src/review/eval-source-input.js.map +1 -0
- package/dist/src/review/review-profile.d.ts +17 -0
- package/dist/src/review/review-profile.js +234 -0
- package/dist/src/review/review-profile.js.map +1 -0
- package/dist/src/review/review-selection.d.ts +30 -0
- package/dist/src/review/review-selection.js +527 -0
- package/dist/src/review/review-selection.js.map +1 -0
- package/dist/src/review/review-types.d.ts +68 -0
- package/dist/src/review/review-types.js +16 -0
- package/dist/src/review/review-types.js.map +1 -0
- package/dist/src/review/skill-materialization.d.ts +13 -0
- package/dist/src/review/skill-materialization.js +75 -0
- package/dist/src/review/skill-materialization.js.map +1 -0
- package/dist/src/review/source-binding.d.ts +183 -0
- package/dist/src/review/source-binding.js +708 -0
- package/dist/src/review/source-binding.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 +156 -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 +40 -0
- package/dist/src/tui/catalog-sources/screens.js.map +1 -0
- package/dist/src/tui/catalog-sources/session.d.ts +32 -0
- package/dist/src/tui/catalog-sources/session.js +300 -0
- package/dist/src/tui/catalog-sources/session.js.map +1 -0
- package/dist/src/tui/catalog-sources/types.d.ts +54 -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/catalog-store-task.d.ts +16 -0
- package/dist/src/tui/catalog-store-task.js +19 -0
- package/dist/src/tui/catalog-store-task.js.map +1 -0
- package/dist/src/tui/clipboard.d.ts +13 -0
- package/dist/src/tui/clipboard.js +95 -0
- package/dist/src/tui/clipboard.js.map +1 -0
- package/dist/src/tui/components.d.ts +177 -0
- package/dist/src/tui/components.js +297 -7
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/config-array-draft.d.ts +29 -0
- package/dist/src/tui/config-array-draft.js +48 -0
- package/dist/src/tui/config-array-draft.js.map +1 -0
- package/dist/src/tui/config-leaf-editor.d.ts +16 -0
- package/dist/src/tui/config-leaf-editor.js +206 -0
- package/dist/src/tui/config-leaf-editor.js.map +1 -0
- package/dist/src/tui/config-value-presentation.d.ts +20 -0
- package/dist/src/tui/config-value-presentation.js +104 -0
- package/dist/src/tui/config-value-presentation.js.map +1 -0
- package/dist/src/tui/console-app-v4.d.ts +14 -4
- package/dist/src/tui/console-app-v4.js +9659 -1558
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/content-item-card.d.ts +13 -0
- package/dist/src/tui/content-item-card.js +51 -0
- package/dist/src/tui/content-item-card.js.map +1 -0
- package/dist/src/tui/controller-runtime.d.ts +13 -1
- package/dist/src/tui/controller-runtime.js +3323 -349
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +643 -40
- package/dist/src/tui/controller.js +3756 -705
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/dependency-graph-view.d.ts +39 -0
- package/dist/src/tui/dependency-graph-view.js +121 -0
- package/dist/src/tui/dependency-graph-view.js.map +1 -0
- package/dist/src/tui/dependency-graph.d.ts +81 -0
- package/dist/src/tui/dependency-graph.js +452 -0
- package/dist/src/tui/dependency-graph.js.map +1 -0
- package/dist/src/tui/diagnostic-projection.d.ts +23 -0
- package/dist/src/tui/diagnostic-projection.js +567 -0
- package/dist/src/tui/diagnostic-projection.js.map +1 -0
- package/dist/src/tui/diagnostics.d.ts +31 -0
- package/dist/src/tui/diagnostics.js +83 -0
- package/dist/src/tui/diagnostics.js.map +1 -0
- package/dist/src/tui/entity-cards.d.ts +55 -0
- package/dist/src/tui/entity-cards.js +220 -0
- package/dist/src/tui/entity-cards.js.map +1 -0
- package/dist/src/tui/glossary.d.ts +23 -0
- package/dist/src/tui/glossary.js +42 -0
- package/dist/src/tui/glossary.js.map +1 -0
- package/dist/src/tui/index.d.ts +11 -4
- package/dist/src/tui/index.js +8 -2
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/input-display.d.ts +9 -0
- package/dist/src/tui/input-display.js +58 -0
- package/dist/src/tui/input-display.js.map +1 -0
- package/dist/src/tui/keys.d.ts +44 -0
- package/dist/src/tui/keys.js +43 -15
- package/dist/src/tui/keys.js.map +1 -1
- package/dist/src/tui/lifecycle-action-view.d.ts +6 -0
- package/dist/src/tui/lifecycle-action-view.js +36 -0
- package/dist/src/tui/lifecycle-action-view.js.map +1 -0
- package/dist/src/tui/model.d.ts +248 -27
- package/dist/src/tui/model.js +1662 -314
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.d.ts +8 -0
- package/dist/src/tui/operation-diagnostic-screens.js +71 -0
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
- package/dist/src/tui/operation-history.d.ts +81 -0
- package/dist/src/tui/operation-history.js +136 -0
- package/dist/src/tui/operation-history.js.map +1 -0
- package/dist/src/tui/operation-review-planner.d.ts +21 -0
- package/dist/src/tui/operation-review-planner.js +1295 -0
- package/dist/src/tui/operation-review-planner.js.map +1 -0
- package/dist/src/tui/plugin-content.d.ts +31 -0
- package/dist/src/tui/plugin-content.js +680 -0
- package/dist/src/tui/plugin-content.js.map +1 -0
- package/dist/src/tui/plugin-detail.d.ts +52 -0
- package/dist/src/tui/plugin-detail.js +165 -0
- package/dist/src/tui/plugin-detail.js.map +1 -0
- package/dist/src/tui/plugin-write-task.d.ts +69 -0
- package/dist/src/tui/plugin-write-task.js +286 -0
- package/dist/src/tui/plugin-write-task.js.map +1 -0
- package/dist/src/tui/project-inventory.d.ts +68 -0
- package/dist/src/tui/project-inventory.js +203 -0
- package/dist/src/tui/project-inventory.js.map +1 -0
- package/dist/src/tui/prompt.js +4 -15
- package/dist/src/tui/prompt.js.map +1 -1
- package/dist/src/tui/query-header.d.ts +30 -0
- package/dist/src/tui/query-header.js +40 -0
- package/dist/src/tui/query-header.js.map +1 -0
- package/dist/src/tui/reader.d.ts +37 -0
- package/dist/src/tui/reader.js +47 -0
- package/dist/src/tui/reader.js.map +1 -0
- package/dist/src/tui/router.d.ts +207 -14
- package/dist/src/tui/router.js +352 -29
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/screen-registry.d.ts +701 -0
- package/dist/src/tui/screen-registry.js +230 -0
- package/dist/src/tui/screen-registry.js.map +1 -0
- package/dist/src/tui/session-console-app.d.ts +6 -0
- package/dist/src/tui/session-console-app.js +13 -0
- package/dist/src/tui/session-console-app.js.map +1 -0
- package/dist/src/tui/session-host.d.ts +45 -0
- package/dist/src/tui/session-host.js +209 -0
- package/dist/src/tui/session-host.js.map +1 -0
- package/dist/src/tui/source-detail-card.d.ts +29 -0
- package/dist/src/tui/source-detail-card.js +45 -0
- package/dist/src/tui/source-detail-card.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 +30 -10
- package/dist/src/tui/theme.js +30 -10
- package/dist/src/tui/theme.js.map +1 -1
- package/dist/src/tui/viewport.d.ts +21 -0
- package/dist/src/tui/viewport.js +52 -0
- package/dist/src/tui/viewport.js.map +1 -0
- package/dist/src/tui/views.js +31 -3
- package/dist/src/tui/views.js.map +1 -1
- package/dist/src/tui/wizard.js +37 -13
- package/dist/src/tui/wizard.js.map +1 -1
- package/dist/src/types.d.ts +244 -20
- package/dist/src/types.js +1 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.d.ts +7 -1
- package/dist/src/utils/agent-version.js +41 -8
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +5 -4
- package/dist/src/utils/artifact-plan.js +18 -7
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +17 -7
- package/dist/src/utils/artifact-renderer.js +214 -216
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +21 -0
- package/dist/src/utils/artifact-request.js +78 -0
- package/dist/src/utils/artifact-request.js.map +1 -0
- package/dist/src/utils/aw-home-mutation-lock.d.ts +1 -0
- package/dist/src/utils/aw-home-mutation-lock.js +32 -4
- package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
- package/dist/src/utils/bundle-integrity.d.ts +0 -1
- package/dist/src/utils/bundle-integrity.js +0 -25
- package/dist/src/utils/bundle-integrity.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +22 -29
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-capability-projection.d.ts +8 -0
- package/dist/src/utils/catalog-capability-projection.js +14 -0
- package/dist/src/utils/catalog-capability-projection.js.map +1 -0
- package/dist/src/utils/catalog-digests.d.ts +10 -0
- package/dist/src/utils/catalog-digests.js +50 -2
- package/dist/src/utils/catalog-digests.js.map +1 -1
- 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 +44 -0
- package/dist/src/utils/catalog-generation-resolver.js +273 -0
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -0
- package/dist/src/utils/catalog-generation-service.d.ts +172 -0
- package/dist/src/utils/catalog-generation-service.js +1271 -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 +58 -0
- package/dist/src/utils/catalog-generation-store.js +452 -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-v4.js → catalog-manifest-v7.js} +35 -43
- 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 +142 -0
- package/dist/src/utils/catalog-operation-context.js.map +1 -0
- package/dist/src/utils/catalog-public-error.d.ts +7 -3
- package/dist/src/utils/catalog-public-error.js +28 -8
- package/dist/src/utils/catalog-public-error.js.map +1 -1
- package/dist/src/utils/catalog-runtime-projection.d.ts +4 -7
- package/dist/src/utils/catalog-runtime-projection.js +7 -102
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
- package/dist/src/utils/catalog-snapshot.d.ts +5 -3
- package/dist/src/utils/catalog-snapshot.js +11 -3
- package/dist/src/utils/catalog-snapshot.js.map +1 -1
- package/dist/src/utils/catalog-source-identity.d.ts +1 -0
- package/dist/src/utils/catalog-source-identity.js +21 -2
- package/dist/src/utils/catalog-source-identity.js.map +1 -1
- package/dist/src/utils/catalog-source-impact.d.ts +21 -0
- package/dist/src/utils/catalog-source-impact.js +344 -0
- package/dist/src/utils/catalog-source-impact.js.map +1 -0
- package/dist/src/utils/catalog-source-references.d.ts +3 -2
- package/dist/src/utils/catalog-source-references.js +195 -347
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/catalog-sources.d.ts +15 -1
- package/dist/src/utils/catalog-sources.js +206 -27
- package/dist/src/utils/catalog-sources.js.map +1 -1
- package/dist/src/utils/codex-config.d.ts +2 -0
- package/dist/src/utils/codex-config.js +26 -5
- package/dist/src/utils/codex-config.js.map +1 -1
- package/dist/src/utils/codex-manager.d.ts +79 -0
- package/dist/src/utils/codex-manager.js +745 -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 +49 -0
- package/dist/src/utils/codex-native-observation.js +154 -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 +126 -0
- package/dist/src/utils/codex-reconciler.js +298 -0
- package/dist/src/utils/codex-reconciler.js.map +1 -0
- package/dist/src/utils/codex-shared-native.d.ts +43 -0
- package/dist/src/utils/codex-shared-native.js +81 -0
- package/dist/src/utils/codex-shared-native.js.map +1 -0
- package/dist/src/utils/codex-skill-staging.d.ts +2 -0
- package/dist/src/utils/codex-skill-staging.js.map +1 -1
- package/dist/src/utils/codex-surface-analysis.d.ts +46 -0
- package/dist/src/utils/codex-surface-analysis.js +247 -0
- package/dist/src/utils/codex-surface-analysis.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +4 -0
- package/dist/src/utils/dynamic-skill-tree.js +36 -6
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/git-catalog-provider.d.ts +16 -0
- package/dist/src/utils/git-catalog-provider.js +169 -144
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/local-marketplace.d.ts +17 -1
- package/dist/src/utils/local-marketplace.js +301 -84
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/manifest.d.ts +1 -4
- package/dist/src/utils/manifest.js +1 -4
- package/dist/src/utils/manifest.js.map +1 -1
- package/dist/src/utils/multi-source-catalog.d.ts +3 -9
- package/dist/src/utils/multi-source-catalog.js +54 -110
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +55 -7
- package/dist/src/utils/native-cli.js +386 -57
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/orphan-marketplace-cleanup.js +0 -4
- package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +84 -20
- package/dist/src/utils/ownership.js +179 -222
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/path-catalog-provider.d.ts +1 -1
- package/dist/src/utils/path-catalog-provider.js +54 -65
- package/dist/src/utils/path-catalog-provider.js.map +1 -1
- package/dist/src/utils/paths.d.ts +0 -1
- package/dist/src/utils/paths.js +0 -1
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/plugin-config-impact.d.ts +33 -0
- package/dist/src/utils/plugin-config-impact.js +298 -0
- package/dist/src/utils/plugin-config-impact.js.map +1 -0
- package/dist/src/utils/plugin-config-write.d.ts +52 -27
- package/dist/src/utils/plugin-config-write.js +1000 -296
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +153 -93
- package/dist/src/utils/plugin-config.js +1163 -1017
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/plugin-intent-state.d.ts +49 -0
- package/dist/src/utils/plugin-intent-state.js +320 -0
- package/dist/src/utils/plugin-intent-state.js.map +1 -0
- package/dist/src/utils/plugin-scripts.d.ts +65 -125
- package/dist/src/utils/plugin-scripts.js +482 -524
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-tree.d.ts +2 -2
- package/dist/src/utils/process-tree.js +1 -1
- package/dist/src/utils/process-tree.js.map +1 -1
- package/dist/src/utils/project-boundary.d.ts +11 -13
- package/dist/src/utils/project-boundary.js +28 -34
- package/dist/src/utils/project-boundary.js.map +1 -1
- package/dist/src/utils/runtime-config.d.ts +20 -0
- package/dist/src/utils/runtime-config.js +75 -0
- package/dist/src/utils/runtime-config.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/safe-operation-diagnostic.d.ts +15 -0
- package/dist/src/utils/safe-operation-diagnostic.js +33 -0
- package/dist/src/utils/safe-operation-diagnostic.js.map +1 -0
- package/dist/src/utils/sensitive-content.d.ts +4 -0
- package/dist/src/utils/sensitive-content.js +36 -0
- package/dist/src/utils/sensitive-content.js.map +1 -0
- package/dist/src/utils/skill-validation.d.ts +1 -1
- package/dist/src/utils/skill-validation.js +1 -1
- package/dist/src/utils/skill-validation.js.map +1 -1
- package/dist/src/utils/state-paths.d.ts +1 -0
- package/dist/src/utils/state-paths.js +12 -2
- package/dist/src/utils/state-paths.js.map +1 -1
- package/dist/src/utils/target-eligibility.d.ts +8 -2
- package/dist/src/utils/target-eligibility.js +17 -8
- package/dist/src/utils/target-eligibility.js.map +1 -1
- package/dist/src/utils/windows-claude-shim.d.ts +9 -0
- package/dist/src/utils/windows-claude-shim.js +141 -0
- package/dist/src/utils/windows-claude-shim.js.map +1 -0
- package/dist/vitest.config.js +91 -10
- package/dist/vitest.config.js.map +1 -1
- package/package.json +22 -19
- package/dist/authoring/scripts/check-plugin-versions.mjs +0 -5
- package/dist/authoring/scripts/check-plugin-versions.mjs.map +0 -1
- package/dist/scripts/aw-skill-eval-engine.d.ts +0 -13
- package/dist/scripts/aw-skill-eval-engine.js +0 -31
- package/dist/scripts/aw-skill-eval-engine.js.map +0 -1
- package/dist/scripts/codex-eval-app-server.d.ts +0 -89
- package/dist/scripts/codex-eval-app-server.js +0 -1228
- package/dist/scripts/codex-eval-app-server.js.map +0 -1
- package/dist/scripts/codex-eval-isolation.d.ts +0 -61
- package/dist/scripts/codex-eval-isolation.js +0 -318
- package/dist/scripts/codex-eval-isolation.js.map +0 -1
- package/dist/scripts/codex-eval-process-management.d.ts +0 -8
- package/dist/scripts/codex-eval-process-management.js +0 -69
- package/dist/scripts/codex-eval-process-management.js.map +0 -1
- package/dist/scripts/codex-eval-process-tree.d.ts +0 -38
- package/dist/scripts/codex-eval-process-tree.js +0 -803
- package/dist/scripts/codex-eval-process-tree.js.map +0 -1
- package/dist/scripts/codex-eval-runtime-config.d.ts +0 -62
- package/dist/scripts/codex-eval-runtime-config.js +0 -843
- package/dist/scripts/codex-eval-runtime-config.js.map +0 -1
- package/dist/scripts/codex-trigger-eval.d.ts +0 -84
- package/dist/scripts/codex-trigger-eval.js +0 -968
- package/dist/scripts/codex-trigger-eval.js.map +0 -1
- package/dist/scripts/eval-plugin-skills-audited.d.ts +0 -6
- package/dist/scripts/eval-plugin-skills-audited.js +0 -261
- package/dist/scripts/eval-plugin-skills-audited.js.map +0 -1
- package/dist/scripts/eval-plugin-skills.d.ts +0 -45
- package/dist/scripts/eval-plugin-skills.js +0 -1586
- package/dist/scripts/eval-plugin-skills.js.map +0 -1
- package/dist/scripts/eval-run-layout.d.ts +0 -17
- package/dist/scripts/eval-run-layout.js +0 -26
- package/dist/scripts/eval-run-layout.js.map +0 -1
- package/dist/scripts/plugin-eval-contract.d.ts +0 -185
- package/dist/scripts/plugin-eval-contract.js +0 -695
- package/dist/scripts/plugin-eval-contract.js.map +0 -1
- package/dist/scripts/plugin-eval-materializer.d.ts +0 -13
- package/dist/scripts/plugin-eval-materializer.js +0 -421
- package/dist/scripts/plugin-eval-materializer.js.map +0 -1
- package/dist/scripts/skill-reporting.d.ts +0 -212
- package/dist/scripts/skill-reporting.js +0 -922
- package/dist/scripts/skill-reporting.js.map +0 -1
- package/dist/src/commands/status-v4.d.ts +0 -102
- package/dist/src/commands/status-v4.js +0 -844
- package/dist/src/commands/status-v4.js.map +0 -1
- package/dist/src/commands/status.d.ts +0 -93
- package/dist/src/commands/status.js +0 -442
- package/dist/src/commands/status.js.map +0 -1
- package/dist/src/utils/active-marketplace-runtime-lock.d.ts +0 -12
- package/dist/src/utils/active-marketplace-runtime-lock.js +0 -133
- package/dist/src/utils/active-marketplace-runtime-lock.js.map +0 -1
- package/dist/src/utils/catalog-manifest-v3.d.ts +0 -2
- package/dist/src/utils/catalog-manifest-v3.js +0 -3
- package/dist/src/utils/catalog-manifest-v3.js.map +0 -1
- package/dist/src/utils/catalog-manifest-v4.d.ts +0 -5
- package/dist/src/utils/catalog-manifest-v4.js.map +0 -1
- package/dist/src/utils/catalog-source-cache.d.ts +0 -61
- package/dist/src/utils/catalog-source-cache.js +0 -276
- package/dist/src/utils/catalog-source-cache.js.map +0 -1
- package/dist/src/utils/codex-project-surface.d.ts +0 -3
- package/dist/src/utils/codex-project-surface.js +0 -49
- package/dist/src/utils/codex-project-surface.js.map +0 -1
- package/dist/src/utils/lifecycle-active-store.d.ts +0 -175
- package/dist/src/utils/lifecycle-active-store.js +0 -1276
- package/dist/src/utils/lifecycle-active-store.js.map +0 -1
- package/dist/src/utils/plugin-authoring-capabilities.d.ts +0 -23
- package/dist/src/utils/plugin-authoring-capabilities.js +0 -37
- package/dist/src/utils/plugin-authoring-capabilities.js.map +0 -1
- package/dist/src/utils/plugin-authoring-capabilities.json +0 -92
- package/dist/src/utils/plugin-release.d.ts +0 -2
- package/dist/src/utils/plugin-release.js +0 -2
- package/dist/src/utils/plugin-release.js.map +0 -1
- package/dist/src/utils/skill-frontmatter-capabilities.d.ts +0 -201
- package/dist/src/utils/skill-frontmatter-capabilities.js +0 -5
- package/dist/src/utils/skill-frontmatter-capabilities.js.map +0 -1
- package/dist/src/utils/skill-frontmatter-capabilities.json +0 -200
- /package/dist/authoring/scripts/{check-plugin-versions.d.mts → remove-plugin.d.mts} +0 -0
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
1
|
+
import { execFile, spawn } from 'node:child_process';
|
|
2
2
|
import crypto from 'node:crypto';
|
|
3
3
|
import * as fs from 'node:fs/promises';
|
|
4
4
|
import * as os from 'node:os';
|
|
5
5
|
import * as path from 'node:path';
|
|
6
|
+
import { Readable } from 'node:stream';
|
|
7
|
+
import { pipeline } from 'node:stream/promises';
|
|
6
8
|
import { promisify } from 'node:util';
|
|
7
9
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
10
|
import { compareStrictSemVer, parseStrictSemVer } from './semver.mjs';
|
|
9
11
|
import { assertAuthoringPluginPathFence, resolveAuthoringPluginRoot, } from './plugin-root.mjs';
|
|
10
12
|
const execFileAsync = promisify(execFile);
|
|
11
|
-
const EXPECTED_MANIFEST_CONTRACT_VERSION =
|
|
12
|
-
const CLI_PACKAGE_NAME = '@lesliechan721/aw';
|
|
13
|
+
const EXPECTED_MANIFEST_CONTRACT_VERSION = 16;
|
|
13
14
|
const PLUGIN_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const GIT_OBJECT_ID_PATTERN = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u;
|
|
16
|
+
const MAX_GIT_BLOB_BYTES = 50 * 1024 * 1024;
|
|
17
|
+
const MAX_GIT_BATCH_HEADER_BYTES = 1024;
|
|
18
|
+
const GIT_BATCH_OPERATION_TIMEOUT_MS = 30_000;
|
|
19
|
+
const GIT_BATCH_TERM_GRACE_MS = 250;
|
|
20
|
+
const GIT_BATCH_CLOSE_TIMEOUT_MS = 2_000;
|
|
18
21
|
const CLI_PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', '..', '..');
|
|
19
22
|
export class PluginVersionCheckError extends Error {
|
|
20
23
|
constructor(code, message) {
|
|
@@ -26,14 +29,14 @@ export class PluginVersionCheckError extends Error {
|
|
|
26
29
|
function codedError(code, message) {
|
|
27
30
|
return new PluginVersionCheckError(code, message);
|
|
28
31
|
}
|
|
29
|
-
function parseStablePluginVersion(version, fieldName) {
|
|
32
|
+
export function parseStablePluginVersion(version, fieldName) {
|
|
30
33
|
const parsed = parseStrictSemVer(version, fieldName);
|
|
31
34
|
if (parsed.prerelease.length > 0 || parsed.build.length > 0) {
|
|
32
35
|
throw codedError('invalidPlugin', `${fieldName} must be a stable SemVer without prerelease or build metadata.`);
|
|
33
36
|
}
|
|
34
37
|
return parsed;
|
|
35
38
|
}
|
|
36
|
-
async function runGit(repoRoot, args, options = {}) {
|
|
39
|
+
export async function runGit(repoRoot, args, options = {}) {
|
|
37
40
|
try {
|
|
38
41
|
const result = await execFileAsync('git', args, {
|
|
39
42
|
cwd: repoRoot,
|
|
@@ -49,7 +52,7 @@ async function runGit(repoRoot, args, options = {}) {
|
|
|
49
52
|
throw codedError(options.code ?? 'gitFailed', `${options.label ?? `git ${args.join(' ')}`} failed${detail ? `: ${detail}` : '.'}`);
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
|
-
async function resolveBaseCommit(repoRoot, base) {
|
|
55
|
+
export async function resolveBaseCommit(repoRoot, base) {
|
|
53
56
|
await runGit(repoRoot, ['rev-parse', '--show-toplevel'], {
|
|
54
57
|
code: 'gitUnavailable',
|
|
55
58
|
label: 'Git repository discovery',
|
|
@@ -109,7 +112,16 @@ async function loadProductionBundler(cliPackageRoot) {
|
|
|
109
112
|
}
|
|
110
113
|
function parseTreeRecord(record) {
|
|
111
114
|
const tabIndex = record.indexOf('\t');
|
|
115
|
+
if (tabIndex < 0) {
|
|
116
|
+
throw codedError('gitFailed', 'Git authoring source tree returned a malformed record.');
|
|
117
|
+
}
|
|
112
118
|
const metadata = record.slice(0, tabIndex).split(' ');
|
|
119
|
+
if (metadata.length !== 3
|
|
120
|
+
|| !metadata[0]
|
|
121
|
+
|| !metadata[1]
|
|
122
|
+
|| !GIT_OBJECT_ID_PATTERN.test(metadata[2] ?? '')) {
|
|
123
|
+
throw codedError('gitFailed', 'Git authoring source tree returned malformed metadata.');
|
|
124
|
+
}
|
|
113
125
|
return {
|
|
114
126
|
mode: metadata[0],
|
|
115
127
|
type: metadata[1],
|
|
@@ -117,20 +129,221 @@ function parseTreeRecord(record) {
|
|
|
117
129
|
filePath: record.slice(tabIndex + 1),
|
|
118
130
|
};
|
|
119
131
|
}
|
|
132
|
+
function createBatchReader(stream) {
|
|
133
|
+
const iterator = stream[Symbol.asyncIterator]();
|
|
134
|
+
let chunk = Buffer.alloc(0);
|
|
135
|
+
let offset = 0;
|
|
136
|
+
let ended = false;
|
|
137
|
+
async function nextChunk() {
|
|
138
|
+
if (offset < chunk.length)
|
|
139
|
+
return true;
|
|
140
|
+
const next = await iterator.next();
|
|
141
|
+
if (next.done) {
|
|
142
|
+
ended = true;
|
|
143
|
+
chunk = Buffer.alloc(0);
|
|
144
|
+
offset = 0;
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
chunk = Buffer.isBuffer(next.value) ? next.value : Buffer.from(next.value);
|
|
148
|
+
offset = 0;
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
async readLine() {
|
|
153
|
+
const parts = [];
|
|
154
|
+
let size = 0;
|
|
155
|
+
while (await nextChunk()) {
|
|
156
|
+
const newline = chunk.indexOf(0x0a, offset);
|
|
157
|
+
const end = newline < 0 ? chunk.length : newline;
|
|
158
|
+
const part = chunk.subarray(offset, end);
|
|
159
|
+
parts.push(part);
|
|
160
|
+
size += part.length;
|
|
161
|
+
if (size > MAX_GIT_BATCH_HEADER_BYTES) {
|
|
162
|
+
throw codedError('gitFailed', 'Git cat-file batch returned an oversized header.');
|
|
163
|
+
}
|
|
164
|
+
offset = newline < 0 ? chunk.length : newline + 1;
|
|
165
|
+
if (newline >= 0)
|
|
166
|
+
return Buffer.concat(parts, size).toString('ascii');
|
|
167
|
+
}
|
|
168
|
+
if (size === 0 && ended)
|
|
169
|
+
return null;
|
|
170
|
+
throw codedError('gitFailed', 'Git cat-file batch stdout ended during a header.');
|
|
171
|
+
},
|
|
172
|
+
async readExact(size) {
|
|
173
|
+
const output = Buffer.allocUnsafe(size);
|
|
174
|
+
let written = 0;
|
|
175
|
+
while (written < size && await nextChunk()) {
|
|
176
|
+
const available = Math.min(size - written, chunk.length - offset);
|
|
177
|
+
chunk.copy(output, written, offset, offset + available);
|
|
178
|
+
offset += available;
|
|
179
|
+
written += available;
|
|
180
|
+
}
|
|
181
|
+
if (written !== size) {
|
|
182
|
+
throw codedError('gitFailed', 'Git cat-file batch stdout ended during a blob.');
|
|
183
|
+
}
|
|
184
|
+
return output;
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export async function readGitBlobsBatch(repoRoot, objectIds, options = {}) {
|
|
189
|
+
const uniqueObjectIds = [...new Set(objectIds)];
|
|
190
|
+
for (const objectId of uniqueObjectIds) {
|
|
191
|
+
if (!GIT_OBJECT_ID_PATTERN.test(objectId)) {
|
|
192
|
+
throw codedError('gitFailed', `Git authoring source tree returned an invalid object ID.`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (uniqueObjectIds.length === 0)
|
|
196
|
+
return new Map();
|
|
197
|
+
const child = spawn('git', ['cat-file', '--batch'], {
|
|
198
|
+
cwd: repoRoot,
|
|
199
|
+
env: options.env ?? process.env,
|
|
200
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
201
|
+
});
|
|
202
|
+
let cleanupStarted = false;
|
|
203
|
+
let operationTimedOut = false;
|
|
204
|
+
let operationTimeoutTimer;
|
|
205
|
+
let forceKillTimer;
|
|
206
|
+
let closeTimeoutTimer;
|
|
207
|
+
let settleExit;
|
|
208
|
+
let onStderrData;
|
|
209
|
+
const exitTask = new Promise((resolve, reject) => {
|
|
210
|
+
const finish = (settle, value) => {
|
|
211
|
+
if (!settleExit)
|
|
212
|
+
return;
|
|
213
|
+
settleExit = null;
|
|
214
|
+
clearTimeout(operationTimeoutTimer);
|
|
215
|
+
clearTimeout(forceKillTimer);
|
|
216
|
+
clearTimeout(closeTimeoutTimer);
|
|
217
|
+
child.removeListener('error', onError);
|
|
218
|
+
child.removeListener('close', onClose);
|
|
219
|
+
if (onStderrData)
|
|
220
|
+
child.stderr.removeListener('data', onStderrData);
|
|
221
|
+
settle(value);
|
|
222
|
+
};
|
|
223
|
+
const onError = (error) => finish(reject, error);
|
|
224
|
+
const onClose = (code, signal) => finish(resolve, { code, signal });
|
|
225
|
+
settleExit = (error) => finish(reject, error);
|
|
226
|
+
child.once('error', onError);
|
|
227
|
+
child.once('close', onClose);
|
|
228
|
+
});
|
|
229
|
+
function requestCleanup() {
|
|
230
|
+
if (cleanupStarted || !settleExit)
|
|
231
|
+
return;
|
|
232
|
+
cleanupStarted = true;
|
|
233
|
+
child.stdin.destroy();
|
|
234
|
+
child.kill('SIGTERM');
|
|
235
|
+
forceKillTimer = setTimeout(() => child.kill('SIGKILL'), GIT_BATCH_TERM_GRACE_MS);
|
|
236
|
+
closeTimeoutTimer = setTimeout(() => {
|
|
237
|
+
child.kill('SIGKILL');
|
|
238
|
+
child.stdin.destroy();
|
|
239
|
+
child.stdout.destroy();
|
|
240
|
+
child.stderr.destroy();
|
|
241
|
+
child.unref();
|
|
242
|
+
settleExit(codedError('gitFailed', 'Git cat-file batch did not exit after forced termination.'));
|
|
243
|
+
}, GIT_BATCH_CLOSE_TIMEOUT_MS);
|
|
244
|
+
}
|
|
245
|
+
operationTimeoutTimer = setTimeout(() => {
|
|
246
|
+
operationTimedOut = true;
|
|
247
|
+
requestCleanup();
|
|
248
|
+
}, options.operationTimeoutMs ?? GIT_BATCH_OPERATION_TIMEOUT_MS);
|
|
249
|
+
const stderrChunks = [];
|
|
250
|
+
let stderrBytes = 0;
|
|
251
|
+
onStderrData = (value) => {
|
|
252
|
+
const valueBuffer = Buffer.isBuffer(value) ? value : Buffer.from(value);
|
|
253
|
+
stderrBytes += valueBuffer.length;
|
|
254
|
+
if (stderrBytes <= MAX_GIT_BLOB_BYTES)
|
|
255
|
+
stderrChunks.push(valueBuffer);
|
|
256
|
+
requestCleanup();
|
|
257
|
+
};
|
|
258
|
+
child.stderr.on('data', onStderrData);
|
|
259
|
+
const readTask = (async () => {
|
|
260
|
+
const reader = createBatchReader(child.stdout);
|
|
261
|
+
const contents = new Map();
|
|
262
|
+
for (const expectedObjectId of uniqueObjectIds) {
|
|
263
|
+
const header = await reader.readLine();
|
|
264
|
+
if (header === null) {
|
|
265
|
+
throw codedError('gitFailed', 'Git cat-file batch stdout ended before all blobs were returned.');
|
|
266
|
+
}
|
|
267
|
+
if (header === `${expectedObjectId} missing`) {
|
|
268
|
+
throw codedError('gitFailed', `Git blob ${expectedObjectId} is missing.`);
|
|
269
|
+
}
|
|
270
|
+
const match = /^(\S+) (\S+) (\S+)$/u.exec(header);
|
|
271
|
+
if (!match || match[1] !== expectedObjectId) {
|
|
272
|
+
throw codedError('gitFailed', 'Git cat-file batch returned a malformed header.');
|
|
273
|
+
}
|
|
274
|
+
if (match[2] !== 'blob') {
|
|
275
|
+
throw codedError('gitFailed', `Git object ${expectedObjectId} is not a blob.`);
|
|
276
|
+
}
|
|
277
|
+
if (!/^(?:0|[1-9][0-9]*)$/u.test(match[3])) {
|
|
278
|
+
throw codedError('gitFailed', `Git blob ${expectedObjectId} has an invalid size.`);
|
|
279
|
+
}
|
|
280
|
+
const size = Number(match[3]);
|
|
281
|
+
if (!Number.isSafeInteger(size) || size > MAX_GIT_BLOB_BYTES) {
|
|
282
|
+
throw codedError('gitFailed', `Git blob ${expectedObjectId} exceeds the size limit.`);
|
|
283
|
+
}
|
|
284
|
+
const content = await reader.readExact(size);
|
|
285
|
+
const separator = await reader.readExact(1);
|
|
286
|
+
if (separator[0] !== 0x0a) {
|
|
287
|
+
throw codedError('gitFailed', `Git blob ${expectedObjectId} has an invalid separator.`);
|
|
288
|
+
}
|
|
289
|
+
contents.set(expectedObjectId, content);
|
|
290
|
+
}
|
|
291
|
+
if (await reader.readLine() !== null) {
|
|
292
|
+
throw codedError('gitFailed', 'Git cat-file batch returned unexpected output.');
|
|
293
|
+
}
|
|
294
|
+
return contents;
|
|
295
|
+
})();
|
|
296
|
+
const writeTask = pipeline(Readable.from(uniqueObjectIds.map((objectId) => `${objectId}\n`)), child.stdin);
|
|
297
|
+
for (const task of [readTask, writeTask]) {
|
|
298
|
+
task.catch(requestCleanup);
|
|
299
|
+
}
|
|
300
|
+
const [readResult, writeResult, exitResult] = await Promise.allSettled([
|
|
301
|
+
readTask,
|
|
302
|
+
writeTask,
|
|
303
|
+
exitTask,
|
|
304
|
+
]);
|
|
305
|
+
if (operationTimedOut) {
|
|
306
|
+
throw codedError('gitFailed', 'Git cat-file batch timed out.');
|
|
307
|
+
}
|
|
308
|
+
if (exitResult.status === 'rejected'
|
|
309
|
+
&& exitResult.reason instanceof PluginVersionCheckError) {
|
|
310
|
+
throw exitResult.reason;
|
|
311
|
+
}
|
|
312
|
+
if (readResult.status === 'rejected')
|
|
313
|
+
throw readResult.reason;
|
|
314
|
+
if (writeResult.status === 'rejected') {
|
|
315
|
+
throw codedError('gitFailed', `Git cat-file batch input failed: ${writeResult.reason.message}`);
|
|
316
|
+
}
|
|
317
|
+
if (exitResult.status === 'rejected') {
|
|
318
|
+
throw codedError('gitFailed', `Git cat-file batch failed: ${exitResult.reason.message}`);
|
|
319
|
+
}
|
|
320
|
+
const stderr = Buffer.concat(stderrChunks).toString('utf8').trim();
|
|
321
|
+
if (stderrBytes > MAX_GIT_BLOB_BYTES) {
|
|
322
|
+
throw codedError('gitFailed', 'Git cat-file batch stderr exceeded the size limit.');
|
|
323
|
+
}
|
|
324
|
+
if (exitResult.value.signal) {
|
|
325
|
+
throw codedError('gitFailed', `Git cat-file batch ended from signal ${exitResult.value.signal}${stderr ? `: ${stderr}` : '.'}`);
|
|
326
|
+
}
|
|
327
|
+
if (exitResult.value.code !== 0 || stderr) {
|
|
328
|
+
throw codedError('gitFailed', `Git cat-file batch failed${stderr ? `: ${stderr}` : ` with exit code ${exitResult.value.code}.`}`);
|
|
329
|
+
}
|
|
330
|
+
return readResult.value;
|
|
331
|
+
}
|
|
120
332
|
async function materializeBaseAuthoringSourceSet(repoRoot, baseCommit, outputRoot, pluginRootPath) {
|
|
121
333
|
const sourcePaths = [
|
|
122
334
|
'plugins',
|
|
123
|
-
'packages/cli/package.json',
|
|
124
|
-
'packages/cli/src/utils/skill-frontmatter-capabilities.json',
|
|
125
|
-
'packages/cli/src/utils/plugin-authoring-capabilities.json',
|
|
126
335
|
];
|
|
127
336
|
if (pluginRootPath && !sourcePaths.includes(pluginRootPath))
|
|
128
337
|
sourcePaths.push(pluginRootPath);
|
|
129
338
|
const output = await runGit(repoRoot, ['ls-tree', '-r', '-z', baseCommit, '--', ...sourcePaths], { buffer: true, label: 'Git authoring source tree' });
|
|
130
339
|
const records = output.toString('utf8').split('\0').filter(Boolean).map(parseTreeRecord);
|
|
131
340
|
for (const record of records) {
|
|
132
|
-
if (record.type !== 'blob')
|
|
133
|
-
|
|
341
|
+
if (record.type !== 'blob') {
|
|
342
|
+
throw codedError('gitFailed', `Git authoring source object ${record.objectId} is not a blob.`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const contentsByObjectId = await readGitBlobsBatch(repoRoot, records.map((record) => record.objectId));
|
|
346
|
+
for (const record of records) {
|
|
134
347
|
const normalizedPath = path.posix.normalize(record.filePath);
|
|
135
348
|
if (normalizedPath !== record.filePath
|
|
136
349
|
|| normalizedPath === '..'
|
|
@@ -140,10 +353,10 @@ async function materializeBaseAuthoringSourceSet(repoRoot, baseCommit, outputRoo
|
|
|
140
353
|
}
|
|
141
354
|
const targetPath = path.join(outputRoot, ...normalizedPath.split('/'));
|
|
142
355
|
await fs.mkdir(path.dirname(targetPath), { recursive: true });
|
|
143
|
-
const content =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
356
|
+
const content = contentsByObjectId.get(record.objectId);
|
|
357
|
+
if (!content) {
|
|
358
|
+
throw codedError('gitFailed', `Git blob ${record.objectId} was not returned.`);
|
|
359
|
+
}
|
|
147
360
|
if (record.mode === '120000') {
|
|
148
361
|
await fs.symlink(content.toString('utf8'), targetPath);
|
|
149
362
|
}
|
|
@@ -162,203 +375,7 @@ async function lstatOrNull(filePath) {
|
|
|
162
375
|
throw error;
|
|
163
376
|
});
|
|
164
377
|
}
|
|
165
|
-
async function
|
|
166
|
-
const rootStat = await lstatOrNull(rootDir);
|
|
167
|
-
if (!rootStat || rootStat.isSymbolicLink() || !rootStat.isDirectory()) {
|
|
168
|
-
throw codedError('invalidPlugin', `${label} root must be a non-symbolic-link directory.`);
|
|
169
|
-
}
|
|
170
|
-
let currentPath = rootDir;
|
|
171
|
-
const segments = relativePath.split('/');
|
|
172
|
-
for (const [index, segment] of segments.entries()) {
|
|
173
|
-
currentPath = path.join(currentPath, segment);
|
|
174
|
-
const stat = await lstatOrNull(currentPath);
|
|
175
|
-
if (!stat) {
|
|
176
|
-
throw codedError('invalidPlugin', `${label} is missing ${JSON.stringify(relativePath)}.`);
|
|
177
|
-
}
|
|
178
|
-
if (stat.isSymbolicLink()) {
|
|
179
|
-
throw codedError('invalidPlugin', `${label} contains a symbolic-link node: ${currentPath}`);
|
|
180
|
-
}
|
|
181
|
-
if (index < segments.length - 1 && !stat.isDirectory()) {
|
|
182
|
-
throw codedError('invalidPlugin', `${label} contains a non-directory path node: ${currentPath}`);
|
|
183
|
-
}
|
|
184
|
-
if (index === segments.length - 1 && !stat.isFile()) {
|
|
185
|
-
throw codedError('invalidPlugin', `${label} must use a regular file: ${currentPath}`);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
return currentPath;
|
|
189
|
-
}
|
|
190
|
-
async function assertDirectoryPathChain(boundaryRoot, targetRoot, label) {
|
|
191
|
-
const relative = path.relative(boundaryRoot, targetRoot);
|
|
192
|
-
if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
193
|
-
throw codedError('invalidPlugin', `${label} source root must stay inside its workspace.`);
|
|
194
|
-
}
|
|
195
|
-
let currentPath = boundaryRoot;
|
|
196
|
-
for (const segment of relative.split(path.sep).filter(Boolean)) {
|
|
197
|
-
currentPath = path.join(currentPath, segment);
|
|
198
|
-
const stat = await lstatOrNull(currentPath);
|
|
199
|
-
if (!stat)
|
|
200
|
-
return;
|
|
201
|
-
if (stat.isSymbolicLink()) {
|
|
202
|
-
throw codedError('invalidPlugin', `${label} contains a symbolic-link path node: ${currentPath}`);
|
|
203
|
-
}
|
|
204
|
-
if (!stat.isDirectory()) {
|
|
205
|
-
throw codedError('invalidPlugin', `${label} contains a non-directory path node: ${currentPath}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
function calculateCliSourceSetDigest(packageBytes, registryEntries) {
|
|
210
|
-
const hash = crypto.createHash('sha256').update('package.json\0').update(packageBytes);
|
|
211
|
-
for (const [relativePath, bytes] of registryEntries) {
|
|
212
|
-
hash.update(`\0${relativePath}\0`).update(bytes);
|
|
213
|
-
}
|
|
214
|
-
return `sha256:${hash.digest('hex')}`;
|
|
215
|
-
}
|
|
216
|
-
async function inspectWorkspaceCliSourceSet(cliRoot, label, boundaryRoot) {
|
|
217
|
-
if (boundaryRoot)
|
|
218
|
-
await assertDirectoryPathChain(boundaryRoot, cliRoot, label);
|
|
219
|
-
const packagePath = path.join(cliRoot, 'package.json');
|
|
220
|
-
const registryPaths = CLI_REGISTRY_RELATIVE_PATHS.map((relativePath) => path.join(cliRoot, ...relativePath.split('/')));
|
|
221
|
-
const [packageStat, ...registryStats] = await Promise.all([
|
|
222
|
-
lstatOrNull(packagePath),
|
|
223
|
-
...registryPaths.map((registryPath) => lstatOrNull(registryPath)),
|
|
224
|
-
]);
|
|
225
|
-
if (!packageStat && registryStats.every((stat) => !stat)) {
|
|
226
|
-
const cliRootStat = await lstatOrNull(cliRoot);
|
|
227
|
-
if (cliRootStat?.isSymbolicLink() || (cliRootStat && !cliRootStat.isDirectory())) {
|
|
228
|
-
throw codedError('invalidPlugin', `${label} @aw/cli source root has an invalid node: ${cliRoot}`);
|
|
229
|
-
}
|
|
230
|
-
return { state: 'none', root: cliRoot };
|
|
231
|
-
}
|
|
232
|
-
if (!packageStat || !registryStats[0]) {
|
|
233
|
-
return { state: 'partial', root: cliRoot };
|
|
234
|
-
}
|
|
235
|
-
const availableRegistryRelativePaths = CLI_REGISTRY_RELATIVE_PATHS
|
|
236
|
-
.filter((_relativePath, index) => registryStats[index]);
|
|
237
|
-
await Promise.all([
|
|
238
|
-
assertRegularFilePath(cliRoot, 'package.json', `${label} @aw/cli source set`),
|
|
239
|
-
...availableRegistryRelativePaths.map((relativePath) => assertRegularFilePath(cliRoot, relativePath, `${label} @aw/cli source set`)),
|
|
240
|
-
]);
|
|
241
|
-
const availableRegistryPaths = availableRegistryRelativePaths.map((relativePath) => path.join(cliRoot, ...relativePath.split('/')));
|
|
242
|
-
const [packageBytes, ...registryBytes] = await Promise.all([
|
|
243
|
-
fs.readFile(packagePath),
|
|
244
|
-
...availableRegistryPaths.map((registryPath) => fs.readFile(registryPath)),
|
|
245
|
-
]);
|
|
246
|
-
let packageDocument;
|
|
247
|
-
try {
|
|
248
|
-
packageDocument = JSON.parse(packageBytes.toString('utf8'));
|
|
249
|
-
for (const bytes of registryBytes)
|
|
250
|
-
JSON.parse(bytes.toString('utf8'));
|
|
251
|
-
}
|
|
252
|
-
catch (error) {
|
|
253
|
-
throw codedError('invalidPlugin', `${label} @aw/cli source set contains invalid JSON: ${error.message}`);
|
|
254
|
-
}
|
|
255
|
-
if (typeof packageDocument?.name !== 'string' || packageDocument.name.trim() === '') {
|
|
256
|
-
throw codedError('invalidPlugin', `${label} @aw/cli package name is missing.`);
|
|
257
|
-
}
|
|
258
|
-
parseStrictSemVer(packageDocument.version, `${label} @aw/cli package version`);
|
|
259
|
-
return {
|
|
260
|
-
state: 'complete',
|
|
261
|
-
root: cliRoot,
|
|
262
|
-
packageName: packageDocument.name,
|
|
263
|
-
providerVersion: packageDocument.version,
|
|
264
|
-
digest: calculateCliSourceSetDigest(packageBytes, availableRegistryRelativePaths.map((relativePath, index) => [relativePath, registryBytes[index]])),
|
|
265
|
-
registryRelativePaths: availableRegistryRelativePaths,
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
async function materializeCliSourceSet(source, outputRoot, label) {
|
|
269
|
-
await fs.mkdir(path.join(outputRoot, 'src', 'utils'), { recursive: true });
|
|
270
|
-
await Promise.all([
|
|
271
|
-
fs.copyFile(path.join(source.root, 'package.json'), path.join(outputRoot, 'package.json')),
|
|
272
|
-
...source.registryRelativePaths.map((relativePath) => fs.copyFile(path.join(source.root, ...relativePath.split('/')), path.join(outputRoot, ...relativePath.split('/')))),
|
|
273
|
-
]);
|
|
274
|
-
const materialized = await inspectWorkspaceCliSourceSet(outputRoot, label);
|
|
275
|
-
if (materialized.state !== 'complete'
|
|
276
|
-
|| materialized.packageName !== source.packageName
|
|
277
|
-
|| materialized.providerVersion !== source.providerVersion
|
|
278
|
-
|| materialized.digest !== source.digest) {
|
|
279
|
-
throw codedError('invalidPlugin', `${label} @aw/cli source identity changed during materialization.`);
|
|
280
|
-
}
|
|
281
|
-
return materialized;
|
|
282
|
-
}
|
|
283
|
-
async function inspectExternalCliProvider(cliPackageRoot) {
|
|
284
|
-
const canonicalRoot = await fs.realpath(cliPackageRoot).catch(() => null);
|
|
285
|
-
if (!canonicalRoot) {
|
|
286
|
-
throw codedError('bundlerUnavailable', 'Plugin version checking cannot resolve the installed CLI package root.');
|
|
287
|
-
}
|
|
288
|
-
const packagePath = await assertRegularFilePath(canonicalRoot, 'package.json', 'Installed CLI provider');
|
|
289
|
-
const registryPaths = await Promise.all(CLI_REGISTRY_RELATIVE_PATHS.map((relativePath) => assertRegularFilePath(canonicalRoot, `dist/${relativePath}`, 'Installed CLI provider')));
|
|
290
|
-
const [packageBytes, ...registryBytes] = await Promise.all([
|
|
291
|
-
fs.readFile(packagePath),
|
|
292
|
-
...registryPaths.map((registryPath) => fs.readFile(registryPath)),
|
|
293
|
-
]);
|
|
294
|
-
let packageDocument;
|
|
295
|
-
try {
|
|
296
|
-
packageDocument = JSON.parse(packageBytes.toString('utf8'));
|
|
297
|
-
for (const bytes of registryBytes)
|
|
298
|
-
JSON.parse(bytes.toString('utf8'));
|
|
299
|
-
}
|
|
300
|
-
catch (error) {
|
|
301
|
-
throw codedError('bundlerUnavailable', `Installed CLI provider contains invalid JSON: ${error.message}`);
|
|
302
|
-
}
|
|
303
|
-
if (packageDocument?.name !== CLI_PACKAGE_NAME) {
|
|
304
|
-
throw codedError('bundlerUnavailable', `Installed CLI provider package name must be ${JSON.stringify(CLI_PACKAGE_NAME)}.`);
|
|
305
|
-
}
|
|
306
|
-
parseStrictSemVer(packageDocument.version, 'installed CLI provider version');
|
|
307
|
-
return {
|
|
308
|
-
root: canonicalRoot,
|
|
309
|
-
packagePath,
|
|
310
|
-
registryPaths,
|
|
311
|
-
packageName: packageDocument.name,
|
|
312
|
-
providerVersion: packageDocument.version,
|
|
313
|
-
digest: calculateCliSourceSetDigest(packageBytes, CLI_REGISTRY_RELATIVE_PATHS.map((relativePath, index) => [relativePath, registryBytes[index]])),
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
async function materializeExternalCliProvider(provider, outputRoot, label) {
|
|
317
|
-
await fs.mkdir(path.join(outputRoot, 'src', 'utils'), { recursive: true });
|
|
318
|
-
await Promise.all([
|
|
319
|
-
fs.copyFile(provider.packagePath, path.join(outputRoot, 'package.json')),
|
|
320
|
-
...CLI_REGISTRY_RELATIVE_PATHS.map((relativePath, index) => fs.copyFile(provider.registryPaths[index], path.join(outputRoot, ...relativePath.split('/')))),
|
|
321
|
-
]);
|
|
322
|
-
return inspectWorkspaceCliSourceSet(outputRoot, label);
|
|
323
|
-
}
|
|
324
|
-
async function resolveCliVirtualSourceSets(options) {
|
|
325
|
-
const baseSource = await inspectWorkspaceCliSourceSet(path.join(options.baseSourceRoot, 'packages', 'cli'), 'Git base', options.baseSourceRoot);
|
|
326
|
-
const currentSource = await inspectWorkspaceCliSourceSet(path.join(options.repoRoot, 'packages', 'cli'), 'current workspace', options.repoRoot);
|
|
327
|
-
if (baseSource.state === 'partial') {
|
|
328
|
-
throw codedError('invalidPlugin', 'Git base contains an incomplete @aw/cli virtual authoring source set.');
|
|
329
|
-
}
|
|
330
|
-
if (currentSource.state === 'partial') {
|
|
331
|
-
throw codedError('invalidPlugin', 'Found an incomplete current workspace @aw/cli source set.');
|
|
332
|
-
}
|
|
333
|
-
if (baseSource.state !== currentSource.state) {
|
|
334
|
-
throw codedError('invalidPlugin', 'Git base and current workspace CLI source ownership differs; version checking cannot mix workspace and external providers.');
|
|
335
|
-
}
|
|
336
|
-
if (baseSource.state === 'complete') {
|
|
337
|
-
const currentMaterialized = await materializeCliSourceSet(currentSource, path.join(options.tempRoot, 'current-cli-workspace'), 'current workspace materialization');
|
|
338
|
-
return {
|
|
339
|
-
base: baseSource,
|
|
340
|
-
current: currentMaterialized,
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
const externalProvider = await inspectExternalCliProvider(options.cliPackageRoot);
|
|
344
|
-
const [baseExternal, currentExternal] = await Promise.all([
|
|
345
|
-
materializeExternalCliProvider(externalProvider, path.join(options.tempRoot, 'base-cli-external'), 'base external CLI provider'),
|
|
346
|
-
materializeExternalCliProvider(externalProvider, path.join(options.tempRoot, 'current-cli-external'), 'current external CLI provider'),
|
|
347
|
-
]);
|
|
348
|
-
for (const materialized of [baseExternal, currentExternal]) {
|
|
349
|
-
if (materialized.state !== 'complete'
|
|
350
|
-
|| materialized.packageName !== externalProvider.packageName
|
|
351
|
-
|| materialized.providerVersion !== externalProvider.providerVersion
|
|
352
|
-
|| materialized.digest !== externalProvider.digest) {
|
|
353
|
-
throw codedError('invalidPlugin', 'External CLI provider identity changed during independent materialization.');
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
if (baseExternal.root === currentExternal.root || baseExternal.digest !== currentExternal.digest) {
|
|
357
|
-
throw codedError('invalidPlugin', 'External CLI provider materializations are not independent and identical.');
|
|
358
|
-
}
|
|
359
|
-
return { base: baseExternal, current: currentExternal };
|
|
360
|
-
}
|
|
361
|
-
async function readManifestDocument(pluginRoot) {
|
|
378
|
+
export async function readManifestDocument(pluginRoot) {
|
|
362
379
|
const manifestPath = path.join(pluginRoot, '.agents-plugin', 'plugin.json');
|
|
363
380
|
let manifest;
|
|
364
381
|
try {
|
|
@@ -401,16 +418,13 @@ function compareBundleEntries(baseEntries, currentEntries) {
|
|
|
401
418
|
.filter((filePath) => baseEntries.get(filePath) !== currentEntries.get(filePath))
|
|
402
419
|
.sort();
|
|
403
420
|
}
|
|
404
|
-
async function bundlePlugin(bundler, sourceSetRoot,
|
|
421
|
+
async function bundlePlugin(bundler, sourceSetRoot, pluginRoot, outputRoot, runtimeSkillClosureValidation = 'current') {
|
|
405
422
|
const sourceSetPlugins = await bundler.discoverPlugins(sourceSetRoot);
|
|
406
423
|
const plugin = await bundler.readPluginManifest(pluginRoot);
|
|
407
424
|
if (!sourceSetPlugins.some((candidate) => candidate.manifest.name === plugin.manifest.name)) {
|
|
408
425
|
sourceSetPlugins.push(plugin);
|
|
409
426
|
}
|
|
410
|
-
const runtimeResolver = bundler.createRuntimeResolver(sourceSetPlugins
|
|
411
|
-
cliVirtualExportRoot,
|
|
412
|
-
cliProviderVersion,
|
|
413
|
-
});
|
|
427
|
+
const runtimeResolver = bundler.createRuntimeResolver(sourceSetPlugins);
|
|
414
428
|
await bundler.bundleLocalPlugin(plugin, outputRoot, {
|
|
415
429
|
buildMode: 'staging',
|
|
416
430
|
runtimeResolver,
|
|
@@ -439,7 +453,7 @@ function createCheckResult(pluginName, values = {}) {
|
|
|
439
453
|
};
|
|
440
454
|
}
|
|
441
455
|
async function checkOnePlugin(options) {
|
|
442
|
-
const { repoRoot, pluginName, bundler, tempRoot, baseSourceRoot,
|
|
456
|
+
const { repoRoot, pluginName, bundler, tempRoot, baseSourceRoot, currentRoot, baseRoot, } = options;
|
|
443
457
|
if (!PLUGIN_NAME_PATTERN.test(pluginName)) {
|
|
444
458
|
return createCheckResult(pluginName, {
|
|
445
459
|
ok: false,
|
|
@@ -476,7 +490,7 @@ async function checkOnePlugin(options) {
|
|
|
476
490
|
if (!baseRoot) {
|
|
477
491
|
let currentBundle;
|
|
478
492
|
try {
|
|
479
|
-
currentBundle = await bundlePlugin(bundler, repoRoot,
|
|
493
|
+
currentBundle = await bundlePlugin(bundler, repoRoot, currentRoot, path.join(tempRoot, 'bundles', pluginName, 'current'));
|
|
480
494
|
}
|
|
481
495
|
catch (error) {
|
|
482
496
|
return createCheckResult(pluginName, {
|
|
@@ -520,8 +534,8 @@ async function checkOnePlugin(options) {
|
|
|
520
534
|
let bundleResults;
|
|
521
535
|
try {
|
|
522
536
|
bundleResults = await Promise.allSettled([
|
|
523
|
-
bundlePlugin(bundler, baseSourceRoot,
|
|
524
|
-
bundlePlugin(bundler, repoRoot,
|
|
537
|
+
bundlePlugin(bundler, baseSourceRoot, baseRoot, path.join(tempRoot, 'bundles', pluginName, 'base'), 'historical'),
|
|
538
|
+
bundlePlugin(bundler, repoRoot, currentRoot, path.join(tempRoot, 'bundles', pluginName, 'current')),
|
|
525
539
|
]);
|
|
526
540
|
}
|
|
527
541
|
finally {
|
|
@@ -702,12 +716,6 @@ export async function checkPluginVersions(options = {}) {
|
|
|
702
716
|
}
|
|
703
717
|
currentRoots.set(pluginName, currentRoot);
|
|
704
718
|
}
|
|
705
|
-
const cliVirtualSources = await resolveCliVirtualSourceSets({
|
|
706
|
-
baseSourceRoot,
|
|
707
|
-
repoRoot,
|
|
708
|
-
cliPackageRoot,
|
|
709
|
-
tempRoot,
|
|
710
|
-
});
|
|
711
719
|
const checks = [];
|
|
712
720
|
for (const pluginName of pluginNames) {
|
|
713
721
|
const currentRoot = currentRoots.get(pluginName);
|
|
@@ -730,7 +738,6 @@ export async function checkPluginVersions(options = {}) {
|
|
|
730
738
|
bundler,
|
|
731
739
|
tempRoot,
|
|
732
740
|
baseSourceRoot,
|
|
733
|
-
cliVirtualSources,
|
|
734
741
|
currentRoot,
|
|
735
742
|
baseRoot,
|
|
736
743
|
}));
|