decant-core 1.0.0 → 1.0.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/README.md +20 -20
- package/ai/base.js +4 -4
- package/ai/chatgpt.js +356 -216
- package/ai/chatgpt_helper.js +46 -28
- package/ai/chatgpt_scroll_collector.js +36 -33
- package/ai/chub.js +90 -0
- package/ai/claude.js +119 -92
- package/ai/claude_react_reader.js +8 -6
- package/ai/copilot.js +158 -124
- package/ai/deepseek.js +36 -27
- package/ai/gemini.js +384 -230
- package/ai/gemini_cloud_assist.js +31 -22
- package/ai/google_ai_studio.js +45 -27
- package/ai/google_search_ai.js +32 -23
- package/ai/index.js +25 -19
- package/ai/joyland.js +85 -0
- package/ai/lumo.js +39 -28
- package/ai/meta.js +30 -24
- package/ai/mistral.js +21 -16
- package/ai/notebooklm.js +50 -34
- package/ai/perplexity.js +22 -19
- package/ai/qwen.js +29 -25
- package/ai/z_ai.js +34 -28
- package/detection/detect-platform.js +27 -19
- package/detection/domains.js +32 -24
- package/lib/turndown.js +352 -183
- package/package.json +13 -4
- package/utils/html-to-markdown.js +130 -109
package/README.md
CHANGED
|
@@ -6,23 +6,23 @@ This package powers the AI chat extraction features in both [AI Chat Exporter](h
|
|
|
6
6
|
|
|
7
7
|
## Supported Platforms
|
|
8
8
|
|
|
9
|
-
| Platform
|
|
10
|
-
|
|
11
|
-
| ChatGPT
|
|
12
|
-
| Claude
|
|
13
|
-
| Copilot
|
|
14
|
-
| DeepSeek
|
|
15
|
-
| Gemini
|
|
9
|
+
| Platform | Parser |
|
|
10
|
+
| ------------------- | ------------------------- |
|
|
11
|
+
| ChatGPT | `ChatGPTParser` |
|
|
12
|
+
| Claude | `ClaudeParser` |
|
|
13
|
+
| Copilot | `CopilotParser` |
|
|
14
|
+
| DeepSeek | `DeepSeekParser` |
|
|
15
|
+
| Gemini | `GeminiParser` |
|
|
16
16
|
| Gemini Cloud Assist | `GeminiCloudAssistParser` |
|
|
17
|
-
| Google AI Studio
|
|
18
|
-
| Google Search AI
|
|
19
|
-
| Lumo
|
|
20
|
-
| Meta AI
|
|
21
|
-
| Mistral
|
|
22
|
-
| NotebookLM
|
|
23
|
-
| Perplexity
|
|
24
|
-
| Qwen
|
|
25
|
-
| Z AI
|
|
17
|
+
| Google AI Studio | `GoogleAIStudioParser` |
|
|
18
|
+
| Google Search AI | `GoogleSearchAIParser` |
|
|
19
|
+
| Lumo | `LumoParser` |
|
|
20
|
+
| Meta AI | `MetaParser` |
|
|
21
|
+
| Mistral | `MistralParser` |
|
|
22
|
+
| NotebookLM | `NotebookLMParser` |
|
|
23
|
+
| Perplexity | `PerplexityParser` |
|
|
24
|
+
| Qwen | `QwenParser` |
|
|
25
|
+
| Z AI | `ZAiParser` |
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
@@ -39,7 +39,7 @@ npm install decant-core@file:../parser-core
|
|
|
39
39
|
## Usage
|
|
40
40
|
|
|
41
41
|
```js
|
|
42
|
-
import { detectPlatform, parsers, isAiChatUrl } from
|
|
42
|
+
import { detectPlatform, parsers, isAiChatUrl } from "decant-core";
|
|
43
43
|
|
|
44
44
|
// Check if a URL is an AI chat platform
|
|
45
45
|
if (isAiChatUrl(window.location.href)) {
|
|
@@ -60,13 +60,13 @@ if (isAiChatUrl(window.location.href)) {
|
|
|
60
60
|
|
|
61
61
|
```js
|
|
62
62
|
// Individual parser
|
|
63
|
-
import { ChatGPTParser } from
|
|
63
|
+
import { ChatGPTParser } from "decant-core";
|
|
64
64
|
|
|
65
65
|
// Detection helpers
|
|
66
|
-
import { detectPlatform, isAiChatUrl, AI_CHAT_DOMAINS } from
|
|
66
|
+
import { detectPlatform, isAiChatUrl, AI_CHAT_DOMAINS } from "decant-core";
|
|
67
67
|
|
|
68
68
|
// Utilities
|
|
69
|
-
import { convertToMarkdown, cleanMarkdown } from
|
|
69
|
+
import { convertToMarkdown, cleanMarkdown } from "decant-core";
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
## Project Structure
|
package/ai/base.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export class ChatParser {
|
|
2
|
-
name =
|
|
2
|
+
name = "Generic";
|
|
3
3
|
|
|
4
4
|
getPlatformName() {
|
|
5
|
-
return this.name || this.constructor.name.replace(/Parser$/,
|
|
5
|
+
return this.name || this.constructor.name.replace(/Parser$/, "");
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
constructor() {}
|
|
@@ -13,7 +13,7 @@ export class ChatParser {
|
|
|
13
13
|
* @returns {boolean}
|
|
14
14
|
*/
|
|
15
15
|
isAvailable(_url) {
|
|
16
|
-
throw new Error(
|
|
16
|
+
throw new Error("Not implemented");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -21,6 +21,6 @@ export class ChatParser {
|
|
|
21
21
|
* @returns {Promise<{ title: string, messages: Array<{role: string, content: string}>, metadata?: Record<string, string> }>}
|
|
22
22
|
*/
|
|
23
23
|
async parse() {
|
|
24
|
-
throw new Error(
|
|
24
|
+
throw new Error("Not implemented");
|
|
25
25
|
}
|
|
26
26
|
}
|