@agentxm/client-core 0.2.0 → 0.3.2
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/src/unstable/commands/operations/disable.d.ts +2 -2
- package/dist/src/unstable/commands/operations/disable.d.ts.map +1 -1
- package/dist/src/unstable/commands/operations/enable.d.ts +2 -2
- package/dist/src/unstable/commands/operations/enable.d.ts.map +1 -1
- package/dist/src/unstable/commands/operations/install.d.ts +1 -1
- package/dist/src/unstable/commands/operations/install.d.ts.map +1 -1
- package/dist/src/unstable/commands/operations/new-command.d.ts +2 -2
- package/dist/src/unstable/commands/operations/new-command.d.ts.map +1 -1
- package/dist/src/unstable/commands/operations/publish.d.ts +1 -1
- package/dist/src/unstable/commands/operations/publish.d.ts.map +1 -1
- package/dist/src/unstable/commands/operations/uninstall.d.ts +1 -1
- package/dist/src/unstable/commands/operations/uninstall.d.ts.map +1 -1
- package/dist/src/unstable/extensions/operations.d.ts +1 -1
- package/dist/src/unstable/extensions/operations.d.ts.map +1 -1
- package/dist/src/unstable/lint/catalog/index.d.ts +39 -0
- package/dist/src/unstable/lint/catalog/index.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/index.js +49 -0
- package/dist/src/unstable/lint/catalog/index.js.map +1 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts +31 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js +41 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-keys-recognized.js.map +1 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts +18 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-present.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-present.js +41 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-present.js.map +1 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts +26 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js +34 -0
- package/dist/src/unstable/lint/catalog/pack/manifest-schema-valid.js.map +1 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts +61 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js +46 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/contexts.js.map +1 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/platform.d.ts +53 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/platform.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/platform.js +90 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/platform.js.map +1 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts +60 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.js +85 -0
- package/dist/src/unstable/lint/catalog/pack-accessor/vft.js.map +1 -0
- package/dist/src/unstable/lint/catalog/pack.d.ts +37 -0
- package/dist/src/unstable/lint/catalog/pack.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/pack.js +47 -0
- package/dist/src/unstable/lint/catalog/pack.js.map +1 -0
- package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts +59 -0
- package/dist/src/unstable/lint/catalog/shared/schema-rule.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/shared/schema-rule.js +99 -0
- package/dist/src/unstable/lint/catalog/shared/schema-rule.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts +31 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js +151 -0
- package/dist/src/unstable/lint/catalog/skill/frontmatter-parseable.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts +26 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js +41 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-keys-recognized.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts +18 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-present.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-present.js +46 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-present.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts +22 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js +37 -0
- package/dist/src/unstable/lint/catalog/skill/manifest-schema-valid.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts +17 -0
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.js +38 -0
- package/dist/src/unstable/lint/catalog/skill/skill-md-present.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts +65 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js +50 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/contexts.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/platform.d.ts +52 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/platform.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/platform.js +89 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/platform.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts +58 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.js +83 -0
- package/dist/src/unstable/lint/catalog/skill-accessor/vft.js.map +1 -0
- package/dist/src/unstable/lint/catalog/skill.d.ts +38 -0
- package/dist/src/unstable/lint/catalog/skill.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/skill.js +52 -0
- package/dist/src/unstable/lint/catalog/skill.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.d.ts +23 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.js +75 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-detected-declared.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-recognized.d.ts +23 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-recognized.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-recognized.js +76 -0
- package/dist/src/unstable/lint/catalog/workspace/agents-recognized.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/empty.d.ts +18 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/empty.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/empty.js +16 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/empty.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.d.ts +133 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.js +149 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/install-ops.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.d.ts +25 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.js +30 -0
- package/dist/src/unstable/lint/catalog/workspace/helpers/registry-source.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/initialized.d.ts +22 -0
- package/dist/src/unstable/lint/catalog/workspace/initialized.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/initialized.js +55 -0
- package/dist/src/unstable/lint/catalog/workspace/initialized.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.d.ts +33 -0
- package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.js +125 -0
- package/dist/src/unstable/lint/catalog/workspace/lockfile-valid.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.d.ts +19 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.js +145 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-declarations-valid.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.d.ts +17 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.js +107 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-dependencies-resolved.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.d.ts +22 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.js +163 -0
- package/dist/src/unstable/lint/catalog/workspace/packs-members-retained.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.d.ts +28 -0
- package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.js +67 -0
- package/dist/src/unstable/lint/catalog/workspace/settings-schema-valid.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.d.ts +30 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.js +232 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-clean.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.d.ts +26 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.js +129 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-artifacts-correct.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.d.ts +26 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.js +151 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-declarations-valid.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.d.ts +29 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.js +149 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-integrity-valid.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.d.ts +29 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.js +242 -0
- package/dist/src/unstable/lint/catalog/workspace/skills-lockfile-aligned.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.d.ts +141 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.js +123 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/contexts.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.d.ts +38 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.js +311 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/interpret-ops.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/platform.d.ts +60 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/platform.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/platform.js +201 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/platform.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.d.ts +65 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.js +95 -0
- package/dist/src/unstable/lint/catalog/workspace-accessor/test-state.js.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace.d.ts +47 -0
- package/dist/src/unstable/lint/catalog/workspace.d.ts.map +1 -0
- package/dist/src/unstable/lint/catalog/workspace.js +80 -0
- package/dist/src/unstable/lint/catalog/workspace.js.map +1 -0
- package/dist/src/unstable/lint/cli.d.ts +297 -0
- package/dist/src/unstable/lint/cli.d.ts.map +1 -0
- package/dist/src/unstable/lint/cli.js +388 -0
- package/dist/src/unstable/lint/cli.js.map +1 -0
- package/dist/src/unstable/lint/compose-path.d.ts +27 -0
- package/dist/src/unstable/lint/compose-path.d.ts.map +1 -0
- package/dist/src/unstable/lint/compose-path.js +61 -0
- package/dist/src/unstable/lint/compose-path.js.map +1 -0
- package/dist/src/unstable/lint/config.d.ts +103 -0
- package/dist/src/unstable/lint/config.d.ts.map +1 -0
- package/dist/src/unstable/lint/config.js +137 -0
- package/dist/src/unstable/lint/config.js.map +1 -0
- package/dist/src/unstable/lint/context.d.ts +265 -0
- package/dist/src/unstable/lint/context.d.ts.map +1 -0
- package/dist/src/unstable/lint/context.js +21 -0
- package/dist/src/unstable/lint/context.js.map +1 -0
- package/dist/src/unstable/lint/evaluate.d.ts +68 -0
- package/dist/src/unstable/lint/evaluate.d.ts.map +1 -0
- package/dist/src/unstable/lint/evaluate.js +147 -0
- package/dist/src/unstable/lint/evaluate.js.map +1 -0
- package/dist/src/unstable/lint/index.d.ts +28 -0
- package/dist/src/unstable/lint/index.d.ts.map +1 -0
- package/dist/src/unstable/lint/index.js +35 -0
- package/dist/src/unstable/lint/index.js.map +1 -0
- package/dist/src/unstable/lint/issues-to-findings.d.ts +35 -0
- package/dist/src/unstable/lint/issues-to-findings.d.ts.map +1 -0
- package/dist/src/unstable/lint/issues-to-findings.js +97 -0
- package/dist/src/unstable/lint/issues-to-findings.js.map +1 -0
- package/dist/src/unstable/lint/rule.d.ts +139 -0
- package/dist/src/unstable/lint/rule.d.ts.map +1 -0
- package/dist/src/unstable/lint/rule.js +25 -0
- package/dist/src/unstable/lint/rule.js.map +1 -0
- package/dist/src/unstable/mcp-servers/operations/install.d.ts +1 -1
- package/dist/src/unstable/mcp-servers/operations/install.d.ts.map +1 -1
- package/dist/src/unstable/mcp-servers/operations/publish.d.ts +1 -1
- package/dist/src/unstable/mcp-servers/operations/publish.d.ts.map +1 -1
- package/dist/src/unstable/mcp-servers/operations/uninstall.d.ts +1 -1
- package/dist/src/unstable/mcp-servers/operations/uninstall.d.ts.map +1 -1
- package/dist/src/unstable/packs/operations/add-to-pack.d.ts +2 -2
- package/dist/src/unstable/packs/operations/add-to-pack.d.ts.map +1 -1
- package/dist/src/unstable/packs/operations/install.d.ts +2 -2
- package/dist/src/unstable/packs/operations/install.d.ts.map +1 -1
- package/dist/src/unstable/packs/operations/new-pack.d.ts +2 -2
- package/dist/src/unstable/packs/operations/new-pack.d.ts.map +1 -1
- package/dist/src/unstable/packs/operations/publish.d.ts +2 -2
- package/dist/src/unstable/packs/operations/publish.d.ts.map +1 -1
- package/dist/src/unstable/packs/operations/remove-from-pack.d.ts +2 -2
- package/dist/src/unstable/packs/operations/remove-from-pack.d.ts.map +1 -1
- package/dist/src/unstable/packs/operations/uninstall.d.ts +2 -2
- package/dist/src/unstable/packs/operations/uninstall.d.ts.map +1 -1
- package/dist/src/unstable/packs/operations/unpack.d.ts +2 -2
- package/dist/src/unstable/packs/operations/unpack.d.ts.map +1 -1
- package/dist/src/unstable/{workspace → plan}/apply-plan.d.ts +9 -0
- package/dist/src/unstable/plan/apply-plan.d.ts.map +1 -0
- package/dist/src/unstable/{workspace → plan}/apply-plan.js +10 -1
- package/dist/src/unstable/plan/apply-plan.js.map +1 -0
- package/dist/src/unstable/plan/index.d.ts +24 -0
- package/dist/src/unstable/plan/index.d.ts.map +1 -0
- package/dist/src/unstable/plan/index.js +28 -0
- package/dist/src/unstable/plan/index.js.map +1 -0
- package/dist/src/unstable/{workspace → plan}/plan.d.ts +6 -0
- package/dist/src/unstable/plan/plan.d.ts.map +1 -0
- package/dist/src/unstable/{workspace → plan}/plan.js +6 -0
- package/dist/src/unstable/plan/plan.js.map +1 -0
- package/dist/src/unstable/{workspace → plan}/resolve-plan.d.ts +30 -2
- package/dist/src/unstable/plan/resolve-plan.d.ts.map +1 -0
- package/dist/src/unstable/{workspace → plan}/resolve-plan.js +37 -6
- package/dist/src/unstable/plan/resolve-plan.js.map +1 -0
- package/dist/src/unstable/publish/manifest-policy.d.ts +8 -8
- package/dist/src/unstable/settings/index.d.ts +2 -0
- package/dist/src/unstable/settings/index.d.ts.map +1 -1
- package/dist/src/unstable/settings/index.js +1 -0
- package/dist/src/unstable/settings/index.js.map +1 -1
- package/dist/src/unstable/settings/schema.d.ts +3 -0
- package/dist/src/unstable/settings/schema.d.ts.map +1 -1
- package/dist/src/unstable/settings/schema.js +3 -0
- package/dist/src/unstable/settings/schema.js.map +1 -1
- package/dist/src/unstable/settings/settings.d.ts +10 -0
- package/dist/src/unstable/settings/settings.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/copy.d.ts +2 -2
- package/dist/src/unstable/skills/operations/copy.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/disable.d.ts +2 -2
- package/dist/src/unstable/skills/operations/disable.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/enable.d.ts +2 -2
- package/dist/src/unstable/skills/operations/enable.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/install.d.ts +2 -2
- package/dist/src/unstable/skills/operations/install.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/new-skill.d.ts +2 -2
- package/dist/src/unstable/skills/operations/new-skill.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/publish.d.ts +2 -2
- package/dist/src/unstable/skills/operations/publish.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/rename.d.ts +2 -2
- package/dist/src/unstable/skills/operations/rename.d.ts.map +1 -1
- package/dist/src/unstable/skills/operations/uninstall.d.ts +2 -2
- package/dist/src/unstable/skills/operations/uninstall.d.ts.map +1 -1
- package/dist/src/unstable/subagents/operations/disable.d.ts +2 -2
- package/dist/src/unstable/subagents/operations/disable.d.ts.map +1 -1
- package/dist/src/unstable/subagents/operations/enable.d.ts +2 -2
- package/dist/src/unstable/subagents/operations/enable.d.ts.map +1 -1
- package/dist/src/unstable/subagents/operations/publish.d.ts +2 -2
- package/dist/src/unstable/subagents/operations/publish.d.ts.map +1 -1
- package/dist/src/unstable/workflows/install-command/workflow.d.ts +1 -1
- package/dist/src/unstable/workflows/install-command/workflow.d.ts.map +1 -1
- package/dist/src/unstable/workflows/install-command/workflow.js +1 -1
- package/dist/src/unstable/workflows/install-command/workflow.js.map +1 -1
- package/dist/src/unstable/workflows/uninstall-command/workflow.d.ts +1 -1
- package/dist/src/unstable/workflows/uninstall-command/workflow.d.ts.map +1 -1
- package/dist/src/unstable/workflows/uninstall-command/workflow.js +1 -1
- package/dist/src/unstable/workflows/uninstall-command/workflow.js.map +1 -1
- package/dist/src/unstable/workspace/augment-plan.d.ts +1 -1
- package/dist/src/unstable/workspace/augment-plan.d.ts.map +1 -1
- package/dist/src/unstable/workspace/display-plan.d.ts +1 -1
- package/dist/src/unstable/workspace/display-plan.d.ts.map +1 -1
- package/dist/src/unstable/workspace/display-plan.js.map +1 -1
- package/dist/src/unstable/workspace/index.d.ts +0 -5
- package/dist/src/unstable/workspace/index.d.ts.map +1 -1
- package/dist/src/unstable/workspace/index.js +3 -7
- package/dist/src/unstable/workspace/index.js.map +1 -1
- package/dist/src/unstable/workspace/initialization.d.ts +15 -0
- package/dist/src/unstable/workspace/initialization.d.ts.map +1 -1
- package/dist/src/unstable/workspace/paths.d.ts +0 -18
- package/dist/src/unstable/workspace/paths.d.ts.map +1 -1
- package/dist/src/unstable/workspace/paths.js +12 -2
- package/dist/src/unstable/workspace/paths.js.map +1 -1
- package/dist/src/unstable/workspace/reconciliation.d.ts +1 -1
- package/dist/src/unstable/workspace/reconciliation.d.ts.map +1 -1
- package/dist/src/unstable/workspace/scan-plan-readiness.d.ts +1 -1
- package/dist/src/unstable/workspace/scan-plan-readiness.d.ts.map +1 -1
- package/dist/src/unstable/workspace/settings-validation/types.d.ts +11 -1
- package/dist/src/unstable/workspace/settings-validation/types.d.ts.map +1 -1
- package/package.json +10 -2
- package/site-content/__generated__/schemas/axm-lock.schema.json +727 -1124
- package/site-content/__generated__/schemas/axm-package-meta.schema.json +3 -16
- package/site-content/__generated__/schemas/command.schema.json +29 -130
- package/site-content/__generated__/schemas/extension-pack.schema.json +36 -154
- package/site-content/__generated__/schemas/mcp-server.schema.json +21 -134
- package/site-content/__generated__/schemas/settings.schema.json +111 -291
- package/site-content/__generated__/schemas/skill.schema.json +23 -143
- package/dist/src/unstable/workspace/apply-plan.d.ts.map +0 -1
- package/dist/src/unstable/workspace/apply-plan.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/check-def.d.ts +0 -29
- package/dist/src/unstable/workspace/doctor/check-def.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/check-def.js +0 -17
- package/dist/src/unstable/workspace/doctor/check-def.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/agents-configured.d.ts +0 -5
- package/dist/src/unstable/workspace/doctor/checks/agents-configured.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/agents-configured.js +0 -170
- package/dist/src/unstable/workspace/doctor/checks/agents-configured.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/extensions-active.d.ts +0 -4
- package/dist/src/unstable/workspace/doctor/checks/extensions-active.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/extensions-active.js +0 -238
- package/dist/src/unstable/workspace/doctor/checks/extensions-active.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/extensions-current.d.ts +0 -18
- package/dist/src/unstable/workspace/doctor/checks/extensions-current.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/extensions-current.js +0 -92
- package/dist/src/unstable/workspace/doctor/checks/extensions-current.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/extensions-installed.d.ts +0 -5
- package/dist/src/unstable/workspace/doctor/checks/extensions-installed.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/extensions-installed.js +0 -472
- package/dist/src/unstable/workspace/doctor/checks/extensions-installed.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/workspace-ready.d.ts +0 -5
- package/dist/src/unstable/workspace/doctor/checks/workspace-ready.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/checks/workspace-ready.js +0 -201
- package/dist/src/unstable/workspace/doctor/checks/workspace-ready.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/diagnose.d.ts +0 -49
- package/dist/src/unstable/workspace/doctor/diagnose.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/diagnose.js +0 -78
- package/dist/src/unstable/workspace/doctor/diagnose.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/index.d.ts +0 -8
- package/dist/src/unstable/workspace/doctor/index.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/index.js +0 -6
- package/dist/src/unstable/workspace/doctor/index.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/rollup.d.ts +0 -4
- package/dist/src/unstable/workspace/doctor/rollup.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/rollup.js +0 -28
- package/dist/src/unstable/workspace/doctor/rollup.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/runner.d.ts +0 -6
- package/dist/src/unstable/workspace/doctor/runner.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/runner.js +0 -179
- package/dist/src/unstable/workspace/doctor/runner.js.map +0 -1
- package/dist/src/unstable/workspace/doctor/types.d.ts +0 -127
- package/dist/src/unstable/workspace/doctor/types.d.ts.map +0 -1
- package/dist/src/unstable/workspace/doctor/types.js +0 -60
- package/dist/src/unstable/workspace/doctor/types.js.map +0 -1
- package/dist/src/unstable/workspace/plan.d.ts.map +0 -1
- package/dist/src/unstable/workspace/plan.js.map +0 -1
- package/dist/src/unstable/workspace/resolve-plan.d.ts.map +0 -1
- package/dist/src/unstable/workspace/resolve-plan.js.map +0 -1
- package/dist/src/unstable/workspace/sync.d.ts +0 -17
- package/dist/src/unstable/workspace/sync.d.ts.map +0 -1
- package/dist/src/unstable/workspace/sync.js +0 -142
- package/dist/src/unstable/workspace/sync.js.map +0 -1
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lint runner — the reusable core of `axm lint`.
|
|
3
|
+
*
|
|
4
|
+
* The `axm lint` CLI command file is a thin surface over flag parsing and
|
|
5
|
+
* rendering; the logic that evaluates rule catalogs, renders findings, detects
|
|
6
|
+
* publish-gate drift, and (under `--fix`) composes the autofix plan lives in
|
|
7
|
+
* this module.
|
|
8
|
+
*
|
|
9
|
+
* Phase 5 entry points (see `openspec/changes/add-lint-engine/tasks.md`):
|
|
10
|
+
*
|
|
11
|
+
* - {@link evaluateAllCatalogs} — concurrent evaluation of the three
|
|
12
|
+
* v1 rule catalogs against pre-built contexts.
|
|
13
|
+
* - {@link summarizeEvaluations} — group, count, and derive the exit
|
|
14
|
+
* category from raw `Evaluated<*>` lists.
|
|
15
|
+
* - {@link detectPublishGateDrift} — compute whether the configured
|
|
16
|
+
* `LintConfig` weakens any `skill/*` / `pack/*` platform-default-`error`
|
|
17
|
+
* rule (task 5.7).
|
|
18
|
+
* - {@link renderFindingsText} — finding-first human renderer (task
|
|
19
|
+
* 5.6).
|
|
20
|
+
* - {@link toLintJsonDocument} — `--json` document shape (task 5.6).
|
|
21
|
+
* - {@link resolveLintExitCategory} — exit-code contract evaluator (task
|
|
22
|
+
* 5.9).
|
|
23
|
+
*
|
|
24
|
+
* Lint-intent → canonical `Operation` adapter composition happens in the CLI
|
|
25
|
+
* handler (`packages/cli/src/root/lint/handler.ts`), which re-resolves each
|
|
26
|
+
* intent's `source` via the `resolveConfigured*` helpers and hands the
|
|
27
|
+
* resulting canonical Operation to the per-extension plan-step builder. The
|
|
28
|
+
* runner here stays accessor-free.
|
|
29
|
+
*
|
|
30
|
+
* @experimental This API is unstable and may change without notice.
|
|
31
|
+
* @packageDocumentation
|
|
32
|
+
*/
|
|
33
|
+
import * as Effect from "effect/Effect";
|
|
34
|
+
import type { LintConfig } from "./config.js";
|
|
35
|
+
import { platformCanonicalLintConfig } from "./config.js";
|
|
36
|
+
import type { Evaluated } from "./evaluate.js";
|
|
37
|
+
import type { PackRuleContext, SkillRuleContext, WorkspaceRuleContext } from "./context.js";
|
|
38
|
+
import type { AutofixingRule, LintFinding, Severity } from "./rule.js";
|
|
39
|
+
/**
|
|
40
|
+
* A single finding annotated with the context that produced it.
|
|
41
|
+
*
|
|
42
|
+
* `displayRoot` carries the context's rendering root; `path` is the
|
|
43
|
+
* pre-composed display path for the finding so consumers (text / JSON /
|
|
44
|
+
* summary logs) don't re-derive it.
|
|
45
|
+
*
|
|
46
|
+
* @experimental This API is unstable and may change without notice.
|
|
47
|
+
*/
|
|
48
|
+
export interface RenderedFinding {
|
|
49
|
+
readonly group: "skill" | "pack" | "workspace";
|
|
50
|
+
readonly displayRoot: string;
|
|
51
|
+
readonly path: string;
|
|
52
|
+
readonly finding: LintFinding;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Per-group evaluation result. The raw `Evaluated<*>` list is retained so
|
|
56
|
+
* downstream consumers (render, JSON emitter, `collectFixOperations`) can
|
|
57
|
+
* walk evaluations without re-running rules.
|
|
58
|
+
*
|
|
59
|
+
* @experimental This API is unstable and may change without notice.
|
|
60
|
+
*/
|
|
61
|
+
export interface GroupEvaluations {
|
|
62
|
+
readonly skills: ReadonlyArray<Evaluated<SkillRuleContext>>;
|
|
63
|
+
readonly packs: ReadonlyArray<Evaluated<PackRuleContext>>;
|
|
64
|
+
readonly workspace: ReadonlyArray<Evaluated<WorkspaceRuleContext>>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Aggregate counts across all emitted findings.
|
|
68
|
+
*
|
|
69
|
+
* `total` === `errors + warnings + infos` — info findings participate in
|
|
70
|
+
* rendering and in the JSON envelope, but never influence exit code.
|
|
71
|
+
*
|
|
72
|
+
* @experimental This API is unstable and may change without notice.
|
|
73
|
+
*/
|
|
74
|
+
export interface FindingCounts {
|
|
75
|
+
readonly total: number;
|
|
76
|
+
readonly errors: number;
|
|
77
|
+
readonly warnings: number;
|
|
78
|
+
readonly infos: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Possible exit-code categories for `axm lint`.
|
|
82
|
+
*
|
|
83
|
+
* - `"clean"` — zero findings, or only info-severity findings; zero exit.
|
|
84
|
+
* - `"warnings"` — at least one warning, no errors; non-zero only when
|
|
85
|
+
* `--strict` is set (see {@link resolveLintExitCategory}).
|
|
86
|
+
* - `"errors"` — at least one error; non-zero exit regardless of flags.
|
|
87
|
+
*
|
|
88
|
+
* @experimental This API is unstable and may change without notice.
|
|
89
|
+
*/
|
|
90
|
+
export type LintExitCategory = "clean" | "warnings" | "errors";
|
|
91
|
+
/**
|
|
92
|
+
* Build the three v1 evaluation groups concurrently.
|
|
93
|
+
*
|
|
94
|
+
* The evaluator is a pure `Effect.Effect<ReadonlyArray<Evaluated<C>>>`; this
|
|
95
|
+
* helper simply hands the three catalogs to `Effect.all` with unbounded
|
|
96
|
+
* concurrency so catalog evaluations run in parallel but findings stay in
|
|
97
|
+
* stable catalog order inside each group.
|
|
98
|
+
*
|
|
99
|
+
* @experimental This API is unstable and may change without notice.
|
|
100
|
+
*/
|
|
101
|
+
export declare const evaluateAllCatalogs: (args: {
|
|
102
|
+
readonly skillContexts: ReadonlyArray<SkillRuleContext>;
|
|
103
|
+
readonly packContexts: ReadonlyArray<PackRuleContext>;
|
|
104
|
+
readonly workspaceContext: WorkspaceRuleContext;
|
|
105
|
+
readonly config: LintConfig;
|
|
106
|
+
}) => Effect.Effect<GroupEvaluations>;
|
|
107
|
+
/**
|
|
108
|
+
* Flatten a {@link GroupEvaluations} triple into a single `RenderedFinding[]`
|
|
109
|
+
* in stable group-then-catalog order.
|
|
110
|
+
*
|
|
111
|
+
* @experimental This API is unstable and may change without notice.
|
|
112
|
+
*/
|
|
113
|
+
export declare const collectRenderedFindings: (evaluations: GroupEvaluations) => ReadonlyArray<RenderedFinding>;
|
|
114
|
+
/**
|
|
115
|
+
* Count findings by severity across every group.
|
|
116
|
+
*
|
|
117
|
+
* @experimental This API is unstable and may change without notice.
|
|
118
|
+
*/
|
|
119
|
+
export declare const countFindings: (findings: ReadonlyArray<RenderedFinding>) => FindingCounts;
|
|
120
|
+
/**
|
|
121
|
+
* Aggregated summary — counts + derived exit category — computed from a
|
|
122
|
+
* {@link GroupEvaluations} triple.
|
|
123
|
+
*
|
|
124
|
+
* @experimental This API is unstable and may change without notice.
|
|
125
|
+
*/
|
|
126
|
+
export interface LintSummary {
|
|
127
|
+
readonly findings: ReadonlyArray<RenderedFinding>;
|
|
128
|
+
readonly counts: FindingCounts;
|
|
129
|
+
readonly exitCategory: LintExitCategory;
|
|
130
|
+
readonly driftBanner: ReadonlyArray<string>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Derive a full {@link LintSummary} (findings, counts, exit category, drift
|
|
134
|
+
* banner rule ids) from raw evaluations + the configured severity overrides.
|
|
135
|
+
*
|
|
136
|
+
* @experimental This API is unstable and may change without notice.
|
|
137
|
+
*/
|
|
138
|
+
export declare const summarizeEvaluations: (evaluations: GroupEvaluations, config: LintConfig) => LintSummary;
|
|
139
|
+
/**
|
|
140
|
+
* Translate a {@link LintExitCategory} + `--strict` into the exit-code
|
|
141
|
+
* policy.
|
|
142
|
+
*
|
|
143
|
+
* | Category | --strict=false | --strict=true |
|
|
144
|
+
* | ------------ | -------------- | ------------- |
|
|
145
|
+
* | `"clean"` | `0` | `0` |
|
|
146
|
+
* | `"warnings"` | `0` | non-zero |
|
|
147
|
+
* | `"errors"` | non-zero | non-zero |
|
|
148
|
+
*
|
|
149
|
+
* The return value is a discriminated enum; the CLI handler maps the `"fail"`
|
|
150
|
+
* branch to its platform exit-code primitive.
|
|
151
|
+
*
|
|
152
|
+
* @experimental This API is unstable and may change without notice.
|
|
153
|
+
*/
|
|
154
|
+
export declare const resolveLintExitCategory: (args: {
|
|
155
|
+
readonly category: LintExitCategory;
|
|
156
|
+
readonly strict: boolean;
|
|
157
|
+
}) => "success" | "fail";
|
|
158
|
+
/**
|
|
159
|
+
* Identify every configured `lint.rules` entry that weakens a platform-canonical
|
|
160
|
+
* `error`-severity `skill/*` or `pack/*` rule.
|
|
161
|
+
*
|
|
162
|
+
* The publish gate runs the `skill/*` and `pack/*` catalogs against
|
|
163
|
+
* {@link platformCanonicalLintConfig}; any workspace override that lowers a
|
|
164
|
+
* rule in those namespaces from `error` to `off | info | warn` creates a
|
|
165
|
+
* publish-gate divergence the user should know about (they'll see `error`
|
|
166
|
+
* findings from the registry that don't appear locally).
|
|
167
|
+
*
|
|
168
|
+
* Workspace-only rule weakenings (`workspace/*`) do NOT trigger the banner —
|
|
169
|
+
* those never reach publish.
|
|
170
|
+
*
|
|
171
|
+
* Returns the rule ids that trigger the banner, in catalog order, so the
|
|
172
|
+
* renderer can produce stable deterministic output.
|
|
173
|
+
*
|
|
174
|
+
* @experimental This API is unstable and may change without notice.
|
|
175
|
+
*/
|
|
176
|
+
export declare const detectPublishGateDrift: (config: LintConfig) => ReadonlyArray<string>;
|
|
177
|
+
/**
|
|
178
|
+
* Input for the human text renderer.
|
|
179
|
+
*
|
|
180
|
+
* The `fixSummary` slot is reserved for the trailing `--fix` summary line
|
|
181
|
+
* (populated after `applyPlan` completes). When `undefined`, no summary is
|
|
182
|
+
* rendered — the read-only `axm lint` run.
|
|
183
|
+
*
|
|
184
|
+
* @experimental This API is unstable and may change without notice.
|
|
185
|
+
*/
|
|
186
|
+
export interface RenderFindingsArgs {
|
|
187
|
+
readonly summary: LintSummary;
|
|
188
|
+
readonly fixSummary?: FixSummary;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Outcome of a `--fix` run; used by the renderer and the JSON emitter.
|
|
192
|
+
*
|
|
193
|
+
* @experimental This API is unstable and may change without notice.
|
|
194
|
+
*/
|
|
195
|
+
export interface FixSummary {
|
|
196
|
+
readonly attempted: number;
|
|
197
|
+
readonly applied: number;
|
|
198
|
+
readonly failed: number;
|
|
199
|
+
readonly warnings: ReadonlyArray<string>;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Render a finding-first human text report.
|
|
203
|
+
*
|
|
204
|
+
* Output shape (one line per entry, grouped first by context type then by
|
|
205
|
+
* severity within each group):
|
|
206
|
+
*
|
|
207
|
+
* DRIFT: The registry will still block publish on these rules:
|
|
208
|
+
* - skill/manifest-schema-valid
|
|
209
|
+
*
|
|
210
|
+
* WORKSPACE
|
|
211
|
+
* [error] workspace/lockfile-valid axm-lock.yaml is missing. ./axm-lock.yaml
|
|
212
|
+
* [warning] workspace/... ...
|
|
213
|
+
*
|
|
214
|
+
* SKILLS
|
|
215
|
+
* [error] ...
|
|
216
|
+
*
|
|
217
|
+
* Summary: 2 errors, 1 warning.
|
|
218
|
+
* Applied 3 fixes; 1 warning surfaced from applyPlan.
|
|
219
|
+
*
|
|
220
|
+
* @experimental This API is unstable and may change without notice.
|
|
221
|
+
*/
|
|
222
|
+
export declare const renderFindingsText: (args: RenderFindingsArgs) => ReadonlyArray<string>;
|
|
223
|
+
/**
|
|
224
|
+
* JSON-renderable finding entry used by the `--json` document.
|
|
225
|
+
*
|
|
226
|
+
* @experimental This API is unstable and may change without notice.
|
|
227
|
+
*/
|
|
228
|
+
export interface LintJsonFinding {
|
|
229
|
+
readonly group: "skill" | "pack" | "workspace";
|
|
230
|
+
readonly kind: "autofixable" | "advisory";
|
|
231
|
+
readonly ruleId: string;
|
|
232
|
+
readonly severity: Severity;
|
|
233
|
+
readonly message: string;
|
|
234
|
+
readonly displayRoot: string;
|
|
235
|
+
readonly path: string;
|
|
236
|
+
readonly location?: {
|
|
237
|
+
readonly file: string;
|
|
238
|
+
readonly line?: number;
|
|
239
|
+
readonly column?: number;
|
|
240
|
+
};
|
|
241
|
+
readonly suggestions: ReadonlyArray<string>;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* JSON envelope shape returned under `axm lint --json`.
|
|
245
|
+
*
|
|
246
|
+
* Mirrors the design doc §9 envelope for the CLI and matches the registry
|
|
247
|
+
* publish failure envelope structure (`findings[]`, `displayRoot` per entry,
|
|
248
|
+
* per-finding `path` pre-composed). `--fix` runs add a `fix` summary block.
|
|
249
|
+
*
|
|
250
|
+
* @experimental This API is unstable and may change without notice.
|
|
251
|
+
*/
|
|
252
|
+
export interface LintJsonDocument {
|
|
253
|
+
readonly findings: ReadonlyArray<LintJsonFinding>;
|
|
254
|
+
readonly summary: {
|
|
255
|
+
readonly total: number;
|
|
256
|
+
readonly errors: number;
|
|
257
|
+
readonly warnings: number;
|
|
258
|
+
readonly infos: number;
|
|
259
|
+
readonly exitCategory: LintExitCategory;
|
|
260
|
+
};
|
|
261
|
+
readonly driftBanner: ReadonlyArray<string>;
|
|
262
|
+
readonly fix?: {
|
|
263
|
+
readonly attempted: number;
|
|
264
|
+
readonly applied: number;
|
|
265
|
+
readonly failed: number;
|
|
266
|
+
readonly warnings: ReadonlyArray<string>;
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Build the `--json` document from a {@link LintSummary} (+ optional fix
|
|
271
|
+
* summary).
|
|
272
|
+
*
|
|
273
|
+
* @experimental This API is unstable and may change without notice.
|
|
274
|
+
*/
|
|
275
|
+
export declare const toLintJsonDocument: (args: {
|
|
276
|
+
readonly summary: LintSummary;
|
|
277
|
+
readonly fixSummary?: FixSummary;
|
|
278
|
+
}) => LintJsonDocument;
|
|
279
|
+
/**
|
|
280
|
+
* Walk workspace evaluations (the only v1 namespace that ships
|
|
281
|
+
* `AutofixingRule`s) and return the set of `(rule, finding, context)` triples
|
|
282
|
+
* the CLI handler can dispatch on to produce canonical Operations.
|
|
283
|
+
*
|
|
284
|
+
* The returned triples point at the already-evaluated `AutofixableFinding`
|
|
285
|
+
* values so the renderer and the fix pipeline share a single source of truth.
|
|
286
|
+
*
|
|
287
|
+
* @experimental This API is unstable and may change without notice.
|
|
288
|
+
*/
|
|
289
|
+
export declare const collectAutofixableEntries: (evaluations: GroupEvaluations) => ReadonlyArray<{
|
|
290
|
+
readonly rule: AutofixingRule<WorkspaceRuleContext>;
|
|
291
|
+
readonly context: WorkspaceRuleContext;
|
|
292
|
+
readonly finding: LintFinding & {
|
|
293
|
+
readonly kind: "autofixable";
|
|
294
|
+
};
|
|
295
|
+
}>;
|
|
296
|
+
export { platformCanonicalLintConfig };
|
|
297
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/unstable/lint/cli.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lint runner — the reusable core of `axm lint`.
|
|
3
|
+
*
|
|
4
|
+
* The `axm lint` CLI command file is a thin surface over flag parsing and
|
|
5
|
+
* rendering; the logic that evaluates rule catalogs, renders findings, detects
|
|
6
|
+
* publish-gate drift, and (under `--fix`) composes the autofix plan lives in
|
|
7
|
+
* this module.
|
|
8
|
+
*
|
|
9
|
+
* Phase 5 entry points (see `openspec/changes/add-lint-engine/tasks.md`):
|
|
10
|
+
*
|
|
11
|
+
* - {@link evaluateAllCatalogs} — concurrent evaluation of the three
|
|
12
|
+
* v1 rule catalogs against pre-built contexts.
|
|
13
|
+
* - {@link summarizeEvaluations} — group, count, and derive the exit
|
|
14
|
+
* category from raw `Evaluated<*>` lists.
|
|
15
|
+
* - {@link detectPublishGateDrift} — compute whether the configured
|
|
16
|
+
* `LintConfig` weakens any `skill/*` / `pack/*` platform-default-`error`
|
|
17
|
+
* rule (task 5.7).
|
|
18
|
+
* - {@link renderFindingsText} — finding-first human renderer (task
|
|
19
|
+
* 5.6).
|
|
20
|
+
* - {@link toLintJsonDocument} — `--json` document shape (task 5.6).
|
|
21
|
+
* - {@link resolveLintExitCategory} — exit-code contract evaluator (task
|
|
22
|
+
* 5.9).
|
|
23
|
+
*
|
|
24
|
+
* Lint-intent → canonical `Operation` adapter composition happens in the CLI
|
|
25
|
+
* handler (`packages/cli/src/root/lint/handler.ts`), which re-resolves each
|
|
26
|
+
* intent's `source` via the `resolveConfigured*` helpers and hands the
|
|
27
|
+
* resulting canonical Operation to the per-extension plan-step builder. The
|
|
28
|
+
* runner here stays accessor-free.
|
|
29
|
+
*
|
|
30
|
+
* @experimental This API is unstable and may change without notice.
|
|
31
|
+
* @packageDocumentation
|
|
32
|
+
*/
|
|
33
|
+
import * as Effect from "effect/Effect";
|
|
34
|
+
import { composePath } from "./compose-path.js";
|
|
35
|
+
import { platformCanonicalLintConfig } from "./config.js";
|
|
36
|
+
import { evaluateContexts } from "./evaluate.js";
|
|
37
|
+
import { packRules, skillRules, workspaceRules } from "./catalog/index.js";
|
|
38
|
+
// -----------------------------------------------------------------------------
|
|
39
|
+
// Evaluation
|
|
40
|
+
// -----------------------------------------------------------------------------
|
|
41
|
+
/**
|
|
42
|
+
* Build the three v1 evaluation groups concurrently.
|
|
43
|
+
*
|
|
44
|
+
* The evaluator is a pure `Effect.Effect<ReadonlyArray<Evaluated<C>>>`; this
|
|
45
|
+
* helper simply hands the three catalogs to `Effect.all` with unbounded
|
|
46
|
+
* concurrency so catalog evaluations run in parallel but findings stay in
|
|
47
|
+
* stable catalog order inside each group.
|
|
48
|
+
*
|
|
49
|
+
* @experimental This API is unstable and may change without notice.
|
|
50
|
+
*/
|
|
51
|
+
export const evaluateAllCatalogs = (args) => Effect.gen(function* () {
|
|
52
|
+
const [skills, packs, workspace] = yield* Effect.all([
|
|
53
|
+
evaluateContexts(skillRules, args.skillContexts, args.config),
|
|
54
|
+
evaluateContexts(packRules, args.packContexts, args.config),
|
|
55
|
+
evaluateContexts(workspaceRules, [args.workspaceContext], args.config),
|
|
56
|
+
], { concurrency: "unbounded" });
|
|
57
|
+
return { skills, packs, workspace };
|
|
58
|
+
});
|
|
59
|
+
// -----------------------------------------------------------------------------
|
|
60
|
+
// Summary
|
|
61
|
+
// -----------------------------------------------------------------------------
|
|
62
|
+
const severityOrder = (s) => {
|
|
63
|
+
switch (s) {
|
|
64
|
+
case "error":
|
|
65
|
+
return 0;
|
|
66
|
+
case "warning":
|
|
67
|
+
return 1;
|
|
68
|
+
case "info":
|
|
69
|
+
return 2;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const flattenEvaluated = (group, evaluated, getDisplayRoot) => {
|
|
73
|
+
const out = [];
|
|
74
|
+
for (const entry of evaluated) {
|
|
75
|
+
const displayRoot = getDisplayRoot(entry.context);
|
|
76
|
+
for (const finding of entry.findings) {
|
|
77
|
+
out.push({
|
|
78
|
+
group,
|
|
79
|
+
displayRoot,
|
|
80
|
+
path: composePath(displayRoot, finding.location),
|
|
81
|
+
finding,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Flatten a {@link GroupEvaluations} triple into a single `RenderedFinding[]`
|
|
89
|
+
* in stable group-then-catalog order.
|
|
90
|
+
*
|
|
91
|
+
* @experimental This API is unstable and may change without notice.
|
|
92
|
+
*/
|
|
93
|
+
export const collectRenderedFindings = (evaluations) => [
|
|
94
|
+
...flattenEvaluated("skill", evaluations.skills, (c) => c.displayRoot),
|
|
95
|
+
...flattenEvaluated("pack", evaluations.packs, (c) => c.displayRoot),
|
|
96
|
+
...flattenEvaluated("workspace", evaluations.workspace, (c) => c.displayRoot),
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* Count findings by severity across every group.
|
|
100
|
+
*
|
|
101
|
+
* @experimental This API is unstable and may change without notice.
|
|
102
|
+
*/
|
|
103
|
+
export const countFindings = (findings) => {
|
|
104
|
+
let errors = 0;
|
|
105
|
+
let warnings = 0;
|
|
106
|
+
let infos = 0;
|
|
107
|
+
for (const f of findings) {
|
|
108
|
+
switch (f.finding.severity) {
|
|
109
|
+
case "error":
|
|
110
|
+
errors += 1;
|
|
111
|
+
break;
|
|
112
|
+
case "warning":
|
|
113
|
+
warnings += 1;
|
|
114
|
+
break;
|
|
115
|
+
case "info":
|
|
116
|
+
infos += 1;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return { total: findings.length, errors, warnings, infos };
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Derive a full {@link LintSummary} (findings, counts, exit category, drift
|
|
124
|
+
* banner rule ids) from raw evaluations + the configured severity overrides.
|
|
125
|
+
*
|
|
126
|
+
* @experimental This API is unstable and may change without notice.
|
|
127
|
+
*/
|
|
128
|
+
export const summarizeEvaluations = (evaluations, config) => {
|
|
129
|
+
const findings = collectRenderedFindings(evaluations);
|
|
130
|
+
const counts = countFindings(findings);
|
|
131
|
+
return {
|
|
132
|
+
findings,
|
|
133
|
+
counts,
|
|
134
|
+
exitCategory: exitCategoryFromCounts(counts),
|
|
135
|
+
driftBanner: detectPublishGateDrift(config),
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const exitCategoryFromCounts = (counts) => {
|
|
139
|
+
if (counts.errors > 0) {
|
|
140
|
+
return "errors";
|
|
141
|
+
}
|
|
142
|
+
if (counts.warnings > 0) {
|
|
143
|
+
return "warnings";
|
|
144
|
+
}
|
|
145
|
+
return "clean";
|
|
146
|
+
};
|
|
147
|
+
// -----------------------------------------------------------------------------
|
|
148
|
+
// Exit-code contract (task 5.9)
|
|
149
|
+
// -----------------------------------------------------------------------------
|
|
150
|
+
/**
|
|
151
|
+
* Translate a {@link LintExitCategory} + `--strict` into the exit-code
|
|
152
|
+
* policy.
|
|
153
|
+
*
|
|
154
|
+
* | Category | --strict=false | --strict=true |
|
|
155
|
+
* | ------------ | -------------- | ------------- |
|
|
156
|
+
* | `"clean"` | `0` | `0` |
|
|
157
|
+
* | `"warnings"` | `0` | non-zero |
|
|
158
|
+
* | `"errors"` | non-zero | non-zero |
|
|
159
|
+
*
|
|
160
|
+
* The return value is a discriminated enum; the CLI handler maps the `"fail"`
|
|
161
|
+
* branch to its platform exit-code primitive.
|
|
162
|
+
*
|
|
163
|
+
* @experimental This API is unstable and may change without notice.
|
|
164
|
+
*/
|
|
165
|
+
export const resolveLintExitCategory = (args) => {
|
|
166
|
+
switch (args.category) {
|
|
167
|
+
case "errors":
|
|
168
|
+
return "fail";
|
|
169
|
+
case "warnings":
|
|
170
|
+
return args.strict ? "fail" : "success";
|
|
171
|
+
case "clean":
|
|
172
|
+
return "success";
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
// -----------------------------------------------------------------------------
|
|
176
|
+
// Drift banner (task 5.7)
|
|
177
|
+
// -----------------------------------------------------------------------------
|
|
178
|
+
/**
|
|
179
|
+
* Identify every configured `lint.rules` entry that weakens a platform-canonical
|
|
180
|
+
* `error`-severity `skill/*` or `pack/*` rule.
|
|
181
|
+
*
|
|
182
|
+
* The publish gate runs the `skill/*` and `pack/*` catalogs against
|
|
183
|
+
* {@link platformCanonicalLintConfig}; any workspace override that lowers a
|
|
184
|
+
* rule in those namespaces from `error` to `off | info | warn` creates a
|
|
185
|
+
* publish-gate divergence the user should know about (they'll see `error`
|
|
186
|
+
* findings from the registry that don't appear locally).
|
|
187
|
+
*
|
|
188
|
+
* Workspace-only rule weakenings (`workspace/*`) do NOT trigger the banner —
|
|
189
|
+
* those never reach publish.
|
|
190
|
+
*
|
|
191
|
+
* Returns the rule ids that trigger the banner, in catalog order, so the
|
|
192
|
+
* renderer can produce stable deterministic output.
|
|
193
|
+
*
|
|
194
|
+
* @experimental This API is unstable and may change without notice.
|
|
195
|
+
*/
|
|
196
|
+
export const detectPublishGateDrift = (config) => {
|
|
197
|
+
const overrides = config.rules ?? {};
|
|
198
|
+
if (Object.keys(overrides).length === 0) {
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
// Only the `id` and `severity` fields of each rule matter for drift
|
|
202
|
+
// detection — rule-id snapshotting is public API, and severity is the
|
|
203
|
+
// platform canonical default the workspace override weakens. The helper
|
|
204
|
+
// is called against each catalog's concrete rule type so no assertion
|
|
205
|
+
// is needed to widen the generic parameter.
|
|
206
|
+
const weakened = [];
|
|
207
|
+
const visitCatalog = (rules) => {
|
|
208
|
+
for (const rule of rules) {
|
|
209
|
+
if (rule.severity !== "error") {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const override = overrides[rule.id];
|
|
213
|
+
if (override === undefined) {
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (override === "off" || override === "info" || override === "warn") {
|
|
217
|
+
weakened.push(rule.id);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
visitCatalog(skillRules);
|
|
222
|
+
visitCatalog(packRules);
|
|
223
|
+
return weakened;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Render a finding-first human text report.
|
|
227
|
+
*
|
|
228
|
+
* Output shape (one line per entry, grouped first by context type then by
|
|
229
|
+
* severity within each group):
|
|
230
|
+
*
|
|
231
|
+
* DRIFT: The registry will still block publish on these rules:
|
|
232
|
+
* - skill/manifest-schema-valid
|
|
233
|
+
*
|
|
234
|
+
* WORKSPACE
|
|
235
|
+
* [error] workspace/lockfile-valid axm-lock.yaml is missing. ./axm-lock.yaml
|
|
236
|
+
* [warning] workspace/... ...
|
|
237
|
+
*
|
|
238
|
+
* SKILLS
|
|
239
|
+
* [error] ...
|
|
240
|
+
*
|
|
241
|
+
* Summary: 2 errors, 1 warning.
|
|
242
|
+
* Applied 3 fixes; 1 warning surfaced from applyPlan.
|
|
243
|
+
*
|
|
244
|
+
* @experimental This API is unstable and may change without notice.
|
|
245
|
+
*/
|
|
246
|
+
export const renderFindingsText = (args) => {
|
|
247
|
+
const lines = [];
|
|
248
|
+
const { summary, fixSummary } = args;
|
|
249
|
+
if (summary.driftBanner.length > 0) {
|
|
250
|
+
lines.push("DRIFT: The registry will still block publish on these rules:");
|
|
251
|
+
for (const id of summary.driftBanner) {
|
|
252
|
+
lines.push(` - ${id}`);
|
|
253
|
+
}
|
|
254
|
+
lines.push("");
|
|
255
|
+
}
|
|
256
|
+
const groups = [
|
|
257
|
+
{ key: "workspace", label: "WORKSPACE" },
|
|
258
|
+
{ key: "skill", label: "SKILLS" },
|
|
259
|
+
{ key: "pack", label: "PACKS" },
|
|
260
|
+
];
|
|
261
|
+
for (const group of groups) {
|
|
262
|
+
const inGroup = summary.findings.filter((f) => f.group === group.key);
|
|
263
|
+
if (inGroup.length === 0) {
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
const sorted = [...inGroup].sort((a, b) => severityOrder(a.finding.severity) - severityOrder(b.finding.severity));
|
|
267
|
+
lines.push(group.label);
|
|
268
|
+
for (const entry of sorted) {
|
|
269
|
+
lines.push(` [${entry.finding.severity}] ${entry.finding.ruleId} ${entry.finding.message} ${entry.path}`);
|
|
270
|
+
}
|
|
271
|
+
lines.push("");
|
|
272
|
+
}
|
|
273
|
+
if (summary.findings.length === 0 && summary.driftBanner.length === 0) {
|
|
274
|
+
lines.push("No findings.");
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
lines.push(formatCountsSentence(summary.counts));
|
|
278
|
+
}
|
|
279
|
+
if (fixSummary !== undefined) {
|
|
280
|
+
lines.push(formatFixSummary(fixSummary));
|
|
281
|
+
for (const warning of fixSummary.warnings) {
|
|
282
|
+
lines.push(` warning: ${warning}`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return lines;
|
|
286
|
+
};
|
|
287
|
+
const formatCountsSentence = (counts) => {
|
|
288
|
+
const parts = [];
|
|
289
|
+
parts.push(`${counts.errors} ${pluralize(counts.errors, "error", "errors")}`);
|
|
290
|
+
parts.push(`${counts.warnings} ${pluralize(counts.warnings, "warning", "warnings")}`);
|
|
291
|
+
if (counts.infos > 0) {
|
|
292
|
+
parts.push(`${counts.infos} ${pluralize(counts.infos, "info", "infos")}`);
|
|
293
|
+
}
|
|
294
|
+
return `Summary: ${parts.join(", ")}.`;
|
|
295
|
+
};
|
|
296
|
+
const formatFixSummary = (fix) => {
|
|
297
|
+
const appliedLabel = pluralize(fix.applied, "fix", "fixes");
|
|
298
|
+
const warningsLabel = pluralize(fix.warnings.length, "warning", "warnings");
|
|
299
|
+
return `Applied ${fix.applied} ${appliedLabel}; ${fix.warnings.length} ${warningsLabel}, ${fix.failed} failed.`;
|
|
300
|
+
};
|
|
301
|
+
const pluralize = (n, singular, plural) => n === 1 ? singular : plural;
|
|
302
|
+
const toJsonFinding = (entry) => {
|
|
303
|
+
const base = {
|
|
304
|
+
group: entry.group,
|
|
305
|
+
kind: entry.finding.kind,
|
|
306
|
+
ruleId: entry.finding.ruleId,
|
|
307
|
+
severity: entry.finding.severity,
|
|
308
|
+
message: entry.finding.message,
|
|
309
|
+
displayRoot: entry.displayRoot,
|
|
310
|
+
path: entry.path,
|
|
311
|
+
suggestions: [...entry.finding.suggestions],
|
|
312
|
+
};
|
|
313
|
+
if (entry.finding.location === undefined) {
|
|
314
|
+
return base;
|
|
315
|
+
}
|
|
316
|
+
const loc = {
|
|
317
|
+
file: entry.finding.location.file,
|
|
318
|
+
...(entry.finding.location.line !== undefined ? { line: entry.finding.location.line } : {}),
|
|
319
|
+
...(entry.finding.location.column !== undefined
|
|
320
|
+
? { column: entry.finding.location.column }
|
|
321
|
+
: {}),
|
|
322
|
+
};
|
|
323
|
+
return { ...base, location: loc };
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Build the `--json` document from a {@link LintSummary} (+ optional fix
|
|
327
|
+
* summary).
|
|
328
|
+
*
|
|
329
|
+
* @experimental This API is unstable and may change without notice.
|
|
330
|
+
*/
|
|
331
|
+
export const toLintJsonDocument = (args) => {
|
|
332
|
+
const { summary, fixSummary } = args;
|
|
333
|
+
const base = {
|
|
334
|
+
findings: summary.findings.map(toJsonFinding),
|
|
335
|
+
summary: {
|
|
336
|
+
total: summary.counts.total,
|
|
337
|
+
errors: summary.counts.errors,
|
|
338
|
+
warnings: summary.counts.warnings,
|
|
339
|
+
infos: summary.counts.infos,
|
|
340
|
+
exitCategory: summary.exitCategory,
|
|
341
|
+
},
|
|
342
|
+
driftBanner: summary.driftBanner,
|
|
343
|
+
};
|
|
344
|
+
if (fixSummary === undefined) {
|
|
345
|
+
return base;
|
|
346
|
+
}
|
|
347
|
+
return {
|
|
348
|
+
...base,
|
|
349
|
+
fix: {
|
|
350
|
+
attempted: fixSummary.attempted,
|
|
351
|
+
applied: fixSummary.applied,
|
|
352
|
+
failed: fixSummary.failed,
|
|
353
|
+
warnings: fixSummary.warnings,
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
// -----------------------------------------------------------------------------
|
|
358
|
+
// Autofix rule surface (helper for the CLI handler)
|
|
359
|
+
// -----------------------------------------------------------------------------
|
|
360
|
+
/**
|
|
361
|
+
* Walk workspace evaluations (the only v1 namespace that ships
|
|
362
|
+
* `AutofixingRule`s) and return the set of `(rule, finding, context)` triples
|
|
363
|
+
* the CLI handler can dispatch on to produce canonical Operations.
|
|
364
|
+
*
|
|
365
|
+
* The returned triples point at the already-evaluated `AutofixableFinding`
|
|
366
|
+
* values so the renderer and the fix pipeline share a single source of truth.
|
|
367
|
+
*
|
|
368
|
+
* @experimental This API is unstable and may change without notice.
|
|
369
|
+
*/
|
|
370
|
+
export const collectAutofixableEntries = (evaluations) => {
|
|
371
|
+
const out = [];
|
|
372
|
+
for (const entry of evaluations.workspace) {
|
|
373
|
+
if (entry.rule.kind !== "autofixing") {
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
for (const finding of entry.findings) {
|
|
377
|
+
if (finding.kind === "autofixable") {
|
|
378
|
+
out.push({ rule: entry.rule, context: entry.context, finding });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return out;
|
|
383
|
+
};
|
|
384
|
+
// -----------------------------------------------------------------------------
|
|
385
|
+
// Re-exports that CLI callers use alongside the runner
|
|
386
|
+
// -----------------------------------------------------------------------------
|
|
387
|
+
export { platformCanonicalLintConfig };
|
|
388
|
+
//# sourceMappingURL=cli.js.map
|