artifact-contracts 0.32.1 → 0.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -8,6 +8,7 @@ import { handleResolve } from "./resolve.js";
8
8
  import { handleList } from "./list.js";
9
9
  import { handleExplain } from "./explain.js";
10
10
  import { handleAudit } from "./audit.js";
11
+ import { resolvedDsl } from "../generated/dsl/index.js";
11
12
  const __dirname = dirname(fileURLToPath(import.meta.url));
12
13
  const pkg = JSON.parse(readFileSync(resolve(__dirname, "../../package.json"), "utf-8"));
13
14
  const handlers = {
@@ -30,6 +31,22 @@ const handlers = {
30
31
  audit: async (opts) => {
31
32
  await handleAudit(opts);
32
33
  },
34
+ agents: async (opts) => {
35
+ const YAML = await import("yaml");
36
+ const format = opts.format ?? "yaml";
37
+ try {
38
+ if (format === "json") {
39
+ console.log(JSON.stringify(resolvedDsl, null, 2));
40
+ }
41
+ else {
42
+ console.log(YAML.stringify(resolvedDsl, { lineWidth: 120 }));
43
+ }
44
+ }
45
+ catch (err) {
46
+ console.error(`Failed to output DSL: ${err.message}`);
47
+ process.exit(1);
48
+ }
49
+ },
33
50
  };
34
51
  createProgram(handlers, pkg.version).parse();
35
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAwB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CACzC,CAAC;AAEzB,MAAM,QAAQ,GAAoB;IAChC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACvB,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACnB,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC;AAEF,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAwB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CACzC,CAAC;AAEzB,MAAM,QAAQ,GAAoB;IAChC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACvB,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACnB,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;YACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAM,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QACrC,IAAI,CAAC;YACH,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,yBAA0B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC;AAEF,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAA2piB,CAAC;AAExriB,eAAO,MAAM,iBAAiB,EAAE,MAA0nzB,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAAkqkB,CAAC;AAE/rkB,eAAO,MAAM,iBAAiB,EAAE,MAAs/1B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // Auto-generated by cli-contracts. Do not edit.
2
2
  // Embedded contract for the extract subcommand.
3
- export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: artifact-contracts CLI\n version: 0.1.1\n description: >-\n Declarative artifact registry — define file properties, resolve\n paths to artifact IDs, and detect definition overlaps.\n stdout is reserved for primary output (JSON/YAML/text result);\n all diagnostics and progress messages go to stderr.\n license:\n name: MIT\n contact:\n name: foo-log-inc\n url: https://github.com/foo-log-inc/artifact-contracts\n\nartifact_slots:\n artifact-definitions:\n description: artifact-contracts.yaml definitions and config files\n direction: read\n repository-files:\n description: Repository files scanned for path pattern matching and overlap detection\n direction: read\n audit-report:\n description: LLM audit result output files\n direction: write\n\ncommand_sets:\n artifact-contracts:\n summary: >-\n Artifact registry CLI — validate definitions, resolve artifacts,\n list registered entries, and explain file properties.\n executable: artifact-contracts\n\n global_options:\n - name: version\n aliases: [V]\n description: Output the version number\n schema:\n type: boolean\n - name: help\n aliases: [h]\n description: Display help for command\n schema:\n type: boolean\n\n commands:\n validate:\n summary: Validate artifact-contracts definitions\n description: >-\n Validates artifact-contracts.yaml against the schema, checks\n artifact ID naming conventions, ensures path_patterns are\n non-empty, and optionally detects overlapping definitions\n against real repository files.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: check-files\n description: >-\n Scan repository files to detect path_patterns overlaps\n that static glob analysis cannot fully determine.\n When enabled, reads all files from git ls-files or glob.\n schema:\n type: boolean\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n - repository-files\n execution_mode: normal\n x-agent:\n expected_duration_ms: 5000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ValidationResult\"\n description: >-\n Validation diagnostics. On exit 0 stdout is empty (diagnostics\n go to stderr). On exit 1/2 with --format json, structured\n diagnostics are written to stdout.\n exits:\n \"0\":\n description: Validation passed with no errors\n \"1\":\n description: Schema or naming convention errors detected\n \"2\":\n description: Overlap detected — same path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n\n resolve:\n summary: Output fully-resolved artifact definitions\n description: >-\n Expands config variables, applies authority-based defaults\n for manual_edit and change_control, and outputs the complete\n resolved DSL. Default format is yaml.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: yaml)\"\n schema:\n type: string\n enum: [yaml, json]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ResolvedDefinitions\"\n description: >-\n Fully resolved artifact definitions with authority-based\n defaults applied. Format varies by --format (yaml default, json).\n exits:\n \"0\":\n description: Successfully output resolved definitions\n \"1\":\n description: Error resolving definitions\n \"3\":\n description: Config or input file not found / parse error\n\n list:\n summary: List registered artifacts\n description: >-\n Displays all registered artifacts with optional filtering\n by authority. Use --path for simple ID lookup; use explain\n for full governance metadata. Default format is text.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: authority\n description: Filter by authority type\n schema:\n type: string\n enum: [canonical, derived, generated, control]\n - name: path\n description: >-\n Reverse-lookup — show artifact IDs matching this file\n path. For full governance details, use the explain command.\n value_name: file\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactList\"\n description: >-\n List of matching artifacts. Schema applies to --format json\n and --format yaml. Text format is human-readable only.\n exits:\n \"0\":\n description: Successfully listed artifacts\n \"1\":\n description: Error reading definitions\n \"3\":\n description: Config or input file not found / parse error\n\n explain:\n summary: Explain artifact properties for a file path\n description: >-\n Given a file path, resolves the matching artifact and displays\n its full governance properties — artifact ID, authority,\n manual_edit policy, change_control, and other metadata.\n Useful for humans and LLM agents to understand file\n governance. Default format is text.\n arguments:\n - name: path\n description: File path to explain\n required: true\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactExplanation\"\n description: >-\n Artifact governance metadata for the resolved path.\n Schema applies to --format json and --format yaml.\n Text format is human-readable only.\n exits:\n \"0\":\n description: Path resolved to an artifact\n \"2\":\n description: Overlap — path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n \"4\":\n description: Path does not match any registered artifact\n\n audit:\n summary: LLM-based semantic audit of artifact definitions\n description: >-\n Performs semantic analysis of artifact definitions using LLM\n to identify quality issues that static validation cannot\n detect — naming inconsistencies, missing coverage for common\n file types, authority mismatches, and structural improvements.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: adapter\n description: LLM adapter to use\n schema:\n type: string\n enum: [mock, cursor, openai, claude, gemini]\n - name: model\n description: Model name to pass to the adapter\n - name: show-prompt\n description: Output the constructed prompt without calling the LLM API\n schema:\n type: boolean\n - name: dry-run\n aliases: [n]\n description: Alias for --show-prompt (output prompt without LLM call)\n schema:\n type: boolean\n - name: fail-on\n description: >-\n Minimum severity that causes exit 10. Ordering:\n critical > error > warning > info. For example,\n --fail-on warning exits 10 on warning, error, or critical.\n schema:\n type: string\n enum: [info, warning, error, critical]\n - name: output\n aliases: [o]\n description: Write result to a file instead of stdout\n value_name: file\n - name: report-format\n description: >-\n Output format for the report (default: text).\n LLM commands use --report-format; deterministic\n commands use --format.\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: medium\n reads:\n - artifact-definitions\n writes:\n - audit-report\n network:\n description: LLM API calls to configured provider\n idempotent: false\n execution_mode: normal\n stdout:\n schema:\n $ref: \"#/components/schemas/AgentAuditResult\"\n description: >-\n Structured audit result conforming to the AgentAuditResult\n schema. Format varies by --report-format (json, yaml, text).\n x-agent:\n expected_duration_ms: 120000\n retryable_exit_codes: [1]\n recommended_before_use:\n - \"Run with --show-prompt first to preview the prompt\"\n exits:\n \"0\":\n description: Audit completed — no findings above threshold\n \"1\":\n description: General / transient error\n \"3\":\n description: Config or input file not found / parse error\n \"10\":\n description: Findings detected above --fail-on threshold\n \"11\":\n description: agent-contracts-runtime is not installed\n \"12\":\n description: Adapter initialization error (missing API key, etc.)\n\n env:\n OPENAI_API_KEY:\n description: >-\n OpenAI API key. Required when --adapter openai is selected.\n required: false\n ANTHROPIC_API_KEY:\n description: >-\n Anthropic API key. Required when --adapter claude is selected.\n required: false\n GEMINI_API_KEY:\n description: >-\n Google Gemini API key. Required when --adapter gemini is selected.\n required: false\n CURSOR_API_KEY:\n description: >-\n Cursor API key. Required when --adapter cursor is selected.\n required: false\n\ncomponents:\n schemas:\n AgentFinding:\n type: object\n properties:\n id:\n type: string\n severity:\n type: string\n enum: [critical, error, warning, info]\n category:\n type: string\n title:\n type: string\n description:\n type: string\n location:\n type: string\n target:\n type: string\n recommendation:\n type: string\n evidence:\n type: array\n items:\n $ref: \"#/components/schemas/AgentEvidence\"\n required: [id, severity, category, title, description]\n\n AgentAuditResult:\n type: object\n properties:\n summary:\n type: string\n risk_level:\n type: string\n enum: [none, low, medium, high, critical]\n findings:\n type: array\n items:\n $ref: \"#/components/schemas/AgentFinding\"\n recommended_actions:\n type: array\n items:\n $ref: \"#/components/schemas/AgentRecommendedAction\"\n metadata:\n type: object\n properties:\n total_artifacts:\n type: integer\n analyzed_artifacts:\n type: integer\n analysis_scope:\n type: string\n required: [summary, risk_level, findings, recommended_actions]\n\n AgentEvidence:\n type: object\n properties:\n kind:\n type: string\n enum: [schema, code, config, runtime, doc]\n target:\n type: string\n location:\n type: string\n excerpt:\n type: string\n reasoning:\n type: string\n required: [kind]\n\n AgentRecommendedAction:\n type: object\n properties:\n action:\n type: string\n priority:\n type: string\n enum: [high, medium, low]\n description:\n type: string\n required: [action, priority]\n\n ResolvedDefinitions:\n type: object\n description: Output of the resolve command\n properties:\n artifact_contracts:\n type: string\n system:\n type: object\n properties:\n id:\n type: string\n name:\n type: string\n required: [id]\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n required: [artifact_contracts, system, artifacts]\n\n ArtifactExplanation:\n type: object\n description: Output of the explain command (json/yaml format)\n properties:\n id:\n type: string\n type:\n type: string\n authority:\n type: string\n manual_edit:\n type: string\n change_control:\n type: string\n visibility:\n type: string\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n required: [id, type, authority, manual_edit, change_control]\n\n ArtifactDefinition:\n type: object\n description: A single resolved artifact definition\n properties:\n type:\n type: string\n authority:\n type: string\n enum: [canonical, derived, generated, control]\n manual_edit:\n type: string\n enum: [allowed, discouraged, forbidden]\n change_control:\n type: string\n enum: [none, approval-required, regeneration-required]\n visibility:\n type: string\n enum: [public, internal, private]\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n states:\n type: array\n items:\n type: string\n required: [type, authority, manual_edit, change_control, visibility, path_patterns]\n\n ArtifactList:\n type: object\n description: Output of the list command (json/yaml format)\n properties:\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n\n ValidationResult:\n type: object\n description: Output of the validate command (json format, on error)\n properties:\n valid:\n type: boolean\n diagnostics:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n message:\n type: string\n severity:\n type: string\n enum: [error, warning]\n required: [message, severity]\n overlaps:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n matching_artifacts:\n type: array\n items:\n type: string\n required: [path, matching_artifacts]\n required: [valid, diagnostics, overlaps]\n";
4
- export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"artifact-contracts CLI\",\n \"version\": \"0.1.1\",\n \"description\": \"Declarative artifact registry — define file properties, resolve paths to artifact IDs, and detect definition overlaps. stdout is reserved for primary output (JSON/YAML/text result); all diagnostics and progress messages go to stderr.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-log-inc\",\n \"url\": \"https://github.com/foo-log-inc/artifact-contracts\"\n }\n },\n \"artifact_slots\": {\n \"artifact-definitions\": {\n \"description\": \"artifact-contracts.yaml definitions and config files\",\n \"direction\": \"read\"\n },\n \"repository-files\": {\n \"description\": \"Repository files scanned for path pattern matching and overlap detection\",\n \"direction\": \"read\"\n },\n \"audit-report\": {\n \"description\": \"LLM audit result output files\",\n \"direction\": \"write\"\n }\n },\n \"command_sets\": {\n \"artifact-contracts\": {\n \"summary\": \"Artifact registry CLI — validate definitions, resolve artifacts, list registered entries, and explain file properties.\",\n \"executable\": \"artifact-contracts\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Output the version number\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Display help for command\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"validate\": {\n \"summary\": \"Validate artifact-contracts definitions\",\n \"description\": \"Validates artifact-contracts.yaml against the schema, checks artifact ID naming conventions, ensures path_patterns are non-empty, and optionally detects overlapping definitions against real repository files.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"check-files\",\n \"description\": \"Scan repository files to detect path_patterns overlaps that static glob analysis cannot fully determine. When enabled, reads all files from git ls-files or glob.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\",\n \"repository-files\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 5000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationResult\"\n },\n \"description\": \"Validation diagnostics. On exit 0 stdout is empty (diagnostics go to stderr). On exit 1/2 with --format json, structured diagnostics are written to stdout.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Validation passed with no errors\"\n },\n \"1\": {\n \"description\": \"Schema or naming convention errors detected\"\n },\n \"2\": {\n \"description\": \"Overlap detected — same path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"resolve\": {\n \"summary\": \"Output fully-resolved artifact definitions\",\n \"description\": \"Expands config variables, applies authority-based defaults for manual_edit and change_control, and outputs the complete resolved DSL. Default format is yaml.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: yaml)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ResolvedDefinitions\"\n },\n \"description\": \"Fully resolved artifact definitions with authority-based defaults applied. Format varies by --format (yaml default, json).\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully output resolved definitions\"\n },\n \"1\": {\n \"description\": \"Error resolving definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"list\": {\n \"summary\": \"List registered artifacts\",\n \"description\": \"Displays all registered artifacts with optional filtering by authority. Use --path for simple ID lookup; use explain for full governance metadata. Default format is text.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"authority\",\n \"description\": \"Filter by authority type\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n }\n },\n {\n \"name\": \"path\",\n \"description\": \"Reverse-lookup — show artifact IDs matching this file path. For full governance details, use the explain command.\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactList\"\n },\n \"description\": \"List of matching artifacts. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully listed artifacts\"\n },\n \"1\": {\n \"description\": \"Error reading definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"explain\": {\n \"summary\": \"Explain artifact properties for a file path\",\n \"description\": \"Given a file path, resolves the matching artifact and displays its full governance properties — artifact ID, authority, manual_edit policy, change_control, and other metadata. Useful for humans and LLM agents to understand file governance. Default format is text.\",\n \"arguments\": [\n {\n \"name\": \"path\",\n \"description\": \"File path to explain\",\n \"required\": true\n }\n ],\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactExplanation\"\n },\n \"description\": \"Artifact governance metadata for the resolved path. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Path resolved to an artifact\"\n },\n \"2\": {\n \"description\": \"Overlap — path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"4\": {\n \"description\": \"Path does not match any registered artifact\"\n }\n }\n },\n \"audit\": {\n \"summary\": \"LLM-based semantic audit of artifact definitions\",\n \"description\": \"Performs semantic analysis of artifact definitions using LLM to identify quality issues that static validation cannot detect — naming inconsistencies, missing coverage for common file types, authority mismatches, and structural improvements.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"adapter\",\n \"description\": \"LLM adapter to use\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"mock\",\n \"cursor\",\n \"openai\",\n \"claude\",\n \"gemini\"\n ]\n }\n },\n {\n \"name\": \"model\",\n \"description\": \"Model name to pass to the adapter\"\n },\n {\n \"name\": \"show-prompt\",\n \"description\": \"Output the constructed prompt without calling the LLM API\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"dry-run\",\n \"aliases\": [\n \"n\"\n ],\n \"description\": \"Alias for --show-prompt (output prompt without LLM call)\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"fail-on\",\n \"description\": \"Minimum severity that causes exit 10. Ordering: critical > error > warning > info. For example, --fail-on warning exits 10 on warning, error, or critical.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"info\",\n \"warning\",\n \"error\",\n \"critical\"\n ]\n }\n },\n {\n \"name\": \"output\",\n \"aliases\": [\n \"o\"\n ],\n \"description\": \"Write result to a file instead of stdout\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"report-format\",\n \"description\": \"Output format for the report (default: text). LLM commands use --report-format; deterministic commands use --format.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"medium\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"writes\": [\n \"audit-report\"\n ],\n \"network\": {\n \"description\": \"LLM API calls to configured provider\",\n \"idempotent\": false\n },\n \"execution_mode\": \"normal\"\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/AgentAuditResult\"\n },\n \"description\": \"Structured audit result conforming to the AgentAuditResult schema. Format varies by --report-format (json, yaml, text).\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 120000,\n \"retryable_exit_codes\": [\n 1\n ],\n \"recommended_before_use\": [\n \"Run with --show-prompt first to preview the prompt\"\n ]\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Audit completed — no findings above threshold\"\n },\n \"1\": {\n \"description\": \"General / transient error\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"10\": {\n \"description\": \"Findings detected above --fail-on threshold\"\n },\n \"11\": {\n \"description\": \"agent-contracts-runtime is not installed\"\n },\n \"12\": {\n \"description\": \"Adapter initialization error (missing API key, etc.)\"\n }\n }\n }\n },\n \"env\": {\n \"OPENAI_API_KEY\": {\n \"description\": \"OpenAI API key. Required when --adapter openai is selected.\",\n \"required\": false\n },\n \"ANTHROPIC_API_KEY\": {\n \"description\": \"Anthropic API key. Required when --adapter claude is selected.\",\n \"required\": false\n },\n \"GEMINI_API_KEY\": {\n \"description\": \"Google Gemini API key. Required when --adapter gemini is selected.\",\n \"required\": false\n },\n \"CURSOR_API_KEY\": {\n \"description\": \"Cursor API key. Required when --adapter cursor is selected.\",\n \"required\": false\n }\n }\n }\n },\n \"components\": {\n \"schemas\": {\n \"AgentFinding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"critical\",\n \"error\",\n \"warning\",\n \"info\"\n ]\n },\n \"category\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"recommendation\": {\n \"type\": \"string\"\n },\n \"evidence\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentEvidence\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"severity\",\n \"category\",\n \"title\",\n \"description\"\n ]\n },\n \"AgentAuditResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"summary\": {\n \"type\": \"string\"\n },\n \"risk_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"low\",\n \"medium\",\n \"high\",\n \"critical\"\n ]\n },\n \"findings\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentFinding\"\n }\n },\n \"recommended_actions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentRecommendedAction\"\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"total_artifacts\": {\n \"type\": \"integer\"\n },\n \"analyzed_artifacts\": {\n \"type\": \"integer\"\n },\n \"analysis_scope\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"required\": [\n \"summary\",\n \"risk_level\",\n \"findings\",\n \"recommended_actions\"\n ]\n },\n \"AgentEvidence\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\n \"schema\",\n \"code\",\n \"config\",\n \"runtime\",\n \"doc\"\n ]\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"excerpt\": {\n \"type\": \"string\"\n },\n \"reasoning\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"kind\"\n ]\n },\n \"AgentRecommendedAction\": {\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n },\n \"priority\": {\n \"type\": \"string\",\n \"enum\": [\n \"high\",\n \"medium\",\n \"low\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"action\",\n \"priority\"\n ]\n },\n \"ResolvedDefinitions\": {\n \"type\": \"object\",\n \"description\": \"Output of the resolve command\",\n \"properties\": {\n \"artifact_contracts\": {\n \"type\": \"string\"\n },\n \"system\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\"\n ]\n },\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n },\n \"required\": [\n \"artifact_contracts\",\n \"system\",\n \"artifacts\"\n ]\n },\n \"ArtifactExplanation\": {\n \"type\": \"object\",\n \"description\": \"Output of the explain command (json/yaml format)\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\"\n },\n \"manual_edit\": {\n \"type\": \"string\"\n },\n \"change_control\": {\n \"type\": \"string\"\n },\n \"visibility\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\"\n ]\n },\n \"ArtifactDefinition\": {\n \"type\": \"object\",\n \"description\": \"A single resolved artifact definition\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n },\n \"manual_edit\": {\n \"type\": \"string\",\n \"enum\": [\n \"allowed\",\n \"discouraged\",\n \"forbidden\"\n ]\n },\n \"change_control\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"approval-required\",\n \"regeneration-required\"\n ]\n },\n \"visibility\": {\n \"type\": \"string\",\n \"enum\": [\n \"public\",\n \"internal\",\n \"private\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"states\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\",\n \"visibility\",\n \"path_patterns\"\n ]\n },\n \"ArtifactList\": {\n \"type\": \"object\",\n \"description\": \"Output of the list command (json/yaml format)\",\n \"properties\": {\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n }\n },\n \"ValidationResult\": {\n \"type\": \"object\",\n \"description\": \"Output of the validate command (json format, on error)\",\n \"properties\": {\n \"valid\": {\n \"type\": \"boolean\"\n },\n \"diagnostics\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warning\"\n ]\n }\n },\n \"required\": [\n \"message\",\n \"severity\"\n ]\n }\n },\n \"overlaps\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"matching_artifacts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"path\",\n \"matching_artifacts\"\n ]\n }\n }\n },\n \"required\": [\n \"valid\",\n \"diagnostics\",\n \"overlaps\"\n ]\n }\n }\n }\n}";
3
+ export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: artifact-contracts CLI\n version: 0.1.1\n description: >-\n Declarative artifact registry — define file properties, resolve\n paths to artifact IDs, and detect definition overlaps.\n stdout is reserved for primary output (JSON/YAML/text result);\n all diagnostics and progress messages go to stderr.\n license:\n name: MIT\n contact:\n name: foo-log-inc\n url: https://github.com/foo-log-inc/artifact-contracts\n\nartifact_slots:\n artifact-definitions:\n description: artifact-contracts.yaml definitions and config files\n direction: read\n repository-files:\n description: Repository files scanned for path pattern matching and overlap detection\n direction: read\n audit-report:\n description: LLM audit result output files\n direction: write\n\ncommand_sets:\n artifact-contracts:\n summary: >-\n Artifact registry CLI — validate definitions, resolve artifacts,\n list registered entries, and explain file properties.\n executable: artifact-contracts\n\n global_options:\n - name: version\n aliases: [V]\n description: Output the version number\n schema:\n type: boolean\n - name: help\n aliases: [h]\n description: Display help for command\n schema:\n type: boolean\n\n commands:\n validate:\n summary: Validate artifact-contracts definitions\n description: >-\n Validates artifact-contracts.yaml against the schema, checks\n artifact ID naming conventions, ensures path_patterns are\n non-empty, and optionally detects overlapping definitions\n against real repository files.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: check-files\n description: >-\n Scan repository files to detect path_patterns overlaps\n that static glob analysis cannot fully determine.\n When enabled, reads all files from git ls-files or glob.\n schema:\n type: boolean\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n - repository-files\n execution_mode: normal\n x-agent:\n expected_duration_ms: 5000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ValidationResult\"\n description: >-\n Validation diagnostics. On exit 0 stdout is empty (diagnostics\n go to stderr). On exit 1/2 with --format json, structured\n diagnostics are written to stdout.\n exits:\n \"0\":\n description: Validation passed with no errors\n \"1\":\n description: Schema or naming convention errors detected\n \"2\":\n description: Overlap detected — same path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n\n resolve:\n summary: Output fully-resolved artifact definitions\n description: >-\n Expands config variables, applies authority-based defaults\n for manual_edit and change_control, and outputs the complete\n resolved DSL. Default format is yaml.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: yaml)\"\n schema:\n type: string\n enum: [yaml, json]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ResolvedDefinitions\"\n description: >-\n Fully resolved artifact definitions with authority-based\n defaults applied. Format varies by --format (yaml default, json).\n exits:\n \"0\":\n description: Successfully output resolved definitions\n \"1\":\n description: Error resolving definitions\n \"3\":\n description: Config or input file not found / parse error\n\n list:\n summary: List registered artifacts\n description: >-\n Displays all registered artifacts with optional filtering\n by authority. Use --path for simple ID lookup; use explain\n for full governance metadata. Default format is text.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: authority\n description: Filter by authority type\n schema:\n type: string\n enum: [canonical, derived, generated, control]\n - name: path\n description: >-\n Reverse-lookup — show artifact IDs matching this file\n path. For full governance details, use the explain command.\n value_name: file\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactList\"\n description: >-\n List of matching artifacts. Schema applies to --format json\n and --format yaml. Text format is human-readable only.\n exits:\n \"0\":\n description: Successfully listed artifacts\n \"1\":\n description: Error reading definitions\n \"3\":\n description: Config or input file not found / parse error\n\n explain:\n summary: Explain artifact properties for a file path\n description: >-\n Given a file path, resolves the matching artifact and displays\n its full governance properties — artifact ID, authority,\n manual_edit policy, change_control, and other metadata.\n Useful for humans and LLM agents to understand file\n governance. Default format is text.\n arguments:\n - name: path\n description: File path to explain\n required: true\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactExplanation\"\n description: >-\n Artifact governance metadata for the resolved path.\n Schema applies to --format json and --format yaml.\n Text format is human-readable only.\n exits:\n \"0\":\n description: Path resolved to an artifact\n \"2\":\n description: Overlap — path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n \"4\":\n description: Path does not match any registered artifact\n\n audit:\n summary: LLM-based semantic audit of artifact definitions\n description: >-\n Performs semantic analysis of artifact definitions using LLM\n to identify quality issues that static validation cannot\n detect — naming inconsistencies, missing coverage for common\n file types, authority mismatches, and structural improvements.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: adapter\n description: LLM adapter to use\n schema:\n type: string\n enum: [mock, cursor, openai, claude, gemini]\n - name: model\n description: Model name to pass to the adapter\n - name: show-prompt\n description: Output the constructed prompt without calling the LLM API\n schema:\n type: boolean\n - name: dry-run\n aliases: [n]\n description: Alias for --show-prompt (output prompt without LLM call)\n schema:\n type: boolean\n - name: fail-on\n description: >-\n Minimum severity that causes exit 10. Ordering:\n critical > error > warning > info. For example,\n --fail-on warning exits 10 on warning, error, or critical.\n schema:\n type: string\n enum: [info, warning, error, critical]\n - name: output\n aliases: [o]\n description: Write result to a file instead of stdout\n value_name: file\n - name: report-format\n description: >-\n Output format for the report (default: text).\n LLM commands use --report-format; deterministic\n commands use --format.\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: medium\n reads:\n - artifact-definitions\n writes:\n - audit-report\n network:\n description: LLM API calls to configured provider\n idempotent: false\n execution_mode: normal\n stdout:\n schema:\n $ref: \"#/components/schemas/AgentAuditResult\"\n description: >-\n Structured audit result conforming to the AgentAuditResult\n schema. Format varies by --report-format (json, yaml, text).\n x-agent:\n expected_duration_ms: 120000\n retryable_exit_codes: [1]\n recommended_before_use:\n - \"Run with --show-prompt first to preview the prompt\"\n exits:\n \"0\":\n description: Audit completed — no findings above threshold\n \"1\":\n description: General / transient error\n \"3\":\n description: Config or input file not found / parse error\n \"10\":\n description: Findings detected above --fail-on threshold\n \"11\":\n description: agent-contracts-runtime is not installed\n \"12\":\n description: Adapter initialization error (missing API key, etc.)\n\n # ── agents ──────────────────────────────────────────\n agents:\n summary: Output the full resolved agent DSL as structured data.\n description: >-\n Outputs the complete resolved agent-contracts DSL (agents, tasks,\n workflows, handoff_types) embedded in this CLI binary.\n Useful for debugging, external tooling integration, and DSL\n inspection.\n options:\n - name: format\n aliases: [F]\n description: Output format.\n schema:\n type: string\n enum: [yaml, json]\n default: yaml\n\n exits:\n '0':\n description: DSL output successfully.\n stdout:\n format: text\n '1':\n description: Failed to load embedded DSL.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: []\n\n env:\n OPENAI_API_KEY:\n description: >-\n OpenAI API key. Required when --adapter openai is selected.\n required: false\n ANTHROPIC_API_KEY:\n description: >-\n Anthropic API key. Required when --adapter claude is selected.\n required: false\n GEMINI_API_KEY:\n description: >-\n Google Gemini API key. Required when --adapter gemini is selected.\n required: false\n CURSOR_API_KEY:\n description: >-\n Cursor API key. Required when --adapter cursor is selected.\n required: false\n\ncomponents:\n schemas:\n AgentFinding:\n type: object\n properties:\n id:\n type: string\n severity:\n type: string\n enum: [critical, error, warning, info]\n category:\n type: string\n title:\n type: string\n description:\n type: string\n location:\n type: string\n target:\n type: string\n recommendation:\n type: string\n evidence:\n type: array\n items:\n $ref: \"#/components/schemas/AgentEvidence\"\n required: [id, severity, category, title, description]\n\n AgentAuditResult:\n type: object\n properties:\n summary:\n type: string\n risk_level:\n type: string\n enum: [none, low, medium, high, critical]\n findings:\n type: array\n items:\n $ref: \"#/components/schemas/AgentFinding\"\n recommended_actions:\n type: array\n items:\n $ref: \"#/components/schemas/AgentRecommendedAction\"\n metadata:\n type: object\n properties:\n total_artifacts:\n type: integer\n analyzed_artifacts:\n type: integer\n analysis_scope:\n type: string\n required: [summary, risk_level, findings, recommended_actions]\n\n AgentEvidence:\n type: object\n properties:\n kind:\n type: string\n enum: [schema, code, config, runtime, doc]\n target:\n type: string\n location:\n type: string\n excerpt:\n type: string\n reasoning:\n type: string\n required: [kind]\n\n AgentRecommendedAction:\n type: object\n properties:\n action:\n type: string\n priority:\n type: string\n enum: [high, medium, low]\n description:\n type: string\n required: [action, priority]\n\n ResolvedDefinitions:\n type: object\n description: Output of the resolve command\n properties:\n artifact_contracts:\n type: string\n system:\n type: object\n properties:\n id:\n type: string\n name:\n type: string\n required: [id]\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n required: [artifact_contracts, system, artifacts]\n\n ArtifactExplanation:\n type: object\n description: Output of the explain command (json/yaml format)\n properties:\n id:\n type: string\n type:\n type: string\n authority:\n type: string\n manual_edit:\n type: string\n change_control:\n type: string\n visibility:\n type: string\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n required: [id, type, authority, manual_edit, change_control]\n\n ArtifactDefinition:\n type: object\n description: A single resolved artifact definition\n properties:\n type:\n type: string\n authority:\n type: string\n enum: [canonical, derived, generated, control]\n manual_edit:\n type: string\n enum: [allowed, discouraged, forbidden]\n change_control:\n type: string\n enum: [none, approval-required, regeneration-required]\n visibility:\n type: string\n enum: [public, internal, private]\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n states:\n type: array\n items:\n type: string\n required: [type, authority, manual_edit, change_control, visibility, path_patterns]\n\n ArtifactList:\n type: object\n description: Output of the list command (json/yaml format)\n properties:\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n\n ValidationResult:\n type: object\n description: Output of the validate command (json format, on error)\n properties:\n valid:\n type: boolean\n diagnostics:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n message:\n type: string\n severity:\n type: string\n enum: [error, warning]\n required: [message, severity]\n overlaps:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n matching_artifacts:\n type: array\n items:\n type: string\n required: [path, matching_artifacts]\n required: [valid, diagnostics, overlaps]\n";
4
+ export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"artifact-contracts CLI\",\n \"version\": \"0.1.1\",\n \"description\": \"Declarative artifact registry — define file properties, resolve paths to artifact IDs, and detect definition overlaps. stdout is reserved for primary output (JSON/YAML/text result); all diagnostics and progress messages go to stderr.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-log-inc\",\n \"url\": \"https://github.com/foo-log-inc/artifact-contracts\"\n }\n },\n \"artifact_slots\": {\n \"artifact-definitions\": {\n \"description\": \"artifact-contracts.yaml definitions and config files\",\n \"direction\": \"read\"\n },\n \"repository-files\": {\n \"description\": \"Repository files scanned for path pattern matching and overlap detection\",\n \"direction\": \"read\"\n },\n \"audit-report\": {\n \"description\": \"LLM audit result output files\",\n \"direction\": \"write\"\n }\n },\n \"command_sets\": {\n \"artifact-contracts\": {\n \"summary\": \"Artifact registry CLI — validate definitions, resolve artifacts, list registered entries, and explain file properties.\",\n \"executable\": \"artifact-contracts\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Output the version number\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Display help for command\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"validate\": {\n \"summary\": \"Validate artifact-contracts definitions\",\n \"description\": \"Validates artifact-contracts.yaml against the schema, checks artifact ID naming conventions, ensures path_patterns are non-empty, and optionally detects overlapping definitions against real repository files.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"check-files\",\n \"description\": \"Scan repository files to detect path_patterns overlaps that static glob analysis cannot fully determine. When enabled, reads all files from git ls-files or glob.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\",\n \"repository-files\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 5000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationResult\"\n },\n \"description\": \"Validation diagnostics. On exit 0 stdout is empty (diagnostics go to stderr). On exit 1/2 with --format json, structured diagnostics are written to stdout.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Validation passed with no errors\"\n },\n \"1\": {\n \"description\": \"Schema or naming convention errors detected\"\n },\n \"2\": {\n \"description\": \"Overlap detected — same path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"resolve\": {\n \"summary\": \"Output fully-resolved artifact definitions\",\n \"description\": \"Expands config variables, applies authority-based defaults for manual_edit and change_control, and outputs the complete resolved DSL. Default format is yaml.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: yaml)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ResolvedDefinitions\"\n },\n \"description\": \"Fully resolved artifact definitions with authority-based defaults applied. Format varies by --format (yaml default, json).\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully output resolved definitions\"\n },\n \"1\": {\n \"description\": \"Error resolving definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"list\": {\n \"summary\": \"List registered artifacts\",\n \"description\": \"Displays all registered artifacts with optional filtering by authority. Use --path for simple ID lookup; use explain for full governance metadata. Default format is text.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"authority\",\n \"description\": \"Filter by authority type\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n }\n },\n {\n \"name\": \"path\",\n \"description\": \"Reverse-lookup — show artifact IDs matching this file path. For full governance details, use the explain command.\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactList\"\n },\n \"description\": \"List of matching artifacts. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully listed artifacts\"\n },\n \"1\": {\n \"description\": \"Error reading definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"explain\": {\n \"summary\": \"Explain artifact properties for a file path\",\n \"description\": \"Given a file path, resolves the matching artifact and displays its full governance properties — artifact ID, authority, manual_edit policy, change_control, and other metadata. Useful for humans and LLM agents to understand file governance. Default format is text.\",\n \"arguments\": [\n {\n \"name\": \"path\",\n \"description\": \"File path to explain\",\n \"required\": true\n }\n ],\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactExplanation\"\n },\n \"description\": \"Artifact governance metadata for the resolved path. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Path resolved to an artifact\"\n },\n \"2\": {\n \"description\": \"Overlap — path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"4\": {\n \"description\": \"Path does not match any registered artifact\"\n }\n }\n },\n \"audit\": {\n \"summary\": \"LLM-based semantic audit of artifact definitions\",\n \"description\": \"Performs semantic analysis of artifact definitions using LLM to identify quality issues that static validation cannot detect — naming inconsistencies, missing coverage for common file types, authority mismatches, and structural improvements.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"adapter\",\n \"description\": \"LLM adapter to use\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"mock\",\n \"cursor\",\n \"openai\",\n \"claude\",\n \"gemini\"\n ]\n }\n },\n {\n \"name\": \"model\",\n \"description\": \"Model name to pass to the adapter\"\n },\n {\n \"name\": \"show-prompt\",\n \"description\": \"Output the constructed prompt without calling the LLM API\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"dry-run\",\n \"aliases\": [\n \"n\"\n ],\n \"description\": \"Alias for --show-prompt (output prompt without LLM call)\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"fail-on\",\n \"description\": \"Minimum severity that causes exit 10. Ordering: critical > error > warning > info. For example, --fail-on warning exits 10 on warning, error, or critical.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"info\",\n \"warning\",\n \"error\",\n \"critical\"\n ]\n }\n },\n {\n \"name\": \"output\",\n \"aliases\": [\n \"o\"\n ],\n \"description\": \"Write result to a file instead of stdout\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"report-format\",\n \"description\": \"Output format for the report (default: text). LLM commands use --report-format; deterministic commands use --format.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"medium\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"writes\": [\n \"audit-report\"\n ],\n \"network\": {\n \"description\": \"LLM API calls to configured provider\",\n \"idempotent\": false\n },\n \"execution_mode\": \"normal\"\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/AgentAuditResult\"\n },\n \"description\": \"Structured audit result conforming to the AgentAuditResult schema. Format varies by --report-format (json, yaml, text).\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 120000,\n \"retryable_exit_codes\": [\n 1\n ],\n \"recommended_before_use\": [\n \"Run with --show-prompt first to preview the prompt\"\n ]\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Audit completed — no findings above threshold\"\n },\n \"1\": {\n \"description\": \"General / transient error\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"10\": {\n \"description\": \"Findings detected above --fail-on threshold\"\n },\n \"11\": {\n \"description\": \"agent-contracts-runtime is not installed\"\n },\n \"12\": {\n \"description\": \"Adapter initialization error (missing API key, etc.)\"\n }\n }\n },\n \"agents\": {\n \"summary\": \"Output the full resolved agent DSL as structured data.\",\n \"description\": \"Outputs the complete resolved agent-contracts DSL (agents, tasks, workflows, handoff_types) embedded in this CLI binary. Useful for debugging, external tooling integration, and DSL inspection.\",\n \"options\": [\n {\n \"name\": \"format\",\n \"aliases\": [\n \"F\"\n ],\n \"description\": \"Output format.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ],\n \"default\": \"yaml\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"DSL output successfully.\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Failed to load embedded DSL.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": []\n }\n }\n },\n \"env\": {\n \"OPENAI_API_KEY\": {\n \"description\": \"OpenAI API key. Required when --adapter openai is selected.\",\n \"required\": false\n },\n \"ANTHROPIC_API_KEY\": {\n \"description\": \"Anthropic API key. Required when --adapter claude is selected.\",\n \"required\": false\n },\n \"GEMINI_API_KEY\": {\n \"description\": \"Google Gemini API key. Required when --adapter gemini is selected.\",\n \"required\": false\n },\n \"CURSOR_API_KEY\": {\n \"description\": \"Cursor API key. Required when --adapter cursor is selected.\",\n \"required\": false\n }\n }\n }\n },\n \"components\": {\n \"schemas\": {\n \"AgentFinding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"critical\",\n \"error\",\n \"warning\",\n \"info\"\n ]\n },\n \"category\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"recommendation\": {\n \"type\": \"string\"\n },\n \"evidence\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentEvidence\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"severity\",\n \"category\",\n \"title\",\n \"description\"\n ]\n },\n \"AgentAuditResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"summary\": {\n \"type\": \"string\"\n },\n \"risk_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"low\",\n \"medium\",\n \"high\",\n \"critical\"\n ]\n },\n \"findings\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentFinding\"\n }\n },\n \"recommended_actions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentRecommendedAction\"\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"total_artifacts\": {\n \"type\": \"integer\"\n },\n \"analyzed_artifacts\": {\n \"type\": \"integer\"\n },\n \"analysis_scope\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"required\": [\n \"summary\",\n \"risk_level\",\n \"findings\",\n \"recommended_actions\"\n ]\n },\n \"AgentEvidence\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\n \"schema\",\n \"code\",\n \"config\",\n \"runtime\",\n \"doc\"\n ]\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"excerpt\": {\n \"type\": \"string\"\n },\n \"reasoning\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"kind\"\n ]\n },\n \"AgentRecommendedAction\": {\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n },\n \"priority\": {\n \"type\": \"string\",\n \"enum\": [\n \"high\",\n \"medium\",\n \"low\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"action\",\n \"priority\"\n ]\n },\n \"ResolvedDefinitions\": {\n \"type\": \"object\",\n \"description\": \"Output of the resolve command\",\n \"properties\": {\n \"artifact_contracts\": {\n \"type\": \"string\"\n },\n \"system\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\"\n ]\n },\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n },\n \"required\": [\n \"artifact_contracts\",\n \"system\",\n \"artifacts\"\n ]\n },\n \"ArtifactExplanation\": {\n \"type\": \"object\",\n \"description\": \"Output of the explain command (json/yaml format)\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\"\n },\n \"manual_edit\": {\n \"type\": \"string\"\n },\n \"change_control\": {\n \"type\": \"string\"\n },\n \"visibility\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\"\n ]\n },\n \"ArtifactDefinition\": {\n \"type\": \"object\",\n \"description\": \"A single resolved artifact definition\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n },\n \"manual_edit\": {\n \"type\": \"string\",\n \"enum\": [\n \"allowed\",\n \"discouraged\",\n \"forbidden\"\n ]\n },\n \"change_control\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"approval-required\",\n \"regeneration-required\"\n ]\n },\n \"visibility\": {\n \"type\": \"string\",\n \"enum\": [\n \"public\",\n \"internal\",\n \"private\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"states\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\",\n \"visibility\",\n \"path_patterns\"\n ]\n },\n \"ArtifactList\": {\n \"type\": \"object\",\n \"description\": \"Output of the list command (json/yaml format)\",\n \"properties\": {\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n }\n },\n \"ValidationResult\": {\n \"type\": \"object\",\n \"description\": \"Output of the validate command (json format, on error)\",\n \"properties\": {\n \"valid\": {\n \"type\": \"boolean\"\n },\n \"diagnostics\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warning\"\n ]\n }\n },\n \"required\": [\n \"message\",\n \"severity\"\n ]\n }\n },\n \"overlaps\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"matching_artifacts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"path\",\n \"matching_artifacts\"\n ]\n }\n }\n },\n \"required\": [\n \"valid\",\n \"diagnostics\",\n \"overlaps\"\n ]\n }\n }\n }\n}";
5
5
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,kpiBAAkpiB,CAAC;AAExriB,MAAM,CAAC,MAAM,iBAAiB,GAAW,inzBAAinzB,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,ypkBAAypkB,CAAC;AAE/rkB,MAAM,CAAC,MAAM,iBAAiB,GAAW,6+1BAA6+1B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * AUTO-GENERATED by agent-contracts-runtime. DO NOT EDIT.
3
+ *
4
+ * Regenerate via: npx agent-runtime generate
5
+ */
6
+ export declare const resolvedDsl: Record<string, unknown>;
7
+ //# sourceMappingURL=dsl-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dsl-data.d.ts","sourceRoot":"","sources":["../../../src/generated/dsl/dsl-data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAuhBtC,CAAC"}