@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.
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/tools/arxiv.ts +1 -5
- package/src/tools/crossref.ts +1 -5
- package/src/tools/openalex.ts +1 -5
- package/src/tools/pubmed.ts +1 -5
- package/src/tools/semantic-scholar.ts +1 -5
- package/src/tools/unpaywall.ts +1 -5
- package/src/tools/util.ts +11 -0
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/tools/arxiv.ts
CHANGED
|
@@ -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);
|
package/src/tools/crossref.ts
CHANGED
|
@@ -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,
|
package/src/tools/openalex.ts
CHANGED
|
@@ -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,
|
package/src/tools/pubmed.ts
CHANGED
|
@@ -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,
|
package/src/tools/unpaywall.ts
CHANGED
|
@@ -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
|
+
}
|