@task-mcp/shared 1.0.20 → 1.0.21
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/package.json +1 -6
- package/dist/algorithms/critical-path.d.ts +0 -46
- package/dist/algorithms/critical-path.d.ts.map +0 -1
- package/dist/algorithms/critical-path.js +0 -320
- package/dist/algorithms/critical-path.js.map +0 -1
- package/dist/algorithms/critical-path.test.d.ts +0 -2
- package/dist/algorithms/critical-path.test.d.ts.map +0 -1
- package/dist/algorithms/critical-path.test.js +0 -194
- package/dist/algorithms/critical-path.test.js.map +0 -1
- package/dist/algorithms/dependency-integrity.d.ts +0 -81
- package/dist/algorithms/dependency-integrity.d.ts.map +0 -1
- package/dist/algorithms/dependency-integrity.js +0 -207
- package/dist/algorithms/dependency-integrity.js.map +0 -1
- package/dist/algorithms/dependency-integrity.test.d.ts +0 -2
- package/dist/algorithms/dependency-integrity.test.d.ts.map +0 -1
- package/dist/algorithms/dependency-integrity.test.js +0 -309
- package/dist/algorithms/dependency-integrity.test.js.map +0 -1
- package/dist/algorithms/index.d.ts +0 -5
- package/dist/algorithms/index.d.ts.map +0 -1
- package/dist/algorithms/index.js +0 -5
- package/dist/algorithms/index.js.map +0 -1
- package/dist/algorithms/tech-analysis.d.ts +0 -106
- package/dist/algorithms/tech-analysis.d.ts.map +0 -1
- package/dist/algorithms/tech-analysis.js +0 -344
- package/dist/algorithms/tech-analysis.js.map +0 -1
- package/dist/algorithms/tech-analysis.test.d.ts +0 -2
- package/dist/algorithms/tech-analysis.test.d.ts.map +0 -1
- package/dist/algorithms/tech-analysis.test.js +0 -338
- package/dist/algorithms/tech-analysis.test.js.map +0 -1
- package/dist/algorithms/topological-sort.d.ts +0 -41
- package/dist/algorithms/topological-sort.d.ts.map +0 -1
- package/dist/algorithms/topological-sort.js +0 -165
- package/dist/algorithms/topological-sort.js.map +0 -1
- package/dist/algorithms/topological-sort.test.d.ts +0 -2
- package/dist/algorithms/topological-sort.test.d.ts.map +0 -1
- package/dist/algorithms/topological-sort.test.js +0 -162
- package/dist/algorithms/topological-sort.test.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/schemas/inbox.d.ts +0 -55
- package/dist/schemas/inbox.d.ts.map +0 -1
- package/dist/schemas/inbox.js +0 -25
- package/dist/schemas/inbox.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -7
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -17
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/project.d.ts +0 -177
- package/dist/schemas/project.d.ts.map +0 -1
- package/dist/schemas/project.js +0 -56
- package/dist/schemas/project.js.map +0 -1
- package/dist/schemas/response-format.d.ts +0 -148
- package/dist/schemas/response-format.d.ts.map +0 -1
- package/dist/schemas/response-format.js +0 -18
- package/dist/schemas/response-format.js.map +0 -1
- package/dist/schemas/response-schema.d.ts +0 -307
- package/dist/schemas/response-schema.d.ts.map +0 -1
- package/dist/schemas/response-schema.js +0 -75
- package/dist/schemas/response-schema.js.map +0 -1
- package/dist/schemas/response-schema.test.d.ts +0 -2
- package/dist/schemas/response-schema.test.d.ts.map +0 -1
- package/dist/schemas/response-schema.test.js +0 -256
- package/dist/schemas/response-schema.test.js.map +0 -1
- package/dist/schemas/state.d.ts +0 -17
- package/dist/schemas/state.d.ts.map +0 -1
- package/dist/schemas/state.js +0 -17
- package/dist/schemas/state.js.map +0 -1
- package/dist/schemas/task.d.ts +0 -881
- package/dist/schemas/task.d.ts.map +0 -1
- package/dist/schemas/task.js +0 -189
- package/dist/schemas/task.js.map +0 -1
- package/dist/schemas/view.d.ts +0 -143
- package/dist/schemas/view.d.ts.map +0 -1
- package/dist/schemas/view.js +0 -48
- package/dist/schemas/view.js.map +0 -1
- package/dist/utils/dashboard-renderer.d.ts +0 -93
- package/dist/utils/dashboard-renderer.d.ts.map +0 -1
- package/dist/utils/dashboard-renderer.js +0 -424
- package/dist/utils/dashboard-renderer.js.map +0 -1
- package/dist/utils/dashboard-renderer.test.d.ts +0 -2
- package/dist/utils/dashboard-renderer.test.d.ts.map +0 -1
- package/dist/utils/dashboard-renderer.test.js +0 -774
- package/dist/utils/dashboard-renderer.test.js.map +0 -1
- package/dist/utils/date.d.ts +0 -94
- package/dist/utils/date.d.ts.map +0 -1
- package/dist/utils/date.js +0 -323
- package/dist/utils/date.js.map +0 -1
- package/dist/utils/date.test.d.ts +0 -2
- package/dist/utils/date.test.d.ts.map +0 -1
- package/dist/utils/date.test.js +0 -276
- package/dist/utils/date.test.js.map +0 -1
- package/dist/utils/hierarchy.d.ts +0 -102
- package/dist/utils/hierarchy.d.ts.map +0 -1
- package/dist/utils/hierarchy.js +0 -236
- package/dist/utils/hierarchy.js.map +0 -1
- package/dist/utils/hierarchy.test.d.ts +0 -2
- package/dist/utils/hierarchy.test.d.ts.map +0 -1
- package/dist/utils/hierarchy.test.js +0 -436
- package/dist/utils/hierarchy.test.js.map +0 -1
- package/dist/utils/id.d.ts +0 -60
- package/dist/utils/id.d.ts.map +0 -1
- package/dist/utils/id.js +0 -118
- package/dist/utils/id.js.map +0 -1
- package/dist/utils/id.test.d.ts +0 -2
- package/dist/utils/id.test.d.ts.map +0 -1
- package/dist/utils/id.test.js +0 -193
- package/dist/utils/id.test.js.map +0 -1
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -34
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/natural-language.d.ts +0 -57
- package/dist/utils/natural-language.d.ts.map +0 -1
- package/dist/utils/natural-language.js +0 -211
- package/dist/utils/natural-language.js.map +0 -1
- package/dist/utils/natural-language.test.d.ts +0 -2
- package/dist/utils/natural-language.test.d.ts.map +0 -1
- package/dist/utils/natural-language.test.js +0 -197
- package/dist/utils/natural-language.test.js.map +0 -1
- package/dist/utils/priority-queue.d.ts +0 -17
- package/dist/utils/priority-queue.d.ts.map +0 -1
- package/dist/utils/priority-queue.js +0 -62
- package/dist/utils/priority-queue.js.map +0 -1
- package/dist/utils/priority-queue.test.d.ts +0 -2
- package/dist/utils/priority-queue.test.d.ts.map +0 -1
- package/dist/utils/priority-queue.test.js +0 -82
- package/dist/utils/priority-queue.test.js.map +0 -1
- package/dist/utils/projection.d.ts +0 -65
- package/dist/utils/projection.d.ts.map +0 -1
- package/dist/utils/projection.js +0 -180
- package/dist/utils/projection.js.map +0 -1
- package/dist/utils/projection.test.d.ts +0 -2
- package/dist/utils/projection.test.d.ts.map +0 -1
- package/dist/utils/projection.test.js +0 -336
- package/dist/utils/projection.test.js.map +0 -1
- package/dist/utils/terminal-ui.d.ts +0 -208
- package/dist/utils/terminal-ui.d.ts.map +0 -1
- package/dist/utils/terminal-ui.js +0 -611
- package/dist/utils/terminal-ui.js.map +0 -1
- package/dist/utils/terminal-ui.test.d.ts +0 -2
- package/dist/utils/terminal-ui.test.d.ts.map +0 -1
- package/dist/utils/terminal-ui.test.js +0 -683
- package/dist/utils/terminal-ui.test.js.map +0 -1
- package/dist/utils/workspace.d.ts +0 -100
- package/dist/utils/workspace.d.ts.map +0 -1
- package/dist/utils/workspace.js +0 -173
- package/dist/utils/workspace.js.map +0 -1
- package/dist/utils/workspace.test.d.ts +0 -2
- package/dist/utils/workspace.test.d.ts.map +0 -1
- package/dist/utils/workspace.test.js +0 -97
- package/dist/utils/workspace.test.js.map +0 -1
- package/src/algorithms/critical-path.test.ts +0 -241
- package/src/algorithms/dependency-integrity.test.ts +0 -348
- package/src/algorithms/tech-analysis.test.ts +0 -413
- package/src/algorithms/topological-sort.test.ts +0 -190
- package/src/schemas/response-schema.test.ts +0 -314
- package/src/utils/dashboard-renderer.test.ts +0 -983
- package/src/utils/date.test.ts +0 -329
- package/src/utils/hierarchy.test.ts +0 -505
- package/src/utils/id.test.ts +0 -235
- package/src/utils/natural-language.test.ts +0 -242
- package/src/utils/priority-queue.test.ts +0 -103
- package/src/utils/projection.test.ts +0 -425
- package/src/utils/terminal-ui.test.ts +0 -831
- package/src/utils/workspace.test.ts +0 -125
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "bun:test";
|
|
2
|
-
import {
|
|
3
|
-
ResponseType,
|
|
4
|
-
ResponsePriority,
|
|
5
|
-
ResponseOption,
|
|
6
|
-
QuestionResponse,
|
|
7
|
-
SuggestionResponse,
|
|
8
|
-
ConfirmationResponse,
|
|
9
|
-
GenerateResponseInput,
|
|
10
|
-
} from "./response-schema.js";
|
|
11
|
-
|
|
12
|
-
describe("Response Schema", () => {
|
|
13
|
-
describe("ResponseType", () => {
|
|
14
|
-
it("should accept valid response types", () => {
|
|
15
|
-
expect(() => ResponseType.parse("question")).not.toThrow();
|
|
16
|
-
expect(() => ResponseType.parse("suggestion")).not.toThrow();
|
|
17
|
-
expect(() => ResponseType.parse("confirmation")).not.toThrow();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("should reject invalid response types", () => {
|
|
21
|
-
expect(() => ResponseType.parse("invalid")).toThrow();
|
|
22
|
-
expect(() => ResponseType.parse("ask")).toThrow();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe("ResponsePriority", () => {
|
|
27
|
-
it("should accept valid priority levels", () => {
|
|
28
|
-
expect(() => ResponsePriority.parse("low")).not.toThrow();
|
|
29
|
-
expect(() => ResponsePriority.parse("medium")).not.toThrow();
|
|
30
|
-
expect(() => ResponsePriority.parse("high")).not.toThrow();
|
|
31
|
-
expect(() => ResponsePriority.parse("critical")).not.toThrow();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("should reject invalid priority levels", () => {
|
|
35
|
-
expect(() => ResponsePriority.parse("urgent")).toThrow();
|
|
36
|
-
expect(() => ResponsePriority.parse("normal")).toThrow();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe("ResponseOption", () => {
|
|
41
|
-
it("should validate option with all fields", () => {
|
|
42
|
-
const option = {
|
|
43
|
-
label: "High Priority",
|
|
44
|
-
value: "high",
|
|
45
|
-
description: "For urgent tasks",
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
expect(() => ResponseOption.parse(option)).not.toThrow();
|
|
49
|
-
const parsed = ResponseOption.parse(option);
|
|
50
|
-
expect(parsed.label).toBe("High Priority");
|
|
51
|
-
expect(parsed.value).toBe("high");
|
|
52
|
-
expect(parsed.description).toBe("For urgent tasks");
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("should validate option without description", () => {
|
|
56
|
-
const option = {
|
|
57
|
-
label: "Low Priority",
|
|
58
|
-
value: "low",
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
expect(() => ResponseOption.parse(option)).not.toThrow();
|
|
62
|
-
const parsed = ResponseOption.parse(option);
|
|
63
|
-
expect(parsed.label).toBe("Low Priority");
|
|
64
|
-
expect(parsed.value).toBe("low");
|
|
65
|
-
expect(parsed.description).toBeUndefined();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("should reject option without required fields", () => {
|
|
69
|
-
expect(() => ResponseOption.parse({ label: "Test" })).toThrow();
|
|
70
|
-
expect(() => ResponseOption.parse({ value: "test" })).toThrow();
|
|
71
|
-
expect(() => ResponseOption.parse({})).toThrow();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
describe("QuestionResponse", () => {
|
|
76
|
-
it("should validate question with all fields", () => {
|
|
77
|
-
const question = {
|
|
78
|
-
type: "question" as const,
|
|
79
|
-
message: "What should we do?",
|
|
80
|
-
context: "Need clarification on approach",
|
|
81
|
-
priority: "high" as const,
|
|
82
|
-
options: [
|
|
83
|
-
{ label: "Option A", value: "a" },
|
|
84
|
-
{ label: "Option B", value: "b" },
|
|
85
|
-
],
|
|
86
|
-
defaultOption: "a",
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
expect(() => QuestionResponse.parse(question)).not.toThrow();
|
|
90
|
-
const parsed = QuestionResponse.parse(question);
|
|
91
|
-
expect(parsed.type).toBe("question");
|
|
92
|
-
expect(parsed.message).toBe("What should we do?");
|
|
93
|
-
expect(parsed.options).toHaveLength(2);
|
|
94
|
-
expect(parsed.defaultOption).toBe("a");
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it("should validate question with minimal fields", () => {
|
|
98
|
-
const question = {
|
|
99
|
-
type: "question" as const,
|
|
100
|
-
message: "Proceed?",
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
expect(() => QuestionResponse.parse(question)).not.toThrow();
|
|
104
|
-
const parsed = QuestionResponse.parse(question);
|
|
105
|
-
expect(parsed.type).toBe("question");
|
|
106
|
-
expect(parsed.message).toBe("Proceed?");
|
|
107
|
-
expect(parsed.context).toBeUndefined();
|
|
108
|
-
expect(parsed.options).toBeUndefined();
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("should reject question without message", () => {
|
|
112
|
-
expect(() => QuestionResponse.parse({ type: "question" })).toThrow();
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it("should reject question with wrong type", () => {
|
|
116
|
-
expect(() =>
|
|
117
|
-
QuestionResponse.parse({
|
|
118
|
-
type: "suggestion",
|
|
119
|
-
message: "Test",
|
|
120
|
-
})
|
|
121
|
-
).toThrow();
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
describe("SuggestionResponse", () => {
|
|
126
|
-
it("should validate suggestion with all fields", () => {
|
|
127
|
-
const suggestion = {
|
|
128
|
-
type: "suggestion" as const,
|
|
129
|
-
message: "Consider breaking down this task",
|
|
130
|
-
context: "Task is complex",
|
|
131
|
-
priority: "medium" as const,
|
|
132
|
-
options: [
|
|
133
|
-
{ label: "3 subtasks", value: "sub_3" },
|
|
134
|
-
{ label: "5 subtasks", value: "sub_5" },
|
|
135
|
-
],
|
|
136
|
-
reasoning: "Based on complexity analysis",
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
expect(() => SuggestionResponse.parse(suggestion)).not.toThrow();
|
|
140
|
-
const parsed = SuggestionResponse.parse(suggestion);
|
|
141
|
-
expect(parsed.type).toBe("suggestion");
|
|
142
|
-
expect(parsed.options).toHaveLength(2);
|
|
143
|
-
expect(parsed.reasoning).toBe("Based on complexity analysis");
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it("should validate suggestion with minimal fields", () => {
|
|
147
|
-
const suggestion = {
|
|
148
|
-
type: "suggestion" as const,
|
|
149
|
-
message: "Try this",
|
|
150
|
-
options: [{ label: "Do it", value: "yes" }],
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
expect(() => SuggestionResponse.parse(suggestion)).not.toThrow();
|
|
154
|
-
const parsed = SuggestionResponse.parse(suggestion);
|
|
155
|
-
expect(parsed.options).toHaveLength(1);
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
it("should reject suggestion without options", () => {
|
|
159
|
-
expect(() =>
|
|
160
|
-
SuggestionResponse.parse({
|
|
161
|
-
type: "suggestion",
|
|
162
|
-
message: "Test",
|
|
163
|
-
})
|
|
164
|
-
).toThrow();
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it("should reject suggestion with empty options array", () => {
|
|
168
|
-
expect(() =>
|
|
169
|
-
SuggestionResponse.parse({
|
|
170
|
-
type: "suggestion",
|
|
171
|
-
message: "Test",
|
|
172
|
-
options: [],
|
|
173
|
-
})
|
|
174
|
-
).toThrow();
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
describe("ConfirmationResponse", () => {
|
|
179
|
-
it("should validate confirmation with all fields", () => {
|
|
180
|
-
const confirmation = {
|
|
181
|
-
type: "confirmation" as const,
|
|
182
|
-
message: "Are you sure?",
|
|
183
|
-
action: "Delete all completed tasks",
|
|
184
|
-
context: "This operation is irreversible",
|
|
185
|
-
priority: "critical" as const,
|
|
186
|
-
consequences: ["10 tasks will be removed", "Cannot be undone"],
|
|
187
|
-
defaultConfirm: false,
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
expect(() => ConfirmationResponse.parse(confirmation)).not.toThrow();
|
|
191
|
-
const parsed = ConfirmationResponse.parse(confirmation);
|
|
192
|
-
expect(parsed.type).toBe("confirmation");
|
|
193
|
-
expect(parsed.action).toBe("Delete all completed tasks");
|
|
194
|
-
expect(parsed.consequences).toHaveLength(2);
|
|
195
|
-
expect(parsed.defaultConfirm).toBe(false);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it("should validate confirmation with minimal fields", () => {
|
|
199
|
-
const confirmation = {
|
|
200
|
-
type: "confirmation" as const,
|
|
201
|
-
message: "Delete this?",
|
|
202
|
-
action: "Delete task",
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
expect(() => ConfirmationResponse.parse(confirmation)).not.toThrow();
|
|
206
|
-
const parsed = ConfirmationResponse.parse(confirmation);
|
|
207
|
-
expect(parsed.action).toBe("Delete task");
|
|
208
|
-
expect(parsed.consequences).toBeUndefined();
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
it("should reject confirmation without action", () => {
|
|
212
|
-
expect(() =>
|
|
213
|
-
ConfirmationResponse.parse({
|
|
214
|
-
type: "confirmation",
|
|
215
|
-
message: "Confirm?",
|
|
216
|
-
})
|
|
217
|
-
).toThrow();
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it("should reject confirmation without message", () => {
|
|
221
|
-
expect(() =>
|
|
222
|
-
ConfirmationResponse.parse({
|
|
223
|
-
type: "confirmation",
|
|
224
|
-
action: "Do something",
|
|
225
|
-
})
|
|
226
|
-
).toThrow();
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
describe("GenerateResponseInput", () => {
|
|
231
|
-
it("should validate input for question type", () => {
|
|
232
|
-
const input = {
|
|
233
|
-
type: "question" as const,
|
|
234
|
-
message: "What to do?",
|
|
235
|
-
options: [{ label: "Yes", value: "yes" }],
|
|
236
|
-
defaultOption: "yes",
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
expect(() => GenerateResponseInput.parse(input)).not.toThrow();
|
|
240
|
-
const parsed = GenerateResponseInput.parse(input);
|
|
241
|
-
expect(parsed.type).toBe("question");
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
it("should validate input for suggestion type", () => {
|
|
245
|
-
const input = {
|
|
246
|
-
type: "suggestion" as const,
|
|
247
|
-
message: "Try this",
|
|
248
|
-
options: [{ label: "Option", value: "opt" }],
|
|
249
|
-
reasoning: "Because reasons",
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
expect(() => GenerateResponseInput.parse(input)).not.toThrow();
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
it("should validate input for confirmation type", () => {
|
|
256
|
-
const input = {
|
|
257
|
-
type: "confirmation" as const,
|
|
258
|
-
message: "Sure?",
|
|
259
|
-
action: "Delete",
|
|
260
|
-
consequences: ["Gone forever"],
|
|
261
|
-
defaultConfirm: false,
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
expect(() => GenerateResponseInput.parse(input)).not.toThrow();
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
it("should use default priority of medium", () => {
|
|
268
|
-
const input = {
|
|
269
|
-
type: "question" as const,
|
|
270
|
-
message: "Test?",
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
const parsed = GenerateResponseInput.parse(input);
|
|
274
|
-
expect(parsed.priority).toBe("medium");
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
it("should allow custom priority", () => {
|
|
278
|
-
const input = {
|
|
279
|
-
type: "question" as const,
|
|
280
|
-
message: "Test?",
|
|
281
|
-
priority: "critical" as const,
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
const parsed = GenerateResponseInput.parse(input);
|
|
285
|
-
expect(parsed.priority).toBe("critical");
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
describe("Type discrimination", () => {
|
|
290
|
-
it("should differentiate response types at compile time", () => {
|
|
291
|
-
const question: QuestionResponse = {
|
|
292
|
-
type: "question",
|
|
293
|
-
message: "Test",
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
const suggestion: SuggestionResponse = {
|
|
297
|
-
type: "suggestion",
|
|
298
|
-
message: "Test",
|
|
299
|
-
options: [{ label: "A", value: "a" }],
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
const confirmation: ConfirmationResponse = {
|
|
303
|
-
type: "confirmation",
|
|
304
|
-
message: "Test",
|
|
305
|
-
action: "Do it",
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
// TypeScript should allow this
|
|
309
|
-
expect(question.type).toBe("question");
|
|
310
|
-
expect(suggestion.type).toBe("suggestion");
|
|
311
|
-
expect(confirmation.type).toBe("confirmation");
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
});
|