@fantasticit/sumi 0.0.0-stage → 0.5.0
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/README.md +81 -2
- package/dist/adapters.d.ts +86 -0
- package/dist/adapters.js +469 -0
- package/dist/adapters.js.map +1 -0
- package/dist/agent-hooks.d.ts +15 -0
- package/dist/agent-hooks.js +63 -0
- package/dist/agent-hooks.js.map +1 -0
- package/dist/agents.d.ts +1 -0
- package/dist/agents.js +139 -0
- package/dist/agents.js.map +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +21 -0
- package/dist/bin.js.map +1 -0
- package/dist/build-identity.d.ts +7 -0
- package/dist/build-identity.js +55 -0
- package/dist/build-identity.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.js +150 -0
- package/dist/cli.js.map +1 -0
- package/dist/context.d.ts +1 -0
- package/dist/context.js +117 -0
- package/dist/context.js.map +1 -0
- package/dist/fix.d.ts +1 -0
- package/dist/fix.js +51 -0
- package/dist/fix.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/instructions.d.ts +31 -0
- package/dist/instructions.js +150 -0
- package/dist/instructions.js.map +1 -0
- package/dist/launcher-entry.d.ts +1 -0
- package/dist/launcher-entry.js +8 -0
- package/dist/launcher-entry.js.map +1 -0
- package/dist/launcher.cjs +10606 -0
- package/dist/launcher.d.ts +3 -0
- package/dist/launcher.js +117 -0
- package/dist/launcher.js.map +1 -0
- package/dist/runtime-manifest.d.ts +29 -0
- package/dist/runtime-manifest.js +75 -0
- package/dist/runtime-manifest.js.map +1 -0
- package/dist/runtime-package.d.ts +10 -0
- package/dist/runtime-package.js +66 -0
- package/dist/runtime-package.js.map +1 -0
- package/dist/scaffold-commands.d.ts +3 -0
- package/dist/scaffold-commands.js +214 -0
- package/dist/scaffold-commands.js.map +1 -0
- package/dist/vendor.d.ts +1 -0
- package/dist/vendor.js +260 -0
- package/dist/vendor.js.map +1 -0
- package/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
- package/node_modules/@isaacs/fs-minipass/README.md +71 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +118 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +118 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/fs-minipass/package.json +72 -0
- package/node_modules/@sumi/create/README.md +77 -0
- package/node_modules/@sumi/create/dist/index.d.ts +1 -0
- package/node_modules/@sumi/create/dist/index.js +2 -0
- package/node_modules/@sumi/create/dist/index.js.map +1 -0
- package/node_modules/@sumi/create/dist/scaffold.d.ts +29 -0
- package/node_modules/@sumi/create/dist/scaffold.js +134 -0
- package/node_modules/@sumi/create/dist/scaffold.js.map +1 -0
- package/node_modules/@sumi/create/package.json +22 -0
- package/node_modules/@sumi/create/template/.gitattributes +1 -0
- package/node_modules/@sumi/create/template/.prettierignore +5 -0
- package/node_modules/@sumi/create/template/.prettierrc +1 -0
- package/node_modules/@sumi/create/template/AGENTS.md +28 -0
- package/node_modules/@sumi/create/template/control/baselines/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/control/config.yaml +59 -0
- package/node_modules/@sumi/create/template/control/decisions/0001-config-module.md +15 -0
- package/node_modules/@sumi/create/template/control/flows/change.flow.yaml +14 -0
- package/node_modules/@sumi/create/template/control/flows/check.flow.yaml +25 -0
- package/node_modules/@sumi/create/template/control/plugins/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/control/rubrics/architecture.yaml +14 -0
- package/node_modules/@sumi/create/template/eslint.config.mjs +9 -0
- package/node_modules/@sumi/create/template/gitignore +4 -0
- package/node_modules/@sumi/create/template/init/AGENTS.md +27 -0
- package/node_modules/@sumi/create/template/init/control/baselines/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/init/control/flows/check.flow.yaml +20 -0
- package/node_modules/@sumi/create/template/init/control/plugins/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/init/control/rubrics/architecture.yaml +14 -0
- package/node_modules/@sumi/create/template/init/openspec/changes/archive/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/init/openspec/config.yaml +1 -0
- package/node_modules/@sumi/create/template/init/openspec/specs/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/init/precedents/registry.yaml +1 -0
- package/node_modules/@sumi/create/template/openspec/changes/archive/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/openspec/config.yaml +1 -0
- package/node_modules/@sumi/create/template/openspec/specs/.gitkeep +0 -0
- package/node_modules/@sumi/create/template/package.json +21 -0
- package/node_modules/@sumi/create/template/precedents/no-env-in-business/check.mjs +36 -0
- package/node_modules/@sumi/create/template/precedents/no-env-in-business/fixtures/compliant/src/a.ts +3 -0
- package/node_modules/@sumi/create/template/precedents/no-env-in-business/fixtures/violating/src/a.ts +1 -0
- package/node_modules/@sumi/create/template/precedents/no-env-in-business/precedent.yaml +9 -0
- package/node_modules/@sumi/create/template/precedents/registry.yaml +3 -0
- package/node_modules/@sumi/create/template/src/config.ts +4 -0
- package/node_modules/@sumi/create/template/src/index.test.ts +6 -0
- package/node_modules/@sumi/create/template/src/index.ts +5 -0
- package/node_modules/@sumi/create/template/tsconfig.json +12 -0
- package/node_modules/@sumi/kernel/README.md +128 -0
- package/node_modules/@sumi/kernel/dist/brief.d.ts +41 -0
- package/node_modules/@sumi/kernel/dist/brief.js +82 -0
- package/node_modules/@sumi/kernel/dist/brief.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/config.d.ts +40 -0
- package/node_modules/@sumi/kernel/dist/config.js +94 -0
- package/node_modules/@sumi/kernel/dist/config.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/engine.d.ts +33 -0
- package/node_modules/@sumi/kernel/dist/engine.js +242 -0
- package/node_modules/@sumi/kernel/dist/engine.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/errors.d.ts +5 -0
- package/node_modules/@sumi/kernel/dist/errors.js +9 -0
- package/node_modules/@sumi/kernel/dist/errors.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/flow.d.ts +37 -0
- package/node_modules/@sumi/kernel/dist/flow.js +132 -0
- package/node_modules/@sumi/kernel/dist/flow.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/index.d.ts +10 -0
- package/node_modules/@sumi/kernel/dist/index.js +11 -0
- package/node_modules/@sumi/kernel/dist/index.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/plan.d.ts +21 -0
- package/node_modules/@sumi/kernel/dist/plan.js +68 -0
- package/node_modules/@sumi/kernel/dist/plan.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/record.d.ts +31 -0
- package/node_modules/@sumi/kernel/dist/record.js +54 -0
- package/node_modules/@sumi/kernel/dist/record.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/registry.d.ts +32 -0
- package/node_modules/@sumi/kernel/dist/registry.js +126 -0
- package/node_modules/@sumi/kernel/dist/registry.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/runner.d.ts +15 -0
- package/node_modules/@sumi/kernel/dist/runner.js +101 -0
- package/node_modules/@sumi/kernel/dist/runner.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/scope.d.ts +29 -0
- package/node_modules/@sumi/kernel/dist/scope.js +132 -0
- package/node_modules/@sumi/kernel/dist/scope.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/testing.d.ts +7 -0
- package/node_modules/@sumi/kernel/dist/testing.js +32 -0
- package/node_modules/@sumi/kernel/dist/testing.js.map +1 -0
- package/node_modules/@sumi/kernel/dist/windows-process.d.ts +1 -0
- package/node_modules/@sumi/kernel/dist/windows-process.js +90 -0
- package/node_modules/@sumi/kernel/dist/windows-process.js.map +1 -0
- package/node_modules/@sumi/kernel/package.json +20 -0
- package/node_modules/@sumi/kernel/test/fixtures/fake-plugin.mjs +44 -0
- package/node_modules/@sumi/kernel/test/fixtures/py-plugin.py +3 -0
- package/node_modules/@sumi/plugin-sdk/README.md +144 -0
- package/node_modules/@sumi/plugin-sdk/dist/env.d.ts +5 -0
- package/node_modules/@sumi/plugin-sdk/dist/env.js +30 -0
- package/node_modules/@sumi/plugin-sdk/dist/env.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/git.d.ts +7 -0
- package/node_modules/@sumi/plugin-sdk/dist/git.js +19 -0
- package/node_modules/@sumi/plugin-sdk/dist/git.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/index.d.ts +9 -0
- package/node_modules/@sumi/plugin-sdk/dist/index.js +10 -0
- package/node_modules/@sumi/plugin-sdk/dist/index.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/process.d.ts +7 -0
- package/node_modules/@sumi/plugin-sdk/dist/process.js +13 -0
- package/node_modules/@sumi/plugin-sdk/dist/process.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/project.d.ts +9 -0
- package/node_modules/@sumi/plugin-sdk/dist/project.js +55 -0
- package/node_modules/@sumi/plugin-sdk/dist/project.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/protocol.d.ts +200 -0
- package/node_modules/@sumi/plugin-sdk/dist/protocol.js +36 -0
- package/node_modules/@sumi/plugin-sdk/dist/protocol.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/rules.d.ts +17 -0
- package/node_modules/@sumi/plugin-sdk/dist/rules.js +16 -0
- package/node_modules/@sumi/plugin-sdk/dist/rules.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/sdk.d.ts +12 -0
- package/node_modules/@sumi/plugin-sdk/dist/sdk.js +51 -0
- package/node_modules/@sumi/plugin-sdk/dist/sdk.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/tool-batches.d.ts +11 -0
- package/node_modules/@sumi/plugin-sdk/dist/tool-batches.js +41 -0
- package/node_modules/@sumi/plugin-sdk/dist/tool-batches.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/dist/validate.d.ts +8 -0
- package/node_modules/@sumi/plugin-sdk/dist/validate.js +221 -0
- package/node_modules/@sumi/plugin-sdk/dist/validate.js.map +1 -0
- package/node_modules/@sumi/plugin-sdk/package.json +18 -0
- package/node_modules/@sumi/plugins-core/README.md +105 -0
- package/node_modules/@sumi/plugins-core/dist/baseline.d.ts +34 -0
- package/node_modules/@sumi/plugins-core/dist/baseline.js +54 -0
- package/node_modules/@sumi/plugins-core/dist/baseline.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/commands/adopt.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/commands/adopt.js +182 -0
- package/node_modules/@sumi/plugins-core/dist/commands/adopt.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/commands/baseline.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/commands/baseline.js +56 -0
- package/node_modules/@sumi/plugins-core/dist/commands/baseline.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/fix/format.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/fix/format.js +4 -0
- package/node_modules/@sumi/plugins-core/dist/fix/format.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/fix/lint.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/fix/lint.js +4 -0
- package/node_modules/@sumi/plugins-core/dist/fix/lint.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/index.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/index.js +2 -0
- package/node_modules/@sumi/plugins-core/dist/index.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/lib.d.ts +34 -0
- package/node_modules/@sumi/plugins-core/dist/lib.js +113 -0
- package/node_modules/@sumi/plugins-core/dist/lib.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/agent-drift.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/agent-drift.js +32 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/agent-drift.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/control-docs.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/control-docs.js +109 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/control-docs.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/coverage.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/coverage.js +107 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/coverage.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/exec.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/exec.js +69 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/exec.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/format.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/format.js +41 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/format.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/layer-boundary.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/layer-boundary.js +87 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/layer-boundary.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/lint.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/lint.js +91 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/lint.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/ratchet.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/ratchet.js +83 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/ratchet.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/test-affected.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/test-affected.js +82 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/test-affected.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/typecheck.d.ts +1 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/typecheck.js +31 -0
- package/node_modules/@sumi/plugins-core/dist/plugins/typecheck.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/testing.d.ts +13 -0
- package/node_modules/@sumi/plugins-core/dist/testing.js +47 -0
- package/node_modules/@sumi/plugins-core/dist/testing.js.map +1 -0
- package/node_modules/@sumi/plugins-core/dist/tool-batches.d.ts +11 -0
- package/node_modules/@sumi/plugins-core/dist/tool-batches.js +41 -0
- package/node_modules/@sumi/plugins-core/dist/tool-batches.js.map +1 -0
- package/node_modules/@sumi/plugins-core/instructions/adopt.md +37 -0
- package/node_modules/@sumi/plugins-core/package.json +25 -0
- package/node_modules/@sumi/plugins-core/sumi-plugins.yaml +80 -0
- package/node_modules/@sumi/plugins-governance/README.md +159 -0
- package/node_modules/@sumi/plugins-governance/dist/checkout.d.ts +45 -0
- package/node_modules/@sumi/plugins-governance/dist/checkout.js +138 -0
- package/node_modules/@sumi/plugins-governance/dist/checkout.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/approve.d.ts +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/approve.js +27 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/approve.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/gate.d.ts +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/gate.js +167 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/gate.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/guard.d.ts +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/guard.js +27 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/guard.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/pr-report-check.d.ts +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/pr-report-check.js +8 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/pr-report-check.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/pr-report.d.ts +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/pr-report.js +128 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/pr-report.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/unlock.d.ts +1 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/unlock.js +21 -0
- package/node_modules/@sumi/plugins-governance/dist/commands/unlock.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/guard.d.ts +19 -0
- package/node_modules/@sumi/plugins-governance/dist/guard.js +173 -0
- package/node_modules/@sumi/plugins-governance/dist/guard.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/index.d.ts +4 -0
- package/node_modules/@sumi/plugins-governance/dist/index.js +5 -0
- package/node_modules/@sumi/plugins-governance/dist/index.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/plugins/protected-paths.d.ts +1 -0
- package/node_modules/@sumi/plugins-governance/dist/plugins/protected-paths.js +31 -0
- package/node_modules/@sumi/plugins-governance/dist/plugins/protected-paths.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-base.d.ts +19 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-base.js +49 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-base.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.d.ts +4 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.js +11 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-report-markers.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-report-status.d.ts +14 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-report-status.js +97 -0
- package/node_modules/@sumi/plugins-governance/dist/pr-report-status.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/protected.d.ts +22 -0
- package/node_modules/@sumi/plugins-governance/dist/protected.js +65 -0
- package/node_modules/@sumi/plugins-governance/dist/protected.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/push-base.d.ts +9 -0
- package/node_modules/@sumi/plugins-governance/dist/push-base.js +42 -0
- package/node_modules/@sumi/plugins-governance/dist/push-base.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/semantic.d.ts +5 -0
- package/node_modules/@sumi/plugins-governance/dist/semantic.js +105 -0
- package/node_modules/@sumi/plugins-governance/dist/semantic.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/dist/state.d.ts +48 -0
- package/node_modules/@sumi/plugins-governance/dist/state.js +155 -0
- package/node_modules/@sumi/plugins-governance/dist/state.js.map +1 -0
- package/node_modules/@sumi/plugins-governance/instructions/push.md +20 -0
- package/node_modules/@sumi/plugins-governance/package.json +25 -0
- package/node_modules/@sumi/plugins-governance/sumi-plugins.yaml +23 -0
- package/node_modules/@sumi/plugins-openspec/README.md +80 -0
- package/node_modules/@sumi/plugins-openspec/dist/index.d.ts +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/index.js +2 -0
- package/node_modules/@sumi/plugins-openspec/dist/index.js.map +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/openspec.d.ts +21 -0
- package/node_modules/@sumi/plugins-openspec/dist/openspec.js +59 -0
- package/node_modules/@sumi/plugins-openspec/dist/openspec.js.map +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/change-tasks.d.ts +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/change-tasks.js +85 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/change-tasks.js.map +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/planner.d.ts +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/planner.js +16 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/planner.js.map +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/validate.d.ts +1 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/validate.js +45 -0
- package/node_modules/@sumi/plugins-openspec/dist/plugins/validate.js.map +1 -0
- package/node_modules/@sumi/plugins-openspec/package.json +22 -0
- package/node_modules/@sumi/plugins-openspec/sumi-plugins.yaml +20 -0
- package/node_modules/@sumi/plugins-precedent/README.md +162 -0
- package/node_modules/@sumi/plugins-precedent/dist/candidates.d.ts +17 -0
- package/node_modules/@sumi/plugins-precedent/dist/candidates.js +18 -0
- package/node_modules/@sumi/plugins-precedent/dist/candidates.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/commands/context.d.ts +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/commands/context.js +23 -0
- package/node_modules/@sumi/plugins-precedent/dist/commands/context.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/commands/promote.d.ts +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/commands/promote.js +89 -0
- package/node_modules/@sumi/plugins-precedent/dist/commands/promote.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/index.d.ts +2 -0
- package/node_modules/@sumi/plugins-precedent/dist/index.js +3 -0
- package/node_modules/@sumi/plugins-precedent/dist/index.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/model.d.ts +65 -0
- package/node_modules/@sumi/plugins-precedent/dist/model.js +150 -0
- package/node_modules/@sumi/plugins-precedent/dist/model.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/checker.d.ts +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/checker.js +32 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/checker.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/harvest.d.ts +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/harvest.js +174 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/harvest.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/planner.d.ts +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/planner.js +103 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/planner.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/selftest.d.ts +1 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/selftest.js +220 -0
- package/node_modules/@sumi/plugins-precedent/dist/plugins/selftest.js.map +1 -0
- package/node_modules/@sumi/plugins-precedent/instructions/distill.md +12 -0
- package/node_modules/@sumi/plugins-precedent/package.json +26 -0
- package/node_modules/@sumi/plugins-precedent/sumi-plugins.yaml +33 -0
- package/node_modules/@sumi/plugins-review/README.md +131 -0
- package/node_modules/@sumi/plugins-review/dist/commands/context.d.ts +1 -0
- package/node_modules/@sumi/plugins-review/dist/commands/context.js +32 -0
- package/node_modules/@sumi/plugins-review/dist/commands/context.js.map +1 -0
- package/node_modules/@sumi/plugins-review/dist/commands/submit.d.ts +1 -0
- package/node_modules/@sumi/plugins-review/dist/commands/submit.js +46 -0
- package/node_modules/@sumi/plugins-review/dist/commands/submit.js.map +1 -0
- package/node_modules/@sumi/plugins-review/dist/index.d.ts +1 -0
- package/node_modules/@sumi/plugins-review/dist/index.js +2 -0
- package/node_modules/@sumi/plugins-review/dist/index.js.map +1 -0
- package/node_modules/@sumi/plugins-review/dist/plugins/rubric.d.ts +1 -0
- package/node_modules/@sumi/plugins-review/dist/plugins/rubric.js +116 -0
- package/node_modules/@sumi/plugins-review/dist/plugins/rubric.js.map +1 -0
- package/node_modules/@sumi/plugins-review/dist/review.d.ts +64 -0
- package/node_modules/@sumi/plugins-review/dist/review.js +104 -0
- package/node_modules/@sumi/plugins-review/dist/review.js.map +1 -0
- package/node_modules/@sumi/plugins-review/package.json +25 -0
- package/node_modules/@sumi/plugins-review/sumi-plugins.yaml +13 -0
- package/node_modules/chownr/LICENSE.md +63 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
- package/node_modules/chownr/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/node_modules/chownr/dist/commonjs/index.js.map +1 -0
- package/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/node_modules/chownr/dist/esm/index.d.ts +3 -0
- package/node_modules/chownr/dist/esm/index.d.ts.map +1 -0
- package/node_modules/chownr/dist/esm/index.js +85 -0
- package/node_modules/chownr/dist/esm/index.js.map +1 -0
- package/node_modules/chownr/dist/esm/package.json +3 -0
- package/node_modules/chownr/package.json +69 -0
- package/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/cross-spawn/README.md +89 -0
- package/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/cross-spawn/lib/parse.js +91 -0
- package/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/node_modules/cross-spawn/package.json +73 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/minipass/LICENSE.md +55 -0
- package/node_modules/minipass/README.md +825 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/node_modules/minipass/dist/esm/index.d.ts +545 -0
- package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/esm/index.js +1020 -0
- package/node_modules/minipass/dist/esm/index.js.map +1 -0
- package/node_modules/minipass/dist/esm/package.json +3 -0
- package/node_modules/minipass/package.json +77 -0
- package/node_modules/minizlib/LICENSE +26 -0
- package/node_modules/minizlib/README.md +64 -0
- package/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
- package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +1 -0
- package/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/node_modules/minizlib/dist/commonjs/constants.js.map +1 -0
- package/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
- package/node_modules/minizlib/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/node_modules/minizlib/dist/commonjs/index.js.map +1 -0
- package/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
- package/node_modules/minizlib/dist/esm/constants.d.ts.map +1 -0
- package/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/node_modules/minizlib/dist/esm/constants.js.map +1 -0
- package/node_modules/minizlib/dist/esm/index.d.ts +99 -0
- package/node_modules/minizlib/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minizlib/dist/esm/index.js +363 -0
- package/node_modules/minizlib/dist/esm/index.js.map +1 -0
- package/node_modules/minizlib/dist/esm/package.json +3 -0
- package/node_modules/minizlib/package.json +80 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/license +9 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +61 -0
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +743 -0
- package/node_modules/picomatch/index.js +17 -0
- package/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/picomatch/package.json +83 -0
- package/node_modules/picomatch/posix.js +3 -0
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/shebang-command/readme.md +34 -0
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +9 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/tar/LICENSE.md +55 -0
- package/node_modules/tar/README.md +1233 -0
- package/node_modules/tar/dist/commonjs/create.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/create.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/create.js +82 -0
- package/node_modules/tar/dist/commonjs/create.js.map +1 -0
- package/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
- package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/node_modules/tar/dist/commonjs/cwd-error.js.map +1 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/node_modules/tar/dist/commonjs/extract.js.map +1 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.js.map +1 -0
- package/node_modules/tar/dist/commonjs/header.d.ts +53 -0
- package/node_modules/tar/dist/commonjs/header.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/header.js +348 -0
- package/node_modules/tar/dist/commonjs/header.js.map +1 -0
- package/node_modules/tar/dist/commonjs/index.d.ts +20 -0
- package/node_modules/tar/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/index.js +64 -0
- package/node_modules/tar/dist/commonjs/index.js.map +1 -0
- package/node_modules/tar/dist/commonjs/index.min.js +4 -0
- package/node_modules/tar/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/node_modules/tar/dist/commonjs/large-numbers.js.map +1 -0
- package/node_modules/tar/dist/commonjs/list.d.ts +7 -0
- package/node_modules/tar/dist/commonjs/list.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/list.js +153 -0
- package/node_modules/tar/dist/commonjs/list.js.map +1 -0
- package/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
- package/node_modules/tar/dist/commonjs/make-command.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/node_modules/tar/dist/commonjs/make-command.js.map +1 -0
- package/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
- package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/node_modules/tar/dist/commonjs/mkdir.js.map +1 -0
- package/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/node_modules/tar/dist/commonjs/mode-fix.js.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +1 -0
- package/node_modules/tar/dist/commonjs/options.d.ts +604 -0
- package/node_modules/tar/dist/commonjs/options.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/options.js +66 -0
- package/node_modules/tar/dist/commonjs/options.js.map +1 -0
- package/node_modules/tar/dist/commonjs/pack.d.ts +105 -0
- package/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/pack.js +544 -0
- package/node_modules/tar/dist/commonjs/pack.js.map +1 -0
- package/node_modules/tar/dist/commonjs/package.json +3 -0
- package/node_modules/tar/dist/commonjs/parse.d.ts +92 -0
- package/node_modules/tar/dist/commonjs/parse.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/parse.js +655 -0
- package/node_modules/tar/dist/commonjs/parse.js.map +1 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/node_modules/tar/dist/commonjs/path-reservations.js.map +1 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/pax.js +182 -0
- package/node_modules/tar/dist/commonjs/pax.js.map +1 -0
- package/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/node_modules/tar/dist/commonjs/process-umask.js.map +1 -0
- package/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
- package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/node_modules/tar/dist/commonjs/read-entry.js.map +1 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/node_modules/tar/dist/commonjs/replace.js.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +1 -0
- package/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
- package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/node_modules/tar/dist/commonjs/symlink-error.js.map +1 -0
- package/node_modules/tar/dist/commonjs/types.d.ts +16 -0
- package/node_modules/tar/dist/commonjs/types.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/types.js +70 -0
- package/node_modules/tar/dist/commonjs/types.js.map +1 -0
- package/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
- package/node_modules/tar/dist/commonjs/unpack.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/node_modules/tar/dist/commonjs/unpack.js.map +1 -0
- package/node_modules/tar/dist/commonjs/update.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/update.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/update.js +33 -0
- package/node_modules/tar/dist/commonjs/update.js.map +1 -0
- package/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
- package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/node_modules/tar/dist/commonjs/warn-method.js.map +1 -0
- package/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/winchars.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/node_modules/tar/dist/commonjs/winchars.js.map +1 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/node_modules/tar/dist/commonjs/write-entry.js.map +1 -0
- package/node_modules/tar/dist/esm/create.d.ts +3 -0
- package/node_modules/tar/dist/esm/create.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/create.js +76 -0
- package/node_modules/tar/dist/esm/create.js.map +1 -0
- package/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
- package/node_modules/tar/dist/esm/cwd-error.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/node_modules/tar/dist/esm/cwd-error.js.map +1 -0
- package/node_modules/tar/dist/esm/extract.d.ts +3 -0
- package/node_modules/tar/dist/esm/extract.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/extract.js +49 -0
- package/node_modules/tar/dist/esm/extract.js.map +1 -0
- package/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
- package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/node_modules/tar/dist/esm/get-write-flag.js.map +1 -0
- package/node_modules/tar/dist/esm/header.d.ts +53 -0
- package/node_modules/tar/dist/esm/header.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/header.js +311 -0
- package/node_modules/tar/dist/esm/header.js.map +1 -0
- package/node_modules/tar/dist/esm/index.d.ts +20 -0
- package/node_modules/tar/dist/esm/index.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/index.js +20 -0
- package/node_modules/tar/dist/esm/index.js.map +1 -0
- package/node_modules/tar/dist/esm/index.min.js +4 -0
- package/node_modules/tar/dist/esm/index.min.js.map +7 -0
- package/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
- package/node_modules/tar/dist/esm/large-numbers.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/node_modules/tar/dist/esm/large-numbers.js.map +1 -0
- package/node_modules/tar/dist/esm/list.d.ts +7 -0
- package/node_modules/tar/dist/esm/list.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/list.js +113 -0
- package/node_modules/tar/dist/esm/list.js.map +1 -0
- package/node_modules/tar/dist/esm/make-command.d.ts +49 -0
- package/node_modules/tar/dist/esm/make-command.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/make-command.js +48 -0
- package/node_modules/tar/dist/esm/make-command.js.map +1 -0
- package/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
- package/node_modules/tar/dist/esm/mkdir.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/node_modules/tar/dist/esm/mkdir.js.map +1 -0
- package/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
- package/node_modules/tar/dist/esm/mode-fix.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/node_modules/tar/dist/esm/mode-fix.js.map +1 -0
- package/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
- package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/node_modules/tar/dist/esm/normalize-unicode.js.map +1 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.js.map +1 -0
- package/node_modules/tar/dist/esm/options.d.ts +604 -0
- package/node_modules/tar/dist/esm/options.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/options.js +54 -0
- package/node_modules/tar/dist/esm/options.js.map +1 -0
- package/node_modules/tar/dist/esm/pack.d.ts +105 -0
- package/node_modules/tar/dist/esm/pack.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/pack.js +502 -0
- package/node_modules/tar/dist/esm/pack.js.map +1 -0
- package/node_modules/tar/dist/esm/package.json +3 -0
- package/node_modules/tar/dist/esm/parse.d.ts +92 -0
- package/node_modules/tar/dist/esm/parse.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/parse.js +651 -0
- package/node_modules/tar/dist/esm/parse.js.map +1 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/node_modules/tar/dist/esm/path-reservations.js.map +1 -0
- package/node_modules/tar/dist/esm/pax.d.ts +26 -0
- package/node_modules/tar/dist/esm/pax.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/pax.js +178 -0
- package/node_modules/tar/dist/esm/pax.js.map +1 -0
- package/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
- package/node_modules/tar/dist/esm/process-umask.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/node_modules/tar/dist/esm/process-umask.js.map +1 -0
- package/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
- package/node_modules/tar/dist/esm/read-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/node_modules/tar/dist/esm/read-entry.js.map +1 -0
- package/node_modules/tar/dist/esm/replace.d.ts +2 -0
- package/node_modules/tar/dist/esm/replace.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/replace.js +221 -0
- package/node_modules/tar/dist/esm/replace.js.map +1 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js.map +1 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +1 -0
- package/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
- package/node_modules/tar/dist/esm/symlink-error.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/node_modules/tar/dist/esm/symlink-error.js.map +1 -0
- package/node_modules/tar/dist/esm/types.d.ts +16 -0
- package/node_modules/tar/dist/esm/types.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/types.js +65 -0
- package/node_modules/tar/dist/esm/types.js.map +1 -0
- package/node_modules/tar/dist/esm/unpack.d.ts +101 -0
- package/node_modules/tar/dist/esm/unpack.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/unpack.js +891 -0
- package/node_modules/tar/dist/esm/unpack.js.map +1 -0
- package/node_modules/tar/dist/esm/update.d.ts +2 -0
- package/node_modules/tar/dist/esm/update.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/update.js +30 -0
- package/node_modules/tar/dist/esm/update.js.map +1 -0
- package/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
- package/node_modules/tar/dist/esm/warn-method.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/node_modules/tar/dist/esm/warn-method.js.map +1 -0
- package/node_modules/tar/dist/esm/winchars.d.ts +3 -0
- package/node_modules/tar/dist/esm/winchars.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/winchars.js +9 -0
- package/node_modules/tar/dist/esm/winchars.js.map +1 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/node_modules/tar/dist/esm/write-entry.js.map +1 -0
- package/node_modules/tar/package.json +298 -0
- package/node_modules/which/LICENSE +15 -0
- package/node_modules/which/README.md +54 -0
- package/node_modules/which/bin/node-which +52 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/node_modules/yallist/LICENSE.md +63 -0
- package/node_modules/yallist/README.md +205 -0
- package/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
- package/node_modules/yallist/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/node_modules/yallist/dist/commonjs/index.js.map +1 -0
- package/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/node_modules/yallist/dist/esm/index.d.ts +39 -0
- package/node_modules/yallist/dist/esm/index.d.ts.map +1 -0
- package/node_modules/yallist/dist/esm/index.js +379 -0
- package/node_modules/yallist/dist/esm/index.js.map +1 -0
- package/node_modules/yallist/dist/esm/package.json +3 -0
- package/node_modules/yallist/package.json +68 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +226 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +228 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +120 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +44 -4
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
3
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
4
|
+
import { commandFileNames, configFile, spawnCommandSync, splitFileArguments } from '@sumi/plugin-sdk';
|
|
5
|
+
import { parse } from 'yaml';
|
|
6
|
+
/**
|
|
7
|
+
* 查找项目工具:优先步骤配置 binDir,其次从仓库根向上查找 node_modules/.bin。
|
|
8
|
+
* 工具版本属于项目,插件不自带。
|
|
9
|
+
*/
|
|
10
|
+
export function findTool(ctx, name) {
|
|
11
|
+
const binDir = ctx.config.binDir;
|
|
12
|
+
if (typeof binDir === 'string') {
|
|
13
|
+
for (const file of commandFileNames(name)) {
|
|
14
|
+
const candidate = resolve(ctx.repoRoot, binDir, file);
|
|
15
|
+
if (existsSync(candidate))
|
|
16
|
+
return candidate;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return findProjectTool(ctx.repoRoot, name);
|
|
20
|
+
}
|
|
21
|
+
/** 从目录向上查找 node_modules/.bin 中的项目工具。检查与修复共用,保证两者用的是同一个工具。 */
|
|
22
|
+
export function findProjectTool(root, name, platform = process.platform) {
|
|
23
|
+
let dir = root;
|
|
24
|
+
for (;;) {
|
|
25
|
+
for (const file of commandFileNames(name, platform)) {
|
|
26
|
+
const candidate = join(dir, 'node_modules', '.bin', file);
|
|
27
|
+
if (existsSync(candidate))
|
|
28
|
+
return candidate;
|
|
29
|
+
}
|
|
30
|
+
const parent = dirname(dir);
|
|
31
|
+
if (parent === dir)
|
|
32
|
+
return null;
|
|
33
|
+
dir = parent;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** 修复命令的入口:用项目自己的工具处理步骤检查过的文件(没有文件时处理全仓)。 */
|
|
37
|
+
export function runFix(tool, args) {
|
|
38
|
+
const files = process.argv.slice(2);
|
|
39
|
+
const bin = findProjectTool(process.cwd(), tool);
|
|
40
|
+
if (!bin) {
|
|
41
|
+
process.stderr.write(`未找到 ${tool},请先在项目中安装依赖(例如 pnpm install)\n`);
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let batches;
|
|
46
|
+
try {
|
|
47
|
+
batches = splitFileArguments(bin, args, files.length ? files : ['.']);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
let failed = false;
|
|
55
|
+
for (const batch of batches) {
|
|
56
|
+
const r = spawnCommandSync(bin, [...args, ...batch], { stdio: 'inherit', windowsHide: true });
|
|
57
|
+
if (r.error)
|
|
58
|
+
process.stderr.write(`无法运行 ${bin}:${r.error.message}\n`);
|
|
59
|
+
if (r.error || r.status !== 0)
|
|
60
|
+
failed = true;
|
|
61
|
+
}
|
|
62
|
+
process.exitCode = failed ? 1 : 0;
|
|
63
|
+
}
|
|
64
|
+
export function runTool(ctx, cmd, args, input, env) {
|
|
65
|
+
const r = spawnCommandSync(cmd, args, {
|
|
66
|
+
cwd: ctx.repoRoot,
|
|
67
|
+
encoding: 'utf8',
|
|
68
|
+
input,
|
|
69
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
70
|
+
env: env ?? process.env,
|
|
71
|
+
windowsHide: true,
|
|
72
|
+
});
|
|
73
|
+
const launchError = r.error ? `无法启动 ${cmd}:${r.error.message}` : '';
|
|
74
|
+
return { status: r.status, stdout: r.stdout ?? '', stderr: [r.stderr ?? '', launchError].filter(Boolean).join('\n') };
|
|
75
|
+
}
|
|
76
|
+
/** 分批运行以文件列表为参数的工具;输出解释和合并由具体插件负责。 */
|
|
77
|
+
export function runFileTool(ctx, cmd, fixedArgs, files) {
|
|
78
|
+
try {
|
|
79
|
+
return {
|
|
80
|
+
runs: splitFileArguments(cmd, fixedArgs, files).map((batch) => runTool(ctx, cmd, [...fixedArgs, ...batch])),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
return { runs: [], error: error instanceof Error ? error.message : String(error) };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export function gitShow(ctx, file) {
|
|
88
|
+
if (!ctx.base)
|
|
89
|
+
return null;
|
|
90
|
+
const r = spawnSync('git', ['show', `${ctx.base}:${file}`], { cwd: ctx.repoRoot, encoding: 'utf8', windowsHide: true });
|
|
91
|
+
return r.status === 0 ? r.stdout : null;
|
|
92
|
+
}
|
|
93
|
+
/** 读取项目配置中与本插件相关的部分(control 层数据)。 */
|
|
94
|
+
export function readProjectConfig(root) {
|
|
95
|
+
const rel = configFile(root);
|
|
96
|
+
return rel ? (parse(readFileSync(join(root, rel), 'utf8')) ?? {}) : {};
|
|
97
|
+
}
|
|
98
|
+
/** 把工具报告的绝对路径转为相对仓库根的路径(处理 /var 与 /private/var 这类符号链接)。 */
|
|
99
|
+
export function toRepoPath(root, file) {
|
|
100
|
+
const real = realpathSync(root);
|
|
101
|
+
for (const base of [real, root]) {
|
|
102
|
+
const rel = relative(base, file);
|
|
103
|
+
if (isAbsolute(file) && !isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`)) {
|
|
104
|
+
return rel.replaceAll(sep, '/');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return file.replaceAll(sep, '/');
|
|
108
|
+
}
|
|
109
|
+
export function filterByExt(files, exts) {
|
|
110
|
+
return files.filter((f) => exts.some((e) => f.endsWith(e)));
|
|
111
|
+
}
|
|
112
|
+
export const JS_EXTS = ['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs'];
|
|
113
|
+
//# sourceMappingURL=lib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,E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UAAU,CAAC,IAAY,EAAE,IAAY;IACnD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACjC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC;YACxF,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAe,EAAE,IAAc;IACzD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { sumiCommand, definePlugin, result } from '@sumi/plugin-sdk';
|
|
2
|
+
import { runTool } from '../lib.js';
|
|
3
|
+
/** 适配漂移:调用 sumi update --check 与 control 层单一来源比较,生成物被手改或未重新生成时失败。 */
|
|
4
|
+
await definePlugin((ctx) => {
|
|
5
|
+
const [cmd, ...pre] = sumiCommand();
|
|
6
|
+
const r = runTool(ctx, cmd, [...pre, 'update', '--check', '--json']);
|
|
7
|
+
let drift;
|
|
8
|
+
try {
|
|
9
|
+
drift = JSON.parse(r.stdout).drift;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return result({ status: 'blocked', summary: `适配检查无法运行:${r.stderr.split('\n')[0] ?? ''}` });
|
|
13
|
+
}
|
|
14
|
+
const findings = drift.map((d, i) => ({
|
|
15
|
+
id: `F${i + 1}`,
|
|
16
|
+
rule: 'agent-drift',
|
|
17
|
+
severity: 'error',
|
|
18
|
+
message: d.problem,
|
|
19
|
+
file: d.path,
|
|
20
|
+
subject: d.path,
|
|
21
|
+
}));
|
|
22
|
+
return result({
|
|
23
|
+
status: findings.length ? 'fail' : 'pass',
|
|
24
|
+
summary: findings.length ? `${findings.length} 处 AI 工具适配漂移` : 'AI 工具适配无漂移',
|
|
25
|
+
findings,
|
|
26
|
+
checked: 'all',
|
|
27
|
+
next: findings.length
|
|
28
|
+
? [{ type: 'run', argv: ['sumi', 'update'], effects: ['writes-control'], why: '从 control 层重新生成适配' }]
|
|
29
|
+
: undefined,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=agent-drift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-drift.js","sourceRoot":"","sources":["../../src/plugins/agent-drift.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAgB,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qEAAqE;AACrE,MAAM,YAAY,CAAC,CAAC,GAAG,EAAE,EAAE;IACzB,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,WAAW,EAAE,CAAC;IACpC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,GAAI,EAAE,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,SAAS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AC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { definePlugin, gitPaths, result, ruleRefPattern } from '@sumi/plugin-sdk';
|
|
4
|
+
import picomatch from 'picomatch';
|
|
5
|
+
import { parse } from 'yaml';
|
|
6
|
+
import { readPlan } from '../baseline.js';
|
|
7
|
+
const DEFAULT_KEYWORDS = ['MUST', 'SHALL', '必须', '禁止', '不得'];
|
|
8
|
+
const ENFORCER_KINDS = new Set(['plugin', 'step', 'prec', 'rubric']);
|
|
9
|
+
function precedentIds(root) {
|
|
10
|
+
const path = join(root, 'precedents', 'registry.yaml');
|
|
11
|
+
if (!existsSync(path))
|
|
12
|
+
return new Set();
|
|
13
|
+
const registry = parse(readFileSync(path, 'utf8'));
|
|
14
|
+
return new Set((registry?.precedents ?? []).map((p) => p.id));
|
|
15
|
+
}
|
|
16
|
+
/** control/flows 下所有流程的步骤 id(显式 id,或未声明时的插件 id)。 */
|
|
17
|
+
function flowStepIds(root) {
|
|
18
|
+
const dir = join(root, 'control', 'flows');
|
|
19
|
+
const ids = new Set();
|
|
20
|
+
if (!existsSync(dir))
|
|
21
|
+
return ids;
|
|
22
|
+
for (const file of readdirSync(dir).filter((f) => f.endsWith('.flow.yaml'))) {
|
|
23
|
+
const flow = parse(readFileSync(join(dir, file), 'utf8'));
|
|
24
|
+
for (const step of flow?.steps ?? [])
|
|
25
|
+
if (step.id ?? step.use)
|
|
26
|
+
ids.add(String(step.id ?? step.use));
|
|
27
|
+
}
|
|
28
|
+
return ids;
|
|
29
|
+
}
|
|
30
|
+
function rubricHas(root, ref) {
|
|
31
|
+
const [id, item] = ref.split('#');
|
|
32
|
+
const path = join(root, 'control', 'rubrics', `${id}.yaml`);
|
|
33
|
+
if (!existsSync(path))
|
|
34
|
+
return false;
|
|
35
|
+
const rubric = parse(readFileSync(path, 'utf8'));
|
|
36
|
+
return item === undefined || (rubric?.items ?? []).some((i) => i.id === item);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* control 文档检查:入口文档限长;规范性语句必须引用存在的执行者。
|
|
40
|
+
* 只证明规则声明了执行者,不证明执行者语义正确。
|
|
41
|
+
*/
|
|
42
|
+
await definePlugin((ctx) => {
|
|
43
|
+
const maxLines = typeof ctx.config.maxLines === 'number' ? ctx.config.maxLines : 100;
|
|
44
|
+
const keywords = Array.isArray(ctx.config.keywords) ? ctx.config.keywords : DEFAULT_KEYWORDS;
|
|
45
|
+
const docGlobs = Array.isArray(ctx.config.paths) ? ctx.config.paths : ['AGENTS.md', 'control/**/*.md'];
|
|
46
|
+
const isDoc = picomatch(docGlobs, { dot: true });
|
|
47
|
+
// with.exclude:原样同步的外部参考文档不扫描,排除的文件数计入豁免指标。
|
|
48
|
+
const isExcluded = picomatch(Array.isArray(ctx.config.exclude) ? ctx.config.exclude : [], { dot: true });
|
|
49
|
+
const candidates = gitPaths(ctx.repoRoot, ['ls-files', '--cached', '--others', '--exclude-standard']).filter((f) => isDoc(f) && existsSync(join(ctx.repoRoot, f)));
|
|
50
|
+
const docs = candidates.filter((f) => !isExcluded(f));
|
|
51
|
+
const plugins = new Set(readPlan(ctx.runDir).plugins);
|
|
52
|
+
const precedents = precedentIds(ctx.repoRoot);
|
|
53
|
+
const steps = flowStepIds(ctx.repoRoot);
|
|
54
|
+
const keywordRe = new RegExp(keywords.map((k) => (/^[A-Z]+$/.test(k) ? `\\b${k}\\b` : k)).join('|'));
|
|
55
|
+
const findings = [];
|
|
56
|
+
let exemptions = candidates.length - docs.length;
|
|
57
|
+
const add = (rule, message, file, line) => findings.push({ id: `F${findings.length + 1}`, rule, severity: 'error', message, file, line, subject: `${file}:${message}` });
|
|
58
|
+
for (const file of docs) {
|
|
59
|
+
const lines = readFileSync(join(ctx.repoRoot, file), 'utf8').split('\n');
|
|
60
|
+
if (file === 'AGENTS.md' && lines.length > maxLines)
|
|
61
|
+
add('entry-too-long', `AGENTS.md 共 ${lines.length} 行,超过上限 ${maxLines}`, file);
|
|
62
|
+
let fenced = false;
|
|
63
|
+
lines.forEach((text, i) => {
|
|
64
|
+
if (/^\s*(```|~~~)/.test(text)) {
|
|
65
|
+
fenced = !fenced;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (fenced || /^\s*>/.test(text) || !text.trim())
|
|
69
|
+
return;
|
|
70
|
+
if (text.includes('[non-normative]')) {
|
|
71
|
+
exemptions++;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
// 本插件认的执行者类型;其他 [类型:目标] 写法不视为执行者引用。
|
|
75
|
+
const refs = [...text.matchAll(ruleRefPattern())].filter((m) => ENFORCER_KINDS.has(m[1]));
|
|
76
|
+
for (const [, kind, target] of refs) {
|
|
77
|
+
const ok = kind === 'plugin'
|
|
78
|
+
? plugins.has(target)
|
|
79
|
+
: kind === 'step'
|
|
80
|
+
? steps.has(target)
|
|
81
|
+
: kind === 'prec'
|
|
82
|
+
? precedents.has(target)
|
|
83
|
+
: rubricHas(ctx.repoRoot, target);
|
|
84
|
+
if (!ok)
|
|
85
|
+
add('broken-reference', `引用的执行者不存在:[${kind}:${target}]`, file, i + 1);
|
|
86
|
+
}
|
|
87
|
+
if (refs.length === 0 && keywordRe.test(text))
|
|
88
|
+
add('no-enforcer', `规范性语句没有执行者引用:${text.trim().slice(0, 60)}`, file, i + 1);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return result({
|
|
92
|
+
status: findings.length ? 'fail' : 'pass',
|
|
93
|
+
summary: findings.length ? `${findings.length} 处 control 文档问题` : 'control 文档检查通过',
|
|
94
|
+
findings,
|
|
95
|
+
checked: 'all',
|
|
96
|
+
metrics: [{ name: 'exemptions', value: exemptions }],
|
|
97
|
+
next: findings.some((f) => f.rule === 'no-enforcer')
|
|
98
|
+
? [
|
|
99
|
+
{
|
|
100
|
+
type: 'edit',
|
|
101
|
+
file: findings.find((f) => f.rule === 'no-enforcer').file,
|
|
102
|
+
intent: '为规则补充 [plugin:…]、[step:…]、[prec:…] 或 [rubric:…#…] 引用,或改写为非规范性说明',
|
|
103
|
+
why: 'control 层的规则必须有执行者',
|
|
104
|
+
},
|
|
105
|
+
]
|
|
106
|
+
: undefined,
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=control-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-docs.js","sourceRoot":"","sources":["../../src/plugins/control-docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AAChG,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC7D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAErE,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC;IACvD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,GAAG,EAAE,CAAC;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAA6C,CAAC;IAC/F,OAAO,IAAI,GAAG,CA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,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAE,CAAC,IAAK;oBAC3D,MAAM,EAAE,iEAAiE;oBACzE,GAAG,EAAE,oBAAoB;iBAC1B;aACF;YACH,CAAC,CAAC,SAAS;KACd,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { isAbsolute, join } from 'node:path';
|
|
3
|
+
import { definePlugin, result, writeEvidence } from '@sumi/plugin-sdk';
|
|
4
|
+
import picomatch from 'picomatch';
|
|
5
|
+
import { findTool, runTool, toRepoPath } from '../lib.js';
|
|
6
|
+
const list = (value) => (Array.isArray(value) ? value : []);
|
|
7
|
+
/** 从 istanbul 格式的 coverage-final.json 中取出每个文件的"出现过的行"与"执行过的行"。 */
|
|
8
|
+
function lineSets(root, path) {
|
|
9
|
+
const out = new Map();
|
|
10
|
+
if (!existsSync(path))
|
|
11
|
+
return out;
|
|
12
|
+
const data = JSON.parse(readFileSync(path, 'utf8'));
|
|
13
|
+
for (const [file, cov] of Object.entries(data)) {
|
|
14
|
+
const rel = toRepoPath(root, file);
|
|
15
|
+
const entry = out.get(rel) ?? { all: new Set(), hit: new Set() };
|
|
16
|
+
for (const [id, loc] of Object.entries(cov.statementMap)) {
|
|
17
|
+
entry.all.add(loc.start.line);
|
|
18
|
+
if ((cov.s[id] ?? 0) > 0)
|
|
19
|
+
entry.hit.add(loc.start.line);
|
|
20
|
+
}
|
|
21
|
+
out.set(rel, entry);
|
|
22
|
+
}
|
|
23
|
+
return out;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 覆盖率:全量运行测试并上报行覆盖率指标 coverage,比较交给棘轮。
|
|
27
|
+
* with.tool 为 c8 时同时计入子进程:测试进程内的代码用 vitest 自带的 v8 覆盖率(有正确的 source map),
|
|
28
|
+
* 子进程中运行的代码(with.subprocess 匹配的构建产物,例如以独立进程运行的插件)用 NODE_V8_COVERAGE 收集、
|
|
29
|
+
* 经 c8 映射回源码,两者按行取并集。默认只统计测试进程内的代码。
|
|
30
|
+
*/
|
|
31
|
+
await definePlugin((ctx) => {
|
|
32
|
+
const vitest = findTool(ctx, 'vitest');
|
|
33
|
+
if (!vitest)
|
|
34
|
+
return result({ status: 'skipped', summary: '未找到 vitest,请在项目中安装' });
|
|
35
|
+
const include = list(ctx.config.include);
|
|
36
|
+
const exclude = list(ctx.config.exclude);
|
|
37
|
+
const inProcess = join(ctx.evidenceDir, 'coverage');
|
|
38
|
+
const scope = [...include.map((g) => `--coverage.include=${g}`), ...exclude.map((g) => `--coverage.exclude=${g}`)];
|
|
39
|
+
if (ctx.config.tool !== 'c8') {
|
|
40
|
+
const r = runTool(ctx, vitest, [
|
|
41
|
+
'run',
|
|
42
|
+
'--passWithNoTests',
|
|
43
|
+
'--coverage.enabled',
|
|
44
|
+
'--coverage.reporter=json-summary',
|
|
45
|
+
`--coverage.reportsDirectory=${inProcess}`,
|
|
46
|
+
...scope,
|
|
47
|
+
]);
|
|
48
|
+
const evidence = [writeEvidence(ctx, 'coverage.log', r.stdout + r.stderr)];
|
|
49
|
+
const summary = join(inProcess, 'coverage-summary.json');
|
|
50
|
+
if (!existsSync(summary))
|
|
51
|
+
return result({ status: 'skipped', summary: '未产出覆盖率报告,请安装 @vitest/coverage-v8', evidence });
|
|
52
|
+
const pct = JSON.parse(readFileSync(summary, 'utf8')).total.lines.pct;
|
|
53
|
+
return result({
|
|
54
|
+
status: r.status === 0 ? 'pass' : 'fail',
|
|
55
|
+
summary: `行覆盖率 ${pct}%`,
|
|
56
|
+
checked: 'all',
|
|
57
|
+
evidence: [...evidence, summary],
|
|
58
|
+
metrics: [{ name: 'coverage', value: pct }],
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const c8 = findTool(ctx, 'c8');
|
|
62
|
+
if (!c8)
|
|
63
|
+
return result({ status: 'skipped', summary: '配置了 tool: c8,但未找到 c8,请在项目中安装' });
|
|
64
|
+
const raw = join(ctx.evidenceDir, 'raw');
|
|
65
|
+
const sub = join(ctx.evidenceDir, 'subprocess');
|
|
66
|
+
const r = runTool(ctx, vitest, ['run', '--passWithNoTests', '--coverage.enabled', '--coverage.reporter=json', `--coverage.reportsDirectory=${inProcess}`, ...scope], undefined, { ...process.env, NODE_V8_COVERAGE: raw });
|
|
67
|
+
// 只对子进程运行的构建产物出报告(不带 --exclude-after-remap,先按产物路径筛选再映射回源码)。
|
|
68
|
+
const subGlobs = list(ctx.config.subprocess);
|
|
69
|
+
const report = runTool(ctx, c8, [
|
|
70
|
+
'report',
|
|
71
|
+
'--temp-directory',
|
|
72
|
+
raw,
|
|
73
|
+
'--reports-dir',
|
|
74
|
+
sub,
|
|
75
|
+
'--reporter=json',
|
|
76
|
+
...subGlobs.flatMap((g) => ['--include', g]),
|
|
77
|
+
]);
|
|
78
|
+
const evidence = [writeEvidence(ctx, 'coverage.log', r.stdout + r.stderr + report.stdout + report.stderr)];
|
|
79
|
+
const a = lineSets(ctx.repoRoot, join(inProcess, 'coverage-final.json'));
|
|
80
|
+
if (a.size === 0)
|
|
81
|
+
return result({ status: 'skipped', summary: '未产出覆盖率报告,请安装 @vitest/coverage-v8', evidence });
|
|
82
|
+
const b = lineSets(ctx.repoRoot, join(sub, 'coverage-final.json'));
|
|
83
|
+
const inScope = (f) => (include.length ? picomatch(include)(f) : true) && !(exclude.length && picomatch(exclude)(f));
|
|
84
|
+
let all = 0;
|
|
85
|
+
let hit = 0;
|
|
86
|
+
const perFile = {};
|
|
87
|
+
for (const file of new Set([...a.keys(), ...b.keys()])) {
|
|
88
|
+
// toRepoPath 对仓库外的文件返回绝对路径,这些文件不计入。
|
|
89
|
+
if (isAbsolute(file) || !inScope(file))
|
|
90
|
+
continue;
|
|
91
|
+
const lines = new Set([...(a.get(file)?.all ?? []), ...(b.get(file)?.all ?? [])]);
|
|
92
|
+
const covered = new Set([...(a.get(file)?.hit ?? []), ...(b.get(file)?.hit ?? [])]);
|
|
93
|
+
all += lines.size;
|
|
94
|
+
hit += covered.size;
|
|
95
|
+
perFile[file] = lines.size ? Math.round((covered.size / lines.size) * 10000) / 100 : 100;
|
|
96
|
+
}
|
|
97
|
+
const pct = all ? Math.round((hit / all) * 10000) / 100 : 100;
|
|
98
|
+
const merged = writeEvidence(ctx, 'coverage-merged.json', JSON.stringify({ total: pct, files: perFile }, null, 2));
|
|
99
|
+
return result({
|
|
100
|
+
status: r.status === 0 ? 'pass' : 'fail',
|
|
101
|
+
summary: `行覆盖率 ${pct}%(测试进程内 + 子进程)`,
|
|
102
|
+
checked: 'all',
|
|
103
|
+
evidence: [...evidence, merged],
|
|
104
|
+
metrics: [{ name: 'coverage', value: pct }],
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=coverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../src/plugins/coverage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,IAAI,GAAG,CAAC,KAAc,EAAY,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAkB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAO7F,kEAAkE;AAClE,SAAS,QAAQ,CAAC,IAAY,EAAE,IAAY;IAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkD,CAAC;IACtE,IA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QAAQ,EAAE,CAAC,GAAG,QAAQ,EAAE,MAAM,CAAC;QAC/B,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { definePlugin, result, writeEvidence } from '@sumi/plugin-sdk';
|
|
2
|
+
import { runTool, toRepoPath } from '../lib.js';
|
|
3
|
+
/** Windows CreateProcess 的命令行上限。 */
|
|
4
|
+
const WINDOWS_COMMAND_LIMIT = 32_767;
|
|
5
|
+
/** cmd.exe 的命令行上限:经 .cmd shim 启动时超过它,命令根本不会运行。 */
|
|
6
|
+
const CMD_COMMAND_LIMIT = 8_191;
|
|
7
|
+
const tooLong = (argv, files) => `${argv.join(' ')}:文件参数超出 Windows 命令行上限(${files} 个文件),请让命令通过 SUMI_BASE 自行计算范围,或使用工具支持的响应文件`;
|
|
8
|
+
/**
|
|
9
|
+
* 命令适配:运行 with.argv 给出的已有命令(工作目录为仓库根),按退出码给出 pass 或 fail,完整输出存为证据。
|
|
10
|
+
* 可选 with.pattern(含 file、line、message 命名分组的正则)把输出行解析为 findings;
|
|
11
|
+
* 可选 with.passFiles 把命中的文件追加为命令参数;命令的环境中有 SUMI_BASE(比较基准,无基准时为空)。
|
|
12
|
+
* 用于零改写接入项目已有的检查脚本。
|
|
13
|
+
*/
|
|
14
|
+
await definePlugin((ctx) => {
|
|
15
|
+
const argv = Array.isArray(ctx.config.argv) ? ctx.config.argv : [];
|
|
16
|
+
if (argv.length === 0)
|
|
17
|
+
return result({ status: 'blocked', summary: '缺少 with.argv:要运行的命令' });
|
|
18
|
+
const [cmd, ...args] = argv;
|
|
19
|
+
// SUMI_BASE:比较基准(无基准时为空)。命令需要完整改动清单(含删除与排除路径)时可据此自行计算。
|
|
20
|
+
const env = { ...process.env, SUMI_BASE: ctx.base ?? '' };
|
|
21
|
+
if (ctx.config.passFiles === true)
|
|
22
|
+
args.push(...ctx.files);
|
|
23
|
+
// 包装的是任意项目命令,无法确认能否分批重复执行、如何合并输出,因此不自动分批;
|
|
24
|
+
// Windows 上命令行明显超出 CreateProcess 的上限(32767 字符)时提前阻塞;经 .cmd 时 cmd.exe 的上限更低(8191),
|
|
25
|
+
// 由运行后的退出码与命令行长度识别。两种情况都明确阻塞,而不是把启动失败当作检查失败。其他平台的参数上限足够大。
|
|
26
|
+
const commandLength = [cmd, ...args].reduce((n, a) => n + a.length + 3, 0);
|
|
27
|
+
if (process.platform === 'win32' && ctx.config.passFiles === true && commandLength > WINDOWS_COMMAND_LIMIT) {
|
|
28
|
+
return result({ status: 'blocked', summary: tooLong(argv, ctx.files.length) });
|
|
29
|
+
}
|
|
30
|
+
const r = runTool(ctx, cmd, args, undefined, env);
|
|
31
|
+
const output = `${r.stdout}${r.stderr}`;
|
|
32
|
+
const evidence = [writeEvidence(ctx, 'output.log', output)];
|
|
33
|
+
if (r.status === null)
|
|
34
|
+
return result({ status: 'blocked', summary: `无法运行 ${argv.join(' ')}`, evidence });
|
|
35
|
+
// cmd.exe 的报错随系统语言与代码页变化(中文系统为 GBK),不按文字识别:超过 cmd.exe 上限且非零退出时,命令可能没有真正运行。
|
|
36
|
+
if (process.platform === 'win32' && ctx.config.passFiles === true && r.status !== 0 && commandLength > CMD_COMMAND_LIMIT) {
|
|
37
|
+
return result({
|
|
38
|
+
status: 'blocked',
|
|
39
|
+
summary: `${tooLong(argv, ctx.files.length)}(经 .cmd 启动时超过 cmd.exe 的 ${CMD_COMMAND_LIMIT} 字符上限,命令可能没有运行)`,
|
|
40
|
+
evidence,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const findings = [];
|
|
44
|
+
if (typeof ctx.config.pattern === 'string') {
|
|
45
|
+
const re = new RegExp(ctx.config.pattern);
|
|
46
|
+
for (const line of output.split(/\r?\n/)) {
|
|
47
|
+
const g = re.exec(line)?.groups;
|
|
48
|
+
if (!g?.message)
|
|
49
|
+
continue;
|
|
50
|
+
findings.push({
|
|
51
|
+
id: `F${findings.length + 1}`,
|
|
52
|
+
rule: ctx.stepId,
|
|
53
|
+
severity: r.status === 0 ? 'warning' : 'error',
|
|
54
|
+
message: g.message,
|
|
55
|
+
file: g.file ? toRepoPath(ctx.repoRoot, g.file) : undefined,
|
|
56
|
+
line: g.line ? Number(g.line) : undefined,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const last = output.trim().split(/\r?\n/).at(-1) ?? '';
|
|
61
|
+
return result({
|
|
62
|
+
status: r.status === 0 ? 'pass' : 'fail',
|
|
63
|
+
summary: `${argv.join(' ')}:退出码 ${r.status}${last ? `,${last.slice(0, 120)}` : ''}`,
|
|
64
|
+
findings,
|
|
65
|
+
checked: ctx.config.passFiles === true ? ctx.files : 'all',
|
|
66
|
+
evidence,
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/plugins/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEhD,oCAAoC;AACpC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,kDAAkD;AAClD,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAChC,MAAM,OAAO,GAAG,CAAC,IAAc,EAAE,KAAa,EAAE,EAAE,CAChD,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAyB,KAAK,4CAA4C,CAAC;AAE9F;;;;;GAKG;AACH,MAAM,YAAY,CAAC,CAAC,GAAG,EAAE,EAAE;IACzB,MAAM,IAAI,GAAG,KAAK,CAAC,OAA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import { findTool, runFileTool } from '../lib.js';
|
|
3
|
+
/** 格式检查:prettier --check,只读不写;修复由声明的修复命令完成。 */
|
|
4
|
+
await definePlugin((ctx) => {
|
|
5
|
+
const prettier = findTool(ctx, 'prettier');
|
|
6
|
+
if (!prettier)
|
|
7
|
+
return result({ status: 'skipped', summary: '未找到 prettier,请在项目中安装' });
|
|
8
|
+
// 始终使用内核给出的文件列表(全量时为全仓减去排除路径),不让工具自行扫描。
|
|
9
|
+
const files = ctx.files;
|
|
10
|
+
if (files.length === 0)
|
|
11
|
+
return result({ status: 'pass', summary: '没有需要检查的文件', checked: [] });
|
|
12
|
+
const execution = runFileTool(ctx, prettier, ['--list-different', '--ignore-unknown'], files);
|
|
13
|
+
const output = execution.runs.map((run) => run.stdout + run.stderr).join('');
|
|
14
|
+
const evidence = [writeEvidence(ctx, 'prettier.log', `${output}${execution.error ?? ''}`)];
|
|
15
|
+
if (execution.error)
|
|
16
|
+
return result({ status: 'blocked', summary: execution.error, evidence });
|
|
17
|
+
const failedRun = execution.runs.find((run) => run.status === null || run.status > 1);
|
|
18
|
+
if (failedRun) {
|
|
19
|
+
const detail = failedRun.stderr.split('\n')[0];
|
|
20
|
+
return result({ status: 'blocked', summary: detail ? `prettier 运行出错:${detail}` : 'prettier 运行出错', evidence });
|
|
21
|
+
}
|
|
22
|
+
const unformatted = execution.runs.flatMap((run) => run.stdout.split('\n').filter(Boolean));
|
|
23
|
+
const findings = unformatted.map((file, i) => ({
|
|
24
|
+
id: `F${i + 1}`,
|
|
25
|
+
rule: 'prettier',
|
|
26
|
+
severity: 'error',
|
|
27
|
+
message: '格式不符合 prettier',
|
|
28
|
+
file,
|
|
29
|
+
}));
|
|
30
|
+
return result({
|
|
31
|
+
status: findings.length ? 'fail' : 'pass',
|
|
32
|
+
summary: findings.length ? `${findings.length} 个文件格式不符` : '格式正确',
|
|
33
|
+
findings,
|
|
34
|
+
checked: ctx.all ? 'all' : ctx.files,
|
|
35
|
+
evidence,
|
|
36
|
+
next: findings.length
|
|
37
|
+
? [{ type: 'run', argv: ['sumi', 'fix', ctx.stepId], effects: ['writes-worktree'], why: '可自动格式化' }]
|
|
38
|
+
: undefined,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/plugins/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAgB,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,+CAA+C;AAC/C,MAAM,YAAY,CAAC,CAAC,GAAG,EAAE,EAAE;IACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAC3C,IAAI,CAAC,QAAQ;QAAE,OAAO,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;IACrF,wCAAwC;IACxC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACxB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7F,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9F,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7E,MAAM,QAAQ,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,c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