everclaw 0.3.12 → 0.3.13
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/index.js +2 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -310,9 +310,9 @@ ${o}`}}async function kn(o,e,t){let n=si(),r=ai(o),i=(await e.chat({model:t,mess
|
|
|
310
310
|
${t.stdout.trim()}`:"",t.stderr.trim()?`STDERR:
|
|
311
311
|
${t.stderr.trim()}`:"",typeof t.exitCode=="number"?`Exit code: ${t.exitCode}`:"",t.signal?`Signal: ${t.signal}`:"",t.errorMessage?`Error: ${t.errorMessage}`:""].filter(Boolean).join(`
|
|
312
312
|
`);return r?`${n} failed
|
|
313
|
-
${r}`:`${n} failed`}function uc(){let o=process.argv[1]??"";return Gt(o)}function jr(o){let e=Math.max(1,Number(o??0))*1e3;return Math.max(cc,e)}var jo=class{constructor(e,t,n,r=new ve,s){this.target=e;this.timeoutMs=t;this.buildCommand=n;this.runner=r;this.defaultEnv=s}async run(e){if(St(this.target).mode!=="local-process")throw new Error(`${pi(this.target)} requires local-process isolation`);let n=await this.runner.run({command:this.buildCommand(e.payload),cwd:e.cwd,env:e.env??this.defaultEnv,timeoutMs:this.timeoutMs,signal:e.signal,maxCaptureBytes:e.maxCaptureBytes??lc});if(n.status==="aborted")throw cn();if(n.status==="ok")return n.stdout;throw new Error(dc(this.target,this.timeoutMs,n))}};function Cn(o){let e=uc();return new jo(o.target,o.timeoutMs,t=>({kind:"argv",file:e.file,args:[...e.args,"agent","--message",t.message,"--session",t.session,"--channel",t.channel,"--chat-id",t.chatId,"--raw-output"]}),o.runner,e.env)}var Vt=class o{constructor(e,t,n){this.config=e;this.bus=t;this.debounce=n}running=!1;isAllowed(e){let t=this.config?.allowFrom??[];return!t.length||t.includes(String(e))?!0:String(e).includes("|")?String(e).split("|").some(n=>t.includes(n)):!1}static channelColors={telegram:"\x1B[36m",discord:"\x1B[35m"};async handleMessage(e){let t=typeof e.content=="string"?e.content:JSON.stringify(e.content),n=o.channelColors[this.name]??"\x1B[0m",r=t.length>80?t.slice(0,80)+"\u2026":t;if(!this.isAllowed(e.senderId)){console.log(`[${n}${this.name}\x1B[0m] \x1B[31mBLOCKED\x1B[0m from=${e.senderId}`);return}console.log(`[${n}${this.name}\x1B[0m] from=${e.senderId} chat=${e.chatId} "${r}"`);let
|
|
313
|
+
${r}`:`${n} failed`}function uc(){let o=process.argv[1]??"";return Gt(o)}function jr(o){let e=Math.max(1,Number(o??0))*1e3;return Math.max(cc,e)}var jo=class{constructor(e,t,n,r=new ve,s){this.target=e;this.timeoutMs=t;this.buildCommand=n;this.runner=r;this.defaultEnv=s}async run(e){if(St(this.target).mode!=="local-process")throw new Error(`${pi(this.target)} requires local-process isolation`);let n=await this.runner.run({command:this.buildCommand(e.payload),cwd:e.cwd,env:e.env??this.defaultEnv,timeoutMs:this.timeoutMs,signal:e.signal,maxCaptureBytes:e.maxCaptureBytes??lc});if(n.status==="aborted")throw cn();if(n.status==="ok")return n.stdout;throw new Error(dc(this.target,this.timeoutMs,n))}};function Cn(o){let e=uc();return new jo(o.target,o.timeoutMs,t=>({kind:"argv",file:e.file,args:[...e.args,"agent","--message",t.message,"--session",t.session,"--channel",t.channel,"--chat-id",t.chatId,"--raw-output"]}),o.runner,e.env)}var Vt=class o{constructor(e,t,n){this.config=e;this.bus=t;this.debounce=n}running=!1;isAllowed(e){let t=this.config?.allowFrom??[];return!t.length||t.includes(String(e))?!0:String(e).includes("|")?String(e).split("|").some(n=>t.includes(n)):!1}static channelColors={telegram:"\x1B[36m",discord:"\x1B[35m"};async handleMessage(e){let t=typeof e.content=="string"?e.content:JSON.stringify(e.content),n=o.channelColors[this.name]??"\x1B[0m",r=t.length>80?t.slice(0,80)+"\u2026":t;if(!(e.metadata?._skip_allow_from===!0)&&!this.isAllowed(e.senderId)){console.log(`[${n}${this.name}\x1B[0m] \x1B[31mBLOCKED\x1B[0m from=${e.senderId}`);return}console.log(`[${n}${this.name}\x1B[0m] from=${e.senderId} chat=${e.chatId} "${r}"`);let i=e.metadata?{...e.metadata}:void 0;i&&"_skip_allow_from"in i&&delete i._skip_allow_from;let a={channel:this.name,senderId:String(e.senderId),chatId:String(e.chatId),content:e.content};e.media&&e.media.length>0&&(a.media=e.media),i&&Object.keys(i).length>0&&(a.metadata=i),e.sessionKey&&(a.sessionKeyOverride=e.sessionKey),await this.bus.publishInbound(a)}get isRunning(){return this.running}};var Yt=class{buffers=new Map;config;onEmit;constructor(e,t){this.config=e,this.onEmit=t}submit(e){if(!this.config.enabled){this.onEmit(e);return}let t=`${e.channel}:${e.chatId}`,n=this.buffers.get(t);if(n){clearTimeout(n.quietTimer),n.messages.push(e),n.quietTimer=setTimeout(()=>this.emit(t),this.config.quietMs);return}let r=setTimeout(()=>this.emit(t),this.config.quietMs),s=setTimeout(()=>this.emit(t),this.config.maxWaitMs);this.buffers.set(t,{messages:[e],quietTimer:r,maxTimer:s})}emit(e){let t=this.buffers.get(e);if(!t)return;clearTimeout(t.quietTimer),clearTimeout(t.maxTimer),this.buffers.delete(e);let n=t.messages[0];if(!n)return;let r=t.messages.map(a=>typeof a.content=="string"?a.content:a.content.find(c=>c.type==="text")?.text??JSON.stringify(a.content)).join(`
|
|
314
314
|
`),s=t.messages.flatMap(a=>a.media??[]),i=t.messages.reduce((a,l)=>({...a,...l.metadata??{}}),{});this.onEmit({...n,content:r,media:s.length>0?s:void 0,metadata:Object.keys(i).length>0?i:void 0})}flush(){for(let e of this.buffers.keys())this.emit(e)}get size(){return this.buffers.size}};function gc(o,e=4e3){if(o.length<=e)return[o];let t=[],n=o;for(;n.length>e;){let r=n.slice(0,e),s=Math.max(r.lastIndexOf(`
|
|
315
|
-
`),r.lastIndexOf(" "));s<=0&&(s=e),t.push(n.slice(0,s)),n=n.slice(s).trimStart()}return n&&t.push(n),t}function mc(o){if(!o)return"[Unsupported message]";if(o.text)return o.text;let e=o.caption?` ${o.caption}`:"";return o.photo?`[Photo]${e}`:o.video?`[Video]${e}`:o.voice?`[Voice message]${e}`:o.audio?`[Audio]${e}`:o.document?`[Document: ${o.document.file_name??"file"}]${e}`:o.sticker?`[Sticker ${o.sticker.emoji??""}]${e}`:o.location?`[Location]${e}`:o.contact?`[Contact]${e}`:`[Unsupported message]${e}`}function pc(o){return o.toLowerCase().replace(/[^a-z0-9_]/g,"_").slice(0,32)}var fc=new Set(["chatid","ping"]);function hc(o){let e=o.match(/^\/([a-zA-Z0-9_]+)(?:@([a-zA-Z0-9_]+))?(?:\s|$)/);return e?{name:e[1].toLowerCase(),target:e[2]?.toLowerCase()??null}:null}var yc=3e3,Fr=class extends Vt{name="telegram";offset=0;inbox;botUsername=null;botId=null;startTime=Date.now();lastTypingAt=new Map;constructor(e,t){super(e,t,e.debounce),this.inbox=new Yt(e.debounce,n=>this.handleMessage(n))}api(e){return`https://api.telegram.org/bot${this.config.token}/${e}`}async start(){if(!this.config.token){console.error("Telegram token not configured");return}if(!this.botUsername)try{let e=await fetch(this.api("getMe"));if(e.ok){let t=await e.json();t.ok&&t.result&&(t.result.id&&(this.botId=String(t.result.id)),t.result.username&&(this.botUsername=t.result.username.toLowerCase(),this.config.commands?.native!==!1&&await this.registerCommands()))}}catch{}for(this.running=!0;this.running;)try{let e=new URL(this.api("getUpdates"));e.searchParams.set("timeout","25"),e.searchParams.set("offset",String(this.offset)),e.searchParams.set("allowed_updates",JSON.stringify(["message"]));let t=await fetch(e);if(!t.ok){await new Promise(r=>setTimeout(r,1500));continue}let n=await t.json();if(!n.ok)continue;for(let r of n.result){this.offset=r.update_id+1;let s=r.message;if(!s||s.from?.is_bot)continue;let i=String(s.from?.id??"unknown"),a=s.from?.username?`${i}|@${s.from.username}`:i,l=mc(s),c=s.text?hc(l):null,d=c?.target!=null&&this.botUsername!=null&&c.target!==this.botUsername;if(c&&!d&&fc.has(c.name)){await this.handleBotCommand(c.name,s);continue}let p={message_id:s.message_id};s.chat.type&&(p.chat_type=s.chat.type);let g=!1;if(this.botUsername&&s.text&&s.entities&&(g=s.entities.some(y=>y.type==="mention"?s.text.substring(y.offset,y.offset+y.length).toLowerCase().trim()===`@${this.botUsername}`:y.type==="text_mention"?!0:y.type==="bot_command"?s.text.substring(y.offset,y.offset+y.length).toLowerCase().includes(`@${this.botUsername}`):!1)),s.chat.type==="group"||s.chat.type==="supergroup"){let y=this.config.groups?.allowedGroupIds,u=y==null?null:Array.isArray(y)?y:[String(y)];if(u!==null&&!u.includes(String(s.chat.id)))continue;if(this.config.groups?.requireMention!==!1){let R=!!c&&!d,S=!!(s.reply_to_message?.from?.is_bot&&(!this.botId||String(s.reply_to_message.from.id)===this.botId));if(!g&&!R&&!S)continue}}g&&this.botUsername&&(p.bot_mentioned=!0,s.text&&(l=l.replace(new RegExp(`@${this.botUsername}`,"gi"),"").trim())),s.message_thread_id&&(p.thread_id=s.message_thread_id),this.inbox.submit({channel:this.name,senderId:a,chatId:String(s.chat.id),content:l,metadata:p,...s.message_thread_id&&{sessionKey:`telegram:${s.chat.id}:${s.message_thread_id}`}})}}catch{await new Promise(e=>setTimeout(e,1500))}}async registerCommands(){let e=[{command:"chatid",description:"Show this chat's ID for configuration"},{command:"ping",description:"Check if the bot is online"},{command:"new",description:"Start a new conversation session"},{command:"reset",description:"Clear the current session context"},{command:"stop",description:"Stop the current task"},{command:"help",description:"Show available commands"}],t=(this.config.commands?.custom??[]).map(r=>({command:pc(r.command),description:r.description})),n=[...e,...t].slice(0,100);try{let r=await fetch(this.api("setMyCommands"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commands:n})});if(!r.ok){let s=await r.json().catch(()=>({}));console.warn(`[telegram] setMyCommands failed: ${s?.description??r.status}`)}}catch{console.warn("[telegram] setMyCommands request failed")}}async handleBotCommand(e,t){let n=String(t.chat.id);if(e==="chatid"){let r=t.chat.type??"private",s=r==="private"?t.from?.first_name??t.from?.username??"Private":t.chat.title??"Unknown";await this.sendChunk(n,`Chat ID: \`telegram:${n}\`
|
|
315
|
+
`),r.lastIndexOf(" "));s<=0&&(s=e),t.push(n.slice(0,s)),n=n.slice(s).trimStart()}return n&&t.push(n),t}function mc(o){if(!o)return"[Unsupported message]";if(o.text)return o.text;let e=o.caption?` ${o.caption}`:"";return o.photo?`[Photo]${e}`:o.video?`[Video]${e}`:o.voice?`[Voice message]${e}`:o.audio?`[Audio]${e}`:o.document?`[Document: ${o.document.file_name??"file"}]${e}`:o.sticker?`[Sticker ${o.sticker.emoji??""}]${e}`:o.location?`[Location]${e}`:o.contact?`[Contact]${e}`:`[Unsupported message]${e}`}function pc(o){return o.toLowerCase().replace(/[^a-z0-9_]/g,"_").slice(0,32)}var fc=new Set(["chatid","ping"]);function hc(o){let e=o.match(/^\/([a-zA-Z0-9_]+)(?:@([a-zA-Z0-9_]+))?(?:\s|$)/);return e?{name:e[1].toLowerCase(),target:e[2]?.toLowerCase()??null}:null}var yc=3e3,Fr=class extends Vt{name="telegram";offset=0;inbox;botUsername=null;botId=null;startTime=Date.now();lastTypingAt=new Map;constructor(e,t){super(e,t,e.debounce),this.inbox=new Yt(e.debounce,n=>this.handleMessage(n))}api(e){return`https://api.telegram.org/bot${this.config.token}/${e}`}async start(){if(!this.config.token){console.error("Telegram token not configured");return}if(!this.botUsername)try{let e=await fetch(this.api("getMe"));if(e.ok){let t=await e.json();t.ok&&t.result&&(t.result.id&&(this.botId=String(t.result.id)),t.result.username&&(this.botUsername=t.result.username.toLowerCase(),this.config.commands?.native!==!1&&await this.registerCommands()))}}catch{}for(this.running=!0;this.running;)try{let e=new URL(this.api("getUpdates"));e.searchParams.set("timeout","25"),e.searchParams.set("offset",String(this.offset)),e.searchParams.set("allowed_updates",JSON.stringify(["message"]));let t=await fetch(e);if(!t.ok){await new Promise(r=>setTimeout(r,1500));continue}let n=await t.json();if(!n.ok)continue;for(let r of n.result){this.offset=r.update_id+1;let s=r.message;if(!s||s.from?.is_bot)continue;let i=String(s.from?.id??"unknown"),a=s.from?.username?`${i}|@${s.from.username}`:i,l=mc(s),c=s.text?hc(l):null,d=c?.target!=null&&this.botUsername!=null&&c.target!==this.botUsername;if(c&&!d&&fc.has(c.name)){await this.handleBotCommand(c.name,s);continue}let p={message_id:s.message_id};s.chat.type&&(p.chat_type=s.chat.type);let g=!1;if(this.botUsername&&s.text&&s.entities&&(g=s.entities.some(y=>y.type==="mention"?s.text.substring(y.offset,y.offset+y.length).toLowerCase().trim()===`@${this.botUsername}`:y.type==="text_mention"?!0:y.type==="bot_command"?s.text.substring(y.offset,y.offset+y.length).toLowerCase().includes(`@${this.botUsername}`):!1)),s.chat.type==="group"||s.chat.type==="supergroup"){let y=this.config.groups?.allowedGroupIds,u=y==null?null:Array.isArray(y)?y:[String(y)];if(u!==null&&!u.includes(String(s.chat.id)))continue;if(u!==null&&(p._skip_allow_from=!0),this.config.groups?.requireMention!==!1){let R=!!c&&!d,S=!!(s.reply_to_message?.from?.is_bot&&(!this.botId||String(s.reply_to_message.from.id)===this.botId));if(!g&&!R&&!S)continue}}g&&this.botUsername&&(p.bot_mentioned=!0,s.text&&(l=l.replace(new RegExp(`@${this.botUsername}`,"gi"),"").trim())),s.message_thread_id&&(p.thread_id=s.message_thread_id),this.inbox.submit({channel:this.name,senderId:a,chatId:String(s.chat.id),content:l,metadata:p,...s.message_thread_id&&{sessionKey:`telegram:${s.chat.id}:${s.message_thread_id}`}})}}catch{await new Promise(e=>setTimeout(e,1500))}}async registerCommands(){let e=[{command:"chatid",description:"Show this chat's ID for configuration"},{command:"ping",description:"Check if the bot is online"},{command:"new",description:"Start a new conversation session"},{command:"reset",description:"Clear the current session context"},{command:"stop",description:"Stop the current task"},{command:"help",description:"Show available commands"}],t=(this.config.commands?.custom??[]).map(r=>({command:pc(r.command),description:r.description})),n=[...e,...t].slice(0,100);try{let r=await fetch(this.api("setMyCommands"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commands:n})});if(!r.ok){let s=await r.json().catch(()=>({}));console.warn(`[telegram] setMyCommands failed: ${s?.description??r.status}`)}}catch{console.warn("[telegram] setMyCommands request failed")}}async handleBotCommand(e,t){let n=String(t.chat.id);if(e==="chatid"){let r=t.chat.type??"private",s=r==="private"?t.from?.first_name??t.from?.username??"Private":t.chat.title??"Unknown";await this.sendChunk(n,`Chat ID: \`telegram:${n}\`
|
|
316
316
|
Name: ${s}
|
|
317
317
|
Type: ${r}`,{message_id:t.message_id,thread_id:t.message_thread_id})}else if(e==="ping"){let r=Math.floor((Date.now()-this.startTime)/1e3);await this.sendChunk(n,`Pong! Uptime: ${r}s`,{message_id:t.message_id,thread_id:t.message_thread_id})}}async stop(){this.running=!1}async send(e){if(!this.config.token)return;if(e.metadata?._progress){await this.sendTyping(e.chatId);return}let t=gc(e.content||"");for(let n of t)await this.sendChunk(e.chatId,n,e.metadata)}async sendTyping(e){let t=Date.now(),n=this.lastTypingAt.get(e)??0;t-n<yc||(this.lastTypingAt.set(e,t),await fetch(this.api("sendChatAction"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({chat_id:e,action:"typing"})}).catch(()=>{}))}async sendChunk(e,t,n){let r={chat_id:e,text:t,parse_mode:"Markdown"},s=n?.message_id;this.config.replyToMessage&&s&&(r.reply_parameters={message_id:s});let i=n?.thread_id;i&&(r.message_thread_id=i);let a=await this.fetchWithRetry(this.api("sendMessage"),r);if(a&&!a.ok&&a.status===400)try{if((await a.json()).description?.toLowerCase().includes("parse")){let c={...r};delete c.parse_mode,await this.fetchWithRetry(this.api("sendMessage"),c)}}catch{}}async fetchWithRetry(e,t,n=1){for(let r=0;r<=n;r++)try{return await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(s){r<n?await new Promise(i=>setTimeout(i,1e3)):console.error(`[telegram] send failed after ${n+1} attempts:`,s instanceof Error?s.message:String(s))}}};import fi from"ws";var Br=class extends Vt{name="discord";ws=null;hb=null;seq=null;inbox;constructor(e,t){super(e,t,e.debounce),this.inbox=new Yt(e.debounce,n=>this.handleMessage(n))}async start(){if(!this.config.token){console.error("Discord token not configured");return}for(this.running=!0;this.running;){try{await this.connectOnce()}catch{}this.running&&await new Promise(e=>setTimeout(e,2e3))}}async stop(){if(this.running=!1,this.hb&&(clearInterval(this.hb),this.hb=null),this.ws){try{this.ws.close()}catch{}this.ws=null}}async send(e){this.config.token&&await fetch(`https://discord.com/api/v10/channels/${e.chatId}/messages`,{method:"POST",headers:{Authorization:`Bot ${this.config.token}`,"Content-Type":"application/json"},body:JSON.stringify({content:e.content||""})}).catch(()=>{})}async connectOnce(){await new Promise(e=>{let t=new fi(this.config.gatewayUrl);this.ws=t,t.on("message",async n=>{let r;try{r=JSON.parse(n.toString())}catch{return}if(r.s!=null&&(this.seq=r.s),r.op===10){let s=Number(r.d?.heartbeat_interval??3e4);this.startHeartbeat(s),this.sendPayload({op:2,d:{token:this.config.token,intents:this.config.intents,properties:{os:process.platform,browser:"everclaw",device:"everclaw"}}});return}if(r.op===7){t.close();return}if(r.op!==11&&r.t==="MESSAGE_CREATE"){let s=r.d;if(!s||s.author?.bot)return;let i=String(s.content??"").trim();if(!i)return;let a=`${s.author?.id}${s.author?.username?`|${s.author.username}`:""}`;this.inbox.submit({channel:this.name,senderId:a,chatId:String(s.channel_id),content:i,...s.attachments?.length?{media:s.attachments.map(l=>l.url)}:{},metadata:{message_id:s.id,guild_id:s.guild_id??null}})}}),t.on("close",()=>{this.hb&&(clearInterval(this.hb),this.hb=null),e()}),t.on("error",()=>{this.hb&&(clearInterval(this.hb),this.hb=null),e()})})}startHeartbeat(e){this.hb&&clearInterval(this.hb),this.hb=setInterval(()=>{this.sendPayload({op:1,d:this.seq})},e)}sendPayload(e){!this.ws||this.ws.readyState!==fi.OPEN||this.ws.send(JSON.stringify(e))}};var hi="_shutdown",Ur=class{constructor(e,t,n,r){this.config=e;this.bus=t;this.lifecycle=n??rt(),this.logger=r,this.initChannels()}channels=new Map;dispatchLoop=null;stopping=!1;lifecycle;logger;initChannels(){this.config.channels.telegram.enabled&&this.channels.set("telegram",new Fr(this.config.channels.telegram,this.bus)),this.config.channels.discord.enabled&&this.channels.set("discord",new Br(this.config.channels.discord,this.bus))}async startAll(){this.channels.size&&(this.stopping=!1,this.dispatchLoop=this.dispatchOutbound(),await Promise.all([...this.channels.values()].map(e=>e.start().catch(()=>{}))))}async stopAll(){this.stopping=!0,await Promise.all([...this.channels.values()].map(e=>e.stop().catch(()=>{}))),this.dispatchLoop&&(await this.bus.publishOutbound({channel:"system",chatId:"gateway:shutdown",content:"",metadata:{[hi]:!0}}),await this.dispatchLoop.catch(()=>{}),this.dispatchLoop=null)}getSkipReason(e){if(this.stopping)return"stopping";if(e.metadata?._progress){let t=!!e.metadata._tool_hint;if(t&&!this.config.channels.sendToolHints||!t&&!this.config.channels.sendProgress)return"progress_disabled"}return this.channels.has(e.channel)?null:"channel_unavailable"}async dispatchOutbound(){for(;;){let e=await this.bus.consumeOutbound();if(e.metadata?.[hi])break;let t=this.channels.has(e.channel),n=this.getSkipReason(e),r=!1,s=null;try{await qe(this.lifecycle.beforeOutbound,"beforeOutbound",{message:e,hasChannel:t,skippedReason:n})}catch(i){s=i,console.warn(String(i))}if(!s&&!n){let i=this.channels.get(e.channel);if(i)try{await i.send(e),r=!0}catch(a){s=a}}try{await qe(this.lifecycle.afterOutbound,"afterOutbound",{message:e,hasChannel:t,skippedReason:n,dispatched:r,error:s})}catch(i){console.warn(String(i))}}}get enabledChannels(){return[...this.channels.keys()]}getStatus(){return Object.fromEntries([...this.channels].map(([e,t])=>[e,{enabled:!0,running:t.isRunning}]))}};Ue();import{randomUUID as bc}from"node:crypto";import wc from"node:path";function vc(o,e=160){let t=typeof o=="string"?o.trim().replace(/\s+/g," "):"";return t?t.length>e?`${t.slice(0,Math.max(0,e-1)).trimEnd()}\u2026`:t:"No delivery content available."}function Sc(o){return wc.resolve(o)}function yi(o){if(!o)return null;let e=String(o.content??"");return{id:String(o.delivery_id??""),jobId:String(o.job_id??""),jobName:String(o.job_name??"Delivery"),sessionKey:String(o.session_key??""),channel:String(o.channel??"cli"),recipient:String(o.recipient??"direct"),content:e,contentPreview:vc(e),deliveredAt:String(o.delivered_at??""),clearedAt:o.cleared_at?String(o.cleared_at):null}}var Xt=class{storage;workspace;constructor(e,t,n){this.workspace=Sc(e),this.storage=n??Fe({dataDir:t})}list(e={}){return this.storage.prepare(`SELECT delivery_id, job_id, job_name, session_key, channel, recipient, content, delivered_at, cleared_at
|
|
318
318
|
FROM inbox_deliveries
|
package/package.json
CHANGED