@mintlify/cli 4.0.1466 → 4.0.1468
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/__test__/mintTestFilePreview.test.ts +35 -0
- package/__test__/mintTestOutput.test.ts +194 -0
- package/__test__/runHistory.test.ts +164 -0
- package/bin/agent-harness/agentPreflight.js +24 -0
- package/bin/agent-harness/buildTaskPrompt.js +17 -7
- package/bin/agent-harness/countReport.js +10 -0
- package/bin/agent-harness/executeCodeBlocks.js +53 -10
- package/bin/agent-harness/generateTestCode.js +58 -43
- package/bin/agent-harness/index.js +14 -5
- package/bin/agent-harness/manifest.js +113 -0
- package/bin/agent-harness/runHistory.js +252 -0
- package/bin/agent-harness/setupFolders.js +20 -6
- package/bin/agent-harness/tasks/checkTestability.js +7 -5
- package/bin/agent-harness/types.js +33 -2
- package/bin/constants.js +3 -3
- package/bin/mintTest.js +14 -12
- package/bin/mintTestFilePreview.js +39 -0
- package/bin/mintTestText.js +31 -0
- package/bin/mintTestUi.js +295 -105
- package/bin/status.js +26 -0
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/agent-harness/MINT_TEST_SYSTEM_DESIGN.md +15 -9
- package/src/agent-harness/agentPreflight.ts +13 -0
- package/src/agent-harness/buildTaskPrompt.ts +18 -7
- package/src/agent-harness/countReport.ts +17 -0
- package/src/agent-harness/executeCodeBlocks.ts +67 -1
- package/src/agent-harness/generateTestCode.ts +81 -51
- package/src/agent-harness/index.ts +20 -5
- package/src/agent-harness/manifest.ts +116 -0
- package/src/agent-harness/runHistory.ts +250 -0
- package/src/agent-harness/setupFolders.ts +19 -5
- package/src/agent-harness/tasks/checkTestability.ts +15 -6
- package/src/agent-harness/types.ts +81 -5
- package/src/constants.ts +6 -2
- package/src/mintTest.tsx +15 -11
- package/src/mintTestFilePreview.ts +32 -0
- package/src/mintTestText.ts +35 -0
- package/src/mintTestUi.tsx +586 -224
- package/src/status.tsx +24 -0
package/src/status.tsx
CHANGED
|
@@ -30,6 +30,30 @@ export async function getCliStatus(
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
export type CliStatusResult =
|
|
34
|
+
| { ok: true; status: z.infer<typeof StatusResponseSchema> }
|
|
35
|
+
| { ok: false; reason: 'unauthenticated' | 'unreachable' | 'invalid'; detail?: string };
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Like getCliStatus, but refreshes an expired session and says why it failed, so commands can
|
|
39
|
+
* tell "log in again" apart from "the server is down" and from "not allowed".
|
|
40
|
+
*/
|
|
41
|
+
export async function fetchCliStatus(): Promise<CliStatusResult> {
|
|
42
|
+
let res: Response;
|
|
43
|
+
try {
|
|
44
|
+
res = await authenticatedFetch(`${API_URL}/api/cli/status`);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
47
|
+
if (/not authenticated/i.test(detail)) return { ok: false, reason: 'unauthenticated' };
|
|
48
|
+
return { ok: false, reason: 'unreachable', detail };
|
|
49
|
+
}
|
|
50
|
+
if (res.status === 401 || res.status === 403) return { ok: false, reason: 'unauthenticated' };
|
|
51
|
+
if (!res.ok) return { ok: false, reason: 'unreachable', detail: `HTTP ${res.status}` };
|
|
52
|
+
const parsed = StatusResponseSchema.safeParse(await res.json().catch(() => null));
|
|
53
|
+
if (!parsed.success) return { ok: false, reason: 'invalid' };
|
|
54
|
+
return { ok: true, status: parsed.data };
|
|
55
|
+
}
|
|
56
|
+
|
|
33
57
|
export async function getCliSubdomains(accessToken: string): Promise<string[]> {
|
|
34
58
|
const status = await getCliStatus(accessToken);
|
|
35
59
|
return status?.subdomains ?? [];
|