@oss-autopilot/core 0.49.0 → 0.51.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/cli-registry.js +44 -98
- package/dist/cli.bundle.cjs +43 -45
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/commands/daily.d.ts +1 -1
- package/dist/commands/daily.js +5 -42
- package/dist/commands/dashboard-server.d.ts +1 -1
- package/dist/commands/dashboard-server.js +19 -29
- package/dist/commands/dismiss.d.ts +1 -1
- package/dist/commands/dismiss.js +4 -4
- package/dist/commands/index.d.ts +3 -5
- package/dist/commands/index.js +2 -4
- package/dist/commands/move.d.ts +16 -0
- package/dist/commands/move.js +56 -0
- package/dist/commands/setup.d.ts +3 -0
- package/dist/commands/setup.js +62 -0
- package/dist/commands/shelve.d.ts +4 -0
- package/dist/commands/shelve.js +8 -2
- package/dist/core/category-mapping.d.ts +19 -0
- package/dist/core/category-mapping.js +58 -0
- package/dist/core/daily-logic.d.ts +1 -1
- package/dist/core/daily-logic.js +8 -5
- package/dist/core/issue-discovery.js +55 -3
- package/dist/core/issue-scoring.d.ts +3 -0
- package/dist/core/issue-scoring.js +5 -0
- package/dist/core/issue-vetting.js +12 -0
- package/dist/core/pr-monitor.d.ts +2 -27
- package/dist/core/pr-monitor.js +4 -110
- package/dist/core/state.d.ts +8 -40
- package/dist/core/state.js +36 -93
- package/dist/core/status-determination.d.ts +35 -0
- package/dist/core/status-determination.js +112 -0
- package/dist/core/types.d.ts +18 -12
- package/dist/core/types.js +11 -1
- package/package.json +1 -1
- package/dist/commands/override.d.ts +0 -21
- package/dist/commands/override.js +0 -35
- package/dist/commands/snooze.d.ts +0 -24
- package/dist/commands/snooze.js +0 -40
package/dist/cli-registry.js
CHANGED
|
@@ -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 {
|
|
758
|
-
const data = await
|
|
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(
|
|
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 {
|
|
789
|
-
const data = await
|
|
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
|
|
794
|
-
console.log(
|
|
795
|
-
|
|
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(
|
|
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
|
|
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
|
|
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 {
|
|
952
|
-
const
|
|
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(
|
|
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 {
|
|
979
|
-
const data = await
|
|
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(
|
|
933
|
+
console.log(data.description);
|
|
988
934
|
}
|
|
989
935
|
}
|
|
990
936
|
catch (err) {
|