@neuroequality/neuroadapt-ai
Version:
AI-powered accessibility personalization for neurodivergent users
949 lines (915 loc) • 29.2 kB
JavaScript
import { EventEmitter as g } from "eventemitter3";
class p extends g {
constructor(e) {
super(), this.config = { ...e }, this.capabilities = this.getCapabilities(), this.status = {
isAvailable: !1,
isConfigured: this.isConfigValid()
};
}
/**
* Update provider configuration
*/
updateConfig(e) {
this.config = { ...this.config, ...e }, this.status.isConfigured = this.isConfigValid(), this.checkAvailability();
}
/**
* Get current provider status
*/
getStatus() {
return { ...this.status };
}
/**
* Test provider availability
*/
async testConnection() {
try {
const e = {
prompt: "Hello",
maxTokens: 5
};
return await this.generate(e), this.status.isAvailable = !0, !0;
} catch (e) {
return this.status.isAvailable = !1, this.status.lastError = e instanceof Error ? e.message : String(e), !1;
}
}
/**
* Get estimated cost for request
*/
estimateCost(e) {
return (Math.ceil(e.prompt.length / 4) + (e.maxTokens || 100)) * 1e-5;
}
/**
* Check if provider supports a specific capability
*/
supportsCapability(e) {
return this.capabilities[e];
}
/**
* Get rate limit information
*/
getRateLimitInfo() {
return {
remaining: this.status.rateLimitRemaining,
reset: this.status.rateLimitReset
};
}
// Protected methods for subclasses
/**
* Validate provider configuration
*/
isConfigValid() {
return !!(this.config.apiKey || this.config.baseURL);
}
/**
* Check provider availability
*/
async checkAvailability() {
this.status.isConfigured && await this.testConnection();
}
/**
* Handle rate limiting
*/
handleRateLimit(e) {
this.status.rateLimitReset = Date.now() + e * 1e3, this.status.rateLimitRemaining = 0, this.emit("rate-limit", e);
}
/**
* Update rate limit status
*/
updateRateLimit(e, t) {
this.status.rateLimitRemaining = e, this.status.rateLimitReset = t;
}
/**
* Create standard error response
*/
createErrorResponse(e) {
throw this.status.lastError = e.message, this.emit("error", e), e;
}
/**
* Validate request parameters
*/
validateRequest(e) {
if (!e.prompt)
throw new Error("Prompt is required");
if (e.maxTokens && e.maxTokens <= 0)
throw new Error("maxTokens must be positive");
if (e.temperature && (e.temperature < 0 || e.temperature > 2))
throw new Error("temperature must be between 0 and 2");
if (e.stream && !this.capabilities.streaming)
throw new Error("Streaming not supported by this provider");
if (e.functions && !this.capabilities.functionCalling)
throw new Error("Function calling not supported by this provider");
}
/**
* Create accessibility analysis prompt
*/
createAccessibilityPrompt(e, t) {
return `Analyze this content for accessibility improvements for neurodivergent users.
Current user preferences: ${JSON.stringify(t, null, 2)}
Content to analyze:
${e}
Provide specific suggestions for:
1. Sensory adaptations (motion, contrast, visual)
2. Cognitive load reduction (chunking, simplification)
3. Navigation improvements
4. Content structure optimizations
Format your response as actionable recommendations with confidence scores.`;
}
/**
* Create content simplification prompt
*/
createSimplificationPrompt(e, t) {
return `Simplify this content for a ${t} reading level while preserving all important information.
Guidelines:
- Use shorter sentences
- Replace complex words with simpler alternatives
- Break up long paragraphs
- Add clear headings and structure
- Maintain factual accuracy
Original content:
${e}
Simplified version:`;
}
/**
* Parse adaptation suggestions from AI response
*/
parseAdaptationSuggestions(e) {
const t = [], s = e.split(`
`).filter((a) => a.trim());
for (const a of s)
(a.includes("motion") || a.includes("animation")) && t.push({
type: "sensory",
target: "motionReduction",
action: "enable",
reasoning: a,
confidence: "medium",
priority: "medium",
estimatedImpact: 0.6
}), (a.includes("contrast") || a.includes("color")) && t.push({
type: "sensory",
target: "highContrast",
action: "enable",
reasoning: a,
confidence: "medium",
priority: "medium",
estimatedImpact: 0.7
}), (a.includes("chunk") || a.includes("break")) && t.push({
type: "cognitive",
target: "chunkSize",
action: "adjust",
value: 2,
reasoning: a,
confidence: "high",
priority: "high",
estimatedImpact: 0.8
});
return t;
}
}
class y extends p {
constructor(e) {
super(e), this.model = e.model || "claude-3-sonnet-20240229", this.initializeClient();
}
getProviderName() {
return "Claude/Anthropic";
}
getCapabilities() {
return {
textGeneration: !0,
textAnalysis: !0,
codeGeneration: !0,
reasoning: !0,
streaming: !0,
functionCalling: !1,
// Claude doesn't support function calling yet
vision: this.model.includes("claude-3")
// Vision available in Claude 3
};
}
getAvailableModels() {
return [
"claude-3-opus-20240229",
"claude-3-sonnet-20240229",
"claude-3-haiku-20240307"
];
}
async generate(e) {
if (this.validateRequest(e), !this.anthropic)
throw new Error("Claude client not initialized. Make sure anthropic package is installed.");
try {
const t = [
{ role: "user", content: e.prompt }
], s = await this.anthropic.messages.create({
model: this.model,
max_tokens: e.maxTokens || 1e3,
temperature: e.temperature || 0.7,
messages: t,
...e.system && { system: e.system }
});
return this.mapResponse(s);
} catch (t) {
return this.createErrorResponse(
t instanceof Error ? t : new Error(String(t))
);
}
}
async *generateStream(e) {
if (this.validateRequest(e), !this.anthropic)
throw new Error("Claude client not initialized");
try {
const t = [
{ role: "user", content: e.prompt }
], s = await this.anthropic.messages.create({
model: this.model,
max_tokens: e.maxTokens || 1e3,
temperature: e.temperature || 0.7,
messages: t,
stream: !0,
...e.system && { system: e.system }
});
let a = "";
for await (const n of s)
if (n.type === "content_block_delta" && n.delta?.text) {
a += n.delta.text;
const i = {
id: n.index?.toString() || Date.now().toString(),
type: "token",
content: n.delta.text,
timestamp: Date.now()
};
yield i, this.emit("stream-chunk", i);
} else n.type === "message_stop" && (yield {
id: "done",
type: "done",
content: a,
timestamp: Date.now()
}, this.emit("stream-complete", a));
} catch (t) {
yield {
id: "error",
type: "error",
content: t instanceof Error ? t.message : String(t),
timestamp: Date.now()
}, this.emit("stream-error", t instanceof Error ? t : new Error(String(t)));
}
}
async analyzeAccessibility(e, t, s) {
const a = `${this.createAccessibilityPrompt(e, t)}
Additional context: ${s ? JSON.stringify(s) : "None"}
Please analyze the content and provide specific, actionable accessibility recommendations for neurodivergent users. Focus on:
1. Visual adaptations (motion reduction, contrast, font size)
2. Cognitive load management (content chunking, simplification)
3. Navigation and interaction improvements
4. Content structure optimization
Format your response as a structured analysis with specific recommendations, confidence levels, and estimated impact.`, n = await this.generate({
prompt: a,
system: "You are an accessibility expert specializing in neurodivergent user needs. Provide practical, specific recommendations.",
maxTokens: 1500,
temperature: 0.3
});
return this.parseAdaptationSuggestions(n.content);
}
async simplifyContent(e, t, s) {
const a = `${this.createSimplificationPrompt(e, t)}
${s ? `Additional context: ${JSON.stringify(s)}` : ""}
Guidelines for ${t} level:
- Simple: 5th-8th grade reading level, short sentences, common words
- Intermediate: 9th-12th grade reading level, moderate complexity
- Advanced: College level, but still clear and well-structured
Important: Preserve all factual information and key concepts while making the language more accessible.`;
return (await this.generate({
prompt: a,
system: "You are an expert at making content accessible while preserving information accuracy and completeness.",
maxTokens: Math.max(2e3, Math.ceil(e.length * 1.5)),
temperature: 0.2
})).content;
}
// Private methods
async initializeClient() {
try {
const { Anthropic: e } = await import("anthropic");
if (!this.config.apiKey)
throw new Error("Claude API key is required");
this.anthropic = new e({
apiKey: this.config.apiKey,
baseURL: this.config.baseURL
}), this.status.isAvailable = !0;
} catch (e) {
console.warn("Claude provider not available:", e), this.status.isAvailable = !1, this.status.lastError = "anthropic package not installed or API key missing";
}
}
mapResponse(e) {
return {
content: e.content.filter((s) => s.type === "text").map((s) => s.text).join(""),
usage: {
promptTokens: e.usage.input_tokens,
completionTokens: e.usage.output_tokens,
totalTokens: e.usage.input_tokens + e.usage.output_tokens
},
finishReason: this.mapStopReason(e.stop_reason),
metadata: {
model: e.model,
id: e.id
}
};
}
mapStopReason(e) {
switch (e) {
case "end_turn":
return "stop";
case "max_tokens":
return "length";
case "stop_sequence":
return "stop";
default:
return "stop";
}
}
parseAdaptationSuggestions(e) {
const t = [], s = e.split(`
`).filter((n) => n.trim());
for (const n of s) {
const i = n.toLowerCase();
(i.includes("motion") || i.includes("animation") || i.includes("autoplay")) && t.push({
type: "sensory",
target: "motionReduction",
action: "enable",
reasoning: n.trim(),
confidence: "high",
priority: "high",
estimatedImpact: 0.8
}), (i.includes("contrast") || i.includes("color") || i.includes("visibility")) && t.push({
type: "sensory",
target: "highContrast",
action: "enable",
reasoning: n.trim(),
confidence: "high",
priority: "medium",
estimatedImpact: 0.7
}), (i.includes("font") || i.includes("text size") || i.includes("readability")) && t.push({
type: "sensory",
target: "fontSize",
action: "adjust",
value: 1.2,
reasoning: n.trim(),
confidence: "medium",
priority: "medium",
estimatedImpact: 0.6
}), (i.includes("chunk") || i.includes("break") || i.includes("section")) && t.push({
type: "cognitive",
target: "chunkSize",
action: "adjust",
value: 2,
reasoning: n.trim(),
confidence: "high",
priority: "high",
estimatedImpact: 0.9
}), (i.includes("heading") || i.includes("structure") || i.includes("organize")) && t.push({
type: "content",
target: "structure",
action: "adjust",
reasoning: n.trim(),
confidence: "high",
priority: "medium",
estimatedImpact: 0.7
});
}
return t.filter(
(n, i, r) => r.findIndex((o) => o.type === n.type && o.target === n.target) === i
);
}
estimateCost(e) {
const t = Math.ceil(e.prompt.length / 4), s = e.maxTokens || 1e3;
let a, n;
switch (this.model) {
case "claude-3-opus-20240229":
a = t * 15e-6, n = s * 75e-6;
break;
case "claude-3-sonnet-20240229":
a = t * 3e-6, n = s * 15e-6;
break;
case "claude-3-haiku-20240307":
a = t * 25e-8, n = s * 125e-8;
break;
default:
return super.estimateCost(e);
}
return a + n;
}
}
class v extends p {
constructor(e) {
super(e), this.model = e.model || "gpt-4-turbo-preview", this.initializeClient();
}
getProviderName() {
return "OpenAI";
}
getCapabilities() {
return {
textGeneration: !0,
textAnalysis: !0,
codeGeneration: !0,
reasoning: !0,
streaming: !0,
functionCalling: this.model.includes("gpt-4") || this.model.includes("gpt-3.5-turbo"),
vision: this.model.includes("vision") || this.model === "gpt-4-turbo-preview"
};
}
getAvailableModels() {
return [
"gpt-4-turbo-preview",
"gpt-4",
"gpt-4-vision-preview",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k"
];
}
async generate(e) {
if (this.validateRequest(e), !this.openai)
throw new Error("OpenAI client not initialized. Make sure openai package is installed.");
try {
const t = [
...e.system ? [{ role: "system", content: e.system }] : [],
{ role: "user", content: e.prompt }
], s = await this.openai.chat.completions.create({
model: this.model,
messages: t,
max_tokens: e.maxTokens || 1e3,
temperature: e.temperature || 0.7,
...e.functions && { functions: e.functions }
});
return this.mapResponse(s);
} catch (t) {
return this.createErrorResponse(
t instanceof Error ? t : new Error(String(t))
);
}
}
async *generateStream(e) {
if (this.validateRequest(e), !this.openai)
throw new Error("OpenAI client not initialized");
try {
const t = [
...e.system ? [{ role: "system", content: e.system }] : [],
{ role: "user", content: e.prompt }
], s = await this.openai.chat.completions.create({
model: this.model,
messages: t,
max_tokens: e.maxTokens || 1e3,
temperature: e.temperature || 0.7,
stream: !0,
...e.functions && { functions: e.functions }
});
let a = "";
for await (const n of s) {
const i = n.choices[0]?.delta;
if (i?.content) {
a += i.content;
const r = {
id: n.id,
type: "token",
content: i.content,
timestamp: Date.now()
};
yield r, this.emit("stream-chunk", r);
} else n.choices[0]?.finish_reason && (yield {
id: n.id,
type: "done",
content: a,
timestamp: Date.now()
}, this.emit("stream-complete", a));
}
} catch (t) {
yield {
id: "error",
type: "error",
content: t instanceof Error ? t.message : String(t),
timestamp: Date.now()
}, this.emit("stream-error", t instanceof Error ? t : new Error(String(t)));
}
}
async analyzeAccessibility(e, t, s) {
const a = `${this.createAccessibilityPrompt(e, t)}
Additional context: ${s ? JSON.stringify(s) : "None"}
Analyze the content and provide specific accessibility recommendations for neurodivergent users. Focus on practical, implementable suggestions for:
1. Visual adaptations (motion, contrast, font sizing)
2. Cognitive load management (content structure, complexity)
3. Navigation improvements
4. Interactive element accessibility
Provide specific, actionable recommendations with confidence levels and estimated impact scores.`, n = await this.generate({
prompt: a,
system: "You are an expert accessibility consultant specializing in neurodivergent user experience. Provide specific, actionable recommendations.",
maxTokens: 1500,
temperature: 0.3
});
return this.parseAdaptationSuggestions(n.content);
}
async simplifyContent(e, t, s) {
const a = `${this.createSimplificationPrompt(e, t)}
${s ? `Additional context: ${JSON.stringify(s)}` : ""}
Simplification guidelines for ${t} level:
- Simple: Elementary to middle school reading level (grades 3-8)
- Intermediate: High school reading level (grades 9-12)
- Advanced: College level but clear and accessible
Key requirements:
- Preserve all factual information
- Maintain logical flow and structure
- Use appropriate vocabulary for target level
- Keep content engaging and informative`;
return (await this.generate({
prompt: a,
system: "You are an expert content editor specializing in making complex information accessible while preserving accuracy and completeness.",
maxTokens: Math.max(2e3, Math.ceil(e.length * 1.5)),
temperature: 0.2
})).content;
}
// Private methods
async initializeClient() {
try {
const { OpenAI: e } = await import("openai");
if (!this.config.apiKey)
throw new Error("OpenAI API key is required");
this.openai = new e({
apiKey: this.config.apiKey,
baseURL: this.config.baseURL,
organization: this.config.organization
}), this.status.isAvailable = !0;
} catch (e) {
console.warn("OpenAI provider not available:", e), this.status.isAvailable = !1, this.status.lastError = "openai package not installed or API key missing";
}
}
mapResponse(e) {
const t = e.choices[0];
return {
content: t.message.content,
usage: {
promptTokens: e.usage.prompt_tokens,
completionTokens: e.usage.completion_tokens,
totalTokens: e.usage.total_tokens
},
finishReason: t.finish_reason,
metadata: {
model: e.model,
id: e.id,
created: e.created
}
};
}
parseAdaptationSuggestions(e) {
const t = [], s = e.split(`
`).filter((n) => n.trim());
for (const n of s) {
const i = n.toLowerCase();
(i.includes("motion") || i.includes("animation") || i.includes("reduce movement") || i.includes("autoplay")) && t.push({
type: "sensory",
target: "motionReduction",
action: "enable",
reasoning: n.trim(),
confidence: "high",
priority: "high",
estimatedImpact: 0.8
}), (i.includes("contrast") || i.includes("visibility") || i.includes("color") || i.includes("dark mode")) && t.push({
type: "sensory",
target: "highContrast",
action: "enable",
reasoning: n.trim(),
confidence: "high",
priority: "medium",
estimatedImpact: 0.7
}), (i.includes("font") || i.includes("text size") || i.includes("readability") || i.includes("larger text")) && t.push({
type: "sensory",
target: "fontSize",
action: "adjust",
value: 1.2,
reasoning: n.trim(),
confidence: "medium",
priority: "medium",
estimatedImpact: 0.6
}), (i.includes("chunk") || i.includes("break up") || i.includes("section") || i.includes("simplify")) && t.push({
type: "cognitive",
target: "chunkSize",
action: "adjust",
value: 2,
reasoning: n.trim(),
confidence: "high",
priority: "high",
estimatedImpact: 0.9
}), (i.includes("heading") || i.includes("structure") || i.includes("organize") || i.includes("navigation")) && t.push({
type: "content",
target: "structure",
action: "adjust",
reasoning: n.trim(),
confidence: "high",
priority: "medium",
estimatedImpact: 0.7
});
}
return t.filter(
(n, i, r) => r.findIndex((o) => o.type === n.type && o.target === n.target) === i
);
}
estimateCost(e) {
const t = Math.ceil(e.prompt.length / 4), s = e.maxTokens || 1e3;
let a, n;
switch (this.model) {
case "gpt-4-turbo-preview":
case "gpt-4":
a = t * 3e-5, n = s * 6e-5;
break;
case "gpt-4-vision-preview":
a = t * 1e-5, n = s * 3e-5;
break;
case "gpt-3.5-turbo":
case "gpt-3.5-turbo-16k":
a = t * 5e-7, n = s * 15e-7;
break;
default:
return super.estimateCost(e);
}
return a + n;
}
}
class k extends p {
constructor(e) {
super(e), this.model = e.model || "llama2", this.host = e.host || e.baseURL || "http://localhost:11434", this.keepAlive = e.keepAlive || "5m", this.checkAvailability();
}
getProviderName() {
return "Ollama";
}
getCapabilities() {
return {
textGeneration: !0,
textAnalysis: !0,
codeGeneration: this.model.includes("code") || this.model.includes("wizard"),
reasoning: !0,
streaming: !0,
functionCalling: !1,
// Most Ollama models don't support function calling
vision: this.model.includes("vision") || this.model.includes("llava")
};
}
getAvailableModels() {
return [
"llama2",
"llama2:13b",
"llama2:70b",
"mistral",
"mixtral",
"codellama",
"llava",
"neural-chat",
"starling-lm"
];
}
async generate(e) {
this.validateRequest(e);
try {
const t = this.buildPrompt(e), s = await fetch(`${this.host}/api/generate`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
model: this.model,
prompt: t,
stream: !1,
options: {
temperature: e.temperature || 0.7,
num_predict: e.maxTokens || 1e3
},
keep_alive: this.keepAlive
})
});
if (!s.ok)
throw new Error(`Ollama API error: ${s.status} ${s.statusText}`);
const a = await s.json();
return this.mapResponse(a);
} catch (t) {
return this.createErrorResponse(
t instanceof Error ? t : new Error(String(t))
);
}
}
async *generateStream(e) {
this.validateRequest(e);
try {
const t = this.buildPrompt(e), s = await fetch(`${this.host}/api/generate`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
model: this.model,
prompt: t,
stream: !0,
options: {
temperature: e.temperature || 0.7,
num_predict: e.maxTokens || 1e3
},
keep_alive: this.keepAlive
})
});
if (!s.ok)
throw new Error(`Ollama API error: ${s.status} ${s.statusText}`);
const a = s.body?.getReader();
if (!a)
throw new Error("No response body");
const n = new TextDecoder();
let i = "", r = "";
try {
for (; ; ) {
const { done: o, value: h } = await a.read();
if (o) break;
i += n.decode(h, { stream: !0 });
const d = i.split(`
`);
i = d.pop() || "";
for (const m of d)
if (m.trim() !== "")
try {
const c = JSON.parse(m);
if (c.response) {
r += c.response;
const u = {
id: Date.now().toString(),
type: "token",
content: c.response,
timestamp: Date.now(),
metadata: {
model: c.model,
eval_count: c.eval_count
}
};
yield u, this.emit("stream-chunk", u);
}
if (c.done) {
yield {
id: "done",
type: "done",
content: r,
timestamp: Date.now(),
metadata: {
total_duration: c.total_duration,
eval_count: c.eval_count,
eval_duration: c.eval_duration
}
}, this.emit("stream-complete", r);
return;
}
} catch {
console.warn("Failed to parse Ollama response line:", m);
}
}
} finally {
a.releaseLock();
}
} catch (t) {
yield {
id: "error",
type: "error",
content: t instanceof Error ? t.message : String(t),
timestamp: Date.now()
}, this.emit("stream-error", t instanceof Error ? t : new Error(String(t)));
}
}
async analyzeAccessibility(e, t, s) {
const a = `${this.buildAccessibilityAnalysisPrompt(e, t, s)}
Please provide a detailed analysis with specific recommendations for improving accessibility for neurodivergent users.`, n = await this.generate({
prompt: a,
maxTokens: 1500,
temperature: 0.3
});
return this.parseAdaptationSuggestions(n.content);
}
async simplifyContent(e, t, s) {
const a = this.buildSimplificationPrompt(e, t, s);
return (await this.generate({
prompt: a,
maxTokens: Math.max(2e3, Math.ceil(e.length * 1.5)),
temperature: 0.2
})).content;
}
// Override to check Ollama availability
async testConnection() {
try {
const e = await fetch(`${this.host}/api/tags`, {
method: "GET",
headers: {
"Content-Type": "application/json"
}
});
if (e.ok)
return this.status.isAvailable = !0, !0;
throw new Error(`HTTP ${e.status}`);
} catch (e) {
return this.status.isAvailable = !1, this.status.lastError = e instanceof Error ? e.message : String(e), !1;
}
}
// Private methods
buildPrompt(e) {
return e.system ? `System: ${e.system}
User: ${e.prompt}
Assistant:` : e.prompt;
}
buildAccessibilityAnalysisPrompt(e, t, s) {
return `You are an accessibility expert. Analyze the following content for neurodivergent users and provide specific recommendations.
Current User Preferences:
${JSON.stringify(t, null, 2)}
${s ? `Context: ${JSON.stringify(s, null, 2)}` : ""}
Content to Analyze:
${e}
Provide specific suggestions for:
1. Visual adaptations (motion reduction, contrast, font size)
2. Cognitive load management (content chunking, simplification)
3. Navigation improvements
4. Content structure optimization
Format your response with clear recommendations and reasoning.`;
}
buildSimplificationPrompt(e, t, s) {
return `You are an expert content editor. Simplify the following content for a ${t} reading level while preserving all important information.
${s ? `Context: ${JSON.stringify(s, null, 2)}` : ""}
Guidelines:
- Use shorter, clearer sentences
- Replace complex words with simpler alternatives
- Break up long paragraphs
- Maintain factual accuracy
- Keep the content engaging
Original Content:
${e}
Simplified Content:`;
}
mapResponse(e) {
return {
content: e.response,
usage: {
promptTokens: e.prompt_eval_count || 0,
completionTokens: e.eval_count || 0,
totalTokens: (e.prompt_eval_count || 0) + (e.eval_count || 0)
},
finishReason: e.done ? "stop" : "length",
metadata: {
model: e.model,
created_at: e.created_at,
total_duration: e.total_duration,
eval_duration: e.eval_duration
}
};
}
parseAdaptationSuggestions(e) {
const t = [], s = e.split(`
`).filter((n) => n.trim());
for (const n of s) {
const i = n.toLowerCase();
(i.includes("motion") || i.includes("animation") || i.includes("movement") || i.includes("autoplay")) && t.push({
type: "sensory",
target: "motionReduction",
action: "enable",
reasoning: n.trim(),
confidence: "medium",
priority: "high",
estimatedImpact: 0.7
}), (i.includes("contrast") || i.includes("dark") || i.includes("light") || i.includes("color")) && t.push({
type: "sensory",
target: "highContrast",
action: "enable",
reasoning: n.trim(),
confidence: "medium",
priority: "medium",
estimatedImpact: 0.6
}), (i.includes("font") || i.includes("text") || i.includes("size") || i.includes("larger")) && t.push({
type: "sensory",
target: "fontSize",
action: "adjust",
value: 1.15,
reasoning: n.trim(),
confidence: "medium",
priority: "medium",
estimatedImpact: 0.5
}), (i.includes("chunk") || i.includes("break") || i.includes("section") || i.includes("paragraph")) && t.push({
type: "cognitive",
target: "chunkSize",
action: "adjust",
value: 2,
reasoning: n.trim(),
confidence: "high",
priority: "high",
estimatedImpact: 0.8
});
}
return t.filter(
(n, i, r) => r.findIndex((o) => o.type === n.type && o.target === n.target) === i
);
}
estimateCost(e) {
return 0;
}
isConfigValid() {
return !!this.host;
}
}
export {
p as B,
y as C,
v as O,
k as a
};
//# sourceMappingURL=ollama-provider-AUKt-Rtf.js.map