@bahulam/code 0.1.6 → 0.1.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.
Files changed (178) hide show
  1. package/LICENSE +1 -1
  2. package/NOTICE +6 -6
  3. package/README.md +10 -17
  4. package/package.json +9 -9
  5. package/src/agents/loader.mjs +1 -1
  6. package/src/agents/workflow_loader.mjs +2 -2
  7. package/src/auth/tarang-auth.mjs +3 -2
  8. package/src/config/model-catalog-default.json +4 -3
  9. package/src/config/model-catalog.mjs +2 -0
  10. package/src/context/prose-chunker.mjs +162 -5
  11. package/src/core/attachments.mjs +65 -3
  12. package/src/core/bundled-runtime.mjs +1 -1
  13. package/src/core/headless.mjs +14 -0
  14. package/src/core/jsonl-writer.mjs +3 -3
  15. package/src/core/lint-resolver.mjs +472 -0
  16. package/src/core/local-agent.mjs +15 -4
  17. package/src/core/local-store.mjs +4 -0
  18. package/src/core/output-filter.mjs +21 -25
  19. package/src/core/pricing.mjs +10 -3
  20. package/src/core/stream-client.mjs +9 -4
  21. package/src/core/tool-executor.mjs +105 -29
  22. package/src/daemon/http-dashboard.mjs +400 -0
  23. package/src/daemon/session-core.mjs +1 -0
  24. package/src/local-service/agent-relay.mjs +868 -0
  25. package/src/local-service/approval-bridge.mjs +222 -0
  26. package/src/local-service/browser.mjs +24 -0
  27. package/src/local-service/command.mjs +155 -0
  28. package/src/local-service/file-access.mjs +393 -0
  29. package/src/local-service/machine.mjs +86 -0
  30. package/src/local-service/paths.mjs +29 -0
  31. package/src/local-service/preview-converters.mjs +260 -0
  32. package/src/local-service/server.mjs +2644 -0
  33. package/src/local-service/session-store.mjs +221 -0
  34. package/src/onboarding/preflight.mjs +1 -1
  35. package/src/terminal/analytics.mjs +2 -6
  36. package/src/terminal/ansi.mjs +11 -3
  37. package/src/terminal/main.mjs +37 -11
  38. package/src/terminal/model-catalog-display.mjs +111 -0
  39. package/src/terminal/repl-format.mjs +4 -1
  40. package/src/terminal/repl-model-form.mjs +81 -14
  41. package/src/terminal/repl-render.mjs +35 -5
  42. package/src/terminal/repl-state.mjs +12 -0
  43. package/src/terminal/repl.mjs +231 -53
  44. package/src/terminal/tool-display.mjs +32 -0
  45. package/src/terminal/watch-state.mjs +118 -0
  46. package/src/tools/analyze-image.mjs +158 -0
  47. package/src/tools/bash.mjs +11 -9
  48. package/src/tools/generate-image.mjs +411 -0
  49. package/src/tools/lint.mjs +24 -43
  50. package/src/tools/registry.mjs +4 -0
  51. package/src/ui/icons.mjs +2 -0
  52. package/src/ui/palette.mjs +1 -1
  53. package/src/ui/slash-commands.mjs +4 -6
  54. package/src/ui/tool-card.mjs +7 -3
  55. package/pulse/app/activity/page.tsx +0 -190
  56. package/pulse/app/api/activity/route.ts +0 -138
  57. package/pulse/app/api/benchmark/route.ts +0 -113
  58. package/pulse/app/api/benchmarks/route.ts +0 -195
  59. package/pulse/app/api/costs/route.ts +0 -88
  60. package/pulse/app/api/export/route.ts +0 -77
  61. package/pulse/app/api/history/route.ts +0 -11
  62. package/pulse/app/api/import/route.ts +0 -31
  63. package/pulse/app/api/memory/route.ts +0 -50
  64. package/pulse/app/api/plans/route.ts +0 -9
  65. package/pulse/app/api/projects/[slug]/route.ts +0 -96
  66. package/pulse/app/api/projects/route.ts +0 -121
  67. package/pulse/app/api/sessions/[id]/replay/route.ts +0 -20
  68. package/pulse/app/api/sessions/[id]/route.ts +0 -31
  69. package/pulse/app/api/sessions/route.ts +0 -112
  70. package/pulse/app/api/settings/route.ts +0 -14
  71. package/pulse/app/api/stats/route.ts +0 -143
  72. package/pulse/app/api/todos/route.ts +0 -9
  73. package/pulse/app/api/tools/route.ts +0 -160
  74. package/pulse/app/benchmarks/page.tsx +0 -224
  75. package/pulse/app/costs/page.tsx +0 -179
  76. package/pulse/app/export/page.tsx +0 -465
  77. package/pulse/app/favicon.ico +0 -0
  78. package/pulse/app/globals.css +0 -263
  79. package/pulse/app/help/page.tsx +0 -143
  80. package/pulse/app/history/page.tsx +0 -157
  81. package/pulse/app/layout.tsx +0 -46
  82. package/pulse/app/memory/page.tsx +0 -365
  83. package/pulse/app/overview-client.tsx +0 -393
  84. package/pulse/app/page.tsx +0 -14
  85. package/pulse/app/plans/page.tsx +0 -308
  86. package/pulse/app/projects/[slug]/page.tsx +0 -390
  87. package/pulse/app/projects/page.tsx +0 -110
  88. package/pulse/app/sessions/[id]/page.tsx +0 -243
  89. package/pulse/app/sessions/page.tsx +0 -39
  90. package/pulse/app/settings/page.tsx +0 -188
  91. package/pulse/app/todos/page.tsx +0 -211
  92. package/pulse/app/tools/page.tsx +0 -249
  93. package/pulse/cli.js +0 -164
  94. package/pulse/components/activity/day-of-week-chart.tsx +0 -35
  95. package/pulse/components/activity/streak-card.tsx +0 -36
  96. package/pulse/components/costs/cache-efficiency-panel.tsx +0 -76
  97. package/pulse/components/costs/cost-by-project-chart.tsx +0 -48
  98. package/pulse/components/costs/cost-over-time-chart.tsx +0 -95
  99. package/pulse/components/costs/model-token-table.tsx +0 -60
  100. package/pulse/components/global-search.tsx +0 -193
  101. package/pulse/components/keyboard-nav-provider.tsx +0 -23
  102. package/pulse/components/layout/bottom-nav.tsx +0 -53
  103. package/pulse/components/layout/client-layout.tsx +0 -31
  104. package/pulse/components/layout/sidebar-context.tsx +0 -50
  105. package/pulse/components/layout/sidebar.tsx +0 -183
  106. package/pulse/components/layout/top-bar.tsx +0 -121
  107. package/pulse/components/overview/activity-heatmap.tsx +0 -107
  108. package/pulse/components/overview/conversation-table.tsx +0 -148
  109. package/pulse/components/overview/model-breakdown-donut.tsx +0 -95
  110. package/pulse/components/overview/peak-hours-chart.tsx +0 -87
  111. package/pulse/components/overview/project-activity-donut.tsx +0 -96
  112. package/pulse/components/overview/stat-card.tsx +0 -102
  113. package/pulse/components/overview/usage-over-time-chart.tsx +0 -166
  114. package/pulse/components/projects/project-card.tsx +0 -175
  115. package/pulse/components/sessions/replay/assistant-markdown.tsx +0 -94
  116. package/pulse/components/sessions/replay/compaction-card.tsx +0 -25
  117. package/pulse/components/sessions/replay/session-sidebar.tsx +0 -231
  118. package/pulse/components/sessions/replay/token-accumulation-chart.tsx +0 -98
  119. package/pulse/components/sessions/replay/tool-call-badge.tsx +0 -127
  120. package/pulse/components/sessions/replay/turn-cards.tsx +0 -220
  121. package/pulse/components/sessions/replay/user-tool-result.tsx +0 -158
  122. package/pulse/components/sessions/session-badges.tsx +0 -49
  123. package/pulse/components/sessions/session-table.tsx +0 -299
  124. package/pulse/components/theme-provider.tsx +0 -44
  125. package/pulse/components/tools/feature-adoption-table.tsx +0 -58
  126. package/pulse/components/tools/mcp-server-panel.tsx +0 -45
  127. package/pulse/components/tools/tool-ranking-chart.tsx +0 -57
  128. package/pulse/components/tools/version-history-table.tsx +0 -32
  129. package/pulse/components/ui/alert.tsx +0 -66
  130. package/pulse/components/ui/badge.tsx +0 -48
  131. package/pulse/components/ui/breadcrumb.tsx +0 -109
  132. package/pulse/components/ui/button.tsx +0 -64
  133. package/pulse/components/ui/calendar.tsx +0 -220
  134. package/pulse/components/ui/card.tsx +0 -92
  135. package/pulse/components/ui/command.tsx +0 -158
  136. package/pulse/components/ui/dialog.tsx +0 -158
  137. package/pulse/components/ui/input.tsx +0 -21
  138. package/pulse/components/ui/popover.tsx +0 -89
  139. package/pulse/components/ui/progress.tsx +0 -31
  140. package/pulse/components/ui/select.tsx +0 -190
  141. package/pulse/components/ui/separator.tsx +0 -28
  142. package/pulse/components/ui/sheet.tsx +0 -143
  143. package/pulse/components/ui/skeleton.tsx +0 -13
  144. package/pulse/components/ui/table.tsx +0 -116
  145. package/pulse/components/ui/tabs.tsx +0 -91
  146. package/pulse/components/ui/tooltip.tsx +0 -57
  147. package/pulse/components/use-global-keyboard-nav.ts +0 -79
  148. package/pulse/components.json +0 -23
  149. package/pulse/eslint.config.mjs +0 -18
  150. package/pulse/lib/bahulam-paths.ts +0 -23
  151. package/pulse/lib/claude-reader.ts +0 -592
  152. package/pulse/lib/decode.ts +0 -129
  153. package/pulse/lib/pricing.ts +0 -102
  154. package/pulse/lib/replay-parser.ts +0 -165
  155. package/pulse/lib/tool-categories.ts +0 -140
  156. package/pulse/lib/utils.ts +0 -6
  157. package/pulse/next-env.d.ts +0 -6
  158. package/pulse/next.config.ts +0 -16
  159. package/pulse/package.json +0 -45
  160. package/pulse/postcss.config.mjs +0 -7
  161. package/pulse/public/activity.png +0 -0
  162. package/pulse/public/cc-lens.png +0 -0
  163. package/pulse/public/command-k.png +0 -0
  164. package/pulse/public/costs.png +0 -0
  165. package/pulse/public/dashboard-dark.png +0 -0
  166. package/pulse/public/dashboard-white.png +0 -0
  167. package/pulse/public/export.png +0 -0
  168. package/pulse/public/file.svg +0 -1
  169. package/pulse/public/globe.svg +0 -1
  170. package/pulse/public/next.svg +0 -1
  171. package/pulse/public/projects.png +0 -0
  172. package/pulse/public/session-chat.png +0 -0
  173. package/pulse/public/todos.png +0 -0
  174. package/pulse/public/tools.png +0 -0
  175. package/pulse/public/vercel.svg +0 -1
  176. package/pulse/public/window.svg +0 -1
  177. package/pulse/tsconfig.json +0 -34
  178. package/pulse/types/claude.ts +0 -294
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "noEmit": true,
9
- "esModuleInterop": true,
10
- "module": "esnext",
11
- "moduleResolution": "bundler",
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
- "jsx": "react-jsx",
15
- "incremental": true,
16
- "plugins": [
17
- {
18
- "name": "next"
19
- }
20
- ],
21
- "paths": {
22
- "@/*": ["./*"]
23
- }
24
- },
25
- "include": [
26
- "next-env.d.ts",
27
- "**/*.ts",
28
- "**/*.tsx",
29
- ".next/types/**/*.ts",
30
- ".next/dev/types/**/*.ts",
31
- "**/*.mts"
32
- ],
33
- "exclude": ["node_modules"]
34
- }
@@ -1,294 +0,0 @@
1
- // ─── Stats Cache ─────────────────────────────────────────────────────────────
2
-
3
- export interface DailyActivity {
4
- date: string
5
- messageCount: number
6
- sessionCount: number
7
- toolCallCount: number
8
- }
9
-
10
- export interface DailyTokens {
11
- date: string
12
- tokensByModel: Record<string, number>
13
- }
14
-
15
- export interface ModelUsage {
16
- inputTokens: number
17
- outputTokens: number
18
- cacheReadInputTokens: number
19
- cacheCreationInputTokens: number
20
- costUSD: number
21
- webSearchRequests: number
22
- }
23
-
24
- export interface LongestSession {
25
- sessionId: string
26
- duration: number
27
- messageCount: number
28
- timestamp: string
29
- }
30
-
31
- export interface StatsCache {
32
- version: number
33
- lastComputedDate: string
34
- dailyActivity: DailyActivity[]
35
- tokensByDate: DailyTokens[]
36
- dailyModelTokens?: DailyTokens[]
37
- modelUsage: Record<string, ModelUsage>
38
- totalSessions: number
39
- totalMessages: number
40
- longestSession: LongestSession
41
- firstSessionDate: string
42
- hourCounts: Record<string, number>
43
- totalSpeculationTimeSavedMs: number
44
- }
45
-
46
- // ─── Session Meta ─────────────────────────────────────────────────────────────
47
-
48
- export interface SessionMeta {
49
- session_id: string
50
- project_path: string
51
- start_time: string
52
- duration_minutes: number
53
- user_message_count: number
54
- assistant_message_count: number
55
- tool_counts: Record<string, number>
56
- languages: Record<string, number>
57
- git_commits: number
58
- git_pushes: number
59
- input_tokens: number
60
- output_tokens: number
61
- cache_creation_input_tokens?: number
62
- cache_read_input_tokens?: number
63
- first_prompt: string
64
- user_interruptions: number
65
- user_response_times: number[]
66
- tool_errors: number
67
- tool_error_categories: Record<string, number>
68
- uses_task_agent: boolean
69
- uses_mcp: boolean
70
- uses_web_search: boolean
71
- uses_web_fetch: boolean
72
- lines_added: number
73
- lines_removed: number
74
- files_modified: number
75
- message_hours: number[]
76
- user_message_timestamps: string[]
77
- }
78
-
79
- // ─── Facets ──────────────────────────────────────────────────────────────────
80
-
81
- export interface Facet {
82
- session_id: string
83
- underlying_goal: string
84
- goal_categories: Record<string, number>
85
- outcome: string
86
- user_satisfaction_counts: Record<string, number>
87
- claude_helpfulness: string
88
- session_type: string
89
- friction_counts: Record<string, number>
90
- friction_detail: string
91
- primary_success: string
92
- brief_summary: string
93
- }
94
-
95
- // ─── Session with Facet joined ───────────────────────────────────────────────
96
-
97
- export interface SessionWithFacet extends SessionMeta {
98
- facet?: Facet
99
- estimated_cost: number
100
- slug?: string
101
- version?: string
102
- git_branch?: string
103
- has_compaction?: boolean
104
- has_thinking?: boolean
105
- }
106
-
107
- // ─── Replay / JSONL ──────────────────────────────────────────────────────────
108
-
109
- export interface TurnUsage {
110
- input_tokens: number
111
- output_tokens: number
112
- cache_creation_input_tokens: number
113
- cache_read_input_tokens: number
114
- cache_creation?: {
115
- ephemeral_5m_input_tokens: number
116
- ephemeral_1h_input_tokens: number
117
- }
118
- service_tier?: string
119
- inference_geo?: string
120
- }
121
-
122
- export interface ToolCall {
123
- id: string
124
- name: string
125
- input: Record<string, unknown>
126
- result?: string
127
- is_error?: boolean
128
- }
129
-
130
- export interface ReplayTurn {
131
- uuid: string
132
- parentUuid: string | null
133
- type: 'user' | 'assistant'
134
- timestamp: string
135
- model?: string
136
- usage?: TurnUsage
137
- text?: string
138
- tool_calls?: ToolCall[]
139
- tool_results?: Array<{ tool_use_id: string; content: string; is_error: boolean }>
140
- has_thinking?: boolean
141
- thinking_text?: string
142
- estimated_cost?: number
143
- turn_duration_ms?: number
144
- response_time_s?: number
145
- }
146
-
147
- export interface CompactionEvent {
148
- uuid: string
149
- timestamp: string
150
- trigger: 'auto' | 'manual'
151
- pre_tokens: number
152
- summary?: string
153
- turn_index: number
154
- }
155
-
156
- export interface SummaryEvent {
157
- uuid: string
158
- summary: string
159
- leaf_uuid: string
160
- }
161
-
162
- export interface ReplayData {
163
- session_id: string
164
- slug?: string
165
- version?: string
166
- git_branch?: string
167
- turns: ReplayTurn[]
168
- compactions: CompactionEvent[]
169
- summaries: SummaryEvent[]
170
- total_cost: number
171
- }
172
-
173
- // ─── Project Summary ──────────────────────────────────────────────────────────
174
-
175
- export interface ProjectSummary {
176
- slug: string
177
- project_path: string
178
- display_name: string
179
- session_count: number
180
- total_messages: number
181
- total_duration_minutes: number
182
- total_lines_added: number
183
- total_lines_removed: number
184
- total_files_modified: number
185
- git_commits: number
186
- git_pushes: number
187
- estimated_cost: number
188
- input_tokens: number
189
- output_tokens: number
190
- languages: Record<string, number>
191
- tool_counts: Record<string, number>
192
- last_active: string
193
- first_active: string
194
- uses_mcp: boolean
195
- uses_task_agent: boolean
196
- branches: string[]
197
- }
198
-
199
- // ─── Tool Analytics ───────────────────────────────────────────────────────────
200
-
201
- export interface ToolSummary {
202
- name: string
203
- category: string
204
- total_calls: number
205
- session_count: number
206
- error_count: number
207
- }
208
-
209
- export interface McpServerSummary {
210
- server_name: string
211
- tools: Array<{ name: string; calls: number }>
212
- total_calls: number
213
- session_count: number
214
- }
215
-
216
- export interface VersionRecord {
217
- version: string
218
- session_count: number
219
- first_seen: string
220
- last_seen: string
221
- }
222
-
223
- export interface ToolsAnalytics {
224
- tools: ToolSummary[]
225
- mcp_servers: McpServerSummary[]
226
- feature_adoption: Record<string, { sessions: number; pct: number }>
227
- versions: VersionRecord[]
228
- branches: Array<{ branch: string; turns: number }>
229
- error_categories: Record<string, number>
230
- total_tool_calls: number
231
- total_errors: number
232
- }
233
-
234
- // ─── Cost Analytics ───────────────────────────────────────────────────────────
235
-
236
- export interface ModelCostBreakdown {
237
- model: string
238
- input_tokens: number
239
- output_tokens: number
240
- cache_write_tokens: number
241
- cache_read_tokens: number
242
- estimated_cost: number
243
- cache_savings: number
244
- cache_hit_rate: number
245
- }
246
-
247
- export interface DailyCost {
248
- date: string
249
- costs: Record<string, number>
250
- total: number
251
- }
252
-
253
- export interface ProjectCost {
254
- slug: string
255
- display_name: string
256
- estimated_cost: number
257
- input_tokens: number
258
- output_tokens: number
259
- }
260
-
261
- export interface CostAnalytics {
262
- total_cost: number
263
- total_savings: number
264
- models: ModelCostBreakdown[]
265
- daily: DailyCost[]
266
- by_project: ProjectCost[]
267
- }
268
-
269
- // ─── History ──────────────────────────────────────────────────────────────────
270
-
271
- export interface HistoryEntry {
272
- display: string
273
- timestamp: number
274
- project: string
275
- sessionId?: string
276
- }
277
-
278
- // ─── Export ──────────────────────────────────────────────────────────────────
279
-
280
- export interface ExportPayload {
281
- exportedAt: string
282
- version: string
283
- stats: StatsCache | null
284
- sessions: SessionMeta[]
285
- facets: Facet[]
286
- history: HistoryEntry[]
287
- }
288
-
289
- export interface ImportDiff {
290
- total_in_export: number
291
- already_present: number
292
- new_sessions: number
293
- sessions_to_add: SessionMeta[]
294
- }