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 +1 -1
- package/docs/history-source-handling.md +24 -24
- package/docs/release.md +1 -1
- package/package.json +1 -1
- package/src/archive.js +2 -1
- package/src/importers.js +80 -22
package/README.md
CHANGED
|
@@ -183,30 +183,30 @@ package-prefixed scheme.
|
|
|
183
183
|
|
|
184
184
|
| Source type | Version |
|
|
185
185
|
| --- | --- |
|
|
186
|
-
| `codex-cli-history` | `0.2.
|
|
187
|
-
| `codex-desktop-history` | `0.2.
|
|
188
|
-
| `cli-history` | `0.2.
|
|
189
|
-
| `claude-sdk-history` | `0.2.
|
|
190
|
-
| `claude-code-desktop-metadata` | `0.2.
|
|
191
|
-
| `claude-workspace-desktop` | `0.2.
|
|
192
|
-
| `cursor-workspace-sqlite` | `0.2.
|
|
193
|
-
| `cursor-global-sqlite` | `0.2.
|
|
194
|
-
| `cursor-raw-sqlite-salvage` | `0.2.
|
|
195
|
-
| `cursor-agent-transcripts` | `0.2.
|
|
196
|
-
| `devin-cli-history` | `0.2.
|
|
197
|
-
| `gemini-cli-history` | `0.2.
|
|
198
|
-
| `cline-task-history` | `0.2.
|
|
199
|
-
| `opencode-history` | `0.2.
|
|
200
|
-
| `opencode-sqlite-history` | `0.2.
|
|
201
|
-
| `aider-chat-history` | `0.2.
|
|
202
|
-
| `antigravity-history` | `0.2.
|
|
203
|
-
| `antigravity-trajectory-summary` | `0.2.
|
|
204
|
-
| `windsurf-trajectory-export` | `0.2.
|
|
205
|
-
| `web-chat-export` | `0.2.
|
|
206
|
-
| `chatgpt-export` | `0.2.
|
|
207
|
-
| `claude-web-export` | `0.2.
|
|
208
|
-
| `claude-web-memory` | `0.2.
|
|
209
|
-
| `import` | `0.2.
|
|
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
package/package.json
CHANGED
package/src/archive.js
CHANGED
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
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
"
|
|
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
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
"
|
|
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
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
"
|
|
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) {
|