@chatpanel/events 0.20.0 → 0.21.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.
Files changed (3) hide show
  1. package/event.js +6 -1
  2. package/package.json +1 -1
  3. package/schedule.js +6 -1
package/event.js CHANGED
@@ -37,7 +37,12 @@ export const ALL_TYPES = Object.freeze(
37
37
  Object.entries(EVENT_TYPES).flatMap(([fam, kinds]) => kinds.map((k) => `${fam}.${k}`)),
38
38
  );
39
39
 
40
- export const ACTOR_KINDS = Object.freeze(['user', 'rule', 'schedule', 'model', 'agent']);
40
+ // 'channel' is a message arriving from a paired external surface — Telegram, WhatsApp — that
41
+ // drives a turn the same way a person pressing send does. It is turn-independent for the same
42
+ // reason 'schedule' and 'agent' are: nobody is sitting in the panel when it fires, so consent
43
+ // and reach have to be settled at pairing time, not at the keystroke. The actor.id carries the
44
+ // surface and the sender, e.g. 'telegram:8412…'. See chatpanel-channels for the invoker.
45
+ export const ACTOR_KINDS = Object.freeze(['user', 'rule', 'schedule', 'model', 'agent', 'channel']);
41
46
  export const SCOPE_KINDS = Object.freeze(['global', 'site', 'tab', 'session', 'agent']);
42
47
  export const CLASSES = Object.freeze(['R', 'M', 'L', 'C', 'A', 'X', 'H']);
43
48
  export const EFFECTS = Object.freeze(['pure', 'idempotent', 'replay-safe', 'non-replayable']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/events",
3
- "version": "0.20.0",
3
+ "version": "0.21.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",
package/schedule.js CHANGED
@@ -28,7 +28,12 @@ export class ScheduleError extends Error {
28
28
  }
29
29
 
30
30
  export const SCHEDULE_KINDS = Object.freeze(['once', 'interval', 'daily', 'weekly']);
31
- export const TRIGGER_KINDS = Object.freeze(['timer', 'meeting', 'voice', 'data']);
31
+ // 'channel' is the plug-in point for external messaging surfaces (Telegram/WhatsApp). A
32
+ // message arriving in a paired chat is an event like any other, so it can START a job the user
33
+ // already created and approved — "when I text the bot, run my daily brief" — and can do nothing
34
+ // else, exactly like a phrase spoken in a meeting. The trigger definition itself lives in the
35
+ // chatpanel-channels package; this enum is what lets it declare kind:'channel'.
36
+ export const TRIGGER_KINDS = Object.freeze(['timer', 'meeting', 'voice', 'data', 'channel']);
32
37
  /** What a job does when it fires. `skill` is the headline: the instruction IS a skill. */
33
38
  export const JOB_ACTIONS = Object.freeze(['skill', 'prompt', 'monitor', 'notify']);
34
39
  /** What to do about occurrences that passed while nothing was running. */