1bcoder 0.1.9__tar.gz → 0.1.11__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 (101) hide show
  1. {1bcoder-0.1.9 → 1bcoder-0.1.11/1bcoder.egg-info}/PKG-INFO +61 -7
  2. 1bcoder-0.1.9/README.md → 1bcoder-0.1.11/PKG-INFO +1828 -1759
  3. 1bcoder-0.1.9/1bcoder.egg-info/PKG-INFO → 1bcoder-0.1.11/README.md +1813 -1774
  4. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/advance.txt +3 -2
  5. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/doc/PARAM.md +2 -0
  6. {1bcoder-0.1.9 → 1bcoder-0.1.11}/chat.py +238 -45
  7. {1bcoder-0.1.9 → 1bcoder-0.1.11}/map_index.py +7 -4
  8. {1bcoder-0.1.9 → 1bcoder-0.1.11}/map_query.py +85 -8
  9. {1bcoder-0.1.9 → 1bcoder-0.1.11}/pyproject.toml +1 -1
  10. {1bcoder-0.1.9 → 1bcoder-0.1.11}/1bcoder.egg-info/SOURCES.txt +0 -0
  11. {1bcoder-0.1.9 → 1bcoder-0.1.11}/1bcoder.egg-info/dependency_links.txt +0 -0
  12. {1bcoder-0.1.9 → 1bcoder-0.1.11}/1bcoder.egg-info/entry_points.txt +0 -0
  13. {1bcoder-0.1.9 → 1bcoder-0.1.11}/1bcoder.egg-info/requires.txt +0 -0
  14. {1bcoder-0.1.9 → 1bcoder-0.1.11}/1bcoder.egg-info/top_level.txt +0 -0
  15. {1bcoder-0.1.9 → 1bcoder-0.1.11}/LICENSE +0 -0
  16. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/__init__.py +0 -0
  17. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/ask.txt +0 -0
  18. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/compact.txt +0 -0
  19. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/concepts.txt +0 -0
  20. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/fill.txt +0 -0
  21. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/planning.txt +0 -0
  22. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/scan.txt +0 -0
  23. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/sqlite.txt +0 -0
  24. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/agents/websearch.txt +0 -0
  25. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/aliases.txt +0 -0
  26. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/doc/FLOWS.md +0 -0
  27. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/doc/MCP.md +0 -0
  28. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/doc/OLLAMA_SERVER_PARAM.md +0 -0
  29. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/doc/PROC.md +0 -0
  30. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/doc/TRANSLATE.md +0 -0
  31. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/flows/__pycache__/commit_message.cpython-311.pyc +0 -0
  32. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/flows/commit_message.py +0 -0
  33. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/flows/grounding.py +0 -0
  34. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/flows/py_error_trace.py +0 -0
  35. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/flows/simargl_files.py +0 -0
  36. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/flows/webask.py +0 -0
  37. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/map.txt +0 -0
  38. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/action-required.py +0 -0
  39. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/add-save.py +0 -0
  40. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/assist.py +0 -0
  41. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/collect-files.py +0 -0
  42. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/ctx_cut.py +0 -0
  43. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/extract-code.py +0 -0
  44. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/extract-files.py +0 -0
  45. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/extract-list.py +0 -0
  46. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/grounding-check.py +0 -0
  47. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/md.py +0 -0
  48. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/mdx.py +0 -0
  49. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/pattern-gate.py +0 -0
  50. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/regexp-extract.py +0 -0
  51. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/rude_words.py +0 -0
  52. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/scan-save.py +0 -0
  53. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/secret_check.py +0 -0
  54. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/sql_readonly_guard.py +0 -0
  55. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/proc/tempctx-cut.py +0 -0
  56. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/profiles.txt +0 -0
  57. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/prompts/analysis.txt +0 -0
  58. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/prompts/sumarise.txt +0 -0
  59. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/prompts.txt +0 -0
  60. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/AddFunction.txt +0 -0
  61. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/AskProject.txt +0 -0
  62. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/CheckRequirements.txt +0 -0
  63. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/DockerMySQL.txt +0 -0
  64. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/DockerNginx.txt +0 -0
  65. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/DockerPython.txt +0 -0
  66. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/DockerStack.txt +0 -0
  67. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/DuckDuckGoInstant.txt +0 -0
  68. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/EnvTemplate.txt +0 -0
  69. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/Explain.txt +0 -0
  70. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/ExploreProjectStructure.txt +0 -0
  71. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/GitIgnorePython.txt +0 -0
  72. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/MySQLDump.txt +0 -0
  73. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/NewScript.txt +0 -0
  74. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/PipFreeze.txt +0 -0
  75. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/PyPI.txt +0 -0
  76. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/Refactor.txt +0 -0
  77. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/RunAndFix.txt +0 -0
  78. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/SQLiteSchema.txt +0 -0
  79. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/Translate.txt +0 -0
  80. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/WikiPage.txt +0 -0
  81. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/WikiSearch.txt +0 -0
  82. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/auto-bkup.txt +0 -0
  83. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/edit-control.txt +0 -0
  84. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/parallel_call.txt +0 -0
  85. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/personal/content/create-regular-content.txt +0 -0
  86. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/personal/content/plan.txt +0 -0
  87. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/personal/test/collect-data-from-test-environment.txt +0 -0
  88. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/plan.txt +0 -0
  89. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/remote/create-content-on-remote-server.txt +0 -0
  90. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/set_ctx.txt +0 -0
  91. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/simargl-cli_index_files.txt +0 -0
  92. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/simargl-cli_index_units.txt +0 -0
  93. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/simargl-cli_search.txt +0 -0
  94. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/team-map-worker.txt +0 -0
  95. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/team-search-worker.txt +0 -0
  96. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/team-summarize.txt +0 -0
  97. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/team-tree-worker.txt +0 -0
  98. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/scripts/test.txt +0 -0
  99. {1bcoder-0.1.9 → 1bcoder-0.1.11}/_bcoder_data/teams/code-analysis.yaml +0 -0
  100. {1bcoder-0.1.9 → 1bcoder-0.1.11}/setup.cfg +0 -0
  101. {1bcoder-0.1.9 → 1bcoder-0.1.11}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 1bcoder
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: AI coding assistant agent for 1B–7B local models (Ollama, LMStudio, llama.cpp). Terminal REPL with file editing, project map, agents, scripts, and parallel multi-model queries.
5
5
  Project-URL: Homepage, https://github.com/szholobetsky/1bcoder
6
6
  Project-URL: Repository, https://github.com/szholobetsky/1bcoder
@@ -13,6 +13,8 @@ Requires-Dist: tqdm>=4.64
13
13
  Requires-Dist: rich>=13.0
14
14
  Dynamic: license-file
15
15
 
16
+ ![1bcoder](images/1bcoder.png)
17
+
16
18
  # 1bcoder
17
19
 
18
20
  AI coding assistant for small local models (0.5B–4B) — runs via [Ollama](https://ollama.com), [LMStudio](https://lmstudio.ai), or any OpenAI-compatible backend.
@@ -59,7 +61,7 @@ Key design decisions:
59
61
  - **Short agent system prompts, at most 5 tools per agent, one function per agent** — `ask`, `edit`, `fill`, `scan`, `compact`. Not universal agents with bloated skill sets.
60
62
  - **Tolerant of long and malformed output** — post-processing is automatic; the programmer does not teach the model JSON syntax.
61
63
  - **`/parallel`** — send the same context to several models simultaneously and combine results; a 0.5b and a 1b model working together often outperform either alone; designed to coordinate small models running on multiple machines or phones.
62
- - **`/map`** — project structure index with structural diff; lets the model navigate a codebase without loading it into context.
64
+ - **`/map`** — project structure index with structural diff and keyword grounding; lets the model navigate a codebase without loading it into context. Keyword extract supports three modes: exact, like (`%token%`), and fuzzy (subword); `-o` resolves each keyword to the files it appears in.
63
65
  - **`/ctx`** — surgical context management: savepoints, selective compaction, named context library, multi-turn rollback. Small models cannot afford wasted tokens.
64
66
  - **`/scan`** — reads any large file chunk by chunk and builds a themed summary without overflowing context.
65
67
  - **`/proc`** — parameterized command scripts for repeatable preparation workflows.
@@ -128,7 +130,7 @@ Tasks that require the model to decide *what to look at* — refactoring across
128
130
  - **Command autocorrection** — typos in command names, file paths, and keywords are detected and fixed automatically before execution, for both human input and agent actions
129
131
  - **`/tree [path]`** — display directory tree of the whole project or any subtree; ask to inject into context (or pass `ctx` to skip the prompt)
130
132
  - **`/find <pattern>`** — search filenames and file content with regex; supports `-f`/`-c`/`-i`/`--ext` flags; highlights matches, asks to inject results into context; sets `{{find_files}}` after every search; **`/find <terms> -r`** ranked BM25 mode returns top-10 files by relevance; hidden directories (`.git`, `.venv`, etc.) excluded automatically
131
- - AI proposes a **one-line fix** (`/fix`) or a **SEARCH/REPLACE patch** (`/patch`) — always shows a diff before applying
133
+ - AI proposes a **one-line fix** (`/fix`), a **SEARCH/REPLACE patch** (`/patch`), or a **FIM-based fix** (`/fim`) — always shows a unified diff before applying
132
134
  - **Apply AI code blocks directly** with `/edit <file> code` (new/full file) or `/patch <file> code` (SEARCH/REPLACE from reply, no line numbers needed) — preferred for agent mode
133
135
  - **`<think>` tag support** — reasoning blocks shown in terminal by default; `/think hide` suppresses terminal display; `/think include` keeps reasoning in context for chained turns
134
136
  - Run shell commands and inject their output with `/run`
@@ -453,10 +455,12 @@ Then configure `/translate` to use it:
453
455
  | Command | Description |
454
456
  |---|---|
455
457
  | `/fix <file> [start-end] [hint]` | AI proposes one-line fix, shows diff, asks to apply |
458
+ | `/fim <file> <line or start-end> [-w N] [hint]` | FIM-based fix — model rewrites the marked section, shows unified diff |
456
459
  | `/patch <file> [start-end] [hint]` | AI proposes SEARCH/REPLACE block, shows unified diff |
457
460
  | `/patch <file> code` | Apply SEARCH/REPLACE block from last AI reply (no new LLM call) |
458
461
 
459
- `/fix` is designed for 1B modelsoutput is strictly constrained to `LINE N: content`.
462
+ `/fix` asks the model to output `LINE N: content` simple but small models often lose indentation.
463
+ `/fim` (Fill-In-the-Middle) marks the target line(s) with `<<<...>>>` inside the full file, asks the model to return the corrected file, then diffs the result — no output format to learn, grammar constraints come from the surrounding code. Use `-w N` to limit context to N lines around the target when the file is larger than the context window.
460
464
  `/patch` works better with larger models (7B+) and can replace multiple consecutive lines.
461
465
  `/patch <file> code` is the preferred agent mode edit — the agent writes the SEARCH/REPLACE block in its reply, then calls `/patch <file> code` to apply it without needing line numbers.
462
466
 
@@ -465,6 +469,9 @@ When `/patch` fails to find the SEARCH text it shows a diagnostic diff — the S
465
469
  ```
466
470
  /fix main.py
467
471
  /fix main.py 2-2 wrong operator
472
+ /fim main.py 3 replace != with ==
473
+ /fim main.py 3-5 fix the logic
474
+ /fim huge_file.py 14567 -w 20 fix indentation
468
475
  /patch main.py 10-40 fix the loop logic
469
476
  /patch main.py code
470
477
  ```
@@ -538,8 +545,8 @@ The map command scans your project with language-agnostic regex, extracts defini
538
545
  /map trace <start> <end> [-y] — shortest dependency path between two points
539
546
  /map idiff [path] [depth] — re-index then show diff vs previous snapshot
540
547
  /map diff — show diff without re-indexing (safe to repeat)
541
- /map keyword index — build keyword vocabulary from map.txt
542
- /map keyword extract <text> [-f] [-a] [-n] [-c] — extract real identifiers from keyword.txt matching text/file
548
+ /map keyword index — build keyword vocabulary from map.txt
549
+ /map keyword extract <text> [-f] [-l] [-a] [-s] [-n] [-c] [-o] — extract real identifiers from keyword.txt matching text/file
543
550
  ```
544
551
 
545
552
  **Partial / incremental indexing** — for large codebases where a full re-scan is slow:
@@ -583,6 +590,33 @@ This lets you re-index a changed module in seconds instead of hours.
583
590
  /map find models -d 2 — filenames + defines/vars only
584
591
  ```
585
592
 
593
+ **`/map keyword`** — two-step identifier grounding:
594
+
595
+ ```
596
+ /map keyword index — scan map.txt → .1bcoder/keyword.txt (word, count, line refs)
597
+ /map keyword extract "fix rule search" -l -o — find identifiers, show which files they're in
598
+ ```
599
+
600
+ Extract flags:
601
+
602
+ | Flag | Mode | Effect |
603
+ |---|---|---|
604
+ | *(none)* | exact | query word must exactly match a keyword |
605
+ | `-f` | fuzzy | splits camelCase/snake_case into subwords; matches if all query subwords (≥5 chars) appear in the identifier |
606
+ | `-l` | like | substring match: any keyword containing the token (`%token%`) |
607
+ | `-n` | — | show frequency count: `RuleIndex(25)` |
608
+ | `-s` | — | sort by frequency descending |
609
+ | `-a` | — | sort alphabetically |
610
+ | `-c` | — | comma-separated output (default: one per line) |
611
+ | `-o` | — | show origin files: `parameter_rule -> lib/cop/rule.rb, config/default.yml` |
612
+
613
+ ```
614
+ /map keyword extract "add validation rule" -l -o
615
+ # parameter_rule -> lib/rubocop/cop/style/rule.rb, config/default.yml
616
+ # cop_rule -> lib/rubocop/cop/base.rb
617
+ # load_rules -> lib/rubocop/config_loader.rb
618
+ ```
619
+
586
620
  **`/map trace`** — three modes:
587
621
 
588
622
  **1. Backwards BFS** (who depends on this?):
@@ -1712,7 +1746,7 @@ On Windows: hold `Shift` and drag with the left mouse button to select and copy
1712
1746
  ## Tips for 1B models
1713
1747
 
1714
1748
  - **Start small.** Use `/read file.py 10-25` instead of loading the whole file. Short context = better focus.
1715
- - **Use `/fix` not `/patch`.** The `LINE N: content` format is much more reliable at 1B scale than free-form generation.
1749
+ - **Try `/fim` for tricky fixes.** FIM-based editing activates the model's grammar knowledge through surrounding code context — more reliable than `/fix` for indentation and multi-line logic. Use `-w 20` for large files.
1716
1750
  - **Build a map first.** Run `/map index .` at the start of a session, then use `/map find` to load only the relevant parts into context.
1717
1751
  - **Use scripts.** Scripts make multi-step work reproducible — the model only needs to handle one step at a time.
1718
1752
  - **Capture workflows.** After solving a task manually, run `/script create ctx` to save the exact steps as a reusable script.
@@ -1769,6 +1803,26 @@ For human input, the corrected command is shown with `[fix?]` and you are asked
1769
1803
 
1770
1804
  ---
1771
1805
 
1806
+ ## Part of the SIMARGL toolkit
1807
+
1808
+ 1bcoder is one of four tools that together form an **intellectual development support system**:
1809
+
1810
+ | Tool | Role |
1811
+ |---|---|
1812
+ | **[simargl](https://github.com/szholobetsky/simargl)** | Task-to-code retrieval — given a task description, finds which files and modules are likely affected, using semantic similarity over git history |
1813
+ | **[svitovyd](https://github.com/szholobetsky/svitovyd)** | Project map — scans any codebase and produces a structural map of definitions and cross-file dependencies; exposes it as an MCP server |
1814
+ | **[1bcoder](https://github.com/szholobetsky/1bcoder)** | AI coding assistant for small local models — surgical context management, agents, parallel inference, proc scripts |
1815
+ | **[yasna](https://github.com/szholobetsky/yasna)** | Session memory — indexes conversations from all AI agents so you can find what was discussed, when, and where |
1816
+
1817
+ - **simargl** answers: *what code is related to this task?*
1818
+ - **svitovyd** answers: *how is the code structured and what depends on what?*
1819
+ - **1bcoder** answers: *how do I work with local models efficiently?*
1820
+ - **yasna** answers: *where did I already discuss this?*
1821
+
1822
+ Together they cover the full development loop: understand the codebase, find relevant history, work with AI locally, remember what was decided.
1823
+
1824
+ ---
1825
+
1772
1826
  **(c) 2026 Stanislav Zholobetskyi**
1773
1827
  Institute for Information Recording, National Academy of Sciences of Ukraine, Kyiv
1774
1828
  *PhD research: «Intelligent Technology for Software Development and Maintenance Support»*