File tree Expand file tree Collapse file tree
packages/skills/src/built-in Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " splash-agent" ,
3- "version" : " 2.0.1 " ,
3+ "version" : " 2.0.2 " ,
44 "description" : " Splash — Autonomous Agent Platform: CLI + multi-provider agent loop + TUI dashboard + platform bots" ,
55 "author" : " Splash Contributors" ,
66 "license" : " MIT" ,
Original file line number Diff line number Diff line change 11import type { Result , SkillManifest , SkillResult } from "@alpclaw/utils" ;
22import { ok , err , createError } from "@alpclaw/utils" ;
33import type { Skill , SkillContext } from "../skill.js" ;
4- import { Readability } from "@mozilla/readability" ;
5- import { JSDOM } from "jsdom" ;
6- import TurndownService from "turndown" ;
4+
75
86/**
97 * Web scraper — fetches a URL and extracts clean Markdown content
@@ -44,6 +42,21 @@ export class WebScraperSkill implements Skill {
4442
4543 const html = await res . text ( ) ;
4644
45+ let Readability : any ;
46+ let JSDOM : any ;
47+ let TurndownService : any ;
48+
49+ try {
50+ const readabilityModule = await import ( "@mozilla/readability" ) ;
51+ const jsdomModule = await import ( "jsdom" ) ;
52+ const turndownModule = await import ( "turndown" ) ;
53+ Readability = readabilityModule . Readability ;
54+ JSDOM = jsdomModule . JSDOM ;
55+ TurndownService = turndownModule . default || turndownModule ;
56+ } catch ( err ) {
57+ return { ok : false , error : createError ( "skill" , "Web scraper dependencies not available. Run: pnpm install" ) } ;
58+ }
59+
4760 const doc = new JSDOM ( html , { url } ) ;
4861 const reader = new Readability ( doc . window . document ) ;
4962 const article = reader . parse ( ) ;
You can’t perform that action at this time.
0 commit comments