@wentorai/research-plugins 1.2.1 → 1.2.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "research-plugins",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "name": "Research Plugins",
5
5
  "description": "487 academic research skills, 13 agent tools, 150 MCP configs & 6 curated lists for Research-Claw",
6
6
  "skills": ["./skills"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wentorai/research-plugins",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "type": "module",
5
5
  "description": "487 academic research skills, 150 MCP configs, 13 agent tools, and 6 curated lists for Research-Claw and AI agents",
6
6
  "keywords": [
@@ -1,13 +1,9 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import type { OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
3
+ import { toolResult } from "./util.js";
3
4
 
4
5
  const BASE = "https://export.arxiv.org/api/query";
5
6
 
6
- function toolResult(data: unknown) {
7
- const text = JSON.stringify(data, null, 2);
8
- return { content: [{ type: "text" as const, text }] };
9
- }
10
-
11
7
  function parseArxivXml(xml: string) {
12
8
  const entries: Record<string, unknown>[] = [];
13
9
  const entryBlocks = xml.split("<entry>").slice(1);
@@ -1,13 +1,9 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import type { OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
3
+ import { toolResult } from "./util.js";
3
4
 
4
5
  const BASE = "https://api.crossref.org";
5
6
 
6
- function toolResult(data: unknown) {
7
- const text = JSON.stringify(data, null, 2);
8
- return { content: [{ type: "text" as const, text }] };
9
- }
10
-
11
7
  export function createCrossRefTools(
12
8
  _ctx: OpenClawPluginToolContext,
13
9
  _api: OpenClawPluginApi,
@@ -1,13 +1,9 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import type { OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
3
+ import { toolResult } from "./util.js";
3
4
 
4
5
  const BASE = "https://api.openalex.org";
5
6
 
6
- function toolResult(data: unknown) {
7
- const text = JSON.stringify(data, null, 2);
8
- return { content: [{ type: "text" as const, text }] };
9
- }
10
-
11
7
  export function createOpenAlexTools(
12
8
  _ctx: OpenClawPluginToolContext,
13
9
  _api: OpenClawPluginApi,
@@ -1,13 +1,9 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import type { OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
3
+ import { toolResult } from "./util.js";
3
4
 
4
5
  const EUTILS = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils";
5
6
 
6
- function toolResult(data: unknown) {
7
- const text = JSON.stringify(data, null, 2);
8
- return { content: [{ type: "text" as const, text }] };
9
- }
10
-
11
7
  export function createPubMedTools(
12
8
  _ctx: OpenClawPluginToolContext,
13
9
  _api: OpenClawPluginApi,
@@ -1,13 +1,9 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import type { OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
3
+ import { toolResult } from "./util.js";
3
4
 
4
5
  const BASE = "https://api.semanticscholar.org/graph/v1";
5
6
 
6
- function toolResult(data: unknown) {
7
- const text = JSON.stringify(data, null, 2);
8
- return { content: [{ type: "text" as const, text }] };
9
- }
10
-
11
7
  export function createSemanticScholarTools(
12
8
  ctx: OpenClawPluginToolContext,
13
9
  api: OpenClawPluginApi,
@@ -1,13 +1,9 @@
1
1
  import { Type } from "@sinclair/typebox";
2
2
  import type { OpenClawPluginApi, OpenClawPluginToolContext } from "openclaw/plugin-sdk";
3
+ import { toolResult } from "./util.js";
3
4
 
4
5
  const BASE = "https://api.unpaywall.org/v2";
5
6
 
6
- function toolResult(data: unknown) {
7
- const text = JSON.stringify(data, null, 2);
8
- return { content: [{ type: "text" as const, text }] };
9
- }
10
-
11
7
  export function createUnpaywallTools(
12
8
  _ctx: OpenClawPluginToolContext,
13
9
  _api: OpenClawPluginApi,
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Wrap raw data into the OpenClaw AgentTool return format.
3
+ *
4
+ * Expected shape: { content: [{ type: "text", text: string }], details: unknown }
5
+ * - content → displayed to the user / consumed by the model as text
6
+ * - details → structured data for programmatic access by downstream tools
7
+ */
8
+ export function toolResult(data: unknown) {
9
+ const text = JSON.stringify(data, null, 2);
10
+ return { content: [{ type: "text" as const, text }], details: data };
11
+ }