@oss-autopilot/core 0.50.0 → 0.51.1

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.
@@ -754,18 +754,13 @@ export const commands = [
754
754
  .option('--json', 'Output as JSON')
755
755
  .action(async (prUrl, options) => {
756
756
  try {
757
- const { runShelve } = await import('./commands/shelve.js');
758
- const data = await runShelve({ prUrl });
757
+ const { runMove } = await import('./commands/move.js');
758
+ const data = await runMove({ prUrl, target: 'shelved' });
759
759
  if (options.json) {
760
760
  outputJson(data);
761
761
  }
762
- else if (data.shelved) {
763
- console.log(`Shelved: ${prUrl}`);
764
- console.log('This PR is now excluded from capacity and actionable issues.');
765
- console.log('It will auto-unshelve if a maintainer engages.');
766
- }
767
762
  else {
768
- console.log('PR is already shelved.');
763
+ console.log(data.description);
769
764
  }
770
765
  }
771
766
  catch (err) {
@@ -785,17 +780,39 @@ export const commands = [
785
780
  .option('--json', 'Output as JSON')
786
781
  .action(async (prUrl, options) => {
787
782
  try {
788
- const { runUnshelve } = await import('./commands/shelve.js');
789
- const data = await runUnshelve({ prUrl });
783
+ const { runMove } = await import('./commands/move.js');
784
+ const data = await runMove({ prUrl, target: 'auto' });
790
785
  if (options.json) {
791
786
  outputJson(data);
792
787
  }
793
- else if (data.unshelved) {
794
- console.log(`Unshelved: ${prUrl}`);
795
- console.log('This PR is now active again.');
788
+ else {
789
+ console.log(data.description);
790
+ }
791
+ }
792
+ catch (err) {
793
+ handleCommandError(err, options.json);
794
+ }
795
+ });
796
+ },
797
+ },
798
+ // ── Move ───────────────────────────────────────────────────────────
799
+ {
800
+ name: 'move',
801
+ localOnly: true,
802
+ register(program) {
803
+ program
804
+ .command('move <pr-url> <target>')
805
+ .description('Move a PR between states: attention, waiting, shelved, or auto (reset to computed)')
806
+ .option('--json', 'Output as JSON')
807
+ .action(async (prUrl, target, options) => {
808
+ try {
809
+ const { runMove } = await import('./commands/move.js');
810
+ const data = await runMove({ prUrl, target });
811
+ if (options.json) {
812
+ outputJson(data);
796
813
  }
797
814
  else {
798
- console.log('PR was not shelved.');
815
+ console.log(data.description);
799
816
  }
800
817
  }
801
818
  catch (err) {
@@ -811,7 +828,7 @@ export const commands = [
811
828
  register(program) {
812
829
  program
813
830
  .command('dismiss <url>')
814
- .description('Dismiss notifications for an issue or PR (resurfaces on new activity)')
831
+ .description('Dismiss notifications for an issue (resurfaces on new activity)')
815
832
  .option('--json', 'Output as JSON')
816
833
  .action(async (url, options) => {
817
834
  try {
@@ -842,7 +859,7 @@ export const commands = [
842
859
  register(program) {
843
860
  program
844
861
  .command('undismiss <url>')
845
- .description('Undismiss an issue or PR (re-enable notifications)')
862
+ .description('Undismiss an issue (re-enable notifications)')
846
863
  .option('--json', 'Output as JSON')
847
864
  .action(async (url, options) => {
848
865
  try {
@@ -865,78 +882,6 @@ export const commands = [
865
882
  });
866
883
  },
867
884
  },
868
- // ── Snooze ─────────────────────────────────────────────────────────────
869
- {
870
- name: 'snooze',
871
- localOnly: true,
872
- register(program) {
873
- program
874
- .command('snooze <pr-url>')
875
- .description('Snooze CI failure notifications for a PR')
876
- .requiredOption('--reason <reason>', 'Reason for snoozing (e.g., "upstream infrastructure issue")')
877
- .option('--days <days>', 'Number of days to snooze (default: 7)', '7')
878
- .option('--json', 'Output as JSON')
879
- .action(async (prUrl, options) => {
880
- try {
881
- const days = parseInt(options.days, 10);
882
- if (!Number.isFinite(days) || days < 1 || !Number.isInteger(days)) {
883
- throw new Error(`Invalid days value "${options.days}". Must be a positive integer.`);
884
- }
885
- const { runSnooze } = await import('./commands/snooze.js');
886
- const data = await runSnooze({ prUrl, reason: options.reason, days });
887
- if (options.json) {
888
- outputJson(data);
889
- }
890
- else if (data.snoozed) {
891
- console.log(`Snoozed: ${prUrl}`);
892
- console.log(`Reason: ${data.reason}`);
893
- console.log(`Duration: ${data.days} day${data.days === 1 ? '' : 's'}`);
894
- console.log(`Expires: ${data.expiresAt ? new Date(data.expiresAt).toLocaleString() : 'unknown'}`);
895
- console.log('CI failure notifications are now muted for this PR.');
896
- }
897
- else {
898
- console.log('PR is already snoozed.');
899
- if (data.expiresAt) {
900
- console.log(`Expires: ${new Date(data.expiresAt).toLocaleString()}`);
901
- }
902
- }
903
- }
904
- catch (err) {
905
- handleCommandError(err, options.json);
906
- }
907
- });
908
- },
909
- },
910
- // ── Unsnooze ───────────────────────────────────────────────────────────
911
- {
912
- name: 'unsnooze',
913
- localOnly: true,
914
- register(program) {
915
- program
916
- .command('unsnooze <pr-url>')
917
- .description('Unsnooze a PR (re-enable CI failure notifications)')
918
- .option('--json', 'Output as JSON')
919
- .action(async (prUrl, options) => {
920
- try {
921
- const { runUnsnooze } = await import('./commands/snooze.js');
922
- const data = await runUnsnooze({ prUrl });
923
- if (options.json) {
924
- outputJson(data);
925
- }
926
- else if (data.unsnoozed) {
927
- console.log(`Unsnoozed: ${prUrl}`);
928
- console.log('CI failure notifications are active again for this PR.');
929
- }
930
- else {
931
- console.log('PR was not snoozed.');
932
- }
933
- }
934
- catch (err) {
935
- handleCommandError(err, options.json);
936
- }
937
- });
938
- },
939
- },
940
885
  // ── Override Status ────────────────────────────────────────────────────
941
886
  {
942
887
  name: 'override',
@@ -948,14 +893,18 @@ export const commands = [
948
893
  .option('--json', 'Output as JSON')
949
894
  .action(async (prUrl, status, options) => {
950
895
  try {
951
- const { runOverride } = await import('./commands/override.js');
952
- const data = await runOverride({ prUrl, status });
896
+ const { runMove } = await import('./commands/move.js');
897
+ const validStatuses = ['needs_addressing', 'waiting_on_maintainer'];
898
+ if (!validStatuses.includes(status)) {
899
+ throw new Error(`Invalid status "${status}". Must be one of: ${validStatuses.join(', ')}`);
900
+ }
901
+ const target = status === 'needs_addressing' ? 'attention' : 'waiting';
902
+ const data = await runMove({ prUrl, target });
953
903
  if (options.json) {
954
904
  outputJson(data);
955
905
  }
956
906
  else {
957
- console.log(`Override set: ${prUrl} → ${data.status}`);
958
- console.log('This override will auto-clear when the PR has new activity.');
907
+ console.log(data.description);
959
908
  }
960
909
  }
961
910
  catch (err) {
@@ -975,16 +924,13 @@ export const commands = [
975
924
  .option('--json', 'Output as JSON')
976
925
  .action(async (prUrl, options) => {
977
926
  try {
978
- const { runClearOverride } = await import('./commands/override.js');
979
- const data = await runClearOverride({ prUrl });
927
+ const { runMove } = await import('./commands/move.js');
928
+ const data = await runMove({ prUrl, target: 'auto' });
980
929
  if (options.json) {
981
930
  outputJson(data);
982
931
  }
983
- else if (data.cleared) {
984
- console.log(`Override cleared: ${prUrl}`);
985
- }
986
932
  else {
987
- console.log('No override was set for this PR.');
933
+ console.log(data.description);
988
934
  }
989
935
  }
990
936
  catch (err) {