@chatpanel/events 0.447.3 → 0.449.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/entitlement.js +1 -1
- package/meeting-followup.js +26 -0
- package/package.json +3 -1
package/entitlement.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class S extends Error{constructor(t){super(t),this.name="EntitlementError"}}const m=Object.freeze(["free","pro","team"]),
|
|
1
|
+
class S extends Error{constructor(t){super(t),this.name="EntitlementError"}}const m=Object.freeze(["free","pro","team"]),u=Object.freeze({free:0,pro:1,team:2}),l="https://api.chatpanel.net",C=Object.freeze({verify:`${l}/license/verify`,entitlement:`${l}/entitlement`,claim:`${l}/entitlement/claim`,entitlementChallenge:`${l}/entitlement/challenge`,release:`${l}/entitlement/release`,restore:`${l}/restore`,appStore:`${l}/appstore/transaction`}),h=Object.freeze({kty:"EC",crv:"P-256",x:"CmgKLC4e3xDMvwhbjVqF7jbDe1JhC1KKQi8JN3qVX_4",y:"r40l6fQiyCcJYqW-SvB4VoSyn4F36yhSt82ZAOSo78E"}),O="https://chatpanel.net/#pricing";function _(e="pro",t="",n=""){const r=new URL("https://chatpanel.net/");return t&&r.searchParams.set("install_id",t),e&&r.searchParams.set("plan",e),n&&r.searchParams.set("client",n),r.hash="pricing",r.toString()}const y=Object.freeze({localAgents:"free",byoModels:"free",urlContext:"free",liveMeetings:"free",multiTab:"pro",unlimitedAgents:"pro",customSkills:"pro",customAgents:"pro",advancedAgent:"pro",unlimitedNotes:"pro",unlimitedMeetings:"pro",structuredInsert:"pro",exportChats:"pro",autoBackup:"pro",promptLibrary:"pro",fileAttachments:"pro",watch:"pro",link:"pro",unlimitedPoolAgents:"pro",unlimitedTeams:"pro",unlimitedTeamRuns:"pro",unlimitedProjects:"pro",unlimitedBoardPosts:"pro",fullObservability:"pro",unlimitedRecipes:"pro",unlimitedSkills:"pro",unlimitedWidgets:"pro",unlimitedMcpTools:"pro",cloudSync:"team",sharedLibrary:"team",hostedBridge:"team",sso:"team"}),R=Object.freeze({unlimitedNotes:"Unlimited notes — Free keeps your first 10",unlimitedMeetings:"Unlimited meetings — Free keeps your first 10",multiTab:"Attach several tabs at once",unlimitedAgents:"Unlimited custom agents",customSkills:"Create & edit your own skills",advancedAgent:"Per-agent system prompts & working directories",structuredInsert:"Clean diagrams on Excalidraw, draw.io & tldraw — shapes placed as data, not pixel-drawn",exportChats:"Export conversations as Markdown",autoBackup:"Automatic daily backup of all your data to disk",watch:"Watch a page & act on changes — the agent reacts as the page updates",link:"ChatPanel Link — your phone reaches your computer's agents and models, and both keep the same chats, notes and meetings",unlimitedPoolAgents:"Unlimited agents in your roster — Free keeps 2 of your own",unlimitedTeams:"Unlimited agent teams and runs — Free keeps 1 team, 3 runs a day",unlimitedProjects:"Unlimited projects — Free keeps 1",fullObservability:"The whole run history in Observe — Free sees the last 24 hours",unlimitedRecipes:"Unlimited saved recipes — Free keeps 2",unlimitedSkills:"Unlimited skills — Free uses 3 at a time",unlimitedWidgets:"Unlimited widgets — Free keeps 3",unlimitedMcpTools:"Unlimited MCP tools — Free enables 10"}),U=Object.freeze({cloudSync:"Sync chats across your devices",sharedLibrary:"Shared team agents & skills",hostedBridge:"Hosted agents — no local bridge to run",sso:"SSO & admin controls"}),p=Object.freeze({notes:10,meetings:10,apiEndpoints:1,bridgeAgents:1,customAgents:1,attachmentsPerMessage:1,mcpServers:1,gatewayDestinations:1,webSearchEngines:3,webSearchesPerDay:50,fullRedactions:25,poolAgents:2,teams:1,teamRunsPerDay:3,projects:1,boardPostsPerDay:10,observeDays:1,recipes:2,skills:3,widgets:3,mcpTools:10}),g=Object.freeze({unlimitedAgents:"customAgents",customSkills:"skills",unlimitedPoolAgents:"poolAgents",unlimitedTeams:"teams",unlimitedTeamRuns:"teamRunsPerDay",unlimitedProjects:"projects",unlimitedBoardPosts:"boardPostsPerDay",unlimitedRecipes:"recipes",unlimitedSkills:"skills",unlimitedWidgets:"widgets",unlimitedMcpTools:"mcpTools"});function c(e,t=Date.now()){return!e||!m.includes(e.plan)||e.expiresAt&&t>e.expiresAt?"free":e.plan}function x(e,t=Date.now()){return{free:"Free",pro:"Pro",team:"Team"}[c(e,t)]}function b(e,t=Date.now()){return u[c(e,t)]>=u.pro}function j(e,t=Date.now()){return c(e,t)==="team"}function F(e,t,n=0,r=Date.now()){const i=c(e,r),o=g[t];if(o&&u[i]<u.pro)return n<p[o];const a=y[t]||"free";return u[i]>=u[a]}function M(e){const t=g[e];return t?p[t]:null}function N(e,t=Date.now()){return b(e,t)?0:t-p.observeDays*864e5}function L(e){return y[e]||"free"}function B(e,t,n,r=Date.now()){if(b(e,r))return!0;const i=p[t];return typeof i!="number"||n<i}function d(e){const t="=".repeat((4-String(e).length%4)%4),n=String(e).replace(/-/g,"+").replace(/_/g,"/")+t;if(typeof Buffer<"u")return new Uint8Array(Buffer.from(n,"base64"));const r=atob(n),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i}function A(e){try{return JSON.parse(new TextDecoder().decode(d(e)))}catch{return null}}let f=null;async function E(e){const t=e||globalThis.crypto?.subtle;if(!t)throw new S("no WebCrypto available on this runtime");return e?t.importKey("jwk",h,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]):(f||(f=t.importKey("jwk",h,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])),f)}const T="ent";async function K(e,{typ:t=null,subtle:n=null,now:r=Date.now()}={}){if(!e||typeof e!="string"||e.indexOf(".")<0)return null;const[i,o]=e.split(".");if(!i||!o)return null;let a=!1;try{a=await(n||globalThis.crypto?.subtle).verify({name:"ECDSA",hash:"SHA-256"},await E(n),d(o),new TextEncoder().encode(i))}catch{return null}if(!a)return null;const s=A(i);return!s||t&&s.typ!==t||s.exp&&r>Number(s.exp)?null:s}async function P(e,t,{subtle:n=null,now:r=Date.now()}={}){if(!e||typeof e!="string"||e.indexOf(".")<0)return null;const[i,o]=e.split(".");if(!i||!o)return null;let a=!1;try{a=await(n||globalThis.crypto?.subtle).verify({name:"ECDSA",hash:"SHA-256"},await E(n),d(o),new TextEncoder().encode(i))}catch{return null}if(!a)return null;const s=A(i);return!s||s.typ!==T||s.exp&&r>Number(s.exp)||!s.install_id||t&&s.install_id!==t||!m.includes(s.plan)?null:s}function D(e,{at:t=Date.now(),expiresAt:n=0}={}){return e?{plan:e.plan,trial:!!e.trial,expiresAt:Number(n)||0,tokenExp:Number(e.exp)||0,installId:e.install_id||"",sub:e.sub||null,checkedAt:t,source:"entitlement"}:{plan:"free"}}const v=720*60*1e3;function z(e,{now:t=Date.now(),interval:n=v}={}){if(!e||!e.checkedAt||t-e.checkedAt>n)return!0;const r=1440*60*1e3;return!!(e.expiresAt&&e.expiresAt-t<r||e.tokenExp&&e.tokenExp-t<r)}async function I(e,{installId:t="",token:n="",subtle:r=null,now:i=Date.now()}={}){const o={plan:"free",status:"inactive"};if(!e||typeof e!="object")return o;if(!m.includes(e.plan)||e.plan==="free")return{...e,plan:"free"};const a=await P(n||e.token||"",t,{subtle:r,now:i});return a?{...e,...D(a,{at:e.checkedAt||i,expiresAt:e.expiresAt||0})}:{...o,status:"lapsed",source:e.source||""}}function w(e,t=Date.now()){return!!(e&&e.trial)&&c(e,t)!=="free"}function $(e,t=Date.now()){return w(e,t)?`${x(e,t)} trial`:x(e,t)}function W(e,t=Date.now()){return!w(e,t)||!e.expiresAt?null:Math.max(0,Math.ceil((e.expiresAt-t)/864e5))}export{l as API_BASE,g as COUNTED,C as ENDPOINTS,h as ENTITLEMENT_PUBLIC_JWK,S as EntitlementError,y as FEATURE_TIER,p as FREE_LIMITS,m as PLANS,R as PRO_FEATURES,v as RECHECK_INTERVAL_MS,U as TEAM_FEATURES,T as TOKEN_TYPE,O as UPGRADE_URL,F as can,_ as checkoutUrl,M as freeCap,b as isPro,j as isTeam,w as isTrial,D as licenseFromPayload,z as needsRecheck,N as observeSince,$ as planBadge,x as planLabel,c as planOf,L as tierFor,W as trialDaysLeft,I as trustedLicense,P as verifyEntitlement,K as verifySignedToken,B as withinFreeLimit};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{defineSchema as $,describeSchema as x,parseStructured as E}from"./structured.js";const y=Object.freeze(["none","add_section","replace_section"]),f=$({name:"meeting_followup",purpose:"the answer to a question about a meeting, and the change to its notes when one was asked for",fields:{reply:{type:"string",required:!0,max:2e3,describe:"what to say back to the person: the answer, or one line saying what was changed in the notes"},edit:{type:"enum",values:y,required:!0,describe:"add_section or replace_section ONLY when the person asked to add to, change, update or fix the notes; none for a question"},heading:{type:"string",max:80,describe:"the section heading to add or replace, short; empty when edit is none"},body:{type:"string",max:4e3,describe:"the section content in markdown (bullets welcome), without the heading; empty when edit is none"}}}),O=4,_=2e4,k=8e3;function N({transcript:o="",notes:e="",history:t=[],question:a=""}={}){const i=(Array.isArray(t)?t:[]).slice(-O).map(r=>`Q: ${r.question}
|
|
2
|
+
A: ${r.reply}`).join(`
|
|
3
|
+
|
|
4
|
+
`),n=["You help with one meeting: you answer questions about it and keep its notes up to date.","Answer from the transcript and the notes. When they do not say, say so rather than guess.","When the person asks to add something to the notes, change, update or fix them, put it in a section: add_section with a new heading, or replace_section with the heading of the section to rewrite. The section body holds the content, in markdown.","When the person only asks a question, edit is none.",x(f)].join(`
|
|
5
|
+
`),d=[`TRANSCRIPT:
|
|
6
|
+
${String(o).slice(-_)}`,`NOTES:
|
|
7
|
+
${String(e||"(none yet)").slice(0,k)}`,i?`EARLIER QUESTIONS:
|
|
8
|
+
${i}`:"",`THE PERSON NOW SAYS: ${a}`].filter(Boolean).join(`
|
|
9
|
+
|
|
10
|
+
`);return{system:n,user:d,maxTokens:1200}}function R(o){const e=E(o,f);if(!e||typeof e.reply!="string")return{reply:String(o||"").trim(),edit:"none",heading:"",body:""};const t=y.includes(e.edit)?e.edit:"none",a=String(e.heading||"").replace(/^#+\s*/,"").trim(),i=String(e.body||"").trim();return t!=="none"&&(!a||!i)?{reply:e.reply.trim(),edit:"none",heading:"",body:""}:{reply:e.reply.trim(),edit:t,heading:a,body:i}}const w=/^(#{1,6})\s+(.+?)\s*#*\s*$/,S=o=>String(o||"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim();function A(o="",{edit:e="none",heading:t="",body:a=""}={}){const i=String(o||"");if(e==="none"||!t||!a)return i;const n=i.split(`
|
|
11
|
+
`),d=S(t);let r=-1,h=2;for(let s=0;s<n.length;s++){const c=w.exec(n[s]);if(c&&S(c[2])===d){r=s,h=c[1].length;break}}const l=String(a).trim();if(r<0)return`${i.trimEnd()}${i.trim()?`
|
|
12
|
+
|
|
13
|
+
`:""}## ${t}
|
|
14
|
+
|
|
15
|
+
${l}
|
|
16
|
+
`;let p=n.length;for(let s=r+1;s<n.length;s++){const c=w.exec(n[s]);if(c&&c[1].length<=h){p=s;break}}const u=e==="add_section"?n.slice(r+1,p).join(`
|
|
17
|
+
`).trim():"",b=`${n[r]}
|
|
18
|
+
|
|
19
|
+
${u?`${u}
|
|
20
|
+
|
|
21
|
+
`:""}${l}
|
|
22
|
+
`,g=n.slice(0,r).join(`
|
|
23
|
+
`),m=n.slice(p).join(`
|
|
24
|
+
`);return`${g}${g?`
|
|
25
|
+
`:""}${b}${m?`
|
|
26
|
+
${m}`:""}`}function L({question:o="",result:e={},at:t=0}={}){return{at:Number(t)||0,question:String(o).trim(),reply:String(e.reply||"").trim(),...e.edit&&e.edit!=="none"?{edit:e.edit,heading:e.heading}:{}}}export{y as FOLLOWUP_EDITS,O as FOLLOWUP_HISTORY,f as MEETING_FOLLOWUP_SCHEMA,A as applyNotesEdit,L as followupEntry,N as followupPrompt,R as followupResult};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/events",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.449.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",
|
|
@@ -128,6 +128,7 @@
|
|
|
128
128
|
"./media-transcript.js": "./media-transcript.js",
|
|
129
129
|
"./meeting-analyzers.js": "./meeting-analyzers.js",
|
|
130
130
|
"./meeting-insights.js": "./meeting-insights.js",
|
|
131
|
+
"./meeting-followup.js": "./meeting-followup.js",
|
|
131
132
|
"./meeting-insight-prompts.js": "./meeting-insight-prompts.js",
|
|
132
133
|
"./meeting-shape.js": "./meeting-shape.js",
|
|
133
134
|
"./meeting-speakers.js": "./meeting-speakers.js",
|
|
@@ -489,6 +490,7 @@
|
|
|
489
490
|
"media-transcript.js",
|
|
490
491
|
"meeting-analyzers.js",
|
|
491
492
|
"meeting-insights.js",
|
|
493
|
+
"meeting-followup.js",
|
|
492
494
|
"meeting-insight-prompts.js",
|
|
493
495
|
"meeting-shape.js",
|
|
494
496
|
"meeting-speakers.js",
|