@lesliechan721/aw 0.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring/assets/aw-config.d.mts +51 -0
- package/dist/authoring/assets/aw-config.mjs +1025 -0
- package/dist/authoring/assets/aw-config.mjs.map +1 -0
- package/dist/authoring/scripts/add-skill.d.mts +2 -0
- package/dist/authoring/scripts/add-skill.mjs +355 -0
- package/dist/authoring/scripts/add-skill.mjs.map +1 -0
- package/dist/authoring/scripts/init-plugin.d.mts +2 -0
- package/dist/authoring/scripts/init-plugin.mjs +487 -0
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -0
- package/dist/authoring/scripts/lib/javascript-import-scanner.d.mts +4 -0
- package/dist/authoring/scripts/lib/javascript-import-scanner.mjs +261 -0
- package/dist/authoring/scripts/lib/javascript-import-scanner.mjs.map +1 -0
- package/dist/authoring/scripts/lib/plugin-root.d.mts +26 -0
- package/dist/authoring/scripts/lib/plugin-root.mjs +125 -0
- package/dist/authoring/scripts/lib/plugin-root.mjs.map +1 -0
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +69 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +563 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -0
- package/dist/authoring/scripts/lib/semver.d.mts +9 -0
- package/dist/authoring/scripts/lib/semver.mjs +63 -0
- package/dist/authoring/scripts/lib/semver.mjs.map +1 -0
- package/dist/authoring/scripts/lib/skill-scaffold.d.mts +111 -0
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +353 -0
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -0
- package/dist/authoring/scripts/plugin-status.d.mts +2 -0
- package/dist/authoring/scripts/plugin-status.mjs +93 -0
- package/dist/authoring/scripts/plugin-status.mjs.map +1 -0
- package/dist/authoring/scripts/remove-plugin.d.mts +2 -0
- package/dist/authoring/scripts/remove-plugin.mjs +367 -0
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -0
- package/dist/authoring/scripts/validate-plugin.d.mts +2 -0
- package/dist/authoring/scripts/validate-plugin.mjs +3465 -0
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -0
- package/dist/authoring/scripts/validate-skill.d.mts +2 -0
- package/dist/authoring/scripts/validate-skill.mjs +126 -0
- package/dist/authoring/scripts/validate-skill.mjs.map +1 -0
- package/dist/authoring/templates/aw-config-runtime.d.mts +2 -0
- package/dist/authoring/templates/aw-config-runtime.mjs +407 -0
- package/dist/authoring/templates/aw-config-runtime.mjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/scripts/aw-skill-eval-materializer.d.ts +24 -0
- package/dist/scripts/aw-skill-eval-materializer.js +309 -0
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
- package/dist/scripts/bundle-plugins.d.ts +17 -0
- package/dist/scripts/bundle-plugins.js +126 -0
- package/dist/scripts/bundle-plugins.js.map +1 -0
- package/dist/scripts/plugin-staging.d.ts +26 -0
- package/dist/scripts/plugin-staging.js +76 -0
- package/dist/scripts/plugin-staging.js.map +1 -0
- package/dist/scripts/test-plugin-scripts.d.ts +7 -0
- package/dist/scripts/test-plugin-scripts.js +610 -0
- package/dist/scripts/test-plugin-scripts.js.map +1 -0
- package/dist/src/adapters/helpers.d.ts +44 -0
- package/dist/src/adapters/helpers.js +95 -0
- package/dist/src/adapters/helpers.js.map +1 -0
- package/dist/src/authoring/workspace-commands.d.ts +70 -0
- package/dist/src/authoring/workspace-commands.js +158 -0
- package/dist/src/authoring/workspace-commands.js.map +1 -0
- package/dist/src/commands/aw-capabilities.d.ts +78 -0
- package/dist/src/commands/aw-capabilities.js +254 -0
- package/dist/src/commands/aw-capabilities.js.map +1 -0
- package/dist/src/commands/catalog-dev-source.d.ts +120 -0
- package/dist/src/commands/catalog-dev-source.js +434 -0
- package/dist/src/commands/catalog-dev-source.js.map +1 -0
- package/dist/src/commands/catalog-generation.d.ts +16 -0
- package/dist/src/commands/catalog-generation.js +9 -0
- package/dist/src/commands/catalog-generation.js.map +1 -0
- package/dist/src/commands/catalog-publication-inspection.d.ts +138 -0
- package/dist/src/commands/catalog-publication-inspection.js +711 -0
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -0
- package/dist/src/commands/catalog-publication-journal.d.ts +56 -0
- package/dist/src/commands/catalog-publication-journal.js +215 -0
- package/dist/src/commands/catalog-publication-journal.js.map +1 -0
- package/dist/src/commands/catalog-publication-target.d.ts +18 -0
- package/dist/src/commands/catalog-publication-target.js +95 -0
- package/dist/src/commands/catalog-publication-target.js.map +1 -0
- package/dist/src/commands/catalog-publish.d.ts +103 -0
- package/dist/src/commands/catalog-publish.js +804 -0
- package/dist/src/commands/catalog-publish.js.map +1 -0
- package/dist/src/commands/catalog-source.d.ts +134 -0
- package/dist/src/commands/catalog-source.js +377 -0
- package/dist/src/commands/catalog-source.js.map +1 -0
- package/dist/src/commands/catalog-status.d.ts +56 -0
- package/dist/src/commands/catalog-status.js +217 -0
- package/dist/src/commands/catalog-status.js.map +1 -0
- package/dist/src/commands/catalog-store.d.ts +80 -0
- package/dist/src/commands/catalog-store.js +348 -0
- package/dist/src/commands/catalog-store.js.map +1 -0
- package/dist/src/commands/catalog-workspace-resolution.d.ts +13 -0
- package/dist/src/commands/catalog-workspace-resolution.js +42 -0
- package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
- package/dist/src/commands/console.d.ts +3 -0
- package/dist/src/commands/console.js +44 -0
- package/dist/src/commands/console.js.map +1 -0
- package/dist/src/commands/dependency-operation-plan.d.ts +58 -0
- package/dist/src/commands/dependency-operation-plan.js +261 -0
- package/dist/src/commands/dependency-operation-plan.js.map +1 -0
- package/dist/src/commands/init.d.ts +25 -0
- package/dist/src/commands/init.js +42 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/offline-cleanup-evidence.d.ts +59 -0
- package/dist/src/commands/offline-cleanup-evidence.js +163 -0
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -0
- package/dist/src/commands/operation-plan.d.ts +126 -0
- package/dist/src/commands/operation-plan.js +47 -0
- package/dist/src/commands/operation-plan.js.map +1 -0
- package/dist/src/commands/operation-planner.d.ts +46 -0
- package/dist/src/commands/operation-planner.js +139 -0
- package/dist/src/commands/operation-planner.js.map +1 -0
- package/dist/src/commands/options.d.ts +70 -0
- package/dist/src/commands/options.js +194 -0
- package/dist/src/commands/options.js.map +1 -0
- package/dist/src/commands/plugin-capabilities.d.ts +22 -0
- package/dist/src/commands/plugin-capabilities.js +159 -0
- package/dist/src/commands/plugin-capabilities.js.map +1 -0
- package/dist/src/commands/rebuild-command.d.ts +88 -0
- package/dist/src/commands/rebuild-command.js +3626 -0
- package/dist/src/commands/rebuild-command.js.map +1 -0
- package/dist/src/commands/rebuild-integration.d.ts +190 -0
- package/dist/src/commands/rebuild-integration.js +4439 -0
- package/dist/src/commands/rebuild-integration.js.map +1 -0
- package/dist/src/commands/rebuild-operations.d.ts +100 -0
- package/dist/src/commands/rebuild-operations.js +625 -0
- package/dist/src/commands/rebuild-operations.js.map +1 -0
- package/dist/src/commands/reconcile-operation-plan.d.ts +26 -0
- package/dist/src/commands/reconcile-operation-plan.js +28 -0
- package/dist/src/commands/reconcile-operation-plan.js.map +1 -0
- package/dist/src/commands/review-publication.d.ts +99 -0
- package/dist/src/commands/review-publication.js +904 -0
- package/dist/src/commands/review-publication.js.map +1 -0
- package/dist/src/commands/runtime.d.ts +172 -0
- package/dist/src/commands/runtime.js +720 -0
- package/dist/src/commands/runtime.js.map +1 -0
- package/dist/src/commands/skill-eval.d.ts +33 -0
- package/dist/src/commands/skill-eval.js +363 -0
- package/dist/src/commands/skill-eval.js.map +1 -0
- package/dist/src/commands/status-v6.d.ts +206 -0
- package/dist/src/commands/status-v6.js +2175 -0
- package/dist/src/commands/status-v6.js.map +1 -0
- package/dist/src/commands/sync-command.d.ts +23 -0
- package/dist/src/commands/sync-command.js +242 -0
- package/dist/src/commands/sync-command.js.map +1 -0
- package/dist/src/commands/wizard.d.ts +56 -0
- package/dist/src/commands/wizard.js +58 -0
- package/dist/src/commands/wizard.js.map +1 -0
- package/dist/src/commands/write-commands.d.ts +7 -0
- package/dist/src/commands/write-commands.js +190 -0
- package/dist/src/commands/write-commands.js.map +1 -0
- package/dist/src/constants.d.ts +31 -0
- package/dist/src/constants.js +32 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/eval/manifest-v1.d.ts +67 -0
- package/dist/src/eval/manifest-v1.js +347 -0
- package/dist/src/eval/manifest-v1.js.map +1 -0
- package/dist/src/generators/agents.d.ts +3 -0
- package/dist/src/generators/agents.js +46 -0
- package/dist/src/generators/agents.js.map +1 -0
- package/dist/src/generators/hooks.d.ts +15 -0
- package/dist/src/generators/hooks.js +76 -0
- package/dist/src/generators/hooks.js.map +1 -0
- package/dist/src/generators/instructions.d.ts +13 -0
- package/dist/src/generators/instructions.js +66 -0
- package/dist/src/generators/instructions.js.map +1 -0
- package/dist/src/generators/local-plugin.d.ts +56 -0
- package/dist/src/generators/local-plugin.js +1373 -0
- package/dist/src/generators/local-plugin.js.map +1 -0
- package/dist/src/generators/permissions.d.ts +10 -0
- package/dist/src/generators/permissions.js +37 -0
- package/dist/src/generators/permissions.js.map +1 -0
- package/dist/src/generators/shared.d.ts +2 -0
- package/dist/src/generators/shared.js +15 -0
- package/dist/src/generators/shared.js.map +1 -0
- package/dist/src/index.d.ts +41 -0
- package/dist/src/index.js +3327 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/output/command-receipt.d.ts +87 -0
- package/dist/src/output/command-receipt.js +302 -0
- package/dist/src/output/command-receipt.js.map +1 -0
- package/dist/src/output/debug-log.d.ts +4 -0
- package/dist/src/output/debug-log.js +97 -0
- package/dist/src/output/debug-log.js.map +1 -0
- package/dist/src/output/equivalent-command.d.ts +9 -0
- package/dist/src/output/equivalent-command.js +39 -0
- package/dist/src/output/equivalent-command.js.map +1 -0
- package/dist/src/output/model.d.ts +76 -0
- package/dist/src/output/model.js +2 -0
- package/dist/src/output/model.js.map +1 -0
- package/dist/src/output/rebuild-progress.d.ts +21 -0
- package/dist/src/output/rebuild-progress.js +128 -0
- package/dist/src/output/rebuild-progress.js.map +1 -0
- package/dist/src/output/redact.d.ts +3 -0
- package/dist/src/output/redact.js +39 -0
- package/dist/src/output/redact.js.map +1 -0
- package/dist/src/output/reporter.d.ts +9 -0
- package/dist/src/output/reporter.js +133 -0
- package/dist/src/output/reporter.js.map +1 -0
- package/dist/src/portable/commands.d.ts +124 -0
- package/dist/src/portable/commands.js +557 -0
- package/dist/src/portable/commands.js.map +1 -0
- package/dist/src/portable/materializer.d.ts +50 -0
- package/dist/src/portable/materializer.js +462 -0
- package/dist/src/portable/materializer.js.map +1 -0
- package/dist/src/portable/skills-cli.d.ts +43 -0
- package/dist/src/portable/skills-cli.js +148 -0
- package/dist/src/portable/skills-cli.js.map +1 -0
- package/dist/src/tui/catalog-freshness.d.ts +1 -0
- package/dist/src/tui/catalog-freshness.js +2 -0
- package/dist/src/tui/catalog-freshness.js.map +1 -0
- package/dist/src/tui/catalog-generation.d.ts +21 -0
- package/dist/src/tui/catalog-generation.js +116 -0
- package/dist/src/tui/catalog-generation.js.map +1 -0
- package/dist/src/tui/catalog-sources/projection.d.ts +4 -0
- package/dist/src/tui/catalog-sources/projection.js +17 -0
- package/dist/src/tui/catalog-sources/projection.js.map +1 -0
- package/dist/src/tui/catalog-sources/review.d.ts +3 -0
- package/dist/src/tui/catalog-sources/review.js +13 -0
- package/dist/src/tui/catalog-sources/review.js.map +1 -0
- package/dist/src/tui/catalog-sources/screens.d.ts +12 -0
- package/dist/src/tui/catalog-sources/screens.js +33 -0
- package/dist/src/tui/catalog-sources/screens.js.map +1 -0
- package/dist/src/tui/catalog-sources/session.d.ts +22 -0
- package/dist/src/tui/catalog-sources/session.js +225 -0
- package/dist/src/tui/catalog-sources/session.js.map +1 -0
- package/dist/src/tui/catalog-sources/types.d.ts +41 -0
- package/dist/src/tui/catalog-sources/types.js +2 -0
- package/dist/src/tui/catalog-sources/types.js.map +1 -0
- package/dist/src/tui/components.d.ts +102 -0
- package/dist/src/tui/components.js +184 -0
- package/dist/src/tui/components.js.map +1 -0
- package/dist/src/tui/console-app-v4.d.ts +20 -0
- package/dist/src/tui/console-app-v4.js +5066 -0
- package/dist/src/tui/console-app-v4.js.map +1 -0
- package/dist/src/tui/controller-runtime.d.ts +23 -0
- package/dist/src/tui/controller-runtime.js +2011 -0
- package/dist/src/tui/controller-runtime.js.map +1 -0
- package/dist/src/tui/controller.d.ts +557 -0
- package/dist/src/tui/controller.js +2120 -0
- package/dist/src/tui/controller.js.map +1 -0
- package/dist/src/tui/diagnostics.d.ts +30 -0
- package/dist/src/tui/diagnostics.js +71 -0
- package/dist/src/tui/diagnostics.js.map +1 -0
- package/dist/src/tui/index.d.ts +17 -0
- package/dist/src/tui/index.js +17 -0
- package/dist/src/tui/index.js.map +1 -0
- package/dist/src/tui/input-display.d.ts +8 -0
- package/dist/src/tui/input-display.js +36 -0
- package/dist/src/tui/input-display.js.map +1 -0
- package/dist/src/tui/keys.d.ts +12 -0
- package/dist/src/tui/keys.js +22 -0
- package/dist/src/tui/keys.js.map +1 -0
- package/dist/src/tui/layout.d.ts +12 -0
- package/dist/src/tui/layout.js +19 -0
- package/dist/src/tui/layout.js.map +1 -0
- package/dist/src/tui/model.d.ts +424 -0
- package/dist/src/tui/model.js +1493 -0
- package/dist/src/tui/model.js.map +1 -0
- package/dist/src/tui/operation-review-planner.d.ts +21 -0
- package/dist/src/tui/operation-review-planner.js +622 -0
- package/dist/src/tui/operation-review-planner.js.map +1 -0
- package/dist/src/tui/prompt.d.ts +8 -0
- package/dist/src/tui/prompt.js +231 -0
- package/dist/src/tui/prompt.js.map +1 -0
- package/dist/src/tui/router.d.ts +206 -0
- package/dist/src/tui/router.js +137 -0
- package/dist/src/tui/router.js.map +1 -0
- package/dist/src/tui/runner.d.ts +11 -0
- package/dist/src/tui/runner.js +71 -0
- package/dist/src/tui/runner.js.map +1 -0
- package/dist/src/tui/source-ref-presets.d.ts +3 -0
- package/dist/src/tui/source-ref-presets.js +11 -0
- package/dist/src/tui/source-ref-presets.js.map +1 -0
- package/dist/src/tui/theme.d.ts +26 -0
- package/dist/src/tui/theme.js +28 -0
- package/dist/src/tui/theme.js.map +1 -0
- package/dist/src/tui/viewport.d.ts +20 -0
- package/dist/src/tui/viewport.js +29 -0
- package/dist/src/tui/viewport.js.map +1 -0
- package/dist/src/tui/views.d.ts +57 -0
- package/dist/src/tui/views.js +201 -0
- package/dist/src/tui/views.js.map +1 -0
- package/dist/src/tui/wizard.d.ts +11 -0
- package/dist/src/tui/wizard.js +323 -0
- package/dist/src/tui/wizard.js.map +1 -0
- package/dist/src/types.d.ts +474 -0
- package/dist/src/types.js +34 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/agent-version.d.ts +19 -0
- package/dist/src/utils/agent-version.js +205 -0
- package/dist/src/utils/agent-version.js.map +1 -0
- package/dist/src/utils/artifact-plan.d.ts +27 -0
- package/dist/src/utils/artifact-plan.js +453 -0
- package/dist/src/utils/artifact-plan.js.map +1 -0
- package/dist/src/utils/artifact-renderer.d.ts +129 -0
- package/dist/src/utils/artifact-renderer.js +400 -0
- package/dist/src/utils/artifact-renderer.js.map +1 -0
- package/dist/src/utils/artifact-request.d.ts +16 -0
- package/dist/src/utils/artifact-request.js +42 -0
- package/dist/src/utils/artifact-request.js.map +1 -0
- package/dist/src/utils/artifact-sources.d.ts +8 -0
- package/dist/src/utils/artifact-sources.js +10 -0
- package/dist/src/utils/artifact-sources.js.map +1 -0
- package/dist/src/utils/aw-home-mutation-lock.d.ts +11 -0
- package/dist/src/utils/aw-home-mutation-lock.js +83 -0
- package/dist/src/utils/aw-home-mutation-lock.js.map +1 -0
- package/dist/src/utils/bundle-integrity.d.ts +2 -0
- package/dist/src/utils/bundle-integrity.js +63 -0
- package/dist/src/utils/bundle-integrity.js.map +1 -0
- package/dist/src/utils/bundle-layout.d.ts +4 -0
- package/dist/src/utils/bundle-layout.js +531 -0
- package/dist/src/utils/bundle-layout.js.map +1 -0
- package/dist/src/utils/catalog-digests.d.ts +18 -0
- package/dist/src/utils/catalog-digests.js +156 -0
- package/dist/src/utils/catalog-digests.js.map +1 -0
- package/dist/src/utils/catalog-generation-control-snapshot.d.ts +11 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js +45 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js.map +1 -0
- package/dist/src/utils/catalog-generation-error.d.ts +16 -0
- package/dist/src/utils/catalog-generation-error.js +30 -0
- package/dist/src/utils/catalog-generation-error.js.map +1 -0
- package/dist/src/utils/catalog-generation-resolver.d.ts +32 -0
- package/dist/src/utils/catalog-generation-resolver.js +251 -0
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -0
- package/dist/src/utils/catalog-generation-service.d.ts +161 -0
- package/dist/src/utils/catalog-generation-service.js +1237 -0
- package/dist/src/utils/catalog-generation-service.js.map +1 -0
- package/dist/src/utils/catalog-generation-state.d.ts +22 -0
- package/dist/src/utils/catalog-generation-state.js +192 -0
- package/dist/src/utils/catalog-generation-state.js.map +1 -0
- package/dist/src/utils/catalog-generation-store.d.ts +57 -0
- package/dist/src/utils/catalog-generation-store.js +397 -0
- package/dist/src/utils/catalog-generation-store.js.map +1 -0
- package/dist/src/utils/catalog-manifest-v7.d.ts +5 -0
- package/dist/src/utils/catalog-manifest-v7.js +98 -0
- package/dist/src/utils/catalog-manifest-v7.js.map +1 -0
- package/dist/src/utils/catalog-operation-context.d.ts +20 -0
- package/dist/src/utils/catalog-operation-context.js +141 -0
- package/dist/src/utils/catalog-operation-context.js.map +1 -0
- package/dist/src/utils/catalog-public-error.d.ts +19 -0
- package/dist/src/utils/catalog-public-error.js +100 -0
- package/dist/src/utils/catalog-public-error.js.map +1 -0
- package/dist/src/utils/catalog-runtime-projection.d.ts +33 -0
- package/dist/src/utils/catalog-runtime-projection.js +77 -0
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -0
- package/dist/src/utils/catalog-snapshot.d.ts +10 -0
- package/dist/src/utils/catalog-snapshot.js +20 -0
- package/dist/src/utils/catalog-snapshot.js.map +1 -0
- package/dist/src/utils/catalog-source-identity.d.ts +5 -0
- package/dist/src/utils/catalog-source-identity.js +137 -0
- package/dist/src/utils/catalog-source-identity.js.map +1 -0
- package/dist/src/utils/catalog-source-impact.d.ts +20 -0
- package/dist/src/utils/catalog-source-impact.js +222 -0
- package/dist/src/utils/catalog-source-impact.js.map +1 -0
- package/dist/src/utils/catalog-source-presentation.d.ts +1 -0
- package/dist/src/utils/catalog-source-presentation.js +32 -0
- package/dist/src/utils/catalog-source-presentation.js.map +1 -0
- package/dist/src/utils/catalog-source-references.d.ts +66 -0
- package/dist/src/utils/catalog-source-references.js +1180 -0
- package/dist/src/utils/catalog-source-references.js.map +1 -0
- package/dist/src/utils/catalog-sources.d.ts +53 -0
- package/dist/src/utils/catalog-sources.js +456 -0
- package/dist/src/utils/catalog-sources.js.map +1 -0
- package/dist/src/utils/codex-config.d.ts +126 -0
- package/dist/src/utils/codex-config.js +1032 -0
- package/dist/src/utils/codex-config.js.map +1 -0
- package/dist/src/utils/codex-manager.d.ts +81 -0
- package/dist/src/utils/codex-manager.js +810 -0
- package/dist/src/utils/codex-manager.js.map +1 -0
- package/dist/src/utils/codex-marketplace-path.d.ts +5 -0
- package/dist/src/utils/codex-marketplace-path.js +45 -0
- package/dist/src/utils/codex-marketplace-path.js.map +1 -0
- package/dist/src/utils/codex-native-observation.d.ts +16 -0
- package/dist/src/utils/codex-native-observation.js +22 -0
- package/dist/src/utils/codex-native-observation.js.map +1 -0
- package/dist/src/utils/codex-native-render-receipt.d.ts +40 -0
- package/dist/src/utils/codex-native-render-receipt.js +205 -0
- package/dist/src/utils/codex-native-render-receipt.js.map +1 -0
- package/dist/src/utils/codex-reconciler.d.ts +128 -0
- package/dist/src/utils/codex-reconciler.js +294 -0
- package/dist/src/utils/codex-reconciler.js.map +1 -0
- package/dist/src/utils/codex-roles.d.ts +71 -0
- package/dist/src/utils/codex-roles.js +257 -0
- package/dist/src/utils/codex-roles.js.map +1 -0
- package/dist/src/utils/codex-shared-native.d.ts +63 -0
- package/dist/src/utils/codex-shared-native.js +142 -0
- package/dist/src/utils/codex-shared-native.js.map +1 -0
- package/dist/src/utils/codex-skill-staging.d.ts +11 -0
- package/dist/src/utils/codex-skill-staging.js +8 -0
- package/dist/src/utils/codex-skill-staging.js.map +1 -0
- package/dist/src/utils/codex-surface-analysis.d.ts +45 -0
- package/dist/src/utils/codex-surface-analysis.js +245 -0
- package/dist/src/utils/codex-surface-analysis.js.map +1 -0
- package/dist/src/utils/config-value.d.ts +3 -0
- package/dist/src/utils/config-value.js +23 -0
- package/dist/src/utils/config-value.js.map +1 -0
- package/dist/src/utils/dynamic-skill-tree.d.ts +36 -0
- package/dist/src/utils/dynamic-skill-tree.js +466 -0
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -0
- package/dist/src/utils/file-rules.d.ts +1 -0
- package/dist/src/utils/file-rules.js +2 -0
- package/dist/src/utils/file-rules.js.map +1 -0
- package/dist/src/utils/git-catalog-provider.d.ts +22 -0
- package/dist/src/utils/git-catalog-provider.js +497 -0
- package/dist/src/utils/git-catalog-provider.js.map +1 -0
- package/dist/src/utils/hooks-contract.d.ts +1 -0
- package/dist/src/utils/hooks-contract.js +2 -0
- package/dist/src/utils/hooks-contract.js.map +1 -0
- package/dist/src/utils/json.d.ts +4 -0
- package/dist/src/utils/json.js +29 -0
- package/dist/src/utils/json.js.map +1 -0
- package/dist/src/utils/local-marketplace.d.ts +41 -0
- package/dist/src/utils/local-marketplace.js +316 -0
- package/dist/src/utils/local-marketplace.js.map +1 -0
- package/dist/src/utils/manifest.d.ts +11 -0
- package/dist/src/utils/manifest.js +33 -0
- package/dist/src/utils/manifest.js.map +1 -0
- package/dist/src/utils/marketplace.d.ts +3 -0
- package/dist/src/utils/marketplace.js +76 -0
- package/dist/src/utils/marketplace.js.map +1 -0
- package/dist/src/utils/multi-source-catalog.d.ts +66 -0
- package/dist/src/utils/multi-source-catalog.js +345 -0
- package/dist/src/utils/multi-source-catalog.js.map +1 -0
- package/dist/src/utils/native-cli.d.ts +118 -0
- package/dist/src/utils/native-cli.js +518 -0
- package/dist/src/utils/native-cli.js.map +1 -0
- package/dist/src/utils/orphan-marketplace-cleanup.d.ts +18 -0
- package/dist/src/utils/orphan-marketplace-cleanup.js +198 -0
- package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -0
- package/dist/src/utils/ownership.d.ts +194 -0
- package/dist/src/utils/ownership.js +723 -0
- package/dist/src/utils/ownership.js.map +1 -0
- package/dist/src/utils/path-catalog-provider.d.ts +7 -0
- package/dist/src/utils/path-catalog-provider.js +74 -0
- package/dist/src/utils/path-catalog-provider.js.map +1 -0
- package/dist/src/utils/paths.d.ts +40 -0
- package/dist/src/utils/paths.js +137 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/platform-entries.d.ts +1 -0
- package/dist/src/utils/platform-entries.js +2 -0
- package/dist/src/utils/platform-entries.js.map +1 -0
- package/dist/src/utils/platform-support.d.ts +1 -0
- package/dist/src/utils/platform-support.js +2 -0
- package/dist/src/utils/platform-support.js.map +1 -0
- package/dist/src/utils/plugin-config-write.d.ts +110 -0
- package/dist/src/utils/plugin-config-write.js +773 -0
- package/dist/src/utils/plugin-config-write.js.map +1 -0
- package/dist/src/utils/plugin-config.d.ts +389 -0
- package/dist/src/utils/plugin-config.js +1642 -0
- package/dist/src/utils/plugin-config.js.map +1 -0
- package/dist/src/utils/plugin-dependencies.d.ts +12 -0
- package/dist/src/utils/plugin-dependencies.js +162 -0
- package/dist/src/utils/plugin-dependencies.js.map +1 -0
- package/dist/src/utils/plugin-intent-state.d.ts +34 -0
- package/dist/src/utils/plugin-intent-state.js +289 -0
- package/dist/src/utils/plugin-intent-state.js.map +1 -0
- package/dist/src/utils/plugin-script-contract.d.ts +1 -0
- package/dist/src/utils/plugin-script-contract.js +2 -0
- package/dist/src/utils/plugin-script-contract.js.map +1 -0
- package/dist/src/utils/plugin-scripts.d.ts +101 -0
- package/dist/src/utils/plugin-scripts.js +253 -0
- package/dist/src/utils/plugin-scripts.js.map +1 -0
- package/dist/src/utils/process-lock.d.ts +47 -0
- package/dist/src/utils/process-lock.js +532 -0
- package/dist/src/utils/process-lock.js.map +1 -0
- package/dist/src/utils/process-tree.d.ts +2 -0
- package/dist/src/utils/process-tree.js +2 -0
- package/dist/src/utils/process-tree.js.map +1 -0
- package/dist/src/utils/project-boundary.d.ts +9 -0
- package/dist/src/utils/project-boundary.js +67 -0
- package/dist/src/utils/project-boundary.js.map +1 -0
- package/dist/src/utils/rendered-contract.d.ts +8 -0
- package/dist/src/utils/rendered-contract.js +134 -0
- package/dist/src/utils/rendered-contract.js.map +1 -0
- package/dist/src/utils/runtime-skill-closure.d.ts +13 -0
- package/dist/src/utils/runtime-skill-closure.js +863 -0
- package/dist/src/utils/runtime-skill-closure.js.map +1 -0
- package/dist/src/utils/safe-fs.d.ts +21 -0
- package/dist/src/utils/safe-fs.js +111 -0
- package/dist/src/utils/safe-fs.js.map +1 -0
- package/dist/src/utils/skill-authoring.d.ts +1 -0
- package/dist/src/utils/skill-authoring.js +2 -0
- package/dist/src/utils/skill-authoring.js.map +1 -0
- package/dist/src/utils/skill-validation.d.ts +37 -0
- package/dist/src/utils/skill-validation.js +326 -0
- package/dist/src/utils/skill-validation.js.map +1 -0
- package/dist/src/utils/slash-commands.d.ts +1 -0
- package/dist/src/utils/slash-commands.js +2 -0
- package/dist/src/utils/slash-commands.js.map +1 -0
- package/dist/src/utils/state-paths.d.ts +14 -0
- package/dist/src/utils/state-paths.js +139 -0
- package/dist/src/utils/state-paths.js.map +1 -0
- package/dist/src/utils/target-eligibility.d.ts +13 -0
- package/dist/src/utils/target-eligibility.js +35 -0
- package/dist/src/utils/target-eligibility.js.map +1 -0
- package/dist/src/utils/target-order.d.ts +7 -0
- package/dist/src/utils/target-order.js +10 -0
- package/dist/src/utils/target-order.js.map +1 -0
- package/dist/src/utils/template-engine.d.ts +1 -0
- package/dist/src/utils/template-engine.js +2 -0
- package/dist/src/utils/template-engine.js.map +1 -0
- package/dist/src/utils/test-path-fence.d.ts +12 -0
- package/dist/src/utils/test-path-fence.js +31 -0
- package/dist/src/utils/test-path-fence.js.map +1 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +16 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
export function requestedIntentAction(command) {
|
|
2
|
+
if (command === 'install')
|
|
3
|
+
return 'add';
|
|
4
|
+
if (command === 'uninstall')
|
|
5
|
+
return 'remove';
|
|
6
|
+
return 'keep';
|
|
7
|
+
}
|
|
8
|
+
function unique(values) {
|
|
9
|
+
return [...new Set(values)];
|
|
10
|
+
}
|
|
11
|
+
function recoveryForTarget(state, errorCode) {
|
|
12
|
+
if (state === 'completed')
|
|
13
|
+
return [];
|
|
14
|
+
if (errorCode === 'exclusiveOwnerEvidenceInvalid'
|
|
15
|
+
|| errorCode === 'forceCleanupPathUnavailable')
|
|
16
|
+
return [];
|
|
17
|
+
if (errorCode === 'codexProjectPluginVersionTooLow'
|
|
18
|
+
|| errorCode === 'codexProjectPluginUnsupported'
|
|
19
|
+
|| errorCode === 'codexSystemCliUnsupported') {
|
|
20
|
+
return ['upgrade or repair the official system Codex CLI, then retry the original operation'];
|
|
21
|
+
}
|
|
22
|
+
if (errorCode === 'sourceMissing' || errorCode === 'catalogSourceUnavailable'
|
|
23
|
+
|| errorCode === 'codexIntentSourceUnavailable') {
|
|
24
|
+
return ['refresh the Catalog source and run sync', 'run cleanup for AW-owned residue'];
|
|
25
|
+
}
|
|
26
|
+
if (errorCode === 'codexSharedNativeForeign') {
|
|
27
|
+
return [
|
|
28
|
+
'remove or rename the foreign Codex plugin, then run sync; cleanup preserves foreign content and does not delete this collision',
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
return ['run sync', 'run reinstall', 'run cleanup for AW-owned residue'];
|
|
32
|
+
}
|
|
33
|
+
function rebuildErrorCode(message) {
|
|
34
|
+
for (const code of [
|
|
35
|
+
'legacyStateUnsupported',
|
|
36
|
+
'sourceChanged',
|
|
37
|
+
'sourceMissing',
|
|
38
|
+
'artifactCollision',
|
|
39
|
+
'dependencyNotReady',
|
|
40
|
+
'dependencyScopeTooNarrow',
|
|
41
|
+
'dependencyScopeConflict',
|
|
42
|
+
'dependencyTargetUnsupported',
|
|
43
|
+
'dependencyInstallFailed',
|
|
44
|
+
'dependencyStillRequired',
|
|
45
|
+
]) {
|
|
46
|
+
if (message.includes(code))
|
|
47
|
+
return code;
|
|
48
|
+
}
|
|
49
|
+
if (message.startsWith('Cannot resolve required catalog sources:')) {
|
|
50
|
+
return 'catalogSourceUnavailable';
|
|
51
|
+
}
|
|
52
|
+
const prefix = message.split(':', 1)[0];
|
|
53
|
+
return /^[A-Za-z][A-Za-z0-9]*$/u.test(prefix) ? prefix : 'writeFailed';
|
|
54
|
+
}
|
|
55
|
+
function earlyFailureRecovery(command, errorCode) {
|
|
56
|
+
if (errorCode === 'codexProjectPluginVersionTooLow'
|
|
57
|
+
|| errorCode === 'codexProjectPluginUnsupported'
|
|
58
|
+
|| errorCode === 'codexSystemCliUnsupported') {
|
|
59
|
+
return ['upgrade or repair the official system Codex CLI, then retry the original operation'];
|
|
60
|
+
}
|
|
61
|
+
if (errorCode === 'syncSelectorConflict') {
|
|
62
|
+
return ['remove either plugin selectors or --all, then rerun sync'];
|
|
63
|
+
}
|
|
64
|
+
if (errorCode === 'syncSelectionRequired') {
|
|
65
|
+
return ['specify desired plugin selectors or --all, then rerun sync'];
|
|
66
|
+
}
|
|
67
|
+
return [`correct the ${command} request and retry`];
|
|
68
|
+
}
|
|
69
|
+
function sameTarget(left, right) {
|
|
70
|
+
return left.platform === right.platform
|
|
71
|
+
&& left.scope === right.scope
|
|
72
|
+
&& (left.pluginId !== undefined && right.pluginId !== undefined
|
|
73
|
+
? left.pluginId === right.pluginId
|
|
74
|
+
: left.pluginName === right.pluginName);
|
|
75
|
+
}
|
|
76
|
+
function receiptTargetFromRebuild(result) {
|
|
77
|
+
return {
|
|
78
|
+
pluginName: result.target.pluginName,
|
|
79
|
+
...(result.target.pluginId ? { pluginId: result.target.pluginId } : {}),
|
|
80
|
+
...(result.target.marketplaceName ? { marketplaceName: result.target.marketplaceName } : {}),
|
|
81
|
+
...(result.target.sourceId ? { sourceId: result.target.sourceId } : {}),
|
|
82
|
+
...(result.target.sourceIdentity ? { sourceIdentity: result.target.sourceIdentity } : {}),
|
|
83
|
+
platform: result.target.platform,
|
|
84
|
+
scope: result.target.scope,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function sourceTargetResults(command, result, errors) {
|
|
88
|
+
const targetResults = [...(result.targetResults ?? [])];
|
|
89
|
+
for (const rebuild of result.rebuildResults ?? []) {
|
|
90
|
+
const target = receiptTargetFromRebuild(rebuild);
|
|
91
|
+
if (targetResults.some((candidate) => sameTarget(candidate.target, target)))
|
|
92
|
+
continue;
|
|
93
|
+
targetResults.push({
|
|
94
|
+
target,
|
|
95
|
+
action: rebuild.command,
|
|
96
|
+
state: rebuild.status === 'succeeded' ? 'completed' : 'failed',
|
|
97
|
+
...(rebuild.status === 'failed' ? {
|
|
98
|
+
message: rebuild.error.message,
|
|
99
|
+
errorCode: rebuildErrorCode(rebuild.error.message),
|
|
100
|
+
} : {}),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (targetResults.length > 0)
|
|
104
|
+
return targetResults;
|
|
105
|
+
const earlyError = errors[0];
|
|
106
|
+
return (result.receiptTargets ?? []).map((target) => ({
|
|
107
|
+
target,
|
|
108
|
+
action: command,
|
|
109
|
+
state: result.overallState === 'succeeded' ? 'completed' : 'failed',
|
|
110
|
+
...(result.overallState === 'succeeded' ? {} : {
|
|
111
|
+
message: earlyError?.message ?? 'The write command did not run.',
|
|
112
|
+
errorCode: earlyError?.code ?? 'writeCommandFailed',
|
|
113
|
+
}),
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
function findRebuildResult(target, rebuildResults) {
|
|
117
|
+
return rebuildResults.find((candidate) => sameTarget(target, receiptTargetFromRebuild(candidate)));
|
|
118
|
+
}
|
|
119
|
+
function plannedTargetChanges(target, operationPlan) {
|
|
120
|
+
if (!operationPlan || !target.pluginId)
|
|
121
|
+
return [];
|
|
122
|
+
const exactPrefix = `${target.pluginId}:${target.platform}:${target.scope}:`;
|
|
123
|
+
const exact = operationPlan.changes.filter((change) => change.startsWith(exactPrefix));
|
|
124
|
+
if (exact.length > 0)
|
|
125
|
+
return exact;
|
|
126
|
+
const hasTargetAction = operationPlan.actions.some((action) => action.pluginId === target.pluginId
|
|
127
|
+
&& action.platform === target.platform
|
|
128
|
+
&& action.scope === target.scope);
|
|
129
|
+
return hasTargetAction
|
|
130
|
+
? operationPlan.changes.filter((change) => change.startsWith(`${target.pluginId}:`))
|
|
131
|
+
: [];
|
|
132
|
+
}
|
|
133
|
+
const MUTATING_REBUILD_ACTIONS = new Set([
|
|
134
|
+
'stale.cleanup',
|
|
135
|
+
'native.write',
|
|
136
|
+
'artifacts.write',
|
|
137
|
+
'marketplace.commit',
|
|
138
|
+
'marketplace.rollback',
|
|
139
|
+
'recovery.cleanup',
|
|
140
|
+
'cleanup.owned',
|
|
141
|
+
]);
|
|
142
|
+
function observableTargetChanges(targetResult, rebuildResult) {
|
|
143
|
+
const changes = rebuildResult?.actions
|
|
144
|
+
.filter((action) => action.status === 'succeeded' && MUTATING_REBUILD_ACTIONS.has(action.name))
|
|
145
|
+
.map((action) => action.name) ?? [];
|
|
146
|
+
changes.push(...(rebuildResult?.removed ?? []).map((entry) => `removed:${entry}`));
|
|
147
|
+
if (changes.length === 0
|
|
148
|
+
&& targetResult.state === 'completed'
|
|
149
|
+
&& targetResult.action !== 'keep'
|
|
150
|
+
&& targetResult.action !== 'skipped') {
|
|
151
|
+
changes.push(targetResult.action);
|
|
152
|
+
}
|
|
153
|
+
return unique(changes);
|
|
154
|
+
}
|
|
155
|
+
function receiptTargetResult(targetResult, result) {
|
|
156
|
+
const rebuild = findRebuildResult(targetResult.target, result.rebuildResults ?? []);
|
|
157
|
+
const target = rebuild
|
|
158
|
+
? { ...receiptTargetFromRebuild(rebuild), ...targetResult.target }
|
|
159
|
+
: targetResult.target;
|
|
160
|
+
const planned = result.dependencyPlan?.targets.find((candidate) => candidate.pluginId === target.pluginId
|
|
161
|
+
&& candidate.platform === target.platform
|
|
162
|
+
&& candidate.resolvedScope === target.scope);
|
|
163
|
+
const message = targetResult.message
|
|
164
|
+
?? (rebuild?.status === 'failed' ? rebuild.error.message : undefined);
|
|
165
|
+
const errorCode = targetResult.errorCode
|
|
166
|
+
?? (message && (targetResult.state === 'failed' || targetResult.action === 'skipped')
|
|
167
|
+
? rebuildErrorCode(message)
|
|
168
|
+
: undefined);
|
|
169
|
+
const planChanges = plannedTargetChanges(target, result.operationPlan);
|
|
170
|
+
const changes = planChanges.length > 0
|
|
171
|
+
? planChanges
|
|
172
|
+
: observableTargetChanges(targetResult, rebuild);
|
|
173
|
+
const recoveryActions = unique([
|
|
174
|
+
...(targetResult.recoveryActions ?? []),
|
|
175
|
+
...recoveryForTarget(targetResult.action === 'skipped' ? 'failed' : targetResult.state, errorCode),
|
|
176
|
+
]);
|
|
177
|
+
const sharedNative = target.platform === 'codex' && target.pluginId
|
|
178
|
+
? result.codexReconcilePlans?.flatMap((plan) => plan.desiredTargets.some((desired) => desired.pluginId === target.pluginId && desired.scopes.includes(target.scope))
|
|
179
|
+
? plan.sharedNativeActions
|
|
180
|
+
: [])
|
|
181
|
+
.find((action) => action.pluginId === target.pluginId && action.action !== 'none')
|
|
182
|
+
: undefined;
|
|
183
|
+
return {
|
|
184
|
+
target,
|
|
185
|
+
action: targetResult.action,
|
|
186
|
+
state: targetResult.state,
|
|
187
|
+
...(message ? { message } : {}),
|
|
188
|
+
...(errorCode ? { errorCode } : {}),
|
|
189
|
+
relation: planned?.relation ?? targetResult.relation ?? 'requested',
|
|
190
|
+
requiredBy: planned?.requiredBy ?? targetResult.requiredBy ?? [],
|
|
191
|
+
changes,
|
|
192
|
+
recoveryActions,
|
|
193
|
+
cleanupAttempted: rebuild?.cleanupAttempted ?? false,
|
|
194
|
+
actions: rebuild?.actions ?? [],
|
|
195
|
+
removed: rebuild?.removed ?? [],
|
|
196
|
+
absent: rebuild?.absent ?? [],
|
|
197
|
+
residual: rebuild?.residual ?? [],
|
|
198
|
+
quarantined: rebuild?.quarantined ?? [],
|
|
199
|
+
failures: rebuild?.failures ?? [],
|
|
200
|
+
...(sharedNative ? {
|
|
201
|
+
sharedNative: {
|
|
202
|
+
codexPluginId: sharedNative.codexPluginId,
|
|
203
|
+
action: sharedNative.action,
|
|
204
|
+
},
|
|
205
|
+
} : {}),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function overallState(targetResults, fallback) {
|
|
209
|
+
if (targetResults.length === 0)
|
|
210
|
+
return fallback ?? 'succeeded';
|
|
211
|
+
const successful = targetResults.filter((target) => target.state === 'completed' && target.action !== 'skipped').length;
|
|
212
|
+
if (successful === targetResults.length)
|
|
213
|
+
return 'succeeded';
|
|
214
|
+
const successfulRequested = targetResults.some((target) => target.relation === 'requested'
|
|
215
|
+
&& target.state === 'completed'
|
|
216
|
+
&& target.action !== 'skipped');
|
|
217
|
+
return successfulRequested ? 'partial' : 'failed';
|
|
218
|
+
}
|
|
219
|
+
export function buildRebuildReceiptJson(command, result) {
|
|
220
|
+
const hasCoreEvidence = (result.targetResults?.length ?? 0) > 0
|
|
221
|
+
|| (result.rebuildResults?.length ?? 0) > 0
|
|
222
|
+
|| (result.receiptTargets?.length ?? 0) > 0;
|
|
223
|
+
const errors = result.errors ?? (!hasCoreEvidence && result.overallState !== 'succeeded'
|
|
224
|
+
? [{
|
|
225
|
+
code: result.warnings[0]?.split(':', 1)[0] || 'writeCommandFailed',
|
|
226
|
+
message: result.warnings[0] ?? 'The write command did not run.',
|
|
227
|
+
}]
|
|
228
|
+
: []);
|
|
229
|
+
const targetResults = sourceTargetResults(command, result, errors)
|
|
230
|
+
.map((target) => receiptTargetResult(target, result));
|
|
231
|
+
const state = overallState(targetResults, result.overallState);
|
|
232
|
+
const changes = result.operationPlan?.changes ?? unique(targetResults.flatMap((target) => target.changes));
|
|
233
|
+
const recoveryActions = unique(targetResults.flatMap((target) => target.recoveryActions));
|
|
234
|
+
if (state !== 'succeeded' && targetResults.length === 0) {
|
|
235
|
+
recoveryActions.push(...earlyFailureRecovery(command, errors[0]?.code));
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
ok: state === 'succeeded',
|
|
239
|
+
command,
|
|
240
|
+
receiptSchemaVersion: 6,
|
|
241
|
+
...(result.dependencyPlan ? {
|
|
242
|
+
dependencyPlanSchemaVersion: 2,
|
|
243
|
+
requestedPluginIds: result.dependencyPlan.requestedPluginIds,
|
|
244
|
+
resolvedPluginIds: result.dependencyPlan.resolvedPluginIds,
|
|
245
|
+
dependencyEdges: result.dependencyPlan.dependencyEdges,
|
|
246
|
+
} : {}),
|
|
247
|
+
overallState: state,
|
|
248
|
+
changes,
|
|
249
|
+
targetResults,
|
|
250
|
+
warnings: unique([
|
|
251
|
+
...result.warnings,
|
|
252
|
+
...(result.operationPlan?.warnings ?? []),
|
|
253
|
+
]),
|
|
254
|
+
recoveryActions: unique(recoveryActions),
|
|
255
|
+
...(result.operationPlan ? { planFingerprint: result.operationPlan.planFingerprint } : {}),
|
|
256
|
+
errors,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
export function renderRebuildReceipt(command, result) {
|
|
260
|
+
const receipt = buildRebuildReceiptJson(command, result);
|
|
261
|
+
const stateLabel = {
|
|
262
|
+
succeeded: '完成',
|
|
263
|
+
partial: '部分完成',
|
|
264
|
+
failed: '失败',
|
|
265
|
+
};
|
|
266
|
+
return [
|
|
267
|
+
`${command} ${stateLabel[receipt.overallState]}:${receipt.targetResults.length} 个目标。`,
|
|
268
|
+
...receipt.changes.map((change) => `变更:${change}`),
|
|
269
|
+
...receipt.warnings.map((warning) => `警告:${warning}`),
|
|
270
|
+
...receipt.errors.map((error) => error.message),
|
|
271
|
+
...receipt.targetResults.flatMap((target) => {
|
|
272
|
+
const pluginId = target.target.pluginId ?? target.target.pluginName;
|
|
273
|
+
return [
|
|
274
|
+
`- ${pluginId} / ${target.target.platform} / ${target.target.scope}: ${target.state}`,
|
|
275
|
+
...(target.sharedNative
|
|
276
|
+
? [` shared native ${target.sharedNative.codexPluginId}: ${target.sharedNative.action}`]
|
|
277
|
+
: []),
|
|
278
|
+
...(target.message ? [` ${target.message}`] : []),
|
|
279
|
+
...target.failures
|
|
280
|
+
.filter((failure) => failure.message !== target.message)
|
|
281
|
+
.map((failure) => ` ${failure.phase}: ${failure.message}`),
|
|
282
|
+
];
|
|
283
|
+
}),
|
|
284
|
+
...receipt.recoveryActions.map((recovery) => `恢复:${recovery}`),
|
|
285
|
+
];
|
|
286
|
+
}
|
|
287
|
+
export function buildInitReceiptJson(result) {
|
|
288
|
+
return {
|
|
289
|
+
command: 'init',
|
|
290
|
+
receiptSchemaVersion: 6,
|
|
291
|
+
receiptKind: 'catalogReadiness',
|
|
292
|
+
...result,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
export function renderInitReceipt(result) {
|
|
296
|
+
return [
|
|
297
|
+
`Catalog Active sources ${result.ok ? 'ready' : 'not ready'}.`,
|
|
298
|
+
...result.sources.map((source) => `- ${source.id}: ${source.activeReady ? 'ready' : source.error}`),
|
|
299
|
+
...result.recovery.map((recovery) => `Recovery: ${recovery}`),
|
|
300
|
+
];
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=command-receipt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-receipt.js","sourceRoot":"","sources":["../../../src/output/command-receipt.ts"],"names":[],"mappings":"AAuEA,MAAM,UAAU,qBAAqB,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KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { redactValue } from './redact.js';
|
|
4
|
+
const MAX_LOG_FILES = 20;
|
|
5
|
+
const MAX_LOG_AGE_MS = 14 * 24 * 60 * 60 * 1000;
|
|
6
|
+
export function createNoopDebugLogger() {
|
|
7
|
+
return {
|
|
8
|
+
log: () => { },
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
async function appendJsonLine(logFile, payload) {
|
|
12
|
+
await fs.ensureDir(path.dirname(logFile));
|
|
13
|
+
await fs.appendFile(logFile, `${JSON.stringify(redactValue(payload))}\n`, 'utf8');
|
|
14
|
+
}
|
|
15
|
+
async function cleanupOldLogs(logFile, diagnostics) {
|
|
16
|
+
if (diagnostics.commandName === 'status' || diagnostics.logFileSource !== 'default') {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const dir = path.dirname(logFile);
|
|
20
|
+
try {
|
|
21
|
+
const entries = await fs.readdir(dir);
|
|
22
|
+
const now = Date.now();
|
|
23
|
+
const candidates = await Promise.all(entries
|
|
24
|
+
.filter((entry) => entry.startsWith('aw-') && entry.endsWith('.log'))
|
|
25
|
+
.map(async (entry) => {
|
|
26
|
+
const filePath = path.join(dir, entry);
|
|
27
|
+
const stat = await fs.stat(filePath);
|
|
28
|
+
return {
|
|
29
|
+
filePath,
|
|
30
|
+
mtimeMs: stat.mtimeMs,
|
|
31
|
+
};
|
|
32
|
+
}));
|
|
33
|
+
const sorted = candidates.sort((left, right) => right.mtimeMs - left.mtimeMs);
|
|
34
|
+
await Promise.all(sorted
|
|
35
|
+
.filter((entry, index) => index >= MAX_LOG_FILES || now - entry.mtimeMs > MAX_LOG_AGE_MS)
|
|
36
|
+
.map((entry) => fs.remove(entry.filePath)));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
await appendJsonLine(logFile, {
|
|
40
|
+
time: new Date().toISOString(),
|
|
41
|
+
runId: diagnostics.runId,
|
|
42
|
+
commandName: diagnostics.commandName,
|
|
43
|
+
event: {
|
|
44
|
+
type: 'debug-log:cleanup-error',
|
|
45
|
+
message: error instanceof Error ? error.message : String(error),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function createFileDebugLogger(diagnostics) {
|
|
51
|
+
if (!diagnostics.debug || !diagnostics.logFile) {
|
|
52
|
+
return createNoopDebugLogger();
|
|
53
|
+
}
|
|
54
|
+
const logFile = diagnostics.logFile;
|
|
55
|
+
let initialized = false;
|
|
56
|
+
async function ensureInitialized() {
|
|
57
|
+
if (initialized) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
initialized = true;
|
|
61
|
+
await appendJsonLine(logFile, {
|
|
62
|
+
time: new Date().toISOString(),
|
|
63
|
+
runId: diagnostics.runId,
|
|
64
|
+
commandName: diagnostics.commandName,
|
|
65
|
+
event: {
|
|
66
|
+
type: 'run:metadata',
|
|
67
|
+
data: {
|
|
68
|
+
nodeVersion: process.version,
|
|
69
|
+
platform: process.platform,
|
|
70
|
+
arch: process.arch,
|
|
71
|
+
logFile,
|
|
72
|
+
commandName: diagnostics.commandName,
|
|
73
|
+
runId: diagnostics.runId,
|
|
74
|
+
cliVersion: process.env.npm_package_version,
|
|
75
|
+
...diagnostics.metadata,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
await cleanupOldLogs(logFile, diagnostics);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
logFile,
|
|
83
|
+
log: async (event) => {
|
|
84
|
+
if (initialized && !(await fs.pathExists(logFile))) {
|
|
85
|
+
initialized = false;
|
|
86
|
+
}
|
|
87
|
+
await ensureInitialized();
|
|
88
|
+
await appendJsonLine(logFile, {
|
|
89
|
+
time: new Date().toISOString(),
|
|
90
|
+
runId: diagnostics.runId,
|
|
91
|
+
commandName: diagnostics.commandName,
|
|
92
|
+
event,
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=debug-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-log.js","sourceRoot":"","sources":["../../../src/output/debug-log.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC;KACd,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,OAAgB;IAC7D,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1C,MAAM,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpF,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,OAAe,EAAE,WAA+B;IAC5E,IAAI,WAAW,CAAC,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACpF,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;Q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E,CAAC;gBACnD,WAAW,GAAG,KAAK,CAAC;YACtB,CAAC;YACD,MAAM,iBAAiB,EAAE,CAAC;YAC1B,MAAM,cAAc,CAAC,OAAO,EAAE;gBAC5B,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,WAAW,EAAE,WAAW,CAAC,WAAW;gBACpC,KAAK;aACN,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ShellKind = 'posix' | 'powershell';
|
|
2
|
+
export interface EquivalentCommandDisplay {
|
|
3
|
+
kind: ShellKind | 'argv';
|
|
4
|
+
label: 'POSIX shell 命令' | 'PowerShell 命令' | '参数列表';
|
|
5
|
+
text: string;
|
|
6
|
+
replayable: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function renderShellCommand(tokens: readonly string[], shell: ShellKind): string;
|
|
9
|
+
export declare function renderEquivalentCommandDisplays(tokens: readonly string[], platform?: NodeJS.Platform): EquivalentCommandDisplay[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function quotePosixToken(value) {
|
|
2
|
+
return /^[A-Za-z0-9_./:@+-]+$/.test(value)
|
|
3
|
+
? value
|
|
4
|
+
: `'${value.replaceAll("'", `'"'"'`)}'`;
|
|
5
|
+
}
|
|
6
|
+
function quotePowerShellToken(value) {
|
|
7
|
+
return `'${value.replaceAll("'", "''")}'`;
|
|
8
|
+
}
|
|
9
|
+
export function renderShellCommand(tokens, shell) {
|
|
10
|
+
if (shell === 'powershell') {
|
|
11
|
+
return `& ${tokens.map(quotePowerShellToken).join(' ')}`;
|
|
12
|
+
}
|
|
13
|
+
return tokens.map(quotePosixToken).join(' ');
|
|
14
|
+
}
|
|
15
|
+
export function renderEquivalentCommandDisplays(tokens, platform = process.platform) {
|
|
16
|
+
if (platform === 'win32') {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
kind: 'powershell',
|
|
20
|
+
label: 'PowerShell 命令',
|
|
21
|
+
text: renderShellCommand(tokens, 'powershell'),
|
|
22
|
+
replayable: true,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
kind: 'argv',
|
|
26
|
+
label: '参数列表',
|
|
27
|
+
text: JSON.stringify(tokens),
|
|
28
|
+
replayable: false,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
return [{
|
|
33
|
+
kind: 'posix',
|
|
34
|
+
label: 'POSIX shell 命令',
|
|
35
|
+
text: renderShellCommand(tokens, 'posix'),
|
|
36
|
+
replayable: true,
|
|
37
|
+
}];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=equivalent-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equivalent-command.js","sourceRoot":"","sources":["../../../src/output/equivalent-command.ts"],"names":[],"mappings":"AASA,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC;QACxC,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC5C,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa;IACzC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAyB,EAAE,KAAgB;IAC5E,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;QAC3B,OAAO,KAAK,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,MAAyB,EACzB,WAA4B,OAAO,CAAC,QAAQ;IAE5C,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO;YACL;gBACE,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,eAAe;gBACtB,IAAI,EAAE,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC;gBAC9C,UAAU,EAAE,IAAI;aACjB;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;gBAC5B,UAAU,EAAE,KAAK;aAClB;SACF,CAAC;IACJ,CAAC;IACD,OAAO,CAAC;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,gBAAgB;YACvB,IAAI,EAAE,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC;YACzC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { CommandAction, PlatformName, RebuildActionEvent as SharedRebuildActionEvent, RebuildActionEventData as SharedRebuildActionEventData, Scope } from '../types.js';
|
|
2
|
+
export type OutputLevel = 'success' | 'info' | 'notice' | 'warning' | 'debug';
|
|
3
|
+
export type OutputTarget = 'stdout' | 'stderr' | 'debugLog';
|
|
4
|
+
export type NativeEventPhase = 'start' | 'success' | 'error';
|
|
5
|
+
export interface NativeMarketplaceEventData {
|
|
6
|
+
platform: PlatformName;
|
|
7
|
+
scope: Scope;
|
|
8
|
+
plugin: string;
|
|
9
|
+
marketplaceName: string;
|
|
10
|
+
marketplacePath: string;
|
|
11
|
+
operation: 'add' | 'list' | 'remove' | 'verify';
|
|
12
|
+
phase: NativeEventPhase;
|
|
13
|
+
errorCategory?: string;
|
|
14
|
+
suggestion?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface NativeRpcEventData {
|
|
17
|
+
platform: PlatformName;
|
|
18
|
+
scope: Scope;
|
|
19
|
+
plugin: string;
|
|
20
|
+
pluginId: string;
|
|
21
|
+
method: 'plugin/install' | 'plugin/uninstall' | 'codex plugin add' | 'codex plugin remove';
|
|
22
|
+
phase: NativeEventPhase;
|
|
23
|
+
durationMs: number;
|
|
24
|
+
nativeWriteSucceeded?: boolean;
|
|
25
|
+
errorCategory?: string;
|
|
26
|
+
suggestion?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface NativePostCheckEventData {
|
|
29
|
+
platform: PlatformName;
|
|
30
|
+
scope: Scope;
|
|
31
|
+
plugin: string;
|
|
32
|
+
pluginId: string;
|
|
33
|
+
operation: 'install' | 'uninstall';
|
|
34
|
+
phase: NativeEventPhase;
|
|
35
|
+
pluginEnabled: boolean | null;
|
|
36
|
+
configEntryPresent: boolean | null;
|
|
37
|
+
pluginInstalled: boolean | null;
|
|
38
|
+
activeCachePath: string | null;
|
|
39
|
+
errorCategory?: string;
|
|
40
|
+
suggestion?: string;
|
|
41
|
+
}
|
|
42
|
+
export type RebuildActionEventData = SharedRebuildActionEventData;
|
|
43
|
+
export type RebuildActionEvent = SharedRebuildActionEvent;
|
|
44
|
+
export type CommandEventType = 'native:marketplace' | 'native:rpc' | 'native:post-check' | string;
|
|
45
|
+
export type CommandEventData = Record<string, unknown> | RebuildActionEventData | NativeMarketplaceEventData | NativeRpcEventData | NativePostCheckEventData;
|
|
46
|
+
export interface CommandOutputSource {
|
|
47
|
+
platform?: PlatformName;
|
|
48
|
+
plugin?: string;
|
|
49
|
+
scope?: Scope;
|
|
50
|
+
action?: CommandAction | string;
|
|
51
|
+
}
|
|
52
|
+
export interface CommandEvent {
|
|
53
|
+
type: CommandEventType;
|
|
54
|
+
commandName?: string;
|
|
55
|
+
message?: string;
|
|
56
|
+
data?: CommandEventData;
|
|
57
|
+
source?: CommandOutputSource;
|
|
58
|
+
level?: OutputLevel;
|
|
59
|
+
target?: OutputTarget;
|
|
60
|
+
}
|
|
61
|
+
export interface CommandNotice {
|
|
62
|
+
level: OutputLevel;
|
|
63
|
+
message: string;
|
|
64
|
+
identity?: string;
|
|
65
|
+
target?: OutputTarget;
|
|
66
|
+
source?: CommandOutputSource;
|
|
67
|
+
}
|
|
68
|
+
export interface CommandReporter {
|
|
69
|
+
event: (event: CommandEvent) => void | Promise<void>;
|
|
70
|
+
notice: (notice: CommandNotice) => void | Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
export interface DebugLogger {
|
|
73
|
+
readonly logFile?: string;
|
|
74
|
+
log: (event: CommandEvent) => void | Promise<void>;
|
|
75
|
+
flush?: () => void | Promise<void>;
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/output/model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CommandEvent, CommandNotice } from './model.js';
|
|
2
|
+
export declare function projectTuiNotice(notice: CommandNotice): string;
|
|
3
|
+
export interface RebuildProgressCurrent {
|
|
4
|
+
target: string;
|
|
5
|
+
phase: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RebuildProgressSnapshot {
|
|
8
|
+
current?: RebuildProgressCurrent;
|
|
9
|
+
messages: string[];
|
|
10
|
+
startedAtMs?: number;
|
|
11
|
+
elapsedMs?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface RebuildProgressFeed {
|
|
14
|
+
addEvent: (event: CommandEvent) => void;
|
|
15
|
+
addNotice: (notice: CommandNotice) => void;
|
|
16
|
+
setCurrent: (current: RebuildProgressCurrent, message?: string) => void;
|
|
17
|
+
clearCurrent: () => void;
|
|
18
|
+
get: () => RebuildProgressSnapshot;
|
|
19
|
+
subscribe: (listener: (snapshot: RebuildProgressSnapshot) => void) => () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function createRebuildProgressFeed(limit?: number): RebuildProgressFeed;
|