witbitz-code 1.3.0__tar.gz → 1.3.1__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 (73) hide show
  1. {witbitz_code-1.3.0/src/witbitz_code.egg-info → witbitz_code-1.3.1}/PKG-INFO +1 -1
  2. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/pyproject.toml +1 -1
  3. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/__init__.py +1 -1
  4. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/account.py +5 -2
  5. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/pair.py +1 -1
  6. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/uninstall.py +1 -1
  7. {witbitz_code-1.3.0 → witbitz_code-1.3.1/src/witbitz_code.egg-info}/PKG-INFO +1 -1
  8. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_pair_flows.py +8 -0
  9. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/LICENSE +0 -0
  10. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/README.md +0 -0
  11. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/setup.cfg +0 -0
  12. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/__main__.py +0 -0
  13. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/_js.py +0 -0
  14. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/asks.py +0 -0
  15. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/attachments.py +0 -0
  16. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/auto.py +0 -0
  17. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/auto_runner.py +0 -0
  18. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/cli.py +0 -0
  19. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/codekeys.py +0 -0
  20. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/codetools.py +0 -0
  21. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/compress.py +0 -0
  22. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/computers.py +0 -0
  23. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/confidential.py +0 -0
  24. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/confidential_models.json +0 -0
  25. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/connector.py +0 -0
  26. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/devicelink.py +0 -0
  27. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/folders.py +0 -0
  28. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/gateway.py +0 -0
  29. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/keys.py +0 -0
  30. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/link.py +0 -0
  31. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/models.py +0 -0
  32. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/net.py +0 -0
  33. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/offered_models.json +0 -0
  34. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/notes-init.md +0 -0
  35. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-media-server.mjs +0 -0
  36. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-notes.js +0 -0
  37. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-progress.js +0 -0
  38. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/outputs.py +0 -0
  39. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/pairings.py +0 -0
  40. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/payers.py +0 -0
  41. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/plugins.py +0 -0
  42. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/policy.py +0 -0
  43. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/qr.py +0 -0
  44. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/receipt.py +0 -0
  45. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/relay.py +0 -0
  46. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/seen.py +0 -0
  47. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/tinfoil_read.py +0 -0
  48. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/tools_probe.py +0 -0
  49. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/wizard.py +0 -0
  50. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/SOURCES.txt +0 -0
  51. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/dependency_links.txt +0 -0
  52. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/entry_points.txt +0 -0
  53. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/requires.txt +0 -0
  54. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/top_level.txt +0 -0
  55. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_asks.py +0 -0
  56. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_attachments.py +0 -0
  57. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_auto.py +0 -0
  58. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_cli.py +0 -0
  59. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_codekeys.py +0 -0
  60. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_codetools.py +0 -0
  61. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_confidential.py +0 -0
  62. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_connector_e2e.py +0 -0
  63. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_devicelink.py +0 -0
  64. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_files_and_compress.py +0 -0
  65. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_folders.py +0 -0
  66. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_outputs.py +0 -0
  67. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_plugins.py +0 -0
  68. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_policy.py +0 -0
  69. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_registry.py +0 -0
  70. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_relay_codec.py +0 -0
  71. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_setup.py +0 -0
  72. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_tools_probe.py +0 -0
  73. {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_uninstall.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: witbitz-code
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Reach OpenCode on this computer from the Witbitz Spaces Code section, through an end-to-end sealed relay.
5
5
  Author: Witbitz
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "witbitz-code"
7
- version = "1.3.0"
7
+ version = "1.3.1"
8
8
  description = "Reach OpenCode on this computer from the Witbitz Spaces Code section, through an end-to-end sealed relay."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -4,4 +4,4 @@ The Python implementation of tools/witbitz-code.mjs (docs/opencode-relay.md phas
4
4
  vectors and cross-implementation tests.
5
5
  """
6
6
 
7
- __version__ = "1.3.0"
7
+ __version__ = "1.3.1"
@@ -73,13 +73,16 @@ async def publish_computer(*, call: ApiCall, idx: dict, computer_id: str, name:
73
73
 
74
74
 
75
75
  async def unpublish_computer(*, call: ApiCall, idx: dict, computer_id: str, now: float | None = None) -> dict:
76
- """Tombstone this computer in the account's registry (its secret leaves the account). Nothing there → nothing written."""
76
+ """Tombstone this computer in the account's registry (its secret leaves the account). Written even when this doc does not
77
+ list it: an app that seals the list keeps it in 'xcomputers', which this tool cannot read (it holds no account key), and
78
+ an older app emptied this doc — so "not listed" here says nothing about the list the apps show (tools/opencode-pair.mjs
79
+ unpublishComputer). Only a tombstone already here is left alone."""
77
80
  now = _now_ms() if now is None else now
78
81
  rd = await read_doc(call, idx, COMPUTERS_DOC)
79
82
  if not rd["ok"]:
80
83
  return rd
81
84
  cur = norm_registry(rd["state"])["computers"].get(computer_id)
82
- if not cur or cur.get("removed"):
85
+ if cur and cur.get("removed"):
83
86
  return {"ok": True, "noop": True}
84
87
  nxt = without_computer(rd["state"], computer_id, now)
85
88
  wr = await call(_write_body(idx, COMPUTERS_DOC, wrap_index_state({**nxt, "at": now}), "computer unpaired"))
@@ -205,7 +205,7 @@ async def _run(args: Args, call: Any, link_fn: LinkFn | None, out: Callable, err
205
205
  ok = False
206
206
  err(f"witbitz-code: ✖ {p.get('account')}: {r['why']} — kept the local pairing so you can retry")
207
207
  continue
208
- note = " (it was not listed)" if r.get("noop") else ""
208
+ note = " (it was already removed)" if r.get("noop") else ""
209
209
  out(f"witbitz-code: ✓ removed \"{p.get('name')}\" from {p.get('account')}{note} — every device drops it on its next sync")
210
210
  pp.write_pairings(pp.remove_pairings(pp.read_pairings(), p.get("account") or "")["doc"])
211
211
  out(f"witbitz-code: restart the connector ({START_HINT}) so it stops answering on the old channel.")
@@ -323,7 +323,7 @@ async def run_uninstall(d: Deps) -> dict:
323
323
  except Exception as e: # noqa: BLE001 — one account failing must not stop the rest
324
324
  r = {"ok": False, "why": str(e)}
325
325
  if r.get("ok"):
326
- d.say(f"✓ Removed \"{p.get('name')}\" from {p.get('account') or 'your account'}{' (it was not listed)' if r.get('noop') else ''}")
326
+ d.say(f"✓ Removed \"{p.get('name')}\" from {p.get('account') or 'your account'}{' (it was already removed)' if r.get('noop') else ''}")
327
327
  else:
328
328
  d.say(f"✖ Could not remove \"{p.get('name')}\" from {p.get('account') or 'your account'} ({r.get('why')})")
329
329
  left.append(p)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: witbitz-code
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Reach OpenCode on this computer from the Witbitz Spaces Code section, through an end-to-end sealed relay.
5
5
  Author: Witbitz
6
6
  License-Expression: MIT
@@ -70,6 +70,14 @@ def test_unpublish_tombstones_and_a_second_unpair_writes_nothing():
70
70
  assert run(acct.unpublish_computer(call=MockApi(read_status=500).call, idx=IDX, computer_id="x"))["ok"] is False
71
71
 
72
72
 
73
+ def test_unpublish_writes_the_tombstone_into_a_doc_an_app_emptied():
74
+ # the list lives sealed ('xcomputers'), where this tool cannot read — "not listed" here must still remove it
75
+ api = MockApi(docs={"computers": {"v": 2, "moved": "sealed"}})
76
+ r = run(acct.unpublish_computer(call=api.call, idx=IDX, computer_id="cmp_desk_01", now=1000))
77
+ assert r["ok"] and not r.get("noop"), r
78
+ assert norm_registry(api.plain("computers"))["computers"]["cmp_desk_01"] == {"removed": True, "mod": 1000}
79
+
80
+
73
81
  def test_clear_legacy_direct_keeps_contacts_and_the_model():
74
82
  api = MockApi(docs={"index2": {"v": 2, "contacts": [{"kind": "person", "email": "dana@example.com"}],
75
83
  "code": {"base": "https://old.example", "pass": "p", "model": "m", "agent": "build", "mod": 50}}})
File without changes
File without changes
File without changes