github-issue-tower-defence-management 1.129.0 → 1.131.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -5
  3. package/bin/adapter/entry-points/cli/index.js +8 -0
  4. package/bin/adapter/entry-points/cli/index.js.map +1 -1
  5. package/bin/adapter/entry-points/cli/projectConfig.js +2 -0
  6. package/bin/adapter/entry-points/cli/projectConfig.js.map +1 -1
  7. package/bin/adapter/entry-points/console/consoleDataDelivery.js +1 -0
  8. package/bin/adapter/entry-points/console/consoleDataDelivery.js.map +1 -1
  9. package/bin/adapter/entry-points/console/consoleDoneStore.js +1 -0
  10. package/bin/adapter/entry-points/console/consoleDoneStore.js.map +1 -1
  11. package/bin/adapter/entry-points/console/ui-dist/assets/{index-Dr5qin37.js → index-Bz0KvgIG.js} +22 -22
  12. package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
  13. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +6 -6
  14. package/bin/adapter/entry-points/handlers/consoleListsWriter.js +1 -0
  15. package/bin/adapter/entry-points/handlers/consoleListsWriter.js.map +1 -1
  16. package/bin/domain/usecases/HandleScheduledEventUseCase.js +1 -0
  17. package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
  18. package/bin/domain/usecases/StartPreparationUseCase.js +6 -1
  19. package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
  20. package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js +1 -0
  21. package/bin/domain/usecases/console/GenerateConsoleListsUseCase.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/adapter/entry-points/cli/index.test.ts +36 -0
  24. package/src/adapter/entry-points/cli/index.ts +14 -0
  25. package/src/adapter/entry-points/cli/projectConfig.ts +3 -0
  26. package/src/adapter/entry-points/console/consoleDataDelivery.test.ts +6 -0
  27. package/src/adapter/entry-points/console/consoleDataDelivery.ts +1 -0
  28. package/src/adapter/entry-points/console/consoleDoneStore.test.ts +4 -0
  29. package/src/adapter/entry-points/console/consoleDoneStore.ts +1 -0
  30. package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +10 -0
  31. package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.stories.tsx +4 -0
  32. package/src/adapter/entry-points/console/ui/src/features/console/components/layout/ConsoleTabList.test.tsx +2 -0
  33. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.stories.tsx +2 -2
  34. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.test.tsx +5 -5
  35. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.tsx +3 -3
  36. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.stories.tsx +8 -0
  37. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.test.tsx +15 -0
  38. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleOperationMenu.tsx +2 -2
  39. package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleNavigation.test.ts +1 -0
  40. package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleTabData.test.ts +2 -1
  41. package/src/adapter/entry-points/console/ui/src/features/console/logic/actionToast.test.ts +6 -2
  42. package/src/adapter/entry-points/console/ui/src/features/console/logic/actionToast.ts +7 -6
  43. package/src/adapter/entry-points/console/ui/src/features/console/logic/operations.test.ts +7 -5
  44. package/src/adapter/entry-points/console/ui/src/features/console/logic/operations.ts +3 -2
  45. package/src/adapter/entry-points/console/ui/src/features/console/logic/tabAdvance.test.ts +11 -1
  46. package/src/adapter/entry-points/console/ui/src/features/console/logic/types.ts +3 -1
  47. package/src/adapter/entry-points/console/ui/src/features/console/testing/fixtures.ts +1 -0
  48. package/src/adapter/entry-points/console/ui-dist/assets/{index-Dr5qin37.js → index-Bz0KvgIG.js} +22 -22
  49. package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
  50. package/src/adapter/entry-points/console/webServer.test.ts +1 -0
  51. package/src/adapter/entry-points/handlers/consoleListsWriter.test.ts +21 -1
  52. package/src/adapter/entry-points/handlers/consoleListsWriter.ts +1 -0
  53. package/src/domain/usecases/HandleScheduledEventUseCase.ts +1 -0
  54. package/src/domain/usecases/StartPreparationUseCase.test.ts +315 -3
  55. package/src/domain/usecases/StartPreparationUseCase.ts +7 -1
  56. package/src/domain/usecases/console/GenerateConsoleListsUseCase.test.ts +26 -0
  57. package/src/domain/usecases/console/GenerateConsoleListsUseCase.ts +8 -1
  58. package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
  59. package/types/adapter/entry-points/cli/projectConfig.d.ts +1 -0
  60. package/types/adapter/entry-points/cli/projectConfig.d.ts.map +1 -1
  61. package/types/adapter/entry-points/console/consoleDataDelivery.d.ts.map +1 -1
  62. package/types/adapter/entry-points/console/consoleDoneStore.d.ts.map +1 -1
  63. package/types/adapter/entry-points/handlers/consoleListsWriter.d.ts.map +1 -1
  64. package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
  65. package/types/domain/usecases/StartPreparationUseCase.d.ts +1 -0
  66. package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
  67. package/types/domain/usecases/console/GenerateConsoleListsUseCase.d.ts +2 -1
  68. package/types/domain/usecases/console/GenerateConsoleListsUseCase.d.ts.map +1 -1
@@ -25,6 +25,7 @@ const counts: Record<ConsoleTabName, number> = {
25
25
  unread: 18,
26
26
  'failed-preparation': 2,
27
27
  'todo-by-human': 66,
28
+ 'todo-by-agent': 24,
28
29
  };
29
30
 
30
31
  export const AllTabsWithCounts: Story = {
@@ -44,6 +45,7 @@ export const ZeroCountTabsHidden: Story = {
44
45
  unread: 18,
45
46
  'failed-preparation': 0,
46
47
  'todo-by-human': 0,
48
+ 'todo-by-agent': 0,
47
49
  },
48
50
  },
49
51
  };
@@ -58,6 +60,7 @@ export const ZeroCountActiveTabStaysVisible: Story = {
58
60
  unread: 18,
59
61
  'failed-preparation': 0,
60
62
  'todo-by-human': 0,
63
+ 'todo-by-agent': 0,
61
64
  },
62
65
  },
63
66
  };
@@ -72,6 +75,7 @@ export const AfterAutoAdvanceToNextTab: Story = {
72
75
  unread: 7,
73
76
  'failed-preparation': 2,
74
77
  'todo-by-human': 4,
78
+ 'todo-by-agent': 0,
75
79
  },
76
80
  onSelectTab: () => {},
77
81
  },
@@ -9,6 +9,7 @@ const counts: Record<ConsoleTabName, number> = {
9
9
  unread: 5,
10
10
  'failed-preparation': 0,
11
11
  'todo-by-human': 2,
12
+ 'todo-by-agent': 3,
12
13
  };
13
14
 
14
15
  const baseProps = {
@@ -26,6 +27,7 @@ describe('ConsoleTabList', () => {
26
27
  expect(queryByText('Awaiting Quality Check')).not.toBeNull();
27
28
  expect(queryByText('Unread')).not.toBeNull();
28
29
  expect(queryByText('Todo by human')).not.toBeNull();
30
+ expect(queryByText('Todo by agent')).not.toBeNull();
29
31
  expect(queryByText('Triage')).toBeNull();
30
32
  expect(queryByText('Failed Preparation')).toBeNull();
31
33
  });
@@ -12,9 +12,9 @@ export default meta;
12
12
  type Story = StoryObj<typeof ConsoleNextActionDateActions>;
13
13
 
14
14
  export const StandardTab: Story = {
15
- args: { isTodoByHuman: false },
15
+ args: { isManualTriage: false },
16
16
  };
17
17
 
18
18
  export const TodoByHumanTab: Story = {
19
- args: { isTodoByHuman: true },
19
+ args: { isManualTriage: true },
20
20
  };
@@ -2,10 +2,10 @@ import { fireEvent, render } from '@testing-library/react';
2
2
  import { ConsoleNextActionDateActions } from './ConsoleNextActionDateActions';
3
3
 
4
4
  describe('ConsoleNextActionDateActions', () => {
5
- it('shows +1 day and +1 week outside the todo-by-human tab', () => {
5
+ it('shows +1 day and +1 week outside manual triage tabs', () => {
6
6
  const { getByText, queryByText } = render(
7
7
  <ConsoleNextActionDateActions
8
- isTodoByHuman={false}
8
+ isManualTriage={false}
9
9
  onSetNextActionDate={() => {}}
10
10
  />,
11
11
  );
@@ -14,10 +14,10 @@ describe('ConsoleNextActionDateActions', () => {
14
14
  expect(queryByText('+1 week and skip')).toBeNull();
15
15
  });
16
16
 
17
- it('shows +1 week and skip on the todo-by-human tab', () => {
17
+ it('shows +1 week and skip on manual triage tabs', () => {
18
18
  const { getByText } = render(
19
19
  <ConsoleNextActionDateActions
20
- isTodoByHuman
20
+ isManualTriage
21
21
  onSetNextActionDate={() => {}}
22
22
  />,
23
23
  );
@@ -28,7 +28,7 @@ describe('ConsoleNextActionDateActions', () => {
28
28
  const onSetNextActionDate = jest.fn();
29
29
  const { getByText } = render(
30
30
  <ConsoleNextActionDateActions
31
- isTodoByHuman={false}
31
+ isManualTriage={false}
32
32
  onSetNextActionDate={onSetNextActionDate}
33
33
  />,
34
34
  );
@@ -1,12 +1,12 @@
1
1
  import type { ConsoleNextActionDateAction } from '../../logic/operations';
2
2
 
3
3
  export type ConsoleNextActionDateGroupProps = {
4
- isTodoByHuman: boolean;
4
+ isManualTriage: boolean;
5
5
  onSetNextActionDate: (action: ConsoleNextActionDateAction) => void;
6
6
  };
7
7
 
8
8
  export const ConsoleNextActionDateActions = ({
9
- isTodoByHuman,
9
+ isManualTriage,
10
10
  onSetNextActionDate,
11
11
  }: ConsoleNextActionDateGroupProps) => (
12
12
  <div className="console-op-group">
@@ -22,7 +22,7 @@ export const ConsoleNextActionDateActions = ({
22
22
  className="console-op-button console-op-button-snooze"
23
23
  onClick={() => onSetNextActionDate('snooze_1week')}
24
24
  >
25
- {isTodoByHuman ? '+1 week and skip' : '+1 week'}
25
+ {isManualTriage ? '+1 week and skip' : '+1 week'}
26
26
  </button>
27
27
  </div>
28
28
  );
@@ -63,3 +63,11 @@ export const TodoByHumanTabIssue: Story = {
63
63
  hasPullRequest: false,
64
64
  },
65
65
  };
66
+
67
+ export const TodoByAgentTabIssue: Story = {
68
+ args: {
69
+ tab: 'todo-by-agent',
70
+ item: consoleListItemsFixture[2],
71
+ hasPullRequest: false,
72
+ },
73
+ };
@@ -73,6 +73,21 @@ describe('ConsoleOperationMenu', () => {
73
73
  expect(getByText('+1 week and skip')).toBeInTheDocument();
74
74
  });
75
75
 
76
+ it('shows +1 week and skip on the todo-by-agent tab', () => {
77
+ const { getByText } = render(
78
+ <ConsoleOperationMenu
79
+ tab="todo-by-agent"
80
+ item={issueItem}
81
+ hasPullRequest={false}
82
+ rejectEnabled={false}
83
+ statusOptions={consoleStatusOptionsFixture}
84
+ storyOptions={consoleStoryOptionsFixture}
85
+ handlers={handlers}
86
+ />,
87
+ );
88
+ expect(getByText('+1 week and skip')).toBeInTheDocument();
89
+ });
90
+
76
91
  it('hides the review group when there is no pull request', () => {
77
92
  const { queryByText } = render(
78
93
  <ConsoleOperationMenu
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  type ConsoleOperationHandlers,
3
- isTodoByHumanTab,
3
+ isManualTriageTab,
4
4
  } from '../../logic/operations';
5
5
  import type {
6
6
  ConsoleFieldOption,
@@ -41,7 +41,7 @@ export const ConsoleOperationMenu = ({
41
41
  />
42
42
  )}
43
43
  <ConsoleNextActionDateActions
44
- isTodoByHuman={isTodoByHumanTab(tab)}
44
+ isManualTriage={isManualTriageTab(tab)}
45
45
  onSetNextActionDate={handlers.onSetNextActionDate}
46
46
  />
47
47
  {showStory && (
@@ -15,6 +15,7 @@ const counts = (
15
15
  unread: 0,
16
16
  'failed-preparation': 0,
17
17
  'todo-by-human': 0,
18
+ 'todo-by-agent': 0,
18
19
  ...overrides,
19
20
  });
20
21
 
@@ -1,4 +1,5 @@
1
1
  import { renderHook, waitFor } from '@testing-library/react';
2
+ import { CONSOLE_TABS } from '../logic/types';
2
3
  import { useConsoleTabData } from './useConsoleTabData';
3
4
 
4
5
  describe('useConsoleTabData', () => {
@@ -27,7 +28,7 @@ describe('useConsoleTabData', () => {
27
28
  await waitFor(() => {
28
29
  expect(result.current.isLoading).toBe(false);
29
30
  });
30
- expect(fetchMock).toHaveBeenCalledTimes(6);
31
+ expect(fetchMock).toHaveBeenCalledTimes(CONSOLE_TABS.length);
31
32
  expect(fetchMock).toHaveBeenCalledWith(
32
33
  expect.stringContaining('/projects/umino/prs/list.json'),
33
34
  );
@@ -44,7 +44,7 @@ describe('actionToastMessage', () => {
44
44
  ).toBe('Marked unnecessary');
45
45
  });
46
46
 
47
- it('labels the +1 week snooze differently on the todo-by-human tab', () => {
47
+ it('labels the +1 week snooze differently on the manual triage tabs', () => {
48
48
  const kind: ConsoleActionKind = {
49
49
  type: 'next_action_date',
50
50
  action: 'snooze_1week',
@@ -53,6 +53,9 @@ describe('actionToastMessage', () => {
53
53
  expect(actionToastMessage(kind, 'todo-by-human')).toBe(
54
54
  'Next Action Date +1 week and skip',
55
55
  );
56
+ expect(actionToastMessage(kind, 'todo-by-agent')).toBe(
57
+ 'Next Action Date +1 week and skip',
58
+ );
56
59
  });
57
60
 
58
61
  it('labels the +1 day snooze the same on every tab', () => {
@@ -134,13 +137,14 @@ describe('actionAdvances', () => {
134
137
  );
135
138
  });
136
139
 
137
- it('does not advance a snooze except on the todo-by-human tab', () => {
140
+ it('does not advance a snooze except on the manual triage tabs', () => {
138
141
  const kind: ConsoleActionKind = {
139
142
  type: 'next_action_date',
140
143
  action: 'snooze_1week',
141
144
  };
142
145
  expect(actionAdvances(kind, 'prs')).toBe(false);
143
146
  expect(actionAdvances(kind, 'todo-by-human')).toBe(true);
147
+ expect(actionAdvances(kind, 'todo-by-agent')).toBe(true);
144
148
  });
145
149
  });
146
150
 
@@ -1,7 +1,8 @@
1
- import type {
2
- ConsoleCloseAction,
3
- ConsoleNextActionDateAction,
4
- ConsoleReviewAction,
1
+ import {
2
+ type ConsoleCloseAction,
3
+ type ConsoleNextActionDateAction,
4
+ type ConsoleReviewAction,
5
+ isManualTriageTab,
5
6
  } from './operations';
6
7
  import type { ConsoleListItem, ConsoleTabName } from './types';
7
8
 
@@ -46,7 +47,7 @@ export const actionToastMessage = (
46
47
  if (kind.action === 'snooze_1day') {
47
48
  return 'Next Action Date +1 day';
48
49
  }
49
- return tab === 'todo-by-human'
50
+ return isManualTriageTab(tab)
50
51
  ? 'Next Action Date +1 week and skip'
51
52
  : 'Next Action Date +1 week';
52
53
  case 'set_story':
@@ -91,7 +92,7 @@ export const actionAdvances = (
91
92
  tab: ConsoleTabName,
92
93
  ): boolean => {
93
94
  if (kind.type === 'next_action_date') {
94
- return tab === 'todo-by-human';
95
+ return isManualTriageTab(tab);
95
96
  }
96
97
  return true;
97
98
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildRequestChangesBody,
3
3
  IN_TMUX_BY_HUMAN_NAME,
4
- isTodoByHumanTab,
4
+ isManualTriageTab,
5
5
  STATUS_BUTTON_NAMES,
6
6
  TOTALLY_WRONG_COMMENT_BODY,
7
7
  UNNECESSARY_COMMENT_BODY,
@@ -21,6 +21,7 @@ describe('operation constants', () => {
21
21
  'In Tmux by agent',
22
22
  'In Tmux by human',
23
23
  'Todo by human',
24
+ 'Todo by agent',
24
25
  'Awaiting Workspace',
25
26
  ]);
26
27
  });
@@ -30,10 +31,11 @@ describe('operation constants', () => {
30
31
  });
31
32
  });
32
33
 
33
- describe('isTodoByHumanTab', () => {
34
- it('is true only for the todo-by-human tab', () => {
35
- expect(isTodoByHumanTab('todo-by-human')).toBe(true);
36
- expect(isTodoByHumanTab('prs')).toBe(false);
34
+ describe('isManualTriageTab', () => {
35
+ it('is true for the manual triage tabs and false otherwise', () => {
36
+ expect(isManualTriageTab('todo-by-human')).toBe(true);
37
+ expect(isManualTriageTab('todo-by-agent')).toBe(true);
38
+ expect(isManualTriageTab('prs')).toBe(false);
37
39
  });
38
40
  });
39
41
 
@@ -41,10 +41,11 @@ export const STATUS_BUTTON_NAMES: string[] = [
41
41
  'In Tmux by agent',
42
42
  'In Tmux by human',
43
43
  'Todo by human',
44
+ 'Todo by agent',
44
45
  'Awaiting Workspace',
45
46
  ];
46
47
 
47
48
  export const IN_TMUX_BY_HUMAN_NAME = 'In Tmux by human';
48
49
 
49
- export const isTodoByHumanTab = (tab: ConsoleTabName): boolean =>
50
- tab === 'todo-by-human';
50
+ export const isManualTriageTab = (tab: ConsoleTabName): boolean =>
51
+ tab === 'todo-by-human' || tab === 'todo-by-agent';
@@ -13,6 +13,7 @@ const counts = (
13
13
  unread: 0,
14
14
  'failed-preparation': 0,
15
15
  'todo-by-human': 0,
16
+ 'todo-by-agent': 0,
16
17
  ...overrides,
17
18
  });
18
19
 
@@ -32,6 +33,15 @@ describe('findNextNonEmptyTabToRight', () => {
32
33
  ).toBe('todo-by-human');
33
34
  });
34
35
 
36
+ it('advances from todo-by-human to todo-by-agent when it has items', () => {
37
+ expect(
38
+ findNextNonEmptyTabToRight(
39
+ 'todo-by-human',
40
+ counts({ 'todo-by-agent': 2 }),
41
+ ),
42
+ ).toBe('todo-by-agent');
43
+ });
44
+
35
45
  it('returns the immediately adjacent tab when it is non-empty', () => {
36
46
  expect(
37
47
  findNextNonEmptyTabToRight('prs', counts({ triage: 12, unread: 7 })),
@@ -46,7 +56,7 @@ describe('findNextNonEmptyTabToRight', () => {
46
56
 
47
57
  it('returns null when the active tab is the last tab', () => {
48
58
  expect(
49
- findNextNonEmptyTabToRight('todo-by-human', counts({ prs: 35 })),
59
+ findNextNonEmptyTabToRight('todo-by-agent', counts({ prs: 35 })),
50
60
  ).toBeNull();
51
61
  });
52
62
  });
@@ -144,7 +144,8 @@ export type ConsoleTabName =
144
144
  | 'triage'
145
145
  | 'unread'
146
146
  | 'failed-preparation'
147
- | 'todo-by-human';
147
+ | 'todo-by-human'
148
+ | 'todo-by-agent';
148
149
 
149
150
  export type ConsoleTab = {
150
151
  name: ConsoleTabName;
@@ -158,4 +159,5 @@ export const CONSOLE_TABS: ConsoleTab[] = [
158
159
  { name: 'unread', label: 'Unread' },
159
160
  { name: 'failed-preparation', label: 'Failed Preparation' },
160
161
  { name: 'todo-by-human', label: 'Todo by human' },
162
+ { name: 'todo-by-agent', label: 'Todo by agent' },
161
163
  ];
@@ -15,6 +15,7 @@ export const consoleStatusOptionsFixture: ConsoleFieldOption[] = [
15
15
  { id: 'f57f1ce9', name: 'Preparation', color: 'YELLOW' },
16
16
  { id: 'fd313492', name: 'Failed Preparation', color: 'RED' },
17
17
  { id: 'e9931e57', name: 'Todo by human', color: 'PINK' },
18
+ { id: 'a1e4b7c9', name: 'Todo by agent', color: 'BLUE' },
18
19
  { id: 'c2d278b2', name: 'In Tmux by human', color: 'RED' },
19
20
  { id: 'e9f6a726', name: 'In Tmux by agent', color: 'YELLOW' },
20
21
  { id: 'bd8358eb', name: 'Icebox', color: 'GRAY' },