dint-cli 0.1.2__tar.gz → 0.1.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.
- {dint_cli-0.1.2/src/dint_cli.egg-info → dint_cli-0.1.3}/PKG-INFO +1 -1
- {dint_cli-0.1.2 → dint_cli-0.1.3}/pyproject.toml +1 -1
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/__init__.py +1 -1
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/cli.py +10 -5
- {dint_cli-0.1.2 → dint_cli-0.1.3/src/dint_cli.egg-info}/PKG-INFO +1 -1
- {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_cli.py +28 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/LICENSE +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/README.md +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/setup.cfg +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/__main__.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/__init__.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/base.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/claude.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/codex.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/copilot.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/grok.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/envfile.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/jobs.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/logbook/__init__.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/logbook/mcp.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/logbook/rest.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/proc.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/router.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/runtime.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/status.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/types.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/SOURCES.txt +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/dependency_links.txt +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/entry_points.txt +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/requires.txt +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/top_level.txt +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_engines.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_envfile.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_jobs.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_logbook.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_router.py +0 -0
- {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_runtime.py +0 -0
|
@@ -223,12 +223,16 @@ def _repl(router: Router, engine: str, cwd: str, chat_id: str, *, fresh: bool) -
|
|
|
223
223
|
text = line.strip()
|
|
224
224
|
if not text:
|
|
225
225
|
continue
|
|
226
|
-
|
|
226
|
+
send_text = text
|
|
227
|
+
if text.startswith("//"):
|
|
228
|
+
send_text = text[1:]
|
|
229
|
+
elif text.startswith("/"):
|
|
227
230
|
action, engine, chat_id = _slash(router, engine, cwd, chat_id, text)
|
|
228
231
|
if action == "quit":
|
|
229
232
|
return 0
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
if action != "send":
|
|
234
|
+
continue
|
|
235
|
+
code = _send(router, chat_id, send_text, quiet_done=True)
|
|
232
236
|
if code != 0:
|
|
233
237
|
return code
|
|
234
238
|
|
|
@@ -254,6 +258,8 @@ def _print_help(engine: str) -> None:
|
|
|
254
258
|
" /status logbook + engines\n"
|
|
255
259
|
" /new new chat, same engine\n"
|
|
256
260
|
" /help /quit\n"
|
|
261
|
+
" /login (and other unknown /lines) go to the engine\n"
|
|
262
|
+
" //help send /help to the engine\n"
|
|
257
263
|
"same from another shell:\n"
|
|
258
264
|
f' dint job {engine} "Summarize this repo"\n'
|
|
259
265
|
" dint chats\n"
|
|
@@ -302,8 +308,7 @@ def _slash(
|
|
|
302
308
|
if cmd == "/job":
|
|
303
309
|
_slash_job(router, engine, cwd, args)
|
|
304
310
|
return "ok", engine, chat_id
|
|
305
|
-
|
|
306
|
-
return "ok", engine, chat_id
|
|
311
|
+
return "send", engine, chat_id
|
|
307
312
|
|
|
308
313
|
|
|
309
314
|
def _slash_job(router: Router, engine: str, cwd: str, args: list[str]) -> None:
|
|
@@ -175,6 +175,34 @@ def test_repl_job(monkeypatch, capsys, tmp_path) -> None:
|
|
|
175
175
|
assert "job-1" in err and "chatjob" in err
|
|
176
176
|
|
|
177
177
|
|
|
178
|
+
def test_repl_unknown_slash_goes_to_engine(monkeypatch, capsys, tmp_path) -> None:
|
|
179
|
+
monkeypatch.chdir(tmp_path)
|
|
180
|
+
monkeypatch.setattr("dint.cli.ensure_runtime", lambda **k: None)
|
|
181
|
+
monkeypatch.setattr("dint.cli.pick_engine", lambda: "claude")
|
|
182
|
+
monkeypatch.setattr("dint.cli.shutil.which", lambda name: f"/bin/{name}")
|
|
183
|
+
monkeypatch.setattr("dint.cli.logbook_url", lambda: "http://127.0.0.1:5100")
|
|
184
|
+
monkeypatch.setattr("dint.cli.jobs_url", lambda: "http://127.0.0.1:8787")
|
|
185
|
+
monkeypatch.setattr(sys.stdin, "isatty", lambda: True)
|
|
186
|
+
claude = FakeEngine(
|
|
187
|
+
"claude",
|
|
188
|
+
[
|
|
189
|
+
[Event(type="text", text="login please"), Event(type="done")],
|
|
190
|
+
[Event(type="text", text="engine help"), Event(type="done")],
|
|
191
|
+
],
|
|
192
|
+
)
|
|
193
|
+
router = Router(
|
|
194
|
+
store=ChatLog(MemoryLogbook(), project="dint"),
|
|
195
|
+
engines={"claude": claude},
|
|
196
|
+
)
|
|
197
|
+
monkeypatch.setattr("dint.cli.Router", lambda: router)
|
|
198
|
+
lines = iter(["/login", "//help", "/quit"])
|
|
199
|
+
monkeypatch.setattr("builtins.input", lambda prompt="": next(lines))
|
|
200
|
+
assert main([]) == 0
|
|
201
|
+
assert [c["prompt"] for c in claude.calls] == ["/login", "/help"]
|
|
202
|
+
out = capsys.readouterr().out
|
|
203
|
+
assert "login please" in out and "engine help" in out
|
|
204
|
+
|
|
205
|
+
|
|
178
206
|
def test_cli_streams_tokens_inline(capsys) -> None:
|
|
179
207
|
printer = EventPrinter()
|
|
180
208
|
printer.emit(Event(type="text", text="He"))
|
|
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
|