dexto 1.14.6 → 2.0.0-beta.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/dist/agents/coding-agent/coding-agent.yml +0 -2
- package/dist/cli/agent-audit.d.ts +12 -0
- package/dist/cli/agent-audit.d.ts.map +1 -0
- package/dist/cli/agent-audit.js +52 -0
- package/dist/cli/auth/billing.d.ts +0 -6
- package/dist/cli/auth/billing.d.ts.map +1 -1
- package/dist/cli/auth/billing.js +0 -23
- package/dist/cli/auth/constants.d.ts +3 -31
- package/dist/cli/auth/constants.d.ts.map +1 -1
- package/dist/cli/auth/constants.js +9 -33
- package/dist/cli/auth/index.d.ts +2 -9
- package/dist/cli/auth/index.d.ts.map +1 -1
- package/dist/cli/auth/index.js +2 -7
- package/dist/cli/auth/sign-in-runtime.d.ts +12 -0
- package/dist/cli/auth/sign-in-runtime.d.ts.map +1 -0
- package/dist/cli/auth/sign-in-runtime.js +59 -0
- package/dist/cli/cloud/app-scopes.d.ts +4 -0
- package/dist/cli/cloud/app-scopes.d.ts.map +1 -0
- package/dist/cli/cloud/app-scopes.js +19 -0
- package/dist/cli/cloud/command.d.ts +107 -0
- package/dist/cli/cloud/command.d.ts.map +1 -0
- package/dist/cli/cloud/command.js +154 -0
- package/dist/cli/cloud/commands/account.d.ts +11 -0
- package/dist/cli/cloud/commands/account.d.ts.map +1 -0
- package/dist/cli/cloud/commands/account.js +129 -0
- package/dist/cli/cloud/commands/agents.d.ts +3 -0
- package/dist/cli/cloud/commands/agents.d.ts.map +1 -0
- package/dist/cli/cloud/commands/agents.js +526 -0
- package/dist/cli/cloud/commands/api.d.ts +3 -0
- package/dist/cli/cloud/commands/api.d.ts.map +1 -0
- package/dist/cli/cloud/commands/api.js +26 -0
- package/dist/cli/cloud/commands/app-files.d.ts +29 -0
- package/dist/cli/cloud/commands/app-files.d.ts.map +1 -0
- package/dist/cli/cloud/commands/app-files.js +72 -0
- package/dist/cli/cloud/commands/artifacts.d.ts +3 -0
- package/dist/cli/cloud/commands/artifacts.d.ts.map +1 -0
- package/dist/cli/cloud/commands/artifacts.js +267 -0
- package/dist/cli/cloud/commands/automations.d.ts +3 -0
- package/dist/cli/cloud/commands/automations.d.ts.map +1 -0
- package/dist/cli/cloud/commands/automations.js +233 -0
- package/dist/cli/cloud/commands/chats.d.ts +3 -0
- package/dist/cli/cloud/commands/chats.d.ts.map +1 -0
- package/dist/cli/cloud/commands/chats.js +204 -0
- package/dist/cli/cloud/commands/data-deletions.d.ts +3 -0
- package/dist/cli/cloud/commands/data-deletions.d.ts.map +1 -0
- package/dist/cli/cloud/commands/data-deletions.js +55 -0
- package/dist/cli/cloud/commands/deploys.d.ts +10 -0
- package/dist/cli/cloud/commands/deploys.d.ts.map +1 -0
- package/dist/cli/cloud/commands/deploys.js +225 -0
- package/dist/cli/cloud/commands/drive.d.ts +12 -0
- package/dist/cli/cloud/commands/drive.d.ts.map +1 -0
- package/dist/cli/cloud/commands/drive.js +321 -0
- package/dist/cli/cloud/commands/files.d.ts +24 -0
- package/dist/cli/cloud/commands/files.d.ts.map +1 -0
- package/dist/cli/cloud/commands/files.js +284 -0
- package/dist/cli/cloud/commands/find.d.ts +3 -0
- package/dist/cli/cloud/commands/find.d.ts.map +1 -0
- package/dist/cli/cloud/commands/find.js +63 -0
- package/dist/cli/cloud/commands/models.d.ts +3 -0
- package/dist/cli/cloud/commands/models.d.ts.map +1 -0
- package/dist/cli/cloud/commands/models.js +250 -0
- package/dist/cli/cloud/commands/profile.d.ts +3 -0
- package/dist/cli/cloud/commands/profile.d.ts.map +1 -0
- package/dist/cli/cloud/commands/profile.js +120 -0
- package/dist/cli/cloud/commands/projects.d.ts +5 -0
- package/dist/cli/cloud/commands/projects.d.ts.map +1 -0
- package/dist/cli/cloud/commands/projects.js +66 -0
- package/dist/cli/cloud/commands/publish.d.ts +3 -0
- package/dist/cli/cloud/commands/publish.d.ts.map +1 -0
- package/dist/cli/cloud/commands/publish.js +139 -0
- package/dist/cli/cloud/commands/sandboxes.d.ts +3 -0
- package/dist/cli/cloud/commands/sandboxes.d.ts.map +1 -0
- package/dist/cli/cloud/commands/sandboxes.js +266 -0
- package/dist/cli/cloud/commands/secrets.d.ts +3 -0
- package/dist/cli/cloud/commands/secrets.d.ts.map +1 -0
- package/dist/cli/cloud/commands/secrets.js +111 -0
- package/dist/cli/cloud/commands/skills.d.ts +3 -0
- package/dist/cli/cloud/commands/skills.d.ts.map +1 -0
- package/dist/cli/cloud/commands/skills.js +203 -0
- package/dist/cli/cloud/commands/traces.d.ts +3 -0
- package/dist/cli/cloud/commands/traces.d.ts.map +1 -0
- package/dist/cli/cloud/commands/traces.js +142 -0
- package/dist/cli/cloud/commands/web.d.ts +3 -0
- package/dist/cli/cloud/commands/web.d.ts.map +1 -0
- package/dist/cli/cloud/commands/web.js +53 -0
- package/dist/cli/cloud/commands/workspace-apps.d.ts +58 -0
- package/dist/cli/cloud/commands/workspace-apps.d.ts.map +1 -0
- package/dist/cli/cloud/commands/workspace-apps.js +657 -0
- package/dist/cli/cloud/commands/workspace.d.ts +36 -0
- package/dist/cli/cloud/commands/workspace.d.ts.map +1 -0
- package/dist/cli/cloud/commands/workspace.js +281 -0
- package/dist/cli/cloud/connection.d.ts +33 -0
- package/dist/cli/cloud/connection.d.ts.map +1 -0
- package/dist/cli/cloud/connection.js +38 -0
- package/dist/cli/cloud/events.d.ts +63 -0
- package/dist/cli/cloud/events.d.ts.map +1 -0
- package/dist/cli/cloud/events.js +72 -0
- package/dist/cli/cloud/host.d.ts +9 -0
- package/dist/cli/cloud/host.d.ts.map +1 -0
- package/dist/cli/cloud/host.js +109 -0
- package/dist/cli/cloud/output.d.ts +34 -0
- package/dist/cli/cloud/output.d.ts.map +1 -0
- package/dist/cli/cloud/output.js +77 -0
- package/dist/cli/cloud/run.d.ts +26 -0
- package/dist/cli/cloud/run.d.ts.map +1 -0
- package/dist/cli/cloud/run.js +444 -0
- package/dist/cli/cloud/runtime.d.ts +33 -0
- package/dist/cli/cloud/runtime.d.ts.map +1 -0
- package/dist/cli/cloud/runtime.js +86 -0
- package/dist/cli/cloud/tar.d.ts +9 -0
- package/dist/cli/cloud/tar.d.ts.map +1 -0
- package/dist/cli/cloud/tar.js +69 -0
- package/dist/cli/cloud/transfer.d.ts +13 -0
- package/dist/cli/cloud/transfer.d.ts.map +1 -0
- package/dist/cli/cloud/transfer.js +36 -0
- package/dist/cli/cloud/v1.d.ts +20 -0
- package/dist/cli/cloud/v1.d.ts.map +1 -0
- package/dist/cli/cloud/v1.js +66 -0
- package/dist/cli/cloud/zip.d.ts +8 -0
- package/dist/cli/cloud/zip.d.ts.map +1 -0
- package/dist/cli/cloud/zip.js +66 -0
- package/dist/cli/commands/auth/sign-in-commands.d.ts +62 -0
- package/dist/cli/commands/auth/sign-in-commands.d.ts.map +1 -0
- package/dist/cli/commands/auth/sign-in-commands.js +248 -0
- package/dist/cli/commands/auth/sign-in-context.d.ts +16 -0
- package/dist/cli/commands/auth/sign-in-context.d.ts.map +1 -0
- package/dist/cli/commands/auth/sign-in-context.js +68 -0
- package/dist/cli/commands/cloud/register.d.ts +5 -0
- package/dist/cli/commands/cloud/register.d.ts.map +1 -1
- package/dist/cli/commands/cloud/register.js +44 -24
- package/dist/cli/commands/create-app.js +5 -6
- package/dist/cli/commands/create-image.d.ts.map +1 -1
- package/dist/cli/commands/create-image.js +9 -10
- package/dist/cli/commands/index.d.ts +0 -2
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +0 -2
- package/dist/cli/commands/init.d.ts +0 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +5 -26
- package/dist/cli/commands/run/headless.d.ts.map +1 -1
- package/dist/cli/commands/run/headless.js +57 -2
- package/dist/cli/commands/run/output.d.ts +29 -10
- package/dist/cli/commands/run/output.d.ts.map +1 -1
- package/dist/cli/commands/run/output.js +44 -22
- package/dist/cli/commands/run/register.d.ts.map +1 -1
- package/dist/cli/commands/run/register.js +21 -9
- package/dist/cli/commands/run/step-log.d.ts +11 -0
- package/dist/cli/commands/run/step-log.d.ts.map +1 -0
- package/dist/cli/commands/run/step-log.js +42 -0
- package/dist/cli/commands/session/register.d.ts.map +1 -1
- package/dist/cli/commands/session/register.js +51 -21
- package/dist/cli/commands/session-commands.js +1 -1
- package/dist/cli/commands/setup.js +17 -14
- package/dist/cli/failure.d.ts +29 -0
- package/dist/cli/failure.d.ts.map +1 -0
- package/dist/cli/failure.js +31 -0
- package/dist/cli/help-json.d.ts +22 -0
- package/dist/cli/help-json.d.ts.map +1 -0
- package/dist/cli/help-json.js +20 -0
- package/dist/cli/import/claude-code.d.ts +10 -0
- package/dist/cli/import/claude-code.d.ts.map +1 -0
- package/dist/cli/import/claude-code.js +131 -0
- package/dist/cli/import/codex.d.ts +27 -0
- package/dist/cli/import/codex.d.ts.map +1 -0
- package/dist/cli/import/codex.js +148 -0
- package/dist/cli/import/git.d.ts +19 -0
- package/dist/cli/import/git.d.ts.map +1 -0
- package/dist/cli/import/git.js +95 -0
- package/dist/cli/import/local-chats.d.ts +28 -0
- package/dist/cli/import/local-chats.d.ts.map +1 -0
- package/dist/cli/import/local-chats.js +129 -0
- package/dist/cli/import/redaction.d.ts +37 -0
- package/dist/cli/import/redaction.d.ts.map +1 -0
- package/dist/cli/import/redaction.js +148 -0
- package/dist/cli/import/test-utils.d.ts +16 -0
- package/dist/cli/import/test-utils.d.ts.map +1 -0
- package/dist/cli/import/test-utils.js +223 -0
- package/dist/cli/import/transcript.d.ts +75 -0
- package/dist/cli/import/transcript.d.ts.map +1 -0
- package/dist/cli/import/transcript.js +123 -0
- package/dist/cli/interaction.d.ts +18 -0
- package/dist/cli/interaction.d.ts.map +1 -0
- package/dist/cli/interaction.js +30 -0
- package/dist/cli/modes/cli.d.ts.map +1 -1
- package/dist/cli/modes/cli.js +42 -9
- package/dist/cli/modes/server.js +8 -8
- package/dist/cli/modes/web.js +3 -3
- package/dist/cli/output.d.ts +9 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +6 -0
- package/dist/cli/utils/dexto-auth-check.d.ts +1 -1
- package/dist/cli/utils/dexto-auth-check.d.ts.map +1 -1
- package/dist/cli/utils/dexto-auth-check.js +4 -5
- package/dist/cli/utils/dexto-setup.d.ts +4 -5
- package/dist/cli/utils/dexto-setup.d.ts.map +1 -1
- package/dist/cli/utils/dexto-setup.js +17 -14
- package/dist/cli/utils/provider-setup.js +1 -1
- package/dist/cli/utils/scaffolding-utils.d.ts +9 -3
- package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -1
- package/dist/cli/utils/scaffolding-utils.js +48 -40
- package/dist/cli/utils/version-check.d.ts.map +1 -1
- package/dist/cli/utils/version-check.js +2 -1
- package/dist/index-main.js +44 -65
- package/dist/webui/assets/index-D9xiOs62.js +1649 -0
- package/dist/webui/index.html +1 -1
- package/package.json +15 -14
- package/dist/cli/auth/api-client.d.ts +0 -125
- package/dist/cli/auth/api-client.d.ts.map +0 -1
- package/dist/cli/auth/api-client.js +0 -585
- package/dist/cli/auth/device.d.ts +0 -14
- package/dist/cli/auth/device.d.ts.map +0 -1
- package/dist/cli/auth/device.js +0 -84
- package/dist/cli/auth/dexto-api-key.d.ts +0 -34
- package/dist/cli/auth/dexto-api-key.d.ts.map +0 -1
- package/dist/cli/auth/dexto-api-key.js +0 -160
- package/dist/cli/auth/login-persistence.d.ts +0 -15
- package/dist/cli/auth/login-persistence.d.ts.map +0 -1
- package/dist/cli/auth/login-persistence.js +0 -72
- package/dist/cli/auth/oauth.d.ts +0 -39
- package/dist/cli/auth/oauth.d.ts.map +0 -1
- package/dist/cli/auth/oauth.js +0 -434
- package/dist/cli/auth/service.d.ts +0 -24
- package/dist/cli/auth/service.d.ts.map +0 -1
- package/dist/cli/auth/service.js +0 -161
- package/dist/cli/auth/types.d.ts +0 -11
- package/dist/cli/auth/types.d.ts.map +0 -1
- package/dist/cli/auth/types.js +0 -1
- package/dist/cli/cloud-chat.d.ts +0 -18
- package/dist/cli/cloud-chat.d.ts.map +0 -1
- package/dist/cli/cloud-chat.js +0 -734
- package/dist/cli/commands/auth/index.d.ts +0 -4
- package/dist/cli/commands/auth/index.d.ts.map +0 -1
- package/dist/cli/commands/auth/index.js +0 -4
- package/dist/cli/commands/auth/login.d.ts +0 -12
- package/dist/cli/commands/auth/login.d.ts.map +0 -1
- package/dist/cli/commands/auth/login.js +0 -153
- package/dist/cli/commands/auth/logout.d.ts +0 -5
- package/dist/cli/commands/auth/logout.d.ts.map +0 -1
- package/dist/cli/commands/auth/logout.js +0 -81
- package/dist/cli/commands/auth/register.d.ts +0 -3
- package/dist/cli/commands/auth/register.d.ts.map +0 -1
- package/dist/cli/commands/auth/register.js +0 -96
- package/dist/cli/commands/auth/status.d.ts +0 -2
- package/dist/cli/commands/auth/status.d.ts.map +0 -1
- package/dist/cli/commands/auth/status.js +0 -22
- package/dist/cli/commands/billing/index.d.ts +0 -2
- package/dist/cli/commands/billing/index.d.ts.map +0 -1
- package/dist/cli/commands/billing/index.js +0 -2
- package/dist/cli/commands/billing/register.d.ts +0 -3
- package/dist/cli/commands/billing/register.d.ts.map +0 -1
- package/dist/cli/commands/billing/register.js +0 -20
- package/dist/cli/commands/billing/status.d.ts +0 -8
- package/dist/cli/commands/billing/status.d.ts.map +0 -1
- package/dist/cli/commands/billing/status.js +0 -71
- package/dist/cli/commands/cloud/discovery.d.ts +0 -17
- package/dist/cli/commands/cloud/discovery.d.ts.map +0 -1
- package/dist/cli/commands/cloud/discovery.js +0 -88
- package/dist/cli/commands/deploy/client.d.ts +0 -113
- package/dist/cli/commands/deploy/client.d.ts.map +0 -1
- package/dist/cli/commands/deploy/client.js +0 -519
- package/dist/cli/commands/deploy/config.d.ts +0 -37
- package/dist/cli/commands/deploy/config.d.ts.map +0 -1
- package/dist/cli/commands/deploy/config.js +0 -144
- package/dist/cli/commands/deploy/entry-agent.d.ts +0 -3
- package/dist/cli/commands/deploy/entry-agent.d.ts.map +0 -1
- package/dist/cli/commands/deploy/entry-agent.js +0 -70
- package/dist/cli/commands/deploy/index.d.ts +0 -12
- package/dist/cli/commands/deploy/index.d.ts.map +0 -1
- package/dist/cli/commands/deploy/index.js +0 -370
- package/dist/cli/commands/deploy/links.d.ts +0 -3
- package/dist/cli/commands/deploy/links.d.ts.map +0 -1
- package/dist/cli/commands/deploy/links.js +0 -53
- package/dist/cli/commands/deploy/register.d.ts +0 -6
- package/dist/cli/commands/deploy/register.d.ts.map +0 -1
- package/dist/cli/commands/deploy/register.js +0 -128
- package/dist/cli/commands/deploy/snapshot.d.ts +0 -12
- package/dist/cli/commands/deploy/snapshot.d.ts.map +0 -1
- package/dist/cli/commands/deploy/snapshot.js +0 -76
- package/dist/cli/commands/deploy/state.d.ts +0 -13
- package/dist/cli/commands/deploy/state.d.ts.map +0 -1
- package/dist/cli/commands/deploy/state.js +0 -122
- package/dist/cli/commands/span/register.d.ts +0 -6
- package/dist/cli/commands/span/register.d.ts.map +0 -1
- package/dist/cli/commands/span/register.js +0 -25
- package/dist/cli/commands/trace/client.d.ts +0 -98
- package/dist/cli/commands/trace/client.d.ts.map +0 -1
- package/dist/cli/commands/trace/client.js +0 -150
- package/dist/cli/commands/trace/format.d.ts +0 -5
- package/dist/cli/commands/trace/format.d.ts.map +0 -1
- package/dist/cli/commands/trace/format.js +0 -58
- package/dist/cli/commands/trace/index.d.ts +0 -21
- package/dist/cli/commands/trace/index.d.ts.map +0 -1
- package/dist/cli/commands/trace/index.js +0 -49
- package/dist/cli/commands/trace/register.d.ts +0 -6
- package/dist/cli/commands/trace/register.d.ts.map +0 -1
- package/dist/cli/commands/trace/register.js +0 -71
- package/dist/webui/assets/index-DEfRFmFT.js +0 -1667
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { withAnalytics, safeExit, ExitSignal } from '../../../analytics/wrapper.js';
|
|
2
2
|
export function registerSessionCommand({ program, bootstrapAgentFromGlobalOpts, }) {
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const chatCommand = program
|
|
4
|
+
.command('chat')
|
|
5
|
+
.description("Your chats: this machine's sessions, and other agents' chats into Dexto");
|
|
6
|
+
chatCommand
|
|
5
7
|
.command('list')
|
|
6
|
-
.description(
|
|
7
|
-
.action(withAnalytics('
|
|
8
|
+
.description("List this machine's chats")
|
|
9
|
+
.action(withAnalytics('chat list', async () => {
|
|
8
10
|
let agent = null;
|
|
9
11
|
try {
|
|
10
12
|
agent = await bootstrapAgentFromGlobalOpts({ mode: 'non-interactive' });
|
|
11
13
|
const { handleSessionListCommand } = await import('../session-commands.js');
|
|
12
14
|
await handleSessionListCommand(agent);
|
|
13
|
-
safeExit('
|
|
15
|
+
safeExit('chat list', 0);
|
|
14
16
|
}
|
|
15
17
|
catch (err) {
|
|
16
18
|
if (err instanceof ExitSignal)
|
|
17
19
|
throw err;
|
|
18
|
-
console.error(`❌ dexto
|
|
19
|
-
safeExit('
|
|
20
|
+
console.error(`❌ dexto chat list command failed: ${err}`);
|
|
21
|
+
safeExit('chat list', 1, 'error');
|
|
20
22
|
}
|
|
21
23
|
finally {
|
|
22
24
|
if (agent) {
|
|
@@ -24,23 +26,23 @@ export function registerSessionCommand({ program, bootstrapAgentFromGlobalOpts,
|
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
}));
|
|
27
|
-
|
|
29
|
+
chatCommand
|
|
28
30
|
.command('history')
|
|
29
|
-
.description(
|
|
30
|
-
.argument('[sessionId]', '
|
|
31
|
-
.action(withAnalytics('
|
|
31
|
+
.description("Show a chat's messages")
|
|
32
|
+
.argument('[sessionId]', 'The chat (default: the current one)')
|
|
33
|
+
.action(withAnalytics('chat history', async (sessionId) => {
|
|
32
34
|
let agent = null;
|
|
33
35
|
try {
|
|
34
36
|
agent = await bootstrapAgentFromGlobalOpts({ mode: 'non-interactive' });
|
|
35
37
|
const { handleSessionHistoryCommand } = await import('../session-commands.js');
|
|
36
38
|
await handleSessionHistoryCommand(agent, sessionId);
|
|
37
|
-
safeExit('
|
|
39
|
+
safeExit('chat history', 0);
|
|
38
40
|
}
|
|
39
41
|
catch (err) {
|
|
40
42
|
if (err instanceof ExitSignal)
|
|
41
43
|
throw err;
|
|
42
|
-
console.error(`❌ dexto
|
|
43
|
-
safeExit('
|
|
44
|
+
console.error(`❌ dexto chat history command failed: ${err}`);
|
|
45
|
+
safeExit('chat history', 1, 'error');
|
|
44
46
|
}
|
|
45
47
|
finally {
|
|
46
48
|
if (agent) {
|
|
@@ -48,23 +50,23 @@ export function registerSessionCommand({ program, bootstrapAgentFromGlobalOpts,
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
}));
|
|
51
|
-
|
|
53
|
+
chatCommand
|
|
52
54
|
.command('delete')
|
|
53
|
-
.description('Delete a
|
|
54
|
-
.argument('<sessionId>', '
|
|
55
|
-
.action(withAnalytics('
|
|
55
|
+
.description('Delete a chat')
|
|
56
|
+
.argument('<sessionId>', 'The chat to delete')
|
|
57
|
+
.action(withAnalytics('chat delete', async (sessionId) => {
|
|
56
58
|
let agent = null;
|
|
57
59
|
try {
|
|
58
60
|
agent = await bootstrapAgentFromGlobalOpts({ mode: 'non-interactive' });
|
|
59
61
|
const { handleSessionDeleteCommand } = await import('../session-commands.js');
|
|
60
62
|
await handleSessionDeleteCommand(agent, sessionId);
|
|
61
|
-
safeExit('
|
|
63
|
+
safeExit('chat delete', 0);
|
|
62
64
|
}
|
|
63
65
|
catch (err) {
|
|
64
66
|
if (err instanceof ExitSignal)
|
|
65
67
|
throw err;
|
|
66
|
-
console.error(`❌ dexto
|
|
67
|
-
safeExit('
|
|
68
|
+
console.error(`❌ dexto chat delete command failed: ${err}`);
|
|
69
|
+
safeExit('chat delete', 1, 'error');
|
|
68
70
|
}
|
|
69
71
|
finally {
|
|
70
72
|
if (agent) {
|
|
@@ -72,4 +74,32 @@ export function registerSessionCommand({ program, bootstrapAgentFromGlobalOpts,
|
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
}));
|
|
77
|
+
// Claude Code and Codex chats on this machine, and importing them into Dexto, run on the
|
|
78
|
+
// cloud command engine with its own options; analytics records only the command name.
|
|
79
|
+
for (const [word, description] of [
|
|
80
|
+
['local', 'List Claude Code and Codex chats on this machine that Dexto can import'],
|
|
81
|
+
['import', 'Import Claude Code or Codex chats into Dexto'],
|
|
82
|
+
])
|
|
83
|
+
chatCommand
|
|
84
|
+
.command(word)
|
|
85
|
+
.description(description)
|
|
86
|
+
.helpOption(false)
|
|
87
|
+
.passThroughOptions()
|
|
88
|
+
.allowUnknownOption()
|
|
89
|
+
.allowExcessArguments()
|
|
90
|
+
.argument('[args...]')
|
|
91
|
+
.action(async (args) => {
|
|
92
|
+
await withAnalytics(`chat ${word}`, async () => {
|
|
93
|
+
const [{ runCloud }, { nodeCloudHost }] = await Promise.all([
|
|
94
|
+
import('../../cloud/run.js'),
|
|
95
|
+
import('../../cloud/host.js'),
|
|
96
|
+
]);
|
|
97
|
+
const code = await runCloud(nodeCloudHost(new AbortController().signal), [
|
|
98
|
+
'chat',
|
|
99
|
+
word,
|
|
100
|
+
...args,
|
|
101
|
+
]);
|
|
102
|
+
safeExit(`chat ${word}`, code);
|
|
103
|
+
})();
|
|
104
|
+
});
|
|
75
105
|
}
|
|
@@ -117,7 +117,7 @@ export async function handleSessionHistoryCommand(agent, sessionId) {
|
|
|
117
117
|
catch (error) {
|
|
118
118
|
if (error instanceof Error && error.message.includes('not found')) {
|
|
119
119
|
console.log(chalk.red(`❌ Session not found: ${sessionId || 'current'}`));
|
|
120
|
-
console.log(chalk.gray(' Use `dexto
|
|
120
|
+
console.log(chalk.gray(' Use `dexto chat list` to see available sessions'));
|
|
121
121
|
}
|
|
122
122
|
else if (error instanceof Error && error.message !== 'No sessions found') {
|
|
123
123
|
logger.error(`Failed to get session history: ${error.message}`, null, 'red');
|
|
@@ -3,14 +3,13 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { acceptsAnyModel, getDefaultModelForProvider, getReasoningProfile, getSupportedModels, isValidProviderModel, LLM_PROVIDERS, LLM_REGISTRY, requiresApiKey, supportsCustomModels, } from '@dexto/llm';
|
|
5
5
|
import { getCuratedModelsForProvider, logger, resolveApiKeyForProvider } from '@dexto/core';
|
|
6
|
-
import { createInitialPreferences, saveGlobalPreferences, loadGlobalPreferences, getGlobalPreferencesPath, updateGlobalPreferences, setActiveModel, isDextoAuthEnabled, loadCustomModels, saveCustomModel, deleteCustomModel, globalPreferencesExist, getDefaultModelAuthProfile, loadModelAuthProfilesSync, } from '@dexto/agent-management';
|
|
6
|
+
import { createInitialPreferences, saveGlobalPreferences, loadGlobalPreferences, getGlobalPreferencesPath, updateGlobalPreferences, setActiveModel, isDextoAuthEnabled, loadCustomModels, saveCustomModel, deleteCustomModel, globalPreferencesExist, getDefaultModelAuthProfile, loadModelAuthProfilesSync, dextoGateway, } from '@dexto/agent-management';
|
|
7
7
|
import { interactiveApiKeySetup, hasApiKeyConfigured } from '../utils/api-key-setup.js';
|
|
8
8
|
import { selectProvider, getProviderDisplayName, getProviderEnvVar, providerRequiresBaseURL, getDefaultModel, } from '../utils/provider-setup.js';
|
|
9
9
|
import { setupLocalModels, setupOllamaModels, hasSelectedModel, getModelFromResult, } from '../utils/local-model-setup.js';
|
|
10
10
|
import { requiresSetup } from '../utils/setup-utils.js';
|
|
11
|
-
import { canUseDextoProvider } from '../utils/dexto-setup.js';
|
|
12
|
-
import {
|
|
13
|
-
import { loadAuth, getBillingBalanceForCurrentLogin, openDextoBillingPage } from '../auth/index.js';
|
|
11
|
+
import { canUseDextoProvider, signInForDextoModels } from '../utils/dexto-setup.js';
|
|
12
|
+
import { openBrowserUrl } from '../auth/browser-launch.js';
|
|
14
13
|
import { DEXTO_CREDITS_URL } from '../auth/constants.js';
|
|
15
14
|
import * as p from '@clack/prompts';
|
|
16
15
|
import { capture } from '../../analytics/index.js';
|
|
@@ -446,11 +445,11 @@ async function handleDextoProviderSetup(options = {}) {
|
|
|
446
445
|
return false;
|
|
447
446
|
};
|
|
448
447
|
console.log(chalk.magenta('\n★ Dexto Nova Setup\n'));
|
|
449
|
-
//
|
|
448
|
+
// Signed in with permission to spend credits, or DEXTO_API_KEY
|
|
450
449
|
const hasKey = await canUseDextoProvider();
|
|
451
450
|
if (!hasKey) {
|
|
452
451
|
p.note(`Dexto gives you instant access to ${chalk.cyan('all AI models')} with a single account.\n\n` +
|
|
453
|
-
`We'll
|
|
452
|
+
`We'll sign you in with your browser, or a code over SSH.`, 'Login Required');
|
|
454
453
|
const shouldLogin = await p.confirm({
|
|
455
454
|
message: 'Continue with Dexto login?',
|
|
456
455
|
initialValue: true,
|
|
@@ -459,10 +458,10 @@ async function handleDextoProviderSetup(options = {}) {
|
|
|
459
458
|
return abort('Setup cancelled');
|
|
460
459
|
}
|
|
461
460
|
try {
|
|
462
|
-
await
|
|
463
|
-
//
|
|
461
|
+
await signInForDextoModels();
|
|
462
|
+
// Consent can leave out spending credits, and an organization can have no Cloud project.
|
|
464
463
|
if (!(await canUseDextoProvider())) {
|
|
465
|
-
p.log.error('
|
|
464
|
+
p.log.error("Signed in, but Dexto models can't run yet: allow spending credits when asked, and make sure your organization has a Cloud project. Or use `dexto setup` with a different provider.");
|
|
466
465
|
return abort('Setup cancelled', 1);
|
|
467
466
|
}
|
|
468
467
|
p.log.success('Login successful! Continuing with setup...');
|
|
@@ -474,9 +473,12 @@ async function handleDextoProviderSetup(options = {}) {
|
|
|
474
473
|
}
|
|
475
474
|
}
|
|
476
475
|
else {
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
476
|
+
const [{ describeSignIn }, { nodeSignInContext }] = await Promise.all([
|
|
477
|
+
import('./auth/sign-in-commands.js'),
|
|
478
|
+
import('./auth/sign-in-context.js'),
|
|
479
|
+
]);
|
|
480
|
+
const signedInAs = await describeSignIn(await nodeSignInContext());
|
|
481
|
+
p.log.success(`Signed in to Dexto as ${signedInAs ?? 'unknown'}`);
|
|
480
482
|
}
|
|
481
483
|
const balance = await getCreditsBalance();
|
|
482
484
|
if (balance !== null) {
|
|
@@ -608,7 +610,7 @@ async function handleDextoProviderSetup(options = {}) {
|
|
|
608
610
|
}
|
|
609
611
|
async function openCreditsPage() {
|
|
610
612
|
try {
|
|
611
|
-
await
|
|
613
|
+
await openBrowserUrl(DEXTO_CREDITS_URL);
|
|
612
614
|
}
|
|
613
615
|
catch (error) {
|
|
614
616
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -618,7 +620,8 @@ async function openCreditsPage() {
|
|
|
618
620
|
}
|
|
619
621
|
async function getCreditsBalance() {
|
|
620
622
|
try {
|
|
621
|
-
|
|
623
|
+
const summary = await dextoGateway.dextoBillingSummary(dextoGateway.defaultDextoGatewayOptions());
|
|
624
|
+
return summary?.balanceUsd ?? null;
|
|
622
625
|
}
|
|
623
626
|
catch {
|
|
624
627
|
return null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** What kind of thing went wrong; each kind has an exit code an agent can branch on. */
|
|
2
|
+
export type FailureKind = 'failed' | 'invalid_input' | 'needs_confirmation' | 'needs_permission' | 'needs_sign_in' | 'not_found' | 'waiting_on_person';
|
|
3
|
+
export declare const EXIT_CODES: {
|
|
4
|
+
readonly failed: 1;
|
|
5
|
+
readonly invalid_input: 2;
|
|
6
|
+
readonly needs_confirmation: 4;
|
|
7
|
+
readonly needs_permission: 3;
|
|
8
|
+
readonly needs_sign_in: 3;
|
|
9
|
+
readonly not_found: 5;
|
|
10
|
+
readonly waiting_on_person: 6;
|
|
11
|
+
readonly usage: 2;
|
|
12
|
+
};
|
|
13
|
+
/** What each exit code means; frozen in 2.0 and shown in help. */
|
|
14
|
+
export declare const EXIT_CODE_MEANINGS: {
|
|
15
|
+
readonly '0': "done";
|
|
16
|
+
readonly '1': "failed";
|
|
17
|
+
readonly '2': "usage or invalid input";
|
|
18
|
+
readonly '3': "needs sign-in or permission";
|
|
19
|
+
readonly '4': "needs confirmation: pass --yes once your person has agreed";
|
|
20
|
+
readonly '5': "not found";
|
|
21
|
+
readonly '6': "waiting on a person, such as an approval";
|
|
22
|
+
};
|
|
23
|
+
/** A failure that says what kind it is and, where there is one, the command that fixes it. */
|
|
24
|
+
export declare class CommandFailure extends Error {
|
|
25
|
+
readonly fix: string | null;
|
|
26
|
+
readonly kind: FailureKind;
|
|
27
|
+
constructor(kind: FailureKind, message: string, fix: string | null);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../../src/cli/failure.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,MAAM,MAAM,WAAW,GACjB,QAAQ,GACR,eAAe,GACf,oBAAoB,GACpB,kBAAkB,GAClB,eAAe,GACf,WAAW,GACX,mBAAmB,CAAC;AAE1B,eAAO,MAAM,UAAU;;;;;;;;;CASmC,CAAC;AAE3D,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;;;;;;;CAQrB,CAAC;AAEX,8FAA8F;AAC9F,qBAAa,cAAe,SAAQ,KAAK;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;gBAEf,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;CAMrE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const EXIT_CODES = {
|
|
2
|
+
failed: 1,
|
|
3
|
+
invalid_input: 2,
|
|
4
|
+
needs_confirmation: 4,
|
|
5
|
+
needs_permission: 3,
|
|
6
|
+
needs_sign_in: 3,
|
|
7
|
+
not_found: 5,
|
|
8
|
+
waiting_on_person: 6,
|
|
9
|
+
usage: 2,
|
|
10
|
+
};
|
|
11
|
+
/** What each exit code means; frozen in 2.0 and shown in help. */
|
|
12
|
+
export const EXIT_CODE_MEANINGS = {
|
|
13
|
+
'0': 'done',
|
|
14
|
+
'1': 'failed',
|
|
15
|
+
'2': 'usage or invalid input',
|
|
16
|
+
'3': 'needs sign-in or permission',
|
|
17
|
+
'4': 'needs confirmation: pass --yes once your person has agreed',
|
|
18
|
+
'5': 'not found',
|
|
19
|
+
'6': 'waiting on a person, such as an approval',
|
|
20
|
+
};
|
|
21
|
+
/** A failure that says what kind it is and, where there is one, the command that fixes it. */
|
|
22
|
+
export class CommandFailure extends Error {
|
|
23
|
+
fix;
|
|
24
|
+
kind;
|
|
25
|
+
constructor(kind, message, fix) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.name = 'CommandFailure';
|
|
28
|
+
this.fix = fix;
|
|
29
|
+
this.kind = kind;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/** `--help` (or `-h`) with `--json`, and nothing else. */
|
|
3
|
+
export declare function isRootJsonHelp(args: readonly string[]): boolean;
|
|
4
|
+
export declare function rootHelpJson(program: Command): {
|
|
5
|
+
usage: string[];
|
|
6
|
+
commands: {
|
|
7
|
+
name: string;
|
|
8
|
+
summary: string;
|
|
9
|
+
help: string;
|
|
10
|
+
}[];
|
|
11
|
+
output: string;
|
|
12
|
+
exit_codes: {
|
|
13
|
+
readonly '0': "done";
|
|
14
|
+
readonly '1': "failed";
|
|
15
|
+
readonly '2': "usage or invalid input";
|
|
16
|
+
readonly '3': "needs sign-in or permission";
|
|
17
|
+
readonly '4': "needs confirmation: pass --yes once your person has agreed";
|
|
18
|
+
readonly '5': "not found";
|
|
19
|
+
readonly '6': "waiting on a person, such as an approval";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=help-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-json.d.ts","sourceRoot":"","sources":["../../src/cli/help-json.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAM/D;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;EAW5C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// `dexto --help --json`: the commands and the frozen exit codes, for agents.
|
|
2
|
+
import { EXIT_CODE_MEANINGS } from './failure.js';
|
|
3
|
+
/** `--help` (or `-h`) with `--json`, and nothing else. */
|
|
4
|
+
export function isRootJsonHelp(args) {
|
|
5
|
+
return (args.length === 2 &&
|
|
6
|
+
args.includes('--json') &&
|
|
7
|
+
(args.includes('--help') || args.includes('-h')));
|
|
8
|
+
}
|
|
9
|
+
export function rootHelpJson(program) {
|
|
10
|
+
return {
|
|
11
|
+
usage: ['dexto [prompt]', 'dexto <command> [options]'],
|
|
12
|
+
commands: program.commands.map((command) => ({
|
|
13
|
+
name: command.name(),
|
|
14
|
+
summary: command.description(),
|
|
15
|
+
help: `dexto ${command.name()} --help --json`,
|
|
16
|
+
})),
|
|
17
|
+
output: 'JSON when stdout isn\'t a terminal; failures as {"error":{"code","message","fix"}} on stderr.',
|
|
18
|
+
exit_codes: EXIT_CODE_MEANINGS,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ParsedChat } from './transcript.js';
|
|
2
|
+
/**
|
|
3
|
+
* A Claude Code session file: one Agent SDK message per line (`type` `user` or `assistant`, with
|
|
4
|
+
* Anthropic `message.content`), plus title, `pr-link` and bookkeeping lines. Sidechain (subagent),
|
|
5
|
+
* meta and compact-summary lines are left out, as is thinking.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseClaudeCodeTranscript(text: string, file: string): ParsedChat | null;
|
|
8
|
+
/** Where Claude Code keeps its sessions on this machine. */
|
|
9
|
+
export declare function claudeCodeFolder(environment: Readonly<Record<string, string | undefined>>, homeDirectory: string): string;
|
|
10
|
+
//# sourceMappingURL=claude-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/cli/import/claude-code.ts"],"names":[],"mappings":"AAIA,OAAO,EAUH,KAAK,UAAU,EAClB,MAAM,iBAAiB,CAAC;AAsCzB;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CA8DvF;AAiBD,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAC5B,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACzD,aAAa,EAAE,MAAM,GACtB,MAAM,CAKR"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Reads Claude Code session files: `$CLAUDE_CONFIG_DIR/projects/<dashed-cwd>/<session>.jsonl`.
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { createTurns, finishChat, isRecord, jsonLines, stringField, toolCallText, toolResultText, validTime, } from './transcript.js';
|
|
4
|
+
/** What Claude Code writes as a `user` line but the person never typed: slash commands and their output. */
|
|
5
|
+
const CLAUDE_CODE_INJECTED = /^\s*<(command-name|command-message|local-command-[a-z]+)>/u;
|
|
6
|
+
/**
|
|
7
|
+
* The title Claude Code shows for a session, in this order: the person's own (`custom-title`, from
|
|
8
|
+
* renaming it), the one Claude Code generates (`ai-title`, the last one written), then a `summary`
|
|
9
|
+
* line (Claude Code before 2.1). Null when there is none, and the chat is titled by its first line.
|
|
10
|
+
*/
|
|
11
|
+
class ClaudeCodeTitle {
|
|
12
|
+
custom = null;
|
|
13
|
+
generated = null;
|
|
14
|
+
summary = null;
|
|
15
|
+
/** Whether the line was a title line. */
|
|
16
|
+
read(line) {
|
|
17
|
+
if (line.type === 'custom-title')
|
|
18
|
+
this.custom = stringField(line, 'customTitle');
|
|
19
|
+
else if (line.type === 'ai-title')
|
|
20
|
+
this.generated = stringField(line, 'aiTitle');
|
|
21
|
+
else if (line.type === 'summary')
|
|
22
|
+
this.summary ??= stringField(line, 'summary');
|
|
23
|
+
else
|
|
24
|
+
return false;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
get title() {
|
|
28
|
+
return this.custom ?? this.generated ?? this.summary;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** Claude Code's `pr-link` line: `{prNumber, prRepository: "owner/name", prUrl}`. */
|
|
32
|
+
function pullRequest(line) {
|
|
33
|
+
const repository = stringField(line, 'prRepository');
|
|
34
|
+
const url = stringField(line, 'prUrl');
|
|
35
|
+
const number = line.prNumber;
|
|
36
|
+
if (repository === null || url === null || typeof number !== 'number')
|
|
37
|
+
return null;
|
|
38
|
+
return { number, repository, url };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A Claude Code session file: one Agent SDK message per line (`type` `user` or `assistant`, with
|
|
42
|
+
* Anthropic `message.content`), plus title, `pr-link` and bookkeeping lines. Sidechain (subagent),
|
|
43
|
+
* meta and compact-summary lines are left out, as is thinking.
|
|
44
|
+
*/
|
|
45
|
+
export function parseClaudeCodeTranscript(text, file) {
|
|
46
|
+
const turns = createTurns();
|
|
47
|
+
const title = new ClaudeCodeTitle();
|
|
48
|
+
const pullRequests = new Map();
|
|
49
|
+
let sessionId = null;
|
|
50
|
+
let cwd = null;
|
|
51
|
+
let gitBranch = null;
|
|
52
|
+
for (const line of jsonLines(text)) {
|
|
53
|
+
if (title.read(line))
|
|
54
|
+
continue;
|
|
55
|
+
if (line.type === 'pr-link') {
|
|
56
|
+
const linked = pullRequest(line);
|
|
57
|
+
if (linked !== null && !pullRequests.has(linked.url))
|
|
58
|
+
pullRequests.set(linked.url, linked);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (line.type !== 'user' && line.type !== 'assistant')
|
|
62
|
+
continue;
|
|
63
|
+
// A compact summary is Claude Code's own recap of the turns before it, written as `user`.
|
|
64
|
+
if (line.isSidechain === true || line.isMeta === true || line.isCompactSummary === true)
|
|
65
|
+
continue;
|
|
66
|
+
const message = line.message;
|
|
67
|
+
const at = validTime(stringField(line, 'timestamp'));
|
|
68
|
+
if (!isRecord(message) || at === null)
|
|
69
|
+
continue;
|
|
70
|
+
sessionId ??= stringField(line, 'sessionId');
|
|
71
|
+
cwd ??= stringField(line, 'cwd');
|
|
72
|
+
gitBranch ??= stringField(line, 'gitBranch');
|
|
73
|
+
const content = message.content;
|
|
74
|
+
if (typeof content === 'string') {
|
|
75
|
+
if (line.type === 'assistant')
|
|
76
|
+
turns.assistant(content, at);
|
|
77
|
+
else if (!CLAUDE_CODE_INJECTED.test(content))
|
|
78
|
+
turns.user(content, at);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
if (!Array.isArray(content))
|
|
82
|
+
continue;
|
|
83
|
+
for (const block of content) {
|
|
84
|
+
if (!isRecord(block))
|
|
85
|
+
continue;
|
|
86
|
+
if (block.type === 'text' && typeof block.text === 'string') {
|
|
87
|
+
if (line.type === 'assistant')
|
|
88
|
+
turns.assistant(block.text, at);
|
|
89
|
+
else if (!CLAUDE_CODE_INJECTED.test(block.text))
|
|
90
|
+
turns.user(block.text, at);
|
|
91
|
+
}
|
|
92
|
+
else if (block.type === 'tool_use') {
|
|
93
|
+
turns.assistant(toolCallText(stringField(block, 'name') ?? 'tool', block.input), at);
|
|
94
|
+
}
|
|
95
|
+
else if (block.type === 'tool_result') {
|
|
96
|
+
turns.assistant(toolResultText(claudeToolResultText(block.content)), at);
|
|
97
|
+
}
|
|
98
|
+
else if (block.type === 'image' && line.type === 'user') {
|
|
99
|
+
turns.user('[An image was attached here; it was not imported.]', at);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return finishChat({
|
|
104
|
+
cwd,
|
|
105
|
+
gitBranch,
|
|
106
|
+
id: sessionId ?? path.basename(file, '.jsonl'),
|
|
107
|
+
path: file,
|
|
108
|
+
pullRequests: [...pullRequests.values()],
|
|
109
|
+
recordedRemoteUrl: null,
|
|
110
|
+
source: 'claude-code',
|
|
111
|
+
title: title.title,
|
|
112
|
+
}, turns.done());
|
|
113
|
+
}
|
|
114
|
+
function claudeToolResultText(content) {
|
|
115
|
+
if (typeof content === 'string')
|
|
116
|
+
return content;
|
|
117
|
+
if (!Array.isArray(content))
|
|
118
|
+
return '';
|
|
119
|
+
return content
|
|
120
|
+
.map((part) => isRecord(part) && typeof part.text === 'string'
|
|
121
|
+
? part.text
|
|
122
|
+
: isRecord(part) && part.type === 'image'
|
|
123
|
+
? '[image]'
|
|
124
|
+
: '')
|
|
125
|
+
.filter((part) => part !== '')
|
|
126
|
+
.join('\n');
|
|
127
|
+
}
|
|
128
|
+
/** Where Claude Code keeps its sessions on this machine. */
|
|
129
|
+
export function claudeCodeFolder(environment, homeDirectory) {
|
|
130
|
+
return path.join(environment.CLAUDE_CONFIG_DIR ?? path.join(homeDirectory, '.claude'), 'projects');
|
|
131
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ParsedChat } from './transcript.js';
|
|
2
|
+
/**
|
|
3
|
+
* A Codex rollout: `{timestamp, type, payload}` lines, as `codex-rs/history` writes them. The
|
|
4
|
+
* `session_meta` line names the thread and its git remote; `response_item` lines carry messages and
|
|
5
|
+
* tool calls. Developer and system messages, injected context, reasoning and compaction are left out.
|
|
6
|
+
* `titleOf` gives the title Codex keeps for a thread, or null when it keeps none.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseCodexRollout(text: string, file: string, titleOf: (threadId: string) => string | null): ParsedChat | null;
|
|
9
|
+
/** `$CODEX_HOME`, or `~/.codex`. */
|
|
10
|
+
export declare function codexHome(environment: Readonly<Record<string, string | undefined>>, homeDirectory: string): string;
|
|
11
|
+
/** A row of Codex's `threads` table, as much of it as an import needs. */
|
|
12
|
+
export interface CodexThread {
|
|
13
|
+
readonly cwd: string;
|
|
14
|
+
readonly id: string;
|
|
15
|
+
/** Whether its rollout file is still on disk; `codex migrate-rollouts` moves history out. */
|
|
16
|
+
readonly hasRollout: boolean;
|
|
17
|
+
/** The name the person gave it, else the title Codex gave it; null when both are blank. */
|
|
18
|
+
readonly title: string | null;
|
|
19
|
+
readonly updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The threads Codex lists, read from its state database without writing to it; null when there is
|
|
23
|
+
* no such database. A present database that cannot be read is reported to the caller.
|
|
24
|
+
* Archived threads are left out, as their rollouts are not where sessions are read from.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readCodexThreads(home: string): Promise<CodexThread[] | null>;
|
|
27
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/cli/import/codex.ts"],"names":[],"mappings":"AAOA,OAAO,EASH,KAAK,UAAU,EAClB,MAAM,iBAAiB,CAAC;AAMzB;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAC7C,UAAU,GAAG,IAAI,CAiEnB;AAgBD,oCAAoC;AACpC,wBAAgB,SAAS,CACrB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACzD,aAAa,EAAE,MAAM,GACtB,MAAM,CAER;AAMD,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAiBD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,CAsClF"}
|