artifact-contracts 0.1.0 → 0.2.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.
Files changed (113) hide show
  1. package/README.md +254 -2
  2. package/cli-contract.yaml +529 -0
  3. package/dist/agents/index.d.ts +3 -0
  4. package/dist/agents/index.d.ts.map +1 -0
  5. package/dist/agents/index.js +2 -0
  6. package/dist/agents/index.js.map +1 -0
  7. package/dist/agents/orchestrator.d.ts +3 -0
  8. package/dist/agents/orchestrator.d.ts.map +1 -0
  9. package/dist/agents/orchestrator.js +109 -0
  10. package/dist/agents/orchestrator.js.map +1 -0
  11. package/dist/agents/types.d.ts +21 -0
  12. package/dist/agents/types.d.ts.map +1 -0
  13. package/dist/agents/types.js +2 -0
  14. package/dist/agents/types.js.map +1 -0
  15. package/dist/cli/audit.d.ts +12 -0
  16. package/dist/cli/audit.d.ts.map +1 -0
  17. package/dist/cli/audit.js +122 -0
  18. package/dist/cli/audit.js.map +1 -0
  19. package/dist/cli/explain.d.ts +5 -0
  20. package/dist/cli/explain.d.ts.map +1 -0
  21. package/dist/cli/explain.js +47 -0
  22. package/dist/cli/explain.js.map +1 -0
  23. package/dist/cli/index.d.ts +3 -0
  24. package/dist/cli/index.d.ts.map +1 -0
  25. package/dist/cli/index.js +35 -0
  26. package/dist/cli/index.js.map +1 -0
  27. package/dist/cli/list.d.ts +7 -0
  28. package/dist/cli/list.d.ts.map +1 -0
  29. package/dist/cli/list.js +49 -0
  30. package/dist/cli/list.js.map +1 -0
  31. package/dist/cli/resolve.d.ts +5 -0
  32. package/dist/cli/resolve.d.ts.map +1 -0
  33. package/dist/cli/resolve.js +21 -0
  34. package/dist/cli/resolve.js.map +1 -0
  35. package/dist/cli/validate.d.ts +5 -0
  36. package/dist/cli/validate.d.ts.map +1 -0
  37. package/dist/cli/validate.js +36 -0
  38. package/dist/cli/validate.js.map +1 -0
  39. package/dist/core/index.d.ts +10 -0
  40. package/dist/core/index.d.ts.map +1 -0
  41. package/dist/core/index.js +6 -0
  42. package/dist/core/index.js.map +1 -0
  43. package/dist/core/lookup.d.ts +12 -0
  44. package/dist/core/lookup.d.ts.map +1 -0
  45. package/dist/core/lookup.js +24 -0
  46. package/dist/core/lookup.js.map +1 -0
  47. package/dist/core/matcher.d.ts +3 -0
  48. package/dist/core/matcher.d.ts.map +1 -0
  49. package/dist/core/matcher.js +14 -0
  50. package/dist/core/matcher.js.map +1 -0
  51. package/dist/core/resolver.d.ts +18 -0
  52. package/dist/core/resolver.d.ts.map +1 -0
  53. package/dist/core/resolver.js +98 -0
  54. package/dist/core/resolver.js.map +1 -0
  55. package/dist/core/schema.d.ts +160 -0
  56. package/dist/core/schema.d.ts.map +1 -0
  57. package/dist/core/schema.js +69 -0
  58. package/dist/core/schema.js.map +1 -0
  59. package/dist/core/validator.d.ts +16 -0
  60. package/dist/core/validator.d.ts.map +1 -0
  61. package/dist/core/validator.js +86 -0
  62. package/dist/core/validator.js.map +1 -0
  63. package/dist/generated/commands.d.ts +2 -0
  64. package/dist/generated/commands.d.ts.map +1 -0
  65. package/dist/generated/commands.js +2 -0
  66. package/dist/generated/commands.js.map +1 -0
  67. package/dist/generated/dsl/agents.d.ts +34 -0
  68. package/dist/generated/dsl/agents.d.ts.map +1 -0
  69. package/dist/generated/dsl/agents.js +42 -0
  70. package/dist/generated/dsl/agents.js.map +1 -0
  71. package/dist/generated/dsl/handoffs.d.ts +339 -0
  72. package/dist/generated/dsl/handoffs.d.ts.map +1 -0
  73. package/dist/generated/dsl/handoffs.js +74 -0
  74. package/dist/generated/dsl/handoffs.js.map +1 -0
  75. package/dist/generated/dsl/index.d.ts +13 -0
  76. package/dist/generated/dsl/index.d.ts.map +1 -0
  77. package/dist/generated/dsl/index.js +10 -0
  78. package/dist/generated/dsl/index.js.map +1 -0
  79. package/dist/generated/dsl/tasks.d.ts +23 -0
  80. package/dist/generated/dsl/tasks.d.ts.map +1 -0
  81. package/dist/generated/dsl/tasks.js +25 -0
  82. package/dist/generated/dsl/tasks.js.map +1 -0
  83. package/dist/generated/dsl/workflows.d.ts +31 -0
  84. package/dist/generated/dsl/workflows.d.ts.map +1 -0
  85. package/dist/generated/dsl/workflows.js +32 -0
  86. package/dist/generated/dsl/workflows.js.map +1 -0
  87. package/dist/generated/index.d.ts +7 -0
  88. package/dist/generated/index.d.ts.map +1 -0
  89. package/dist/generated/index.js +7 -0
  90. package/dist/generated/index.js.map +1 -0
  91. package/dist/generated/policy.d.ts +146 -0
  92. package/dist/generated/policy.d.ts.map +1 -0
  93. package/dist/generated/policy.js +236 -0
  94. package/dist/generated/policy.js.map +1 -0
  95. package/dist/generated/program.d.ts +33 -0
  96. package/dist/generated/program.d.ts.map +1 -0
  97. package/dist/generated/program.js +92 -0
  98. package/dist/generated/program.js.map +1 -0
  99. package/dist/generated/schemas.d.ts +471 -0
  100. package/dist/generated/schemas.d.ts.map +1 -0
  101. package/dist/generated/schemas.js +640 -0
  102. package/dist/generated/schemas.js.map +1 -0
  103. package/dist/generated/types.d.ts +187 -0
  104. package/dist/generated/types.d.ts.map +1 -0
  105. package/dist/generated/types.js +3 -0
  106. package/dist/generated/types.js.map +1 -0
  107. package/dist/index.d.ts +4 -3
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +3 -5
  110. package/dist/index.js.map +1 -0
  111. package/package.json +47 -10
  112. package/schemas/2026A.config.json +47 -0
  113. package/schemas/2026A.json +116 -0
@@ -0,0 +1,146 @@
1
+ import type { DerivedPolicy, IntrospectionResult } from "cli-contracts/policy";
2
+ export type { DerivedPolicy, IntrospectionResult };
3
+ export declare const commandDefinitions: {
4
+ readonly validate: {
5
+ readonly effects: {
6
+ readonly riskLevel: "low";
7
+ readonly reads: readonly [{
8
+ readonly target: "artifact-definitions";
9
+ readonly description: "artifact-contracts.yaml and config";
10
+ }, {
11
+ readonly target: "repository-files";
12
+ readonly description: "All tracked files via git ls-files. Only read when --check-files is specified.";
13
+ }];
14
+ readonly executionMode: "normal";
15
+ };
16
+ readonly options: readonly [{
17
+ readonly name: "config";
18
+ }, {
19
+ readonly name: "check-files";
20
+ readonly schema: {
21
+ readonly type: "boolean";
22
+ };
23
+ }];
24
+ };
25
+ readonly resolve: {
26
+ readonly effects: {
27
+ readonly riskLevel: "low";
28
+ readonly reads: readonly [{
29
+ readonly target: "artifact-definitions";
30
+ readonly description: "artifact-contracts.yaml and config";
31
+ }];
32
+ readonly executionMode: "normal";
33
+ };
34
+ readonly options: readonly [{
35
+ readonly name: "config";
36
+ }, {
37
+ readonly name: "format";
38
+ readonly schema: {
39
+ readonly type: "string";
40
+ readonly enum: readonly ["yaml", "json"];
41
+ };
42
+ }];
43
+ };
44
+ readonly list: {
45
+ readonly effects: {
46
+ readonly riskLevel: "low";
47
+ readonly reads: readonly [{
48
+ readonly target: "artifact-definitions";
49
+ readonly description: "artifact-contracts.yaml and config";
50
+ }];
51
+ readonly executionMode: "normal";
52
+ };
53
+ readonly options: readonly [{
54
+ readonly name: "config";
55
+ }, {
56
+ readonly name: "authority";
57
+ readonly schema: {
58
+ readonly type: "string";
59
+ readonly enum: readonly ["canonical", "derived", "generated", "control"];
60
+ };
61
+ }, {
62
+ readonly name: "path";
63
+ }, {
64
+ readonly name: "format";
65
+ readonly schema: {
66
+ readonly type: "string";
67
+ readonly enum: readonly ["text", "json", "yaml"];
68
+ };
69
+ }];
70
+ };
71
+ readonly explain: {
72
+ readonly effects: {
73
+ readonly riskLevel: "low";
74
+ readonly reads: readonly [{
75
+ readonly target: "artifact-definitions";
76
+ readonly description: "artifact-contracts.yaml and config";
77
+ }];
78
+ readonly executionMode: "normal";
79
+ };
80
+ readonly options: readonly [{
81
+ readonly name: "config";
82
+ }, {
83
+ readonly name: "format";
84
+ readonly schema: {
85
+ readonly type: "string";
86
+ readonly enum: readonly ["text", "json", "yaml"];
87
+ };
88
+ }];
89
+ };
90
+ readonly audit: {
91
+ readonly effects: {
92
+ readonly riskLevel: "medium";
93
+ readonly reads: readonly [{
94
+ readonly target: "artifact-definitions";
95
+ readonly description: "artifact-contracts.yaml and config";
96
+ }];
97
+ readonly writes: readonly [{
98
+ readonly target: "output-file";
99
+ readonly description: "Written only when --output is specified";
100
+ readonly overwrite: true;
101
+ }];
102
+ readonly network: {
103
+ readonly description: "LLM API calls to configured provider";
104
+ readonly idempotent: false;
105
+ };
106
+ readonly executionMode: "normal";
107
+ };
108
+ readonly options: readonly [{
109
+ readonly name: "config";
110
+ }, {
111
+ readonly name: "adapter";
112
+ readonly schema: {
113
+ readonly type: "string";
114
+ readonly enum: readonly ["mock", "cursor", "openai", "claude", "gemini"];
115
+ };
116
+ }, {
117
+ readonly name: "model";
118
+ }, {
119
+ readonly name: "show-prompt";
120
+ readonly schema: {
121
+ readonly type: "boolean";
122
+ };
123
+ }, {
124
+ readonly name: "dry-run";
125
+ readonly schema: {
126
+ readonly type: "boolean";
127
+ };
128
+ }, {
129
+ readonly name: "fail-on";
130
+ readonly schema: {
131
+ readonly type: "string";
132
+ readonly enum: readonly ["info", "warning", "error", "critical"];
133
+ };
134
+ }, {
135
+ readonly name: "output";
136
+ }, {
137
+ readonly name: "report-format";
138
+ readonly schema: {
139
+ readonly type: "string";
140
+ readonly enum: readonly ["text", "json", "yaml"];
141
+ };
142
+ }];
143
+ };
144
+ };
145
+ export declare function deriveCommandPolicy(commandId: string, optionValues: Record<string, unknown>): IntrospectionResult;
146
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/generated/policy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC;AAEnD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgNrB,CAAC;AAEX,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,mBAAmB,CA0BrB"}
@@ -0,0 +1,236 @@
1
+ // Auto-generated by cli-contracts. Do not edit.
2
+ import { derivePolicy, isOptionActive } from "cli-contracts/policy";
3
+ export const commandDefinitions = {
4
+ "validate": {
5
+ "effects": {
6
+ "riskLevel": "low",
7
+ "reads": [
8
+ {
9
+ "target": "artifact-definitions",
10
+ "description": "artifact-contracts.yaml and config"
11
+ },
12
+ {
13
+ "target": "repository-files",
14
+ "description": "All tracked files via git ls-files. Only read when --check-files is specified."
15
+ }
16
+ ],
17
+ "executionMode": "normal"
18
+ },
19
+ "options": [
20
+ {
21
+ "name": "config"
22
+ },
23
+ {
24
+ "name": "check-files",
25
+ "schema": {
26
+ "type": "boolean"
27
+ }
28
+ }
29
+ ]
30
+ },
31
+ "resolve": {
32
+ "effects": {
33
+ "riskLevel": "low",
34
+ "reads": [
35
+ {
36
+ "target": "artifact-definitions",
37
+ "description": "artifact-contracts.yaml and config"
38
+ }
39
+ ],
40
+ "executionMode": "normal"
41
+ },
42
+ "options": [
43
+ {
44
+ "name": "config"
45
+ },
46
+ {
47
+ "name": "format",
48
+ "schema": {
49
+ "type": "string",
50
+ "enum": [
51
+ "yaml",
52
+ "json"
53
+ ]
54
+ }
55
+ }
56
+ ]
57
+ },
58
+ "list": {
59
+ "effects": {
60
+ "riskLevel": "low",
61
+ "reads": [
62
+ {
63
+ "target": "artifact-definitions",
64
+ "description": "artifact-contracts.yaml and config"
65
+ }
66
+ ],
67
+ "executionMode": "normal"
68
+ },
69
+ "options": [
70
+ {
71
+ "name": "config"
72
+ },
73
+ {
74
+ "name": "authority",
75
+ "schema": {
76
+ "type": "string",
77
+ "enum": [
78
+ "canonical",
79
+ "derived",
80
+ "generated",
81
+ "control"
82
+ ]
83
+ }
84
+ },
85
+ {
86
+ "name": "path"
87
+ },
88
+ {
89
+ "name": "format",
90
+ "schema": {
91
+ "type": "string",
92
+ "enum": [
93
+ "text",
94
+ "json",
95
+ "yaml"
96
+ ]
97
+ }
98
+ }
99
+ ]
100
+ },
101
+ "explain": {
102
+ "effects": {
103
+ "riskLevel": "low",
104
+ "reads": [
105
+ {
106
+ "target": "artifact-definitions",
107
+ "description": "artifact-contracts.yaml and config"
108
+ }
109
+ ],
110
+ "executionMode": "normal"
111
+ },
112
+ "options": [
113
+ {
114
+ "name": "config"
115
+ },
116
+ {
117
+ "name": "format",
118
+ "schema": {
119
+ "type": "string",
120
+ "enum": [
121
+ "text",
122
+ "json",
123
+ "yaml"
124
+ ]
125
+ }
126
+ }
127
+ ]
128
+ },
129
+ "audit": {
130
+ "effects": {
131
+ "riskLevel": "medium",
132
+ "reads": [
133
+ {
134
+ "target": "artifact-definitions",
135
+ "description": "artifact-contracts.yaml and config"
136
+ }
137
+ ],
138
+ "writes": [
139
+ {
140
+ "target": "output-file",
141
+ "description": "Written only when --output is specified",
142
+ "overwrite": true
143
+ }
144
+ ],
145
+ "network": {
146
+ "description": "LLM API calls to configured provider",
147
+ "idempotent": false
148
+ },
149
+ "executionMode": "normal"
150
+ },
151
+ "options": [
152
+ {
153
+ "name": "config"
154
+ },
155
+ {
156
+ "name": "adapter",
157
+ "schema": {
158
+ "type": "string",
159
+ "enum": [
160
+ "mock",
161
+ "cursor",
162
+ "openai",
163
+ "claude",
164
+ "gemini"
165
+ ]
166
+ }
167
+ },
168
+ {
169
+ "name": "model"
170
+ },
171
+ {
172
+ "name": "show-prompt",
173
+ "schema": {
174
+ "type": "boolean"
175
+ }
176
+ },
177
+ {
178
+ "name": "dry-run",
179
+ "schema": {
180
+ "type": "boolean"
181
+ }
182
+ },
183
+ {
184
+ "name": "fail-on",
185
+ "schema": {
186
+ "type": "string",
187
+ "enum": [
188
+ "info",
189
+ "warning",
190
+ "error",
191
+ "critical"
192
+ ]
193
+ }
194
+ },
195
+ {
196
+ "name": "output"
197
+ },
198
+ {
199
+ "name": "report-format",
200
+ "schema": {
201
+ "type": "string",
202
+ "enum": [
203
+ "text",
204
+ "json",
205
+ "yaml"
206
+ ]
207
+ }
208
+ }
209
+ ]
210
+ },
211
+ };
212
+ export function deriveCommandPolicy(commandId, optionValues) {
213
+ const def = commandDefinitions[commandId];
214
+ if (!def)
215
+ throw new Error(`Unknown command: ${commandId}`);
216
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
217
+ const cmdDef = def;
218
+ const options = {};
219
+ const activeOptions = [];
220
+ for (const optDef of cmdDef.options ?? []) {
221
+ const value = optionValues[optDef.name];
222
+ const specified = optDef.name in optionValues && value !== undefined;
223
+ options[optDef.name] = { value, specified, definition: optDef };
224
+ if (isOptionActive(optDef, value, specified)) {
225
+ activeOptions.push(optDef.name);
226
+ }
227
+ }
228
+ const policy = derivePolicy({
229
+ commandId,
230
+ commandEffects: cmdDef.effects,
231
+ options,
232
+ env: cmdDef.env,
233
+ });
234
+ return { command: commandId, activeOptions, policy };
235
+ }
236
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/generated/policy.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKpE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE;QACV,SAAS,EAAE;YACT,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE;gBACP;oBACE,QAAQ,EAAE,sBAAsB;oBAChC,aAAa,EAAE,oCAAoC;iBACpD;gBACD;oBACE,QAAQ,EAAE,kBAAkB;oBAC5B,aAAa,EAAE,gFAAgF;iBAChG;aACF;YACD,eAAe,EAAE,QAAQ;SAC1B;QACD,SAAS,EAAE;YACT;gBACE,MAAM,EAAE,QAAQ;aACjB;YACD;gBACE,MA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CommandHandlers {
3
+ validate: (options: {
4
+ config?: string;
5
+ checkFiles?: boolean;
6
+ }, parentOpts: Record<string, unknown>) => Promise<void>;
7
+ resolve: (options: {
8
+ config?: string;
9
+ format?: string;
10
+ }, parentOpts: Record<string, unknown>) => Promise<void>;
11
+ list: (options: {
12
+ config?: string;
13
+ authority?: string;
14
+ path?: string;
15
+ format?: string;
16
+ }, parentOpts: Record<string, unknown>) => Promise<void>;
17
+ explain: (path: string | undefined, options: {
18
+ config?: string;
19
+ format?: string;
20
+ }, parentOpts: Record<string, unknown>) => Promise<void>;
21
+ audit: (options: {
22
+ config?: string;
23
+ adapter?: string;
24
+ model?: string;
25
+ showPrompt?: boolean;
26
+ dryRun?: boolean;
27
+ failOn?: string;
28
+ output?: string;
29
+ reportFormat?: string;
30
+ }, parentOpts: Record<string, unknown>) => Promise<void>;
31
+ }
32
+ export declare function createProgram(handlers: CommandHandlers, version: string): Command;
33
+ //# sourceMappingURL=program.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,CAAC,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrH,OAAO,EAAE,CAAC,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/G,IAAI,EAAE,CAAC,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/I,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzI,KAAK,EAAE,CAAC,OAAO,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChO;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,GACd,OAAO,CA8FT"}
@@ -0,0 +1,92 @@
1
+ // Auto-generated by cli-contracts. Do not edit.
2
+ import { Command } from "commander";
3
+ import { deriveCommandPolicy } from "./policy.js";
4
+ export function createProgram(handlers, version) {
5
+ const program = new Command();
6
+ program
7
+ .name("artifact-contracts")
8
+ .version(version, "-V, --version")
9
+ .description("Artifact registry CLI — validate definitions, resolve artifacts, list registered entries, and explain file properties.");
10
+ program.option("--introspect", "Output derived policy as JSON without executing the command");
11
+ program
12
+ .command("validate")
13
+ .description("Validate artifact-contracts definitions")
14
+ .option("--config <path>", "Path to artifact-contracts.config.yaml")
15
+ .option("--check-files", "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.")
16
+ .action(async (opts, cmd) => {
17
+ const globalOpts = cmd.optsWithGlobals();
18
+ if (globalOpts.introspect) {
19
+ const policy = deriveCommandPolicy("validate", opts);
20
+ console.log(JSON.stringify(policy, null, 2));
21
+ return;
22
+ }
23
+ await handlers.validate(opts, globalOpts);
24
+ });
25
+ program
26
+ .command("resolve")
27
+ .description("Output fully-resolved artifact definitions")
28
+ .option("--config <path>", "Path to artifact-contracts.config.yaml")
29
+ .option("--format <value>", "Output format (default: yaml)")
30
+ .action(async (opts, cmd) => {
31
+ const globalOpts = cmd.optsWithGlobals();
32
+ if (globalOpts.introspect) {
33
+ const policy = deriveCommandPolicy("resolve", opts);
34
+ console.log(JSON.stringify(policy, null, 2));
35
+ return;
36
+ }
37
+ await handlers.resolve(opts, globalOpts);
38
+ });
39
+ program
40
+ .command("list")
41
+ .description("List registered artifacts")
42
+ .option("--config <path>", "Path to artifact-contracts.config.yaml")
43
+ .option("--authority <value>", "Filter by authority type")
44
+ .option("--path <file>", "Reverse-lookup — show artifact IDs matching this file path. For full governance details, use the explain command.")
45
+ .option("--format <value>", "Output format (default: text)")
46
+ .action(async (opts, cmd) => {
47
+ const globalOpts = cmd.optsWithGlobals();
48
+ if (globalOpts.introspect) {
49
+ const policy = deriveCommandPolicy("list", opts);
50
+ console.log(JSON.stringify(policy, null, 2));
51
+ return;
52
+ }
53
+ await handlers.list(opts, globalOpts);
54
+ });
55
+ program
56
+ .command("explain")
57
+ .description("Explain artifact properties for a file path")
58
+ .argument("<path>", "File path to explain")
59
+ .option("--config <path>", "Path to artifact-contracts.config.yaml")
60
+ .option("--format <value>", "Output format (default: text)")
61
+ .action(async (path, opts, cmd) => {
62
+ const globalOpts = cmd.optsWithGlobals();
63
+ if (globalOpts.introspect) {
64
+ const policy = deriveCommandPolicy("explain", opts);
65
+ console.log(JSON.stringify(policy, null, 2));
66
+ return;
67
+ }
68
+ await handlers.explain(path, opts, globalOpts);
69
+ });
70
+ program
71
+ .command("audit")
72
+ .description("LLM-based semantic audit of artifact definitions")
73
+ .option("--config <path>", "Path to artifact-contracts.config.yaml")
74
+ .option("--adapter <value>", "LLM adapter to use")
75
+ .option("--model <value>", "Model name to pass to the adapter")
76
+ .option("--show-prompt", "Output the constructed prompt without calling the LLM API")
77
+ .option("-n, --dry-run", "Alias for --show-prompt (output prompt without LLM call)")
78
+ .option("--fail-on <value>", "Minimum severity that causes exit 10. Ordering: critical > error > warning > info. For example, --fail-on warning exits 10 on warning, error, or critical.")
79
+ .option("-o, --output <file>", "Write result to a file instead of stdout")
80
+ .option("--report-format <value>", "Output format for the report (default: text). LLM commands use --report-format; deterministic commands use --format.")
81
+ .action(async (opts, cmd) => {
82
+ const globalOpts = cmd.optsWithGlobals();
83
+ if (globalOpts.introspect) {
84
+ const policy = deriveCommandPolicy("audit", opts);
85
+ console.log(JSON.stringify(policy, null, 2));
86
+ return;
87
+ }
88
+ await handlers.audit(opts, globalOpts);
89
+ });
90
+ return program;
91
+ }
92
+ //# sourceMappingURL=program.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/generated/program.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAsB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAUtE,MAAM,UAAU,aAAa,CAC3B,QAAyB,EACzB,OAAe;IAEf,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO;SACJ,IAAI,CAAC,oBAAoB,CAAC;SAC1B,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC;SACjC,WAAW,CAAC,wHAAwH,CAAC,CAA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