@bahulam/code 0.1.5 → 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.
- package/LICENSE +1 -1
- package/NOTICE +6 -6
- package/README.md +10 -17
- package/package.json +9 -9
- package/src/agents/loader.mjs +1 -1
- package/src/agents/workflow_loader.mjs +2 -2
- package/src/auth/tarang-auth.mjs +3 -2
- package/src/config/model-catalog-default.json +4 -3
- package/src/config/model-catalog.mjs +2 -0
- package/src/context/prose-chunker.mjs +162 -5
- package/src/core/attachments.mjs +65 -3
- package/src/core/bundled-runtime.mjs +1 -1
- package/src/core/headless.mjs +14 -0
- package/src/core/jsonl-writer.mjs +3 -3
- package/src/core/lint-resolver.mjs +472 -0
- package/src/core/local-agent.mjs +15 -4
- package/src/core/local-store.mjs +4 -0
- package/src/core/output-filter.mjs +21 -25
- package/src/core/pricing.mjs +10 -3
- package/src/core/stream-client.mjs +112 -16
- package/src/core/tool-executor.mjs +123 -31
- package/src/daemon/http-dashboard.mjs +400 -0
- package/src/daemon/session-core.mjs +1 -0
- package/src/local-service/agent-relay.mjs +868 -0
- package/src/local-service/approval-bridge.mjs +222 -0
- package/src/local-service/browser.mjs +24 -0
- package/src/local-service/command.mjs +155 -0
- package/src/local-service/file-access.mjs +393 -0
- package/src/local-service/machine.mjs +86 -0
- package/src/local-service/paths.mjs +29 -0
- package/src/local-service/preview-converters.mjs +260 -0
- package/src/local-service/server.mjs +2644 -0
- package/src/local-service/session-store.mjs +221 -0
- package/src/onboarding/preflight.mjs +1 -1
- package/src/terminal/analytics.mjs +2 -6
- package/src/terminal/ansi.mjs +11 -3
- package/src/terminal/main.mjs +37 -11
- package/src/terminal/model-catalog-display.mjs +111 -0
- package/src/terminal/repl-format.mjs +4 -1
- package/src/terminal/repl-model-form.mjs +81 -14
- package/src/terminal/repl-render.mjs +35 -5
- package/src/terminal/repl-state.mjs +12 -0
- package/src/terminal/repl.mjs +255 -55
- package/src/terminal/tool-display.mjs +32 -0
- package/src/terminal/watch-state.mjs +118 -0
- package/src/tools/analyze-image.mjs +158 -0
- package/src/tools/bash.mjs +11 -9
- package/src/tools/generate-image.mjs +411 -0
- package/src/tools/lint.mjs +24 -43
- package/src/tools/project-overview.mjs +5 -2
- package/src/tools/registry.mjs +4 -0
- package/src/ui/icons.mjs +2 -0
- package/src/ui/palette.mjs +1 -1
- package/src/ui/slash-commands.mjs +4 -6
- package/src/ui/tool-card.mjs +7 -3
- package/pulse/app/activity/page.tsx +0 -190
- package/pulse/app/api/activity/route.ts +0 -138
- package/pulse/app/api/benchmark/route.ts +0 -113
- package/pulse/app/api/benchmarks/route.ts +0 -195
- package/pulse/app/api/costs/route.ts +0 -88
- package/pulse/app/api/export/route.ts +0 -77
- package/pulse/app/api/history/route.ts +0 -11
- package/pulse/app/api/import/route.ts +0 -31
- package/pulse/app/api/memory/route.ts +0 -50
- package/pulse/app/api/plans/route.ts +0 -9
- package/pulse/app/api/projects/[slug]/route.ts +0 -96
- package/pulse/app/api/projects/route.ts +0 -121
- package/pulse/app/api/sessions/[id]/replay/route.ts +0 -20
- package/pulse/app/api/sessions/[id]/route.ts +0 -31
- package/pulse/app/api/sessions/route.ts +0 -112
- package/pulse/app/api/settings/route.ts +0 -14
- package/pulse/app/api/stats/route.ts +0 -143
- package/pulse/app/api/todos/route.ts +0 -9
- package/pulse/app/api/tools/route.ts +0 -160
- package/pulse/app/benchmarks/page.tsx +0 -224
- package/pulse/app/costs/page.tsx +0 -179
- package/pulse/app/export/page.tsx +0 -465
- package/pulse/app/favicon.ico +0 -0
- package/pulse/app/globals.css +0 -263
- package/pulse/app/help/page.tsx +0 -143
- package/pulse/app/history/page.tsx +0 -157
- package/pulse/app/layout.tsx +0 -46
- package/pulse/app/memory/page.tsx +0 -365
- package/pulse/app/overview-client.tsx +0 -393
- package/pulse/app/page.tsx +0 -14
- package/pulse/app/plans/page.tsx +0 -308
- package/pulse/app/projects/[slug]/page.tsx +0 -390
- package/pulse/app/projects/page.tsx +0 -110
- package/pulse/app/sessions/[id]/page.tsx +0 -243
- package/pulse/app/sessions/page.tsx +0 -39
- package/pulse/app/settings/page.tsx +0 -188
- package/pulse/app/todos/page.tsx +0 -211
- package/pulse/app/tools/page.tsx +0 -249
- package/pulse/cli.js +0 -164
- package/pulse/components/activity/day-of-week-chart.tsx +0 -35
- package/pulse/components/activity/streak-card.tsx +0 -36
- package/pulse/components/costs/cache-efficiency-panel.tsx +0 -76
- package/pulse/components/costs/cost-by-project-chart.tsx +0 -48
- package/pulse/components/costs/cost-over-time-chart.tsx +0 -95
- package/pulse/components/costs/model-token-table.tsx +0 -60
- package/pulse/components/global-search.tsx +0 -193
- package/pulse/components/keyboard-nav-provider.tsx +0 -23
- package/pulse/components/layout/bottom-nav.tsx +0 -53
- package/pulse/components/layout/client-layout.tsx +0 -31
- package/pulse/components/layout/sidebar-context.tsx +0 -50
- package/pulse/components/layout/sidebar.tsx +0 -183
- package/pulse/components/layout/top-bar.tsx +0 -121
- package/pulse/components/overview/activity-heatmap.tsx +0 -107
- package/pulse/components/overview/conversation-table.tsx +0 -148
- package/pulse/components/overview/model-breakdown-donut.tsx +0 -95
- package/pulse/components/overview/peak-hours-chart.tsx +0 -87
- package/pulse/components/overview/project-activity-donut.tsx +0 -96
- package/pulse/components/overview/stat-card.tsx +0 -102
- package/pulse/components/overview/usage-over-time-chart.tsx +0 -166
- package/pulse/components/projects/project-card.tsx +0 -175
- package/pulse/components/sessions/replay/assistant-markdown.tsx +0 -94
- package/pulse/components/sessions/replay/compaction-card.tsx +0 -25
- package/pulse/components/sessions/replay/session-sidebar.tsx +0 -231
- package/pulse/components/sessions/replay/token-accumulation-chart.tsx +0 -98
- package/pulse/components/sessions/replay/tool-call-badge.tsx +0 -127
- package/pulse/components/sessions/replay/turn-cards.tsx +0 -220
- package/pulse/components/sessions/replay/user-tool-result.tsx +0 -158
- package/pulse/components/sessions/session-badges.tsx +0 -49
- package/pulse/components/sessions/session-table.tsx +0 -299
- package/pulse/components/theme-provider.tsx +0 -44
- package/pulse/components/tools/feature-adoption-table.tsx +0 -58
- package/pulse/components/tools/mcp-server-panel.tsx +0 -45
- package/pulse/components/tools/tool-ranking-chart.tsx +0 -57
- package/pulse/components/tools/version-history-table.tsx +0 -32
- package/pulse/components/ui/alert.tsx +0 -66
- package/pulse/components/ui/badge.tsx +0 -48
- package/pulse/components/ui/breadcrumb.tsx +0 -109
- package/pulse/components/ui/button.tsx +0 -64
- package/pulse/components/ui/calendar.tsx +0 -220
- package/pulse/components/ui/card.tsx +0 -92
- package/pulse/components/ui/command.tsx +0 -158
- package/pulse/components/ui/dialog.tsx +0 -158
- package/pulse/components/ui/input.tsx +0 -21
- package/pulse/components/ui/popover.tsx +0 -89
- package/pulse/components/ui/progress.tsx +0 -31
- package/pulse/components/ui/select.tsx +0 -190
- package/pulse/components/ui/separator.tsx +0 -28
- package/pulse/components/ui/sheet.tsx +0 -143
- package/pulse/components/ui/skeleton.tsx +0 -13
- package/pulse/components/ui/table.tsx +0 -116
- package/pulse/components/ui/tabs.tsx +0 -91
- package/pulse/components/ui/tooltip.tsx +0 -57
- package/pulse/components/use-global-keyboard-nav.ts +0 -79
- package/pulse/components.json +0 -23
- package/pulse/eslint.config.mjs +0 -18
- package/pulse/lib/bahulam-paths.ts +0 -23
- package/pulse/lib/claude-reader.ts +0 -592
- package/pulse/lib/decode.ts +0 -129
- package/pulse/lib/pricing.ts +0 -102
- package/pulse/lib/replay-parser.ts +0 -165
- package/pulse/lib/tool-categories.ts +0 -140
- package/pulse/lib/utils.ts +0 -6
- package/pulse/next-env.d.ts +0 -6
- package/pulse/next.config.ts +0 -16
- package/pulse/package.json +0 -45
- package/pulse/postcss.config.mjs +0 -7
- package/pulse/public/activity.png +0 -0
- package/pulse/public/cc-lens.png +0 -0
- package/pulse/public/command-k.png +0 -0
- package/pulse/public/costs.png +0 -0
- package/pulse/public/dashboard-dark.png +0 -0
- package/pulse/public/dashboard-white.png +0 -0
- package/pulse/public/export.png +0 -0
- package/pulse/public/file.svg +0 -1
- package/pulse/public/globe.svg +0 -1
- package/pulse/public/next.svg +0 -1
- package/pulse/public/projects.png +0 -0
- package/pulse/public/session-chat.png +0 -0
- package/pulse/public/todos.png +0 -0
- package/pulse/public/tools.png +0 -0
- package/pulse/public/vercel.svg +0 -1
- package/pulse/public/window.svg +0 -1
- package/pulse/tsconfig.json +0 -34
- package/pulse/types/claude.ts +0 -294
|
@@ -21,6 +21,7 @@ import { paint } from '../ui/palette.mjs';
|
|
|
21
21
|
import { runtime, session } from './repl-state.mjs';
|
|
22
22
|
import { fitAnsiLine } from './repl-format.mjs';
|
|
23
23
|
import { exploreCategory, isExploreTool } from './repl-explore.mjs';
|
|
24
|
+
import { watchState } from './watch-state.mjs';
|
|
24
25
|
import {
|
|
25
26
|
clearPinnedStatus,
|
|
26
27
|
drawPinnedStatus,
|
|
@@ -36,21 +37,50 @@ import * as queue from '../ui/render-queue.mjs';
|
|
|
36
37
|
// Max inner-tool lines shown under the spinner during a sub-agent run.
|
|
37
38
|
const SUB_AGENT_WINDOW_ROWS = 7;
|
|
38
39
|
|
|
40
|
+
function statusWidth() {
|
|
41
|
+
return Math.max(8, (process.stderr.columns || process.stdout.columns || 120) - 1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function fitStatusLine(line) {
|
|
45
|
+
return fitAnsiLine(String(line ?? '').replace(/[\r\n]+/g, ' '), statusWidth());
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function fitStatusLines(lines) {
|
|
49
|
+
return (Array.isArray(lines) ? lines : [lines]).map(fitStatusLine);
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
function presentStatus(rendered) {
|
|
53
|
+
// Watch panel override: when active, render the watch panel entries as a
|
|
54
|
+
// multi-line status block instead of the normal spinner/status line.
|
|
55
|
+
if (watchState.active) {
|
|
56
|
+
const lines = watchState.visible();
|
|
57
|
+
if (lines.length) {
|
|
58
|
+
const fitted = fitStatusLines(lines);
|
|
59
|
+
if (queue.isActive()) {
|
|
60
|
+
queue.statusBlock(fitted);
|
|
61
|
+
} else if (isInputDockMounted()) {
|
|
62
|
+
drawPinnedStatus(fitted.join('\n'));
|
|
63
|
+
} else {
|
|
64
|
+
inPlace(fitted.join('\n'));
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const fitted = fitStatusLine(rendered);
|
|
40
70
|
if (queue.isActive()) {
|
|
41
71
|
const win = runtime.subAgentWindow;
|
|
42
72
|
if (win?.active && win.lines.length) {
|
|
43
73
|
queue.statusBlock([
|
|
44
|
-
|
|
45
|
-
...win.lines.slice(-SUB_AGENT_WINDOW_ROWS).map(l => ` ${c.dim(l)}`),
|
|
74
|
+
fitted,
|
|
75
|
+
...fitStatusLines(win.lines.slice(-SUB_AGENT_WINDOW_ROWS).map(l => ` ${c.dim(l)}`)),
|
|
46
76
|
]);
|
|
47
77
|
return;
|
|
48
78
|
}
|
|
49
|
-
queue.status(
|
|
79
|
+
queue.status(fitted);
|
|
50
80
|
return;
|
|
51
81
|
}
|
|
52
|
-
if (isInputDockMounted()) { drawPinnedStatus(
|
|
53
|
-
inPlace(
|
|
82
|
+
if (isInputDockMounted()) { drawPinnedStatus(fitted); return; }
|
|
83
|
+
inPlace(fitted);
|
|
54
84
|
}
|
|
55
85
|
|
|
56
86
|
/** Push a line into the live sub-agent tool window (dedup consecutive). */
|
|
@@ -62,6 +62,10 @@ export const runtime = {
|
|
|
62
62
|
// N lines under the spinner) instead of appending to the transcript.
|
|
63
63
|
// Full detail stays on the recorded cards (/expand, /last, `d`).
|
|
64
64
|
subAgentWindow: { active: false, lines: [] },
|
|
65
|
+
|
|
66
|
+
// PRD-092: Watch panel — toggled by /watch. When active, the spinner
|
|
67
|
+
// area renders a compact agent-activity summary instead of the spinner.
|
|
68
|
+
watchPanelActive: false,
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
// Full session state for the current CLI process. Set by the REPL loop
|
|
@@ -73,6 +77,13 @@ export const session = {
|
|
|
73
77
|
startTime: Date.now(),
|
|
74
78
|
inputTokens: 0,
|
|
75
79
|
outputTokens: 0,
|
|
80
|
+
// Per-turn context indicator for the dock strip. Updated at each
|
|
81
|
+
// AGENT_COMPLETE from the backend's usage.total_input_tokens (the
|
|
82
|
+
// cumulative input the primary agent sent this turn across all its
|
|
83
|
+
// internal inferences). Rough proxy for "how big is the prompt right
|
|
84
|
+
// now" — approximates what the NEXT user turn will pay before any
|
|
85
|
+
// growth. Reset by /new.
|
|
86
|
+
lastTurnInputTokens: 0,
|
|
76
87
|
toolCalls: 0, // primary-agent tool calls in the current turn
|
|
77
88
|
subAgentToolCalls: 0,// forwarded internal sub-agent tool calls in the current turn
|
|
78
89
|
totalToolCalls: 0, // across all turns
|
|
@@ -85,6 +96,7 @@ export const session = {
|
|
|
85
96
|
user: null, // { github_username, email, role }
|
|
86
97
|
model: null, // from backend user profile
|
|
87
98
|
modelLimits: {}, // role -> {model, context_length, max_output, source}
|
|
99
|
+
subAgentModels: {}, // role -> model from backend session_info
|
|
88
100
|
blockedOps: 0, // safety guardrail blocks
|
|
89
101
|
delegations: [], // agent delegation events: { from, to, time }
|
|
90
102
|
phases: [], // phase history: { name, time }
|