pi-lean-search 0.3.2 → 0.4.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.
Files changed (2) hide show
  1. package/index.ts +11 -1
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -16,7 +16,11 @@ import type {
16
16
  ExtensionContext,
17
17
  ThemeColor,
18
18
  } from "@earendil-works/pi-coding-agent";
19
- import { defineToolset, TOOLSET_EVENTS } from "pi-tool-masking";
19
+ import {
20
+ defineToolset,
21
+ TOOLSET_EVENTS,
22
+ getDefaultResolutionMode,
23
+ } from "pi-tool-masking";
20
24
  import type { ToolsetSpec, ToolsetChangedEvent } from "pi-tool-masking";
21
25
  import { readSearxngUrl } from "./search-config.js";
22
26
  import { webSearchTool } from "./web-search-tool.js";
@@ -199,9 +203,15 @@ export default function (pi: ExtensionAPI) {
199
203
 
200
204
  // ── Co-activation: mirror pi-lean-dimension.web changed events ─
201
205
  // Listen on changed ONLY, not restored (§10.1).
206
+ //
207
+ // Focus-mode guard: while allowlist focus holds the line, skip
208
+ // co-activation. The focus set is authoritative, so a web `changed` event
209
+ // — including one a stale library `doRestore` emits during resume — must
210
+ // not disable search or write a focus-indistinguishable {enabled} entry.
202
211
  pi.events.on(TOOLSET_EVENTS.changed, (data: unknown) => {
203
212
  const event = data as ToolsetChangedEvent;
204
213
  if (event.id === "pi-lean-dimension.web") {
214
+ if (getDefaultResolutionMode() === "allowlist") return;
205
215
  if (event.enabled) {
206
216
  searchToolset.enable(pi);
207
217
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lean-search",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
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",
@@ -38,7 +38,7 @@
38
38
  "test": "vitest run"
39
39
  },
40
40
  "dependencies": {
41
- "pi-tool-masking": "^1.0.0"
41
+ "pi-tool-masking": "^1.2.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@earendil-works/pi-ai": "*",