agentel 0.2.2 → 0.2.3

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
@@ -41,7 +41,7 @@ ref for repeatable installs:
41
41
  ```sh
42
42
  npm install -g brianlzhou/agentlog
43
43
  # or
44
- npm install -g brianlzhou/agentlog#v0.2.2
44
+ npm install -g brianlzhou/agentlog#v0.2.3
45
45
  agentlog init
46
46
  ```
47
47
 
@@ -183,30 +183,30 @@ package-prefixed scheme.
183
183
 
184
184
  | Source type | Version |
185
185
  | --- | --- |
186
- | `codex-cli-history` | `0.2.2.0` |
187
- | `codex-desktop-history` | `0.2.2.0` |
188
- | `cli-history` | `0.2.2.0` |
189
- | `claude-sdk-history` | `0.2.2.0` |
190
- | `claude-code-desktop-metadata` | `0.2.2.0` |
191
- | `claude-workspace-desktop` | `0.2.2.0` |
192
- | `cursor-workspace-sqlite` | `0.2.2.0` |
193
- | `cursor-global-sqlite` | `0.2.2.0` |
194
- | `cursor-raw-sqlite-salvage` | `0.2.2.0` |
195
- | `cursor-agent-transcripts` | `0.2.2.0` |
196
- | `devin-cli-history` | `0.2.2.0` |
197
- | `gemini-cli-history` | `0.2.2.0` |
198
- | `cline-task-history` | `0.2.2.0` |
199
- | `opencode-history` | `0.2.2.0` |
200
- | `opencode-sqlite-history` | `0.2.2.0` |
201
- | `aider-chat-history` | `0.2.2.0` |
202
- | `antigravity-history` | `0.2.2.0` |
203
- | `antigravity-trajectory-summary` | `0.2.2.0` |
204
- | `windsurf-trajectory-export` | `0.2.2.0` |
205
- | `web-chat-export` | `0.2.2.0` |
206
- | `chatgpt-export` | `0.2.2.0` |
207
- | `claude-web-export` | `0.2.2.0` |
208
- | `claude-web-memory` | `0.2.2.0` |
209
- | `import` | `0.2.2.0` |
186
+ | `codex-cli-history` | `0.2.3.0` |
187
+ | `codex-desktop-history` | `0.2.3.0` |
188
+ | `cli-history` | `0.2.3.0` |
189
+ | `claude-sdk-history` | `0.2.3.0` |
190
+ | `claude-code-desktop-metadata` | `0.2.3.0` |
191
+ | `claude-workspace-desktop` | `0.2.3.0` |
192
+ | `cursor-workspace-sqlite` | `0.2.3.0` |
193
+ | `cursor-global-sqlite` | `0.2.3.0` |
194
+ | `cursor-raw-sqlite-salvage` | `0.2.3.0` |
195
+ | `cursor-agent-transcripts` | `0.2.3.0` |
196
+ | `devin-cli-history` | `0.2.3.0` |
197
+ | `gemini-cli-history` | `0.2.3.0` |
198
+ | `cline-task-history` | `0.2.3.0` |
199
+ | `opencode-history` | `0.2.3.0` |
200
+ | `opencode-sqlite-history` | `0.2.3.0` |
201
+ | `aider-chat-history` | `0.2.3.0` |
202
+ | `antigravity-history` | `0.2.3.0` |
203
+ | `antigravity-trajectory-summary` | `0.2.3.0` |
204
+ | `windsurf-trajectory-export` | `0.2.3.0` |
205
+ | `web-chat-export` | `0.2.3.0` |
206
+ | `chatgpt-export` | `0.2.3.0` |
207
+ | `claude-web-export` | `0.2.3.0` |
208
+ | `claude-web-memory` | `0.2.3.0` |
209
+ | `import` | `0.2.3.0` |
210
210
 
211
211
  `cursor-sqlite-history` and `antigravity-brain` are compatibility aliases for
212
212
  older labels. Fingerprints include the parser version prefix, so changing the
package/docs/release.md CHANGED
@@ -65,5 +65,5 @@ After tagging and pushing the release, sanity-check both public install forms:
65
65
 
66
66
  ```sh
67
67
  npm install -g agentel
68
- npm install -g brianlzhou/agentlog#v0.2.2
68
+ npm install -g brianlzhou/agentlog#v0.2.3
69
69
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentel",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Local-first archive and recall layer for agent coding sessions.",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
package/src/archive.js CHANGED
@@ -138,7 +138,8 @@ function writeSession(input, env = process.env) {
138
138
  "conversationKind",
139
139
  "pinned",
140
140
  "timeStatus",
141
- "composerId"
141
+ "composerId",
142
+ "parentComposerId"
142
143
  ]) {
143
144
  if (input[key] !== undefined) session[key] = input[key];
144
145
  }
package/src/importers.js CHANGED
@@ -455,6 +455,7 @@ function importCursorProvider(provider, since, options = {}, env = process.env)
455
455
  sourceType,
456
456
  title: session.title,
457
457
  composerId: cursorSessionComposerId(session) || undefined,
458
+ parentComposerId: session.parentComposerId || undefined,
458
459
  sharedRawFiles: cursorSessionUsesSharedRawFiles(sourceType),
459
460
  replaceSourcePathCopies: sourceType === "cursor-agent-transcripts"
460
461
  },
@@ -2967,6 +2968,26 @@ function sqliteTableExists(dbPath, tableName) {
2967
2968
  }
2968
2969
  }
2969
2970
 
2971
+ function sqliteTableColumns(dbPath, tableName) {
2972
+ try {
2973
+ return new Set(
2974
+ readSqliteJson(dbPath, `select name from pragma_table_info(${sqlQuote(tableName)})`, `${tableName} column check`)
2975
+ .map((row) => String(row.name || ""))
2976
+ .filter(Boolean)
2977
+ );
2978
+ } catch {
2979
+ return new Set();
2980
+ }
2981
+ }
2982
+
2983
+ function sqliteSelectMaybe(columns, tableAlias, columnName, outputName = columnName) {
2984
+ if (columns.has(columnName)) {
2985
+ const value = `${tableAlias}.${columnName}`;
2986
+ return outputName === columnName ? value : `${value} as ${outputName}`;
2987
+ }
2988
+ return `null as ${outputName}`;
2989
+ }
2990
+
2970
2991
  function codexStateDb(env = process.env) {
2971
2992
  return env.CODEX_STATE_DB || path.join(codexHome(env), "state_5.sqlite");
2972
2993
  }
@@ -6689,34 +6710,71 @@ function readOpenCodeSqliteSessionsFromDb(dbPath) {
6689
6710
  }
6690
6711
 
6691
6712
  function readOpenCodeSqliteSessionRows(dbPath) {
6692
- return readSqliteJson(
6693
- dbPath,
6694
- [
6695
- "select s.id, s.project_id, s.parent_id, s.slug, s.directory, s.title, s.version,",
6696
- "s.share_url, s.time_created, s.time_updated, s.time_archived, s.workspace_id, s.path, s.agent, s.model,",
6697
- "p.worktree as project_worktree, p.name as project_name",
6698
- "from session s left join project p on p.id = s.project_id",
6699
- "where coalesce(s.time_archived, 0) = 0",
6700
- "order by s.time_updated desc, s.id"
6701
- ].join(" "),
6702
- "OpenCode SQLite sessions"
6703
- );
6713
+ const sessionColumns = sqliteTableColumns(dbPath, "session");
6714
+ if (!sessionColumns.has("id")) return [];
6715
+ const projectColumns = sqliteTableExists(dbPath, "project") ? sqliteTableColumns(dbPath, "project") : new Set();
6716
+ const canJoinProject = sessionColumns.has("project_id") && projectColumns.has("id");
6717
+ const selects = [
6718
+ "s.id",
6719
+ sqliteSelectMaybe(sessionColumns, "s", "project_id"),
6720
+ sqliteSelectMaybe(sessionColumns, "s", "parent_id"),
6721
+ sqliteSelectMaybe(sessionColumns, "s", "slug"),
6722
+ sqliteSelectMaybe(sessionColumns, "s", "directory"),
6723
+ sqliteSelectMaybe(sessionColumns, "s", "title"),
6724
+ sqliteSelectMaybe(sessionColumns, "s", "version"),
6725
+ sqliteSelectMaybe(sessionColumns, "s", "share_url"),
6726
+ sqliteSelectMaybe(sessionColumns, "s", "time_created"),
6727
+ sqliteSelectMaybe(sessionColumns, "s", "time_updated"),
6728
+ sqliteSelectMaybe(sessionColumns, "s", "time_archived"),
6729
+ sqliteSelectMaybe(sessionColumns, "s", "workspace_id"),
6730
+ sqliteSelectMaybe(sessionColumns, "s", "path"),
6731
+ sqliteSelectMaybe(sessionColumns, "s", "agent"),
6732
+ sqliteSelectMaybe(sessionColumns, "s", "model"),
6733
+ canJoinProject && projectColumns.has("worktree") ? "p.worktree as project_worktree" : "null as project_worktree",
6734
+ canJoinProject && projectColumns.has("name") ? "p.name as project_name" : "null as project_name"
6735
+ ];
6736
+ const queryParts = [`select ${selects.join(", ")}`, "from session s"];
6737
+ if (canJoinProject) queryParts.push("left join project p on p.id = s.project_id");
6738
+ if (sessionColumns.has("time_archived")) queryParts.push("where coalesce(s.time_archived, 0) = 0");
6739
+ const orderColumns = [];
6740
+ if (sessionColumns.has("time_updated")) orderColumns.push("s.time_updated desc");
6741
+ if (sessionColumns.has("time_created")) orderColumns.push("s.time_created desc");
6742
+ orderColumns.push("s.id");
6743
+ queryParts.push(`order by ${orderColumns.join(", ")}`);
6744
+ return readSqliteJson(dbPath, queryParts.join(" "), "OpenCode SQLite sessions");
6704
6745
  }
6705
6746
 
6706
6747
  function readOpenCodeSqliteMessageRows(dbPath) {
6707
- return readSqliteJson(
6708
- dbPath,
6709
- "select id, session_id, time_created, time_updated, data from message order by session_id, time_created, id",
6710
- "OpenCode SQLite messages"
6711
- );
6748
+ const columns = sqliteTableColumns(dbPath, "message");
6749
+ if (!columns.has("id") || !columns.has("session_id")) return [];
6750
+ const selects = [
6751
+ "id",
6752
+ "session_id",
6753
+ sqliteSelectMaybe(columns, "message", "time_created"),
6754
+ sqliteSelectMaybe(columns, "message", "time_updated"),
6755
+ sqliteSelectMaybe(columns, "message", "data")
6756
+ ];
6757
+ const orderColumns = ["session_id"];
6758
+ if (columns.has("time_created")) orderColumns.push("time_created");
6759
+ orderColumns.push("id");
6760
+ return readSqliteJson(dbPath, `select ${selects.join(", ")} from message order by ${orderColumns.join(", ")}`, "OpenCode SQLite messages");
6712
6761
  }
6713
6762
 
6714
6763
  function readOpenCodeSqlitePartRows(dbPath) {
6715
- return readSqliteJson(
6716
- dbPath,
6717
- "select id, message_id, session_id, time_created, time_updated, data from part order by session_id, message_id, time_created, id",
6718
- "OpenCode SQLite parts"
6719
- );
6764
+ const columns = sqliteTableColumns(dbPath, "part");
6765
+ if (!columns.has("id") || !columns.has("message_id") || !columns.has("session_id")) return [];
6766
+ const selects = [
6767
+ "id",
6768
+ "message_id",
6769
+ "session_id",
6770
+ sqliteSelectMaybe(columns, "part", "time_created"),
6771
+ sqliteSelectMaybe(columns, "part", "time_updated"),
6772
+ sqliteSelectMaybe(columns, "part", "data")
6773
+ ];
6774
+ const orderColumns = ["session_id", "message_id"];
6775
+ if (columns.has("time_created")) orderColumns.push("time_created");
6776
+ orderColumns.push("id");
6777
+ return readSqliteJson(dbPath, `select ${selects.join(", ")} from part order by ${orderColumns.join(", ")}`, "OpenCode SQLite parts");
6720
6778
  }
6721
6779
 
6722
6780
  function openCodeSqliteMessagesFromRow(row, partRows, index) {