The best way to control Claude Code, Codex and more from any computer or phone

main
ts 72 lines 2.22 KB
Raw
1 import * as Schema from "effect/Schema";
2
3 export class ServerCliCommandExitError extends Schema.TaggedError<ServerCliCommandExitError>()(
4 "ServerCliCommandExitError",
5 {
6 command: Schema.String,
7 args: Schema.Array(Schema.String),
8 cwd: Schema.optional(Schema.String),
9 exitCode: Schema.Int,
10 },
11 ) {
12 override get message(): string {
13 return `Command exited with non-zero exit code (${this.exitCode})`;
14 }
15 }
16
17 export class ServerCliDevelopmentIconSourceMissingError extends Schema.TaggedError<ServerCliDevelopmentIconSourceMissingError>()(
18 "ServerCliDevelopmentIconSourceMissingError",
19 {
20 sourcePath: Schema.String,
21 },
22 ) {
23 override get message(): string {
24 return `Missing development icon source: ${this.sourcePath}`;
25 }
26 }
27
28 export class ServerCliDevelopmentIconTargetMissingError extends Schema.TaggedError<ServerCliDevelopmentIconTargetMissingError>()(
29 "ServerCliDevelopmentIconTargetMissingError",
30 {
31 targetPath: Schema.String,
32 },
33 ) {
34 override get message(): string {
35 return `Missing development icon target: ${this.targetPath}. Build web first.`;
36 }
37 }
38
39 export class ServerCliBuildAssetMissingError extends Schema.TaggedError<ServerCliBuildAssetMissingError>()(
40 "ServerCliBuildAssetMissingError",
41 {
42 assetPath: Schema.String,
43 },
44 ) {
45 override get message(): string {
46 return `Missing build asset: ${this.assetPath}. Run the build subcommand first.`;
47 }
48 }
49
50 export class ServerCliExecutableImportError extends Schema.TaggedError<ServerCliExecutableImportError>()(
51 "ServerCliExecutableImportError",
52 {
53 bundlePath: Schema.String,
54 specifiers: Schema.Array(Schema.String),
55 },
56 ) {
57 override get message(): string {
58 return `${this.bundlePath} imports file-backed packages that a single-executable cannot resolve: ${this.specifiers.join(", ")}. Load them through createRequire instead.`;
59 }
60 }
61
62 export class ServerCliBootstrapTooLargeError extends Schema.TaggedError<ServerCliBootstrapTooLargeError>()(
63 "ServerCliBootstrapTooLargeError",
64 {
65 bootstrapPath: Schema.String,
66 bytes: Schema.Number,
67 },
68 ) {
69 override get message(): string {
70 return `${this.bootstrapPath} is ${this.bytes} bytes. The CLI was bundled into the executable bootstrap; keep ./binMain.ts external.`;
71 }
72 }