euron-code 1.7.2__tar.gz → 1.8.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.
- {euron_code-1.7.2 → euron_code-1.8.0}/CHANGELOG.md +29 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/PKG-INFO +18 -6
- {euron_code-1.7.2 → euron_code-1.8.0}/README.md +17 -5
- {euron_code-1.7.2 → euron_code-1.8.0}/pyproject.toml +1 -1
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/__init__.py +1 -1
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/agent.py +194 -21
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/api.py +27 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/cli.py +4 -1
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/config.py +73 -1
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/permissions.py +80 -7
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/prompts.py +1 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/repl.py +75 -7
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/__init__.py +8 -2
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/ignore.py +75 -75
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/web.py +13 -0
- euron_code-1.8.0/src/euron_code/tools/websearch.py +125 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_permissions.py +91 -91
- euron_code-1.8.0/tests/test_v180_rescue_research_permissions.py +220 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/.gitignore +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/LICENSE +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/__main__.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/activity.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/attachments.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/auth.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/autoupdate.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/cache.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/checkpoints.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/codeindex.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/context.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/contextforge/LICENSE +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/contextforge/__init__.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/contextforge/text.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/contextforge/toolout.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/credentials.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/ctxstats.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/doctor.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/documents.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/dotnet.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/error_hints.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/errorlog.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/failures.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/friendly.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/frontmatter.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/hooks.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/keys.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/knowledge.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/licensing.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/llm/__init__.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/llm/anthropic.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/llm/base.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/llm/openai_compat.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/llm/setup.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/logo.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/markdown_view.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/memory.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/migration.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/modes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/mvc5.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/osscache.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/ossgithub.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/pasteinput.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/pathfix.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/progress.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/project_setup.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/repomap.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/rules.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/security_scan.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/sessions.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/skills.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/taskstate.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/textsafe.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tls.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/background.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/base.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/db.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/document.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/erie.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/fs.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/normalize.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/oss.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/pathfind.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/port.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/reuse.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/search.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/shell.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/skill.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/symbols.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/task.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/tools/todo.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/transcript.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/trust.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/ui.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/update_check.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/usage_view.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/version_info.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/src/euron_code/webforms.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/conftest.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/fake_providers.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/helpers.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/measure_floor.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/mock_gateway.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/serve_helper.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/sim_long_session.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_agent_mock.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_api_shell.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_bench.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_bench_harness.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_cli_e2e.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_context_memory_sessions.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_dashboard_fixes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_dashboard_fixes_102.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_db.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_erie.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_knowledge_security.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_markdown_view.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_oss_local.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_powershell_exit_codes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_qa_attach_secrets.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_qa_long_task.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_qa_print_output.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_qa_reuse_unrelated.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_qa_yolo_outside.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_repl.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_reuse_honesty.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_search.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_textsafe.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_tools_fs.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_transcript_ui.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_update_check.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v111_user_reports.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v113_fix_path.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v11_byo.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v11_speed.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v11_tool_fixes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v130_cut_writes.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v130_reliability.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v140_parity.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v152_migration.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v153_user_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v155_user_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v156_autoupdate.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v156_paste_and_edits.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v157_zero_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v15_hosted_models.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v15_reuse_off_subagent_hooks.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v160_stop_scope_atomic.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v161_residual_errors.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v170_v2.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v2_rules_skills_hooks.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v2_tokens_shortcuts.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v2_usage_headers.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v31_security.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v3_accounts_value_setup.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v3_activity.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v3_attachments.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v3_context.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v3_live_repl.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v3_single_login.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v4.py +0 -0
- {euron_code-1.7.2 → euron_code-1.8.0}/tests/test_v5.py +0 -0
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.8.0 (2026-11-14)
|
|
4
|
+
|
|
5
|
+
Finishes tasks faster, looks things up on the web, and stops asking what you already allowed.
|
|
6
|
+
|
|
7
|
+
- **Gets unstuck faster.** When a task keeps failing on the Euron model (failed edits, empty answers, a check that
|
|
8
|
+
still fails after a fix, or several minutes without progress), Euron may let a stronger helper model take a few
|
|
9
|
+
steps. Euron Code then hands the task back with a short note of where things stand (files changed, the last
|
|
10
|
+
check, what is left), so the Euron model carries on without redoing work. A task that is clearly too hard is
|
|
11
|
+
finished by the helper. You do not need to do anything; Euron Code says when it happens.
|
|
12
|
+
- **Web search.** A new `web_search` tool looks up what is not in your project and may be newer than the model
|
|
13
|
+
knows: the latest version of a package, breaking API changes, an error message, how a library works now. It
|
|
14
|
+
answers in a few lines with numbered sources, and the model can open a source with `web_fetch`. Your project
|
|
15
|
+
path, home folder and anything that looks like a secret are masked before a query leaves your computer. Turn it
|
|
16
|
+
off with `"webSearch": false` or a `"deny": ["WebSearch"]` rule.
|
|
17
|
+
- **Never asks the same thing twice.** Answers to permission questions are remembered for the project (in
|
|
18
|
+
`~/.euron`, never in the repo) and carry over to new sessions, `continue`, `--resume` and sub-agents:
|
|
19
|
+
- commands: this exact command, or every `npm test` / `pytest` command, in this project or in every project;
|
|
20
|
+
- edits: auto-approve edits inside this project (or every project);
|
|
21
|
+
- websites: this site, in this project or everywhere.
|
|
22
|
+
Destructive commands, files outside the project, secret files and Euron Code's own settings still ask, but only
|
|
23
|
+
once per exact thing (a yes is remembered) unless you choose "ask every time".
|
|
24
|
+
- **`/permissions`** lists everything that is allowed and where it is saved; `/permissions revoke <n>` takes one
|
|
25
|
+
back, `/permissions reset` forgets this project's answers, `/permissions auto-edits on|off` and
|
|
26
|
+
`/permissions ask-every-time on|off` set the switches.
|
|
27
|
+
- **Safer rules.** A broad rule (`Edit`, `Read`, `Bash(cat:*)`) no longer covers Euron Code's own settings, a
|
|
28
|
+
secret-looking file or a command that names files outside the project; only a rule for that exact thing does.
|
|
29
|
+
- **Fewer wasted steps.** Several web searches or page fetches in one step run at the same time, and a change
|
|
30
|
+
that only touches plain CSS or images is not sent back for a build check.
|
|
31
|
+
|
|
3
32
|
## 1.7.2 (2026-11-13)
|
|
4
33
|
|
|
5
34
|
- Task status reports from one-shot `euron -p` runs now reach Euron. They were sent on a connection the run had
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: euron-code
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.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>
|
|
@@ -449,13 +449,21 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
449
449
|
|
|
450
450
|
### Answering permission questions
|
|
451
451
|
|
|
452
|
+
Your answers are remembered for the project (saved in `~/.euron`, never in the repo), so Euron Code does not
|
|
453
|
+
ask the same thing again: not in a new session, not after `continue` or `--resume`, not in a sub-agent.
|
|
454
|
+
|
|
452
455
|
| Key | Meaning |
|
|
453
456
|
|---|---|
|
|
454
|
-
| `y` | yes,
|
|
457
|
+
| `y` | yes, this time |
|
|
455
458
|
| `n` | no (you can then tell it what to do instead) |
|
|
456
|
-
| `a` | always
|
|
457
|
-
| `p` | always
|
|
458
|
-
| `
|
|
459
|
+
| `a` | always for this project: this exact command, all edits inside the project, or this website |
|
|
460
|
+
| `p` | always for this project: every command that starts the same way (e.g. every `npm test ...`) |
|
|
461
|
+
| `u` | always, in every project (a command prefix, auto-approve edits, a website) |
|
|
462
|
+
|
|
463
|
+
Some questions stay: a destructive command, a file outside the project, a secret-looking file (`.env`, keys) and
|
|
464
|
+
Euron Code's own settings (`EURON.md`, `.euron/`). Each exact one is asked once per project (`y` remembers it,
|
|
465
|
+
`o` allows it only this time), or every time after `/permissions ask-every-time on`. `/permissions` lists what is
|
|
466
|
+
allowed and where it is saved; `/permissions revoke <n>` takes one back; `/permissions reset` forgets them all.
|
|
459
467
|
|
|
460
468
|
### All commands
|
|
461
469
|
|
|
@@ -477,7 +485,7 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
477
485
|
| `/review [focus]`, `/plan` | review uncommitted changes; plan mode |
|
|
478
486
|
| `/security`, `/security-review` | rescan the project and list open findings; let the AI fix them |
|
|
479
487
|
| `/knowledge` | rebuild the code map and show what goes into the context |
|
|
480
|
-
| `/permissions` |
|
|
488
|
+
| `/permissions` | what is allowed and where it is saved; `revoke <n>`, `reset`, `auto-edits on\|off`, `ask-every-time on\|off`, `mode acceptEdits`, `allow "Bash(pytest:*)"` |
|
|
481
489
|
| `/config` | show settings; `/config set <key> <value> [--project]` |
|
|
482
490
|
| `/thinking show\|collapse\|hide`, `/todos`, `/doctor` | reasoning display, task list, setup check |
|
|
483
491
|
| `/login`, `/logout`, `/bug`, `/release-notes`, `/exit` | |
|
|
@@ -795,6 +803,10 @@ and the keychain.
|
|
|
795
803
|
- Your key is never printed in full and never logged. Keys for your own model are sent only to that
|
|
796
804
|
provider, never to Euron.
|
|
797
805
|
- Edits and commands ask first. Files outside the project folder always ask, even to read.
|
|
806
|
+
- `web_search` sends only the search question (your project path, home folder and anything that looks like a
|
|
807
|
+
secret are masked) to Euron's research service.
|
|
808
|
+
- When a task is stuck on the Euron model, a stronger helper model run for Euron may answer a few of its steps;
|
|
809
|
+
it sees the same conversation the Euron model sees, and the task then goes back to the Euron model.
|
|
798
810
|
- Hooks are commands you configure; project hooks only run after you trust them.
|
|
799
811
|
- Text inside your files, web pages and command output is treated as data, not instructions.
|
|
800
812
|
|
|
@@ -383,13 +383,21 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
383
383
|
|
|
384
384
|
### Answering permission questions
|
|
385
385
|
|
|
386
|
+
Your answers are remembered for the project (saved in `~/.euron`, never in the repo), so Euron Code does not
|
|
387
|
+
ask the same thing again: not in a new session, not after `continue` or `--resume`, not in a sub-agent.
|
|
388
|
+
|
|
386
389
|
| Key | Meaning |
|
|
387
390
|
|---|---|
|
|
388
|
-
| `y` | yes,
|
|
391
|
+
| `y` | yes, this time |
|
|
389
392
|
| `n` | no (you can then tell it what to do instead) |
|
|
390
|
-
| `a` | always
|
|
391
|
-
| `p` | always
|
|
392
|
-
| `
|
|
393
|
+
| `a` | always for this project: this exact command, all edits inside the project, or this website |
|
|
394
|
+
| `p` | always for this project: every command that starts the same way (e.g. every `npm test ...`) |
|
|
395
|
+
| `u` | always, in every project (a command prefix, auto-approve edits, a website) |
|
|
396
|
+
|
|
397
|
+
Some questions stay: a destructive command, a file outside the project, a secret-looking file (`.env`, keys) and
|
|
398
|
+
Euron Code's own settings (`EURON.md`, `.euron/`). Each exact one is asked once per project (`y` remembers it,
|
|
399
|
+
`o` allows it only this time), or every time after `/permissions ask-every-time on`. `/permissions` lists what is
|
|
400
|
+
allowed and where it is saved; `/permissions revoke <n>` takes one back; `/permissions reset` forgets them all.
|
|
393
401
|
|
|
394
402
|
### All commands
|
|
395
403
|
|
|
@@ -411,7 +419,7 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
|
|
|
411
419
|
| `/review [focus]`, `/plan` | review uncommitted changes; plan mode |
|
|
412
420
|
| `/security`, `/security-review` | rescan the project and list open findings; let the AI fix them |
|
|
413
421
|
| `/knowledge` | rebuild the code map and show what goes into the context |
|
|
414
|
-
| `/permissions` |
|
|
422
|
+
| `/permissions` | what is allowed and where it is saved; `revoke <n>`, `reset`, `auto-edits on\|off`, `ask-every-time on\|off`, `mode acceptEdits`, `allow "Bash(pytest:*)"` |
|
|
415
423
|
| `/config` | show settings; `/config set <key> <value> [--project]` |
|
|
416
424
|
| `/thinking show\|collapse\|hide`, `/todos`, `/doctor` | reasoning display, task list, setup check |
|
|
417
425
|
| `/login`, `/logout`, `/bug`, `/release-notes`, `/exit` | |
|
|
@@ -729,6 +737,10 @@ and the keychain.
|
|
|
729
737
|
- Your key is never printed in full and never logged. Keys for your own model are sent only to that
|
|
730
738
|
provider, never to Euron.
|
|
731
739
|
- Edits and commands ask first. Files outside the project folder always ask, even to read.
|
|
740
|
+
- `web_search` sends only the search question (your project path, home folder and anything that looks like a
|
|
741
|
+
secret are masked) to Euron's research service.
|
|
742
|
+
- When a task is stuck on the Euron model, a stronger helper model run for Euron may answer a few of its steps;
|
|
743
|
+
it sees the same conversation the Euron model sees, and the task then goes back to the Euron model.
|
|
732
744
|
- Hooks are commands you configure; project hooks only run after you trust them.
|
|
733
745
|
- Text inside your files, web pages and command output is treated as data, not instructions.
|
|
734
746
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "euron-code"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.8.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"
|
|
@@ -46,7 +46,7 @@ MAX_TOOLS_PER_REQUEST = 128 # servers refuse more tool definitions than this in
|
|
|
46
46
|
#: tools that are never dropped when the list has to be cut to MAX_TOOLS_PER_REQUEST
|
|
47
47
|
CORE_TOOLS = ("read_file", "write_file", "edit_file", "multi_edit", "list_dir", "glob", "grep", "bash", "todo_write",
|
|
48
48
|
"task", "skill", "read_document", "find_symbol", "delete_file", "move_file", "start_background_process",
|
|
49
|
-
"read_process_output", "stop_process", "check_app", "web_fetch", "db_query", "port_page",
|
|
49
|
+
"read_process_output", "stop_process", "check_app", "web_fetch", "web_search", "db_query", "port_page",
|
|
50
50
|
"create_mvc5_project")
|
|
51
51
|
SESSION_IN_USE_WAIT = 3 # a 409 right after a restart is usually this computer's own previous session
|
|
52
52
|
FIT_TARGET = 0.8 # never send a prompt above 80% of the window (estimate); shrink the history first
|
|
@@ -101,6 +101,8 @@ DEFAULT_STEP_BUDGET = 60
|
|
|
101
101
|
MAX_MIGRATION_NUDGES = 2 # "these legacy files are not carried over yet" asks per request
|
|
102
102
|
HANDOVERS_PER_STEP = 2 # legacy pages pasted into one step's results (8 at once overflowed the 32k context)
|
|
103
103
|
_EXIT_RE = re.compile(r"^Exit code: (-?\d+)")
|
|
104
|
+
#: changes with nothing to build or test: plain CSS, images, icons (1.8.0, no verify round trip for them)
|
|
105
|
+
_NO_BUILD_RE = re.compile(r"\.(css|svg|png|jpe?g|gif|webp|ico)$", re.I)
|
|
104
106
|
_DOC_RE = re.compile(r"(\.(md|txt|rst|adoc)$|^(LICENSE|NOTICE|THIRD_PARTY_NOTICES)|(^|/)\.euron/)", re.I)
|
|
105
107
|
_SOURCE_RE = re.compile(r"\.(py|ipynb|js|jsx|ts|tsx|mjs|cjs|vue|svelte|html|css|scss|java|kt|go|rs|c|cc|cpp|h|cs|"
|
|
106
108
|
r"php|rb|swift|dart|sql)$", re.I)
|
|
@@ -152,6 +154,16 @@ class _WaitClock:
|
|
|
152
154
|
|
|
153
155
|
WAIT_CLOCK = _WaitClock()
|
|
154
156
|
|
|
157
|
+
#: titles of the asks no broad rule covers (permissions.Permissions.hard_kind)
|
|
158
|
+
HARD_TITLES = {
|
|
159
|
+
"destructive": "Run this DESTRUCTIVE command?",
|
|
160
|
+
"outside_command": "Run this command? It names files outside the project.",
|
|
161
|
+
"private_host": "Fetch from a private / local network address?",
|
|
162
|
+
"own_settings": "Change Euron Code's own instructions or settings for this project?",
|
|
163
|
+
"secret": "Read a secret-looking file (keys, .env)?",
|
|
164
|
+
"outside": "Allow access outside the project?",
|
|
165
|
+
}
|
|
166
|
+
|
|
155
167
|
|
|
156
168
|
def hook_block(event: str, text: str) -> str:
|
|
157
169
|
return f'<hook-output event="{event}">\n{text.strip()}\n</hook-output>'
|
|
@@ -327,6 +339,13 @@ class Agent:
|
|
|
327
339
|
self._extensions = 0 # extra budget windows given to a request still making progress
|
|
328
340
|
self._ext_from = (0, 0.0) # (steps, active seconds) when the current budget window started
|
|
329
341
|
self._budget_kind = "step_budget"
|
|
342
|
+
# 1.8.0 rescue: model seconds since this request last made progress (a check passed, a todo was finished, a
|
|
343
|
+
# new file was changed), sent as X-Euron-Stall-Sec; and the steps a stronger helper model answered
|
|
344
|
+
self._stall_s = 0.0
|
|
345
|
+
self._stall_files: set = set()
|
|
346
|
+
self._stall_done = 0
|
|
347
|
+
self._rescue_steps = 0
|
|
348
|
+
self._handback_due = False
|
|
330
349
|
self.last_status: Optional[Dict[str, Any]] = None # the last task's decided status + evidence
|
|
331
350
|
self._job_diff = ""
|
|
332
351
|
self._adopt_fails = 0
|
|
@@ -557,6 +576,9 @@ class Agent:
|
|
|
557
576
|
self._extensions = 0
|
|
558
577
|
self._ext_from = (0, 0.0)
|
|
559
578
|
self._budget_kind = "step_budget"
|
|
579
|
+
self._stall_s = 0.0
|
|
580
|
+
self._stall_files = set()
|
|
581
|
+
self._stall_done = sum(1 for t in self.ctx.todos if isinstance(t, dict) and t.get("status") == "completed")
|
|
560
582
|
self._done_at_window = sum(1 for t in self.ctx.todos if isinstance(t, dict) and t.get("status") == "completed")
|
|
561
583
|
self._job_diff = (resume_cp or {}).get("diff") or ""
|
|
562
584
|
self.client.mode = self.mode
|
|
@@ -1454,6 +1476,9 @@ class Agent:
|
|
|
1454
1476
|
# last line of defence: the estimate must be under 80% of the window before anything is sent,
|
|
1455
1477
|
# so "context length exceeded" never reaches the user
|
|
1456
1478
|
self.fit_to_window()
|
|
1479
|
+
self._maybe_handback()
|
|
1480
|
+
if hasattr(self.llm, "stall_sec") and getattr(self.llm, "is_euron", False):
|
|
1481
|
+
self.llm.stall_sec = int(self._stall_s)
|
|
1457
1482
|
payload = self._payload()
|
|
1458
1483
|
if not self.is_subagent:
|
|
1459
1484
|
self.ctxstats.observe(self.messages[1:])
|
|
@@ -1462,12 +1487,15 @@ class Agent:
|
|
|
1462
1487
|
act = self.activity
|
|
1463
1488
|
if act is not None:
|
|
1464
1489
|
act.request_started(self.tokens.prompt_estimate(self.messages, self.tool_schemas))
|
|
1490
|
+
t_model = time.monotonic()
|
|
1465
1491
|
try:
|
|
1466
1492
|
resp = self._stream_once(payload)
|
|
1467
1493
|
except BaseException:
|
|
1468
1494
|
if act is not None:
|
|
1469
1495
|
act.request_finished(None)
|
|
1470
1496
|
raise
|
|
1497
|
+
self._stall_s += time.monotonic() - t_model
|
|
1498
|
+
self._note_rescue()
|
|
1471
1499
|
if act is not None:
|
|
1472
1500
|
act.request_finished(resp.usage)
|
|
1473
1501
|
self.tokens.record(resp.usage, raw_est, euron=self.uses_euron)
|
|
@@ -1478,6 +1506,53 @@ class Agent:
|
|
|
1478
1506
|
return resp
|
|
1479
1507
|
return self._with_retries(call)
|
|
1480
1508
|
|
|
1509
|
+
# ---------------------------------------------------------- rescue hand-back (1.8.0)
|
|
1510
|
+
def _note_rescue(self) -> None:
|
|
1511
|
+
"""The gateway may answer a step of a struggling task with a stronger helper model (x-euron-tier 2/3) for a
|
|
1512
|
+
few calls; when that window ends, the next request carries a short state note so the Euron model continues
|
|
1513
|
+
from where the helper stopped instead of redoing work."""
|
|
1514
|
+
if not getattr(self.llm, "is_euron", False):
|
|
1515
|
+
return
|
|
1516
|
+
tier = str(getattr(self.llm, "last_tier", None) or "")
|
|
1517
|
+
kind = getattr(self.llm, "last_rescue", None)
|
|
1518
|
+
left = getattr(self.llm, "last_rescue_left", None)
|
|
1519
|
+
if tier in ("2", "3"):
|
|
1520
|
+
if self._rescue_steps == 0 and not self.is_subagent:
|
|
1521
|
+
self.ui.dim("(this task got stuck on the Euron model: a stronger helper model takes the next steps"
|
|
1522
|
+
+ (" and finishes it)" if kind == "finish" else ", then the Euron model continues)"))
|
|
1523
|
+
self._rescue_steps += 1
|
|
1524
|
+
self._stall_s = 0.0
|
|
1525
|
+
if kind != "finish" and left == 0:
|
|
1526
|
+
self._handback_due = True
|
|
1527
|
+
elif self._rescue_steps and tier == "1":
|
|
1528
|
+
self._handback_due = True # the window closed early (a cap, or the helper failed too)
|
|
1529
|
+
|
|
1530
|
+
def handback_note(self) -> str:
|
|
1531
|
+
edits = sorted({rel for _st, rel in self._real_edits()})
|
|
1532
|
+
todos = [t for t in self.ctx.todos if isinstance(t, dict)]
|
|
1533
|
+
done = sum(1 for t in todos if t.get("status") == "completed")
|
|
1534
|
+
nxt = next((str(t.get("content") or "")[:120] for t in todos if t.get("status") != "completed"), "")
|
|
1535
|
+
check = getattr(self, "_last_check", None)
|
|
1536
|
+
parts = [f"[Euron Code: a stronger helper model did the last {self._rescue_steps} step(s) of this task. "
|
|
1537
|
+
"The Euron model continues now: carry on from the current state, do not redo finished work."]
|
|
1538
|
+
if edits:
|
|
1539
|
+
parts.append("Files changed so far: " + ", ".join(edits[:15]) + ("..." if len(edits) > 15 else "") + ".")
|
|
1540
|
+
if check:
|
|
1541
|
+
parts.append(f"Last check: `{str(check[0])[:120]}` exited {check[1]}.")
|
|
1542
|
+
if todos:
|
|
1543
|
+
parts.append(f"Todos: {done} of {len(todos)} done" + (f"; next: {nxt}" if nxt else "") + ".")
|
|
1544
|
+
parts.append("Re-read a file before editing it.]")
|
|
1545
|
+
return " ".join(parts)
|
|
1546
|
+
|
|
1547
|
+
def _maybe_handback(self) -> None:
|
|
1548
|
+
if not self._handback_due or len(self.messages) < 2:
|
|
1549
|
+
return
|
|
1550
|
+
if self.messages[-1].get("role") not in ("tool", "user"):
|
|
1551
|
+
return
|
|
1552
|
+
self._handback_due = False
|
|
1553
|
+
self._append({"role": "user", "content": self.handback_note()})
|
|
1554
|
+
self._rescue_steps = 0
|
|
1555
|
+
|
|
1481
1556
|
def _stream_once(self, payload: Dict[str, Any]) -> Response:
|
|
1482
1557
|
r = Response()
|
|
1483
1558
|
calls: Dict[int, Dict[str, Any]] = {}
|
|
@@ -1751,6 +1826,7 @@ class Agent:
|
|
|
1751
1826
|
parallel = (len(task_ids) > 1 and not self.is_subagent
|
|
1752
1827
|
and self.settings.get("parallelSubagents", True) is not False)
|
|
1753
1828
|
done: Dict[str, Tuple[str, Optional[str]]] = {}
|
|
1829
|
+
self._prefetch_network(tool_calls)
|
|
1754
1830
|
for i, tc in enumerate(tool_calls):
|
|
1755
1831
|
if stop is not None:
|
|
1756
1832
|
self._append({"role": "tool", "tool_call_id": tc["id"], "name": tc["function"]["name"],
|
|
@@ -1789,6 +1865,39 @@ class Agent:
|
|
|
1789
1865
|
stop = "stuck"
|
|
1790
1866
|
return stop
|
|
1791
1867
|
|
|
1868
|
+
def _prefetch_network(self, tool_calls: List[Dict[str, Any]]) -> None:
|
|
1869
|
+
"""Several web_search / web_fetch calls in one step (1.8.0): fetch them at the same time, then run the step
|
|
1870
|
+
as usual (each call finds its result ready). Only calls already allowed without asking are fetched early;
|
|
1871
|
+
nothing is shown or recorded out of order."""
|
|
1872
|
+
calls = []
|
|
1873
|
+
for tc in tool_calls:
|
|
1874
|
+
fn = tc.get("function") or {}
|
|
1875
|
+
tool = self.tool_map.get(fn.get("name") or "")
|
|
1876
|
+
if tool is None or not hasattr(tool, "prefetch"):
|
|
1877
|
+
continue
|
|
1878
|
+
try:
|
|
1879
|
+
args = json.loads(fn.get("arguments") or "{}")
|
|
1880
|
+
if not isinstance(args, dict):
|
|
1881
|
+
continue
|
|
1882
|
+
req = tool.permission(args, self.ctx)
|
|
1883
|
+
if self.permissions.check(req) != "allow":
|
|
1884
|
+
continue
|
|
1885
|
+
except Exception:
|
|
1886
|
+
continue
|
|
1887
|
+
calls.append((tool, args))
|
|
1888
|
+
if len(calls) < 2:
|
|
1889
|
+
return
|
|
1890
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
1891
|
+
|
|
1892
|
+
def one(item):
|
|
1893
|
+
tool, args = item
|
|
1894
|
+
try:
|
|
1895
|
+
tool.prefetch(args, self.ctx)
|
|
1896
|
+
except Exception:
|
|
1897
|
+
pass # the call runs normally later and reports its own error
|
|
1898
|
+
with ThreadPoolExecutor(max_workers=min(4, len(calls)), thread_name_prefix="euron-prefetch") as pool:
|
|
1899
|
+
list(pool.map(one, calls))
|
|
1900
|
+
|
|
1792
1901
|
def _run_parallel(self, calls: List[Dict[str, Any]], truncated: bool) -> Dict[str, Tuple[str, Optional[str]]]:
|
|
1793
1902
|
"""Several task calls in one step: run them at once (up to MAX_PARALLEL_SUBAGENTS). The gateway
|
|
1794
1903
|
allows a few requests per user in flight; a full queue is waited out by each sub-agent's retries."""
|
|
@@ -1944,6 +2053,19 @@ class Agent:
|
|
|
1944
2053
|
if not failed and req is not None and name not in ("todo_write",):
|
|
1945
2054
|
what = (req.command or "") if name == "bash" else ", ".join(self.ctx.rel(p) for p in req.paths[:3])
|
|
1946
2055
|
self._last_ok_action = f"step {self.steps}: {name} {what}".strip()[:200]
|
|
2056
|
+
# progress resets the stall clock (X-Euron-Stall-Sec): a passing check, a finished todo, a new file changed
|
|
2057
|
+
if is_check and not failed:
|
|
2058
|
+
self._stall_s = 0.0
|
|
2059
|
+
if name == "todo_write" and not failed:
|
|
2060
|
+
done_now = sum(1 for t in self.ctx.todos if isinstance(t, dict) and t.get("status") == "completed")
|
|
2061
|
+
if done_now > self._stall_done:
|
|
2062
|
+
self._stall_s = 0.0
|
|
2063
|
+
self._stall_done = done_now
|
|
2064
|
+
if not failed and req is not None and req.category == "Edit":
|
|
2065
|
+
fresh = {str(p) for p in req.paths} - self._stall_files
|
|
2066
|
+
if fresh:
|
|
2067
|
+
self._stall_files |= fresh
|
|
2068
|
+
self._stall_s = 0.0
|
|
1947
2069
|
v = self.guard.tool_result(name, content, is_check=is_check)
|
|
1948
2070
|
notes = [v.note] if v.note else []
|
|
1949
2071
|
if not failed and req is not None and req.category == "Edit" and name != "oss_adopt":
|
|
@@ -2073,8 +2195,8 @@ class Agent:
|
|
|
2073
2195
|
if (self.is_subagent or self._done_nudges >= self.policy.done_nudges or not self._real_edits()
|
|
2074
2196
|
or self.permissions.mode == "plan" or self.settings.get("verifyNudge", True) is False):
|
|
2075
2197
|
return None
|
|
2076
|
-
if all(_DOC_RE.search(rel) for rel in self.files_changed()):
|
|
2077
|
-
return None # docs / notes only: nothing to build
|
|
2198
|
+
if all(_DOC_RE.search(rel) or _NO_BUILD_RE.search(rel) for rel in self.files_changed()):
|
|
2199
|
+
return None # docs / notes / plain CSS / images only: nothing to build (1.8.0: no extra steps for these)
|
|
2078
2200
|
if self._verified():
|
|
2079
2201
|
return None
|
|
2080
2202
|
last_edit = self._last_edit_step()
|
|
@@ -2971,29 +3093,17 @@ class Agent:
|
|
|
2971
3093
|
"Db": "Open this database outside the project?",
|
|
2972
3094
|
}
|
|
2973
3095
|
title = titles.get(req.category or "", f"Allow {tool.name}?")
|
|
2974
|
-
|
|
2975
|
-
if
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
options.append(("p", f"always `{command_prefix(req.command or '')}` commands (session)"))
|
|
2979
|
-
elif req.category != "DbWrite":
|
|
2980
|
-
options.append(("a", f"always allow {req.category} (session)"))
|
|
2981
|
-
if req.category not in ("DbWrite",):
|
|
2982
|
-
options.append(("s", "always, and remember for this project"))
|
|
3096
|
+
hard = self.permissions.hard_kind(req)
|
|
3097
|
+
if hard in ("destructive", "outside_command", "private_host", "own_settings", "secret", "outside"):
|
|
3098
|
+
title = HARD_TITLES.get(hard, title)
|
|
3099
|
+
options = self._ask_options(req, hard)
|
|
2983
3100
|
t0 = time.monotonic()
|
|
2984
3101
|
try:
|
|
2985
3102
|
choice = self.ui.ask_permission(title, detail, options)
|
|
2986
3103
|
finally:
|
|
2987
3104
|
WAIT_CLOCK.add(time.monotonic() - t0)
|
|
2988
|
-
if choice
|
|
2989
|
-
|
|
2990
|
-
if choice in ("a", "p", "s"):
|
|
2991
|
-
rule = self.permissions.session_rule_for(req, prefix=(choice == "p" or (choice == "s" and req.category == "Bash")))
|
|
2992
|
-
self.permissions.grant_session(rule)
|
|
2993
|
-
if choice == "s":
|
|
2994
|
-
from euron_code import config
|
|
2995
|
-
path = config.add_permission_rule(self.root, "allow", rule)
|
|
2996
|
-
self.ui.dim(f" saved allow rule {rule} to {path}")
|
|
3105
|
+
if choice in ("y", "o", "a", "p", "u", "e", "s"):
|
|
3106
|
+
self._remember_choice(req, hard, choice)
|
|
2997
3107
|
return "allow", None
|
|
2998
3108
|
feedback = ""
|
|
2999
3109
|
if getattr(self.ui, "interactive", False):
|
|
@@ -3004,6 +3114,69 @@ class Agent:
|
|
|
3004
3114
|
WAIT_CLOCK.add(time.monotonic() - t0)
|
|
3005
3115
|
return "deny", feedback or None
|
|
3006
3116
|
|
|
3117
|
+
def _ask_options(self, req: Request, hard: Optional[str]) -> List[tuple]:
|
|
3118
|
+
"""What the user may answer (1.8.0): a yes is remembered for this project unless they say otherwise, so
|
|
3119
|
+
Euron Code never asks the same thing twice. Hard asks remember only that exact thing."""
|
|
3120
|
+
from euron_code.permissions import command_prefix
|
|
3121
|
+
if hard in ("destructive", "outside_command", "private_host", "own_settings", "secret", "outside"):
|
|
3122
|
+
if self.permissions.ask_every_time:
|
|
3123
|
+
return [("y", "yes, this time"), ("n", "no")]
|
|
3124
|
+
return [("y", "yes (remember this exact one for this project)"), ("o", "yes, only this time"),
|
|
3125
|
+
("n", "no")]
|
|
3126
|
+
if req.category == "Bash":
|
|
3127
|
+
pre = command_prefix(req.command or "")
|
|
3128
|
+
return [("y", "yes, this time"), ("a", "always this exact command in this project"),
|
|
3129
|
+
("p", f"always `{pre}` commands in this project"), ("u", f"always `{pre}` commands, every project"),
|
|
3130
|
+
("n", "no")]
|
|
3131
|
+
if req.category == "Edit":
|
|
3132
|
+
return [("y", "yes, this change"), ("a", "auto-approve edits inside this project"),
|
|
3133
|
+
("u", "auto-approve edits in every project"), ("n", "no")]
|
|
3134
|
+
if req.category == "WebFetch":
|
|
3135
|
+
return [("y", "yes, this time"), ("a", f"always {req.domain} in this project"),
|
|
3136
|
+
("u", f"always {req.domain}, every project"), ("n", "no")]
|
|
3137
|
+
if req.category == "DbWrite":
|
|
3138
|
+
return [("y", "yes, this statement"), ("n", "no")]
|
|
3139
|
+
return [("y", "yes, this time"), ("a", f"always allow {req.category} in this project"), ("n", "no")]
|
|
3140
|
+
|
|
3141
|
+
def _remember_choice(self, req: Request, hard: Optional[str], choice: str) -> None:
|
|
3142
|
+
"""Save what the user allowed (~/.euron/projects/<hash>.json, outside the repo: never committed, and a repo
|
|
3143
|
+
cannot plant it), so new sessions, "continue", resume and sub-agents never ask again."""
|
|
3144
|
+
from euron_code import config
|
|
3145
|
+
perms = self.permissions
|
|
3146
|
+
try:
|
|
3147
|
+
if hard in ("destructive", "outside_command", "private_host", "own_settings", "secret", "outside"):
|
|
3148
|
+
if choice != "y" or perms.ask_every_time:
|
|
3149
|
+
return # "only this time"
|
|
3150
|
+
rule = perms.remember_rule_for(req)
|
|
3151
|
+
perms.grant(rule)
|
|
3152
|
+
config.add_permission_rule(self.root, "allow", rule)
|
|
3153
|
+
self.ui.dim(f" remembered for this project: {rule} (/permissions to see or revoke)")
|
|
3154
|
+
return
|
|
3155
|
+
if choice in ("y", "o"):
|
|
3156
|
+
return
|
|
3157
|
+
if req.category == "Edit" and choice in ("a", "u"):
|
|
3158
|
+
perms.mode = "acceptEdits" if perms.mode == "default" else perms.mode
|
|
3159
|
+
if choice == "u":
|
|
3160
|
+
config.set_user_permission_flag("autoApproveEdits", True)
|
|
3161
|
+
self.ui.dim(" edits inside a project are now auto-approved in every project (/permissions)")
|
|
3162
|
+
else:
|
|
3163
|
+
config.set_project_permission_flag(self.root, "autoApproveEdits", True)
|
|
3164
|
+
self.ui.dim(" edits inside this project are now auto-approved (/permissions to change)")
|
|
3165
|
+
return
|
|
3166
|
+
rule = perms.session_rule_for(req, prefix=(choice in ("p", "u") or (choice == "s" and req.category == "Bash")))
|
|
3167
|
+
if choice == "a" and req.category == "Bash":
|
|
3168
|
+
rule = perms.exact_rule_for(req)
|
|
3169
|
+
perms.grant(rule)
|
|
3170
|
+
if choice == "u":
|
|
3171
|
+
path = config.add_user_permission_rule("allow", rule)
|
|
3172
|
+
self.ui.dim(f" allowed in every project: {rule} ({path})")
|
|
3173
|
+
else:
|
|
3174
|
+
config.add_permission_rule(self.root, "allow", rule)
|
|
3175
|
+
self.ui.dim(f" remembered for this project: {rule} (/permissions to see or revoke)")
|
|
3176
|
+
except OSError as e: # a read-only home folder: the grant still holds for this session
|
|
3177
|
+
perms.grant_session(perms.session_rule_for(req))
|
|
3178
|
+
self.ui.dim(f" could not save the permission ({type(e).__name__}); it holds for this session")
|
|
3179
|
+
|
|
3007
3180
|
# ---------------------------------------------------------- compaction
|
|
3008
3181
|
def context_usage(self) -> int:
|
|
3009
3182
|
return self.tokens.prompt_estimate(self.messages, self.tool_schemas)
|
|
@@ -398,6 +398,12 @@ class Client:
|
|
|
398
398
|
self.job_id: Optional[str] = None # X-Euron-Job: one per job, kept across "continue" resumes (1.7.0)
|
|
399
399
|
self.resumed = False # X-Euron-Resume: 1 while a job continues from its checkpoint
|
|
400
400
|
self.mode: Optional[str] = None # X-Euron-Mode: auto | economy | balanced | advanced (a hint only)
|
|
401
|
+
# 1.8.0: model seconds since the task last made progress (X-Euron-Stall-Sec, the gateway's rescue trigger),
|
|
402
|
+
# and what the gateway said about the last answer (x-euron-tier, x-euron-rescue, x-euron-rescue-left)
|
|
403
|
+
self.stall_sec: Optional[int] = None
|
|
404
|
+
self.last_tier: Optional[str] = None
|
|
405
|
+
self.last_rescue: Optional[str] = None
|
|
406
|
+
self.last_rescue_left: Optional[int] = None
|
|
401
407
|
self._transport = transport
|
|
402
408
|
self._is_clone = False
|
|
403
409
|
self._lock = threading.Lock() # one model request at a time
|
|
@@ -483,6 +489,8 @@ class Client:
|
|
|
483
489
|
h["X-Euron-Resume"] = "1"
|
|
484
490
|
if self.mode in ("auto", "economy", "balanced", "advanced"):
|
|
485
491
|
h["X-Euron-Mode"] = str(self.mode)
|
|
492
|
+
if isinstance(self.stall_sec, int) and 0 <= self.stall_sec < 1_000_000:
|
|
493
|
+
h["X-Euron-Stall-Sec"] = str(self.stall_sec)
|
|
486
494
|
return h
|
|
487
495
|
|
|
488
496
|
def _request(self, method: str, path: str, *, auth: bool = True, **kw: Any) -> httpx.Response:
|
|
@@ -579,6 +587,24 @@ class Client:
|
|
|
579
587
|
def usage(self, days: int = 30) -> Dict[str, Any]:
|
|
580
588
|
return self._json("GET", "/v1/usage", params={"days": days})
|
|
581
589
|
|
|
590
|
+
def _note_route(self, headers: Any) -> None:
|
|
591
|
+
try:
|
|
592
|
+
self.last_tier = headers.get("x-euron-tier")
|
|
593
|
+
self.last_rescue = headers.get("x-euron-rescue")
|
|
594
|
+
left = headers.get("x-euron-rescue-left")
|
|
595
|
+
self.last_rescue_left = int(left) if left is not None and str(left).isdigit() else None
|
|
596
|
+
except Exception:
|
|
597
|
+
self.last_tier = self.last_rescue = None
|
|
598
|
+
self.last_rescue_left = None
|
|
599
|
+
|
|
600
|
+
def research(self, query: str, domains: Optional[List[str]] = None, max_results: int = 6) -> Dict[str, Any]:
|
|
601
|
+
"""POST /v1/research (1.8.0): web search + a short cited answer, run by Euron."""
|
|
602
|
+
body: Dict[str, Any] = {"query": query, "maxResults": max_results}
|
|
603
|
+
if domains:
|
|
604
|
+
body["domains"] = domains
|
|
605
|
+
h = {k: v for k, v in self._chat_headers().items() if k.startswith("X-Euron-") and k != "X-Euron-Takeover"}
|
|
606
|
+
return self._json("POST", "/v1/research", json=body, headers=h, timeout=60.0)
|
|
607
|
+
|
|
582
608
|
# ------------------------------------------------------------ open source (V5 section 1)
|
|
583
609
|
def oss_search(self, query: str, kind: str = "repos", language: Optional[str] = None,
|
|
584
610
|
limit: int = 8) -> Dict[str, Any]:
|
|
@@ -710,6 +736,7 @@ class Client:
|
|
|
710
736
|
with self._http.stream("POST", self.base_url + "/v1/chat/completions",
|
|
711
737
|
headers=self._chat_headers(), json=body) as resp:
|
|
712
738
|
holder["resp"] = resp
|
|
739
|
+
self._note_route(resp.headers)
|
|
713
740
|
if resp.status_code >= 400:
|
|
714
741
|
resp.read()
|
|
715
742
|
q.put(("error", _error_from_response(resp)))
|
|
@@ -686,10 +686,13 @@ def _run_session(args, ui, root, settings) -> int:
|
|
|
686
686
|
settings["mode"] = args.mode
|
|
687
687
|
perms_cfg = settings.get("permissions") or {}
|
|
688
688
|
mode = "yolo" if args.yolo else (args.permission_mode or perms_cfg.get("defaultMode") or "default")
|
|
689
|
+
if mode == "default" and not args.permission_mode and perms_cfg.get("autoApproveEdits") is True:
|
|
690
|
+
mode = "acceptEdits" # the user chose "auto-approve edits" for this project (or every project) before
|
|
689
691
|
allow = list(perms_cfg.get("allow") or [])
|
|
690
692
|
if args.allowed_tools:
|
|
691
693
|
allow += [r.strip() for r in args.allowed_tools.split(",") if r.strip()]
|
|
692
|
-
permissions = Permissions(root, allow=allow, deny=list(perms_cfg.get("deny") or []), mode=mode
|
|
694
|
+
permissions = Permissions(root, allow=allow, deny=list(perms_cfg.get("deny") or []), mode=mode,
|
|
695
|
+
ask_every_time=perms_cfg.get("askEveryTime") is True)
|
|
693
696
|
for d in args.add_dir:
|
|
694
697
|
extra = Path(d).expanduser().resolve()
|
|
695
698
|
if not extra.is_dir():
|
|
@@ -60,6 +60,7 @@ DEFAULTS: Dict[str, Any] = {
|
|
|
60
60
|
"bashTimeout": 120,
|
|
61
61
|
"shell": None, # None -> auto (PowerShell/cmd on Windows, bash/sh elsewhere)
|
|
62
62
|
"webFetch": True,
|
|
63
|
+
"webSearch": True, # 1.8.0: web_search (Euron research: latest versions, breaking changes, unknown errors)
|
|
63
64
|
"credentialStore": "auto", # auto | keyring | file
|
|
64
65
|
"sslTrustStore": "certifi", # certifi | system (the OS certificate store; verification is always on)
|
|
65
66
|
"permissions": {"defaultMode": "default", "allow": [], "deny": []},
|
|
@@ -122,6 +123,11 @@ def load_user_settings() -> Dict[str, Any]:
|
|
|
122
123
|
return _read_json(user_settings_path())
|
|
123
124
|
|
|
124
125
|
|
|
126
|
+
#: yes/no switches the user sets for permissions (1.8.0): autoApproveEdits = edits inside the project apply without
|
|
127
|
+
#: asking (acceptEdits as the starting mode); askEveryTime = hard asks are never remembered
|
|
128
|
+
PERMISSION_FLAGS = ("autoApproveEdits", "askEveryTime")
|
|
129
|
+
|
|
130
|
+
|
|
125
131
|
def _merge(base: Dict[str, Any], over: Dict[str, Any]) -> Dict[str, Any]:
|
|
126
132
|
out = copy.deepcopy(base)
|
|
127
133
|
for k, v in over.items():
|
|
@@ -132,6 +138,9 @@ def _merge(base: Dict[str, Any], over: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
132
138
|
cur[lk] = list(cur.get(lk, [])) + [str(x) for x in v[lk]]
|
|
133
139
|
if v.get("defaultMode"):
|
|
134
140
|
cur["defaultMode"] = v["defaultMode"]
|
|
141
|
+
for flag in PERMISSION_FLAGS:
|
|
142
|
+
if isinstance(v.get(flag), bool):
|
|
143
|
+
cur[flag] = v[flag]
|
|
135
144
|
elif isinstance(v, dict) and isinstance(out.get(k), dict):
|
|
136
145
|
out[k] = _merge(out[k], v)
|
|
137
146
|
else:
|
|
@@ -182,7 +191,7 @@ def split_project(data: Dict[str, Any], base: Dict[str, Any]) -> Tuple[Dict[str,
|
|
|
182
191
|
except (TypeError, ValueError):
|
|
183
192
|
lower = False
|
|
184
193
|
(safe if lower else priv)[k] = v
|
|
185
|
-
elif k
|
|
194
|
+
elif k in ("webFetch", "webSearch") and v is False:
|
|
186
195
|
safe[k] = v
|
|
187
196
|
else:
|
|
188
197
|
priv[k] = v # shell, db, webFetch: true, apiBaseUrl, credentialStore, anything unknown
|
|
@@ -336,3 +345,66 @@ def add_permission_rule(root: Path, kind: str, rule: str, local: bool = True) ->
|
|
|
336
345
|
lst.append(rule)
|
|
337
346
|
write_json(path, data)
|
|
338
347
|
return path
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
def add_user_permission_rule(kind: str, rule: str) -> Path:
|
|
351
|
+
"""A rule the user allowed for every project (~/.euron/settings.json)."""
|
|
352
|
+
path = user_settings_path()
|
|
353
|
+
data = _read_json(path)
|
|
354
|
+
lst: List[str] = data.setdefault("permissions", {}).setdefault(kind, [])
|
|
355
|
+
if rule not in lst:
|
|
356
|
+
lst.append(rule)
|
|
357
|
+
write_json(path, data)
|
|
358
|
+
return path
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
def _set_flag(path: Path, flag: str, value: Optional[bool]) -> Path:
|
|
362
|
+
data = _read_json(path)
|
|
363
|
+
perms = data.setdefault("permissions", {})
|
|
364
|
+
if value is None:
|
|
365
|
+
perms.pop(flag, None)
|
|
366
|
+
else:
|
|
367
|
+
perms[flag] = bool(value)
|
|
368
|
+
write_json(path, data)
|
|
369
|
+
return path
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
def set_project_permission_flag(root: Path, flag: str, value: Optional[bool]) -> Path:
|
|
373
|
+
"""The user's own switch for one project (outside the repo, like their saved rules)."""
|
|
374
|
+
return _set_flag(user_project_settings_path(root), flag, value)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
def set_user_permission_flag(flag: str, value: Optional[bool]) -> Path:
|
|
378
|
+
return _set_flag(user_settings_path(), flag, value)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def project_grants(root: Path) -> Dict[str, Any]:
|
|
382
|
+
"""What the user saved for this project: {"allow": [...], "deny": [...], flags...}."""
|
|
383
|
+
return dict(_read_json(user_project_settings_path(root)).get("permissions") or {})
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def remove_permission_rule(root: Path, rule: str) -> List[Path]:
|
|
387
|
+
"""Revoke a saved rule wherever the USER saved it (this project's grants, then ~/.euron/settings.json).
|
|
388
|
+
The repo's own .euron/settings.json is the project's file and is left alone."""
|
|
389
|
+
changed: List[Path] = []
|
|
390
|
+
for path in (user_project_settings_path(root), user_settings_path()):
|
|
391
|
+
data = _read_json(path)
|
|
392
|
+
perms = data.get("permissions") or {}
|
|
393
|
+
hit = False
|
|
394
|
+
for kind in ("allow", "deny"):
|
|
395
|
+
lst = perms.get(kind)
|
|
396
|
+
if isinstance(lst, list) and rule in lst:
|
|
397
|
+
perms[kind] = [r for r in lst if r != rule]
|
|
398
|
+
hit = True
|
|
399
|
+
if hit:
|
|
400
|
+
write_json(path, data)
|
|
401
|
+
changed.append(path)
|
|
402
|
+
return changed
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
def reset_project_grants(root: Path) -> Path:
|
|
406
|
+
path = user_project_settings_path(root)
|
|
407
|
+
data = _read_json(path)
|
|
408
|
+
data.pop("permissions", None)
|
|
409
|
+
write_json(path, data)
|
|
410
|
+
return path
|