@alsdd/t3-import 0.0.0-stage → 0.1.1-alsd.1

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 (97) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/README.md +141 -2
  4. package/assets/fork-demo.gif +0 -0
  5. package/assets/fork-demo.png +0 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.js +399 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/core/checkpoint.d.ts +25 -0
  10. package/dist/core/checkpoint.js +82 -0
  11. package/dist/core/checkpoint.js.map +1 -0
  12. package/dist/core/errors.d.ts +12 -0
  13. package/dist/core/errors.js +17 -0
  14. package/dist/core/errors.js.map +1 -0
  15. package/dist/core/jsonl.d.ts +7 -0
  16. package/dist/core/jsonl.js +37 -0
  17. package/dist/core/jsonl.js.map +1 -0
  18. package/dist/core/providers.d.ts +6 -0
  19. package/dist/core/providers.js +17 -0
  20. package/dist/core/providers.js.map +1 -0
  21. package/dist/core/types.d.ts +247 -0
  22. package/dist/core/types.js +4 -0
  23. package/dist/core/types.js.map +1 -0
  24. package/dist/core/util.d.ts +14 -0
  25. package/dist/core/util.js +61 -0
  26. package/dist/core/util.js.map +1 -0
  27. package/dist/sources/claude.d.ts +6 -0
  28. package/dist/sources/claude.js +576 -0
  29. package/dist/sources/claude.js.map +1 -0
  30. package/dist/sources/codex.d.ts +11 -0
  31. package/dist/sources/codex.js +603 -0
  32. package/dist/sources/codex.js.map +1 -0
  33. package/dist/sources/codexAppServer.d.ts +24 -0
  34. package/dist/sources/codexAppServer.js +190 -0
  35. package/dist/sources/codexAppServer.js.map +1 -0
  36. package/dist/sources/files.d.ts +1 -0
  37. package/dist/sources/files.js +24 -0
  38. package/dist/sources/files.js.map +1 -0
  39. package/dist/sources/index.d.ts +3 -0
  40. package/dist/sources/index.js +15 -0
  41. package/dist/sources/index.js.map +1 -0
  42. package/dist/sources/opencode.d.ts +6 -0
  43. package/dist/sources/opencode.js +443 -0
  44. package/dist/sources/opencode.js.map +1 -0
  45. package/dist/target/cache.d.ts +14 -0
  46. package/dist/target/cache.js +155 -0
  47. package/dist/target/cache.js.map +1 -0
  48. package/dist/target/config.d.ts +22 -0
  49. package/dist/target/config.js +90 -0
  50. package/dist/target/config.js.map +1 -0
  51. package/dist/target/destination.d.ts +21 -0
  52. package/dist/target/destination.js +77 -0
  53. package/dist/target/destination.js.map +1 -0
  54. package/dist/target/importer.d.ts +86 -0
  55. package/dist/target/importer.js +597 -0
  56. package/dist/target/importer.js.map +1 -0
  57. package/dist/target/launch.d.ts +6 -0
  58. package/dist/target/launch.js +77 -0
  59. package/dist/target/launch.js.map +1 -0
  60. package/dist/target/ledger.d.ts +35 -0
  61. package/dist/target/ledger.js +174 -0
  62. package/dist/target/ledger.js.map +1 -0
  63. package/dist/target/reconciliation.d.ts +60 -0
  64. package/dist/target/reconciliation.js +259 -0
  65. package/dist/target/reconciliation.js.map +1 -0
  66. package/dist/target/replace.d.ts +9 -0
  67. package/dist/target/replace.js +341 -0
  68. package/dist/target/replace.js.map +1 -0
  69. package/dist/target/schema.d.ts +22 -0
  70. package/dist/target/schema.js +108 -0
  71. package/dist/target/schema.js.map +1 -0
  72. package/dist/target/sync.d.ts +34 -0
  73. package/dist/target/sync.js +879 -0
  74. package/dist/target/sync.js.map +1 -0
  75. package/dist/target/syncAll.d.ts +4 -0
  76. package/dist/target/syncAll.js +98 -0
  77. package/dist/target/syncAll.js.map +1 -0
  78. package/dist/target/v2.d.ts +18 -0
  79. package/dist/target/v2.js +267 -0
  80. package/dist/target/v2.js.map +1 -0
  81. package/dist/target/v2Profiles.d.ts +5 -0
  82. package/dist/target/v2Profiles.js +14 -0
  83. package/dist/target/v2Profiles.js.map +1 -0
  84. package/dist/tui.d.ts +49 -0
  85. package/dist/tui.js +560 -0
  86. package/dist/tui.js.map +1 -0
  87. package/package.json +93 -4
  88. package/vendor/t3-v010/LICENSE +21 -0
  89. package/vendor/t3-v010/THIRD-PARTY-NOTICES.txt +2274 -0
  90. package/vendor/t3-v010/reference.json +6 -0
  91. package/vendor/t3-v010/runtime.mjs +60364 -0
  92. package/vendor/t3-v010/schema-columns.json +568 -0
  93. package/vendor/t3-v011/LICENSE +21 -0
  94. package/vendor/t3-v011/THIRD-PARTY-NOTICES.txt +2274 -0
  95. package/vendor/t3-v011/reference.json +6 -0
  96. package/vendor/t3-v011/runtime.mjs +60993 -0
  97. package/vendor/t3-v011/schema-columns.json +526 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1-alsd.1
4
+
5
+ First release from the maintained `alsd4git/t3-import` fork. Package name:
6
+ `@alsdd/t3-import`; executable: `t3-import`. Version numbers follow the latest
7
+ supported T3 release plus an independent
8
+ fork revision. GitHub releases provide a tarball; npm publication uses the
9
+ default `latest` channel.
10
+
11
+ - Support T3 V1 migrations 40–54 and pinned T3 0.1.0/0.1.1 V2 migrations 62/67.
12
+ - Import and sync OpenCode 2.x sessions into T3, preserving native session identity,
13
+ working directory, model and variant.
14
+ - Safely adopt linked Codex/OpenCode conversations and sync across working folders.
15
+ - Select compatible destination projects in the CLI and TUI, including eligible
16
+ managed scratch folders.
17
+ - Explain sync states, conflicts, ignored active turns and source inspection errors.
18
+ - Report current bindings, historical V1 identities and verified V2 context handoffs.
19
+ - Validate packed installs, synthetic import/sync and idempotency across Windows,
20
+ macOS and Ubuntu on Node 22/24.
21
+ - Provide fork documentation and reproducible synthetic TUI captures.
22
+
23
+ Provider history flows into T3 only. Unknown database schemas fail closed. Existing
24
+ upstream PR branches remain unchanged; this release does not merge or rewrite them.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 t3-import contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,142 @@
1
- # Temporary Holding Version
1
+ # t3-import
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![CI](https://github.com/alsd4git/t3-import/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/alsd4git/t3-import/actions/workflows/ci.yml)
4
+ [![Release](https://img.shields.io/github/v/release/alsd4git/t3-import?include_prereleases)](https://github.com/alsd4git/t3-import/releases)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+
7
+ Import and sync local **Codex, Claude Code, and OpenCode** conversations into
8
+ [T3 Code](https://github.com/pingdotgg/t3code), with native session bindings for
9
+ continuation, interactive previews, and verified backups.
10
+
11
+ Maintained fork by [alsd4git](https://github.com/alsd4git), based on
12
+ [CarlosGtrz/t3-import](https://github.com/CarlosGtrz/t3-import). This repository's
13
+ `main` is the development and release base. Existing upstream pull requests stay
14
+ open on their original branches. This is an independent tool, unaffiliated with
15
+ T3 Code or its providers.
16
+
17
+ ## Compatibility
18
+
19
+ | T3 database | Supported migrations | Sources |
20
+ | --- | --- | --- |
21
+ | V1 | 40–54 | Codex, Claude Code |
22
+ | T3 0.1.0 / Orchestrator V2 | 62 | Codex, Claude Code, OpenCode |
23
+ | T3 0.1.1 / Orchestrator V2 | 67 | Codex, Claude Code, OpenCode |
24
+
25
+ Use **Node.js 22.21.1+ or 24+**. Unknown schemas, including intermediate V2
26
+ migrations, are refused. T3 owns database upgrades; the importer never migrates
27
+ your installation. OpenCode requires its 2.x SQLite session format.
28
+
29
+ History sync goes **from the provider into T3**. It is an explicit operation,
30
+ without a background watcher or reverse transcript writer. Continuing a bound
31
+ session from T3 uses the provider's native session. Titles remain separate from
32
+ transcript sync. See [compatibility and validation](docs/compatibility.md).
33
+
34
+ ## Install
35
+
36
+ The fork package is named `@alsdd/t3-import`; the command remains `t3-import`.
37
+ Install the scoped npm package, or use the pinned GitHub release tarball below.
38
+ The upstream `@carlosgtrz/t3-import` package does not contain this fork's features.
39
+
40
+ ```sh
41
+ npm i -g @alsdd/t3-import --allow-scripts=better-sqlite3
42
+ t3-import --version
43
+ ```
44
+
45
+ For a pinned GitHub release without the npm registry:
46
+
47
+ ```sh
48
+ npm i -g --allow-scripts=better-sqlite3 https://github.com/alsd4git/t3-import/releases/download/v0.1.1-alsd.1/alsdd-t3-import-0.1.1-alsd.1.tgz
49
+ ```
50
+
51
+ Versions follow `<T3 version>-alsd.<revision>`. `0.1.1-alsd.1` targets T3 0.1.1
52
+ and retains the earlier compatibility shown above. npm installs the default
53
+ `latest` channel; no `@next` suffix is required.
54
+
55
+ The script approval allows the native SQLite dependency to install with recent
56
+ npm versions. Older npm versions may report the option as unknown; their normal
57
+ install-script behavior still applies.
58
+
59
+ To build from source:
60
+
61
+ ```sh
62
+ git clone https://github.com/alsd4git/t3-import.git
63
+ cd t3-import
64
+ npm ci
65
+ npm run build
66
+ node dist/cli.js
67
+ ```
68
+
69
+ ## Import and sync
70
+
71
+ Close T3 before importing, syncing, or replacing history. Every write creates a
72
+ verified database backup. Keep that backup and back up the external import ledger
73
+ separately when needed. See [storage and recovery](docs/usage.md#safety-and-storage).
74
+
75
+ Running `t3-import` opens the interactive flow. Choose a source and working folder,
76
+ review each conversation's status, select imports or safe updates, and confirm.
77
+ New imports offer compatible destination projects while preserving the source cwd.
78
+ Native "No project" is available only for eligible T3 scratch folders.
79
+
80
+ ![Synthetic OpenCode conversation selection in the fork's actual TUI](assets/fork-demo.png)
81
+
82
+ ```sh
83
+ t3-import # interactive import and sync
84
+ t3-import import --source opencode # start with OpenCode
85
+ t3-import sync --source codex # focused interactive sync
86
+ t3-import sync --source codex --all --dry-run --yes --summary
87
+ t3-import sync --source codex --all --yes --summary
88
+ t3-import links --json # read-only identity report
89
+ ```
90
+
91
+ `links` distinguishes current bindings, retained V1 identities and verified V2
92
+ context handoffs. It does not compare transcripts, rename threads, or establish
93
+ identity from similar titles. It can run while T3 is open, with provisional results.
94
+
95
+ The TUI explains pending additions, active turns, conflicts and unavailable
96
+ sources. Safe sync appends settled history only after verifying the existing
97
+ transcript prefix. Divergent or ambiguous histories need review. Exit code `7`
98
+ reports skipped reconciliation cases, even when other updates in the batch succeed.
99
+
100
+ ### Demo
101
+
102
+ ![Synthetic OpenCode import preview through source, selection, destination and review](assets/fork-demo.gif)
103
+
104
+ These captures use the actual TUI with synthetic conversations and an isolated
105
+ target. They stop at review before writing history.
106
+ [Reproduce the demo](docs/demo.md).
107
+
108
+ ## Documentation
109
+
110
+ - [Commands, destinations, safety and storage](docs/usage.md)
111
+ - [Compatibility, pinned runtimes and vendoring](docs/compatibility.md)
112
+ - [OpenCode and T3 0.1.1 validation](docs/v011-opencode-validation.md)
113
+ - [Native continuation test and its limits](docs/continuation-validation-2026-10-22.md)
114
+ - [Packed install and CI checks](docs/package-validation.md)
115
+ - [Fork history and release process](docs/fork-maintenance.md)
116
+ - [Changelog](CHANGELOG.md)
117
+
118
+ Optional title normalization can consume `links` evidence. The personal
119
+ [`codex-thread-normalizer` skill](https://github.com/alsd4git/my-skills/tree/main/skills/codex-thread-normalizer)
120
+ is maintained separately and is not required to use the importer.
121
+
122
+ ## Development
123
+
124
+ ```sh
125
+ npm ci
126
+ npm run typecheck
127
+ npm test
128
+ npm run build
129
+ npm run package:check
130
+ ```
131
+
132
+ CI checks Node 22/24 on Windows, macOS and Ubuntu. The package check installs a
133
+ tarball with independent dependencies, imports a synthetic conversation, appends
134
+ a turn, and verifies that repeated sync is a no-op. Additional pinned-runtime
135
+ checks and regeneration commands are described in the
136
+ [compatibility guide](docs/compatibility.md).
137
+
138
+ ## Credits and license
139
+
140
+ Originally created by CarlosGtrz; fork maintenance and extensions by Alessandro
141
+ Digilio and contributors. Licensed under [MIT](LICENSE). Bundled T3 runtimes retain
142
+ their licenses, source references and third-party notices under `vendor/`.
Binary file
Binary file
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,399 @@
1
+ #!/usr/bin/env node
2
+ import { Command, Option } from "commander";
3
+ import { render } from "ink";
4
+ import React from "react";
5
+ import Database from "better-sqlite3";
6
+ import { createInterface } from "node:readline/promises";
7
+ import { existsSync, readdirSync } from "node:fs";
8
+ import { stdin as input, stdout as output } from "node:process";
9
+ import { z } from "zod";
10
+ import { ImportTui } from "./tui.js";
11
+ import { ImporterError, usageError } from "./core/errors.js";
12
+ import { validateDestinationOptions } from "./target/destination.js";
13
+ import { sourceNames } from "./core/providers.js";
14
+ import { inspectLinkedThreads } from "./target/reconciliation.js";
15
+ import { disposeSourceAdapters, sourceAdapter } from "./sources/index.js";
16
+ import { resolveTargetPaths } from "./target/config.js";
17
+ import { IMPORTER_VERSION, importConversations } from "./target/importer.js";
18
+ import { inspectRuntime, validateTargetDatabase } from "./target/schema.js";
19
+ import { inspectConversationSync, syncConversations } from "./target/sync.js";
20
+ import { syncAllLinkedConversations } from "./target/syncAll.js";
21
+ import { replaceConversations } from "./target/replace.js";
22
+ import { discoverT3CacheProfiles, formatCacheResetResult, resetT3RebuildableCache } from "./target/cache.js";
23
+ const sourceSchema = z.enum(sourceNames);
24
+ const program = new Command();
25
+ function collect(value, previous) { return [...previous, value]; }
26
+ function globalOverrides() {
27
+ const values = program.opts();
28
+ return { ...(values.t3Home ? { t3Home: values.t3Home } : {}), ...(values.db ? { dbPath: values.db } : {}), ...(values.attachmentsDir ? { attachmentsDir: values.attachmentsDir } : {}), ...(values.providerInstance ? { providerInstance: values.providerInstance } : {}) };
29
+ }
30
+ function isJson() { return Boolean(program.opts().json); }
31
+ function shouldResetCache() { return program.opts().cacheReset !== false; }
32
+ function print(value) { console.log(isJson() ? JSON.stringify(value) : typeof value === "string" ? value : JSON.stringify(value, null, 2)); }
33
+ function printSync(result, summary) {
34
+ if (!summary || isJson()) {
35
+ print(result);
36
+ return;
37
+ }
38
+ const updated = result.results.filter((item) => item.status === "synced" || item.status === "dry-run");
39
+ const current = result.results.filter((item) => item.status === "up-to-date");
40
+ const skipped = result.results.filter((item) => !updated.includes(item) && !current.includes(item));
41
+ const turns = updated.reduce((sum, item) => sum + item.turnsAdded, 0);
42
+ console.log(`${result.status}: ${turns} new turns; ${current.length} current threads; ${skipped.length} skipped.`);
43
+ for (const item of [...updated, ...skipped])
44
+ console.log(`${item.status}\t${item.title}${item.turnsAdded ? ` (+${item.turnsAdded} turns)` : ""}`);
45
+ if (result.backup)
46
+ console.log(`Backup: ${result.backup}`);
47
+ for (const warning of result.warnings)
48
+ console.log(`Warning: ${warning}`);
49
+ if (skipped.length)
50
+ console.log("Skipped histories were preserved. Exit code 7 means some linked threads need review.");
51
+ }
52
+ function parseSince(value) {
53
+ if (!value)
54
+ return undefined;
55
+ const parsed = new Date(value);
56
+ if (Number.isNaN(parsed.valueOf()))
57
+ throw usageError(`Invalid ISO date: ${value}`);
58
+ return parsed;
59
+ }
60
+ function sourceName(value) { return sourceSchema.parse(value); }
61
+ async function confirmImport(count) {
62
+ const prompt = createInterface({ input, output });
63
+ try {
64
+ return /^(y|yes)$/iu.test((await prompt.question(`Import ${count} conversation${count === 1 ? "" : "s"} into T3? [y/N] `)).trim());
65
+ }
66
+ finally {
67
+ prompt.close();
68
+ }
69
+ }
70
+ async function confirmSync(count) {
71
+ const prompt = createInterface({ input, output });
72
+ try {
73
+ return /^(y|yes)$/iu.test((await prompt.question(`Synchronize ${count} conversation${count === 1 ? "" : "s"} with T3? [y/N] `)).trim());
74
+ }
75
+ finally {
76
+ prompt.close();
77
+ }
78
+ }
79
+ async function confirmReplace(count) {
80
+ const prompt = createInterface({ input, output });
81
+ try {
82
+ return /^(y|yes)$/iu.test((await prompt.question(`Replace ${count} canonical T3 task${count === 1 ? "" : "s"}? The old tasks will be soft-deleted. [y/N] `)).trim());
83
+ }
84
+ finally {
85
+ prompt.close();
86
+ }
87
+ }
88
+ async function confirmCacheReset() {
89
+ const prompt = createInterface({ input, output });
90
+ try {
91
+ return /^(y|yes)$/iu.test((await prompt.question("Reset T3's rebuildable IndexedDB cache? A verified backup will be created. [y/N] ")).trim());
92
+ }
93
+ finally {
94
+ prompt.close();
95
+ }
96
+ }
97
+ async function attachCacheReset(result, paths, changed) {
98
+ if (!changed || !shouldResetCache())
99
+ return result;
100
+ try {
101
+ result.cache = await resetT3RebuildableCache(paths);
102
+ result.warnings.push(...result.cache.warnings);
103
+ }
104
+ catch (error) {
105
+ result.warnings.push(`T3 data was updated, but its IndexedDB cache could not be reset: ${error instanceof Error ? error.message : String(error)}`);
106
+ }
107
+ return result;
108
+ }
109
+ program
110
+ .name("t3-import")
111
+ .description("Import, synchronize, and replace Codex, Claude Code, and OpenCode conversations in T3 Code")
112
+ .version(IMPORTER_VERSION)
113
+ .option("--t3-home <path>", "T3 home directory")
114
+ .option("--db <path>", "T3 database path (state.sqlite or statev2.sqlite)")
115
+ .option("--attachments-dir <path>", "T3 attachments directory")
116
+ .option("--provider-instance <id>", "T3 provider instance")
117
+ .option("--json", "write machine-readable JSON to stdout")
118
+ .option("--no-color", "disable color output")
119
+ .option("--no-cache-reset", "keep T3's existing IndexedDB cache after writes")
120
+ .action(async () => {
121
+ const paths = resolveTargetPaths(globalOverrides());
122
+ const provider = globalOverrides().providerInstance;
123
+ const instance = render(React.createElement(ImportTui, { paths, resetCache: shouldResetCache(), ...(provider ? { initialProvider: provider } : {}) }));
124
+ await instance.waitUntilExit();
125
+ });
126
+ program.command("links")
127
+ .description("Inspect provider bindings, origins and lineage without changing metadata or transcripts")
128
+ .option("--source <source>", "codex, claude, or opencode")
129
+ .option("--include-subagents", "include child threads in the read-only report")
130
+ .option("--include-archived", "include archived threads in the read-only report")
131
+ .action(async (options) => {
132
+ print(await inspectLinkedThreads(resolveTargetPaths(globalOverrides()), {
133
+ ...(options.source ? { source: sourceName(options.source) } : {}),
134
+ includeSubagents: Boolean(options.includeSubagents), includeArchived: Boolean(options.includeArchived),
135
+ }));
136
+ });
137
+ program.command("list")
138
+ .description("List source conversations")
139
+ .requiredOption("--source <source>", "codex, claude, or opencode")
140
+ .option("--workspace <path>")
141
+ .option("--since <date>", "ISO date/time")
142
+ .action(async (options) => {
143
+ const since = parseSince(options.since);
144
+ const summaries = await sourceAdapter(sourceName(options.source)).discover({ ...(options.workspace ? { workspace: options.workspace } : {}), ...(since ? { since } : {}) });
145
+ if (isJson())
146
+ print({ schemaVersion: 1, conversations: summaries });
147
+ else if (!summaries.length)
148
+ print("No conversations found.");
149
+ else
150
+ print(summaries.map((item) => `${item.id}\t${item.updatedAt}\t${item.branches}\t${item.workspace}\t${item.title}`).join("\n"));
151
+ });
152
+ program.command("show")
153
+ .description("Show an import preview")
154
+ .requiredOption("--source <source>", "codex, claude, or opencode")
155
+ .requiredOption("--thread <id>")
156
+ .option("--workspace <path>")
157
+ .option("--include-incomplete")
158
+ .action(async (options) => {
159
+ const adapter = sourceAdapter(sourceName(options.source));
160
+ const summaries = await adapter.discover(options.workspace ? { workspace: options.workspace } : {});
161
+ const summary = summaries.find((item) => item.id === options.thread);
162
+ if (!summary)
163
+ throw usageError(`Conversation not found: ${options.thread}`);
164
+ const conversation = await adapter.load(summary, { ...(options.includeIncomplete !== undefined ? { includeIncomplete: options.includeIncomplete } : {}) });
165
+ print({ schemaVersion: 1, source: conversation.summary, fingerprint: conversation.fingerprint, tasks: conversation.threads.map((thread) => ({ sourceKey: thread.sourceKey, title: thread.title, currentBranch: thread.currentBranch, resumable: Boolean(thread.resumeCursor), turns: thread.turns.length, messages: thread.turns.reduce((sum, turn) => sum + 1 + turn.assistant.length, 0), activities: thread.turns.reduce((sum, turn) => sum + turn.activities.length, 0), plans: thread.turns.reduce((sum, turn) => sum + turn.plans.length, 0), attachments: thread.turns.reduce((sum, turn) => sum + turn.user.attachments.length, 0), warnings: thread.warnings })) });
166
+ });
167
+ program.command("doctor")
168
+ .description("Check source and T3 readiness without changing anything")
169
+ .action(async () => {
170
+ const paths = resolveTargetPaths(globalOverrides());
171
+ const runtime = await inspectRuntime(paths);
172
+ let database = { exists: existsSync(paths.dbPath) };
173
+ if (existsSync(paths.dbPath)) {
174
+ const db = new Database(paths.dbPath, { readonly: true, fileMustExist: true });
175
+ try {
176
+ database = { exists: true, ...validateTargetDatabase(db) };
177
+ }
178
+ catch (error) {
179
+ database = { exists: true, compatible: false, error: error instanceof Error ? error.message : String(error) };
180
+ }
181
+ finally {
182
+ db.close();
183
+ }
184
+ }
185
+ const staging = existsSync(paths.attachmentsDir) ? readdirSync(paths.attachmentsDir).filter((name) => name.startsWith(".t3-import-staging-")) : [];
186
+ const sources = {};
187
+ for (const name of sourceNames) {
188
+ try {
189
+ const items = await sourceAdapter(name).discover({});
190
+ sources[name] = { available: true, conversations: items.length, workspaces: new Set(items.map((item) => item.workspace)).size };
191
+ }
192
+ catch (error) {
193
+ sources[name] = { available: false, error: error instanceof Error ? error.message : String(error) };
194
+ }
195
+ }
196
+ print({ schemaVersion: 1, target: paths, runtime, database, sources, indexedDbCaches: discoverT3CacheProfiles(), stagingDirectories: staging });
197
+ });
198
+ const cacheCommand = program.command("cache").description("Inspect or reset T3's rebuildable IndexedDB cache");
199
+ cacheCommand.command("reset")
200
+ .description("Back up and reset the most recently used T3 IndexedDB cache")
201
+ .option("--yes", "skip confirmation")
202
+ .action(async (options) => {
203
+ if (!options.yes) {
204
+ if (!process.stdout.isTTY || isJson())
205
+ throw usageError("Non-interactive cache reset requires --yes.");
206
+ if (!await confirmCacheReset())
207
+ return;
208
+ }
209
+ const result = await resetT3RebuildableCache(resolveTargetPaths(globalOverrides()));
210
+ print(isJson() ? { schemaVersion: 1, ...result } : formatCacheResetResult(result));
211
+ });
212
+ program.command("import")
213
+ .description("Import selected conversations")
214
+ .addOption(new Option("--source <source>", "codex, claude, or opencode"))
215
+ .option("--workspace <path>")
216
+ .option("--target-project <id>", "existing T3 project ID; its root must match the source cwd")
217
+ .option("--no-project", "use native No project for a source cwd already inside T3 scratch")
218
+ .option("--thread <id>", "source conversation id (repeatable)", collect, [])
219
+ .option("--all", "select every matching conversation")
220
+ .option("--since <date>", "ISO date/time")
221
+ .option("--include-incomplete")
222
+ .option("--dry-run")
223
+ .option("--yes")
224
+ .option("--non-interactive")
225
+ .option("--no-resume")
226
+ .action(async (options) => {
227
+ validateDestinationOptions(options);
228
+ if ((options.targetProject || options.noProject) && (!options.source || !options.workspace || (!options.all && !options.thread.length)))
229
+ throw usageError("Destination selection requires --source, --workspace, and --thread or --all; it is not available through the TUI yet.");
230
+ if (!options.source || !options.workspace || (!options.all && options.thread.length === 0)) {
231
+ if (process.stdout.isTTY && !options.nonInteractive && !isJson()) {
232
+ const paths = resolveTargetPaths(globalOverrides());
233
+ const source = options.source ? sourceName(options.source) : undefined;
234
+ const provider = globalOverrides().providerInstance;
235
+ const instance = render(React.createElement(ImportTui, {
236
+ paths,
237
+ ...(source ? { initialSource: source } : {}),
238
+ ...(options.workspace ? { initialWorkspace: options.workspace } : {}),
239
+ ...(provider ? { initialProvider: provider } : {}),
240
+ resetCache: shouldResetCache(),
241
+ }));
242
+ await instance.waitUntilExit();
243
+ return;
244
+ }
245
+ throw usageError("Non-interactive import requires --source, --workspace, and either --thread or --all.");
246
+ }
247
+ if (options.all && options.thread.length)
248
+ throw usageError("--all and --thread are mutually exclusive.");
249
+ if (!options.dryRun && !options.yes) {
250
+ if (!process.stdout.isTTY || options.nonInteractive || isJson())
251
+ throw usageError("Non-interactive imports require --yes.");
252
+ if (!await confirmImport(options.all ? 1 : options.thread.length))
253
+ return;
254
+ }
255
+ const source = sourceName(options.source);
256
+ const adapter = sourceAdapter(source);
257
+ const since = parseSince(options.since);
258
+ const summaries = await adapter.discover({ workspace: options.workspace, ...(since ? { since } : {}), ...(options.includeIncomplete !== undefined ? { includeIncomplete: options.includeIncomplete } : {}) });
259
+ const selected = options.all ? summaries : options.thread.map((id) => {
260
+ const summary = summaries.find((item) => item.id === id);
261
+ if (!summary)
262
+ throw usageError(`Conversation not found in workspace: ${id}`);
263
+ return summary;
264
+ });
265
+ const loaded = await Promise.all(selected.map(async (summary) => ({ conversation: await adapter.load(summary, { workspace: options.workspace, ...(since ? { since } : {}), ...(options.includeIncomplete !== undefined ? { includeIncomplete: options.includeIncomplete } : {}) }), resume: options.resume })));
266
+ const paths = resolveTargetPaths(globalOverrides());
267
+ const result = await importConversations(loaded, paths, { ...globalOverrides(), dryRun: Boolean(options.dryRun), resume: options.resume, ...(options.targetProject ? { targetProject: options.targetProject } : {}), ...(options.noProject ? { noProject: true } : {}) });
268
+ await attachCacheReset(result, paths, result.results.some((item) => item.status === "imported"));
269
+ print(result);
270
+ });
271
+ program.command("replace")
272
+ .description("Replace canonical T3 tasks with complete provider transcripts")
273
+ .addOption(new Option("--source <source>", "codex, claude, or opencode"))
274
+ .option("--workspace <path>")
275
+ .option("--thread <id>", "source conversation id (repeatable)", collect, [])
276
+ .option("--dry-run")
277
+ .option("--yes")
278
+ .option("--non-interactive")
279
+ .action(async (options) => {
280
+ if (!options.source || !options.workspace || options.thread.length === 0) {
281
+ if (process.stdout.isTTY && !options.nonInteractive && !isJson()) {
282
+ const paths = resolveTargetPaths(globalOverrides());
283
+ const source = options.source ? sourceName(options.source) : undefined;
284
+ const instance = render(React.createElement(ImportTui, {
285
+ paths, mode: "replace",
286
+ ...(source ? { initialSource: source } : {}),
287
+ ...(options.workspace ? { initialWorkspace: options.workspace } : {}),
288
+ resetCache: shouldResetCache(),
289
+ }));
290
+ await instance.waitUntilExit();
291
+ return;
292
+ }
293
+ throw usageError("Non-interactive replacement requires --source, --workspace, and --thread.");
294
+ }
295
+ if (!options.yes && (!process.stdout.isTTY || options.nonInteractive || isJson()))
296
+ throw usageError("Non-interactive replacement requires --yes.");
297
+ if (!options.dryRun && !options.yes && !await confirmReplace(options.thread.length))
298
+ return;
299
+ const source = sourceName(options.source);
300
+ const adapter = sourceAdapter(source);
301
+ const summaries = await adapter.discover({ workspace: options.workspace });
302
+ const selected = [...new Set(options.thread)].map((id) => {
303
+ const summary = summaries.find((item) => item.id === id);
304
+ if (!summary)
305
+ throw usageError(`Conversation not found in workspace: ${id}`);
306
+ return summary;
307
+ });
308
+ const loaded = await Promise.all(selected.map(async (summary) => ({ conversation: await adapter.load(summary, { workspace: options.workspace }) })));
309
+ const paths = resolveTargetPaths(globalOverrides());
310
+ const result = await replaceConversations(loaded, paths, { ...globalOverrides(), dryRun: Boolean(options.dryRun) });
311
+ await attachCacheReset(result, paths, result.results.some((item) => item.status === "replaced"));
312
+ print(result);
313
+ if (result.hasConflicts)
314
+ process.exitCode = 7;
315
+ });
316
+ program.command("sync")
317
+ .description("Append new turns to imported tasks and safely adopt matching native Codex threads")
318
+ .addOption(new Option("--source <source>", "codex, claude, or opencode"))
319
+ .option("--workspace <path>")
320
+ .option("--thread <id>", "source conversation id (repeatable)", collect, [])
321
+ .option("--all", "synchronize linked tasks; omit --workspace to scan all Codex projects")
322
+ .option("--since <date>", "ISO date/time")
323
+ .option("--dry-run")
324
+ .option("--yes")
325
+ .option("--non-interactive")
326
+ .option("--summary", "print a compact synchronization report")
327
+ .action(async (options) => {
328
+ if (!options.source || (!options.workspace && !options.all) || (!options.all && options.thread.length === 0)) {
329
+ if (process.stdout.isTTY && !options.nonInteractive && !isJson()) {
330
+ const paths = resolveTargetPaths(globalOverrides());
331
+ const source = options.source ? sourceName(options.source) : undefined;
332
+ const provider = globalOverrides().providerInstance;
333
+ const instance = render(React.createElement(ImportTui, {
334
+ paths, mode: "sync",
335
+ ...(source ? { initialSource: source } : {}),
336
+ ...(options.workspace ? { initialWorkspace: options.workspace } : {}),
337
+ ...(provider ? { initialProvider: provider } : {}),
338
+ resetCache: shouldResetCache(),
339
+ }));
340
+ await instance.waitUntilExit();
341
+ return;
342
+ }
343
+ throw usageError("Non-interactive sync requires --source and either --all or --workspace with --thread.");
344
+ }
345
+ if (options.all && options.thread.length)
346
+ throw usageError("--all and --thread are mutually exclusive.");
347
+ if (!options.yes && (!process.stdout.isTTY || options.nonInteractive || isJson())) {
348
+ throw usageError("Non-interactive synchronization requires --yes.");
349
+ }
350
+ if (!options.dryRun && !options.yes) {
351
+ if (!await confirmSync(options.all ? 1 : options.thread.length))
352
+ return;
353
+ }
354
+ const source = sourceName(options.source);
355
+ const adapter = sourceAdapter(source);
356
+ if (options.all && !options.workspace) {
357
+ if (options.since)
358
+ throw usageError("--since requires --workspace when synchronizing; a global sync checks every linked conversation.");
359
+ const paths = resolveTargetPaths(globalOverrides());
360
+ const result = await syncAllLinkedConversations(adapter, paths, { ...globalOverrides(), dryRun: Boolean(options.dryRun) });
361
+ await attachCacheReset(result, paths, result.results.some((item) => item.status === "synced"));
362
+ printSync(result, options.summary);
363
+ if (result.hasConflicts)
364
+ process.exitCode = 7;
365
+ return;
366
+ }
367
+ const since = parseSince(options.since);
368
+ const summaries = await adapter.discover({ workspace: options.workspace, ...(since ? { since } : {}) });
369
+ const selected = options.all ? summaries : options.thread.map((id) => {
370
+ const summary = summaries.find((item) => item.id === id);
371
+ if (!summary)
372
+ throw usageError(`Conversation not found in workspace: ${id}`);
373
+ return summary;
374
+ });
375
+ const paths = resolveTargetPaths(globalOverrides());
376
+ const loaded = await Promise.all(selected.map(async (summary) => ({ conversation: await adapter.load(summary, { workspace: options.workspace }) })));
377
+ const eligible = options.all
378
+ ? (await Promise.all(loaded.map(async (selection) => ({ selection, preview: await inspectConversationSync(selection.conversation, paths) })))).filter((item) => item.preview.previouslyImported).map((item) => item.selection)
379
+ : loaded;
380
+ const result = await syncConversations(eligible, paths, { ...globalOverrides(), dryRun: Boolean(options.dryRun) });
381
+ await attachCacheReset(result, paths, result.results.some((item) => item.status === "synced"));
382
+ printSync(result, options.summary);
383
+ if (result.hasConflicts)
384
+ process.exitCode = 7;
385
+ });
386
+ try {
387
+ await program.parseAsync(process.argv);
388
+ }
389
+ catch (error) {
390
+ if (isJson())
391
+ console.log(JSON.stringify({ schemaVersion: 1, status: "error", error: error instanceof Error ? error.message : String(error) }));
392
+ else
393
+ console.error(error instanceof Error ? error.message : String(error));
394
+ process.exitCode = error instanceof ImporterError ? error.exitCode : error instanceof z.ZodError ? 2 : 6;
395
+ }
396
+ finally {
397
+ await disposeSourceAdapters();
398
+ }
399
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,a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