pi-lean-search 0.3.0 → 0.3.2

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.
Files changed (2) hide show
  1. package/index.ts +14 -14
  2. package/package.json +4 -2
package/index.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Registers the `web-search` tool and a `/searxng-status` diagnostic command.
5
5
  * Manages the `search` status bar slot with health-colored glyphs.
6
6
  *
7
- * Owns the `search.web` toolset (co-activated off `portal.web`):
7
+ * Owns the `pi-lean-dimension.search` toolset (co-activated off `pi-lean-dimension.web`):
8
8
  * ● searxng (accent/blue) — healthy and reachable
9
9
  * ● searxng (warning/yellow) — server up but pipeline degraded
10
10
  * ● searxng (error/red) — unreachable
@@ -24,9 +24,9 @@ import { webSearchTool } from "./web-search-tool.js";
24
24
  // ─── Toolset spec ────────────────────────────────────────────────
25
25
 
26
26
  const SEARCH_WEB_SPEC: ToolsetSpec = {
27
- id: "search.web",
27
+ id: "pi-lean-dimension.search",
28
28
  names: new Set(["web-search"]),
29
- persistKey: "toolset-state:search.web",
29
+ persistKey: "toolset-state:pi-lean-dimension.search",
30
30
  defaultEnabled: true,
31
31
  };
32
32
 
@@ -35,7 +35,7 @@ const SEARCH_WEB_SPEC: ToolsetSpec = {
35
35
  /** Cached SearXNG URL (read once at startup, stable mid-session). */
36
36
  let _searxngUrl: string | undefined;
37
37
 
38
- /** Last known search.web enabled state (updated by library events). */
38
+ /** Last known pi-lean-dimension.search enabled state (updated by library events). */
39
39
  let _lastSearchEnabled = true;
40
40
 
41
41
  /** Last known health state: true=healthy, false=unreachable, null=unconfigured. */
@@ -128,10 +128,10 @@ function displayUrl(url: string): string {
128
128
  /**
129
129
  * Render the `search` status slot based on toolset state + health.
130
130
  *
131
- * search.web off → ○ searxng
132
- * search.web on + healthy → ● searxng (accent/blue)
133
- * search.web on + degraded → ● searxng (warning/yellow)
134
- * search.web on + unreachable → ● searxng (error/red)
131
+ * pi-lean-dimension.search off → ○ searxng
132
+ * pi-lean-dimension.search on + healthy → ● searxng (accent/blue)
133
+ * pi-lean-dimension.search on + degraded → ● searxng (warning/yellow)
134
+ * pi-lean-dimension.search on + unreachable → ● searxng (error/red)
135
135
  * unconfigured → (clear slot)
136
136
  */
137
137
  function renderSearchGlyph(ctx: {
@@ -154,13 +154,13 @@ function renderSearchGlyph(ctx: {
154
154
  return;
155
155
  }
156
156
 
157
- // search.web disabled — show off state
157
+ // pi-lean-dimension.search disabled — show off state
158
158
  if (!_lastSearchEnabled) {
159
159
  safeSetStatus("○ searxng");
160
160
  return;
161
161
  }
162
162
 
163
- // search.web enabled — show health-colored glyph
163
+ // pi-lean-dimension.search enabled — show health-colored glyph
164
164
  if (!_lastHealth) {
165
165
  safeSetStatus(ctx.ui.theme.fg("error", "●") + " searxng");
166
166
  return;
@@ -193,15 +193,15 @@ export default function (pi: ExtensionAPI) {
193
193
  // ── Register the web-search tool ─────────────────────────
194
194
  pi.registerTool(webSearchTool);
195
195
 
196
- // ── Define the search.web toolset ────────────────────────
196
+ // ── Define the pi-lean-dimension.search toolset ───────────
197
197
  // Registers restore handler on session_start / session_tree.
198
198
  const searchToolset = defineToolset(pi, SEARCH_WEB_SPEC);
199
199
 
200
- // ── Co-activation: mirror portal.web changed events ──────
200
+ // ── Co-activation: mirror pi-lean-dimension.web changed events ─
201
201
  // Listen on changed ONLY, not restored (§10.1).
202
202
  pi.events.on(TOOLSET_EVENTS.changed, (data: unknown) => {
203
203
  const event = data as ToolsetChangedEvent;
204
- if (event.id === "portal.web") {
204
+ if (event.id === "pi-lean-dimension.web") {
205
205
  if (event.enabled) {
206
206
  searchToolset.enable(pi);
207
207
  } else {
@@ -213,7 +213,7 @@ export default function (pi: ExtensionAPI) {
213
213
  // ── Keep cached state in sync with library events ────────
214
214
  const syncSearchState = (data: unknown) => {
215
215
  const event = data as ToolsetChangedEvent;
216
- if (event.id === "search.web") {
216
+ if (event.id === "pi-lean-dimension.search") {
217
217
  _lastSearchEnabled = event.enabled;
218
218
  if (_lastCtx) renderSearchGlyph(_lastCtx);
219
219
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lean-search",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Pi extension. SearXNG search tool for Pi — pairs with pi-lean-portal's /web toggle; search-only installs are valid, or add it to a portal install for the full web-tools suite.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -37,12 +37,14 @@
37
37
  "prepack": "cp ../../LICENSE ./LICENSE",
38
38
  "test": "vitest run"
39
39
  },
40
+ "dependencies": {
41
+ "pi-tool-masking": "^1.0.0"
42
+ },
40
43
  "peerDependencies": {
41
44
  "@earendil-works/pi-ai": "*",
42
45
  "@earendil-works/pi-coding-agent": "*",
43
46
  "@earendil-works/pi-tui": "*",
44
47
  "pi-lean-portal": "*",
45
- "pi-tool-masking": "^1.0.0",
46
48
  "typebox": "*"
47
49
  },
48
50
  "peerDependenciesMeta": {