@kapybara/zerosub 1.0.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/LICENSE +21 -0
- package/README.md +152 -0
- package/client/accounts-surface.tsx +592 -0
- package/client/add-account.tsx +351 -0
- package/client/commands.ts +112 -0
- package/client/fork-confirm.tsx +57 -0
- package/client/pills.ts +251 -0
- package/client/reset-confirm.tsx +138 -0
- package/client/settings-screen.tsx +120 -0
- package/client/store.ts +139 -0
- package/client/switch-row.tsx +103 -0
- package/client/ui.tsx +231 -0
- package/index.client.tsx +39 -0
- package/index.server.ts +91 -0
- package/package.json +58 -0
- package/paseo-plugin.json +7 -0
- package/server/adapter.ts +126 -0
- package/server/binaries.ts +63 -0
- package/server/claude-resets.ts +192 -0
- package/server/claude.ts +478 -0
- package/server/codex.ts +459 -0
- package/server/families.ts +78 -0
- package/server/handoff.ts +175 -0
- package/server/homes.ts +352 -0
- package/server/json-file.ts +39 -0
- package/server/limits.ts +213 -0
- package/server/machine.ts +17 -0
- package/server/modes.ts +34 -0
- package/server/paths.ts +37 -0
- package/server/process.ts +66 -0
- package/server/reopen.ts +95 -0
- package/server/routing.ts +131 -0
- package/server/service.ts +1692 -0
- package/server/state.ts +177 -0
- package/server/switch-guard.ts +28 -0
- package/server/usage.ts +68 -0
- package/shared/format.ts +99 -0
- package/shared/model.ts +150 -0
- package/shared/preferences.ts +32 -0
- package/shared/rpc.ts +120 -0
- package/shared/timeline.ts +42 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FamilySchema } from "./model";
|
|
3
|
+
|
|
4
|
+
export const SWITCH_ROW_KIND = "zerosub-switch";
|
|
5
|
+
export const SWITCH_ROW_VERSION = 1;
|
|
6
|
+
|
|
7
|
+
export const SwitchRowSchema = z.object({
|
|
8
|
+
family: FamilySchema,
|
|
9
|
+
from: z.string().nullable(),
|
|
10
|
+
to: z.string(),
|
|
11
|
+
reason: z.enum([
|
|
12
|
+
/** `from` hit its usage limit. */
|
|
13
|
+
"limit",
|
|
14
|
+
/** `from` is no longer signed in. */
|
|
15
|
+
"signed_out",
|
|
16
|
+
/** The user picked another account for this agent. */
|
|
17
|
+
"manual",
|
|
18
|
+
/** The default account changed and this agent follows it. */
|
|
19
|
+
"default",
|
|
20
|
+
/** `from` was removed. */
|
|
21
|
+
"removed",
|
|
22
|
+
/** Every account of this provider is at its limit; nothing to switch to. */
|
|
23
|
+
"exhausted",
|
|
24
|
+
]),
|
|
25
|
+
/** When the exhausted account frees up again, if known. */
|
|
26
|
+
resetsAt: z.string().nullable(),
|
|
27
|
+
/** A follow-up was sent so the interrupted turn continues. */
|
|
28
|
+
continued: z.boolean(),
|
|
29
|
+
/** The conversation could not move in place and carries on in this new agent. */
|
|
30
|
+
continuedIn: z.object({ agentId: z.string(), title: z.string() }).nullable().default(null),
|
|
31
|
+
/** Set when `continuedIn` runs on the other provider (a fork from Claude to ChatGPT, or back). */
|
|
32
|
+
toFamily: FamilySchema.nullable().default(null),
|
|
33
|
+
/**
|
|
34
|
+
* `switched`: the agent now runs on `to`. `pending`: it moves when its session next starts.
|
|
35
|
+
* `continued`: the work goes on in `continuedIn`. `stayed`: it remains on `from` (see `detail`).
|
|
36
|
+
* `reset`: a banked reset refilled `from`, and the agent stayed on it.
|
|
37
|
+
*/
|
|
38
|
+
outcome: z.enum(["switched", "pending", "continued", "stayed", "reset"]).default("switched"),
|
|
39
|
+
detail: z.string().nullable().default(null),
|
|
40
|
+
at: z.string(),
|
|
41
|
+
});
|
|
42
|
+
export type SwitchRow = z.infer<typeof SwitchRowSchema>;
|