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