@cmodjs/core 5.5.1 → 5.5.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmodjs/core",
3
- "version": "5.5.1",
3
+ "version": "5.5.4",
4
4
  "description": "Build Claude Code mods: hooks, panes, checks, and an install that just works.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/records.d.ts CHANGED
@@ -131,7 +131,7 @@ export declare function newestLog(entries: readonly LogEntry[]): LogEntry[];
131
131
  export declare function versionsLine({ mod, core, cmod, program, claudeCode }: LogVersions): string;
132
132
  export declare function logReport(entry: LogEntry): string;
133
133
  export declare function parseConsent(value: unknown, path: string): Record<string, string[]>;
134
- export declare const coreVersion = "5.5.1";
134
+ export declare const coreVersion = "5.5.4";
135
135
  export declare const oldestCmodVersion = "5.4.0";
136
136
  export declare function hotkeyCommand(mod: string, hotkey: string): string;
137
137
  export declare function hotkeyBindings(mod: string, hotkeys: Hotkeys | undefined): Record<string, string>;
package/records.js CHANGED
@@ -296,7 +296,7 @@ function readHotkeys(hotkeys) {
296
296
  throw new Error(`package.json "cmod.hotkeys" is not a map of hotkeys to their title and optional default combo. ${fix}`);
297
297
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys) };
298
298
  }
299
- export const coreVersion = '5.5.1';
299
+ export const coreVersion = '5.5.4';
300
300
  export const oldestCmodVersion = '5.4.0';
301
301
  export function hotkeyCommand(mod, hotkey) {
302
302
  return `${mod}--${hotkey}`;
@@ -1 +1 @@
1
- {"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../src/runtime/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAK5D,OAAO,EAA0L,KAAK,QAAQ,EAAmB,MAAM,4BAA4B,CAAA;AAUnQ,OAAO,KAAK,EAAE,MAAM,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7 @@ export function serveConversations({ claude, router, store, project, report, cle
42
42
  let published = new Set();
43
43
  let publishing = Promise.resolve();
44
44
  let session = '';
45
+ const left = new Set();
45
46
  let asks = 0;
46
47
  let conversation = createConversation(emptyConversation(''));
47
48
  let starting = Promise.resolve();
@@ -222,8 +223,11 @@ export function serveConversations({ claude, router, store, project, report, cle
222
223
  const targets = new Set([...published, ...list.map((watch) => watch.target)]);
223
224
  published = new Set(list.map((watch) => watch.target));
224
225
  const running = targets.has(everySession) ? (await json(['history', 'sessions', '--running'])).map((each) => each.id) : [];
225
- const told = new Set([...running, ...targets].filter((id) => id !== everySession && id !== session));
226
- await Promise.all([...told].map((id) => post(id, { kind: 'watch' }).catch((error) => claude.ui.warn('before:tell', `cmod: session ${id} did not hear of a before listener: ${messageOf(error)}`))));
226
+ const told = new Set([...running, ...targets].filter((id) => id !== everySession && id !== session && !left.has(id)));
227
+ await Promise.all([...told].map((id) => post(id, { kind: 'watch' }).catch((error) => {
228
+ if (messageOf(error) !== ended(id).message)
229
+ claude.ui.warn('before:tell', `cmod: session ${id} did not hear of a before listener: ${messageOf(error)}`);
230
+ })));
227
231
  };
228
232
  const hear = (caller, id, list) => {
229
233
  const sessions = heard.get(caller) ?? new Map();
@@ -272,6 +276,8 @@ export function serveConversations({ claude, router, store, project, report, cle
272
276
  const found = [];
273
277
  for (const [index, file] of files.entries()) {
274
278
  const from = file.name.replace(/\.json$/, '');
279
+ if (left.has(from))
280
+ continue;
275
281
  const text = texts[index] ?? noWatches;
276
282
  let list;
277
283
  try {
@@ -394,6 +400,9 @@ export function serveConversations({ claude, router, store, project, report, cle
394
400
  if (id === session)
395
401
  return;
396
402
  const previous = session;
403
+ if (previous !== '')
404
+ left.add(previous);
405
+ left.delete(id);
397
406
  session = id;
398
407
  live = [];
399
408
  liveIds.clear();
package/src/records.ts CHANGED
@@ -361,7 +361,7 @@ function readHotkeys(hotkeys: unknown): Steps {
361
361
  return { hotkeys: checkHotkeys('package.json "cmod"', hotkeys as Record<string, HotkeyInit>) }
362
362
  }
363
363
 
364
- export const coreVersion = '5.5.1'
364
+ export const coreVersion = '5.5.4'
365
365
 
366
366
  export const oldestCmodVersion = '5.4.0'
367
367
 
@@ -101,6 +101,7 @@ export function serveConversations({
101
101
  let published = new Set<string>()
102
102
  let publishing: Promise<unknown> = Promise.resolve()
103
103
  let session = ''
104
+ const left = new Set<string>()
104
105
  let asks = 0
105
106
  let conversation: Conversation = createConversation(emptyConversation(''))
106
107
  let starting: Promise<void> = Promise.resolve()
@@ -276,8 +277,14 @@ export function serveConversations({
276
277
  const targets = new Set([...published, ...list.map((watch) => watch.target)])
277
278
  published = new Set(list.map((watch) => watch.target))
278
279
  const running = targets.has(everySession) ? (await json<SessionData[]>(['history', 'sessions', '--running'])).map((each) => each.id) : []
279
- const told = new Set([...running, ...targets].filter((id) => id !== everySession && id !== session))
280
- await Promise.all([...told].map((id) => post(id, { kind: 'watch' }).catch((error: unknown) => claude.ui.warn('before:tell', `cmod: session ${id} did not hear of a before listener: ${messageOf(error)}`))))
280
+ const told = new Set([...running, ...targets].filter((id) => id !== everySession && id !== session && !left.has(id)))
281
+ await Promise.all(
282
+ [...told].map((id) =>
283
+ post(id, { kind: 'watch' }).catch((error: unknown) => {
284
+ if (messageOf(error) !== ended(id).message) claude.ui.warn('before:tell', `cmod: session ${id} did not hear of a before listener: ${messageOf(error)}`)
285
+ }),
286
+ ),
287
+ )
281
288
  }
282
289
 
283
290
  const hear = (caller: string, id: string, list: readonly Listened[]) => {
@@ -329,6 +336,7 @@ export function serveConversations({
329
336
  const found: Watcher[] = []
330
337
  for (const [index, file] of files.entries()) {
331
338
  const from = file.name.replace(/\.json$/, '')
339
+ if (left.has(from)) continue
332
340
  const text = texts[index] ?? noWatches
333
341
  let list: readonly Watch[]
334
342
  try {
@@ -456,6 +464,8 @@ export function serveConversations({
456
464
  const start = (id: string, source: string) => {
457
465
  if (id === session) return
458
466
  const previous = session
467
+ if (previous !== '') left.add(previous)
468
+ left.delete(id)
459
469
  session = id
460
470
  live = []
461
471
  liveIds.clear()