@kapybara/zerosub 1.19.0 → 1.19.2
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 -1
- package/client/composer-item.tsx +13 -3
- package/package.json +1 -1
- package/server/codex.ts +1 -1
- package/server/routing.ts +2 -1
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ Then open **Accounts (ZeroSub)** in the sidebar.
|
|
|
64
64
|
|
|
65
65
|
### Choose accounts for new agents
|
|
66
66
|
|
|
67
|
-
Turn on **Spread new agents across accounts** to select an account from its usage. For ChatGPT agents, ZeroSub prefers an account when its weekly limit resets within one day and both limits have at least 20% left. Usage for every available account must be complete and less than 30 minutes old. Otherwise, and always for Claude agents, ZeroSub paces the accounts. It projects each account's 5-hour use an hour ahead from how fast it has used its current window, and adds 10% for each agent it placed there in the last 10 minutes, since readings lag behind new agents. It also compares weekly use with how much of the week has passed. An account projected to reach 80% of its 5-hour window, or already there, ranks behind every account that isn't. Among the rest, each account counts by the higher of its two figures, and the account with the lowest wins, so new agents use weekly room that would otherwise expire and avoid accounts running ahead of their week, and accounts don't all run out together. An account whose window has reset since its last reading counts by what it has left. While this is on, automatic switching picks the account to move to the same way. While it's off, switching picks the account with the most room, and an account at 80% of its 5-hour window ranks behind any under it. When a near weekly reset was the reason, the agent's account
|
|
67
|
+
Turn on **Spread new agents across accounts** to select an account from its usage. For ChatGPT agents, ZeroSub prefers an account when its weekly limit resets within one day and both limits have at least 20% left. Usage for every available account must be complete and less than 30 minutes old. Otherwise, and always for Claude agents, ZeroSub paces the accounts. It projects each account's 5-hour use an hour ahead from how fast it has used its current window, and adds 10% for each agent it placed there in the last 10 minutes, since readings lag behind new agents. It also compares weekly use with how much of the week has passed. An account projected to reach 80% of its 5-hour window, or already there, ranks behind every account that isn't. Among the rest, each account counts by the higher of its two figures, and the account with the lowest wins, so new agents use weekly room that would otherwise expire and avoid accounts running ahead of their week, and accounts don't all run out together. An account whose window has reset since its last reading counts by what it has left. While this is on, automatic switching picks the account to move to the same way. While it's off, switching picks the account with the most room, and an account at 80% of its 5-hour window ranks behind any under it. When a near weekly reset was the reason, the agent's account says so: **Weekly reset was near** beside the account in the **Account** control's list, or **Started here: weekly reset was near** in the account button's menu where there is no control. Otherwise, existing agents stay on their accounts.
|
|
68
68
|
|
|
69
69
|
With **Automatic switching** on too, ZeroSub also moves Claude agents that have been idle for an hour or more off an account projected to reach 80% of its 5-hour window. They go only to an account with room in both windows that stays under 80% of its 5-hour window with them. Agents used within the last hour stay put. Their next turn would cost more on another account, which has none of the conversation cached yet. Agents you put on an account yourself stay too, and so do ChatGPT agents, since their threads can't change accounts.
|
|
70
70
|
|
package/client/composer-item.tsx
CHANGED
|
@@ -42,6 +42,9 @@ export interface AccountChoices {
|
|
|
42
42
|
icon: string;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/** Beside an agent's account in its list, when the agent started there because the account's weekly reset was near. */
|
|
46
|
+
export const WEEKLY_RESET_NOTE = "Weekly reset was near";
|
|
47
|
+
|
|
45
48
|
/** The option that names no account: the agent starts, or goes back to, where the default sends it. */
|
|
46
49
|
export const FOLLOW = "follow";
|
|
47
50
|
/** The option that opens the Accounts screen. */
|
|
@@ -86,7 +89,8 @@ export function accountChoices(state: StateView, provider: string | null, chosen
|
|
|
86
89
|
/**
|
|
87
90
|
* What the account control offers for a running agent: the account it's on first (named with the
|
|
88
91
|
* one it's moving from while a move is under way, as on the account button), then the accounts it
|
|
89
|
-
* can move to, going back to the default, and the Accounts screen.
|
|
92
|
+
* can move to, going back to the default, and the Accounts screen. The agent's account also says
|
|
93
|
+
* when the agent started on it because its weekly reset was near. Null when the agent isn't routed
|
|
90
94
|
* or its provider has one account. What needs a confirmation, a banked reset or a fork to the other
|
|
91
95
|
* provider, stays with the account button, which shows for it (see pills.ts).
|
|
92
96
|
*/
|
|
@@ -101,7 +105,13 @@ export function agentChoices(state: StateView, agentId: string): AccountChoices
|
|
|
101
105
|
const { label } = pillText(current, running ?? null, route.waiting ?? (state.canReopen ? "idle" : "restart"));
|
|
102
106
|
// As on the account button: pacing's verdict names the account it picks for the next new agent.
|
|
103
107
|
const next = (account: AccountView) => state.pacedNext?.[account.family] === account.id;
|
|
104
|
-
|
|
108
|
+
// Why the agent is on this account, which the account button's menu says as "Started here: weekly
|
|
109
|
+
// reset was near": with the control there, that button doesn't show for an agent that isn't at a
|
|
110
|
+
// limit. Short, as a list cuts a description to one line. On this account it stands in place of
|
|
111
|
+
// pacing's verdict, which the others keep; without pacing the usage comes after it.
|
|
112
|
+
const options: AccountOption[] = [
|
|
113
|
+
{ value: current.id, label, description: detail(current, next(current), route.selectionReason === "weekly_reset" ? WEEKLY_RESET_NOTE : undefined) },
|
|
114
|
+
];
|
|
105
115
|
// Codex threads can't change accounts in place and continue in the task's tab for the account;
|
|
106
116
|
// Grok conversations stay on theirs, so the others aren't offered.
|
|
107
117
|
const stays = !route.movable && !HAND_OFF[route.family];
|
|
@@ -123,7 +133,7 @@ function takesAgents(state: StateView, account: AccountView): boolean {
|
|
|
123
133
|
}
|
|
124
134
|
|
|
125
135
|
function detail(account: AccountView, next: boolean, lead?: string): string | undefined {
|
|
126
|
-
// A pace and a lead
|
|
136
|
+
// A pace and a lead: the lead (a one-time pick, or why the agent started here) wins over pacing's verdict.
|
|
127
137
|
if (account.pace) return lead ?? paceVerdict(account.pace, next);
|
|
128
138
|
const parts = lead ? [lead] : [];
|
|
129
139
|
if (account.status === "limited") parts.push("Limit reached");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kapybara/zerosub",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.2",
|
|
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
|
@@ -71,7 +71,7 @@ class AppServer {
|
|
|
71
71
|
try {
|
|
72
72
|
await server.request(
|
|
73
73
|
"initialize",
|
|
74
|
-
{ clientInfo: { name: CLIENT_NAME, title: "Paseo ZeroSub", version: "1.19.
|
|
74
|
+
{ clientInfo: { name: CLIENT_NAME, title: "Paseo ZeroSub", version: "1.19.2" }, capabilities: { experimentalApi: false } },
|
|
75
75
|
60_000,
|
|
76
76
|
);
|
|
77
77
|
server.send({ method: "initialized" });
|
package/server/routing.ts
CHANGED
|
@@ -457,8 +457,9 @@ export function chooseAccount(state: StoredState, input: RouteInput): RouteDecis
|
|
|
457
457
|
// A paid stand-in is only kept while no subscription account could take over from it.
|
|
458
458
|
const keeps = (stand: StoredAccount) =>
|
|
459
459
|
!isLastResort(stand) || !accountsOf(state, input.family).some((other) => other.id !== account!.id && canStandIn(other, input.now, input.model));
|
|
460
|
+
const stays = (stand: StoredAccount) => canStandIn(stand, input.now, input.model) || (isLastResort(stand) && isUsable(stand, input.now, input.model));
|
|
460
461
|
let alternative =
|
|
461
|
-
staying && staying.family === input.family && staying.id !== account.id &&
|
|
462
|
+
staying && staying.family === input.family && staying.id !== account.id && stays(staying) && keeps(staying)
|
|
462
463
|
? staying
|
|
463
464
|
: mostAvailable(state, input.family, input.usageOf, input.now, new Set([account.id]), input.paidFallback, pacing, input.model);
|
|
464
465
|
// Before a paid stand-in, a limited subscription with a usable banked reset: the account itself
|