@lesliechan721/aw 0.1.0-beta.5 → 0.1.0-beta.50
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-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 +229 -8
- 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 +3 -2
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +346 -1131
- 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 -0
- package/dist/scripts/bundle-plugins.js +20 -5
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +7 -9
- package/dist/scripts/plugin-staging.js +18 -29
- 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 +47 -76
- 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.js +2 -2
- package/dist/src/adapters/helpers.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +17 -1
- package/dist/src/authoring/workspace-commands.js +21 -4
- 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 +264 -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 +71 -30
- package/dist/src/commands/catalog-publication-inspection.js +475 -63
- 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 +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 +73 -15
- package/dist/src/commands/catalog-publish.js +701 -212
- 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 +18 -22
- package/dist/src/commands/catalog-status.js +81 -115
- 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 +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.js +23 -3
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +77 -31
- package/dist/src/commands/rebuild-command.js +4862 -729
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +131 -21
- package/dist/src/commands/rebuild-integration.js +2866 -1339
- 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 +236 -109
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.d.ts +10 -4
- package/dist/src/index.js +1793 -486
- 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 +74 -20
- 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 +110 -3
- package/dist/src/tui/components.js +183 -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 +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 +8941 -1872
- 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 +10 -2
- package/dist/src/tui/controller-runtime.js +3211 -388
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +615 -45
- package/dist/src/tui/controller.js +3558 -768
- 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 +3 -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 +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 +6 -1
- package/dist/src/tui/index.js +5 -1
- 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 +223 -31
- package/dist/src/tui/model.js +1510 -397
- 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 +197 -10
- package/dist/src/tui/router.js +338 -50
- 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 +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/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 +57 -20
- 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 +3 -0
- 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 +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 +747 -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 +35 -5
- 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 +177 -145
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/local-marketplace.d.ts +18 -1
- package/dist/src/utils/local-marketplace.js +354 -84
- package/dist/src/utils/local-marketplace.js.map +1 -1
- 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 +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 +400 -58
- 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 +1116 -968
- 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 +484 -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/state-paths.js +7 -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 +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 +14 -0
- package/dist/src/utils/windows-npm-shim.js +140 -0
- package/dist/src/utils/windows-npm-shim.js.map +1 -0
- package/dist/vitest.config.js +92 -10
- package/dist/vitest.config.js.map +1 -1
- package/package.json +27 -18
- package/dist/authoring/scripts/check-plugin-versions.d.mts +0 -2
- 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 -123
- package/dist/src/commands/status-v4.js +0 -905
- 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 -62
- package/dist/src/utils/catalog-source-cache.js +0 -296
- 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-release.d.ts +0 -2
- package/dist/src/utils/plugin-release.js +0 -2
- package/dist/src/utils/plugin-release.js.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { CodexSharedNativeInspection } from './codex-shared-native.js';
|
|
2
|
+
import type { CodexSurfaceAnalysis, CodexSurfaceComponent } from './codex-surface-analysis.js';
|
|
3
|
+
import type { PluginIntentState } from './plugin-intent-state.js';
|
|
4
|
+
import type { CodexOperationRequirement, Scope } from '../types.js';
|
|
5
|
+
export type CodexReconcileOperation = 'install' | 'uninstall' | 'reinstall' | 'cleanup' | 'sync';
|
|
6
|
+
export type CodexSharedNativeAction = 'reuse' | 'install' | 'replace' | 'repair' | 'none';
|
|
7
|
+
export type CodexActivationAction = 'enable' | 'disable' | 'remove' | 'none';
|
|
8
|
+
export interface CodexReconcilerCatalogTarget {
|
|
9
|
+
pluginId: string;
|
|
10
|
+
pluginName: string;
|
|
11
|
+
codexPluginId: string;
|
|
12
|
+
version: string;
|
|
13
|
+
payloadDigest: string;
|
|
14
|
+
relation: 'requested' | 'dependency';
|
|
15
|
+
resolvedScope: Scope;
|
|
16
|
+
desiredScopes?: Scope[];
|
|
17
|
+
intentScopes?: Scope[];
|
|
18
|
+
surface: CodexSurfaceAnalysis;
|
|
19
|
+
}
|
|
20
|
+
export type CodexLiveExtensionState = 'absent' | 'present' | 'drifted' | 'foreign';
|
|
21
|
+
export interface CodexReconcilerLiveEvidence {
|
|
22
|
+
codexPluginId: string;
|
|
23
|
+
sharedNative: CodexSharedNativeInspection;
|
|
24
|
+
activations: {
|
|
25
|
+
user?: boolean;
|
|
26
|
+
project?: boolean;
|
|
27
|
+
};
|
|
28
|
+
extensions?: Array<{
|
|
29
|
+
componentKey: string;
|
|
30
|
+
scope: Scope;
|
|
31
|
+
state: CodexLiveExtensionState;
|
|
32
|
+
owner?: string;
|
|
33
|
+
}>;
|
|
34
|
+
projectionDigest?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CodexReconcilerInput {
|
|
37
|
+
scope: Scope;
|
|
38
|
+
cwd: string;
|
|
39
|
+
operation: CodexReconcileOperation;
|
|
40
|
+
intentBefore: PluginIntentState;
|
|
41
|
+
intentAfter: PluginIntentState;
|
|
42
|
+
relatedIntentBefore?: PluginIntentState;
|
|
43
|
+
relatedIntentAfter?: PluginIntentState;
|
|
44
|
+
catalogClosure: CodexReconcilerCatalogTarget[];
|
|
45
|
+
liveEvidence: CodexReconcilerLiveEvidence[];
|
|
46
|
+
activationSupport?: 'observed' | 'assumed';
|
|
47
|
+
}
|
|
48
|
+
export interface CodexSharedNativePlanAction {
|
|
49
|
+
pluginId: string;
|
|
50
|
+
codexPluginId: string;
|
|
51
|
+
action: CodexSharedNativeAction;
|
|
52
|
+
desiredVersion: string;
|
|
53
|
+
affectsOtherScopes: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface CodexActivationPlanAction {
|
|
56
|
+
pluginId: string;
|
|
57
|
+
codexPluginId: string;
|
|
58
|
+
scope: Scope;
|
|
59
|
+
action: CodexActivationAction;
|
|
60
|
+
desired: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface CodexExtensionPlanAction {
|
|
63
|
+
pluginId: string;
|
|
64
|
+
componentKey: string;
|
|
65
|
+
kind: CodexSurfaceComponent['kind'];
|
|
66
|
+
scope: Scope;
|
|
67
|
+
action: 'write' | 'remove';
|
|
68
|
+
}
|
|
69
|
+
export interface CodexReconcilePostcheckDescriptor {
|
|
70
|
+
requirement: CodexOperationRequirement;
|
|
71
|
+
support: 'observed' | 'assumed';
|
|
72
|
+
plugins: Array<{
|
|
73
|
+
pluginId: string;
|
|
74
|
+
codexPluginId: string;
|
|
75
|
+
expectedUserEnabled: boolean;
|
|
76
|
+
expectedProjectEnabled: boolean;
|
|
77
|
+
exactCwd: string;
|
|
78
|
+
neutralCwdRequired: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
export interface CodexReconcileReviewDescriptor {
|
|
82
|
+
requiresConfirmation: boolean;
|
|
83
|
+
sharedImpact: {
|
|
84
|
+
pluginIds: string[];
|
|
85
|
+
warning?: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface CodexReconcilePlan {
|
|
89
|
+
requirement: CodexOperationRequirement;
|
|
90
|
+
desiredTargets: Array<{
|
|
91
|
+
pluginId: string;
|
|
92
|
+
scopes: Scope[];
|
|
93
|
+
}>;
|
|
94
|
+
sharedNativeActions: CodexSharedNativePlanAction[];
|
|
95
|
+
activationActions: {
|
|
96
|
+
user: CodexActivationPlanAction[];
|
|
97
|
+
project: CodexActivationPlanAction[];
|
|
98
|
+
};
|
|
99
|
+
extensionWrites: CodexExtensionPlanAction[];
|
|
100
|
+
extensionRemovals: CodexExtensionPlanAction[];
|
|
101
|
+
staleActivationRemovals: Array<{
|
|
102
|
+
scope: Scope;
|
|
103
|
+
codexPluginId: string;
|
|
104
|
+
}>;
|
|
105
|
+
managedInventory: {
|
|
106
|
+
before: string[];
|
|
107
|
+
desired: string[];
|
|
108
|
+
ownershipSuperset: string[];
|
|
109
|
+
converged: string[];
|
|
110
|
+
related: {
|
|
111
|
+
before: string[];
|
|
112
|
+
desired: string[];
|
|
113
|
+
ownershipSuperset: string[];
|
|
114
|
+
converged: string[];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
warnings: string[];
|
|
118
|
+
postcheck: CodexReconcilePostcheckDescriptor;
|
|
119
|
+
review: CodexReconcileReviewDescriptor;
|
|
120
|
+
}
|
|
121
|
+
export declare class CodexReconcilePlanError extends Error {
|
|
122
|
+
readonly code: 'codexSharedNativeForeign' | 'codexSharedNativeCorrupt' | 'codexExtensionScopeConflict' | 'codexSurfaceOwnerCollision' | 'codexReconcileEvidenceInvalid';
|
|
123
|
+
constructor(code: CodexReconcilePlanError['code'], detail: string);
|
|
124
|
+
}
|
|
125
|
+
export declare function createCodexReconcilePlan(input: CodexReconcilerInput): CodexReconcilePlan;
|
|
126
|
+
export declare const planCodexReconciliation: typeof createCodexReconcilePlan;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { getCodexOperationRequirement } from './agent-version.js';
|
|
2
|
+
export class CodexReconcilePlanError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
constructor(code, detail) {
|
|
5
|
+
super(`${code}: ${detail}`);
|
|
6
|
+
this.name = 'CodexReconcilePlanError';
|
|
7
|
+
this.code = code;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function compareText(left, right) {
|
|
11
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
12
|
+
}
|
|
13
|
+
function canonicalStrings(values) {
|
|
14
|
+
return [...new Set(values)].sort(compareText);
|
|
15
|
+
}
|
|
16
|
+
function targetKey(target) {
|
|
17
|
+
return `${target.pluginId}\0${target.codexPluginId}`;
|
|
18
|
+
}
|
|
19
|
+
function desiredScopes(target) {
|
|
20
|
+
return [...new Set(target.desiredScopes ?? [target.resolvedScope])].sort(compareText);
|
|
21
|
+
}
|
|
22
|
+
function assertTarget(target) {
|
|
23
|
+
if (!target.surface.ok) {
|
|
24
|
+
throw new CodexReconcilePlanError('codexSurfaceOwnerCollision', `${target.pluginId} has an ambiguous or unsupported Codex surface.`);
|
|
25
|
+
}
|
|
26
|
+
if (!target.codexPluginId.includes('@')) {
|
|
27
|
+
throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `${target.pluginId} has an invalid Codex plugin ID.`);
|
|
28
|
+
}
|
|
29
|
+
if (!/^sha256:[0-9a-f]{64}$/u.test(target.payloadDigest)) {
|
|
30
|
+
throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `${target.pluginId} has an invalid payload digest.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function nativeAction(options) {
|
|
34
|
+
const { operation, target, evidence } = options;
|
|
35
|
+
const requiresNative = target.surface.nativeKinds.length > 0
|
|
36
|
+
&& desiredScopes(target).length > 0;
|
|
37
|
+
if (!requiresNative || operation === 'uninstall')
|
|
38
|
+
return 'none';
|
|
39
|
+
const state = evidence.sharedNative;
|
|
40
|
+
if (state.state === 'unobserved') {
|
|
41
|
+
return operation === 'cleanup' ? 'none' : 'install';
|
|
42
|
+
}
|
|
43
|
+
if (state.state === 'blocked') {
|
|
44
|
+
throw new CodexReconcilePlanError(state.reason === 'foreign' ? 'codexSharedNativeForeign' : 'codexSharedNativeCorrupt', `${target.codexPluginId} shared native state is ${state.reason}.`);
|
|
45
|
+
}
|
|
46
|
+
if (operation === 'reinstall') {
|
|
47
|
+
return state.state === 'missing' ? 'install' : 'replace';
|
|
48
|
+
}
|
|
49
|
+
if (state.state === 'missing')
|
|
50
|
+
return 'install';
|
|
51
|
+
if (state.state === 'replaceable') {
|
|
52
|
+
return state.reason === 'damaged' ? 'repair' : 'replace';
|
|
53
|
+
}
|
|
54
|
+
return 'reuse';
|
|
55
|
+
}
|
|
56
|
+
function activationAction(options) {
|
|
57
|
+
if (options.desired)
|
|
58
|
+
return options.actual === true ? 'none' : 'enable';
|
|
59
|
+
if (options.scope === 'user' && options.nativeDesiredSomewhere) {
|
|
60
|
+
return options.actual === false ? 'none' : 'disable';
|
|
61
|
+
}
|
|
62
|
+
return options.actual === undefined ? 'none' : 'remove';
|
|
63
|
+
}
|
|
64
|
+
function liveExtensionState(evidence, componentKey, scope) {
|
|
65
|
+
return evidence.extensions?.find((entry) => entry.componentKey === componentKey && entry.scope === scope)?.state ?? 'absent';
|
|
66
|
+
}
|
|
67
|
+
function addExtensionActions(options) {
|
|
68
|
+
const scopes = desiredScopes(options.target);
|
|
69
|
+
const awComponents = options.target.surface.components.filter((component) => component.owner === 'aw');
|
|
70
|
+
if (awComponents.length > 0 && scopes.includes('user') && scopes.includes('project')) {
|
|
71
|
+
throw new CodexReconcilePlanError('codexExtensionScopeConflict', `${options.target.pluginId} has AW-owned output at both user and project scope.`);
|
|
72
|
+
}
|
|
73
|
+
for (const component of awComponents) {
|
|
74
|
+
for (const scope of ['user', 'project']) {
|
|
75
|
+
const state = liveExtensionState(options.evidence, component.key, scope);
|
|
76
|
+
if (state === 'foreign') {
|
|
77
|
+
throw new CodexReconcilePlanError('codexSurfaceOwnerCollision', `${options.target.pluginId} extension ${component.key} is foreign at ${scope} scope.`);
|
|
78
|
+
}
|
|
79
|
+
const desired = scopes.includes(scope) && component.scopes.includes(scope);
|
|
80
|
+
const refreshOnSync = options.input.operation === 'sync'
|
|
81
|
+
&& component.dynamic
|
|
82
|
+
&& (component.refreshKeys?.length ?? 0) > 0;
|
|
83
|
+
const shouldWrite = desired && (state !== 'present'
|
|
84
|
+
|| options.input.operation === 'reinstall'
|
|
85
|
+
|| refreshOnSync);
|
|
86
|
+
if (shouldWrite) {
|
|
87
|
+
options.writes.push({
|
|
88
|
+
pluginId: options.target.pluginId,
|
|
89
|
+
componentKey: component.key,
|
|
90
|
+
kind: component.kind,
|
|
91
|
+
scope,
|
|
92
|
+
action: 'write',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
else if (!desired && state !== 'absent') {
|
|
96
|
+
options.removals.push({
|
|
97
|
+
pluginId: options.target.pluginId,
|
|
98
|
+
componentKey: component.key,
|
|
99
|
+
kind: component.kind,
|
|
100
|
+
scope,
|
|
101
|
+
action: 'remove',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function sortActivationActions(actions) {
|
|
108
|
+
actions.sort((left, right) => compareText(`${left.codexPluginId}\0${left.pluginId}`, `${right.codexPluginId}\0${right.pluginId}`));
|
|
109
|
+
}
|
|
110
|
+
function sortExtensionActions(actions) {
|
|
111
|
+
actions.sort((left, right) => compareText(`${left.scope}\0${left.pluginId}\0${left.componentKey}`, `${right.scope}\0${right.pluginId}\0${right.componentKey}`));
|
|
112
|
+
}
|
|
113
|
+
function evidenceFor(target, evidenceById) {
|
|
114
|
+
const evidence = evidenceById.get(target.codexPluginId);
|
|
115
|
+
if (!evidence) {
|
|
116
|
+
throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `Missing live evidence for ${target.codexPluginId}.`);
|
|
117
|
+
}
|
|
118
|
+
return evidence;
|
|
119
|
+
}
|
|
120
|
+
export function createCodexReconcilePlan(input) {
|
|
121
|
+
const sortedTargets = [...input.catalogClosure].sort((left, right) => compareText(targetKey(left), targetKey(right)));
|
|
122
|
+
const duplicateTarget = sortedTargets.find((target, index) => index > 0 && targetKey(sortedTargets[index - 1]) === targetKey(target));
|
|
123
|
+
if (duplicateTarget) {
|
|
124
|
+
throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `Duplicate catalog target ${duplicateTarget.pluginId}.`);
|
|
125
|
+
}
|
|
126
|
+
sortedTargets.forEach(assertTarget);
|
|
127
|
+
const ownersByCodexPluginId = new Map();
|
|
128
|
+
for (const target of sortedTargets) {
|
|
129
|
+
const owners = ownersByCodexPluginId.get(target.codexPluginId) ?? new Set();
|
|
130
|
+
owners.add(target.pluginId);
|
|
131
|
+
ownersByCodexPluginId.set(target.codexPluginId, owners);
|
|
132
|
+
}
|
|
133
|
+
const ownerCollision = [...ownersByCodexPluginId.entries()].find(([, owners]) => owners.size > 1);
|
|
134
|
+
if (ownerCollision) {
|
|
135
|
+
throw new CodexReconcilePlanError('codexSurfaceOwnerCollision', `${ownerCollision[0]} has multiple Catalog owners: ${[...ownerCollision[1]].sort(compareText).join(', ')}.`);
|
|
136
|
+
}
|
|
137
|
+
const evidenceById = new Map();
|
|
138
|
+
for (const evidence of input.liveEvidence) {
|
|
139
|
+
if (evidenceById.has(evidence.codexPluginId)) {
|
|
140
|
+
throw new CodexReconcilePlanError('codexReconcileEvidenceInvalid', `Duplicate live evidence for ${evidence.codexPluginId}.`);
|
|
141
|
+
}
|
|
142
|
+
evidenceById.set(evidence.codexPluginId, evidence);
|
|
143
|
+
}
|
|
144
|
+
const sharedNativeActions = [];
|
|
145
|
+
const userActions = [];
|
|
146
|
+
const projectActions = [];
|
|
147
|
+
const extensionWrites = [];
|
|
148
|
+
const extensionRemovals = [];
|
|
149
|
+
const warnings = [];
|
|
150
|
+
const postcheckPlugins = [];
|
|
151
|
+
let projectContractRequired = input.scope === 'project'
|
|
152
|
+
|| sortedTargets.some((target) => target.resolvedScope === 'project');
|
|
153
|
+
for (const target of sortedTargets) {
|
|
154
|
+
const evidence = evidenceFor(target, evidenceById);
|
|
155
|
+
const scopes = desiredScopes(target);
|
|
156
|
+
const hasNative = target.surface.nativeKinds.length > 0;
|
|
157
|
+
const userDesired = hasNative && scopes.includes('user');
|
|
158
|
+
const projectDesired = hasNative && scopes.includes('project');
|
|
159
|
+
const nativeDesiredSomewhere = userDesired || projectDesired;
|
|
160
|
+
projectContractRequired ||= projectDesired;
|
|
161
|
+
const action = nativeAction({ operation: input.operation, target, evidence });
|
|
162
|
+
if (hasNative || action !== 'none') {
|
|
163
|
+
sharedNativeActions.push({
|
|
164
|
+
pluginId: target.pluginId,
|
|
165
|
+
codexPluginId: target.codexPluginId,
|
|
166
|
+
action,
|
|
167
|
+
desiredVersion: target.version,
|
|
168
|
+
affectsOtherScopes: action === 'replace' || action === 'repair',
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
if (action === 'replace' || action === 'repair') {
|
|
172
|
+
warnings.push(`codexSharedNativeAffectsOtherScopes:${target.codexPluginId}`);
|
|
173
|
+
}
|
|
174
|
+
const userAction = {
|
|
175
|
+
pluginId: target.pluginId,
|
|
176
|
+
codexPluginId: target.codexPluginId,
|
|
177
|
+
scope: 'user',
|
|
178
|
+
action: activationAction({
|
|
179
|
+
actual: evidence.activations.user,
|
|
180
|
+
desired: userDesired,
|
|
181
|
+
scope: 'user',
|
|
182
|
+
nativeDesiredSomewhere,
|
|
183
|
+
}),
|
|
184
|
+
desired: userDesired,
|
|
185
|
+
};
|
|
186
|
+
const projectAction = {
|
|
187
|
+
pluginId: target.pluginId,
|
|
188
|
+
codexPluginId: target.codexPluginId,
|
|
189
|
+
scope: 'project',
|
|
190
|
+
action: activationAction({
|
|
191
|
+
actual: evidence.activations.project,
|
|
192
|
+
desired: projectDesired,
|
|
193
|
+
scope: 'project',
|
|
194
|
+
nativeDesiredSomewhere,
|
|
195
|
+
}),
|
|
196
|
+
desired: projectDesired,
|
|
197
|
+
};
|
|
198
|
+
userActions.push(userAction);
|
|
199
|
+
projectActions.push(projectAction);
|
|
200
|
+
addExtensionActions({
|
|
201
|
+
input,
|
|
202
|
+
target,
|
|
203
|
+
evidence,
|
|
204
|
+
writes: extensionWrites,
|
|
205
|
+
removals: extensionRemovals,
|
|
206
|
+
});
|
|
207
|
+
if (hasNative && (userDesired || projectDesired)) {
|
|
208
|
+
postcheckPlugins.push({
|
|
209
|
+
pluginId: target.pluginId,
|
|
210
|
+
codexPluginId: target.codexPluginId,
|
|
211
|
+
expectedUserEnabled: userDesired,
|
|
212
|
+
expectedProjectEnabled: projectDesired,
|
|
213
|
+
exactCwd: input.cwd,
|
|
214
|
+
neutralCwdRequired: projectDesired,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const actualDesiredIds = canonicalStrings(sortedTargets.flatMap((target) => target.surface.nativeKinds.length > 0 && desiredScopes(target).length > 0
|
|
219
|
+
? [target.codexPluginId]
|
|
220
|
+
: []));
|
|
221
|
+
const desiredIds = canonicalStrings(sortedTargets.flatMap((target) => (target.intentScopes ?? desiredScopes(target)).includes(input.scope)
|
|
222
|
+
? [target.codexPluginId]
|
|
223
|
+
: []));
|
|
224
|
+
const relatedScope = input.scope === 'user' ? 'project' : 'user';
|
|
225
|
+
const relatedDesiredIds = canonicalStrings(sortedTargets.flatMap((target) => (target.intentScopes ?? desiredScopes(target)).includes(relatedScope)
|
|
226
|
+
? [target.codexPluginId]
|
|
227
|
+
: []));
|
|
228
|
+
const beforeIds = [];
|
|
229
|
+
const relatedBeforeIds = [];
|
|
230
|
+
const nativeReconciledPluginIds = new Set(sortedTargets.flatMap((target) => target.surface.nativeKinds.length > 0 ? [target.codexPluginId] : []));
|
|
231
|
+
const reconciledPluginIds = new Set(sortedTargets.map((target) => target.codexPluginId));
|
|
232
|
+
const staleActivationRemovals = canonicalStrings([...beforeIds, ...relatedBeforeIds].filter((pluginId) => nativeReconciledPluginIds.has(pluginId)
|
|
233
|
+
&& !actualDesiredIds.includes(pluginId))).flatMap((codexPluginId) => [
|
|
234
|
+
{ scope: 'user', codexPluginId },
|
|
235
|
+
{ scope: 'project', codexPluginId },
|
|
236
|
+
]);
|
|
237
|
+
const requirement = getCodexOperationRequirement(projectContractRequired ? 'project' : 'user');
|
|
238
|
+
const support = input.activationSupport ?? 'observed';
|
|
239
|
+
if (support === 'assumed')
|
|
240
|
+
warnings.push('codexProjectActivationAssumed');
|
|
241
|
+
sharedNativeActions.sort((left, right) => compareText(left.codexPluginId, right.codexPluginId));
|
|
242
|
+
sortActivationActions(userActions);
|
|
243
|
+
sortActivationActions(projectActions);
|
|
244
|
+
sortExtensionActions(extensionWrites);
|
|
245
|
+
sortExtensionActions(extensionRemovals);
|
|
246
|
+
postcheckPlugins.sort((left, right) => compareText(left.codexPluginId, right.codexPluginId));
|
|
247
|
+
const ownershipSuperset = canonicalStrings([...beforeIds, ...desiredIds]);
|
|
248
|
+
const convergedIds = canonicalStrings([
|
|
249
|
+
...beforeIds.filter((pluginId) => !reconciledPluginIds.has(pluginId)),
|
|
250
|
+
...desiredIds,
|
|
251
|
+
]);
|
|
252
|
+
const relatedOwnershipSuperset = canonicalStrings([...relatedBeforeIds, ...relatedDesiredIds]);
|
|
253
|
+
const relatedConvergedIds = canonicalStrings([
|
|
254
|
+
...relatedBeforeIds.filter((pluginId) => !reconciledPluginIds.has(pluginId)),
|
|
255
|
+
...relatedDesiredIds,
|
|
256
|
+
]);
|
|
257
|
+
const planDescriptor = {
|
|
258
|
+
requirement,
|
|
259
|
+
desiredTargets: sortedTargets.map((target) => ({
|
|
260
|
+
pluginId: target.pluginId,
|
|
261
|
+
scopes: desiredScopes(target),
|
|
262
|
+
})),
|
|
263
|
+
sharedNativeActions,
|
|
264
|
+
activationActions: { user: userActions, project: projectActions },
|
|
265
|
+
extensionWrites,
|
|
266
|
+
extensionRemovals,
|
|
267
|
+
staleActivationRemovals,
|
|
268
|
+
managedInventory: {
|
|
269
|
+
before: beforeIds,
|
|
270
|
+
desired: desiredIds,
|
|
271
|
+
ownershipSuperset,
|
|
272
|
+
converged: convergedIds,
|
|
273
|
+
related: {
|
|
274
|
+
before: relatedBeforeIds,
|
|
275
|
+
desired: relatedDesiredIds,
|
|
276
|
+
ownershipSuperset: relatedOwnershipSuperset,
|
|
277
|
+
converged: relatedConvergedIds,
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
warnings: canonicalStrings(warnings),
|
|
281
|
+
postcheck: { requirement, support, plugins: postcheckPlugins },
|
|
282
|
+
};
|
|
283
|
+
const sharedImpactPluginIds = sharedNativeActions.flatMap((entry) => entry.affectsOtherScopes ? [entry.codexPluginId] : []);
|
|
284
|
+
return {
|
|
285
|
+
...planDescriptor,
|
|
286
|
+
review: {
|
|
287
|
+
requiresConfirmation: sharedImpactPluginIds.length > 0,
|
|
288
|
+
sharedImpact: {
|
|
289
|
+
pluginIds: sharedImpactPluginIds,
|
|
290
|
+
...(sharedImpactPluginIds.length > 0 ? {
|
|
291
|
+
warning: 'Replacing or reinstalling shared Codex native state can affect other projects.',
|
|
292
|
+
} : {}),
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
export const planCodexReconciliation = createCodexReconcilePlan;
|
|
298
|
+
//# sourceMappingURL=codex-reconciler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-reconciler.js","sourceRoot":"","sources":["../../../src/utils/codex-reconciler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AA8IlE,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,IAAI,CAKuB;IAEpC,YAAY,IAAqC,EAAE,MAAc;QAC/D,KAAK,CAAC,GAAG,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,G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CAAC,CAAC,CAAC,CAAC;oBACrC,OAAO,EAAE,gFAAgF;iBAC1F,CAAC,CAAC,CAAC,EAAE,CAAC;aACR;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CodexMarketplaceSnapshot } from './codex-config.js';
|
|
2
|
+
import type { CodexNativePluginObservation } from './codex-native-observation.js';
|
|
3
|
+
export type CodexSharedNativeDiagnostic = 'staleCacheObserved' | 'marketplaceRegistrationForeign' | 'marketplacePathUnsafe' | 'pluginListUnavailable' | 'pluginListDuplicate' | 'pluginNameCollision' | 'pluginListVersionMismatch' | 'manifestMissing' | 'manifestUnreadable' | 'manifestIdentityMismatch' | 'manifestVersionInvalid' | 'payloadPathUnsafe' | 'payloadDigestMismatch' | 'projectionReceiptMissing' | 'projectionReceiptUnreadable' | 'projectionExpectedPayloadDigestMissing' | 'projectionReceiptIdentityMismatch' | 'projectionPayloadDigestMismatch' | 'projectionRenderDrift';
|
|
4
|
+
export type CodexSharedNativeState = 'missing' | 'usable' | 'replaceable' | 'blocked' | 'unobserved';
|
|
5
|
+
export type CodexSharedNativeInspection = {
|
|
6
|
+
state: 'unobserved';
|
|
7
|
+
staleCacheObserved?: true;
|
|
8
|
+
} | {
|
|
9
|
+
state: 'missing';
|
|
10
|
+
staleCacheObserved?: true;
|
|
11
|
+
} | {
|
|
12
|
+
state: 'usable';
|
|
13
|
+
version?: string;
|
|
14
|
+
} | {
|
|
15
|
+
state: 'replaceable';
|
|
16
|
+
reason: 'outdated' | 'damaged' | 'renderDrift';
|
|
17
|
+
version?: string;
|
|
18
|
+
desiredVersion?: string;
|
|
19
|
+
diagnostic?: CodexSharedNativeDiagnostic;
|
|
20
|
+
} | {
|
|
21
|
+
state: 'blocked';
|
|
22
|
+
reason: 'foreign' | 'unreadable';
|
|
23
|
+
diagnostic: CodexSharedNativeDiagnostic;
|
|
24
|
+
};
|
|
25
|
+
export interface CodexSharedNativeEvidence {
|
|
26
|
+
pluginName: string;
|
|
27
|
+
pluginId: string;
|
|
28
|
+
marketplaceName: string;
|
|
29
|
+
canonicalMarketplaceRoot: string;
|
|
30
|
+
desiredVersion: string;
|
|
31
|
+
expectedPayloadDigest?: string;
|
|
32
|
+
marketplaceRegistration?: CodexMarketplaceSnapshot;
|
|
33
|
+
marketplacePathSafe: boolean;
|
|
34
|
+
observation: CodexNativePluginObservation;
|
|
35
|
+
sourceProjection?: 'current' | 'drifted';
|
|
36
|
+
sourceProjectionIssue?: {
|
|
37
|
+
reason: 'damaged' | 'foreign' | 'unreadable';
|
|
38
|
+
diagnostic: CodexSharedNativeDiagnostic;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare function isCanonicalCodexMarketplaceRegistration(registration: CodexMarketplaceSnapshot | undefined, canonicalMarketplaceRoot: string): boolean;
|
|
42
|
+
export declare function inspectCodexSharedNative(evidence: CodexSharedNativeEvidence): CodexSharedNativeInspection;
|
|
43
|
+
export declare const classifyCodexSharedNativeEvidence: typeof inspectCodexSharedNative;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { tryParseStrictSemVer } from './manifest.js';
|
|
3
|
+
function samePath(left, right) {
|
|
4
|
+
return path.resolve(left) === path.resolve(right);
|
|
5
|
+
}
|
|
6
|
+
export function isCanonicalCodexMarketplaceRegistration(registration, canonicalMarketplaceRoot) {
|
|
7
|
+
return registration?.sourceType === 'local'
|
|
8
|
+
&& registration.sourcePointsToManifest === false
|
|
9
|
+
&& typeof registration.source === 'string'
|
|
10
|
+
&& samePath(registration.source, canonicalMarketplaceRoot);
|
|
11
|
+
}
|
|
12
|
+
function blocked(reason, diagnostic) {
|
|
13
|
+
return { state: 'blocked', reason, diagnostic };
|
|
14
|
+
}
|
|
15
|
+
export function inspectCodexSharedNative(evidence) {
|
|
16
|
+
const expectedPluginId = `${evidence.pluginName}@${evidence.marketplaceName}`;
|
|
17
|
+
if (evidence.pluginId !== expectedPluginId) {
|
|
18
|
+
throw new Error(`Invalid Codex shared native identity: expected ${expectedPluginId}.`);
|
|
19
|
+
}
|
|
20
|
+
if (!tryParseStrictSemVer(evidence.desiredVersion)) {
|
|
21
|
+
throw new Error(`Invalid desired Codex shared native version: ${evidence.desiredVersion}.`);
|
|
22
|
+
}
|
|
23
|
+
if (evidence.expectedPayloadDigest !== undefined
|
|
24
|
+
&& !/^sha256:[0-9a-f]{64}$/u.test(evidence.expectedPayloadDigest)) {
|
|
25
|
+
throw new Error('Invalid expected Codex shared native payload digest.');
|
|
26
|
+
}
|
|
27
|
+
if (!evidence.marketplacePathSafe)
|
|
28
|
+
return blocked('foreign', 'marketplacePathUnsafe');
|
|
29
|
+
if (evidence.observation.state === 'unobserved') {
|
|
30
|
+
return { state: 'unobserved' };
|
|
31
|
+
}
|
|
32
|
+
if (evidence.observation.state === 'failed') {
|
|
33
|
+
return blocked('unreadable', evidence.observation.reason === 'duplicate' ? 'pluginListDuplicate' : 'pluginListUnavailable');
|
|
34
|
+
}
|
|
35
|
+
if (evidence.observation.value === 'absent') {
|
|
36
|
+
return { state: 'missing' };
|
|
37
|
+
}
|
|
38
|
+
const listEntry = evidence.observation.entry;
|
|
39
|
+
if (evidence.marketplaceRegistration && !isCanonicalCodexMarketplaceRegistration(evidence.marketplaceRegistration, evidence.canonicalMarketplaceRoot)) {
|
|
40
|
+
return blocked('foreign', 'marketplaceRegistrationForeign');
|
|
41
|
+
}
|
|
42
|
+
if (!evidence.marketplaceRegistration) {
|
|
43
|
+
return blocked('foreign', 'marketplaceRegistrationForeign');
|
|
44
|
+
}
|
|
45
|
+
if (evidence.sourceProjectionIssue
|
|
46
|
+
&& evidence.sourceProjectionIssue.reason !== 'damaged') {
|
|
47
|
+
return blocked(evidence.sourceProjectionIssue.reason, evidence.sourceProjectionIssue.diagnostic);
|
|
48
|
+
}
|
|
49
|
+
if (listEntry.version !== undefined && listEntry.version !== evidence.desiredVersion) {
|
|
50
|
+
return {
|
|
51
|
+
state: 'replaceable',
|
|
52
|
+
reason: 'outdated',
|
|
53
|
+
version: listEntry.version,
|
|
54
|
+
desiredVersion: evidence.desiredVersion,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (evidence.sourceProjectionIssue?.reason === 'damaged') {
|
|
58
|
+
return {
|
|
59
|
+
state: 'replaceable',
|
|
60
|
+
reason: 'damaged',
|
|
61
|
+
...(listEntry.version ? { version: listEntry.version } : {}),
|
|
62
|
+
desiredVersion: evidence.desiredVersion,
|
|
63
|
+
diagnostic: evidence.sourceProjectionIssue.diagnostic,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (evidence.sourceProjection === 'drifted') {
|
|
67
|
+
return {
|
|
68
|
+
state: 'replaceable',
|
|
69
|
+
reason: 'renderDrift',
|
|
70
|
+
...(listEntry.version ? { version: listEntry.version } : {}),
|
|
71
|
+
desiredVersion: evidence.desiredVersion,
|
|
72
|
+
diagnostic: 'projectionRenderDrift',
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
state: 'usable',
|
|
77
|
+
...(listEntry.version ? { version: listEntry.version } : {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export const classifyCodexSharedNativeEvidence = inspectCodexSharedNative;
|
|
81
|
+
//# sourceMappingURL=codex-shared-native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-shared-native.js","sourceRoot":"","sources":["../../../src/utils/codex-shared-native.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAqErD,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAa;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,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AE,MAAM,KAAK,SAAS,EAAE,CAAC;QACzD,OAAO;YACL,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,SAAS;YACjB,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,cAAc,EAAE,QAAQ,CAAC,cAAc;YACvC,UAAU,EAAE,QAAQ,CAAC,qBAAqB,CAAC,UAAU;SACtD,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QAC5C,OAAO;YACL,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,aAAa;YACrB,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,cAAc,EAAE,QAAQ,CAAC,cAAc;YACvC,UAAU,EAAE,uBAAuB;SACpC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,QAAQ;QACf,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,wBAAwB,CAAC"}
|
|
@@ -5,5 +5,7 @@ export declare function createCodexSkillExpectedTree(options: {
|
|
|
5
5
|
artifact: Pick<CodexSkillArtifact, 'target' | 'skillKey' | 'state' | 'content'>;
|
|
6
6
|
sourceDirs?: string[];
|
|
7
7
|
requireReadme?: boolean;
|
|
8
|
+
requirementsReceipt?: Buffer;
|
|
9
|
+
sourceRequirementsReceiptPolicy?: 'reject' | 'allow' | 'ignore';
|
|
8
10
|
}): Promise<CodexSkillStagingTree>;
|
|
9
11
|
export declare function createCodexSkillStagingTreeContentDigest(tree: CodexSkillStagingTree): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-skill-staging.js","sourceRoot":"","sources":["../../../src/utils/codex-skill-staging.ts"],"names":[],"mappings":"AACA,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,GAEpC,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,
|
|
1
|
+
{"version":3,"file":"codex-skill-staging.js","sourceRoot":"","sources":["../../../src/utils/codex-skill-staging.ts"],"names":[],"mappings":"AACA,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,GAEpC,MAAM,yBAAyB,CAAC;AAIjC,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,OAMlD;IACC,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wCAAwC,CACtD,IAA2B;IAE3B,OAAO,mCAAmC,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { NormalizedPluginManifest, Scope } from '../types.js';
|
|
2
|
+
export declare const QUALIFIED_CODEX_NATIVE_KINDS: readonly ["skill", "mcp", "hook", "app"];
|
|
3
|
+
export type CodexNativeKind = typeof QUALIFIED_CODEX_NATIVE_KINDS[number];
|
|
4
|
+
export type CodexUnsupportedNativeKind = 'slashCommand';
|
|
5
|
+
export type CodexExtensionKind = 'skill' | 'instruction' | 'permission' | 'agent';
|
|
6
|
+
export type CodexSurfaceClassification = 'empty' | 'native' | 'aw-extension' | 'mixed' | 'unsupported';
|
|
7
|
+
export type CodexSurfaceDeliveryOwner = 'none' | 'codex-native' | 'aw' | 'split' | 'unsupported';
|
|
8
|
+
export type CodexScopeOverlap = 'none' | 'native-compatible' | 'aw-owned-conflict';
|
|
9
|
+
export interface CodexSurfaceComponent {
|
|
10
|
+
key: string;
|
|
11
|
+
kind: CodexNativeKind | CodexExtensionKind;
|
|
12
|
+
owner: 'codex-native' | 'aw';
|
|
13
|
+
scopes: Scope[];
|
|
14
|
+
dynamic: boolean;
|
|
15
|
+
refreshKeys?: string[];
|
|
16
|
+
name?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CodexSurfaceOwnerCollision {
|
|
19
|
+
kind: CodexNativeKind | CodexExtensionKind;
|
|
20
|
+
name: string;
|
|
21
|
+
owners: ['codex-native', 'aw'];
|
|
22
|
+
}
|
|
23
|
+
export interface CodexSurfaceAnalysisOptions {
|
|
24
|
+
nativeArtifactNames?: Partial<Record<CodexNativeKind, readonly string[]>>;
|
|
25
|
+
}
|
|
26
|
+
export interface CodexSurfaceAnalysis {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
configInputs: string[];
|
|
29
|
+
nativeKinds: CodexNativeKind[];
|
|
30
|
+
extensionKinds: CodexExtensionKind[];
|
|
31
|
+
unsupportedKinds: CodexUnsupportedNativeKind[];
|
|
32
|
+
classification: CodexSurfaceClassification;
|
|
33
|
+
deliveryOwner: CodexSurfaceDeliveryOwner;
|
|
34
|
+
scopeOverlap: CodexScopeOverlap;
|
|
35
|
+
components: CodexSurfaceComponent[];
|
|
36
|
+
collisions: CodexSurfaceOwnerCollision[];
|
|
37
|
+
missingNativeIdentityKinds: CodexNativeKind[];
|
|
38
|
+
errorCode?: 'codexSurfaceOwnerCollision' | 'codexSurfaceNativeIdentityMissing' | 'codexNativeKindUnsupported';
|
|
39
|
+
}
|
|
40
|
+
export declare class CodexSurfaceAnalysisError extends Error {
|
|
41
|
+
readonly code: 'codexSurfaceOwnerCollision' | 'codexSurfaceNativeIdentityMissing' | 'codexNativeKindUnsupported';
|
|
42
|
+
readonly analysis: CodexSurfaceAnalysis;
|
|
43
|
+
constructor(analysis: CodexSurfaceAnalysis);
|
|
44
|
+
}
|
|
45
|
+
export declare function analyzeCodexSurface(manifest: NormalizedPluginManifest, options?: CodexSurfaceAnalysisOptions): CodexSurfaceAnalysis;
|
|
46
|
+
export declare function assertCodexSurfaceSupported(analysis: CodexSurfaceAnalysis): CodexSurfaceAnalysis;
|