feat: add ora spinner (v9.3.0) while running shell

This commit is contained in:
2026-03-23 14:27:23 +05:30
parent 6b07a7ac2a
commit e4d3e0e263
12 changed files with 201 additions and 72 deletions
+19 -9
View File
@@ -70,7 +70,7 @@ describe("cleanupMultiModel", () => {
stderr: "",
};
const result = await cleanupMultiModel({ force: true });
const result = await cleanupMultiModel({ mode: "cli", force: true });
expect(result.success).toBe(true);
expect(result.localTagsDeleted).toBe(0);
@@ -96,7 +96,7 @@ describe("cleanupMultiModel", () => {
} as any;
spyOn(readline, "createInterface").mockImplementation(() => mockInterface);
const result = await cleanupMultiModel({ force: false });
const result = await cleanupMultiModel({ mode: "cli", force: false });
expect(result.success).toBe(false);
expect(result.error).toBe("Cleanup cancelled by user");
@@ -126,7 +126,7 @@ describe("cleanupMultiModel", () => {
stderr: "",
};
const result = await cleanupMultiModel({ force: true });
const result = await cleanupMultiModel({ mode: "cli", force: true });
expect(result.success).toBe(true);
expect(result.localTagsDeleted).toBe(1);
@@ -150,7 +150,11 @@ describe("cleanupMultiModel", () => {
stderr: "",
};
const result = await cleanupMultiModel({ force: true, remote: false });
const result = await cleanupMultiModel({
mode: "cli",
force: true,
remote: false,
});
expect(result.success).toBe(true);
expect(result.localTagsDeleted).toBe(1);
@@ -191,7 +195,7 @@ describe("cleanupMultiModel", () => {
stderr: "",
};
const result = await cleanupMultiModel({ force: true });
const result = await cleanupMultiModel({ mode: "cli", force: true });
expect(result.success).toBe(true);
expect(result.localTagsDeleted).toBe(2);
@@ -222,7 +226,11 @@ describe("cleanupMultiModel", () => {
stderr: "",
};
const result = await cleanupMultiModel({ force: true, remote: undefined });
const result = await cleanupMultiModel({
mode: "cli",
force: true,
remote: undefined,
});
expect(result.success).toBe(true);
expect(executedCommands).toContain(
@@ -253,6 +261,7 @@ describe("cleanupMultiModel", () => {
};
const result = await cleanupMultiModel({
mode: "cli",
force: true,
remote: "upstream",
});
@@ -277,6 +286,7 @@ describe("cleanupMultiModel", () => {
};
const result = await cleanupMultiModel({
mode: "cli",
force: true,
remote: "nonexistent",
});
@@ -303,7 +313,7 @@ describe("cleanupMultiModel", () => {
stderr: "",
};
const result = await cleanupMultiModel({ force: true });
const result = await cleanupMultiModel({ mode: "cli", force: true });
expect(result.success).toBe(true);
expect(result.availableRemotes).toEqual([]);
@@ -339,7 +349,7 @@ describe("cleanupMultiModel", () => {
} as any;
spyOn(readline, "createInterface").mockImplementation(() => mockInterface);
const result = await cleanupMultiModel({ force: false });
const result = await cleanupMultiModel({ mode: "cli", force: false });
expect(result.success).toBe(true);
expect(result.localTagsDeleted).toBe(1);
@@ -392,7 +402,7 @@ describe("cleanupMultiModel", () => {
stderr: "",
};
const result = await cleanupMultiModel({ force: true });
const result = await cleanupMultiModel({ mode: "cli", force: true });
expect(result.success).toBe(true);
expect(result.localTagsDeleted).toBe(3);
+9
View File
@@ -79,6 +79,7 @@ describe("closeMultiModel", () => {
};
const result = await closeMultiModel({
mode: "cli",
sessionName: "test-session",
cleanupWorktrees: false,
force: false,
@@ -103,6 +104,7 @@ describe("closeMultiModel", () => {
};
const result = await closeMultiModel({
mode: "cli",
sessionName: "test-session",
cleanupWorktrees: false,
force: false,
@@ -161,6 +163,7 @@ describe("closeMultiModel", () => {
} as any;
const result = await closeMultiModel({
mode: "cli",
sessionName: "test-session",
cleanupWorktrees: true,
force: true,
@@ -206,6 +209,7 @@ describe("closeMultiModel", () => {
spyOn(readline, "createInterface").mockImplementation(() => mockInterface);
const result = await closeMultiModel({
mode: "cli",
sessionName: "test-session",
cleanupWorktrees: true,
force: false,
@@ -251,6 +255,7 @@ describe("closeMultiModel", () => {
} as any;
const result = await closeMultiModel({
mode: "cli",
sessionName: "test-session",
cleanupWorktrees: true,
force: false,
@@ -322,6 +327,7 @@ describe("closeMultiModel", () => {
};
const result = await closeMultiModel({
mode: "cli",
sessionName: "test-session",
cleanupWorktrees: true,
force: true,
@@ -380,6 +386,7 @@ describe("closeMultiModel", () => {
} as any;
const result = await closeMultiModel({
mode: "cli",
sessionName: unsanitized,
cleanupWorktrees: true,
force: true,
@@ -422,6 +429,7 @@ describe("closeMultiModel", () => {
};
const result = await closeMultiModel({
mode: "cli",
sessionName: unsanitized,
cleanupWorktrees: false,
force: false,
@@ -465,6 +473,7 @@ describe("closeMultiModel", () => {
] = { ok: true, stdout: "", stderr: "" };
const result = await closeMultiModel({
mode: "cli",
sessionName: "test-session",
cleanupWorktrees: true,
force: true,
+1
View File
@@ -62,6 +62,7 @@ describe("closeMultiModel unexpected error handling", () => {
test("catches thrown error and returns failure", async () => {
const result = await closeMultiModel({
mode: "cli",
sessionName: "any-session",
cleanupWorktrees: false,
force: false,
+18
View File
@@ -94,6 +94,7 @@ describe("multi-model launch", () => {
test("fails if session name is empty", async () => {
const result = await openMultiModel({
mode: "cli",
sessionName: "",
models: ["openai/gpt-5.2"],
});
@@ -105,6 +106,7 @@ describe("multi-model launch", () => {
test("fails if no models are provided", async () => {
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: [],
});
@@ -116,6 +118,7 @@ describe("multi-model launch", () => {
test("fails if duplicate models are provided", async () => {
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2", "openai/gpt-5.2"],
});
@@ -133,6 +136,7 @@ describe("multi-model launch", () => {
};
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -152,6 +156,7 @@ describe("multi-model launch", () => {
};
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -174,6 +179,7 @@ describe("multi-model launch", () => {
};
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -191,6 +197,7 @@ describe("multi-model launch", () => {
test("fails if model name is not in allowlist", async () => {
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["invalid/model"],
});
@@ -215,6 +222,7 @@ describe("multi-model launch", () => {
};
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -232,6 +240,7 @@ describe("multi-model launch", () => {
test("successfully plans and executes tmux launch with single model", async () => {
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -258,6 +267,7 @@ describe("multi-model launch", () => {
] = { ok: false, stdout: "", stderr: "" };
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2", "anthropic/claude-3-5-sonnet"],
});
@@ -289,6 +299,7 @@ describe("multi-model launch", () => {
] = { ok: false, stdout: "", stderr: "" };
const result = await openMultiModel({
mode: "cli",
sessionName: "test session!",
models: ["openai/gpt-5.2"],
});
@@ -326,6 +337,7 @@ describe("multi-model launch", () => {
] = { ok: true, stdout: "", stderr: "" };
const result = await openMultiModel({
mode: "cli",
sessionName: unsanitized,
models: ["openai/gpt-5.2"],
});
@@ -373,6 +385,7 @@ describe("multi-model launch", () => {
};
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -399,6 +412,7 @@ describe("multi-model launch", () => {
});
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -420,6 +434,7 @@ describe("multi-model launch", () => {
] = { ok: true, stdout: "", stderr: "" };
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -444,6 +459,7 @@ describe("multi-model launch", () => {
] = { ok: false, stdout: "", stderr: "git error" };
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2"],
});
@@ -475,6 +491,7 @@ describe("multi-model launch", () => {
] = { ok: false, stdout: "", stderr: "" };
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: ["openai/gpt-5.2", "anthropic/gpt-5.2"],
});
@@ -507,6 +524,7 @@ describe("multi-model launch", () => {
] = { ok: false, stdout: "", stderr: "" };
const result = await openMultiModel({
mode: "cli",
sessionName: "test-session",
models: [longModel],
});