Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,12 @@
"repo": "Azure/git-ape"
}
},
{
"name": "git-worktree-explorer",
"source": "extensions/git-worktree-explorer",
"description": "Visualize the active Git repository through worktrees, branches, commits, and optional GitHub pull request context.",
"version": "1.0.0"
},
{
"name": "github-copilot-modernization",
"description": "Autonomous application modernization using multi-agent orchestration for GitHub Copilot CLI. Supports Java upgrades (8→21, Spring Boot 2.x→3.x), .NET modernization, Azure migration, CVE/vulnerability fixing, and application rearchitecture (monolith-to-microservices). Features a 3-level agent hierarchy (orchestrator → coordinators → executors) with enterprise rulebook support for embedding organizational policies into the workflow.",
Expand Down
18 changes: 18 additions & 0 deletions extensions/git-worktree-explorer/.github/plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "git-worktree-explorer",
"description": "Visualize the active Git repository through worktrees, branches, commits, and optional GitHub pull request context.",
"version": "1.0.0",
"author": {
"name": "GitHub Copilot"
},
"keywords": [
"branch-visualization",
"canvas",
"commit-history",
"git",
"repository-topology",
"worktrees"
],
"logo": "assets/preview.png",
"extensions": "."
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions extensions/git-worktree-explorer/extension.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { CanvasError, createCanvas, joinSession } from "@github/copilot-sdk/extension";
import { getServerEntry, refreshServer, startServer, stopServer } from "./server.mjs";

const session = await joinSession({
canvases: [
createCanvas({
id: "git-worktree-explorer",
displayName: "Git Worktree Explorer",
description: "Explore the active Git repository through worktrees, branches, commits, and related GitHub pull requests.",
inputSchema: {
type: "object",
additionalProperties: false,
properties: {
startAt: {
type: "string",
enum: ["repository"],
description: "Initial topology level.",
},
},
},
actions: [
{
name: "refresh",
description: "Refresh Git and GitHub information shown by an open explorer.",
inputSchema: {
type: "object",
additionalProperties: false,
properties: {},
},
handler: async (ctx) => {
try {
const snapshot = await refreshServer(ctx.instanceId);
return {
gatheredAt: snapshot.gatheredAt,
worktrees: snapshot.worktrees.length,
branches: snapshot.branches.length,
};
} catch (error) {
throw new CanvasError("git_refresh_failed", error.message);
}
},
},
{
name: "focus_node",
description: "Ask an open explorer to focus a repository, worktree, or branch node by its canvas node ID.",
inputSchema: {
type: "object",
additionalProperties: false,
properties: {
nodeId: { type: "string", minLength: 1 },
},
required: ["nodeId"],
},
handler: async (ctx) => {
const entry = getServerEntry(ctx.instanceId);
if (!entry) throw new CanvasError("canvas_not_open", "Canvas instance is not open.");
const nodeId = ctx.input?.nodeId;
const snapshot = entry.snapshot;
const exists = nodeId === "repository"
|| snapshot.worktrees.some((item) => item.id === nodeId)
|| snapshot.branches.some((item) => item.id === nodeId);
if (!exists) throw new CanvasError("git_node_not_found", `Git node not found: ${nodeId}`);
for (const client of entry.clients) {
client.write(`event: focus\ndata: ${JSON.stringify({ nodeId })}\n\n`);
}
return { nodeId };
},
},
],
open: async (ctx) => {
const cwd = ctx.session?.workingDirectory;
if (!cwd) {
throw new CanvasError("workspace_unavailable", "The active session working directory is unavailable.");
}
try {
const entry = await startServer(ctx.instanceId, {
cwd,
sendPrompt: async (prompt) => session.send({ prompt }),
});
return {
title: "Git Worktree Explorer",
status: `${entry.snapshot.worktrees.length} worktrees · ${entry.snapshot.branches.length} branches`,
url: entry.url,
};
} catch (error) {
throw new CanvasError("git_repository_unavailable", error.message);
}
},
onClose: async (ctx) => {
await stopServer(ctx.instanceId);
},
}),
],
});
Loading
Loading