@gotza02/sequential-thinking 10000.0.0 → 10000.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.
- package/README.md +6 -0
- package/dist/chaos.test.d.ts +1 -0
- package/dist/chaos.test.js +73 -0
- package/dist/codestore.test.d.ts +1 -0
- package/dist/codestore.test.js +65 -0
- package/dist/coding.test.d.ts +1 -0
- package/dist/coding.test.js +140 -0
- package/dist/e2e.test.d.ts +1 -0
- package/dist/e2e.test.js +122 -0
- package/dist/filesystem.test.d.ts +1 -0
- package/dist/filesystem.test.js +190 -0
- package/dist/graph.test.d.ts +1 -0
- package/dist/graph.test.js +150 -0
- package/dist/graph_extra.test.d.ts +1 -0
- package/dist/graph_extra.test.js +93 -0
- package/dist/graph_repro.test.d.ts +1 -0
- package/dist/graph_repro.test.js +50 -0
- package/dist/human.test.d.ts +1 -0
- package/dist/human.test.js +221 -0
- package/dist/integration.test.d.ts +1 -0
- package/dist/integration.test.js +58 -0
- package/dist/knowledge.test.d.ts +1 -0
- package/dist/knowledge.test.js +105 -0
- package/dist/lib.js +1 -0
- package/dist/notes.test.d.ts +1 -0
- package/dist/notes.test.js +84 -0
- package/dist/registration.test.d.ts +1 -0
- package/dist/registration.test.js +39 -0
- package/dist/server.test.d.ts +1 -0
- package/dist/server.test.js +127 -0
- package/dist/stress.test.d.ts +1 -0
- package/dist/stress.test.js +72 -0
- package/dist/tools/codestore_tools.test.d.ts +1 -0
- package/dist/tools/codestore_tools.test.js +115 -0
- package/dist/tools/filesystem.js +1 -0
- package/dist/tools/sports/core/constants.d.ts +2 -1
- package/dist/tools/sports/core/constants.js +18 -6
- package/dist/tools/sports/providers/scraper.d.ts +6 -1
- package/dist/tools/sports/providers/scraper.js +63 -8
- package/dist/tools/sports/tools/match.js +44 -21
- package/dist/tools/sports/tracker.test.d.ts +1 -0
- package/dist/tools/sports/tracker.test.js +100 -0
- package/dist/utils.test.d.ts +1 -0
- package/dist/utils.test.js +40 -0
- package/dist/verify_cache.test.d.ts +1 -0
- package/dist/verify_cache.test.js +185 -0
- package/dist/web_fallback.test.d.ts +1 -0
- package/dist/web_fallback.test.js +103 -0
- package/dist/web_read.test.d.ts +1 -0
- package/dist/web_read.test.js +60 -0
- package/package.json +7 -6
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { registerWebTools } from './tools/web.js';
|
|
3
|
+
import * as utils from './utils.js';
|
|
4
|
+
vi.mock('./utils.js', async (importOriginal) => {
|
|
5
|
+
const actual = await importOriginal();
|
|
6
|
+
return {
|
|
7
|
+
...actual,
|
|
8
|
+
fetchWithRetry: vi.fn(),
|
|
9
|
+
validatePublicUrl: vi.fn(),
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
describe('read_webpage tool', () => {
|
|
13
|
+
let mockToolCallback;
|
|
14
|
+
const mockServer = {
|
|
15
|
+
tool: vi.fn((name, desc, schema, callback) => {
|
|
16
|
+
if (name === 'read_webpage') {
|
|
17
|
+
mockToolCallback = callback;
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
vi.clearAllMocks();
|
|
23
|
+
registerWebTools(mockServer);
|
|
24
|
+
});
|
|
25
|
+
it('should convert HTML to Markdown', async () => {
|
|
26
|
+
const mockHtml = `
|
|
27
|
+
<html>
|
|
28
|
+
<head><title>Test Article</title></head>
|
|
29
|
+
<body>
|
|
30
|
+
<h1>Main Header</h1>
|
|
31
|
+
<p>Paragraph <b>bold</b>.</p>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
34
|
+
`;
|
|
35
|
+
utils.fetchWithRetry.mockResolvedValue({
|
|
36
|
+
ok: true,
|
|
37
|
+
text: async () => mockHtml
|
|
38
|
+
});
|
|
39
|
+
utils.validatePublicUrl.mockResolvedValue(undefined);
|
|
40
|
+
const result = await mockToolCallback({ url: 'https://example.com' });
|
|
41
|
+
expect(result.isError).toBeUndefined();
|
|
42
|
+
const content = result.content[0].text;
|
|
43
|
+
expect(content).toContain("Title: Test Article");
|
|
44
|
+
expect(content).toContain("Main Header");
|
|
45
|
+
expect(content).toContain("**bold**"); // Markdown bold
|
|
46
|
+
});
|
|
47
|
+
it('should handle private URL validation error', async () => {
|
|
48
|
+
utils.validatePublicUrl.mockRejectedValue(new Error("Access denied: Private IP"));
|
|
49
|
+
const result = await mockToolCallback({ url: 'http://localhost' });
|
|
50
|
+
expect(result.isError).toBe(true);
|
|
51
|
+
expect(result.content[0].text).toContain("Access denied");
|
|
52
|
+
});
|
|
53
|
+
it('should handle fetch errors', async () => {
|
|
54
|
+
utils.validatePublicUrl.mockResolvedValue(undefined);
|
|
55
|
+
utils.fetchWithRetry.mockRejectedValue(new Error("Network Error"));
|
|
56
|
+
const result = await mockToolCallback({ url: 'https://example.com' });
|
|
57
|
+
expect(result.isError).toBe(true);
|
|
58
|
+
expect(result.content[0].text).toContain("Network Error");
|
|
59
|
+
});
|
|
60
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gotza02/sequential-thinking",
|
|
3
|
-
"version": "10000.0.
|
|
3
|
+
"version": "10000.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,12 +53,13 @@
|
|
|
53
53
|
"@types/node": "^25.0.9",
|
|
54
54
|
"@types/turndown": "^5.0.6",
|
|
55
55
|
"@types/yargs": "^17.0.35",
|
|
56
|
-
"@vitest/coverage-v8": "^
|
|
57
|
-
"eslint": "^
|
|
58
|
-
"@typescript-eslint/parser": "^
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
56
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
57
|
+
"eslint": "^9.39.2",
|
|
58
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
60
|
+
"typescript-eslint": "^8.54.0",
|
|
60
61
|
"prettier": "^3.2.5",
|
|
61
62
|
"shx": "^0.4.0",
|
|
62
|
-
"vitest": "^
|
|
63
|
+
"vitest": "^4.0.18"
|
|
63
64
|
}
|
|
64
65
|
}
|