@codedrifters/configulator 0.0.191 → 0.0.192

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.
@@ -0,0 +1,138 @@
1
+ # Label Taxonomy Ownership
2
+
3
+ Configulator synthesizes a canonical GitHub label set for every consuming
4
+ project via the sync-labels workflow. This document defines **who owns
5
+ which label families** so the taxonomy stays coherent as more agent
6
+ bundles are ported.
7
+
8
+ ## Three ownership tiers
9
+
10
+ Labels fall into one of three tiers based on who is responsible for
11
+ defining them, maintaining their colors and descriptions, and keeping
12
+ them in sync with the agent rules that depend on them.
13
+
14
+ ### Tier 1 — Configulator core labels
15
+
16
+ Defined statically in `src/workflows/sync-labels.ts` and applied to
17
+ every project that uses `addSyncLabelsWorkflow`. These are the labels
18
+ that the orchestrator, issue-worker, and PR automation depend on
19
+ regardless of which specific agent bundles a project enables.
20
+
21
+ Families in this tier:
22
+
23
+ - **`status:*`** — workflow state (`ready`, `in-progress`, `blocked`,
24
+ `done`, `deferred`, `needs-attention`). Required by every agent that
25
+ transitions issues through the workflow.
26
+ - **`priority:*`** — scheduling priority (`critical`, `high`, `medium`,
27
+ `low`, `trivial`). Required by the orchestrator to sequence work.
28
+ - **`type:*`** — conventional-commit work type (`feat`, `fix`, `docs`,
29
+ `chore`, `refactor`, `style`, `perf`, `test`, `build`, `ci`,
30
+ `revert`, `release`, `hotfix`). Matches the PR title convention so
31
+ automation can derive one from the other.
32
+
33
+ These are exported as `DEFAULT_STATUS_LABELS`, `DEFAULT_PRIORITY_LABELS`,
34
+ and `DEFAULT_TYPE_LABELS` and are always merged in.
35
+
36
+ ### Tier 2 — Agent-bundle labels
37
+
38
+ Owned by the individual agent bundle that depends on them. A bundle
39
+ should contribute only the labels its rules reference — typically a
40
+ small family of phase labels used by a multi-phase workflow.
41
+
42
+ Examples seen in the vortex reference taxonomy:
43
+
44
+ - `meeting:extract`, `meeting:notes`, `meeting:draft`, `meeting:link`
45
+ — owned by the meeting-analysis bundle
46
+ - `research:scope`, `research:search`, `research:synthesize`,
47
+ `research:verify` — owned by a research-pipeline bundle
48
+ - `bcm:outline`, `bcm:scaffold`, `bcm:context`, `bcm:connect` —
49
+ owned by a bcm-writer bundle
50
+
51
+ Bundle-contributed labels are scoped: a project that does not enable
52
+ the meeting-analysis bundle does not get `meeting:*` labels. This
53
+ keeps the label list per-project aligned with the workflows that
54
+ project actually runs.
55
+
56
+ A bundle declares its labels via the optional `labels` field on the
57
+ `AgentRuleBundle` interface. When `AgentConfig` is enabled on a
58
+ project, `addSyncLabelsWorkflow` merges labels from every active
59
+ bundle into `.github/labels.yml` automatically.
60
+
61
+ ```ts
62
+ export const meetingAnalysisBundle: AgentRuleBundle = {
63
+ name: "meeting-analysis",
64
+ // ...
65
+ labels: [
66
+ { name: "meeting:extract", color: "C5DEF5", description: "..." },
67
+ { name: "meeting:notes", color: "BFDADC", description: "..." },
68
+ { name: "meeting:draft", color: "D4C5F9", description: "..." },
69
+ { name: "meeting:link", color: "FEF2C0", description: "..." },
70
+ ],
71
+ };
72
+ ```
73
+
74
+ Consumers can still override a bundle-contributed label's color or
75
+ description by supplying the same label name via
76
+ `SyncLabelsOptions.labels` — the consumer entry wins.
77
+
78
+ ### Tier 3 — Consumer-project labels
79
+
80
+ Owned by the end project. These are domain-specific categories
81
+ configulator cannot reasonably predict. Examples from the vortex
82
+ reference project:
83
+
84
+ - `area:requirements`, `area:business-strategy`, `area:references`,
85
+ `area:product`, `area:architecture` — area labels tied to a
86
+ directory layout unique to that project
87
+
88
+ Consumers add these through the `labels` option on
89
+ `addSyncLabelsWorkflow` / `SyncLabelsOptions.labels`.
90
+
91
+ ## How the tiers compose
92
+
93
+ At synth time, the final label set written to `.github/labels.yml` is:
94
+
95
+ ```
96
+ DEFAULT_STATUS_LABELS
97
+ ∪ DEFAULT_PRIORITY_LABELS
98
+ ∪ DEFAULT_TYPE_LABELS
99
+ ∪ (labels contributed by enabled agent bundles)
100
+ ∪ (labels provided by the consumer via options)
101
+ ```
102
+
103
+ The sync-labels workflow then reconciles this set against the live
104
+ repo — creating missing labels, updating colors/descriptions, and
105
+ (if `deleteOtherLabels` is true, the default) removing any label that
106
+ is not in the file.
107
+
108
+ ## Naming conventions
109
+
110
+ - Use lowercase, kebab-case label names.
111
+ - Use a family prefix followed by a colon: `family:name` (e.g.
112
+ `status:ready`, `meeting:extract`).
113
+ - Keep descriptions short and action-oriented — they appear in the
114
+ GitHub UI dropdown when applying labels.
115
+ - Pick distinct hex colors within a family so labels are scannable in
116
+ the issue list. Related families (e.g. all `research:*`) should
117
+ share a color gradient.
118
+
119
+ ## When to add a new label family
120
+
121
+ Before adding a new family, check whether an existing one covers the
122
+ intent:
123
+
124
+ - Workflow state → `status:*`
125
+ - Scheduling order → `priority:*`
126
+ - Kind of change → `type:*`
127
+
128
+ A new family is warranted when it cross-cuts the existing ones and
129
+ is required by a specific agent's rules — for example, phase labels
130
+ that track which micro-session of a multi-phase agent an issue
131
+ belongs to.
132
+
133
+ ## See also
134
+
135
+ - `docs/audits/label-audit-308.md` — initial audit of configulator
136
+ labels against the vortex reference taxonomy
137
+ - `src/workflows/sync-labels.ts` — source of truth for the Tier 1
138
+ default labels
package/lib/index.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { Component, Project as Project$1, typescript } from 'projen';
2
2
  import { Project, Component as Component$1, Task } from 'projen/lib';
3
+ import { NodeProject } from 'projen/lib/javascript';
3
4
  import { AwsCdkTypeScriptApp } from 'projen/lib/awscdk';
4
5
  import { AwsStageType, DeploymentTargetRoleType, AwsEnvironmentType, AWS_STAGE_TYPE } from '@codedrifters/utils';
5
6
  import * as spec from '@jsii/spec';
6
7
  import { TypeScriptProject as TypeScriptProject$1, TypeScriptAppProject, TypeScriptProjectOptions as TypeScriptProjectOptions$1 } from 'projen/lib/typescript';
7
8
  import { ValueOf } from 'type-fest';
8
9
  import { BuildWorkflowOptions, BuildWorkflow } from 'projen/lib/build';
9
- import { NodeProject } from 'projen/lib/javascript';
10
10
  import { JobStep } from 'projen/lib/github/workflows-model';
11
11
 
12
12
  /**
@@ -390,6 +390,56 @@ interface McpServerConfig {
390
390
  readonly disabledTools?: ReadonlyArray<string>;
391
391
  }
392
392
 
393
+ /** A single GitHub label definition for EndBug/label-sync. */
394
+ interface LabelDefinition {
395
+ /** Label name (e.g. "priority:high"). */
396
+ readonly name: string;
397
+ /** Hex color without the leading `#` (e.g. "B60205"). */
398
+ readonly color: string;
399
+ /** Short description shown in the GitHub UI. */
400
+ readonly description: string;
401
+ }
402
+ /** Options for the sync-labels workflow and labels config file. */
403
+ interface SyncLabelsOptions {
404
+ /**
405
+ * Additional labels to sync alongside the standard defaults.
406
+ * Merged with DEFAULT_STATUS_LABELS, DEFAULT_PRIORITY_LABELS, and
407
+ * DEFAULT_TYPE_LABELS (standard labels are always included).
408
+ */
409
+ readonly labels?: ReadonlyArray<LabelDefinition>;
410
+ /**
411
+ * Remove labels from the repo that are not in the config file.
412
+ * @default true
413
+ */
414
+ readonly deleteOtherLabels?: boolean;
415
+ /**
416
+ * Workflow file name (display name in the Actions tab).
417
+ * @default "sync-labels"
418
+ */
419
+ readonly workflowName?: string;
420
+ /**
421
+ * Agent bundles whose contributed labels should be merged into
422
+ * `.github/labels.yml`. Typically populated by the project type from
423
+ * `AgentConfig.of(project)?.activeBundles` so bundle-supplied labels
424
+ * only appear when the bundle is actually enabled.
425
+ *
426
+ * Merge order: Tier 1 defaults → bundle labels → user-supplied `labels`
427
+ * (later entries override earlier ones on name collision).
428
+ */
429
+ readonly bundles?: ReadonlyArray<AgentRuleBundle>;
430
+ }
431
+ /** Default status labels. */
432
+ declare const DEFAULT_STATUS_LABELS: ReadonlyArray<LabelDefinition>;
433
+ /** Default priority labels. */
434
+ declare const DEFAULT_PRIORITY_LABELS: ReadonlyArray<LabelDefinition>;
435
+ /** Default type labels — one per conventional commit type. */
436
+ declare const DEFAULT_TYPE_LABELS: ReadonlyArray<LabelDefinition>;
437
+ /**
438
+ * Adds a labels config file and a GitHub Actions workflow that syncs
439
+ * labels to the repository using EndBug/label-sync.
440
+ */
441
+ declare function addSyncLabelsWorkflow(project: NodeProject, options: SyncLabelsOptions): void;
442
+
393
443
  /*******************************************************************************
394
444
  *
395
445
  * Agent Rule Bundle
@@ -448,6 +498,15 @@ interface AgentRuleBundle {
448
498
  readonly allow?: ReadonlyArray<string>;
449
499
  readonly deny?: ReadonlyArray<string>;
450
500
  };
501
+ /**
502
+ * GitHub labels contributed by this bundle. When the bundle is active in a
503
+ * project that also uses the sync-labels workflow, these labels are merged
504
+ * into `.github/labels.yml` alongside the Tier 1 defaults.
505
+ *
506
+ * User-supplied labels (via `SyncLabelsOptions.labels`) override bundle
507
+ * labels on name collision.
508
+ */
509
+ readonly labels?: ReadonlyArray<LabelDefinition>;
451
510
  }
452
511
  /*******************************************************************************
453
512
  *
@@ -882,6 +941,15 @@ declare class AgentConfig extends Component {
882
941
  private static mergeClaudeDefaults;
883
942
  private readonly options;
884
943
  constructor(project: Project$1, options?: AgentConfigOptions);
944
+ /**
945
+ * Returns the bundles that are active for this project: auto-detected
946
+ * bundles (when `autoDetectBundles !== false`) plus force-included
947
+ * bundles, minus explicitly excluded bundles. Deduplicated by name.
948
+ *
949
+ * Exposed so sibling components (e.g. the sync-labels workflow) can
950
+ * consume bundle-contributed configuration.
951
+ */
952
+ get activeBundles(): ReadonlyArray<AgentRuleBundle>;
885
953
  preSynthesize(): void;
886
954
  private resolvePlatforms;
887
955
  private resolveRules;
@@ -2507,46 +2575,6 @@ interface ApproveMergeUpgradeOptions {
2507
2575
  */
2508
2576
  declare function addApproveMergeUpgradeWorkflow(project: NodeProject, options: ApproveMergeUpgradeOptions): void;
2509
2577
 
2510
- /** A single GitHub label definition for EndBug/label-sync. */
2511
- interface LabelDefinition {
2512
- /** Label name (e.g. "priority:high"). */
2513
- readonly name: string;
2514
- /** Hex color without the leading `#` (e.g. "B60205"). */
2515
- readonly color: string;
2516
- /** Short description shown in the GitHub UI. */
2517
- readonly description: string;
2518
- }
2519
- /** Options for the sync-labels workflow and labels config file. */
2520
- interface SyncLabelsOptions {
2521
- /**
2522
- * Additional labels to sync alongside the standard defaults.
2523
- * Merged with DEFAULT_STATUS_LABELS, DEFAULT_PRIORITY_LABELS, and
2524
- * DEFAULT_TYPE_LABELS (standard labels are always included).
2525
- */
2526
- readonly labels?: ReadonlyArray<LabelDefinition>;
2527
- /**
2528
- * Remove labels from the repo that are not in the config file.
2529
- * @default true
2530
- */
2531
- readonly deleteOtherLabels?: boolean;
2532
- /**
2533
- * Workflow file name (display name in the Actions tab).
2534
- * @default "sync-labels"
2535
- */
2536
- readonly workflowName?: string;
2537
- }
2538
- /** Default status labels. */
2539
- declare const DEFAULT_STATUS_LABELS: ReadonlyArray<LabelDefinition>;
2540
- /** Default priority labels. */
2541
- declare const DEFAULT_PRIORITY_LABELS: ReadonlyArray<LabelDefinition>;
2542
- /** Default type labels — one per conventional commit type. */
2543
- declare const DEFAULT_TYPE_LABELS: ReadonlyArray<LabelDefinition>;
2544
- /**
2545
- * Adds a labels config file and a GitHub Actions workflow that syncs
2546
- * labels to the repository using EndBug/label-sync.
2547
- */
2548
- declare function addSyncLabelsWorkflow(project: NodeProject, options: SyncLabelsOptions): void;
2549
-
2550
2578
  /*******************************************************************************
2551
2579
  *
2552
2580
  * Monorepo Root Project.
package/lib/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { Component, Project, typescript } from 'projen';
2
2
  import { Project as Project$1, Task, Component as Component$1 } from 'projen/lib';
3
+ import { NodeProject } from 'projen/lib/javascript';
3
4
  import { AwsCdkTypeScriptApp } from 'projen/lib/awscdk';
4
5
  import * as spec from '@jsii/spec';
5
6
  import { TypeScriptProject as TypeScriptProject$1, TypeScriptAppProject, TypeScriptProjectOptions as TypeScriptProjectOptions$1 } from 'projen/lib/typescript';
6
7
  import { ValueOf } from 'type-fest';
7
8
  import { BuildWorkflow, BuildWorkflowOptions } from 'projen/lib/build';
8
- import { NodeProject } from 'projen/lib/javascript';
9
9
  import { JobStep } from 'projen/lib/github/workflows-model';
10
10
 
11
11
  /**
@@ -439,6 +439,56 @@ interface McpServerConfig {
439
439
  readonly disabledTools?: ReadonlyArray<string>;
440
440
  }
441
441
 
442
+ /** A single GitHub label definition for EndBug/label-sync. */
443
+ interface LabelDefinition {
444
+ /** Label name (e.g. "priority:high"). */
445
+ readonly name: string;
446
+ /** Hex color without the leading `#` (e.g. "B60205"). */
447
+ readonly color: string;
448
+ /** Short description shown in the GitHub UI. */
449
+ readonly description: string;
450
+ }
451
+ /** Options for the sync-labels workflow and labels config file. */
452
+ interface SyncLabelsOptions {
453
+ /**
454
+ * Additional labels to sync alongside the standard defaults.
455
+ * Merged with DEFAULT_STATUS_LABELS, DEFAULT_PRIORITY_LABELS, and
456
+ * DEFAULT_TYPE_LABELS (standard labels are always included).
457
+ */
458
+ readonly labels?: ReadonlyArray<LabelDefinition>;
459
+ /**
460
+ * Remove labels from the repo that are not in the config file.
461
+ * @default true
462
+ */
463
+ readonly deleteOtherLabels?: boolean;
464
+ /**
465
+ * Workflow file name (display name in the Actions tab).
466
+ * @default "sync-labels"
467
+ */
468
+ readonly workflowName?: string;
469
+ /**
470
+ * Agent bundles whose contributed labels should be merged into
471
+ * `.github/labels.yml`. Typically populated by the project type from
472
+ * `AgentConfig.of(project)?.activeBundles` so bundle-supplied labels
473
+ * only appear when the bundle is actually enabled.
474
+ *
475
+ * Merge order: Tier 1 defaults → bundle labels → user-supplied `labels`
476
+ * (later entries override earlier ones on name collision).
477
+ */
478
+ readonly bundles?: ReadonlyArray<AgentRuleBundle>;
479
+ }
480
+ /** Default status labels. */
481
+ declare const DEFAULT_STATUS_LABELS: ReadonlyArray<LabelDefinition>;
482
+ /** Default priority labels. */
483
+ declare const DEFAULT_PRIORITY_LABELS: ReadonlyArray<LabelDefinition>;
484
+ /** Default type labels — one per conventional commit type. */
485
+ declare const DEFAULT_TYPE_LABELS: ReadonlyArray<LabelDefinition>;
486
+ /**
487
+ * Adds a labels config file and a GitHub Actions workflow that syncs
488
+ * labels to the repository using EndBug/label-sync.
489
+ */
490
+ declare function addSyncLabelsWorkflow(project: NodeProject, options: SyncLabelsOptions): void;
491
+
442
492
  /*******************************************************************************
443
493
  *
444
494
  * Agent Rule Bundle
@@ -497,6 +547,15 @@ interface AgentRuleBundle {
497
547
  readonly allow?: ReadonlyArray<string>;
498
548
  readonly deny?: ReadonlyArray<string>;
499
549
  };
550
+ /**
551
+ * GitHub labels contributed by this bundle. When the bundle is active in a
552
+ * project that also uses the sync-labels workflow, these labels are merged
553
+ * into `.github/labels.yml` alongside the Tier 1 defaults.
554
+ *
555
+ * User-supplied labels (via `SyncLabelsOptions.labels`) override bundle
556
+ * labels on name collision.
557
+ */
558
+ readonly labels?: ReadonlyArray<LabelDefinition>;
500
559
  }
501
560
  /*******************************************************************************
502
561
  *
@@ -931,6 +990,15 @@ declare class AgentConfig extends Component {
931
990
  private static mergeClaudeDefaults;
932
991
  private readonly options;
933
992
  constructor(project: Project, options?: AgentConfigOptions);
993
+ /**
994
+ * Returns the bundles that are active for this project: auto-detected
995
+ * bundles (when `autoDetectBundles !== false`) plus force-included
996
+ * bundles, minus explicitly excluded bundles. Deduplicated by name.
997
+ *
998
+ * Exposed so sibling components (e.g. the sync-labels workflow) can
999
+ * consume bundle-contributed configuration.
1000
+ */
1001
+ get activeBundles(): ReadonlyArray<AgentRuleBundle>;
934
1002
  preSynthesize(): void;
935
1003
  private resolvePlatforms;
936
1004
  private resolveRules;
@@ -2556,46 +2624,6 @@ interface ApproveMergeUpgradeOptions {
2556
2624
  */
2557
2625
  declare function addApproveMergeUpgradeWorkflow(project: NodeProject, options: ApproveMergeUpgradeOptions): void;
2558
2626
 
2559
- /** A single GitHub label definition for EndBug/label-sync. */
2560
- interface LabelDefinition {
2561
- /** Label name (e.g. "priority:high"). */
2562
- readonly name: string;
2563
- /** Hex color without the leading `#` (e.g. "B60205"). */
2564
- readonly color: string;
2565
- /** Short description shown in the GitHub UI. */
2566
- readonly description: string;
2567
- }
2568
- /** Options for the sync-labels workflow and labels config file. */
2569
- interface SyncLabelsOptions {
2570
- /**
2571
- * Additional labels to sync alongside the standard defaults.
2572
- * Merged with DEFAULT_STATUS_LABELS, DEFAULT_PRIORITY_LABELS, and
2573
- * DEFAULT_TYPE_LABELS (standard labels are always included).
2574
- */
2575
- readonly labels?: ReadonlyArray<LabelDefinition>;
2576
- /**
2577
- * Remove labels from the repo that are not in the config file.
2578
- * @default true
2579
- */
2580
- readonly deleteOtherLabels?: boolean;
2581
- /**
2582
- * Workflow file name (display name in the Actions tab).
2583
- * @default "sync-labels"
2584
- */
2585
- readonly workflowName?: string;
2586
- }
2587
- /** Default status labels. */
2588
- declare const DEFAULT_STATUS_LABELS: ReadonlyArray<LabelDefinition>;
2589
- /** Default priority labels. */
2590
- declare const DEFAULT_PRIORITY_LABELS: ReadonlyArray<LabelDefinition>;
2591
- /** Default type labels — one per conventional commit type. */
2592
- declare const DEFAULT_TYPE_LABELS: ReadonlyArray<LabelDefinition>;
2593
- /**
2594
- * Adds a labels config file and a GitHub Actions workflow that syncs
2595
- * labels to the repository using EndBug/label-sync.
2596
- */
2597
- declare function addSyncLabelsWorkflow(project: NodeProject, options: SyncLabelsOptions): void;
2598
-
2599
2627
  /*******************************************************************************
2600
2628
  *
2601
2629
  * Monorepo Root Project.
package/lib/index.js CHANGED
@@ -1451,7 +1451,29 @@ var meetingAnalysisBundle = {
1451
1451
  }
1452
1452
  ],
1453
1453
  skills: [processMeetingSkill],
1454
- subAgents: [meetingAnalystSubAgent]
1454
+ subAgents: [meetingAnalystSubAgent],
1455
+ labels: [
1456
+ {
1457
+ name: "meeting:extract",
1458
+ color: "C5DEF5",
1459
+ description: "Phase 1: raw extraction from a meeting transcript"
1460
+ },
1461
+ {
1462
+ name: "meeting:notes",
1463
+ color: "BFDADC",
1464
+ description: "Phase 2: curated notes derived from an extraction"
1465
+ },
1466
+ {
1467
+ name: "meeting:draft",
1468
+ color: "D4C5F9",
1469
+ description: "Phase 3: draft follow-up issues proposed from notes"
1470
+ },
1471
+ {
1472
+ name: "meeting:link",
1473
+ color: "FEF2C0",
1474
+ description: "Phase 4: linking/reconciling drafted issues with existing work"
1475
+ }
1476
+ ]
1455
1477
  };
1456
1478
 
1457
1479
  // src/agent/bundles/orchestrator.ts
@@ -4031,6 +4053,39 @@ var AgentConfig = class _AgentConfig extends import_projen8.Component {
4031
4053
  super(project);
4032
4054
  this.options = options;
4033
4055
  }
4056
+ /**
4057
+ * Returns the bundles that are active for this project: auto-detected
4058
+ * bundles (when `autoDetectBundles !== false`) plus force-included
4059
+ * bundles, minus explicitly excluded bundles. Deduplicated by name.
4060
+ *
4061
+ * Exposed so sibling components (e.g. the sync-labels workflow) can
4062
+ * consume bundle-contributed configuration.
4063
+ */
4064
+ get activeBundles() {
4065
+ const bundleMap = /* @__PURE__ */ new Map();
4066
+ if (this.options.autoDetectBundles !== false) {
4067
+ for (const bundle of BUILT_IN_BUNDLES) {
4068
+ if (this.options.excludeBundles?.includes(bundle.name)) {
4069
+ continue;
4070
+ }
4071
+ if (bundle.name === "base" && this.options.includeBaseRules === false) {
4072
+ continue;
4073
+ }
4074
+ if (bundle.appliesWhen(this.project)) {
4075
+ bundleMap.set(bundle.name, bundle);
4076
+ }
4077
+ }
4078
+ }
4079
+ if (this.options.includeBundles) {
4080
+ for (const bundleName of this.options.includeBundles) {
4081
+ const bundle = BUILT_IN_BUNDLES.find((b) => b.name === bundleName);
4082
+ if (bundle) {
4083
+ bundleMap.set(bundle.name, bundle);
4084
+ }
4085
+ }
4086
+ }
4087
+ return [...bundleMap.values()];
4088
+ }
4034
4089
  preSynthesize() {
4035
4090
  super.preSynthesize();
4036
4091
  const platforms = this.resolvePlatforms();
@@ -5294,12 +5349,25 @@ var LABELS_CONFIG_PATH = ".github/labels.yml";
5294
5349
  function addSyncLabelsWorkflow(project, options) {
5295
5350
  const workflowName = options.workflowName ?? DEFAULT_WORKFLOW_NAME2;
5296
5351
  const deleteOtherLabels = options.deleteOtherLabels ?? true;
5297
- const allLabels = [
5298
- ...DEFAULT_STATUS_LABELS,
5299
- ...DEFAULT_PRIORITY_LABELS,
5300
- ...DEFAULT_TYPE_LABELS,
5301
- ...options.labels ?? []
5302
- ];
5352
+ const labelMap = /* @__PURE__ */ new Map();
5353
+ for (const label of DEFAULT_STATUS_LABELS) {
5354
+ labelMap.set(label.name, label);
5355
+ }
5356
+ for (const label of DEFAULT_PRIORITY_LABELS) {
5357
+ labelMap.set(label.name, label);
5358
+ }
5359
+ for (const label of DEFAULT_TYPE_LABELS) {
5360
+ labelMap.set(label.name, label);
5361
+ }
5362
+ for (const bundle of options.bundles ?? []) {
5363
+ for (const label of bundle.labels ?? []) {
5364
+ labelMap.set(label.name, label);
5365
+ }
5366
+ }
5367
+ for (const label of options.labels ?? []) {
5368
+ labelMap.set(label.name, label);
5369
+ }
5370
+ const allLabels = [...labelMap.values()];
5303
5371
  new LabelsFile(project, allLabels);
5304
5372
  const workflow = project.github?.addWorkflow(workflowName);
5305
5373
  if (!workflow) {
@@ -5602,10 +5670,12 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
5602
5670
  );
5603
5671
  }
5604
5672
  if (options.syncLabels !== false) {
5605
- addSyncLabelsWorkflow(
5606
- this,
5607
- typeof options.syncLabels === "object" ? options.syncLabels : {}
5608
- );
5673
+ const syncLabelsOptions = typeof options.syncLabels === "object" ? options.syncLabels : {};
5674
+ const agentConfig = AgentConfig.of(this);
5675
+ addSyncLabelsWorkflow(this, {
5676
+ ...syncLabelsOptions,
5677
+ bundles: syncLabelsOptions.bundles ?? agentConfig?.activeBundles
5678
+ });
5609
5679
  }
5610
5680
  if (this.buildWorkflow) {
5611
5681
  addBuildCompleteJob(this.buildWorkflow);