@nandoblanco/opencode-local-search 1.0.1 → 1.1.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/README.md +27 -9
- package/cli.js +19 -1
- package/dist/gui-experimental.cjs +1 -0
- package/package.json +22 -3
- package/src/gui.css +616 -0
- package/src/gui.tsx +1175 -0
- package/src/index.ts +6 -6
- package/src/rpc.ts +107 -0
- package/src/server.ts +105 -5
- package/src/tui.ts +448 -344
package/README.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# opencode-local-search
|
|
2
2
|
|
|
3
|
-
**Local-first, zero-token interactive session search plugin for OpenCode**: indexes
|
|
3
|
+
**Local-first, zero-token interactive session search plugin for OpenCode**: indexes local SQLite session history, previews matching messages, tools, and files as you type, and opens matching conversations from the TUI or OpenCode Desktop.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
+
## OpenCode Desktop Support
|
|
8
|
+
|
|
9
|
+
**Replaces OpenCode Desktop's built-in session search.** The titlebar, vertical-tabs, Home session search, and built-in Search sessions dialog route into this plugin's Session Search interface.
|
|
10
|
+
|
|
11
|
+
**Now available in OpenCode Desktop as well as the TUI.** Search local conversation history in a persistent Session Search side panel, preview matching messages and file/tool details, and open matching sessions without a model turn. Press `Ctrl+Shift+F` to open or focus the panel, or `Ctrl+Alt+F` to toggle it. When no session is active, search opens in a fallback dialog.
|
|
12
|
+
|
|
13
|
+
**In the CLI/TUI, search is an additional tool rather than a replacement.** Open it with `/search` or the command palette. The built-in `/sessions` picker remains available.
|
|
14
|
+
|
|
15
|
+
One global OpenCode V2 plugin entry loads the server RPC bridge, TUI, and Desktop integration together. Both interfaces search the same local session history; see [Installation](#installation) for setup.
|
|
16
|
+
|
|
7
17
|
## Background
|
|
8
18
|
|
|
9
19
|
This project started as a small local CLI script wired to a custom `/search` command. It queried OpenCode's SQLite database and printed matching session IDs into the chat, which worked as a quick prototype but had two limitations in daily use:
|
|
@@ -28,6 +38,7 @@ This project started as a small local CLI script wired to a custom `/search` com
|
|
|
28
38
|
| Session-level multi-term AND ranking | Searching `auth cookie` finds sessions where both terms appear anywhere across the session title, user prompts, assistant replies, tool calls, or file paths, ranking single-message co-occurrences higher |
|
|
29
39
|
| Typo-tolerant fuzzy & regex search | Supports `"exact phrase"`, `/regex/i` (`re:`), explicit `~fuzzy` terms, and automatic bounded Levenshtein fallback when a multi-word query has a typo |
|
|
30
40
|
| Auto-scroll to matched message | Pressing `Enter` (or clicking any snippet card in the preview pane) opens the session and automatically scrolls the transcript to the exact matched message |
|
|
41
|
+
| OpenCode Desktop search | Persistent Session Search side panel backed by `SearchRpc.query`, with a fallback dialog when no session is active, scope and query filters, snippets, and session navigation |
|
|
31
42
|
|
|
32
43
|
## Installation
|
|
33
44
|
|
|
@@ -49,24 +60,24 @@ opencode plugin add github:nandoblanco/opencode-local-search
|
|
|
49
60
|
|
|
50
61
|
### Option 2: Manual Configuration
|
|
51
62
|
|
|
52
|
-
Add `@nandoblanco/opencode-local-search` to `~/.config/opencode/
|
|
63
|
+
Add `@nandoblanco/opencode-local-search` to the global `~/.config/opencode/opencode.jsonc` (or `$XDG_CONFIG_HOME/opencode/opencode.jsonc`) to load the server RPC bridge, TUI, and Desktop parts together:
|
|
53
64
|
|
|
54
65
|
```json
|
|
55
66
|
{
|
|
56
67
|
"plugins": [
|
|
57
|
-
|
|
58
|
-
"@nandoblanco/opencode-local-search",
|
|
59
|
-
{
|
|
68
|
+
{
|
|
69
|
+
"package": "@nandoblanco/opencode-local-search",
|
|
70
|
+
"options": {
|
|
60
71
|
"dialogWidth": "80%"
|
|
61
72
|
}
|
|
62
|
-
|
|
73
|
+
}
|
|
63
74
|
]
|
|
64
75
|
}
|
|
65
76
|
```
|
|
66
77
|
|
|
67
78
|
### From a Local Directory
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
For development, use Node.js 26.4 or newer to meet the OpenTUI dependency's declared minimum. Clone this repository, run `npm ci` and `npm run build` to build the Desktop bundle, then reference the directory in the global `opencode.jsonc`. TUI-only use does not need the GUI build. The root `overrides` pin patched `glob` and `minimatch` versions for this repository's development dependencies; they do not alter the OpenCode host application's dependencies:
|
|
70
81
|
|
|
71
82
|
```json
|
|
72
83
|
{
|
|
@@ -90,6 +101,12 @@ Clone or copy this folder and reference it in `~/.config/opencode/cli.json` (no
|
|
|
90
101
|
}
|
|
91
102
|
```
|
|
92
103
|
|
|
104
|
+
### OpenCode Desktop
|
|
105
|
+
|
|
106
|
+
Run `/search [query]` or press `Ctrl+Shift+F` (`Cmd+Shift+F` on macOS) to open and focus the persistent Session Search side panel. `Ctrl+Alt+F` (`Cmd+Option+F`) toggles it. Without an active session, these commands open a dialog. The plugin also intercepts the built-in titlebar, vertical-tab, and home-session search entry points.
|
|
107
|
+
|
|
108
|
+
Desktop requests use a 35 ms debounce and a sequence counter to discard stale responses. They call `SearchRpc.query` on the server, which returns up to 60 session results with message snippets and file/tool metadata. The TUI continues to query SQLite locally. Exact-message scrolling in the TUI uses the render-tree traversal described below; Desktop uses its own session navigation path.
|
|
109
|
+
|
|
93
110
|
## TUI Query Syntax (`/search`)
|
|
94
111
|
|
|
95
112
|
Type filters inline in the search bar or toggle them with keyboard shortcuts and clickable filter pills.
|
|
@@ -204,7 +221,7 @@ When you press `Enter` on a session (or click a specific snippet card in the rig
|
|
|
204
221
|
|
|
205
222
|
### 7. Agent Tools Registered by the Server Plugin
|
|
206
223
|
|
|
207
|
-
`src/server.ts`
|
|
224
|
+
`src/server.ts` registers `SearchRpc.query`, implemented by `executeSearchQuery()`, for Desktop clients. It loads the read-only SQLite index and runs the same query parser and ranking functions as the TUI. The server registers **zero LLM agent tools** and adds **0 schema tokens** to model context. `src/rpc.ts` exports the shared contract; `src/gui.tsx` and `src/gui.css` build to `dist/gui-experimental.cjs` with `npm run build`.
|
|
208
225
|
|
|
209
226
|
### 8. Token Usage Breakdown
|
|
210
227
|
|
|
@@ -216,10 +233,11 @@ Every operation in `opencode-local-search` uses zero LLM tokens:
|
|
|
216
233
|
| Live filtering, fuzzy matching & snippet preview | **0 tokens** | Runs synchronously in memory (`searchSessionIndex`) inside the TUI process on every keystroke |
|
|
217
234
|
| Jumping to a matched session & message (`Enter`) | **0 tokens** | Navigates via `context.ui.router.navigate()` and scrolls the local `@opentui` transcript tree directly |
|
|
218
235
|
| Server plugin entrypoint (`src/server.ts`) | **0 schema tokens** | Registers no LLM tools or system prompts |
|
|
236
|
+
| Desktop queries and session navigation | **0 tokens** | Uses the server RPC bridge and Desktop layout API without a model turn |
|
|
219
237
|
|
|
220
238
|
## Configuration Options
|
|
221
239
|
|
|
222
|
-
|
|
240
|
+
Configure the package in the global `opencode.jsonc` for all interfaces. `dialogWidth` controls the TUI popup only; Desktop uses its panel or dialog layout. TUI-specific options can also be passed in `cli.json`:
|
|
223
241
|
|
|
224
242
|
```json
|
|
225
243
|
{
|
package/cli.js
CHANGED
|
@@ -221,6 +221,21 @@ export async function installPlugin(options) {
|
|
|
221
221
|
? '["' + pkgName + '", { "dialogWidth": "' + String(opts.dialogWidth) + '" }]'
|
|
222
222
|
: '"' + pkgName + '"';
|
|
223
223
|
|
|
224
|
+
const jsoncCandidate = path.join(configDir, cliName + ".jsonc");
|
|
225
|
+
const jsonCandidate = path.join(configDir, cliName + ".json");
|
|
226
|
+
const serverConfigFile = fs.existsSync(jsoncCandidate)
|
|
227
|
+
? jsoncCandidate
|
|
228
|
+
: fs.existsSync(jsonCandidate)
|
|
229
|
+
? jsonCandidate
|
|
230
|
+
: jsoncCandidate;
|
|
231
|
+
|
|
232
|
+
const serverStatus = addPluginToJsoncFile(
|
|
233
|
+
serverConfigFile,
|
|
234
|
+
"https://" + cliName + ".ai/config.json",
|
|
235
|
+
'"' + pkgName + '"',
|
|
236
|
+
matchKey
|
|
237
|
+
);
|
|
238
|
+
|
|
224
239
|
const cliConfigFile = path.join(configDir, "cli.json");
|
|
225
240
|
const cliStatus = addPluginToJsoncFile(
|
|
226
241
|
cliConfigFile,
|
|
@@ -231,6 +246,8 @@ export async function installPlugin(options) {
|
|
|
231
246
|
|
|
232
247
|
return {
|
|
233
248
|
configDir,
|
|
249
|
+
serverConfigFile,
|
|
250
|
+
serverStatus,
|
|
234
251
|
cliConfigFile,
|
|
235
252
|
cliStatus,
|
|
236
253
|
};
|
|
@@ -256,7 +273,8 @@ if (isDirectRun) {
|
|
|
256
273
|
installPlugin({ configDir, dialogWidth })
|
|
257
274
|
.then((res) => {
|
|
258
275
|
console.log("opencode-local-search installed:");
|
|
259
|
-
console.log("
|
|
276
|
+
console.log(" Server/Desktop config: " + res.serverConfigFile + " (" + res.serverStatus + ")");
|
|
277
|
+
console.log(" TUI config: " + res.cliConfigFile + " (" + res.cliStatus + ")");
|
|
260
278
|
})
|
|
261
279
|
.catch((err) => {
|
|
262
280
|
console.error("Install failed:", err);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require("solid-js/web"),t=require("@opencode/plugin/gui"),n=require("solid-js");var r=`.ols-root{--ols-bg-surface:var(--v2-background-bg-layer-01,#141417);--ols-bg-subtle:var(--v2-background-bg-base,#0e0e11);--ols-bg-elevated:var(--v2-background-bg-layer-02,#1c1c21);--ols-bg-pill:var(--v2-background-bg-layer-03,#25252c);--ols-bg-hover:var(--v2-overlay-simple-overlay-hover,#ffffff0d);--ols-bg-pressed:var(--v2-overlay-simple-overlay-pressed,#ffffff17);--ols-border:var(--v2-border-border-muted,#ffffff14);--ols-border-strong:var(--v2-border-border-strong,#ffffff24);--ols-focus:var(--v2-border-border-focus,#3b82f6);--ols-text:var(--v2-text-text-base,#ededf0);--ols-text-muted:var(--v2-text-text-muted,#9ca3af);--ols-text-faint:var(--v2-text-text-faint,#6b7280);--ols-danger:var(--v2-state-fg-danger,#ef4444);--ols-mark-bg:#f59e0b38;--ols-mark-fg:var(--v2-text-text-base,#fde68a);box-sizing:border-box;width:100%;height:100%;min-height:0;color:var(--ols-text);font-family:var(--font-family-text,-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);letter-spacing:-.04px;-webkit-user-select:none;user-select:none;flex-direction:column;font-size:13px;font-weight:440;line-height:1.45;display:flex;overflow:hidden}.ols-root[data-scheme=light]{--ols-bg-surface:var(--v2-background-bg-layer-01,#fff);--ols-bg-subtle:var(--v2-background-bg-base,#f6f6f8);--ols-bg-elevated:var(--v2-background-bg-layer-02,#f0f0f3);--ols-bg-pill:var(--v2-background-bg-layer-03,#e6e6eb);--ols-bg-hover:var(--v2-overlay-simple-overlay-hover,#0000000b);--ols-bg-pressed:var(--v2-overlay-simple-overlay-pressed,#00000014);--ols-border:var(--v2-border-border-muted,#00000014);--ols-border-strong:var(--v2-border-border-strong,#00000024);--ols-text:var(--v2-text-text-base,#161618);--ols-text-muted:var(--v2-text-text-muted,#5c606a);--ols-text-faint:var(--v2-text-text-faint,#8c909a);--ols-mark-bg:#f59e0b47;--ols-mark-fg:#78350f}.ols-root *,.ols-root :before,.ols-root :after{box-sizing:border-box}.ols-root--modal{border-top:1px solid var(--ols-border);border-bottom:1px solid var(--ols-border);flex:1;height:min(64vh,480px);max-height:100%;overflow:hidden}.ols-root--panel{height:100%;min-height:360px}.ols-header{border-bottom:1px solid var(--ols-border);flex-direction:column;flex-shrink:0;gap:8px;padding:10px 16px;display:flex}.ols-root--panel .ols-header{padding:10px 12px}.ols-input-wrap{width:100%;display:flex}.ols-input-wrap [data-component=text-input-v2]{flex:1;width:100%}.ols-controls-bar{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;display:flex}.ols-controls-left{flex-wrap:wrap;align-items:center;gap:6px;min-width:0;display:flex}.ols-controls-right{flex-shrink:0;align-items:center;gap:6px;margin-inline-start:auto;display:flex}.ols-segment{background:var(--ols-bg-elevated);box-shadow:inset 0 0 0 1px var(--ols-border);border-radius:6px;align-items:center;padding:2px;display:inline-flex}.ols-segment-btn{height:20px;color:var(--ols-text-muted);letter-spacing:-.04px;cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;gap:5px;padding:0 8px;font-family:inherit;font-size:12px;font-weight:440;transition:background-color 85ms ease-out,color 85ms ease-out;display:inline-flex}.ols-segment-btn:hover{color:var(--ols-text)}.ols-segment-btn:focus-visible{outline:2px solid var(--ols-focus);outline-offset:1px}.ols-segment-btn--active{background:var(--ols-bg-surface);color:var(--ols-text);box-shadow:var(--v2-elevation-button-neutral,0 1px 2px #00000029);font-weight:530}.ols-active-pill{background:var(--ols-bg-pill);height:22px;color:var(--ols-text);cursor:pointer;border:0;border-radius:4px;align-items:center;gap:4px;padding:0 6px 0 8px;font-family:inherit;font-size:12px;font-weight:440;transition:background-color 85ms ease-out;display:inline-flex}.ols-active-pill:hover{background:var(--ols-bg-pressed)}.ols-active-pill:focus-visible{outline:2px solid var(--ols-focus);outline-offset:1px}.ols-error-pill{height:22px;color:var(--ols-danger);background:#ef44441f;border-radius:4px;align-items:center;padding:0 8px;font-size:12px;font-weight:530;display:inline-flex}.ols-status-count{color:var(--ols-text-faint);font-variant-numeric:tabular-nums;align-items:center;font-size:12px;display:inline-flex}.ols-split{flex:1;grid-template-columns:minmax(260px,38%) minmax(0,1fr);min-height:0;display:grid;overflow:hidden}.ols-root--panel .ols-split{grid-template-rows:minmax(170px,44%) minmax(0,1fr);grid-template-columns:1fr}.ols-column{flex-direction:column;min-width:0;min-height:0;display:flex;overflow:hidden}.ols-column--list{border-right:1px solid var(--ols-border);background:var(--ols-bg-subtle)}.ols-root--panel .ols-column--list{border-right:0;border-bottom:1px solid var(--ols-border)}.ols-column--detail{background:var(--ols-bg-surface)}.ols-list-scroll,.ols-detail-scroll{flex:1;min-height:0;overflow:hidden auto}.ols-list-scroll{flex-direction:column;gap:2px;padding:6px;display:flex}.ols-row{width:100%;color:var(--ols-text);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;flex-direction:column;gap:3px;padding:8px 10px;font-family:inherit;transition:background-color 65ms ease-out;display:flex}.ols-row:hover{background:var(--ols-bg-hover)}.ols-row:focus-visible{outline:2px solid var(--ols-focus);outline-offset:-2px}.ols-row--selected,.ols-row--selected:hover{background:var(--ols-bg-pressed)}.ols-row-top{justify-content:space-between;align-items:baseline;gap:8px;min-width:0;display:flex}.ols-row-title{color:var(--ols-text);white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:13px;font-weight:530;overflow:hidden}.ols-row-time{color:var(--ols-text-faint);font-variant-numeric:tabular-nums;flex-shrink:0;font-size:11px}.ols-row-snippet{color:var(--ols-text-muted);-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;font-size:12px;line-height:1.38;display:-webkit-box;overflow:hidden}.ols-row-meta{color:var(--ols-text-faint);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:center;gap:6px;margin-top:2px;font-size:11px;display:flex;overflow:hidden}.ols-row-hit-badge{background:var(--ols-bg-pill);height:16px;color:var(--ols-text-muted);letter-spacing:.01em;border-radius:3px;align-items:center;padding:0 5px;font-size:10px;font-weight:530;display:inline-flex}.ols-row-folder{color:var(--ols-text-muted);text-overflow:ellipsis;overflow:hidden}.ols-detail-header{border-bottom:1px solid var(--ols-border);flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;display:flex}.ols-detail-heading{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.ols-detail-title{color:var(--ols-text);white-space:nowrap;text-overflow:ellipsis;font-size:14px;font-weight:530;overflow:hidden}.ols-detail-meta{color:var(--ols-text-faint);white-space:nowrap;text-overflow:ellipsis;align-items:center;gap:6px;font-size:12px;display:flex;overflow:hidden}.ols-detail-actions{flex-shrink:0;align-items:center;gap:6px;display:flex}.ols-quick-bar{border-bottom:1px solid var(--ols-border);background:var(--ols-bg-subtle);flex-wrap:wrap;flex-shrink:0;align-items:center;gap:6px;padding:7px 16px;display:flex}.ols-quick-label{color:var(--ols-text-faint);font-size:11px}.ols-quick-chip{background:var(--ols-bg-elevated);height:20px;box-shadow:inset 0 0 0 1px var(--ols-border);color:var(--ols-text-muted);font-family:var(--font-family-mono,ui-monospace, SFMono-Regular, Consolas, monospace);cursor:pointer;border:0;border-radius:4px;align-items:center;padding:0 7px;font-size:11px;transition:background-color 65ms ease-out,color 65ms ease-out;display:inline-flex}.ols-quick-chip:hover{background:var(--ols-bg-hover);color:var(--ols-text)}.ols-timeline{divide-y:1px solid var(--ols-border);flex-direction:column;display:flex}.ols-turn{border-bottom:1px solid var(--ols-border);cursor:pointer;flex-direction:column;gap:4px;padding:12px 16px;transition:background-color 65ms ease-out;display:flex}.ols-turn:hover{background:var(--ols-bg-hover)}.ols-turn--selected{background:var(--ols-bg-pressed)}.ols-turn-header{align-items:center;gap:6px;font-size:12px;display:flex}.ols-turn-author{color:var(--ols-text);font-weight:530}.ols-turn-author--user{color:var(--ols-text)}.ols-turn-author--assistant{color:var(--ols-text-muted)}.ols-turn-author--shell{color:var(--v2-state-fg-warning,#f59e0b)}.ols-turn-chip{background:var(--ols-bg-pill);height:16px;color:var(--ols-text-muted);font-family:var(--font-family-mono,ui-monospace, SFMono-Regular, Consolas, monospace);border-radius:3px;align-items:center;padding:0 5px;font-size:10px;display:inline-flex}.ols-turn-time{color:var(--ols-text-faint);font-variant-numeric:tabular-nums;margin-inline-start:auto;font-size:11px}.ols-turn-body{color:var(--ols-text-muted);white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text;font-size:13px;line-height:1.5}.ols-mark{background:var(--ols-mark-bg);color:var(--ols-mark-fg);border-radius:2px;padding:0 2px;font-weight:530}.ols-empty{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:4px;padding:36px 20px;display:flex}.ols-empty-title{color:var(--ols-text);font-size:13px;font-weight:530}.ols-empty-sub{color:var(--ols-text-faint);max-width:280px;font-size:12px}.ols-inline-link{color:var(--ols-text);font:inherit;text-underline-offset:2px;cursor:pointer;background:0 0;border:0;padding:0;font-weight:530;text-decoration:underline}.ols-dialog-footer{justify-content:space-between;align-items:center;gap:12px;width:100%;display:flex}.ols-dialog-shortcuts{flex-wrap:wrap;align-items:center;gap:14px;display:flex}.ols-shortcut-item{color:var(--ols-text-faint);align-items:center;gap:5px;font-size:12px;display:inline-flex}@media (width<=720px){.ols-split{grid-template-rows:minmax(160px,42%) minmax(0,1fr);grid-template-columns:1fr}.ols-column--list{border-right:0;border-bottom:1px solid var(--ols-border)}}[data-component=home-session-search],[data-component=home-session-search] label,[data-component=home-session-search] input{cursor:pointer}#home-session-search-results{display:none}`,i={id:`opencode-local-search`,methods:{query:{input:{$schema:`https://json-schema.org/draft/2020-12/schema`,type:`object`,properties:{query:{type:`string`},scope:{type:`string`,enum:[`all`,`project`]},currentDirectory:{type:`string`},role:{type:`string`,enum:[`all`,`user`,`assistant`,`shell`]},datePreset:{type:`string`,enum:[`all`,`today`,`yesterday`,`7d`,`30d`]},mode:{type:`string`,enum:[`smart`,`fuzzy`,`regex`]},limit:{type:`number`},forceReload:{type:`boolean`}},required:[`query`],additionalProperties:!1},output:{$schema:`https://json-schema.org/draft/2020-12/schema`,type:`object`,additionalProperties:!0}}},events:{}},a=(0,e.template)(`<mark class=ols-mark>`),o=(0,e.template)(`<button type=button class=ols-active-pill title="Click to reset search mode"><span>`),s=(0,e.template)(`<button type=button class=ols-active-pill title="Click to reset role filter"><span>`),c=(0,e.template)(`<button type=button class=ols-active-pill title="Click to reset time filter"><span>`),l=(0,e.template)(`<div class=ols-split><div><div class=ols-list-scroll></div></div><div>`),u=(0,e.template)(`<div><div class=ols-header><div class=ols-input-wrap></div><div class=ols-controls-bar><div class=ols-controls-left><div class=ols-segment role=group aria-label="Search scope"><button type=button><span></span></button><button type=button><span>All workspaces</span></button></div></div><div class=ols-controls-right><span class=ols-status-count>`),d=(0,e.template)(`<span class=ols-error-pill>`),f=(0,e.template)(`<div class=ols-empty><div class=ols-empty-title>Unable to search sessions</div><div class=ols-empty-sub>`),ee=(0,e.template)(`<button type=button class=ols-inline-link>All workspaces`),te=(0,e.template)(`<div class=ols-empty><div class=ols-empty-title>No matching sessions</div><div class=ols-empty-sub>`),ne=(0,e.template)(`<div class=ols-row-snippet>`),re=(0,e.template)(`<span class=ols-row-hit-badge>`),ie=(0,e.template)(`<span class=ols-row-folder>`),ae=(0,e.template)(`<button type=button><div class=ols-row-top><span class=ols-row-title></span><span class=ols-row-time></span></div><div class=ols-row-meta><span> messages`),oe=(0,e.template)(`<div class=ols-empty><div class=ols-empty-sub>Select a session to inspect conversation matches.`),se=(0,e.template)(`<div class=ols-detail-header><div class=ols-detail-heading><div class=ols-detail-title></div><div class=ols-detail-meta><span></span><span>·</span><span></span></div></div><div class=ols-detail-actions>`),ce=(0,e.template)(`<div class=ols-quick-bar><span class=ols-quick-label>Try:</span><button type=button class=ols-quick-chip>role:user</button><button type=button class=ols-quick-chip>tool:shell</button><button type=button class=ols-quick-chip>in:title</button><button type=button class=ols-quick-chip>since:7d`),p=(0,e.template)(`<div class=ols-timeline>`),le=(0,e.template)(`<div class=ols-detail-scroll>`),ue=(0,e.template)(`<span class=ols-turn-chip>`),de=(0,e.template)(`<div class=ols-turn><div class=ols-turn-header><span></span><span class=ols-turn-time></span></div><div class=ols-turn-body>`),fe=(0,e.template)(`<span class=ols-turn-chip>file`),pe=(0,e.template)(`<span class=ols-turn-chip>~`),me=(0,e.template)(`<div><div class=ols-turn-header><span></span><span class=ols-turn-time></span></div><div class=ols-turn-body>`),m=[`all`,`user`,`assistant`,`shell`],h=[`all`,`today`,`yesterday`,`7d`,`30d`],g=[`smart`,`fuzzy`,`regex`],he={all:`Any time`,today:`Today`,yesterday:`Yesterday`,"7d":`Last 7 days`,"30d":`Last 30 days`},ge={smart:`Smart`,fuzzy:`Fuzzy`,regex:`Regex`},_={all:`All roles`,user:`User`,assistant:`Assistant`,shell:`Shell`};function v(e,t=Date.now()){if(!e||e<=0)return``;let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);if(a<30)return`${a}d ago`;let o=new Date(e);return`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,`0`)}-${String(o.getDate()).padStart(2,`0`)}`}function _e(e){if(!e)return`unknown`;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function y(e){if(!e)return`Global`;let t=e.replace(/\\/g,`/`).split(`/`).filter(Boolean);return t.length<=2?t.join(`/`):`${t.slice(-2).join(`/`)}`}function b(e,t,n,r){if(!e)return[{text:``,match:!1}];if(n)try{let t=r?.includes(`g`)?r:`${r??`i`}g`,i=new RegExp(n,t),a=[],o=0,s,c=0;for(;(s=i.exec(e))!==null&&c++<40;)s[0].length===0?i.lastIndex++:(s.index>o&&a.push({text:e.slice(o,s.index),match:!1}),a.push({text:s[0],match:!0}),o=s.index+s[0].length);return o<e.length&&a.push({text:e.slice(o),match:!1}),a.length>0?a:[{text:e,match:!1}]}catch{return[{text:e,match:!1}]}let i=t.map(e=>e.trim().toLowerCase()).filter(e=>e.length>0).sort((e,t)=>t.length-e.length);if(i.length===0)return[{text:e,match:!1}];let a=e.toLowerCase(),o=[],s=0;for(;s<e.length;){let t=-1,n=0;for(let e of i){let r=a.indexOf(e,s);r!==-1&&(t===-1||r<t)&&(t=r,n=e.length)}if(t===-1){o.push({text:e.slice(s),match:!1});break}t>s&&o.push({text:e.slice(s,t),match:!1}),o.push({text:e.slice(t,t+n),match:!0}),s=t+n}return o.length>0?o:[{text:e,match:!1}]}function x(t){let r=(0,n.createMemo)(()=>b(t.text,t.terms,t.regexPattern,t.regexFlags));return(0,e.createComponent)(n.For,{get each(){return r()},children:t=>t.match?(()=>{var n=a();return(0,e.insert)(n,()=>t.text),n})():t.text})}function S(e){let t=e.sessions.current();if(t?.server?.id)return t.server.id;let n=e.servers.list();for(let t of n)if(e.servers.get(t)?.builtin)return t;return n[0]??`sidecar`}function C(e){return e===`user`?`You`:e===`assistant`?`Assistant`:e===`shell`?`Command`:e===`title`?`Title`:e}var[w,T]=(0,n.createSignal)(``);function E(t){let r=t.ctx.ui,[a,b]=(0,n.createSignal)(t.initialQuery??``),[T,E]=(0,n.createSignal)(t.ctx.sessions.current()?.directory?`project`:`all`),[D,O]=(0,n.createSignal)(`all`),[k,A]=(0,n.createSignal)(`all`),[j,M]=(0,n.createSignal)(`smart`),[N,P]=(0,n.createSignal)(0),[F,I]=(0,n.createSignal)(0),[L,R]=(0,n.createSignal)(`sessions`),[ve,z]=(0,n.createSignal)(!0),[ye,B]=(0,n.createSignal)(!1),[V,H]=(0,n.createSignal)(null),[be,xe]=(0,n.createSignal)(0),[U,Se]=(0,n.createSignal)([]),[W,Ce]=(0,n.createSignal)(null);(0,n.createEffect)(()=>{let e=w();e&&b(e)});let G=0,K,q=(0,n.createMemo)(()=>t.ctx.sessions.current()?.directory??``),we=(0,n.createMemo)(()=>t.ctx.appearance.mode());async function J(e=!1){let n=++G;e&&B(!0),z(!0),H(null);try{let r=await(t.ctx.sessions.current()?.server?.client??t.ctx.servers.get(S(t.ctx))?.client??t.ctx.client).rpc(i).query({query:a(),scope:T(),currentDirectory:q(),role:D(),datePreset:k(),mode:j(),limit:60,forceReload:e});if(n!==G)return;xe(r.totalSessions),Se(r.results),Ce(r.parsed),P(e=>Math.max(0,Math.min(e,Math.max(0,r.results.length-1)))),I(0),e&&t.ctx.toast.show({variant:`success`,title:`Refreshed ${r.totalSessions} sessions`})}catch(e){if(n!==G)return;H(e instanceof Error?e.message:`Failed to query session index`)}finally{n===G&&(z(!1),B(!1))}}(0,n.createEffect)(()=>{a(),T(),D(),k(),j(),q(),K&&clearTimeout(K),K=setTimeout(()=>{J(!1)},35)}),(0,n.onCleanup)(()=>{K&&clearTimeout(K)});let Y=(0,n.createMemo)(()=>U()[N()]??U()[0]),X=(0,n.createMemo)(()=>{let e=W(),t=e?[...e.terms,...e.fuzzyTerms]:[],n=Y()?.matches[F()]?.matchedTerm;return n&&!t.includes(n)&&t.push(n),t}),Z=(0,n.createMemo)(()=>{let e=0;return D()!==`all`&&e++,k()!==`all`&&e++,j()!==`smart`&&e++,e}),Te=(0,n.createMemo)(()=>[{type:`group`,label:`Search Mode`,items:g.map(e=>({label:ge[e],icon:j()===e?`check-small`:void 0,onSelect:()=>{M(e),P(0)}}))},{type:`separator`},{type:`group`,label:`Message Role`,items:m.map(e=>({label:_[e],icon:D()===e?`check-small`:void 0,onSelect:()=>{O(e),P(0)}}))},{type:`separator`},{type:`group`,label:`Time Range`,items:h.map(e=>({label:he[e],icon:k()===e?`check-small`:void 0,onSelect:()=>{A(e),P(0)}}))},{type:`separator`},{label:`Reset filters`,disabled:Z()===0,onSelect:()=>{M(`smart`),O(`all`),A(`all`),P(0)}}]);function Ee(){E(e=>e===`project`?`all`:`project`),P(0)}function De(){O(e=>m[(m.indexOf(e)+1)%m.length]??`all`),P(0)}function Oe(){A(e=>h[(h.indexOf(e)+1)%h.length]??`all`),P(0)}function ke(){M(e=>g[(g.indexOf(e)+1)%g.length]??`smart`),P(0)}function Q(e){if(!e)return;let n=S(t.ctx);t.ctx.tabs.open({server:n,id:e.id},{focus:!0}),t.onClose?.()}async function Ae(e){e&&(await t.ctx.system.copy(e.id),t.ctx.toast.show({variant:`success`,title:`Copied session ID`,description:e.id}))}function $(e){let t=a().trim();b(t?`${t} ${e}`:e)}function je(e){if((e.ctrlKey||e.altKey)&&!e.shiftKey){let t=e.key.toLowerCase();if(t===`p`){e.preventDefault(),Ee();return}if(t===`g`){e.preventDefault(),De();return}if(t===`t`){e.preventDefault(),Oe();return}if(t===`r`){e.preventDefault(),ke();return}if(t===`l`){e.preventDefault(),J(!0);return}}if(e.key===`Tab`){e.preventDefault(),R(e=>e===`sessions`?`matches`:`sessions`);return}let t=U().length,n=Y()?.matches.length??0;e.key===`ArrowDown`?(e.preventDefault(),L()===`matches`&&n>0?I(e=>Math.min(n-1,e+1)):t>0&&(P(e=>Math.min(t-1,e+1)),I(0))):e.key===`ArrowUp`?(e.preventDefault(),L()===`matches`&&n>0?I(e=>Math.max(0,e-1)):t>0&&(P(e=>Math.max(0,e-1)),I(0))):e.key===`PageDown`?(e.preventDefault(),t>0&&(P(e=>Math.min(t-1,e+8)),I(0))):e.key===`PageUp`?(e.preventDefault(),t>0&&(P(e=>Math.max(0,e-8)),I(0))):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Q(Y()))}return(()=>{var i=u(),m=i.firstChild.firstChild,h=m.nextSibling.firstChild,g=h.firstChild.firstChild,S=g.firstChild,w=g.nextSibling,z=h.nextSibling,B=z.firstChild;return i.$$keydown=je,(0,e.insert)(m,(0,e.createComponent)(r.TextInput,{type:`search`,size:`large`,label:`Search session history`,get value(){return a()},onInput:e=>{b(e),P(0),I(0)},onSubmit:()=>Q(Y()),placeholder:`Search conversations, "exact phrase", fuzzy~, /regex/i, role:user, tool:shell...`,get invalid(){return!!W()?.regexError},autofocus:!0})),g.$$click=()=>{E(`project`),P(0)},(0,e.insert)(g,(0,e.createComponent)(r.Icon,{name:`folder`,size:`small`}),S),(0,e.insert)(S,(()=>{var t=(0,e.memo)(()=>!!q());return()=>t()?y(q()):`Project`})()),w.$$click=()=>{E(`all`),P(0)},(0,e.insert)(h,(0,e.createComponent)(r.Menu,{get label(){return(0,e.memo)(()=>Z()>0)()?`Filters (${Z()})`:`Filters`},icon:`sliders`,trigger:`button`,get items(){return Te()}}),null),(0,e.insert)(h,(0,e.createComponent)(n.Show,{get when(){return j()!==`smart`},get children(){var t=o(),n=t.firstChild;return t.$$click=()=>M(`smart`),(0,e.insert)(n,()=>ge[j()]),(0,e.insert)(t,(0,e.createComponent)(r.Icon,{name:`close-small`,size:`small`}),null),t}}),null),(0,e.insert)(h,(0,e.createComponent)(n.Show,{get when(){return D()!==`all`},get children(){var t=s(),n=t.firstChild;return t.$$click=()=>O(`all`),(0,e.insert)(n,()=>_[D()]),(0,e.insert)(t,(0,e.createComponent)(r.Icon,{name:`close-small`,size:`small`}),null),t}}),null),(0,e.insert)(h,(0,e.createComponent)(n.Show,{get when(){return k()!==`all`},get children(){var t=c(),n=t.firstChild;return t.$$click=()=>A(`all`),(0,e.insert)(n,()=>he[k()]),(0,e.insert)(t,(0,e.createComponent)(r.Icon,{name:`close-small`,size:`small`}),null),t}}),null),(0,e.insert)(h,(0,e.createComponent)(n.Show,{get when(){return W()?.regexError},children:t=>(()=>{var n=d();return(0,e.insert)(n,t),n})()}),null),(0,e.insert)(B,(0,e.createComponent)(n.Show,{get when(){return!ve()},get fallback(){return(0,e.createComponent)(r.Loader,{size:`small`})},get children(){return[(0,e.memo)(()=>U().length),` of `,(0,e.memo)(()=>be()),` sessions`]}})),(0,e.insert)(z,(0,e.createComponent)(r.Tooltip,{value:`Refresh index`,keys:[`Ctrl`,`L`],get children(){return(0,e.createComponent)(r.IconButton,{icon:`refresh`,label:`Refresh index`,variant:`ghost`,size:`small`,get busy(){return ye()},onClick:()=>void J(!0)})}}),null),(0,e.insert)(i,(0,e.createComponent)(n.Show,{get when(){return V()},children:t=>(()=>{var n=f(),r=n.firstChild.nextSibling;return(0,e.insert)(r,t),n})()}),null),(0,e.insert)(i,(0,e.createComponent)(n.Show,{get when(){return!V()},get children(){var i=l(),o=i.firstChild,s=o.firstChild,c=o.nextSibling;return o.$$click=()=>R(`sessions`),(0,e.insert)(s,(0,e.createComponent)(n.Show,{get when(){return U().length>0},get fallback(){return(()=>{var t=te(),r=t.firstChild.nextSibling;return(0,e.insert)(r,(0,e.createComponent)(n.Show,{get when(){return T()===`project`},fallback:`Try Fuzzy mode or fewer search terms.`,get children(){return[`No hits in this workspace. Switch to`,` `,(()=>{var e=ee();return e.$$click=Ee,e})(),` `,`to search everywhere.`]}})),t})()},get children(){return(0,e.createComponent)(n.For,{get each(){return U()},children:(t,r)=>{let i=()=>r()===N();return(()=>{var o=ae(),s=o.firstChild,c=s.firstChild,l=c.nextSibling,u=s.nextSibling,d=u.firstChild,f=d.firstChild;return o.$$dblclick=()=>Q(t),o.$$click=()=>{P(r()),I(0),R(`sessions`)},(0,e.insert)(c,(0,e.createComponent)(x,{get text(){return t.title||`Untitled session`},get terms(){return X()},get regexPattern(){return W()?.regexPattern},get regexFlags(){return W()?.regexFlags}})),(0,e.insert)(l,()=>v(t.timeUpdated)),(0,e.insert)(o,(0,e.createComponent)(n.Show,{get when(){return t.bestSnippet},get children(){var n=ne();return(0,e.insert)(n,(0,e.createComponent)(x,{get text(){return t.bestSnippet},get terms(){return X()},get regexPattern(){return W()?.regexPattern},get regexFlags(){return W()?.regexFlags}})),n}}),u),(0,e.insert)(u,(0,e.createComponent)(n.Show,{get when(){return a().trim().length>0},get children(){var n=re();return(0,e.insert)(n,()=>t.matchBadge),n}}),d),(0,e.insert)(u,(0,e.createComponent)(n.Show,{get when(){return(0,e.memo)(()=>T()===`all`)()&&t.directory},get children(){var n=ie();return(0,e.insert)(n,()=>y(t.directory)),n}}),d),(0,e.insert)(d,()=>t.entryCount,f),(0,e.effect)(()=>(0,e.className)(o,`ols-row ${i()?`ols-row--selected`:``}`)),o})()}})}})),c.$$click=()=>R(`matches`),(0,e.insert)(c,(0,e.createComponent)(n.Show,{get when(){return Y()},get fallback(){return oe()},children:i=>[(()=>{var t=se(),n=t.firstChild,a=n.firstChild,o=a.nextSibling.firstChild,s=o.nextSibling.nextSibling,c=n.nextSibling;return(0,e.insert)(a,()=>i().title),(0,e.insert)(o,()=>i().directory||`Global`),(0,e.insert)(s,()=>_e(i().timeUpdated)),(0,e.insert)(c,(0,e.createComponent)(r.Tooltip,{value:`Copy session ID`,get children(){return(0,e.createComponent)(r.IconButton,{icon:`copy`,label:`Copy session ID`,variant:`ghost`,size:`small`,onClick:()=>void Ae(i())})}}),null),(0,e.insert)(c,(0,e.createComponent)(r.Button,{variant:`contrast`,size:`small`,icon:`square-arrow-top-right`,onClick:()=>Q(i()),children:`Open`}),null),t})(),(0,e.createComponent)(n.Show,{get when(){return(0,e.memo)(()=>a().trim().length===0)()&&t.variant===`modal`},get children(){var e=ce(),t=e.firstChild.nextSibling,n=t.nextSibling,r=n.nextSibling,i=r.nextSibling;return t.$$click=()=>$(`role:user`),n.$$click=()=>$(`tool:shell`),r.$$click=()=>$(`in:title`),i.$$click=()=>$(`since:7d`),e}}),(()=>{var t=le();return(0,e.insert)(t,(0,e.createComponent)(n.Show,{get when(){return i().matches.length>0},get fallback(){return(()=>{var t=p();return(0,e.insert)(t,(0,e.createComponent)(n.For,{get each(){return i().recentEntries},children:t=>(()=>{var r=de(),a=r.firstChild,o=a.firstChild,s=o.nextSibling,c=a.nextSibling;return r.$$click=()=>Q(i()),(0,e.insert)(o,()=>C(t.role)),(0,e.insert)(a,(0,e.createComponent)(n.Show,{get when(){return t.toolName},get children(){var n=ue();return(0,e.insert)(n,()=>t.toolName),n}}),s),(0,e.insert)(s,()=>v(t.timeCreated)),(0,e.insert)(c,()=>t.text),(0,e.effect)(()=>(0,e.className)(o,`ols-turn-author ols-turn-author--${t.role}`)),r})()})),t})()},get children(){var t=p();return(0,e.insert)(t,(0,e.createComponent)(n.For,{get each(){return i().matches},children:(t,r)=>{let a=()=>L()===`matches`&&r()===F();return(()=>{var o=me(),s=o.firstChild,c=s.firstChild,l=c.nextSibling,u=s.nextSibling;return o.$$dblclick=()=>Q(i()),o.$$click=()=>{R(`matches`),I(r())},(0,e.insert)(c,()=>C(t.role)),(0,e.insert)(s,(0,e.createComponent)(n.Show,{get when(){return(0,e.memo)(()=>t.kind===`tool`)()&&t.toolName},get children(){var n=ue();return(0,e.insert)(n,()=>t.toolName),n}}),l),(0,e.insert)(s,(0,e.createComponent)(n.Show,{get when(){return t.kind===`filepath`},get children(){return fe()}}),l),(0,e.insert)(s,(0,e.createComponent)(n.Show,{get when(){return t.kind===`fuzzy`},get children(){var n=pe();return n.firstChild,(0,e.insert)(n,()=>t.matchedTerm,null),n}}),l),(0,e.insert)(l,()=>v(t.timeCreated)),(0,e.insert)(u,(0,e.createComponent)(x,{get text(){return t.snippet},get terms(){return X()},get regexPattern(){return W()?.regexPattern},get regexFlags(){return W()?.regexFlags}})),(0,e.effect)(n=>{var r=`ols-turn ${a()?`ols-turn--selected`:``}`,i=`ols-turn-author ols-turn-author--${t.role}`;return r!==n.e&&(0,e.className)(o,n.e=r),i!==n.t&&(0,e.className)(c,n.t=i),n},{e:void 0,t:void 0}),o})()}})),t}})),t})()]})),(0,e.effect)(t=>{var n=`ols-column ols-column--list ${L()===`sessions`?`ols-column--active`:``}`,r=`ols-column ols-column--detail ${L()===`matches`?`ols-column--active`:``}`;return n!==t.e&&(0,e.className)(o,t.e=n),r!==t.t&&(0,e.className)(c,t.t=r),t},{e:void 0,t:void 0}),i}}),null),(0,e.effect)(n=>{var r=`ols-root ols-root--${t.variant}`,a=we(),o=`ols-segment-btn ${T()===`project`?`ols-segment-btn--active`:``}`,s=q()?`Current project (${q()})`:`Current project`,c=`ols-segment-btn ${T()===`all`?`ols-segment-btn--active`:``}`;return r!==n.e&&(0,e.className)(i,n.e=r),a!==n.t&&(0,e.setAttribute)(i,`data-scheme`,n.t=a),o!==n.a&&(0,e.className)(g,n.a=o),s!==n.o&&(0,e.setAttribute)(g,`title`,n.o=s),c!==n.i&&(0,e.className)(w,n.i=c),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()}var D=t.Plugin.define({i18n:{en:{"search.title":`Search Sessions`,"search.command":`Search session history...`,"search.panel":`Session Search`}},setup(i){let a=i.ui;i.add(t.Style,r);let o;function s(t=``){T(t);let r=i.sessions.current();if(r){o?.close();try{i.layout.open(`${i.id}:search`,r)}catch{}}else{if(o)return;o=i.dialogs.open(r=>((0,n.onCleanup)(()=>{o=void 0}),(0,e.createComponent)(a.Dialog,{title:`Search Sessions`,size:`x-large`,get children(){return(0,e.createComponent)(E,{ctx:i,variant:`modal`,initialQuery:t,get onClose(){return r.close}})}})))}}if(i.add(t.Command,()=>({id:`search`,title:`Search session history...`,description:`Full-text, fuzzy, regex, tool, and file search across all session conversations`,keywords:`find history messages conversation regex fuzzy search grep`,group:`Session`,section:`session`,bind:`mod+shift+f`,slash:{name:`search`,arguments:!0},featured:!0,run(e){s(typeof e==`string`?e:``)}})),i.add(t.Command,()=>({id:`search-panel`,title:`Toggle session search panel`,description:`Open or close the Session Search side panel`,keywords:`panel sidebar search history`,group:`Session`,section:`session`,bind:`mod+alt+f`,run(){let e=i.sessions.current();e?i.layout.toggle(`${i.id}:search`,e):s(``)}})),typeof document<`u`){let e=e=>{let t=e.closest(`button`);if(!t||t.closest(`.ols-root`))return!1;if(t.getAttribute(`data-action`)===`vertical-tabs-search`)return!0;if(!t.closest(`[data-slot="titlebar-v2"]`)||t.closest(`[data-titlebar-plugin-item]`))return!1;if((t.getAttribute(`aria-label`)??``).toLowerCase().includes(`search`))return!0;let n=t.querySelector(`svg[data-slot="icon-svg"] use`);return(n?.getAttribute(`href`)??n?.getAttribute(`xlink:href`)??``).includes(`magnifying-glass`)},t=t=>{let n=t.target;if(!(n instanceof Element))return;if(e(n)){t.preventDefault(),t.stopPropagation(),s(``);return}let r=n.closest(`[data-component="home-session-search"]`);if(r){t.preventDefault(),t.stopPropagation();let e=r.querySelector(`input`),n=e instanceof HTMLInputElement?e.value:``;e instanceof HTMLElement&&e.blur(),s(n)}},r=e=>{let t=e.target;if(!(t instanceof Element)||!t.closest(`[data-component="home-session-search"]`))return;let n=t instanceof HTMLInputElement?t.value:``;t instanceof HTMLElement&&t.blur(),s(n)};document.addEventListener(`click`,t,!0),document.addEventListener(`focusin`,r,!0);let i=new WeakSet,a=new MutationObserver(()=>{let e=document.querySelector(`.command-palette input[placeholder="Search sessions"], .command-palette-dialog input[placeholder="Search sessions..."]`);if(e&&!i.has(e)){i.add(e);let t=e.value||``;e.dispatchEvent(new KeyboardEvent(`keydown`,{key:`Escape`,code:`Escape`,bubbles:!0,cancelable:!0})),s(t)}});document.body&&a.observe(document.body,{childList:!0,subtree:!0}),(0,n.onCleanup)(()=>{document.removeEventListener(`click`,t,!0),document.removeEventListener(`focusin`,r,!0),a.disconnect()})}let c={id:`search`,get title(){return i.t(`search.panel`)},closable:`compact`};i.add(t.Panel,{id:`search`,region:`side`,list:e=>e.open.includes(`search`)?[c]:[],render:()=>(0,e.createComponent)(E,{ctx:i,variant:`panel`})}),i.add(t.MenuItem,()=>{let e=i.sessions.current();return{menu:`session.panel`,id:`search`,title:`Session Search`,description:`Search conversation history`,icon:`magnifying-glass`,keybind:`${i.id}.search-panel`,opened:!!e&&i.layout.state(`${i.id}:search`,e)!==`closed`,run:()=>{let e=i.sessions.current();e?i.layout.open(`${i.id}:search`,e):s(``)}}})}});(0,e.delegateEvents)([`keydown`,`click`,`dblclick`]),exports.default=D;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nandoblanco/opencode-local-search",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./src/index.ts",
|
|
12
12
|
"./server": "./src/server.ts",
|
|
13
|
-
"./tui": "./src/tui.ts"
|
|
13
|
+
"./tui": "./src/tui.ts",
|
|
14
|
+
"./gui-experimental": "./dist/gui-experimental.cjs",
|
|
15
|
+
"./rpc": "./src/rpc.ts"
|
|
14
16
|
},
|
|
15
17
|
"bin": {
|
|
16
18
|
"opencode-local-search": "cli.js"
|
|
@@ -18,12 +20,17 @@
|
|
|
18
20
|
"files": [
|
|
19
21
|
"cli.js",
|
|
20
22
|
"src/*.ts",
|
|
23
|
+
"src/*.tsx",
|
|
24
|
+
"src/*.css",
|
|
25
|
+
"dist/*.cjs",
|
|
21
26
|
"assets/screenshot.png",
|
|
22
27
|
"README.md",
|
|
23
28
|
"LICENSE"
|
|
24
29
|
],
|
|
25
30
|
"scripts": {
|
|
26
|
-
"
|
|
31
|
+
"build": "vite build",
|
|
32
|
+
"test": "node --no-warnings --experimental-strip-types --test test/search.test.ts",
|
|
33
|
+
"test:browser": "node test/search-shortcut.mjs"
|
|
27
34
|
},
|
|
28
35
|
"sideEffects": false,
|
|
29
36
|
"engines": {
|
|
@@ -60,10 +67,22 @@
|
|
|
60
67
|
"optional": true
|
|
61
68
|
}
|
|
62
69
|
},
|
|
70
|
+
"overrides": {
|
|
71
|
+
"glob": "14.0.5",
|
|
72
|
+
"minimatch": "11.0.8"
|
|
73
|
+
},
|
|
63
74
|
"author": "nandoblanco",
|
|
64
75
|
"license": "MIT",
|
|
65
76
|
"repository": {
|
|
66
77
|
"type": "git",
|
|
67
78
|
"url": "git+https://github.com/nandoblanco/opencode-local-search.git"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"playwright": "^1.56.0",
|
|
82
|
+
"@opencode/plugin": "^2.2.4",
|
|
83
|
+
"@opencode/theme": "^2.2.4",
|
|
84
|
+
"solid-js": "^1.9.18",
|
|
85
|
+
"vite": "^8.3.5",
|
|
86
|
+
"vite-plugin-solid": "^2.11.15"
|
|
68
87
|
}
|
|
69
88
|
}
|