uro-cli 0.15.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: uro-cli
3
- Version: 0.15.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.15.0
16
- Requires-Dist: uro-server==0.15.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.15.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.15.0",
17
- "uro-server==0.15.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,14 +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 the uro-loom web console (a cross-origin SPA); the browser "
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 solo dev loop, on
602
- 127.0.0.1 only: binding any other host needs --token).
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).
603
603
 
604
604
  Each campaign plays under the ruleset it pinned, as with `uro play`: one server hosts d20,
605
605
  PbtA and Uro Pool campaigns side by side. `--ruleset` sets the default for unpinned ones."""
@@ -610,13 +610,16 @@ def serve(
610
610
 
611
611
  # The default 'local' token is a guessable name, fine on loopback (the solo dev loop) and
612
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 host not in ("127.0.0.1", "localhost", "::1"):
613
+ if not token and not admin_token and host not in ("127.0.0.1", "localhost", "::1"):
614
614
  typer.echo(
615
- f"error: binding {host} needs --token: the default 'local' token is only for 127.0.0.1",
615
+ f"error: binding {host} needs --token or --admin-token: the default 'local' token is "
616
+ "only for 127.0.0.1",
616
617
  err=True,
617
618
  )
618
619
  raise typer.Exit(2)
619
- toks = token or ["local"]
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"])
620
623
  # `TOK=participant` names the participant explicitly (gap G-16 — token order was load-bearing
621
624
  # config); a bare `TOK` falls back to positional player-1..N.
622
625
  tokens: dict[str, str] = {}
@@ -653,7 +656,8 @@ def serve(
653
656
  "vote": VoteArbiter,
654
657
  }
655
658
  if arbiter_kind is None:
656
- arbiter: TurnArbiter | None = PartyArbiter() if len(tokens) > 1 else None
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
657
661
  elif arbiter_kind not in shapes:
658
662
  raise typer.BadParameter(
659
663
  f"--arbiter must be one of {', '.join(shapes)} (got {arbiter_kind!r})"
@@ -1482,6 +1486,38 @@ def campaign_show(campaign_id: str) -> None:
1482
1486
  _run_async(_run)
1483
1487
 
1484
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
+
1485
1521
  @branch_app.command("diff")
1486
1522
  def branch_diff(
1487
1523
  world: str,
@@ -1851,7 +1887,7 @@ def codex_list(
1851
1887
 
1852
1888
 
1853
1889
  # --- Model-connection registry (D-47, docs/20) — direct-DB config of the LLM provider registry.
1854
- # A server API mirror (for uro-loom / remote clients) lands in the next slice; today these edit the
1890
+ # A server API mirror (for remote clients) lands in the next slice; today these edit the
1855
1891
  # instance's DB directly (operator with DB access), like `uro world`/`uro campaign`.
1856
1892
 
1857
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