contree-cli 0.9.1__tar.gz → 0.9.3__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.
- {contree_cli-0.9.1 → contree_cli-0.9.3}/PKG-INFO +1 -1
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/run.py +13 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/config.py +7 -1
- {contree_cli-0.9.1 → contree_cli-0.9.3}/pyproject.toml +1 -1
- {contree_cli-0.9.1 → contree_cli-0.9.3}/pyproject.toml.orig +1 -1
- {contree_cli-0.9.1 → contree_cli-0.9.3}/LICENSE +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/README.md +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/__init__.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/__main__.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/agent.md +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/arguments.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/__init__.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/agent.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/auth.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/build.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/cat.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/cd.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/cp.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/env.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/export.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/file.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/grep.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/images.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/ls.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/operation.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/session.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/show.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/skill.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/tag.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/cli/use.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/client.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/__init__.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/context.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/dockerignore.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/keyword.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_add.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_arg.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_copy.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_env.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_from.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_run.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_skipped.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_user.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/kw_workdir.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/local_context.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/parser.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/docker/url_fetch.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/log.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/man.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/manual.md +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/mapped_file.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/migrations.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/output.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/pty_utils.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/py.typed +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/refs.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/session.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/__init__.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/argmap.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/argspec.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/cache.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/completer.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/history.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/parser.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/repl.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/sources.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/shell/trie.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/skill.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/skill_body.md +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/types.py +0 -0
- {contree_cli-0.9.1 → contree_cli-0.9.3}/contree_cli/update_check.py +0 -0
|
@@ -157,6 +157,11 @@ class StdinForwarder(threading.Thread):
|
|
|
157
157
|
self.source = source
|
|
158
158
|
self.spid = spid
|
|
159
159
|
self.error: Exception | None = None
|
|
160
|
+
self.abandoned = threading.Event()
|
|
161
|
+
|
|
162
|
+
def abandon(self) -> None:
|
|
163
|
+
"""Drop further queue items instead of sending them to a terminal operation."""
|
|
164
|
+
self.abandoned.set()
|
|
160
165
|
|
|
161
166
|
def send(self, sr: ClosableStreamRepr) -> None:
|
|
162
167
|
# This POST is non-idempotent and a lost response is ambiguous
|
|
@@ -174,6 +179,8 @@ class StdinForwarder(threading.Thread):
|
|
|
174
179
|
def run(self) -> None:
|
|
175
180
|
while True:
|
|
176
181
|
sr = self.source.get()
|
|
182
|
+
if self.abandoned.is_set():
|
|
183
|
+
return
|
|
177
184
|
try:
|
|
178
185
|
self.send(sr)
|
|
179
186
|
except Exception as exc:
|
|
@@ -649,6 +656,8 @@ def stream_events_until_close(
|
|
|
649
656
|
logger.debug("event: %s", ev)
|
|
650
657
|
case _:
|
|
651
658
|
logger.debug("event: %s", ev)
|
|
659
|
+
if stdin_forwarder is not None:
|
|
660
|
+
stdin_forwarder.abandon()
|
|
652
661
|
break
|
|
653
662
|
except KeyboardInterrupt as interrupt:
|
|
654
663
|
if not sigint_sent:
|
|
@@ -667,6 +676,8 @@ def stream_events_until_close(
|
|
|
667
676
|
# Either the signal itself failed, or this is a second
|
|
668
677
|
# Ctrl-C after it was already sent: give up and tear down
|
|
669
678
|
# the whole operation.
|
|
679
|
+
if stdin_forwarder is not None:
|
|
680
|
+
stdin_forwarder.abandon()
|
|
670
681
|
with contextlib.suppress(KeyboardInterrupt, *SIGNAL_ERRORS):
|
|
671
682
|
client.cancel_operation(op_uuid)
|
|
672
683
|
logger.info("Cancelled operation %s", op_uuid)
|
|
@@ -1014,6 +1025,8 @@ def cmd_run(args: RunArgs) -> int | None:
|
|
|
1014
1025
|
# Local stdout/stderr was closed (e.g. `contree run | head`).
|
|
1015
1026
|
# Cancel the op, silence further stdio writes, then exit 141
|
|
1016
1027
|
# so callers see the SIGPIPE convention (128 + 13).
|
|
1028
|
+
if forwarder is not None:
|
|
1029
|
+
forwarder.abandon()
|
|
1017
1030
|
with contextlib.suppress(ContreeAPIError, OSError):
|
|
1018
1031
|
client.cancel_operation(op_uuid)
|
|
1019
1032
|
with contextlib.suppress(OSError):
|
|
@@ -78,7 +78,13 @@ EDITOR = (
|
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
def session_db_path(profile_name: str) -> Path:
|
|
81
|
-
"""Per-profile session database location (CLI-owned layout).
|
|
81
|
+
"""Per-profile session database location (CLI-owned layout).
|
|
82
|
+
|
|
83
|
+
``CONTREE_SESSION_DB`` overrides the computed path entirely.
|
|
84
|
+
"""
|
|
85
|
+
override = os.getenv("CONTREE_SESSION_DB")
|
|
86
|
+
if override:
|
|
87
|
+
return Path(override).expanduser()
|
|
82
88
|
return CONTREE_HOME / "cli" / "sessions" / f"{profile_name}.db"
|
|
83
89
|
|
|
84
90
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|