t3code-session-manager 0.0.0-stage → 0.4.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.
- package/.claude-plugin/marketplace.json +21 -0
- package/.claude-plugin/plugin.json +19 -0
- package/CHANGELOG.md +149 -0
- package/LICENSE +21 -0
- package/README.md +661 -2
- package/README.pt.md +617 -0
- package/bin/entry.d.mts +2 -0
- package/bin/entry.mjs +19 -0
- package/bin/t3sm.mjs +44 -0
- package/commands/import.md +30 -0
- package/commands/organize.md +36 -0
- package/commands/status.md +24 -0
- package/commands/sync.md +26 -0
- package/dist/apply/apply.js +993 -0
- package/dist/apply/claudeWriter.js +168 -0
- package/dist/apply/copyTranscript.js +116 -0
- package/dist/apply/importer.js +697 -0
- package/dist/apply/materialize.js +335 -0
- package/dist/apply/waves.js +108 -0
- package/dist/assistant/core.js +295 -0
- package/dist/assistant/deps.js +256 -0
- package/dist/assistant/i18n.js +38 -0
- package/dist/assistant/messages.en.js +494 -0
- package/dist/assistant/messages.pt.js +495 -0
- package/dist/assistant/runner.js +64 -0
- package/dist/assistant/steps.js +1362 -0
- package/dist/build.json +1 -0
- package/dist/cli/applyScreen.js +158 -0
- package/dist/cli/commands/accounts.js +254 -0
- package/dist/cli/commands/apply.js +199 -0
- package/dist/cli/commands/changelog.js +61 -0
- package/dist/cli/commands/doctor.js +105 -0
- package/dist/cli/commands/help.js +158 -0
- package/dist/cli/commands/merge.js +224 -0
- package/dist/cli/commands/organize.js +872 -0
- package/dist/cli/commands/plan.js +161 -0
- package/dist/cli/commands/projects.js +430 -0
- package/dist/cli/commands/quarantine.js +203 -0
- package/dist/cli/commands/recover.js +230 -0
- package/dist/cli/commands/rollback.js +281 -0
- package/dist/cli/commands/scan.js +117 -0
- package/dist/cli/commands/schedule.js +288 -0
- package/dist/cli/commands/start.js +45 -0
- package/dist/cli/commands/status.js +615 -0
- package/dist/cli/commands/sync.js +336 -0
- package/dist/cli/commands/update.js +398 -0
- package/dist/cli/errors.js +53 -0
- package/dist/cli/failures.js +91 -0
- package/dist/cli/flags.js +53 -0
- package/dist/cli/help.en.js +549 -0
- package/dist/cli/help.pt.js +566 -0
- package/dist/cli/helpText.js +211 -0
- package/dist/cli/helpTopics.js +58 -0
- package/dist/cli/locked.js +12 -0
- package/dist/cli/main.js +155 -0
- package/dist/cli/screen.js +3 -0
- package/dist/cli/ui.js +111 -0
- package/dist/cli/words.js +2 -0
- package/dist/core/activity.js +16 -0
- package/dist/core/changelog.js +47 -0
- package/dist/core/config.js +530 -0
- package/dist/core/fsutil.js +171 -0
- package/dist/core/glob.js +34 -0
- package/dist/core/history.js +32 -0
- package/dist/core/journal.js +274 -0
- package/dist/core/lock.js +337 -0
- package/dist/core/mask.js +31 -0
- package/dist/core/paths.js +68 -0
- package/dist/core/pid.js +101 -0
- package/dist/core/run.js +4 -0
- package/dist/core/semver.js +18 -0
- package/dist/core/sysroot.js +29 -0
- package/dist/core/types.js +229 -0
- package/dist/core/uuid.js +29 -0
- package/dist/core/version.js +72 -0
- package/dist/help/convert.md +20 -0
- package/dist/help/convert.pt.md +21 -0
- package/dist/help/cwd-unreadable.md +22 -0
- package/dist/help/cwd-unreadable.pt.md +22 -0
- package/dist/help/decisions.md +20 -0
- package/dist/help/decisions.pt.md +20 -0
- package/dist/help/errors.md +20 -0
- package/dist/help/errors.pt.md +22 -0
- package/dist/help/held.md +20 -0
- package/dist/help/held.pt.md +20 -0
- package/dist/help/history.md +27 -0
- package/dist/help/history.pt.md +29 -0
- package/dist/help/instance-unavailable.md +18 -0
- package/dist/help/instance-unavailable.pt.md +19 -0
- package/dist/help/not-imported.md +19 -0
- package/dist/help/not-imported.pt.md +19 -0
- package/dist/help/orphaned.md +19 -0
- package/dist/help/orphaned.pt.md +19 -0
- package/dist/help/project-mismatch.md +15 -0
- package/dist/help/project-mismatch.pt.md +15 -0
- package/dist/help/t3-native.md +22 -0
- package/dist/help/t3-native.pt.md +22 -0
- package/dist/help/updates.md +26 -0
- package/dist/help/updates.pt.md +28 -0
- package/dist/help/watcher.md +24 -0
- package/dist/help/watcher.pt.md +25 -0
- package/dist/i18n/cli.js +41 -0
- package/dist/i18n/lang.js +55 -0
- package/dist/i18n/messages.en.js +1140 -0
- package/dist/i18n/messages.pt.js +1149 -0
- package/dist/i18n/words.js +12 -0
- package/dist/ops/accounts.js +170 -0
- package/dist/ops/autoUpdate.js +223 -0
- package/dist/ops/discoverAccounts.js +343 -0
- package/dist/ops/doctor.js +811 -0
- package/dist/ops/elevated.js +47 -0
- package/dist/ops/errorCodes.js +39 -0
- package/dist/ops/follow.js +558 -0
- package/dist/ops/merge.js +830 -0
- package/dist/ops/notify.js +249 -0
- package/dist/ops/plugin.js +92 -0
- package/dist/ops/projects.js +113 -0
- package/dist/ops/quarantine.js +415 -0
- package/dist/ops/rollback.js +868 -0
- package/dist/ops/schedule.js +464 -0
- package/dist/ops/successor.js +51 -0
- package/dist/ops/sync.js +859 -0
- package/dist/ops/syncStatus.js +290 -0
- package/dist/ops/update.js +273 -0
- package/dist/ops/updater.js +641 -0
- package/dist/ops/watch.js +676 -0
- package/dist/ops/watcherControl.js +212 -0
- package/dist/ops/watcherHealth.js +75 -0
- package/dist/organize/apply.js +495 -0
- package/dist/organize/history.js +192 -0
- package/dist/organize/plan.js +283 -0
- package/dist/organize/rename.js +58 -0
- package/dist/organize/sessions.js +100 -0
- package/dist/organize/titles.js +70 -0
- package/dist/organize/types.js +73 -0
- package/dist/plan/categories.js +104 -0
- package/dist/plan/dedupe.js +137 -0
- package/dist/plan/folders.js +82 -0
- package/dist/plan/names.js +93 -0
- package/dist/plan/ownership.js +316 -0
- package/dist/plan/planner.js +669 -0
- package/dist/plan/rehome.js +101 -0
- package/dist/plan/report.js +407 -0
- package/dist/sources/cache.js +89 -0
- package/dist/sources/claude.js +297 -0
- package/dist/sources/codex.js +496 -0
- package/dist/sources/flatten.js +23 -0
- package/dist/sources/jsonl.js +169 -0
- package/dist/sources/native.js +233 -0
- package/dist/sources/opencode.js +483 -0
- package/dist/sources/pi.js +133 -0
- package/dist/sources/registry.js +67 -0
- package/dist/sources/types.js +80 -0
- package/dist/t3/api.js +492 -0
- package/dist/t3/auth.js +248 -0
- package/dist/t3/compat.js +62 -0
- package/dist/t3/decode.js +408 -0
- package/dist/t3/errors.js +185 -0
- package/dist/t3/rpc.js +185 -0
- package/dist/t3/runtime.js +80 -0
- package/dist/ui/caps.js +56 -0
- package/dist/ui/components.js +202 -0
- package/dist/ui/layout.js +205 -0
- package/dist/ui/list.js +423 -0
- package/dist/ui/locale.js +73 -0
- package/dist/ui/organizePreview.js +72 -0
- package/dist/ui/progress.js +237 -0
- package/dist/ui/style.js +32 -0
- package/dist/ui/terminal.js +126 -0
- package/dist/ui/text.js +186 -0
- package/package.json +58 -4
- package/skills/t3code-sessions/SKILL.md +183 -0
package/bin/entry.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Which entry point bin/t3sm.mjs runs. A checkout (src/ next to bin/, not inside node_modules) runs the TypeScript
|
|
2
|
+
// sources directly (Node type stripping), so a stale gitignored dist/ can never shadow them; an installed package
|
|
3
|
+
// runs its compiled dist/. Neither present: the caller tells the user to build.
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {URL} binUrl URL of bin/t3sm.mjs
|
|
9
|
+
* @param {(u: URL) => boolean} [exists]
|
|
10
|
+
* @returns {{ kind: "src" | "dist"; url: string } | { kind: "none" }}
|
|
11
|
+
*/
|
|
12
|
+
export function resolveEntry(binUrl, exists = (u) => existsSync(u)) {
|
|
13
|
+
const src = new URL("../src/cli/main.ts", binUrl);
|
|
14
|
+
const dist = new URL("../dist/cli/main.js", binUrl);
|
|
15
|
+
const installed = fileURLToPath(new URL("..", binUrl)).split(/[\\/]+/).includes("node_modules");
|
|
16
|
+
if (!installed && exists(src)) return { kind: "src", url: src.href };
|
|
17
|
+
if (exists(dist)) return { kind: "dist", url: dist.href };
|
|
18
|
+
return { kind: "none" };
|
|
19
|
+
}
|
package/bin/t3sm.mjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createInterface } from "node:readline/promises";
|
|
3
|
+
import { resolveEntry } from "./entry.mjs";
|
|
4
|
+
|
|
5
|
+
// The OpenCode adapter reads a private copy of OpenCode's database with node:sqlite, which Node 22/24 still label
|
|
6
|
+
// experimental: drop that one warning (it would print on every run for OpenCode users); every other warning stays.
|
|
7
|
+
const emitWarning = process.emitWarning;
|
|
8
|
+
process.emitWarning = function (warning, ...rest) {
|
|
9
|
+
if (String(warning?.message ?? warning).startsWith("SQLite is an experimental feature")) return;
|
|
10
|
+
return emitWarning.call(process, warning, ...rest);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// A checkout runs src/ (never a stale dist/); an installed package runs dist/ (bin/entry.mjs).
|
|
14
|
+
const entry = resolveEntry(new URL(import.meta.url));
|
|
15
|
+
if (entry.kind === "none") {
|
|
16
|
+
process.stderr.write("t3sm: neither src/cli/main.ts nor dist/cli/main.js was found. Run `npm run build`.\n");
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const { main } = await import(entry.url);
|
|
20
|
+
|
|
21
|
+
const io = {
|
|
22
|
+
stdout: (s) => void process.stdout.write(s),
|
|
23
|
+
stderr: (s) => void process.stderr.write(s),
|
|
24
|
+
isTTY: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
25
|
+
// Ctrl+C at a prompt, or input closed (Ctrl+D / Ctrl+Z), answers "\u0003": every confirmation reads it as "no", the
|
|
26
|
+
// guided assistant as "quit". Ctrl+C while a command runs is that command's own signal handling.
|
|
27
|
+
prompt: async (q) => {
|
|
28
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
29
|
+
const ac = new AbortController();
|
|
30
|
+
rl.on("SIGINT", () => ac.abort());
|
|
31
|
+
rl.on("close", () => ac.abort());
|
|
32
|
+
try {
|
|
33
|
+
return await rl.question(q, { signal: ac.signal });
|
|
34
|
+
} catch (e) {
|
|
35
|
+
if (e?.name === "AbortError") { process.stderr.write("\n"); return "\u0003"; }
|
|
36
|
+
throw e;
|
|
37
|
+
} finally {
|
|
38
|
+
rl.close();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
env: process.env,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
process.exitCode = await main(process.argv.slice(2), io);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Bring old Claude Code, Codex, Pi and OpenCode history into T3 Code: plan, review, then import after a yes.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Import the user's existing agent sessions into T3 Code as resumable threads, each under the Claude account it was
|
|
6
|
+
run with. Review first, write only after a yes.
|
|
7
|
+
|
|
8
|
+
1. Run the read-only form (it changes nothing in T3 Code or in your sessions; it only saves the plan in t3sm's own folder) and show the result to the user:
|
|
9
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm plan`
|
|
10
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm plan`
|
|
11
|
+
|
|
12
|
+
Always run t3sm with `CLAUDE_CONFIG_DIR` removed, as above: t3sm reads every Claude account itself. If `t3sm` is not installed, use the pinned release described in the `t3code-sessions` skill instead. Exit code 3
|
|
13
|
+
means T3 Code is not running: ask the user to open it from the Start menu or their launcher.
|
|
14
|
+
2. Read the `plan.md` it names and tell the user, briefly: the totals (import, convert, skip), the new projects,
|
|
15
|
+
which account each project opens with, and every warning. Ask whether any project is under the wrong account.
|
|
16
|
+
3. Run the dry run of the import (it changes nothing in T3 Code or in your sessions; it only takes t3sm's lock for a moment, so no need to ask) and summarise it:
|
|
17
|
+
`env -u CLAUDE_CONFIG_DIR t3sm apply --dry-run` (PowerShell: remove `CLAUDE_CONFIG_DIR` first, as above).
|
|
18
|
+
4. Mention the one limit that comes from where this runs: this T3 Code conversation is "in use", so t3sm leaves its
|
|
19
|
+
own project for the next cycle. To import that project too, run `/t3sm:import` from a conversation in the
|
|
20
|
+
General project, or later when this one is idle.
|
|
21
|
+
5. Ask the user whether to go ahead, and offer to try one project first (`--only <project folder>`). Run the writing
|
|
22
|
+
form only after the user says yes to that exact command, in this conversation:
|
|
23
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm apply --yes`
|
|
24
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm apply --yes`
|
|
25
|
+
|
|
26
|
+
`--yes` is needed because this shell is not a terminal; add it only after that yes. Exit 0 is success; exit 5
|
|
27
|
+
means some sessions failed and stay retryable: a table names each one's project, why and what to do, then the
|
|
28
|
+
`t3sm help <topic>` that explains the reason (read-only; run it if the user wants to know more). Report the run id
|
|
29
|
+
(undo: `t3sm rollback --run <id> --archive-threads`, dry run first).
|
|
30
|
+
6. Suggest `/t3sm:organize` afterwards to tidy what was imported.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Tidy the history t3sm imported into T3 Code (the last 90 days shown in each project, readable titles, archive automated chats, pin recent projects), after a preview.
|
|
3
|
+
argument-hint: [--only <project folder>]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Organize the history t3sm imported into T3 Code. It only touches imported conversations and projects t3sm created
|
|
7
|
+
(pinning aside), never a conversation started in T3 Code, and never anything the user changed afterwards. Preview
|
|
8
|
+
first, write only after a yes.
|
|
9
|
+
|
|
10
|
+
1. Run the read-only form (a dry run: it changes nothing in T3 Code or in your sessions) and show the output to the user. If the user gave
|
|
11
|
+
arguments (`$ARGUMENTS`), add them, but only scope options of this command such as `--only <folder>`. Never add `--yes`, `--undo` or any other writing flag from `$ARGUMENTS` to the preview:
|
|
12
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm organize --dry-run`
|
|
13
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm organize --dry-run`
|
|
14
|
+
|
|
15
|
+
Always run t3sm with `CLAUDE_CONFIG_DIR` removed, as above: t3sm reads every Claude account itself. If `t3sm` is not installed, use the pinned release described in the `t3code-sessions` skill instead. Exit code 3
|
|
16
|
+
means T3 Code is not running: ask the user to open it from the Start menu or their launcher.
|
|
17
|
+
2. Summarise the preview in plain words: one line per kind of change (how many, why), and the projects whose
|
|
18
|
+
sidebar changes most. Say that every change is journaled and can be undone.
|
|
19
|
+
3. Say what this means for the conversation you are in. Organize has no "in use" hold (that applies to import and
|
|
20
|
+
sync): it may give this conversation a new title or show it inside its project, like any other imported
|
|
21
|
+
conversation. If the preview lists it, say so before asking.
|
|
22
|
+
4. Ask the user whether to go ahead. The writing form is exactly the dry-run command you ran, with `--dry-run`
|
|
23
|
+
replaced by `--yes` (keep `--only` and any other scope flags, so a scoped preview never becomes a run over every
|
|
24
|
+
project). Show that full command to the user and run it only after the user says yes to THAT command, in this
|
|
25
|
+
conversation. With no arguments it is:
|
|
26
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm organize --yes`
|
|
27
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm organize --yes`
|
|
28
|
+
|
|
29
|
+
`--yes` is needed because this shell is not a terminal; add it only after that yes. Report the run id.
|
|
30
|
+
5. To undo, run the read-only form first and show it:
|
|
31
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm organize --undo --dry-run`
|
|
32
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm organize --undo --dry-run`
|
|
33
|
+
|
|
34
|
+
Show the full command (`env -u CLAUDE_CONFIG_DIR t3sm organize --undo <run id> --yes`, with the run id from that
|
|
35
|
+
dry run or from `t3sm runs`) and run it only after the user says yes to that exact command, in this conversation.
|
|
36
|
+
Say which run it is.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show whether t3sm needs anything from you (decisions, the background watcher, updates, held projects, last sync, plugin). Read-only.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Tell the user, in plain words, whether t3sm needs anything from them. This command only reads; it never writes.
|
|
6
|
+
|
|
7
|
+
1. Run the read-only command and show its output to the user:
|
|
8
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm status`
|
|
9
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm status`
|
|
10
|
+
|
|
11
|
+
Always run t3sm with `CLAUDE_CONFIG_DIR` removed, as above: t3sm reads every Claude account itself, and this
|
|
12
|
+
conversation's own account folder must not leak into it. If `t3sm` is not installed, use the pinned release
|
|
13
|
+
described in the `t3code-sessions` skill instead.
|
|
14
|
+
Exit code 10 means "something needs you", not an error: read the output as usual. Only another non-zero code
|
|
15
|
+
(1, 2) is a failure of the command itself.
|
|
16
|
+
2. Explain what it says in two or three short sentences. The first line is the level: "All good", "Needs you (N)"
|
|
17
|
+
or "Working" (a t3sm run is in progress). For each item that needs the user, say what it is and quote the
|
|
18
|
+
command shown under it (the line starting with `›`, or `>` in a plain console); for a conversation continued
|
|
19
|
+
twice, say what it says (continue the one they want in T3 Code, archive the other). Mention the "Worth knowing"
|
|
20
|
+
lines only briefly. If the user asks what an item means, `t3sm help <topic>` (read-only; `t3sm help` lists the
|
|
21
|
+
topics) explains it in their language.
|
|
22
|
+
3. Do not run any command that writes (`sync` without `--dry-run`, `organize`, `apply`, `rollback`, ...) from here.
|
|
23
|
+
If the user wants one, point them to `/t3sm:sync`, `/t3sm:organize` or `/t3sm:import`. A writing command runs
|
|
24
|
+
only after the user says yes to that exact command, in this conversation.
|
package/commands/sync.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Import the agent sessions that are new since the last sync into T3 Code, after showing what would change.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Bring new Claude Code, Codex, Pi and OpenCode sessions into T3 Code. Review first, write only after a yes.
|
|
6
|
+
|
|
7
|
+
1. Run the read-only form (a dry run: it changes nothing in T3 Code or in your sessions) and show the output to the user:
|
|
8
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm sync --dry-run`
|
|
9
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm sync --dry-run`
|
|
10
|
+
|
|
11
|
+
Always run t3sm with `CLAUDE_CONFIG_DIR` removed, as above: t3sm reads every Claude account itself. If `t3sm` is not installed, use the pinned release described in the `t3code-sessions` skill instead. Exit code 3
|
|
12
|
+
means T3 Code is not running: ask the user to open it from the Start menu or their launcher, not from a shell
|
|
13
|
+
that sets `CLAUDE_CONFIG_DIR`.
|
|
14
|
+
2. Summarise it briefly: how many sessions would be imported, which projects they go to, and anything it holds back.
|
|
15
|
+
3. Mention the one limit that comes from where this runs: this T3 Code conversation is "in use", so t3sm leaves its
|
|
16
|
+
own project for the next cycle (it is retried once the conversation has been idle for about ten minutes). To
|
|
17
|
+
bring that project in too, run `/t3sm:sync` from a conversation in the General project.
|
|
18
|
+
4. Ask the user whether to go ahead. Run the writing form only after the user says yes to that exact command, in
|
|
19
|
+
this conversation (a yes to an earlier question does not count):
|
|
20
|
+
- Bash: `env -u CLAUDE_CONFIG_DIR t3sm sync`
|
|
21
|
+
- PowerShell: `Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue; t3sm sync`
|
|
22
|
+
|
|
23
|
+
`sync` is the unattended command: it never asks and takes no `--yes` (it refuses an option it does not know), so
|
|
24
|
+
the user's yes here is the only confirmation. Report the run id it prints and say it can be undone with
|
|
25
|
+
`t3sm rollback --run <id>` (dry run first). If some conversations could not be imported, the output names the
|
|
26
|
+
`t3sm help <topic>` that explains each reason; run that (read-only) and summarise it.
|