euron-code 0.5.1__tar.gz → 0.6.0__tar.gz

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 (107) hide show
  1. {euron_code-0.5.1 → euron_code-0.6.0}/CHANGELOG.md +38 -0
  2. {euron_code-0.5.1 → euron_code-0.6.0}/PKG-INFO +20 -1
  3. {euron_code-0.5.1 → euron_code-0.6.0}/README.md +19 -0
  4. {euron_code-0.5.1 → euron_code-0.6.0}/pyproject.toml +1 -1
  5. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/__init__.py +1 -1
  6. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/activity.py +24 -13
  7. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/agent.py +120 -6
  8. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/api.py +7 -1
  9. euron_code-0.6.0/src/euron_code/builtin_skills/build-from-reference/SKILL.md +30 -0
  10. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/cli.py +79 -10
  11. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/config.py +3 -1
  12. euron_code-0.6.0/src/euron_code/licensing.py +155 -0
  13. euron_code-0.6.0/src/euron_code/osscache.py +608 -0
  14. euron_code-0.6.0/src/euron_code/ossgithub.py +352 -0
  15. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/permissions.py +6 -0
  16. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/prompts.py +10 -1
  17. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/repl.py +113 -32
  18. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/__init__.py +3 -2
  19. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/erie.py +28 -17
  20. euron_code-0.6.0/src/euron_code/tools/oss.py +611 -0
  21. euron_code-0.6.0/src/euron_code/transcript.py +368 -0
  22. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/ui.py +168 -15
  23. {euron_code-0.5.1 → euron_code-0.6.0}/tests/conftest.py +13 -0
  24. {euron_code-0.5.1 → euron_code-0.6.0}/tests/mock_gateway.py +43 -0
  25. euron_code-0.6.0/tests/test_oss_local.py +524 -0
  26. euron_code-0.6.0/tests/test_qa_attach_secrets.py +59 -0
  27. euron_code-0.6.0/tests/test_qa_long_task.py +88 -0
  28. euron_code-0.6.0/tests/test_qa_print_output.py +101 -0
  29. euron_code-0.6.0/tests/test_qa_reuse_unrelated.py +105 -0
  30. euron_code-0.6.0/tests/test_qa_yolo_outside.py +59 -0
  31. euron_code-0.6.0/tests/test_transcript_ui.py +269 -0
  32. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v3_activity.py +2 -2
  33. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v3_live_repl.py +19 -2
  34. euron_code-0.5.1/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -28
  35. euron_code-0.5.1/src/euron_code/licensing.py +0 -67
  36. euron_code-0.5.1/src/euron_code/tools/oss.py +0 -178
  37. {euron_code-0.5.1 → euron_code-0.6.0}/.gitignore +0 -0
  38. {euron_code-0.5.1 → euron_code-0.6.0}/LICENSE +0 -0
  39. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/__main__.py +0 -0
  40. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/attachments.py +0 -0
  41. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/auth.py +0 -0
  42. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
  43. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
  44. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
  45. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/cache.py +0 -0
  46. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/checkpoints.py +0 -0
  47. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/context.py +0 -0
  48. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/contextforge/LICENSE +0 -0
  49. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/contextforge/__init__.py +0 -0
  50. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/contextforge/text.py +0 -0
  51. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/contextforge/toolout.py +0 -0
  52. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/credentials.py +0 -0
  53. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/doctor.py +0 -0
  54. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/documents.py +0 -0
  55. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/error_hints.py +0 -0
  56. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/errorlog.py +0 -0
  57. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/frontmatter.py +0 -0
  58. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/hooks.py +0 -0
  59. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/keys.py +0 -0
  60. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/memory.py +0 -0
  61. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/project_setup.py +0 -0
  62. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/repomap.py +0 -0
  63. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/rules.py +0 -0
  64. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/sessions.py +0 -0
  65. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/skills.py +0 -0
  66. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/textsafe.py +0 -0
  67. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/background.py +0 -0
  68. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/base.py +0 -0
  69. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/db.py +0 -0
  70. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/document.py +0 -0
  71. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/fs.py +0 -0
  72. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/ignore.py +0 -0
  73. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/reuse.py +0 -0
  74. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/search.py +0 -0
  75. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/shell.py +0 -0
  76. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/skill.py +0 -0
  77. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/symbols.py +0 -0
  78. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/task.py +0 -0
  79. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/todo.py +0 -0
  80. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/tools/web.py +0 -0
  81. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/trust.py +0 -0
  82. {euron_code-0.5.1 → euron_code-0.6.0}/src/euron_code/usage_view.py +0 -0
  83. {euron_code-0.5.1 → euron_code-0.6.0}/tests/helpers.py +0 -0
  84. {euron_code-0.5.1 → euron_code-0.6.0}/tests/serve_helper.py +0 -0
  85. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_agent_mock.py +0 -0
  86. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_api_shell.py +0 -0
  87. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_bench.py +0 -0
  88. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_cli_e2e.py +0 -0
  89. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_context_memory_sessions.py +0 -0
  90. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_db.py +0 -0
  91. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_erie.py +0 -0
  92. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_permissions.py +0 -0
  93. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_powershell_exit_codes.py +0 -0
  94. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_repl.py +0 -0
  95. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_search.py +0 -0
  96. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_textsafe.py +0 -0
  97. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_tools_fs.py +0 -0
  98. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v2_rules_skills_hooks.py +0 -0
  99. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v2_tokens_shortcuts.py +0 -0
  100. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v2_usage_headers.py +0 -0
  101. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v31_security.py +0 -0
  102. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v3_accounts_value_setup.py +0 -0
  103. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v3_attachments.py +0 -0
  104. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v3_context.py +0 -0
  105. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v3_single_login.py +0 -0
  106. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v4.py +0 -0
  107. {euron_code-0.5.1 → euron_code-0.6.0}/tests/test_v5.py +0 -0
@@ -1,5 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 (2026-11-06)
4
+
5
+ A new look for the interactive session.
6
+
7
+ - Each tool call is a block: `● Bash(npm test)` with its output indented under it. Long output shows
8
+ its first lines and `… +58 lines (ctrl+o to expand)`; Ctrl+O (or `/expand [n]`) prints it in full.
9
+ - Edits show as a numbered diff with added lines on green and removed lines on red.
10
+ - Answers start with a `●` bullet; while Euron Code works, a status line above the input shows what it is
11
+ doing, the time so far and the tokens received.
12
+ - The input sits in a box with a footer: the permission mode on the left (`▸▸ auto-approve on`), with
13
+ `esc to interrupt` while a task runs, and the model, context and today's tokens on the right.
14
+ - `!command` output uses the same block. `euron -p` output is unchanged.
15
+
16
+ Reuse from all of GitHub, on your own computer.
17
+
18
+ - Open-source search now asks GitHub directly from your machine (your own allowance; code search too
19
+ with `gh auth login` or `GITHUB_TOKEN`). The token goes only to GitHub, never to Euron, and is never
20
+ printed. When GitHub is offline or rate limited, Euron's service answers as before.
21
+ - New tools: `oss_fetch` downloads a reference once at a pinned commit into `~/.euron/cache/oss` and
22
+ indexes it; `oss_grep` and `oss_read` then work from your disk; `oss_adopt` copies the files worth
23
+ reusing with their licence header, copies LICENSE / NOTICE and updates `THIRD_PARTY_NOTICES.md`.
24
+ - Licences are checked in code from GitHub's licence detection, and again in the downloaded licence text
25
+ (Commons Clause and non-commercial riders are refused).
26
+ - `euron cache` (list, size, clear). The cache keeps 2 GB by default, least recently used out first.
27
+
28
+ ## 0.5.2 (2026-11-05)
29
+
30
+ Security and reliability fixes from pre-launch testing.
31
+
32
+ - Bypass mode (`--yolo`) now asks before any command that names a path outside your project, including
33
+ quoted paths and paths in your home folder.
34
+ - Files that usually hold secrets (such as `.env`) are never sent with your message without a yes.
35
+ - An answer that comes back empty is asked for once more instead of ending silently; `-p` always prints a
36
+ result, and JSON mode reports errors as JSON.
37
+ - Hindi, emoji and other non-English text print correctly when output is piped on Windows.
38
+ - Long tasks no longer stop early as a false "loop", or with an unfinished task list.
39
+ - Reuse planning picks the right components and records every reused source.
40
+
3
41
  ## 0.5.1 (2026-11-05)
4
42
 
5
43
  - Running `euron` again right after a run finished no longer says Euron Code is already running for
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: euron-code
3
- Version: 0.5.1
3
+ Version: 0.6.0
4
4
  Summary: Euron Code: an agentic coding assistant in your terminal for Euron Plus and Super 30 students.
5
5
  Project-URL: Homepage, https://euron.one/code-agent
6
6
  Author-email: Euron <contact@euron.one>
@@ -240,6 +240,25 @@ again. MPL-2.0 files stay separate files under their own licence. Every reused s
240
240
  your project's `THIRD_PARTY_NOTICES.md`, and the completion report lists it (`Reused: owner/repo/path
241
241
  (MIT)`).
242
242
 
243
+ ### All of GitHub, from your own computer
244
+
245
+ Euron Code searches all public repositories on GitHub directly from your machine, so you get your own
246
+ GitHub allowance (and code search too when you are signed in with `gh auth login` or set `GITHUB_TOKEN`;
247
+ the token is only ever sent to GitHub, never to Euron, and never printed). A chosen reference is
248
+ downloaded once at a pinned commit into `~/.euron/cache/oss`, indexed on your computer, and reused in
249
+ later sessions: searching it and reading parts of it needs no network and no tokens. `oss_adopt` copies
250
+ the few files that are worth reusing into your project with their licence header, copies the LICENSE
251
+ (and NOTICE for Apache-2.0) to `third_party/licenses/`, and records repo, commit, licence and files in
252
+ `THIRD_PARTY_NOTICES.md`. The licence comes from GitHub's licence detection and is checked in code: a
253
+ repo with no detected licence, NOASSERTION, GPL, AGPL, LGPL, SSPL, BUSL, a non-commercial licence or a
254
+ Commons Clause rider is refused.
255
+
256
+ `euron cache` lists what is cached, `euron cache size` shows the total, `euron cache clear [owner/name]`
257
+ removes it. The cache keeps up to 2 GB (least recently used first out; `reuse.cacheMaxMB`) and at most
258
+ 50 MB per repo (`reuse.repoMaxMB`). `reuse.local false` (or `EURON_OSS_LOCAL=0`) asks Euron's service
259
+ instead of GitHub; when GitHub is offline or its rate limit is reached, Euron Code falls back to it by
260
+ itself. Full walk-through: [docs/USE_CASES_REUSE.md](docs/USE_CASES_REUSE.md).
261
+
243
262
  ## Limits and value
244
263
 
245
264
  Your plan has a token allowance per **day**, **week**, **month** and **year**, the same for Euron Plus
@@ -174,6 +174,25 @@ again. MPL-2.0 files stay separate files under their own licence. Every reused s
174
174
  your project's `THIRD_PARTY_NOTICES.md`, and the completion report lists it (`Reused: owner/repo/path
175
175
  (MIT)`).
176
176
 
177
+ ### All of GitHub, from your own computer
178
+
179
+ Euron Code searches all public repositories on GitHub directly from your machine, so you get your own
180
+ GitHub allowance (and code search too when you are signed in with `gh auth login` or set `GITHUB_TOKEN`;
181
+ the token is only ever sent to GitHub, never to Euron, and never printed). A chosen reference is
182
+ downloaded once at a pinned commit into `~/.euron/cache/oss`, indexed on your computer, and reused in
183
+ later sessions: searching it and reading parts of it needs no network and no tokens. `oss_adopt` copies
184
+ the few files that are worth reusing into your project with their licence header, copies the LICENSE
185
+ (and NOTICE for Apache-2.0) to `third_party/licenses/`, and records repo, commit, licence and files in
186
+ `THIRD_PARTY_NOTICES.md`. The licence comes from GitHub's licence detection and is checked in code: a
187
+ repo with no detected licence, NOASSERTION, GPL, AGPL, LGPL, SSPL, BUSL, a non-commercial licence or a
188
+ Commons Clause rider is refused.
189
+
190
+ `euron cache` lists what is cached, `euron cache size` shows the total, `euron cache clear [owner/name]`
191
+ removes it. The cache keeps up to 2 GB (least recently used first out; `reuse.cacheMaxMB`) and at most
192
+ 50 MB per repo (`reuse.repoMaxMB`). `reuse.local false` (or `EURON_OSS_LOCAL=0`) asks Euron's service
193
+ instead of GitHub; when GitHub is offline or its rate limit is reached, Euron Code falls back to it by
194
+ itself. Full walk-through: [docs/USE_CASES_REUSE.md](docs/USE_CASES_REUSE.md).
195
+
177
196
  ## Limits and value
178
197
 
179
198
  Your plan has a token allowance per **day**, **week**, **month** and **year**, the same for Euron Plus
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "euron-code"
7
- version = "0.5.1"
7
+ version = "0.6.0"
8
8
  description = "Euron Code: an agentic coding assistant in your terminal for Euron Plus and Super 30 students."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1,3 +1,3 @@
1
1
  """Euron Code: an agentic coding assistant for the terminal."""
2
2
 
3
- __version__ = "0.5.1"
3
+ __version__ = "0.6.0"
@@ -1,6 +1,8 @@
1
1
  """The live activity line shown while the agent works, e.g.
2
2
 
3
- ✻ Brewing… (14s · ↑ 3.2k ↓ 418 tokens · running pytest -q 6s · esc to interrupt)
3
+ ⠹ Building… (14s · ↓ 418 tokens · running pytest -q 6s)
4
+
5
+ (the interactive prompt shows "esc to interrupt" in its footer; other displays add it to the line)
4
6
 
5
7
  The agent updates one Activity object from whatever thread runs the turn; the UI only reads it
6
8
  (`render()`), from the prompt_toolkit loop or a ticker thread. Counters are guarded by a lock.
@@ -19,15 +21,16 @@ import threading
19
21
  import time
20
22
  from typing import Any, Dict, Optional
21
23
 
22
- GLYPHS = ["·", "✢", "✳", "✶", "✻", "✽", "✻", "✶", "✳", "✢"]
23
- ASCII_GLYPHS = [".", "o", "O", "@", "*", "@", "O", "o"]
24
+ GLYPHS = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
25
+ ASCII_GLYPHS = ["|", "/", "-", "\\"]
24
26
 
27
+ #: Euron's own working verbs: what a learner and an engineer actually do
25
28
  VERBS = [
26
- "Pondering", "Brewing", "Tinkering", "Weaving", "Compiling thoughts", "Mulling", "Crafting",
27
- "Sketching", "Untangling", "Assembling", "Polishing", "Reasoning", "Exploring", "Distilling",
28
- "Composing", "Calibrating", "Simmering", "Forging", "Puzzling", "Sculpting", "Orchestrating",
29
- "Percolating", "Refining", "Wrangling", "Considering", "Charting", "Threading", "Kneading",
30
- "Tuning", "Musing", "Conjuring", "Shaping",
29
+ "Building", "Thinking", "Compiling", "Debugging", "Refactoring", "Testing", "Indexing", "Tracing",
30
+ "Profiling", "Linting", "Reviewing", "Planning", "Drafting", "Scaffolding", "Wiring up", "Benchmarking",
31
+ "Optimising", "Iterating", "Analysing", "Reading the docs", "Mapping the repo", "Writing tests",
32
+ "Checking edge cases", "Studying", "Practising", "Solving", "Structuring", "Modelling", "Deploying",
33
+ "Shipping", "Learning", "Pairing", "Prototyping", "Validating",
31
34
  ]
32
35
 
33
36
  QUEUED = re.compile(r"queued,\s*(\d+)\s*ahead", re.IGNORECASE)
@@ -87,6 +90,7 @@ class Activity:
87
90
  def __init__(self, ascii: Optional[bool] = None, verb_seconds: float = 4.0, frame_seconds: float = 0.12,
88
91
  rng: Optional[random.Random] = None, clock=time.monotonic):
89
92
  self.ascii = (not supports_unicode()) if ascii is None else ascii
93
+ self.animate = True # False: a still glyph (NO_COLOR asks for a calm, plain display)
90
94
  self.verb_seconds = verb_seconds
91
95
  self.frame_seconds = frame_seconds
92
96
  self.rng = rng or random.Random()
@@ -166,6 +170,8 @@ class Activity:
166
170
 
167
171
  def glyph(self, now: Optional[float] = None) -> str:
168
172
  frames = ASCII_GLYPHS if self.ascii else GLYPHS
173
+ if not self.animate:
174
+ return frames[4 % len(frames)]
169
175
  n = int(self.elapsed(now) / self.frame_seconds)
170
176
  return frames[n % len(frames)]
171
177
 
@@ -173,17 +179,18 @@ class Activity:
173
179
  n = int(self.elapsed(now) / self.verb_seconds)
174
180
  return VERBS[(self._verb_offset + n) % len(VERBS)]
175
181
 
176
- def render(self, now: Optional[float] = None, hint: bool = True) -> str:
182
+ def parts(self, now: Optional[float] = None, hint: bool = True):
183
+ """(glyph, "Verb…", "(elapsed · ↓ tokens · what)") for a renderer that colours each part."""
177
184
  now = self.clock() if now is None else now
178
- sent, recv = self.tokens
179
- up, down = ("^", "v") if self.ascii else ("↑", "↓")
185
+ _, recv = self.tokens
186
+ down = "v" if self.ascii else "↓"
180
187
  dots = "..." if self.ascii else "…"
181
188
  with self._lock:
182
189
  tool, tool_t0 = self.tool, self.tool_t0
183
190
  what = tool or self.phase
184
191
  if tool and now - tool_t0 >= 2:
185
192
  what += f" {fmt_elapsed(now - tool_t0)}"
186
- parts = [fmt_elapsed(self.elapsed(now)), f"{up} {fmt_tokens(sent)} {down} {fmt_tokens(recv)} tokens"]
193
+ parts = [fmt_elapsed(self.elapsed(now)), f"{down} {fmt_tokens(recv)} tokens"]
187
194
  if what:
188
195
  parts.append(what)
189
196
  if self.queued:
@@ -191,4 +198,8 @@ class Activity:
191
198
  if hint:
192
199
  parts.append("esc to interrupt")
193
200
  sep = " - " if self.ascii else " · "
194
- return f"{self.glyph(now)} {self.verb(now)}{dots} (" + sep.join(parts) + ")"
201
+ return self.glyph(now), self.verb(now) + dots, "(" + sep.join(parts) + ")"
202
+
203
+ def render(self, now: Optional[float] = None, hint: bool = True) -> str:
204
+ glyph, verb, detail = self.parts(now, hint=hint)
205
+ return f"{glyph} {verb} {detail}"
@@ -47,7 +47,7 @@ REPEAT_STOP_AT = 8
47
47
  SEARCH_BUDGET = 4 # reference searches per request before a "pick one" note
48
48
  READ_BUDGET = 6 # reference file reads per request
49
49
  SEARCH_TOOLS = ("euron_reuse_search", "oss_search")
50
- READ_TOOLS = ("euron_reuse_read", "oss_read", "oss_tree")
50
+ READ_TOOLS = ("euron_reuse_read", "oss_read", "oss_tree", "oss_grep")
51
51
  _LIC_RE = re.compile(r"\[(MIT|Apache-2\.0|BSD-[23]-Clause|ISC|0BSD|Unlicense|MPL-2\.0|CC0-1\.0|Zlib)\]|licence (\S+)")
52
52
  DEFAULT_STEP_BUDGET = 60
53
53
  _EXIT_RE = re.compile(r"^Exit code: (-?\d+)")
@@ -167,7 +167,9 @@ class Agent:
167
167
  self.pending_images: List[Dict[str, Any]] = [] # image_url parts for the next prompt
168
168
  self.pending_image_paths: List[Path] = [] # their local files (a photo may belong on the page)
169
169
  self._placeholder_nudged = False
170
+ self._ctx_note_band = 0 # 10% band of the last small "Context was N% full" note
170
171
  self.pending_paths: List[Path] = [] # /attach, /paste-image: attached to the next prompt
172
+ self._notice_nudged = False # one THIRD_PARTY_NOTICES nudge per prompt
171
173
  self.memory_files: List[memory.MemoryFile] = []
172
174
  self.rules = rules.RuleSet([])
173
175
  self.skills: Dict[str, skills.Skill] = {}
@@ -319,6 +321,7 @@ class Agent:
319
321
  errorlog.get().task_id = self.client.task_id
320
322
  self._nudged = False
321
323
  self._placeholder_nudged = False
324
+ self._notice_nudged = False
322
325
  for r in self._run_hooks("UserPromptSubmit", {"prompt": user_text}):
323
326
  if r.code == 2:
324
327
  self.ui.warn("A UserPromptSubmit hook blocked this prompt: " + (r.stderr.strip() or "(no reason given)"))
@@ -379,8 +382,11 @@ class Agent:
379
382
  continues = 0 # answer cut by the output limit, continued automatically
380
383
  cut_tools = 0
381
384
  effort_retry = False
385
+ empty_retry = False # one retry when the model answers with nothing at all
382
386
  partial = "" # text of an answer that is being continued
383
387
  todos_before = list(self.ctx.todos)
388
+ todo_nudged = False # one "your task list is not finished" nudge per request
389
+ todos_at_start = list(self.ctx.todos)
384
390
  while True:
385
391
  if max_turns and turns >= max_turns:
386
392
  return TurnResult(last_text, "max_turns", turns)
@@ -433,6 +439,15 @@ class Agent:
433
439
  self._append({"role": "user", "content": prompts.ANSWER_NUDGE})
434
440
  self._effort_once = "low"
435
441
  continue
442
+ if (not resp.tool_calls and not (partial + resp.content).strip() and not empty_retry
443
+ and not self.is_subagent):
444
+ # the model ended the turn without a word (seen live): ask once instead of
445
+ # printing nothing and exiting 0
446
+ empty_retry = True
447
+ self._append({"role": "assistant", "content": "(empty reply)"})
448
+ self._append({"role": "user", "content": prompts.EMPTY_NUDGE})
449
+ self.ui.dim("(the answer came back empty; asking again)")
450
+ continue
436
451
  msg: Dict[str, Any] = {"role": "assistant", "content": resp.content}
437
452
  if resp.tool_calls:
438
453
  msg["tool_calls"] = resp.tool_calls
@@ -455,11 +470,29 @@ class Agent:
455
470
  self._append({"role": "user", "content": prompts.PLACEHOLDER_NUDGE.format(where=where)})
456
471
  self.ui.dim("(asking Euron Code to replace placeholder text with your details)")
457
472
  continue
473
+ missing = self._missing_notices() if not self._notice_nudged and not self.is_subagent else ""
474
+ if missing:
475
+ self._notice_nudged = True
476
+ self._append({"role": "user", "content": prompts.NOTICE_NUDGE.format(repos=missing)})
477
+ self.ui.dim("(asking Euron Code to record the reused sources in THIRD_PARTY_NOTICES.md)")
478
+ continue
458
479
  if self._needs_verify_nudge():
459
480
  self._nudged = True
460
481
  self._append({"role": "user", "content": prompts.verify_nudge(self.test_command)})
461
482
  self.ui.dim("(asking Euron Code to check its change)")
462
483
  continue
484
+ open_todos = [t for t in self.ctx.todos if isinstance(t, dict)
485
+ and t.get("status") in ("pending", "in_progress")]
486
+ if (open_todos and self.ctx.todos != todos_at_start and not todo_nudged and not self.is_subagent
487
+ and self.permissions.mode != "plan"
488
+ and len((resp.content or "").strip()) < 400):
489
+ # QA 2026-11-05: a portfolio build ended on "Scaffolding the Next.js project now..." with 6 of 6
490
+ # todos open and no file written; exit 0, nothing built
491
+ todo_nudged = True
492
+ self._append({"role": "user", "content": prompts.TODO_NUDGE.format(
493
+ todos="; ".join(str(t.get("content"))[:80] for t in open_todos[:5]))})
494
+ self.ui.dim("(the task list is not finished; asking Euron Code to continue)")
495
+ continue
463
496
  if not self.is_subagent:
464
497
  self._footer()
465
498
  return TurnResult(partial + resp.content, "end_turn", turns)
@@ -755,7 +788,11 @@ class Agent:
755
788
  args = str(fn.get("arguments"))
756
789
  failed = content.startswith("Error") or (content.startswith("Exit code: ") and
757
790
  not content.startswith("Exit code: 0"))
758
- key = (fn.get("name"), args, failed, content[:300] if failed else "")
791
+ # A failing run is "the same" only when its start AND its end match (numbers ignored, so timings
792
+ # do not hide a real loop). QA 2026-11-05: pytest printed the same 300-char warning first every time,
793
+ # so 15 failed / collection error / 4 failed counted as one call failing 5 times and the turn stopped.
794
+ key = (fn.get("name"), args, failed,
795
+ (content[:300], re.sub(r"\d+", "N", content[-300:])) if failed else "")
759
796
  n = self._calls[key] = self._calls.get(key, 0) + 1
760
797
  if failed:
761
798
  if n >= LOOP_STOP_AT:
@@ -858,7 +895,7 @@ class Agent:
858
895
  "references from these results and read only the files you need.]")
859
896
  elif name in READ_TOOLS:
860
897
  n = self._calls[("budget", "read")] = self._calls.get(("budget", "read"), 0) + 1
861
- if name != "oss_tree" and args.get("repo") and args.get("path"):
898
+ if name not in ("oss_tree", "oss_grep") and args.get("repo") and args.get("path"):
862
899
  m = _LIC_RE.search(content.split("\n", 2)[0] + " " + content.split("\n", 2)[1]
863
900
  if "\n" in content else content)
864
901
  lic = (m.group(1) or m.group(2)) if m else "?"
@@ -870,6 +907,17 @@ class Agent:
870
907
  "read, record it with add_third_party_notice, and write only what is missing.]")
871
908
  return note
872
909
 
910
+ def _record_adoption(self, args: Dict[str, Any], content: str) -> None:
911
+ """oss_adopt copied files: each is reused code for the report and the -p JSON."""
912
+ reused = self.ledger.setdefault("reused", [])
913
+ m = _LIC_RE.search(content.partition("\n")[0])
914
+ lic = (m.group(1) or m.group(2)) if m else "?"
915
+ paths = args.get("paths") if isinstance(args.get("paths"), list) else [args.get("paths")]
916
+ for p in paths:
917
+ item = (str(args.get("repo")), str(p), lic)
918
+ if p and item not in reused:
919
+ reused.append(item)
920
+
873
921
  def files_changed(self) -> List[str]:
874
922
  return list(dict.fromkeys(rel for _, rel in self.ledger["edits"]))
875
923
 
@@ -879,6 +927,9 @@ class Agent:
879
927
  model call), so the model starts from proven code whatever it would have chosen; and put the
880
928
  user's photo into the project. Returns text for the end of the user message."""
881
929
  from euron_code.tools import erie
930
+ # only what the user typed: an attached document's text ("The service must expose GET /health")
931
+ # turned a question about it into a build request (QA 2026-11-05)
932
+ user_text = re.sub(r'<attached-file path="[^"]*">.*?</attached-file>', " ", user_text, flags=re.S)
882
933
  if not erie.is_build_request(user_text):
883
934
  return ""
884
935
  out = ""
@@ -942,6 +993,36 @@ class Agent:
942
993
  hits.append(f"{rel} ({', '.join(found[:3])})")
943
994
  return "; ".join(hits[:6])
944
995
 
996
+ def _missing_notices(self) -> str:
997
+ """Repos read this prompt that a changed file names (an "Adapted from owner/repo" header) but that
998
+ THIRD_PARTY_NOTICES.md does not list. QA 2026-11-05: a portfolio's Hero said "Adapted from
999
+ euron-sde-team/euron-open-multi-tenant-lms (MIT)" and the notices file had no entry for it."""
1000
+ from euron_code import licensing
1001
+ repos = list(dict.fromkeys(r for r, _, _ in self.ledger.get("reused") or []))
1002
+ if not repos:
1003
+ return ""
1004
+ try:
1005
+ notices = (self.root / licensing.NOTICES_FILE).read_text(encoding="utf-8", errors="ignore")
1006
+ except OSError:
1007
+ notices = ""
1008
+ listed = {ln[3:].strip().lower() for ln in notices.splitlines() if ln.startswith("## ")}
1009
+ todo = [r for r in repos if r.lower() not in listed]
1010
+ if not todo:
1011
+ return ""
1012
+ named = []
1013
+ for rel in self.files_changed():
1014
+ p = self.root / rel
1015
+ if p.name == licensing.NOTICES_FILE:
1016
+ continue
1017
+ try:
1018
+ if not p.is_file() or p.stat().st_size > 400_000:
1019
+ continue
1020
+ text = p.read_text(encoding="utf-8", errors="ignore")
1021
+ except OSError:
1022
+ continue
1023
+ named += [r for r in todo if r in text and r not in named]
1024
+ return ", ".join(named[:6])
1025
+
945
1026
  def _verified(self) -> bool:
946
1027
  if not self.ledger["edits"]:
947
1028
  return True
@@ -960,7 +1041,10 @@ class Agent:
960
1041
  """Local report after a prompt that changed files (shown to the user, not sent to the model)."""
961
1042
  changed = self.files_changed()
962
1043
  reused = self.ledger.get("reused") or []
963
- planned = [c for c in self.reuse_report() if c["decision"] in ("REUSE", "ADAPT")]
1044
+ read_repos = {r for r, _, _ in reused}
1045
+ # "x reused from repo" only when that repo was actually read (QA 2026-11-05: a question about two
1046
+ # attached documents printed "Reuse plan: api reused from euron-open-smart-router" with nothing read)
1047
+ planned = [c for c in self.reuse_report() if c["decision"] in ("REUSE", "ADAPT") and c.get("repo") in read_repos]
964
1048
  if planned:
965
1049
  self._phase("Integration completed")
966
1050
  self.ui.dim("Reuse plan: " + "; ".join(f"{c['component']} {_PAST.get(c['decision'], c['decision'].lower())} from {c['repo']} "
@@ -1068,6 +1152,8 @@ class Agent:
1068
1152
  if result.is_error and not content.startswith(("Error", "Exit code")):
1069
1153
  content = "Error: " + content
1070
1154
  self._record(name, req, content, result.is_error)
1155
+ if not result.is_error and name == "oss_adopt":
1156
+ self._record_adoption(args, content)
1071
1157
  if not result.is_error and (name in SEARCH_TOOLS or name in READ_TOOLS):
1072
1158
  content += self._record_reuse(name, args, content)
1073
1159
  self._note_component_read(name, args)
@@ -1193,7 +1279,14 @@ class Agent:
1193
1279
  self.savings.add("micro", saved)
1194
1280
  self._persist_compaction()
1195
1281
  after = self.context_usage()
1196
- if before - after >= 2000 or before * 100 // self.usable_window >= 60:
1282
+ pct = before * 100 // self.usable_window
1283
+ if pct < 60:
1284
+ self._ctx_note_band = 0
1285
+ # above 60% the note came on EVERY step, even for 32 freed tokens (QA 2026-11-05: 11 lines in one
1286
+ # build); now a small clearing is shown once per 10% band
1287
+ if before - after >= 2000 or (pct >= 60 and pct // 10 > self._ctx_note_band):
1288
+ if before - after < 2000:
1289
+ self._ctx_note_band = pct // 10
1197
1290
  self.ui.dim(f"Context was {before * 100 // self.usable_window}% full: cleared {len(ids)} tool "
1198
1291
  f"output(s), freed {max(0, before - after):,} tokens, now "
1199
1292
  f"{after * 100 // self.usable_window}%.")
@@ -1243,7 +1336,11 @@ class Agent:
1243
1336
  if not manual:
1244
1337
  context.elide_old_tool_outputs(self.messages, keep_last=1, min_chars=300)
1245
1338
  self._persist_compaction()
1246
- self.ui.warn("Nothing older to summarise; the current turn alone is large. Consider /clear.")
1339
+ if len(users) <= 1: # the first message itself is too big: /clear cannot help
1340
+ self.ui.warn("Your message alone is too large for the context. Put long text in a file and "
1341
+ "mention it with @file instead.")
1342
+ else:
1343
+ self.ui.warn("Nothing older to summarise; the current turn alone is large. Consider /clear.")
1247
1344
  return False
1248
1345
  old = self.messages[1:cut]
1249
1346
  recent = self.messages[cut:]
@@ -1459,6 +1556,10 @@ class Agent:
1459
1556
  self.pending_image_paths.append(p)
1460
1557
  attachments.privacy_notice_once(self.ui)
1461
1558
  return None
1559
+ from euron_code.permissions import is_sensitive
1560
+ if is_sensitive(p) and not self._consent_to_secret(p):
1561
+ return (f"(not attached: {self.ctx.rel(p)} looks like a secrets file, so its contents were not "
1562
+ "sent. Do not read it unless the user asks you to.)")
1462
1563
  if documents.is_document(p):
1463
1564
  return documents.extract(p, cap_tokens=cap)
1464
1565
  data = p.read_bytes()[:8192]
@@ -1469,6 +1570,19 @@ class Agent:
1469
1570
  except (ToolError, documents.DocumentError, OSError) as e:
1470
1571
  return f"(could not attach: {e})"
1471
1572
 
1573
+ def _consent_to_secret(self, p: Path) -> bool:
1574
+ """A .env / key / credentials file named in a prompt (typed or dragged, @ or a bare absolute
1575
+ path) is only sent after a yes. QA 2026-11-05: "the values are in C:\\Users\\me\\app\\.env" uploaded
1576
+ the file's contents without a question, in default mode and from outside the project."""
1577
+ rel = self.ctx.rel(p)
1578
+ if not getattr(self.ui, "interactive", False):
1579
+ self.ui.warn(f"Not attached: {rel} looks like a secrets file (its contents would be sent with your "
1580
+ "message). Attach it in an interactive session if you mean to.")
1581
+ return False
1582
+ choice = self.ui.ask_permission(f"Attach {rel}? It looks like a secrets file: its contents are sent with "
1583
+ "your message.", None, [("y", "yes"), ("n", "no")])
1584
+ return choice == "y"
1585
+
1472
1586
  # ---------------------------------------------------------- sub-agent
1473
1587
  def run_subagent(self, prompt: str) -> str:
1474
1588
  sub_ui = _SubagentUI(self.ui)
@@ -58,6 +58,10 @@ class AuthError(EuronError):
58
58
  SIGNED_IN_ELSEWHERE_MESSAGE = ("You signed in to Euron Code on another device, so this one was signed out. "
59
59
  "One login at a time: signing in on a new computer signs out the old one.")
60
60
  SESSION_IN_USE_MESSAGE = "Euron Code is running for your account in another terminal or computer."
61
+ #: shown instead of the gateway's raw text, which named the model's context size and the serving
62
+ #: stack's parameters (QA 2026-11-05, a 100 KB prompt)
63
+ CONTEXT_TOO_LONG_MESSAGE = ("This request is too long for Euron Code to read in one go. Put long text in a file in "
64
+ "your project and mention it with @file (it is then read in parts), or split the request.")
61
65
 
62
66
 
63
67
  class NotEntitledError(EuronError):
@@ -208,7 +212,9 @@ def error_from_body(status: int, body: Any, retry_after: Optional[float] = None)
208
212
  if status == 413 or code == "context_length_exceeded" or (
209
213
  status == 400 and "context length" in message.lower()
210
214
  ):
211
- return ContextTooLongError(message, **kw)
215
+ e = ContextTooLongError(CONTEXT_TOO_LONG_MESSAGE, **kw)
216
+ e.detail = message # the gateway's own text, never shown
217
+ return e
212
218
  if status == 503:
213
219
  return BusyError(message, **kw)
214
220
  if status == 429:
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: build-from-reference
3
+ description: Build an app, feature, page or UI from existing permissive open-source code instead of from scratch. Use for every "build me X" request and for any UI work.
4
+ ---
5
+
6
+ # Build from a reference
7
+
8
+ Goal: $ARGUMENTS
9
+
10
+ Less time, fewer tokens: reuse first, generate only what is missing. Budget: about 4 searches and 6 file reads
11
+ before you write anything.
12
+
13
+ 1. **Look at the project first.** Which framework, component library and styling does it already use
14
+ (package.json, existing components, Tailwind/MUI/shadcn, ...)? Prefer what is there.
15
+ 2. **Search Euron's repos:** `euron_reuse_search` with a short query (for UI use `language: "typescript"`).
16
+ 3. **Then all of GitHub:** `oss_search` (kind=repos, a few keywords, never code) searches from this computer and
17
+ returns the top 5 with licence and why. Only MIT, Apache-2.0, BSD, ISC, 0BSD, Unlicense, MPL-2.0, CC0 and Zlib
18
+ may be used; the tools enforce it. If a tool says a licence is not permitted, drop that source completely.
19
+ 4. **Fetch one reference:** `oss_fetch` downloads it once into the local cache and indexes it (later sessions
20
+ reuse it). Find the 2-6 files that matter with `oss_grep` and read only the lines you need with `oss_read`.
21
+ 5. **Adopt the smallest set of files:** `oss_adopt` copies them into the project with their licence header,
22
+ copies LICENSE (and NOTICE for Apache-2.0) and updates THIRD_PARTY_NOTICES.md. Then adapt them to the
23
+ project's conventions; do not regenerate them. MPL-2.0 files stay separate files under MPL.
24
+ 6. **Hand adaptations** (you rewrote rather than copied): record the source once with `add_third_party_notice`.
25
+ Skip all of this for trivial code.
26
+ 7. **Generate only what is missing**, then run the project (tests, `start_background_process` + `check_app`
27
+ for apps) to verify.
28
+
29
+ Finish with: what you built, `Reused: owner/repo/path (licence)` for each source, and how you verified it.
30
+ If oss_fetch cannot download (offline, rate limited), oss_tree / oss_read still work through Euron.