@gobing-ai/ts-llm-jsonl-importer 0.4.36 → 0.4.37
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/dist/mappers.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { JsonObject, SplitEntry, TransformContext } from './types';
|
|
3
3
|
/** Compute args_digest: sha256 of stable-jsonified, key-sorted, redacted args. */
|
|
4
4
|
export declare function argsDigest(args: unknown): string;
|
|
5
|
+
/**
|
|
6
|
+
* Return JSON-stringified raw args when the tool is a todo-writing tool for its source,
|
|
7
|
+
* otherwise undefined. Codex `arguments` arrives as a JSON string already — store as-is.
|
|
8
|
+
*/
|
|
9
|
+
export declare function maybeArgsRaw(source: string, toolName: string, args: unknown): string | undefined;
|
|
5
10
|
/** Map a Claude Code JSONL record into one or more ETL split entries. */
|
|
6
11
|
export declare function claudeSplit(raw: Record<string, unknown>): readonly SplitEntry[];
|
|
7
12
|
/** Map a Pi JSONL record into one or more ETL split entries. */
|
package/dist/mappers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAmExE,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAGhD;
|
|
1
|
+
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAmExE,kFAAkF;AAClF,wBAAgB,UAAU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
|
|
|
89
89
|
*
|
|
90
90
|
* Evidence: 0489 R4 confirmed omp/pi/claude; codex/grok/agy probed task 0553 R3 from real
|
|
91
91
|
* session JSONL. agy has no on-disk session format (VS Code fork); gemini deferred by the
|
|
92
|
-
* 2026-08-06 source-support ruling.
|
|
92
|
+
* 2026-08-06 source-support ruling. Task 0578 R3: omp `todo_write`, pi `manage_todo_list`,
|
|
93
|
+
* opencode `todowrite`/`todoread` measured live in .spur/spur.db (3,237/21, 1,043, 379/2
|
|
94
|
+
* rows with NULL args_raw).
|
|
93
95
|
*/
|
|
94
96
|
const TODO_TOOL_ALLOWLIST = {
|
|
95
97
|
claude: ['TodoWrite'],
|
|
96
|
-
|
|
97
|
-
omp: ['TodoWrite', 'todo'],
|
|
98
|
+
opencode: ['todowrite', 'todoread'],
|
|
98
99
|
codex: ['update_plan'],
|
|
100
|
+
omp: ['TodoWrite', 'todo', 'todo_write'],
|
|
99
101
|
grok: ['todo_write'],
|
|
102
|
+
pi: ['todo', 'manage_todo_list'],
|
|
100
103
|
agy: [],
|
|
101
104
|
gemini: [],
|
|
102
105
|
};
|
|
@@ -104,7 +107,7 @@ const TODO_TOOL_ALLOWLIST = {
|
|
|
104
107
|
* Return JSON-stringified raw args when the tool is a todo-writing tool for its source,
|
|
105
108
|
* otherwise undefined. Codex `arguments` arrives as a JSON string already — store as-is.
|
|
106
109
|
*/
|
|
107
|
-
function maybeArgsRaw(source, toolName, args) {
|
|
110
|
+
export function maybeArgsRaw(source, toolName, args) {
|
|
108
111
|
const allow = TODO_TOOL_ALLOWLIST[source];
|
|
109
112
|
if (allow === undefined || !allow.includes(toolName))
|
|
110
113
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-importer.d.ts","sourceRoot":"","sources":["../src/opencode-importer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAGH,KAAK,UAAU,EAEf,KAAK,YAAY,EACpB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"opencode-importer.d.ts","sourceRoot":"","sources":["../src/opencode-importer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAGH,KAAK,UAAU,EAEf,KAAK,YAAY,EACpB,MAAM,uBAAuB,CAAC;AAgB/B,OAAO,KAAK,EAAe,UAAU,EAAE,YAAY,EAAgC,aAAa,EAAE,MAAM,SAAS,CAAC;AAYlH,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,SAAS,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wFAAwF;AACxF,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,CAoI7F"}
|
|
@@ -2,6 +2,7 @@ import { createDbAdapter } from '@gobing-ai/ts-db';
|
|
|
2
2
|
import { ambientRuntimePaths, createNodeFileSystem, joinPath, } from '@gobing-ai/ts-runtime';
|
|
3
3
|
import { sha256 } from './hash.js';
|
|
4
4
|
import { applyHistoryImportSchema, deleteCheckpointOperation, openCodeBulkWriteOperations, openCodeDeleteOperations, readOpenCodeExistingEntries, readOpenCodeMessages, readOpenCodeParts, } from './jsonl-importer-dao.js';
|
|
5
|
+
import { maybeArgsRaw } from './mappers.js';
|
|
5
6
|
import { redactRecord } from './redaction.js';
|
|
6
7
|
const SOURCE = 'opencode';
|
|
7
8
|
const PAGE_SIZE = 250;
|
|
@@ -202,6 +203,7 @@ function prepareEntries(row, data, parts, sourceFile, redactionRules) {
|
|
|
202
203
|
session_id: row.session_id,
|
|
203
204
|
seq: started ?? created,
|
|
204
205
|
tool_name: stringValue(part.tool) ?? 'unknown',
|
|
206
|
+
args_raw: maybeArgsRaw(SOURCE, stringValue(part.tool) ?? 'unknown', state.input),
|
|
205
207
|
args_digest: sha256(state.input ?? null),
|
|
206
208
|
status,
|
|
207
209
|
started_at: started === undefined ? null : isoTime(started),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobing-ai/ts-llm-jsonl-importer",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "@gobing-ai/ts-llm-jsonl-importer — Generic JSONL importer for LLM agent history files.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-llm-jsonl-importer-v<version> && git push --tags' && exit 1"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@gobing-ai/ts-db": "^0.4.
|
|
51
|
-
"@gobing-ai/ts-runtime": "^0.4.
|
|
52
|
-
"@gobing-ai/ts-utils": "^0.4.
|
|
50
|
+
"@gobing-ai/ts-db": "^0.4.37",
|
|
51
|
+
"@gobing-ai/ts-runtime": "^0.4.37",
|
|
52
|
+
"@gobing-ai/ts-utils": "^0.4.37",
|
|
53
53
|
"zod": "^4.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
package/src/mappers.ts
CHANGED
|
@@ -96,14 +96,17 @@ function redactArgs(args: unknown): unknown {
|
|
|
96
96
|
*
|
|
97
97
|
* Evidence: 0489 R4 confirmed omp/pi/claude; codex/grok/agy probed task 0553 R3 from real
|
|
98
98
|
* session JSONL. agy has no on-disk session format (VS Code fork); gemini deferred by the
|
|
99
|
-
* 2026-08-06 source-support ruling.
|
|
99
|
+
* 2026-08-06 source-support ruling. Task 0578 R3: omp `todo_write`, pi `manage_todo_list`,
|
|
100
|
+
* opencode `todowrite`/`todoread` measured live in .spur/spur.db (3,237/21, 1,043, 379/2
|
|
101
|
+
* rows with NULL args_raw).
|
|
100
102
|
*/
|
|
101
103
|
const TODO_TOOL_ALLOWLIST: Readonly<Record<string, readonly string[]>> = {
|
|
102
104
|
claude: ['TodoWrite'],
|
|
103
|
-
|
|
104
|
-
omp: ['TodoWrite', 'todo'],
|
|
105
|
+
opencode: ['todowrite', 'todoread'],
|
|
105
106
|
codex: ['update_plan'],
|
|
107
|
+
omp: ['TodoWrite', 'todo', 'todo_write'],
|
|
106
108
|
grok: ['todo_write'],
|
|
109
|
+
pi: ['todo', 'manage_todo_list'],
|
|
107
110
|
agy: [],
|
|
108
111
|
gemini: [],
|
|
109
112
|
};
|
|
@@ -112,7 +115,7 @@ const TODO_TOOL_ALLOWLIST: Readonly<Record<string, readonly string[]>> = {
|
|
|
112
115
|
* Return JSON-stringified raw args when the tool is a todo-writing tool for its source,
|
|
113
116
|
* otherwise undefined. Codex `arguments` arrives as a JSON string already — store as-is.
|
|
114
117
|
*/
|
|
115
|
-
function maybeArgsRaw(source: string, toolName: string, args: unknown): string | undefined {
|
|
118
|
+
export function maybeArgsRaw(source: string, toolName: string, args: unknown): string | undefined {
|
|
116
119
|
const allow = TODO_TOOL_ALLOWLIST[source];
|
|
117
120
|
if (allow === undefined || !allow.includes(toolName)) return undefined;
|
|
118
121
|
if (typeof args === 'string') return args;
|
package/src/opencode-importer.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
readOpenCodeMessages,
|
|
20
20
|
readOpenCodeParts,
|
|
21
21
|
} from './jsonl-importer-dao';
|
|
22
|
+
import { maybeArgsRaw } from './mappers';
|
|
22
23
|
import { redactRecord } from './redaction';
|
|
23
24
|
import type { ImportIssue, ImportMode, ImportResult, JsonObject, ReconcileSummary, RedactionRule } from './types';
|
|
24
25
|
|
|
@@ -262,6 +263,7 @@ function prepareEntries(
|
|
|
262
263
|
session_id: row.session_id,
|
|
263
264
|
seq: started ?? created,
|
|
264
265
|
tool_name: stringValue(part.tool) ?? 'unknown',
|
|
266
|
+
args_raw: maybeArgsRaw(SOURCE, stringValue(part.tool) ?? 'unknown', state.input),
|
|
265
267
|
args_digest: sha256(state.input ?? null),
|
|
266
268
|
status,
|
|
267
269
|
started_at: started === undefined ? null : isoTime(started),
|