ocwt 0.1.1__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.
@@ -0,0 +1,34 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "**"
7
+ pull_request:
8
+
9
+ jobs:
10
+ quality:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Set up uv
22
+ uses: astral-sh/setup-uv@v5
23
+
24
+ - name: Install dependencies
25
+ run: uv sync --group dev
26
+
27
+ - name: Ruff lint
28
+ run: uv run ruff check .
29
+
30
+ - name: Ty typecheck
31
+ run: uv run ty check
32
+
33
+ - name: Pytest
34
+ run: uv run pytest
@@ -0,0 +1,44 @@
1
+ name: Nightly Release Build
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ nightly:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.12"
22
+
23
+ - name: Set up uv
24
+ uses: astral-sh/setup-uv@v5
25
+
26
+ - name: Build distributions
27
+ run: uv build
28
+
29
+ - name: Compute nightly tag
30
+ id: nightly_tag
31
+ run: |
32
+ stamp="$(date -u +%Y%m%d)"
33
+ short_sha="${GITHUB_SHA::7}"
34
+ tag="nightly-${stamp}-${short_sha}"
35
+ echo "tag=${tag}" >> "${GITHUB_OUTPUT}"
36
+
37
+ - name: Create nightly GitHub release
38
+ uses: softprops/action-gh-release@v2
39
+ with:
40
+ tag_name: ${{ steps.nightly_tag.outputs.tag }}
41
+ name: Nightly ${{ steps.nightly_tag.outputs.tag }}
42
+ prerelease: true
43
+ generate_release_notes: true
44
+ files: dist/*
@@ -0,0 +1,97 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - published
7
+
8
+ permissions:
9
+ contents: write
10
+ id-token: write
11
+
12
+ jobs:
13
+ release:
14
+ runs-on: ubuntu-latest
15
+ environment: pypi
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+
27
+ - name: Set up uv
28
+ uses: astral-sh/setup-uv@v5
29
+
30
+ - name: Resolve version from tag
31
+ id: version
32
+ env:
33
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
34
+ run: |
35
+ python - <<'PY'
36
+ import os
37
+ import re
38
+ from pathlib import Path
39
+
40
+ tag = os.environ["RELEASE_TAG"].strip()
41
+ pyproject = Path("pyproject.toml")
42
+ init_file = Path("src/ocwt/__init__.py")
43
+
44
+ semver_match = re.fullmatch(r"v(\d+)\.(\d+)\.(\d+)", tag)
45
+ if not semver_match:
46
+ raise SystemExit(f"Unsupported release tag '{tag}'. Use semantic version tags only (vX.Y.Z).")
47
+
48
+ next_version = ".".join(semver_match.groups())
49
+
50
+ py_text = pyproject.read_text(encoding="utf-8")
51
+ py_text, py_count = re.subn(
52
+ r'(?m)^version = "[^"]+"$',
53
+ f'version = "{next_version}"',
54
+ py_text,
55
+ count=1,
56
+ )
57
+ if py_count != 1:
58
+ raise SystemExit("Failed to update project.version in pyproject.toml")
59
+ pyproject.write_text(py_text, encoding="utf-8")
60
+
61
+ init_text = init_file.read_text(encoding="utf-8")
62
+ init_text, init_count = re.subn(
63
+ r'(?m)^__version__ = "[^"]+"$',
64
+ f'__version__ = "{next_version}"',
65
+ init_text,
66
+ count=1,
67
+ )
68
+ if init_count != 1:
69
+ raise SystemExit("Failed to update __version__ in src/ocwt/__init__.py")
70
+ init_file.write_text(init_text, encoding="utf-8")
71
+
72
+ output = Path(os.environ["GITHUB_OUTPUT"])
73
+ with output.open("a", encoding="utf-8") as fh:
74
+ fh.write(f"version={next_version}\n")
75
+ print(f"Resolved release version: {next_version}")
76
+ PY
77
+
78
+ - name: Install dependencies
79
+ run: uv sync --group dev
80
+
81
+ - name: Run checks
82
+ run: |
83
+ uv run ruff check .
84
+ uv run ty check
85
+ uv run pytest
86
+
87
+ - name: Build distributions
88
+ run: uv build
89
+
90
+ - name: Upload assets to GitHub release
91
+ uses: softprops/action-gh-release@v2
92
+ with:
93
+ tag_name: ${{ github.event.release.tag_name }}
94
+ files: dist/*
95
+
96
+ - name: Publish to PyPI
97
+ uses: pypa/gh-action-pypi-publish@release/v1
ocwt-0.1.1/.gitignore ADDED
@@ -0,0 +1,213 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+ /.idea/inspectionProfiles/profiles_settings.xml
209
+ /.idea/.gitignore
210
+ /.idea/misc.xml
211
+ /.idea/modules.xml
212
+ /.idea/ocwt_main.iml
213
+ /.idea/vcs.xml
ocwt-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marco Müllner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ocwt-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: ocwt
3
+ Version: 0.1.1
4
+ Summary: OpenCode worktree helper
5
+ Author: Marco
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Marco Müllner
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ License-File: LICENSE
28
+ Requires-Python: >=3.12
29
+ Requires-Dist: typer<1.0.0,>=0.12.5
30
+ Description-Content-Type: text/markdown
31
+
32
+ # ocwt
33
+
34
+ ocwt spins up Git worktrees fast, plans with OpenCode, and then drops into build mode.
35
+
36
+ ## Development
37
+
38
+ Requirements:
39
+
40
+ - Python 3.12+
41
+ - [uv](https://docs.astral.sh/uv/)
42
+
43
+ Install dependencies:
44
+
45
+ ```bash
46
+ uv sync --group dev
47
+ ```
48
+
49
+ Run checks:
50
+
51
+ ```bash
52
+ uv run ruff format .
53
+ uv run ruff check .
54
+ uv run ty check
55
+ uv run pytest
56
+ ```
57
+
58
+ Run the CLI:
59
+
60
+ ```bash
61
+ uv run ocwt --help
62
+ uv run ocwt open "add config command" --plan
63
+ ```
64
+
65
+ Config:
66
+
67
+ ```bash
68
+ uv run ocwt config show
69
+ uv run ocwt config get editor
70
+ uv run ocwt config set editor zed
71
+ uv run ocwt config reset
72
+ ```
73
+
74
+ Completion:
75
+
76
+ ```bash
77
+ uv run ocwt completion bash
78
+ uv run ocwt completion zsh
79
+ ```
ocwt-0.1.1/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # ocwt
2
+
3
+ ocwt spins up Git worktrees fast, plans with OpenCode, and then drops into build mode.
4
+
5
+ ## Development
6
+
7
+ Requirements:
8
+
9
+ - Python 3.12+
10
+ - [uv](https://docs.astral.sh/uv/)
11
+
12
+ Install dependencies:
13
+
14
+ ```bash
15
+ uv sync --group dev
16
+ ```
17
+
18
+ Run checks:
19
+
20
+ ```bash
21
+ uv run ruff format .
22
+ uv run ruff check .
23
+ uv run ty check
24
+ uv run pytest
25
+ ```
26
+
27
+ Run the CLI:
28
+
29
+ ```bash
30
+ uv run ocwt --help
31
+ uv run ocwt open "add config command" --plan
32
+ ```
33
+
34
+ Config:
35
+
36
+ ```bash
37
+ uv run ocwt config show
38
+ uv run ocwt config get editor
39
+ uv run ocwt config set editor zed
40
+ uv run ocwt config reset
41
+ ```
42
+
43
+ Completion:
44
+
45
+ ```bash
46
+ uv run ocwt completion bash
47
+ uv run ocwt completion zsh
48
+ ```
@@ -0,0 +1,64 @@
1
+ # Revised Plan
2
+
3
+ - Rebuild `ocwt` as a Python package with a console executable, preserving current worktree behavior (`open`, `close`, completion, symlinks, branch generation, reuse existing worktrees).
4
+ - Replace file-based manual config editing with CLI-managed config commands only, backed by JSON at `~/.config/ocwt/config.json`.
5
+ - Add interactive one-shot planning mode that visibly streams progress, then drops into `opencode` in the same session using the `build` agent.
6
+ - Keep editor launch integrated and configurable via CLI (`ocwt config editor <executable>`), opening in the created/reused worktree directory.
7
+
8
+ ## CLI Surface
9
+
10
+ - `ocwt open [intent|branch] [@file ...] [--plan] [--agent build] [--editor <exe>|none]`
11
+ - `ocwt close [branch|worktree_path]`
12
+ - `ocwt completion [bash|zsh]`
13
+ - `ocwt config show`
14
+ - `ocwt config get <key>`
15
+ - `ocwt config set <key> <value>`
16
+ - Convenience setters:
17
+ - `ocwt config editor <executable|none>`
18
+ - `ocwt config agent <name>`
19
+ - `ocwt config prompt-file <path|default>`
20
+ - `ocwt config branch-prompt-file <path|default>`
21
+ - `ocwt config worktree-parent <name>`
22
+ - `ocwt config auto-plan <true|false>`
23
+ - `ocwt config open-editor <true|false>`
24
+ - `ocwt config reset [key]`
25
+
26
+ ## JSON Config Schema
27
+
28
+ - Path: `~/.config/ocwt/config.json`
29
+ - Keys:
30
+ - `editor` (string, default `"cursor"` or `"none"` if unavailable)
31
+ - `open_editor` (bool)
32
+ - `agent` (string, default `"build"`)
33
+ - `auto_plan` (bool, default `false`)
34
+ - `prompt_file` (string or `null` for built-in default)
35
+ - `branch_prompt_file` (string or `null`)
36
+ - `worktree_parent` (string, default `".worktrees"`)
37
+ - `symlink_opencode` / `symlink_idea` / `symlink_env` (bool)
38
+
39
+ ## One-Shot Planning + Same Session Flow
40
+
41
+ - `ocwt open --plan ...`:
42
+ - Creates/reuses worktree.
43
+ - Prints clear planning banner (`Planning started...`) and streams live opencode output (spinner + line stream; no silent wait).
44
+ - Runs one-shot with `opencode run --agent build ...` (plus attached `@file`s).
45
+ - Captures resulting session id from machine output (`--format json`) when available.
46
+ - Opens interactive TUI in the same session via `opencode --session <id> <worktree_dir> --agent build`.
47
+ - Fallback if id not parseable: `opencode --continue <worktree_dir> --agent build` with explicit warning.
48
+
49
+ ## Implementation Phases
50
+
51
+ - Phase 1: Package scaffold (`pyproject.toml`, `src/ocwt/...`, entrypoint).
52
+ - Phase 2: Port git/worktree + branch logic from Bash.
53
+ - Phase 3: Port symlink logic and close safeguards.
54
+ - Phase 4: Add config subsystem (`config` command family + JSON persistence).
55
+ - Phase 5: Add planning runner with interactive streamed UX + session handoff.
56
+ - Phase 6: Add editor launcher + config integration.
57
+ - Phase 7: Tests (unit + temp-repo integration) and compatibility polish (`octw` alias optional).
58
+
59
+ ## Acceptance Checks
60
+
61
+ - `ocwt config editor zed` persists and is used on next `open`.
62
+ - `ocwt open "..." --plan` shows active planning output and then lands in same opencode session.
63
+ - Existing branch/worktree reopen behavior still works.
64
+ - `close` still protects `main/master/base` and handles interactive selection safely.