sideby 0.25.0 → 0.26.1
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.
- package/README.md +1 -0
- package/ai-tasks.json +17 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +14 -0
- package/dist/src/cli/commands.js +113 -7
- package/dist/src/cli/json-schemas.js +46 -0
- package/dist/src/cli/main.js +38 -3
- package/dist/src/core/ask.js +5 -0
- package/dist/src/core/config.d.ts +16 -0
- package/dist/src/core/config.js +16 -0
- package/dist/src/core/egress.d.ts +103 -0
- package/dist/src/core/egress.js +333 -0
- package/dist/src/core/handoff-run.d.ts +4 -2
- package/dist/src/core/handoff-run.js +18 -11
- package/dist/src/core/launch.d.ts +5 -1
- package/dist/src/core/launch.js +5 -0
- package/dist/src/core/network.d.ts +131 -0
- package/dist/src/core/network.js +317 -0
- package/dist/src/network/hook.d.ts +15 -0
- package/dist/src/network/hook.js +69 -0
- package/dist/src/panel/handler.d.ts +3 -0
- package/dist/src/panel/handler.js +32 -0
- package/dist/src/panel/i18n.d.ts +53 -0
- package/dist/src/panel/i18n.js +106 -0
- package/dist/src/panel/page-logic.d.ts +23 -1
- package/dist/src/panel/page-logic.js +33 -0
- package/dist/src/panel/page-script.js +184 -11
- package/dist/src/panel/page-styles.js +11 -3
- package/dist/src/runtime.d.ts +18 -1
- package/dist/src/runtime.js +78 -7
- package/package.json +2 -2
- package/schemas/config.json +20 -0
- package/schemas/network-set.json +129 -0
- package/schemas/network.json +199 -0
- package/skills/sideby/SKILL.md +2 -1
- package/skills/sideby/references/ai-tasks.md +1 -1
- package/skills/sideby/references/network.md +37 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Network check: stop Claude and Codex on the wrong network
|
|
2
|
+
|
|
3
|
+
Network Guard (spec §3.35, ADR-0053) checks the country a Host's requests leave from (its Egress): before sideby starts a Claude or Codex account, and before each prompt and tool call in a session sideby started. When the country is not one the user allows, or cannot be told within 3 seconds, it stops and says what to do. It guards against a proxy that stopped or a node in the wrong country. It does not make use from a region the vendor does not support allowed; say so if the user seems to expect that, and never help hide where they are (time zone, fingerprints).
|
|
4
|
+
|
|
5
|
+
## See where requests leave from
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
sideby network --json # the setting and the newest result per address, from the cache (no request)
|
|
9
|
+
sideby network check --json # ask every address now
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Each `targets[]` row is one address sideby asks (`api.anthropic.com` for Claude, `chatgpt.com` for Codex subscription accounts, `api.openai.com` for Codex API accounts) with `status` (`ok`, `blocked`, `unknown`, `not-checked`), `loc` (the country) and the `accounts` checked there. `accounts[].skip` says why an account is not checked: `third-party` (an API account on another endpoint) or `at-launch` (an API account, whose address is known only when it starts).
|
|
13
|
+
|
|
14
|
+
## Turn it on
|
|
15
|
+
|
|
16
|
+
Ask the user which countries their requests may leave from. Never choose for them, and never add the current country because it is current: on a wrong network that would allow the wrong country. Then:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
sideby network allow US JP --json # exit 10 with the change; rerun with --yes after they agree
|
|
20
|
+
sideby network on --json # exit 10; rerun with --yes after they agree
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`on` is refused while no country is allowed (`network-allow-empty`). `sideby network off --yes --json` turns it off. Codes are two letters (ISO 3166-1 alpha-2): US, JP, SG, GB, DE.
|
|
24
|
+
|
|
25
|
+
Tell the user, once:
|
|
26
|
+
- Only sessions sideby starts are checked (`sideby run`, short commands, `sideby next`, Auto Handoff, AI Tasks). Running `claude` or `codex` directly is not.
|
|
27
|
+
- Codex runs the hook only after they trust it once: in that account type `/hooks` and trust `network-hook`. Until then Codex is checked only before starting.
|
|
28
|
+
- A Claude session started with its own `--settings` is checked only before starting.
|
|
29
|
+
- sideby asks the vendor's own `/cdn-cgi/trace` through the account's proxy settings, with no credential, and keeps only the country and a hash of the address. The Panel has the same switch under **Settings › Network check**.
|
|
30
|
+
|
|
31
|
+
## As an AI Task
|
|
32
|
+
|
|
33
|
+
The Panel's **Let AI help** (in the Network check dialog and on the wrong-network banner) starts the `network` AI Task (`sideby ask --task network`). Its prompt carries the switch, the allowed countries and the newest result per address (countries only, never an address). Follow it: run `sideby network check --json`, ask which countries, preview, then `--yes` after they agree.
|
|
34
|
+
|
|
35
|
+
## When something was blocked
|
|
36
|
+
|
|
37
|
+
A blocked Launch exits 1 with `code` `network-blocked` (wrong country) or `network-unknown` (could not tell). Inside a session the prompt or tool call is stopped with the same reason. Help the user check their proxy (is it running, which node), then run `sideby network check --json` to confirm. To go on once anyway, the user runs `sideby run <account> --ignore-network` (or `sideby next <family> --ignore-network`); never add it yourself without their say-so.
|