@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
|
@@ -1,695 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
export const PLUGIN_EVAL_SCHEMA_VERSION = 2;
|
|
4
|
-
export const PLUGIN_EVAL_CASE_SCHEMA_VERSION = 1;
|
|
5
|
-
function isRecord(value) {
|
|
6
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
-
}
|
|
8
|
-
function expectRecord(value, label) {
|
|
9
|
-
if (!isRecord(value)) {
|
|
10
|
-
throw new Error(`${label} must be an object.`);
|
|
11
|
-
}
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
function expectOnlyKeys(value, allowedKeys, label) {
|
|
15
|
-
const allowed = new Set(allowedKeys);
|
|
16
|
-
const unknownKey = Object.keys(value).find((key) => !allowed.has(key));
|
|
17
|
-
if (unknownKey) {
|
|
18
|
-
throw new Error(`${label} has unknown field "${unknownKey}".`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function parseEvalWorkspacePath(value, label, options) {
|
|
22
|
-
const raw = expectString(value, label);
|
|
23
|
-
const treePattern = options.allowTreePattern && raw.endsWith('/**');
|
|
24
|
-
const candidate = treePattern ? raw.slice(0, -3) : raw;
|
|
25
|
-
if (candidate === '' ||
|
|
26
|
-
candidate.includes('\0') ||
|
|
27
|
-
candidate.includes('\\') ||
|
|
28
|
-
candidate.includes('*') ||
|
|
29
|
-
candidate.includes('?') ||
|
|
30
|
-
candidate.includes('[') ||
|
|
31
|
-
candidate.includes(']') ||
|
|
32
|
-
path.isAbsolute(candidate) ||
|
|
33
|
-
path.posix.normalize(candidate) !== candidate ||
|
|
34
|
-
candidate.split('/').includes('..')) {
|
|
35
|
-
throw new Error(`${label} must be a normalized POSIX path inside the eval workspace.`);
|
|
36
|
-
}
|
|
37
|
-
const firstSegment = candidate.split('/')[0];
|
|
38
|
-
if (firstSegment === '.git' || firstSegment === '.agents' || firstSegment === '.codex') {
|
|
39
|
-
throw new Error(`${label} must not target an eval control directory.`);
|
|
40
|
-
}
|
|
41
|
-
return raw;
|
|
42
|
-
}
|
|
43
|
-
function workspacePathMatchesPattern(relativePath, pattern) {
|
|
44
|
-
if (pattern.endsWith('/**')) {
|
|
45
|
-
const prefix = pattern.slice(0, -3);
|
|
46
|
-
return relativePath === prefix || relativePath.startsWith(`${prefix}/`);
|
|
47
|
-
}
|
|
48
|
-
return relativePath === pattern;
|
|
49
|
-
}
|
|
50
|
-
function expectString(value, label) {
|
|
51
|
-
if (typeof value !== 'string' || value.trim() === '') {
|
|
52
|
-
throw new Error(`${label} must be a non-empty string.`);
|
|
53
|
-
}
|
|
54
|
-
return value;
|
|
55
|
-
}
|
|
56
|
-
function expectBoolean(value, label) {
|
|
57
|
-
if (typeof value !== 'boolean') {
|
|
58
|
-
throw new Error(`${label} must be boolean.`);
|
|
59
|
-
}
|
|
60
|
-
return value;
|
|
61
|
-
}
|
|
62
|
-
function expectPositiveInteger(value, label) {
|
|
63
|
-
if (!Number.isInteger(value) || value <= 0) {
|
|
64
|
-
throw new Error(`${label} must be a positive integer.`);
|
|
65
|
-
}
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
function expectRate(value, label) {
|
|
69
|
-
if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || value > 1) {
|
|
70
|
-
throw new Error(`${label} must be a number greater than 0 and at most 1.`);
|
|
71
|
-
}
|
|
72
|
-
return value;
|
|
73
|
-
}
|
|
74
|
-
function isPathInsideOrEqual(root, candidate) {
|
|
75
|
-
const relative = path.relative(root, candidate);
|
|
76
|
-
return relative === '' || (relative !== '..' &&
|
|
77
|
-
!relative.startsWith(`..${path.sep}`) &&
|
|
78
|
-
!path.isAbsolute(relative));
|
|
79
|
-
}
|
|
80
|
-
function assertRealPathInside(boundary, candidate, label, boundaryLabel) {
|
|
81
|
-
const canonicalBoundary = fs.realpathSync(boundary);
|
|
82
|
-
const canonicalCandidate = fs.realpathSync(candidate);
|
|
83
|
-
if (!isPathInsideOrEqual(canonicalBoundary, canonicalCandidate)) {
|
|
84
|
-
throw new Error(`${label} must stay inside the ${boundaryLabel}.`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function validateEvalRelativeFile(pluginRoot, evalRoot, value, label) {
|
|
88
|
-
const inputPath = expectString(value, label);
|
|
89
|
-
const normalizedInput = inputPath.replace(/^\.\//u, '');
|
|
90
|
-
if (path.isAbsolute(normalizedInput) ||
|
|
91
|
-
normalizedInput.split(/[\\/]/u).includes('..')) {
|
|
92
|
-
throw new Error(`${label} must stay inside the Skill eval directory.`);
|
|
93
|
-
}
|
|
94
|
-
const absolutePath = path.resolve(evalRoot, normalizedInput);
|
|
95
|
-
if (!fs.pathExistsSync(absolutePath) || !fs.statSync(absolutePath).isFile()) {
|
|
96
|
-
throw new Error(`${label} must reference an existing file: ${inputPath}`);
|
|
97
|
-
}
|
|
98
|
-
assertRealPathInside(evalRoot, absolutePath, label, 'Skill eval directory');
|
|
99
|
-
const pluginRelative = path.relative(pluginRoot, absolutePath).split(path.sep).join('/');
|
|
100
|
-
return `./${pluginRelative}`;
|
|
101
|
-
}
|
|
102
|
-
function parseStringArray(value, label) {
|
|
103
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
104
|
-
throw new Error(`${label} must be a non-empty array.`);
|
|
105
|
-
}
|
|
106
|
-
return value.map((entry, index) => expectString(entry, `${label}[${index}]`));
|
|
107
|
-
}
|
|
108
|
-
function assertUniqueIds(values, label) {
|
|
109
|
-
const seen = new Set();
|
|
110
|
-
for (const value of values) {
|
|
111
|
-
if (seen.has(value.id)) {
|
|
112
|
-
throw new Error(`Duplicate ${label} id: ${value.id}`);
|
|
113
|
-
}
|
|
114
|
-
seen.add(value.id);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function validateConversationReply(value, label) {
|
|
118
|
-
if (typeof value === 'string')
|
|
119
|
-
return;
|
|
120
|
-
const reply = expectRecord(value, label);
|
|
121
|
-
if (!Array.isArray(reply.answers_by_index) || reply.answers_by_index.some((entry) => typeof entry !== 'string')) {
|
|
122
|
-
throw new Error(`${label}.answers_by_index must be an array of strings.`);
|
|
123
|
-
}
|
|
124
|
-
if (reply.expected_question_count !== undefined &&
|
|
125
|
-
(!Number.isInteger(reply.expected_question_count) ||
|
|
126
|
-
reply.expected_question_count < 0)) {
|
|
127
|
-
throw new Error(`${label}.expected_question_count must be a non-negative integer.`);
|
|
128
|
-
}
|
|
129
|
-
expectString(reply.unexpected_question_answer, `${label}.unexpected_question_answer`);
|
|
130
|
-
}
|
|
131
|
-
function validateConversationWorkspaceFiles(value, label) {
|
|
132
|
-
if (value === undefined)
|
|
133
|
-
return;
|
|
134
|
-
const files = expectRecord(value, label);
|
|
135
|
-
const entries = Object.entries(files);
|
|
136
|
-
if (entries.length === 0) {
|
|
137
|
-
throw new Error(`${label} must contain at least one file.`);
|
|
138
|
-
}
|
|
139
|
-
for (const [relativePath, content] of entries) {
|
|
140
|
-
parseEvalWorkspacePath(relativePath, `${label}.${relativePath}`, {
|
|
141
|
-
allowTreePattern: false,
|
|
142
|
-
});
|
|
143
|
-
expectString(content, `${label}.${relativePath}`);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
export function validatePluginEvalConversationCaseDocument(value, expectedSkill, label = 'conversation cases') {
|
|
147
|
-
const document = expectRecord(value, label);
|
|
148
|
-
const skill = expectString(document.skill_name, `${label}.skill_name`);
|
|
149
|
-
if (skill !== expectedSkill) {
|
|
150
|
-
throw new Error(`${label}.skill_name "${skill}" does not match suite skill "${expectedSkill}".`);
|
|
151
|
-
}
|
|
152
|
-
if (!Array.isArray(document.evals) || document.evals.length === 0) {
|
|
153
|
-
throw new Error(`${label}.evals must be a non-empty array.`);
|
|
154
|
-
}
|
|
155
|
-
const ids = new Set();
|
|
156
|
-
return document.evals.map((entry, index) => {
|
|
157
|
-
const row = expectRecord(entry, `${label}.evals[${index}]`);
|
|
158
|
-
const id = expectString(row.id, `${label}.evals[${index}].id`).trim();
|
|
159
|
-
if (ids.has(id)) {
|
|
160
|
-
throw new Error(`${label} has duplicate case id "${id}".`);
|
|
161
|
-
}
|
|
162
|
-
ids.add(id);
|
|
163
|
-
expectString(row.prompt, `${label}.evals[${index}].prompt`);
|
|
164
|
-
const sandbox = row.sandbox === undefined
|
|
165
|
-
? 'read-only'
|
|
166
|
-
: expectString(row.sandbox, `${label}.evals[${index}].sandbox`);
|
|
167
|
-
if (sandbox !== 'read-only' && sandbox !== 'workspace-write') {
|
|
168
|
-
throw new Error(`${label}.evals[${index}].sandbox must be "read-only" or "workspace-write".`);
|
|
169
|
-
}
|
|
170
|
-
if (!Array.isArray(row.scripted_replies)) {
|
|
171
|
-
throw new Error(`${label}.evals[${index}].scripted_replies must be an array.`);
|
|
172
|
-
}
|
|
173
|
-
row.scripted_replies.forEach((reply, replyIndex) => validateConversationReply(reply, `${label}.evals[${index}].scripted_replies[${replyIndex}]`));
|
|
174
|
-
expectString(row.expected_output, `${label}.evals[${index}].expected_output`);
|
|
175
|
-
validateConversationWorkspaceFiles(row.workspace_files, `${label}.evals[${index}].workspace_files`);
|
|
176
|
-
const review = expectRecord(row.review, `${label}.evals[${index}].review`);
|
|
177
|
-
parseStringArray(review.checks, `${label}.evals[${index}].review.checks`);
|
|
178
|
-
if (review.workspace_unchanged !== undefined) {
|
|
179
|
-
expectBoolean(review.workspace_unchanged, `${label}.evals[${index}].review.workspace_unchanged`);
|
|
180
|
-
}
|
|
181
|
-
const allowedWorkspaceChanges = review.allowed_workspace_changes === undefined
|
|
182
|
-
? []
|
|
183
|
-
: parseStringArray(review.allowed_workspace_changes, `${label}.evals[${index}].review.allowed_workspace_changes`).map((entry, pathIndex) => parseEvalWorkspacePath(entry, `${label}.evals[${index}].review.allowed_workspace_changes[${pathIndex}]`, { allowTreePattern: true }));
|
|
184
|
-
const artifacts = review.artifacts === undefined
|
|
185
|
-
? []
|
|
186
|
-
: review.artifacts;
|
|
187
|
-
if (!Array.isArray(artifacts)) {
|
|
188
|
-
throw new Error(`${label}.evals[${index}].review.artifacts must be an array.`);
|
|
189
|
-
}
|
|
190
|
-
const artifactPaths = artifacts.map((artifact, artifactIndex) => {
|
|
191
|
-
const artifactLabel = `${label}.evals[${index}].review.artifacts[${artifactIndex}]`;
|
|
192
|
-
const artifactRow = expectRecord(artifact, artifactLabel);
|
|
193
|
-
expectOnlyKeys(artifactRow, ['path', 'exists', 'contains', 'not_contains', 'json'], artifactLabel);
|
|
194
|
-
const artifactPath = parseEvalWorkspacePath(artifactRow.path, `${artifactLabel}.path`, { allowTreePattern: false });
|
|
195
|
-
if (artifactRow.exists !== undefined) {
|
|
196
|
-
expectBoolean(artifactRow.exists, `${artifactLabel}.exists`);
|
|
197
|
-
}
|
|
198
|
-
if (artifactRow.contains !== undefined) {
|
|
199
|
-
parseStringArray(artifactRow.contains, `${artifactLabel}.contains`);
|
|
200
|
-
}
|
|
201
|
-
if (artifactRow.not_contains !== undefined) {
|
|
202
|
-
parseStringArray(artifactRow.not_contains, `${artifactLabel}.not_contains`);
|
|
203
|
-
}
|
|
204
|
-
if (artifactRow.json !== undefined) {
|
|
205
|
-
expectRecord(artifactRow.json, `${artifactLabel}.json`);
|
|
206
|
-
}
|
|
207
|
-
return artifactPath;
|
|
208
|
-
});
|
|
209
|
-
if (new Set(artifactPaths).size !== artifactPaths.length) {
|
|
210
|
-
throw new Error(`${label}.evals[${index}].review.artifacts contains duplicate paths.`);
|
|
211
|
-
}
|
|
212
|
-
if (sandbox === 'workspace-write') {
|
|
213
|
-
if (review.workspace_unchanged !== false) {
|
|
214
|
-
throw new Error(`${label}.evals[${index}] workspace-write requires review.workspace_unchanged=false.`);
|
|
215
|
-
}
|
|
216
|
-
if (allowedWorkspaceChanges.length === 0) {
|
|
217
|
-
throw new Error(`${label}.evals[${index}] workspace-write requires non-empty review.allowed_workspace_changes.`);
|
|
218
|
-
}
|
|
219
|
-
if (artifactPaths.length === 0) {
|
|
220
|
-
throw new Error(`${label}.evals[${index}] workspace-write requires non-empty review.artifacts.`);
|
|
221
|
-
}
|
|
222
|
-
const unmatchedArtifact = artifactPaths.find((artifactPath) => !allowedWorkspaceChanges.some((pattern) => workspacePathMatchesPattern(artifactPath, pattern)));
|
|
223
|
-
if (unmatchedArtifact) {
|
|
224
|
-
throw new Error(`${label}.evals[${index}] artifact path ${JSON.stringify(unmatchedArtifact)} is outside review.allowed_workspace_changes.`);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return row;
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
function parseProfile(value, index, ownerPlugin) {
|
|
231
|
-
const row = expectRecord(value, `profiles[${index}]`);
|
|
232
|
-
expectOnlyKeys(row, ['id', 'scope', 'plugins', 'runModel', 'requiredForRelease'], `profiles[${index}]`);
|
|
233
|
-
const id = expectString(row.id, `profiles[${index}].id`);
|
|
234
|
-
if (!/^[a-z0-9][a-z0-9-]*$/u.test(id)) {
|
|
235
|
-
throw new Error(`profiles[${index}].id must use lowercase kebab-case.`);
|
|
236
|
-
}
|
|
237
|
-
const scope = row.scope;
|
|
238
|
-
if (scope !== 'user' && scope !== 'project') {
|
|
239
|
-
throw new Error(`profiles[${index}].scope must be user or project.`);
|
|
240
|
-
}
|
|
241
|
-
if (!Array.isArray(row.plugins) || row.plugins.length === 0) {
|
|
242
|
-
throw new Error(`profiles[${index}].plugins must be a non-empty array.`);
|
|
243
|
-
}
|
|
244
|
-
const seenPlugins = new Set();
|
|
245
|
-
const plugins = row.plugins.map((value, pluginIndex) => {
|
|
246
|
-
const label = `profiles[${index}].plugins[${pluginIndex}]`;
|
|
247
|
-
const plugin = expectRecord(value, label);
|
|
248
|
-
expectOnlyKeys(plugin, ['name', 'config'], label);
|
|
249
|
-
const name = expectString(plugin.name, `${label}.name`);
|
|
250
|
-
if (!/^[a-z0-9][a-z0-9-]*$/u.test(name)) {
|
|
251
|
-
throw new Error(`${label}.name must use lowercase kebab-case.`);
|
|
252
|
-
}
|
|
253
|
-
if (seenPlugins.has(name)) {
|
|
254
|
-
throw new Error(`profiles[${index}].plugins has duplicate plugin "${name}".`);
|
|
255
|
-
}
|
|
256
|
-
seenPlugins.add(name);
|
|
257
|
-
return {
|
|
258
|
-
name,
|
|
259
|
-
config: plugin.config === undefined
|
|
260
|
-
? {}
|
|
261
|
-
: expectRecord(plugin.config, `${label}.config`),
|
|
262
|
-
};
|
|
263
|
-
});
|
|
264
|
-
if (!seenPlugins.has(ownerPlugin)) {
|
|
265
|
-
throw new Error(`profiles[${index}].plugins must include owner plugin "${ownerPlugin}".`);
|
|
266
|
-
}
|
|
267
|
-
return {
|
|
268
|
-
id,
|
|
269
|
-
scope,
|
|
270
|
-
plugins,
|
|
271
|
-
runModel: expectBoolean(row.runModel, `profiles[${index}].runModel`),
|
|
272
|
-
requiredForRelease: expectBoolean(row.requiredForRelease, `profiles[${index}].requiredForRelease`),
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
const VALID_SPLITS = new Set(['train', 'validation', 'sanity', 'all']);
|
|
276
|
-
const VALID_TRIGGER_CASE_SPLITS = new Set([
|
|
277
|
-
'train',
|
|
278
|
-
'validation',
|
|
279
|
-
'sanity',
|
|
280
|
-
]);
|
|
281
|
-
const VALID_SUPPORTS = new Set([
|
|
282
|
-
'split',
|
|
283
|
-
'runs',
|
|
284
|
-
'case',
|
|
285
|
-
'model',
|
|
286
|
-
'codexBin',
|
|
287
|
-
'timeout',
|
|
288
|
-
'allowEnvironmentSkips',
|
|
289
|
-
]);
|
|
290
|
-
function parseIsolation(value, label) {
|
|
291
|
-
const isolation = value ?? 'standard';
|
|
292
|
-
if (isolation !== 'standard' && isolation !== 'strict') {
|
|
293
|
-
throw new Error(`${label} must be standard or strict.`);
|
|
294
|
-
}
|
|
295
|
-
return isolation;
|
|
296
|
-
}
|
|
297
|
-
function parseSuite(pluginRoot, evalRoot, skill, value, index, profileIds) {
|
|
298
|
-
const row = expectRecord(value, `suites[${index}]`);
|
|
299
|
-
const id = expectString(row.id, `suites[${index}].id`);
|
|
300
|
-
if (!/^[a-z0-9][a-z0-9-]*$/u.test(id)) {
|
|
301
|
-
throw new Error(`suites[${index}].id must use lowercase kebab-case.`);
|
|
302
|
-
}
|
|
303
|
-
const kind = row.kind;
|
|
304
|
-
if (kind !== 'command' && kind !== 'conversation' && kind !== 'trigger') {
|
|
305
|
-
throw new Error(`suites[${index}].kind must be command, conversation, or trigger.`);
|
|
306
|
-
}
|
|
307
|
-
const profiles = parseStringArray(row.profiles, `suites[${index}].profiles`);
|
|
308
|
-
for (const profile of profiles) {
|
|
309
|
-
if (!profileIds.has(profile)) {
|
|
310
|
-
throw new Error(`suites[${index}] references unknown profile "${profile}".`);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const skills = parseStringArray(row.skills, `suites[${index}].skills`);
|
|
314
|
-
const uniqueSkills = new Set();
|
|
315
|
-
for (const [skillIndex, participant] of skills.entries()) {
|
|
316
|
-
if (!/^[a-z0-9][a-z0-9-]*$/u.test(participant)) {
|
|
317
|
-
throw new Error(`suites[${index}].skills[${skillIndex}] must use lowercase kebab-case.`);
|
|
318
|
-
}
|
|
319
|
-
if (uniqueSkills.has(participant)) {
|
|
320
|
-
throw new Error(`suites[${index}].skills has duplicate Skill "${participant}".`);
|
|
321
|
-
}
|
|
322
|
-
uniqueSkills.add(participant);
|
|
323
|
-
}
|
|
324
|
-
if (!uniqueSkills.has(skill)) {
|
|
325
|
-
throw new Error(`suites[${index}].skills must include owner Skill "${skill}".`);
|
|
326
|
-
}
|
|
327
|
-
const rawSplits = row.releaseSplits ?? [];
|
|
328
|
-
if (!Array.isArray(rawSplits)) {
|
|
329
|
-
throw new Error(`suites[${index}].releaseSplits must be an array.`);
|
|
330
|
-
}
|
|
331
|
-
const releaseSplits = rawSplits.map((entry, splitIndex) => {
|
|
332
|
-
const split = expectString(entry, `suites[${index}].releaseSplits[${splitIndex}]`);
|
|
333
|
-
if (!VALID_SPLITS.has(split)) {
|
|
334
|
-
throw new Error(`Unsupported release split "${split}" in suite "${id}".`);
|
|
335
|
-
}
|
|
336
|
-
return split;
|
|
337
|
-
});
|
|
338
|
-
const common = {
|
|
339
|
-
id,
|
|
340
|
-
skill,
|
|
341
|
-
skills,
|
|
342
|
-
profiles,
|
|
343
|
-
defaultRuns: expectPositiveInteger(row.defaultRuns, `suites[${index}].defaultRuns`),
|
|
344
|
-
releaseSplits,
|
|
345
|
-
requiredForRelease: expectBoolean(row.requiredForRelease, `suites[${index}].requiredForRelease`),
|
|
346
|
-
perRunTimeoutMs: expectPositiveInteger(row.perRunTimeoutMs, `suites[${index}].perRunTimeoutMs`),
|
|
347
|
-
};
|
|
348
|
-
if (kind === 'conversation') {
|
|
349
|
-
expectOnlyKeys(row, [
|
|
350
|
-
'id', 'kind', 'skills', 'cases', 'profiles', 'defaultRuns', 'releaseSplits',
|
|
351
|
-
'requiredForRelease', 'perRunTimeoutMs', 'isolation',
|
|
352
|
-
], `suites[${index}]`);
|
|
353
|
-
return {
|
|
354
|
-
...common,
|
|
355
|
-
kind,
|
|
356
|
-
cases: validateEvalRelativeFile(pluginRoot, evalRoot, row.cases, `suites[${index}].cases`),
|
|
357
|
-
isolation: parseIsolation(row.isolation, `suites[${index}].isolation`),
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
if (kind === 'trigger') {
|
|
361
|
-
expectOnlyKeys(row, [
|
|
362
|
-
'id', 'kind', 'skills', 'cases', 'fixtureModule', 'observeSpawnAgent', 'isolation',
|
|
363
|
-
'strictNegativeSplits', 'minimumPassRate', 'forbidMultipleSkillLoads',
|
|
364
|
-
'profiles', 'defaultRuns', 'releaseSplits',
|
|
365
|
-
'requiredForRelease', 'perRunTimeoutMs',
|
|
366
|
-
], `suites[${index}]`);
|
|
367
|
-
const isolation = parseIsolation(row.isolation, `suites[${index}].isolation`);
|
|
368
|
-
const rawStrictNegativeSplits = row.strictNegativeSplits ?? [];
|
|
369
|
-
if (!Array.isArray(rawStrictNegativeSplits)) {
|
|
370
|
-
throw new Error(`suites[${index}].strictNegativeSplits must be an array.`);
|
|
371
|
-
}
|
|
372
|
-
const strictNegativeSplits = rawStrictNegativeSplits.map((entry, splitIndex) => {
|
|
373
|
-
const split = expectString(entry, `suites[${index}].strictNegativeSplits[${splitIndex}]`);
|
|
374
|
-
if (!VALID_TRIGGER_CASE_SPLITS.has(split)) {
|
|
375
|
-
throw new Error(`Unsupported strict negative split "${split}" in suite "${id}".`);
|
|
376
|
-
}
|
|
377
|
-
return split;
|
|
378
|
-
});
|
|
379
|
-
const fixtureModule = row.fixtureModule === undefined
|
|
380
|
-
? undefined
|
|
381
|
-
: validateEvalRelativeFile(pluginRoot, evalRoot, row.fixtureModule, `suites[${index}].fixtureModule`);
|
|
382
|
-
if (fixtureModule && path.extname(fixtureModule) !== '.mjs') {
|
|
383
|
-
throw new Error(`suites[${index}].fixtureModule must reference an .mjs file.`);
|
|
384
|
-
}
|
|
385
|
-
return {
|
|
386
|
-
...common,
|
|
387
|
-
kind,
|
|
388
|
-
cases: validateEvalRelativeFile(pluginRoot, evalRoot, row.cases, `suites[${index}].cases`),
|
|
389
|
-
...(fixtureModule ? { fixtureModule } : {}),
|
|
390
|
-
observeSpawnAgent: expectBoolean(row.observeSpawnAgent, `suites[${index}].observeSpawnAgent`),
|
|
391
|
-
isolation,
|
|
392
|
-
strictNegativeSplits,
|
|
393
|
-
...(row.minimumPassRate === undefined ? {} : {
|
|
394
|
-
minimumPassRate: expectRate(row.minimumPassRate, `suites[${index}].minimumPassRate`),
|
|
395
|
-
}),
|
|
396
|
-
forbidMultipleSkillLoads: row.forbidMultipleSkillLoads === undefined
|
|
397
|
-
? false
|
|
398
|
-
: expectBoolean(row.forbidMultipleSkillLoads, `suites[${index}].forbidMultipleSkillLoads`),
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
const rawSupports = row.supports ?? [];
|
|
402
|
-
expectOnlyKeys(row, [
|
|
403
|
-
'id', 'kind', 'skills', 'entry', 'cases', 'profiles', 'defaultRuns', 'releaseSplits',
|
|
404
|
-
'requiredForRelease', 'perRunTimeoutMs', 'suiteTimeoutMs', 'supports',
|
|
405
|
-
], `suites[${index}]`);
|
|
406
|
-
if (!Array.isArray(rawSupports)) {
|
|
407
|
-
throw new Error(`suites[${index}].supports must be an array.`);
|
|
408
|
-
}
|
|
409
|
-
const supports = rawSupports.map((entry, supportIndex) => {
|
|
410
|
-
const support = expectString(entry, `suites[${index}].supports[${supportIndex}]`);
|
|
411
|
-
if (!VALID_SUPPORTS.has(support)) {
|
|
412
|
-
throw new Error(`Unsupported command capability "${support}" in suite "${id}".`);
|
|
413
|
-
}
|
|
414
|
-
return support;
|
|
415
|
-
});
|
|
416
|
-
const suiteTimeoutMs = expectPositiveInteger(row.suiteTimeoutMs, `suites[${index}].suiteTimeoutMs`);
|
|
417
|
-
if (suiteTimeoutMs < common.perRunTimeoutMs) {
|
|
418
|
-
throw new Error(`suites[${index}].suiteTimeoutMs must be greater than or equal to perRunTimeoutMs.`);
|
|
419
|
-
}
|
|
420
|
-
const cases = row.cases === undefined
|
|
421
|
-
? undefined
|
|
422
|
-
: validateEvalRelativeFile(pluginRoot, evalRoot, row.cases, `suites[${index}].cases`);
|
|
423
|
-
if (supports.includes('case') && !cases) {
|
|
424
|
-
throw new Error(`suites[${index}].cases is required when supports includes case.`);
|
|
425
|
-
}
|
|
426
|
-
if (cases && !supports.includes('case')) {
|
|
427
|
-
throw new Error(`suites[${index}].cases requires supports to include case.`);
|
|
428
|
-
}
|
|
429
|
-
return {
|
|
430
|
-
...common,
|
|
431
|
-
kind,
|
|
432
|
-
entry: validateEvalRelativeFile(pluginRoot, evalRoot, row.entry, `suites[${index}].entry`),
|
|
433
|
-
...(cases ? { cases } : {}),
|
|
434
|
-
suiteTimeoutMs,
|
|
435
|
-
supports,
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
function validatePluginEvalCommandCaseDocument(value, skill, label) {
|
|
439
|
-
const document = expectRecord(value, label);
|
|
440
|
-
if (document.skill_name !== skill) {
|
|
441
|
-
throw new Error(`${label}.skill_name must be ${JSON.stringify(skill)}.`);
|
|
442
|
-
}
|
|
443
|
-
if (!Array.isArray(document.evals) || document.evals.length === 0) {
|
|
444
|
-
throw new Error(`${label}.evals must be a non-empty array.`);
|
|
445
|
-
}
|
|
446
|
-
const ids = document.evals.map((entry, index) => {
|
|
447
|
-
const row = expectRecord(entry, `${label}.evals[${index}]`);
|
|
448
|
-
const id = expectString(row.id, `${label}.evals[${index}].id`);
|
|
449
|
-
if (!/^[a-z0-9_]+$/u.test(id)) {
|
|
450
|
-
throw new Error(`${label}.evals[${index}].id must use lowercase letters, digits, and underscores.`);
|
|
451
|
-
}
|
|
452
|
-
return id;
|
|
453
|
-
});
|
|
454
|
-
if (new Set(ids).size !== ids.length) {
|
|
455
|
-
throw new Error(`${label}.evals contains duplicate ids.`);
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
function parseTriggerCase(value, index, suite) {
|
|
459
|
-
const row = expectRecord(value, `trigger cases[${index}]`);
|
|
460
|
-
const id = expectString(row.id, `trigger cases[${index}].id`);
|
|
461
|
-
if (!/^[a-z0-9][a-z0-9_]*$/u.test(id)) {
|
|
462
|
-
throw new Error(`trigger cases[${index}].id must use lowercase snake_case.`);
|
|
463
|
-
}
|
|
464
|
-
const split = expectString(row.split, `trigger cases[${index}].split`);
|
|
465
|
-
if (!VALID_TRIGGER_CASE_SPLITS.has(split)) {
|
|
466
|
-
throw new Error(`trigger cases[${index}].split must be train, validation, or sanity.`);
|
|
467
|
-
}
|
|
468
|
-
const shouldSpawnAgent = row.should_spawn_agent === undefined
|
|
469
|
-
? undefined
|
|
470
|
-
: expectBoolean(row.should_spawn_agent, `trigger cases[${index}].should_spawn_agent`);
|
|
471
|
-
if (suite.observeSpawnAgent && shouldSpawnAgent === undefined) {
|
|
472
|
-
throw new Error(`trigger cases[${index}].should_spawn_agent is required when observeSpawnAgent=true.`);
|
|
473
|
-
}
|
|
474
|
-
if (!suite.observeSpawnAgent && shouldSpawnAgent !== undefined) {
|
|
475
|
-
throw new Error(`trigger cases[${index}].should_spawn_agent requires observeSpawnAgent=true.`);
|
|
476
|
-
}
|
|
477
|
-
const workspaceFixture = row.workspace_fixture === undefined
|
|
478
|
-
? undefined
|
|
479
|
-
: expectString(row.workspace_fixture, `trigger cases[${index}].workspace_fixture`);
|
|
480
|
-
const useProjectRules = row.use_project_rules === undefined
|
|
481
|
-
? undefined
|
|
482
|
-
: expectBoolean(row.use_project_rules, `trigger cases[${index}].use_project_rules`);
|
|
483
|
-
let tags;
|
|
484
|
-
if (row.tags !== undefined) {
|
|
485
|
-
tags = parseStringArray(row.tags, `trigger cases[${index}].tags`);
|
|
486
|
-
}
|
|
487
|
-
const usesLegacyExpectation = row.should_load_skill !== undefined;
|
|
488
|
-
const usesRouteExpectation = row.expected_loaded_skills !== undefined;
|
|
489
|
-
if (usesLegacyExpectation === usesRouteExpectation) {
|
|
490
|
-
throw new Error(`trigger cases[${index}] must declare exactly one of should_load_skill or expected_loaded_skills.`);
|
|
491
|
-
}
|
|
492
|
-
let expectedLoadedSkills;
|
|
493
|
-
if (usesRouteExpectation) {
|
|
494
|
-
if (!Array.isArray(row.expected_loaded_skills)) {
|
|
495
|
-
throw new Error(`trigger cases[${index}].expected_loaded_skills must be an array.`);
|
|
496
|
-
}
|
|
497
|
-
expectedLoadedSkills = row.expected_loaded_skills.map((entry, skillIndex) => expectString(entry, `trigger cases[${index}].expected_loaded_skills[${skillIndex}]`));
|
|
498
|
-
if (new Set(expectedLoadedSkills).size !== expectedLoadedSkills.length) {
|
|
499
|
-
throw new Error(`trigger cases[${index}].expected_loaded_skills must not contain duplicates.`);
|
|
500
|
-
}
|
|
501
|
-
const unknownSkill = expectedLoadedSkills.find((entry) => !suite.skills.includes(entry));
|
|
502
|
-
if (unknownSkill) {
|
|
503
|
-
throw new Error(`trigger cases[${index}].expected_loaded_skills contains non-participant Skill "${unknownSkill}".`);
|
|
504
|
-
}
|
|
505
|
-
if (suite.forbidMultipleSkillLoads && expectedLoadedSkills.length > 1) {
|
|
506
|
-
throw new Error(`trigger cases[${index}] expects multiple Skills but suite "${suite.id}" forbids multiple Skill loads.`);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
return {
|
|
510
|
-
id,
|
|
511
|
-
split: split,
|
|
512
|
-
query: expectString(row.query, `trigger cases[${index}].query`),
|
|
513
|
-
...(usesLegacyExpectation ? {
|
|
514
|
-
should_load_skill: expectBoolean(row.should_load_skill, `trigger cases[${index}].should_load_skill`),
|
|
515
|
-
} : { expected_loaded_skills: expectedLoadedSkills }),
|
|
516
|
-
...(shouldSpawnAgent === undefined ? {} : { should_spawn_agent: shouldSpawnAgent }),
|
|
517
|
-
...(workspaceFixture ? { workspace_fixture: workspaceFixture } : {}),
|
|
518
|
-
...(useProjectRules === undefined ? {} : { use_project_rules: useProjectRules }),
|
|
519
|
-
...(tags ? { tags } : {}),
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
export async function readPluginEvalTriggerCases(pluginRoot, suite) {
|
|
523
|
-
const casesPath = path.resolve(pluginRoot, suite.cases.replace(/^\.\//u, ''));
|
|
524
|
-
const raw = expectRecord(await fs.readJson(casesPath), `trigger cases for suite "${suite.id}"`);
|
|
525
|
-
if (raw.schemaVersion !== PLUGIN_EVAL_CASE_SCHEMA_VERSION) {
|
|
526
|
-
throw new Error(`trigger cases for suite "${suite.id}" must use schemaVersion ${PLUGIN_EVAL_CASE_SCHEMA_VERSION}.`);
|
|
527
|
-
}
|
|
528
|
-
const skill = expectString(raw.skill, `trigger cases for suite "${suite.id}".skill`);
|
|
529
|
-
if (skill !== suite.skill) {
|
|
530
|
-
throw new Error(`trigger cases skill "${skill}" does not match suite skill "${suite.skill}".`);
|
|
531
|
-
}
|
|
532
|
-
if (!Array.isArray(raw.cases) || raw.cases.length === 0) {
|
|
533
|
-
throw new Error(`trigger cases for suite "${suite.id}" must contain a non-empty cases array.`);
|
|
534
|
-
}
|
|
535
|
-
const cases = raw.cases.map((entry, index) => parseTriggerCase(entry, index, suite));
|
|
536
|
-
assertUniqueIds(cases, 'trigger case');
|
|
537
|
-
if (!suite.fixtureModule && cases.some((entry) => entry.workspace_fixture)) {
|
|
538
|
-
throw new Error(`Trigger suite "${suite.id}" requires fixtureModule because cases declare workspace_fixture.`);
|
|
539
|
-
}
|
|
540
|
-
for (const split of suite.releaseSplits) {
|
|
541
|
-
if (split !== 'all' && !cases.some((entry) => entry.split === split)) {
|
|
542
|
-
throw new Error(`Trigger suite "${suite.id}" has no cases for release split "${split}".`);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
return {
|
|
546
|
-
schemaVersion: PLUGIN_EVAL_CASE_SCHEMA_VERSION,
|
|
547
|
-
skill,
|
|
548
|
-
cases,
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
function resolveDeclaredPluginPath(pluginRoot, declaredPath, label) {
|
|
552
|
-
const resolved = path.resolve(pluginRoot, declaredPath.replace(/^\.\//u, ''));
|
|
553
|
-
if (!isPathInsideOrEqual(pluginRoot, resolved)) {
|
|
554
|
-
throw new Error(`${label} must stay inside the plugin root.`);
|
|
555
|
-
}
|
|
556
|
-
return resolved;
|
|
557
|
-
}
|
|
558
|
-
export async function resolvePluginSkillAuthorRoot(pluginRoot, expectedSkill) {
|
|
559
|
-
if (!/^[a-z0-9][a-z0-9-]*$/u.test(expectedSkill)) {
|
|
560
|
-
throw new Error('Skill name must use lowercase kebab-case without path separators.');
|
|
561
|
-
}
|
|
562
|
-
const pluginManifestPath = path.join(pluginRoot, '.agents-plugin', 'plugin.json');
|
|
563
|
-
const pluginManifest = expectRecord(await fs.readJson(pluginManifestPath), 'plugin manifest');
|
|
564
|
-
const canonicalRoot = path.join(pluginRoot, 'skills', expectedSkill);
|
|
565
|
-
let declared = false;
|
|
566
|
-
if (typeof pluginManifest.skills === 'string' && pluginManifest.skills.trim() !== '') {
|
|
567
|
-
const skillsRoot = resolveDeclaredPluginPath(pluginRoot, pluginManifest.skills, 'plugin manifest.skills');
|
|
568
|
-
if (path.resolve(skillsRoot) !== path.resolve(pluginRoot, 'skills')) {
|
|
569
|
-
throw new Error('plugin manifest.skills must be "./skills".');
|
|
570
|
-
}
|
|
571
|
-
declared = await fs.pathExists(canonicalRoot);
|
|
572
|
-
}
|
|
573
|
-
const artifacts = isRecord(pluginManifest.artifacts) &&
|
|
574
|
-
Array.isArray(pluginManifest.artifacts.targets)
|
|
575
|
-
? pluginManifest.artifacts.targets
|
|
576
|
-
: [];
|
|
577
|
-
for (const value of artifacts) {
|
|
578
|
-
if (!isRecord(value) || value.target !== 'codex.skill' || value.skillKey !== expectedSkill) {
|
|
579
|
-
continue;
|
|
580
|
-
}
|
|
581
|
-
const sourceDirs = Array.isArray(value.sourceDirs) ? value.sourceDirs : [];
|
|
582
|
-
for (const [index, sourceDir] of sourceDirs.entries()) {
|
|
583
|
-
if (typeof sourceDir !== 'string' || sourceDir.trim() === '')
|
|
584
|
-
continue;
|
|
585
|
-
const candidate = resolveDeclaredPluginPath(pluginRoot, sourceDir, `codex.skill ${JSON.stringify(expectedSkill)} sourceDirs[${index}]`);
|
|
586
|
-
const relative = path.relative(canonicalRoot, candidate);
|
|
587
|
-
if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
588
|
-
throw new Error(`Dynamic Skill source directory must stay inside skills/${expectedSkill}.`);
|
|
589
|
-
}
|
|
590
|
-
assertRealPathInside(pluginRoot, candidate, 'Dynamic Skill source directory', 'plugin root');
|
|
591
|
-
}
|
|
592
|
-
if (sourceDirs.length > 0)
|
|
593
|
-
declared = true;
|
|
594
|
-
}
|
|
595
|
-
if (!declared) {
|
|
596
|
-
throw new Error(`Plugin does not declare a Codex Skill source directory for ${JSON.stringify(expectedSkill)}.`);
|
|
597
|
-
}
|
|
598
|
-
if (!(await fs.pathExists(canonicalRoot)) || !(await fs.stat(canonicalRoot)).isDirectory()) {
|
|
599
|
-
throw new Error(`Plugin Skill source root not found: ${canonicalRoot}`);
|
|
600
|
-
}
|
|
601
|
-
assertRealPathInside(pluginRoot, canonicalRoot, 'Skill root', 'plugin root');
|
|
602
|
-
return canonicalRoot;
|
|
603
|
-
}
|
|
604
|
-
export async function readPluginEvalManifest(pluginRoot, expectedSkill, expectedPluginName) {
|
|
605
|
-
const skillRoot = await resolvePluginSkillAuthorRoot(pluginRoot, expectedSkill);
|
|
606
|
-
const evalRoot = path.join(skillRoot, 'evals');
|
|
607
|
-
const manifestPath = path.join(evalRoot, 'manifest.json');
|
|
608
|
-
if (!(await fs.pathExists(manifestPath))) {
|
|
609
|
-
const legacyPath = path.join(pluginRoot, 'evals', 'manifest.json');
|
|
610
|
-
if (await fs.pathExists(legacyPath)) {
|
|
611
|
-
throw new Error(`Legacy plugin-wide eval manifest is not supported: ${legacyPath}. ` +
|
|
612
|
-
`Move it to the ${expectedSkill} Skill directory as evals/manifest.json ` +
|
|
613
|
-
'and use schemaVersion 2.');
|
|
614
|
-
}
|
|
615
|
-
throw new Error(`Plugin eval manifest not found: ${manifestPath}`);
|
|
616
|
-
}
|
|
617
|
-
const raw = expectRecord(await fs.readJson(manifestPath), 'eval manifest');
|
|
618
|
-
expectOnlyKeys(raw, ['schemaVersion', 'plugin', 'skill', 'profiles', 'suites'], 'eval manifest');
|
|
619
|
-
if (raw.schemaVersion !== PLUGIN_EVAL_SCHEMA_VERSION) {
|
|
620
|
-
throw new Error(`eval manifest schemaVersion must be ${PLUGIN_EVAL_SCHEMA_VERSION}.`);
|
|
621
|
-
}
|
|
622
|
-
const plugin = expectString(raw.plugin, 'eval manifest.plugin');
|
|
623
|
-
if (expectedPluginName && plugin !== expectedPluginName) {
|
|
624
|
-
throw new Error(`eval manifest.plugin "${plugin}" does not match plugin "${expectedPluginName}".`);
|
|
625
|
-
}
|
|
626
|
-
const skill = expectString(raw.skill, 'eval manifest.skill');
|
|
627
|
-
if (!/^[a-z0-9][a-z0-9-]*$/u.test(skill)) {
|
|
628
|
-
throw new Error('eval manifest.skill must use lowercase kebab-case.');
|
|
629
|
-
}
|
|
630
|
-
if (skill !== expectedSkill) {
|
|
631
|
-
throw new Error(`eval manifest.skill "${skill}" does not match selected Skill "${expectedSkill}".`);
|
|
632
|
-
}
|
|
633
|
-
if (!Array.isArray(raw.profiles) || raw.profiles.length === 0) {
|
|
634
|
-
throw new Error('eval manifest.profiles must be a non-empty array.');
|
|
635
|
-
}
|
|
636
|
-
const profiles = raw.profiles.map((profile, index) => parseProfile(profile, index, plugin));
|
|
637
|
-
assertUniqueIds(profiles, 'profile');
|
|
638
|
-
if (!profiles.some((profile) => profile.scope === 'project' && profile.runModel)) {
|
|
639
|
-
throw new Error('eval manifest must define at least one project profile with runModel=true.');
|
|
640
|
-
}
|
|
641
|
-
if (profiles.some((profile) => profile.scope === 'user' && profile.runModel)) {
|
|
642
|
-
throw new Error('v2 does not allow real model execution for user-scope profiles.');
|
|
643
|
-
}
|
|
644
|
-
if (!Array.isArray(raw.suites) || raw.suites.length === 0) {
|
|
645
|
-
throw new Error('eval manifest.suites must be a non-empty array.');
|
|
646
|
-
}
|
|
647
|
-
const profileIds = new Set(profiles.map((profile) => profile.id));
|
|
648
|
-
const suites = raw.suites.map((suite, index) => parseSuite(pluginRoot, evalRoot, skill, suite, index, profileIds));
|
|
649
|
-
assertUniqueIds(suites, 'suite');
|
|
650
|
-
for (const suite of suites) {
|
|
651
|
-
for (const profileId of suite.profiles) {
|
|
652
|
-
const profile = profiles.find((entry) => entry.id === profileId);
|
|
653
|
-
if (!profile.runModel) {
|
|
654
|
-
throw new Error(`Suite "${suite.id}" cannot execute materialize-only profile "${profileId}".`);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
if (suite.releaseSplits.length > 0 && suite.kind === 'command' && !suite.supports.includes('split')) {
|
|
658
|
-
throw new Error(`Suite "${suite.id}" declares releaseSplits but does not support split.`);
|
|
659
|
-
}
|
|
660
|
-
if (suite.kind === 'conversation' && suite.releaseSplits.length > 0) {
|
|
661
|
-
throw new Error(`Conversation suite "${suite.id}" cannot declare releaseSplits because conversation cases do not support split filtering.`);
|
|
662
|
-
}
|
|
663
|
-
if (suite.kind === 'trigger') {
|
|
664
|
-
await readPluginEvalTriggerCases(pluginRoot, suite);
|
|
665
|
-
}
|
|
666
|
-
else if (suite.kind === 'conversation') {
|
|
667
|
-
const casesPath = path.resolve(pluginRoot, suite.cases.replace(/^\.\//u, ''));
|
|
668
|
-
validatePluginEvalConversationCaseDocument(await fs.readJson(casesPath), suite.skill, `conversation cases for suite "${suite.id}"`);
|
|
669
|
-
}
|
|
670
|
-
else if (suite.cases) {
|
|
671
|
-
const casesPath = path.resolve(pluginRoot, suite.cases.replace(/^\.\//u, ''));
|
|
672
|
-
validatePluginEvalCommandCaseDocument(await fs.readJson(casesPath), suite.skill, `command cases for suite "${suite.id}"`);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
return {
|
|
676
|
-
schemaVersion: PLUGIN_EVAL_SCHEMA_VERSION,
|
|
677
|
-
plugin,
|
|
678
|
-
skill,
|
|
679
|
-
profiles,
|
|
680
|
-
suites,
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
export function combinePluginEvalOutcome(reports) {
|
|
684
|
-
if (reports.some((report) => report.outcome === 'incomplete')) {
|
|
685
|
-
return 'incomplete';
|
|
686
|
-
}
|
|
687
|
-
if (reports.some((report) => report.outcome === 'failed')) {
|
|
688
|
-
return 'failed';
|
|
689
|
-
}
|
|
690
|
-
if (reports.some((report) => report.outcome === 'needs_review')) {
|
|
691
|
-
return 'needs_review';
|
|
692
|
-
}
|
|
693
|
-
return 'passed';
|
|
694
|
-
}
|
|
695
|
-
//# sourceMappingURL=plugin-eval-contract.js.map
|