mulmocast-preprocessor 0.4.0 → 0.5.0
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 +10 -10
- package/lib/cli/utils.d.ts +2 -2
- package/lib/core/ai/command/query/index.d.ts +2 -2
- package/lib/core/ai/command/query/interactive.d.ts +7 -7
- package/lib/core/ai/command/query/prompts.d.ts +3 -3
- package/lib/core/ai/command/summarize/index.d.ts +2 -2
- package/lib/core/ai/command/summarize/prompts.d.ts +2 -2
- package/lib/core/ai/llm.d.ts +4 -4
- package/lib/core/ai/utils/fetcher.d.ts +8 -0
- package/lib/core/ai/utils/fetcher.js +68 -17
- package/lib/core/preprocessing/filter.d.ts +4 -4
- package/lib/core/preprocessing/filter.js +1 -1
- package/lib/core/preprocessing/process.d.ts +2 -2
- package/lib/core/preprocessing/profiles.d.ts +2 -2
- package/lib/core/preprocessing/variant.d.ts +2 -2
- package/lib/core/preprocessing/variant.js +1 -1
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -106,9 +106,9 @@ mulmocast-preprocessor query script.json # Omit question for interactive mode
|
|
|
106
106
|
|
|
107
107
|
```typescript
|
|
108
108
|
import { processScript, listProfiles, applyProfile } from "mulmocast-preprocessor";
|
|
109
|
-
import type {
|
|
109
|
+
import type { ExtendedMulmoScript } from "mulmocast-preprocessor";
|
|
110
110
|
|
|
111
|
-
const script:
|
|
111
|
+
const script: ExtendedMulmoScript = {
|
|
112
112
|
title: "My Presentation",
|
|
113
113
|
beats: [
|
|
114
114
|
{
|
|
@@ -148,7 +148,7 @@ const result = processScript(script, {
|
|
|
148
148
|
Main processing function that applies profile and filters.
|
|
149
149
|
|
|
150
150
|
**Parameters:**
|
|
151
|
-
- `script:
|
|
151
|
+
- `script: ExtendedMulmoScript` - Input script with variants/meta
|
|
152
152
|
- `options: ProcessOptions` - Processing options
|
|
153
153
|
- `profile?: string` - Profile name to apply
|
|
154
154
|
- `section?: string` - Filter by section
|
|
@@ -161,7 +161,7 @@ Main processing function that applies profile and filters.
|
|
|
161
161
|
Apply a profile to the script, replacing text/image and skipping marked beats.
|
|
162
162
|
|
|
163
163
|
**Parameters:**
|
|
164
|
-
- `script:
|
|
164
|
+
- `script: ExtendedMulmoScript` - Input script
|
|
165
165
|
- `profileName: string` - Profile name
|
|
166
166
|
|
|
167
167
|
**Returns:** `MulmoScript` - Processed script
|
|
@@ -171,7 +171,7 @@ Apply a profile to the script, replacing text/image and skipping marked beats.
|
|
|
171
171
|
Get list of available profiles from script.
|
|
172
172
|
|
|
173
173
|
**Parameters:**
|
|
174
|
-
- `script:
|
|
174
|
+
- `script: ExtendedMulmoScript` - Input script
|
|
175
175
|
|
|
176
176
|
**Returns:** `ProfileInfo[]` - Array of profile info with beat counts
|
|
177
177
|
|
|
@@ -188,7 +188,7 @@ Filter beats by tags (extracts beats that have any of the specified tags).
|
|
|
188
188
|
Generate a summary of the script content using LLM.
|
|
189
189
|
|
|
190
190
|
**Parameters:**
|
|
191
|
-
- `script:
|
|
191
|
+
- `script: ExtendedMulmoScript` - Input script
|
|
192
192
|
- `options: SummarizeOptions` - Summarization options
|
|
193
193
|
- `provider?: LLMProvider` - LLM provider (default: "openai")
|
|
194
194
|
- `model?: string` - Model name
|
|
@@ -204,7 +204,7 @@ Generate a summary of the script content using LLM.
|
|
|
204
204
|
Ask a question about the script content.
|
|
205
205
|
|
|
206
206
|
**Parameters:**
|
|
207
|
-
- `script:
|
|
207
|
+
- `script: ExtendedMulmoScript` - Input script
|
|
208
208
|
- `question: string` - Question to ask
|
|
209
209
|
- `options: QueryOptions` - Query options (same as summarize)
|
|
210
210
|
|
|
@@ -215,7 +215,7 @@ Ask a question about the script content.
|
|
|
215
215
|
Create an interactive query session for follow-up questions.
|
|
216
216
|
|
|
217
217
|
**Parameters:**
|
|
218
|
-
- `script:
|
|
218
|
+
- `script: ExtendedMulmoScript` - Input script
|
|
219
219
|
- `options: QueryOptions` - Query options
|
|
220
220
|
|
|
221
221
|
**Returns:** Session object with `sendInteractiveQuery()` method
|
|
@@ -233,10 +233,10 @@ For AI features (summarize, query), set the API key for your LLM provider:
|
|
|
233
233
|
|
|
234
234
|
## Extended Schema
|
|
235
235
|
|
|
236
|
-
###
|
|
236
|
+
### ExtendedMulmoBeat
|
|
237
237
|
|
|
238
238
|
```typescript
|
|
239
|
-
interface
|
|
239
|
+
interface ExtendedMulmoBeat extends MulmoBeat {
|
|
240
240
|
variants?: Record<string, BeatVariant>;
|
|
241
241
|
meta?: BeatMeta;
|
|
242
242
|
}
|
package/lib/cli/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
2
2
|
/**
|
|
3
3
|
* Check if input is a URL
|
|
4
4
|
*/
|
|
@@ -6,4 +6,4 @@ export declare const isUrl: (input: string) => boolean;
|
|
|
6
6
|
/**
|
|
7
7
|
* Load script from file path or URL
|
|
8
8
|
*/
|
|
9
|
-
export declare const loadScript: (input: string) => Promise<
|
|
9
|
+
export declare const loadScript: (input: string) => Promise<ExtendedMulmoScript>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
2
2
|
import type { QueryOptions, QueryResult } from "../../../../types/query.js";
|
|
3
3
|
/**
|
|
4
4
|
* Main query function - answers a question based on script content
|
|
5
5
|
*/
|
|
6
|
-
export declare const queryScript: (script:
|
|
6
|
+
export declare const queryScript: (script: ExtendedMulmoScript, question: string, options?: Partial<QueryOptions>) => Promise<QueryResult>;
|
|
7
7
|
export type { QueryOptions, QueryResult } from "../../../../types/query.js";
|
|
8
8
|
export { queryOptionsSchema } from "../../../../types/query.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExtendedMulmoScript, Reference } from "@mulmocast/extended-types";
|
|
2
2
|
import type { QueryOptions, InteractiveQuerySession, ConversationMessage } from "../../../../types/query.js";
|
|
3
3
|
import { type FetchedContent } from "../../utils/fetcher.js";
|
|
4
4
|
/**
|
|
5
5
|
* Create an interactive query session
|
|
6
6
|
*/
|
|
7
|
-
export declare const createInteractiveSession: (script:
|
|
7
|
+
export declare const createInteractiveSession: (script: ExtendedMulmoScript, options?: Partial<QueryOptions>) => {
|
|
8
8
|
session: InteractiveQuerySession;
|
|
9
|
-
filteredScript:
|
|
9
|
+
filteredScript: ExtendedMulmoScript;
|
|
10
10
|
validatedOptions: QueryOptions;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Send a question in an interactive session
|
|
14
14
|
*/
|
|
15
|
-
export declare const sendInteractiveQuery: (filteredScript:
|
|
15
|
+
export declare const sendInteractiveQuery: (filteredScript: ExtendedMulmoScript, question: string, session: InteractiveQuerySession, options: QueryOptions) => Promise<string>;
|
|
16
16
|
/**
|
|
17
17
|
* Clear conversation history
|
|
18
18
|
*/
|
|
@@ -37,7 +37,7 @@ export declare const removeSuggestFetchMarkers: (response: string) => string;
|
|
|
37
37
|
/**
|
|
38
38
|
* Get available references from script
|
|
39
39
|
*/
|
|
40
|
-
export declare const getReferences: (script:
|
|
40
|
+
export declare const getReferences: (script: ExtendedMulmoScript) => Reference[];
|
|
41
41
|
/**
|
|
42
42
|
* Fetch reference content by URL
|
|
43
43
|
*/
|
|
@@ -45,8 +45,8 @@ export declare const fetchReference: (url: string, verbose?: boolean) => Promise
|
|
|
45
45
|
/**
|
|
46
46
|
* Find matching reference for a query
|
|
47
47
|
*/
|
|
48
|
-
export declare const findReference: (script:
|
|
48
|
+
export declare const findReference: (script: ExtendedMulmoScript, query: string) => Reference | null;
|
|
49
49
|
/**
|
|
50
50
|
* Send a question with fetched reference content
|
|
51
51
|
*/
|
|
52
|
-
export declare const sendInteractiveQueryWithFetch: (filteredScript:
|
|
52
|
+
export declare const sendInteractiveQueryWithFetch: (filteredScript: ExtendedMulmoScript, question: string, fetchedContent: FetchedContent, session: InteractiveQuerySession, options: QueryOptions) => Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QueryOptions, ConversationMessage } from "../../../../types/query.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
3
3
|
/**
|
|
4
4
|
* Default system prompt for query
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ export declare const getSystemPrompt: (options: QueryOptions) => string;
|
|
|
11
11
|
/**
|
|
12
12
|
* Build user prompt from script and question
|
|
13
13
|
*/
|
|
14
|
-
export declare const buildUserPrompt: (script:
|
|
14
|
+
export declare const buildUserPrompt: (script: ExtendedMulmoScript, question: string) => string;
|
|
15
15
|
/**
|
|
16
16
|
* Default system prompt for interactive query
|
|
17
17
|
*/
|
|
@@ -27,4 +27,4 @@ export declare const getInteractiveSystemPrompt: (options: QueryOptions) => stri
|
|
|
27
27
|
/**
|
|
28
28
|
* Build user prompt with conversation history for interactive mode
|
|
29
29
|
*/
|
|
30
|
-
export declare const buildInteractiveUserPrompt: (script:
|
|
30
|
+
export declare const buildInteractiveUserPrompt: (script: ExtendedMulmoScript, question: string, history: ConversationMessage[]) => string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
2
2
|
import type { SummarizeOptions, SummarizeResult } from "../../../../types/summarize.js";
|
|
3
3
|
/**
|
|
4
4
|
* Main summarize function - generates a summary of the entire script
|
|
5
5
|
*/
|
|
6
|
-
export declare const summarizeScript: (script:
|
|
6
|
+
export declare const summarizeScript: (script: ExtendedMulmoScript, options?: Partial<SummarizeOptions>) => Promise<SummarizeResult>;
|
|
7
7
|
export type { SummarizeOptions, SummarizeResult, LLMProvider, SummarizeFormat } from "../../../../types/summarize.js";
|
|
8
8
|
export { summarizeOptionsSchema, llmProviderSchema, summarizeFormatSchema } from "../../../../types/summarize.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SummarizeOptions } from "../../../../types/summarize.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
3
3
|
/**
|
|
4
4
|
* Default system prompt for text summary
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ export declare const DEFAULT_SYSTEM_PROMPT_MARKDOWN = "You are creating a summar
|
|
|
11
11
|
/**
|
|
12
12
|
* Build user prompt from entire script
|
|
13
13
|
*/
|
|
14
|
-
export declare const buildUserPrompt: (script:
|
|
14
|
+
export declare const buildUserPrompt: (script: ExtendedMulmoScript, options: SummarizeOptions) => string;
|
|
15
15
|
/**
|
|
16
16
|
* Get system prompt based on format and language
|
|
17
17
|
*/
|
package/lib/core/ai/llm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
2
2
|
import type { LLMProvider } from "../../types/summarize.js";
|
|
3
3
|
/**
|
|
4
4
|
* Base options for LLM operations
|
|
@@ -34,7 +34,7 @@ export declare const getProviderApiKey: (provider: LLMProvider) => string | unde
|
|
|
34
34
|
/**
|
|
35
35
|
* Filter script based on options (section, tags)
|
|
36
36
|
*/
|
|
37
|
-
export declare const filterScript: (script:
|
|
37
|
+
export declare const filterScript: (script: ExtendedMulmoScript, options: BaseLLMOptions) => ExtendedMulmoScript;
|
|
38
38
|
/**
|
|
39
39
|
* Get language name from code
|
|
40
40
|
*/
|
|
@@ -42,7 +42,7 @@ export declare const getLanguageName: (langCode: string) => string;
|
|
|
42
42
|
/**
|
|
43
43
|
* Build script content for user prompt (common part)
|
|
44
44
|
*/
|
|
45
|
-
export declare const buildScriptContent: (script:
|
|
45
|
+
export declare const buildScriptContent: (script: ExtendedMulmoScript) => string;
|
|
46
46
|
/**
|
|
47
47
|
* Command execution result
|
|
48
48
|
*/
|
|
@@ -54,7 +54,7 @@ export interface CommandResult {
|
|
|
54
54
|
/**
|
|
55
55
|
* Execute a command (summarize, query, etc.) with common logic
|
|
56
56
|
*/
|
|
57
|
-
export declare const executeCommand: <T extends BaseLLMOptions>(script:
|
|
57
|
+
export declare const executeCommand: <T extends BaseLLMOptions>(script: ExtendedMulmoScript, options: T, getSystemPrompt: (opts: T) => string, buildUserPrompt: (script: ExtendedMulmoScript) => string, verboseMessage: string) => Promise<CommandResult | null>;
|
|
58
58
|
/**
|
|
59
59
|
* Execute LLM call with GraphAI
|
|
60
60
|
*/
|
|
@@ -7,6 +7,14 @@ export interface FetchedContent {
|
|
|
7
7
|
content: string;
|
|
8
8
|
error?: string;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Strip HTML tags and extract text content
|
|
12
|
+
*/
|
|
13
|
+
export declare const stripHtml: (html: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Extract title from HTML using indexOf (avoids regex ReDoS)
|
|
16
|
+
*/
|
|
17
|
+
export declare const extractTitle: (html: string) => string | null;
|
|
10
18
|
/**
|
|
11
19
|
* Fetch URL content and extract text
|
|
12
20
|
*/
|
|
@@ -1,36 +1,87 @@
|
|
|
1
1
|
import { GraphAILogger } from "graphai";
|
|
2
|
+
/**
|
|
3
|
+
* Remove all occurrences of a tag block (e.g. <script>...</script>) using indexOf
|
|
4
|
+
*/
|
|
5
|
+
const removeTagBlock = (html, openTag, closeTag) => {
|
|
6
|
+
let result = html;
|
|
7
|
+
let lower = result.toLowerCase();
|
|
8
|
+
let start = lower.indexOf(openTag);
|
|
9
|
+
while (start !== -1) {
|
|
10
|
+
const end = lower.indexOf(closeTag, start);
|
|
11
|
+
if (end === -1)
|
|
12
|
+
break;
|
|
13
|
+
result = result.substring(0, start) + result.substring(end + closeTag.length);
|
|
14
|
+
lower = result.toLowerCase();
|
|
15
|
+
start = lower.indexOf(openTag);
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
const BLOCK_ELEMENTS = new Set(["p", "div", "h1", "h2", "h3", "h4", "h5", "h6", "li", "tr", "br"]);
|
|
20
|
+
/**
|
|
21
|
+
* Remove all HTML tags using indexOf, replacing block closings with newlines
|
|
22
|
+
*/
|
|
23
|
+
const removeTags = (html) => {
|
|
24
|
+
const parts = [];
|
|
25
|
+
let i = 0;
|
|
26
|
+
while (i < html.length) {
|
|
27
|
+
const tagStart = html.indexOf("<", i);
|
|
28
|
+
if (tagStart === -1) {
|
|
29
|
+
parts.push(html.substring(i));
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
parts.push(html.substring(i, tagStart));
|
|
33
|
+
const tagEnd = html.indexOf(">", tagStart);
|
|
34
|
+
if (tagEnd === -1) {
|
|
35
|
+
parts.push(html.substring(tagStart));
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
const tagContent = html.substring(tagStart + 1, tagEnd);
|
|
39
|
+
const closeMatch = tagContent.match(/^\/(\w+)/);
|
|
40
|
+
if (closeMatch && BLOCK_ELEMENTS.has(closeMatch[1].toLowerCase())) {
|
|
41
|
+
parts.push("\n");
|
|
42
|
+
}
|
|
43
|
+
i = tagEnd + 1;
|
|
44
|
+
}
|
|
45
|
+
return parts.join("");
|
|
46
|
+
};
|
|
2
47
|
/**
|
|
3
48
|
* Strip HTML tags and extract text content
|
|
4
49
|
*/
|
|
5
|
-
const stripHtml = (html) => {
|
|
6
|
-
// Remove script and
|
|
7
|
-
let text = html
|
|
8
|
-
text = text
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// Remove all remaining HTML tags
|
|
14
|
-
// eslint-disable-next-line sonarjs/slow-regex -- standard HTML tag removal pattern, safe for typical HTML
|
|
15
|
-
text = text.replace(/<[^>]*>/g, " ");
|
|
16
|
-
// Decode common HTML entities
|
|
50
|
+
export const stripHtml = (html) => {
|
|
51
|
+
// Remove script, style elements and comments using indexOf (avoids regex ReDoS)
|
|
52
|
+
let text = removeTagBlock(html, "<script", "</script>");
|
|
53
|
+
text = removeTagBlock(text, "<style", "</style>");
|
|
54
|
+
text = removeTagBlock(text, "<!--", "-->");
|
|
55
|
+
// Remove all HTML tags
|
|
56
|
+
text = removeTags(text);
|
|
57
|
+
// Decode common HTML entities (& must be last to prevent double-decoding)
|
|
17
58
|
text = text.replace(/ /g, " ");
|
|
18
|
-
text = text.replace(/&/g, "&");
|
|
19
59
|
text = text.replace(/</g, "<");
|
|
20
60
|
text = text.replace(/>/g, ">");
|
|
21
61
|
text = text.replace(/"/g, '"');
|
|
22
62
|
text = text.replace(/'/g, "'");
|
|
63
|
+
text = text.replace(/&/g, "&");
|
|
23
64
|
// Normalize whitespace
|
|
24
65
|
text = text.replace(/\s+/g, " ");
|
|
25
66
|
text = text.replace(/\n\s*\n/g, "\n\n");
|
|
26
67
|
return text.trim();
|
|
27
68
|
};
|
|
28
69
|
/**
|
|
29
|
-
* Extract title from HTML
|
|
70
|
+
* Extract title from HTML using indexOf (avoids regex ReDoS)
|
|
30
71
|
*/
|
|
31
|
-
const extractTitle = (html) => {
|
|
32
|
-
const
|
|
33
|
-
|
|
72
|
+
export const extractTitle = (html) => {
|
|
73
|
+
const lower = html.toLowerCase();
|
|
74
|
+
const titleStart = lower.indexOf("<title");
|
|
75
|
+
if (titleStart === -1)
|
|
76
|
+
return null;
|
|
77
|
+
const contentStart = html.indexOf(">", titleStart);
|
|
78
|
+
if (contentStart === -1)
|
|
79
|
+
return null;
|
|
80
|
+
const titleEnd = lower.indexOf("</title>", contentStart);
|
|
81
|
+
if (titleEnd === -1)
|
|
82
|
+
return null;
|
|
83
|
+
const title = html.substring(contentStart + 1, titleEnd).trim();
|
|
84
|
+
return title || null;
|
|
34
85
|
};
|
|
35
86
|
/**
|
|
36
87
|
* Fetch URL content and extract text
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { MulmoScript } from "@mulmocast/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
3
3
|
/**
|
|
4
4
|
* Filter beats by section (preserves meta for chaining)
|
|
5
5
|
*/
|
|
6
|
-
export declare const filterBySection: (script:
|
|
6
|
+
export declare const filterBySection: (script: ExtendedMulmoScript, section: string) => ExtendedMulmoScript;
|
|
7
7
|
/**
|
|
8
8
|
* Filter beats by tags (preserves meta for chaining)
|
|
9
9
|
*/
|
|
10
|
-
export declare const filterByTags: (script:
|
|
10
|
+
export declare const filterByTags: (script: ExtendedMulmoScript, tags: string[]) => ExtendedMulmoScript;
|
|
11
11
|
/**
|
|
12
12
|
* Strip variants and meta fields, converting to standard MulmoScript
|
|
13
13
|
*/
|
|
14
|
-
export declare const stripExtendedFields: (script:
|
|
14
|
+
export declare const stripExtendedFields: (script: ExtendedMulmoScript) => MulmoScript;
|
|
@@ -3,7 +3,7 @@ const stripBeatExtendedFields = (beat) => {
|
|
|
3
3
|
return baseBeat;
|
|
4
4
|
};
|
|
5
5
|
const filterBeatsToMulmoScript = (script, predicate) => {
|
|
6
|
-
const { outputProfiles: __outputProfiles, ...baseScript } = script;
|
|
6
|
+
const { outputProfiles: __outputProfiles, scriptMeta: __scriptMeta, ...baseScript } = script;
|
|
7
7
|
return {
|
|
8
8
|
...baseScript,
|
|
9
9
|
beats: script.beats.filter(predicate).map(stripBeatExtendedFields),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MulmoScript } from "@mulmocast/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
3
3
|
import type { ProcessOptions } from "../../types/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Main processing function
|
|
6
6
|
* Applies filters first (while meta exists), then profile
|
|
7
7
|
*/
|
|
8
|
-
export declare const processScript: (script:
|
|
8
|
+
export declare const processScript: (script: ExtendedMulmoScript, options?: ProcessOptions) => MulmoScript;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
2
2
|
import type { ProfileInfo } from "../../types/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Get list of available profiles from script
|
|
5
5
|
*/
|
|
6
|
-
export declare const listProfiles: (script:
|
|
6
|
+
export declare const listProfiles: (script: ExtendedMulmoScript) => ProfileInfo[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MulmoScript } from "@mulmocast/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedMulmoScript } from "@mulmocast/extended-types";
|
|
3
3
|
/**
|
|
4
4
|
* Apply profile to script and return standard MulmoScript
|
|
5
5
|
*/
|
|
6
|
-
export declare const applyProfile: (script:
|
|
6
|
+
export declare const applyProfile: (script: ExtendedMulmoScript, profileName: string) => MulmoScript;
|
|
@@ -18,7 +18,7 @@ const applyVariantToBeat = (beat, profileName) => {
|
|
|
18
18
|
* Apply profile to script and return standard MulmoScript
|
|
19
19
|
*/
|
|
20
20
|
export const applyProfile = (script, profileName) => {
|
|
21
|
-
const { outputProfiles: __outputProfiles, ...baseScript } = script;
|
|
21
|
+
const { outputProfiles: __outputProfiles, scriptMeta: __scriptMeta, ...baseScript } = script;
|
|
22
22
|
return {
|
|
23
23
|
...baseScript,
|
|
24
24
|
beats: script.beats.map((beat) => applyVariantToBeat(beat, profileName)).filter((beat) => beat !== null),
|
package/lib/index.d.ts
CHANGED
|
@@ -5,10 +5,8 @@ export { listProfiles } from "./core/preprocessing/profiles.js";
|
|
|
5
5
|
export { summarizeScript } from "./core/ai/command/summarize/index.js";
|
|
6
6
|
export { queryScript } from "./core/ai/command/query/index.js";
|
|
7
7
|
export { createInteractiveSession, sendInteractiveQuery, sendInteractiveQueryWithFetch, clearHistory, getHistory, getReferences, findReference, fetchReference, parseSuggestedFetch, removeSuggestFetchMarkers, } from "./core/ai/command/query/interactive.js";
|
|
8
|
-
export { fetchUrlContent } from "./core/ai/utils/fetcher.js";
|
|
8
|
+
export { fetchUrlContent, stripHtml, extractTitle } from "./core/ai/utils/fetcher.js";
|
|
9
9
|
export type { FetchedContent } from "./core/ai/utils/fetcher.js";
|
|
10
|
-
export type { BeatVariant, BeatMeta, ExtendedBeat, ExtendedScript, OutputProfile, Reference, FAQ, ScriptMeta, MulmoImageAsset, } from "@mulmocast/extended-types";
|
|
11
|
-
export { beatVariantSchema, beatMetaSchema, extendedBeatSchema, extendedScriptSchema, outputProfileSchema, referenceSchema, faqSchema, scriptMetaSchema, } from "@mulmocast/extended-types";
|
|
12
10
|
export type { ProcessOptions, ProfileInfo } from "./types/index.js";
|
|
13
11
|
export type { SummarizeOptions, SummarizeResult, LLMProvider, SummarizeFormat, ProviderConfig } from "./types/summarize.js";
|
|
14
12
|
export type { QueryOptions, QueryResult, ConversationMessage, InteractiveQuerySession } from "./types/query.js";
|
package/lib/index.js
CHANGED
|
@@ -8,8 +8,7 @@ export { summarizeScript } from "./core/ai/command/summarize/index.js";
|
|
|
8
8
|
export { queryScript } from "./core/ai/command/query/index.js";
|
|
9
9
|
export { createInteractiveSession, sendInteractiveQuery, sendInteractiveQueryWithFetch, clearHistory, getHistory, getReferences, findReference, fetchReference, parseSuggestedFetch, removeSuggestFetchMarkers, } from "./core/ai/command/query/interactive.js";
|
|
10
10
|
// Utilities
|
|
11
|
-
export { fetchUrlContent } from "./core/ai/utils/fetcher.js";
|
|
12
|
-
export { beatVariantSchema, beatMetaSchema, extendedBeatSchema, extendedScriptSchema, outputProfileSchema, referenceSchema, faqSchema, scriptMetaSchema, } from "@mulmocast/extended-types";
|
|
11
|
+
export { fetchUrlContent, stripHtml, extractTitle } from "./core/ai/utils/fetcher.js";
|
|
13
12
|
// Schemas (local)
|
|
14
13
|
export { summarizeOptionsSchema, llmProviderSchema, summarizeFormatSchema } from "./types/summarize.js";
|
|
15
14
|
export { queryOptionsSchema } from "./types/query.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulmocast-preprocessor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Preprocessor for MulmoScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@graphai/groq_agent": "^2.0.2",
|
|
40
40
|
"@graphai/openai_agent": "^2.0.9",
|
|
41
41
|
"@graphai/vanilla": "^2.0.12",
|
|
42
|
-
"@mulmocast/extended-types": "^0.
|
|
42
|
+
"@mulmocast/extended-types": "^0.3.0",
|
|
43
43
|
"@mulmocast/types": "^2.1.35",
|
|
44
44
|
"dotenv": "^17.2.4",
|
|
45
45
|
"graphai": "^2.0.16",
|