Official
tabs
The tabbed detail pane beside the chat: files to edit and diffs (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/tabs@0.2.4
Permissions in 0.2.4
Files
contract.ts1.6 KB
// The divergence/tabs service: other plugins open and close files, diffs,
// terminals and diagrams, which are this plugin's tab kinds and show in the
// side split or a task's pane (specs/tasks-and-splits/05), and follow which
// one is visible. Zod is the contract; the host
// derives JSON Schema from it and checks every call, result and event.
import * as z from "zod";
import { defineService } from "divergence/services";
export const TabKind = z.enum(["file", "diff", "terminal", "diagram"]);
// Which tab: tabs are known by kind and path (a terminal's path is its id).
export const TabRef = z.object({ kind: TabKind, path: z.string() });
export const OpenTab = z.object({
kind: TabKind,
workspaceId: z.string(),
path: z.string(),
// A diff tab shows this unified diff; a diagram tab draws this source of
// a markdown fence of `language`.
diff: z.string().optional(),
source: z.string().optional(),
language: z.string().optional(),
title: z.string().optional(),
icon: z.string().optional(),
// A file tab's editor takes the keyboard once it shows: a file the
// user picked from a list.
focus: z.boolean().optional(),
// The chat it comes from (a diff from a tool call, a diagram from a
// reply): the tab then belongs to that chat's task.
chatId: z.string().optional(),
});
export const Tabs = defineService("divergence/tabs", "2.0.0", {
methods: {
open: { params: OpenTab, result: z.object({ id: z.string() }) },
close: { params: TabRef, result: z.null() },
active: { params: z.object({}), result: TabRef.nullable() },
},
events: {
activeChanged: TabRef.nullable(),
},
});
export type Tabs = typeof Tabs;
No comments yet.