euron-code 1.9.2__tar.gz → 1.10.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.9.2 → euron_code-1.10.0}/CHANGELOG.md +48 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/PKG-INFO +1 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/pyproject.toml +1 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/__init__.py +1 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/agent.py +216 -6
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/api.py +19 -2
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/documents.py +300 -38
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/modes.py +4 -2
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/progress.py +35 -4
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/prompts.py +2 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/taskstate.py +1 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/__init__.py +2 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/base.py +4 -0
- euron_code-1.10.0/src/euron_code/tools/citations.py +263 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/document.py +1 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/fs.py +15 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/template.py +13 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/transcript.py +1 -1
- euron_code-1.10.0/tests/test_v1100_finish_on_time.py +306 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v170_v2.py +1 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v190_refund_fixes.py +2 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v191_page_assets.py +15 -0
- euron_code-1.10.0/tests/test_v194_citations.py +376 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v3_context.py +3 -1
- {euron_code-1.9.2 → euron_code-1.10.0}/.gitignore +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/LICENSE +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/README.md +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/__main__.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/activity.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/attachments.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/auth.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/autoupdate.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/cache.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/checkpoints.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/cli.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/codeindex.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/config.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/context.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/contextforge/LICENSE +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/contextforge/__init__.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/contextforge/text.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/contextforge/toolout.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/credentials.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/ctxstats.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/doctor.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/dotnet.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/error_hints.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/errorlog.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/failures.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/friendly.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/frontmatter.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/hooks.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/keys.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/knowledge.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/licensing.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/llm/__init__.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/llm/anthropic.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/llm/base.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/llm/openai_compat.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/llm/setup.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/logo.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/markdown_view.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/memory.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/migration.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/mvc5.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/osscache.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/ossgithub.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/pasteinput.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/pathfix.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/permissions.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/project_setup.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/repl.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/repomap.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/rules.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/security_scan.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/sessions.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/skills.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/textsafe.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tls.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/background.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/db.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/erie.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/ignore.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/normalize.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/oss.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/pagecheck.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/pathfind.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/port.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/reuse.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/search.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/shell.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/skill.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/symbols.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/task.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/todo.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/web.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/tools/websearch.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/trust.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/ui.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/update_check.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/usage_view.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/version_info.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/src/euron_code/webforms.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/conftest.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/fake_providers.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/helpers.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/measure_floor.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/mock_gateway.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/serve_helper.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/sim_long_session.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_agent_mock.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_api_shell.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_bench.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_bench_harness.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_cli_e2e.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_context_memory_sessions.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_dashboard_fixes.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_dashboard_fixes_102.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_db.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_erie.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_knowledge_security.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_markdown_view.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_oss_local.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_permissions.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_powershell_exit_codes.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_qa_attach_secrets.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_qa_long_task.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_qa_print_output.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_qa_reuse_unrelated.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_qa_yolo_outside.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_render_ghost.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_repl.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_reuse_honesty.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_search.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_textsafe.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_tools_fs.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_transcript_ui.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_update_check.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v111_user_reports.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v113_fix_path.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v11_byo.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v11_speed.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v11_tool_fixes.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v130_cut_writes.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v130_reliability.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v140_parity.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v152_migration.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v153_user_errors.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v155_user_errors.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v156_autoupdate.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v156_paste_and_edits.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v157_zero_errors.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v15_hosted_models.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v15_reuse_off_subagent_hooks.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v160_stop_scope_atomic.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v161_residual_errors.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v180_rescue_research_permissions.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v181_silent_failures_verified.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v182_zero_errors.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v184_selfupdate_pep668.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v186_bypass_and_waits.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v187_sleep_wake.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v188_typed_cli_commands.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v189_edit_partial.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v2_rules_skills_hooks.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v2_tokens_shortcuts.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v2_usage_headers.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v31_security.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v3_accounts_value_setup.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v3_activity.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v3_attachments.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v3_live_repl.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v3_single_login.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v4.py +0 -0
- {euron_code-1.9.2 → euron_code-1.10.0}/tests/test_v5.py +0 -0
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.10.0 (2026-11-23)
|
|
4
|
+
|
|
5
|
+
- **Long jobs keep going while they make progress.** In Euron Auto a request that is still changing files,
|
|
6
|
+
finishing its task list or turning a failing check green gets up to three more windows (was one) instead of
|
|
7
|
+
stopping at its step / time budget and waiting for you to type `continue`. A request that stops making progress
|
|
8
|
+
still stops, with the done / left list.
|
|
9
|
+
- **No more re-reading after a summary.** When a long conversation is summarised, the files Euron Code was working
|
|
10
|
+
on come back with the summary, current and counted as read, so it carries on editing instead of reading the same
|
|
11
|
+
files again (and instead of having its edits refused with "the conversation was summarised since you last saw
|
|
12
|
+
this file").
|
|
13
|
+
- A refused edit that comes back with the file's current text no longer counts as a failure: it cannot stop a job
|
|
14
|
+
as "not making progress", and it no longer undoes the other edits of the same step. Parallel edits of one step
|
|
15
|
+
that fail the same way count once, so a batch of edits cannot stop a job in a single step.
|
|
16
|
+
- `cat file`, `type file` and `Get-Content file` printing a whole file now count as reading it, like `read_file`.
|
|
17
|
+
- One step no longer reads a dozen whole files at once: past 40% of the room, further files of that step come back
|
|
18
|
+
as an outline (definitions with line numbers) to read in part, instead of filling the window and forcing a summary.
|
|
19
|
+
- A job stopped for repeated edit errors is no longer reported as "blocked by the environment" just because an
|
|
20
|
+
earlier check once failed on a missing package.
|
|
21
|
+
- When a page check fails while a server Euron Code started before its last change is still running (and does not
|
|
22
|
+
reload by itself), Euron Code is told to restart it first, instead of checking the old code again and again.
|
|
23
|
+
|
|
24
|
+
## 1.9.4 (2026-11-23, shipped in 1.10.0)
|
|
25
|
+
|
|
26
|
+
- **Word documents are read in full.** `read_document` now takes `range` for .docx (lines of the extracted text,
|
|
27
|
+
like a text file: `"201-400"`, `"400-"`); before, every read of a long Word file showed the same first ~6k tokens,
|
|
28
|
+
so the end of the document (its References) was never reached. Every cut result says exactly where to read on
|
|
29
|
+
(`range="181-"` and the total line count for Word, text, JSON and notebooks; `page="5-"` for PDF and slides;
|
|
30
|
+
`sheet` + `range` for Excel; `range` for CSV) and, when the document has a References / Bibliography section,
|
|
31
|
+
the line or page where it starts. A line or page longer than the cap no longer makes the hint repeat itself.
|
|
32
|
+
- Word: superscript citation marks are kept (`MALDI-TOF MS^{1,3}`, not `MS1,3`), subscripts as `_{2}`; footnotes
|
|
33
|
+
and endnotes are read and listed under `## Footnotes` / `## Endnotes` with their `[^n]` marks in the text;
|
|
34
|
+
content controls (Word's own citations and bibliography) are no longer skipped.
|
|
35
|
+
- **New `audit_citations` tool.** One call audits every reference of a manuscript (.docx, .pdf, .txt, .md) with
|
|
36
|
+
Euron's citation audit service: a status per reference (VERIFIED, METADATA_MISMATCH, UNRESOLVED,
|
|
37
|
+
POSSIBLY_FABRICATED, CONFIRMED_FABRICATION, retracted), optional claim support, and an Excel and a PDF report
|
|
38
|
+
written next to the manuscript (never over an existing file). A reference that is not found is UNRESOLVED, never
|
|
39
|
+
"fabricated".
|
|
40
|
+
- Euron Code no longer checks references one by one with web searches, never writes replacement references from
|
|
41
|
+
memory or placeholders such as "[Original ref 1]", and stops when a document could not be read in full. A
|
|
42
|
+
conversation summary keeps check results as unverified claims, not decisions.
|
|
43
|
+
|
|
44
|
+
## 1.9.3 (2026-11-22)
|
|
45
|
+
|
|
46
|
+
- An answer cut off after its first words ("I see", "The") is asked again like an empty one, instead of ending the
|
|
47
|
+
task on it.
|
|
48
|
+
- After `fix_page_assets` has fixed a page, a rewrite of that whole page is refused once (it replaced the user's
|
|
49
|
+
forms and ids); Euron Code edits only what `check_app` still reports.
|
|
50
|
+
|
|
3
51
|
## 1.9.2 (2026-11-22)
|
|
4
52
|
|
|
5
53
|
- When today's token allowance is used up, the task status now says "paused: today's token allowance is used (it
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: euron-code
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.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>
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "euron-code"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.10.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"
|
|
@@ -58,7 +58,7 @@ MAX_TOOLS_PER_REQUEST = 128 # servers refuse more tool definitions than this in
|
|
|
58
58
|
CORE_TOOLS = ("read_file", "write_file", "edit_file", "multi_edit", "list_dir", "glob", "grep", "bash", "todo_write",
|
|
59
59
|
"task", "skill", "read_document", "find_symbol", "delete_file", "move_file", "start_background_process",
|
|
60
60
|
"read_process_output", "stop_process", "check_app", "fix_page_assets", "web_fetch", "web_search", "db_query", "port_page",
|
|
61
|
-
"create_mvc5_project")
|
|
61
|
+
"create_mvc5_project", "audit_citations")
|
|
62
62
|
SESSION_IN_USE_WAIT = 3 # a 409 right after a restart is usually this computer's own previous session
|
|
63
63
|
FIT_TARGET = 0.8 # never send a prompt above 80% of the window (estimate); shrink the history first
|
|
64
64
|
# Compaction (1.1.0). Thresholds are fractions of the CONVERSATION room (usable window minus the fixed floor:
|
|
@@ -89,6 +89,18 @@ SUMMARY_REGROW = 0.25 # ... and only after the conversation grew again by this
|
|
|
89
89
|
SUMMARY_KEEP = 0.2 # the recent tail kept verbatim after a summary, as a share of the conversation room
|
|
90
90
|
SUMMARY_MAX_TOKENS = 900
|
|
91
91
|
AFTER_SUMMARY_MAX = 0.45 # after a summary the conversation must be under this share of its room
|
|
92
|
+
#: 1.10.0: the files the request was working on come back with the summary, current and counted as read.
|
|
93
|
+
#: Prod 16-23 Nov: 36% of tasks had a summary; they finished 41% of the time (1 summary) and 18% (2+), against 71%
|
|
94
|
+
#: without one. After every summary the model re-read the same files (51% of its tool calls were reads) and 361
|
|
95
|
+
#: edits were refused as "summarised since you last saw this file", which the stuck guard then counted as errors.
|
|
96
|
+
WORKING_SET_SHARE = 0.15 # at most this share of the conversation room, and never past AFTER_SUMMARY_MAX
|
|
97
|
+
WORKING_SET_FILES = 4
|
|
98
|
+
WORKING_SET_RECENT_STEPS = 10 # files edited or read within this many steps before the summary
|
|
99
|
+
WORKING_SET_WHOLE_LINES = 220 # a file up to this long comes back whole, a longer one as its last-read part
|
|
100
|
+
WORKING_SET_PART_LINES = 140
|
|
101
|
+
#: one step's reads in full stop at this share of the conversation room; later files of the step come back as an
|
|
102
|
+
#: outline (1.10.0: a step reading 12 files at once filled the 32k window, was summarised and read them all again)
|
|
103
|
+
STEP_READ_SHARE = 0.4
|
|
92
104
|
DENIED = "denied"
|
|
93
105
|
EFFORTS = ("low", "medium", "high")
|
|
94
106
|
OUTPUT_FLOOR = 1024 # never ask for fewer output tokens than this
|
|
@@ -112,6 +124,13 @@ DEFAULT_STEP_BUDGET = 60
|
|
|
112
124
|
MAX_MIGRATION_NUDGES = 2 # "these legacy files are not carried over yet" asks per request
|
|
113
125
|
HANDOVERS_PER_STEP = 2 # legacy pages pasted into one step's results (8 at once overflowed the 32k context)
|
|
114
126
|
_EXIT_RE = re.compile(r"^Exit code: (-?\d+)")
|
|
127
|
+
#: servers that pick up code changes by themselves (no restart needed after an edit)
|
|
128
|
+
_RELOADING_RE = re.compile(r"--reload|--watch|\bwatch\b|nodemon|\bdev\b|vite|next |artisan serve|php -S|ng serve|"
|
|
129
|
+
r"webpack serve|--debug|debug=true|ts-node-dev|live-server|http-server|http\.server", re.I)
|
|
130
|
+
#: a shell command that only prints one whole file (1.10.0)
|
|
131
|
+
_SHELL_READ_RE = re.compile(
|
|
132
|
+
r"^\s*(cat|type|get-content|gc)\s+(?:-(?:raw|path|encoding\s+\S+)\s+)*"
|
|
133
|
+
r"(?:\"([^\"|<>;&]+)\"|'([^'|<>;&]+)'|([^\s\"'|<>;&]+))(?:\s+-(?:raw|encoding\s+\S+))*\s*$", re.I)
|
|
115
134
|
#: changes with nothing to build or test: plain CSS, images, icons (1.8.0, no verify round trip for them)
|
|
116
135
|
_NO_BUILD_RE = re.compile(r"\.(css|svg|png|jpe?g|gif|webp|ico|woff2?|ttf|eot|map)$", re.I)
|
|
117
136
|
_DOC_RE = re.compile(r"(\.(md|txt|rst|adoc)$|^(LICENSE|NOTICE|THIRD_PARTY_NOTICES)|(^|/)\.euron/)", re.I)
|
|
@@ -207,7 +226,12 @@ def blank_answer(text: str) -> bool:
|
|
|
207
226
|
return False
|
|
208
227
|
# one or two words with no sentence end ("I", "The", "Let me"): the model stopped right after it began
|
|
209
228
|
words = re.findall(r"[\w']+", t.lower())
|
|
210
|
-
|
|
229
|
+
if len(words) <= 3 and all(w in _STUB_WORDS for w in words):
|
|
230
|
+
return True
|
|
231
|
+
# "I see", "Now let", "The CSS": a few English words with no sentence end = the answer was cut at its start
|
|
232
|
+
# (non-English short answers such as a Hindi word are real answers)
|
|
233
|
+
return (bool(words) and words[0] in _STUB_WORDS and len(words) <= 3 and len(t) <= 20 and t.isascii()
|
|
234
|
+
and not t.endswith((".", "!", "?", ")", "`", "\"", "'", ":", "*")))
|
|
211
235
|
|
|
212
236
|
|
|
213
237
|
_STUB_WORDS = {"i", "i'm", "i'll", "the", "a", "an", "let", "let's", "me", "now", "so", "to", "it", "this", "here",
|
|
@@ -1052,7 +1076,11 @@ class Agent:
|
|
|
1052
1076
|
"edits": bool(self._real_edits()), "verified": bool(self._real_edits()) and self._verified(),
|
|
1053
1077
|
"last_check": (last[1], last[2], last[3]) if last else None,
|
|
1054
1078
|
"checks_after_edit": bool(self._checks_after_edit()), "open_todos": len(self._open_todos()),
|
|
1055
|
-
"tier": self._tier, "budget_kind": self._budget_kind
|
|
1079
|
+
"tier": self._tier, "budget_kind": self._budget_kind,
|
|
1080
|
+
# 1.10.0: a stop for repeated edit errors is not "blocked by the environment" just because an
|
|
1081
|
+
# older check once failed on a missing package (prod 22 Nov)
|
|
1082
|
+
"stuck_on_check": (str(self._stuck or "").startswith("the same failure came back")
|
|
1083
|
+
or bool(self._checks and self._checks[-1][0] >= self.steps - 3))}
|
|
1056
1084
|
|
|
1057
1085
|
def _checkpoint(self, result: Optional[TurnResult], decided: Optional[Dict[str, Any]], final: bool) -> Dict[str, Any]:
|
|
1058
1086
|
steps, minutes = self.budget()
|
|
@@ -1280,6 +1308,9 @@ class Agent:
|
|
|
1280
1308
|
turns += 1
|
|
1281
1309
|
self.steps += 1
|
|
1282
1310
|
self.ctx.turn = self.steps
|
|
1311
|
+
self.ctx.step_read_used = 0 # 1.10.0: one step may not read more than a share of the room in full
|
|
1312
|
+
self.ctx.step_read_budget = (0 if self.settings.get("stepReadCap", True) is False else
|
|
1313
|
+
int(STEP_READ_SHARE * self.conversation_room() * context.CHARS_PER_TOKEN))
|
|
1283
1314
|
self._plan_effort(first_step=(turns == 1))
|
|
1284
1315
|
try:
|
|
1285
1316
|
self.maybe_compact()
|
|
@@ -1578,7 +1609,7 @@ class Agent:
|
|
|
1578
1609
|
def _may_extend(self, turns: int) -> bool:
|
|
1579
1610
|
"""A request at its budget line goes on (its mode's extra windows) only while the evidence says it is
|
|
1580
1611
|
getting somewhere: in the window since the last line, files changed or todo items were finished, and
|
|
1581
|
-
the latest check is not failing the same way again. Never for a question, never past
|
|
1612
|
+
the latest check is not failing the same way again. Never for a question, never past 2.5x the budget
|
|
1582
1613
|
(V2 phase 7: 348 of 3,235 tasks in 7 days stopped at the budget, many of them mid-way through work)."""
|
|
1583
1614
|
if (self.is_subagent or self._tier == "question" or self._extensions >= self.policy.extensions
|
|
1584
1615
|
or self._stuck or self.settings.get("taskStepBudget") == 0):
|
|
@@ -2527,6 +2558,7 @@ class Agent:
|
|
|
2527
2558
|
for p in req.paths:
|
|
2528
2559
|
rel = self.ctx.rel(p)
|
|
2529
2560
|
self.ledger["edits"].append((step, rel))
|
|
2561
|
+
self._last_edit_mono, self._last_edit_rel = time.monotonic(), rel
|
|
2530
2562
|
n = sum(1 for _, r in self.ledger["edits"] if r == rel)
|
|
2531
2563
|
cmds = self.ledger["commands"]
|
|
2532
2564
|
if (n == EDIT_THRASH_AT and cmds and cmds[-1][2] != 0 and not self.is_subagent
|
|
@@ -2541,11 +2573,56 @@ class Agent:
|
|
|
2541
2573
|
m = _EXIT_RE.match(content)
|
|
2542
2574
|
if m:
|
|
2543
2575
|
self.ledger["commands"].append((step, req.command or "", int(m.group(1))))
|
|
2576
|
+
if m.group(1) == "0":
|
|
2577
|
+
self._mark_shell_read(req.command or "", content)
|
|
2544
2578
|
elif name == "check_app":
|
|
2545
2579
|
# A passing HTTP / browser check of the running app is verification
|
|
2546
2580
|
# too (live 2026-11-05: the nudge asked to re-verify after check_app).
|
|
2547
2581
|
self.ledger["commands"].append((step, "check_app", 0))
|
|
2548
2582
|
|
|
2583
|
+
def _stale_server_note(self) -> str:
|
|
2584
|
+
"""A page check failed while a server Euron Code started BEFORE the last code change is still running and
|
|
2585
|
+
does not reload by itself (1.10.0 replay of "run this project": the app was fixed, but the old process kept
|
|
2586
|
+
answering 500 and six identical checks stopped the request as stuck)."""
|
|
2587
|
+
pm = getattr(self.ctx, "processes", None)
|
|
2588
|
+
edited = getattr(self, "_last_edit_mono", 0.0)
|
|
2589
|
+
if pm is None or not edited:
|
|
2590
|
+
return ""
|
|
2591
|
+
noted = self.__dict__.setdefault("_stale_noted", set())
|
|
2592
|
+
for p in pm.running():
|
|
2593
|
+
cmd = str(getattr(p, "command", "") or "")
|
|
2594
|
+
if p.started >= edited or _RELOADING_RE.search(cmd) or (p.id, edited) in noted:
|
|
2595
|
+
continue
|
|
2596
|
+
noted.add((p.id, edited))
|
|
2597
|
+
label = f"{p.name or p.id} (`{cmd[:60]}`)"
|
|
2598
|
+
return (f"[Euron Code: {label} was started before your last change ({getattr(self, '_last_edit_rel', '')}) "
|
|
2599
|
+
"and does not reload by itself, so it still runs the old code. Restart it (stop_process, then "
|
|
2600
|
+
"start_background_process) before you check the page again.]")
|
|
2601
|
+
return ""
|
|
2602
|
+
|
|
2603
|
+
def _mark_shell_read(self, command: str, content: str) -> None:
|
|
2604
|
+
"""`cat file` / `type file` / `Get-Content file` printed a whole file: it counts as read, like read_file
|
|
2605
|
+
(1.10.0: prod 22 Nov, the model re-read six files with cat after a summary, then all six edits were
|
|
2606
|
+
refused as "summarised since you last saw this file" and the job stopped as stuck)."""
|
|
2607
|
+
m = _SHELL_READ_RE.match(command or "")
|
|
2608
|
+
if not m or "output truncated" in content:
|
|
2609
|
+
return
|
|
2610
|
+
raw = (m.group(2) or m.group(3) or m.group(4) or "").strip()
|
|
2611
|
+
if not raw or any(ch in raw for ch in "*?$"):
|
|
2612
|
+
return
|
|
2613
|
+
try:
|
|
2614
|
+
base = Path(getattr(self.ctx.shell, "cwd", None) or self.root)
|
|
2615
|
+
p = Path(raw) if os.path.isabs(raw) else base / raw
|
|
2616
|
+
if not p.is_file():
|
|
2617
|
+
return
|
|
2618
|
+
size = p.stat().st_size
|
|
2619
|
+
if size > 200_000 or len(content) < 0.7 * size - 64:
|
|
2620
|
+
return
|
|
2621
|
+
from euron_code.tools.fs import TO_END
|
|
2622
|
+
self.ctx.tracker.mark_read(p, (1, TO_END), self.steps, len(content), self.ctx.call_id)
|
|
2623
|
+
except (OSError, ValueError):
|
|
2624
|
+
return
|
|
2625
|
+
|
|
2549
2626
|
# ---------------------------------------------------------- calls cut by the output limit
|
|
2550
2627
|
def _repair_cut_calls(self, resp: "Response") -> int:
|
|
2551
2628
|
"""The answer stopped at the output limit while writing its tool calls. Complete calls before the last
|
|
@@ -2623,8 +2700,12 @@ class Agent:
|
|
|
2623
2700
|
self._stall_files |= fresh
|
|
2624
2701
|
self._stall_s = 0.0
|
|
2625
2702
|
self._mark_progress()
|
|
2626
|
-
v = self.guard.tool_result(name, content, is_check=is_check)
|
|
2703
|
+
v = self.guard.tool_result(name, content, is_check=is_check, step=self.steps)
|
|
2627
2704
|
notes = [v.note] if v.note else []
|
|
2705
|
+
if name == "check_app" and failed:
|
|
2706
|
+
stale = self._stale_server_note()
|
|
2707
|
+
if stale:
|
|
2708
|
+
notes.append(stale)
|
|
2628
2709
|
if not failed and req is not None and req.category == "Edit" and name != "oss_adopt":
|
|
2629
2710
|
for p in req.paths[:4]:
|
|
2630
2711
|
try:
|
|
@@ -3704,6 +3785,22 @@ class Agent:
|
|
|
3704
3785
|
except OSError:
|
|
3705
3786
|
pass
|
|
3706
3787
|
stash = self._migration_stash(req) if name != "port_page" else []
|
|
3788
|
+
fixed = getattr(self.ctx, "fixed_pages", None)
|
|
3789
|
+
if name == "write_file" and fixed and not args.get("append"):
|
|
3790
|
+
warned = getattr(self.ctx, "_fixed_warned", None)
|
|
3791
|
+
if warned is None:
|
|
3792
|
+
warned = self.ctx._fixed_warned = set()
|
|
3793
|
+
hit = [p for p in req.paths if str(Path(p).resolve()) in fixed and Path(p).is_file()
|
|
3794
|
+
and str(Path(p).resolve()) not in warned]
|
|
3795
|
+
if hit:
|
|
3796
|
+
# replay 22 Nov: after fix_page_assets the model rewrote the working login and dashboard
|
|
3797
|
+
# pages from memory and dropped their form and ids
|
|
3798
|
+
warned.update(str(Path(p).resolve()) for p in hit)
|
|
3799
|
+
msg = (f"Not applied: fix_page_assets already fixed {self.ctx.rel(hit[0])}; rewriting the "
|
|
3800
|
+
"whole page replaces the user's content (forms, ids, text). Change only what check_app "
|
|
3801
|
+
"still reports, with edit_file. If the user asked for a redesign, send it again.")
|
|
3802
|
+
self.ui.tool_result("not applied: the page was just fixed; edit it instead", is_error=True)
|
|
3803
|
+
return "Error: " + msg, None
|
|
3707
3804
|
if name == "bash":
|
|
3708
3805
|
self._shell_before()
|
|
3709
3806
|
from euron_code.permissions import is_instruction_path
|
|
@@ -3719,7 +3816,8 @@ class Agent:
|
|
|
3719
3816
|
result = tool.run(args, self.ctx)
|
|
3720
3817
|
except ToolError as e:
|
|
3721
3818
|
result = ToolResult(str(e), is_error=True)
|
|
3722
|
-
|
|
3819
|
+
if not progress.handed_back(str(e)): # 1.10.0: a refusal with the current text undoes nothing else
|
|
3820
|
+
self._mark_step_failure()
|
|
3723
3821
|
from euron_code import errorlog
|
|
3724
3822
|
errorlog.report("tool", "tool_error", str(e), tool=name)
|
|
3725
3823
|
except KeyboardInterrupt:
|
|
@@ -4026,6 +4124,7 @@ class Agent:
|
|
|
4026
4124
|
# the conversation as the model last saw it, before stage 1 edits old tool outputs in place:
|
|
4027
4125
|
# a summary asked at its end reuses the GPU prefix cache (stage 1 replaces messages by index)
|
|
4028
4126
|
sent = list(self.messages)
|
|
4127
|
+
recent_reads = self._recent_reads() # before stage 1 forgets them: the working set after a summary
|
|
4029
4128
|
# stage 1: drop bulky old tool outputs
|
|
4030
4129
|
if not manual:
|
|
4031
4130
|
self._supersede_stale_reads()
|
|
@@ -4149,6 +4248,7 @@ class Agent:
|
|
|
4149
4248
|
head += "\n\nContinue the task from where the work below left off."
|
|
4150
4249
|
self.messages = [self.messages[0], {"role": "user", "content": head}] + recent
|
|
4151
4250
|
self.ctx.tracker.clear(stale=True) # every file must be seen again before it is changed (1.6.0)
|
|
4251
|
+
self._attach_working_set(recent_reads, room, target) # ... except the ones that come back now (1.10.0)
|
|
4152
4252
|
self.rules.reset()
|
|
4153
4253
|
self.checkpoints.forget_positions() # message indices are stale after a summary
|
|
4154
4254
|
self._persist_compaction()
|
|
@@ -4167,6 +4267,116 @@ class Agent:
|
|
|
4167
4267
|
self.ui.dim(f"Compacted: {before} -> {after} tokens (estimated).")
|
|
4168
4268
|
return True
|
|
4169
4269
|
|
|
4270
|
+
def _recent_reads(self, within: int = WORKING_SET_RECENT_STEPS) -> Dict[str, Tuple[Path, int, int, int]]:
|
|
4271
|
+
"""Files whose text the model saw in the last `within` steps: key -> (path, offset, limit, step)."""
|
|
4272
|
+
out: Dict[str, Tuple[Path, int, int, int]] = {}
|
|
4273
|
+
floor = self.steps - within
|
|
4274
|
+
for key, rec in list(self.ctx.tracker.files.items()):
|
|
4275
|
+
for r in rec.ranges:
|
|
4276
|
+
t = max(r.turn, getattr(r, "seen", 0) or 0)
|
|
4277
|
+
if t >= floor and (key not in out or t > out[key][3]):
|
|
4278
|
+
out[key] = (Path(key), r.offset, r.limit, t)
|
|
4279
|
+
return out
|
|
4280
|
+
|
|
4281
|
+
def _working_set(self, reads: Dict[str, Tuple[Path, int, int, int]], budget_chars: int
|
|
4282
|
+
) -> Tuple[str, List[Tuple[Path, Tuple[int, int], int]]]:
|
|
4283
|
+
"""The current text of the files this request was working on (edited or read in the last steps), most
|
|
4284
|
+
recent first, within `budget_chars`: small files whole, a longer one as the part read last. Returns the
|
|
4285
|
+
block for the post-summary message and the (path, range, chars) to mark as read."""
|
|
4286
|
+
from euron_code.tools.fs import TO_END, load_text
|
|
4287
|
+
floor = self.steps - WORKING_SET_RECENT_STEPS
|
|
4288
|
+
cands: List[Tuple[int, Path, Optional[Tuple[int, int]]]] = []
|
|
4289
|
+
for st, rel in self._real_edits():
|
|
4290
|
+
if st >= floor:
|
|
4291
|
+
p = Path(rel) if os.path.isabs(rel) else self.root / rel
|
|
4292
|
+
cands.append((st + 1000, p, None)) # edited files first: they are what the next step changes
|
|
4293
|
+
for _key, (p, off, lim, turn) in reads.items():
|
|
4294
|
+
cands.append((turn, p, (off, lim)))
|
|
4295
|
+
cands.sort(key=lambda c: -c[0])
|
|
4296
|
+
seen: set = set()
|
|
4297
|
+
parts: List[str] = []
|
|
4298
|
+
marks: List[Tuple[Path, Tuple[int, int], int]] = []
|
|
4299
|
+
used = 0
|
|
4300
|
+
for _rank, p, rng in cands:
|
|
4301
|
+
if len(marks) >= WORKING_SET_FILES:
|
|
4302
|
+
break
|
|
4303
|
+
try:
|
|
4304
|
+
key = self.ctx.tracker._key(p)
|
|
4305
|
+
if key in seen or not p.is_file() or p.stat().st_size > 400_000:
|
|
4306
|
+
continue
|
|
4307
|
+
seen.add(key)
|
|
4308
|
+
if rng is None: # an edited file: its last-read part if it was read, else the whole (small) file
|
|
4309
|
+
r = reads.get(key)
|
|
4310
|
+
rng = (r[1], r[2]) if r else (1, TO_END)
|
|
4311
|
+
lines = load_text(p).text.replace("\r\n", "\n").split("\n")
|
|
4312
|
+
except (OSError, ToolError, ValueError):
|
|
4313
|
+
continue
|
|
4314
|
+
if lines and lines[-1] == "":
|
|
4315
|
+
lines.pop()
|
|
4316
|
+
n = len(lines)
|
|
4317
|
+
if not n:
|
|
4318
|
+
continue
|
|
4319
|
+
if n <= WORKING_SET_WHOLE_LINES:
|
|
4320
|
+
a, b = 1, n
|
|
4321
|
+
else:
|
|
4322
|
+
a = max(1, min(rng[0], n))
|
|
4323
|
+
b = min(n, a + min(rng[1], WORKING_SET_PART_LINES) - 1)
|
|
4324
|
+
rows = [f"{i:>6}\t{ln[:400]}" for i, ln in enumerate(lines[a - 1:b], start=a)]
|
|
4325
|
+
room_left = budget_chars - used - 120
|
|
4326
|
+
size = sum(len(r) + 1 for r in rows)
|
|
4327
|
+
while rows and size > room_left: # too long for what is left: keep the first lines that fit
|
|
4328
|
+
size -= len(rows.pop()) + 1
|
|
4329
|
+
if len(rows) < min(30, b - a + 1):
|
|
4330
|
+
continue # too little of it would fit; a smaller file further down may still fit
|
|
4331
|
+
b = a + len(rows) - 1
|
|
4332
|
+
head = (f"--- {self.ctx.rel(p)} " + ("(whole file" if (a, b) == (1, n) else f"(lines {a}-{b} of {n}")
|
|
4333
|
+
+ ", current text) ---")
|
|
4334
|
+
text = head + "\n" + "\n".join(rows)
|
|
4335
|
+
parts.append(text)
|
|
4336
|
+
used += len(text)
|
|
4337
|
+
marks.append((p, (a, TO_END if b >= n else b - a + 1), len(text)))
|
|
4338
|
+
if not parts:
|
|
4339
|
+
return "", []
|
|
4340
|
+
block = ("\n\n[Current text of the files you were working on: these count as read, so edit them from this "
|
|
4341
|
+
"text without reading them again (line numbers are not part of the files). Read any other file "
|
|
4342
|
+
"again before you change it.]\n" + "\n\n".join(parts))
|
|
4343
|
+
return block, marks
|
|
4344
|
+
|
|
4345
|
+
def _attach_working_set(self, reads: Dict[str, Tuple[Path, int, int, int]], room: int, target: int) -> None:
|
|
4346
|
+
"""After a summary: put the working set into the summary message (1.10.0), within the post-summary target
|
|
4347
|
+
so the next step is not summarised again at once."""
|
|
4348
|
+
if self.settings.get("summaryWorkingSet", True) is False or len(self.messages) < 2:
|
|
4349
|
+
return
|
|
4350
|
+
try:
|
|
4351
|
+
budget_tok = min(int(WORKING_SET_SHARE * room), target - self.context_usage() - 300)
|
|
4352
|
+
if budget_tok < 400:
|
|
4353
|
+
return
|
|
4354
|
+
block, marks = self._working_set(reads, int(budget_tok * context.CHARS_PER_TOKEN))
|
|
4355
|
+
if not block:
|
|
4356
|
+
return
|
|
4357
|
+
m = dict(self.messages[1])
|
|
4358
|
+
c = m.get("content")
|
|
4359
|
+
if isinstance(c, list):
|
|
4360
|
+
items = [dict(x) for x in c]
|
|
4361
|
+
for x in items:
|
|
4362
|
+
if x.get("type") == "text":
|
|
4363
|
+
x["text"] = str(x.get("text") or "") + block
|
|
4364
|
+
break
|
|
4365
|
+
else:
|
|
4366
|
+
items.insert(0, {"type": "text", "text": block})
|
|
4367
|
+
m["content"] = items
|
|
4368
|
+
else:
|
|
4369
|
+
m["content"] = str(c or "") + block
|
|
4370
|
+
self.messages[1] = m
|
|
4371
|
+
for p, rng, chars in marks:
|
|
4372
|
+
try:
|
|
4373
|
+
self.ctx.tracker.mark_read(p, rng, self.steps, chars, None)
|
|
4374
|
+
except OSError:
|
|
4375
|
+
pass
|
|
4376
|
+
self._working_set_files = [self.ctx.rel(p) for p, _, _ in marks]
|
|
4377
|
+
except Exception: # never let a convenience break a summary
|
|
4378
|
+
return
|
|
4379
|
+
|
|
4170
4380
|
def _seen_paths(self, limit: int = 40) -> List[str]:
|
|
4171
4381
|
out: List[str] = []
|
|
4172
4382
|
for key in reversed(self.ctx.tracker.known_paths()):
|
|
@@ -611,8 +611,25 @@ class Client:
|
|
|
611
611
|
body: Dict[str, Any] = {"query": query, "maxResults": max_results}
|
|
612
612
|
if domains:
|
|
613
613
|
body["domains"] = domains
|
|
614
|
-
|
|
615
|
-
|
|
614
|
+
return self._json("POST", "/v1/research", json=body, headers=self._service_headers(), timeout=60.0)
|
|
615
|
+
|
|
616
|
+
def _service_headers(self) -> Dict[str, str]:
|
|
617
|
+
"""The client / session / task headers of a side service call (research, citation audit); auth is added
|
|
618
|
+
by _request."""
|
|
619
|
+
return {k: v for k, v in self._chat_headers().items() if k.startswith("X-Euron-") and k != "X-Euron-Takeover"}
|
|
620
|
+
|
|
621
|
+
def citations_audit_start(self, file_name: str, data: bytes, claims: bool = True) -> Dict[str, Any]:
|
|
622
|
+
"""POST /v1/citations/audit (1.9.4): start (or find, for the same file) a server-side audit of a
|
|
623
|
+
manuscript's references. Answers 202 (or 200 for an existing job) {jobId, status, stage, ...}."""
|
|
624
|
+
import base64
|
|
625
|
+
body = {"fileName": file_name, "fileBase64": base64.b64encode(data).decode("ascii"), "claims": bool(claims)}
|
|
626
|
+
return self._json("POST", "/v1/citations/audit", json=body, headers=self._service_headers(), timeout=120.0)
|
|
627
|
+
|
|
628
|
+
def citations_audit_status(self, job_id: str) -> Dict[str, Any]:
|
|
629
|
+
"""GET /v1/citations/audit/<jobId>: the job's stage, and when done its results and exports."""
|
|
630
|
+
from urllib.parse import quote
|
|
631
|
+
return self._json("GET", "/v1/citations/audit/" + quote(str(job_id), safe=""),
|
|
632
|
+
headers=self._service_headers(), timeout=60.0)
|
|
616
633
|
|
|
617
634
|
# ------------------------------------------------------------ open source (V5 section 1)
|
|
618
635
|
def oss_search(self, query: str, kind: str = "repos", language: Optional[str] = None,
|