@kapybara/zerosub 1.2.2 → 1.4.0
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 +11 -4
- package/client/accounts-surface.tsx +7 -0
- package/client/pills.ts +3 -3
- package/client/settings-screen.tsx +7 -0
- package/client/switch-row.tsx +2 -4
- package/package.json +1 -1
- package/server/codex.ts +1 -1
- package/server/continuations.ts +576 -0
- package/server/handoff.ts +52 -8
- package/server/limits.ts +18 -1
- package/server/service.ts +230 -17
- package/server/state.ts +30 -1
- package/shared/preferences.ts +7 -0
- package/shared/rpc.ts +1 -1
package/README.md
CHANGED
|
@@ -37,13 +37,16 @@ Then open **Accounts (ZeroSub)** in the sidebar.
|
|
|
37
37
|
- In a browser on the host's own computer, the page finishes by itself.
|
|
38
38
|
- Anywhere else, choose **Use a code instead**. For Claude, paste the code shown after sign-in. For ChatGPT, type the code shown in Paseo on the page. Phones, and hosts without a desktop (servers, containers, daemons started over SSH), start with the code.
|
|
39
39
|
3. Choose which account agents use:
|
|
40
|
-
- **Make default**: new agents, and agents that follow the default, use it.
|
|
40
|
+
- **Make default**: new agents, and agents that follow the default, use it. Open Claude agents switch right away, busy ones after their turn.
|
|
41
|
+
- To leave open agents where they are, turn off **Move open agents when the default changes** (in Accounts, or **Settings → Plugins → zerosub → ZeroSub preferences**). Each open agent that follows the default then stays pinned to the account it's using, even after it reopens, unless that account is signed out, disabled or at its limit. New agents, and agents that aren't open at the time, use the new default.
|
|
42
|
+
- A kept agent still switches when its account hits a limit. To move it to the new default, choose **Follow default** from its account button, or type `/account default`.
|
|
41
43
|
- **The account button in an agent's message box**: moves that one agent.
|
|
42
44
|
- **`/account work`** in the message box, or `/account default` to follow the default again.
|
|
43
45
|
- **⌘K → "Make … the default"**.
|
|
44
46
|
- **Disable for now** (the pause button on a card): the account stays signed in but ZeroSub stops using it. Its agents move to your other accounts right away (busy ones after their turn) and come back when you press **Enable**. ChatGPT conversations already on it stay, since they can't change accounts. You can't disable the last usable account of a provider.
|
|
45
47
|
4. Leave **Automatic switching** on (in Accounts, or **Settings → Plugins → zerosub → ZeroSub preferences**) and limits take care of themselves:
|
|
46
48
|
- Only the CLIs' own limit notices trigger a switch. That covers Claude Code's "You've hit your session limit · resets 3pm" and Codex's "You’ve hit your usage limit…".
|
|
49
|
+
- Paseo 0.13 and later no longer send the finished turn to plugins, so ZeroSub reads that turn from the agent's timeline instead.
|
|
47
50
|
- A short note in the agent's timeline says what happened.
|
|
48
51
|
- As a safety stop, one agent changes accounts at most 4 times in 10 minutes. If it hits that, its timeline says so; pick an account from its account button to carry on.
|
|
49
52
|
- An exhausted account is skipped until it resets. If you know it has room again sooner, for example after upgrading or buying credits, press **Mark as available again** (the check mark) on its card.
|
|
@@ -51,7 +54,11 @@ Then open **Accounts (ZeroSub)** in the sidebar.
|
|
|
51
54
|
### Claude vs. ChatGPT when switching mid-conversation
|
|
52
55
|
|
|
53
56
|
- **Claude:** a conversation moves to another account in place. The agent reopens on the new account with its full history and continues.
|
|
54
|
-
- **ChatGPT (Codex):** Codex encrypts its reasoning per ChatGPT account, so another account can't read an existing thread. The thread stays on its account. When it hits a limit, or you pick another account for it, ZeroSub
|
|
57
|
+
- **ChatGPT (Codex):** Codex encrypts its reasoning per ChatGPT account, so another account can't read an existing thread. The thread stays on its account. When it hits a limit, or you pick another account for it, ZeroSub carries the task on in its tab for the other account: a **continuation agent** in the same workspace, created on the first visit and reused after that. Switching A → B → A → B keeps two tabs, not four. Independent tasks keep separate tabs, even in the same workspace.
|
|
58
|
+
- A tab you return to gets the instructions and progress since it was last used, and checks the current files and Git diff before going on. Very long instructions are shortened, keeping the first one since the tab was last used (the original request, for a new tab), the latest ones and a note of how many were left out.
|
|
59
|
+
- You can type in any of a task's tabs and switch from any of them. The tab you used last is where the task continues: automatic switches and resets only move that tab, and another tab that hits a limit says in its timeline where the task went.
|
|
60
|
+
- A tab is reused while it is in the same workspace with the same account and permission mode; otherwise ZeroSub starts a new one. While one of the task's tabs is working or asking for permission, a switch you pick is refused until it stops, and an automatic switch leaves the task where it is and says so in its timeline.
|
|
61
|
+
- ZeroSub never sends a hand-off twice. If a lost connection leaves one unconfirmed, the switch stops and names the tab to check. Continuation agents from earlier versions are picked up on the first switch. New Codex agents simply start on the chosen account.
|
|
55
62
|
|
|
56
63
|
### Banked resets
|
|
57
64
|
|
|
@@ -68,7 +75,7 @@ ZeroSub tries these in order, and a timeline note says which one happened:
|
|
|
68
75
|
|
|
69
76
|
1. **Use a banked reset**, if you turned on **Use banked resets when every account is out**.
|
|
70
77
|
2. **Fork the chat to the other provider**, if you turned on **When every account is out, fork the chat to the other provider** (off by default). A stopped Claude chat continues in a new ChatGPT agent, or the other way round:
|
|
71
|
-
- The new agent opens in the same workspace with the conversation so far and goes straight back to work. It uses the other provider's default model and its account with the most room left.
|
|
78
|
+
- The new agent opens in the same workspace with the conversation so far and goes straight back to work. If that conversation began as a hand-off itself, only the start and end of the earlier one are quoted. It uses the other provider's default model and its account with the most room left.
|
|
72
79
|
- Its permission mode matches the original's level. Bypass becomes Full Access, and Accept File Edits becomes Default Permissions. Codex has no read-only or ask-first mode, so a Claude agent in Plan Mode or Always Ask isn't forked. ZeroSub never gives a fork more freedom than you gave the original.
|
|
73
80
|
- The original agent stays as it was, and prompting it again while its provider is still out points to the same fork rather than starting another.
|
|
74
81
|
- With the option off, a stopped agent's account button offers **Continue on ChatGPT (new agent)…** (or Claude) instead, with a confirmation.
|
|
@@ -104,7 +111,7 @@ ZeroSub never implements OAuth itself and never copies credentials between accou
|
|
|
104
111
|
|
|
105
112
|
## Privacy and security
|
|
106
113
|
|
|
107
|
-
- Credentials stay in the CLIs' own stores. ZeroSub's registry (`$PASEO_HOME/zerosub/state.json`) holds
|
|
114
|
+
- Credentials stay in the CLIs' own stores. ZeroSub's registry (`$PASEO_HOME/zerosub/state.json`) holds account names, emails, plans, which agent uses which account, and continuation links with timeline positions. Handoff text stays in the agents' conversation histories; it isn't copied into the registry.
|
|
108
115
|
- To show Claude usage, ZeroSub reads each account's current access token and calls Anthropic's usage endpoint, the same way Paseo's built-in usage display and `/usage` do. It never logs or stores tokens and never refreshes them itself. When you refresh usage (the ↻ button beside the title) or use a reset and a token has expired, it runs `claude -p /usage` so Claude Code renews its own sign-in. Codex usage comes from `codex app-server`.
|
|
109
116
|
- Using a banked reset calls the provider's own reset endpoint with that account's sign-in, and only after you confirm (or turn on automatic use).
|
|
110
117
|
- Removing an account moves its agents to the default account, then signs it out (`claude auth logout` / `codex` logout) and deletes its home. This happens once no agent is mid-turn on it. Abandoned sign-ins are cleaned up the same way.
|
|
@@ -639,6 +639,13 @@ function AutomationSettings({ theme }: { theme: Theme }) {
|
|
|
639
639
|
disabled={settings.saving}
|
|
640
640
|
onValueChange={(balanceNewAgents) => save({ balanceNewAgents })}
|
|
641
641
|
/>
|
|
642
|
+
<SettingsSwitch
|
|
643
|
+
label="Move open agents when the default changes"
|
|
644
|
+
hint="Off: open agents stay on the account they're using, even after they reopen. New agents, and agents that aren't open at the time, use the new default."
|
|
645
|
+
value={settings.values.moveAgentsOnDefaultChange}
|
|
646
|
+
disabled={settings.saving}
|
|
647
|
+
onValueChange={(moveAgentsOnDefaultChange) => save({ moveAgentsOnDefaultChange })}
|
|
648
|
+
/>
|
|
642
649
|
<SettingsSwitch
|
|
643
650
|
label="Use banked resets when every account is out"
|
|
644
651
|
hint="Spends one of the account's banked resets instead of stopping. Resets are scarce, so this is off unless you turn it on."
|
package/client/pills.ts
CHANGED
|
@@ -169,13 +169,13 @@ function buttonFor(
|
|
|
169
169
|
await store.rpc(setAgentAccount, { agentId: agent.id, accountId });
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
// Codex threads can't change
|
|
172
|
+
// Codex threads can't change accounts in place; continue in this task's tab for that account.
|
|
173
173
|
const movable = route?.movable ?? true;
|
|
174
174
|
const items: PluginButtonMenuEntry[] = accounts.map((account, index) => ({
|
|
175
175
|
kind: "item",
|
|
176
176
|
id: `account-${index}`,
|
|
177
|
-
title: account.id === current.id || movable ? menuTitle(account) : `Continue on ${account.label}
|
|
178
|
-
icon: account.id === current.id ? "CircleCheck" : movable ? "Circle" : "
|
|
177
|
+
title: account.id === current.id || movable ? menuTitle(account) : `Continue on ${account.label}`,
|
|
178
|
+
icon: account.id === current.id ? "CircleCheck" : movable ? "Circle" : "ArrowRightLeft",
|
|
179
179
|
disabled: account.status === "signed_out" || account.status === "disabled" || account.id === current.id,
|
|
180
180
|
behavior: { kind: "action", onPress: choose(account.id) },
|
|
181
181
|
}));
|
|
@@ -42,6 +42,13 @@ export function PreferencesScreen({ theme, host, onOpenAccounts }: PluginSurface
|
|
|
42
42
|
actionLabel="Open accounts"
|
|
43
43
|
onPress={onOpenAccounts}
|
|
44
44
|
/>
|
|
45
|
+
<SettingsSwitch
|
|
46
|
+
label="Move open agents when the default changes"
|
|
47
|
+
hint="Off: open agents stay on the account they're using, even after they reopen. New agents, and agents that aren't open at the time, use the new default."
|
|
48
|
+
value={settings.values.moveAgentsOnDefaultChange}
|
|
49
|
+
disabled={settings.saving}
|
|
50
|
+
onValueChange={(moveAgentsOnDefaultChange) => save({ moveAgentsOnDefaultChange })}
|
|
51
|
+
/>
|
|
45
52
|
</SettingsCard>
|
|
46
53
|
</SettingsSection>
|
|
47
54
|
<SettingsSection title="Automatic switching">
|
package/client/switch-row.tsx
CHANGED
|
@@ -56,7 +56,7 @@ export function describeRow(row: SwitchRow): string {
|
|
|
56
56
|
switch (row.outcome) {
|
|
57
57
|
case "continued":
|
|
58
58
|
return row.continuedIn
|
|
59
|
-
? `${lead}ChatGPT conversations can't change accounts, so this
|
|
59
|
+
? `${lead}ChatGPT conversations can't change accounts, so this task continues in “${row.continuedIn.title}” on ${row.to}.`
|
|
60
60
|
: `${lead}Continuing on ${row.to}.`;
|
|
61
61
|
case "stayed":
|
|
62
62
|
return `${lead}This conversation stays on ${row.from ?? "its account"}.${row.detail ? ` ${row.detail}` : ""}`;
|
|
@@ -80,9 +80,7 @@ export function SwitchRowView({ item, theme }: PluginTimelineItemProps<SwitchRow
|
|
|
80
80
|
? "GitFork"
|
|
81
81
|
: row.reason === "exhausted" || row.outcome === "stayed"
|
|
82
82
|
? "CircleAlert"
|
|
83
|
-
: row.outcome === "
|
|
84
|
-
? "CopyPlus"
|
|
85
|
-
: row.outcome === "reset"
|
|
83
|
+
: row.outcome === "reset"
|
|
86
84
|
? "TimerReset"
|
|
87
85
|
: "ArrowRightLeft";
|
|
88
86
|
return (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kapybara/zerosub",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "ZeroSub: use several Claude and ChatGPT (Codex) subscriptions side by side in Paseo. Add accounts in-app, pick one per agent, and switch automatically when an account hits its limit.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paseo",
|
package/server/codex.ts
CHANGED
|
@@ -70,7 +70,7 @@ class AppServer {
|
|
|
70
70
|
try {
|
|
71
71
|
await server.request(
|
|
72
72
|
"initialize",
|
|
73
|
-
{ clientInfo: { name: CLIENT_NAME, title: "Paseo ZeroSub", version: "1.
|
|
73
|
+
{ clientInfo: { name: CLIENT_NAME, title: "Paseo ZeroSub", version: "1.4.0" }, capabilities: { experimentalApi: false } },
|
|
74
74
|
60_000,
|
|
75
75
|
);
|
|
76
76
|
server.send({ method: "initialized" });
|