@ycodium-ai/plugin-session-import 0.2.2544 → 0.2.2566

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 (2) hide show
  1. package/dist/index.js +12 -12
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -171,7 +171,7 @@ import * as NodeProcess2 from "node:process";
171
171
  import * as NodePath from "node:path";
172
172
  import * as NodeProcess from "node:process";
173
173
 
174
- // src/jsonlStream.ts
174
+ // ../../packages/ycodium-jsonl-stream/src/jsonlStream.ts
175
175
  var DEFAULT_MAX_RETAINED_CHARS = 8e6;
176
176
  var MAX_DEPTH = 128;
177
177
  var MAX_KEY_CHARS = 256;
@@ -591,6 +591,15 @@ function matchesPrefix(pattern, path, length) {
591
591
  }
592
592
  return true;
593
593
  }
594
+ function jsonlEntryRecord(entry, accepts) {
595
+ if ("oversized" in entry) return entry.oversized;
596
+ if (!accepts(entry.line)) return void 0;
597
+ try {
598
+ return JSON.parse(entry.line);
599
+ } catch {
600
+ return void 0;
601
+ }
602
+ }
594
603
  async function* readJsonlEntries(fs, path, options) {
595
604
  const decoder = new TextDecoder("utf-8");
596
605
  let pieces = [];
@@ -722,15 +731,6 @@ var TRANSCRIPT_FIELDS = [
722
731
  maxChars: TOOL_TEXT_KEEP_CHARS
723
732
  }
724
733
  ];
725
- function entryRecord(entry, accepts) {
726
- if ("oversized" in entry) return entry.oversized;
727
- if (!accepts(entry.line)) return void 0;
728
- try {
729
- return JSON.parse(entry.line);
730
- } catch {
731
- return void 0;
732
- }
733
- }
734
734
  var TRANSCRIPT_SUFFIX = ".jsonl";
735
735
  function truncate(value) {
736
736
  const trimmed = value?.trim() ?? "";
@@ -764,7 +764,7 @@ async function readClaudeTranscriptDigest(fs, filePath) {
764
764
  fields: DIGEST_FIELDS
765
765
  });
766
766
  for await (const entry of entries) {
767
- const record3 = entryRecord(entry, (line) => {
767
+ const record3 = jsonlEntryRecord(entry, (line) => {
768
768
  const isUser = line.includes('"type":"user"');
769
769
  const wantsAssistant = model === null && line.includes('"type":"assistant"');
770
770
  const isTitle = line.includes('"custom-title"') || line.includes('"ai-title"');
@@ -913,7 +913,7 @@ async function readClaudeSessionRecords(input) {
913
913
  fields: TRANSCRIPT_FIELDS
914
914
  });
915
915
  for await (const entry of entries) {
916
- const record3 = entryRecord(
916
+ const record3 = jsonlEntryRecord(
917
917
  entry,
918
918
  (line) => line.includes('"type":"user"') || line.includes('"type":"assistant"')
919
919
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-session-import",
3
- "version": "0.2.2544",
3
+ "version": "0.2.2566",
4
4
  "description": "Brings a session you started in a terminal into Ycodium.",
5
5
  "keywords": [
6
6
  "session-import",
@@ -20,7 +20,8 @@
20
20
  "effect": "4.0.0-beta.103",
21
21
  "esbuild": "0.28.1",
22
22
  "vite-plus": "0.2.2",
23
- "@ycodium-ai/plugin-api": "0.2.2544"
23
+ "ycodium-jsonl-stream": "0.0.0",
24
+ "@ycodium-ai/plugin-api": "0.2.2566"
24
25
  },
25
26
  "ycodium": {
26
27
  "plugin": "./dist/index.js",