Add opencode resume command
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
|
import { buildProviderCommand } from "@/utils/provider-command-templates";
|
||||||
|
|
||||||
|
describe("buildProviderCommand", () => {
|
||||||
|
test("builds OpenCode resume commands from native session ids", () => {
|
||||||
|
expect(
|
||||||
|
buildProviderCommand({
|
||||||
|
provider: "opencode",
|
||||||
|
id: "resume",
|
||||||
|
sessionId: "ses_abc123",
|
||||||
|
}),
|
||||||
|
).toBe("opencode --session ses_abc123");
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -20,6 +20,9 @@ export const PROVIDER_COMMAND_TEMPLATES: Record<
|
|||||||
pi: {
|
pi: {
|
||||||
resume: "pi --session {sessionId}",
|
resume: "pi --session {sessionId}",
|
||||||
},
|
},
|
||||||
|
opencode: {
|
||||||
|
resume: "opencode --session {sessionId}",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function renderTemplate(template: string, vars: Record<string, string>): string {
|
function renderTemplate(template: string, vars: Record<string, string>): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user