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.
Files changed (37) hide show
  1. {dint_cli-0.1.2/src/dint_cli.egg-info → dint_cli-0.1.3}/PKG-INFO +1 -1
  2. {dint_cli-0.1.2 → dint_cli-0.1.3}/pyproject.toml +1 -1
  3. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/__init__.py +1 -1
  4. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/cli.py +10 -5
  5. {dint_cli-0.1.2 → dint_cli-0.1.3/src/dint_cli.egg-info}/PKG-INFO +1 -1
  6. {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_cli.py +28 -0
  7. {dint_cli-0.1.2 → dint_cli-0.1.3}/LICENSE +0 -0
  8. {dint_cli-0.1.2 → dint_cli-0.1.3}/README.md +0 -0
  9. {dint_cli-0.1.2 → dint_cli-0.1.3}/setup.cfg +0 -0
  10. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/__main__.py +0 -0
  11. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/__init__.py +0 -0
  12. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/base.py +0 -0
  13. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/claude.py +0 -0
  14. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/codex.py +0 -0
  15. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/copilot.py +0 -0
  16. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/engines/grok.py +0 -0
  17. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/envfile.py +0 -0
  18. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/jobs.py +0 -0
  19. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/logbook/__init__.py +0 -0
  20. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/logbook/mcp.py +0 -0
  21. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/logbook/rest.py +0 -0
  22. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/proc.py +0 -0
  23. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/router.py +0 -0
  24. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/runtime.py +0 -0
  25. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/status.py +0 -0
  26. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint/types.py +0 -0
  27. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/SOURCES.txt +0 -0
  28. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/dependency_links.txt +0 -0
  29. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/entry_points.txt +0 -0
  30. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/requires.txt +0 -0
  31. {dint_cli-0.1.2 → dint_cli-0.1.3}/src/dint_cli.egg-info/top_level.txt +0 -0
  32. {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_engines.py +0 -0
  33. {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_envfile.py +0 -0
  34. {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_jobs.py +0 -0
  35. {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_logbook.py +0 -0
  36. {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_router.py +0 -0
  37. {dint_cli-0.1.2 → dint_cli-0.1.3}/tests/test_runtime.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dint-cli
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: One local chat API over Claude, Codex, Grok, and Copilot. Codicent Logbook is the ledger.
5
5
  Author-email: Johan Isaksson <johan@izaxon.com>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dint-cli"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "One local chat API over Claude, Codex, Grok, and Copilot. Codicent Logbook is the ledger."
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -4,4 +4,4 @@ from dint.router import Router
4
4
  from dint.types import Chat, Event
5
5
 
6
6
  __all__ = ["Chat", "Event", "Router"]
7
- __version__ = "0.1.2"
7
+ __version__ = "0.1.3"
@@ -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
- if text.startswith("/"):
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
- continue
231
- code = _send(router, chat_id, text, quiet_done=True)
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
- print("commands: /engine /job /chats /status /new /help /quit", file=sys.stderr)
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dint-cli
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: One local chat API over Claude, Codex, Grok, and Copilot. Codicent Logbook is the ledger.
5
5
  Author-email: Johan Isaksson <johan@izaxon.com>
6
6
  License: MIT License
@@ -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