sessioner 0.1.3 → 0.1.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/README.md CHANGED
@@ -173,8 +173,6 @@ sessioner
173
173
 
174
174
  ## ⌨️ Navigation
175
175
 
176
- ---
177
-
178
176
  ### Main Menu
179
177
 
180
178
  - <kbd>Up</kbd> / <kbd>Down</kbd>: move cursor
@@ -88,11 +88,7 @@ const copySubagents = async (sourceSessions, targetDir) => {
88
88
  };
89
89
  export const merge = async (sessions, title) => {
90
90
  const sorted = [...sessions].sort((first, second) => first.date.localeCompare(second.date));
91
- const contents = [];
92
- for (const session of sorted) {
93
- const raw = await readFile(session.file, 'utf-8');
94
- contents.push(raw);
95
- }
91
+ const contents = await Promise.all(sorted.map((session) => readFile(session.file, 'utf-8')));
96
92
  const first = sorted[0];
97
93
  if (!first)
98
94
  return { id: '', date: '', message: title, file: '' };
@@ -17,20 +17,12 @@ const stripTagsFromText = (text) => {
17
17
  }
18
18
  return result;
19
19
  };
20
- const stripSystemTags = (blocks) => {
21
- const result = [];
22
- for (const block of blocks) {
23
- if (block.type !== 'text' || !block.text) {
24
- result.push(block);
25
- continue;
26
- }
27
- const stripped = stripTagsFromText(block.text).trim();
28
- if (!stripped)
29
- continue;
30
- result.push({ ...block, text: stripped });
31
- }
32
- return result;
33
- };
20
+ const stripSystemTags = (blocks) => blocks.flatMap((block) => {
21
+ if (block.type !== 'text' || !block.text)
22
+ return [block];
23
+ const stripped = stripTagsFromText(block.text).trim();
24
+ return stripped ? [{ ...block, text: stripped }] : [];
25
+ });
34
26
  const filterContent = (content, options) => {
35
27
  let filtered = content;
36
28
  if (options.toolBlocks) {
package/lib/ui/search.js CHANGED
@@ -38,15 +38,7 @@ const highlightMatch = (value, query) => {
38
38
  const pattern = new RegExp(escapeRegExp(query), 'gi');
39
39
  return value.replace(pattern, (match) => colorize(match, MATCH_COLOR));
40
40
  };
41
- const flattenMatches = (results) => {
42
- const entries = [];
43
- for (const result of results) {
44
- for (const line of result.entries) {
45
- entries.push({ session: result.session, text: line });
46
- }
47
- }
48
- return entries;
49
- };
41
+ const flattenMatches = (results) => results.flatMap((result) => result.entries.map((text) => ({ session: result.session, text })));
50
42
  export const selectSearchResult = async (results, query, fields) => {
51
43
  const entries = flattenMatches(results);
52
44
  let page = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sessioner",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "✨ An interactive CLI to navigate and manage Claude Code sessions from the terminal.",
5
5
  "type": "module",
6
6
  "license": "MIT",