@ccpocket-base-auth/bridge 1.26.0

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 (89) hide show
  1. package/README.md +67 -0
  2. package/dist/archive-store.d.ts +28 -0
  3. package/dist/archive-store.js +68 -0
  4. package/dist/archive-store.js.map +1 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +82 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/codex-process.d.ts +171 -0
  9. package/dist/codex-process.js +1928 -0
  10. package/dist/codex-process.js.map +1 -0
  11. package/dist/debug-trace-store.d.ts +15 -0
  12. package/dist/debug-trace-store.js +78 -0
  13. package/dist/debug-trace-store.js.map +1 -0
  14. package/dist/doctor.d.ts +58 -0
  15. package/dist/doctor.js +663 -0
  16. package/dist/doctor.js.map +1 -0
  17. package/dist/firebase-auth.d.ts +35 -0
  18. package/dist/firebase-auth.js +132 -0
  19. package/dist/firebase-auth.js.map +1 -0
  20. package/dist/gallery-store.d.ts +67 -0
  21. package/dist/gallery-store.js +333 -0
  22. package/dist/gallery-store.js.map +1 -0
  23. package/dist/image-store.d.ts +23 -0
  24. package/dist/image-store.js +142 -0
  25. package/dist/image-store.js.map +1 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +191 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/mdns.d.ts +7 -0
  30. package/dist/mdns.js +49 -0
  31. package/dist/mdns.js.map +1 -0
  32. package/dist/parser.d.ts +465 -0
  33. package/dist/parser.js +251 -0
  34. package/dist/parser.js.map +1 -0
  35. package/dist/project-history.d.ts +10 -0
  36. package/dist/project-history.js +73 -0
  37. package/dist/project-history.js.map +1 -0
  38. package/dist/prompt-history-backup.d.ts +15 -0
  39. package/dist/prompt-history-backup.js +46 -0
  40. package/dist/prompt-history-backup.js.map +1 -0
  41. package/dist/proxy.d.ts +15 -0
  42. package/dist/proxy.js +95 -0
  43. package/dist/proxy.js.map +1 -0
  44. package/dist/push-i18n.d.ts +7 -0
  45. package/dist/push-i18n.js +75 -0
  46. package/dist/push-i18n.js.map +1 -0
  47. package/dist/push-relay.d.ts +29 -0
  48. package/dist/push-relay.js +70 -0
  49. package/dist/push-relay.js.map +1 -0
  50. package/dist/recording-store.d.ts +51 -0
  51. package/dist/recording-store.js +158 -0
  52. package/dist/recording-store.js.map +1 -0
  53. package/dist/screenshot.d.ts +28 -0
  54. package/dist/screenshot.js +98 -0
  55. package/dist/screenshot.js.map +1 -0
  56. package/dist/sdk-process.d.ts +180 -0
  57. package/dist/sdk-process.js +937 -0
  58. package/dist/sdk-process.js.map +1 -0
  59. package/dist/session.d.ts +142 -0
  60. package/dist/session.js +615 -0
  61. package/dist/session.js.map +1 -0
  62. package/dist/sessions-index.d.ts +128 -0
  63. package/dist/sessions-index.js +1767 -0
  64. package/dist/sessions-index.js.map +1 -0
  65. package/dist/setup-launchd.d.ts +8 -0
  66. package/dist/setup-launchd.js +109 -0
  67. package/dist/setup-launchd.js.map +1 -0
  68. package/dist/setup-systemd.d.ts +8 -0
  69. package/dist/setup-systemd.js +118 -0
  70. package/dist/setup-systemd.js.map +1 -0
  71. package/dist/startup-info.d.ts +8 -0
  72. package/dist/startup-info.js +92 -0
  73. package/dist/startup-info.js.map +1 -0
  74. package/dist/usage.d.ts +69 -0
  75. package/dist/usage.js +545 -0
  76. package/dist/usage.js.map +1 -0
  77. package/dist/version.d.ts +13 -0
  78. package/dist/version.js +43 -0
  79. package/dist/version.js.map +1 -0
  80. package/dist/websocket.d.ts +127 -0
  81. package/dist/websocket.js +2482 -0
  82. package/dist/websocket.js.map +1 -0
  83. package/dist/worktree-store.d.ts +25 -0
  84. package/dist/worktree-store.js +59 -0
  85. package/dist/worktree-store.js.map +1 -0
  86. package/dist/worktree.d.ts +47 -0
  87. package/dist/worktree.js +313 -0
  88. package/dist/worktree.js.map +1 -0
  89. package/package.json +68 -0
@@ -0,0 +1,128 @@
1
+ export interface SessionIndexEntry {
2
+ sessionId: string;
3
+ provider: "claude" | "codex";
4
+ /** User-assigned session name (customTitle for Claude, thread_name for Codex). */
5
+ name?: string;
6
+ agentNickname?: string;
7
+ agentRole?: string;
8
+ summary?: string;
9
+ firstPrompt: string;
10
+ lastPrompt?: string;
11
+ created: string;
12
+ modified: string;
13
+ gitBranch: string;
14
+ projectPath: string;
15
+ /** Raw cwd used to resume this session (worktree path for codex, if any). */
16
+ resumeCwd?: string;
17
+ isSidechain: boolean;
18
+ codexSettings?: {
19
+ approvalPolicy?: string;
20
+ sandboxMode?: string;
21
+ model?: string;
22
+ modelReasoningEffort?: string;
23
+ networkAccessEnabled?: boolean;
24
+ webSearchMode?: string;
25
+ };
26
+ }
27
+ export interface GetRecentSessionsOptions {
28
+ limit?: number;
29
+ offset?: number;
30
+ projectPath?: string;
31
+ /** Session IDs to exclude (archived sessions). */
32
+ archivedSessionIds?: ReadonlySet<string>;
33
+ /** Filter by provider (claude or codex). */
34
+ provider?: "claude" | "codex";
35
+ /** Show only sessions with a non-empty name. */
36
+ namedOnly?: boolean;
37
+ /** Free-text search across name, firstPrompt, lastPrompt and summary. */
38
+ searchQuery?: string;
39
+ }
40
+ export interface GetRecentSessionsResult {
41
+ sessions: SessionIndexEntry[];
42
+ hasMore: boolean;
43
+ }
44
+ interface JsonlScanStats {
45
+ filesTotal: number;
46
+ filesExcluded: number;
47
+ filesRead: number;
48
+ entriesReturned: number;
49
+ }
50
+ interface ScanJsonlDirOptions {
51
+ excludeSessionIds?: ReadonlySet<string>;
52
+ stats?: JsonlScanStats;
53
+ }
54
+ /** Convert a filesystem path to Claude's project directory slug (e.g. /foo/bar → -foo-bar). */
55
+ export declare function pathToSlug(p: string): string;
56
+ /**
57
+ * Normalize a worktree cwd back to the main project path.
58
+ * e.g. /path/to/project-worktrees/branch → /path/to/project
59
+ */
60
+ export declare function normalizeWorktreePath(p: string): string;
61
+ /**
62
+ * Check if a directory slug represents a worktree directory for a given project slug.
63
+ * e.g. "-Users-x-proj-worktrees-branch" is a worktree dir for "-Users-x-proj".
64
+ */
65
+ export declare function isWorktreeSlug(dirSlug: string, projectSlug: string): boolean;
66
+ /**
67
+ * Scan a directory for JSONL session files and create SessionIndexEntry objects.
68
+ * Used as a fallback when sessions-index.json is missing (common for worktree sessions).
69
+ * File reads are parallelized and use head+tail partial reads for performance.
70
+ */
71
+ export declare function scanJsonlDir(dirPath: string, options?: ScanJsonlDirOptions): Promise<SessionIndexEntry[]>;
72
+ export declare function getAllRecentSessions(options?: GetRecentSessionsOptions): Promise<GetRecentSessionsResult>;
73
+ /**
74
+ * Look up the saved name (customTitle) for a Claude Code session.
75
+ * Returns the name if found, or undefined.
76
+ */
77
+ export declare function getClaudeSessionName(projectPath: string, claudeSessionId: string): Promise<string | undefined>;
78
+ /**
79
+ * Rename a Claude Code session by writing customTitle to sessions-index.json.
80
+ * This is the same mechanism the CLI uses for /rename.
81
+ */
82
+ export declare function renameClaudeSession(projectPath: string, claudeSessionId: string, name: string | null): Promise<boolean>;
83
+ /**
84
+ * Read the Codex session_index.jsonl and build a threadId → name map.
85
+ */
86
+ export declare function loadCodexSessionNames(): Promise<Map<string, string>>;
87
+ /**
88
+ * Rename a Codex session by appending to ~/.codex/session_index.jsonl.
89
+ * Passing `null` or empty name writes an empty thread_name to effectively clear it.
90
+ */
91
+ export declare function renameCodexSession(threadId: string, name: string | null): Promise<boolean>;
92
+ export interface SessionHistoryMessage {
93
+ role: "user" | "assistant";
94
+ uuid?: string;
95
+ timestamp?: string;
96
+ /** Skill loading prompt or other meta message (rendered as a chip). */
97
+ isMeta?: boolean;
98
+ /** Number of images attached to this user message (for display indicator). */
99
+ imageCount?: number;
100
+ content: Array<{
101
+ type: string;
102
+ text?: string;
103
+ id?: string;
104
+ name?: string;
105
+ input?: Record<string, unknown>;
106
+ }>;
107
+ }
108
+ /**
109
+ * Read past conversation messages from a session's JSONL file.
110
+ * Returns user and assistant messages suitable for display.
111
+ */
112
+ export declare function getSessionHistory(sessionId: string): Promise<SessionHistoryMessage[]>;
113
+ export interface ExtractedImage {
114
+ base64: string;
115
+ mimeType: string;
116
+ }
117
+ /**
118
+ * Extract image base64 data from a Claude Code session JSONL for a specific message UUID.
119
+ */
120
+ export declare function extractMessageImages(sessionId: string, messageUuid: string): Promise<ExtractedImage[]>;
121
+ export declare function getCodexSessionHistory(threadId: string): Promise<SessionHistoryMessage[]>;
122
+ /**
123
+ * Look up session metadata for a set of Claude CLI sessionIds.
124
+ * Returns a map from sessionId to a subset of session metadata.
125
+ * More efficient than getAllRecentSessions when you only need a few entries.
126
+ */
127
+ export declare function findSessionsByClaudeIds(ids: Set<string>): Promise<Map<string, Pick<SessionIndexEntry, "summary" | "firstPrompt" | "lastPrompt" | "projectPath">>>;
128
+ export {};