nini-cli 0.4.3__tar.gz → 0.4.5__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.
- {nini_cli-0.4.3 → nini_cli-0.4.5}/PKG-INFO +4 -4
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/__init__.py +1 -1
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/store.py +28 -2
- {nini_cli-0.4.3 → nini_cli-0.4.5}/pyproject.toml +4 -4
- {nini_cli-0.4.3 → nini_cli-0.4.5}/LICENSE +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/README.md +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/__main__.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/app.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/cli_util.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/__init__.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/attach.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/config_cmd.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/doctor.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/import_cmd.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/mcp.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/pair.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/provider_cmd.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/run.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/serve.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/sessions.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/status.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/token.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/commands/workspace.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/config.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/events.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/i18n.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/import_api.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/mcp_api.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/permissions.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/policy.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/projects.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/relay_api.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/roots.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/service_boot.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/startup.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/__init__.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/app.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/app.tcss +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/client.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/clipboard.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/keymap.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/mark_art.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/markdown.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/models.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/palette.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/pointer.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/render.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/session_timeline.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/splash.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/status_line.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/stream.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui/widgets.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/tui_main.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/turn.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/ui.py +0 -0
- {nini_cli-0.4.3 → nini_cli-0.4.5}/nini_cli/workspace.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: nini-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.5
|
|
4
4
|
Summary: Nini command line interface: start the daemon, stream a session, answer approvals
|
|
5
5
|
Project-URL: Homepage, https://nini.flygpt.cc
|
|
6
6
|
Project-URL: Repository, https://github.com/xusai2014/Nini
|
|
@@ -13,9 +13,9 @@ Classifier: Operating System :: OS Independent
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Requires-Python: >=3.12
|
|
15
15
|
Requires-Dist: httpx>=0.28
|
|
16
|
-
Requires-Dist: nini-client==0.4.
|
|
17
|
-
Requires-Dist: nini-core==0.4.
|
|
18
|
-
Requires-Dist: nini-protocol==0.4.
|
|
16
|
+
Requires-Dist: nini-client==0.4.5
|
|
17
|
+
Requires-Dist: nini-core==0.4.5
|
|
18
|
+
Requires-Dist: nini-protocol==0.4.5
|
|
19
19
|
Requires-Dist: rich>=13.9
|
|
20
20
|
Requires-Dist: textual>=0.89
|
|
21
21
|
Requires-Dist: typer>=0.15
|
|
@@ -8,6 +8,12 @@ contract:
|
|
|
8
8
|
``?since=``, duplicated frames, overlapping snapshot) is dropped when
|
|
9
9
|
``0 < seq <= last_seq``. ``resync.required`` is honoured *before* that
|
|
10
10
|
check, because the whole point of the event is that the cursor is stale.
|
|
11
|
+
The pointer frames stamped with the live max (``server.heartbeat``, ``ack``,
|
|
12
|
+
``error``) skip the check *and* never move the cursor, so a caught-up client
|
|
13
|
+
sees ``seq == last_seq`` without losing the frame (see
|
|
14
|
+
:data:`SEQ_SHARED_FRAMES`; ``server.hello`` is ``seq: 0`` and
|
|
15
|
+
``resync.required`` carries ``latest``, so for those two the exclusion is
|
|
16
|
+
inert — they are listed to keep the set identical across clients).
|
|
11
17
|
2. Text accumulates per ``(message_id, part_id)``. A part id reused by a
|
|
12
18
|
different message never absorbs another message's text.
|
|
13
19
|
3. A ``part.updated`` snapshot never shortens text that already streamed in.
|
|
@@ -55,6 +61,20 @@ DEFAULT_PAGE_SIZE = 50
|
|
|
55
61
|
"""Messages per page — the same number the service's snapshot/limit and the
|
|
56
62
|
TUI's ``messages?before=`` request use."""
|
|
57
63
|
|
|
64
|
+
SEQ_SHARED_FRAMES = frozenset(
|
|
65
|
+
{"server.hello", "server.heartbeat", "ack", "error", "resync.required"}
|
|
66
|
+
)
|
|
67
|
+
"""Frames whose ``seq`` is the *live maximum pointer*, not a durable position.
|
|
68
|
+
|
|
69
|
+
Contract §4. The service stamps ``server.heartbeat``, ``ack`` and ``error`` with
|
|
70
|
+
``stream.seq`` (``nini_service/ws.py``), so a caught-up client receives them with
|
|
71
|
+
``seq == last_seq``. Deduping them would swallow the frame (a failed turn would
|
|
72
|
+
never reach the notice line and the TUI would stay on 「停止」), and advancing the
|
|
73
|
+
cursor from one would skip the replay a reconnect just asked for. Kept in sync
|
|
74
|
+
with ``SEQ_SHARED_FRAMES`` in ``@nini/sdk-ts`` and ``SEQ_POINTER_FRAMES`` in
|
|
75
|
+
``apps/web/src/store/events.ts``.
|
|
76
|
+
"""
|
|
77
|
+
|
|
58
78
|
DEFAULT_SESSION_LIMIT = 500
|
|
59
79
|
"""Hard cap on the messages one session may keep in memory."""
|
|
60
80
|
|
|
@@ -990,10 +1010,16 @@ class TuiStore:
|
|
|
990
1010
|
return Change(resync=True)
|
|
991
1011
|
|
|
992
1012
|
seq = event.get("seq")
|
|
993
|
-
|
|
1013
|
+
shared = kind in SEQ_SHARED_FRAMES
|
|
1014
|
+
if (
|
|
1015
|
+
not shared
|
|
1016
|
+
and isinstance(seq, int)
|
|
1017
|
+
and not isinstance(seq, bool)
|
|
1018
|
+
and 0 < seq <= self.last_seq
|
|
1019
|
+
):
|
|
994
1020
|
return Change()
|
|
995
1021
|
change = self._dispatch(kind, data, session_id, ts=_str(event.get("ts")))
|
|
996
|
-
if isinstance(seq, int) and not isinstance(seq, bool):
|
|
1022
|
+
if not shared and isinstance(seq, int) and not isinstance(seq, bool):
|
|
997
1023
|
self.last_seq = max(self.last_seq, seq)
|
|
998
1024
|
return change
|
|
999
1025
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nini-cli"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.5"
|
|
4
4
|
description = "Nini command line interface: start the daemon, stream a session, answer approvals"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { text = "MIT" }
|
|
@@ -17,10 +17,10 @@ dependencies = [
|
|
|
17
17
|
"rich>=13.9",
|
|
18
18
|
"httpx>=0.28",
|
|
19
19
|
"websockets>=13",
|
|
20
|
-
"nini-client==0.4.
|
|
21
|
-
"nini-protocol==0.4.
|
|
20
|
+
"nini-client==0.4.5",
|
|
21
|
+
"nini-protocol==0.4.5",
|
|
22
22
|
"textual>=0.89",
|
|
23
|
-
"nini-core==0.4.
|
|
23
|
+
"nini-core==0.4.5",
|
|
24
24
|
]
|
|
25
25
|
|
|
26
26
|
[project.urls]
|
|
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
|