@chatpanel/events 0.374.0 → 0.389.0

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/note-actions.js CHANGED
@@ -1,21 +1,23 @@
1
- const h=Object.freeze({continue:Object.freeze({label:"Continue writing",hint:"draft inline from here",system:"You are a writing assistant continuing the user's note. Match their voice, tone and markdown style, and continue naturally from where the text stops. Output ONLY the continuation — no preamble, no repeating prior text.",maxTokens:700,needsSelection:!1}),summarize:Object.freeze({label:"Summarize",hint:"a tight summary",system:"Summarize the text concisely in GitHub-flavored markdown — a few tight bullets or a short paragraph. Output ONLY the summary.",maxTokens:500,needsSelection:!1}),tasks:Object.freeze({label:"Turn into tasks",hint:"selection → checklist",system:'Convert the text into a GitHub-flavored markdown checklist: one actionable item per line as "- [ ] item". Output ONLY the checklist.',maxTokens:700,needsSelection:!0}),improve:Object.freeze({label:"Improve writing",hint:"rewrite clearer",system:"Rewrite the text to be clearer and more concise while preserving its meaning, tone and markdown formatting. Output ONLY the rewritten text.",maxTokens:1e3,needsSelection:!1})}),w=.5,p=Object.freeze(["continue","summarize","tasks","improve"]),x=e=>h[e]?.label||String(e||"");function N(e,n,r=0,s=r){if(!h[e])return{error:"unknown"};const t=String(n??""),a=f(r,0,t.length),l=f(s,a,t.length),i=t.slice(a,l);let c,u,m;if(e==="continue")c=t,u=t+(t&&!/\s$/.test(t)?`
1
+ const h=Object.freeze({continue:Object.freeze({label:"Continue writing",hint:"draft inline from here",system:"You are a writing assistant continuing the user's note. Match their voice, tone and markdown style, and continue naturally from where the text stops. Output ONLY the continuation — no preamble, no repeating prior text.",maxTokens:700,needsSelection:!1}),summarize:Object.freeze({label:"Summarize",hint:"a tight summary",system:"Summarize the text concisely in GitHub-flavored markdown — a few tight bullets or a short paragraph. Output ONLY the summary.",maxTokens:500,needsSelection:!1}),tasks:Object.freeze({label:"Turn into tasks",hint:"selection → checklist",system:'Convert the text into a GitHub-flavored markdown checklist: one actionable item per line as "- [ ] item". Output ONLY the checklist.',maxTokens:700,needsSelection:!0}),improve:Object.freeze({label:"Improve writing",hint:"rewrite clearer",system:"Rewrite the text to be clearer and more concise while preserving its meaning, tone and markdown formatting. Output ONLY the rewritten text.",maxTokens:1e3,needsSelection:!1})}),y=.5,O=Object.freeze(["continue","summarize","tasks","improve"]),N=e=>h[e]?.label||String(e||"");function k(e,r,n=0,s=n){if(!h[e])return{error:"unknown"};const t=String(r??""),l=f(n,0,t.length),a=f(s,l,t.length),i=t.slice(l,a);let u,c,m;if(e==="continue")u=t,c=t+(t&&!/\s$/.test(t)?`
2
2
 
3
- `:""),m="";else if(e==="summarize")c=i||t,u=`${t.replace(/\s+$/,"")}
3
+ `:""),m="";else if(e==="summarize")u=i||t,c=`${t.replace(/\s+$/,"")}
4
4
 
5
5
  ## Summary
6
6
 
7
- `,m="";else if(e==="tasks"){if(!i.trim())return{error:"select"};c=i,u=t.slice(0,a),m=t.slice(l)}else c=i||t,u=i?t.slice(0,a):"",m=i?t.slice(l):"";return c.trim()?{target:c,head:u,tail:m}:{error:"empty"}}const y=Object.freeze({select:"Select some text first",empty:"Nothing to work with yet",unknown:"Unknown action"}),d=Object.freeze([Object.freeze({cmd:"insert",label:"Insert",hint:"generate or fetch, then insert",tools:!0,system:"You insert content into the user's note. Follow the instruction. If it needs current, live, or web data, USE the web_search tool to fetch it — never guess or use stale knowledge. Output ONLY the content to insert as clean GitHub-flavored markdown — no preamble, no closing remarks."}),Object.freeze({cmd:"table",label:"Table",hint:"produce a markdown table",tools:!0,system:"Produce the requested data as a GitHub-flavored markdown table. If it needs live/current data, USE the web_search tool. Output ONLY the table."}),Object.freeze({cmd:"list",label:"List",hint:"produce a bullet/task list",tools:!0,system:"Produce the requested content as a GitHub-flavored markdown list (use - [ ] for actionable tasks). Use web_search for live data. Output ONLY the list."}),Object.freeze({cmd:"summarize",label:"Summarize",hint:"summarize a topic",tools:!1,system:"Summarize the requested topic concisely in markdown. Output ONLY the summary."}),Object.freeze({cmd:"translate",label:"Translate",hint:"translate to a language",tools:!1,system:"Translate the requested text to the requested language, preserving markdown. Output ONLY the translation."})]),T=.4,k=1800,b=new RegExp(`@(${d.map(e=>e.cmd).join("|")})\\b[ \\t]*(.*)$`,"i");function S(e,n){const r=String(e??""),s=f(n,0,r.length),o=r.lastIndexOf(`
8
- `,s-1)+1;let t=r.indexOf(`
9
- `,s);t<0&&(t=r.length);const l=r.slice(o,t).match(b);if(!l)return null;const i=d.find(u=>u.cmd===l[1].toLowerCase()),c=(l[2]||"").trim();return!i||!c?null:{spec:i,instruction:c,start:o+l.index,end:t}}function E(e,n,r,{hasSelection:s=!1}={}){if(s)return null;const o=String(e??""),t=f(n,0,o.length),a=o.slice(o.lastIndexOf(`
10
- `,t-1)+1,t),l=g(String(r||"/")),i=a.match(new RegExp(`(?:^|\\s)${l}(\\w*)$`));return i?{word:i[1],start:t-i[1].length,end:t}:null}function z(e,n){const r=String(n||"").trim().toLowerCase(),s=Array.isArray(e)?e:[];return r?s.filter(o=>String(o.key||"").toLowerCase().startsWith(r)||String(o.label||"").toLowerCase().includes(r)):s}function _(e=p){return e.filter(n=>h[n]).map(n=>({key:n,label:h[n].label,hint:h[n].hint}))}const O=4e3;function v(e,n,{title:r="",max:s=O}={}){const o=`${e??""}
11
- ${n??""}`.replace(/\n{3,}/g,`
7
+ `,m="";else if(e==="tasks"){if(!i.trim())return{error:"select"};u=i,c=t.slice(0,l),m=t.slice(a)}else u=i||t,c=i?t.slice(0,l):"",m=i?t.slice(a):"";return u.trim()?{target:u,head:c,tail:m}:{error:"empty"}}const S=Object.freeze({select:"Select some text first",empty:"Nothing to work with yet",unknown:"Unknown action"}),p=Object.freeze([Object.freeze({cmd:"insert",label:"Insert",hint:"generate or fetch, then insert",tools:!0,system:"You insert content into the user's note. Follow the instruction. If it needs current, live, or web data, USE the web_search tool to fetch it — never guess or use stale knowledge. Output ONLY the content to insert as clean GitHub-flavored markdown — no preamble, no closing remarks."}),Object.freeze({cmd:"table",label:"Table",hint:"produce a markdown table",tools:!0,system:"Produce the requested data as a GitHub-flavored markdown table. If it needs live/current data, USE the web_search tool. Output ONLY the table."}),Object.freeze({cmd:"list",label:"List",hint:"produce a bullet/task list",tools:!0,system:"Produce the requested content as a GitHub-flavored markdown list (use - [ ] for actionable tasks). Use web_search for live data. Output ONLY the list."}),Object.freeze({cmd:"summarize",label:"Summarize",hint:"summarize a topic",tools:!1,system:"Summarize the requested topic concisely in markdown. Output ONLY the summary."}),Object.freeze({cmd:"translate",label:"Translate",hint:"translate to a language",tools:!1,system:"Translate the requested text to the requested language, preserving markdown. Output ONLY the translation."})]),E=.4,_=1800,w=new RegExp(`@(${p.map(e=>e.cmd).join("|")})\\b[ \\t]*(.*)$`,"i");function v(e,r){const n=String(e??""),s=f(r,0,n.length),o=n.lastIndexOf(`
8
+ `,s-1)+1;let t=n.indexOf(`
9
+ `,s);t<0&&(t=n.length);const a=n.slice(o,t).match(w);if(!a)return null;const i=p.find(c=>c.cmd===a[1].toLowerCase()),u=(a[2]||"").trim();return!i||!u?null:{spec:i,instruction:u,start:o+a.index,end:t}}function z(e,r,n,{hasSelection:s=!1}={}){if(s)return null;const o=String(e??""),t=f(r,0,o.length),l=o.slice(o.lastIndexOf(`
10
+ `,t-1)+1,t),a=T(String(n||"/")),i=l.match(new RegExp(`(?:^|\\s)${a}(\\w*)$`));return i?{word:i[1],start:t-i[1].length,end:t}:null}function A(e,r){const n=String(r||"").trim().toLowerCase(),s=Array.isArray(e)?e:[];return n?s.filter(o=>String(o.key||"").toLowerCase().startsWith(n)||String(o.label||"").toLowerCase().includes(n)):s}function $(e=O){return e.filter(r=>h[r]).map(r=>({key:r,label:h[r].label,hint:h[r].hint}))}const x=4e3;function L(e,r,{title:n="",max:s=x}={}){const o=`${e??""}
11
+ ${r??""}`.replace(/\n{3,}/g,`
12
12
 
13
13
  `).trim();if(!o)return"";const t=o.length>s?`${o.slice(0,s)}
14
- …(note truncated)`:o,a=String(r||"").trim();return`The note I'm editing${a?` (title: "${a}")`:""} is below. Resolve any reference in my instruction — "this meeting", "above", a date, a name, a [[wikilink]] or a URL (a meeting link's #id identifies that exact meeting) — against THIS note, not a guess. If a tool lets you fetch something referenced here by id, use that id.
14
+ …(note truncated)`:o,l=String(n||"").trim();return`The note I'm editing${l?` (title: "${l}")`:""} is below. Resolve any reference in my instruction — "this meeting", "above", a date, a name, a [[wikilink]] or a URL (a meeting link's #id identifies that exact meeting) — against THIS note, not a guess. If a tool lets you fetch something referenced here by id, use that id.
15
15
 
16
16
  """
17
17
  ${t}
18
- """`}function A(e,n){const r=String(e??"");return n?`${n}
18
+ """`}function R(e,r){const n=String(e??"");return r?`${r}
19
19
 
20
20
  ---
21
- Instruction: ${r}`:r}function f(e,n,r){const s=Number.isFinite(e)?e:n;return Math.max(n,Math.min(r,s))}const g=e=>e.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&");export{h as NOTE_ACTIONS,y as NOTE_ACTION_ERRORS,p as NOTE_ACTION_ORDER,w as NOTE_ACTION_TEMPERATURE,d as NOTE_COMMANDS,k as NOTE_COMMAND_MAX_TOKENS,T as NOTE_COMMAND_TEMPERATURE,O as NOTE_CONTEXT_MAX_CHARS,S as commandLineAt,z as filterNoteActions,N as frameNoteAction,A as groundedInstruction,_ as noteActionItems,x as noteActionLabel,v as noteCommandContext,E as triggerQueryAt};
21
+ Instruction: ${n}`:n}const d=/^\s*\|.*\|\s*$/,g=/^\s*\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?\s*$/,b=e=>e.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,"").split(/(?<!\\)\|/).length;function C(e,r){const n=String(r??"").trim().split(`
22
+ `);if(!n[0]||!n.every(c=>d.test(c)&&!g.test(c)))return null;const s=String(e??""),o=s.replace(/\s+$/,"").length,t=s.slice(o);if(!/\n[ \t]*\n/.test(t))return null;const l=s.slice(0,o).split(`
23
+ `);let a=l.length-1;for(;a>=0&&d.test(l[a]);)a--;const i=l.slice(a+1);if(!i.length||!i.some(c=>g.test(c)))return null;const u=b(i[i.length-1]);return n.every(c=>b(c)===u)?{from:o,to:s.length}:null}function f(e,r,n){const s=Number.isFinite(e)?e:r;return Math.max(r,Math.min(n,s))}const T=e=>e.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&");export{h as NOTE_ACTIONS,S as NOTE_ACTION_ERRORS,O as NOTE_ACTION_ORDER,y as NOTE_ACTION_TEMPERATURE,p as NOTE_COMMANDS,_ as NOTE_COMMAND_MAX_TOKENS,E as NOTE_COMMAND_TEMPERATURE,x as NOTE_CONTEXT_MAX_CHARS,v as commandLineAt,A as filterNoteActions,k as frameNoteAction,R as groundedInstruction,$ as noteActionItems,N as noteActionLabel,L as noteCommandContext,C as tableRowGap,z as triggerQueryAt};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/events",
3
- "version": "0.374.0",
3
+ "version": "0.389.0",
4
4
  "description": "The canonical ChatPanel event-log and capability contracts — typed durable facts, clock-free deterministic linearization, schema upcasting, and the invariants the replay harness asserts. Pure, dependency-free ESM shared by the ChatPanel extension, gateway and bridge.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -273,6 +273,9 @@
273
273
  "./voice-speaker.js": "./voice-speaker.js",
274
274
  "./speaker-cluster.js": "./speaker-cluster.js",
275
275
  "./speaker-turns.js": "./speaker-turns.js",
276
+ "./speech-language.js": "./speech-language.js",
277
+ "./meeting-translate.js": "./meeting-translate.js",
278
+ "./stt-session.js": "./stt-session.js",
276
279
  "./link-noise.js": "./link-noise.js",
277
280
  "./link-protocol.js": "./link-protocol.js",
278
281
  "./voice-channels.js": "./voice-channels.js",
@@ -617,6 +620,9 @@
617
620
  "voice-speaker.js",
618
621
  "speaker-cluster.js",
619
622
  "speaker-turns.js",
623
+ "speech-language.js",
624
+ "meeting-translate.js",
625
+ "stt-session.js",
620
626
  "link-noise.js",
621
627
  "link-protocol.js",
622
628
  "voice-channels.js",
package/schedule.js CHANGED
@@ -1 +1 @@
1
- class l extends Error{constructor(t,n){super(n),this.name="ScheduleError",this.code=t}}const O=Object.freeze(["once","interval","daily","weekly","cron"]),B=Object.freeze(["timer","meeting","voice","data","channel"]),D=Object.freeze(["skill","prompt","monitor","notify"]),C=Object.freeze(["skip","runOnce","runAll"]),E=20;function f(e,{days:t=0,hour:n,minute:r=0}){const o=new Date(e);return o.setDate(o.getDate()+t),o.setHours(n,r,0,0),o.getTime()}const L=e=>{const t=new Date(e).getDay();return t===0||t===6};function A(e){if(!e||typeof e!="object")throw new l("BAD_SCHEDULE","schedule must be an object");if(!O.includes(e.kind))throw new l("BAD_SCHEDULE",`unknown schedule kind '${e.kind}'`);if(e.kind==="once"&&!(e.at>0))throw new l("BAD_SCHEDULE","once needs `at`");if(e.kind==="interval"&&!(e.everyMs>=6e4))throw new l("BAD_SCHEDULE","interval needs everyMs >= 60000");if(e.kind==="daily"||e.kind==="weekly"){if(!Number.isInteger(e.hour)||e.hour<0||e.hour>23)throw new l("BAD_SCHEDULE","hour must be 0-23");const t=e.minute??0;if(!Number.isInteger(t)||t<0||t>59)throw new l("BAD_SCHEDULE","minute must be 0-59")}if(e.kind==="weekly"&&(!Number.isInteger(e.weekday)||e.weekday<0||e.weekday>6))throw new l("BAD_SCHEDULE","weekly needs weekday 0-6 (Sunday = 0)");return e.kind==="cron"&&p(e.expr),e}const I=Object.freeze([{name:"minute",min:0,max:59},{name:"hour",min:0,max:23},{name:"day-of-month",min:1,max:31},{name:"month",min:1,max:12,names:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"]},{name:"day-of-week",min:0,max:7,names:["sun","mon","tue","wed","thu","fri","sat"]}]);function w(e,t){const n=e.toLowerCase();if(t.names){const o=t.names.indexOf(n.slice(0,3));if(o>=0&&n.length===3)return t.min===1?o+1:o}if(!/^\d+$/.test(n))throw new l("BAD_SCHEDULE",`cron: '${e}' is not a ${t.name}`);const r=Number(n);if(r<t.min||r>t.max)throw new l("BAD_SCHEDULE",`cron: ${t.name} ${r} is outside ${t.min}-${t.max}`);return r}function M(e,t){const n=new Set;for(const r of String(e).split(",")){if(!r)throw new l("BAD_SCHEDULE",`cron: empty entry in ${t.name}`);const[o,s]=r.split("/"),i=s===void 0?1:Number(s);if(!Number.isInteger(i)||i<1)throw new l("BAD_SCHEDULE",`cron: bad step '/${s}' in ${t.name}`);let c,a;if(o==="*")c=t.min,a=t.max;else if(o.includes("-")){const[u,h]=o.split("-");if(c=w(u,t),a=w(h,t),a<c)throw new l("BAD_SCHEDULE",`cron: range ${o} runs backwards in ${t.name}`)}else c=w(o,t),a=s===void 0?c:t.max;for(let u=c;u<=a;u+=i)n.add(u)}return t.name==="day-of-week"&&n.has(7)&&(n.delete(7),n.add(0)),n}function p(e){const t=String(e??"").trim().split(/\s+/);if(t.length!==5||!t[0])throw new l("BAD_SCHEDULE","cron needs five fields: minute hour day-of-month month day-of-week");const[n,r,o,s,i]=t.map((u,h)=>M(u,I[h])),c=t[2]==="*",a=t[4]==="*";return{minute:n,hour:r,dom:o,month:s,dow:i,domAny:c,dowAny:a}}const N=366*5;function H(e,t){const n=i=>{if(!e.month.has(i.getMonth()+1))return!1;const c=e.dom.has(i.getDate()),a=e.dow.has(i.getDay());return e.domAny&&e.dowAny?!0:e.domAny?a:e.dowAny?c:c||a},r=[...e.hour].sort((i,c)=>i-c),o=[...e.minute].sort((i,c)=>i-c),s=new Date(t);s.setSeconds(0,0);for(let i=0;i<N;i++){const c=new Date(s);if(c.setDate(s.getDate()+i),c.setHours(0,0,0,0),!!n(c))for(const a of r)for(const u of o){const h=new Date(c);if(h.setHours(a,u,0,0),h.getHours()===a&&h.getTime()>t)return h.getTime()}}return null}function _(e,t){const n=A(e),r=n.minute??0;switch(n.kind){case"once":return n.at>t?n.at:null;case"interval":{const o=n.anchor??t;if(o>t)return o;const s=Math.floor((t-o)/n.everyMs)+1;return o+s*n.everyMs}case"daily":{let o=f(t,{hour:n.hour,minute:r});if(o<=t&&(o=f(t,{days:1,hour:n.hour,minute:r})),n.weekdaysOnly)for(let s=0;s<7&&L(o);s++)o=f(o,{days:1,hour:n.hour,minute:r});return o}case"weekly":{const o=new Date(t).getDay();let s=(n.weekday-o+7)%7;return s===0&&f(t,{hour:n.hour,minute:r})<=t&&(s=7),f(t,{days:s,hour:n.hour,minute:r})}case"cron":return H(p(n.expr),t);default:return null}}const R=Object.freeze(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]),y=e=>`${String(e?.hour??0).padStart(2,"0")}:${String(e?.minute??0).padStart(2,"0")}`;function re(e){if(!e||typeof e!="object")return"";switch(e.kind){case"once":return e.at>0?`once, at ${new Date(e.at).toLocaleString()}`:"";case"interval":{const t=Number(e.everyMs)||0;if(t<6e4)return"";const n=Math.round(t/6e4);if(n%1440===0){const r=n/1440;return`every ${r===1?"day":`${r} days`}`}if(n%60===0){const r=n/60;return`every ${r===1?"hour":`${r} hours`}`}return`every ${n} minutes`}case"daily":return e.weekdaysOnly?`every weekday at ${y(e)}`:`every day at ${y(e)}`;case"weekly":{const t=R[e.weekday];return t?`every ${t} at ${y(e)}`:""}case"cron":{try{p(e.expr)}catch{return""}return`on the cron schedule ${String(e.expr).trim()}`}default:return""}}function v(e,t,n,r=E){const o=[];let s=t;for(;o.length<r;){const i=_(e,s);if(i===null||i>n)break;o.push(i),s=i}return o}function m({id:e,label:t,kind:n,watches:r=[],description:o="",classUsed:s="R",matches:i=null,params:c={}}){if(!e)throw new l("BAD_TRIGGER","trigger.id required");if(!B.includes(n))throw new l("BAD_TRIGGER",`trigger '${e}': unknown kind '${n}'`);if(n!=="timer"&&typeof i!="function")throw new l("BAD_TRIGGER",`trigger '${e}': an event trigger needs matches()`);return Object.freeze({id:e,label:t||e,kind:n,watches:Object.freeze([...r]),description:o,classUsed:s,matches:i,params:Object.freeze({...c})})}function oe(e=[]){const t=[...e];return{add(n){return t.push(n),()=>{const r=t.indexOf(n);r>=0&&t.splice(r,1)}},list:()=>[...t],get:n=>t.find(r=>r.id===n)||null}}const U=e=>String(e||"").toLowerCase().match(/[\p{L}\p{N}']+/gu)||[],d=e=>String(e||"").trim().toLowerCase(),T=3,G=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function x(e,t=120){const n=String(e||"").replace(/\s+/g," ").trim();if(n.length<=t)return n;const r=n.slice(0,t),o=r.lastIndexOf(" ");return`${(o>t*.6?r.slice(0,o):r).replace(/[\s,;:.!?—-]+$/,"")}…`}function W(e,t){const n=d(t);if(n.length<T)return!1;const r=/[\p{L}\p{N}]/u.test(n[0])?"\\b":"",o=/[\p{L}\p{N}]/u.test(n[n.length-1])?"\\b":"";try{return new RegExp(`${r}${G(n)}${o}`,"iu").test(String(e||""))}catch{return d(e).includes(n)}}function b(e,t,n){return e==="me"?!!n?.isSelf?.(t):e==="others"?!n?.isSelf?.(t):!0}const z=Object.freeze(new Set(["and","or","but","so","because","cause","cos","since","although","though","while","whereas","unless","until","if","when","whenever","that","which","who","whom","whose","than","as","like","what","to","of","in","on","at","by","for","from","with","without","about","into","onto","over","under","between","through","during","against","per","a","an","the","my","our","your","their","its","is","are","was","were","be","been","being","am","do","does","did","have","has","had","will","would","can","could","should","shall","may","might","must","um","uh","er"]));function ie(e){const t=String(e||"").trim();if(!t)return!1;if(/[.!?…]["'\u2019\u201d)\]]*$/.test(t))return!0;if(/[,;:\-\u2013\u2014]$/.test(t))return!1;const n=t.toLowerCase().match(/[\p{L}\p{N}']+/gu)||[],r=n[n.length-1];return r?!z.has(r):!0}const J="text.delta",j=Object.freeze(["meeting","note","chat"]),k=Object.freeze(["meeting.transcript.delta",J]);function q(e){if(e?.type==="meeting.transcript.delta")return"meeting";const t=d(e?.source);return j.includes(t)?t:""}function S(e,t){const n=q(t);if(!n)return!1;const r=(Array.isArray(e)?e:[]).map(d).filter(o=>j.includes(o));return r.length?r.includes(n):n==="meeting"}const g=m({id:"timer:schedule",label:"On a schedule",kind:"timer",description:'Once, on an interval, daily, or on a weekday — "every weekday at 8am".'}),F=m({id:"meeting:started",label:"When a meeting starts",kind:"meeting",watches:["meeting.started"],matches:(e,t={})=>t.platform&&d(e.platform)!==d(t.platform)||t.titleIncludes&&!d(e.title).includes(d(t.titleIncludes))?null:{why:`meeting started: ${e.title||e.meetingId}`}}),X=m({id:"meeting:ended",label:"When a meeting ends",kind:"meeting",watches:["meeting.ended"],matches:e=>({why:`meeting ended: ${e.title||e.meetingId}`})}),K=m({id:"meeting:person-joined",label:"When someone joins",kind:"meeting",watches:["meeting.person-joined"],matches:(e,t={})=>{const n=(t.names||[]).map(d).filter(Boolean),r=(e.people||[]).filter(o=>!n.length||n.some(s=>d(o)===s||d(o).startsWith(`${s} `)));return r.length?{why:`joined: ${r.join(", ")}`,people:r}:null}}),P=m({id:"meeting:phrase",label:"When a phrase is said",kind:"meeting",watches:k,matches:(e,t={},n={})=>{if(!S(t.sources,e))return null;const r=(t.any||[]).map(d).filter(o=>o.length>=T);if(!r.length)return null;for(const o of e.segments||[]){if(!b(t.speaker,o.speaker,n))continue;const s=r.find(i=>W(o.text,i));if(s)return{why:`“${s}” said by ${o.speaker||"someone"}`,segment:o,phrase:s}}return null}}),Y=m({id:"meeting:topic",label:"When someone talks about something",kind:"meeting",watches:k,matches:(e,t={},n={})=>{if(!S(t.sources,e))return null;const r=(t.terms||[]).map(d).filter(Boolean);if(!r.length)return null;const o=Math.max(1,Math.min(t.minHits||1,r.length)),s=(e.segments||[]).filter(a=>b(t.speaker,a.speaker,n)),i=new Set(s.flatMap(a=>U(a.text))),c=r.filter(a=>a.split(/\s+/).every(u=>i.has(u)));return c.length>=o?{why:`talking about ${c.join(", ")}`,terms:c}:null}}),Q=/^(who|what|when|where|why|how|which|whose|can|could|would|should|shall|do|does|did|is|are|was|were|will|have|has|any(one|body)|is there|are there)\b/i,V=m({id:"meeting:question",label:"When a question is asked",kind:"meeting",watches:k,matches:(e,t={},n={})=>{if(!S(t.sources,e))return null;for(const r of e.segments||[]){if(!b(t.speaker||"anyone",r.speaker,n))continue;const o=String(r.text||"").trim();if(!(o.length<8)&&(o.includes("?")||Q.test(o)))return{why:`question from ${r.speaker||"someone"}: “${x(o,100)}”`,segment:r}}return null}}),Z=m({id:"voice:command",label:"When you say the wake word",kind:"voice",watches:["voice.command"],matches:(e,t={})=>{const n=t.intents||[];return!e.command?.allowed||n.length&&!n.includes(e.command.intent)?null:{why:`you said “${e.command.command}”`,command:e.command}}}),se=Object.freeze([g,F,X,K,P,Y,V,Z]);function ce({id:e,name:t,trigger:n,schedule:r=null,params:o={},action:s,enabled:i=!0,onMissed:c="runOnce",limits:a={},approval:u=null,createdAt:h=0}){if(!e)throw new l("BAD_JOB","job.id required");if(!t)throw new l("BAD_JOB",`job '${e}': name required`);if(!n)throw new l("BAD_JOB",`job '${e}': trigger required`);if(!s||!D.includes(s.kind))throw new l("BAD_JOB",`job '${e}': action.kind must be one of ${D}`);if(s.kind==="skill"&&!s.skillId)throw new l("BAD_JOB",`job '${e}': skill action needs skillId`);if(!C.includes(c))throw new l("BAD_JOB",`job '${e}': unknown onMissed '${c}'`);return(n===g.id||r)&&A(r),{id:e,name:t,trigger:n,schedule:r,params:{...o},action:{...s},enabled:!!i,onMissed:c,limits:{...a},approval:u,createdAt:h||0}}function $(e,t){return`${e}@${t}`}function ae(e,{now:t,lastRun:n={},admit:r=null,max:o=E}={}){const s=[];for(const i of e||[]){if(!i.enabled||i.trigger!==g.id||!i.schedule||r&&!r(i))continue;const c=n[i.id]||i.createdAt||0;if(!c)continue;const a=v(i.schedule,c,t,o);if(!a.length)continue;const u=i.onMissed==="runAll"?a:i.onMissed==="runOnce"?[a[a.length-1]]:[];for(const h of u)s.push({job:i,at:h,key:$(i.id,h),late:t-h>6e4,missedCount:a.length});u.length||s.push({job:i,at:a[a.length-1],key:$(i.id,a[a.length-1]),skipped:!0,missedCount:a.length})}return s}function ue(e,{now:t,lastRun:n={}}={}){let r=null;for(const o of e||[]){if(!o.enabled||o.trigger!==g.id||!o.schedule)continue;const s=_(o.schedule,Math.max(t,n[o.id]||0));s!==null&&(r===null||s<r)&&(r=s)}return r}const ee=8;function te(e=[],{max:t=ee}={}){const n=[];for(const r of e){const o=String(r?.segment?.text||r?.why||"").trim();if(!o)continue;const s=d(r?.segment?.speaker),i=r?.segment?.t||0,c=o.toLowerCase().replace(/\s+/g," "),a=n.findIndex(u=>u.who===s&&(i&&u.t?u.t===i:u.flat.startsWith(c)||c.startsWith(u.flat)));if(a>=0){o.length>n[a].text.length&&(n[a]={...n[a],match:r,text:o,flat:c});continue}n.push({who:s,t:i,match:r,text:o,flat:c})}return n.slice(-Math.max(1,t)).map(r=>r.match)}function ne(e=[]){return te(e,{max:Number.MAX_SAFE_INTEGER}).map(t=>String(t?.segment?.text||t?.why||"").trim()).filter(Boolean)}function le(e=[],{noun:t="matches",max:n=3,chars:r=180}={}){const o=(e||[]).filter(Boolean);if(!o.length)return"";if(o.length===1)return String(o[0].why||"")||x(o[0]?.segment?.text,r);const s=ne(o);if(!s.length)return`${o.length} ${t}`;const i=s.slice(0,n),c=Math.max(40,Math.floor(r/i.length)),a=s.length-i.length;return`${s.length} ${t}: ${i.map(u=>`“${x(u,c)}”`).join(" · ")}`+(a>0?` +${a} more`:"")}function he(e,t,{registry:n,ctx:r={},admit:o=null}={}){const s=[];for(const i of e||[]){if(!i.enabled||o&&!o(i))continue;const c=n?.get(i.trigger);if(!c||c.kind==="timer"||c.watches.length&&!c.watches.includes(t?.type))continue;let a=null;try{a=c.matches(t,i.params,r)}catch{a=null}a&&s.push({job:i,trigger:c,match:a,key:$(i.id,t.at||t.t||0)})}return s}export{se as BUILTIN_TRIGGERS,z as DANGLING_TAILS,ee as DEFAULT_COALESCE_MAX,D as JOB_ACTIONS,T as MIN_PHRASE_CHARS,C as MISSED_POLICIES,O as SCHEDULE_KINDS,l as ScheduleError,J as TEXT_DELTA,k as TEXT_WATCHES,B as TRIGGER_KINDS,j as TRIGGER_SOURCES,R as WEEKDAY_NAMES,x as clipText,te as coalesceMatches,oe as createTriggerRegistry,ce as defineJob,m as defineTrigger,re as describeSchedule,ae as dueJobs,q as eventSource,he as jobsForEvent,le as matchSummary,ne as matchTexts,X as meetingEndedTrigger,F as meetingStartedTrigger,_ as nextFireAt,ue as nextWakeAt,$ as occurrenceKey,v as occurrencesBetween,p as parseCron,K as personJoinedTrigger,P as phraseTrigger,V as questionTrigger,W as saidIn,S as sourceAllowed,g as timerTrigger,Y as topicTrigger,ie as utteranceLooksComplete,A as validateSchedule,Z as voiceCommandTrigger};
1
+ class l extends Error{constructor(t,n){super(n),this.name="ScheduleError",this.code=t}}const B=Object.freeze(["once","interval","daily","weekly","cron"]),C=Object.freeze(["timer","meeting","voice","data","channel"]),D=Object.freeze(["skill","prompt","monitor","notify"]),L=Object.freeze(["skip","runOnce","runAll"]),E=20;function f(e,{days:t=0,hour:n,minute:o=0}){const r=new Date(e);return r.setDate(r.getDate()+t),r.setHours(n,o,0,0),r.getTime()}const I=e=>{const t=new Date(e).getDay();return t===0||t===6};function A(e){if(!e||typeof e!="object")throw new l("BAD_SCHEDULE","schedule must be an object");if(!B.includes(e.kind))throw new l("BAD_SCHEDULE",`unknown schedule kind '${e.kind}'`);if(e.kind==="once"&&!(e.at>0))throw new l("BAD_SCHEDULE","once needs `at`");if(e.kind==="interval"&&!(e.everyMs>=6e4))throw new l("BAD_SCHEDULE","interval needs everyMs >= 60000");if(e.kind==="daily"||e.kind==="weekly"){if(!Number.isInteger(e.hour)||e.hour<0||e.hour>23)throw new l("BAD_SCHEDULE","hour must be 0-23");const t=e.minute??0;if(!Number.isInteger(t)||t<0||t>59)throw new l("BAD_SCHEDULE","minute must be 0-59")}if(e.kind==="weekly"&&(!Number.isInteger(e.weekday)||e.weekday<0||e.weekday>6))throw new l("BAD_SCHEDULE","weekly needs weekday 0-6 (Sunday = 0)");return e.kind==="cron"&&p(e.expr),e}const M=Object.freeze([{name:"minute",min:0,max:59},{name:"hour",min:0,max:23},{name:"day-of-month",min:1,max:31},{name:"month",min:1,max:12,names:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"]},{name:"day-of-week",min:0,max:7,names:["sun","mon","tue","wed","thu","fri","sat"]}]);function w(e,t){const n=e.toLowerCase();if(t.names){const r=t.names.indexOf(n.slice(0,3));if(r>=0&&n.length===3)return t.min===1?r+1:r}if(!/^\d+$/.test(n))throw new l("BAD_SCHEDULE",`cron: '${e}' is not a ${t.name}`);const o=Number(n);if(o<t.min||o>t.max)throw new l("BAD_SCHEDULE",`cron: ${t.name} ${o} is outside ${t.min}-${t.max}`);return o}function N(e,t){const n=new Set;for(const o of String(e).split(",")){if(!o)throw new l("BAD_SCHEDULE",`cron: empty entry in ${t.name}`);const[r,s]=o.split("/"),i=s===void 0?1:Number(s);if(!Number.isInteger(i)||i<1)throw new l("BAD_SCHEDULE",`cron: bad step '/${s}' in ${t.name}`);let c,a;if(r==="*")c=t.min,a=t.max;else if(r.includes("-")){const[u,h]=r.split("-");if(c=w(u,t),a=w(h,t),a<c)throw new l("BAD_SCHEDULE",`cron: range ${r} runs backwards in ${t.name}`)}else c=w(r,t),a=s===void 0?c:t.max;for(let u=c;u<=a;u+=i)n.add(u)}return t.name==="day-of-week"&&n.has(7)&&(n.delete(7),n.add(0)),n}function p(e){const t=String(e??"").trim().split(/\s+/);if(t.length!==5||!t[0])throw new l("BAD_SCHEDULE","cron needs five fields: minute hour day-of-month month day-of-week");const[n,o,r,s,i]=t.map((u,h)=>N(u,M[h])),c=t[2]==="*",a=t[4]==="*";return{minute:n,hour:o,dom:r,month:s,dow:i,domAny:c,dowAny:a}}const H=366*5;function R(e,t){const n=i=>{if(!e.month.has(i.getMonth()+1))return!1;const c=e.dom.has(i.getDate()),a=e.dow.has(i.getDay());return e.domAny&&e.dowAny?!0:e.domAny?a:e.dowAny?c:c||a},o=[...e.hour].sort((i,c)=>i-c),r=[...e.minute].sort((i,c)=>i-c),s=new Date(t);s.setSeconds(0,0);for(let i=0;i<H;i++){const c=new Date(s);if(c.setDate(s.getDate()+i),c.setHours(0,0,0,0),!!n(c))for(const a of o)for(const u of r){const h=new Date(c);if(h.setHours(a,u,0,0),h.getHours()===a&&h.getTime()>t)return h.getTime()}}return null}function _(e,t){const n=A(e),o=n.minute??0;switch(n.kind){case"once":return n.at>t?n.at:null;case"interval":{const r=n.anchor??t;if(r>t)return r;const s=Math.floor((t-r)/n.everyMs)+1;return r+s*n.everyMs}case"daily":{let r=f(t,{hour:n.hour,minute:o});if(r<=t&&(r=f(t,{days:1,hour:n.hour,minute:o})),n.weekdaysOnly)for(let s=0;s<7&&I(r);s++)r=f(r,{days:1,hour:n.hour,minute:o});return r}case"weekly":{const r=new Date(t).getDay();let s=(n.weekday-r+7)%7;return s===0&&f(t,{hour:n.hour,minute:o})<=t&&(s=7),f(t,{days:s,hour:n.hour,minute:o})}case"cron":return R(p(n.expr),t);default:return null}}const v=Object.freeze(["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]),y=e=>`${String(e?.hour??0).padStart(2,"0")}:${String(e?.minute??0).padStart(2,"0")}`;function re(e){if(!e||typeof e!="object")return"";switch(e.kind){case"once":return e.at>0?`once, at ${new Date(e.at).toLocaleString()}`:"";case"interval":{const t=Number(e.everyMs)||0;if(t<6e4)return"";const n=Math.round(t/6e4);if(n%1440===0){const o=n/1440;return`every ${o===1?"day":`${o} days`}`}if(n%60===0){const o=n/60;return`every ${o===1?"hour":`${o} hours`}`}return`every ${n} minutes`}case"daily":return e.weekdaysOnly?`every weekday at ${y(e)}`:`every day at ${y(e)}`;case"weekly":{const t=v[e.weekday];return t?`every ${t} at ${y(e)}`:""}case"cron":{try{p(e.expr)}catch{return""}return`on the cron schedule ${String(e.expr).trim()}`}default:return""}}function U(e,t,n,o=E){const r=[];let s=t;for(;r.length<o;){const i=_(e,s);if(i===null||i>n)break;r.push(i),s=i}return r}function m({id:e,label:t,kind:n,watches:o=[],description:r="",classUsed:s="R",matches:i=null,params:c={}}){if(!e)throw new l("BAD_TRIGGER","trigger.id required");if(!C.includes(n))throw new l("BAD_TRIGGER",`trigger '${e}': unknown kind '${n}'`);if(n!=="timer"&&typeof i!="function")throw new l("BAD_TRIGGER",`trigger '${e}': an event trigger needs matches()`);return Object.freeze({id:e,label:t||e,kind:n,watches:Object.freeze([...o]),description:r,classUsed:s,matches:i,params:Object.freeze({...c})})}function oe(e=[]){const t=[...e];return{add(n){return t.push(n),()=>{const o=t.indexOf(n);o>=0&&t.splice(o,1)}},list:()=>[...t],get:n=>t.find(o=>o.id===n)||null}}const G=e=>String(e||"").toLowerCase().match(/[\p{L}\p{N}']+/gu)||[],d=e=>String(e||"").trim().toLowerCase(),T=3,W=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function x(e,t=120){const n=String(e||"").replace(/\s+/g," ").trim();if(n.length<=t)return n;const o=n.slice(0,t),r=o.lastIndexOf(" ");return`${(r>t*.6?o.slice(0,r):o).replace(/[\s,;:.!?—-]+$/,"")}…`}function j(e,t){const n=d(t);if(n.length<T)return!1;const o=/[\p{L}\p{N}]/u.test(n[0])?"\\b":"",r=/[\p{L}\p{N}]/u.test(n[n.length-1])?"\\b":"";try{return new RegExp(`${o}${W(n)}${r}`,"iu").test(String(e||""))}catch{return d(e).includes(n)}}function b(e,t,n){return e==="me"?!!n?.isSelf?.(t):e==="others"?!n?.isSelf?.(t):!0}const z=Object.freeze(new Set(["and","or","but","so","because","cause","cos","since","although","though","while","whereas","unless","until","if","when","whenever","that","which","who","whom","whose","than","as","like","what","to","of","in","on","at","by","for","from","with","without","about","into","onto","over","under","between","through","during","against","per","a","an","the","my","our","your","their","its","is","are","was","were","be","been","being","am","do","does","did","have","has","had","will","would","can","could","should","shall","may","might","must","um","uh","er"]));function ie(e){const t=String(e||"").trim();if(!t)return!1;if(/[.!?…]["'\u2019\u201d)\]]*$/.test(t))return!0;if(/[,;:\-\u2013\u2014]$/.test(t))return!1;const n=t.toLowerCase().match(/[\p{L}\p{N}']+/gu)||[],o=n[n.length-1];return o?!z.has(o):!0}const J="text.delta",O=Object.freeze(["meeting","note","chat"]),k=Object.freeze(["meeting.transcript.delta",J]);function q(e){if(e?.type==="meeting.transcript.delta")return"meeting";const t=d(e?.source);return O.includes(t)?t:""}function S(e,t){const n=q(t);if(!n)return!1;const o=(Array.isArray(e)?e:[]).map(d).filter(r=>O.includes(r));return o.length?o.includes(n):n==="meeting"}const g=m({id:"timer:schedule",label:"On a schedule",kind:"timer",description:'Once, on an interval, daily, or on a weekday — "every weekday at 8am".'}),F=m({id:"meeting:started",label:"When a meeting starts",kind:"meeting",watches:["meeting.started"],matches:(e,t={})=>t.platform&&d(e.platform)!==d(t.platform)||t.titleIncludes&&!d(e.title).includes(d(t.titleIncludes))?null:{why:`meeting started: ${e.title||e.meetingId}`}}),X=m({id:"meeting:ended",label:"When a meeting ends",kind:"meeting",watches:["meeting.ended"],matches:e=>({why:`meeting ended: ${e.title||e.meetingId}`})}),K=m({id:"meeting:person-joined",label:"When someone joins",kind:"meeting",watches:["meeting.person-joined"],matches:(e,t={})=>{const n=(t.names||[]).map(d).filter(Boolean),o=(e.people||[]).filter(r=>!n.length||n.some(s=>d(r)===s||d(r).startsWith(`${s} `)));return o.length?{why:`joined: ${o.join(", ")}`,people:o}:null}}),P=m({id:"meeting:phrase",label:"When a phrase is said",kind:"meeting",watches:k,matches:(e,t={},n={})=>{if(!S(t.sources,e))return null;const o=(t.any||[]).map(d).filter(r=>r.length>=T);if(!o.length)return null;for(const r of e.segments||[]){if(!b(t.speaker,r.speaker,n))continue;const s=o.find(i=>j(r.text,i)||!!r.en&&j(r.en,i));if(s)return{why:`“${s}” said by ${r.speaker||"someone"}`,segment:r,phrase:s}}return null}}),Y=m({id:"meeting:topic",label:"When someone talks about something",kind:"meeting",watches:k,matches:(e,t={},n={})=>{if(!S(t.sources,e))return null;const o=(t.terms||[]).map(d).filter(Boolean);if(!o.length)return null;const r=Math.max(1,Math.min(t.minHits||1,o.length)),s=(e.segments||[]).filter(a=>b(t.speaker,a.speaker,n)),i=new Set(s.flatMap(a=>G(a.text))),c=o.filter(a=>a.split(/\s+/).every(u=>i.has(u)));return c.length>=r?{why:`talking about ${c.join(", ")}`,terms:c}:null}}),Q=/^(who|what|when|where|why|how|which|whose|can|could|would|should|shall|do|does|did|is|are|was|were|will|have|has|any(one|body)|is there|are there)\b/i,V=m({id:"meeting:question",label:"When a question is asked",kind:"meeting",watches:k,matches:(e,t={},n={})=>{if(!S(t.sources,e))return null;for(const o of e.segments||[]){if(!b(t.speaker||"anyone",o.speaker,n))continue;const r=String(o.en||o.text||"").trim();if(!(r.length<8)&&(r.includes("?")||Q.test(r)))return{why:`question from ${o.speaker||"someone"}: “${x(r,100)}”`,segment:o}}return null}}),Z=m({id:"voice:command",label:"When you say the wake word",kind:"voice",watches:["voice.command"],matches:(e,t={})=>{const n=t.intents||[];return!e.command?.allowed||n.length&&!n.includes(e.command.intent)?null:{why:`you said “${e.command.command}”`,command:e.command}}}),se=Object.freeze([g,F,X,K,P,Y,V,Z]);function ce({id:e,name:t,trigger:n,schedule:o=null,params:r={},action:s,enabled:i=!0,onMissed:c="runOnce",limits:a={},approval:u=null,createdAt:h=0}){if(!e)throw new l("BAD_JOB","job.id required");if(!t)throw new l("BAD_JOB",`job '${e}': name required`);if(!n)throw new l("BAD_JOB",`job '${e}': trigger required`);if(!s||!D.includes(s.kind))throw new l("BAD_JOB",`job '${e}': action.kind must be one of ${D}`);if(s.kind==="skill"&&!s.skillId)throw new l("BAD_JOB",`job '${e}': skill action needs skillId`);if(!L.includes(c))throw new l("BAD_JOB",`job '${e}': unknown onMissed '${c}'`);return(n===g.id||o)&&A(o),{id:e,name:t,trigger:n,schedule:o,params:{...r},action:{...s},enabled:!!i,onMissed:c,limits:{...a},approval:u,createdAt:h||0}}function $(e,t){return`${e}@${t}`}function ae(e,{now:t,lastRun:n={},admit:o=null,max:r=E}={}){const s=[];for(const i of e||[]){if(!i.enabled||i.trigger!==g.id||!i.schedule||o&&!o(i))continue;const c=n[i.id]||i.createdAt||0;if(!c)continue;const a=U(i.schedule,c,t,r);if(!a.length)continue;const u=i.onMissed==="runAll"?a:i.onMissed==="runOnce"?[a[a.length-1]]:[];for(const h of u)s.push({job:i,at:h,key:$(i.id,h),late:t-h>6e4,missedCount:a.length});u.length||s.push({job:i,at:a[a.length-1],key:$(i.id,a[a.length-1]),skipped:!0,missedCount:a.length})}return s}function ue(e,{now:t,lastRun:n={}}={}){let o=null;for(const r of e||[]){if(!r.enabled||r.trigger!==g.id||!r.schedule)continue;const s=_(r.schedule,Math.max(t,n[r.id]||0));s!==null&&(o===null||s<o)&&(o=s)}return o}const ee=8;function te(e=[],{max:t=ee}={}){const n=[];for(const o of e){const r=String(o?.segment?.text||o?.why||"").trim();if(!r)continue;const s=d(o?.segment?.speaker),i=o?.segment?.t||0,c=r.toLowerCase().replace(/\s+/g," "),a=n.findIndex(u=>u.who===s&&(i&&u.t?u.t===i:u.flat.startsWith(c)||c.startsWith(u.flat)));if(a>=0){r.length>n[a].text.length&&(n[a]={...n[a],match:o,text:r,flat:c});continue}n.push({who:s,t:i,match:o,text:r,flat:c})}return n.slice(-Math.max(1,t)).map(o=>o.match)}function ne(e=[]){return te(e,{max:Number.MAX_SAFE_INTEGER}).map(t=>String(t?.segment?.text||t?.why||"").trim()).filter(Boolean)}function le(e=[],{noun:t="matches",max:n=3,chars:o=180}={}){const r=(e||[]).filter(Boolean);if(!r.length)return"";if(r.length===1)return String(r[0].why||"")||x(r[0]?.segment?.text,o);const s=ne(r);if(!s.length)return`${r.length} ${t}`;const i=s.slice(0,n),c=Math.max(40,Math.floor(o/i.length)),a=s.length-i.length;return`${s.length} ${t}: ${i.map(u=>`“${x(u,c)}”`).join(" · ")}`+(a>0?` +${a} more`:"")}function he(e,t,{registry:n,ctx:o={},admit:r=null}={}){const s=[];for(const i of e||[]){if(!i.enabled||r&&!r(i))continue;const c=n?.get(i.trigger);if(!c||c.kind==="timer"||c.watches.length&&!c.watches.includes(t?.type))continue;let a=null;try{a=c.matches(t,i.params,o)}catch{a=null}a&&s.push({job:i,trigger:c,match:a,key:$(i.id,t.at||t.t||0)})}return s}export{se as BUILTIN_TRIGGERS,z as DANGLING_TAILS,ee as DEFAULT_COALESCE_MAX,D as JOB_ACTIONS,T as MIN_PHRASE_CHARS,L as MISSED_POLICIES,B as SCHEDULE_KINDS,l as ScheduleError,J as TEXT_DELTA,k as TEXT_WATCHES,C as TRIGGER_KINDS,O as TRIGGER_SOURCES,v as WEEKDAY_NAMES,x as clipText,te as coalesceMatches,oe as createTriggerRegistry,ce as defineJob,m as defineTrigger,re as describeSchedule,ae as dueJobs,q as eventSource,he as jobsForEvent,le as matchSummary,ne as matchTexts,X as meetingEndedTrigger,F as meetingStartedTrigger,_ as nextFireAt,ue as nextWakeAt,$ as occurrenceKey,U as occurrencesBetween,p as parseCron,K as personJoinedTrigger,P as phraseTrigger,V as questionTrigger,j as saidIn,S as sourceAllowed,g as timerTrigger,Y as topicTrigger,ie as utteranceLooksComplete,A as validateSchedule,Z as voiceCommandTrigger};