@madh-io/alfred-ai 0.14.2 → 0.14.4
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/bundle/index.js +7 -5
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -1020,16 +1020,18 @@ ${a.display}`):a.error&&d.push(`**Route:** \u26A0\uFE0F ${a.error}`),c?.success&
|
|
|
1020
1020
|
`)}}resolveAddresses(e){let t=this.alfredConfig.briefing?.homeAddress,s=this.alfredConfig.briefing?.officeAddress;if(!this.memoryRepo)return{home:t,office:s};let r=t,n=s;for(let o of V(e)){let i=this.memoryRepo.search(o,"adresse");for(let a of i){let c=a.key.toLowerCase(),d=a.value;!r&&/heim|home|wohn|zuhause|privat/.test(c)&&(r=d),!n&&/büro|office|arbeit|firma|work/.test(c)&&(n=d)}if(r&&n)break}return{home:r,office:n}}resolveHaPreferences(e){let t=this.alfredConfig.briefing?.homeAssistant?.entities,s=this.alfredConfig.briefing?.homeAssistant?.domains;if(t?.length||s?.length)return{entities:t,domains:s};if(!this.memoryRepo)return{};for(let r of V(e)){let n=this.memoryRepo.search(r,"briefing");for(let o of n){let i=o.key.toLowerCase();if(/ha_entit|home.?assistant.*entit|briefing.*entit/.test(i)){let a=o.value.split(/[,;]\s*/).map(c=>c.trim()).filter(Boolean);if(a.length)return{entities:a}}if(/ha_domain|home.?assistant.*domain|briefing.*domain/.test(i)){let a=o.value.split(/[,;]\s*/).map(c=>c.trim()).filter(Boolean);if(a.length)return{domains:a}}}}return{}}detectExternalAppointment(e){return Array.isArray(e)?e.some(t=>{let s=t.location??t.loc??"";return!s||typeof s!="string"||/teams|zoom|meet\.google|webex|skype/i.test(s)?!1:s.trim().length>0}):!1}cleanDisplay(e,t){let s=t;return s=s.replace(/\s*\[(?:id:)?[A-Za-z0-9+/=\-]{20,}\]/g,""),e==="email"&&(s=s.replace(/^\d+\.\s*/gm,"- ").replace(/\[UNREAD\]/g,"\u{1F4E9}").replace(/\[ATT\]/g,"\u{1F4CE}").replace(/\n\s+Date:\s+\S+/g,"")),e==="calendar"&&(s=s.replace(/^\d+\s+event\(s\):\n?/i,"")),e==="todo"&&(s=s.replace(/^\|.*\|$/gm,r=>{if(/^[\|\s\-:]+$/.test(r))return"";let n=r.split("|").map(o=>o.trim()).filter(Boolean);if(n.length>=3){let o=n[0],i=n[1]&&n[1]!==""?` [${n[1]}]`:"",a=n[2];return`${o}${i} ${a}`}return r}),s=s.replace(/^\d+\s+todo\(s\):\n?/i,""),s=s.replace(/\n{2,}/g,`
|
|
1021
1021
|
`)),e==="mstodo"&&(s=s.replace(/\s*\[(?:taskId|listId)=[^\]]+\]/g,"")),s=s.replace(/^\[[\w-]+\]\s*/gm,""),s=s.replace(/\n{3,}/g,`
|
|
1022
1022
|
|
|
1023
|
-
`),s.trim()}buildHighlights(e){let t=[],s=e.find(i=>i.module==="bmw")?.data;if(s){let i=this.extractBatteryLevel(s);i!=null&&i<30&&t.push(`\u{1F697} BMW Akku bei ${i}% \u2014 laden empfohlen`)}let r=e.find(i=>i.module==="infra");r&&(!r.success||r.display?.includes("\u26A0\uFE0F"))&&t.push("\u{1F534} Infrastruktur-Warnung vorhanden");let n=e.find(i=>i.module==="energy")?.data;if(n){let i=n.currentCt,a=n.avgCt;i!=null&&a!=null&&i<a&&t.push(`\u26A1 Aktuell g\xFCnstiger Strom (${i} ct/kWh)`)}let o=e.find(i=>i.module==="calendar")?.data;return Array.isArray(o)&&o.length>0&&t.push(`\u{1F4C5} ${o.length} Termin(e) heute`),t}extractBatteryLevel(e){if(!e||typeof e!="object")return null;let t=e,s=t.chargingLevelPercent??t.batterySoc??t.soc??t.chargingState?.chargingLevelPercent;if(typeof s=="number")return s;if(typeof s=="string"){let r=parseFloat(s);return isNaN(r)?null:r}return null}}});var $s,ou=_(()=>{"use strict";W();$s=class extends x{static{m(this,"FeedReaderSkill")}memoryRepo;metadata={name:"feed_reader",category:"information",description:"Subscribe to RSS/Atom feeds and check for new entries. Actions: subscribe, unsubscribe, list_feeds, check.",riskLevel:"read",version:"1.0.0",inputSchema:{type:"object",properties:{action:{type:"string",enum:["subscribe","unsubscribe","list_feeds","check"],description:"The action to perform"},url:{type:"string",description:"Feed URL (for subscribe, unsubscribe, check)"},label:{type:"string",description:"Human-readable label for the feed (for subscribe)"}},required:["action"]}};constructor(e){super(),this.memoryRepo=e}async execute(e,t){let s=e.action,r=e.url,n=t.userId;switch(s){case"subscribe":return this.subscribe(n,r,e.label);case"unsubscribe":return this.unsubscribe(n,r);case"list_feeds":return this.listFeeds(n);case"check":return this.check(n,r);default:return{success:!1,error:`Unknown action: ${s}`}}}async subscribe(e,t,s){if(!t)return{success:!1,error:"URL is required for subscribe"};let r={url:t,label:s??t,lastCheckedAt:null,lastEntryId:null};return this.memoryRepo.save(e,`feed:${t}`,JSON.stringify(r),"feed"),{success:!0,data:r,display:`Subscribed to feed: ${r.label} (${t})`}}async unsubscribe(e,t){return t?this.memoryRepo.delete(e,`feed:${t}`)?{success:!0,display:`Unsubscribed from feed: ${t}`}:{success:!1,error:`No subscription found for ${t}`}:{success:!1,error:"URL is required for unsubscribe"}}async listFeeds(e){let s=this.memoryRepo.listByCategory(e,"feed").map(n=>{try{return JSON.parse(n.value)}catch{return null}}).filter(Boolean);if(s.length===0)return{success:!0,data:[],display:"No feed subscriptions found."};let r=s.map(n=>`\u2022 ${n.label} \u2014 ${n.url} (last checked: ${n.lastCheckedAt??"never"})`);return{success:!0,data:s,display:`Feed subscriptions:
|
|
1023
|
+
`),s.trim()}buildHighlights(e){let t=[],s=e.find(i=>i.module==="bmw")?.data;if(s){let i=this.extractBatteryLevel(s);i!=null&&i<30&&t.push(`\u{1F697} BMW Akku bei ${i}% \u2014 laden empfohlen`)}let r=e.find(i=>i.module==="infra");r&&(!r.success||r.display?.includes("\u26A0\uFE0F"))&&t.push("\u{1F534} Infrastruktur-Warnung vorhanden");let n=e.find(i=>i.module==="energy")?.data;if(n){let i=n.currentCt,a=n.avgCt;i!=null&&a!=null&&i<a&&t.push(`\u26A1 Aktuell g\xFCnstiger Strom (${i} ct/kWh)`)}let o=e.find(i=>i.module==="calendar")?.data;return Array.isArray(o)&&o.length>0&&t.push(`\u{1F4C5} ${o.length} Termin(e) heute`),t}extractBatteryLevel(e){if(!e||typeof e!="object")return null;let t=e,s=t.chargingLevelPercent??t.batterySoc??t.soc??t.chargingState?.chargingLevelPercent;if(typeof s=="number")return s;if(typeof s=="string"){let r=parseFloat(s);return isNaN(r)?null:r}return null}}});var $s,ou=_(()=>{"use strict";W();$s=class extends x{static{m(this,"FeedReaderSkill")}memoryRepo;metadata={name:"feed_reader",category:"information",description:"Subscribe to RSS/Atom feeds and check for new entries. Actions: subscribe, unsubscribe, list_feeds, check.",riskLevel:"read",version:"1.0.0",inputSchema:{type:"object",properties:{action:{type:"string",enum:["subscribe","unsubscribe","list_feeds","check","check_all"],description:"The action to perform"},url:{type:"string",description:"Feed URL (for subscribe, unsubscribe, check)"},label:{type:"string",description:"Human-readable label for the feed (for subscribe)"}},required:["action"]}};constructor(e){super(),this.memoryRepo=e}async execute(e,t){let s=e.action,r=e.url,n=t.userId;switch(s){case"subscribe":return this.subscribe(n,r,e.label);case"unsubscribe":return this.unsubscribe(n,r);case"list_feeds":return this.listFeeds(n);case"check":case"check_all":return this.check(n,r);default:return{success:!1,error:`Unknown action: ${s}`}}}async subscribe(e,t,s){if(!t)return{success:!1,error:"URL is required for subscribe"};let r={url:t,label:s??t,lastCheckedAt:null,lastEntryId:null};return this.memoryRepo.save(e,`feed:${t}`,JSON.stringify(r),"feed"),{success:!0,data:r,display:`Subscribed to feed: ${r.label} (${t})`}}async unsubscribe(e,t){return t?this.memoryRepo.delete(e,`feed:${t}`)?{success:!0,display:`Unsubscribed from feed: ${t}`}:{success:!1,error:`No subscription found for ${t}`}:{success:!1,error:"URL is required for unsubscribe"}}async listFeeds(e){let s=this.memoryRepo.listByCategory(e,"feed").map(n=>{try{return JSON.parse(n.value)}catch{return null}}).filter(Boolean);if(s.length===0)return{success:!0,data:[],display:"No feed subscriptions found."};let r=s.map(n=>`\u2022 ${n.label} \u2014 ${n.url} (last checked: ${n.lastCheckedAt??"never"})`);return{success:!0,data:s,display:`Feed subscriptions:
|
|
1024
1024
|
${r.join(`
|
|
1025
1025
|
`)}`}}async check(e,t){if(!t){let i=this.memoryRepo.listByCategory(e,"feed");if(i.length===0)return{success:!0,data:{newCount:0},display:"No feed subscriptions to check."};let a=0,c=[];for(let u of i)try{let p=JSON.parse(u.value),h=await this.checkSingleFeed(e,p);h.newCount>0&&(a+=h.newCount,c.push(h))}catch{}let d=c.map(u=>`${u.label}: ${u.newCount} new
|
|
1026
|
-
${u.items.map(p=>` \u2022 ${p.title}
|
|
1026
|
+
${u.items.map(p=>` \u2022 ${p.title}${p.link?` \u2014 ${p.link}`:""}${p.snippet?`
|
|
1027
|
+
${p.snippet}`:""}`).join(`
|
|
1027
1028
|
`)}`);return{success:!0,data:{newCount:a,feeds:c},display:a>0?`${a} new entries across ${c.length} feed(s):
|
|
1028
1029
|
${d.join(`
|
|
1029
1030
|
|
|
1030
|
-
`)}`:"No new entries in any feed."}}let s=this.memoryRepo.listByCategory(e,"feed").find(i=>i.key===`feed:${t}`);if(!s)return{success:!1,error:`Not subscribed to ${t}. Use subscribe first.`};let r=JSON.parse(s.value),n=await this.checkSingleFeed(e,r),o=n.items.map(i=>`\u2022 ${i.title}${i.link?` \u2014 ${i.link}`:""}
|
|
1031
|
+
`)}`:"No new entries in any feed."}}let s=this.memoryRepo.listByCategory(e,"feed").find(i=>i.key===`feed:${t}`);if(!s)return{success:!1,error:`Not subscribed to ${t}. Use subscribe first.`};let r=JSON.parse(s.value),n=await this.checkSingleFeed(e,r),o=n.items.map(i=>`\u2022 ${i.title}${i.link?` \u2014 ${i.link}`:""}${i.snippet?`
|
|
1032
|
+
${i.snippet}`:""}`);return{success:!0,data:{newCount:n.newCount,items:n.items},display:n.newCount>0?`${n.newCount} new in ${n.label}:
|
|
1031
1033
|
${o.join(`
|
|
1032
|
-
`)}`:`No new entries in ${n.label}.`}}async checkSingleFeed(e,t){let s=(await import("rss-parser")).default,o=(await new s({timeout:15e3}).parseURL(t.url)).items??[],i;if(t.lastEntryId){let d=o.findIndex(u=>(u.guid??u.link??u.title)===t.lastEntryId);i=d>0?o.slice(0,d):d===0?[]:o.slice(0,10)}else i=o.slice(0,5);let a=o[0]?o[0].guid??o[0].link??o[0].title??null:null,c={...t,lastCheckedAt:new Date().toISOString(),lastEntryId:a};return this.memoryRepo.save(e,`feed:${t.url}`,JSON.stringify(c),"feed"),{label:t.label,newCount:i.length,items:i.map(d=>({title:d.title??"(untitled)",link:d.link,pubDate:d.pubDate
|
|
1034
|
+
`)}`:`No new entries in ${n.label}.`}}async checkSingleFeed(e,t){let s=(await import("rss-parser")).default,o=(await new s({timeout:15e3}).parseURL(t.url)).items??[],i;if(t.lastEntryId){let d=o.findIndex(u=>(u.guid??u.link??u.title)===t.lastEntryId);i=d>0?o.slice(0,d):d===0?[]:o.slice(0,10)}else i=o.slice(0,5);let a=o[0]?o[0].guid??o[0].link??o[0].title??null:null,c={...t,lastCheckedAt:new Date().toISOString(),lastEntryId:a};return this.memoryRepo.save(e,`feed:${t.url}`,JSON.stringify(c),"feed"),{label:t.label,newCount:i.length,items:i.map(d=>{let u=d.contentSnippet??d.summary??"";return!u&&typeof d.content=="string"&&(u=d.content.replace(/<[^>]*>/g,"").slice(0,200)),{title:d.title??"(untitled)",link:d.link,pubDate:d.pubDate,snippet:u?u.slice(0,200).trim():void 0}})}}}});import{spawn as Sh}from"node:child_process";import iu from"node:fs";import lu from"node:path";function Ah(l){let e={};for(let[t,s]of Object.entries(l))e[t]=s.replace(/\$\{(\w+)\}/g,(r,n)=>process.env[n]??"");return e}function Rh(l,e){return l.map(t=>t.replace(/\{\{prompt\}\}/g,e))}function yo(l){return l.length<=au?l:`[...truncated...]
|
|
1033
1035
|
`+l.slice(-au)}function cu(l){let e=new Map;function t(s){let r;try{r=iu.readdirSync(s,{withFileTypes:!0})}catch{return}for(let n of r){if(Ih.has(n.name))continue;let o=lu.join(s,n.name);if(n.isDirectory())t(o);else if(n.isFile())try{let i=iu.statSync(o);e.set(o,i.mtimeMs)}catch{}}}return m(t,"walk"),t(l),e}function xh(l,e,t){let s=[];for(let[r,n]of e){let o=l.get(r);(o===void 0||n>o)&&s.push(lu.relative(t,r))}return s.sort()}async function Br(l,e,t={}){let s=t.cwd??l.cwd??process.cwd(),r=t.timeoutMs??l.timeoutMs??vh,n=Math.min(r,$h),o=Rh(l.argsTemplate,e),i={...process.env,...l.env?Ah(l.env):{}},a=process.platform==="win32",c=cu(s),d=Date.now();return new Promise(u=>{let p=Sh(l.command,o,{cwd:s,env:i,shell:a,stdio:l.promptVia==="stdin"?["pipe","pipe","pipe"]:["ignore","pipe","pipe"]}),h="",g="",f=!1,y=setTimeout(()=>{f=!0,p.kill("SIGTERM"),setTimeout(()=>p.kill("SIGKILL"),5e3)},n);p.stdout?.on("data",k=>{h+=k.toString()}),p.stderr?.on("data",k=>{let S=k.toString();if(g+=S,t.onProgress){let b=S.trim().split(`
|
|
1034
1036
|
`).pop();b&&t.onProgress(`[${l.name}] ${b}`)}}),l.promptVia==="stdin"&&p.stdin&&(p.stdin.write(e),p.stdin.end()),p.on("close",k=>{clearTimeout(y);let S=Date.now()-d,b=cu(s),C=xh(c,b,s);u({stdout:yo(h),stderr:yo(g),exitCode:f?124:k??1,durationMs:S,modifiedFiles:C})}),p.on("error",k=>{clearTimeout(y);let S=Date.now()-d;u({stdout:yo(h),stderr:yo(g+`
|
|
1035
1037
|
`+k.message),exitCode:127,durationMs:S,modifiedFiles:[]})})})}var vh,$h,au,Ih,wo=_(()=>{"use strict";vh=3e5,$h=9e5,au=1e5,Ih=new Set([".git","node_modules",".next","dist",".cache"]);m(Ah,"resolveEnv");m(Rh,"buildArgs");m(yo,"truncateOutput");m(cu,"snapshotMtimes");m(xh,"detectModifiedFiles");m(Br,"executeAgent")});import{execFile as Ch}from"node:child_process";function qe(l,e){return new Promise((t,s)=>{Ch("git",l,{cwd:e.cwd,maxBuffer:10*1024*1024},(r,n,o)=>{if(r){let i=o?.trim()||r.message;s(new Error(`git ${l[0]} failed: ${i}`));return}t(n.trim())})})}async function To(l){try{let e=await qe(["rev-parse","--abbrev-ref","HEAD"],l),t=await qe(["status","--porcelain"],l);return{isRepo:!0,branch:e,dirty:t.length>0}}catch{return{isRepo:!1,branch:"",dirty:!1}}}async function ma(l,e){await qe(["checkout","-b",l],e)}async function pa(l){await qe(["add","-A"],l)}async function ha(l,e){await qe(["commit","-m",l],e);let t=await qe(["rev-parse","--short","HEAD"],e),r=(await qe(["diff","--stat","HEAD~1","HEAD"],e)).split(`
|
|
@@ -1103,7 +1105,7 @@ ${e.allModifiedFiles.map(r=>`- ${r}`).join(`
|
|
|
1103
1105
|
|
|
1104
1106
|
**Git:**
|
|
1105
1107
|
${s.join(`
|
|
1106
|
-
`)}`:"";return{...t,data:{...t.data,git:{branch:r.branch,commit:r.commit,pullRequest:r.pullRequest,warnings:r.warnings}},display:(t.display??"")+n}}}});var pu=_(()=>{"use strict";mu();wo();Ea();ya();_a()});var oe={};he(oe,{ActivityTracker:()=>Lt,BMWSkill:()=>ao,BackgroundTaskSkill:()=>hs,BriefingSkill:()=>go,BrowserSkill:()=>us,CalculatorSkill:()=>Jt,CalendarProvider:()=>Be,CalendarSkill:()=>Nt,ClipboardSkill:()=>ls,CodeAgentSkill:()=>qr,CodeExecutionSkill:()=>Dr,CodeExecutor:()=>Ot,ConfigureSkill:()=>bs,ContactsProvider:()=>ze,ContactsSkill:()=>Ur,CrossPlatformSkill:()=>ps,DelegateSkill:()=>os,DockerSkill:()=>no,DocumentSkill:()=>gs,EmailProvider:()=>rt,EmailSkill:()=>lt,EnergyPriceSkill:()=>lo,FeedReaderSkill:()=>$s,FileSkill:()=>as,ForgeClient:()=>Ft,HomeAssistantSkill:()=>Qn,HttpSkill:()=>is,ImageGenerateSkill:()=>ws,MCPClient:()=>Dt,MCPManager:()=>Nr,MCPSkillAdapter:()=>Mt,MarketplaceSkill:()=>jr,MemorySkill:()=>ns,MicrosoftTodoSkill:()=>mo,MonitorSkill:()=>uo,NoteSkill:()=>ts,PluginLoader:()=>Wn,ProfileSkill:()=>ms,ProxmoxSkill:()=>Jn,ReminderSkill:()=>es,RoutingSkill:()=>co,ScheduledTaskSkill:()=>fs,ScreenshotSkill:()=>ds,ShellSkill:()=>rs,Skill:()=>x,SkillRegistry:()=>Kt,SkillSandbox:()=>Yt,SystemInfoSkill:()=>Zt,TTSSkill:()=>ys,TodoSkill:()=>Ts,TransitSkill:()=>ks,UniFiSkill:()=>Zn,WatchSkill:()=>Ss,WeatherSkill:()=>ss,WebSearchSkill:()=>Qt,WorkflowSkill:()=>vs,allUserIds:()=>V,createCalendarProvider:()=>Lr,createContactsProvider:()=>ea,createEmailProvider:()=>Rr,createForgeClient:()=>Rs,effectiveUserId:()=>ce,gitAddRemote:()=>Wr,gitGetRemoteUrl:()=>Is,gitInitRepo:()=>Hr,orchestrate:()=>jt,orchestrateWithGit:()=>zr,parseRemoteUrl:()=>As});var ne=_(()=>{"use strict";W();Me();vl();$l();Pi();Il();xl();Cl();Ll();Nl();Dl();Ml();Pl();Fl();jl();zl();Gl();Vl();Kl();Jl();Ql();ed();id();ad();cd();ld();ud();pd();hd();fd();gd();yd();wd();Td();vd();$d();Cd();Pd();Fd();Gd();Xd();Yd();Jd();Zd();Qd();eu();ru();nu();ou();pu()});var Gr,ba=_(()=>{"use strict";Gr=class{static{m(this,"ConversationManager")}conversations;constructor(e){this.conversations=e}getOrCreateConversation(e,t,s){let r=this.conversations.findByPlatformChat(e,t);return r?(this.conversations.updateTimestamp(r.id),r):this.conversations.create(e,t,s)}addMessage(e,t,s,r){return this.conversations.addMessage(e,t,s,r)}getHistory(e,t=20){return this.conversations.getMessages(e,t)}pruneMessages(e,t){return this.conversations.pruneMessages(e,t)}}});function $e(l,e){let t;if(e.platformUserId)t=l.findOrCreate(e.platform,e.platformUserId,e.userName,e.displayName);else if(e.userId)t=l.findById(e.userId)??l.findOrCreate(e.platform,e.userId);else throw new Error("ContextSource must provide either platformUserId or userId");let s="getMasterUserId"in l?l.getMasterUserId(t.id):t.id,r=[];"getLinkedUsers"in l&&(r=l.getLinkedUsers(s).map(a=>a.platformUserId));let n;try{"getProfile"in l?n=l.getProfile(s)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone:n=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{n=Intl.DateTimeFormat().resolvedOptions().timeZone}return{context:{userId:t.platformUserId,masterUserId:s,linkedPlatformUserIds:r,chatId:e.chatId,chatType:e.chatType,platform:e.platform,conversationId:e.conversationId??"",timezone:n},user:t,masterUserId:s,linkedPlatformUserIds:r}}var ut=_(()=>{"use strict";m($e,"buildSkillContext")});function hu(l,e){let t=new Set(["core"]),s=!1;for(let[r,n]of Object.entries(Hh))e.has(r)&&n.test(l)&&(t.add(r),s=!0);if(!s){let r=["productivity","information","media","automation","files"];for(let n of r)e.has(n)&&t.add(n)}return t}function fu(l,e){return l.filter(t=>e.has(t.category??"core"))}var Hh,gu=_(()=>{"use strict";Hh={productivity:/\b(todo|note|notiz|remind|erinner|calendar|kalender|termin|event|email|e-mail|mail|contact|kontakt|briefing|morgenbriefing|tagesbriefing)\b/i,information:/\b(search|such|weather|wetter|calculat|rechn|time|date|zeit|datum|uhrzeit|system.?info|transit|bahn|zug|bus|tram|u.?bahn|s.?bahn|abfahrt|verbindung|haltestelle|öffi|fahrplan|strom|energy|preis|price|kwh|awattar|marktpreis|spot|günstig|cheapest|netzentgelt)\b/i,media:/\b(voice|stimme|tts|speak|sprech|sprich|screenshot|clipboard|zwischenablage|brows|bild|image|generier|photo|foto)\b/i,automation:/\b(background|hintergrund|shell|bash|cron|schedul|code.?agent|sandbox|automat|watch|alert|benachrichtig|bescheid|meld|überwach|monitor|script|skript|befehl|kommando|tägliche?r?s?|stündliche?r?s?|wöchentliche?r?s?|monatliche?r?s?|jeden\s+(tag|morgen|abend|montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonntag)|um\s+\d{1,2}\s*(uhr|:|h)|alle\s+\d+\s*(min|stund|sekund)|in\s+\d+\s*(minuten?|stunden?|sekunden?|hours?|minutes?|seconds?|min)|daily|hourly|weekly|every\s+(day|hour|morning|evening|night|\d+\s*min)|führ.{0,5}aus|execut|ausführ)\b/i,files:/\b(file|datei|document|dokument|pdf|http|download|upload|herunterlad|hochlad|anhang|attachment)\b/i,infrastructure:/\b(proxmox|vm|container|docker|unifi|wifi|wlan|netzwerk|network|homeassistant|home.?assistant|smarthome|smart.?home|licht|light|schalter|switch|solar|photovoltaik|pv|wechselrichter|inverter|batterie.?speicher|wallbox|energieverbrauch|stromverbrauch|verbrauch.{0,5}kwh|einspeis|netzeinspeis|autarkie|eigenverbrauch|bmw|auto|fahrzeug|ladestand|reichweite|laden(?!e)|charging|vehicle|soc|ladehistorie|ladesession|ladevorgang|ladezyklus|ladekurve|km|kilometer|kilometerstand|mileage|tachostand)\b/i,identity:/\b(link|verknüpf|cross.?platform|identity|identität)\b/i,mcp:/\bmcp\b/i};m(hu,"selectCategories");m(fu,"filterSkills")});import Sa from"node:fs";import yu from"node:path";function Xh(l,e){if(l.length<=e)return l;let t=l.split(`
|
|
1108
|
+
`)}`:"";return{...t,data:{...t.data,git:{branch:r.branch,commit:r.commit,pullRequest:r.pullRequest,warnings:r.warnings}},display:(t.display??"")+n}}}});var pu=_(()=>{"use strict";mu();wo();Ea();ya();_a()});var oe={};he(oe,{ActivityTracker:()=>Lt,BMWSkill:()=>ao,BackgroundTaskSkill:()=>hs,BriefingSkill:()=>go,BrowserSkill:()=>us,CalculatorSkill:()=>Jt,CalendarProvider:()=>Be,CalendarSkill:()=>Nt,ClipboardSkill:()=>ls,CodeAgentSkill:()=>qr,CodeExecutionSkill:()=>Dr,CodeExecutor:()=>Ot,ConfigureSkill:()=>bs,ContactsProvider:()=>ze,ContactsSkill:()=>Ur,CrossPlatformSkill:()=>ps,DelegateSkill:()=>os,DockerSkill:()=>no,DocumentSkill:()=>gs,EmailProvider:()=>rt,EmailSkill:()=>lt,EnergyPriceSkill:()=>lo,FeedReaderSkill:()=>$s,FileSkill:()=>as,ForgeClient:()=>Ft,HomeAssistantSkill:()=>Qn,HttpSkill:()=>is,ImageGenerateSkill:()=>ws,MCPClient:()=>Dt,MCPManager:()=>Nr,MCPSkillAdapter:()=>Mt,MarketplaceSkill:()=>jr,MemorySkill:()=>ns,MicrosoftTodoSkill:()=>mo,MonitorSkill:()=>uo,NoteSkill:()=>ts,PluginLoader:()=>Wn,ProfileSkill:()=>ms,ProxmoxSkill:()=>Jn,ReminderSkill:()=>es,RoutingSkill:()=>co,ScheduledTaskSkill:()=>fs,ScreenshotSkill:()=>ds,ShellSkill:()=>rs,Skill:()=>x,SkillRegistry:()=>Kt,SkillSandbox:()=>Yt,SystemInfoSkill:()=>Zt,TTSSkill:()=>ys,TodoSkill:()=>Ts,TransitSkill:()=>ks,UniFiSkill:()=>Zn,WatchSkill:()=>Ss,WeatherSkill:()=>ss,WebSearchSkill:()=>Qt,WorkflowSkill:()=>vs,allUserIds:()=>V,createCalendarProvider:()=>Lr,createContactsProvider:()=>ea,createEmailProvider:()=>Rr,createForgeClient:()=>Rs,effectiveUserId:()=>ce,gitAddRemote:()=>Wr,gitGetRemoteUrl:()=>Is,gitInitRepo:()=>Hr,orchestrate:()=>jt,orchestrateWithGit:()=>zr,parseRemoteUrl:()=>As});var ne=_(()=>{"use strict";W();Me();vl();$l();Pi();Il();xl();Cl();Ll();Nl();Dl();Ml();Pl();Fl();jl();zl();Gl();Vl();Kl();Jl();Ql();ed();id();ad();cd();ld();ud();pd();hd();fd();gd();yd();wd();Td();vd();$d();Cd();Pd();Fd();Gd();Xd();Yd();Jd();Zd();Qd();eu();ru();nu();ou();pu()});var Gr,ba=_(()=>{"use strict";Gr=class{static{m(this,"ConversationManager")}conversations;constructor(e){this.conversations=e}getOrCreateConversation(e,t,s){let r=this.conversations.findByPlatformChat(e,t);return r?(this.conversations.updateTimestamp(r.id),r):this.conversations.create(e,t,s)}addMessage(e,t,s,r){return this.conversations.addMessage(e,t,s,r)}getHistory(e,t=20){return this.conversations.getMessages(e,t)}pruneMessages(e,t){return this.conversations.pruneMessages(e,t)}}});function $e(l,e){let t;if(e.platformUserId)t=l.findOrCreate(e.platform,e.platformUserId,e.userName,e.displayName);else if(e.userId)t=l.findById(e.userId)??l.findOrCreate(e.platform,e.userId);else throw new Error("ContextSource must provide either platformUserId or userId");let s="getMasterUserId"in l?l.getMasterUserId(t.id):t.id,r=[];"getLinkedUsers"in l&&(r=l.getLinkedUsers(s).map(a=>a.platformUserId));let n;try{"getProfile"in l?n=l.getProfile(s)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone:n=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{n=Intl.DateTimeFormat().resolvedOptions().timeZone}return{context:{userId:t.platformUserId,masterUserId:s,linkedPlatformUserIds:r,chatId:e.chatId,chatType:e.chatType,platform:e.platform,conversationId:e.conversationId??"",timezone:n},user:t,masterUserId:s,linkedPlatformUserIds:r}}var ut=_(()=>{"use strict";m($e,"buildSkillContext")});function hu(l,e){let t=new Set(["core"]),s=!1;for(let[r,n]of Object.entries(Hh))e.has(r)&&n.test(l)&&(t.add(r),s=!0);if(t.has("automation")){for(let r of e)t.add(r);return t}if(!s){let r=["productivity","information","media","automation","files"];for(let n of r)e.has(n)&&t.add(n)}return t}function fu(l,e){return l.filter(t=>e.has(t.category??"core"))}var Hh,gu=_(()=>{"use strict";Hh={productivity:/\b(todo|note|notiz|remind|erinner|calendar|kalender|termin|event|email|e-mail|mail|contact|kontakt|briefing|morgenbriefing|tagesbriefing)\b/i,information:/\b(search|such|weather|wetter|calculat|rechn|time|date|zeit|datum|uhrzeit|system.?info|transit|bahn|zug|bus|tram|u.?bahn|s.?bahn|abfahrt|verbindung|haltestelle|öffi|fahrplan|strom|energy|preis|price|kwh|awattar|marktpreis|spot|günstig|cheapest|netzentgelt|rss|feed|atom|news|nachricht|schlagzeil|headline)\b/i,media:/\b(voice|stimme|tts|speak|sprech|sprich|screenshot|clipboard|zwischenablage|brows|bild|image|generier|photo|foto)\b/i,automation:/\b(background|hintergrund|shell|bash|cron|schedul|code.?agent|sandbox|automat|watch|alert|benachrichtig|bescheid|meld|überwach|monitor|script|skript|befehl|kommando|tägliche?r?s?|stündliche?r?s?|wöchentliche?r?s?|monatliche?r?s?|jeden\s+(tag|morgen|abend|montag|dienstag|mittwoch|donnerstag|freitag|samstag|sonntag)|um\s+\d{1,2}\s*(uhr|:|h)|alle\s+\d+\s*(min|stund|sekund)|in\s+\d+\s*(minuten?|stunden?|sekunden?|hours?|minutes?|seconds?|min)|daily|hourly|weekly|every\s+(day|hour|morning|evening|night|\d+\s*min)|führ.{0,5}aus|execut|ausführ)\b/i,files:/\b(file|datei|document|dokument|pdf|http|download|upload|herunterlad|hochlad|anhang|attachment)\b/i,infrastructure:/\b(proxmox|vm|container|docker|unifi|wifi|wlan|netzwerk|network|homeassistant|home.?assistant|smarthome|smart.?home|licht|light|schalter|switch|solar|photovoltaik|pv|wechselrichter|inverter|batterie.?speicher|wallbox|energieverbrauch|stromverbrauch|verbrauch.{0,5}kwh|einspeis|netzeinspeis|autarkie|eigenverbrauch|bmw|auto|fahrzeug|ladestand|reichweite|laden(?!e)|charging|vehicle|soc|ladehistorie|ladesession|ladevorgang|ladezyklus|ladekurve|km|kilometer|kilometerstand|mileage|tachostand)\b/i,identity:/\b(link|verknüpf|cross.?platform|identity|identität)\b/i,mcp:/\bmcp\b/i};m(hu,"selectCategories");m(fu,"filterSkills")});import Sa from"node:fs";import yu from"node:path";function Xh(l,e){if(l.length<=e)return l;let t=l.split(`
|
|
1107
1109
|
`);if(t.length<=10)return l.slice(0,e)+`
|
|
1108
1110
|
|
|
1109
1111
|
[... truncated, total `+l.length+" chars]";let s=Math.floor(t.length*.7),r=Math.max(Math.floor(t.length*.2),5),n=t.length-s-r,o=t.slice(0,s),i=t.slice(t.length-r),a=`
|