agor-live 0.3.7
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/LICENSE +94 -0
- package/README.md +163 -0
- package/bin/agor-daemon.js +20 -0
- package/bin/agor.js +14 -0
- package/dist/cli/base-command.d.ts +29 -0
- package/dist/cli/base-command.js +41 -0
- package/dist/cli/commands/board/add-session.d.ts +15 -0
- package/dist/cli/commands/board/add-session.js +102 -0
- package/dist/cli/commands/board/list.d.ts +14 -0
- package/dist/cli/commands/board/list.js +74 -0
- package/dist/cli/commands/config/clear.d.ts +13 -0
- package/dist/cli/commands/config/clear.js +21 -0
- package/dist/cli/commands/config/get.d.ts +13 -0
- package/dist/cli/commands/config/get.js +41 -0
- package/dist/cli/commands/config/index.d.ts +13 -0
- package/dist/cli/commands/config/index.js +118 -0
- package/dist/cli/commands/config/set.d.ts +14 -0
- package/dist/cli/commands/config/set.js +50 -0
- package/dist/cli/commands/config/unset.d.ts +13 -0
- package/dist/cli/commands/config/unset.js +35 -0
- package/dist/cli/commands/daemon/index.d.ts +13 -0
- package/dist/cli/commands/daemon/index.js +65 -0
- package/dist/cli/commands/daemon/logs.d.ts +13 -0
- package/dist/cli/commands/daemon/logs.js +78 -0
- package/dist/cli/commands/daemon/restart.d.ts +13 -0
- package/dist/cli/commands/daemon/restart.js +177 -0
- package/dist/cli/commands/daemon/start.d.ts +13 -0
- package/dist/cli/commands/daemon/start.js +193 -0
- package/dist/cli/commands/daemon/status.d.ts +13 -0
- package/dist/cli/commands/daemon/status.js +93 -0
- package/dist/cli/commands/daemon/stop.d.ts +13 -0
- package/dist/cli/commands/daemon/stop.js +108 -0
- package/dist/cli/commands/init.d.ts +44 -0
- package/dist/cli/commands/init.js +459 -0
- package/dist/cli/commands/mcp/add.d.ts +26 -0
- package/dist/cli/commands/mcp/add.js +162 -0
- package/dist/cli/commands/mcp/list.d.ts +16 -0
- package/dist/cli/commands/mcp/list.js +89 -0
- package/dist/cli/commands/mcp/remove.d.ts +17 -0
- package/dist/cli/commands/mcp/remove.js +86 -0
- package/dist/cli/commands/mcp/show.d.ts +14 -0
- package/dist/cli/commands/mcp/show.js +131 -0
- package/dist/cli/commands/repo/add.d.ts +16 -0
- package/dist/cli/commands/repo/add.js +105 -0
- package/dist/cli/commands/repo/list.d.ts +17 -0
- package/dist/cli/commands/repo/list.js +99 -0
- package/dist/cli/commands/repo/rm.d.ts +17 -0
- package/dist/cli/commands/repo/rm.js +126 -0
- package/dist/cli/commands/repo/worktree/add.d.ts +21 -0
- package/dist/cli/commands/repo/worktree/add.js +145 -0
- package/dist/cli/commands/repo/worktree/list.d.ts +21 -0
- package/dist/cli/commands/repo/worktree/list.js +136 -0
- package/dist/cli/commands/session/list.d.ts +30 -0
- package/dist/cli/commands/session/list.js +204 -0
- package/dist/cli/commands/session/load-claude.d.ts +16 -0
- package/dist/cli/commands/session/load-claude.js +211 -0
- package/dist/cli/commands/user/create-admin.d.ts +13 -0
- package/dist/cli/commands/user/create-admin.js +65 -0
- package/dist/cli/commands/user/create.d.ts +16 -0
- package/dist/cli/commands/user/create.js +126 -0
- package/dist/cli/commands/user/delete.d.ts +16 -0
- package/dist/cli/commands/user/delete.js +77 -0
- package/dist/cli/commands/user/list.d.ts +13 -0
- package/dist/cli/commands/user/list.js +78 -0
- package/dist/cli/commands/user/update.d.ts +19 -0
- package/dist/cli/commands/user/update.js +149 -0
- package/dist/cli/hooks/command-not-found.d.ts +9 -0
- package/dist/cli/hooks/command-not-found.js +14 -0
- package/dist/cli/lib/banner.d.ts +25 -0
- package/dist/cli/lib/banner.js +25 -0
- package/dist/cli/lib/context.d.ts +27 -0
- package/dist/cli/lib/context.js +32 -0
- package/dist/cli/lib/daemon-manager.d.ts +48 -0
- package/dist/cli/lib/daemon-manager.js +109 -0
- package/dist/cli/lib/help.d.ts +13 -0
- package/dist/cli/lib/help.js +46 -0
- package/dist/core/agentic-tool-B_gFNpk5.d.ts +33 -0
- package/dist/core/agentic-tool-DsyX8diw.d.cts +33 -0
- package/dist/core/api/index.cjs +98 -0
- package/dist/core/api/index.d.cts +174 -0
- package/dist/core/api/index.d.ts +174 -0
- package/dist/core/api/index.js +62 -0
- package/dist/core/board-comment-BUm0fpmD.d.cts +134 -0
- package/dist/core/board-comment-gC_-twPx.d.ts +134 -0
- package/dist/core/claude/index.cjs +673 -0
- package/dist/core/claude/index.d.cts +124 -0
- package/dist/core/claude/index.d.ts +124 -0
- package/dist/core/claude/index.js +629 -0
- package/dist/core/config/browser.cjs +165 -0
- package/dist/core/config/browser.d.cts +289 -0
- package/dist/core/config/browser.d.ts +289 -0
- package/dist/core/config/browser.js +131 -0
- package/dist/core/config/index.cjs +518 -0
- package/dist/core/config/index.d.cts +246 -0
- package/dist/core/config/index.d.ts +246 -0
- package/dist/core/config/index.js +451 -0
- package/dist/core/db/index.cjs +3726 -0
- package/dist/core/db/index.d.cts +631 -0
- package/dist/core/db/index.d.ts +631 -0
- package/dist/core/db/index.js +3649 -0
- package/dist/core/dist/agentic-tool-B_gFNpk5.d.ts +33 -0
- package/dist/core/dist/agentic-tool-DsyX8diw.d.cts +33 -0
- package/dist/core/dist/api/index.cjs +98 -0
- package/dist/core/dist/api/index.d.cts +174 -0
- package/dist/core/dist/api/index.d.ts +174 -0
- package/dist/core/dist/api/index.js +62 -0
- package/dist/core/dist/board-comment-BUm0fpmD.d.cts +134 -0
- package/dist/core/dist/board-comment-gC_-twPx.d.ts +134 -0
- package/dist/core/dist/claude/index.cjs +673 -0
- package/dist/core/dist/claude/index.d.cts +124 -0
- package/dist/core/dist/claude/index.d.ts +124 -0
- package/dist/core/dist/claude/index.js +629 -0
- package/dist/core/dist/config/browser.cjs +165 -0
- package/dist/core/dist/config/browser.d.cts +289 -0
- package/dist/core/dist/config/browser.d.ts +289 -0
- package/dist/core/dist/config/browser.js +131 -0
- package/dist/core/dist/config/index.cjs +518 -0
- package/dist/core/dist/config/index.d.cts +246 -0
- package/dist/core/dist/config/index.d.ts +246 -0
- package/dist/core/dist/config/index.js +451 -0
- package/dist/core/dist/db/index.cjs +3726 -0
- package/dist/core/dist/db/index.d.cts +631 -0
- package/dist/core/dist/db/index.d.ts +631 -0
- package/dist/core/dist/db/index.js +3649 -0
- package/dist/core/dist/environment/variable-resolver.cjs +92 -0
- package/dist/core/dist/environment/variable-resolver.d.cts +52 -0
- package/dist/core/dist/environment/variable-resolver.d.ts +52 -0
- package/dist/core/dist/environment/variable-resolver.js +53 -0
- package/dist/core/dist/feathers/index.cjs +66 -0
- package/dist/core/dist/feathers/index.d.cts +7 -0
- package/dist/core/dist/feathers/index.d.ts +7 -0
- package/dist/core/dist/feathers/index.js +25 -0
- package/dist/core/dist/feathers-BzHEPnpl.d.cts +228 -0
- package/dist/core/dist/feathers-BzHEPnpl.d.ts +228 -0
- package/dist/core/dist/git/index.cjs +302 -0
- package/dist/core/dist/git/index.d.cts +137 -0
- package/dist/core/dist/git/index.d.ts +137 -0
- package/dist/core/dist/git/index.js +260 -0
- package/dist/core/dist/id-DMqyogFB.d.cts +131 -0
- package/dist/core/dist/id-DMqyogFB.d.ts +131 -0
- package/dist/core/dist/index.cjs +4653 -0
- package/dist/core/dist/index.d.cts +23 -0
- package/dist/core/dist/index.d.ts +23 -0
- package/dist/core/dist/index.js +4509 -0
- package/dist/core/dist/message-BoxZISHg.d.cts +120 -0
- package/dist/core/dist/message-DvBzHu7V.d.ts +120 -0
- package/dist/core/dist/permissions/index.cjs +112 -0
- package/dist/core/dist/permissions/index.d.cts +81 -0
- package/dist/core/dist/permissions/index.d.ts +81 -0
- package/dist/core/dist/permissions/index.js +85 -0
- package/dist/core/dist/repo-3CUrCRbq.d.cts +405 -0
- package/dist/core/dist/repo-CnvJ0B6-.d.ts +405 -0
- package/dist/core/dist/session-BPjJlVdZ.d.cts +429 -0
- package/dist/core/dist/session-wAzjHatv.d.ts +429 -0
- package/dist/core/dist/task-BIEgT1DK.d.cts +163 -0
- package/dist/core/dist/task-DuIfiUbW.d.ts +163 -0
- package/dist/core/dist/templates/handlebars-helpers.cjs +156 -0
- package/dist/core/dist/templates/handlebars-helpers.d.cts +45 -0
- package/dist/core/dist/templates/handlebars-helpers.d.ts +45 -0
- package/dist/core/dist/templates/handlebars-helpers.js +119 -0
- package/dist/core/dist/tools/claude/models.cjs +70 -0
- package/dist/core/dist/tools/claude/models.d.cts +27 -0
- package/dist/core/dist/tools/claude/models.d.ts +27 -0
- package/dist/core/dist/tools/claude/models.js +44 -0
- package/dist/core/dist/tools/index.cjs +3367 -0
- package/dist/core/dist/tools/index.d.cts +967 -0
- package/dist/core/dist/tools/index.d.ts +967 -0
- package/dist/core/dist/tools/index.js +3314 -0
- package/dist/core/dist/tools/models.cjs +119 -0
- package/dist/core/dist/tools/models.d.cts +47 -0
- package/dist/core/dist/tools/models.d.ts +47 -0
- package/dist/core/dist/tools/models.js +86 -0
- package/dist/core/dist/types/index.cjs +152 -0
- package/dist/core/dist/types/index.d.cts +214 -0
- package/dist/core/dist/types/index.d.ts +214 -0
- package/dist/core/dist/types/index.js +112 -0
- package/dist/core/dist/user-BmL3kFol.d.ts +50 -0
- package/dist/core/dist/user-eUuKj7yM.d.cts +50 -0
- package/dist/core/dist/utils/pricing.cjs +102 -0
- package/dist/core/dist/utils/pricing.d.cts +43 -0
- package/dist/core/dist/utils/pricing.d.ts +43 -0
- package/dist/core/dist/utils/pricing.js +75 -0
- package/dist/core/dist/worktrees-BzIxB1U6.d.cts +2745 -0
- package/dist/core/dist/worktrees-CYem1ya2.d.ts +2745 -0
- package/dist/core/environment/variable-resolver.cjs +92 -0
- package/dist/core/environment/variable-resolver.d.cts +52 -0
- package/dist/core/environment/variable-resolver.d.ts +52 -0
- package/dist/core/environment/variable-resolver.js +53 -0
- package/dist/core/feathers/index.cjs +66 -0
- package/dist/core/feathers/index.d.cts +7 -0
- package/dist/core/feathers/index.d.ts +7 -0
- package/dist/core/feathers/index.js +25 -0
- package/dist/core/feathers-BzHEPnpl.d.cts +228 -0
- package/dist/core/feathers-BzHEPnpl.d.ts +228 -0
- package/dist/core/git/index.cjs +302 -0
- package/dist/core/git/index.d.cts +137 -0
- package/dist/core/git/index.d.ts +137 -0
- package/dist/core/git/index.js +260 -0
- package/dist/core/id-DMqyogFB.d.cts +131 -0
- package/dist/core/id-DMqyogFB.d.ts +131 -0
- package/dist/core/index.cjs +4653 -0
- package/dist/core/index.d.cts +23 -0
- package/dist/core/index.d.ts +23 -0
- package/dist/core/index.js +4509 -0
- package/dist/core/message-BoxZISHg.d.cts +120 -0
- package/dist/core/message-DvBzHu7V.d.ts +120 -0
- package/dist/core/package.json +133 -0
- package/dist/core/permissions/index.cjs +112 -0
- package/dist/core/permissions/index.d.cts +81 -0
- package/dist/core/permissions/index.d.ts +81 -0
- package/dist/core/permissions/index.js +85 -0
- package/dist/core/repo-3CUrCRbq.d.cts +405 -0
- package/dist/core/repo-CnvJ0B6-.d.ts +405 -0
- package/dist/core/session-BPjJlVdZ.d.cts +429 -0
- package/dist/core/session-wAzjHatv.d.ts +429 -0
- package/dist/core/task-BIEgT1DK.d.cts +163 -0
- package/dist/core/task-DuIfiUbW.d.ts +163 -0
- package/dist/core/templates/handlebars-helpers.cjs +156 -0
- package/dist/core/templates/handlebars-helpers.d.cts +45 -0
- package/dist/core/templates/handlebars-helpers.d.ts +45 -0
- package/dist/core/templates/handlebars-helpers.js +119 -0
- package/dist/core/tools/claude/models.cjs +70 -0
- package/dist/core/tools/claude/models.d.cts +27 -0
- package/dist/core/tools/claude/models.d.ts +27 -0
- package/dist/core/tools/claude/models.js +44 -0
- package/dist/core/tools/index.cjs +3367 -0
- package/dist/core/tools/index.d.cts +967 -0
- package/dist/core/tools/index.d.ts +967 -0
- package/dist/core/tools/index.js +3314 -0
- package/dist/core/tools/models.cjs +119 -0
- package/dist/core/tools/models.d.cts +47 -0
- package/dist/core/tools/models.d.ts +47 -0
- package/dist/core/tools/models.js +86 -0
- package/dist/core/types/index.cjs +152 -0
- package/dist/core/types/index.d.cts +214 -0
- package/dist/core/types/index.d.ts +214 -0
- package/dist/core/types/index.js +112 -0
- package/dist/core/user-BmL3kFol.d.ts +50 -0
- package/dist/core/user-eUuKj7yM.d.cts +50 -0
- package/dist/core/utils/pricing.cjs +102 -0
- package/dist/core/utils/pricing.d.cts +43 -0
- package/dist/core/utils/pricing.d.ts +43 -0
- package/dist/core/utils/pricing.js +75 -0
- package/dist/core/worktrees-BzIxB1U6.d.cts +2745 -0
- package/dist/core/worktrees-CYem1ya2.d.ts +2745 -0
- package/dist/daemon/adapters/drizzle.d.ts +114 -0
- package/dist/daemon/adapters/drizzle.js +219 -0
- package/dist/daemon/declarations.d.ts +101 -0
- package/dist/daemon/declarations.js +0 -0
- package/dist/daemon/index.d.ts +2 -0
- package/dist/daemon/index.js +4093 -0
- package/dist/daemon/mcp/routes.d.ts +15 -0
- package/dist/daemon/mcp/routes.js +641 -0
- package/dist/daemon/mcp/tokens.d.ts +50 -0
- package/dist/daemon/mcp/tokens.js +85 -0
- package/dist/daemon/services/board-comments.d.ts +97 -0
- package/dist/daemon/services/board-comments.js +326 -0
- package/dist/daemon/services/board-objects.d.ts +71 -0
- package/dist/daemon/services/board-objects.js +117 -0
- package/dist/daemon/services/boards.d.ts +64 -0
- package/dist/daemon/services/boards.js +286 -0
- package/dist/daemon/services/config.d.ts +35 -0
- package/dist/daemon/services/config.js +68 -0
- package/dist/daemon/services/context.d.ts +55 -0
- package/dist/daemon/services/context.js +113 -0
- package/dist/daemon/services/health-monitor.d.ts +58 -0
- package/dist/daemon/services/health-monitor.js +158 -0
- package/dist/daemon/services/mcp-servers.d.ts +42 -0
- package/dist/daemon/services/mcp-servers.js +275 -0
- package/dist/daemon/services/messages.d.ts +49 -0
- package/dist/daemon/services/messages.js +269 -0
- package/dist/daemon/services/repos.d.ts +61 -0
- package/dist/daemon/services/repos.js +350 -0
- package/dist/daemon/services/session-mcp-servers.d.ts +56 -0
- package/dist/daemon/services/session-mcp-servers.js +51 -0
- package/dist/daemon/services/sessions.d.ts +64 -0
- package/dist/daemon/services/sessions.js +398 -0
- package/dist/daemon/services/tasks.d.ts +55 -0
- package/dist/daemon/services/tasks.js +318 -0
- package/dist/daemon/services/terminals.d.ts +75 -0
- package/dist/daemon/services/terminals.js +110 -0
- package/dist/daemon/services/users.d.ts +98 -0
- package/dist/daemon/services/users.js +177 -0
- package/dist/daemon/services/worktrees.d.ts +98 -0
- package/dist/daemon/services/worktrees.js +719 -0
- package/dist/daemon/strategies/anonymous.d.ts +20 -0
- package/dist/daemon/strategies/anonymous.js +32 -0
- package/dist/ui/assets/cc-CYmbalCD.png +0 -0
- package/dist/ui/assets/codex-4sLD1mVS.png +0 -0
- package/dist/ui/assets/cursor-BUy5pFVL.png +0 -0
- package/dist/ui/assets/gemini-ajOb7iAl.png +0 -0
- package/dist/ui/assets/index-Dc4ELxry.css +32 -0
- package/dist/ui/assets/index-KfIu8v4V.js +578 -0
- package/dist/ui/favicon.png +0 -0
- package/dist/ui/index.html +26 -0
- package/dist/ui/vite.svg +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { d as Message } from '../message-BoxZISHg.cjs';
|
|
2
|
+
import { a as SessionID } from '../id-DMqyogFB.cjs';
|
|
3
|
+
import { T as TaskStatus, e as Task } from '../task-BIEgT1DK.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Claude Code transcript parser
|
|
7
|
+
*
|
|
8
|
+
* Parses JSONL transcript files from ~/.claude/projects/
|
|
9
|
+
*/
|
|
10
|
+
interface TranscriptMessage {
|
|
11
|
+
type: 'user' | 'assistant' | 'system' | 'file-history-snapshot';
|
|
12
|
+
uuid?: string;
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
timestamp?: string;
|
|
15
|
+
parentUuid?: string | null;
|
|
16
|
+
cwd?: string;
|
|
17
|
+
gitBranch?: string;
|
|
18
|
+
version?: string;
|
|
19
|
+
message?: {
|
|
20
|
+
role: string;
|
|
21
|
+
content: string | Array<{
|
|
22
|
+
type: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
isMeta?: boolean;
|
|
27
|
+
isSidechain?: boolean;
|
|
28
|
+
messageId?: string;
|
|
29
|
+
snapshot?: unknown;
|
|
30
|
+
isSnapshotUpdate?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get transcript file path for a session ID
|
|
34
|
+
*/
|
|
35
|
+
declare function getTranscriptPath(sessionId: string, projectDir?: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Parse JSONL transcript file
|
|
38
|
+
*/
|
|
39
|
+
declare function parseTranscript(transcriptPath: string): Promise<TranscriptMessage[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Load transcript for a session ID
|
|
42
|
+
*/
|
|
43
|
+
declare function loadSessionTranscript(sessionId: string, projectDir?: string): Promise<TranscriptMessage[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Filter transcript messages (exclude meta messages, snapshots, etc.)
|
|
46
|
+
*/
|
|
47
|
+
declare function filterConversationMessages(messages: TranscriptMessage[]): TranscriptMessage[];
|
|
48
|
+
/**
|
|
49
|
+
* Build conversation tree from transcript messages
|
|
50
|
+
*/
|
|
51
|
+
interface ConversationNode {
|
|
52
|
+
message: TranscriptMessage;
|
|
53
|
+
children: ConversationNode[];
|
|
54
|
+
}
|
|
55
|
+
declare function buildConversationTree(messages: TranscriptMessage[]): ConversationNode[];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Load Claude Code session by parsing transcript file
|
|
59
|
+
*
|
|
60
|
+
* Strategy:
|
|
61
|
+
* 1. Locate transcript file in ~/.claude/projects/{project-slug}/{session-id}.jsonl
|
|
62
|
+
* 2. Parse the JSONL file to get full message history
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
interface ClaudeSession {
|
|
66
|
+
sessionId: string;
|
|
67
|
+
transcriptPath: string;
|
|
68
|
+
cwd: string | null;
|
|
69
|
+
messages: TranscriptMessage[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Load a Claude Code session by ID
|
|
73
|
+
*
|
|
74
|
+
* Parses the JSONL transcript file from ~/.claude/projects/
|
|
75
|
+
*/
|
|
76
|
+
declare function loadClaudeSession(sessionId: string, projectDir?: string): Promise<ClaudeSession>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Convert Claude transcript messages to Agor Message format
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Convert a transcript message to an Agor Message
|
|
84
|
+
*/
|
|
85
|
+
declare function transcriptToMessage(transcript: TranscriptMessage, sessionId: SessionID, index: number): Message;
|
|
86
|
+
/**
|
|
87
|
+
* Convert array of transcript messages to Agor Messages
|
|
88
|
+
*/
|
|
89
|
+
declare function transcriptsToMessages(transcripts: TranscriptMessage[], sessionId: SessionID): Message[];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Extract Tasks from Claude Code conversation messages
|
|
93
|
+
*
|
|
94
|
+
* Converts user messages into Task records with message ranges.
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
interface ExtractedTask {
|
|
98
|
+
task_id: string;
|
|
99
|
+
session_id: SessionID;
|
|
100
|
+
full_prompt: string;
|
|
101
|
+
description: string;
|
|
102
|
+
status: typeof TaskStatus.COMPLETED;
|
|
103
|
+
message_range: {
|
|
104
|
+
start_index: number;
|
|
105
|
+
end_index: number;
|
|
106
|
+
start_timestamp: string;
|
|
107
|
+
end_timestamp?: string;
|
|
108
|
+
};
|
|
109
|
+
git_state: {
|
|
110
|
+
ref_at_start: string;
|
|
111
|
+
sha_at_start: string;
|
|
112
|
+
};
|
|
113
|
+
model: string;
|
|
114
|
+
tool_use_count: number;
|
|
115
|
+
created_at: string;
|
|
116
|
+
completed_at?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Extract tasks from conversation messages
|
|
120
|
+
* Each user message becomes a task with its associated assistant responses
|
|
121
|
+
*/
|
|
122
|
+
declare function extractTasksFromMessages(messages: Message[], sessionId: SessionID): Partial<Task>[];
|
|
123
|
+
|
|
124
|
+
export { type ClaudeSession, type ConversationNode, type ExtractedTask, type TranscriptMessage, buildConversationTree, extractTasksFromMessages, filterConversationMessages, getTranscriptPath, loadClaudeSession, loadSessionTranscript, parseTranscript, transcriptToMessage, transcriptsToMessages };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { d as Message } from '../message-DvBzHu7V.js';
|
|
2
|
+
import { a as SessionID } from '../id-DMqyogFB.js';
|
|
3
|
+
import { T as TaskStatus, e as Task } from '../task-DuIfiUbW.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Claude Code transcript parser
|
|
7
|
+
*
|
|
8
|
+
* Parses JSONL transcript files from ~/.claude/projects/
|
|
9
|
+
*/
|
|
10
|
+
interface TranscriptMessage {
|
|
11
|
+
type: 'user' | 'assistant' | 'system' | 'file-history-snapshot';
|
|
12
|
+
uuid?: string;
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
timestamp?: string;
|
|
15
|
+
parentUuid?: string | null;
|
|
16
|
+
cwd?: string;
|
|
17
|
+
gitBranch?: string;
|
|
18
|
+
version?: string;
|
|
19
|
+
message?: {
|
|
20
|
+
role: string;
|
|
21
|
+
content: string | Array<{
|
|
22
|
+
type: string;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
isMeta?: boolean;
|
|
27
|
+
isSidechain?: boolean;
|
|
28
|
+
messageId?: string;
|
|
29
|
+
snapshot?: unknown;
|
|
30
|
+
isSnapshotUpdate?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get transcript file path for a session ID
|
|
34
|
+
*/
|
|
35
|
+
declare function getTranscriptPath(sessionId: string, projectDir?: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Parse JSONL transcript file
|
|
38
|
+
*/
|
|
39
|
+
declare function parseTranscript(transcriptPath: string): Promise<TranscriptMessage[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Load transcript for a session ID
|
|
42
|
+
*/
|
|
43
|
+
declare function loadSessionTranscript(sessionId: string, projectDir?: string): Promise<TranscriptMessage[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Filter transcript messages (exclude meta messages, snapshots, etc.)
|
|
46
|
+
*/
|
|
47
|
+
declare function filterConversationMessages(messages: TranscriptMessage[]): TranscriptMessage[];
|
|
48
|
+
/**
|
|
49
|
+
* Build conversation tree from transcript messages
|
|
50
|
+
*/
|
|
51
|
+
interface ConversationNode {
|
|
52
|
+
message: TranscriptMessage;
|
|
53
|
+
children: ConversationNode[];
|
|
54
|
+
}
|
|
55
|
+
declare function buildConversationTree(messages: TranscriptMessage[]): ConversationNode[];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Load Claude Code session by parsing transcript file
|
|
59
|
+
*
|
|
60
|
+
* Strategy:
|
|
61
|
+
* 1. Locate transcript file in ~/.claude/projects/{project-slug}/{session-id}.jsonl
|
|
62
|
+
* 2. Parse the JSONL file to get full message history
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
interface ClaudeSession {
|
|
66
|
+
sessionId: string;
|
|
67
|
+
transcriptPath: string;
|
|
68
|
+
cwd: string | null;
|
|
69
|
+
messages: TranscriptMessage[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Load a Claude Code session by ID
|
|
73
|
+
*
|
|
74
|
+
* Parses the JSONL transcript file from ~/.claude/projects/
|
|
75
|
+
*/
|
|
76
|
+
declare function loadClaudeSession(sessionId: string, projectDir?: string): Promise<ClaudeSession>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Convert Claude transcript messages to Agor Message format
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Convert a transcript message to an Agor Message
|
|
84
|
+
*/
|
|
85
|
+
declare function transcriptToMessage(transcript: TranscriptMessage, sessionId: SessionID, index: number): Message;
|
|
86
|
+
/**
|
|
87
|
+
* Convert array of transcript messages to Agor Messages
|
|
88
|
+
*/
|
|
89
|
+
declare function transcriptsToMessages(transcripts: TranscriptMessage[], sessionId: SessionID): Message[];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Extract Tasks from Claude Code conversation messages
|
|
93
|
+
*
|
|
94
|
+
* Converts user messages into Task records with message ranges.
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
interface ExtractedTask {
|
|
98
|
+
task_id: string;
|
|
99
|
+
session_id: SessionID;
|
|
100
|
+
full_prompt: string;
|
|
101
|
+
description: string;
|
|
102
|
+
status: typeof TaskStatus.COMPLETED;
|
|
103
|
+
message_range: {
|
|
104
|
+
start_index: number;
|
|
105
|
+
end_index: number;
|
|
106
|
+
start_timestamp: string;
|
|
107
|
+
end_timestamp?: string;
|
|
108
|
+
};
|
|
109
|
+
git_state: {
|
|
110
|
+
ref_at_start: string;
|
|
111
|
+
sha_at_start: string;
|
|
112
|
+
};
|
|
113
|
+
model: string;
|
|
114
|
+
tool_use_count: number;
|
|
115
|
+
created_at: string;
|
|
116
|
+
completed_at?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Extract tasks from conversation messages
|
|
120
|
+
* Each user message becomes a task with its associated assistant responses
|
|
121
|
+
*/
|
|
122
|
+
declare function extractTasksFromMessages(messages: Message[], sessionId: SessionID): Partial<Task>[];
|
|
123
|
+
|
|
124
|
+
export { type ClaudeSession, type ConversationNode, type ExtractedTask, type TranscriptMessage, buildConversationTree, extractTasksFromMessages, filterConversationMessages, getTranscriptPath, loadClaudeSession, loadSessionTranscript, parseTranscript, transcriptToMessage, transcriptsToMessages };
|