@codedrifters/configulator 0.0.190 → 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.
package/lib/index.mjs CHANGED
@@ -1392,7 +1392,29 @@ var meetingAnalysisBundle = {
1392
1392
  }
1393
1393
  ],
1394
1394
  skills: [processMeetingSkill],
1395
- subAgents: [meetingAnalystSubAgent]
1395
+ subAgents: [meetingAnalystSubAgent],
1396
+ labels: [
1397
+ {
1398
+ name: "meeting:extract",
1399
+ color: "C5DEF5",
1400
+ description: "Phase 1: raw extraction from a meeting transcript"
1401
+ },
1402
+ {
1403
+ name: "meeting:notes",
1404
+ color: "BFDADC",
1405
+ description: "Phase 2: curated notes derived from an extraction"
1406
+ },
1407
+ {
1408
+ name: "meeting:draft",
1409
+ color: "D4C5F9",
1410
+ description: "Phase 3: draft follow-up issues proposed from notes"
1411
+ },
1412
+ {
1413
+ name: "meeting:link",
1414
+ color: "FEF2C0",
1415
+ description: "Phase 4: linking/reconciling drafted issues with existing work"
1416
+ }
1417
+ ]
1396
1418
  };
1397
1419
 
1398
1420
  // src/agent/bundles/orchestrator.ts
@@ -1924,6 +1946,21 @@ var issueWorkerSubAgent = {
1924
1946
  "",
1925
1947
  "---",
1926
1948
  "",
1949
+ "## Invocation Mode",
1950
+ "",
1951
+ "You operate in one of two modes:",
1952
+ "",
1953
+ "- **Interactive mode (default):** A human invoked you directly. You must",
1954
+ " pause and request explicit user approval before committing code (Phase 6).",
1955
+ "- **Scheduled mode:** A scheduled task or automation invoked you. You commit,",
1956
+ " push, and open the PR autonomously without pausing.",
1957
+ "",
1958
+ "**You are in scheduled mode if and only if the invocation prompt that",
1959
+ "started this session contains the literal phrase `scheduled mode` (or",
1960
+ "`non-interactive`).** Otherwise, default to interactive mode. When in",
1961
+ "doubt, treat the session as interactive \u2014 pausing for approval is always",
1962
+ "safe; committing without approval is not.",
1963
+ "",
1927
1964
  "## Phase 1: Select an Issue",
1928
1965
  "",
1929
1966
  "If an issue number was provided in your instructions, use that issue.",
@@ -2009,6 +2046,22 @@ var issueWorkerSubAgent = {
2009
2046
  "",
2010
2047
  "## Phase 6: Commit and Push",
2011
2048
  "",
2049
+ "**If you are in interactive mode, pause here.** Before running any `git",
2050
+ "commit`, present the user with a summary of the proposed changes:",
2051
+ "",
2052
+ "```bash",
2053
+ "git status",
2054
+ "git diff --stat",
2055
+ "```",
2056
+ "",
2057
+ "Then state the conventional commit message you intend to use and ask for",
2058
+ "explicit approval to commit, push, and open the PR. Do **not** proceed to",
2059
+ "`git commit` until the user replies with an affirmative response (e.g.,",
2060
+ '"yes", "approved", "go ahead"). If the user requests changes, address',
2061
+ "them and ask again.",
2062
+ "",
2063
+ "**If you are in scheduled mode, skip the pause and proceed directly.**",
2064
+ "",
2012
2065
  "Use conventional commit messages:",
2013
2066
  "```bash",
2014
2067
  "git add <files>",
@@ -2038,6 +2091,27 @@ var issueWorkerSubAgent = {
2038
2091
  'gh issue edit <number> --remove-label "status:in-progress" --add-label "status:done"',
2039
2092
  "```",
2040
2093
  "",
2094
+ "## Phase 9: Branch Cleanup",
2095
+ "",
2096
+ "Auto-merge is enabled, so the PR may not be merged yet. Poll the PR state",
2097
+ "up to 10 times, waiting 30 seconds between polls, until it either merges,",
2098
+ "closes, or the timeout is reached:",
2099
+ "",
2100
+ "```bash",
2101
+ "gh pr view <pr-number> --json state --jq '.state'",
2102
+ "```",
2103
+ "",
2104
+ "- **If the state becomes `MERGED`:** clean up the local branch.",
2105
+ " ```bash",
2106
+ " git checkout {{repository.defaultBranch}}",
2107
+ " git pull origin {{repository.defaultBranch}}",
2108
+ " git branch -D <branch-name>",
2109
+ " ```",
2110
+ "- **If the state becomes `CLOSED` (not merged):** leave the branch in place",
2111
+ " and report that the PR was closed without merging. Do not delete the branch.",
2112
+ "- **If still `OPEN` after the polling window:** report that auto-merge is",
2113
+ " still pending and stop. Do not delete the branch.",
2114
+ "",
2041
2115
  "---",
2042
2116
  "",
2043
2117
  "## Rules",
@@ -3920,6 +3994,39 @@ var AgentConfig = class _AgentConfig extends Component8 {
3920
3994
  super(project);
3921
3995
  this.options = options;
3922
3996
  }
3997
+ /**
3998
+ * Returns the bundles that are active for this project: auto-detected
3999
+ * bundles (when `autoDetectBundles !== false`) plus force-included
4000
+ * bundles, minus explicitly excluded bundles. Deduplicated by name.
4001
+ *
4002
+ * Exposed so sibling components (e.g. the sync-labels workflow) can
4003
+ * consume bundle-contributed configuration.
4004
+ */
4005
+ get activeBundles() {
4006
+ const bundleMap = /* @__PURE__ */ new Map();
4007
+ if (this.options.autoDetectBundles !== false) {
4008
+ for (const bundle of BUILT_IN_BUNDLES) {
4009
+ if (this.options.excludeBundles?.includes(bundle.name)) {
4010
+ continue;
4011
+ }
4012
+ if (bundle.name === "base" && this.options.includeBaseRules === false) {
4013
+ continue;
4014
+ }
4015
+ if (bundle.appliesWhen(this.project)) {
4016
+ bundleMap.set(bundle.name, bundle);
4017
+ }
4018
+ }
4019
+ }
4020
+ if (this.options.includeBundles) {
4021
+ for (const bundleName of this.options.includeBundles) {
4022
+ const bundle = BUILT_IN_BUNDLES.find((b) => b.name === bundleName);
4023
+ if (bundle) {
4024
+ bundleMap.set(bundle.name, bundle);
4025
+ }
4026
+ }
4027
+ }
4028
+ return [...bundleMap.values()];
4029
+ }
3923
4030
  preSynthesize() {
3924
4031
  super.preSynthesize();
3925
4032
  const platforms = this.resolvePlatforms();
@@ -5192,12 +5299,25 @@ var LABELS_CONFIG_PATH = ".github/labels.yml";
5192
5299
  function addSyncLabelsWorkflow(project, options) {
5193
5300
  const workflowName = options.workflowName ?? DEFAULT_WORKFLOW_NAME2;
5194
5301
  const deleteOtherLabels = options.deleteOtherLabels ?? true;
5195
- const allLabels = [
5196
- ...DEFAULT_STATUS_LABELS,
5197
- ...DEFAULT_PRIORITY_LABELS,
5198
- ...DEFAULT_TYPE_LABELS,
5199
- ...options.labels ?? []
5200
- ];
5302
+ const labelMap = /* @__PURE__ */ new Map();
5303
+ for (const label of DEFAULT_STATUS_LABELS) {
5304
+ labelMap.set(label.name, label);
5305
+ }
5306
+ for (const label of DEFAULT_PRIORITY_LABELS) {
5307
+ labelMap.set(label.name, label);
5308
+ }
5309
+ for (const label of DEFAULT_TYPE_LABELS) {
5310
+ labelMap.set(label.name, label);
5311
+ }
5312
+ for (const bundle of options.bundles ?? []) {
5313
+ for (const label of bundle.labels ?? []) {
5314
+ labelMap.set(label.name, label);
5315
+ }
5316
+ }
5317
+ for (const label of options.labels ?? []) {
5318
+ labelMap.set(label.name, label);
5319
+ }
5320
+ const allLabels = [...labelMap.values()];
5201
5321
  new LabelsFile(project, allLabels);
5202
5322
  const workflow = project.github?.addWorkflow(workflowName);
5203
5323
  if (!workflow) {
@@ -5500,10 +5620,12 @@ var MonorepoProject = class extends TypeScriptAppProject {
5500
5620
  );
5501
5621
  }
5502
5622
  if (options.syncLabels !== false) {
5503
- addSyncLabelsWorkflow(
5504
- this,
5505
- typeof options.syncLabels === "object" ? options.syncLabels : {}
5506
- );
5623
+ const syncLabelsOptions = typeof options.syncLabels === "object" ? options.syncLabels : {};
5624
+ const agentConfig = AgentConfig.of(this);
5625
+ addSyncLabelsWorkflow(this, {
5626
+ ...syncLabelsOptions,
5627
+ bundles: syncLabelsOptions.bundles ?? agentConfig?.activeBundles
5628
+ });
5507
5629
  }
5508
5630
  if (this.buildWorkflow) {
5509
5631
  addBuildCompleteJob(this.buildWorkflow);