@@ -29,27 +29,6 @@ describe("parseInput — commands", () => {
2929 expect(result).toEqual({ type: "command", command: cmd, args: "" });
3030 }
3131 });
32-
33- test("unknown /foo is plain text", () => {
34- expect(parseInput("/foo")).toEqual({ type: "text", text: "/foo" });
35- });
36-
37- test("/ alone is plain text", () => {
38- expect(parseInput("/")).toEqual({ type: "text", text: "/" });
39- });
40-
41- test("space after slash is plain text", () => {
42- expect(parseInput("/ model")).toEqual({ type: "text", text: "/ model" });
43- });
44-
45- test("command with trailing whitespace still matches", () => {
46- const result = parseInput("/model ");
47- expect(result).toEqual({ type: "command", command: "model", args: "" });
48- });
49-
50- test("command is case-sensitive (uppercase is text)", () => {
51- expect(parseInput("/Model")).toEqual({ type: "text", text: "/Model" });
52- });
5332 });
5433
5534 // ---------------------------------------------------------------------------
@@ -57,14 +36,6 @@ describe("parseInput — commands", () => {
5736 // ---------------------------------------------------------------------------
5837
5938 describe("parseInput — skills", () => {
60- test("/skill:name extracts skill with no user text", () => {
61- expect(parseInput("/skill:review")).toEqual({
62- type: "skill",
63- skillName: "review",
64- userText: "",
65- });
66- });
67-
6839 test("/skill:name rest extracts skill and user text", () => {
6940 expect(parseInput("/skill:code-review check the auth module")).toEqual({
7041 type: "skill",
@@ -72,30 +43,6 @@ describe("parseInput — skills", () => {
7243 userText: "check the auth module",
7344 });
7445 });
75-
76- test("/skill:name with trailing space has empty user text", () => {
77- expect(parseInput("/skill:review ")).toEqual({
78- type: "skill",
79- skillName: "review",
80- userText: "",
81- });
82- });
83-
84- test("/skill: with no name is plain text", () => {
85- expect(parseInput("/skill:")).toEqual({ type: "text", text: "/skill:" });
86- });
87-
88- test("/skill without colon is plain text (not a known command)", () => {
89- expect(parseInput("/skill")).toEqual({ type: "text", text: "/skill" });
90- });
91-
92- test("skill name can contain hyphens and underscores", () => {
93- expect(parseInput("/skill:my_cool-skill do stuff")).toEqual({
94- type: "skill",
95- skillName: "my_cool-skill",
96- userText: "do stuff",
97- });
98- });
9946 });
10047
10148 // ---------------------------------------------------------------------------
@@ -110,21 +57,6 @@ describe("parseInput — images", () => {
11057 expect(result).toEqual({ type: "image", path: img });
11158 });
11259
113- test("supports all image extensions", () => {
114- for (const ext of [".png", ".jpg", ".jpeg", ".gif", ".webp"]) {
115- const img = join(tmp, `test${ext}`);
116- writeFileSync(img, "fake");
117- const result = parseInput(img, { supportsImages: true });
118- expect(result.type).toBe("image");
119- }
120- });
121-
122- test("non-existent image path is plain text", () => {
123- const img = join(tmp, "missing.png");
124- const result = parseInput(img, { supportsImages: true });
125- expect(result.type).toBe("text");
126- });
127-
12860 test("image path when model does not support images is plain text", () => {
12961 const img = join(tmp, "screenshot.png");
13062 writeFileSync(img, "fake png");
@@ -132,20 +64,6 @@ describe("parseInput — images", () => {
13264 expect(result.type).toBe("text");
13365 });
13466
135- test("image path with supportsImages undefined is plain text", () => {
136- const img = join(tmp, "screenshot.png");
137- writeFileSync(img, "fake png");
138- const result = parseInput(img);
139- expect(result.type).toBe("text");
140- });
141-
142- test("non-image extension is plain text even if file exists", () => {
143- const file = join(tmp, "readme.txt");
144- writeFileSync(file, "hello");
145- const result = parseInput(file, { supportsImages: true });
146- expect(result.type).toBe("text");
147- });
148-
14967 test("input with extra text is not an image", () => {
15068 const img = join(tmp, "screenshot.png");
15169 writeFileSync(img, "fake png");
@@ -153,13 +71,6 @@ describe("parseInput — images", () => {
15371 expect(result.type).toBe("text");
15472 });
15573
156- test("trimmed whitespace still detects image", () => {
157- const img = join(tmp, "photo.jpg");
158- writeFileSync(img, "fake jpg");
159- const result = parseInput(` ${img} `, { supportsImages: true });
160- expect(result).toEqual({ type: "image", path: img });
161- });
162-
16374 test("relative image path resolved against cwd", () => {
16475 const img = join(tmp, "img.png");
16576 writeFileSync(img, "fake png");
@@ -167,14 +78,6 @@ describe("parseInput — images", () => {
16778 expect(result).toEqual({ type: "image", path: img });
16879 });
16980
170- test("relative image path without cwd checks as-is", () => {
171- // Relative path that doesn't exist from process.cwd
172- const result = parseInput("nonexistent-dir/img.png", {
173- supportsImages: true,
174- });
175- expect(result.type).toBe("text");
176- });
177-
17881 test("image in subdirectory with cwd", () => {
17982 const sub = join(tmp, "assets");
18083 mkdirSync(sub);
@@ -188,13 +91,6 @@ describe("parseInput — images", () => {
18891 path: join(sub, "logo.webp"),
18992 });
19093 });
191-
192- test("uppercase extension is detected", () => {
193- const img = join(tmp, "PHOTO.PNG");
194- writeFileSync(img, "fake png");
195- const result = parseInput(img, { supportsImages: true });
196- expect(result).toEqual({ type: "image", path: img });
197- });
19894 });
19995
20096 // ---------------------------------------------------------------------------
@@ -208,21 +104,6 @@ describe("parseInput — text", () => {
208104 text: "fix the tests",
209105 });
210106 });
211-
212- test("empty string is text", () => {
213- expect(parseInput("")).toEqual({ type: "text", text: "" });
214- });
215-
216- test("whitespace-only is text", () => {
217- expect(parseInput(" ")).toEqual({ type: "text", text: "" });
218- });
219-
220- test("message starting with slash-like but not command", () => {
221- expect(parseInput("/usr/bin/node")).toEqual({
222- type: "text",
223- text: "/usr/bin/node",
224- });
225- });
226107 });
227108
228109 // ---------------------------------------------------------------------------