saeeol 1.2.7 → 1.2.9

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,4 +1,4 @@
1
- import { Effect, Schema } from "effect"
1
+ import { Effect, Schema } from "effect"
2
2
  import { HttpClient, HttpClientRequest } from "effect/unstable/http"
3
3
  import * as Tool from "../core/tool"
4
4
  import TurndownService from "turndown"
@@ -49,8 +49,6 @@ export const WebFetchTool = Tool.define(
49
49
  })
50
50
 
51
51
  const timeout = Math.min((params.timeout ?? DEFAULT_TIMEOUT / 1000) * 1000, MAX_TIMEOUT)
52
-
53
- // Build Accept header based on requested format with q parameters for fallbacks
54
52
  let acceptHeader = "*/*"
55
53
  switch (params.format) {
56
54
  case "markdown":
@@ -92,8 +90,6 @@ export const WebFetchTool = Tool.define(
92
90
  ),
93
91
  Effect.timeoutOrElse({ duration: timeout, orElse: () => Effect.die(new Error("Request timed out")) }),
94
92
  )
95
-
96
- // Check content length
97
93
  const contentLength = response.headers["content-length"]
98
94
  if (contentLength && parseInt(contentLength) > MAX_RESPONSE_SIZE) {
99
95
  throw new Error("Response too large (exceeds 5MB limit)")
@@ -125,8 +121,6 @@ export const WebFetchTool = Tool.define(
125
121
  }
126
122
 
127
123
  const content = new TextDecoder().decode(arrayBuffer)
128
-
129
- // Handle content based on requested format and actual content type
130
124
  switch (params.format) {
131
125
  case "markdown":
132
126
  if (contentType.includes("text/html")) {
@@ -167,12 +161,10 @@ async function extractTextFromHTML(html: string) {
167
161
  skipContent = true
168
162
  },
169
163
  text() {
170
- // Skip text content inside these elements
171
164
  },
172
165
  })
173
166
  .on("*", {
174
167
  element(element) {
175
- // Reset skip flag when entering other elements
176
168
  if (!["script", "style", "noscript", "iframe", "object", "embed"].includes(element.tagName)) {
177
169
  skipContent = false
178
170
  }
@@ -199,4 +191,4 @@ function convertHTMLToMarkdown(html: string): string {
199
191
  })
200
192
  turndownService.remove(["script", "style", "meta", "link"])
201
193
  return turndownService.turndown(html)
202
- }
194
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "@tsconfig/bun/tsconfig.json",
4
+ "compilerOptions": {
5
+ "jsx": "preserve",
6
+ "jsxImportSource": "@opentui/solid",
7
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
8
+ "types": [],
9
+ "noUncheckedIndexedAccess": false,
10
+ "customConditions": ["browser"],
11
+ "paths": {
12
+ "@/*": ["./src/*"],
13
+ "@/saeeol/*": ["./src/overlay/*"],
14
+ "@tui/*": ["./src/cli/cmd/tui/*"],
15
+ "@test/*": ["./test/*"]
16
+ }
17
+ },
18
+ "exclude": ["src/provider/models-snapshot.ts"]
19
+ }