opencode-plugin-boops 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/browse +58 -2
- package/package.json +1 -1
package/cli/browse
CHANGED
|
@@ -56,6 +56,37 @@ function isPluginInstalled() {
|
|
|
56
56
|
|
|
57
57
|
const PLUGIN_INSTALLED = isPluginInstalled();
|
|
58
58
|
|
|
59
|
+
// Event descriptions for the picker
|
|
60
|
+
const eventDescriptions = {
|
|
61
|
+
"session.idle": "AI completes response",
|
|
62
|
+
"permission.asked": "AI needs permission",
|
|
63
|
+
"session.error": "Error occurs",
|
|
64
|
+
"command.executed": "Command executed",
|
|
65
|
+
"file.edited": "File edited",
|
|
66
|
+
"file.watcher.updated": "File watcher detected change",
|
|
67
|
+
"installation.updated": "Installation/package updated",
|
|
68
|
+
"lsp.client.diagnostics": "LSP diagnostics received",
|
|
69
|
+
"lsp.updated": "LSP server updated",
|
|
70
|
+
"message.part.removed": "Message part removed",
|
|
71
|
+
"message.part.updated": "Message part updated",
|
|
72
|
+
"message.removed": "Message removed",
|
|
73
|
+
"message.updated": "Message updated",
|
|
74
|
+
"permission.replied": "Permission response given",
|
|
75
|
+
"server.connected": "Connected to server",
|
|
76
|
+
"session.created": "New session created",
|
|
77
|
+
"session.compacted": "Session compacted",
|
|
78
|
+
"session.deleted": "Session deleted",
|
|
79
|
+
"session.diff": "Session diff generated",
|
|
80
|
+
"session.status": "Session status changed",
|
|
81
|
+
"session.updated": "Session updated",
|
|
82
|
+
"todo.updated": "Todo list updated",
|
|
83
|
+
"tool.execute.before": "Before tool execution",
|
|
84
|
+
"tool.execute.after": "After tool execution",
|
|
85
|
+
"tui.prompt.append": "Text appended to prompt",
|
|
86
|
+
"tui.command.execute": "TUI command executed",
|
|
87
|
+
"tui.toast.show": "Toast notification shown"
|
|
88
|
+
};
|
|
89
|
+
|
|
59
90
|
// Load current boops.toml config
|
|
60
91
|
function loadCurrentConfig() {
|
|
61
92
|
const configPath = join(homedir(), ".config", "opencode", "plugins", "boops", "boops.toml");
|
|
@@ -1115,10 +1146,14 @@ async function browse() {
|
|
|
1115
1146
|
const boxHeight = Math.min(availableEvents.length + 4, termHeight - boxStartY - fixedFooterLines);
|
|
1116
1147
|
|
|
1117
1148
|
// Calculate scroll offset for event list
|
|
1118
|
-
const maxVisibleEvents = boxHeight -
|
|
1149
|
+
const maxVisibleEvents = boxHeight - 6; // Reserve space for header(2) + description(2) + footer(2)
|
|
1119
1150
|
const eventScrollOffset = Math.max(0, Math.min(state.pickerSelectedEvent - Math.floor(maxVisibleEvents / 2), availableEvents.length - maxVisibleEvents));
|
|
1120
1151
|
const eventEndIndex = Math.min(eventScrollOffset + maxVisibleEvents, availableEvents.length);
|
|
1121
1152
|
|
|
1153
|
+
// Get selected event info
|
|
1154
|
+
const selectedEvent = availableEvents[state.pickerSelectedEvent];
|
|
1155
|
+
const eventDesc = eventDescriptions[selectedEvent] || "No description available";
|
|
1156
|
+
|
|
1122
1157
|
// Draw each line of the picker box
|
|
1123
1158
|
for (let row = 0; row < boxHeight; row++) {
|
|
1124
1159
|
const screenY = boxStartY + row;
|
|
@@ -1141,6 +1176,14 @@ async function browse() {
|
|
|
1141
1176
|
} else if (row === 2) {
|
|
1142
1177
|
// Separator
|
|
1143
1178
|
process.stdout.write(`\x1b[38;5;240m├${'─'.repeat(pickerWidth - 2)}┤\x1b[0m`);
|
|
1179
|
+
} else if (row === boxHeight - 3) {
|
|
1180
|
+
// Separator before description
|
|
1181
|
+
process.stdout.write(`\x1b[38;5;240m├${'─'.repeat(pickerWidth - 2)}┤\x1b[0m`);
|
|
1182
|
+
} else if (row === boxHeight - 2) {
|
|
1183
|
+
// Event description
|
|
1184
|
+
const desc = eventDesc.length > pickerWidth - 4 ? eventDesc.slice(0, pickerWidth - 7) + '...' : eventDesc;
|
|
1185
|
+
const padding = ' '.repeat(Math.max(0, pickerWidth - desc.length - 4));
|
|
1186
|
+
process.stdout.write(`\x1b[38;5;240m│\x1b[0m \x1b[38;5;246m${desc}\x1b[0m${padding} \x1b[38;5;240m│\x1b[0m`);
|
|
1144
1187
|
} else if (row === boxHeight - 1) {
|
|
1145
1188
|
// Bottom border
|
|
1146
1189
|
process.stdout.write(`\x1b[38;5;240m└${'─'.repeat(pickerWidth - 2)}┘\x1b[0m`);
|
|
@@ -1231,7 +1274,7 @@ async function browse() {
|
|
|
1231
1274
|
let controls;
|
|
1232
1275
|
if (state.pickerMode) {
|
|
1233
1276
|
controls = PLUGIN_INSTALLED
|
|
1234
|
-
? ' \x1b[38;5;240m↑/↓ select
|
|
1277
|
+
? ' \x1b[38;5;240m↑/↓ select enter play ctrl+s save d unassign ←/esc close\x1b[0m'
|
|
1235
1278
|
: ' \x1b[38;5;240m↑/↓ select event enter play ←/esc close \x1b[38;5;208m(save disabled)\x1b[0m';
|
|
1236
1279
|
} else {
|
|
1237
1280
|
controls = ' \x1b[38;5;240m↑/↓ navigate ←/→ tags / search s assign enter play q quit\x1b[0m';
|
|
@@ -1896,6 +1939,19 @@ async function browse() {
|
|
|
1896
1939
|
// Stay in picker mode, just show it was saved
|
|
1897
1940
|
render();
|
|
1898
1941
|
return;
|
|
1942
|
+
} else if (key === 'd') {
|
|
1943
|
+
// 'd' - unassign/delete sound from selected event
|
|
1944
|
+
const config = loadCurrentConfig();
|
|
1945
|
+
const event = availableEvents[state.pickerSelectedEvent];
|
|
1946
|
+
|
|
1947
|
+
if (config.sounds && config.sounds[event]) {
|
|
1948
|
+
delete config.sounds[event];
|
|
1949
|
+
saveConfig(config);
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
// Stay in picker mode
|
|
1953
|
+
render();
|
|
1954
|
+
return;
|
|
1899
1955
|
}
|
|
1900
1956
|
return; // Ignore other keys in picker mode
|
|
1901
1957
|
}
|