eslint-plugin-copilot 1.0.8 → 1.1.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/dist/_internal/copilot-config-references.d.ts +1 -1
- package/dist/_internal/copilot-config-references.d.ts.map +1 -1
- package/dist/_internal/copilot-config-references.js +3 -1
- package/dist/_internal/copilot-config-references.js.map +1 -1
- package/dist/_internal/copilot-file-kind.d.ts.map +1 -1
- package/dist/_internal/copilot-file-kind.js +4 -3
- package/dist/_internal/copilot-file-kind.js.map +1 -1
- package/dist/_internal/create-copilot-rule.d.ts +4 -2
- package/dist/_internal/create-copilot-rule.d.ts.map +1 -1
- package/dist/_internal/create-copilot-rule.js.map +1 -1
- package/dist/_internal/file-system.d.ts.map +1 -1
- package/dist/_internal/file-system.js +31 -18
- package/dist/_internal/file-system.js.map +1 -1
- package/dist/_internal/frontmatter.d.ts +1 -1
- package/dist/_internal/frontmatter.d.ts.map +1 -1
- package/dist/_internal/frontmatter.js +151 -119
- package/dist/_internal/frontmatter.js.map +1 -1
- package/dist/_internal/markdown-links.d.ts.map +1 -1
- package/dist/_internal/markdown-links.js +3 -1
- package/dist/_internal/markdown-links.js.map +1 -1
- package/dist/_internal/markdown-rule.d.ts +2 -1
- package/dist/_internal/markdown-rule.d.ts.map +1 -1
- package/dist/_internal/markdown-rule.js.map +1 -1
- package/dist/_internal/repository-hooks-json.d.ts +5 -2
- package/dist/_internal/repository-hooks-json.d.ts.map +1 -1
- package/dist/_internal/repository-hooks-json.js +7 -6
- package/dist/_internal/repository-hooks-json.js.map +1 -1
- package/dist/_internal/rule-catalog.d.ts.map +1 -1
- package/dist/_internal/rule-catalog.js +2 -3
- package/dist/_internal/rule-catalog.js.map +1 -1
- package/dist/plugin.cjs +588 -409
- package/dist/plugin.cjs.map +4 -4
- package/dist/plugin.d.cts +2 -1
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +4 -3
- package/dist/plugin.js.map +1 -1
- package/dist/rules/no-blank-customization-body.d.ts +1 -0
- package/dist/rules/no-blank-customization-body.d.ts.map +1 -1
- package/dist/rules/no-blank-customization-body.js +3 -0
- package/dist/rules/no-blank-customization-body.js.map +1 -1
- package/dist/rules/no-blank-repository-instructions.d.ts +1 -0
- package/dist/rules/no-blank-repository-instructions.d.ts.map +1 -1
- package/dist/rules/no-blank-repository-instructions.js +3 -0
- package/dist/rules/no-blank-repository-instructions.js.map +1 -1
- package/dist/rules/no-blank-skill-body.d.ts +1 -0
- package/dist/rules/no-blank-skill-body.d.ts.map +1 -1
- package/dist/rules/no-blank-skill-body.js +3 -0
- package/dist/rules/no-blank-skill-body.js.map +1 -1
- package/dist/rules/no-deprecated-agent-infer.d.ts +1 -0
- package/dist/rules/no-deprecated-agent-infer.d.ts.map +1 -1
- package/dist/rules/no-deprecated-agent-infer.js +3 -0
- package/dist/rules/no-deprecated-agent-infer.js.map +1 -1
- package/dist/rules/no-duplicate-agent-names.d.ts +1 -0
- package/dist/rules/no-duplicate-agent-names.d.ts.map +1 -1
- package/dist/rules/no-duplicate-agent-names.js +6 -4
- package/dist/rules/no-duplicate-agent-names.js.map +1 -1
- package/dist/rules/no-duplicate-prompt-names.d.ts +1 -0
- package/dist/rules/no-duplicate-prompt-names.d.ts.map +1 -1
- package/dist/rules/no-duplicate-prompt-names.js +6 -4
- package/dist/rules/no-duplicate-prompt-names.js.map +1 -1
- package/dist/rules/no-duplicate-skill-names.d.ts +1 -0
- package/dist/rules/no-duplicate-skill-names.d.ts.map +1 -1
- package/dist/rules/no-duplicate-skill-names.js +6 -4
- package/dist/rules/no-duplicate-skill-names.js.map +1 -1
- package/dist/rules/no-duplicate-slash-command-names.d.ts +1 -0
- package/dist/rules/no-duplicate-slash-command-names.d.ts.map +1 -1
- package/dist/rules/no-duplicate-slash-command-names.js +6 -4
- package/dist/rules/no-duplicate-slash-command-names.js.map +1 -1
- package/dist/rules/no-empty-repository-hook-arrays.d.ts +1 -0
- package/dist/rules/no-empty-repository-hook-arrays.d.ts.map +1 -1
- package/dist/rules/no-empty-repository-hook-arrays.js +7 -3
- package/dist/rules/no-empty-repository-hook-arrays.js.map +1 -1
- package/dist/rules/no-legacy-chatmode-files.d.ts +1 -0
- package/dist/rules/no-legacy-chatmode-files.d.ts.map +1 -1
- package/dist/rules/no-legacy-chatmode-files.js +3 -0
- package/dist/rules/no-legacy-chatmode-files.js.map +1 -1
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.d.ts +1 -0
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.d.ts.map +1 -1
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.js +3 -0
- package/dist/rules/prefer-custom-instructions-under-code-review-limit.js.map +1 -1
- package/dist/rules/prefer-fast-repository-hooks.d.ts +1 -0
- package/dist/rules/prefer-fast-repository-hooks.d.ts.map +1 -1
- package/dist/rules/prefer-fast-repository-hooks.js +5 -1
- package/dist/rules/prefer-fast-repository-hooks.js.map +1 -1
- package/dist/rules/prefer-qualified-tools.d.ts +1 -0
- package/dist/rules/prefer-qualified-tools.d.ts.map +1 -1
- package/dist/rules/prefer-qualified-tools.js +8 -3
- package/dist/rules/prefer-qualified-tools.js.map +1 -1
- package/dist/rules/require-agent-tool-for-subagents.d.ts +1 -0
- package/dist/rules/require-agent-tool-for-subagents.d.ts.map +1 -1
- package/dist/rules/require-agent-tool-for-subagents.js +6 -2
- package/dist/rules/require-agent-tool-for-subagents.js.map +1 -1
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.d.ts +1 -0
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.d.ts.map +1 -1
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.js +3 -0
- package/dist/rules/require-agents-md-for-cross-surface-agent-instructions.js.map +1 -1
- package/dist/rules/require-chatmode-file-metadata.d.ts +1 -0
- package/dist/rules/require-chatmode-file-metadata.d.ts.map +1 -1
- package/dist/rules/require-chatmode-file-metadata.js +5 -1
- package/dist/rules/require-chatmode-file-metadata.js.map +1 -1
- package/dist/rules/require-existing-agent-hook-cwd.d.ts +1 -0
- package/dist/rules/require-existing-agent-hook-cwd.d.ts.map +1 -1
- package/dist/rules/require-existing-agent-hook-cwd.js +6 -2
- package/dist/rules/require-existing-agent-hook-cwd.js.map +1 -1
- package/dist/rules/require-existing-agent-mcp-servers.d.ts +1 -0
- package/dist/rules/require-existing-agent-mcp-servers.d.ts.map +1 -1
- package/dist/rules/require-existing-agent-mcp-servers.js +6 -2
- package/dist/rules/require-existing-agent-mcp-servers.js.map +1 -1
- package/dist/rules/require-existing-relative-agent-links.d.ts +1 -0
- package/dist/rules/require-existing-relative-agent-links.d.ts.map +1 -1
- package/dist/rules/require-existing-relative-agent-links.js +3 -0
- package/dist/rules/require-existing-relative-agent-links.js.map +1 -1
- package/dist/rules/require-existing-relative-instructions-links.d.ts +1 -0
- package/dist/rules/require-existing-relative-instructions-links.d.ts.map +1 -1
- package/dist/rules/require-existing-relative-instructions-links.js +3 -0
- package/dist/rules/require-existing-relative-instructions-links.js.map +1 -1
- package/dist/rules/require-existing-relative-prompt-links.d.ts +1 -0
- package/dist/rules/require-existing-relative-prompt-links.d.ts.map +1 -1
- package/dist/rules/require-existing-relative-prompt-links.js +3 -0
- package/dist/rules/require-existing-relative-prompt-links.js.map +1 -1
- package/dist/rules/require-existing-relative-skill-links.d.ts +1 -0
- package/dist/rules/require-existing-relative-skill-links.d.ts.map +1 -1
- package/dist/rules/require-existing-relative-skill-links.js +3 -0
- package/dist/rules/require-existing-relative-skill-links.js.map +1 -1
- package/dist/rules/require-existing-repository-hook-cwd.d.ts +1 -0
- package/dist/rules/require-existing-repository-hook-cwd.d.ts.map +1 -1
- package/dist/rules/require-existing-repository-hook-cwd.js +5 -1
- package/dist/rules/require-existing-repository-hook-cwd.js.map +1 -1
- package/dist/rules/require-github-copilot-target-for-mcp-servers.d.ts +1 -0
- package/dist/rules/require-github-copilot-target-for-mcp-servers.d.ts.map +1 -1
- package/dist/rules/require-github-copilot-target-for-mcp-servers.js +5 -1
- package/dist/rules/require-github-copilot-target-for-mcp-servers.js.map +1 -1
- package/dist/rules/require-instructions-apply-to.d.ts +1 -0
- package/dist/rules/require-instructions-apply-to.d.ts.map +1 -1
- package/dist/rules/require-instructions-apply-to.js +5 -1
- package/dist/rules/require-instructions-apply-to.js.map +1 -1
- package/dist/rules/require-json-agent-mcp-servers.d.ts +1 -0
- package/dist/rules/require-json-agent-mcp-servers.d.ts.map +1 -1
- package/dist/rules/require-json-agent-mcp-servers.js +6 -2
- package/dist/rules/require-json-agent-mcp-servers.js.map +1 -1
- package/dist/rules/require-prompt-file-metadata.d.ts +1 -0
- package/dist/rules/require-prompt-file-metadata.d.ts.map +1 -1
- package/dist/rules/require-prompt-file-metadata.js +43 -32
- package/dist/rules/require-prompt-file-metadata.js.map +1 -1
- package/dist/rules/require-qualified-agent-handoff-models.d.ts +1 -0
- package/dist/rules/require-qualified-agent-handoff-models.d.ts.map +1 -1
- package/dist/rules/require-qualified-agent-handoff-models.js +6 -2
- package/dist/rules/require-qualified-agent-handoff-models.js.map +1 -1
- package/dist/rules/require-relative-agent-hook-cwd.d.ts +1 -0
- package/dist/rules/require-relative-agent-hook-cwd.d.ts.map +1 -1
- package/dist/rules/require-relative-agent-hook-cwd.js +6 -2
- package/dist/rules/require-relative-agent-hook-cwd.js.map +1 -1
- package/dist/rules/require-relative-agent-links.d.ts +1 -0
- package/dist/rules/require-relative-agent-links.d.ts.map +1 -1
- package/dist/rules/require-relative-agent-links.js +3 -0
- package/dist/rules/require-relative-agent-links.js.map +1 -1
- package/dist/rules/require-relative-instructions-links.d.ts +1 -0
- package/dist/rules/require-relative-instructions-links.d.ts.map +1 -1
- package/dist/rules/require-relative-instructions-links.js +3 -0
- package/dist/rules/require-relative-instructions-links.js.map +1 -1
- package/dist/rules/require-relative-prompt-links.d.ts +1 -0
- package/dist/rules/require-relative-prompt-links.d.ts.map +1 -1
- package/dist/rules/require-relative-prompt-links.js +3 -0
- package/dist/rules/require-relative-prompt-links.js.map +1 -1
- package/dist/rules/require-relative-repository-hook-cwd.d.ts +1 -0
- package/dist/rules/require-relative-repository-hook-cwd.d.ts.map +1 -1
- package/dist/rules/require-relative-repository-hook-cwd.js +5 -1
- package/dist/rules/require-relative-repository-hook-cwd.js.map +1 -1
- package/dist/rules/require-relative-skill-links.d.ts +1 -0
- package/dist/rules/require-relative-skill-links.d.ts.map +1 -1
- package/dist/rules/require-relative-skill-links.js +3 -0
- package/dist/rules/require-relative-skill-links.js.map +1 -1
- package/dist/rules/require-repository-hook-arrays.d.ts +1 -0
- package/dist/rules/require-repository-hook-arrays.d.ts.map +1 -1
- package/dist/rules/require-repository-hook-arrays.js +7 -3
- package/dist/rules/require-repository-hook-arrays.js.map +1 -1
- package/dist/rules/require-repository-hook-command-shell.d.ts +1 -0
- package/dist/rules/require-repository-hook-command-shell.d.ts.map +1 -1
- package/dist/rules/require-repository-hook-command-shell.js +5 -1
- package/dist/rules/require-repository-hook-command-shell.js.map +1 -1
- package/dist/rules/require-repository-hooks-object.d.ts +1 -0
- package/dist/rules/require-repository-hooks-object.d.ts.map +1 -1
- package/dist/rules/require-repository-hooks-object.js +3 -0
- package/dist/rules/require-repository-hooks-object.js.map +1 -1
- package/dist/rules/require-repository-instructions-file.d.ts +1 -0
- package/dist/rules/require-repository-instructions-file.d.ts.map +1 -1
- package/dist/rules/require-repository-instructions-file.js +3 -0
- package/dist/rules/require-repository-instructions-file.js.map +1 -1
- package/dist/rules/require-skill-file-location.d.ts +1 -0
- package/dist/rules/require-skill-file-location.d.ts.map +1 -1
- package/dist/rules/require-skill-file-location.js +3 -0
- package/dist/rules/require-skill-file-location.js.map +1 -1
- package/dist/rules/require-skill-file-metadata.d.ts +1 -0
- package/dist/rules/require-skill-file-metadata.d.ts.map +1 -1
- package/dist/rules/require-skill-file-metadata.js +6 -2
- package/dist/rules/require-skill-file-metadata.js.map +1 -1
- package/dist/rules/require-skill-md-filename.d.ts +1 -0
- package/dist/rules/require-skill-md-filename.d.ts.map +1 -1
- package/dist/rules/require-skill-md-filename.js +3 -0
- package/dist/rules/require-skill-md-filename.js.map +1 -1
- package/dist/rules/require-skill-name-match-directory.d.ts +1 -0
- package/dist/rules/require-skill-name-match-directory.d.ts.map +1 -1
- package/dist/rules/require-skill-name-match-directory.js +5 -1
- package/dist/rules/require-skill-name-match-directory.js.map +1 -1
- package/dist/rules/require-string-repository-hook-env-values.d.ts +1 -0
- package/dist/rules/require-string-repository-hook-env-values.d.ts.map +1 -1
- package/dist/rules/require-string-repository-hook-env-values.js +6 -2
- package/dist/rules/require-string-repository-hook-env-values.js.map +1 -1
- package/dist/rules/require-valid-agent-argument-hint.d.ts +1 -0
- package/dist/rules/require-valid-agent-argument-hint.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-argument-hint.js +5 -1
- package/dist/rules/require-valid-agent-argument-hint.js.map +1 -1
- package/dist/rules/require-valid-agent-handoff-send.d.ts +1 -0
- package/dist/rules/require-valid-agent-handoff-send.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-handoff-send.js +7 -3
- package/dist/rules/require-valid-agent-handoff-send.js.map +1 -1
- package/dist/rules/require-valid-agent-handoffs.d.ts +1 -0
- package/dist/rules/require-valid-agent-handoffs.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-handoffs.js +5 -1
- package/dist/rules/require-valid-agent-handoffs.js.map +1 -1
- package/dist/rules/require-valid-agent-hook-events.d.ts +1 -0
- package/dist/rules/require-valid-agent-hook-events.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-hook-events.js +6 -2
- package/dist/rules/require-valid-agent-hook-events.js.map +1 -1
- package/dist/rules/require-valid-agent-hook-timeouts.d.ts +1 -0
- package/dist/rules/require-valid-agent-hook-timeouts.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-hook-timeouts.js +6 -2
- package/dist/rules/require-valid-agent-hook-timeouts.js.map +1 -1
- package/dist/rules/require-valid-agent-hooks.d.ts +1 -0
- package/dist/rules/require-valid-agent-hooks.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-hooks.js +31 -21
- package/dist/rules/require-valid-agent-hooks.js.map +1 -1
- package/dist/rules/require-valid-agent-invocation-controls.d.ts +1 -0
- package/dist/rules/require-valid-agent-invocation-controls.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-invocation-controls.js +7 -3
- package/dist/rules/require-valid-agent-invocation-controls.js.map +1 -1
- package/dist/rules/require-valid-agent-mcp-servers.d.ts +1 -0
- package/dist/rules/require-valid-agent-mcp-servers.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-mcp-servers.js +8 -4
- package/dist/rules/require-valid-agent-mcp-servers.js.map +1 -1
- package/dist/rules/require-valid-agent-model.d.ts +1 -0
- package/dist/rules/require-valid-agent-model.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-model.js +7 -3
- package/dist/rules/require-valid-agent-model.js.map +1 -1
- package/dist/rules/require-valid-agent-name.d.ts +1 -0
- package/dist/rules/require-valid-agent-name.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-name.js +5 -1
- package/dist/rules/require-valid-agent-name.js.map +1 -1
- package/dist/rules/require-valid-agent-subagents.d.ts +1 -0
- package/dist/rules/require-valid-agent-subagents.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-subagents.js +8 -4
- package/dist/rules/require-valid-agent-subagents.js.map +1 -1
- package/dist/rules/require-valid-agent-target.d.ts +1 -0
- package/dist/rules/require-valid-agent-target.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-target.js +6 -2
- package/dist/rules/require-valid-agent-target.js.map +1 -1
- package/dist/rules/require-valid-agent-tools.d.ts +1 -0
- package/dist/rules/require-valid-agent-tools.d.ts.map +1 -1
- package/dist/rules/require-valid-agent-tools.js +8 -4
- package/dist/rules/require-valid-agent-tools.js.map +1 -1
- package/dist/rules/require-valid-instructions-apply-to-globs.d.ts +1 -0
- package/dist/rules/require-valid-instructions-apply-to-globs.d.ts.map +1 -1
- package/dist/rules/require-valid-instructions-apply-to-globs.js +8 -3
- package/dist/rules/require-valid-instructions-apply-to-globs.js.map +1 -1
- package/dist/rules/require-valid-prompt-argument-hint.d.ts +1 -0
- package/dist/rules/require-valid-prompt-argument-hint.d.ts.map +1 -1
- package/dist/rules/require-valid-prompt-argument-hint.js +6 -3
- package/dist/rules/require-valid-prompt-argument-hint.js.map +1 -1
- package/dist/rules/require-valid-prompt-model.d.ts +1 -0
- package/dist/rules/require-valid-prompt-model.d.ts.map +1 -1
- package/dist/rules/require-valid-prompt-model.js +9 -5
- package/dist/rules/require-valid-prompt-model.js.map +1 -1
- package/dist/rules/require-valid-prompt-name.d.ts +1 -0
- package/dist/rules/require-valid-prompt-name.d.ts.map +1 -1
- package/dist/rules/require-valid-prompt-name.js +5 -1
- package/dist/rules/require-valid-prompt-name.js.map +1 -1
- package/dist/rules/require-valid-prompt-tools.d.ts +1 -0
- package/dist/rules/require-valid-prompt-tools.d.ts.map +1 -1
- package/dist/rules/require-valid-prompt-tools.js +8 -4
- package/dist/rules/require-valid-prompt-tools.js.map +1 -1
- package/dist/rules/require-valid-repository-hook-command-type.d.ts +1 -0
- package/dist/rules/require-valid-repository-hook-command-type.d.ts.map +1 -1
- package/dist/rules/require-valid-repository-hook-command-type.js +5 -1
- package/dist/rules/require-valid-repository-hook-command-type.js.map +1 -1
- package/dist/rules/require-valid-repository-hook-env.d.ts +1 -0
- package/dist/rules/require-valid-repository-hook-env.d.ts.map +1 -1
- package/dist/rules/require-valid-repository-hook-env.js +6 -2
- package/dist/rules/require-valid-repository-hook-env.js.map +1 -1
- package/dist/rules/require-valid-repository-hook-events.d.ts +1 -0
- package/dist/rules/require-valid-repository-hook-events.d.ts.map +1 -1
- package/dist/rules/require-valid-repository-hook-events.js +5 -1
- package/dist/rules/require-valid-repository-hook-events.js.map +1 -1
- package/dist/rules/require-valid-repository-hook-timeouts.d.ts +1 -0
- package/dist/rules/require-valid-repository-hook-timeouts.d.ts.map +1 -1
- package/dist/rules/require-valid-repository-hook-timeouts.js +7 -3
- package/dist/rules/require-valid-repository-hook-timeouts.js.map +1 -1
- package/dist/rules/require-valid-repository-hook-version.d.ts +1 -0
- package/dist/rules/require-valid-repository-hook-version.d.ts.map +1 -1
- package/dist/rules/require-valid-repository-hook-version.js +3 -0
- package/dist/rules/require-valid-repository-hook-version.js.map +1 -1
- package/dist/rules/require-valid-skill-directory-name.d.ts +1 -0
- package/dist/rules/require-valid-skill-directory-name.d.ts.map +1 -1
- package/dist/rules/require-valid-skill-directory-name.js +3 -0
- package/dist/rules/require-valid-skill-directory-name.js.map +1 -1
- package/dist/rules/require-valid-skill-license.d.ts +1 -0
- package/dist/rules/require-valid-skill-license.d.ts.map +1 -1
- package/dist/rules/require-valid-skill-license.js +5 -1
- package/dist/rules/require-valid-skill-license.js.map +1 -1
- package/dist/rules/require-valid-skill-name.d.ts +1 -0
- package/dist/rules/require-valid-skill-name.d.ts.map +1 -1
- package/dist/rules/require-valid-skill-name.js +5 -1
- package/dist/rules/require-valid-skill-name.js.map +1 -1
- package/package.json +65 -53
package/dist/plugin.cjs
CHANGED
|
@@ -35,12 +35,13 @@ __export(plugin_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(plugin_exports);
|
|
36
36
|
var import_json = __toESM(require("@eslint/json"), 1);
|
|
37
37
|
var import_markdown = __toESM(require("@eslint/markdown"), 1);
|
|
38
|
+
var import_ts_extras56 = require("ts-extras");
|
|
38
39
|
|
|
39
40
|
// package.json
|
|
40
41
|
var package_default = {
|
|
41
42
|
$schema: "https://www.schemastore.org/package.json",
|
|
42
43
|
name: "eslint-plugin-copilot",
|
|
43
|
-
version: "1.0
|
|
44
|
+
version: "1.1.0",
|
|
44
45
|
private: false,
|
|
45
46
|
description: "ESLint rules for GitHub Copilot repository customization files.",
|
|
46
47
|
keywords: [
|
|
@@ -237,21 +238,23 @@ var package_default = {
|
|
|
237
238
|
"jsonc-eslint-parser": "$jsonc-eslint-parser"
|
|
238
239
|
},
|
|
239
240
|
dependencies: {
|
|
240
|
-
"@typescript-eslint/parser": "^8.
|
|
241
|
-
"@typescript-eslint/type-utils": "^8.
|
|
242
|
-
"@typescript-eslint/utils": "^8.
|
|
241
|
+
"@typescript-eslint/parser": "^8.59.0",
|
|
242
|
+
"@typescript-eslint/type-utils": "^8.59.0",
|
|
243
|
+
"@typescript-eslint/utils": "^8.59.0",
|
|
244
|
+
"ts-extras": "^1.0.0",
|
|
245
|
+
"type-fest": "^5.6.0"
|
|
243
246
|
},
|
|
244
247
|
devDependencies: {
|
|
245
248
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
246
249
|
"@csstools/stylelint-formatter-github": "^2.0.0",
|
|
247
250
|
"@docusaurus/eslint-plugin": "^3.10.0",
|
|
248
251
|
"@double-great/remark-lint-alt-text": "^1.1.1",
|
|
249
|
-
"@double-great/stylelint-a11y": "^3.4.
|
|
252
|
+
"@double-great/stylelint-a11y": "^3.4.10",
|
|
250
253
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
251
254
|
"@eslint-react/eslint-plugin": "^4.2.3",
|
|
252
255
|
"@eslint/compat": "^2.0.5",
|
|
253
256
|
"@eslint/config-helpers": "^0.5.5",
|
|
254
|
-
"@eslint/config-inspector": "^
|
|
257
|
+
"@eslint/config-inspector": "^2.0.0",
|
|
255
258
|
"@eslint/css": "^1.1.0",
|
|
256
259
|
"@eslint/js": "^10.0.1",
|
|
257
260
|
"@eslint/json": "^1.2.0",
|
|
@@ -260,20 +263,20 @@ var package_default = {
|
|
|
260
263
|
"@html-eslint/parser": "^0.59.0",
|
|
261
264
|
"@microsoft/eslint-plugin-sdl": "^1.1.0",
|
|
262
265
|
"@microsoft/tsdoc-config": "^0.18.1",
|
|
263
|
-
"@secretlint/secretlint-rule-anthropic": "^
|
|
264
|
-
"@secretlint/secretlint-rule-aws": "^
|
|
265
|
-
"@secretlint/secretlint-rule-database-connection-string": "^
|
|
266
|
-
"@secretlint/secretlint-rule-gcp": "^
|
|
267
|
-
"@secretlint/secretlint-rule-github": "^
|
|
268
|
-
"@secretlint/secretlint-rule-no-dotenv": "^
|
|
269
|
-
"@secretlint/secretlint-rule-no-homedir": "^
|
|
270
|
-
"@secretlint/secretlint-rule-npm": "^
|
|
271
|
-
"@secretlint/secretlint-rule-openai": "^
|
|
272
|
-
"@secretlint/secretlint-rule-pattern": "^
|
|
273
|
-
"@secretlint/secretlint-rule-preset-recommend": "^
|
|
274
|
-
"@secretlint/secretlint-rule-privatekey": "^
|
|
275
|
-
"@secretlint/secretlint-rule-secp256k1-privatekey": "^
|
|
276
|
-
"@secretlint/types": "^
|
|
266
|
+
"@secretlint/secretlint-rule-anthropic": "^12.2.0",
|
|
267
|
+
"@secretlint/secretlint-rule-aws": "^12.2.0",
|
|
268
|
+
"@secretlint/secretlint-rule-database-connection-string": "^12.2.0",
|
|
269
|
+
"@secretlint/secretlint-rule-gcp": "^12.2.0",
|
|
270
|
+
"@secretlint/secretlint-rule-github": "^12.2.0",
|
|
271
|
+
"@secretlint/secretlint-rule-no-dotenv": "^12.2.0",
|
|
272
|
+
"@secretlint/secretlint-rule-no-homedir": "^12.2.0",
|
|
273
|
+
"@secretlint/secretlint-rule-npm": "^12.2.0",
|
|
274
|
+
"@secretlint/secretlint-rule-openai": "^12.2.0",
|
|
275
|
+
"@secretlint/secretlint-rule-pattern": "^12.2.0",
|
|
276
|
+
"@secretlint/secretlint-rule-preset-recommend": "^12.2.0",
|
|
277
|
+
"@secretlint/secretlint-rule-privatekey": "^12.2.0",
|
|
278
|
+
"@secretlint/secretlint-rule-secp256k1-privatekey": "^12.2.0",
|
|
279
|
+
"@secretlint/types": "^12.2.0",
|
|
277
280
|
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
|
|
278
281
|
"@stryker-ignorer/console-all": "^0.3.2",
|
|
279
282
|
"@stryker-mutator/core": "^9.6.1",
|
|
@@ -296,11 +299,12 @@ var package_default = {
|
|
|
296
299
|
"@types/postcss-normalize": "^9.0.4",
|
|
297
300
|
"@types/postcss-reporter": "^7.0.5",
|
|
298
301
|
"@types/sloc": "^0.2.3",
|
|
299
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
300
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
301
|
-
"@
|
|
302
|
-
"@vitest/
|
|
303
|
-
"@vitest/
|
|
302
|
+
"@typescript-eslint/eslint-plugin": "^8.59.0",
|
|
303
|
+
"@typescript-eslint/rule-tester": "^8.59.0",
|
|
304
|
+
"@typpi/eslint-plugin-vite": "^1.0.13",
|
|
305
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
306
|
+
"@vitest/eslint-plugin": "^1.6.16",
|
|
307
|
+
"@vitest/ui": "^4.1.5",
|
|
304
308
|
actionlint: "^2.0.6",
|
|
305
309
|
"all-contributors-cli": "^6.26.1",
|
|
306
310
|
"cognitive-complexity-ts": "^0.8.1",
|
|
@@ -309,23 +313,27 @@ var package_default = {
|
|
|
309
313
|
"cross-env": "^10.1.0",
|
|
310
314
|
depcheck: "^1.4.7",
|
|
311
315
|
"detect-secrets": "^1.0.6",
|
|
312
|
-
eslint: "^10.2.
|
|
316
|
+
eslint: "^10.2.1",
|
|
313
317
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
314
318
|
"eslint-config-prettier": "^10.1.8",
|
|
315
319
|
"eslint-formatter-unix": "^9.0.1",
|
|
316
320
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
317
321
|
"eslint-plugin-array-func": "^5.1.1",
|
|
318
322
|
"eslint-plugin-canonical": "^5.1.3",
|
|
319
|
-
"eslint-plugin-case-police": "^2.2.
|
|
320
|
-
"eslint-plugin-comment-length": "^2.3.
|
|
323
|
+
"eslint-plugin-case-police": "^2.2.1",
|
|
324
|
+
"eslint-plugin-comment-length": "^2.3.1",
|
|
325
|
+
"eslint-plugin-copilot": "^1.0.8",
|
|
321
326
|
"eslint-plugin-css-modules": "^2.12.0",
|
|
322
327
|
"eslint-plugin-de-morgan": "^2.1.1",
|
|
323
328
|
"eslint-plugin-depend": "^1.5.0",
|
|
329
|
+
"eslint-plugin-docusaurus-2": "^0.2.0",
|
|
324
330
|
"eslint-plugin-eslint-plugin": "^7.3.2",
|
|
325
331
|
"eslint-plugin-etc": "^2.0.3",
|
|
326
|
-
"eslint-plugin-etc-misc": "^1.0.
|
|
327
|
-
"eslint-plugin-file-progress-2": "^5.0.
|
|
332
|
+
"eslint-plugin-etc-misc": "^1.0.8",
|
|
333
|
+
"eslint-plugin-file-progress-2": "^5.0.1",
|
|
334
|
+
"eslint-plugin-github-actions-2": "^1.1.0",
|
|
328
335
|
"eslint-plugin-html": "^8.1.4",
|
|
336
|
+
"eslint-plugin-immutable-2": "^1.0.10",
|
|
329
337
|
"eslint-plugin-import-x": "^4.16.2",
|
|
330
338
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
331
339
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
@@ -336,7 +344,7 @@ var package_default = {
|
|
|
336
344
|
"eslint-plugin-module-interop": "^0.3.1",
|
|
337
345
|
"eslint-plugin-n": "^17.24.0",
|
|
338
346
|
"eslint-plugin-nitpick": "^0.12.0",
|
|
339
|
-
"eslint-plugin-no-barrel-files": "^1.3.
|
|
347
|
+
"eslint-plugin-no-barrel-files": "^1.3.1",
|
|
340
348
|
"eslint-plugin-no-explicit-type-exports": "^0.12.1",
|
|
341
349
|
"eslint-plugin-no-function-declare-after-return": "^1.1.0",
|
|
342
350
|
"eslint-plugin-no-lookahead-lookbehind-regexp": "^0.4.0",
|
|
@@ -346,42 +354,47 @@ var package_default = {
|
|
|
346
354
|
"eslint-plugin-no-use-extend-native": "^0.7.2",
|
|
347
355
|
"eslint-plugin-node-dependencies": "^2.2.0",
|
|
348
356
|
"eslint-plugin-package-json": "^0.91.1",
|
|
349
|
-
"eslint-plugin-perfectionist": "^5.
|
|
357
|
+
"eslint-plugin-perfectionist": "^5.9.0",
|
|
350
358
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
351
359
|
"eslint-plugin-prettier": "^5.5.5",
|
|
352
360
|
"eslint-plugin-promise": "^7.2.1",
|
|
353
361
|
"eslint-plugin-redos": "^4.5.0",
|
|
354
362
|
"eslint-plugin-regexp": "^3.1.0",
|
|
355
363
|
"eslint-plugin-require-jsdoc": "^1.0.4",
|
|
364
|
+
"eslint-plugin-sdl-2": "^1.0.7",
|
|
356
365
|
"eslint-plugin-security": "^4.0.0",
|
|
357
|
-
"eslint-plugin-sonarjs": "^4.0.
|
|
366
|
+
"eslint-plugin-sonarjs": "^4.0.3",
|
|
358
367
|
"eslint-plugin-sort-class-members": "^1.22.1",
|
|
368
|
+
"eslint-plugin-stylelint-2": "^1.1.0",
|
|
359
369
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
360
370
|
"eslint-plugin-toml": "^1.3.1",
|
|
361
371
|
"eslint-plugin-total-functions": "^7.1.0",
|
|
362
372
|
"eslint-plugin-tsdoc": "^0.5.2",
|
|
363
|
-
"eslint-plugin-tsdoc-require-2": "^1.0
|
|
373
|
+
"eslint-plugin-tsdoc-require-2": "^1.1.0",
|
|
374
|
+
"eslint-plugin-typedoc": "^1.2.0",
|
|
375
|
+
"eslint-plugin-typefest": "^1.2.4",
|
|
364
376
|
"eslint-plugin-undefined-css-classes": "^0.1.5",
|
|
365
377
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
366
378
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
367
379
|
"eslint-plugin-write-good-comments": "^0.2.0",
|
|
380
|
+
"eslint-plugin-write-good-comments-2": "^1.0.6",
|
|
368
381
|
"eslint-plugin-yml": "^3.3.1",
|
|
369
382
|
"eslint-rule-benchmark": "^0.8.0",
|
|
370
|
-
"fast-check": "^4.
|
|
383
|
+
"fast-check": "^4.7.0",
|
|
371
384
|
"git-cliff": "^2.12.0",
|
|
372
385
|
"gitleaks-secret-scanner": "^2.1.1",
|
|
373
386
|
globals: "^17.5.0",
|
|
374
387
|
htmlhint: "^1.9.2",
|
|
375
388
|
jscpd: "^4.0.9",
|
|
376
389
|
"jsonc-eslint-parser": "^3.1.0",
|
|
377
|
-
knip: "^6.
|
|
390
|
+
knip: "^6.6.2",
|
|
378
391
|
leasot: "^14.4.0",
|
|
379
392
|
madge: "^8.0.0",
|
|
380
393
|
"markdown-link-check": "^3.14.2",
|
|
381
|
-
"npm-check-updates": "^
|
|
382
|
-
"npm-package-json-lint": "^10.2.
|
|
394
|
+
"npm-check-updates": "^21.0.3",
|
|
395
|
+
"npm-package-json-lint": "^10.2.1",
|
|
383
396
|
picocolors: "^1.1.1",
|
|
384
|
-
postcss: "^8.5.
|
|
397
|
+
postcss: "^8.5.10",
|
|
385
398
|
"postcss-assets": "^6.0.0",
|
|
386
399
|
"postcss-clamp": "^4.1.0",
|
|
387
400
|
"postcss-combine-duplicated-selectors": "^10.0.3",
|
|
@@ -394,17 +407,17 @@ var package_default = {
|
|
|
394
407
|
"postcss-reporter": "^7.1.0",
|
|
395
408
|
"postcss-round-subpixels": "^2.0.0",
|
|
396
409
|
"postcss-scss": "^4.0.9",
|
|
397
|
-
"postcss-sort-media-queries": "^6.
|
|
410
|
+
"postcss-sort-media-queries": "^6.5.0",
|
|
398
411
|
"postcss-styled-jsx": "^1.0.1",
|
|
399
412
|
"postcss-styled-syntax": "^0.7.1",
|
|
400
413
|
"postcss-viewport-height-correction": "^1.1.1",
|
|
401
|
-
prettier: "^3.8.
|
|
414
|
+
prettier: "^3.8.3",
|
|
402
415
|
"prettier-plugin-ini": "^1.3.0",
|
|
403
416
|
"prettier-plugin-interpolated-html-tags": "^2.0.1",
|
|
404
417
|
"prettier-plugin-jsdoc": "^1.8.0",
|
|
405
418
|
"prettier-plugin-jsdoc-type": "^0.2.0",
|
|
406
419
|
"prettier-plugin-merge": "^0.10.1",
|
|
407
|
-
"prettier-plugin-multiline-arrays": "^4.1.
|
|
420
|
+
"prettier-plugin-multiline-arrays": "^4.1.7",
|
|
408
421
|
"prettier-plugin-packagejson": "^3.0.2",
|
|
409
422
|
"prettier-plugin-properties": "^0.3.1",
|
|
410
423
|
"prettier-plugin-sort-json": "^4.2.0",
|
|
@@ -518,16 +531,16 @@ var package_default = {
|
|
|
518
531
|
"remark-validate-links": "^13.1.0",
|
|
519
532
|
"remark-wiki-link": "^2.0.1",
|
|
520
533
|
rimraf: "^6.1.3",
|
|
521
|
-
secretlint: "^
|
|
534
|
+
secretlint: "^12.2.0",
|
|
522
535
|
sloc: "^0.3.2",
|
|
523
536
|
"sort-package-json": "^3.6.1",
|
|
524
|
-
stylelint: "^17.
|
|
537
|
+
stylelint: "^17.9.0",
|
|
525
538
|
"stylelint-actions-formatters": "^16.3.1",
|
|
526
539
|
"stylelint-checkstyle-formatter": "^0.1.2",
|
|
527
540
|
"stylelint-codeframe-formatter": "^1.2.0",
|
|
528
541
|
"stylelint-config-alphabetical-order": "^2.0.0",
|
|
529
542
|
"stylelint-config-idiomatic-order": "^10.0.0",
|
|
530
|
-
"stylelint-config-inspector": "^2.
|
|
543
|
+
"stylelint-config-inspector": "^2.1.2",
|
|
531
544
|
"stylelint-config-recess-order": "^7.7.0",
|
|
532
545
|
"stylelint-config-recommended": "^18.0.0",
|
|
533
546
|
"stylelint-config-sass-guidelines": "^13.0.0",
|
|
@@ -536,7 +549,7 @@ var package_default = {
|
|
|
536
549
|
"stylelint-config-tailwindcss": "^1.0.1",
|
|
537
550
|
"stylelint-declaration-block-no-ignored-properties": "^3.0.0",
|
|
538
551
|
"stylelint-declaration-strict-value": "^1.11.1",
|
|
539
|
-
"stylelint-define-config": "^17.
|
|
552
|
+
"stylelint-define-config": "^17.8.0",
|
|
540
553
|
"stylelint-find-new-rules": "^6.0.0",
|
|
541
554
|
"stylelint-formatter-gitlab-code-quality-report": "^1.1.0",
|
|
542
555
|
"stylelint-formatter-pretty": "^4.0.1",
|
|
@@ -550,7 +563,7 @@ var package_default = {
|
|
|
550
563
|
"stylelint-no-unresolved-module": "^2.5.2",
|
|
551
564
|
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
552
565
|
"stylelint-order": "^8.1.1",
|
|
553
|
-
"stylelint-plugin-defensive-css": "^2.9.
|
|
566
|
+
"stylelint-plugin-defensive-css": "^2.9.1",
|
|
554
567
|
"stylelint-plugin-logical-css": "^2.1.0",
|
|
555
568
|
"stylelint-plugin-use-baseline": "^1.4.1",
|
|
556
569
|
"stylelint-prettier": "^5.0.3",
|
|
@@ -562,21 +575,21 @@ var package_default = {
|
|
|
562
575
|
"toml-eslint-parser": "^1.0.3",
|
|
563
576
|
"ts-unused-exports": "^11.0.1",
|
|
564
577
|
typedoc: "^0.28.19",
|
|
565
|
-
typescript: "^6.0.
|
|
566
|
-
"typescript-eslint": "^8.
|
|
578
|
+
typescript: "^6.0.3",
|
|
579
|
+
"typescript-eslint": "^8.59.0",
|
|
567
580
|
typesync: "^0.14.3",
|
|
568
581
|
vfile: "^6.0.3",
|
|
569
|
-
vite: "^8.0.
|
|
582
|
+
vite: "^8.0.10",
|
|
570
583
|
"vite-tsconfig-paths": "^6.1.1",
|
|
571
|
-
vitest: "^4.1.
|
|
584
|
+
vitest: "^4.1.5",
|
|
572
585
|
"yaml-eslint-parser": "^2.0.0",
|
|
573
586
|
"yamllint-js": "^0.2.4"
|
|
574
587
|
},
|
|
575
588
|
peerDependencies: {
|
|
576
|
-
eslint: "^9.0.0 || ^10.2.
|
|
589
|
+
eslint: "^9.0.0 || ^10.2.1",
|
|
577
590
|
typescript: ">=5.0.0"
|
|
578
591
|
},
|
|
579
|
-
packageManager: "npm@11.
|
|
592
|
+
packageManager: "npm@11.13.0",
|
|
580
593
|
engines: {
|
|
581
594
|
node: ">=22.0.0"
|
|
582
595
|
},
|
|
@@ -600,6 +613,7 @@ var package_default = {
|
|
|
600
613
|
};
|
|
601
614
|
|
|
602
615
|
// dist/_internal/copilot-config-references.js
|
|
616
|
+
var import_ts_extras = require("ts-extras");
|
|
603
617
|
var copilotConfigMetadataByName = {
|
|
604
618
|
all: {
|
|
605
619
|
icon: "\u{1F7E3}",
|
|
@@ -630,6 +644,7 @@ var copilotConfigMetadataByName = {
|
|
|
630
644
|
// dist/_internal/copilot-file-kind.js
|
|
631
645
|
var fs = __toESM(require("node:fs"), 1);
|
|
632
646
|
var path = __toESM(require("node:path"), 1);
|
|
647
|
+
var import_ts_extras2 = require("ts-extras");
|
|
633
648
|
var normalizeFilePath = (filePath) => path.resolve(filePath).replaceAll("\\", "/");
|
|
634
649
|
var isLegacyChatmodeFilePath = (filePath) => {
|
|
635
650
|
const normalizedFilePath = normalizeFilePath(filePath);
|
|
@@ -689,11 +704,11 @@ var getCopilotFileKind = (filePath) => {
|
|
|
689
704
|
};
|
|
690
705
|
var findRepositoryRoot = (filePath) => {
|
|
691
706
|
const normalizedFilePath = path.resolve(filePath);
|
|
692
|
-
const pathSegments = normalizeFilePath(normalizedFilePath)
|
|
707
|
+
const pathSegments = (0, import_ts_extras2.stringSplit)(normalizeFilePath(normalizedFilePath), "/");
|
|
693
708
|
const githubDirectoryIndex = pathSegments.lastIndexOf(".github");
|
|
694
709
|
if (githubDirectoryIndex > 0) {
|
|
695
710
|
const rootSegments = pathSegments.slice(0, githubDirectoryIndex);
|
|
696
|
-
const candidateRoot =
|
|
711
|
+
const candidateRoot = (0, import_ts_extras2.arrayJoin)(rootSegments, path.sep);
|
|
697
712
|
if (candidateRoot.length > 0) {
|
|
698
713
|
return candidateRoot;
|
|
699
714
|
}
|
|
@@ -725,6 +740,7 @@ var getRepositoryInstructionsPaths = (filePath) => {
|
|
|
725
740
|
var import_utils = require("@typescript-eslint/utils");
|
|
726
741
|
|
|
727
742
|
// dist/_internal/rule-catalog.js
|
|
743
|
+
var import_ts_extras3 = require("ts-extras");
|
|
728
744
|
var orderedRuleNames = [
|
|
729
745
|
"require-instructions-apply-to",
|
|
730
746
|
"require-prompt-file-metadata",
|
|
@@ -808,9 +824,7 @@ var copilotRuleCatalogEntries = orderedRuleNames.map((ruleName, index) => {
|
|
|
808
824
|
var copilotRuleCatalogByRuleName = new Map(copilotRuleCatalogEntries.map((entry) => [entry.ruleName, entry]));
|
|
809
825
|
var getRuleCatalogEntryForRuleName = (ruleName) => {
|
|
810
826
|
const entry = copilotRuleCatalogByRuleName.get(ruleName);
|
|
811
|
-
|
|
812
|
-
throw new TypeError(`Rule '${ruleName}' is missing from the stable rule catalog.`);
|
|
813
|
-
}
|
|
827
|
+
(0, import_ts_extras3.assertDefined)(entry);
|
|
814
828
|
return entry;
|
|
815
829
|
};
|
|
816
830
|
|
|
@@ -869,6 +883,7 @@ var createCopilotRule = (ruleDefinition) => {
|
|
|
869
883
|
};
|
|
870
884
|
|
|
871
885
|
// dist/_internal/frontmatter.js
|
|
886
|
+
var import_ts_extras4 = require("ts-extras");
|
|
872
887
|
var isAsciiLetter = (character) => character >= "A" && character <= "Z" || character >= "a" && character <= "z";
|
|
873
888
|
var isYamlIdentifierCharacter = (character) => isAsciiLetter(character) || character >= "0" && character <= "9" || character === "-";
|
|
874
889
|
var isSupportedFrontmatterFieldName = (value) => {
|
|
@@ -984,12 +999,15 @@ var stripQuotes = (value) => {
|
|
|
984
999
|
function normalizeScalarValue(value) {
|
|
985
1000
|
return stripQuotes(value.trim()).trim();
|
|
986
1001
|
}
|
|
987
|
-
var
|
|
1002
|
+
var withObjectEntryField = (target, source) => {
|
|
988
1003
|
const property = parseFieldLine(source.trim());
|
|
989
1004
|
if (property === null) {
|
|
990
|
-
return;
|
|
1005
|
+
return { ...target };
|
|
991
1006
|
}
|
|
992
|
-
|
|
1007
|
+
return {
|
|
1008
|
+
...target,
|
|
1009
|
+
[property.key]: normalizeScalarValue(property.value)
|
|
1010
|
+
};
|
|
993
1011
|
};
|
|
994
1012
|
var parseInlineList = (value) => {
|
|
995
1013
|
const trimmedValue = value.trim();
|
|
@@ -1000,7 +1018,7 @@ var parseInlineList = (value) => {
|
|
|
1000
1018
|
if (innerValue.length === 0) {
|
|
1001
1019
|
return [];
|
|
1002
1020
|
}
|
|
1003
|
-
return
|
|
1021
|
+
return (0, import_ts_extras4.stringSplit)(innerValue, ",").map((item) => normalizeScalarValue(item)).filter((item) => item.length > 0);
|
|
1004
1022
|
};
|
|
1005
1023
|
var parseBlockList = (lines) => lines.map((line) => {
|
|
1006
1024
|
const trimmedLine = line.trim();
|
|
@@ -1010,7 +1028,7 @@ var parseBlockList = (lines) => lines.map((line) => {
|
|
|
1010
1028
|
return normalizeScalarValue(trimmedLine.slice(1));
|
|
1011
1029
|
}).filter((value) => value.length > 0);
|
|
1012
1030
|
var parseFrontmatterFields = (content) => {
|
|
1013
|
-
const lines = content.replaceAll("\r\n", "\n")
|
|
1031
|
+
const lines = (0, import_ts_extras4.stringSplit)(content.replaceAll("\r\n", "\n"), "\n");
|
|
1014
1032
|
const fields = /* @__PURE__ */ new Map();
|
|
1015
1033
|
let index = 0;
|
|
1016
1034
|
while (index < lines.length) {
|
|
@@ -1092,134 +1110,145 @@ var getFrontmatterList = (document, key) => {
|
|
|
1092
1110
|
return field?.kind === "list" && field.values.length > 0 ? field.values : void 0;
|
|
1093
1111
|
};
|
|
1094
1112
|
var hasFrontmatterField = (document, key) => document.fields.has(key);
|
|
1095
|
-
var
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
const currentLine = lines[index] ?? "";
|
|
1113
|
+
var getFrontmatterContentLines = (document) => (0, import_ts_extras4.stringSplit)(document.content.replaceAll("\r\n", "\n"), "\n");
|
|
1114
|
+
var getTopLevelFrontmatterFieldBlock = (document, key) => {
|
|
1115
|
+
const lines = getFrontmatterContentLines(document);
|
|
1116
|
+
for (const [index, currentLine] of lines.entries()) {
|
|
1100
1117
|
if (currentLine.startsWith(" ") || currentLine.startsWith(" ")) {
|
|
1101
|
-
index += 1;
|
|
1102
1118
|
continue;
|
|
1103
1119
|
}
|
|
1104
1120
|
const field = parseFieldLine(currentLine.trimEnd());
|
|
1105
|
-
if (field
|
|
1106
|
-
index += 1;
|
|
1107
|
-
continue;
|
|
1108
|
-
}
|
|
1109
|
-
if (field.key !== key) {
|
|
1110
|
-
index += 1;
|
|
1121
|
+
if (field?.key !== key) {
|
|
1111
1122
|
continue;
|
|
1112
1123
|
}
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
}
|
|
1117
|
-
if (rawValue.length > 0) {
|
|
1118
|
-
return void 0;
|
|
1119
|
-
}
|
|
1120
|
-
const { blockLines } = collectIndentedBlockLines(lines, index + 1);
|
|
1121
|
-
const entries = [];
|
|
1122
|
-
let currentEntry = null;
|
|
1123
|
-
for (const blockLine of blockLines) {
|
|
1124
|
-
const trimmedLine = blockLine.trim();
|
|
1125
|
-
if (trimmedLine.startsWith("-")) {
|
|
1126
|
-
if (currentEntry !== null) {
|
|
1127
|
-
entries.push(currentEntry);
|
|
1128
|
-
}
|
|
1129
|
-
currentEntry = {};
|
|
1130
|
-
const inlineProperty = trimmedLine.slice(1).trim();
|
|
1131
|
-
if (inlineProperty.length > 0) {
|
|
1132
|
-
setObjectEntryField(currentEntry, inlineProperty);
|
|
1133
|
-
}
|
|
1134
|
-
continue;
|
|
1135
|
-
}
|
|
1136
|
-
if (currentEntry === null) {
|
|
1137
|
-
continue;
|
|
1138
|
-
}
|
|
1139
|
-
setObjectEntryField(currentEntry, trimmedLine);
|
|
1140
|
-
}
|
|
1141
|
-
if (currentEntry !== null) {
|
|
1142
|
-
entries.push(currentEntry);
|
|
1143
|
-
}
|
|
1144
|
-
return entries;
|
|
1124
|
+
return {
|
|
1125
|
+
blockLines: collectIndentedBlockLines(lines, index + 1).blockLines,
|
|
1126
|
+
rawValue: field.value.trim()
|
|
1127
|
+
};
|
|
1145
1128
|
}
|
|
1146
1129
|
return void 0;
|
|
1147
1130
|
};
|
|
1148
|
-
var
|
|
1149
|
-
const
|
|
1150
|
-
let
|
|
1151
|
-
|
|
1152
|
-
const
|
|
1153
|
-
if (
|
|
1154
|
-
|
|
1131
|
+
var parseFrontmatterObjectListEntries = (blockLines) => {
|
|
1132
|
+
const entries = [];
|
|
1133
|
+
let currentEntry = null;
|
|
1134
|
+
for (const blockLine of blockLines) {
|
|
1135
|
+
const trimmedLine = blockLine.trim();
|
|
1136
|
+
if (trimmedLine.startsWith("-")) {
|
|
1137
|
+
if (currentEntry !== null) {
|
|
1138
|
+
entries.push(currentEntry);
|
|
1139
|
+
}
|
|
1140
|
+
const inlineProperty = trimmedLine.slice(1).trim();
|
|
1141
|
+
currentEntry = inlineProperty.length === 0 ? {} : withObjectEntryField({}, inlineProperty);
|
|
1155
1142
|
continue;
|
|
1156
1143
|
}
|
|
1157
|
-
|
|
1158
|
-
if (field === null) {
|
|
1159
|
-
index += 1;
|
|
1144
|
+
if (currentEntry === null) {
|
|
1160
1145
|
continue;
|
|
1161
1146
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1147
|
+
currentEntry = withObjectEntryField(currentEntry, trimmedLine);
|
|
1148
|
+
}
|
|
1149
|
+
if (currentEntry !== null) {
|
|
1150
|
+
entries.push(currentEntry);
|
|
1151
|
+
}
|
|
1152
|
+
return entries;
|
|
1153
|
+
};
|
|
1154
|
+
var flushGroupedObjectListEntry = (groups, state) => {
|
|
1155
|
+
if (state.currentGroupName === null || state.currentEntry === null) {
|
|
1156
|
+
return state;
|
|
1157
|
+
}
|
|
1158
|
+
const groupEntries = groups.get(state.currentGroupName) ?? [];
|
|
1159
|
+
groupEntries.push(state.currentEntry);
|
|
1160
|
+
groups.set(state.currentGroupName, groupEntries);
|
|
1161
|
+
return {
|
|
1162
|
+
...state,
|
|
1163
|
+
currentEntry: null
|
|
1164
|
+
};
|
|
1165
|
+
};
|
|
1166
|
+
var isGroupedObjectListHeaderLine = (indentationWidth, trimmedLine) => !trimmedLine.startsWith("-") && indentationWidth <= 4;
|
|
1167
|
+
var createGroupedObjectListEntry = (trimmedLine) => {
|
|
1168
|
+
const inlineProperty = trimmedLine.slice(1).trim();
|
|
1169
|
+
return inlineProperty.length === 0 ? {} : withObjectEntryField({}, inlineProperty);
|
|
1170
|
+
};
|
|
1171
|
+
var handleGroupedObjectListHeaderLine = (groups, state, trimmedLine) => {
|
|
1172
|
+
const flushedState = flushGroupedObjectListEntry(groups, state);
|
|
1173
|
+
const groupField = parseFieldLine(trimmedLine);
|
|
1174
|
+
if (groupField === null) {
|
|
1175
|
+
return {
|
|
1176
|
+
...flushedState,
|
|
1177
|
+
currentGroupName: null
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
groups.set(groupField.key, groups.get(groupField.key) ?? []);
|
|
1181
|
+
return {
|
|
1182
|
+
...flushedState,
|
|
1183
|
+
currentGroupName: groupField.key
|
|
1184
|
+
};
|
|
1185
|
+
};
|
|
1186
|
+
var handleGroupedObjectListEntryStartLine = (groups, state, trimmedLine) => {
|
|
1187
|
+
const flushedState = flushGroupedObjectListEntry(groups, state);
|
|
1188
|
+
if (flushedState.currentGroupName === null) {
|
|
1189
|
+
return flushedState;
|
|
1190
|
+
}
|
|
1191
|
+
return {
|
|
1192
|
+
...flushedState,
|
|
1193
|
+
currentEntry: createGroupedObjectListEntry(trimmedLine)
|
|
1194
|
+
};
|
|
1195
|
+
};
|
|
1196
|
+
var handleGroupedObjectListPropertyLine = (state, trimmedLine) => {
|
|
1197
|
+
if (state.currentEntry === null) {
|
|
1198
|
+
return state;
|
|
1199
|
+
}
|
|
1200
|
+
return {
|
|
1201
|
+
...state,
|
|
1202
|
+
currentEntry: withObjectEntryField(state.currentEntry, trimmedLine)
|
|
1203
|
+
};
|
|
1204
|
+
};
|
|
1205
|
+
var parseFrontmatterObjectListGroups = (blockLines) => {
|
|
1206
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1207
|
+
let state = {
|
|
1208
|
+
currentEntry: null,
|
|
1209
|
+
currentGroupName: null
|
|
1210
|
+
};
|
|
1211
|
+
for (const blockLine of blockLines) {
|
|
1212
|
+
const indentationWidth = getIndentationWidth(blockLine);
|
|
1213
|
+
const trimmedLine = blockLine.trim();
|
|
1214
|
+
if (trimmedLine.length === 0) {
|
|
1164
1215
|
continue;
|
|
1165
1216
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1217
|
+
if (isGroupedObjectListHeaderLine(indentationWidth, trimmedLine)) {
|
|
1218
|
+
state = handleGroupedObjectListHeaderLine(groups, state, trimmedLine);
|
|
1219
|
+
continue;
|
|
1169
1220
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
let currentEntry = null;
|
|
1174
|
-
const flushCurrentEntry = () => {
|
|
1175
|
-
if (currentGroupName === null || currentEntry === null) {
|
|
1176
|
-
return;
|
|
1177
|
-
}
|
|
1178
|
-
const groupEntries = groups.get(currentGroupName) ?? [];
|
|
1179
|
-
groupEntries.push(currentEntry);
|
|
1180
|
-
groups.set(currentGroupName, groupEntries);
|
|
1181
|
-
currentEntry = null;
|
|
1182
|
-
};
|
|
1183
|
-
for (const blockLine of blockLines) {
|
|
1184
|
-
const indentationWidth = getIndentationWidth(blockLine);
|
|
1185
|
-
const trimmedLine = blockLine.trim();
|
|
1186
|
-
if (trimmedLine.length === 0) {
|
|
1187
|
-
continue;
|
|
1188
|
-
}
|
|
1189
|
-
if (!trimmedLine.startsWith("-") && indentationWidth <= 4) {
|
|
1190
|
-
flushCurrentEntry();
|
|
1191
|
-
const groupField = parseFieldLine(trimmedLine);
|
|
1192
|
-
if (groupField === null) {
|
|
1193
|
-
currentGroupName = null;
|
|
1194
|
-
continue;
|
|
1195
|
-
}
|
|
1196
|
-
currentGroupName = groupField.key;
|
|
1197
|
-
if (currentGroupName !== null && !groups.has(currentGroupName)) {
|
|
1198
|
-
groups.set(currentGroupName, []);
|
|
1199
|
-
}
|
|
1200
|
-
continue;
|
|
1201
|
-
}
|
|
1202
|
-
if (trimmedLine.startsWith("-")) {
|
|
1203
|
-
flushCurrentEntry();
|
|
1204
|
-
if (currentGroupName === null) {
|
|
1205
|
-
continue;
|
|
1206
|
-
}
|
|
1207
|
-
currentEntry = {};
|
|
1208
|
-
const inlineProperty = trimmedLine.slice(1).trim();
|
|
1209
|
-
if (inlineProperty.length > 0) {
|
|
1210
|
-
setObjectEntryField(currentEntry, inlineProperty);
|
|
1211
|
-
}
|
|
1212
|
-
continue;
|
|
1213
|
-
}
|
|
1214
|
-
if (currentEntry === null) {
|
|
1215
|
-
continue;
|
|
1216
|
-
}
|
|
1217
|
-
setObjectEntryField(currentEntry, trimmedLine);
|
|
1221
|
+
if (trimmedLine.startsWith("-")) {
|
|
1222
|
+
state = handleGroupedObjectListEntryStartLine(groups, state, trimmedLine);
|
|
1223
|
+
continue;
|
|
1218
1224
|
}
|
|
1219
|
-
|
|
1220
|
-
return groups;
|
|
1225
|
+
state = handleGroupedObjectListPropertyLine(state, trimmedLine);
|
|
1221
1226
|
}
|
|
1222
|
-
|
|
1227
|
+
flushGroupedObjectListEntry(groups, state);
|
|
1228
|
+
return groups;
|
|
1229
|
+
};
|
|
1230
|
+
var getFrontmatterObjectList = (document, key) => {
|
|
1231
|
+
const fieldBlock = getTopLevelFrontmatterFieldBlock(document, key);
|
|
1232
|
+
if (!(0, import_ts_extras4.isDefined)(fieldBlock)) {
|
|
1233
|
+
return void 0;
|
|
1234
|
+
}
|
|
1235
|
+
if (fieldBlock.rawValue === "[]") {
|
|
1236
|
+
return [];
|
|
1237
|
+
}
|
|
1238
|
+
if (fieldBlock.rawValue.length > 0) {
|
|
1239
|
+
return void 0;
|
|
1240
|
+
}
|
|
1241
|
+
return parseFrontmatterObjectListEntries(fieldBlock.blockLines);
|
|
1242
|
+
};
|
|
1243
|
+
var getFrontmatterObjectListGroups = (document, key) => {
|
|
1244
|
+
const fieldBlock = getTopLevelFrontmatterFieldBlock(document, key);
|
|
1245
|
+
if (!(0, import_ts_extras4.isDefined)(fieldBlock)) {
|
|
1246
|
+
return void 0;
|
|
1247
|
+
}
|
|
1248
|
+
if (fieldBlock.rawValue.length > 0) {
|
|
1249
|
+
return void 0;
|
|
1250
|
+
}
|
|
1251
|
+
return parseFrontmatterObjectListGroups(fieldBlock.blockLines);
|
|
1223
1252
|
};
|
|
1224
1253
|
var getMeaningfulMarkdownBody = (text) => stripHtmlComments(text).trim();
|
|
1225
1254
|
|
|
@@ -1269,7 +1298,8 @@ var noBlankCustomizationBodyRule = createCopilotRule({
|
|
|
1269
1298
|
description: "disallow blank bodies in Copilot customization files other than repository-wide instructions.",
|
|
1270
1299
|
frozen: false,
|
|
1271
1300
|
recommended: true,
|
|
1272
|
-
requiresTypeChecking: false
|
|
1301
|
+
requiresTypeChecking: false,
|
|
1302
|
+
url: createRuleDocsUrl("no-blank-customization-body")
|
|
1273
1303
|
},
|
|
1274
1304
|
messages: {
|
|
1275
1305
|
blankBody: "Copilot customization files should include meaningful Markdown instructions in the document body, not only frontmatter or comments."
|
|
@@ -1309,7 +1339,8 @@ var noBlankRepositoryInstructionsRule = createCopilotRule({
|
|
|
1309
1339
|
description: "disallow empty repository-wide Copilot instructions files.",
|
|
1310
1340
|
frozen: false,
|
|
1311
1341
|
recommended: true,
|
|
1312
|
-
requiresTypeChecking: false
|
|
1342
|
+
requiresTypeChecking: false,
|
|
1343
|
+
url: createRuleDocsUrl("no-blank-repository-instructions")
|
|
1313
1344
|
},
|
|
1314
1345
|
messages: {
|
|
1315
1346
|
blankInstructions: "Repository-wide Copilot instructions should contain actionable Markdown guidance instead of being blank."
|
|
@@ -1349,7 +1380,8 @@ var noBlankSkillBodyRule = createCopilotRule({
|
|
|
1349
1380
|
description: "disallow blank Copilot skill definition bodies.",
|
|
1350
1381
|
frozen: false,
|
|
1351
1382
|
recommended: true,
|
|
1352
|
-
requiresTypeChecking: false
|
|
1383
|
+
requiresTypeChecking: false,
|
|
1384
|
+
url: createRuleDocsUrl("no-blank-skill-body")
|
|
1353
1385
|
},
|
|
1354
1386
|
messages: {
|
|
1355
1387
|
blankSkillBody: "Copilot skill definition files should include a non-empty Markdown body with instructions, examples, or guidance."
|
|
@@ -1388,7 +1420,8 @@ var noDeprecatedAgentInferRule = createCopilotRule({
|
|
|
1388
1420
|
description: "disallow deprecated `infer` frontmatter in Copilot custom agent files.",
|
|
1389
1421
|
frozen: false,
|
|
1390
1422
|
recommended: true,
|
|
1391
|
-
requiresTypeChecking: false
|
|
1423
|
+
requiresTypeChecking: false,
|
|
1424
|
+
url: createRuleDocsUrl("no-deprecated-agent-infer")
|
|
1392
1425
|
},
|
|
1393
1426
|
messages: {
|
|
1394
1427
|
deprecatedInfer: "Copilot custom agent files should replace deprecated `infer` frontmatter with `user-invocable` and/or `disable-model-invocation`."
|
|
@@ -1403,6 +1436,7 @@ var no_deprecated_agent_infer_default = noDeprecatedAgentInferRule;
|
|
|
1403
1436
|
// dist/rules/no-duplicate-agent-names.js
|
|
1404
1437
|
var fs3 = __toESM(require("node:fs"), 1);
|
|
1405
1438
|
var path4 = __toESM(require("node:path"), 1);
|
|
1439
|
+
var import_ts_extras6 = require("ts-extras");
|
|
1406
1440
|
|
|
1407
1441
|
// dist/_internal/copilot-customization-names.js
|
|
1408
1442
|
var path2 = __toESM(require("node:path"), 1);
|
|
@@ -1459,6 +1493,7 @@ var collectDuplicateNameGroups = (entries, normalizeName) => {
|
|
|
1459
1493
|
// dist/_internal/file-system.js
|
|
1460
1494
|
var fs2 = __toESM(require("node:fs"), 1);
|
|
1461
1495
|
var path3 = __toESM(require("node:path"), 1);
|
|
1496
|
+
var import_ts_extras5 = require("ts-extras");
|
|
1462
1497
|
var WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[/\\]/u;
|
|
1463
1498
|
var URI_SCHEME_PATTERN = /^[A-Za-z][+\-.0-9A-Za-z]*:/u;
|
|
1464
1499
|
var normalizeAbsolutePath = (filePath) => path3.resolve(filePath).replaceAll("\\", "/");
|
|
@@ -1467,7 +1502,7 @@ var stripPathFragmentAndQuery = (value) => {
|
|
|
1467
1502
|
const queryIndex = value.indexOf("?");
|
|
1468
1503
|
const fragmentIndex = value.indexOf("#");
|
|
1469
1504
|
const cutIndexCandidates = [queryIndex, fragmentIndex].filter((index) => index >= 0);
|
|
1470
|
-
if (
|
|
1505
|
+
if ((0, import_ts_extras5.isEmpty)(cutIndexCandidates)) {
|
|
1471
1506
|
return value;
|
|
1472
1507
|
}
|
|
1473
1508
|
return value.slice(0, Math.min(...cutIndexCandidates));
|
|
@@ -1491,6 +1526,30 @@ var isRelativeWorkspacePath = (value) => {
|
|
|
1491
1526
|
};
|
|
1492
1527
|
var resolveRelativeWorkspacePath = (currentFilePath, relativePath) => path3.resolve(path3.dirname(currentFilePath), stripPathFragmentAndQuery(relativePath));
|
|
1493
1528
|
var resolveRepositoryRelativePath = (repositoryRootPath, relativePath) => path3.resolve(repositoryRootPath, stripPathFragmentAndQuery(relativePath));
|
|
1529
|
+
var collectDirectoryFiles = (currentDirectory, predicate) => {
|
|
1530
|
+
const discoveredFiles = [];
|
|
1531
|
+
const pendingDirectories = [];
|
|
1532
|
+
for (const entry of fs2.readdirSync(currentDirectory, {
|
|
1533
|
+
withFileTypes: true
|
|
1534
|
+
})) {
|
|
1535
|
+
const absoluteEntryPath = path3.join(currentDirectory, entry.name);
|
|
1536
|
+
if (entry.isDirectory()) {
|
|
1537
|
+
pendingDirectories.push(absoluteEntryPath);
|
|
1538
|
+
continue;
|
|
1539
|
+
}
|
|
1540
|
+
if (!entry.isFile()) {
|
|
1541
|
+
continue;
|
|
1542
|
+
}
|
|
1543
|
+
if ((0, import_ts_extras5.isDefined)(predicate) && !predicate(absoluteEntryPath)) {
|
|
1544
|
+
continue;
|
|
1545
|
+
}
|
|
1546
|
+
discoveredFiles.push(absoluteEntryPath);
|
|
1547
|
+
}
|
|
1548
|
+
return {
|
|
1549
|
+
discoveredFiles,
|
|
1550
|
+
pendingDirectories
|
|
1551
|
+
};
|
|
1552
|
+
};
|
|
1494
1553
|
var listFilesRecursively = (directoryPath, predicate) => {
|
|
1495
1554
|
if (!pathExists(directoryPath)) {
|
|
1496
1555
|
return [];
|
|
@@ -1499,25 +1558,12 @@ var listFilesRecursively = (directoryPath, predicate) => {
|
|
|
1499
1558
|
const pendingDirectories = [directoryPath];
|
|
1500
1559
|
while (pendingDirectories.length > 0) {
|
|
1501
1560
|
const currentDirectory = pendingDirectories.pop();
|
|
1502
|
-
if (
|
|
1561
|
+
if (!(0, import_ts_extras5.isDefined)(currentDirectory)) {
|
|
1503
1562
|
continue;
|
|
1504
1563
|
}
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
const absoluteEntryPath = path3.join(currentDirectory, entry.name);
|
|
1509
|
-
if (entry.isDirectory()) {
|
|
1510
|
-
pendingDirectories.push(absoluteEntryPath);
|
|
1511
|
-
continue;
|
|
1512
|
-
}
|
|
1513
|
-
if (!entry.isFile()) {
|
|
1514
|
-
continue;
|
|
1515
|
-
}
|
|
1516
|
-
if (predicate !== void 0 && !predicate(absoluteEntryPath)) {
|
|
1517
|
-
continue;
|
|
1518
|
-
}
|
|
1519
|
-
discoveredFiles.push(absoluteEntryPath);
|
|
1520
|
-
}
|
|
1564
|
+
const currentDirectoryContents = collectDirectoryFiles(currentDirectory, predicate);
|
|
1565
|
+
pendingDirectories.push(...currentDirectoryContents.pendingDirectories);
|
|
1566
|
+
discoveredFiles.push(...currentDirectoryContents.discoveredFiles);
|
|
1521
1567
|
}
|
|
1522
1568
|
return discoveredFiles.toSorted((left, right) => left.localeCompare(right));
|
|
1523
1569
|
};
|
|
@@ -1542,12 +1588,12 @@ var noDuplicateAgentNamesRule = createCopilotRule({
|
|
|
1542
1588
|
}), normalizeNameForComparison);
|
|
1543
1589
|
const currentAgentName = getAgentName(context.filename, extractFrontmatter(context.sourceCode.text));
|
|
1544
1590
|
const duplicateGroup = duplicateGroups.get(normalizeNameForComparison(currentAgentName));
|
|
1545
|
-
if (
|
|
1591
|
+
if (!(0, import_ts_extras6.isDefined)(duplicateGroup)) {
|
|
1546
1592
|
return;
|
|
1547
1593
|
}
|
|
1548
1594
|
reportAtDocumentStart(context, {
|
|
1549
1595
|
data: {
|
|
1550
|
-
files: duplicateGroup.map((entry) => normalizeRelativeFilePath(repositoryRoot, entry.filePath))
|
|
1596
|
+
files: (0, import_ts_extras6.arrayJoin)(duplicateGroup.map((entry) => normalizeRelativeFilePath(repositoryRoot, entry.filePath)), ", "),
|
|
1551
1597
|
name: currentAgentName
|
|
1552
1598
|
},
|
|
1553
1599
|
messageId: "duplicateAgentName"
|
|
@@ -1565,7 +1611,8 @@ var noDuplicateAgentNamesRule = createCopilotRule({
|
|
|
1565
1611
|
description: "disallow duplicate effective custom-agent names across workspace custom-agent files.",
|
|
1566
1612
|
frozen: false,
|
|
1567
1613
|
recommended: true,
|
|
1568
|
-
requiresTypeChecking: false
|
|
1614
|
+
requiresTypeChecking: false,
|
|
1615
|
+
url: createRuleDocsUrl("no-duplicate-agent-names")
|
|
1569
1616
|
},
|
|
1570
1617
|
messages: {
|
|
1571
1618
|
duplicateAgentName: "Copilot custom-agent name `{{name}}` is duplicated across agent files: {{files}}."
|
|
@@ -1580,6 +1627,7 @@ var no_duplicate_agent_names_default = noDuplicateAgentNamesRule;
|
|
|
1580
1627
|
// dist/rules/no-duplicate-prompt-names.js
|
|
1581
1628
|
var fs4 = __toESM(require("node:fs"), 1);
|
|
1582
1629
|
var path5 = __toESM(require("node:path"), 1);
|
|
1630
|
+
var import_ts_extras7 = require("ts-extras");
|
|
1583
1631
|
var normalizeRelativeFilePath2 = (repositoryRoot, filePath) => path5.relative(repositoryRoot, filePath).replaceAll("\\", "/");
|
|
1584
1632
|
var noDuplicatePromptNamesRule = createCopilotRule({
|
|
1585
1633
|
create(context) {
|
|
@@ -1599,12 +1647,12 @@ var noDuplicatePromptNamesRule = createCopilotRule({
|
|
|
1599
1647
|
}), normalizeNameForComparison);
|
|
1600
1648
|
const currentPromptName = getPromptName(context.filename, extractFrontmatter(context.sourceCode.text));
|
|
1601
1649
|
const duplicateGroup = duplicateGroups.get(normalizeNameForComparison(currentPromptName));
|
|
1602
|
-
if (
|
|
1650
|
+
if (!(0, import_ts_extras7.isDefined)(duplicateGroup)) {
|
|
1603
1651
|
return;
|
|
1604
1652
|
}
|
|
1605
1653
|
reportAtDocumentStart(context, {
|
|
1606
1654
|
data: {
|
|
1607
|
-
files: duplicateGroup.map((entry) => normalizeRelativeFilePath2(repositoryRoot, entry.filePath))
|
|
1655
|
+
files: (0, import_ts_extras7.arrayJoin)(duplicateGroup.map((entry) => normalizeRelativeFilePath2(repositoryRoot, entry.filePath)), ", "),
|
|
1608
1656
|
name: currentPromptName
|
|
1609
1657
|
},
|
|
1610
1658
|
messageId: "duplicatePromptName"
|
|
@@ -1622,7 +1670,8 @@ var noDuplicatePromptNamesRule = createCopilotRule({
|
|
|
1622
1670
|
description: "disallow duplicate effective prompt names across workspace prompt files.",
|
|
1623
1671
|
frozen: false,
|
|
1624
1672
|
recommended: true,
|
|
1625
|
-
requiresTypeChecking: false
|
|
1673
|
+
requiresTypeChecking: false,
|
|
1674
|
+
url: createRuleDocsUrl("no-duplicate-prompt-names")
|
|
1626
1675
|
},
|
|
1627
1676
|
messages: {
|
|
1628
1677
|
duplicatePromptName: "Copilot prompt name `{{name}}` is duplicated across prompt files: {{files}}."
|
|
@@ -1637,6 +1686,7 @@ var no_duplicate_prompt_names_default = noDuplicatePromptNamesRule;
|
|
|
1637
1686
|
// dist/rules/no-duplicate-skill-names.js
|
|
1638
1687
|
var fs5 = __toESM(require("node:fs"), 1);
|
|
1639
1688
|
var path6 = __toESM(require("node:path"), 1);
|
|
1689
|
+
var import_ts_extras8 = require("ts-extras");
|
|
1640
1690
|
var normalizeRelativeFilePath3 = (repositoryRoot, filePath) => path6.relative(repositoryRoot, filePath).replaceAll("\\", "/");
|
|
1641
1691
|
var noDuplicateSkillNamesRule = createCopilotRule({
|
|
1642
1692
|
create(context) {
|
|
@@ -1658,12 +1708,12 @@ var noDuplicateSkillNamesRule = createCopilotRule({
|
|
|
1658
1708
|
}), normalizeNameForComparison);
|
|
1659
1709
|
const currentSkillName = getSkillName(context.filename, extractFrontmatter(context.sourceCode.text));
|
|
1660
1710
|
const duplicateGroup = duplicateGroups.get(normalizeNameForComparison(currentSkillName));
|
|
1661
|
-
if (
|
|
1711
|
+
if (!(0, import_ts_extras8.isDefined)(duplicateGroup)) {
|
|
1662
1712
|
return;
|
|
1663
1713
|
}
|
|
1664
1714
|
reportAtDocumentStart(context, {
|
|
1665
1715
|
data: {
|
|
1666
|
-
files: duplicateGroup.map((entry) => normalizeRelativeFilePath3(repositoryRoot, entry.filePath))
|
|
1716
|
+
files: (0, import_ts_extras8.arrayJoin)(duplicateGroup.map((entry) => normalizeRelativeFilePath3(repositoryRoot, entry.filePath)), ", "),
|
|
1667
1717
|
name: currentSkillName
|
|
1668
1718
|
},
|
|
1669
1719
|
messageId: "duplicateSkillName"
|
|
@@ -1681,7 +1731,8 @@ var noDuplicateSkillNamesRule = createCopilotRule({
|
|
|
1681
1731
|
description: "disallow duplicate effective skill names across project skill definition files.",
|
|
1682
1732
|
frozen: false,
|
|
1683
1733
|
recommended: true,
|
|
1684
|
-
requiresTypeChecking: false
|
|
1734
|
+
requiresTypeChecking: false,
|
|
1735
|
+
url: createRuleDocsUrl("no-duplicate-skill-names")
|
|
1685
1736
|
},
|
|
1686
1737
|
messages: {
|
|
1687
1738
|
duplicateSkillName: "Copilot skill name `{{name}}` is duplicated across skill files: {{files}}."
|
|
@@ -1696,6 +1747,7 @@ var no_duplicate_skill_names_default = noDuplicateSkillNamesRule;
|
|
|
1696
1747
|
// dist/rules/no-duplicate-slash-command-names.js
|
|
1697
1748
|
var fs6 = __toESM(require("node:fs"), 1);
|
|
1698
1749
|
var path7 = __toESM(require("node:path"), 1);
|
|
1750
|
+
var import_ts_extras9 = require("ts-extras");
|
|
1699
1751
|
var isPromptOrSkillCommandFile = (filePath) => filePath.endsWith(".prompt.md") || isSkillFilePath(filePath);
|
|
1700
1752
|
var normalizeRelativeFilePath4 = (repositoryRoot, filePath) => path7.relative(repositoryRoot, filePath).replaceAll("\\", "/");
|
|
1701
1753
|
var noDuplicateSlashCommandNamesRule = createCopilotRule({
|
|
@@ -1721,12 +1773,12 @@ var noDuplicateSlashCommandNamesRule = createCopilotRule({
|
|
|
1721
1773
|
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
1722
1774
|
const currentCommandName = context.filename.endsWith(".prompt.md") ? getPromptName(context.filename, frontmatter) : getSkillName(context.filename, frontmatter);
|
|
1723
1775
|
const duplicateGroup = duplicateGroups.get(normalizeNameForComparison(currentCommandName));
|
|
1724
|
-
if (
|
|
1776
|
+
if (!(0, import_ts_extras9.isDefined)(duplicateGroup)) {
|
|
1725
1777
|
return;
|
|
1726
1778
|
}
|
|
1727
1779
|
reportAtDocumentStart(context, {
|
|
1728
1780
|
data: {
|
|
1729
|
-
files: duplicateGroup.map((entry) => normalizeRelativeFilePath4(repositoryRoot, entry.filePath))
|
|
1781
|
+
files: (0, import_ts_extras9.arrayJoin)(duplicateGroup.map((entry) => normalizeRelativeFilePath4(repositoryRoot, entry.filePath)), ", "),
|
|
1730
1782
|
name: currentCommandName
|
|
1731
1783
|
},
|
|
1732
1784
|
messageId: "duplicateSlashCommandName"
|
|
@@ -1744,7 +1796,8 @@ var noDuplicateSlashCommandNamesRule = createCopilotRule({
|
|
|
1744
1796
|
description: "disallow duplicate slash-command names across prompt files and skills.",
|
|
1745
1797
|
frozen: false,
|
|
1746
1798
|
recommended: true,
|
|
1747
|
-
requiresTypeChecking: false
|
|
1799
|
+
requiresTypeChecking: false,
|
|
1800
|
+
url: createRuleDocsUrl("no-duplicate-slash-command-names")
|
|
1748
1801
|
},
|
|
1749
1802
|
messages: {
|
|
1750
1803
|
duplicateSlashCommandName: "Slash command name `{{name}}` is duplicated across prompt or skill files: {{files}}."
|
|
@@ -1756,7 +1809,11 @@ var noDuplicateSlashCommandNamesRule = createCopilotRule({
|
|
|
1756
1809
|
});
|
|
1757
1810
|
var no_duplicate_slash_command_names_default = noDuplicateSlashCommandNamesRule;
|
|
1758
1811
|
|
|
1812
|
+
// dist/rules/no-empty-repository-hook-arrays.js
|
|
1813
|
+
var import_ts_extras11 = require("ts-extras");
|
|
1814
|
+
|
|
1759
1815
|
// dist/_internal/repository-hooks-json.js
|
|
1816
|
+
var import_ts_extras10 = require("ts-extras");
|
|
1760
1817
|
var DEFAULT_REPOSITORY_HOOK_TIMEOUT_SECONDS = 30;
|
|
1761
1818
|
var VALID_REPOSITORY_HOOK_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
1762
1819
|
"agentStop",
|
|
@@ -1769,15 +1826,15 @@ var VALID_REPOSITORY_HOOK_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
|
1769
1826
|
"userPromptSubmitted"
|
|
1770
1827
|
]);
|
|
1771
1828
|
var VALID_REPOSITORY_HOOK_TYPES = /* @__PURE__ */ new Set(["command", "prompt"]);
|
|
1772
|
-
var isRepositoryHookEventName = (value) =>
|
|
1773
|
-
var isRepositoryHookType = (value) =>
|
|
1829
|
+
var isRepositoryHookEventName = (value) => (0, import_ts_extras10.setHas)(VALID_REPOSITORY_HOOK_EVENT_NAMES, value);
|
|
1830
|
+
var isRepositoryHookType = (value) => (0, import_ts_extras10.setHas)(VALID_REPOSITORY_HOOK_TYPES, value);
|
|
1774
1831
|
var isJsonObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1775
1832
|
var isJsonArray = (value) => Array.isArray(value);
|
|
1776
1833
|
var isJsonString = (value) => typeof value === "string";
|
|
1777
|
-
var isJsonNumber = (value) => typeof value === "number" &&
|
|
1834
|
+
var isJsonNumber = (value) => typeof value === "number" && (0, import_ts_extras10.isFinite)(value);
|
|
1778
1835
|
var parseJsonText = (text) => {
|
|
1779
1836
|
try {
|
|
1780
|
-
return JSON.parse(text);
|
|
1837
|
+
return (0, import_ts_extras10.safeCastTo)(JSON.parse(text));
|
|
1781
1838
|
} catch {
|
|
1782
1839
|
return void 0;
|
|
1783
1840
|
}
|
|
@@ -1786,7 +1843,7 @@ var getRepositoryHooksValue = (root) => isJsonObject(root) ? root["hooks"] : voi
|
|
|
1786
1843
|
var getRepositoryHooksVersionValue = (root) => isJsonObject(root) ? root["version"] : void 0;
|
|
1787
1844
|
var getRepositoryHookEventEntries = (root) => {
|
|
1788
1845
|
const hooksValue = getRepositoryHooksValue(root);
|
|
1789
|
-
return isJsonObject(hooksValue) ?
|
|
1846
|
+
return isJsonObject(hooksValue) ? (0, import_ts_extras10.objectEntries)(hooksValue) : [];
|
|
1790
1847
|
};
|
|
1791
1848
|
var getRepositoryHookObjects = (root) => {
|
|
1792
1849
|
const hookEntries = [];
|
|
@@ -1808,7 +1865,7 @@ var getRepositoryHookObjects = (root) => {
|
|
|
1808
1865
|
return hookEntries;
|
|
1809
1866
|
};
|
|
1810
1867
|
var formatJsonValue = (value) => {
|
|
1811
|
-
if (
|
|
1868
|
+
if (!(0, import_ts_extras10.isDefined)(value)) {
|
|
1812
1869
|
return "(missing)";
|
|
1813
1870
|
}
|
|
1814
1871
|
if (typeof value === "string") {
|
|
@@ -1826,13 +1883,13 @@ var noEmptyRepositoryHookArraysRule = createCopilotRule({
|
|
|
1826
1883
|
return;
|
|
1827
1884
|
}
|
|
1828
1885
|
const root = parseJsonText(context.sourceCode.text);
|
|
1829
|
-
const emptyEntry = getRepositoryHookEventEntries(root).find(([, eventValue]) => isJsonArray(eventValue) &&
|
|
1830
|
-
if (
|
|
1886
|
+
const emptyEntry = getRepositoryHookEventEntries(root).find(([, eventValue]) => isJsonArray(eventValue) && (0, import_ts_extras11.isEmpty)(eventValue));
|
|
1887
|
+
if (!(0, import_ts_extras11.isDefined)(emptyEntry)) {
|
|
1831
1888
|
return;
|
|
1832
1889
|
}
|
|
1833
1890
|
reportAtDocumentStart(context, {
|
|
1834
1891
|
data: {
|
|
1835
|
-
eventName: emptyEntry
|
|
1892
|
+
eventName: (0, import_ts_extras11.arrayFirst)(emptyEntry)
|
|
1836
1893
|
},
|
|
1837
1894
|
messageId: "emptyRepositoryHookArray"
|
|
1838
1895
|
});
|
|
@@ -1846,7 +1903,8 @@ var noEmptyRepositoryHookArraysRule = createCopilotRule({
|
|
|
1846
1903
|
description: "disallow empty repository hook arrays that opt into an event without any hook definitions.",
|
|
1847
1904
|
frozen: false,
|
|
1848
1905
|
recommended: false,
|
|
1849
|
-
requiresTypeChecking: false
|
|
1906
|
+
requiresTypeChecking: false,
|
|
1907
|
+
url: createRuleDocsUrl("no-empty-repository-hook-arrays")
|
|
1850
1908
|
},
|
|
1851
1909
|
messages: {
|
|
1852
1910
|
emptyRepositoryHookArray: "Repository hook event `{{eventName}}` should not be declared with an empty array."
|
|
@@ -1881,7 +1939,8 @@ var noLegacyChatmodeFilesRule = createCopilotRule({
|
|
|
1881
1939
|
description: "disallow legacy Copilot `.chatmode.md` files in favor of modern `.agent.md` custom agents.",
|
|
1882
1940
|
frozen: false,
|
|
1883
1941
|
recommended: true,
|
|
1884
|
-
requiresTypeChecking: false
|
|
1942
|
+
requiresTypeChecking: false,
|
|
1943
|
+
url: createRuleDocsUrl("no-legacy-chatmode-files")
|
|
1885
1944
|
},
|
|
1886
1945
|
messages: {
|
|
1887
1946
|
legacyChatmodeFile: "Legacy Copilot `.chatmode.md` files should be migrated to `.github/agents/*.agent.md` custom agents."
|
|
@@ -1925,7 +1984,8 @@ var preferCustomInstructionsUnderCodeReviewLimitRule = createCopilotRule({
|
|
|
1925
1984
|
description: "enforce repository and path-specific Copilot instruction files staying within the 4,000-character code-review instruction budget.",
|
|
1926
1985
|
frozen: false,
|
|
1927
1986
|
recommended: false,
|
|
1928
|
-
requiresTypeChecking: false
|
|
1987
|
+
requiresTypeChecking: false,
|
|
1988
|
+
url: createRuleDocsUrl("prefer-custom-instructions-under-code-review-limit")
|
|
1929
1989
|
},
|
|
1930
1990
|
messages: {
|
|
1931
1991
|
exceedsCodeReviewLimit: "Copilot code review only reads roughly the first {{maxCharacters}} characters of custom instructions; this file is {{characterCount}} characters long."
|
|
@@ -1938,6 +1998,7 @@ var preferCustomInstructionsUnderCodeReviewLimitRule = createCopilotRule({
|
|
|
1938
1998
|
var prefer_custom_instructions_under_code_review_limit_default = preferCustomInstructionsUnderCodeReviewLimitRule;
|
|
1939
1999
|
|
|
1940
2000
|
// dist/rules/prefer-fast-repository-hooks.js
|
|
2001
|
+
var import_ts_extras12 = require("ts-extras");
|
|
1941
2002
|
var preferFastRepositoryHooksRule = createCopilotRule({
|
|
1942
2003
|
create(context) {
|
|
1943
2004
|
return {
|
|
@@ -1950,7 +2011,7 @@ var preferFastRepositoryHooksRule = createCopilotRule({
|
|
|
1950
2011
|
const timeout2 = hook["timeoutSec"];
|
|
1951
2012
|
return isJsonNumber(timeout2) && timeout2 > DEFAULT_REPOSITORY_HOOK_TIMEOUT_SECONDS;
|
|
1952
2013
|
});
|
|
1953
|
-
if (
|
|
2014
|
+
if (!(0, import_ts_extras12.isDefined)(slowHook)) {
|
|
1954
2015
|
return;
|
|
1955
2016
|
}
|
|
1956
2017
|
const timeout = slowHook.hook["timeoutSec"];
|
|
@@ -1974,7 +2035,8 @@ var preferFastRepositoryHooksRule = createCopilotRule({
|
|
|
1974
2035
|
description: "enforce repository hooks staying at or below the default 30-second timeout unless a slower hook is truly necessary.",
|
|
1975
2036
|
frozen: false,
|
|
1976
2037
|
recommended: false,
|
|
1977
|
-
requiresTypeChecking: false
|
|
2038
|
+
requiresTypeChecking: false,
|
|
2039
|
+
url: createRuleDocsUrl("prefer-fast-repository-hooks")
|
|
1978
2040
|
},
|
|
1979
2041
|
messages: {
|
|
1980
2042
|
slowRepositoryHookTimeout: "Repository hook `timeoutSec` for `{{eventName}}` is {{timeout}} seconds, which exceeds the default 30-second timeout budget."
|
|
@@ -1987,8 +2049,10 @@ var preferFastRepositoryHooksRule = createCopilotRule({
|
|
|
1987
2049
|
var prefer_fast_repository_hooks_default = preferFastRepositoryHooksRule;
|
|
1988
2050
|
|
|
1989
2051
|
// dist/rules/prefer-qualified-tools.js
|
|
2052
|
+
var import_ts_extras13 = require("ts-extras");
|
|
1990
2053
|
var isQualifiedToolName = (toolName) => toolName.includes("/");
|
|
1991
2054
|
var allowedUnqualifiedToolNames = /* @__PURE__ */ new Set(["agent", "runSubagent"]);
|
|
2055
|
+
var isAllowedUnqualifiedToolName = (toolName) => (0, import_ts_extras13.setHas)(allowedUnqualifiedToolNames, toolName);
|
|
1992
2056
|
var preferQualifiedToolsRule = createCopilotRule({
|
|
1993
2057
|
create(context) {
|
|
1994
2058
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2001,11 +2065,11 @@ var preferQualifiedToolsRule = createCopilotRule({
|
|
|
2001
2065
|
return;
|
|
2002
2066
|
}
|
|
2003
2067
|
const tools = getFrontmatterList(frontmatter, "tools");
|
|
2004
|
-
if (
|
|
2068
|
+
if (!(0, import_ts_extras13.isDefined)(tools)) {
|
|
2005
2069
|
return;
|
|
2006
2070
|
}
|
|
2007
|
-
const firstUnqualifiedTool = tools.find((toolName) => !isQualifiedToolName(toolName) && !
|
|
2008
|
-
if (firstUnqualifiedTool ===
|
|
2071
|
+
const firstUnqualifiedTool = tools.find((toolName) => !isQualifiedToolName(toolName) && !isAllowedUnqualifiedToolName(toolName)) ?? null;
|
|
2072
|
+
if (firstUnqualifiedTool === null) {
|
|
2009
2073
|
return;
|
|
2010
2074
|
}
|
|
2011
2075
|
reportAtDocumentStart(context, {
|
|
@@ -2021,7 +2085,8 @@ var preferQualifiedToolsRule = createCopilotRule({
|
|
|
2021
2085
|
description: "enforce fully-qualified tool names in Copilot prompt files, custom agents, and legacy chat modes.",
|
|
2022
2086
|
frozen: false,
|
|
2023
2087
|
recommended: false,
|
|
2024
|
-
requiresTypeChecking: false
|
|
2088
|
+
requiresTypeChecking: false,
|
|
2089
|
+
url: createRuleDocsUrl("prefer-qualified-tools")
|
|
2025
2090
|
},
|
|
2026
2091
|
messages: {
|
|
2027
2092
|
preferQualifiedTool: "Prefer fully-qualified Copilot tool names in `tools` metadata when a documented built-in alias is not required. `{{toolName}}` should include a provider or tool-set prefix such as `search/codebase`."
|
|
@@ -2034,7 +2099,8 @@ var preferQualifiedToolsRule = createCopilotRule({
|
|
|
2034
2099
|
var prefer_qualified_tools_default = preferQualifiedToolsRule;
|
|
2035
2100
|
|
|
2036
2101
|
// dist/rules/require-agent-tool-for-subagents.js
|
|
2037
|
-
var
|
|
2102
|
+
var import_ts_extras14 = require("ts-extras");
|
|
2103
|
+
var hasAgentTool = (tools) => tools?.some((toolName) => (0, import_ts_extras14.arrayAt)((0, import_ts_extras14.stringSplit)(toolName, "/"), -1) === "agent") ?? false;
|
|
2038
2104
|
var requireAgentToolForSubagentsRule = createCopilotRule({
|
|
2039
2105
|
create(context) {
|
|
2040
2106
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2050,7 +2116,7 @@ var requireAgentToolForSubagentsRule = createCopilotRule({
|
|
|
2050
2116
|
}
|
|
2051
2117
|
const allowedAgents = getFrontmatterList(frontmatter, "agents");
|
|
2052
2118
|
const agentsScalar = getFrontmatterScalar(frontmatter, "agents");
|
|
2053
|
-
if (agentsScalar !== "*" && (allowedAgents
|
|
2119
|
+
if (agentsScalar !== "*" && (!(0, import_ts_extras14.isDefined)(allowedAgents) || (0, import_ts_extras14.isEmpty)(allowedAgents))) {
|
|
2054
2120
|
return;
|
|
2055
2121
|
}
|
|
2056
2122
|
const tools = getFrontmatterList(frontmatter, "tools");
|
|
@@ -2073,7 +2139,8 @@ var requireAgentToolForSubagentsRule = createCopilotRule({
|
|
|
2073
2139
|
description: "require custom agents that declare subagents to also include the `agent` tool.",
|
|
2074
2140
|
frozen: false,
|
|
2075
2141
|
recommended: true,
|
|
2076
|
-
requiresTypeChecking: false
|
|
2142
|
+
requiresTypeChecking: false,
|
|
2143
|
+
url: createRuleDocsUrl("require-agent-tool-for-subagents")
|
|
2077
2144
|
},
|
|
2078
2145
|
messages: {
|
|
2079
2146
|
missingAgentTool: "Copilot custom agent files that declare `agents` must include the `agent` tool in `tools`.",
|
|
@@ -2117,7 +2184,8 @@ var requireAgentsMdForCrossSurfaceAgentInstructionsRule = createCopilotRule({
|
|
|
2117
2184
|
description: "require `CLAUDE.md` and `GEMINI.md` agent-instructions files to be paired with a sibling `AGENTS.md` for broader cross-surface support.",
|
|
2118
2185
|
frozen: false,
|
|
2119
2186
|
recommended: false,
|
|
2120
|
-
requiresTypeChecking: false
|
|
2187
|
+
requiresTypeChecking: false,
|
|
2188
|
+
url: createRuleDocsUrl("require-agents-md-for-cross-surface-agent-instructions")
|
|
2121
2189
|
},
|
|
2122
2190
|
messages: {
|
|
2123
2191
|
missingAgentsMdSibling: "`{{basename}}` is less portable across Copilot surfaces without a sibling `AGENTS.md` file in the same directory."
|
|
@@ -2130,6 +2198,7 @@ var requireAgentsMdForCrossSurfaceAgentInstructionsRule = createCopilotRule({
|
|
|
2130
2198
|
var require_agents_md_for_cross_surface_agent_instructions_default = requireAgentsMdForCrossSurfaceAgentInstructionsRule;
|
|
2131
2199
|
|
|
2132
2200
|
// dist/rules/require-chatmode-file-metadata.js
|
|
2201
|
+
var import_ts_extras15 = require("ts-extras");
|
|
2133
2202
|
var requireChatmodeFileMetadataRule = createCopilotRule({
|
|
2134
2203
|
create(context) {
|
|
2135
2204
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2144,7 +2213,7 @@ var requireChatmodeFileMetadataRule = createCopilotRule({
|
|
|
2144
2213
|
return;
|
|
2145
2214
|
}
|
|
2146
2215
|
const description = getFrontmatterScalar(frontmatter, "description");
|
|
2147
|
-
if (
|
|
2216
|
+
if ((0, import_ts_extras15.isDefined)(description)) {
|
|
2148
2217
|
return;
|
|
2149
2218
|
}
|
|
2150
2219
|
reportAtDocumentStart(context, {
|
|
@@ -2164,7 +2233,8 @@ var requireChatmodeFileMetadataRule = createCopilotRule({
|
|
|
2164
2233
|
description: "require custom Copilot agent files and legacy chat mode files to declare a non-empty description in frontmatter.",
|
|
2165
2234
|
frozen: false,
|
|
2166
2235
|
recommended: true,
|
|
2167
|
-
requiresTypeChecking: false
|
|
2236
|
+
requiresTypeChecking: false,
|
|
2237
|
+
url: createRuleDocsUrl("require-chatmode-file-metadata")
|
|
2168
2238
|
},
|
|
2169
2239
|
messages: {
|
|
2170
2240
|
emptyDescription: "Copilot custom agent and legacy chat mode files must define a non-empty `description` frontmatter value.",
|
|
@@ -2179,6 +2249,7 @@ var requireChatmodeFileMetadataRule = createCopilotRule({
|
|
|
2179
2249
|
var require_chatmode_file_metadata_default = requireChatmodeFileMetadataRule;
|
|
2180
2250
|
|
|
2181
2251
|
// dist/rules/require-existing-agent-hook-cwd.js
|
|
2252
|
+
var import_ts_extras16 = require("ts-extras");
|
|
2182
2253
|
var requireExistingAgentHookCwdRule = createCopilotRule({
|
|
2183
2254
|
create(context) {
|
|
2184
2255
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2187,7 +2258,7 @@ var requireExistingAgentHookCwdRule = createCopilotRule({
|
|
|
2187
2258
|
}
|
|
2188
2259
|
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
2189
2260
|
const hookGroups = frontmatter === null ? void 0 : getFrontmatterObjectListGroups(frontmatter, "hooks");
|
|
2190
|
-
if (hookGroups
|
|
2261
|
+
if (!(0, import_ts_extras16.isDefined)(hookGroups) || hookGroups.size === 0) {
|
|
2191
2262
|
return;
|
|
2192
2263
|
}
|
|
2193
2264
|
const repositoryRoot = findRepositoryRoot(context.filename);
|
|
@@ -2196,7 +2267,7 @@ var requireExistingAgentHookCwdRule = createCopilotRule({
|
|
|
2196
2267
|
const cwd = entry["cwd"]?.trim();
|
|
2197
2268
|
return typeof cwd === "string" && cwd.length > 0 && isRelativeWorkspacePath(cwd) && !pathExists(resolveRepositoryRelativePath(repositoryRoot, cwd));
|
|
2198
2269
|
})?.["cwd"];
|
|
2199
|
-
if (
|
|
2270
|
+
if (!(0, import_ts_extras16.isDefined)(missingCwd)) {
|
|
2200
2271
|
continue;
|
|
2201
2272
|
}
|
|
2202
2273
|
reportAtDocumentStart(context, {
|
|
@@ -2216,7 +2287,8 @@ var requireExistingAgentHookCwdRule = createCopilotRule({
|
|
|
2216
2287
|
description: "require Copilot custom-agent hook `cwd` entries to resolve to existing repository directories.",
|
|
2217
2288
|
frozen: false,
|
|
2218
2289
|
recommended: false,
|
|
2219
|
-
requiresTypeChecking: false
|
|
2290
|
+
requiresTypeChecking: false,
|
|
2291
|
+
url: createRuleDocsUrl("require-existing-agent-hook-cwd")
|
|
2220
2292
|
},
|
|
2221
2293
|
messages: {
|
|
2222
2294
|
missingAgentHookCwd: "Copilot custom-agent hook `cwd` value `{{cwd}}` does not resolve to an existing repository path."
|
|
@@ -2229,6 +2301,7 @@ var requireExistingAgentHookCwdRule = createCopilotRule({
|
|
|
2229
2301
|
var require_existing_agent_hook_cwd_default = requireExistingAgentHookCwdRule;
|
|
2230
2302
|
|
|
2231
2303
|
// dist/rules/require-existing-agent-mcp-servers.js
|
|
2304
|
+
var import_ts_extras17 = require("ts-extras");
|
|
2232
2305
|
var requireExistingAgentMcpServersRule = createCopilotRule({
|
|
2233
2306
|
create(context) {
|
|
2234
2307
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2237,12 +2310,12 @@ var requireExistingAgentMcpServersRule = createCopilotRule({
|
|
|
2237
2310
|
}
|
|
2238
2311
|
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
2239
2312
|
const mcpServers = frontmatter === null ? void 0 : getFrontmatterList(frontmatter, "mcp-servers");
|
|
2240
|
-
if (
|
|
2313
|
+
if (!(0, import_ts_extras17.isDefined)(mcpServers)) {
|
|
2241
2314
|
return;
|
|
2242
2315
|
}
|
|
2243
2316
|
const repositoryRoot = findRepositoryRoot(context.filename);
|
|
2244
2317
|
const missingServer = mcpServers.find((serverPath) => !pathExists(resolveRepositoryRelativePath(repositoryRoot, serverPath)));
|
|
2245
|
-
if (
|
|
2318
|
+
if (!(0, import_ts_extras17.isDefined)(missingServer)) {
|
|
2246
2319
|
return;
|
|
2247
2320
|
}
|
|
2248
2321
|
reportAtDocumentStart(context, {
|
|
@@ -2263,7 +2336,8 @@ var requireExistingAgentMcpServersRule = createCopilotRule({
|
|
|
2263
2336
|
description: "require Copilot custom-agent `mcp-servers` entries to resolve to existing repository files.",
|
|
2264
2337
|
frozen: false,
|
|
2265
2338
|
recommended: false,
|
|
2266
|
-
requiresTypeChecking: false
|
|
2339
|
+
requiresTypeChecking: false,
|
|
2340
|
+
url: createRuleDocsUrl("require-existing-agent-mcp-servers")
|
|
2267
2341
|
},
|
|
2268
2342
|
messages: {
|
|
2269
2343
|
missingAgentMcpServer: "Copilot custom-agent `mcp-servers` entry `{{mcpServer}}` does not resolve to an existing repository file."
|
|
@@ -2286,6 +2360,7 @@ var getCustomizationBodyWithOffset = (sourceText) => {
|
|
|
2286
2360
|
};
|
|
2287
2361
|
|
|
2288
2362
|
// dist/_internal/markdown-links.js
|
|
2363
|
+
var import_ts_extras18 = require("ts-extras");
|
|
2289
2364
|
var FENCED_BACKTICK_CODE_BLOCK_PATTERN = /```[\s\S]*?```/gu;
|
|
2290
2365
|
var FENCED_TILDE_CODE_BLOCK_PATTERN = /~~~[\s\S]*?~~~/gu;
|
|
2291
2366
|
var INLINE_CODE_PATTERN = /`[^\n\r`]+`/gu;
|
|
@@ -2295,7 +2370,8 @@ var extractMarkdownLinkDestination = (rawDestination) => {
|
|
|
2295
2370
|
if (trimmedDestination.startsWith("<") && trimmedDestination.endsWith(">")) {
|
|
2296
2371
|
return trimmedDestination.slice(1, -1).trim();
|
|
2297
2372
|
}
|
|
2298
|
-
const
|
|
2373
|
+
const normalizedDestination = trimmedDestination.replaceAll(/\s+/gu, " ");
|
|
2374
|
+
const [destination] = (0, import_ts_extras18.stringSplit)(normalizedDestination, " ");
|
|
2299
2375
|
return destination?.trim() ?? "";
|
|
2300
2376
|
};
|
|
2301
2377
|
var extractMarkdownLinks = (text, offset = 0) => {
|
|
@@ -2387,7 +2463,8 @@ var requireExistingRelativeAgentLinksRule = createCopilotRule({
|
|
|
2387
2463
|
description: "require relative Markdown links in Copilot custom agents to resolve to existing workspace targets.",
|
|
2388
2464
|
frozen: false,
|
|
2389
2465
|
recommended: false,
|
|
2390
|
-
requiresTypeChecking: false
|
|
2466
|
+
requiresTypeChecking: false,
|
|
2467
|
+
url: createRuleDocsUrl("require-existing-relative-agent-links")
|
|
2391
2468
|
},
|
|
2392
2469
|
messages: {
|
|
2393
2470
|
missingAgentLinkTarget: "Copilot custom-agent relative link `{{destination}}` does not resolve to an existing workspace path."
|
|
@@ -2439,7 +2516,8 @@ var requireExistingRelativeInstructionsLinksRule = createCopilotRule({
|
|
|
2439
2516
|
description: "require relative Markdown links in path-specific Copilot instructions files to resolve to existing workspace targets.",
|
|
2440
2517
|
frozen: false,
|
|
2441
2518
|
recommended: false,
|
|
2442
|
-
requiresTypeChecking: false
|
|
2519
|
+
requiresTypeChecking: false,
|
|
2520
|
+
url: createRuleDocsUrl("require-existing-relative-instructions-links")
|
|
2443
2521
|
},
|
|
2444
2522
|
messages: {
|
|
2445
2523
|
missingInstructionsLinkTarget: "Copilot instructions relative link `{{destination}}` does not resolve to an existing workspace path."
|
|
@@ -2491,7 +2569,8 @@ var requireExistingRelativePromptLinksRule = createCopilotRule({
|
|
|
2491
2569
|
description: "require relative Markdown links in Copilot prompt files to resolve to existing workspace targets.",
|
|
2492
2570
|
frozen: false,
|
|
2493
2571
|
recommended: false,
|
|
2494
|
-
requiresTypeChecking: false
|
|
2572
|
+
requiresTypeChecking: false,
|
|
2573
|
+
url: createRuleDocsUrl("require-existing-relative-prompt-links")
|
|
2495
2574
|
},
|
|
2496
2575
|
messages: {
|
|
2497
2576
|
missingPromptLinkTarget: "Copilot prompt-file relative link `{{destination}}` does not resolve to an existing workspace path."
|
|
@@ -2543,7 +2622,8 @@ var requireExistingRelativeSkillLinksRule = createCopilotRule({
|
|
|
2543
2622
|
description: "require relative Markdown links in Copilot skill definition files to resolve to existing workspace resources.",
|
|
2544
2623
|
frozen: false,
|
|
2545
2624
|
recommended: false,
|
|
2546
|
-
requiresTypeChecking: false
|
|
2625
|
+
requiresTypeChecking: false,
|
|
2626
|
+
url: createRuleDocsUrl("require-existing-relative-skill-links")
|
|
2547
2627
|
},
|
|
2548
2628
|
messages: {
|
|
2549
2629
|
missingSkillLinkTarget: "Copilot skill relative link `{{destination}}` does not resolve to an existing workspace path."
|
|
@@ -2556,6 +2636,7 @@ var requireExistingRelativeSkillLinksRule = createCopilotRule({
|
|
|
2556
2636
|
var require_existing_relative_skill_links_default = requireExistingRelativeSkillLinksRule;
|
|
2557
2637
|
|
|
2558
2638
|
// dist/rules/require-existing-repository-hook-cwd.js
|
|
2639
|
+
var import_ts_extras19 = require("ts-extras");
|
|
2559
2640
|
var requireExistingRepositoryHookCwdRule = createCopilotRule({
|
|
2560
2641
|
create(context) {
|
|
2561
2642
|
return {
|
|
@@ -2569,7 +2650,7 @@ var requireExistingRepositoryHookCwdRule = createCopilotRule({
|
|
|
2569
2650
|
const cwd2 = hook["cwd"];
|
|
2570
2651
|
return isJsonString(cwd2) && cwd2.trim().length > 0 && isRelativeWorkspacePath(cwd2) && !pathExists(resolveRepositoryRelativePath(repositoryRoot, cwd2));
|
|
2571
2652
|
});
|
|
2572
|
-
if (
|
|
2653
|
+
if (!(0, import_ts_extras19.isDefined)(invalidHook)) {
|
|
2573
2654
|
return;
|
|
2574
2655
|
}
|
|
2575
2656
|
const cwd = invalidHook.hook["cwd"];
|
|
@@ -2596,7 +2677,8 @@ var requireExistingRepositoryHookCwdRule = createCopilotRule({
|
|
|
2596
2677
|
description: "require repository hook `cwd` values to resolve to existing repository paths.",
|
|
2597
2678
|
frozen: false,
|
|
2598
2679
|
recommended: false,
|
|
2599
|
-
requiresTypeChecking: false
|
|
2680
|
+
requiresTypeChecking: false,
|
|
2681
|
+
url: createRuleDocsUrl("require-existing-repository-hook-cwd")
|
|
2600
2682
|
},
|
|
2601
2683
|
messages: {
|
|
2602
2684
|
missingRepositoryHookCwd: "Repository hook `cwd` value `{{cwd}}` for `{{eventName}}` does not resolve to an existing repository path."
|
|
@@ -2609,6 +2691,7 @@ var requireExistingRepositoryHookCwdRule = createCopilotRule({
|
|
|
2609
2691
|
var require_existing_repository_hook_cwd_default = requireExistingRepositoryHookCwdRule;
|
|
2610
2692
|
|
|
2611
2693
|
// dist/rules/require-github-copilot-target-for-mcp-servers.js
|
|
2694
|
+
var import_ts_extras20 = require("ts-extras");
|
|
2612
2695
|
var requireGithubCopilotTargetForMcpServersRule = createCopilotRule({
|
|
2613
2696
|
create(context) {
|
|
2614
2697
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2623,7 +2706,7 @@ var requireGithubCopilotTargetForMcpServersRule = createCopilotRule({
|
|
|
2623
2706
|
if (target === "github-copilot") {
|
|
2624
2707
|
return;
|
|
2625
2708
|
}
|
|
2626
|
-
if (
|
|
2709
|
+
if (!(0, import_ts_extras20.isDefined)(target)) {
|
|
2627
2710
|
reportAtDocumentStart(context, {
|
|
2628
2711
|
messageId: hasFrontmatterField(frontmatter, "target") ? "emptyTarget" : "missingTarget"
|
|
2629
2712
|
});
|
|
@@ -2646,7 +2729,8 @@ var requireGithubCopilotTargetForMcpServersRule = createCopilotRule({
|
|
|
2646
2729
|
description: "require custom agents that declare `mcp-servers` to set `target: github-copilot`.",
|
|
2647
2730
|
frozen: false,
|
|
2648
2731
|
recommended: true,
|
|
2649
|
-
requiresTypeChecking: false
|
|
2732
|
+
requiresTypeChecking: false,
|
|
2733
|
+
url: createRuleDocsUrl("require-github-copilot-target-for-mcp-servers")
|
|
2650
2734
|
},
|
|
2651
2735
|
messages: {
|
|
2652
2736
|
emptyTarget: "Copilot custom agent files that declare `mcp-servers` must define a non-empty `target: github-copilot` frontmatter value.",
|
|
@@ -2661,6 +2745,7 @@ var requireGithubCopilotTargetForMcpServersRule = createCopilotRule({
|
|
|
2661
2745
|
var require_github_copilot_target_for_mcp_servers_default = requireGithubCopilotTargetForMcpServersRule;
|
|
2662
2746
|
|
|
2663
2747
|
// dist/rules/require-instructions-apply-to.js
|
|
2748
|
+
var import_ts_extras21 = require("ts-extras");
|
|
2664
2749
|
var requireInstructionsApplyToRule = createCopilotRule({
|
|
2665
2750
|
create(context) {
|
|
2666
2751
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2676,7 +2761,7 @@ var requireInstructionsApplyToRule = createCopilotRule({
|
|
|
2676
2761
|
}
|
|
2677
2762
|
const applyToScalar = getFrontmatterScalar(frontmatter, "applyTo");
|
|
2678
2763
|
const applyToList = getFrontmatterList(frontmatter, "applyTo");
|
|
2679
|
-
if (applyToScalar
|
|
2764
|
+
if ((0, import_ts_extras21.isDefined)(applyToScalar) || (0, import_ts_extras21.isDefined)(applyToList)) {
|
|
2680
2765
|
return;
|
|
2681
2766
|
}
|
|
2682
2767
|
reportAtDocumentStart(context, {
|
|
@@ -2696,7 +2781,8 @@ var requireInstructionsApplyToRule = createCopilotRule({
|
|
|
2696
2781
|
description: "require path-specific Copilot instructions files to declare a non-empty `applyTo` frontmatter glob.",
|
|
2697
2782
|
frozen: false,
|
|
2698
2783
|
recommended: true,
|
|
2699
|
-
requiresTypeChecking: false
|
|
2784
|
+
requiresTypeChecking: false,
|
|
2785
|
+
url: createRuleDocsUrl("require-instructions-apply-to")
|
|
2700
2786
|
},
|
|
2701
2787
|
messages: {
|
|
2702
2788
|
emptyApplyTo: "Copilot instructions files must define a non-empty `applyTo` frontmatter value.",
|
|
@@ -2711,6 +2797,7 @@ var requireInstructionsApplyToRule = createCopilotRule({
|
|
|
2711
2797
|
var require_instructions_apply_to_default = requireInstructionsApplyToRule;
|
|
2712
2798
|
|
|
2713
2799
|
// dist/rules/require-json-agent-mcp-servers.js
|
|
2800
|
+
var import_ts_extras22 = require("ts-extras");
|
|
2714
2801
|
var JSON_FILE_EXTENSION_PATTERN = /\.json$/iu;
|
|
2715
2802
|
var requireJsonAgentMcpServersRule = createCopilotRule({
|
|
2716
2803
|
create(context) {
|
|
@@ -2720,11 +2807,11 @@ var requireJsonAgentMcpServersRule = createCopilotRule({
|
|
|
2720
2807
|
}
|
|
2721
2808
|
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
2722
2809
|
const mcpServers = frontmatter === null ? void 0 : getFrontmatterList(frontmatter, "mcp-servers");
|
|
2723
|
-
if (
|
|
2810
|
+
if (!(0, import_ts_extras22.isDefined)(mcpServers)) {
|
|
2724
2811
|
return;
|
|
2725
2812
|
}
|
|
2726
2813
|
const invalidServer = mcpServers.find((serverPath) => !JSON_FILE_EXTENSION_PATTERN.test(serverPath.trim()));
|
|
2727
|
-
if (
|
|
2814
|
+
if (!(0, import_ts_extras22.isDefined)(invalidServer)) {
|
|
2728
2815
|
return;
|
|
2729
2816
|
}
|
|
2730
2817
|
reportAtDocumentStart(context, {
|
|
@@ -2746,7 +2833,8 @@ var requireJsonAgentMcpServersRule = createCopilotRule({
|
|
|
2746
2833
|
description: "require Copilot custom-agent `mcp-servers` entries to reference JSON config files.",
|
|
2747
2834
|
frozen: false,
|
|
2748
2835
|
recommended: true,
|
|
2749
|
-
requiresTypeChecking: false
|
|
2836
|
+
requiresTypeChecking: false,
|
|
2837
|
+
url: createRuleDocsUrl("require-json-agent-mcp-servers")
|
|
2750
2838
|
},
|
|
2751
2839
|
messages: {
|
|
2752
2840
|
nonJsonAgentMcpServer: "Copilot custom-agent `mcp-servers` entry `{{mcpServer}}` should reference a `.json` config file."
|
|
@@ -2759,11 +2847,41 @@ var requireJsonAgentMcpServersRule = createCopilotRule({
|
|
|
2759
2847
|
var require_json_agent_mcp_servers_default = requireJsonAgentMcpServersRule;
|
|
2760
2848
|
|
|
2761
2849
|
// dist/rules/require-prompt-file-metadata.js
|
|
2850
|
+
var import_ts_extras23 = require("ts-extras");
|
|
2762
2851
|
var VALID_BUILT_IN_PROMPT_AGENTS = /* @__PURE__ */ new Set([
|
|
2763
2852
|
"agent",
|
|
2764
2853
|
"ask",
|
|
2765
2854
|
"plan"
|
|
2766
2855
|
]);
|
|
2856
|
+
var getRequiredPromptScalar = (context, frontmatter, key, emptyMessageId, missingMessageId) => {
|
|
2857
|
+
const value = getFrontmatterScalar(frontmatter, key);
|
|
2858
|
+
if ((0, import_ts_extras23.isDefined)(value)) {
|
|
2859
|
+
return value;
|
|
2860
|
+
}
|
|
2861
|
+
reportAtDocumentStart(context, {
|
|
2862
|
+
messageId: hasFrontmatterField(frontmatter, key) ? emptyMessageId : missingMessageId
|
|
2863
|
+
});
|
|
2864
|
+
return void 0;
|
|
2865
|
+
};
|
|
2866
|
+
var reportAgentToolsRequirement = (context, frontmatter, agent, tools) => {
|
|
2867
|
+
if (agent === "agent") {
|
|
2868
|
+
if ((0, import_ts_extras23.isDefined)(tools)) {
|
|
2869
|
+
return false;
|
|
2870
|
+
}
|
|
2871
|
+
reportAtDocumentStart(context, {
|
|
2872
|
+
messageId: hasFrontmatterField(frontmatter, "tools") ? "emptyTools" : "missingTools"
|
|
2873
|
+
});
|
|
2874
|
+
return true;
|
|
2875
|
+
}
|
|
2876
|
+
if ((0, import_ts_extras23.setHas)(VALID_BUILT_IN_PROMPT_AGENTS, agent) && hasFrontmatterField(frontmatter, "tools")) {
|
|
2877
|
+
reportAtDocumentStart(context, {
|
|
2878
|
+
data: { agent },
|
|
2879
|
+
messageId: "unexpectedTools"
|
|
2880
|
+
});
|
|
2881
|
+
return true;
|
|
2882
|
+
}
|
|
2883
|
+
return false;
|
|
2884
|
+
};
|
|
2767
2885
|
var requirePromptFileMetadataRule = createCopilotRule({
|
|
2768
2886
|
create(context) {
|
|
2769
2887
|
return createMarkdownDocumentListener(() => {
|
|
@@ -2777,11 +2895,8 @@ var requirePromptFileMetadataRule = createCopilotRule({
|
|
|
2777
2895
|
});
|
|
2778
2896
|
return;
|
|
2779
2897
|
}
|
|
2780
|
-
const description =
|
|
2781
|
-
if (
|
|
2782
|
-
reportAtDocumentStart(context, {
|
|
2783
|
-
messageId: hasFrontmatterField(frontmatter, "description") ? "emptyDescription" : "missingDescription"
|
|
2784
|
-
});
|
|
2898
|
+
const description = getRequiredPromptScalar(context, frontmatter, "description", "emptyDescription", "missingDescription");
|
|
2899
|
+
if (!(0, import_ts_extras23.isDefined)(description)) {
|
|
2785
2900
|
return;
|
|
2786
2901
|
}
|
|
2787
2902
|
if (hasFrontmatterField(frontmatter, "mode")) {
|
|
@@ -2790,29 +2905,12 @@ var requirePromptFileMetadataRule = createCopilotRule({
|
|
|
2790
2905
|
});
|
|
2791
2906
|
return;
|
|
2792
2907
|
}
|
|
2793
|
-
const agent =
|
|
2794
|
-
if (
|
|
2795
|
-
reportAtDocumentStart(context, {
|
|
2796
|
-
messageId: hasFrontmatterField(frontmatter, "agent") ? "emptyAgent" : "missingAgent"
|
|
2797
|
-
});
|
|
2908
|
+
const agent = getRequiredPromptScalar(context, frontmatter, "agent", "emptyAgent", "missingAgent");
|
|
2909
|
+
if (!(0, import_ts_extras23.isDefined)(agent)) {
|
|
2798
2910
|
return;
|
|
2799
2911
|
}
|
|
2800
2912
|
const tools = getFrontmatterList(frontmatter, "tools");
|
|
2801
|
-
|
|
2802
|
-
if (tools !== void 0) {
|
|
2803
|
-
return;
|
|
2804
|
-
}
|
|
2805
|
-
reportAtDocumentStart(context, {
|
|
2806
|
-
messageId: hasFrontmatterField(frontmatter, "tools") ? "emptyTools" : "missingTools"
|
|
2807
|
-
});
|
|
2808
|
-
return;
|
|
2809
|
-
}
|
|
2810
|
-
if (VALID_BUILT_IN_PROMPT_AGENTS.has(agent) && hasFrontmatterField(frontmatter, "tools")) {
|
|
2811
|
-
reportAtDocumentStart(context, {
|
|
2812
|
-
data: { agent },
|
|
2813
|
-
messageId: "unexpectedTools"
|
|
2814
|
-
});
|
|
2815
|
-
}
|
|
2913
|
+
reportAgentToolsRequirement(context, frontmatter, agent, tools);
|
|
2816
2914
|
});
|
|
2817
2915
|
},
|
|
2818
2916
|
meta: {
|
|
@@ -2827,7 +2925,8 @@ var requirePromptFileMetadataRule = createCopilotRule({
|
|
|
2827
2925
|
description: "require reusable Copilot prompt files to declare description, agent, and built-in agent-mode tools metadata.",
|
|
2828
2926
|
frozen: false,
|
|
2829
2927
|
recommended: true,
|
|
2830
|
-
requiresTypeChecking: false
|
|
2928
|
+
requiresTypeChecking: false,
|
|
2929
|
+
url: createRuleDocsUrl("require-prompt-file-metadata")
|
|
2831
2930
|
},
|
|
2832
2931
|
messages: {
|
|
2833
2932
|
deprecatedMode: "Copilot prompt files should use `agent` instead of the deprecated `mode` frontmatter key.",
|
|
@@ -2848,6 +2947,7 @@ var requirePromptFileMetadataRule = createCopilotRule({
|
|
|
2848
2947
|
var require_prompt_file_metadata_default = requirePromptFileMetadataRule;
|
|
2849
2948
|
|
|
2850
2949
|
// dist/rules/require-qualified-agent-handoff-models.js
|
|
2950
|
+
var import_ts_extras24 = require("ts-extras");
|
|
2851
2951
|
var isQualifiedModelName = (value) => {
|
|
2852
2952
|
const trimmedValue = value.trim();
|
|
2853
2953
|
if (!trimmedValue.endsWith(")")) {
|
|
@@ -2871,12 +2971,12 @@ var requireQualifiedAgentHandoffModelsRule = createCopilotRule({
|
|
|
2871
2971
|
return;
|
|
2872
2972
|
}
|
|
2873
2973
|
const handoffs = getFrontmatterObjectList(frontmatter, "handoffs");
|
|
2874
|
-
if (handoffs
|
|
2974
|
+
if (!(0, import_ts_extras24.isDefined)(handoffs) || (0, import_ts_extras24.isEmpty)(handoffs)) {
|
|
2875
2975
|
return;
|
|
2876
2976
|
}
|
|
2877
2977
|
for (const [index, handoff] of handoffs.entries()) {
|
|
2878
2978
|
const model = handoff["model"]?.trim();
|
|
2879
|
-
if (model
|
|
2979
|
+
if (!(0, import_ts_extras24.isDefined)(model) || model.length === 0 || isQualifiedModelName(model)) {
|
|
2880
2980
|
continue;
|
|
2881
2981
|
}
|
|
2882
2982
|
reportAtDocumentStart(context, {
|
|
@@ -2901,7 +3001,8 @@ var requireQualifiedAgentHandoffModelsRule = createCopilotRule({
|
|
|
2901
3001
|
description: "require Copilot custom-agent handoff models to use qualified `Model Name (vendor)` names.",
|
|
2902
3002
|
frozen: false,
|
|
2903
3003
|
recommended: true,
|
|
2904
|
-
requiresTypeChecking: false
|
|
3004
|
+
requiresTypeChecking: false,
|
|
3005
|
+
url: createRuleDocsUrl("require-qualified-agent-handoff-models")
|
|
2905
3006
|
},
|
|
2906
3007
|
messages: {
|
|
2907
3008
|
unqualifiedHandoffModel: "Copilot custom agent handoff #{{handoffNumber}} should use a qualified `handoffs.model` name like `GPT-5 (copilot)`, not `{{model}}`."
|
|
@@ -2914,6 +3015,7 @@ var requireQualifiedAgentHandoffModelsRule = createCopilotRule({
|
|
|
2914
3015
|
var require_qualified_agent_handoff_models_default = requireQualifiedAgentHandoffModelsRule;
|
|
2915
3016
|
|
|
2916
3017
|
// dist/rules/require-relative-agent-hook-cwd.js
|
|
3018
|
+
var import_ts_extras25 = require("ts-extras");
|
|
2917
3019
|
var isValidRelativeHookCwd = (cwd) => {
|
|
2918
3020
|
const trimmedCwd = cwd.trim();
|
|
2919
3021
|
return trimmedCwd.length > 0 && isRelativeWorkspacePath(trimmedCwd);
|
|
@@ -2929,13 +3031,13 @@ var requireRelativeAgentHookCwdRule = createCopilotRule({
|
|
|
2929
3031
|
return;
|
|
2930
3032
|
}
|
|
2931
3033
|
const hookGroups = getFrontmatterObjectListGroups(frontmatter, "hooks");
|
|
2932
|
-
if (hookGroups
|
|
3034
|
+
if (!(0, import_ts_extras25.isDefined)(hookGroups) || hookGroups.size === 0) {
|
|
2933
3035
|
return;
|
|
2934
3036
|
}
|
|
2935
3037
|
for (const [eventName, hooks] of hookGroups) {
|
|
2936
3038
|
for (const [index, hook] of hooks.entries()) {
|
|
2937
3039
|
const cwd = hook["cwd"]?.trim();
|
|
2938
|
-
if (cwd
|
|
3040
|
+
if (!(0, import_ts_extras25.isDefined)(cwd) || isValidRelativeHookCwd(cwd)) {
|
|
2939
3041
|
continue;
|
|
2940
3042
|
}
|
|
2941
3043
|
reportAtDocumentStart(context, {
|
|
@@ -2962,7 +3064,8 @@ var requireRelativeAgentHookCwdRule = createCopilotRule({
|
|
|
2962
3064
|
description: "require Copilot custom-agent hook `cwd` values to stay relative to the repository root.",
|
|
2963
3065
|
frozen: false,
|
|
2964
3066
|
recommended: true,
|
|
2965
|
-
requiresTypeChecking: false
|
|
3067
|
+
requiresTypeChecking: false,
|
|
3068
|
+
url: createRuleDocsUrl("require-relative-agent-hook-cwd")
|
|
2966
3069
|
},
|
|
2967
3070
|
messages: {
|
|
2968
3071
|
invalidHookCwd: "Copilot custom agent hook #{{hookNumber}} in `{{eventName}}` must use a non-empty repository-relative `cwd` value, not `{{currentValue}}`."
|
|
@@ -3012,7 +3115,8 @@ var requireRelativeAgentLinksRule = createCopilotRule({
|
|
|
3012
3115
|
description: "require Copilot custom agents to use relative Markdown links for workspace files.",
|
|
3013
3116
|
frozen: false,
|
|
3014
3117
|
recommended: true,
|
|
3015
|
-
requiresTypeChecking: false
|
|
3118
|
+
requiresTypeChecking: false,
|
|
3119
|
+
url: createRuleDocsUrl("require-relative-agent-links")
|
|
3016
3120
|
},
|
|
3017
3121
|
messages: {
|
|
3018
3122
|
nonRelativeAgentLink: "Copilot custom agents should reference workspace files with relative Markdown links, not `{{destination}}`."
|
|
@@ -3062,7 +3166,8 @@ var requireRelativeInstructionsLinksRule = createCopilotRule({
|
|
|
3062
3166
|
description: "require path-specific Copilot instructions files to use relative Markdown links for workspace files.",
|
|
3063
3167
|
frozen: false,
|
|
3064
3168
|
recommended: true,
|
|
3065
|
-
requiresTypeChecking: false
|
|
3169
|
+
requiresTypeChecking: false,
|
|
3170
|
+
url: createRuleDocsUrl("require-relative-instructions-links")
|
|
3066
3171
|
},
|
|
3067
3172
|
messages: {
|
|
3068
3173
|
nonRelativeInstructionsLink: "Copilot instructions files should reference workspace files with relative Markdown links, not `{{destination}}`."
|
|
@@ -3130,7 +3235,8 @@ var requireRelativePromptLinksRule = createCopilotRule({
|
|
|
3130
3235
|
description: "require Copilot prompt files to use relative Markdown links for workspace files.",
|
|
3131
3236
|
frozen: false,
|
|
3132
3237
|
recommended: true,
|
|
3133
|
-
requiresTypeChecking: false
|
|
3238
|
+
requiresTypeChecking: false,
|
|
3239
|
+
url: createRuleDocsUrl("require-relative-prompt-links")
|
|
3134
3240
|
},
|
|
3135
3241
|
messages: {
|
|
3136
3242
|
nonRelativePromptLink: "Copilot prompt files should reference workspace files with relative Markdown links, not `{{destination}}`."
|
|
@@ -3143,6 +3249,7 @@ var requireRelativePromptLinksRule = createCopilotRule({
|
|
|
3143
3249
|
var require_relative_prompt_links_default = requireRelativePromptLinksRule;
|
|
3144
3250
|
|
|
3145
3251
|
// dist/rules/require-relative-repository-hook-cwd.js
|
|
3252
|
+
var import_ts_extras26 = require("ts-extras");
|
|
3146
3253
|
var requireRelativeRepositoryHookCwdRule = createCopilotRule({
|
|
3147
3254
|
create(context) {
|
|
3148
3255
|
return {
|
|
@@ -3155,7 +3262,7 @@ var requireRelativeRepositoryHookCwdRule = createCopilotRule({
|
|
|
3155
3262
|
const cwd2 = hook["cwd"];
|
|
3156
3263
|
return isJsonString(cwd2) && isNonRelativeWorkspacePath(cwd2);
|
|
3157
3264
|
});
|
|
3158
|
-
if (
|
|
3265
|
+
if (!(0, import_ts_extras26.isDefined)(invalidHook)) {
|
|
3159
3266
|
return;
|
|
3160
3267
|
}
|
|
3161
3268
|
const cwd = invalidHook.hook["cwd"];
|
|
@@ -3183,7 +3290,8 @@ var requireRelativeRepositoryHookCwdRule = createCopilotRule({
|
|
|
3183
3290
|
description: "require repository hook `cwd` values to use repository-relative paths.",
|
|
3184
3291
|
frozen: false,
|
|
3185
3292
|
recommended: true,
|
|
3186
|
-
requiresTypeChecking: false
|
|
3293
|
+
requiresTypeChecking: false,
|
|
3294
|
+
url: createRuleDocsUrl("require-relative-repository-hook-cwd")
|
|
3187
3295
|
},
|
|
3188
3296
|
messages: {
|
|
3189
3297
|
nonRelativeRepositoryHookCwd: "Repository hook `cwd` values for `{{eventName}}` should use repository-relative paths, not `{{cwd}}`."
|
|
@@ -3233,7 +3341,8 @@ var requireRelativeSkillLinksRule = createCopilotRule({
|
|
|
3233
3341
|
description: "require Copilot skill definition files to use relative Markdown links for workspace resources.",
|
|
3234
3342
|
frozen: false,
|
|
3235
3343
|
recommended: true,
|
|
3236
|
-
requiresTypeChecking: false
|
|
3344
|
+
requiresTypeChecking: false,
|
|
3345
|
+
url: createRuleDocsUrl("require-relative-skill-links")
|
|
3237
3346
|
},
|
|
3238
3347
|
messages: {
|
|
3239
3348
|
nonRelativeSkillLink: "Copilot skill definition files should reference workspace resources with relative Markdown links, not `{{destination}}`."
|
|
@@ -3246,6 +3355,7 @@ var requireRelativeSkillLinksRule = createCopilotRule({
|
|
|
3246
3355
|
var require_relative_skill_links_default = requireRelativeSkillLinksRule;
|
|
3247
3356
|
|
|
3248
3357
|
// dist/rules/require-repository-hook-arrays.js
|
|
3358
|
+
var import_ts_extras27 = require("ts-extras");
|
|
3249
3359
|
var requireRepositoryHookArraysRule = createCopilotRule({
|
|
3250
3360
|
create(context) {
|
|
3251
3361
|
return {
|
|
@@ -3254,13 +3364,13 @@ var requireRepositoryHookArraysRule = createCopilotRule({
|
|
|
3254
3364
|
return;
|
|
3255
3365
|
}
|
|
3256
3366
|
const root = parseJsonText(context.sourceCode.text);
|
|
3257
|
-
const invalidEntry = getRepositoryHookEventEntries(root).find(([, eventValue]) => !isJsonArray(eventValue));
|
|
3258
|
-
if (invalidEntry ===
|
|
3367
|
+
const invalidEntry = getRepositoryHookEventEntries(root).find(([, eventValue]) => !isJsonArray(eventValue)) ?? null;
|
|
3368
|
+
if (invalidEntry === null) {
|
|
3259
3369
|
return;
|
|
3260
3370
|
}
|
|
3261
3371
|
reportAtDocumentStart(context, {
|
|
3262
3372
|
data: {
|
|
3263
|
-
eventName:
|
|
3373
|
+
eventName: (0, import_ts_extras27.arrayFirst)(invalidEntry),
|
|
3264
3374
|
value: formatJsonValue(invalidEntry[1])
|
|
3265
3375
|
},
|
|
3266
3376
|
messageId: "invalidRepositoryHookArray"
|
|
@@ -3279,7 +3389,8 @@ var requireRepositoryHookArraysRule = createCopilotRule({
|
|
|
3279
3389
|
description: "require each repository hook event entry in `hooks` to be an array.",
|
|
3280
3390
|
frozen: false,
|
|
3281
3391
|
recommended: true,
|
|
3282
|
-
requiresTypeChecking: false
|
|
3392
|
+
requiresTypeChecking: false,
|
|
3393
|
+
url: createRuleDocsUrl("require-repository-hook-arrays")
|
|
3283
3394
|
},
|
|
3284
3395
|
messages: {
|
|
3285
3396
|
invalidRepositoryHookArray: "Repository hook event `{{eventName}}` must map to an array of hook definitions (current value: `{{value}}`)."
|
|
@@ -3292,6 +3403,7 @@ var requireRepositoryHookArraysRule = createCopilotRule({
|
|
|
3292
3403
|
var require_repository_hook_arrays_default = requireRepositoryHookArraysRule;
|
|
3293
3404
|
|
|
3294
3405
|
// dist/rules/require-repository-hook-command-shell.js
|
|
3406
|
+
var import_ts_extras28 = require("ts-extras");
|
|
3295
3407
|
var hasHookShellCommand = (value) => typeof value === "string" && value.trim().length > 0;
|
|
3296
3408
|
var requireRepositoryHookCommandShellRule = createCopilotRule({
|
|
3297
3409
|
create(context) {
|
|
@@ -3302,7 +3414,7 @@ var requireRepositoryHookCommandShellRule = createCopilotRule({
|
|
|
3302
3414
|
}
|
|
3303
3415
|
const root = parseJsonText(context.sourceCode.text);
|
|
3304
3416
|
const invalidHook = getRepositoryHookObjects(root).find(({ hook }) => isJsonString(hook["type"]) && hook["type"] === "command" && !hasHookShellCommand(hook["bash"]) && !hasHookShellCommand(hook["powershell"]));
|
|
3305
|
-
if (
|
|
3417
|
+
if (!(0, import_ts_extras28.isDefined)(invalidHook)) {
|
|
3306
3418
|
return;
|
|
3307
3419
|
}
|
|
3308
3420
|
reportAtDocumentStart(context, {
|
|
@@ -3325,7 +3437,8 @@ var requireRepositoryHookCommandShellRule = createCopilotRule({
|
|
|
3325
3437
|
description: "require repository `command` hook definitions to declare at least one shell command under `bash` or `powershell`.",
|
|
3326
3438
|
frozen: false,
|
|
3327
3439
|
recommended: true,
|
|
3328
|
-
requiresTypeChecking: false
|
|
3440
|
+
requiresTypeChecking: false,
|
|
3441
|
+
url: createRuleDocsUrl("require-repository-hook-command-shell")
|
|
3329
3442
|
},
|
|
3330
3443
|
messages: {
|
|
3331
3444
|
missingRepositoryHookShellCommand: "Repository `command` hooks for `{{eventName}}` must declare a non-empty `bash` or `powershell` command."
|
|
@@ -3367,7 +3480,8 @@ var requireRepositoryHooksObjectRule = createCopilotRule({
|
|
|
3367
3480
|
description: "require repository hook configuration files to declare a top-level `hooks` object.",
|
|
3368
3481
|
frozen: false,
|
|
3369
3482
|
recommended: true,
|
|
3370
|
-
requiresTypeChecking: false
|
|
3483
|
+
requiresTypeChecking: false,
|
|
3484
|
+
url: createRuleDocsUrl("require-repository-hooks-object")
|
|
3371
3485
|
},
|
|
3372
3486
|
messages: {
|
|
3373
3487
|
invalidRepositoryHooksObject: "Repository hook configuration files must declare a top-level `hooks` object."
|
|
@@ -3407,7 +3521,8 @@ var requireRepositoryInstructionsFileRule = createCopilotRule({
|
|
|
3407
3521
|
description: "require repositories that define Copilot customization assets to also provide repository instructions via `.github/copilot-instructions.md` or `.github/instructions/copilot-instructions.md`.",
|
|
3408
3522
|
frozen: false,
|
|
3409
3523
|
recommended: false,
|
|
3410
|
-
requiresTypeChecking: false
|
|
3524
|
+
requiresTypeChecking: false,
|
|
3525
|
+
url: createRuleDocsUrl("require-repository-instructions-file")
|
|
3411
3526
|
},
|
|
3412
3527
|
messages: {
|
|
3413
3528
|
missingRepositoryInstructions: "Repositories that define Copilot prompts, custom agents, legacy chat modes, agent instructions, or path-specific instructions should also provide baseline repository guidance in `.github/copilot-instructions.md` or `.github/instructions/copilot-instructions.md`."
|
|
@@ -3455,7 +3570,8 @@ var requireSkillFileLocationRule = createCopilotRule({
|
|
|
3455
3570
|
description: "require project skill definition files to live at a documented `.github/skills/<skill>/SKILL.md` or `.claude/skills/<skill>/SKILL.md` path.",
|
|
3456
3571
|
frozen: false,
|
|
3457
3572
|
recommended: true,
|
|
3458
|
-
requiresTypeChecking: false
|
|
3573
|
+
requiresTypeChecking: false,
|
|
3574
|
+
url: createRuleDocsUrl("require-skill-file-location")
|
|
3459
3575
|
},
|
|
3460
3576
|
messages: {
|
|
3461
3577
|
invalidSkillLocation: "Copilot skill definition files should live at `.github/skills/<skill>/SKILL.md` or `.claude/skills/<skill>/SKILL.md`."
|
|
@@ -3468,6 +3584,7 @@ var requireSkillFileLocationRule = createCopilotRule({
|
|
|
3468
3584
|
var require_skill_file_location_default = requireSkillFileLocationRule;
|
|
3469
3585
|
|
|
3470
3586
|
// dist/rules/require-skill-file-metadata.js
|
|
3587
|
+
var import_ts_extras29 = require("ts-extras");
|
|
3471
3588
|
var requireSkillFileMetadataRule = createCopilotRule({
|
|
3472
3589
|
create(context) {
|
|
3473
3590
|
return createMarkdownDocumentListener(() => {
|
|
@@ -3481,13 +3598,13 @@ var requireSkillFileMetadataRule = createCopilotRule({
|
|
|
3481
3598
|
});
|
|
3482
3599
|
return;
|
|
3483
3600
|
}
|
|
3484
|
-
if (getFrontmatterScalar(frontmatter, "name")
|
|
3601
|
+
if (!(0, import_ts_extras29.isDefined)(getFrontmatterScalar(frontmatter, "name"))) {
|
|
3485
3602
|
reportAtDocumentStart(context, {
|
|
3486
3603
|
messageId: "missingSkillName"
|
|
3487
3604
|
});
|
|
3488
3605
|
return;
|
|
3489
3606
|
}
|
|
3490
|
-
if (getFrontmatterScalar(frontmatter, "description")
|
|
3607
|
+
if (!(0, import_ts_extras29.isDefined)(getFrontmatterScalar(frontmatter, "description"))) {
|
|
3491
3608
|
reportAtDocumentStart(context, {
|
|
3492
3609
|
messageId: "missingSkillDescription"
|
|
3493
3610
|
});
|
|
@@ -3505,7 +3622,8 @@ var requireSkillFileMetadataRule = createCopilotRule({
|
|
|
3505
3622
|
description: "require Copilot skill definition files to declare `name` and `description` frontmatter.",
|
|
3506
3623
|
frozen: false,
|
|
3507
3624
|
recommended: true,
|
|
3508
|
-
requiresTypeChecking: false
|
|
3625
|
+
requiresTypeChecking: false,
|
|
3626
|
+
url: createRuleDocsUrl("require-skill-file-metadata")
|
|
3509
3627
|
},
|
|
3510
3628
|
messages: {
|
|
3511
3629
|
missingSkillDescription: "Copilot skill definition files must declare a non-empty `description` frontmatter value.",
|
|
@@ -3553,7 +3671,8 @@ var requireSkillMdFilenameRule = createCopilotRule({
|
|
|
3553
3671
|
description: "require markdown files that declare skill-definition frontmatter to use the documented `SKILL.md` filename.",
|
|
3554
3672
|
frozen: false,
|
|
3555
3673
|
recommended: true,
|
|
3556
|
-
requiresTypeChecking: false
|
|
3674
|
+
requiresTypeChecking: false,
|
|
3675
|
+
url: createRuleDocsUrl("require-skill-md-filename")
|
|
3557
3676
|
},
|
|
3558
3677
|
messages: {
|
|
3559
3678
|
invalidSkillDefinitionFilename: "Skill-definition markdown files should be named `SKILL.md`, not `{{basename}}`."
|
|
@@ -3566,6 +3685,7 @@ var requireSkillMdFilenameRule = createCopilotRule({
|
|
|
3566
3685
|
var require_skill_md_filename_default = requireSkillMdFilenameRule;
|
|
3567
3686
|
|
|
3568
3687
|
// dist/rules/require-skill-name-match-directory.js
|
|
3688
|
+
var import_ts_extras30 = require("ts-extras");
|
|
3569
3689
|
var requireSkillNameMatchDirectoryRule = createCopilotRule({
|
|
3570
3690
|
create(context) {
|
|
3571
3691
|
return createMarkdownDocumentListener(() => {
|
|
@@ -3574,7 +3694,7 @@ var requireSkillNameMatchDirectoryRule = createCopilotRule({
|
|
|
3574
3694
|
}
|
|
3575
3695
|
const frontmatter = extractFrontmatter(context.sourceCode.text);
|
|
3576
3696
|
const explicitSkillName = frontmatter === null ? void 0 : getFrontmatterScalar(frontmatter, "name");
|
|
3577
|
-
if (
|
|
3697
|
+
if (!(0, import_ts_extras30.isDefined)(explicitSkillName)) {
|
|
3578
3698
|
return;
|
|
3579
3699
|
}
|
|
3580
3700
|
const skillName = getSkillName(context.filename, frontmatter);
|
|
@@ -3601,7 +3721,8 @@ var requireSkillNameMatchDirectoryRule = createCopilotRule({
|
|
|
3601
3721
|
description: "require Copilot skill `name` metadata to match the skill directory name.",
|
|
3602
3722
|
frozen: false,
|
|
3603
3723
|
recommended: false,
|
|
3604
|
-
requiresTypeChecking: false
|
|
3724
|
+
requiresTypeChecking: false,
|
|
3725
|
+
url: createRuleDocsUrl("require-skill-name-match-directory")
|
|
3605
3726
|
},
|
|
3606
3727
|
messages: {
|
|
3607
3728
|
skillNameDoesNotMatchDirectory: "Copilot skill `name` value `{{name}}` should match its directory name `{{directoryName}}`."
|
|
@@ -3614,6 +3735,7 @@ var requireSkillNameMatchDirectoryRule = createCopilotRule({
|
|
|
3614
3735
|
var require_skill_name_match_directory_default = requireSkillNameMatchDirectoryRule;
|
|
3615
3736
|
|
|
3616
3737
|
// dist/rules/require-string-repository-hook-env-values.js
|
|
3738
|
+
var import_ts_extras31 = require("ts-extras");
|
|
3617
3739
|
var requireStringRepositoryHookEnvValuesRule = createCopilotRule({
|
|
3618
3740
|
create(context) {
|
|
3619
3741
|
return {
|
|
@@ -3624,9 +3746,9 @@ var requireStringRepositoryHookEnvValuesRule = createCopilotRule({
|
|
|
3624
3746
|
const root = parseJsonText(context.sourceCode.text);
|
|
3625
3747
|
const invalidHook = getRepositoryHookObjects(root).find(({ hook }) => {
|
|
3626
3748
|
const env2 = hook["env"];
|
|
3627
|
-
return isJsonObject(env2) &&
|
|
3749
|
+
return isJsonObject(env2) && (0, import_ts_extras31.objectValues)(env2).some((value) => !isJsonString(value));
|
|
3628
3750
|
});
|
|
3629
|
-
if (
|
|
3751
|
+
if (!(0, import_ts_extras31.isDefined)(invalidHook)) {
|
|
3630
3752
|
return;
|
|
3631
3753
|
}
|
|
3632
3754
|
const env = invalidHook.hook["env"];
|
|
@@ -3651,7 +3773,8 @@ var requireStringRepositoryHookEnvValuesRule = createCopilotRule({
|
|
|
3651
3773
|
description: "require repository hook `env` objects to use string values.",
|
|
3652
3774
|
frozen: false,
|
|
3653
3775
|
recommended: true,
|
|
3654
|
-
requiresTypeChecking: false
|
|
3776
|
+
requiresTypeChecking: false,
|
|
3777
|
+
url: createRuleDocsUrl("require-string-repository-hook-env-values")
|
|
3655
3778
|
},
|
|
3656
3779
|
messages: {
|
|
3657
3780
|
nonStringRepositoryHookEnvValue: "Repository hook `env` for `{{eventName}}` must use string values only (current value: `{{env}}`)."
|
|
@@ -3664,6 +3787,7 @@ var requireStringRepositoryHookEnvValuesRule = createCopilotRule({
|
|
|
3664
3787
|
var require_string_repository_hook_env_values_default = requireStringRepositoryHookEnvValuesRule;
|
|
3665
3788
|
|
|
3666
3789
|
// dist/rules/require-valid-agent-argument-hint.js
|
|
3790
|
+
var import_ts_extras32 = require("ts-extras");
|
|
3667
3791
|
var requireValidAgentArgumentHintRule = createCopilotRule({
|
|
3668
3792
|
create(context) {
|
|
3669
3793
|
return createMarkdownDocumentListener(() => {
|
|
@@ -3674,7 +3798,7 @@ var requireValidAgentArgumentHintRule = createCopilotRule({
|
|
|
3674
3798
|
if (frontmatter === null || !hasFrontmatterField(frontmatter, "argument-hint")) {
|
|
3675
3799
|
return;
|
|
3676
3800
|
}
|
|
3677
|
-
if (getFrontmatterScalar(frontmatter, "argument-hint")
|
|
3801
|
+
if ((0, import_ts_extras32.isDefined)(getFrontmatterScalar(frontmatter, "argument-hint"))) {
|
|
3678
3802
|
return;
|
|
3679
3803
|
}
|
|
3680
3804
|
reportAtDocumentStart(context, {
|
|
@@ -3693,7 +3817,8 @@ var requireValidAgentArgumentHintRule = createCopilotRule({
|
|
|
3693
3817
|
description: "require Copilot custom-agent `argument-hint` metadata to be a non-empty scalar when present.",
|
|
3694
3818
|
frozen: false,
|
|
3695
3819
|
recommended: true,
|
|
3696
|
-
requiresTypeChecking: false
|
|
3820
|
+
requiresTypeChecking: false,
|
|
3821
|
+
url: createRuleDocsUrl("require-valid-agent-argument-hint")
|
|
3697
3822
|
},
|
|
3698
3823
|
messages: {
|
|
3699
3824
|
invalidAgentArgumentHint: "Copilot custom-agent `argument-hint` metadata must be a non-empty scalar when present."
|
|
@@ -3706,6 +3831,7 @@ var requireValidAgentArgumentHintRule = createCopilotRule({
|
|
|
3706
3831
|
var require_valid_agent_argument_hint_default = requireValidAgentArgumentHintRule;
|
|
3707
3832
|
|
|
3708
3833
|
// dist/rules/require-valid-agent-handoff-send.js
|
|
3834
|
+
var import_ts_extras33 = require("ts-extras");
|
|
3709
3835
|
var VALID_BOOLEAN_FIELD_VALUES = /* @__PURE__ */ new Set(["false", "true"]);
|
|
3710
3836
|
var requireValidAgentHandoffSendRule = createCopilotRule({
|
|
3711
3837
|
create(context) {
|
|
@@ -3718,16 +3844,16 @@ var requireValidAgentHandoffSendRule = createCopilotRule({
|
|
|
3718
3844
|
return;
|
|
3719
3845
|
}
|
|
3720
3846
|
const handoffs = getFrontmatterObjectList(frontmatter, "handoffs");
|
|
3721
|
-
if (handoffs
|
|
3847
|
+
if (!(0, import_ts_extras33.isDefined)(handoffs) || (0, import_ts_extras33.isEmpty)(handoffs)) {
|
|
3722
3848
|
return;
|
|
3723
3849
|
}
|
|
3724
3850
|
for (const [index, handoff] of handoffs.entries()) {
|
|
3725
3851
|
const rawSend = handoff["send"];
|
|
3726
|
-
if (
|
|
3852
|
+
if (!(0, import_ts_extras33.isDefined)(rawSend)) {
|
|
3727
3853
|
continue;
|
|
3728
3854
|
}
|
|
3729
3855
|
const normalizedSend = rawSend.trim().toLowerCase();
|
|
3730
|
-
if (
|
|
3856
|
+
if ((0, import_ts_extras33.setHas)(VALID_BOOLEAN_FIELD_VALUES, normalizedSend)) {
|
|
3731
3857
|
continue;
|
|
3732
3858
|
}
|
|
3733
3859
|
reportAtDocumentStart(context, {
|
|
@@ -3752,7 +3878,8 @@ var requireValidAgentHandoffSendRule = createCopilotRule({
|
|
|
3752
3878
|
description: "require Copilot custom-agent handoff `send` values to use documented boolean metadata when present.",
|
|
3753
3879
|
frozen: false,
|
|
3754
3880
|
recommended: true,
|
|
3755
|
-
requiresTypeChecking: false
|
|
3881
|
+
requiresTypeChecking: false,
|
|
3882
|
+
url: createRuleDocsUrl("require-valid-agent-handoff-send")
|
|
3756
3883
|
},
|
|
3757
3884
|
messages: {
|
|
3758
3885
|
invalidHandoffSend: "Copilot custom agent handoff #{{handoffNumber}} must use a boolean `send` value (`true` or `false`), not `{{sendValue}}`."
|
|
@@ -3765,6 +3892,7 @@ var requireValidAgentHandoffSendRule = createCopilotRule({
|
|
|
3765
3892
|
var require_valid_agent_handoff_send_default = requireValidAgentHandoffSendRule;
|
|
3766
3893
|
|
|
3767
3894
|
// dist/rules/require-valid-agent-handoffs.js
|
|
3895
|
+
var import_ts_extras34 = require("ts-extras");
|
|
3768
3896
|
var requireValidAgentHandoffsRule = createCopilotRule({
|
|
3769
3897
|
create(context) {
|
|
3770
3898
|
return createMarkdownDocumentListener(() => {
|
|
@@ -3776,7 +3904,7 @@ var requireValidAgentHandoffsRule = createCopilotRule({
|
|
|
3776
3904
|
return;
|
|
3777
3905
|
}
|
|
3778
3906
|
const handoffs = getFrontmatterObjectList(frontmatter, "handoffs");
|
|
3779
|
-
if (handoffs
|
|
3907
|
+
if (!(0, import_ts_extras34.isDefined)(handoffs) || (0, import_ts_extras34.isEmpty)(handoffs)) {
|
|
3780
3908
|
return;
|
|
3781
3909
|
}
|
|
3782
3910
|
for (const [index, handoff] of handoffs.entries()) {
|
|
@@ -3820,7 +3948,8 @@ var requireValidAgentHandoffsRule = createCopilotRule({
|
|
|
3820
3948
|
description: "require Copilot custom-agent handoffs to define the metadata needed for usable guided transitions.",
|
|
3821
3949
|
frozen: false,
|
|
3822
3950
|
recommended: true,
|
|
3823
|
-
requiresTypeChecking: false
|
|
3951
|
+
requiresTypeChecking: false,
|
|
3952
|
+
url: createRuleDocsUrl("require-valid-agent-handoffs")
|
|
3824
3953
|
},
|
|
3825
3954
|
messages: {
|
|
3826
3955
|
missingAgent: "Copilot custom agent handoff #{{handoffNumber}} must define a non-empty `agent` target.",
|
|
@@ -3835,6 +3964,7 @@ var requireValidAgentHandoffsRule = createCopilotRule({
|
|
|
3835
3964
|
var require_valid_agent_handoffs_default = requireValidAgentHandoffsRule;
|
|
3836
3965
|
|
|
3837
3966
|
// dist/rules/require-valid-agent-hook-events.js
|
|
3967
|
+
var import_ts_extras35 = require("ts-extras");
|
|
3838
3968
|
var VALID_HOOK_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
3839
3969
|
"PostToolUse",
|
|
3840
3970
|
"PreCompact",
|
|
@@ -3856,11 +3986,11 @@ var requireValidAgentHookEventsRule = createCopilotRule({
|
|
|
3856
3986
|
return;
|
|
3857
3987
|
}
|
|
3858
3988
|
const hookGroups = getFrontmatterObjectListGroups(frontmatter, "hooks");
|
|
3859
|
-
if (hookGroups
|
|
3989
|
+
if (!(0, import_ts_extras35.isDefined)(hookGroups) || hookGroups.size === 0) {
|
|
3860
3990
|
return;
|
|
3861
3991
|
}
|
|
3862
3992
|
for (const eventName of hookGroups.keys()) {
|
|
3863
|
-
if (
|
|
3993
|
+
if ((0, import_ts_extras35.setHas)(VALID_HOOK_EVENT_NAMES, eventName)) {
|
|
3864
3994
|
continue;
|
|
3865
3995
|
}
|
|
3866
3996
|
reportAtDocumentStart(context, {
|
|
@@ -3882,7 +4012,8 @@ var requireValidAgentHookEventsRule = createCopilotRule({
|
|
|
3882
4012
|
description: "require Copilot custom-agent hooks to use supported VS Code hook event names.",
|
|
3883
4013
|
frozen: false,
|
|
3884
4014
|
recommended: true,
|
|
3885
|
-
requiresTypeChecking: false
|
|
4015
|
+
requiresTypeChecking: false,
|
|
4016
|
+
url: createRuleDocsUrl("require-valid-agent-hook-events")
|
|
3886
4017
|
},
|
|
3887
4018
|
messages: {
|
|
3888
4019
|
invalidHookEvent: "Copilot custom agent hooks should use a supported event name, not `{{eventName}}`."
|
|
@@ -3895,6 +4026,7 @@ var requireValidAgentHookEventsRule = createCopilotRule({
|
|
|
3895
4026
|
var require_valid_agent_hook_events_default = requireValidAgentHookEventsRule;
|
|
3896
4027
|
|
|
3897
4028
|
// dist/rules/require-valid-agent-hook-timeouts.js
|
|
4029
|
+
var import_ts_extras36 = require("ts-extras");
|
|
3898
4030
|
var isNumericTimeoutValue = (value) => {
|
|
3899
4031
|
let decimalPointCount = 0;
|
|
3900
4032
|
for (const character of value) {
|
|
@@ -3922,13 +4054,13 @@ var requireValidAgentHookTimeoutsRule = createCopilotRule({
|
|
|
3922
4054
|
return;
|
|
3923
4055
|
}
|
|
3924
4056
|
const hookGroups = getFrontmatterObjectListGroups(frontmatter, "hooks");
|
|
3925
|
-
if (hookGroups
|
|
4057
|
+
if (!(0, import_ts_extras36.isDefined)(hookGroups) || hookGroups.size === 0) {
|
|
3926
4058
|
return;
|
|
3927
4059
|
}
|
|
3928
4060
|
for (const [eventName, hooks] of hookGroups) {
|
|
3929
4061
|
for (const [index, hook] of hooks.entries()) {
|
|
3930
4062
|
const timeout = hook["timeout"]?.trim();
|
|
3931
|
-
if (timeout
|
|
4063
|
+
if (!(0, import_ts_extras36.isDefined)(timeout) || timeout.length === 0 || isNumericTimeoutValue(timeout)) {
|
|
3932
4064
|
continue;
|
|
3933
4065
|
}
|
|
3934
4066
|
reportAtDocumentStart(context, {
|
|
@@ -3955,7 +4087,8 @@ var requireValidAgentHookTimeoutsRule = createCopilotRule({
|
|
|
3955
4087
|
description: "require Copilot custom-agent hook `timeout` values to be numeric seconds when present.",
|
|
3956
4088
|
frozen: false,
|
|
3957
4089
|
recommended: true,
|
|
3958
|
-
requiresTypeChecking: false
|
|
4090
|
+
requiresTypeChecking: false,
|
|
4091
|
+
url: createRuleDocsUrl("require-valid-agent-hook-timeouts")
|
|
3959
4092
|
},
|
|
3960
4093
|
messages: {
|
|
3961
4094
|
invalidHookTimeout: "Copilot custom agent hook #{{hookNumber}} in `{{eventName}}` should use a numeric `timeout` value in seconds, not `{{timeout}}`."
|
|
@@ -3968,6 +4101,7 @@ var requireValidAgentHookTimeoutsRule = createCopilotRule({
|
|
|
3968
4101
|
var require_valid_agent_hook_timeouts_default = requireValidAgentHookTimeoutsRule;
|
|
3969
4102
|
|
|
3970
4103
|
// dist/rules/require-valid-agent-hooks.js
|
|
4104
|
+
var import_ts_extras37 = require("ts-extras");
|
|
3971
4105
|
var hasAnyHookCommand = (hook) => [
|
|
3972
4106
|
"command",
|
|
3973
4107
|
"windows",
|
|
@@ -3977,6 +4111,29 @@ var hasAnyHookCommand = (hook) => [
|
|
|
3977
4111
|
const value = hook[key];
|
|
3978
4112
|
return typeof value === "string" && value.trim().length > 0;
|
|
3979
4113
|
});
|
|
4114
|
+
var getInvalidHookReport = (eventName, hook, hookNumber) => {
|
|
4115
|
+
const type = hook["type"]?.trim() ?? "";
|
|
4116
|
+
if (type !== "command") {
|
|
4117
|
+
return {
|
|
4118
|
+
data: {
|
|
4119
|
+
eventName,
|
|
4120
|
+
hookNumber,
|
|
4121
|
+
type: type.length === 0 ? "(missing)" : type
|
|
4122
|
+
},
|
|
4123
|
+
messageId: "invalidHookType"
|
|
4124
|
+
};
|
|
4125
|
+
}
|
|
4126
|
+
if (hasAnyHookCommand(hook)) {
|
|
4127
|
+
return void 0;
|
|
4128
|
+
}
|
|
4129
|
+
return {
|
|
4130
|
+
data: {
|
|
4131
|
+
eventName,
|
|
4132
|
+
hookNumber
|
|
4133
|
+
},
|
|
4134
|
+
messageId: "missingHookCommand"
|
|
4135
|
+
};
|
|
4136
|
+
};
|
|
3980
4137
|
var requireValidAgentHooksRule = createCopilotRule({
|
|
3981
4138
|
create(context) {
|
|
3982
4139
|
return createMarkdownDocumentListener(() => {
|
|
@@ -3988,34 +4145,17 @@ var requireValidAgentHooksRule = createCopilotRule({
|
|
|
3988
4145
|
return;
|
|
3989
4146
|
}
|
|
3990
4147
|
const hookGroups = getFrontmatterObjectListGroups(frontmatter, "hooks");
|
|
3991
|
-
if (hookGroups
|
|
4148
|
+
if (!(0, import_ts_extras37.isDefined)(hookGroups) || hookGroups.size === 0) {
|
|
3992
4149
|
return;
|
|
3993
4150
|
}
|
|
3994
4151
|
for (const [eventName, hooks] of hookGroups) {
|
|
3995
4152
|
for (const [index, hook] of hooks.entries()) {
|
|
3996
4153
|
const hookNumber = String(index + 1);
|
|
3997
|
-
const
|
|
3998
|
-
if (
|
|
3999
|
-
reportAtDocumentStart(context, {
|
|
4000
|
-
data: {
|
|
4001
|
-
eventName,
|
|
4002
|
-
hookNumber,
|
|
4003
|
-
type: type.length === 0 ? "(missing)" : type
|
|
4004
|
-
},
|
|
4005
|
-
messageId: "invalidHookType"
|
|
4006
|
-
});
|
|
4007
|
-
return;
|
|
4008
|
-
}
|
|
4009
|
-
if (hasAnyHookCommand(hook)) {
|
|
4154
|
+
const invalidHookReport = getInvalidHookReport(eventName, hook, hookNumber);
|
|
4155
|
+
if (!(0, import_ts_extras37.isDefined)(invalidHookReport)) {
|
|
4010
4156
|
continue;
|
|
4011
4157
|
}
|
|
4012
|
-
reportAtDocumentStart(context,
|
|
4013
|
-
data: {
|
|
4014
|
-
eventName,
|
|
4015
|
-
hookNumber
|
|
4016
|
-
},
|
|
4017
|
-
messageId: "missingHookCommand"
|
|
4018
|
-
});
|
|
4158
|
+
reportAtDocumentStart(context, invalidHookReport);
|
|
4019
4159
|
return;
|
|
4020
4160
|
}
|
|
4021
4161
|
}
|
|
@@ -4032,7 +4172,8 @@ var requireValidAgentHooksRule = createCopilotRule({
|
|
|
4032
4172
|
description: "require Copilot custom-agent hooks to use `type: command` and define at least one command property.",
|
|
4033
4173
|
frozen: false,
|
|
4034
4174
|
recommended: true,
|
|
4035
|
-
requiresTypeChecking: false
|
|
4175
|
+
requiresTypeChecking: false,
|
|
4176
|
+
url: createRuleDocsUrl("require-valid-agent-hooks")
|
|
4036
4177
|
},
|
|
4037
4178
|
messages: {
|
|
4038
4179
|
invalidHookType: "Copilot custom agent hook #{{hookNumber}} in `{{eventName}}` must use `type: command` (current value: `{{type}}`).",
|
|
@@ -4046,6 +4187,7 @@ var requireValidAgentHooksRule = createCopilotRule({
|
|
|
4046
4187
|
var require_valid_agent_hooks_default = requireValidAgentHooksRule;
|
|
4047
4188
|
|
|
4048
4189
|
// dist/rules/require-valid-agent-invocation-controls.js
|
|
4190
|
+
var import_ts_extras38 = require("ts-extras");
|
|
4049
4191
|
var VALID_BOOLEAN_FIELD_VALUES2 = /* @__PURE__ */ new Set(["false", "true"]);
|
|
4050
4192
|
var INVOCATION_CONTROL_FIELDS = [
|
|
4051
4193
|
"disable-model-invocation",
|
|
@@ -4067,12 +4209,12 @@ var requireValidAgentInvocationControlsRule = createCopilotRule({
|
|
|
4067
4209
|
}
|
|
4068
4210
|
const fieldValue = getFrontmatterScalar(frontmatter, fieldName);
|
|
4069
4211
|
const normalizedValue = fieldValue?.trim().toLowerCase();
|
|
4070
|
-
if (normalizedValue
|
|
4212
|
+
if ((0, import_ts_extras38.isDefined)(normalizedValue) && (0, import_ts_extras38.setHas)(VALID_BOOLEAN_FIELD_VALUES2, normalizedValue)) {
|
|
4071
4213
|
continue;
|
|
4072
4214
|
}
|
|
4073
4215
|
reportAtDocumentStart(context, {
|
|
4074
4216
|
data: {
|
|
4075
|
-
currentValue: fieldValue
|
|
4217
|
+
currentValue: !(0, import_ts_extras38.isDefined)(fieldValue) || fieldValue.trim().length === 0 ? "(empty)" : fieldValue,
|
|
4076
4218
|
fieldName
|
|
4077
4219
|
},
|
|
4078
4220
|
messageId: "invalidInvocationControl"
|
|
@@ -4092,7 +4234,8 @@ var requireValidAgentInvocationControlsRule = createCopilotRule({
|
|
|
4092
4234
|
description: "require Copilot custom-agent invocation-control flags to use documented boolean values when present.",
|
|
4093
4235
|
frozen: false,
|
|
4094
4236
|
recommended: true,
|
|
4095
|
-
requiresTypeChecking: false
|
|
4237
|
+
requiresTypeChecking: false,
|
|
4238
|
+
url: createRuleDocsUrl("require-valid-agent-invocation-controls")
|
|
4096
4239
|
},
|
|
4097
4240
|
messages: {
|
|
4098
4241
|
invalidInvocationControl: "Copilot custom agent `{{fieldName}}` must use a boolean `true` or `false` value (current value: `{{currentValue}}`)."
|
|
@@ -4105,12 +4248,13 @@ var requireValidAgentInvocationControlsRule = createCopilotRule({
|
|
|
4105
4248
|
var require_valid_agent_invocation_controls_default = requireValidAgentInvocationControlsRule;
|
|
4106
4249
|
|
|
4107
4250
|
// dist/rules/require-valid-agent-mcp-servers.js
|
|
4251
|
+
var import_ts_extras39 = require("ts-extras");
|
|
4108
4252
|
var formatMcpServersValue = (scalarValue, listValue) => {
|
|
4109
|
-
if (
|
|
4253
|
+
if ((0, import_ts_extras39.isDefined)(scalarValue)) {
|
|
4110
4254
|
return scalarValue;
|
|
4111
4255
|
}
|
|
4112
|
-
if (
|
|
4113
|
-
return `[${
|
|
4256
|
+
if ((0, import_ts_extras39.isDefined)(listValue)) {
|
|
4257
|
+
return `[${(0, import_ts_extras39.arrayJoin)(listValue, ", ")}]`;
|
|
4114
4258
|
}
|
|
4115
4259
|
return "(empty)";
|
|
4116
4260
|
};
|
|
@@ -4125,7 +4269,7 @@ var requireValidAgentMcpServersRule = createCopilotRule({
|
|
|
4125
4269
|
return;
|
|
4126
4270
|
}
|
|
4127
4271
|
const mcpServers = getFrontmatterList(frontmatter, "mcp-servers");
|
|
4128
|
-
if (mcpServers
|
|
4272
|
+
if ((0, import_ts_extras39.isDefined)(mcpServers) && mcpServers.length > 0) {
|
|
4129
4273
|
return;
|
|
4130
4274
|
}
|
|
4131
4275
|
reportAtDocumentStart(context, {
|
|
@@ -4147,7 +4291,8 @@ var requireValidAgentMcpServersRule = createCopilotRule({
|
|
|
4147
4291
|
description: "require Copilot custom-agent `mcp-servers` metadata to be a non-empty list when present.",
|
|
4148
4292
|
frozen: false,
|
|
4149
4293
|
recommended: true,
|
|
4150
|
-
requiresTypeChecking: false
|
|
4294
|
+
requiresTypeChecking: false,
|
|
4295
|
+
url: createRuleDocsUrl("require-valid-agent-mcp-servers")
|
|
4151
4296
|
},
|
|
4152
4297
|
messages: {
|
|
4153
4298
|
invalidMcpServersField: "Copilot custom agent `mcp-servers` metadata must be a non-empty list of MCP server config names (current value: `{{mcpServersValue}}`)."
|
|
@@ -4160,6 +4305,7 @@ var requireValidAgentMcpServersRule = createCopilotRule({
|
|
|
4160
4305
|
var require_valid_agent_mcp_servers_default = requireValidAgentMcpServersRule;
|
|
4161
4306
|
|
|
4162
4307
|
// dist/rules/require-valid-agent-model.js
|
|
4308
|
+
var import_ts_extras40 = require("ts-extras");
|
|
4163
4309
|
var INLINE_LIST_LITERAL_PATTERN = /^\s*\[.*\]\s*$/u;
|
|
4164
4310
|
var requireValidAgentModelRule = createCopilotRule({
|
|
4165
4311
|
create(context) {
|
|
@@ -4172,16 +4318,16 @@ var requireValidAgentModelRule = createCopilotRule({
|
|
|
4172
4318
|
return;
|
|
4173
4319
|
}
|
|
4174
4320
|
const modelList = getFrontmatterList(frontmatter, "model");
|
|
4175
|
-
if (modelList
|
|
4321
|
+
if ((0, import_ts_extras40.isDefined)(modelList) && modelList.length > 0) {
|
|
4176
4322
|
return;
|
|
4177
4323
|
}
|
|
4178
4324
|
const model = getFrontmatterScalar(frontmatter, "model");
|
|
4179
|
-
if (model
|
|
4325
|
+
if ((0, import_ts_extras40.isDefined)(model) && model.length > 0 && !INLINE_LIST_LITERAL_PATTERN.test(model)) {
|
|
4180
4326
|
return;
|
|
4181
4327
|
}
|
|
4182
4328
|
reportAtDocumentStart(context, {
|
|
4183
4329
|
data: {
|
|
4184
|
-
modelValue: model
|
|
4330
|
+
modelValue: !(0, import_ts_extras40.isDefined)(model) || model.trim().length === 0 ? "(empty)" : model
|
|
4185
4331
|
},
|
|
4186
4332
|
messageId: "invalidAgentModel"
|
|
4187
4333
|
});
|
|
@@ -4198,7 +4344,8 @@ var requireValidAgentModelRule = createCopilotRule({
|
|
|
4198
4344
|
description: "require Copilot custom-agent `model` metadata to be a non-empty model name or non-empty prioritized model list when present.",
|
|
4199
4345
|
frozen: false,
|
|
4200
4346
|
recommended: true,
|
|
4201
|
-
requiresTypeChecking: false
|
|
4347
|
+
requiresTypeChecking: false,
|
|
4348
|
+
url: createRuleDocsUrl("require-valid-agent-model")
|
|
4202
4349
|
},
|
|
4203
4350
|
messages: {
|
|
4204
4351
|
invalidAgentModel: "Copilot custom agent `model` must be a non-empty model name or non-empty prioritized list of model names (current value: `{{modelValue}}`)."
|
|
@@ -4211,6 +4358,7 @@ var requireValidAgentModelRule = createCopilotRule({
|
|
|
4211
4358
|
var require_valid_agent_model_default = requireValidAgentModelRule;
|
|
4212
4359
|
|
|
4213
4360
|
// dist/rules/require-valid-agent-name.js
|
|
4361
|
+
var import_ts_extras41 = require("ts-extras");
|
|
4214
4362
|
var requireValidAgentNameRule = createCopilotRule({
|
|
4215
4363
|
create(context) {
|
|
4216
4364
|
return createMarkdownDocumentListener(() => {
|
|
@@ -4221,7 +4369,7 @@ var requireValidAgentNameRule = createCopilotRule({
|
|
|
4221
4369
|
if (frontmatter === null || !hasFrontmatterField(frontmatter, "name")) {
|
|
4222
4370
|
return;
|
|
4223
4371
|
}
|
|
4224
|
-
if (getFrontmatterScalar(frontmatter, "name")
|
|
4372
|
+
if ((0, import_ts_extras41.isDefined)(getFrontmatterScalar(frontmatter, "name"))) {
|
|
4225
4373
|
return;
|
|
4226
4374
|
}
|
|
4227
4375
|
reportAtDocumentStart(context, {
|
|
@@ -4240,7 +4388,8 @@ var requireValidAgentNameRule = createCopilotRule({
|
|
|
4240
4388
|
description: "require Copilot custom-agent `name` metadata to be a non-empty scalar when present.",
|
|
4241
4389
|
frozen: false,
|
|
4242
4390
|
recommended: true,
|
|
4243
|
-
requiresTypeChecking: false
|
|
4391
|
+
requiresTypeChecking: false,
|
|
4392
|
+
url: createRuleDocsUrl("require-valid-agent-name")
|
|
4244
4393
|
},
|
|
4245
4394
|
messages: {
|
|
4246
4395
|
invalidAgentName: "Copilot custom-agent `name` metadata must be a non-empty scalar when present."
|
|
@@ -4253,6 +4402,7 @@ var requireValidAgentNameRule = createCopilotRule({
|
|
|
4253
4402
|
var require_valid_agent_name_default = requireValidAgentNameRule;
|
|
4254
4403
|
|
|
4255
4404
|
// dist/rules/require-valid-agent-subagents.js
|
|
4405
|
+
var import_ts_extras42 = require("ts-extras");
|
|
4256
4406
|
var EMPTY_ARRAY_LITERAL = "[]";
|
|
4257
4407
|
var WILDCARD_AGENTS_LITERAL = "*";
|
|
4258
4408
|
var isValidExplicitAgentName = (value) => {
|
|
@@ -4260,11 +4410,11 @@ var isValidExplicitAgentName = (value) => {
|
|
|
4260
4410
|
return trimmedValue.length > 0 && trimmedValue !== EMPTY_ARRAY_LITERAL && trimmedValue !== WILDCARD_AGENTS_LITERAL;
|
|
4261
4411
|
};
|
|
4262
4412
|
var formatAgentsValue = (scalarValue, listValue) => {
|
|
4263
|
-
if (
|
|
4413
|
+
if ((0, import_ts_extras42.isDefined)(scalarValue)) {
|
|
4264
4414
|
return scalarValue;
|
|
4265
4415
|
}
|
|
4266
|
-
if (
|
|
4267
|
-
return `[${
|
|
4416
|
+
if ((0, import_ts_extras42.isDefined)(listValue)) {
|
|
4417
|
+
return `[${(0, import_ts_extras42.arrayJoin)(listValue, ", ")}]`;
|
|
4268
4418
|
}
|
|
4269
4419
|
return "(empty)";
|
|
4270
4420
|
};
|
|
@@ -4283,7 +4433,7 @@ var requireValidAgentSubagentsRule = createCopilotRule({
|
|
|
4283
4433
|
if (agentsScalar === WILDCARD_AGENTS_LITERAL || agentsScalar === EMPTY_ARRAY_LITERAL) {
|
|
4284
4434
|
return;
|
|
4285
4435
|
}
|
|
4286
|
-
if (allowedAgents
|
|
4436
|
+
if ((0, import_ts_extras42.isDefined)(allowedAgents) && allowedAgents.length > 0 && allowedAgents.every((agentName) => isValidExplicitAgentName(agentName))) {
|
|
4287
4437
|
return;
|
|
4288
4438
|
}
|
|
4289
4439
|
reportAtDocumentStart(context, {
|
|
@@ -4305,7 +4455,8 @@ var requireValidAgentSubagentsRule = createCopilotRule({
|
|
|
4305
4455
|
description: "require Copilot custom-agent `agents` metadata to be `*`, `[]`, or a non-empty list of explicit agent names.",
|
|
4306
4456
|
frozen: false,
|
|
4307
4457
|
recommended: true,
|
|
4308
|
-
requiresTypeChecking: false
|
|
4458
|
+
requiresTypeChecking: false,
|
|
4459
|
+
url: createRuleDocsUrl("require-valid-agent-subagents")
|
|
4309
4460
|
},
|
|
4310
4461
|
messages: {
|
|
4311
4462
|
invalidAgentsField: "Copilot custom agent `agents` metadata must be `*`, `[]`, or a non-empty list of agent names (current value: `{{agentsValue}}`)."
|
|
@@ -4318,6 +4469,7 @@ var requireValidAgentSubagentsRule = createCopilotRule({
|
|
|
4318
4469
|
var require_valid_agent_subagents_default = requireValidAgentSubagentsRule;
|
|
4319
4470
|
|
|
4320
4471
|
// dist/rules/require-valid-agent-target.js
|
|
4472
|
+
var import_ts_extras43 = require("ts-extras");
|
|
4321
4473
|
var VALID_AGENT_TARGETS = /* @__PURE__ */ new Set(["github-copilot", "vscode"]);
|
|
4322
4474
|
var requireValidAgentTargetRule = createCopilotRule({
|
|
4323
4475
|
create(context) {
|
|
@@ -4330,13 +4482,13 @@ var requireValidAgentTargetRule = createCopilotRule({
|
|
|
4330
4482
|
return;
|
|
4331
4483
|
}
|
|
4332
4484
|
const target = getFrontmatterScalar(frontmatter, "target");
|
|
4333
|
-
if (
|
|
4485
|
+
if (!(0, import_ts_extras43.isDefined)(target)) {
|
|
4334
4486
|
reportAtDocumentStart(context, {
|
|
4335
4487
|
messageId: "emptyTarget"
|
|
4336
4488
|
});
|
|
4337
4489
|
return;
|
|
4338
4490
|
}
|
|
4339
|
-
if (
|
|
4491
|
+
if ((0, import_ts_extras43.setHas)(VALID_AGENT_TARGETS, target)) {
|
|
4340
4492
|
return;
|
|
4341
4493
|
}
|
|
4342
4494
|
reportAtDocumentStart(context, {
|
|
@@ -4356,7 +4508,8 @@ var requireValidAgentTargetRule = createCopilotRule({
|
|
|
4356
4508
|
description: "require Copilot custom-agent `target` metadata to use a documented target value when present.",
|
|
4357
4509
|
frozen: false,
|
|
4358
4510
|
recommended: true,
|
|
4359
|
-
requiresTypeChecking: false
|
|
4511
|
+
requiresTypeChecking: false,
|
|
4512
|
+
url: createRuleDocsUrl("require-valid-agent-target")
|
|
4360
4513
|
},
|
|
4361
4514
|
messages: {
|
|
4362
4515
|
emptyTarget: "Copilot custom agent files that declare `target` must use a non-empty documented value (`vscode` or `github-copilot`).",
|
|
@@ -4370,12 +4523,13 @@ var requireValidAgentTargetRule = createCopilotRule({
|
|
|
4370
4523
|
var require_valid_agent_target_default = requireValidAgentTargetRule;
|
|
4371
4524
|
|
|
4372
4525
|
// dist/rules/require-valid-agent-tools.js
|
|
4526
|
+
var import_ts_extras44 = require("ts-extras");
|
|
4373
4527
|
var formatToolsValue = (scalarValue, listValue) => {
|
|
4374
|
-
if (
|
|
4528
|
+
if ((0, import_ts_extras44.isDefined)(scalarValue)) {
|
|
4375
4529
|
return scalarValue;
|
|
4376
4530
|
}
|
|
4377
|
-
if (
|
|
4378
|
-
return `[${
|
|
4531
|
+
if ((0, import_ts_extras44.isDefined)(listValue)) {
|
|
4532
|
+
return `[${(0, import_ts_extras44.arrayJoin)(listValue, ", ")}]`;
|
|
4379
4533
|
}
|
|
4380
4534
|
return "(empty)";
|
|
4381
4535
|
};
|
|
@@ -4390,7 +4544,7 @@ var requireValidAgentToolsRule = createCopilotRule({
|
|
|
4390
4544
|
return;
|
|
4391
4545
|
}
|
|
4392
4546
|
const tools = getFrontmatterList(frontmatter, "tools");
|
|
4393
|
-
if (tools
|
|
4547
|
+
if ((0, import_ts_extras44.isDefined)(tools) && tools.length > 0) {
|
|
4394
4548
|
return;
|
|
4395
4549
|
}
|
|
4396
4550
|
reportAtDocumentStart(context, {
|
|
@@ -4412,7 +4566,8 @@ var requireValidAgentToolsRule = createCopilotRule({
|
|
|
4412
4566
|
description: "require Copilot custom-agent `tools` metadata to be a non-empty list of tool or tool-set names when present.",
|
|
4413
4567
|
frozen: false,
|
|
4414
4568
|
recommended: true,
|
|
4415
|
-
requiresTypeChecking: false
|
|
4569
|
+
requiresTypeChecking: false,
|
|
4570
|
+
url: createRuleDocsUrl("require-valid-agent-tools")
|
|
4416
4571
|
},
|
|
4417
4572
|
messages: {
|
|
4418
4573
|
invalidAgentTools: "Copilot custom agent `tools` metadata must be a non-empty list of tool or tool-set names when present (current value: `{{toolsValue}}`)."
|
|
@@ -4425,6 +4580,7 @@ var requireValidAgentToolsRule = createCopilotRule({
|
|
|
4425
4580
|
var require_valid_agent_tools_default = requireValidAgentToolsRule;
|
|
4426
4581
|
|
|
4427
4582
|
// dist/rules/require-valid-instructions-apply-to-globs.js
|
|
4583
|
+
var import_ts_extras45 = require("ts-extras");
|
|
4428
4584
|
var isValidApplyToGlob = (value) => {
|
|
4429
4585
|
const trimmedValue = value.trim();
|
|
4430
4586
|
const lowercaseValue = trimmedValue.toLowerCase();
|
|
@@ -4444,11 +4600,11 @@ var requireValidInstructionsApplyToGlobsRule = createCopilotRule({
|
|
|
4444
4600
|
...getFrontmatterList(frontmatter, "applyTo") ?? []
|
|
4445
4601
|
];
|
|
4446
4602
|
const applyToScalar = getFrontmatterScalar(frontmatter, "applyTo");
|
|
4447
|
-
if (
|
|
4603
|
+
if ((0, import_ts_extras45.isDefined)(applyToScalar)) {
|
|
4448
4604
|
applyToValues.push(applyToScalar);
|
|
4449
4605
|
}
|
|
4450
|
-
const invalidValue = applyToValues.find((value) => !isValidApplyToGlob(value));
|
|
4451
|
-
if (invalidValue ===
|
|
4606
|
+
const invalidValue = applyToValues.find((value) => !isValidApplyToGlob(value)) ?? null;
|
|
4607
|
+
if (invalidValue === null) {
|
|
4452
4608
|
return;
|
|
4453
4609
|
}
|
|
4454
4610
|
reportAtDocumentStart(context, {
|
|
@@ -4470,7 +4626,8 @@ var requireValidInstructionsApplyToGlobsRule = createCopilotRule({
|
|
|
4470
4626
|
description: "require path-specific Copilot instructions `applyTo` metadata to use repository-relative glob patterns.",
|
|
4471
4627
|
frozen: false,
|
|
4472
4628
|
recommended: true,
|
|
4473
|
-
requiresTypeChecking: false
|
|
4629
|
+
requiresTypeChecking: false,
|
|
4630
|
+
url: createRuleDocsUrl("require-valid-instructions-apply-to-globs")
|
|
4474
4631
|
},
|
|
4475
4632
|
messages: {
|
|
4476
4633
|
invalidApplyToGlob: "Copilot instructions `applyTo` metadata should use repository-relative glob patterns, not `{{applyTo}}`."
|
|
@@ -4483,6 +4640,7 @@ var requireValidInstructionsApplyToGlobsRule = createCopilotRule({
|
|
|
4483
4640
|
var require_valid_instructions_apply_to_globs_default = requireValidInstructionsApplyToGlobsRule;
|
|
4484
4641
|
|
|
4485
4642
|
// dist/rules/require-valid-prompt-argument-hint.js
|
|
4643
|
+
var import_ts_extras46 = require("ts-extras");
|
|
4486
4644
|
var requireValidPromptArgumentHintRule = createCopilotRule({
|
|
4487
4645
|
create(context) {
|
|
4488
4646
|
return createMarkdownDocumentListener(() => {
|
|
@@ -4493,7 +4651,7 @@ var requireValidPromptArgumentHintRule = createCopilotRule({
|
|
|
4493
4651
|
if (frontmatter === null || !hasFrontmatterField(frontmatter, "argument-hint")) {
|
|
4494
4652
|
return;
|
|
4495
4653
|
}
|
|
4496
|
-
if (getFrontmatterScalar(frontmatter, "argument-hint")
|
|
4654
|
+
if ((0, import_ts_extras46.isDefined)(getFrontmatterScalar(frontmatter, "argument-hint"))) {
|
|
4497
4655
|
return;
|
|
4498
4656
|
}
|
|
4499
4657
|
reportAtDocumentStart(context, {
|
|
@@ -4512,7 +4670,8 @@ var requireValidPromptArgumentHintRule = createCopilotRule({
|
|
|
4512
4670
|
description: "require Copilot prompt-file `argument-hint` metadata to be a non-empty scalar when present.",
|
|
4513
4671
|
frozen: false,
|
|
4514
4672
|
recommended: true,
|
|
4515
|
-
requiresTypeChecking: false
|
|
4673
|
+
requiresTypeChecking: false,
|
|
4674
|
+
url: createRuleDocsUrl("require-valid-prompt-argument-hint")
|
|
4516
4675
|
},
|
|
4517
4676
|
messages: {
|
|
4518
4677
|
invalidPromptArgumentHint: "Copilot prompt-file `argument-hint` metadata must be a non-empty scalar when present."
|
|
@@ -4525,13 +4684,14 @@ var requireValidPromptArgumentHintRule = createCopilotRule({
|
|
|
4525
4684
|
var require_valid_prompt_argument_hint_default = requireValidPromptArgumentHintRule;
|
|
4526
4685
|
|
|
4527
4686
|
// dist/rules/require-valid-prompt-model.js
|
|
4687
|
+
var import_ts_extras47 = require("ts-extras");
|
|
4528
4688
|
var INLINE_LIST_LITERAL_PATTERN2 = /^\s*\[.*\]\s*$/u;
|
|
4529
4689
|
var formatPromptModelValue = (scalarValue, listValue) => {
|
|
4530
|
-
if (
|
|
4690
|
+
if ((0, import_ts_extras47.isDefined)(scalarValue)) {
|
|
4531
4691
|
return scalarValue;
|
|
4532
4692
|
}
|
|
4533
|
-
if (
|
|
4534
|
-
return `[${
|
|
4693
|
+
if ((0, import_ts_extras47.isDefined)(listValue)) {
|
|
4694
|
+
return `[${(0, import_ts_extras47.arrayJoin)(listValue, ", ")}]`;
|
|
4535
4695
|
}
|
|
4536
4696
|
return "(empty)";
|
|
4537
4697
|
};
|
|
@@ -4546,7 +4706,7 @@ var requireValidPromptModelRule = createCopilotRule({
|
|
|
4546
4706
|
return;
|
|
4547
4707
|
}
|
|
4548
4708
|
const modelList = getFrontmatterList(frontmatter, "model");
|
|
4549
|
-
if (
|
|
4709
|
+
if ((0, import_ts_extras47.isDefined)(modelList)) {
|
|
4550
4710
|
reportAtDocumentStart(context, {
|
|
4551
4711
|
data: {
|
|
4552
4712
|
modelValue: formatPromptModelValue(void 0, modelList)
|
|
@@ -4556,7 +4716,7 @@ var requireValidPromptModelRule = createCopilotRule({
|
|
|
4556
4716
|
return;
|
|
4557
4717
|
}
|
|
4558
4718
|
const model = getFrontmatterScalar(frontmatter, "model");
|
|
4559
|
-
if (model
|
|
4719
|
+
if ((0, import_ts_extras47.isDefined)(model) && model.length > 0 && !INLINE_LIST_LITERAL_PATTERN2.test(model)) {
|
|
4560
4720
|
return;
|
|
4561
4721
|
}
|
|
4562
4722
|
reportAtDocumentStart(context, {
|
|
@@ -4578,7 +4738,8 @@ var requireValidPromptModelRule = createCopilotRule({
|
|
|
4578
4738
|
description: "require Copilot prompt-file `model` metadata to be a non-empty single model name when present.",
|
|
4579
4739
|
frozen: false,
|
|
4580
4740
|
recommended: true,
|
|
4581
|
-
requiresTypeChecking: false
|
|
4741
|
+
requiresTypeChecking: false,
|
|
4742
|
+
url: createRuleDocsUrl("require-valid-prompt-model")
|
|
4582
4743
|
},
|
|
4583
4744
|
messages: {
|
|
4584
4745
|
invalidPromptModel: "Copilot prompt-file `model` metadata must be a non-empty single model name when present (current value: `{{modelValue}}`)."
|
|
@@ -4591,6 +4752,7 @@ var requireValidPromptModelRule = createCopilotRule({
|
|
|
4591
4752
|
var require_valid_prompt_model_default = requireValidPromptModelRule;
|
|
4592
4753
|
|
|
4593
4754
|
// dist/rules/require-valid-prompt-name.js
|
|
4755
|
+
var import_ts_extras48 = require("ts-extras");
|
|
4594
4756
|
var requireValidPromptNameRule = createCopilotRule({
|
|
4595
4757
|
create(context) {
|
|
4596
4758
|
return createMarkdownDocumentListener(() => {
|
|
@@ -4601,7 +4763,7 @@ var requireValidPromptNameRule = createCopilotRule({
|
|
|
4601
4763
|
if (frontmatter === null || !hasFrontmatterField(frontmatter, "name")) {
|
|
4602
4764
|
return;
|
|
4603
4765
|
}
|
|
4604
|
-
if (getFrontmatterScalar(frontmatter, "name")
|
|
4766
|
+
if ((0, import_ts_extras48.isDefined)(getFrontmatterScalar(frontmatter, "name"))) {
|
|
4605
4767
|
return;
|
|
4606
4768
|
}
|
|
4607
4769
|
reportAtDocumentStart(context, {
|
|
@@ -4620,7 +4782,8 @@ var requireValidPromptNameRule = createCopilotRule({
|
|
|
4620
4782
|
description: "require Copilot prompt-file `name` metadata to be a non-empty scalar when present.",
|
|
4621
4783
|
frozen: false,
|
|
4622
4784
|
recommended: true,
|
|
4623
|
-
requiresTypeChecking: false
|
|
4785
|
+
requiresTypeChecking: false,
|
|
4786
|
+
url: createRuleDocsUrl("require-valid-prompt-name")
|
|
4624
4787
|
},
|
|
4625
4788
|
messages: {
|
|
4626
4789
|
invalidPromptName: "Copilot prompt-file `name` metadata must be a non-empty scalar when present."
|
|
@@ -4633,12 +4796,13 @@ var requireValidPromptNameRule = createCopilotRule({
|
|
|
4633
4796
|
var require_valid_prompt_name_default = requireValidPromptNameRule;
|
|
4634
4797
|
|
|
4635
4798
|
// dist/rules/require-valid-prompt-tools.js
|
|
4799
|
+
var import_ts_extras49 = require("ts-extras");
|
|
4636
4800
|
var formatToolsValue2 = (scalarValue, listValue) => {
|
|
4637
|
-
if (
|
|
4801
|
+
if ((0, import_ts_extras49.isDefined)(scalarValue)) {
|
|
4638
4802
|
return scalarValue;
|
|
4639
4803
|
}
|
|
4640
|
-
if (
|
|
4641
|
-
return `[${
|
|
4804
|
+
if ((0, import_ts_extras49.isDefined)(listValue)) {
|
|
4805
|
+
return `[${(0, import_ts_extras49.arrayJoin)(listValue, ", ")}]`;
|
|
4642
4806
|
}
|
|
4643
4807
|
return "(empty)";
|
|
4644
4808
|
};
|
|
@@ -4653,7 +4817,7 @@ var requireValidPromptToolsRule = createCopilotRule({
|
|
|
4653
4817
|
return;
|
|
4654
4818
|
}
|
|
4655
4819
|
const tools = getFrontmatterList(frontmatter, "tools");
|
|
4656
|
-
if (tools
|
|
4820
|
+
if ((0, import_ts_extras49.isDefined)(tools) && tools.length > 0) {
|
|
4657
4821
|
return;
|
|
4658
4822
|
}
|
|
4659
4823
|
reportAtDocumentStart(context, {
|
|
@@ -4675,7 +4839,8 @@ var requireValidPromptToolsRule = createCopilotRule({
|
|
|
4675
4839
|
description: "require Copilot prompt-file `tools` metadata to be a non-empty list of tool or tool-set names when present.",
|
|
4676
4840
|
frozen: false,
|
|
4677
4841
|
recommended: true,
|
|
4678
|
-
requiresTypeChecking: false
|
|
4842
|
+
requiresTypeChecking: false,
|
|
4843
|
+
url: createRuleDocsUrl("require-valid-prompt-tools")
|
|
4679
4844
|
},
|
|
4680
4845
|
messages: {
|
|
4681
4846
|
invalidPromptTools: "Copilot prompt-file `tools` metadata must be a non-empty list of tool or tool-set names when present (current value: `{{toolsValue}}`)."
|
|
@@ -4688,6 +4853,7 @@ var requireValidPromptToolsRule = createCopilotRule({
|
|
|
4688
4853
|
var require_valid_prompt_tools_default = requireValidPromptToolsRule;
|
|
4689
4854
|
|
|
4690
4855
|
// dist/rules/require-valid-repository-hook-command-type.js
|
|
4856
|
+
var import_ts_extras50 = require("ts-extras");
|
|
4691
4857
|
var requireValidRepositoryHookCommandTypeRule = createCopilotRule({
|
|
4692
4858
|
create(context) {
|
|
4693
4859
|
return {
|
|
@@ -4700,7 +4866,7 @@ var requireValidRepositoryHookCommandTypeRule = createCopilotRule({
|
|
|
4700
4866
|
const typeValue = hook["type"];
|
|
4701
4867
|
return !isJsonString(typeValue) || !isRepositoryHookType(typeValue);
|
|
4702
4868
|
});
|
|
4703
|
-
if (
|
|
4869
|
+
if (!(0, import_ts_extras50.isDefined)(invalidHook)) {
|
|
4704
4870
|
return;
|
|
4705
4871
|
}
|
|
4706
4872
|
reportAtDocumentStart(context, {
|
|
@@ -4724,7 +4890,8 @@ var requireValidRepositoryHookCommandTypeRule = createCopilotRule({
|
|
|
4724
4890
|
description: "require repository hook definitions to declare a supported `type` value such as `command` or `prompt`.",
|
|
4725
4891
|
frozen: false,
|
|
4726
4892
|
recommended: true,
|
|
4727
|
-
requiresTypeChecking: false
|
|
4893
|
+
requiresTypeChecking: false,
|
|
4894
|
+
url: createRuleDocsUrl("require-valid-repository-hook-command-type")
|
|
4728
4895
|
},
|
|
4729
4896
|
messages: {
|
|
4730
4897
|
invalidRepositoryHookType: "Repository hook definitions for `{{eventName}}` must declare a supported `type` such as `command` or `prompt` (current value: `{{type}}`)."
|
|
@@ -4737,6 +4904,7 @@ var requireValidRepositoryHookCommandTypeRule = createCopilotRule({
|
|
|
4737
4904
|
var require_valid_repository_hook_command_type_default = requireValidRepositoryHookCommandTypeRule;
|
|
4738
4905
|
|
|
4739
4906
|
// dist/rules/require-valid-repository-hook-env.js
|
|
4907
|
+
var import_ts_extras51 = require("ts-extras");
|
|
4740
4908
|
var requireValidRepositoryHookEnvRule = createCopilotRule({
|
|
4741
4909
|
create(context) {
|
|
4742
4910
|
return {
|
|
@@ -4747,9 +4915,9 @@ var requireValidRepositoryHookEnvRule = createCopilotRule({
|
|
|
4747
4915
|
const root = parseJsonText(context.sourceCode.text);
|
|
4748
4916
|
const invalidHook = getRepositoryHookObjects(root).find(({ hook }) => {
|
|
4749
4917
|
const env = hook["env"];
|
|
4750
|
-
return env
|
|
4918
|
+
return (0, import_ts_extras51.isDefined)(env) && !isJsonObject(env);
|
|
4751
4919
|
});
|
|
4752
|
-
if (
|
|
4920
|
+
if (!(0, import_ts_extras51.isDefined)(invalidHook)) {
|
|
4753
4921
|
return;
|
|
4754
4922
|
}
|
|
4755
4923
|
reportAtDocumentStart(context, {
|
|
@@ -4773,7 +4941,8 @@ var requireValidRepositoryHookEnvRule = createCopilotRule({
|
|
|
4773
4941
|
description: "require repository hook `env` values to be JSON objects when present.",
|
|
4774
4942
|
frozen: false,
|
|
4775
4943
|
recommended: true,
|
|
4776
|
-
requiresTypeChecking: false
|
|
4944
|
+
requiresTypeChecking: false,
|
|
4945
|
+
url: createRuleDocsUrl("require-valid-repository-hook-env")
|
|
4777
4946
|
},
|
|
4778
4947
|
messages: {
|
|
4779
4948
|
invalidRepositoryHookEnv: "Repository hook `env` for `{{eventName}}` must be a JSON object when present (current value: `{{env}}`)."
|
|
@@ -4786,6 +4955,7 @@ var requireValidRepositoryHookEnvRule = createCopilotRule({
|
|
|
4786
4955
|
var require_valid_repository_hook_env_default = requireValidRepositoryHookEnvRule;
|
|
4787
4956
|
|
|
4788
4957
|
// dist/rules/require-valid-repository-hook-events.js
|
|
4958
|
+
var import_ts_extras52 = require("ts-extras");
|
|
4789
4959
|
var requireValidRepositoryHookEventsRule = createCopilotRule({
|
|
4790
4960
|
create(context) {
|
|
4791
4961
|
return {
|
|
@@ -4795,7 +4965,7 @@ var requireValidRepositoryHookEventsRule = createCopilotRule({
|
|
|
4795
4965
|
}
|
|
4796
4966
|
const root = parseJsonText(context.sourceCode.text);
|
|
4797
4967
|
const invalidEventName = getRepositoryHookEventEntries(root).map(([eventName]) => eventName).find((eventName) => !isRepositoryHookEventName(eventName));
|
|
4798
|
-
if (
|
|
4968
|
+
if (!(0, import_ts_extras52.isDefined)(invalidEventName)) {
|
|
4799
4969
|
return;
|
|
4800
4970
|
}
|
|
4801
4971
|
reportAtDocumentStart(context, {
|
|
@@ -4818,7 +4988,8 @@ var requireValidRepositoryHookEventsRule = createCopilotRule({
|
|
|
4818
4988
|
description: "require repository hook configuration files to use supported hook event names.",
|
|
4819
4989
|
frozen: false,
|
|
4820
4990
|
recommended: true,
|
|
4821
|
-
requiresTypeChecking: false
|
|
4991
|
+
requiresTypeChecking: false,
|
|
4992
|
+
url: createRuleDocsUrl("require-valid-repository-hook-events")
|
|
4822
4993
|
},
|
|
4823
4994
|
messages: {
|
|
4824
4995
|
invalidRepositoryHookEvent: "Repository hook configuration files should use a supported hook event name, not `{{eventName}}`."
|
|
@@ -4831,7 +5002,8 @@ var requireValidRepositoryHookEventsRule = createCopilotRule({
|
|
|
4831
5002
|
var require_valid_repository_hook_events_default = requireValidRepositoryHookEventsRule;
|
|
4832
5003
|
|
|
4833
5004
|
// dist/rules/require-valid-repository-hook-timeouts.js
|
|
4834
|
-
var
|
|
5005
|
+
var import_ts_extras53 = require("ts-extras");
|
|
5006
|
+
var isValidTimeoutSeconds = (value) => typeof value === "number" && (0, import_ts_extras53.isInteger)(value) && value > 0;
|
|
4835
5007
|
var requireValidRepositoryHookTimeoutsRule = createCopilotRule({
|
|
4836
5008
|
create(context) {
|
|
4837
5009
|
return {
|
|
@@ -4842,9 +5014,9 @@ var requireValidRepositoryHookTimeoutsRule = createCopilotRule({
|
|
|
4842
5014
|
const root = parseJsonText(context.sourceCode.text);
|
|
4843
5015
|
const invalidHook = getRepositoryHookObjects(root).find(({ hook }) => {
|
|
4844
5016
|
const timeout = hook["timeoutSec"];
|
|
4845
|
-
return timeout
|
|
5017
|
+
return (0, import_ts_extras53.isDefined)(timeout) && !isValidTimeoutSeconds(timeout);
|
|
4846
5018
|
});
|
|
4847
|
-
if (
|
|
5019
|
+
if (!(0, import_ts_extras53.isDefined)(invalidHook)) {
|
|
4848
5020
|
return;
|
|
4849
5021
|
}
|
|
4850
5022
|
reportAtDocumentStart(context, {
|
|
@@ -4868,7 +5040,8 @@ var requireValidRepositoryHookTimeoutsRule = createCopilotRule({
|
|
|
4868
5040
|
description: "require repository hook `timeoutSec` values to be positive integers when present.",
|
|
4869
5041
|
frozen: false,
|
|
4870
5042
|
recommended: true,
|
|
4871
|
-
requiresTypeChecking: false
|
|
5043
|
+
requiresTypeChecking: false,
|
|
5044
|
+
url: createRuleDocsUrl("require-valid-repository-hook-timeouts")
|
|
4872
5045
|
},
|
|
4873
5046
|
messages: {
|
|
4874
5047
|
invalidRepositoryHookTimeout: "Repository hook `timeoutSec` for `{{eventName}}` must be a positive integer when present (current value: `{{timeout}}`)."
|
|
@@ -4913,7 +5086,8 @@ var requireValidRepositoryHookVersionRule = createCopilotRule({
|
|
|
4913
5086
|
description: "require repository hook configuration files to declare `version: 1`.",
|
|
4914
5087
|
frozen: false,
|
|
4915
5088
|
recommended: true,
|
|
4916
|
-
requiresTypeChecking: false
|
|
5089
|
+
requiresTypeChecking: false,
|
|
5090
|
+
url: createRuleDocsUrl("require-valid-repository-hook-version")
|
|
4917
5091
|
},
|
|
4918
5092
|
messages: {
|
|
4919
5093
|
invalidRepositoryHookVersion: "Repository hook configuration files must declare `version: 1` (current value: `{{version}}`)."
|
|
@@ -4955,7 +5129,8 @@ var requireValidSkillDirectoryNameRule = createCopilotRule({
|
|
|
4955
5129
|
description: "require Copilot skill directory names to use the documented lowercase-hyphen form.",
|
|
4956
5130
|
frozen: false,
|
|
4957
5131
|
recommended: true,
|
|
4958
|
-
requiresTypeChecking: false
|
|
5132
|
+
requiresTypeChecking: false,
|
|
5133
|
+
url: createRuleDocsUrl("require-valid-skill-directory-name")
|
|
4959
5134
|
},
|
|
4960
5135
|
messages: {
|
|
4961
5136
|
invalidSkillDirectoryName: "Copilot skill directory names must use lowercase letters, digits, and hyphens only (current directory: `{{directoryName}}`)."
|
|
@@ -4968,6 +5143,7 @@ var requireValidSkillDirectoryNameRule = createCopilotRule({
|
|
|
4968
5143
|
var require_valid_skill_directory_name_default = requireValidSkillDirectoryNameRule;
|
|
4969
5144
|
|
|
4970
5145
|
// dist/rules/require-valid-skill-license.js
|
|
5146
|
+
var import_ts_extras54 = require("ts-extras");
|
|
4971
5147
|
var requireValidSkillLicenseRule = createCopilotRule({
|
|
4972
5148
|
create(context) {
|
|
4973
5149
|
return createMarkdownDocumentListener(() => {
|
|
@@ -4978,7 +5154,7 @@ var requireValidSkillLicenseRule = createCopilotRule({
|
|
|
4978
5154
|
if (frontmatter === null || !hasFrontmatterField(frontmatter, "license")) {
|
|
4979
5155
|
return;
|
|
4980
5156
|
}
|
|
4981
|
-
if (getFrontmatterScalar(frontmatter, "license")
|
|
5157
|
+
if ((0, import_ts_extras54.isDefined)(getFrontmatterScalar(frontmatter, "license"))) {
|
|
4982
5158
|
return;
|
|
4983
5159
|
}
|
|
4984
5160
|
reportAtDocumentStart(context, {
|
|
@@ -4993,7 +5169,8 @@ var requireValidSkillLicenseRule = createCopilotRule({
|
|
|
4993
5169
|
description: "require optional Copilot skill `license` metadata to be a non-empty scalar when present.",
|
|
4994
5170
|
frozen: false,
|
|
4995
5171
|
recommended: false,
|
|
4996
|
-
requiresTypeChecking: false
|
|
5172
|
+
requiresTypeChecking: false,
|
|
5173
|
+
url: createRuleDocsUrl("require-valid-skill-license")
|
|
4997
5174
|
},
|
|
4998
5175
|
messages: {
|
|
4999
5176
|
invalidSkillLicense: "Copilot skill `license` metadata must be a non-empty scalar when present."
|
|
@@ -5006,6 +5183,7 @@ var requireValidSkillLicenseRule = createCopilotRule({
|
|
|
5006
5183
|
var require_valid_skill_license_default = requireValidSkillLicenseRule;
|
|
5007
5184
|
|
|
5008
5185
|
// dist/rules/require-valid-skill-name.js
|
|
5186
|
+
var import_ts_extras55 = require("ts-extras");
|
|
5009
5187
|
var requireValidSkillNameRule = createCopilotRule({
|
|
5010
5188
|
create(context) {
|
|
5011
5189
|
return createMarkdownDocumentListener(() => {
|
|
@@ -5017,7 +5195,7 @@ var requireValidSkillNameRule = createCopilotRule({
|
|
|
5017
5195
|
return;
|
|
5018
5196
|
}
|
|
5019
5197
|
const skillName = getFrontmatterScalar(frontmatter, "name");
|
|
5020
|
-
if (skillName
|
|
5198
|
+
if ((0, import_ts_extras55.isDefined)(skillName) && isValidSkillIdentifier(getSkillName(context.filename, frontmatter))) {
|
|
5021
5199
|
return;
|
|
5022
5200
|
}
|
|
5023
5201
|
reportAtDocumentStart(context, {
|
|
@@ -5039,7 +5217,8 @@ var requireValidSkillNameRule = createCopilotRule({
|
|
|
5039
5217
|
description: "require Copilot skill `name` metadata to use the documented lowercase-hyphen identifier form.",
|
|
5040
5218
|
frozen: false,
|
|
5041
5219
|
recommended: true,
|
|
5042
|
-
requiresTypeChecking: false
|
|
5220
|
+
requiresTypeChecking: false,
|
|
5221
|
+
url: createRuleDocsUrl("require-valid-skill-name")
|
|
5043
5222
|
},
|
|
5044
5223
|
messages: {
|
|
5045
5224
|
invalidSkillName: "Copilot skill `name` values must use lowercase letters, digits, and hyphens only (current value: `{{name}}`)."
|
|
@@ -5167,7 +5346,7 @@ var getPackageVersion = (pkg) => {
|
|
|
5167
5346
|
var eslintRules = copilotRules;
|
|
5168
5347
|
var markdownPlugin = import_markdown.default;
|
|
5169
5348
|
var jsonPlugin = import_json.default;
|
|
5170
|
-
var copilotRuleEntries =
|
|
5349
|
+
var copilotRuleEntries = (0, import_ts_extras56.safeCastTo)((0, import_ts_extras56.objectEntries)(copilotRules).toSorted(([left], [right]) => left.localeCompare(right)));
|
|
5171
5350
|
var createEmptyPresetRuleMap = () => ({
|
|
5172
5351
|
all: [],
|
|
5173
5352
|
minimal: [],
|
|
@@ -5200,8 +5379,8 @@ var errorRulesFor = (ruleNames) => {
|
|
|
5200
5379
|
};
|
|
5201
5380
|
var presetRuleNamesByConfig = derivePresetRuleNamesByConfig();
|
|
5202
5381
|
var partitionRuleNamesByPresetLayer = (ruleNames) => ({
|
|
5203
|
-
jsonRuleNames: ruleNames.filter((ruleName) =>
|
|
5204
|
-
markdownRuleNames: ruleNames.filter((ruleName) =>
|
|
5382
|
+
jsonRuleNames: ruleNames.filter((ruleName) => (0, import_ts_extras56.setHas)(REPOSITORY_HOOK_JSON_RULE_NAMES, ruleName)),
|
|
5383
|
+
markdownRuleNames: ruleNames.filter((0, import_ts_extras56.not)((ruleName) => (0, import_ts_extras56.setHas)(REPOSITORY_HOOK_JSON_RULE_NAMES, ruleName)))
|
|
5205
5384
|
});
|
|
5206
5385
|
var createPresetConfig = (configName, plugin2) => {
|
|
5207
5386
|
const presetName = copilotConfigMetadataByName[configName].presetName;
|