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.
- {witbitz_code-1.3.0/src/witbitz_code.egg-info → witbitz_code-1.3.1}/PKG-INFO +1 -1
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/pyproject.toml +1 -1
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/__init__.py +1 -1
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/account.py +5 -2
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/pair.py +1 -1
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/uninstall.py +1 -1
- {witbitz_code-1.3.0 → witbitz_code-1.3.1/src/witbitz_code.egg-info}/PKG-INFO +1 -1
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_pair_flows.py +8 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/LICENSE +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/README.md +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/setup.cfg +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/__main__.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/_js.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/asks.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/attachments.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/auto.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/auto_runner.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/cli.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/codekeys.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/codetools.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/compress.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/computers.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/confidential.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/confidential_models.json +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/connector.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/devicelink.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/folders.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/gateway.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/keys.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/link.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/models.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/net.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/offered_models.json +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/notes-init.md +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-media-server.mjs +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-notes.js +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-progress.js +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/outputs.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/pairings.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/payers.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/plugins.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/policy.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/qr.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/receipt.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/relay.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/seen.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/tinfoil_read.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/tools_probe.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/wizard.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/SOURCES.txt +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/dependency_links.txt +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/entry_points.txt +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/requires.txt +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code.egg-info/top_level.txt +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_asks.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_attachments.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_auto.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_cli.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_codekeys.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_codetools.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_confidential.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_connector_e2e.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_devicelink.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_files_and_compress.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_folders.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_outputs.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_plugins.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_policy.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_registry.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_relay_codec.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_setup.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_tools_probe.py +0 -0
- {witbitz_code-1.3.0 → witbitz_code-1.3.1}/tests/test_uninstall.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "witbitz-code"
|
|
7
|
-
version = "1.3.
|
|
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"
|
|
@@ -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).
|
|
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
|
|
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
|
|
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
|
|
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)
|
|
@@ -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
|
|
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
|
{witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-media-server.mjs
RENAMED
|
File without changes
|
{witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-notes.js
RENAMED
|
File without changes
|
{witbitz_code-1.3.0 → witbitz_code-1.3.1}/src/witbitz_code/opencode_plugins/witbitz-progress.js
RENAMED
|
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
|