@srobroek/pi-find-tools 0.5.0 → 0.6.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## find-tools [0.6.1](https://github.com/srobroek/harness-plugins/compare/find-tools--v0.6.0...find-tools--v0.6.1) (2026-11-24)
2
+
3
+ ## find-tools [0.6.0](https://github.com/srobroek/harness-plugins/compare/find-tools--v0.5.0...find-tools--v0.6.0) (2026-11-24)
4
+
5
+ ### Features
6
+
7
+ * **find-tools:** read host catalog and inventory ([bbfa00c](https://github.com/srobroek/harness-plugins/commit/bbfa00c8b1b5a45365cc3cee3ad460f1e7ec48d5))
8
+
9
+ # Changelog
10
+
11
+ ## find-tools [0.6.0](https://github.com/srobroek/harness-plugins/compare/find-tools--v0.5.0...find-tools--v0.6.0) (unreleased)
12
+
13
+ ### Features
14
+
15
+ * **find-tools:** use host marketplaces and inventory, including OMP
16
+
1
17
  ## find-tools [0.5.0](https://github.com/srobroek/harness-plugins/compare/find-tools--v0.4.0...find-tools--v0.5.0) (2026-11-23)
2
18
 
3
19
  ### Features
package/README.md CHANGED
@@ -1,15 +1,21 @@
1
1
  # find-tools
2
2
 
3
- Finds reusable OpenCode plugins, agent skills and MCP servers for a capability,
4
- vets them, and recommends one decision: `Use existing`, `Adopt`, `Trial`,
5
- `Reject` or `Build`. It never installs anything.
3
+ Finds reusable plugins, agent skills and MCP servers for a capability, vets them,
4
+ and recommends one decision: `Use existing`, `Adopt`, `Trial`, `Reject` or `Build`.
5
+ It never installs anything.
6
6
 
7
- Ported from the omp-plugins `find-tools` plugin, without its omp sources and
8
- without `setup-tools`.
7
+ Ships to OpenCode, Pi and OMP. OMP uses the same extension bundle as Pi, but
8
+ reads installed plugins from `omp plugin list --json` rather than Pi package
9
+ settings.
9
10
 
10
11
  ## Install
12
+ Install with Pi:
11
13
 
12
- The plugin directory is a Pi package. Add its repository path to `packages` in `~/.pi/agent/settings.json`:
14
+ ```sh
15
+ pi install npm:@srobroek/pi-find-tools
16
+ ```
17
+
18
+ The OpenCode plugin and Pi package are available separately. For local Pi development, add the repository path to `packages` in `~/.pi/agent/settings.json`:
13
19
 
14
20
  ```json
15
21
  { "packages": ["/absolute/path/to/harness-plugins/plugins/find-tools"] }
@@ -23,7 +29,19 @@ The OpenCode plugin is available separately:
23
29
  opencode plugin add 'github:srobroek/harness-plugins::path:plugins/find-tools/opencode'
24
30
  ```
25
31
 
26
- The skill drives the `find_tools_scan` tool. The plugin is not exported to Claude Code.
32
+ Install the OMP plugin from this repository's OMP marketplace:
33
+
34
+ ```sh
35
+ omp plugin install find-tools@harness-plugins
36
+ ```
37
+
38
+ Install the Pi package from npm:
39
+
40
+ ```sh
41
+ pi install npm:@srobroek/pi-find-tools
42
+ ```
43
+
44
+ The OpenCode plugin, Pi package and OMP plugin all register `find_tools_scan`.
27
45
 
28
46
  ## Tool
29
47
 
@@ -35,8 +53,8 @@ and a coverage count.
35
53
 
36
54
  | Source | Searches |
37
55
  | --- | --- |
38
- | `local` | Pi packages from `~/.pi/agent/settings.json`; user skills from `~/.pi/agent/skills`; MCP status counts from `~/.pi/agent/mcp.json`, without names, commands, URLs or environment |
39
- | `catalog` | This repository's `.claude-plugin/marketplace.json` from GitHub, plus `skillCatalogs` |
56
+ | `local` | Pi package declarations and skills/MCP config; OMP installed marketplace/npm plugin IDs from `omp plugin list --json`; OpenCode plugins and skills from host APIs. MCP details are counts only |
57
+ | `catalog` | The Claude marketplace for Claude Code/OpenCode/Pi; the OMP marketplace for OMP; extra `skillCatalogs` |
40
58
  | `mcp_registry` | The official MCP Registry (`/v0.1/servers?search=…&version=latest`) |
41
59
  | `npm` | Keywords `opencode-plugin`, `mcp-server`, `agent-skill`, `claude-skill`; ranked and capped at 20 |
42
60
  | `github` | `gh api` code search for `.claude-plugin/marketplace.json` and `SKILL.md`, and repositories with topic `opencode-plugin`. Skipped without `gh` |
@@ -44,9 +62,8 @@ and a coverage count.
44
62
  | `smithery` | The Smithery registry. Skipped unless `SMITHERY_API_KEY` is set |
45
63
  | `skills_cli` | Always a gap: the skills CLI runs package code, so discovery never calls it |
46
64
 
47
- Hits carry install hints (project scope first, user-wide for plugins). Hints
48
- that start a package runner are marked *runs package code*. The tool shows them
49
- and never runs them.
65
+ Hits carry install hints appropriate to the detected host. The scanner displays
66
+ them without executing them.
50
67
 
51
68
  [`pi-vetter`](https://pi.dev/packages/pi-vetter) is an optional Pi package for package vetting. It complements this discovery workflow; it does not replace it.
52
69
 
@@ -754,8 +754,34 @@ var SOURCES = [
754
754
  "skills_cli"
755
755
  ];
756
756
  var SOURCE_TIMEOUT_MS = 1e4;
757
- var REPO_SPEC = "github:srobroek/opencode-plugins::path:plugins";
758
- var DEFAULT_CATALOG_URL = "https://raw.githubusercontent.com/srobroek/opencode-plugins/main/.claude-plugin/marketplace.json";
757
+ var REPOSITORY = "srobroek/harness-plugins";
758
+ var REPO_SPEC = `github:${REPOSITORY}::path:plugins`;
759
+ var INVENTORY_URL = `https://raw.githubusercontent.com/${REPOSITORY}/main/inventory.json`;
760
+ var CATALOG_URLS = {
761
+ claude: `https://raw.githubusercontent.com/${REPOSITORY}/main/.claude-plugin/marketplace.json`,
762
+ opencode: INVENTORY_URL,
763
+ omp: `https://raw.githubusercontent.com/${REPOSITORY}/main/.omp-plugin/marketplace.json`,
764
+ pi: INVENTORY_URL
765
+ };
766
+ var DEFAULT_CATALOG_URL = CATALOG_URLS.opencode;
767
+ function catalogUrlFor(harness) {
768
+ return CATALOG_URLS[harness];
769
+ }
770
+ function piPackage(name, piName) {
771
+ return `@srobroek/${piName ?? `pi-${name}`}`;
772
+ }
773
+ function installHint(harness, name, piName) {
774
+ switch (harness) {
775
+ case "claude":
776
+ return `/plugin install ${name}@harness-plugins`;
777
+ case "omp":
778
+ return `omp plugin install --scope project ${name}@harness-plugins`;
779
+ case "pi":
780
+ return `pi install npm:${piPackage(name, piName)}`;
781
+ case "opencode":
782
+ return `opencode plugin add 'github:${REPOSITORY}::path:plugins/${name}/opencode'`;
783
+ }
784
+ }
759
785
  var AWESOME_OPENCODE_URL = "https://raw.githubusercontent.com/awesome-opencode/awesome-opencode/main/README.md";
760
786
  var MCP_REGISTRY_URL = "https://registry.modelcontextprotocol.io/v0.1/servers";
761
787
  var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
@@ -811,6 +837,8 @@ function pluginHit(plugin) {
811
837
  let origin = source?.type ?? "unknown";
812
838
  if (source?.type === "package") {
813
839
  origin = `package ${source.target ?? "?"}${source.version ? `@${source.version}` : ""}${source.outdated ? " (outdated)" : ""}`;
840
+ } else if (source?.version) {
841
+ origin = `${source.type} ${source.version}`;
814
842
  }
815
843
  const failedState = plugin.state?.status === "failed" ? "; failed to load" : "";
816
844
  const name = plugin.id ?? (source?.type === "package" ? source.target : undefined) ?? "unnamed";
@@ -853,15 +881,16 @@ async function scanLocal(local) {
853
881
  return { source: "local", ok: true, hits };
854
882
  }
855
883
  const [plugins, skills, mcp] = await Promise.allSettled([
856
- local.plugins?.() ?? Promise.reject(new Error("plugin inventory unavailable")),
857
- local.skills?.() ?? Promise.reject(new Error("skill inventory unavailable")),
858
- local.mcp?.() ?? Promise.reject(new Error("MCP inventory unavailable"))
884
+ local.plugins?.() ?? Promise.resolve([]),
885
+ local.skills?.() ?? Promise.resolve([]),
886
+ local.mcp?.() ?? Promise.resolve([])
859
887
  ]);
860
888
  const hits = [];
861
889
  const failures = [];
862
- if (plugins.status === "fulfilled")
863
- hits.push(...listOf(plugins.value).map(pluginHit));
864
- else
890
+ if (plugins.status === "fulfilled") {
891
+ const entries = listOf(plugins.value);
892
+ hits.push(...entries.map((plugin) => pluginHit(plugin)));
893
+ } else
865
894
  failures.push(`plugin list failed: ${message(plugins.reason).slice(0, 200)}`);
866
895
  if (skills.status === "fulfilled") {
867
896
  for (const skill of listOf(skills.value)) {
@@ -879,51 +908,47 @@ async function scanLocal(local) {
879
908
  return failed("local", failures.join("; "), { failures });
880
909
  return { source: "local", ok: true, hits, ...failures.length ? { failures } : {} };
881
910
  }
882
- function catalogEntries(json) {
911
+ function catalogEntries(json, harness = "opencode") {
883
912
  const obj = record(json);
884
913
  const list = Array.isArray(json) ? json : Array.isArray(obj?.plugins) ? obj.plugins : obj?.skills;
885
914
  if (!Array.isArray(list))
886
915
  return;
887
- const kind = Array.isArray(obj?.plugins) ? "marketplace" : "skills";
916
+ const inventory = Array.isArray(obj?.plugins) && obj.plugins.some((item) => record(record(item)?.harnesses) !== undefined);
917
+ const kind = inventory ? "inventory" : Array.isArray(obj?.plugins) ? "marketplace" : "skills";
888
918
  const entries = [];
889
919
  for (const item of list) {
890
920
  const entry = record(item);
891
921
  const name = str(entry?.name);
892
922
  if (!name)
893
923
  continue;
924
+ if (inventory && record(record(entry?.harnesses)?.[harness]) === undefined)
925
+ continue;
894
926
  const description = str(entry?.description);
895
927
  const source = str(entry?.source) ?? str(record(entry?.source)?.url) ?? str(record(entry?.source)?.repo);
896
- entries.push({ name, ...description ? { description } : {}, ...source ? { source } : {} });
928
+ const piName = inventory ? str(entry?.piName) : undefined;
929
+ entries.push({ name, ...description ? { description } : {}, ...source ? { source } : {}, ...piName ? { piName } : {} });
897
930
  }
898
931
  return { kind, entries };
899
932
  }
900
933
  function catalogIndexUrl(url) {
901
934
  return url.endsWith("/") ? `${url}index.json` : url;
902
935
  }
903
- function catalogHits(url, own, json, terms) {
904
- const parsed = catalogEntries(json);
936
+ function catalogHits(url, own, json, terms, harness = "opencode") {
937
+ const parsed = catalogEntries(json, harness);
905
938
  if (!parsed)
906
939
  return;
907
940
  const ranked = parsed.entries.map((entry) => ({ entry, score: terms.length ? relevance(terms, entry.name, entry.description) : 1 })).filter(({ score }) => score > 0).sort((a, b) => b.score - a.score).slice(0, SEARCH_CAP);
908
941
  return ranked.map(({ entry }) => {
909
- let install;
910
- if (own) {
911
- const spec = `${REPO_SPEC}/${entry.name}`;
912
- install = `project: add "${spec}" to "plugins" in opencode.json; user-wide: opencode plugin add '${spec}'`;
913
- } else if (parsed.kind === "skills") {
914
- install = `project: add "${url}" to "skills" in opencode.json`;
915
- } else {
916
- install = `Claude Code marketplace entry${entry.source ? ` (source ${entry.source})` : ""}; inspect it before adapting`;
917
- }
942
+ const install = own ? installHint(harness, entry.name, entry.piName) : parsed.kind === "skills" ? `project: add "${url}" to "skills" in opencode.json` : `Claude Code marketplace entry${entry.source ? ` (source ${entry.source})` : ""}; inspect it before adapting`;
918
943
  return {
919
944
  name: own ? entry.name : `${entry.name} (${new URL(url).host})`,
920
945
  ...entry.description ? { detail: entry.description } : {},
921
- url: own ? `https://github.com/srobroek/opencode-plugins/tree/main/plugins/${entry.name}` : url,
946
+ url: own ? `https://github.com/${REPOSITORY}/tree/main/plugins/${entry.name}/${harness}` : url,
922
947
  install
923
948
  };
924
949
  });
925
950
  }
926
- async function scanCatalog(fetchFn, signal, query, catalogUrl, extra) {
951
+ async function scanCatalog(fetchFn, signal, query, catalogUrl, extra, harness) {
927
952
  const terms = queryTerms(query);
928
953
  const urls = [catalogUrl, ...extra.filter((u) => u !== catalogUrl)];
929
954
  const answers = await Promise.all(urls.map(async (url, index) => {
@@ -938,7 +963,7 @@ async function scanCatalog(fetchFn, signal, query, catalogUrl, extra) {
938
963
  const res = await getText(fetchFn, target, signal);
939
964
  if (!res.ok)
940
965
  return { url, error: httpReason(res) };
941
- const hits = catalogHits(url, index === 0 && url === catalogUrl, parseJson(res.text), terms);
966
+ const hits = catalogHits(url, index === 0 && url === catalogUrl, parseJson(res.text), terms, harness);
942
967
  return hits ? { url, hits } : { url, error: "not a recognised catalog" };
943
968
  }));
944
969
  const hits = [];
@@ -1313,7 +1338,7 @@ async function scanSources(params, deps = {}) {
1313
1338
  const selected = requested.length > 0 ? new Set(requested) : null;
1314
1339
  const jobs = {
1315
1340
  local: () => scanLocal(deps.local),
1316
- catalog: (signal) => scanCatalog(fetchFn, signal, query, deps.catalogUrl ?? DEFAULT_CATALOG_URL, deps.skillCatalogs ?? []),
1341
+ catalog: (signal) => scanCatalog(fetchFn, signal, query, deps.catalogUrl ?? catalogUrlFor(deps.harness ?? "opencode"), deps.skillCatalogs ?? [], deps.harness ?? "opencode"),
1317
1342
  mcp_registry: (signal) => scanMcpRegistry(fetchFn, signal, query),
1318
1343
  npm: (signal) => scanNpm(fetchFn, signal, query),
1319
1344
  github: (signal) => scanGithub(run, which, signal, ms, query),
@@ -1438,6 +1463,39 @@ async function readPiInventory(agentDirOverride) {
1438
1463
  } catch {}
1439
1464
  return { packages, skills, mcp };
1440
1465
  }
1466
+ async function readOmpInventory(exec) {
1467
+ const result = await exec("omp", ["plugin", "list", "--json"]);
1468
+ if (result.code !== 0)
1469
+ throw new Error("omp plugin list failed");
1470
+ const data = JSON.parse(result.stdout);
1471
+ const marketplace = Array.isArray(data.marketplace) ? data.marketplace.flatMap((group) => {
1472
+ if (!group || typeof group !== "object")
1473
+ return [];
1474
+ const value = group;
1475
+ const entries = Array.isArray(value.entries) ? value.entries : [];
1476
+ const active = entries.find((entry) => entry && typeof entry === "object" && entry.enabled !== false);
1477
+ if (!active || typeof value.id !== "string")
1478
+ return [];
1479
+ const version = typeof active.version === "string" ? active.version : undefined;
1480
+ const scope = typeof active.scope === "string" ? active.scope : undefined;
1481
+ return [{ id: value.id, source: { type: scope ? `marketplace, ${scope} scope` : "marketplace", ...version ? { version } : {} } }];
1482
+ }) : [];
1483
+ const npm = Array.isArray(data.npm) ? data.npm.flatMap((item) => {
1484
+ if (!item || typeof item !== "object")
1485
+ return [];
1486
+ const plugin = item;
1487
+ if (plugin.enabled === false || typeof plugin.name !== "string")
1488
+ return [];
1489
+ return [{ id: plugin.name, source: { type: "npm", ...typeof plugin.version === "string" ? { version: plugin.version } : {} } }];
1490
+ }) : [];
1491
+ return { plugins: [...marketplace, ...npm] };
1492
+ }
1493
+ function isOmpHost(pi) {
1494
+ return pi.runtime !== undefined;
1495
+ }
1496
+ function ompInventory(exec) {
1497
+ return { plugins: async () => (await readOmpInventory(exec)).plugins };
1498
+ }
1441
1499
  var piInventory = (agentDir) => ({
1442
1500
  pi: () => readPiInventory(agentDir)
1443
1501
  });
@@ -1445,7 +1503,7 @@ function find_tools_default(pi) {
1445
1503
  pi.registerTool({
1446
1504
  name: "find_tools_scan",
1447
1505
  label: "Find tools",
1448
- description: "Read-only discovery of plugins, skills and MCP servers for a capability. Sources run in parallel, 10 s each: local (installed Pi packages and skills; MCP as counts only), catalog (srobroek/opencode-plugins marketplace and configured skill catalogs), mcp_registry, npm, github (gh api), awesome_opencode (unvetted), smithery (needs SMITHERY_API_KEY), skills_cli (reported gap, never run). Each source reports ok, empty, partial, skipped or failed, with gaps and coverage. Install hints are shown, never run.",
1506
+ description: "Read-only discovery of plugins, skills and MCP servers for a capability. Sources run in parallel, 10 s each: local (installed host plugins and skills; MCP as counts only), catalog (harness-plugins marketplace and configured skill catalogs), mcp_registry, npm, github (gh api), awesome_opencode (unvetted), smithery (needs SMITHERY_API_KEY), skills_cli (reported gap, never run). Each source reports ok, empty, partial, skipped or failed, with gaps and coverage. Install hints are shown, never run.",
1449
1507
  parameters: Type.Object({
1450
1508
  query: Type.String({ description: "The capability to find, in a few words" }),
1451
1509
  sources: Type.Optional(Type.Array(Type.String({ enum: [...SOURCES] }), {
@@ -1454,7 +1512,13 @@ function find_tools_default(pi) {
1454
1512
  }, { additionalProperties: false }),
1455
1513
  async execute(_toolCallId, params, signal) {
1456
1514
  try {
1457
- const report = await scanSources(params, { signal, local: piInventory(getAgentDir()) });
1515
+ const ompHost = isOmpHost(pi);
1516
+ const inventory = ompHost ? ompInventory(async (command, args) => pi.exec(command, args, { signal, timeout: 1e4, maxBuffer: 1e6 })) : piInventory(getAgentDir());
1517
+ const report = await scanSources(params, {
1518
+ signal,
1519
+ local: inventory,
1520
+ harness: ompHost ? "omp" : "pi"
1521
+ });
1458
1522
  return { content: [{ type: "text", text: renderScan(report) }], details: report };
1459
1523
  } catch (error) {
1460
1524
  const message = error instanceof Error ? error.message : String(error);
@@ -1481,5 +1545,8 @@ function find_tools_default(pi) {
1481
1545
  }
1482
1546
  export {
1483
1547
  find_tools_default as default,
1548
+ isOmpHost,
1549
+ ompInventory,
1550
+ readOmpInventory,
1484
1551
  readPiInventory
1485
1552
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srobroek/pi-find-tools",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Discover and vet plugins, skills and MCP servers across local inventory, catalogs and public registries, without installing anything.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -21,11 +21,13 @@ Adapted from the omp-plugins find-tools adoption policy for OpenCode V2.
21
21
  | Artifact | Project scope (default) | User-wide (ask separately) |
22
22
  | --- | --- | --- |
23
23
  | OpenCode plugin | add the spec to `plugins` in the project's `opencode.json` | `opencode plugin add <spec>` (global config) |
24
+ | Claude Code plugin | `/plugin install <name>@harness-plugins` | the same command |
25
+ | OMP plugin | install `<name>@harness-plugins` with the host package manager | the same command |
26
+ | Pi package | add `npm:@srobroek/pi-<name>` to `packages` in Pi settings | `pi install npm:@srobroek/pi-<name>` |
24
27
  | MCP server | `opencode mcp add <name> --url …` or `-- <command>` | the same with `--global` |
25
28
  | Skill | copy the skill directory to `.opencode/skills/<name>/`, or add a catalog URL to `skills` | `~/.config/opencode/skills/<name>/` |
26
29
 
27
- A plugin from this repository installs with the spec
28
- `github:srobroek/opencode-plugins::path:plugins/<name>`.
30
+ A plugin from this repository uses the spec `github:srobroek/harness-plugins::path:plugins/<name>`.
29
31
 
30
32
  A V1 plugin (`@opencode-ai/plugin`) does not run on OpenCode V2. Check the
31
33
  entry point imports `@opencode/plugin` before adopting a plugin.