jeo-code 0.1.0 → 0.4.5

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 (177) hide show
  1. package/README.ja.md +160 -0
  2. package/README.ko.md +160 -0
  3. package/README.md +115 -297
  4. package/README.zh.md +160 -0
  5. package/package.json +11 -6
  6. package/scripts/install.sh +28 -28
  7. package/scripts/uninstall.sh +17 -15
  8. package/src/AGENTS.md +50 -0
  9. package/src/agent/AGENTS.md +49 -0
  10. package/src/agent/bash-fixups.ts +103 -0
  11. package/src/agent/compaction.ts +410 -19
  12. package/src/agent/config-schema.ts +119 -5
  13. package/src/agent/context-files.ts +314 -17
  14. package/src/agent/dev/AGENTS.md +36 -0
  15. package/src/agent/dev/advanced-analyzer.ts +12 -0
  16. package/src/agent/dev/evolution-bridge.ts +82 -0
  17. package/src/agent/dev/evolution-logger.ts +41 -0
  18. package/src/agent/dev/self-analysis.ts +64 -0
  19. package/src/agent/dev/self-improve.ts +24 -0
  20. package/src/agent/dev/spec-automation.ts +49 -0
  21. package/src/agent/engine.ts +808 -54
  22. package/src/agent/hooks.ts +273 -0
  23. package/src/agent/loop.ts +21 -1
  24. package/src/agent/memory.ts +201 -0
  25. package/src/agent/model-recency.ts +32 -0
  26. package/src/agent/output-minimizer.ts +108 -0
  27. package/src/agent/output-util.ts +64 -0
  28. package/src/agent/plan.ts +187 -0
  29. package/src/agent/seed.ts +52 -0
  30. package/src/agent/session.ts +235 -21
  31. package/src/agent/state.ts +286 -39
  32. package/src/agent/step-budget.ts +232 -0
  33. package/src/agent/subagents.ts +223 -26
  34. package/src/agent/task-tool.ts +272 -0
  35. package/src/agent/todo-tool.ts +87 -0
  36. package/src/agent/tokenizer.ts +117 -0
  37. package/src/agent/tool-registry.ts +54 -0
  38. package/src/agent/tools.ts +624 -103
  39. package/src/agent/web-search.ts +538 -0
  40. package/src/ai/AGENTS.md +44 -0
  41. package/src/ai/index.ts +1 -0
  42. package/src/ai/model-catalog-compat.ts +3 -1
  43. package/src/ai/model-catalog.ts +74 -9
  44. package/src/ai/model-discovery.ts +215 -17
  45. package/src/ai/model-manager.ts +346 -32
  46. package/src/ai/model-picker.ts +1 -1
  47. package/src/ai/model-registry.ts +4 -2
  48. package/src/ai/pricing.ts +84 -0
  49. package/src/ai/provider-registry.ts +23 -0
  50. package/src/ai/provider-status.ts +60 -16
  51. package/src/ai/providers/AGENTS.md +42 -0
  52. package/src/ai/providers/anthropic.ts +250 -31
  53. package/src/ai/providers/antigravity.ts +219 -0
  54. package/src/ai/providers/errors.ts +15 -1
  55. package/src/ai/providers/gemini.ts +196 -13
  56. package/src/ai/providers/ollama.ts +37 -7
  57. package/src/ai/providers/openai-responses.ts +173 -0
  58. package/src/ai/providers/openai.ts +64 -12
  59. package/src/ai/sse.ts +4 -1
  60. package/src/ai/types.ts +18 -1
  61. package/src/auth/AGENTS.md +41 -0
  62. package/src/auth/callback-server.ts +6 -1
  63. package/src/auth/flows/AGENTS.md +32 -0
  64. package/src/auth/flows/antigravity.ts +151 -0
  65. package/src/auth/flows/google-project.ts +190 -0
  66. package/src/auth/flows/google.ts +39 -18
  67. package/src/auth/flows/index.ts +15 -5
  68. package/src/auth/flows/openai.ts +2 -2
  69. package/src/auth/oauth.ts +8 -0
  70. package/src/auth/refresh.ts +44 -27
  71. package/src/auth/storage.ts +149 -26
  72. package/src/auth/types.ts +1 -1
  73. package/src/autopilot.ts +362 -0
  74. package/src/bun-imports.d.ts +4 -0
  75. package/src/cli/AGENTS.md +39 -0
  76. package/src/cli/runner.ts +148 -14
  77. package/src/cli.ts +13 -4
  78. package/src/commands/AGENTS.md +40 -0
  79. package/src/commands/approve.ts +62 -3
  80. package/src/commands/auth.ts +167 -25
  81. package/src/commands/chat.ts +37 -8
  82. package/src/commands/deep-interview.ts +633 -175
  83. package/src/commands/doctor.ts +84 -37
  84. package/src/commands/evolve-core.ts +18 -0
  85. package/src/commands/evolve.ts +2 -1
  86. package/src/commands/export.ts +176 -0
  87. package/src/commands/gjc.ts +52 -0
  88. package/src/commands/launch.ts +3549 -240
  89. package/src/commands/mcp.ts +3 -3
  90. package/src/commands/ooo-seed.ts +19 -0
  91. package/src/commands/ralplan.ts +253 -35
  92. package/src/commands/resume.ts +1 -1
  93. package/src/commands/session.ts +183 -0
  94. package/src/commands/setup-helpers.ts +10 -3
  95. package/src/commands/setup.ts +57 -16
  96. package/src/commands/skills.ts +78 -18
  97. package/src/commands/state.ts +198 -0
  98. package/src/commands/status.ts +84 -0
  99. package/src/commands/team.ts +340 -212
  100. package/src/commands/ultragoal.ts +122 -61
  101. package/src/commands/update.ts +244 -0
  102. package/src/ledger.ts +270 -0
  103. package/src/mcp/AGENTS.md +38 -0
  104. package/src/mcp/server.ts +115 -14
  105. package/src/mcp/tools.ts +42 -22
  106. package/src/md-modules.d.ts +4 -0
  107. package/src/prompts/AGENTS.md +41 -0
  108. package/src/prompts/agents/AGENTS.md +35 -0
  109. package/src/prompts/agents/architect.md +35 -0
  110. package/src/prompts/agents/critic.md +37 -0
  111. package/src/prompts/agents/executor.md +36 -0
  112. package/src/prompts/agents/planner.md +37 -0
  113. package/src/prompts/skills/AGENTS.md +36 -0
  114. package/src/prompts/skills/deep-dive/AGENTS.md +31 -0
  115. package/src/prompts/skills/deep-dive/SKILL.md +13 -0
  116. package/src/prompts/skills/deep-interview/AGENTS.md +31 -0
  117. package/src/prompts/skills/deep-interview/SKILL.md +12 -0
  118. package/src/prompts/skills/gjc/AGENTS.md +31 -0
  119. package/src/prompts/skills/gjc/SKILL.md +15 -0
  120. package/src/prompts/skills/ralplan/AGENTS.md +31 -0
  121. package/src/prompts/skills/ralplan/SKILL.md +11 -0
  122. package/src/prompts/skills/team/AGENTS.md +31 -0
  123. package/src/prompts/skills/team/SKILL.md +11 -0
  124. package/src/prompts/skills/ultragoal/AGENTS.md +31 -0
  125. package/src/prompts/skills/ultragoal/SKILL.md +11 -0
  126. package/src/skills/AGENTS.md +38 -0
  127. package/src/skills/catalog.ts +565 -31
  128. package/src/tui/AGENTS.md +43 -0
  129. package/src/tui/app.ts +1181 -92
  130. package/src/tui/components/AGENTS.md +42 -0
  131. package/src/tui/components/ascii-art.ts +257 -15
  132. package/src/tui/components/autocomplete.ts +98 -16
  133. package/src/tui/components/autopilot-status.ts +65 -0
  134. package/src/tui/components/category-index.ts +49 -0
  135. package/src/tui/components/code-view.ts +54 -11
  136. package/src/tui/components/color.ts +171 -2
  137. package/src/tui/components/config-panel.ts +82 -15
  138. package/src/tui/components/duration.ts +38 -0
  139. package/src/tui/components/evolution.ts +3 -3
  140. package/src/tui/components/footer.ts +91 -42
  141. package/src/tui/components/forge.ts +426 -31
  142. package/src/tui/components/hints.ts +54 -0
  143. package/src/tui/components/hud.ts +73 -0
  144. package/src/tui/components/index.ts +4 -0
  145. package/src/tui/components/input-box.ts +150 -0
  146. package/src/tui/components/layout.ts +11 -3
  147. package/src/tui/components/live-model-picker.ts +108 -0
  148. package/src/tui/components/markdown-table.ts +140 -0
  149. package/src/tui/components/markdown-text.ts +97 -0
  150. package/src/tui/components/meter.ts +4 -1
  151. package/src/tui/components/model-picker.ts +3 -2
  152. package/src/tui/components/provider-picker.ts +3 -2
  153. package/src/tui/components/section.ts +70 -0
  154. package/src/tui/components/select-list.ts +40 -10
  155. package/src/tui/components/skill-picker.ts +25 -0
  156. package/src/tui/components/slash.ts +244 -21
  157. package/src/tui/components/status.ts +272 -11
  158. package/src/tui/components/step-timeline.ts +218 -0
  159. package/src/tui/components/stream.ts +26 -9
  160. package/src/tui/components/themes.ts +212 -6
  161. package/src/tui/components/todo-card.ts +47 -0
  162. package/src/tui/components/tool-list.ts +58 -12
  163. package/src/tui/components/transcript.ts +120 -0
  164. package/src/tui/components/update-box.ts +31 -0
  165. package/src/tui/components/welcome.ts +162 -0
  166. package/src/tui/components/width.ts +163 -0
  167. package/src/tui/monitoring/AGENTS.md +31 -0
  168. package/src/tui/monitoring/hud-view.ts +55 -0
  169. package/src/tui/renderer.ts +112 -3
  170. package/src/tui/terminal.ts +40 -33
  171. package/src/util/AGENTS.md +39 -0
  172. package/src/util/clipboard-image.ts +118 -0
  173. package/src/util/env.ts +12 -0
  174. package/src/util/provider-error.ts +78 -0
  175. package/src/util/retry.ts +91 -6
  176. package/src/util/update-check.ts +64 -0
  177. package/src/commands/models.ts +0 -104
@@ -1,16 +1,15 @@
1
- import {
2
- stageIndexForStep,
3
-
4
- overallProgress,
5
- nextStageName,
6
- stepsToNextStage,
7
- evolutionTrack,
8
- EVOLUTION_STAGE_COUNT,
9
- } from "./evolution";
1
+ import * as path from "node:path";
2
+ import * as os from "node:os";
3
+ import chalk from "chalk";
4
+ import { stageIndexForStep, evolutionTrack } from "./evolution";
5
+ import { formatCost } from "../../ai/pricing";
10
6
 
11
7
  export interface FooterData {
12
8
  model: string;
13
9
  provider?: string;
10
+ /** Drives the evolution-stage tag only — never rendered as a `step n/m` counter
11
+ * (the dynamic step budget keeps extending the denominator, so the raw count
12
+ * carries no information — user feedback). */
14
13
  step?: number;
15
14
  maxSteps?: number;
16
15
  elapsedMs?: number;
@@ -19,10 +18,43 @@ export interface FooterData {
19
18
  showStage?: boolean;
20
19
  /** Use ASCII track markers in the stage tag (default unicode). */
21
20
  unicode?: boolean;
22
- /** Show an estimated time-to-completion (`eta Ns`); opt-in. */
23
- showEta?: boolean;
24
- /** Show whole-turn evolution progress (`evo NN%`) + steps to next stage; opt-in. */
25
- showProgress?: boolean;
21
+ /** Colorize the stage track (default true). Set false for the mono theme. */
22
+ color?: boolean;
23
+ /** Estimated context usage in tokens, when known. */
24
+ contextUsedTokens?: number;
25
+ /** Provider/model context window in tokens, when known. */
26
+ contextMaxTokens?: number;
27
+ cwd?: string;
28
+ branch?: string;
29
+ /** Uncommitted-change count for the `⑂ branch ?N` dirty flag (gjc parity); omit/0 = clean. */
30
+ dirtyCount?: number;
31
+ /** Live USD cost for the turn (price table × usage); omit when the model has no known price. */
32
+ costUsd?: number;
33
+ autoCompact?: boolean;
34
+ }
35
+
36
+ function formatTokens(n: number): string {
37
+ if (n >= 1_000_000) {
38
+ let formatted = (n / 1_000_000).toFixed(1);
39
+ if (formatted.endsWith(".0")) {
40
+ formatted = formatted.slice(0, -2);
41
+ }
42
+ return formatted + "M";
43
+ }
44
+ if (n >= 1000) {
45
+ return Math.round(n / 1000) + "k";
46
+ }
47
+ return Math.round(n).toString();
48
+ }
49
+
50
+ function middleTruncate(s: string, maxLen: number, unicode: boolean): string {
51
+ if (s.length <= maxLen) return s;
52
+ const ellipsis = unicode ? "…" : "...";
53
+ const rem = maxLen - ellipsis.length;
54
+ const leftLen = Math.ceil(rem / 2);
55
+ const rightLen = Math.floor(rem / 2);
56
+ const rightPart = rightLen > 0 ? s.slice(-rightLen) : "";
57
+ return s.slice(0, leftLen) + ellipsis + rightPart;
26
58
  }
27
59
 
28
60
  export function renderFooter(d: FooterData): string {
@@ -38,46 +70,58 @@ export function renderFooter(d: FooterData): string {
38
70
  }
39
71
  }
40
72
 
41
- // Step
42
- if (d.step !== undefined) {
43
- if (d.maxSteps !== undefined) {
44
- parts.push(`step ${d.step}/${d.maxSteps}`);
73
+ // CWD & Branch
74
+ if (d.cwd !== undefined) {
75
+ let displayCwd = d.cwd;
76
+ const home = os.homedir();
77
+ if (home) {
78
+ if (displayCwd === home) {
79
+ displayCwd = "~";
80
+ } else if (displayCwd.startsWith(home + "/") || displayCwd.startsWith(home + "\\")) {
81
+ displayCwd = "~" + displayCwd.slice(home.length);
82
+ }
83
+ }
84
+ displayCwd = middleTruncate(displayCwd, 32, unicode);
85
+ if (d.branch) {
86
+ const dirty = d.dirtyCount && d.dirtyCount > 0 ? ` ?${d.dirtyCount}` : "";
87
+ parts.push(`${displayCwd} (${d.branch}${dirty})`);
45
88
  } else {
46
- parts.push(`step ${d.step}`);
89
+ parts.push(displayCwd);
47
90
  }
48
91
  }
49
92
 
93
+ // No `step n/m` segment (and no step-derived eta/evo%): the dynamic step budget
94
+ // keeps extending the denominator, so those counters carried no information
95
+ // (user feedback). `step`/`maxSteps` still drive the stage tag below.
96
+
50
97
  // Elapsed
51
98
  if (d.elapsedMs !== undefined) {
52
99
  const secs = Math.round(d.elapsedMs / 1000);
53
100
  parts.push(`${secs}s`);
54
101
  }
55
102
 
56
- // Estimated remaining time (opt-in): linear extrapolation from elapsed/step.
57
- if (
58
- d.showEta &&
59
- d.step !== undefined &&
60
- d.step > 0 &&
61
- d.maxSteps !== undefined &&
62
- d.step < d.maxSteps &&
63
- d.elapsedMs !== undefined &&
64
- d.elapsedMs > 0
65
- ) {
66
- const etaMs = (d.elapsedMs / d.step) * (d.maxSteps - d.step);
67
- parts.push(`eta ${Math.round(etaMs / 1000)}s`);
68
- }
69
-
70
- // Whole-turn progress + countdown to the next stage (opt-in).
71
- if (d.showProgress && d.step !== undefined && d.maxSteps !== undefined) {
72
- const pct = Math.round(overallProgress(d.step, d.maxSteps) * 100);
73
- const idx = stageIndexForStep(d.step, d.maxSteps);
74
- if (idx < EVOLUTION_STAGE_COUNT - 1) {
75
- const remaining = stepsToNextStage(d.step, d.maxSteps);
76
- const arrow = unicode ? "\u2192" : "->";
77
- parts.push(`evo ${pct}% ${arrow} ${nextStageName(d.step, d.maxSteps)} in ${remaining}`);
103
+ // Estimated context usage (opt-in): cheap footer signal for context growth.
104
+ if (d.contextUsedTokens !== undefined) {
105
+ const used = Math.max(0, Math.round(d.contextUsedTokens));
106
+ let ctxStr = "";
107
+ if (d.contextMaxTokens && d.contextMaxTokens > 0) {
108
+ const max = Math.round(d.contextMaxTokens);
109
+ const pct = Math.min(999, Math.round((used / max) * 100));
110
+ ctxStr = `ctx ${pct}%/${formatTokens(max)}`;
111
+ if (d.autoCompact) {
112
+ ctxStr += "(auto)";
113
+ }
114
+ if (d.color !== false) {
115
+ if (pct >= 85) {
116
+ ctxStr = chalk.red(ctxStr);
117
+ } else if (pct >= 60) {
118
+ ctxStr = chalk.yellow(ctxStr);
119
+ }
120
+ }
78
121
  } else {
79
- parts.push(`evo ${pct}%`);
122
+ ctxStr = `ctx ~${formatTokens(used)}`;
80
123
  }
124
+ parts.push(ctxStr);
81
125
  }
82
126
 
83
127
  // Session ID
@@ -85,10 +129,15 @@ export function renderFooter(d: FooterData): string {
85
129
  parts.push(d.sessionId.slice(0, 8));
86
130
  }
87
131
 
132
+ // Live turn cost (gjc parity): only when a known price produced a figure.
133
+ if (d.costUsd !== undefined && Number.isFinite(d.costUsd) && d.costUsd > 0) {
134
+ parts.push(formatCost(d.costUsd));
135
+ }
136
+
88
137
  // Compact evolution-stage tag, e.g. "●●●○○ Tool User (Homo Habilis) [3/5]".
89
138
  if (d.showStage !== false && d.step !== undefined && d.maxSteps !== undefined) {
90
139
  const idx = stageIndexForStep(d.step, d.maxSteps);
91
- parts.push(evolutionTrack(idx, { color: true, unicode }));
140
+ parts.push(evolutionTrack(idx, { color: d.color !== false, unicode }));
92
141
  }
93
142
 
94
143
  return parts.join(" · ");