uro-cli 0.14.0__tar.gz → 0.16.0__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.
- {uro_cli-0.14.0 → uro_cli-0.16.0}/PKG-INFO +3 -3
- {uro_cli-0.14.0 → uro_cli-0.16.0}/pyproject.toml +3 -3
- {uro_cli-0.14.0 → uro_cli-0.16.0}/uro_cli/main.py +63 -8
- {uro_cli-0.14.0 → uro_cli-0.16.0}/.gitignore +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/LICENSE +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/README.md +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/tests/test_cli_scaffold.py +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/tests/test_connect.py +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/tests/test_registry_router.py +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/tests/test_wiring.py +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/uro_cli/__init__.py +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/uro_cli/py.typed +0 -0
- {uro_cli-0.14.0 → uro_cli-0.16.0}/uro_cli/wiring.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: uro-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Uro Engine reference client — play, dry-run, and dev tools against the engine
|
|
5
5
|
Project-URL: Homepage, https://github.com/cupskeee/uro
|
|
6
6
|
Project-URL: Repository, https://github.com/cupskeee/uro
|
|
@@ -12,8 +12,8 @@ Requires-Python: >=3.12
|
|
|
12
12
|
Requires-Dist: python-dotenv>=1.0
|
|
13
13
|
Requires-Dist: rich>=13.9
|
|
14
14
|
Requires-Dist: typer>=0.27.2
|
|
15
|
-
Requires-Dist: uro-core[llm,postgres]==0.
|
|
16
|
-
Requires-Dist: uro-server==0.
|
|
15
|
+
Requires-Dist: uro-core[llm,postgres]==0.16.0
|
|
16
|
+
Requires-Dist: uro-server==0.16.0
|
|
17
17
|
Requires-Dist: websockets>=16.1
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "uro-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.16.0"
|
|
4
4
|
description = "Uro Engine reference client — play, dry-run, and dev tools against the engine"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
license-files = ["LICENSE"]
|
|
@@ -13,8 +13,8 @@ requires-python = ">=3.12"
|
|
|
13
13
|
# pair a new uro-cli with an old uro-core; `just release` bumps all three together, and the
|
|
14
14
|
# `{workspace = true}` sources make a drifted pin fail `uv sync` locally.
|
|
15
15
|
dependencies = [
|
|
16
|
-
"uro-core[postgres,llm]==0.
|
|
17
|
-
"uro-server==0.
|
|
16
|
+
"uro-core[postgres,llm]==0.16.0",
|
|
17
|
+
"uro-server==0.16.0",
|
|
18
18
|
"typer>=0.27.2",
|
|
19
19
|
"rich>=13.9",
|
|
20
20
|
"websockets>=16.1",
|
|
@@ -592,13 +592,14 @@ def serve(
|
|
|
592
592
|
None,
|
|
593
593
|
"--cors-origin",
|
|
594
594
|
help="allow a browser origin to call this server, e.g. --cors-origin http://localhost:5173 "
|
|
595
|
-
"(repeatable). REQUIRED for
|
|
595
|
+
"(repeatable). REQUIRED for a web console (a cross-origin SPA); the browser "
|
|
596
596
|
"blocks calls with no CORS header. Pass '*' to allow any origin (dev only; disables "
|
|
597
597
|
"credentials). Omit for CLI/embedded use.",
|
|
598
598
|
),
|
|
599
599
|
) -> None:
|
|
600
600
|
"""Run the Uro server (docs/08): a thin FastAPI shell over the engine. Each --token maps to
|
|
601
|
-
a participant; with no --token, a single 'local' token binds player-1 (the
|
|
601
|
+
a participant; with no --token and no --admin-token, a single 'local' token binds player-1 (the
|
|
602
|
+
solo dev loop, on 127.0.0.1 only: binding any other host needs --token).
|
|
602
603
|
|
|
603
604
|
Each campaign plays under the ruleset it pinned, as with `uro play`: one server hosts d20,
|
|
604
605
|
PbtA and Uro Pool campaigns side by side. `--ruleset` sets the default for unpinned ones."""
|
|
@@ -607,7 +608,18 @@ def serve(
|
|
|
607
608
|
from uro_core.session import PartyArbiter, ProposalWindowArbiter, TurnArbiter, VoteArbiter
|
|
608
609
|
from uro_server.app import create_app, engine_deps
|
|
609
610
|
|
|
610
|
-
|
|
611
|
+
# The default 'local' token is a guessable name, fine on loopback (the solo dev loop) and
|
|
612
|
+
# nowhere else: anyone who can reach a public bind could play as player-1 with it (D-94 review).
|
|
613
|
+
if not token and not admin_token and host not in ("127.0.0.1", "localhost", "::1"):
|
|
614
|
+
typer.echo(
|
|
615
|
+
f"error: binding {host} needs --token or --admin-token: the default 'local' token is "
|
|
616
|
+
"only for 127.0.0.1",
|
|
617
|
+
err=True,
|
|
618
|
+
)
|
|
619
|
+
raise typer.Exit(2)
|
|
620
|
+
# the default 'local' token is for a bare `uro serve` only: with an --admin-token given, adding
|
|
621
|
+
# it would quietly open a second, guessable credential beside the one asked for
|
|
622
|
+
toks = token or ([] if admin_token else ["local"])
|
|
611
623
|
# `TOK=participant` names the participant explicitly (gap G-16 — token order was load-bearing
|
|
612
624
|
# config); a bare `TOK` falls back to positional player-1..N.
|
|
613
625
|
tokens: dict[str, str] = {}
|
|
@@ -644,7 +656,8 @@ def serve(
|
|
|
644
656
|
"vote": VoteArbiter,
|
|
645
657
|
}
|
|
646
658
|
if arbiter_kind is None:
|
|
647
|
-
|
|
659
|
+
# a party is several PARTICIPANTS, not several tokens (two tokens for one player is solo)
|
|
660
|
+
arbiter: TurnArbiter | None = PartyArbiter() if len(set(tokens.values())) > 1 else None
|
|
648
661
|
elif arbiter_kind not in shapes:
|
|
649
662
|
raise typer.BadParameter(
|
|
650
663
|
f"--arbiter must be one of {', '.join(shapes)} (got {arbiter_kind!r})"
|
|
@@ -1473,6 +1486,38 @@ def campaign_show(campaign_id: str) -> None:
|
|
|
1473
1486
|
_run_async(_run)
|
|
1474
1487
|
|
|
1475
1488
|
|
|
1489
|
+
@campaign_app.command("pacing")
|
|
1490
|
+
def campaign_pacing(campaign_id: str) -> None:
|
|
1491
|
+
"""Which live plots have gone quiet, and the one the next beat would name to the narrator
|
|
1492
|
+
(the pacing director, D-95: off unless the world's `[pacing]` turns it on, D-96)."""
|
|
1493
|
+
|
|
1494
|
+
async def _run() -> None:
|
|
1495
|
+
from uro_core.pipeline.pacing import pacing_report
|
|
1496
|
+
|
|
1497
|
+
store = build_store()
|
|
1498
|
+
await connect_store(store)
|
|
1499
|
+
try:
|
|
1500
|
+
c = await _campaign_or_exit(store, campaign_id)
|
|
1501
|
+
report = await pacing_report(store, c.branch_id)
|
|
1502
|
+
finally:
|
|
1503
|
+
await store.close()
|
|
1504
|
+
st = report.settings
|
|
1505
|
+
when = (
|
|
1506
|
+
"off (the world's [pacing] quiet_after turns it on)"
|
|
1507
|
+
if st.quiet_after == 0
|
|
1508
|
+
else f"names a plot quiet {st.quiet_after}+ beats, at most once every {st.every}"
|
|
1509
|
+
)
|
|
1510
|
+
typer.echo(f"pacing: {when} (over the last {report.beats_read} beats)")
|
|
1511
|
+
if not report.threads:
|
|
1512
|
+
typer.echo(" (no live threads)")
|
|
1513
|
+
for t in sorted(report.threads, key=lambda t: (-t.quiet_beats, t.thread_id)):
|
|
1514
|
+
quiet = f"{t.quiet_beats}{'+' if t.at_least else ''}"
|
|
1515
|
+
mark = " ← next" if t.thread_id == report.next_paced else ""
|
|
1516
|
+
typer.echo(f" {quiet:>4} beats quiet [{t.thread_id}] {t.stakes}{mark}")
|
|
1517
|
+
|
|
1518
|
+
_run_async(_run)
|
|
1519
|
+
|
|
1520
|
+
|
|
1476
1521
|
@branch_app.command("diff")
|
|
1477
1522
|
def branch_diff(
|
|
1478
1523
|
world: str,
|
|
@@ -1571,9 +1616,15 @@ def campaign_new(
|
|
|
1571
1616
|
def campaign_time_skip(
|
|
1572
1617
|
campaign_id: str,
|
|
1573
1618
|
days: int = typer.Option(..., "--days", min=1, help="in-fiction days to advance"),
|
|
1619
|
+
downtime: bool = typer.Option(
|
|
1620
|
+
True,
|
|
1621
|
+
"--downtime/--no-downtime",
|
|
1622
|
+
help="rest the sheets and mark a skip (default), or pass the days in play (D-80)",
|
|
1623
|
+
),
|
|
1574
1624
|
) -> None:
|
|
1575
1625
|
"""Advance time ON the campaign's own branch and fire the world's downtime agenda rules (D-33).
|
|
1576
|
-
|
|
1626
|
+
`--no-downtime` passes the days in play instead: the world's rules and agendas react, nothing
|
|
1627
|
+
rests (D-80). To skip time on a NEW branch, use `uro branch fork --time-skip-days`."""
|
|
1577
1628
|
|
|
1578
1629
|
async def _run() -> None:
|
|
1579
1630
|
store = build_store()
|
|
@@ -1584,11 +1635,15 @@ def campaign_time_skip(
|
|
|
1584
1635
|
# and settings decide what the downtime means (D-63)
|
|
1585
1636
|
ruleset = await _time_skip_ruleset(registry.resolve_for_campaign(store, c))
|
|
1586
1637
|
engine = Engine(store, build_router("stub", None), ruleset=ruleset)
|
|
1587
|
-
|
|
1638
|
+
if downtime:
|
|
1639
|
+
await engine.agenda_tick(c.branch_id, days)
|
|
1640
|
+
else:
|
|
1641
|
+
await engine.pass_time(c, days, reason="operator")
|
|
1588
1642
|
day = await store.current_world_time(c.branch_id)
|
|
1589
1643
|
finally:
|
|
1590
1644
|
await store.close()
|
|
1591
|
-
|
|
1645
|
+
how = "" if downtime else " in play"
|
|
1646
|
+
typer.echo(f"advanced {days} day(s){how}; the campaign is now on day {day}")
|
|
1592
1647
|
|
|
1593
1648
|
_run_async(_run)
|
|
1594
1649
|
|
|
@@ -1832,7 +1887,7 @@ def codex_list(
|
|
|
1832
1887
|
|
|
1833
1888
|
|
|
1834
1889
|
# --- Model-connection registry (D-47, docs/20) — direct-DB config of the LLM provider registry.
|
|
1835
|
-
# A server API mirror (for
|
|
1890
|
+
# A server API mirror (for remote clients) lands in the next slice; today these edit the
|
|
1836
1891
|
# instance's DB directly (operator with DB access), like `uro world`/`uro campaign`.
|
|
1837
1892
|
|
|
1838
1893
|
|
|
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
|