nanoPyCodeAgent 0.5.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. nanopycodeagent-0.6.0/.github/workflows/ci.yml +41 -0
  2. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/PKG-INFO +2 -2
  3. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/changelogs/0.5.x.md +9 -0
  4. nanopycodeagent-0.6.0/docs/changelogs/0.6.x.md +37 -0
  5. nanopycodeagent-0.6.0/docs/dev_notes/en/0.6.x.md +48 -0
  6. nanopycodeagent-0.6.0/docs/dev_notes/zh-CN/0.6.x.md +46 -0
  7. nanopycodeagent-0.6.0/docs/research/write_tool.md +606 -0
  8. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/src/nanopycodeagent/agent.py +48 -15
  9. nanopycodeagent-0.6.0/src/nanopycodeagent/terminal.py +96 -0
  10. nanopycodeagent-0.6.0/src/nanopycodeagent/write_tool.py +153 -0
  11. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/tests/helpers.py +12 -0
  12. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/tests/test_agent.py +56 -0
  13. nanopycodeagent-0.6.0/tests/test_line_editing.py +169 -0
  14. nanopycodeagent-0.6.0/tests/test_terminal.py +86 -0
  15. nanopycodeagent-0.6.0/tests/test_write_tool.py +169 -0
  16. nanopycodeagent-0.5.0/src/nanopycodeagent/terminal.py +0 -29
  17. nanopycodeagent-0.5.0/tests/test_terminal.py +0 -39
  18. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.agents/skills/land-pr/SKILL.md +0 -0
  19. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.agents/skills/release/SKILL.md +0 -0
  20. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.agents/skills/release/scripts/verify-release.sh +0 -0
  21. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.github/workflows/release.yml +0 -0
  22. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.gitignore +0 -0
  23. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.ignore +0 -0
  24. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.python-version +0 -0
  25. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/.zed/debug.json +0 -0
  26. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/AGENTS.md +0 -0
  27. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/CLAUDE.md +0 -0
  28. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/LICENSE +0 -0
  29. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/README.md +0 -0
  30. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/README.zh-CN.md +0 -0
  31. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/RELEASING.md +0 -0
  32. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/changelogs/0.1.x.md +0 -0
  33. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/changelogs/0.2.x.md +0 -0
  34. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/changelogs/0.3.x.md +0 -0
  35. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/changelogs/0.4.x.md +0 -0
  36. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/changelogs/README.md +0 -0
  37. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/README.md +0 -0
  38. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/en/0.1.x.md +0 -0
  39. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/en/0.2.x.md +0 -0
  40. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/en/0.3.x.md +0 -0
  41. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/en/0.4.x.md +0 -0
  42. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/en/0.5.x.md +0 -0
  43. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/zh-CN/0.1.x.md +0 -0
  44. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/zh-CN/0.2.x.md +0 -0
  45. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/zh-CN/0.3.x.md +0 -0
  46. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/zh-CN/0.4.x.md +0 -0
  47. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/dev_notes/zh-CN/0.5.x.md +0 -0
  48. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/research/README.md +0 -0
  49. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/research/agent_tools.md +0 -0
  50. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/research/read_tool.md +0 -0
  51. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/superpowers/plans/2026-06-21-release-skills.md +0 -0
  52. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/superpowers/specs/2026-06-21-release-skill-design.md +0 -0
  53. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/docs/superpowers/specs/2026-06-29-config-file-support-design.md +0 -0
  54. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/pyproject.toml +0 -0
  55. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/src/nanopycodeagent/__init__.py +0 -0
  56. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/src/nanopycodeagent/bash_tool.py +0 -0
  57. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/src/nanopycodeagent/read_tool.py +0 -0
  58. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/src/nanopycodeagent/settings.py +0 -0
  59. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/tests/conftest.py +0 -0
  60. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/tests/test_bash_tool.py +0 -0
  61. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/tests/test_read_tool.py +0 -0
  62. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/tests/test_settings.py +0 -0
  63. {nanopycodeagent-0.5.0 → nanopycodeagent-0.6.0}/uv.lock +0 -0
@@ -0,0 +1,41 @@
1
+ name: CI
2
+
3
+ # Run the test suite on every pull request, and again on main once a change
4
+ # has landed. Read-only: this workflow never publishes anything, so it holds
5
+ # no write scopes of any kind.
6
+ on:
7
+ pull_request:
8
+ push:
9
+ branches:
10
+ - main
11
+
12
+ # A new push to a branch supersedes the run still in flight for it.
13
+ concurrency:
14
+ group: ci-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ test:
22
+ name: pytest (Python ${{ matrix.python-version }})
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ fail-fast: false # one version failing should not hide the other's result
26
+ matrix:
27
+ # The lowest version the project supports, and the newest it can run
28
+ # on, so a break in either direction shows up here.
29
+ python-version: ["3.13", "3.14"]
30
+ steps:
31
+ - uses: actions/checkout@v6
32
+ with:
33
+ fetch-depth: 0 # full history + tags so hatch-vcs can derive the version
34
+ - name: Install uv
35
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
36
+ with:
37
+ python-version: ${{ matrix.python-version }}
38
+ - name: Run tests
39
+ # --frozen installs exactly what uv.lock pins and fails if the lock has
40
+ # drifted from pyproject.toml, so CI tests the declared dependencies.
41
+ run: uv run --frozen pytest
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: nanoPyCodeAgent
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: A nano code agent built from scratch in pure Python.
5
5
  Project-URL: Homepage, https://github.com/minixalpha/nanoPyCodeAgent
6
6
  Project-URL: Repository, https://github.com/minixalpha/nanoPyCodeAgent
@@ -4,6 +4,15 @@ All notable changes in the **0.5.x** release series are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.5.1] - 2026-07-30
8
+
9
+ ### Fixed
10
+ - Backspacing a double-width character (CJK, emoji) at the `You>` prompt no
11
+ longer leaves half of its glyph on screen. The prompt now goes through
12
+ `readline`, which redraws the line, instead of letting the terminal erase
13
+ one column per backspace for a character that occupies two. Arrow-key
14
+ editing and in-session history come with it.
15
+
7
16
  ## [0.5.0] - 2026-07-29
8
17
 
9
18
  ### Added
@@ -0,0 +1,37 @@
1
+ # Changelog — 0.6.x
2
+
3
+ All notable changes in the **0.6.x** release series are documented here.
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [0.6.0] - 2026-08-13
8
+
9
+ ### Added
10
+ - A `write` tool creates a file or replaces its entire content from a
11
+ structured `{path, content}` call. Content lands on disk as data instead
12
+ of passing through shell quoting and heredocs, which could silently
13
+ corrupt it; missing parent directories are created, directories and
14
+ non-regular files (FIFOs, device files) are refused as targets, and the
15
+ result states whether the file was created or overwritten. The terminal
16
+ echoes the target path with the content folded to its first lines.
17
+ - A spinner animates while waiting for the model's reply or a running bash
18
+ command, so long waits no longer look like a frozen terminal. It draws
19
+ only when stdout is a terminal (and `NO_COLOR` is unset) and erases
20
+ itself once output arrives, leaving no trace in the transcript.
21
+
22
+ ### Changed
23
+ - Echoed tool calls (`[bash]$ ...`, `[read] ...`) now sit on a lighter
24
+ background shade than their output, so the command and what it printed
25
+ read apart at a glance.
26
+
27
+ <!--
28
+ When cutting a release, copy the relevant items from [Unreleased] into a new
29
+ version section above it, e.g.:
30
+
31
+ ## [0.6.0] - YYYY-MM-DD
32
+
33
+ ### Added
34
+ ### Changed
35
+ ### Fixed
36
+ ### Removed
37
+ -->
@@ -0,0 +1,48 @@
1
+ # Development Notes — 0.6.x
2
+
3
+ > Generated from the Chinese source [`../zh-CN/0.6.x.md`](../zh-CN/0.6.x.md). Do not edit by hand.
4
+
5
+ ## 0.6.0 - 2026.08.13
6
+
7
+ ### Tool output polish
8
+
9
+ Before continuing with the write tool, let's first add some improvements to how the agent presents its output: tool use and tool output now get separate background colors, so it is easier to tell at a glance which part is the tool use and which is the tool use result. Down the road we may want to emit something like an execution trace into a jsonl file; for now this will do.
10
+
11
+ I also tried the animated ASCII indicator pi shows while waiting for the agent's reply: `⠋ Working`. To my surprise, the animated characters turn out to be a few Braille glyphs displayed in rotation — and they are fairly easy to implement, so let's just build it.
12
+
13
+ ### The write tool
14
+
15
+ This version implements the write tool. Today the agent writes files like this:
16
+
17
+ ````text
18
+ You> write a python version hello world to hello.py
19
+
20
+ Agent>
21
+ [bash]$ cat > hello.py << 'EOF'
22
+ print("Hello, World!")
23
+ EOF
24
+ cat hello.py
25
+ python3 hello.py
26
+ print("Hello, World!")
27
+ Hello, World!
28
+
29
+ Agent> I created `hello.py` with the following content:
30
+
31
+ ```python
32
+ print("Hello, World!")
33
+ ```
34
+
35
+ Running it outputs: `Hello, World!`
36
+ ````
37
+
38
+ Based on the revised conclusion of the [write tool research](../../research/write_tool.md), the write tool should implement:
39
+
40
+ - Structured `{path, content}` input: the content lands on disk as data, never passing through shell expansion, heredoc delimiters, or quote escaping — eliminating the whole class of failures where a heredoc silently corrupts a file;
41
+ - Create the file when it does not exist, overwrite it whole when it does, and state which of the two happened in the result;
42
+ - Path handling identical to read's: absolute or relative to the working directory, with a leading `~` expanded;
43
+ - Automatically create missing parent directories;
44
+ - Refuse directories and non-regular files (FIFOs, device files) as write targets — opening a FIFO for writing blocks without a timeout and hangs the session, and a device file could be written by mistake; read already performs the same check on its targets, and write follows the same approach;
45
+ - Write the content exactly as given, as UTF-8 text, with no newline or whitespace normalization;
46
+ - Error messages state what to do next, in read's style;
47
+ - The terminal echoes the target path and a content preview folded to the first few lines, consistent with the tool output shading presentation;
48
+ - The tool description limits its purpose to new files and whole-file rewrites (appending and bulk transforms still go through bash) and claims no safety whatsoever: no prior-Read check, no mtime/revision staleness guard, no atomic replace — the semantics are last-writer-wins.
@@ -0,0 +1,46 @@
1
+ # 开发笔记 — 0.6.x
2
+
3
+ > 本文件为**手写中文源文件**(source of truth);英文版 [`../en/0.6.x.md`](../en/0.6.x.md) 由其生成。
4
+
5
+ ## 0.6.0 - 2026.08.13
6
+ ### 工具输出优化
7
+ 继续开发 write tool 之前,先加一些 Agent 输出方式相关的优化,tool use 和 tool output 背景颜色分开,更容易看出哪里是 tool use ,哪里是 tool use result。后续可能需要输出类似执行轨迹的东西,放 jsonl 里,目前暂时先这样处理。
8
+
9
+ 另外,尝试了一下 pi 里等待 Agent 回复时的 ascii 动态字符: `⠋ Working`,没想到动态字符居然是几个交替显示的盲文,实现起来也比较容易,就先实现吧。
10
+
11
+ ### write 工具
12
+
13
+ 这一版本实现 write 相关工具,当前这个 agent 对文件的写入方式是这样:
14
+
15
+ ````text
16
+ You> write a python version hello world to hello.py
17
+
18
+ Agent>
19
+ [bash]$ cat > hello.py << 'EOF'
20
+ print("Hello, World!")
21
+ EOF
22
+ cat hello.py
23
+ python3 hello.py
24
+ print("Hello, World!")
25
+ Hello, World!
26
+
27
+ Agent> I created `hello.py` with the following content:
28
+
29
+ ```python
30
+ print("Hello, World!")
31
+ ```
32
+
33
+ Running it outputs: `Hello, World!`
34
+ ````
35
+
36
+ 基于 [write 工具调研](../../research/write_tool.md)修正后的结论,write 工具要实现的功能:
37
+
38
+ - 结构化 `{path, content}` 入参:内容作为数据直接落盘,不经过 shell 展开、heredoc delimiter 和引号转义,消除 heredoc 静默写坏文件这一整类失败;
39
+ - 文件不存在则创建,存在则整文件覆盖,并在结果中说明是哪一种;
40
+ - 路径处理与 read 一致:绝对路径或相对工作目录,展开开头的 `~`;
41
+ - 自动创建缺失的父目录;
42
+ - 拒绝目录和非常规文件(FIFO、设备文件)作为写入目标——对 FIFO 的写打开会无超时阻塞挂死会话,设备文件则可能被误写;read 对读取目标已有同样的检查,write 沿用同一做法;
43
+ - 内容按给定原样写入,UTF-8 文本,不做换行或空白归一化;
44
+ - 错误信息按 read 的风格指出下一步该怎么做;
45
+ - 终端回显目标路径和折叠到前几行的内容预览,与 tool output shading 的展示风格一致;
46
+ - 工具描述限定用途为新建文件和整文件重写(追加、批量变换仍走 bash),并且不宣称任何安全性:没有先 Read 检查、没有 mtime/revision 防陈旧、没有原子替换——语义就是 last-writer-wins。