@autobest-ui/agent 1.0.1 → 1.0.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,54 +1,50 @@
1
- import assert from "node:assert/strict";
2
- import { spawnSync } from "node:child_process";
3
- import path from "node:path";
4
- import test from "node:test";
5
- import { fileURLToPath } from "node:url";
6
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
7
- import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
1
+ import assert from 'node:assert/strict';
2
+ import { spawnSync } from 'node:child_process';
3
+ import path from 'node:path';
4
+ import test from 'node:test';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
7
+ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
8
8
 
9
9
  const directory = path.dirname(fileURLToPath(import.meta.url));
10
10
 
11
- test("initializes and exposes the RAG tools over stdio", async () => {
12
- const client = new Client({ name: "rag-mcp-bridge-test", version: "1.0.0" });
11
+ test('initializes and exposes the RAG tools over stdio', async () => {
12
+ const client = new Client({ name: 'rag-mcp-bridge-test', version: '1.0.0' });
13
13
  const transport = new StdioClientTransport({
14
14
  command: process.execPath,
15
- args: [path.join(directory, "index.js")],
16
- cwd: path.resolve(directory, "../.."),
15
+ args: [path.join(directory, 'index.js')],
16
+ cwd: path.resolve(directory, '../..'),
17
17
  env: {
18
- RAG_API_BASE_URL: "http://127.0.0.1:3000/api/knowledge",
18
+ RAG_API_BASE_URL: 'http://192.168.1.12:3000/api/knowledge'
19
19
  },
20
- stderr: "pipe",
20
+ stderr: 'pipe'
21
21
  });
22
22
 
23
23
  try {
24
24
  await client.connect(transport);
25
25
 
26
- assert.equal(client.getServerVersion()?.name, "rag-mcp-bridge");
27
- assert.match(client.getInstructions() ?? "", /retrieve_knowledge/);
26
+ assert.equal(client.getServerVersion()?.name, 'rag-mcp-bridge');
27
+ assert.match(client.getInstructions() ?? '', /retrieve_knowledge/);
28
28
 
29
29
  const { tools } = await client.listTools();
30
30
  assert.deepEqual(
31
31
  tools.map(({ name }) => name),
32
- ["add_prd_file", "update_spec_file", "retrieve_knowledge"],
33
- );
34
- assert.equal(
35
- tools.find(({ name }) => name === "retrieve_knowledge")?.annotations
36
- ?.readOnlyHint,
37
- true,
32
+ ['add_prd_file', 'update_spec_file', 'retrieve_knowledge']
38
33
  );
34
+ assert.equal(tools.find(({ name }) => name === 'retrieve_knowledge')?.annotations?.readOnlyHint, true);
39
35
  } finally {
40
36
  await client.close();
41
37
  }
42
38
  });
43
39
 
44
- test("fails to start when RAG_API_BASE_URL is not configured", () => {
40
+ test('fails to start when RAG_API_BASE_URL is not configured', () => {
45
41
  const environment = { ...process.env };
46
42
  delete environment.RAG_API_BASE_URL;
47
43
 
48
- const result = spawnSync(process.execPath, [path.join(directory, "index.js")], {
49
- cwd: path.resolve(directory, "../.."),
44
+ const result = spawnSync(process.execPath, [path.join(directory, 'index.js')], {
45
+ cwd: path.resolve(directory, '../..'),
50
46
  env: environment,
51
- encoding: "utf8",
47
+ encoding: 'utf8'
52
48
  });
53
49
 
54
50
  assert.notEqual(result.status, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/agent",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "description": "Autobest Agent skills/plugins/mcp assets + sync cli",
6
6
  "files": [