@bahulam/code 0.1.1 → 0.1.3

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 (53) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +39 -0
  3. package/package.json +8 -9
  4. package/pulse/lib/tool-categories.ts +13 -0
  5. package/src/commands/device.mjs +121 -0
  6. package/src/commands/pair.mjs +190 -0
  7. package/src/commands/remote.mjs +110 -0
  8. package/src/config/env.mjs +2 -2
  9. package/src/core/event-log.mjs +393 -0
  10. package/src/core/headless.mjs +198 -0
  11. package/src/core/loop.mjs +276 -0
  12. package/src/core/memory-disk.mjs +210 -0
  13. package/src/core/paths.mjs +36 -0
  14. package/src/core/stream-client.mjs +28 -9
  15. package/src/core/tool-executor.mjs +64 -16
  16. package/src/daemon/approval-store.mjs +253 -0
  17. package/src/daemon/attach-client.mjs +361 -0
  18. package/src/daemon/daemonize.mjs +151 -0
  19. package/src/daemon/event-tap.mjs +197 -0
  20. package/src/daemon/input-lock.mjs +191 -0
  21. package/src/daemon/relay-client.mjs +258 -0
  22. package/src/daemon/session-core.mjs +179 -0
  23. package/src/daemon/session-list.mjs +26 -0
  24. package/src/daemon/session-publisher.mjs +78 -0
  25. package/src/daemon/socket-server.mjs +329 -0
  26. package/src/daemon/stop-daemon.mjs +18 -0
  27. package/src/permissions/checker.mjs +6 -6
  28. package/src/permissions/prompt.mjs +8 -7
  29. package/src/skills/installer.mjs +8 -0
  30. package/src/terminal/ansi.mjs +85 -9
  31. package/src/terminal/main.mjs +97 -3
  32. package/src/terminal/repl.mjs +389 -6
  33. package/src/terminal/skills-picker.mjs +121 -0
  34. package/src/terminal/skills.mjs +3 -3
  35. package/src/tools/analyze-code.mjs +39 -0
  36. package/src/tools/bash.mjs +1 -1
  37. package/src/tools/edit.mjs +18 -18
  38. package/src/tools/git-diff.mjs +34 -0
  39. package/src/tools/git-status.mjs +30 -0
  40. package/src/tools/glob.mjs +5 -2
  41. package/src/tools/grep.mjs +1 -1
  42. package/src/tools/meta-tools.mjs +85 -0
  43. package/src/tools/read-files.mjs +37 -0
  44. package/src/tools/read.mjs +20 -10
  45. package/src/tools/registry.mjs +20 -0
  46. package/src/tools/remember.mjs +147 -0
  47. package/src/tools/search-files.mjs +41 -0
  48. package/src/tools/write-project.mjs +62 -0
  49. package/src/tools/write.mjs +1 -1
  50. package/src/ui/banner.mjs +1 -1
  51. package/src/ui/slash-commands.mjs +16 -0
  52. package/src/ui/sub-agent.mjs +8 -2
  53. package/src/ui/transcript-block.mjs +4 -1
@@ -45,6 +45,8 @@ export const COMMANDS = {
45
45
  '/surgical': 'Verbosity: show everything (reasoning, expanded tools)',
46
46
  '/compact': 'Compact conversation context',
47
47
  '/agents': 'List available agents',
48
+ '/subagents': 'Alias of /agents (list/create/edit/sync sub-agents)',
49
+ '/skills': 'List / install / view / remove skills (SKILL.md bundles)',
48
50
  '/run': 'Run a sub-agent or synced workflow',
49
51
  '/explore': 'Code explorer agent',
50
52
  '/review': 'Code review agent',
@@ -146,6 +148,20 @@ export const HELP_GROUPS = [
146
148
  ['/architect <instruction>', 'Design an approach'],
147
149
  ],
148
150
  },
151
+ {
152
+ key: 'skills',
153
+ title: 'Skills',
154
+ summary: 'SKILL.md bundles',
155
+ commands: [
156
+ ['/skills', 'List installed skills'],
157
+ ['/skills install <url|path>', 'Install from Git URL or local directory'],
158
+ ['/skills install <src> --project', 'Install into .bahulam/skills (project scope)'],
159
+ ['/skills install <src> --force', 'Overwrite an existing skill'],
160
+ ['/skills view <name> [resource]', 'Show SKILL.md or a bundled resource'],
161
+ ['/skills remove <name>', 'Uninstall a skill'],
162
+ ['/skills update <name>', 'Reinstall from the recorded source'],
163
+ ],
164
+ },
149
165
  {
150
166
  key: 'workflows',
151
167
  title: 'Workflows',
@@ -19,6 +19,7 @@
19
19
 
20
20
  import { paint } from './palette.mjs';
21
21
  import { icons } from './icons.mjs';
22
+ import { formatSeconds } from '../terminal/ansi.mjs';
22
23
 
23
24
  const SUB_ICONS = {
24
25
  explore: '🔭',
@@ -122,9 +123,14 @@ export function renderSubAgentClose({
122
123
  const parts = [];
123
124
  if (toolCalls > 0) parts.push(`${toolCalls} tools`);
124
125
  if (iterations > 0) parts.push(`${iterations} iter`);
125
- if (tokens > 0) parts.push(`${formatTokens(tokens)} tok`);
126
+ // Tokens: pass the OUTPUT (generation) count only. Summing input+output
127
+ // across a multi-iteration sub-agent double-counts the context that is
128
+ // re-shipped each iteration, and the resulting number reads huge and
129
+ // misleading (e.g. 632.8k for a 16-iter run whose actual generation was
130
+ // a fraction of that). Output tokens are the honest "work done" number.
131
+ if (tokens > 0) parts.push(`${formatTokens(tokens)} gen`);
126
132
  if (typeof costUsd === 'number' && costUsd > 0) parts.push(formatCost(costUsd));
127
- if (durationS != null) parts.push(`${Number(durationS).toFixed(1)}s`);
133
+ if (durationS != null) parts.push(formatSeconds(durationS));
128
134
  const detail = parts.length ? paint.text.dim(' · ' + parts.join(' · ')) : '';
129
135
 
130
136
  const body = summary
@@ -1,7 +1,10 @@
1
1
  import { paint } from './palette.mjs';
2
2
 
3
3
  function tonePaint(tone) {
4
- return tone === 'user' ? paint.brand.accent : paint.brand.primary;
4
+ // 'user' tone was brand.accent (pink) — swapped to state.success (green)
5
+ // so the "your input" prompt reads as an active/go signal instead of the
6
+ // magenta 'attention/warn' tint the accent palette carries elsewhere.
7
+ return tone === 'user' ? paint.state.success : paint.brand.primary;
5
8
  }
6
9
 
7
10
  export function transcriptHeader(label, { tone = 'assistant' } = {}) {