You are helping build a VS Code extension called GLAT (Global Local Agent Transport).
GLAT allows developers using AI coding agents (like GitHub Copilot) to share structured context about uncommitted changes before commits.
Your task is to implement the change card generation pipeline and Supabase storage layer.
Keep the implementation minimal and production‑like.
GLAT works by converting local code changes into Change Cards.
A change card represents:
- what changed
- who changed it
- which files may be impacted
These cards are stored in Supabase so other developers can retrieve relevant context.
When a developer runs:
GLAT: Broadcast Local Changes
The extension should:
- Detect changed files using git
- Generate a change card
- Store the card in Supabase
When another developer runs:
GLAT: Prepare Context for Copilot
The extension should:
- Detect the active file
- Query Supabase for change cards impacting that file
- Inject relevant summaries into a Copilot prompt
Use the following schema:
{
id: string
author: string
timestamp: string
changed_files: string[]
impacted_files: string[]
summary: string
}
Example:
{
"id": "uuid",
"author": "kiko",
"timestamp": "2026-03-14T19:00:00Z",
"changed_files": ["backend/user.ts"],
"impacted_files": ["frontend/UserCard.tsx"],
"summary": "Backend user response field fullName was renamed to displayName"
}
Use Supabase as the backend database.
Create a table:
change_cards
Schema:
id uuid primary key
author text
timestamp timestamptz
changed_files jsonb
impacted_files jsonb
summary text
This allows fast querying of impacted files.
Install Supabase client:
npm install @supabase/supabase-js
Initialize client:
import { createClient } from "@supabase/supabase-js"
const supabase = createClient(
process.env.SUPABASE_URL!,
process.env.SUPABASE_ANON_KEY!
)
Command ID:
glat.broadcastChanges
Steps:
- Get workspace root
Use:
vscode.workspace.workspaceFolders
- Run git command
git diff --name-only
Use Node:
child_process.exec
-
Parse changed files into array.
-
Generate impacted_files
For MVP:
impacted_files = changed_files
- Create change card object.
Example:
const card = {
id: crypto.randomUUID(),
author: "developer",
timestamp: new Date().toISOString(),
changed_files: changedFiles,
impacted_files: changedFiles,
summary: "Local code changes detected"
}
- Insert into Supabase.
await supabase
.from("change_cards")
.insert(card)
- Notify the user.
vscode.window.showInformationMessage("GLAT change card broadcasted")
Command ID:
glat.prepareContext
Steps:
- Get active editor
const editor = vscode.window.activeTextEditor
- Extract active file path
const activeFile = editor.document.fileName
- Query Supabase for relevant change cards
const { data } = await supabase
.from("change_cards")
.select("*")
.contains("impacted_files", [activeFile])
- Ask the user for a prompt
vscode.window.showInputBox()
- Build an augmented prompt.
Example:
Task:
${userPrompt}
Relevant teammate changes:
${cards.map(c => "- " + c.summary).join("\n")}
Current file:
${fileContents}
- Open prompt in a new editor so the user can paste it into Copilot.
vscode.workspace.openTextDocument({
content: prompt,
language: "markdown"
})
vscode.window.showTextDocument(document)
Keep the system simple.
Do not implement:
- embeddings
- dependency graphs
- automatic Copilot integration
- complex indexing
Use only:
- git diff
- change cards
- Supabase storage
- file‑level retrieval
The feature works if:
- A developer runs GLAT Broadcast Local Changes.
- A change card is inserted into Supabase.
- Another developer runs GLAT Prepare Context for Copilot.
- Relevant change cards are retrieved.
- The extension generates a prompt containing teammate change summaries.
- AI‑generated change summaries
- AI prediction of impacted files
- symbol‑level indexing
- real‑time updates using Supabase subscriptions