@tiny-fish/cli 0.15.1-next.158 → 0.15.1-next.159

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.
@@ -0,0 +1,135 @@
1
+ import { z } from "zod";
2
+ /** Bumped whenever a consumer could misread the payload; the cookbook skill releases separately. */
3
+ export declare const DOCTOR_SCHEMA_VERSION = 1;
4
+ declare const checkStatusSchema: z.ZodEnum<{
5
+ pass: "pass";
6
+ fail: "fail";
7
+ warn: "warn";
8
+ skip: "skip";
9
+ }>;
10
+ declare const doctorCheckSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ title: z.ZodString;
13
+ status: z.ZodEnum<{
14
+ pass: "pass";
15
+ fail: "fail";
16
+ warn: "warn";
17
+ skip: "skip";
18
+ }>;
19
+ detail: z.ZodString;
20
+ harness: z.ZodNullable<z.ZodEnum<{
21
+ openclaw: "openclaw";
22
+ cursor: "cursor";
23
+ codex: "codex";
24
+ hermes: "hermes";
25
+ "claude-code": "claude-code";
26
+ }>>;
27
+ }, z.core.$strip>;
28
+ declare const doctorHarnessSchema: z.ZodObject<{
29
+ harness: z.ZodEnum<{
30
+ openclaw: "openclaw";
31
+ cursor: "cursor";
32
+ codex: "codex";
33
+ hermes: "hermes";
34
+ "claude-code": "claude-code";
35
+ }>;
36
+ detected: z.ZodBoolean;
37
+ registered: z.ZodEnum<{
38
+ unknown: "unknown";
39
+ yes: "yes";
40
+ no: "no";
41
+ }>;
42
+ auth_mode: z.ZodEnum<{
43
+ unknown: "unknown";
44
+ oauth: "oauth";
45
+ "api-key": "api-key";
46
+ }>;
47
+ proves_harness_reach: z.ZodBoolean;
48
+ }, z.core.$strip>;
49
+ declare const doctorRepairSchema: z.ZodObject<{
50
+ for: z.ZodString;
51
+ action: z.ZodEnum<{
52
+ connect: "connect";
53
+ "auth-login": "auth-login";
54
+ }>;
55
+ harness: z.ZodNullable<z.ZodEnum<{
56
+ openclaw: "openclaw";
57
+ cursor: "cursor";
58
+ codex: "codex";
59
+ hermes: "hermes";
60
+ "claude-code": "claude-code";
61
+ }>>;
62
+ command: z.ZodString;
63
+ unattended_safe: z.ZodBoolean;
64
+ }, z.core.$strip>;
65
+ export declare const doctorReportSchema: z.ZodObject<{
66
+ schema_version: z.ZodInt;
67
+ cli_version: z.ZodString;
68
+ ok: z.ZodBoolean;
69
+ checks: z.ZodArray<z.ZodObject<{
70
+ id: z.ZodString;
71
+ title: z.ZodString;
72
+ status: z.ZodEnum<{
73
+ pass: "pass";
74
+ fail: "fail";
75
+ warn: "warn";
76
+ skip: "skip";
77
+ }>;
78
+ detail: z.ZodString;
79
+ harness: z.ZodNullable<z.ZodEnum<{
80
+ openclaw: "openclaw";
81
+ cursor: "cursor";
82
+ codex: "codex";
83
+ hermes: "hermes";
84
+ "claude-code": "claude-code";
85
+ }>>;
86
+ }, z.core.$strip>>;
87
+ harnesses: z.ZodArray<z.ZodObject<{
88
+ harness: z.ZodEnum<{
89
+ openclaw: "openclaw";
90
+ cursor: "cursor";
91
+ codex: "codex";
92
+ hermes: "hermes";
93
+ "claude-code": "claude-code";
94
+ }>;
95
+ detected: z.ZodBoolean;
96
+ registered: z.ZodEnum<{
97
+ unknown: "unknown";
98
+ yes: "yes";
99
+ no: "no";
100
+ }>;
101
+ auth_mode: z.ZodEnum<{
102
+ unknown: "unknown";
103
+ oauth: "oauth";
104
+ "api-key": "api-key";
105
+ }>;
106
+ proves_harness_reach: z.ZodBoolean;
107
+ }, z.core.$strip>>;
108
+ repairs: z.ZodArray<z.ZodObject<{
109
+ for: z.ZodString;
110
+ action: z.ZodEnum<{
111
+ connect: "connect";
112
+ "auth-login": "auth-login";
113
+ }>;
114
+ harness: z.ZodNullable<z.ZodEnum<{
115
+ openclaw: "openclaw";
116
+ cursor: "cursor";
117
+ codex: "codex";
118
+ hermes: "hermes";
119
+ "claude-code": "claude-code";
120
+ }>>;
121
+ command: z.ZodString;
122
+ unattended_safe: z.ZodBoolean;
123
+ }, z.core.$strip>>;
124
+ }, z.core.$strip>;
125
+ export type CheckStatus = z.infer<typeof checkStatusSchema>;
126
+ export type DoctorCheck = z.infer<typeof doctorCheckSchema>;
127
+ export type DoctorHarness = z.infer<typeof doctorHarnessSchema>;
128
+ export type DoctorRepair = z.infer<typeof doctorRepairSchema>;
129
+ export type DoctorReport = z.infer<typeof doctorReportSchema>;
130
+ /** Doctor itself broke, which is a different claim from "your setup is broken". */
131
+ export declare const DOCTOR_COULD_NOT_RUN = 2;
132
+ /** Skips never fail the run; a skip means not applicable, not broken. */
133
+ export declare function exitCodeFor(checks: DoctorCheck[]): 0 | 1;
134
+ export declare function renderPretty(report: DoctorReport): string;
135
+ export {};
@@ -0,0 +1,60 @@
1
+ import { z } from "zod";
2
+ import { FIVE_HARNESSES } from "./harness-detect.js";
3
+ /** Bumped whenever a consumer could misread the payload; the cookbook skill releases separately. */
4
+ export const DOCTOR_SCHEMA_VERSION = 1;
5
+ const checkStatusSchema = z.enum(["pass", "fail", "warn", "skip"]);
6
+ const harnessSchema = z.enum(FIVE_HARNESSES);
7
+ const doctorCheckSchema = z.object({
8
+ id: z.string(),
9
+ title: z.string(),
10
+ status: checkStatusSchema,
11
+ detail: z.string(),
12
+ harness: harnessSchema.nullable(),
13
+ });
14
+ const doctorHarnessSchema = z.object({
15
+ harness: harnessSchema,
16
+ detected: z.boolean(),
17
+ registered: z.enum(["yes", "no", "unknown"]),
18
+ auth_mode: z.enum(["api-key", "oauth", "unknown"]),
19
+ proves_harness_reach: z.boolean(),
20
+ });
21
+ // `action` is what `--fix` dispatches on, not the harness field: keying off a null harness
22
+ // conflated "run auth login" with a non-executable repair and the credential fix never ran.
23
+ const doctorRepairSchema = z.object({
24
+ for: z.string(),
25
+ action: z.enum(["connect", "auth-login"]),
26
+ harness: harnessSchema.nullable(),
27
+ command: z.string(),
28
+ unattended_safe: z.boolean(),
29
+ });
30
+ export const doctorReportSchema = z
31
+ .object({
32
+ // Not `z.literal`: a consumer must be able to read a future version and say so.
33
+ schema_version: z.int().positive(),
34
+ cli_version: z.string(),
35
+ ok: z.boolean(),
36
+ checks: z.array(doctorCheckSchema),
37
+ harnesses: z.array(doctorHarnessSchema),
38
+ repairs: z.array(doctorRepairSchema),
39
+ })
40
+ // A report that says ok while a check failed is worse than no report.
41
+ .refine((report) => !report.ok || report.checks.every((check) => check.status !== "fail"), {
42
+ message: "ok cannot be true while a check has failed",
43
+ path: ["ok"],
44
+ });
45
+ const GLYPHS = { pass: "✓", fail: "✗", warn: "⚠", skip: "…" };
46
+ /** Doctor itself broke, which is a different claim from "your setup is broken". */
47
+ export const DOCTOR_COULD_NOT_RUN = 2;
48
+ /** Skips never fail the run; a skip means not applicable, not broken. */
49
+ export function exitCodeFor(checks) {
50
+ return checks.some((check) => check.status === "fail") ? 1 : 0;
51
+ }
52
+ export function renderPretty(report) {
53
+ const lines = report.checks.map((c) => `${GLYPHS[c.status]} ${c.title}${c.detail ? ` — ${c.detail}` : ""}`);
54
+ if (report.repairs.length > 0) {
55
+ lines.push("", "Repairs:");
56
+ for (const repair of report.repairs)
57
+ lines.push(` ${repair.command}`);
58
+ }
59
+ return lines.join("\n");
60
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiny-fish/cli",
3
- "version": "0.15.1-next.158",
3
+ "version": "0.15.1-next.159",
4
4
  "description": "TinyFish CLI — run web automations from your terminal",
5
5
  "type": "module",
6
6
  "bin": {