@lesliechan721/aw 0.1.0-beta.8 → 0.1.0-beta.81
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 +221 -0
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -0
- package/dist/authoring/scripts/add-skill.mjs +17 -40
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +74 -98
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-root.mjs +4 -4
- package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +1 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +230 -9
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.d.mts +79 -92
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +103 -127
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/remove-plugin.mjs +2 -2
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +490 -2841
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-skill.mjs +1 -1
- package/dist/native-runtime/reader-runtime.mjs +34 -0
- package/dist/native-runtime/reader.d.mts +6 -0
- package/dist/native-runtime/reader.mjs +11 -0
- package/dist/scripts/aw-skill-eval-materializer.d.ts +30 -0
- package/dist/scripts/aw-skill-eval-materializer.js +278 -0
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
- package/dist/scripts/bundle-plugins.d.ts +1 -0
- package/dist/scripts/bundle-plugins.js +27 -8
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +7 -8
- package/dist/scripts/plugin-staging.js +16 -15
- package/dist/scripts/plugin-staging.js.map +1 -1
- package/dist/scripts/plugin-test-reporter.d.mts +2 -0
- package/dist/scripts/plugin-test-reporter.mjs +21 -0
- package/dist/scripts/plugin-test-reporter.mjs.map +1 -0
- package/dist/scripts/test-plugin-scripts.d.ts +5 -0
- package/dist/scripts/test-plugin-scripts.js +273 -78
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/scripts/test-workers.d.mts +24 -0
- package/dist/scripts/test-workers.mjs +59 -0
- package/dist/scripts/test-workers.mjs.map +1 -0
- package/dist/src/adapters/helpers.d.ts +7 -0
- package/dist/src/adapters/helpers.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +5 -1
- package/dist/src/authoring/workspace-commands.js +7 -2
- package/dist/src/authoring/workspace-commands.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +2 -2
- package/dist/src/commands/aw-capabilities.js +41 -29
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/catalog-dev-source.d.ts +58 -13
- package/dist/src/commands/catalog-dev-source.js +549 -305
- package/dist/src/commands/catalog-dev-source.js.map +1 -1
- package/dist/src/commands/catalog-generation.d.ts +14 -19
- package/dist/src/commands/catalog-generation.js +5 -10
- package/dist/src/commands/catalog-generation.js.map +1 -1
- package/dist/src/commands/catalog-publication-inspection.d.ts +70 -30
- package/dist/src/commands/catalog-publication-inspection.js +511 -91
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
- 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 +2 -1
- package/dist/src/commands/catalog-publication-target.js +37 -2
- package/dist/src/commands/catalog-publication-target.js.map +1 -1
- package/dist/src/commands/catalog-publish.d.ts +82 -15
- package/dist/src/commands/catalog-publish.js +722 -219
- package/dist/src/commands/catalog-publish.js.map +1 -1
- package/dist/src/commands/catalog-source.d.ts +55 -35
- package/dist/src/commands/catalog-source.js +298 -148
- package/dist/src/commands/catalog-source.js.map +1 -1
- package/dist/src/commands/catalog-status.d.ts +6 -26
- package/dist/src/commands/catalog-status.js +9 -147
- package/dist/src/commands/catalog-status.js.map +1 -1
- 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 +17 -0
- package/dist/src/commands/catalog-workspace-resolution.js +57 -0
- package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
- package/dist/src/commands/console.js +32 -20
- 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/deployment-confirmation.d.ts +4 -0
- package/dist/src/commands/deployment-confirmation.js +20 -0
- package/dist/src/commands/deployment-confirmation.js.map +1 -0
- 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/intent-command.d.ts +32 -0
- package/dist/src/commands/intent-command.js +171 -0
- package/dist/src/commands/intent-command.js.map +1 -0
- package/dist/src/commands/managed-commands.d.ts +35 -0
- package/dist/src/commands/managed-commands.js +361 -0
- package/dist/src/commands/managed-commands.js.map +1 -0
- package/dist/src/commands/offline-cleanup-evidence.d.ts +46 -0
- package/dist/src/commands/offline-cleanup-evidence.js +158 -10
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +190 -0
- package/dist/src/commands/operation-plan.js +99 -0
- package/dist/src/commands/operation-plan.js.map +1 -0
- package/dist/src/commands/operation-planner.d.ts +47 -0
- package/dist/src/commands/operation-planner.js +142 -0
- package/dist/src/commands/operation-planner.js.map +1 -0
- package/dist/src/commands/options.d.ts +16 -20
- package/dist/src/commands/options.js +94 -41
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +88 -45
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-config-confirmation.d.ts +8 -0
- package/dist/src/commands/public-config-confirmation.js +56 -0
- package/dist/src/commands/public-config-confirmation.js.map +1 -0
- package/dist/src/commands/public-interruption.d.ts +9 -0
- package/dist/src/commands/public-interruption.js +23 -0
- package/dist/src/commands/public-interruption.js.map +1 -0
- package/dist/src/commands/public-lifecycle-result.d.ts +102 -0
- package/dist/src/commands/public-lifecycle-result.js +307 -0
- package/dist/src/commands/public-lifecycle-result.js.map +1 -0
- package/dist/src/commands/public-lifecycle.d.ts +28 -0
- package/dist/src/commands/public-lifecycle.js +492 -0
- package/dist/src/commands/public-lifecycle.js.map +1 -0
- package/dist/src/commands/public-plugin-query.d.ts +16 -0
- package/dist/src/commands/public-plugin-query.js +193 -0
- package/dist/src/commands/public-plugin-query.js.map +1 -0
- package/dist/src/commands/rebuild-command.d.ts +166 -28
- package/dist/src/commands/rebuild-command.js +3745 -813
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +137 -25
- package/dist/src/commands/rebuild-integration.js +1343 -2535
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +73 -22
- package/dist/src/commands/rebuild-operations.js +313 -216
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +62 -0
- package/dist/src/commands/rebuild-platform-integration.js +1317 -0
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -0
- 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 +60 -0
- package/dist/src/commands/review-inspection.js +436 -0
- package/dist/src/commands/review-inspection.js.map +1 -0
- package/dist/src/commands/review-preparation.d.ts +51 -0
- package/dist/src/commands/review-preparation.js +400 -0
- package/dist/src/commands/review-preparation.js.map +1 -0
- package/dist/src/commands/runtime.d.ts +6 -6
- package/dist/src/commands/runtime.js +44 -24
- package/dist/src/commands/runtime.js.map +1 -1
- package/dist/src/commands/skill-eval.d.ts +41 -0
- package/dist/src/commands/skill-eval.js +407 -0
- package/dist/src/commands/skill-eval.js.map +1 -0
- package/dist/src/commands/status-v6.d.ts +319 -0
- package/dist/src/commands/status-v6.js +2979 -0
- package/dist/src/commands/status-v6.js.map +1 -0
- package/dist/src/commands/targets-command.d.ts +38 -0
- package/dist/src/commands/targets-command.js +182 -0
- package/dist/src/commands/targets-command.js.map +1 -0
- package/dist/src/commands/wizard.d.ts +8 -5
- package/dist/src/commands/wizard.js +7 -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 +143 -85
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +6 -6
- package/dist/src/constants.js +6 -6
- package/dist/src/constants.js.map +1 -1
- package/dist/src/eval/manifest-v1.d.ts +70 -0
- package/dist/src/eval/manifest-v1.js +358 -0
- package/dist/src/eval/manifest-v1.js.map +1 -0
- package/dist/src/generators/local-plugin.d.ts +7 -2
- package/dist/src/generators/local-plugin.js +313 -389
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/generators/permissions.d.ts +5 -2
- package/dist/src/generators/permissions.js +28 -15
- package/dist/src/generators/permissions.js.map +1 -1
- package/dist/src/index.d.ts +2 -31
- package/dist/src/index.js +1666 -1827
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent/deployment-preferences.d.ts +63 -0
- package/dist/src/intent/deployment-preferences.js +170 -0
- package/dist/src/intent/deployment-preferences.js.map +1 -0
- package/dist/src/intent/diagnostics.d.ts +11 -0
- package/dist/src/intent/diagnostics.js +14 -0
- package/dist/src/intent/diagnostics.js.map +1 -0
- package/dist/src/intent/intent-codec.d.ts +19 -0
- package/dist/src/intent/intent-codec.js +117 -0
- package/dist/src/intent/intent-codec.js.map +1 -0
- package/dist/src/intent/intent-store.d.ts +43 -0
- package/dist/src/intent/intent-store.js +118 -0
- package/dist/src/intent/intent-store.js.map +1 -0
- package/dist/src/intent/scope-context.d.ts +33 -0
- package/dist/src/intent/scope-context.js +149 -0
- package/dist/src/intent/scope-context.js.map +1 -0
- package/dist/src/intent/work-context.d.ts +13 -0
- package/dist/src/intent/work-context.js +22 -0
- package/dist/src/intent/work-context.js.map +1 -0
- package/dist/src/output/command-receipt.d.ts +47 -46
- package/dist/src/output/command-receipt.js +286 -79
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/model.d.ts +3 -11
- package/dist/src/output/native-consent.d.ts +2 -0
- package/dist/src/output/native-consent.js +5 -0
- package/dist/src/output/native-consent.js.map +1 -0
- package/dist/src/output/public-result.d.ts +49 -0
- package/dist/src/output/public-result.js +240 -0
- package/dist/src/output/public-result.js.map +1 -0
- package/dist/src/output/rebuild-progress.js +20 -15
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.d.ts +7 -0
- package/dist/src/output/receipt-projection.js +592 -0
- package/dist/src/output/receipt-projection.js.map +1 -0
- package/dist/src/platforms/capabilities.d.ts +12 -0
- package/dist/src/platforms/capabilities.js +205 -0
- package/dist/src/platforms/capabilities.js.map +1 -0
- package/dist/src/platforms/contracts.d.ts +358 -0
- package/dist/src/platforms/contracts.js +2 -0
- package/dist/src/platforms/contracts.js.map +1 -0
- package/dist/src/platforms/cursor-workspace-hook.d.ts +28 -0
- package/dist/src/platforms/cursor-workspace-hook.js +198 -0
- package/dist/src/platforms/cursor-workspace-hook.js.map +1 -0
- package/dist/src/platforms/discovery.d.ts +91 -0
- package/dist/src/platforms/discovery.js +653 -0
- package/dist/src/platforms/discovery.js.map +1 -0
- package/dist/src/platforms/gemini-activation.d.ts +36 -0
- package/dist/src/platforms/gemini-activation.js +331 -0
- package/dist/src/platforms/gemini-activation.js.map +1 -0
- package/dist/src/platforms/gemini-consent.d.ts +8 -0
- package/dist/src/platforms/gemini-consent.js +81 -0
- package/dist/src/platforms/gemini-consent.js.map +1 -0
- package/dist/src/platforms/identity.d.ts +4 -0
- package/dist/src/platforms/identity.js +22 -0
- package/dist/src/platforms/identity.js.map +1 -0
- package/dist/src/platforms/inspection-grok.d.ts +4 -0
- package/dist/src/platforms/inspection-grok.js +212 -0
- package/dist/src/platforms/inspection-grok.js.map +1 -0
- package/dist/src/platforms/inspection-native.d.ts +6 -0
- package/dist/src/platforms/inspection-native.js +406 -0
- package/dist/src/platforms/inspection-native.js.map +1 -0
- package/dist/src/platforms/inspection-opencode.d.ts +4 -0
- package/dist/src/platforms/inspection-opencode.js +98 -0
- package/dist/src/platforms/inspection-opencode.js.map +1 -0
- package/dist/src/platforms/inspection-pi.d.ts +3 -0
- package/dist/src/platforms/inspection-pi.js +282 -0
- package/dist/src/platforms/inspection-pi.js.map +1 -0
- package/dist/src/platforms/inspection-query.d.ts +12 -0
- package/dist/src/platforms/inspection-query.js +96 -0
- package/dist/src/platforms/inspection-query.js.map +1 -0
- package/dist/src/platforms/inspection.d.ts +17 -0
- package/dist/src/platforms/inspection.js +227 -0
- package/dist/src/platforms/inspection.js.map +1 -0
- package/dist/src/platforms/layout.d.ts +21 -0
- package/dist/src/platforms/layout.js +239 -0
- package/dist/src/platforms/layout.js.map +1 -0
- package/dist/src/platforms/lifecycle-native-services.d.ts +3 -0
- package/dist/src/platforms/lifecycle-native-services.js +147 -0
- package/dist/src/platforms/lifecycle-native-services.js.map +1 -0
- package/dist/src/platforms/lifecycle-native.d.ts +13 -0
- package/dist/src/platforms/lifecycle-native.js +283 -0
- package/dist/src/platforms/lifecycle-native.js.map +1 -0
- package/dist/src/platforms/lifecycle.d.ts +25 -0
- package/dist/src/platforms/lifecycle.js +494 -0
- package/dist/src/platforms/lifecycle.js.map +1 -0
- package/dist/src/platforms/managed-command-placement.d.ts +8 -0
- package/dist/src/platforms/managed-command-placement.js +79 -0
- package/dist/src/platforms/managed-command-placement.js.map +1 -0
- package/dist/src/platforms/projection-code-extension.d.ts +8 -0
- package/dist/src/platforms/projection-code-extension.js +121 -0
- package/dist/src/platforms/projection-code-extension.js.map +1 -0
- package/dist/src/platforms/projection-command-resources.d.ts +7 -0
- package/dist/src/platforms/projection-command-resources.js +74 -0
- package/dist/src/platforms/projection-command-resources.js.map +1 -0
- package/dist/src/platforms/projection-files.d.ts +27 -0
- package/dist/src/platforms/projection-files.js +111 -0
- package/dist/src/platforms/projection-files.js.map +1 -0
- package/dist/src/platforms/projection-marketplace.d.ts +19 -0
- package/dist/src/platforms/projection-marketplace.js +42 -0
- package/dist/src/platforms/projection-marketplace.js.map +1 -0
- package/dist/src/platforms/projection.d.ts +10 -0
- package/dist/src/platforms/projection.js +446 -0
- package/dist/src/platforms/projection.js.map +1 -0
- package/dist/src/platforms/registry.d.ts +4 -0
- package/dist/src/platforms/registry.js +30 -0
- package/dist/src/platforms/registry.js.map +1 -0
- package/dist/src/platforms/supplement-layout.d.ts +16 -0
- package/dist/src/platforms/supplement-layout.js +31 -0
- package/dist/src/platforms/supplement-layout.js.map +1 -0
- package/dist/src/platforms/supplement-state.d.ts +13 -0
- package/dist/src/platforms/supplement-state.js +82 -0
- package/dist/src/platforms/supplement-state.js.map +1 -0
- package/dist/src/portable/commands.d.ts +58 -11
- package/dist/src/portable/commands.js +94 -350
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/historical-materialization.d.ts +22 -0
- package/dist/src/portable/historical-materialization.js +124 -0
- package/dist/src/portable/historical-materialization.js.map +1 -0
- package/dist/src/portable/materializer.d.ts +24 -4
- package/dist/src/portable/materializer.js +189 -259
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery-layout.d.ts +17 -0
- package/dist/src/portable/recovery-layout.js +42 -0
- package/dist/src/portable/recovery-layout.js.map +1 -0
- package/dist/src/portable/recovery.d.ts +153 -0
- package/dist/src/portable/recovery.js +367 -0
- package/dist/src/portable/recovery.js.map +1 -0
- package/dist/src/portable/writer.d.ts +67 -0
- package/dist/src/portable/writer.js +321 -0
- package/dist/src/portable/writer.js.map +1 -0
- package/dist/src/recovery/coordinator.d.ts +141 -0
- package/dist/src/recovery/coordinator.js +1254 -0
- package/dist/src/recovery/coordinator.js.map +1 -0
- package/dist/src/recovery/demand.d.ts +51 -0
- package/dist/src/recovery/demand.js +159 -0
- package/dist/src/recovery/demand.js.map +1 -0
- package/dist/src/recovery/joint-coordinator.d.ts +25 -0
- package/dist/src/recovery/joint-coordinator.js +991 -0
- package/dist/src/recovery/joint-coordinator.js.map +1 -0
- package/dist/src/recovery/joint-demand.d.ts +50 -0
- package/dist/src/recovery/joint-demand.js +197 -0
- package/dist/src/recovery/joint-demand.js.map +1 -0
- package/dist/src/recovery/performance.d.ts +4 -0
- package/dist/src/recovery/performance.js +26 -0
- package/dist/src/recovery/performance.js.map +1 -0
- package/dist/src/recovery/receipt.d.ts +98 -0
- package/dist/src/recovery/receipt.js +2 -0
- package/dist/src/recovery/receipt.js.map +1 -0
- package/dist/src/recovery/retirement.d.ts +47 -0
- package/dist/src/recovery/retirement.js +469 -0
- package/dist/src/recovery/retirement.js.map +1 -0
- package/dist/src/recovery/status.d.ts +126 -0
- package/dist/src/recovery/status.js +1073 -0
- package/dist/src/recovery/status.js.map +1 -0
- package/dist/src/recovery/types.d.ts +85 -0
- package/dist/src/recovery/types.js +2 -0
- package/dist/src/recovery/types.js.map +1 -0
- 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/platform-profile.d.ts +3 -0
- package/dist/src/review/platform-profile.js +14 -0
- package/dist/src/review/platform-profile.js.map +1 -0
- package/dist/src/review/review-profile.d.ts +20 -0
- package/dist/src/review/review-profile.js +276 -0
- package/dist/src/review/review-profile.js.map +1 -0
- package/dist/src/review/review-selection.d.ts +20 -0
- package/dist/src/review/review-selection.js +495 -0
- package/dist/src/review/review-selection.js.map +1 -0
- package/dist/src/review/review-types.d.ts +71 -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 +62 -0
- package/dist/src/review/skill-materialization.js +205 -0
- package/dist/src/review/skill-materialization.js.map +1 -0
- package/dist/src/review/source-binding.d.ts +201 -0
- package/dist/src/review/source-binding.js +773 -0
- package/dist/src/review/source-binding.js.map +1 -0
- package/dist/src/tui/agent-management.d.ts +23 -0
- package/dist/src/tui/agent-management.js +319 -0
- package/dist/src/tui/agent-management.js.map +1 -0
- package/dist/src/tui/agent-settings.d.ts +47 -0
- package/dist/src/tui/agent-settings.js +97 -0
- package/dist/src/tui/agent-settings.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 +18 -53
- package/dist/src/tui/catalog-generation.js +136 -224
- package/dist/src/tui/catalog-generation.js.map +1 -1
- 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 +113 -3
- package/dist/src/tui/components.js +201 -36
- 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 +43 -0
- package/dist/src/tui/config-leaf-editor.js +224 -0
- package/dist/src/tui/config-leaf-editor.js.map +1 -0
- package/dist/src/tui/config-references.d.ts +38 -0
- package/dist/src/tui/config-references.js +82 -0
- package/dist/src/tui/config-references.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 +13 -4
- package/dist/src/tui/console-app-v4.js +9764 -2210
- 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 +7 -4
- package/dist/src/tui/controller-runtime.js +2064 -779
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +669 -106
- package/dist/src/tui/controller.js +3617 -971
- 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/deployment-view.d.ts +10 -0
- package/dist/src/tui/deployment-view.js +108 -0
- package/dist/src/tui/deployment-view.js.map +1 -0
- package/dist/src/tui/diagnostic-projection.d.ts +23 -0
- package/dist/src/tui/diagnostic-projection.js +595 -0
- package/dist/src/tui/diagnostic-projection.js.map +1 -0
- package/dist/src/tui/diagnostics.d.ts +6 -3
- package/dist/src/tui/diagnostics.js +14 -2
- package/dist/src/tui/diagnostics.js.map +1 -1
- package/dist/src/tui/entity-cards.d.ts +55 -0
- package/dist/src/tui/entity-cards.js +298 -0
- package/dist/src/tui/entity-cards.js.map +1 -0
- package/dist/src/tui/glossary.d.ts +25 -0
- package/dist/src/tui/glossary.js +72 -0
- package/dist/src/tui/glossary.js.map +1 -0
- package/dist/src/tui/index.d.ts +6 -2
- package/dist/src/tui/index.js +5 -2
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/input-display.d.ts +1 -0
- package/dist/src/tui/input-display.js +23 -1
- package/dist/src/tui/input-display.js.map +1 -1
- 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 +243 -45
- package/dist/src/tui/model.js +1402 -415
- 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 +72 -0
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -0
- package/dist/src/tui/operation-history.d.ts +82 -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 +28 -0
- package/dist/src/tui/operation-review-planner.js +1396 -0
- package/dist/src/tui/operation-review-planner.js.map +1 -0
- package/dist/src/tui/plugin-content.d.ts +33 -0
- package/dist/src/tui/plugin-content.js +245 -0
- package/dist/src/tui/plugin-content.js.map +1 -0
- package/dist/src/tui/plugin-detail.d.ts +72 -0
- package/dist/src/tui/plugin-detail.js +260 -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/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 +38 -0
- package/dist/src/tui/reader.js +49 -0
- package/dist/src/tui/reader.js.map +1 -0
- package/dist/src/tui/router.d.ts +186 -35
- package/dist/src/tui/router.js +338 -50
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/scoped-flow.d.ts +45 -0
- package/dist/src/tui/scoped-flow.js +96 -0
- package/dist/src/tui/scoped-flow.js.map +1 -0
- package/dist/src/tui/scoped-inventory.d.ts +126 -0
- package/dist/src/tui/scoped-inventory.js +258 -0
- package/dist/src/tui/scoped-inventory.js.map +1 -0
- package/dist/src/tui/screen-registry.d.ts +701 -0
- package/dist/src/tui/screen-registry.js +226 -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 +219 -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/theme.d.ts +12 -0
- package/dist/src/tui/theme.js +12 -0
- package/dist/src/tui/theme.js.map +1 -1
- package/dist/src/tui/viewport.d.ts +1 -0
- package/dist/src/tui/viewport.js +23 -0
- package/dist/src/tui/viewport.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 +220 -118
- package/dist/src/types.js +1 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.d.ts +13 -4
- package/dist/src/utils/agent-version.js +27 -4
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.d.ts +33 -7
- package/dist/src/utils/artifact-plan.js +115 -430
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +114 -83
- package/dist/src/utils/artifact-renderer.js +213 -364
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +44 -0
- package/dist/src/utils/artifact-request.js +80 -0
- package/dist/src/utils/artifact-request.js.map +1 -0
- package/dist/src/utils/artifact-sources.d.ts +6 -2
- package/dist/src/utils/artifact-sources.js +17 -0
- package/dist/src/utils/artifact-sources.js.map +1 -1
- package/dist/src/utils/bundle-layout.js +57 -173
- 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 +2 -2
- package/dist/src/utils/catalog-digests.js +7 -18
- 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 +5 -1
- package/dist/src/utils/catalog-generation-error.js +14 -0
- package/dist/src/utils/catalog-generation-error.js.map +1 -1
- package/dist/src/utils/catalog-generation-resolver.d.ts +36 -5
- package/dist/src/utils/catalog-generation-resolver.js +221 -77
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -1
- package/dist/src/utils/catalog-generation-service.d.ts +159 -28
- package/dist/src/utils/catalog-generation-service.js +1186 -525
- package/dist/src/utils/catalog-generation-service.js.map +1 -1
- package/dist/src/utils/catalog-generation-state.d.ts +9 -0
- package/dist/src/utils/catalog-generation-state.js +97 -106
- package/dist/src/utils/catalog-generation-state.js.map +1 -1
- package/dist/src/utils/catalog-generation-store.d.ts +38 -24
- package/dist/src/utils/catalog-generation-store.js +337 -272
- package/dist/src/utils/catalog-generation-store.js.map +1 -1
- package/dist/src/utils/catalog-manifest-v7.d.ts +5 -0
- package/dist/src/utils/{catalog-manifest-v5.js → catalog-manifest-v7.js} +23 -35
- package/dist/src/utils/catalog-manifest-v7.js.map +1 -0
- package/dist/src/utils/catalog-operation-context.d.ts +6 -14
- package/dist/src/utils/catalog-operation-context.js +69 -169
- package/dist/src/utils/catalog-operation-context.js.map +1 -1
- package/dist/src/utils/catalog-public-error.js +8 -4
- package/dist/src/utils/catalog-public-error.js.map +1 -1
- package/dist/src/utils/catalog-runtime-projection.d.ts +7 -3
- package/dist/src/utils/catalog-runtime-projection.js +5 -40
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
- package/dist/src/utils/catalog-snapshot.d.ts +2 -2
- 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 +23 -2
- package/dist/src/utils/catalog-source-references.js +456 -382
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/catalog-sources.d.ts +14 -1
- package/dist/src/utils/catalog-sources.js +178 -18
- 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 +22 -1
- package/dist/src/utils/codex-config.js.map +1 -1
- package/dist/src/utils/codex-executable-discovery.d.ts +28 -0
- package/dist/src/utils/codex-executable-discovery.js +431 -0
- package/dist/src/utils/codex-executable-discovery.js.map +1 -0
- package/dist/src/utils/codex-manager.d.ts +47 -18
- package/dist/src/utils/codex-manager.js +88 -622
- package/dist/src/utils/codex-manager.js.map +1 -1
- 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 +169 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -0
- package/dist/src/utils/codex-reconciler.d.ts +123 -0
- package/dist/src/utils/codex-reconciler.js +322 -0
- package/dist/src/utils/codex-reconciler.js.map +1 -0
- package/dist/src/utils/codex-shared-native.d.ts +45 -0
- package/dist/src/utils/codex-shared-native.js +122 -0
- package/dist/src/utils/codex-shared-native.js.map +1 -0
- package/dist/src/utils/codex-skill-staging.d.ts +4 -3
- package/dist/src/utils/codex-skill-staging.js.map +1 -1
- package/dist/src/utils/codex-skills-root.d.ts +4 -0
- package/dist/src/utils/codex-skills-root.js +25 -0
- package/dist/src/utils/codex-skills-root.js.map +1 -0
- package/dist/src/utils/codex-surface-analysis.d.ts +49 -0
- package/dist/src/utils/codex-surface-analysis.js +220 -0
- package/dist/src/utils/codex-surface-analysis.js.map +1 -0
- package/dist/src/utils/component-command-preparation.d.ts +34 -0
- package/dist/src/utils/component-command-preparation.js +228 -0
- package/dist/src/utils/component-command-preparation.js.map +1 -0
- package/dist/src/utils/component-resources.d.ts +51 -0
- package/dist/src/utils/component-resources.js +322 -0
- package/dist/src/utils/component-resources.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +18 -6
- package/dist/src/utils/dynamic-skill-tree.js +32 -9
- 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 +167 -120
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/inventory-recovery-diagnostic.d.ts +4 -0
- package/dist/src/utils/inventory-recovery-diagnostic.js +15 -0
- package/dist/src/utils/inventory-recovery-diagnostic.js.map +1 -0
- package/dist/src/utils/local-marketplace.d.ts +17 -12
- package/dist/src/utils/local-marketplace.js +85 -195
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/managed-command-closure.d.ts +3 -0
- package/dist/src/utils/managed-command-closure.js +35 -0
- package/dist/src/utils/managed-command-closure.js.map +1 -0
- package/dist/src/utils/managed-command-evidence.d.ts +7 -0
- package/dist/src/utils/managed-command-evidence.js +10 -0
- package/dist/src/utils/managed-command-evidence.js.map +1 -0
- package/dist/src/utils/managed-command-materialization.d.ts +124 -0
- package/dist/src/utils/managed-command-materialization.js +369 -0
- package/dist/src/utils/managed-command-materialization.js.map +1 -0
- package/dist/src/utils/managed-command-preparation.d.ts +67 -0
- package/dist/src/utils/managed-command-preparation.js +146 -0
- package/dist/src/utils/managed-command-preparation.js.map +1 -0
- package/dist/src/utils/managed-command-review.d.ts +26 -0
- package/dist/src/utils/managed-command-review.js +68 -0
- package/dist/src/utils/managed-command-review.js.map +1 -0
- package/dist/src/utils/managed-command-runtime.d.ts +33 -0
- package/dist/src/utils/managed-command-runtime.js +121 -0
- package/dist/src/utils/managed-command-runtime.js.map +1 -0
- package/dist/src/utils/managed-command-store.d.ts +143 -0
- package/dist/src/utils/managed-command-store.js +665 -0
- package/dist/src/utils/managed-command-store.js.map +1 -0
- package/dist/src/utils/manifest.d.ts +1 -3
- package/dist/src/utils/manifest.js +1 -3
- package/dist/src/utils/manifest.js.map +1 -1
- package/dist/src/utils/multi-source-catalog.d.ts +1 -10
- package/dist/src/utils/multi-source-catalog.js +9 -175
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +74 -5
- package/dist/src/utils/native-cli.js +479 -31
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-demand.d.ts +29 -0
- package/dist/src/utils/native-demand.js +4 -0
- package/dist/src/utils/native-demand.js.map +1 -0
- package/dist/src/utils/native-tool-context.d.ts +14 -0
- package/dist/src/utils/native-tool-context.js +38 -0
- package/dist/src/utils/native-tool-context.js.map +1 -0
- package/dist/src/utils/native-tool-review.d.ts +18 -0
- package/dist/src/utils/native-tool-review.js +116 -0
- package/dist/src/utils/native-tool-review.js.map +1 -0
- package/dist/src/utils/orphan-marketplace-cleanup.js +0 -1
- package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +103 -21
- package/dist/src/utils/ownership.js +232 -210
- 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 +47 -62
- package/dist/src/utils/path-catalog-provider.js.map +1 -1
- package/dist/src/utils/paths.d.ts +1 -2
- package/dist/src/utils/paths.js +5 -3
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/platform-empty-state.d.ts +45 -0
- package/dist/src/utils/platform-empty-state.js +159 -0
- package/dist/src/utils/platform-empty-state.js.map +1 -0
- package/dist/src/utils/platform-support.d.ts +1 -1
- package/dist/src/utils/platform-support.js +1 -1
- package/dist/src/utils/platform-support.js.map +1 -1
- package/dist/src/utils/plugin-config-impact.d.ts +64 -0
- package/dist/src/utils/plugin-config-impact.js +307 -0
- package/dist/src/utils/plugin-config-impact.js.map +1 -0
- package/dist/src/utils/plugin-config-references.d.ts +89 -0
- package/dist/src/utils/plugin-config-references.js +335 -0
- package/dist/src/utils/plugin-config-references.js.map +1 -0
- package/dist/src/utils/plugin-config-write.d.ts +109 -27
- package/dist/src/utils/plugin-config-write.js +1242 -348
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +187 -109
- package/dist/src/utils/plugin-config.js +916 -1147
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/plugin-dependencies.d.ts +1 -1
- package/dist/src/utils/plugin-dependencies.js.map +1 -1
- package/dist/src/utils/plugin-scripts.d.ts +78 -127
- package/dist/src/utils/plugin-scripts.js +566 -524
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-lock.js +14 -5
- package/dist/src/utils/process-lock.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/rendered-contract.js +18 -1
- package/dist/src/utils/rendered-contract.js.map +1 -1
- package/dist/src/utils/runtime-config.d.ts +18 -0
- package/dist/src/utils/runtime-config.js +64 -0
- package/dist/src/utils/runtime-config.js.map +1 -0
- package/dist/src/utils/runtime-skill-closure.d.ts +2 -2
- package/dist/src/utils/runtime-skill-closure.js +47 -6
- package/dist/src/utils/runtime-skill-closure.js.map +1 -1
- 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/state-paths.d.ts +8 -3
- package/dist/src/utils/state-paths.js +53 -16
- package/dist/src/utils/state-paths.js.map +1 -1
- package/dist/src/utils/target-eligibility.d.ts +4 -3
- package/dist/src/utils/target-eligibility.js +12 -6
- package/dist/src/utils/target-eligibility.js.map +1 -1
- package/dist/src/utils/windows-claude-shim.d.ts +7 -0
- package/dist/src/utils/windows-claude-shim.js +10 -0
- package/dist/src/utils/windows-claude-shim.js.map +1 -0
- package/dist/src/utils/windows-npm-shim.d.ts +16 -0
- package/dist/src/utils/windows-npm-shim.js +155 -0
- package/dist/src/utils/windows-npm-shim.js.map +1 -0
- package/dist/vitest.config.js +105 -9
- package/dist/vitest.config.js.map +1 -1
- package/package.json +30 -21
- 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 -91
- package/dist/scripts/codex-eval-app-server.js +0 -1334
- 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 -1589
- 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 -189
- package/dist/scripts/plugin-eval-contract.js +0 -745
- 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/catalog-context.d.ts +0 -52
- package/dist/src/commands/catalog-context.js +0 -156
- package/dist/src/commands/catalog-context.js.map +0 -1
- package/dist/src/commands/review-publication.d.ts +0 -99
- package/dist/src/commands/review-publication.js +0 -904
- package/dist/src/commands/review-publication.js.map +0 -1
- package/dist/src/commands/status-v5.d.ts +0 -169
- package/dist/src/commands/status-v5.js +0 -1135
- package/dist/src/commands/status-v5.js.map +0 -1
- package/dist/src/portable/skills-cli.d.ts +0 -43
- package/dist/src/portable/skills-cli.js +0 -148
- package/dist/src/portable/skills-cli.js.map +0 -1
- package/dist/src/utils/catalog-manifest-v5.d.ts +0 -5
- package/dist/src/utils/catalog-manifest-v5.js.map +0 -1
- package/dist/src/utils/catalog-source-cache.d.ts +0 -62
- package/dist/src/utils/catalog-source-cache.js +0 -321
- 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 -147
- package/dist/src/utils/lifecycle-active-store.js +0 -1064
- package/dist/src/utils/lifecycle-active-store.js.map +0 -1
- 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/slash-commands.d.ts +0 -1
- package/dist/src/utils/slash-commands.js +0 -2
- package/dist/src/utils/slash-commands.js.map +0 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { assertAgentCommandContext, canonicalizeIdentityValue, getCommandPackageId, normalizeCommandSetArtifact, validateCommandEntryFiles, } from '@lesliechan721/aw-plugin-core/manifest';
|
|
4
|
+
import { selectPlatformRenderConfig } from './artifact-request.js';
|
|
5
|
+
import { resolveArtifactRenderConfig, runPreparedArtifactRenderer } from './artifact-renderer.js';
|
|
6
|
+
import { managedCommandProducerIdentity, nativeToolsForCommandSets, } from './managed-command-materialization.js';
|
|
7
|
+
import { ManagedCommandError, validateManagedCommandResource } from './managed-command-store.js';
|
|
8
|
+
import { collectSensitivePluginConfigValues } from './plugin-scripts.js';
|
|
9
|
+
function producerRefKey(producer) {
|
|
10
|
+
return `${producer.kind}/${producer.platform}/${producer.kind === 'artifact' ? producer.artifactId : producer.skillKey}`;
|
|
11
|
+
}
|
|
12
|
+
/** Resolve only the current complete component set and its verified physical candidates. */
|
|
13
|
+
export async function resolveManagedCommandSkillProducers(options) {
|
|
14
|
+
const groups = new Map();
|
|
15
|
+
for (const set of options.plugin.manifest.managedCommands?.sets ?? []) {
|
|
16
|
+
if (set.producer.kind === 'package' || set.producer.platform !== options.platform)
|
|
17
|
+
continue;
|
|
18
|
+
const key = producerRefKey(set.producer);
|
|
19
|
+
const group = groups.get(key) ?? { producerRef: set.producer, sets: [] };
|
|
20
|
+
group.sets.push(set);
|
|
21
|
+
groups.set(key, group);
|
|
22
|
+
}
|
|
23
|
+
const results = [];
|
|
24
|
+
for (const { producerRef, sets } of groups.values()) {
|
|
25
|
+
const producer = await managedCommandProducerIdentity({ ...options, scope: options.renderUnit.renderScope.kind, producer: producerRef });
|
|
26
|
+
const componentId = producerRef.kind === 'artifact' ? producerRef.artifactId : `skill:${producerRef.skillKey}`;
|
|
27
|
+
const base = { producer, producerRef, componentId, sets };
|
|
28
|
+
try {
|
|
29
|
+
const scopes = options.plugin.manifest.artifacts?.scopes;
|
|
30
|
+
if (producerRef.kind === 'artifact' && (options.dynamicScopeOffered === false
|
|
31
|
+
|| scopes !== undefined && !scopes.includes(options.renderUnit.renderScope.kind))) {
|
|
32
|
+
results.push({ ...base, state: 'omitted', reason: 'scope-excluded' });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const components = options.components.components.filter((component) => component.id === componentId);
|
|
36
|
+
const omitted = options.components.omitted.filter((component) => component.id === componentId);
|
|
37
|
+
const unmet = options.components.unmet.filter((component) => component.id === componentId);
|
|
38
|
+
if (components.length + omitted.length + unmet.length !== 1)
|
|
39
|
+
throw new Error('commandReferenceInvalid: the current complete component set must identify exactly one Skill producer or its explicit unavailable state.');
|
|
40
|
+
const component = components[0] ?? omitted[0] ?? unmet[0];
|
|
41
|
+
if (component.kind !== 'skill')
|
|
42
|
+
throw new Error('commandReferenceInvalid: the command producer component is not a Skill.');
|
|
43
|
+
const expectedSource = producerRef.kind === 'artifact' ? 'dynamic' : 'static';
|
|
44
|
+
if (options.components.sources[componentId] !== expectedSource)
|
|
45
|
+
throw new Error('commandReferenceInvalid: the command producer component has another source owner.');
|
|
46
|
+
if (omitted[0]) {
|
|
47
|
+
results.push({ ...base, state: 'omitted', reason: omitted[0].reason });
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (unmet[0]) {
|
|
51
|
+
results.push({ ...base, state: 'unmet', reasonCode: unmet[0].reasonCode });
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const resources = options.skillResources.filter((resource) => resource.componentId === componentId);
|
|
55
|
+
if (resources.length !== 1 || resources[0].physicalKey !== producer.placementKey)
|
|
56
|
+
throw new Error('commandReferenceInvalid: the Skill resource does not belong to this exact physical producer.');
|
|
57
|
+
const resourceRoot = path.resolve(resources[0].resourceRoot);
|
|
58
|
+
await validateManagedCommandResource(resourceRoot);
|
|
59
|
+
const skill = await fs.lstat(path.join(resourceRoot, 'SKILL.md'));
|
|
60
|
+
if (!skill.isFile() || skill.isSymbolicLink())
|
|
61
|
+
throw new Error('commandReferenceInvalid: the Skill candidate has no regular SKILL.md.');
|
|
62
|
+
results.push({ ...base, state: 'ready', resourceRoot });
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
results.push({ ...base, state: 'failed', error: error instanceof Error ? error : new Error('commandReferenceInvalid: the Skill producer could not be prepared.') });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return results;
|
|
69
|
+
}
|
|
70
|
+
export function validateAgentCommandPlan(options) {
|
|
71
|
+
assertAgentCommandContext(options.context);
|
|
72
|
+
const plan = options.plan;
|
|
73
|
+
if (!plan || typeof plan !== 'object' || Array.isArray(plan)
|
|
74
|
+
|| Object.keys(plan).some((key) => !['version', 'artifacts'].includes(key))
|
|
75
|
+
|| !('version' in plan) || plan.version !== 2 || !('artifacts' in plan) || !Array.isArray(plan.artifacts)) {
|
|
76
|
+
throw new ManagedCommandError('commandDefinitionInvalid', 'The agent command renderer must return one v2 command set plan.');
|
|
77
|
+
}
|
|
78
|
+
const requested = new Set(options.context.requestedArtifactIds);
|
|
79
|
+
const seen = new Set();
|
|
80
|
+
const artifacts = plan.artifacts.map((value, index) => {
|
|
81
|
+
const artifact = normalizeCommandSetArtifact(value, `agent command artifacts[${index}]`);
|
|
82
|
+
const set = options.sets.find((set) => set.mode === 'dynamic' && `command-set.${set.set}` === artifact.id);
|
|
83
|
+
if (!requested.has(artifact.id) || seen.has(artifact.id) || !set || set.mode !== 'dynamic'
|
|
84
|
+
|| artifact.platform !== options.context.platform || JSON.stringify(artifact.refreshKeys) !== JSON.stringify(set.refreshKeys)) {
|
|
85
|
+
throw new ManagedCommandError('commandDefinitionInvalid', 'The agent command output must match each requested ID, platform, and refresh key list exactly.');
|
|
86
|
+
}
|
|
87
|
+
seen.add(artifact.id);
|
|
88
|
+
return artifact;
|
|
89
|
+
});
|
|
90
|
+
if (seen.size !== requested.size)
|
|
91
|
+
throw new ManagedCommandError('commandDefinitionInvalid', 'The agent command output omitted a requested command set.');
|
|
92
|
+
return artifacts;
|
|
93
|
+
}
|
|
94
|
+
export async function prepareAgentCommandSets(options) {
|
|
95
|
+
options.signal?.throwIfAborted();
|
|
96
|
+
const { resolved } = options;
|
|
97
|
+
if (resolved.producer.platform === null || !resolved.producer.placementKey)
|
|
98
|
+
throw new ManagedCommandError('commandReferenceInvalid', 'Agent command sets require a concrete native Skill producer.');
|
|
99
|
+
if (options.previousProducer && getCommandPackageId(options.previousProducer.record.producer) !== getCommandPackageId(resolved.producer))
|
|
100
|
+
throw new ManagedCommandError('commandIdentityConflict', 'Previous command artifacts belong to another physical producer.');
|
|
101
|
+
await validateManagedCommandResource(resolved.resourceRoot);
|
|
102
|
+
const dynamicSets = resolved.sets.filter((set) => set.mode === 'dynamic');
|
|
103
|
+
let artifacts = [];
|
|
104
|
+
if (dynamicSets.length > 0) {
|
|
105
|
+
const config = await resolveArtifactRenderConfig({
|
|
106
|
+
pluginName: options.plugin.manifest.name, manifest: options.plugin.manifest, platform: resolved.producer.platform,
|
|
107
|
+
sourceId: options.plugin.sourceId, sourceIdentity: options.plugin.sourceIdentity, logicalIdentity: options.plugin.catalogLogicalIdentity,
|
|
108
|
+
scope: resolved.producer.scope, cwd: resolved.producer.projectRoot ?? options.cwd, env: options.env, referencePlugins: options.referencePlugins,
|
|
109
|
+
});
|
|
110
|
+
const requestedArtifactIds = dynamicSets.map((set) => `command-set.${set.set}`);
|
|
111
|
+
const previousArtifacts = (options.previousProducer?.artifacts ?? []).filter((artifact) => requestedArtifactIds.includes(artifact.id)).map((artifact) => normalizeCommandSetArtifact(artifact));
|
|
112
|
+
if (previousArtifacts.some((artifact) => artifact.platform !== resolved.producer.platform))
|
|
113
|
+
throw new ManagedCommandError('commandIdentityConflict', 'Previous command artifacts identify another platform.');
|
|
114
|
+
for (const artifact of previousArtifacts) {
|
|
115
|
+
const installed = options.previousProducer.record.sets.find((set) => `command-set.${set.set}` === artifact.id);
|
|
116
|
+
if (!installed || installed.state !== artifact.state || canonicalizeIdentityValue(installed.entries) !== canonicalizeIdentityValue(artifact.entries))
|
|
117
|
+
throw new ManagedCommandError('commandIdentityConflict', 'Previous command artifacts do not match their verified producer record.');
|
|
118
|
+
}
|
|
119
|
+
const context = {
|
|
120
|
+
schemaVersion: 1, surface: 'agent-commands', platform: resolved.producer.platform, scope: resolved.producer.scope,
|
|
121
|
+
plugin: { pluginId: `${resolved.producer.sourceId}/${resolved.producer.pluginName}`, name: options.plugin.manifest.name, version: options.plugin.manifest.version },
|
|
122
|
+
config: selectPlatformRenderConfig({ resolved: config, keys: [...new Set(dynamicSets.flatMap((set) => set.refreshKeys))], nonSensitive: true }),
|
|
123
|
+
changedConfigKeys: [], requestedArtifactIds, previousArtifacts,
|
|
124
|
+
producers: dynamicSets.map((set) => ({ set: set.set, componentId: resolved.componentId, resourceRoot: resolved.resourceRoot })),
|
|
125
|
+
};
|
|
126
|
+
context.changedConfigKeys = (options.changedConfigKeys ?? []).filter((key) => Object.hasOwn(context.config.schema.fields, key));
|
|
127
|
+
assertAgentCommandContext(context);
|
|
128
|
+
if (context.config.issues.length > 0)
|
|
129
|
+
throw new ManagedCommandError('commandDefinitionInvalid', 'Resolve the command set configuration issues before preparing its producer.');
|
|
130
|
+
const rendered = await runPreparedArtifactRenderer({ plugin: options.plugin, context, sensitiveValues: collectSensitivePluginConfigValues(options.plugin.manifest, config.values, resolved.producer.platform), cwd: options.cwd, commandEnv: options.env, event: options.event, scriptTimeoutMs: options.scriptTimeoutMs, signal: options.signal });
|
|
131
|
+
artifacts = validateAgentCommandPlan({ plan: rendered.value, context, sets: resolved.sets });
|
|
132
|
+
}
|
|
133
|
+
const sets = resolved.sets.map((set) => {
|
|
134
|
+
if (set.mode === 'static')
|
|
135
|
+
return { set: set.set, state: 'present', entries: set.entries };
|
|
136
|
+
const artifact = artifacts.find((artifact) => artifact.id === `command-set.${set.set}`);
|
|
137
|
+
return { set: set.set, state: artifact.state, entries: artifact.entries };
|
|
138
|
+
});
|
|
139
|
+
await validateCommandEntryFiles(resolved.resourceRoot, sets.flatMap((set) => set.entries));
|
|
140
|
+
for (const set of sets)
|
|
141
|
+
for (const entry of set.entries)
|
|
142
|
+
await validateManagedCommandResource(resolved.resourceRoot, entry);
|
|
143
|
+
const nativeTools = await nativeToolsForCommandSets(options.plugin, sets);
|
|
144
|
+
return { producer: resolved.producer, resourceRoot: resolved.resourceRoot, sets, artifacts, ...(nativeTools ? { nativeTools } : {}) };
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=managed-command-preparation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-command-preparation.js","sourceRoot":"","sources":["../../../src/utils/managed-command-preparation.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,yBAAyB,GAS1B,MAAM,wCAAwC,CAAC;AAIhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAA4B,MAAM,wBAAwB,CAAC;AAC5H,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,GAE1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAA4B,MAAM,4BAA4B,CAAC;AAC3H,OAAO,EAAE,kCAAkC,EAAE,MAAM,qBAAqB,CAAC;AAmBzE,SAAS,cAAc,CAAC,QAA0B;IAChD,OAAO,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,QA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;IAC5E,CAAC,CAAC,CAAC;IACH,MAAM,yBAAyB,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3F,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,OAAO;YAAE,MAAM,8BAA8B,CAAC,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC5H,MAAM,WAAW,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC1E,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACxI,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type InstalledCommandProducer, type PluginComponent } from '@lesliechan721/aw-plugin-core/manifest';
|
|
2
|
+
import type { ClaudePermissions } from '../generators/permissions.js';
|
|
3
|
+
import type { DeploymentBinding, ProjectionResult, RenderUnit } from '../platforms/contracts.js';
|
|
4
|
+
export type ManagedCommandPermissionReview = {
|
|
5
|
+
kind: 'codex-rules';
|
|
6
|
+
pluginId: string;
|
|
7
|
+
path: string;
|
|
8
|
+
content: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'claude-permissions';
|
|
11
|
+
pluginId: string;
|
|
12
|
+
path: string;
|
|
13
|
+
permissions: ClaudePermissions;
|
|
14
|
+
};
|
|
15
|
+
/** Operation-local values copied from the same projected bytes that execution publishes. */
|
|
16
|
+
export interface ManagedCommandReviewEvidence {
|
|
17
|
+
producers: InstalledCommandProducer[];
|
|
18
|
+
permissions: ManagedCommandPermissionReview[];
|
|
19
|
+
}
|
|
20
|
+
/** Capture once during preparation. Review performs no filesystem reads or renderer calls. */
|
|
21
|
+
export declare function captureManagedCommandReviewEvidence(options: {
|
|
22
|
+
binding: DeploymentBinding;
|
|
23
|
+
renderUnits: readonly RenderUnit[];
|
|
24
|
+
components: readonly PluginComponent[];
|
|
25
|
+
projections: readonly ProjectionResult[];
|
|
26
|
+
}): Promise<ManagedCommandReviewEvidence>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import { COMMAND_PRODUCER_RECORD_FILE, normalizeInstalledCommandProducer } from '@lesliechan721/aw-plugin-core/manifest';
|
|
5
|
+
function invalid() { throw new Error('commandReviewEvidenceInvalid: The prepared command Review does not match its deployment.'); }
|
|
6
|
+
async function ordinaryFile(file) {
|
|
7
|
+
const stat = await fs.lstat(file);
|
|
8
|
+
if (!stat.isFile() || stat.isSymbolicLink())
|
|
9
|
+
invalid();
|
|
10
|
+
return fs.readFile(file);
|
|
11
|
+
}
|
|
12
|
+
/** Capture once during preparation. Review performs no filesystem reads or renderer calls. */
|
|
13
|
+
export async function captureManagedCommandReviewEvidence(options) {
|
|
14
|
+
const { binding } = options;
|
|
15
|
+
const producers = [];
|
|
16
|
+
const permissions = [];
|
|
17
|
+
for (const projection of options.projections) {
|
|
18
|
+
const unit = options.renderUnits.find((candidate) => candidate.id === projection.renderUnitId);
|
|
19
|
+
if (!unit || unit.physicalKey !== binding.physicalKey && unit.output === 'package')
|
|
20
|
+
invalid();
|
|
21
|
+
if (projection.bundle)
|
|
22
|
+
for (const component of projection.components) {
|
|
23
|
+
if (!options.components.some((candidate) => candidate.id === component.id && candidate.kind === 'skill'))
|
|
24
|
+
continue;
|
|
25
|
+
const relative = `skills/${component.nativeName}/${COMMAND_PRODUCER_RECORD_FILE}`;
|
|
26
|
+
if (!component.relativeOutputs.includes(relative))
|
|
27
|
+
continue;
|
|
28
|
+
const record = normalizeInstalledCommandProducer(JSON.parse((await ordinaryFile(path.join(projection.bundle.stagingRoot, relative))).toString('utf8')));
|
|
29
|
+
const producer = record.producer;
|
|
30
|
+
if (producer.kind === 'package' || producer.sourceId !== binding.plugin.sourceId
|
|
31
|
+
|| producer.sourceIdentity !== binding.plugin.sourceIdentity || producer.pluginName !== binding.plugin.pluginId.split('/').at(-1)
|
|
32
|
+
|| producer.platform !== binding.platform || producer.placementKey !== unit.physicalKey
|
|
33
|
+
|| producer.scope !== unit.renderScope.kind || producer.projectRoot !== (unit.renderScope.kind === 'project' ? unit.renderScope.projectRoot : null)
|
|
34
|
+
|| component.id !== (producer.kind === 'static-skill' ? `skill:${producer.key}` : producer.key))
|
|
35
|
+
invalid();
|
|
36
|
+
producers.push(record);
|
|
37
|
+
}
|
|
38
|
+
for (const contribution of projection.supplements) {
|
|
39
|
+
const codex = binding.platform === 'codex' && contribution.kind === 'owned-file'
|
|
40
|
+
&& contribution.id.startsWith('policy:') && path.extname(contribution.destination) === '.rules';
|
|
41
|
+
const claude = binding.platform === 'claude' && contribution.kind === 'config-entry'
|
|
42
|
+
&& contribution.mergeKey?.startsWith('claude-permissions:');
|
|
43
|
+
if (!codex && !claude)
|
|
44
|
+
continue;
|
|
45
|
+
const bytes = await ordinaryFile(contribution.stagingPath);
|
|
46
|
+
if (`sha256:${crypto.createHash('sha256').update(bytes).digest('hex')}` !== contribution.contentDigest)
|
|
47
|
+
invalid();
|
|
48
|
+
if (codex) {
|
|
49
|
+
permissions.push({ kind: 'codex-rules', pluginId: binding.plugin.pluginId, path: contribution.destination, content: bytes.toString('utf8') });
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const mutation = JSON.parse(bytes.toString('utf8'));
|
|
53
|
+
const value = mutation.permissions;
|
|
54
|
+
if (mutation.kind !== 'claude-permissions' || !value || typeof value !== 'object' || Array.isArray(value))
|
|
55
|
+
invalid();
|
|
56
|
+
const record = value;
|
|
57
|
+
if (Object.keys(record).some((key) => !['allow', 'ask', 'deny', 'excludedCommands'].includes(key))
|
|
58
|
+
|| ['allow', 'ask', 'deny'].some((key) => !Object.hasOwn(record, key))
|
|
59
|
+
|| Object.values(record).some((rules) => !Array.isArray(rules) || rules.some((rule) => typeof rule !== 'string')))
|
|
60
|
+
invalid();
|
|
61
|
+
permissions.push({ kind: 'claude-permissions', pluginId: binding.plugin.pluginId, path: contribution.destination,
|
|
62
|
+
permissions: record });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { producers, permissions };
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=managed-command-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-command-review.js","sourceRoot":"","sources":["../../../src/utils/managed-command-review.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,iCAAiC,EAAuD,MAAM,wCAAwC,CAAC;AAe9K,SAAS,OAAO,KAAY,MAAM,IAAI,KAAK,CAAC,0FAA0F,CAAC,CAAC,CAAC,CAAC;AAE1I,KAAK,UAAU,YAAY,CAAC,IAAY;IACtC,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE;QAAE,OAAO,EAAE,CAAC;IACvD,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,mCAAmC,CAAC,OAKzD;IACC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,MAAM,SAAS,GAA+B,EAAE,CAAC;IACjD,MAAM,WAAW,GAAqC,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AC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;oBAAE,OAAO,EAAE,CAAC;gBAC/H,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,WAAW;oBAC9G,WAAW,EAAE,MAAsC,EAAE,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type CommandLaunch } from '@lesliechan721/aw-plugin-core/manifest';
|
|
2
|
+
import { type NativeToolContext } from './native-tool-context.js';
|
|
3
|
+
import type { prepareWindowsJobHelper } from '@lesliechan721/agent-skill-eval';
|
|
4
|
+
export interface CommandHost {
|
|
5
|
+
schemaVersion: 1;
|
|
6
|
+
nodeExecutable: string;
|
|
7
|
+
cliEntry: string;
|
|
8
|
+
awHome: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildManagedCommandEnvironment(options: {
|
|
11
|
+
launch: CommandLaunch;
|
|
12
|
+
hostEnvironment: NodeJS.ProcessEnv;
|
|
13
|
+
host: CommandHost;
|
|
14
|
+
platform?: NodeJS.Platform;
|
|
15
|
+
nativeContext?: NativeToolContext;
|
|
16
|
+
}): NodeJS.ProcessEnv;
|
|
17
|
+
export interface ManagedCommandRunOptions {
|
|
18
|
+
id: string;
|
|
19
|
+
args: string[];
|
|
20
|
+
cwd: string;
|
|
21
|
+
cliEntry: string;
|
|
22
|
+
env?: NodeJS.ProcessEnv;
|
|
23
|
+
platform?: NodeJS.Platform;
|
|
24
|
+
arch?: string;
|
|
25
|
+
prepareNativeTool?: typeof prepareWindowsJobHelper;
|
|
26
|
+
}
|
|
27
|
+
export declare function prepareManagedCommandRun(options: ManagedCommandRunOptions): Promise<{
|
|
28
|
+
executable: string;
|
|
29
|
+
args: string[];
|
|
30
|
+
cwd: string;
|
|
31
|
+
env: NodeJS.ProcessEnv;
|
|
32
|
+
}>;
|
|
33
|
+
export declare function runManagedCommand(options: ManagedCommandRunOptions): Promise<number>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { validateCommandEnvironment } from '@lesliechan721/aw-plugin-core/manifest';
|
|
5
|
+
import { resolveAwHomeCanonical } from './state-paths.js';
|
|
6
|
+
import { prepareNativeToolContext } from './native-tool-context.js';
|
|
7
|
+
import { ManagedCommandError, resolveManagedCommand } from './managed-command-store.js';
|
|
8
|
+
export function buildManagedCommandEnvironment(options) {
|
|
9
|
+
const platform = options.platform ?? process.platform;
|
|
10
|
+
try {
|
|
11
|
+
validateCommandEnvironment(options.launch.env, options.launch.envFrom, platform);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
throw new ManagedCommandError('commandEnvironmentInvalid', 'The command environment definition is invalid.');
|
|
15
|
+
}
|
|
16
|
+
const original = { ...options.hostEnvironment };
|
|
17
|
+
const result = Object.create(null);
|
|
18
|
+
const put = (name, value) => {
|
|
19
|
+
if (platform === 'win32') {
|
|
20
|
+
for (const key of Object.keys(result))
|
|
21
|
+
if (key.toUpperCase() === name.toUpperCase())
|
|
22
|
+
delete result[key];
|
|
23
|
+
}
|
|
24
|
+
result[name] = value;
|
|
25
|
+
};
|
|
26
|
+
for (const [name, value] of Object.entries(original)) {
|
|
27
|
+
if (/^AW_(?:PLUGIN|COMMAND|NATIVE)_/iu.test(name))
|
|
28
|
+
continue;
|
|
29
|
+
put(name, value);
|
|
30
|
+
}
|
|
31
|
+
for (const [name, value] of Object.entries(options.launch.env))
|
|
32
|
+
put(name, value);
|
|
33
|
+
for (const [name, source] of Object.entries(options.launch.envFrom)) {
|
|
34
|
+
const sourceKey = platform === 'win32'
|
|
35
|
+
? Object.keys(original).find((key) => key.toUpperCase() === source.toUpperCase())
|
|
36
|
+
: source;
|
|
37
|
+
const value = sourceKey === undefined ? undefined : original[sourceKey];
|
|
38
|
+
if (value === undefined)
|
|
39
|
+
throw new ManagedCommandError('commandEnvironmentSourceMissing', `The command environment source ${source} is missing.`);
|
|
40
|
+
put(name, value);
|
|
41
|
+
}
|
|
42
|
+
if (options.nativeContext && Object.keys(options.nativeContext.tools).length > 0)
|
|
43
|
+
put('AW_NATIVE_TOOL_CONTEXT', JSON.stringify(options.nativeContext));
|
|
44
|
+
put('AW_HOME', options.host.awHome);
|
|
45
|
+
put('AW_COMMAND_HOST', JSON.stringify(options.host));
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
export async function prepareManagedCommandRun(options) {
|
|
49
|
+
const hostEnvironment = { ...(options.env ?? process.env) };
|
|
50
|
+
const awHome = await resolveAwHomeCanonical(hostEnvironment);
|
|
51
|
+
const { launch, resourceRoot, producer, set } = await resolveManagedCommand(options.id, hostEnvironment);
|
|
52
|
+
// Reject invalid bindings before native preparation or consumer startup.
|
|
53
|
+
const host = { schemaVersion: 1, nodeExecutable: process.execPath, cliEntry: path.resolve(options.cliEntry), awHome };
|
|
54
|
+
const environment = buildManagedCommandEnvironment({ launch, hostEnvironment, host, platform: options.platform });
|
|
55
|
+
let nativeContext;
|
|
56
|
+
try {
|
|
57
|
+
nativeContext = await prepareNativeToolContext({ closure: producer?.nativeTools, kind: 'managed-command-set', key: set ?? '',
|
|
58
|
+
platform: options.platform, arch: options.arch, prepare: options.prepareNativeTool });
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new ManagedCommandError(error && typeof error === 'object' && 'code' in error ? String(error.code) : 'nativeToolUnavailable', 'The required native tool could not be prepared. Reinstall the current CLI/Eval package and include optional dependencies.');
|
|
62
|
+
}
|
|
63
|
+
if (Object.keys(nativeContext.tools).length > 0)
|
|
64
|
+
environment.AW_NATIVE_TOOL_CONTEXT = JSON.stringify(nativeContext);
|
|
65
|
+
const absoluteEntry = path.resolve(resourceRoot, launch.entry);
|
|
66
|
+
return {
|
|
67
|
+
executable: launch.runner === 'node' ? process.execPath : absoluteEntry,
|
|
68
|
+
args: [...(launch.runner === 'node' ? [absoluteEntry] : []), ...launch.args, ...options.args],
|
|
69
|
+
cwd: launch.cwd === 'resource' ? resourceRoot : options.cwd,
|
|
70
|
+
env: environment,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export async function runManagedCommand(options) {
|
|
74
|
+
const invocation = await prepareManagedCommandRun(options);
|
|
75
|
+
return new Promise((resolve, reject) => {
|
|
76
|
+
const child = spawn(invocation.executable, invocation.args, {
|
|
77
|
+
cwd: invocation.cwd,
|
|
78
|
+
env: invocation.env,
|
|
79
|
+
stdio: 'inherit',
|
|
80
|
+
shell: false,
|
|
81
|
+
});
|
|
82
|
+
const signals = process.platform === 'win32' ? ['SIGINT', 'SIGTERM'] : ['SIGINT', 'SIGTERM', 'SIGHUP'];
|
|
83
|
+
const handlers = new Map();
|
|
84
|
+
let received;
|
|
85
|
+
const clean = () => { for (const [signal, handler] of handlers)
|
|
86
|
+
process.off(signal, handler); };
|
|
87
|
+
for (const signal of signals) {
|
|
88
|
+
const handler = () => {
|
|
89
|
+
received = signal;
|
|
90
|
+
try {
|
|
91
|
+
child.kill(signal);
|
|
92
|
+
}
|
|
93
|
+
catch { /* Forwarding is best effort. */ }
|
|
94
|
+
};
|
|
95
|
+
handlers.set(signal, handler);
|
|
96
|
+
process.on(signal, handler);
|
|
97
|
+
}
|
|
98
|
+
child.once('error', () => {
|
|
99
|
+
clean();
|
|
100
|
+
reject(new ManagedCommandError('commandSpawnFailed', 'The operating system could not start the managed command.'));
|
|
101
|
+
});
|
|
102
|
+
child.once('exit', (code, signal) => {
|
|
103
|
+
clean();
|
|
104
|
+
if (process.platform === 'win32' && received) {
|
|
105
|
+
resolve(received === 'SIGINT' ? 130 : 143);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (signal && process.platform !== 'win32') {
|
|
109
|
+
const number = os.constants.signals[signal] ?? 0;
|
|
110
|
+
try {
|
|
111
|
+
process.kill(process.pid, signal);
|
|
112
|
+
}
|
|
113
|
+
catch { /* The numeric fallback is required when self-signalling is unavailable. */ }
|
|
114
|
+
resolve(128 + number);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
resolve(code ?? 1);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=managed-command-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-command-runtime.js","sourceRoot":"","sources":["../../../src/utils/managed-command-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,0BAA0B,EAAsB,MAAM,wCAAwC,CAAC;AAExG,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAA0B,MAAM,0BAA0B,CAAC;AAE5F,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AASxF,MAAM,UAAU,8BAA8B,CAAC,OAM9C;IACC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IACtD,IAAI,CAAC;QAAC,0BAA0B,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAAC,CAAC;IACzF,MAAM,CAAC;QAAC,MAAM,IAAI,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CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { type NativeToolClosure, type CommandIdentity, type CommandLaunch, type ProducerIdentity, type InstalledCommandProducer, type UserCommandDefinition } from '@lesliechan721/aw-plugin-core/manifest';
|
|
2
|
+
export declare const COMMAND_PRODUCER_RECORD = ".aw-command-producer.json";
|
|
3
|
+
export type { InstalledCommandProducer, UserCommandDefinition };
|
|
4
|
+
export interface ManagedCommandDiagnostic {
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
subject?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ManagedCommandError extends Error {
|
|
10
|
+
readonly code: string;
|
|
11
|
+
readonly argumentError: boolean;
|
|
12
|
+
constructor(code: string, message: string, argumentError?: boolean);
|
|
13
|
+
}
|
|
14
|
+
export type InstalledCommandSet = InstalledCommandProducer['sets'][number];
|
|
15
|
+
export interface ManagedCommandBinding {
|
|
16
|
+
schemaVersion: 1;
|
|
17
|
+
id: string;
|
|
18
|
+
identity: CommandIdentity;
|
|
19
|
+
resourceRoot: string;
|
|
20
|
+
}
|
|
21
|
+
declare const bindingRecoveryIdentities: unique symbol;
|
|
22
|
+
export interface ManagedCommandBindingRecoveryEvidence {
|
|
23
|
+
readonly [bindingRecoveryIdentities]: {
|
|
24
|
+
readonly root: string;
|
|
25
|
+
readonly identities: ReadonlyMap<string, CommandIdentity>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface ManagedCommandView {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
owner: {
|
|
32
|
+
kind: 'user';
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'plugin';
|
|
35
|
+
producer: ProducerIdentity;
|
|
36
|
+
};
|
|
37
|
+
availability: 'ready' | 'unavailable';
|
|
38
|
+
resourceRoot: string | null;
|
|
39
|
+
launch: CommandLaunch | null;
|
|
40
|
+
errors: ManagedCommandDiagnostic[];
|
|
41
|
+
recoveryActions: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface ManagedCommandPackageView {
|
|
44
|
+
id: string;
|
|
45
|
+
producer: ProducerIdentity;
|
|
46
|
+
resourceRoot: string;
|
|
47
|
+
availability: 'ready' | 'empty' | 'unavailable';
|
|
48
|
+
sets: Array<{
|
|
49
|
+
set: string;
|
|
50
|
+
state: 'present' | 'disabled';
|
|
51
|
+
commandIds: string[];
|
|
52
|
+
}>;
|
|
53
|
+
errors: ManagedCommandDiagnostic[];
|
|
54
|
+
recoveryActions: string[];
|
|
55
|
+
}
|
|
56
|
+
export declare function managedCommandDiagnostic(error: unknown, subject?: string): ManagedCommandDiagnostic;
|
|
57
|
+
export declare function managedCommandRoot(env?: NodeJS.ProcessEnv): Promise<string>;
|
|
58
|
+
export declare function assertUserCommandId(id: string): void;
|
|
59
|
+
export declare function validateManagedCommandName(value: unknown): string;
|
|
60
|
+
export declare function parseManagedCommandLaunch(value: unknown): CommandLaunch;
|
|
61
|
+
export declare function readUserCommandDefinition(id: string, env?: NodeJS.ProcessEnv): Promise<UserCommandDefinition>;
|
|
62
|
+
export declare function validateManagedCommandResource(resourceRoot: string, launch?: CommandLaunch): Promise<void>;
|
|
63
|
+
export declare function copyManagedCommandDirectory(sourceDirectory: string, destination: string, env?: NodeJS.ProcessEnv, options?: {
|
|
64
|
+
trustedPluginSource?: boolean;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
export declare function installUserCommand(options: {
|
|
67
|
+
sourceDirectory: string;
|
|
68
|
+
name: string;
|
|
69
|
+
launch: CommandLaunch;
|
|
70
|
+
env?: NodeJS.ProcessEnv;
|
|
71
|
+
}): Promise<string>;
|
|
72
|
+
export declare function updateUserCommand(options: {
|
|
73
|
+
id: string;
|
|
74
|
+
sourceDirectory: string;
|
|
75
|
+
name?: string;
|
|
76
|
+
launch?: Partial<CommandLaunch>;
|
|
77
|
+
env?: NodeJS.ProcessEnv;
|
|
78
|
+
}): Promise<{
|
|
79
|
+
errors: ManagedCommandDiagnostic[];
|
|
80
|
+
recoveryActions: string[];
|
|
81
|
+
}>;
|
|
82
|
+
export declare function removeUserCommand(id: string, env?: NodeJS.ProcessEnv): Promise<void>;
|
|
83
|
+
export declare function normalizeInstalledCommandProducer(value: unknown): InstalledCommandProducer;
|
|
84
|
+
export declare function readInstalledCommandProducer(resourceRoot: string): Promise<InstalledCommandProducer>;
|
|
85
|
+
export declare function writeInstalledCommandProducer(resourceRoot: string, record: InstalledCommandProducer): Promise<void>;
|
|
86
|
+
/** Capture the installed Native producer before replacing its canonical payload. */
|
|
87
|
+
export declare function captureManagedCommandBindingRecoveryEvidence(options: {
|
|
88
|
+
producer: ProducerIdentity;
|
|
89
|
+
resourceRoot: string;
|
|
90
|
+
env?: NodeJS.ProcessEnv;
|
|
91
|
+
}): Promise<ManagedCommandBindingRecoveryEvidence>;
|
|
92
|
+
export declare function revokeManagedCommandBindings(producer: ProducerIdentity, env?: NodeJS.ProcessEnv): Promise<string[]>;
|
|
93
|
+
export declare function assertManagedCommandBindingIdentities(options: {
|
|
94
|
+
producers: Array<Pick<InstalledCommandProducer, 'producer' | 'sets' | 'nativeTools'>>;
|
|
95
|
+
env?: NodeJS.ProcessEnv;
|
|
96
|
+
bindingRecoveryEvidence?: readonly ManagedCommandBindingRecoveryEvidence[];
|
|
97
|
+
}): Promise<void>;
|
|
98
|
+
export declare function publishManagedCommandBindings(options: {
|
|
99
|
+
producer: ProducerIdentity;
|
|
100
|
+
resourceRoot: string;
|
|
101
|
+
sets: InstalledCommandSet[];
|
|
102
|
+
nativeTools?: NativeToolClosure;
|
|
103
|
+
env?: NodeJS.ProcessEnv;
|
|
104
|
+
bindingRecoveryEvidence?: readonly ManagedCommandBindingRecoveryEvidence[];
|
|
105
|
+
}): Promise<string[]>;
|
|
106
|
+
export declare function readManagedCommandPackageOwner(id: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
107
|
+
producer: ProducerIdentity;
|
|
108
|
+
resourceRoot: string;
|
|
109
|
+
}>;
|
|
110
|
+
export declare function removeManagedCommandPackage(id: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
111
|
+
producer: ProducerIdentity;
|
|
112
|
+
removedCommandIds: string[];
|
|
113
|
+
}>;
|
|
114
|
+
export declare function syncManagedCommandPackage(options: {
|
|
115
|
+
producer: ProducerIdentity;
|
|
116
|
+
sourceDirectory: string;
|
|
117
|
+
sets: InstalledCommandSet[];
|
|
118
|
+
nativeTools?: NativeToolClosure;
|
|
119
|
+
env?: NodeJS.ProcessEnv;
|
|
120
|
+
}): Promise<{
|
|
121
|
+
id: string;
|
|
122
|
+
resourceRoot: string;
|
|
123
|
+
commandIds: string[];
|
|
124
|
+
removedCommandIds: string[];
|
|
125
|
+
}>;
|
|
126
|
+
export declare function assertManagedCommandProducerOwnership(producer: ProducerIdentity, resourceRoot: string, env?: NodeJS.ProcessEnv): Promise<void>;
|
|
127
|
+
export declare function resolveManagedCommand(id: string, env?: NodeJS.ProcessEnv): Promise<{
|
|
128
|
+
view: ManagedCommandView;
|
|
129
|
+
launch: CommandLaunch;
|
|
130
|
+
resourceRoot: string;
|
|
131
|
+
producer?: InstalledCommandProducer;
|
|
132
|
+
set?: string;
|
|
133
|
+
}>;
|
|
134
|
+
export declare function inspectManagedCommand(id: string, env?: NodeJS.ProcessEnv): Promise<ManagedCommandView>;
|
|
135
|
+
export declare function listManagedCommandPackages(env?: NodeJS.ProcessEnv): Promise<{
|
|
136
|
+
packages: ManagedCommandPackageView[];
|
|
137
|
+
errors: ManagedCommandDiagnostic[];
|
|
138
|
+
}>;
|
|
139
|
+
export declare function listManagedCommands(env?: NodeJS.ProcessEnv): Promise<{
|
|
140
|
+
commands: ManagedCommandView[];
|
|
141
|
+
packages: ManagedCommandPackageView[];
|
|
142
|
+
errors: ManagedCommandDiagnostic[];
|
|
143
|
+
}>;
|