@harness-engineering/core 0.17.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12605,6 +12605,10 @@ var GitHubIssuesSyncAdapter = class {
12605
12605
  owner;
12606
12606
  repo;
12607
12607
  retryOpts;
12608
+ /** Cached GitHub milestone name -> ID mapping */
12609
+ milestoneCache = null;
12610
+ /** Cached authenticated user login (e.g., "@octocat") */
12611
+ authenticatedUserCache = null;
12608
12612
  constructor(options) {
12609
12613
  this.token = options.token;
12610
12614
  this.config = options.config;
@@ -12621,6 +12625,63 @@ var GitHubIssuesSyncAdapter = class {
12621
12625
  this.owner = repoParts[0];
12622
12626
  this.repo = repoParts[1];
12623
12627
  }
12628
+ /**
12629
+ * Fetch all GitHub milestones and build the name -> ID cache.
12630
+ */
12631
+ async loadMilestones() {
12632
+ if (this.milestoneCache) return this.milestoneCache;
12633
+ this.milestoneCache = /* @__PURE__ */ new Map();
12634
+ const response = await fetchWithRetry(
12635
+ this.fetchFn,
12636
+ `${this.apiBase}/repos/${this.owner}/${this.repo}/milestones?state=all&per_page=100`,
12637
+ { method: "GET", headers: this.headers() },
12638
+ this.retryOpts
12639
+ );
12640
+ if (response.ok) {
12641
+ const data = await response.json();
12642
+ for (const m of data) {
12643
+ this.milestoneCache.set(m.title, m.number);
12644
+ }
12645
+ }
12646
+ return this.milestoneCache;
12647
+ }
12648
+ /**
12649
+ * Get or create a GitHub milestone by name. Returns the milestone number.
12650
+ */
12651
+ async ensureMilestone(name) {
12652
+ const cache = await this.loadMilestones();
12653
+ if (cache.has(name)) return cache.get(name);
12654
+ const response = await fetchWithRetry(
12655
+ this.fetchFn,
12656
+ `${this.apiBase}/repos/${this.owner}/${this.repo}/milestones`,
12657
+ { method: "POST", headers: this.headers(), body: JSON.stringify({ title: name }) },
12658
+ this.retryOpts
12659
+ );
12660
+ if (!response.ok) return null;
12661
+ const data = await response.json();
12662
+ cache.set(name, data.number);
12663
+ return data.number;
12664
+ }
12665
+ async getAuthenticatedUser() {
12666
+ if (this.authenticatedUserCache) return (0, import_types21.Ok)(this.authenticatedUserCache);
12667
+ try {
12668
+ const response = await fetchWithRetry(
12669
+ this.fetchFn,
12670
+ `${this.apiBase}/user`,
12671
+ { method: "GET", headers: this.headers() },
12672
+ this.retryOpts
12673
+ );
12674
+ if (!response.ok) {
12675
+ const text = await response.text();
12676
+ return (0, import_types21.Err)(new Error(`GitHub API error ${response.status}: ${text}`));
12677
+ }
12678
+ const data = await response.json();
12679
+ this.authenticatedUserCache = `@${data.login}`;
12680
+ return (0, import_types21.Ok)(this.authenticatedUserCache);
12681
+ } catch (error) {
12682
+ return (0, import_types21.Err)(error instanceof Error ? error : new Error(String(error)));
12683
+ }
12684
+ }
12624
12685
  headers() {
12625
12686
  return {
12626
12687
  Authorization: `Bearer ${this.token}`,
@@ -12645,21 +12706,19 @@ var GitHubIssuesSyncAdapter = class {
12645
12706
  }
12646
12707
  async createTicket(feature, milestone) {
12647
12708
  try {
12648
- const labels = labelsForStatus(feature.status, this.config);
12649
- const body = [
12650
- feature.summary,
12651
- "",
12652
- `**Milestone:** ${milestone}`,
12653
- feature.spec ? `**Spec:** ${feature.spec}` : ""
12654
- ].filter(Boolean).join("\n");
12709
+ const labels = [...labelsForStatus(feature.status, this.config), "feature"];
12710
+ const body = [feature.summary, "", feature.spec ? `**Spec:** ${feature.spec}` : ""].filter(Boolean).join("\n");
12711
+ const milestoneId = await this.ensureMilestone(milestone);
12712
+ const issuePayload = { title: feature.name, body, labels };
12713
+ if (milestoneId) issuePayload.milestone = milestoneId;
12714
+ if (feature.assignee) {
12715
+ const login = feature.assignee.startsWith("@") ? feature.assignee.slice(1) : feature.assignee;
12716
+ issuePayload.assignees = [login];
12717
+ }
12655
12718
  const response = await fetchWithRetry(
12656
12719
  this.fetchFn,
12657
12720
  `${this.apiBase}/repos/${this.owner}/${this.repo}/issues`,
12658
- {
12659
- method: "POST",
12660
- headers: this.headers(),
12661
- body: JSON.stringify({ title: feature.name, body, labels })
12662
- },
12721
+ { method: "POST", headers: this.headers(), body: JSON.stringify(issuePayload) },
12663
12722
  this.retryOpts
12664
12723
  );
12665
12724
  if (!response.ok) {
@@ -12674,7 +12733,7 @@ var GitHubIssuesSyncAdapter = class {
12674
12733
  return (0, import_types21.Err)(error instanceof Error ? error : new Error(String(error)));
12675
12734
  }
12676
12735
  }
12677
- async updateTicket(externalId, changes) {
12736
+ async updateTicket(externalId, changes, milestone) {
12678
12737
  try {
12679
12738
  const parsed = parseExternalId(externalId);
12680
12739
  if (!parsed) return (0, import_types21.Err)(new Error(`Invalid externalId format: "${externalId}"`));
@@ -12687,7 +12746,19 @@ var GitHubIssuesSyncAdapter = class {
12687
12746
  if (changes.status !== void 0) {
12688
12747
  const externalStatus = this.config.statusMap[changes.status];
12689
12748
  patch.state = externalStatus;
12690
- patch.labels = labelsForStatus(changes.status, this.config);
12749
+ patch.labels = [...labelsForStatus(changes.status, this.config), "feature"];
12750
+ }
12751
+ if (changes.assignee !== void 0) {
12752
+ if (changes.assignee) {
12753
+ const login = changes.assignee.startsWith("@") ? changes.assignee.slice(1) : changes.assignee;
12754
+ patch.assignees = [login];
12755
+ } else {
12756
+ patch.assignees = [];
12757
+ }
12758
+ }
12759
+ if (milestone) {
12760
+ const milestoneId = await this.ensureMilestone(milestone);
12761
+ if (milestoneId) patch.milestone = milestoneId;
12691
12762
  }
12692
12763
  const response = await fetchWithRetry(
12693
12764
  this.fetchFn,
@@ -12809,8 +12880,16 @@ function emptySyncResult() {
12809
12880
  }
12810
12881
  async function syncToExternal(roadmap, adapter, _config) {
12811
12882
  const result = emptySyncResult();
12883
+ let defaultAssignee = null;
12884
+ const userResult = await adapter.getAuthenticatedUser();
12885
+ if (userResult.ok) {
12886
+ defaultAssignee = userResult.value;
12887
+ }
12812
12888
  for (const milestone of roadmap.milestones) {
12813
12889
  for (const feature of milestone.features) {
12890
+ if (!feature.assignee && defaultAssignee) {
12891
+ feature.assignee = defaultAssignee;
12892
+ }
12814
12893
  if (!feature.externalId) {
12815
12894
  const createResult = await adapter.createTicket(feature, milestone.name);
12816
12895
  if (createResult.ok) {
@@ -12820,7 +12899,11 @@ async function syncToExternal(roadmap, adapter, _config) {
12820
12899
  result.errors.push({ featureOrId: feature.name, error: createResult.error });
12821
12900
  }
12822
12901
  } else {
12823
- const updateResult = await adapter.updateTicket(feature.externalId, feature);
12902
+ const updateResult = await adapter.updateTicket(
12903
+ feature.externalId,
12904
+ feature,
12905
+ milestone.name
12906
+ );
12824
12907
  if (updateResult.ok) {
12825
12908
  result.updated.push(feature.externalId);
12826
12909
  } else {
package/dist/index.mjs CHANGED
@@ -10496,6 +10496,10 @@ var GitHubIssuesSyncAdapter = class {
10496
10496
  owner;
10497
10497
  repo;
10498
10498
  retryOpts;
10499
+ /** Cached GitHub milestone name -> ID mapping */
10500
+ milestoneCache = null;
10501
+ /** Cached authenticated user login (e.g., "@octocat") */
10502
+ authenticatedUserCache = null;
10499
10503
  constructor(options) {
10500
10504
  this.token = options.token;
10501
10505
  this.config = options.config;
@@ -10512,6 +10516,63 @@ var GitHubIssuesSyncAdapter = class {
10512
10516
  this.owner = repoParts[0];
10513
10517
  this.repo = repoParts[1];
10514
10518
  }
10519
+ /**
10520
+ * Fetch all GitHub milestones and build the name -> ID cache.
10521
+ */
10522
+ async loadMilestones() {
10523
+ if (this.milestoneCache) return this.milestoneCache;
10524
+ this.milestoneCache = /* @__PURE__ */ new Map();
10525
+ const response = await fetchWithRetry(
10526
+ this.fetchFn,
10527
+ `${this.apiBase}/repos/${this.owner}/${this.repo}/milestones?state=all&per_page=100`,
10528
+ { method: "GET", headers: this.headers() },
10529
+ this.retryOpts
10530
+ );
10531
+ if (response.ok) {
10532
+ const data = await response.json();
10533
+ for (const m of data) {
10534
+ this.milestoneCache.set(m.title, m.number);
10535
+ }
10536
+ }
10537
+ return this.milestoneCache;
10538
+ }
10539
+ /**
10540
+ * Get or create a GitHub milestone by name. Returns the milestone number.
10541
+ */
10542
+ async ensureMilestone(name) {
10543
+ const cache = await this.loadMilestones();
10544
+ if (cache.has(name)) return cache.get(name);
10545
+ const response = await fetchWithRetry(
10546
+ this.fetchFn,
10547
+ `${this.apiBase}/repos/${this.owner}/${this.repo}/milestones`,
10548
+ { method: "POST", headers: this.headers(), body: JSON.stringify({ title: name }) },
10549
+ this.retryOpts
10550
+ );
10551
+ if (!response.ok) return null;
10552
+ const data = await response.json();
10553
+ cache.set(name, data.number);
10554
+ return data.number;
10555
+ }
10556
+ async getAuthenticatedUser() {
10557
+ if (this.authenticatedUserCache) return Ok4(this.authenticatedUserCache);
10558
+ try {
10559
+ const response = await fetchWithRetry(
10560
+ this.fetchFn,
10561
+ `${this.apiBase}/user`,
10562
+ { method: "GET", headers: this.headers() },
10563
+ this.retryOpts
10564
+ );
10565
+ if (!response.ok) {
10566
+ const text = await response.text();
10567
+ return Err3(new Error(`GitHub API error ${response.status}: ${text}`));
10568
+ }
10569
+ const data = await response.json();
10570
+ this.authenticatedUserCache = `@${data.login}`;
10571
+ return Ok4(this.authenticatedUserCache);
10572
+ } catch (error) {
10573
+ return Err3(error instanceof Error ? error : new Error(String(error)));
10574
+ }
10575
+ }
10515
10576
  headers() {
10516
10577
  return {
10517
10578
  Authorization: `Bearer ${this.token}`,
@@ -10536,21 +10597,19 @@ var GitHubIssuesSyncAdapter = class {
10536
10597
  }
10537
10598
  async createTicket(feature, milestone) {
10538
10599
  try {
10539
- const labels = labelsForStatus(feature.status, this.config);
10540
- const body = [
10541
- feature.summary,
10542
- "",
10543
- `**Milestone:** ${milestone}`,
10544
- feature.spec ? `**Spec:** ${feature.spec}` : ""
10545
- ].filter(Boolean).join("\n");
10600
+ const labels = [...labelsForStatus(feature.status, this.config), "feature"];
10601
+ const body = [feature.summary, "", feature.spec ? `**Spec:** ${feature.spec}` : ""].filter(Boolean).join("\n");
10602
+ const milestoneId = await this.ensureMilestone(milestone);
10603
+ const issuePayload = { title: feature.name, body, labels };
10604
+ if (milestoneId) issuePayload.milestone = milestoneId;
10605
+ if (feature.assignee) {
10606
+ const login = feature.assignee.startsWith("@") ? feature.assignee.slice(1) : feature.assignee;
10607
+ issuePayload.assignees = [login];
10608
+ }
10546
10609
  const response = await fetchWithRetry(
10547
10610
  this.fetchFn,
10548
10611
  `${this.apiBase}/repos/${this.owner}/${this.repo}/issues`,
10549
- {
10550
- method: "POST",
10551
- headers: this.headers(),
10552
- body: JSON.stringify({ title: feature.name, body, labels })
10553
- },
10612
+ { method: "POST", headers: this.headers(), body: JSON.stringify(issuePayload) },
10554
10613
  this.retryOpts
10555
10614
  );
10556
10615
  if (!response.ok) {
@@ -10565,7 +10624,7 @@ var GitHubIssuesSyncAdapter = class {
10565
10624
  return Err3(error instanceof Error ? error : new Error(String(error)));
10566
10625
  }
10567
10626
  }
10568
- async updateTicket(externalId, changes) {
10627
+ async updateTicket(externalId, changes, milestone) {
10569
10628
  try {
10570
10629
  const parsed = parseExternalId(externalId);
10571
10630
  if (!parsed) return Err3(new Error(`Invalid externalId format: "${externalId}"`));
@@ -10578,7 +10637,19 @@ var GitHubIssuesSyncAdapter = class {
10578
10637
  if (changes.status !== void 0) {
10579
10638
  const externalStatus = this.config.statusMap[changes.status];
10580
10639
  patch.state = externalStatus;
10581
- patch.labels = labelsForStatus(changes.status, this.config);
10640
+ patch.labels = [...labelsForStatus(changes.status, this.config), "feature"];
10641
+ }
10642
+ if (changes.assignee !== void 0) {
10643
+ if (changes.assignee) {
10644
+ const login = changes.assignee.startsWith("@") ? changes.assignee.slice(1) : changes.assignee;
10645
+ patch.assignees = [login];
10646
+ } else {
10647
+ patch.assignees = [];
10648
+ }
10649
+ }
10650
+ if (milestone) {
10651
+ const milestoneId = await this.ensureMilestone(milestone);
10652
+ if (milestoneId) patch.milestone = milestoneId;
10582
10653
  }
10583
10654
  const response = await fetchWithRetry(
10584
10655
  this.fetchFn,
@@ -10700,8 +10771,16 @@ function emptySyncResult() {
10700
10771
  }
10701
10772
  async function syncToExternal(roadmap, adapter, _config) {
10702
10773
  const result = emptySyncResult();
10774
+ let defaultAssignee = null;
10775
+ const userResult = await adapter.getAuthenticatedUser();
10776
+ if (userResult.ok) {
10777
+ defaultAssignee = userResult.value;
10778
+ }
10703
10779
  for (const milestone of roadmap.milestones) {
10704
10780
  for (const feature of milestone.features) {
10781
+ if (!feature.assignee && defaultAssignee) {
10782
+ feature.assignee = defaultAssignee;
10783
+ }
10705
10784
  if (!feature.externalId) {
10706
10785
  const createResult = await adapter.createTicket(feature, milestone.name);
10707
10786
  if (createResult.ok) {
@@ -10711,7 +10790,11 @@ async function syncToExternal(roadmap, adapter, _config) {
10711
10790
  result.errors.push({ featureOrId: feature.name, error: createResult.error });
10712
10791
  }
10713
10792
  } else {
10714
- const updateResult = await adapter.updateTicket(feature.externalId, feature);
10793
+ const updateResult = await adapter.updateTicket(
10794
+ feature.externalId,
10795
+ feature,
10796
+ milestone.name
10797
+ );
10715
10798
  if (updateResult.ok) {
10716
10799
  result.updated.push(feature.externalId);
10717
10800
  } else {
@@ -9,17 +9,17 @@ declare const ViolationSchema: z.ZodObject<{
9
9
  detail: z.ZodString;
10
10
  severity: z.ZodEnum<["error", "warning"]>;
11
11
  }, "strip", z.ZodTypeAny, {
12
- file: string;
13
12
  id: string;
14
- severity: "error" | "warning";
13
+ file: string;
15
14
  detail: string;
16
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
15
+ severity: "error" | "warning";
16
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
17
17
  }, {
18
- file: string;
19
18
  id: string;
20
- severity: "error" | "warning";
19
+ file: string;
21
20
  detail: string;
22
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
21
+ severity: "error" | "warning";
22
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
23
23
  }>;
24
24
  type Violation = z.infer<typeof ViolationSchema>;
25
25
  declare const MetricResultSchema: z.ZodObject<{
@@ -33,41 +33,41 @@ declare const MetricResultSchema: z.ZodObject<{
33
33
  detail: z.ZodString;
34
34
  severity: z.ZodEnum<["error", "warning"]>;
35
35
  }, "strip", z.ZodTypeAny, {
36
- file: string;
37
36
  id: string;
38
- severity: "error" | "warning";
37
+ file: string;
39
38
  detail: string;
40
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
39
+ severity: "error" | "warning";
40
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
41
41
  }, {
42
- file: string;
43
42
  id: string;
44
- severity: "error" | "warning";
43
+ file: string;
45
44
  detail: string;
46
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
45
+ severity: "error" | "warning";
46
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
47
47
  }>, "many">;
48
48
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
49
49
  }, "strip", z.ZodTypeAny, {
50
50
  value: number;
51
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
51
52
  scope: string;
52
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
53
53
  violations: {
54
- file: string;
55
54
  id: string;
56
- severity: "error" | "warning";
55
+ file: string;
57
56
  detail: string;
58
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
57
+ severity: "error" | "warning";
58
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
59
59
  }[];
60
60
  metadata?: Record<string, unknown> | undefined;
61
61
  }, {
62
62
  value: number;
63
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
63
64
  scope: string;
64
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
65
65
  violations: {
66
- file: string;
67
66
  id: string;
68
- severity: "error" | "warning";
67
+ file: string;
69
68
  detail: string;
70
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
69
+ severity: "error" | "warning";
70
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
71
71
  }[];
72
72
  metadata?: Record<string, unknown> | undefined;
73
73
  }>;
@@ -101,7 +101,7 @@ declare const ArchBaselineSchema: z.ZodObject<{
101
101
  version: 1;
102
102
  updatedAt: string;
103
103
  updatedFrom: string;
104
- metrics: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", {
104
+ metrics: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", {
105
105
  value: number;
106
106
  violationIds: string[];
107
107
  }>>;
@@ -109,7 +109,7 @@ declare const ArchBaselineSchema: z.ZodObject<{
109
109
  version: 1;
110
110
  updatedAt: string;
111
111
  updatedFrom: string;
112
- metrics: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", {
112
+ metrics: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", {
113
113
  value: number;
114
114
  violationIds: string[];
115
115
  }>>;
@@ -121,12 +121,12 @@ declare const CategoryRegressionSchema: z.ZodObject<{
121
121
  currentValue: z.ZodNumber;
122
122
  delta: z.ZodNumber;
123
123
  }, "strip", z.ZodTypeAny, {
124
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
124
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
125
125
  baselineValue: number;
126
126
  currentValue: number;
127
127
  delta: number;
128
128
  }, {
129
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
129
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
130
130
  baselineValue: number;
131
131
  currentValue: number;
132
132
  delta: number;
@@ -141,17 +141,17 @@ declare const ArchDiffResultSchema: z.ZodObject<{
141
141
  detail: z.ZodString;
142
142
  severity: z.ZodEnum<["error", "warning"]>;
143
143
  }, "strip", z.ZodTypeAny, {
144
- file: string;
145
144
  id: string;
146
- severity: "error" | "warning";
145
+ file: string;
147
146
  detail: string;
148
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
147
+ severity: "error" | "warning";
148
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
149
149
  }, {
150
- file: string;
151
150
  id: string;
152
- severity: "error" | "warning";
151
+ file: string;
153
152
  detail: string;
154
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
153
+ severity: "error" | "warning";
154
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
155
155
  }>, "many">;
156
156
  resolvedViolations: z.ZodArray<z.ZodString, "many">;
157
157
  preExisting: z.ZodArray<z.ZodString, "many">;
@@ -161,12 +161,12 @@ declare const ArchDiffResultSchema: z.ZodObject<{
161
161
  currentValue: z.ZodNumber;
162
162
  delta: z.ZodNumber;
163
163
  }, "strip", z.ZodTypeAny, {
164
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
164
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
165
165
  baselineValue: number;
166
166
  currentValue: number;
167
167
  delta: number;
168
168
  }, {
169
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
169
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
170
170
  baselineValue: number;
171
171
  currentValue: number;
172
172
  delta: number;
@@ -174,16 +174,16 @@ declare const ArchDiffResultSchema: z.ZodObject<{
174
174
  }, "strip", z.ZodTypeAny, {
175
175
  passed: boolean;
176
176
  newViolations: {
177
- file: string;
178
177
  id: string;
179
- severity: "error" | "warning";
178
+ file: string;
180
179
  detail: string;
181
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
180
+ severity: "error" | "warning";
181
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
182
182
  }[];
183
183
  resolvedViolations: string[];
184
184
  preExisting: string[];
185
185
  regressions: {
186
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
186
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
187
187
  baselineValue: number;
188
188
  currentValue: number;
189
189
  delta: number;
@@ -191,16 +191,16 @@ declare const ArchDiffResultSchema: z.ZodObject<{
191
191
  }, {
192
192
  passed: boolean;
193
193
  newViolations: {
194
- file: string;
195
194
  id: string;
196
- severity: "error" | "warning";
195
+ file: string;
197
196
  detail: string;
198
- category?: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
197
+ severity: "error" | "warning";
198
+ category?: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth" | undefined;
199
199
  }[];
200
200
  resolvedViolations: string[];
201
201
  preExisting: string[];
202
202
  regressions: {
203
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
203
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
204
204
  baselineValue: number;
205
205
  currentValue: number;
206
206
  delta: number;
@@ -215,15 +215,15 @@ declare const ArchConfigSchema: z.ZodObject<{
215
215
  thresholds: z.ZodDefault<z.ZodRecord<z.ZodEnum<["circular-deps", "layer-violations", "complexity", "coupling", "forbidden-imports", "module-size", "dependency-depth"]>, z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>>;
216
216
  modules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<["circular-deps", "layer-violations", "complexity", "coupling", "forbidden-imports", "module-size", "dependency-depth"]>, z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>>>;
217
217
  }, "strip", z.ZodTypeAny, {
218
- thresholds: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
219
- modules: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
220
218
  enabled: boolean;
221
219
  baselinePath: string;
220
+ thresholds: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
221
+ modules: Record<string, Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
222
222
  }, {
223
- thresholds?: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
224
- modules?: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
225
223
  enabled?: boolean | undefined;
226
224
  baselinePath?: string | undefined;
225
+ thresholds?: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
226
+ modules?: Record<string, Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
227
227
  }>;
228
228
  type ArchConfig = z.infer<typeof ArchConfigSchema>;
229
229
  declare const ConstraintRuleSchema: z.ZodObject<{
@@ -233,16 +233,16 @@ declare const ConstraintRuleSchema: z.ZodObject<{
233
233
  scope: z.ZodString;
234
234
  targets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
235
235
  }, "strip", z.ZodTypeAny, {
236
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
236
237
  scope: string;
237
238
  id: string;
238
239
  description: string;
239
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
240
240
  targets?: string[] | undefined;
241
241
  }, {
242
+ category: "circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth";
242
243
  scope: string;
243
244
  id: string;
244
245
  description: string;
245
- category: "complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth";
246
246
  targets?: string[] | undefined;
247
247
  }>;
248
248
  type ConstraintRule = z.infer<typeof ConstraintRuleSchema>;