mirror of
https://github.com/bendtherules/opencode-multi-model.git
synced 2026-08-18 21:52:11 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f15a8f8d2 | ||
|
|
46d81b4162 | ||
|
|
c6d6c889d8 | ||
|
|
6367d99e7b |
@@ -1,7 +1,8 @@
|
|||||||
// Re-export open and close tools for project-level use via relative paths.
|
// Re-export open and close tools for project-level use via relative paths.
|
||||||
// For published package usage, change imports to "@username/opencode-multi-model".
|
// For published package usage, change imports to "@username/opencode-multi-model".
|
||||||
|
|
||||||
|
import { cleanupTool } from "../../src/tools/cleanup";
|
||||||
import { closeTool } from "../../src/tools/close";
|
import { closeTool } from "../../src/tools/close";
|
||||||
import { openTool } from "../../src/tools/open";
|
import { openTool } from "../../src/tools/open";
|
||||||
|
|
||||||
export { closeTool as close, openTool as open };
|
export { cleanupTool as cleanup, closeTool as close, openTool as open };
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "opencode-multi-model",
|
"name": "opencode-multi-model",
|
||||||
"version": "0.0.10",
|
"version": "0.1.0",
|
||||||
"description": "Launch multiple AI models in tmux sessions - OpenCode Plugin, CLI, and Project Tool",
|
"description": "Launch multiple AI models in tmux sessions - OpenCode Plugin, CLI, and Project Tool",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
+12
-8
@@ -8,8 +8,11 @@ import { cleanupMultiModel } from "../core/cleanup";
|
|||||||
* Used to clean up recovery tags created by the close command.
|
* Used to clean up recovery tags created by the close command.
|
||||||
*/
|
*/
|
||||||
export const cleanupTool = tool({
|
export const cleanupTool = tool({
|
||||||
description:
|
description: `Delete all archive tags from the local repository and, optionally, from a remote.
|
||||||
"Delete all archive tags from local and optionally remote repository",
|
|
||||||
|
Arguments:
|
||||||
|
-\`remote\` (string, optional): Specify a remote name to which deletions should be pushed. If omitted, the first available remote is used.
|
||||||
|
- \`noRemote\` (boolean, optional): When true, only delete local tags and do not push deletions to any remote.`,
|
||||||
args: {
|
args: {
|
||||||
remote: tool.schema
|
remote: tool.schema
|
||||||
.union([
|
.union([
|
||||||
@@ -17,21 +20,22 @@ export const cleanupTool = tool({
|
|||||||
.string()
|
.string()
|
||||||
.describe(
|
.describe(
|
||||||
"Remote name to push deletions to. Error if doesn't exist.",
|
"Remote name to push deletions to. Error if doesn't exist.",
|
||||||
),
|
)
|
||||||
tool.schema
|
|
||||||
.literal(false)
|
|
||||||
.describe("Only delete local tags, don't push to remote."),
|
|
||||||
])
|
])
|
||||||
.optional()
|
.optional()
|
||||||
.describe(
|
.describe(
|
||||||
"Remote handling: string=specific remote, false=local-only, undefined=first available remote",
|
"Remote handling: string=specific remote, undefined=first available remote",
|
||||||
),
|
),
|
||||||
|
noRemote: tool.schema
|
||||||
|
.literal(true)
|
||||||
|
.describe("Only delete local tags, don't push to remote.")
|
||||||
|
.optional(),
|
||||||
},
|
},
|
||||||
async execute(args, _context) {
|
async execute(args, _context) {
|
||||||
// In plugin mode, we skip confirmation (force=true)
|
// In plugin mode, we skip confirmation (force=true)
|
||||||
const result = await cleanupMultiModel({
|
const result = await cleanupMultiModel({
|
||||||
force: true,
|
force: true,
|
||||||
remote: args.remote,
|
remote: args.noRemote ? false : args.remote,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
|||||||
+6
-2
@@ -8,8 +8,12 @@ import { closeMultiModel } from "../core/close";
|
|||||||
* creates archive tags, and deletes associated branches.
|
* creates archive tags, and deletes associated branches.
|
||||||
*/
|
*/
|
||||||
export const closeTool = tool({
|
export const closeTool = tool({
|
||||||
description:
|
description: `Close a multi-model tmux session and optionally clean up worktrees and branches.
|
||||||
"Close a multi-model tmux session and optionally cleanup worktrees and branches",
|
|
||||||
|
Arguments:
|
||||||
|
- \`sessionName\` (string, required): tmux session name to close.
|
||||||
|
- \`cleanupWorktrees\` (boolean, optional, default: true): Whether to remove worktrees and delete branches.
|
||||||
|
- \`createArchiveTags\` (boolean, optional, default: true): Whether to create archive tags before deleting branches.`,
|
||||||
args: {
|
args: {
|
||||||
sessionName: tool.schema
|
sessionName: tool.schema
|
||||||
.string()
|
.string()
|
||||||
|
|||||||
+5
-1
@@ -9,7 +9,11 @@ import { getBinaryName } from "../core/utils";
|
|||||||
* Returns instructions for attaching to and cleaning up the session.
|
* Returns instructions for attaching to and cleaning up the session.
|
||||||
*/
|
*/
|
||||||
export const openTool = tool({
|
export const openTool = tool({
|
||||||
description: "Launch multiple OpenCode models in tmux",
|
description: `Launch multiple OpenCode models in tmux.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
- \`sessionName\` (string, required): tmux session name to create.
|
||||||
|
- \`models\` (array of strings, required): one or more OpenCode model IDs to launch.`,
|
||||||
args: {
|
args: {
|
||||||
sessionName: tool.schema
|
sessionName: tool.schema
|
||||||
.string()
|
.string()
|
||||||
|
|||||||
Reference in New Issue
Block a user