@chatpanel/events 0.112.0 → 0.112.1
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/package.json +1 -1
- package/tool-need.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/events",
|
|
3
|
-
"version": "0.112.
|
|
3
|
+
"version": "0.112.1",
|
|
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",
|
package/tool-need.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{signalsFrom as l}from"./router.js";const h=new Set(["hi","hii","hiya","hey","heya","hello","helo","yo","sup","howdy","greetings","good","morning","afternoon","evening","night","day","thanks","thank","thankyou","thx","tnx","ty","cheers","appreciated","ok","okay","k","kk","got","sounds","perfect","great","cool","nice","awesome","lol","haha","hah","hehe","nvm","yep","yeah","yes","no","nope","sure","bye","goodbye","later","ya","cya","ciao","welcome","worries","problem","np","please","there","again","all","everyone","team","friend","mate","buddy","you","u","so","much","very","well","and","a","the"]),u=6;function d(
|
|
2
|
-
`));return d(i)?(
|
|
1
|
+
import{signalsFrom as l}from"./router.js";const h=new Set(["hi","hii","hiya","hey","heya","hello","helo","yo","sup","howdy","greetings","good","morning","afternoon","evening","night","day","thanks","thank","thankyou","thx","tnx","ty","cheers","appreciated","ok","okay","k","kk","got","sounds","perfect","great","cool","nice","awesome","lol","haha","hah","hehe","nvm","yep","yeah","yes","no","nope","sure","bye","goodbye","later","ya","cya","ciao","welcome","worries","problem","np","please","there","again","all","everyone","team","friend","mate","buddy","you","u","so","much","very","well","and","a","the"]),u=6;function d(t){const o=String(t||"").toLowerCase().replace(/[^\p{L}\s']/gu," ").split(/\s+/).filter(Boolean);return!o.length||o.length>u?!1:o.every(r=>h.has(r))}function p({request:t=null,signals:o=null,attachments:r=[],explicit:a=!1}={}){if(a)return{tools:!0,why:"the turn asked for tools"};if((r||[]).some(n=>n&&!n.auto))return{tools:!0,why:"the turn carries an attachment"};const i=String(t?.text??(t?.messages||[]).map(n=>n?.content||"").join(`
|
|
2
|
+
`));return d(i)?(o||l(t||{})).smalltalk?{tools:!1,why:"a greeting — nothing to look up"}:{tools:!0,why:"the request may need something fetched"}:{tools:!0,why:"the request may need something fetched"}}const m=Object.freeze([["web",/\b(search|google|look ?up|latest|current|recent|today|this (week|month|year)|news|price|prices|pricing|cost of|quote|stock|market|website|url|online|web|docs?umentation|release notes|changelog|versions?)\b/i],["history",/\b(our (meeting|call|notes?|chats?|conversation)|what (did|was) (we|i)|we (decided|agreed|discussed|said)|in (my|our) (notes?|meetings?|history|chats?)|past (chats?|meetings?|notes?)|earlier (meeting|conversation|chat|note)|transcript|standup|retro)\b/i],["data",/\b(attached|attachment|this (page|document|file|pdf|spreadsheet|sheet)|the (document|file|pdf|spreadsheet) (above|provided|attached))\b/i]]);function A(t,{held:o=null}={}){const r=String(t||"");if(!r.trim())return[];const a=m.filter(([,e])=>e.test(r)).map(([e])=>e);if(!o)return a;const i=new Set((Array.isArray(o)?o:[]).map(e=>String(e).toLowerCase()));return a.filter(e=>i.has(e)||e==="history"&&i.has("data"))}const g=Object.freeze(["page","data","mcp","memory","note","team","sideline","skills","widgets","recipes"]),f=Object.freeze(["data","mcp","memory"]),b=/\b(this|the|current|open|active|that|my) (page|tab|site|website|article|post|thread|document|doc|file|pdf|sheet|spreadsheet|form|canvas|board|diagram|screen|window|video|table|cell|button|field|link|image)\b|\bon (the|this) (page|screen|tab)\b|\bhere\b|\bthis\b(?!\s+(morning|afternoon|evening|week|weekend|month|year|time|is (a|the|my))\b)|\bthese\b|\bthose\b/i,w=/\b(click|tap|press|type|fill|enter|select|scroll|drag|draw|paint|sketch|navigate|go to|open|close|submit|upload|download|play|pause|screenshot|inspect|read (the|this)|zoom|highlight|copy|paste|log ?in|sign ?in|sign ?up|checkout|add to cart|search (on|in) (the|this)|watch|browse)\b/i,y=/\b(build|make|create|write|generate|draft|code|design|implement|prototype)\b[^.?!]{0,40}\b(app|widget|tool|timer|calculator|tracker|checklist|game|dashboard|form|page|site|script|component|converter|counter|scoreboard|clock|note|dice)\b|\b(widget|app)\b/i,k=/\b(team|teams|agent|agents|project|executive|role|roles|sideline|breakout|skill|skills|recipe|recipes|workflow|remember this|save (this|that) as)\b|^\s*\//i,v=/\b(summar\w*|analy\w*|review|edit|rewrite|fix|refactor|debug|translate|convert|extract|compare|explain (this|that|the)|proofread|format|organi[sz]e|plan)\b/i,S=300;function L({request:t=null,signals:o=null,attachments:r=[],explicit:a=!1,stable:i=!1}={}){const e=c=>({tools:!0,tier:"full",groups:new Set(g),why:c});if(i)return e("a warm process keeps one tool set");const n=p({request:t,signals:o,attachments:r,explicit:a});if(!n.tools)return{tools:!1,tier:"none",groups:new Set,why:n.why};if(a)return e(n.why);if((r||[]).some(c=>c&&!c.auto))return e("the turn carries an attachment");const s=String(t?.text??(t?.messages||[]).map(c=>c?.content||"").join(`
|
|
3
3
|
`));return s.trim()?s.length>S||/```/.test(s)?e("a long or code-bearing request"):b.test(s)?e("the request refers to the page or to something in view"):w.test(s)?e("the request asks to act"):y.test(s)?e("the request asks to make something"):k.test(s)?e("the request names a team, skill, recipe or command"):v.test(s)?e("the request is work, not a lookup"):{tools:!0,tier:"light",groups:new Set(f),why:"a lookup — the user's data and the web are enough"}:e("no text to read")}export{L as equipmentFor,A as grantsNeededFor,p as toolNeedFor};
|