badgr-cli 1.1.1 → 1.1.3

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 (73) hide show
  1. package/LICENSE +207 -0
  2. package/README.md +13 -6
  3. package/package.json +44 -2
  4. package/src/api.js +16 -0
  5. package/src/badgr.js +26 -10
  6. package/src/commands/batch.js +11 -0
  7. package/src/commands/billing.js +3 -3
  8. package/src/commands/comfyui.js +31 -15
  9. package/src/commands/connect.js +4 -1
  10. package/src/commands/diagnose.js +493 -0
  11. package/src/commands/embed.js +13 -10
  12. package/src/commands/job.js +246 -0
  13. package/src/commands/launch.js +152 -16
  14. package/src/commands/login.js +75 -20
  15. package/src/commands/run.js +74 -16
  16. package/src/commands/sbatch.js +6 -1
  17. package/src/commands/serve.js +44 -30
  18. package/src/commands/train.js +8 -12
  19. package/src/commands/transcribe.js +13 -10
  20. package/src/credentials.js +33 -0
  21. package/src/envFlag.js +10 -0
  22. package/src/fallback.js +13 -2
  23. package/src/onboarding.js +8 -1
  24. package/src/progress.js +48 -0
  25. package/src/commands/task.js +0 -25
  26. package/tests/agent-images.test.js +0 -17
  27. package/tests/api.test.js +0 -168
  28. package/tests/artifactDownload.test.js +0 -113
  29. package/tests/artifacts.test.js +0 -168
  30. package/tests/batch.test.js +0 -641
  31. package/tests/browser.test.js +0 -51
  32. package/tests/capacity.test.js +0 -68
  33. package/tests/commands.test.js +0 -417
  34. package/tests/config.test.js +0 -96
  35. package/tests/connect.test.js +0 -83
  36. package/tests/detect.test.js +0 -191
  37. package/tests/down.test.js +0 -150
  38. package/tests/errors.test.js +0 -130
  39. package/tests/fallback-timeout.test.js +0 -41
  40. package/tests/fanout.test.js +0 -124
  41. package/tests/gpu-doctor-classifiers.test.js +0 -402
  42. package/tests/gpu-doctor-doctor.test.js +0 -304
  43. package/tests/gpu-doctor-probe-cache.test.js +0 -110
  44. package/tests/gpu-doctor-probes.test.js +0 -257
  45. package/tests/heartbeat.test.js +0 -70
  46. package/tests/job-progress-poll.test.js +0 -136
  47. package/tests/launch-command-argv.test.js +0 -93
  48. package/tests/launch-readiness.test.js +0 -403
  49. package/tests/launch.test.js +0 -440
  50. package/tests/onboarding.test.js +0 -134
  51. package/tests/productized-dry-run.test.js +0 -141
  52. package/tests/productized-runners.test.js +0 -237
  53. package/tests/pull.test.js +0 -266
  54. package/tests/rerun.test.js +0 -94
  55. package/tests/restart.test.js +0 -88
  56. package/tests/router.test.js +0 -98
  57. package/tests/run-lifecycle.test.js +0 -1054
  58. package/tests/sbatch.test.js +0 -190
  59. package/tests/secrets.test.js +0 -16
  60. package/tests/serve-apps.test.js +0 -189
  61. package/tests/serve-lifecycle.test.js +0 -931
  62. package/tests/slurm.test.js +0 -77
  63. package/tests/spec.test.js +0 -201
  64. package/tests/status.test.js +0 -73
  65. package/tests/store.test.js +0 -187
  66. package/tests/task.test.js +0 -109
  67. package/tests/template.test.js +0 -556
  68. package/tests/train-lora-dataset.test.js +0 -176
  69. package/tests/upload.test.js +0 -79
  70. package/tests/workload-rerun.test.js +0 -56
  71. package/tests/workload-spec.test.js +0 -180
  72. package/tests/workload-templates.test.js +0 -865
  73. package/tests/workload-workspace-paths.test.js +0 -46
@@ -1,46 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from 'vitest';
2
-
3
- // Capture every path passed to callApi so we can assert the CLI never builds a
4
- // doubled `/v1/v1/...` URL. baseUrl already ends in `/v1`, so command paths must
5
- // be unprefixed (e.g. `/workspaces`, not `/v1/workspaces`).
6
- const calls = [];
7
- vi.mock('../src/api.js', () => ({
8
- callApi: vi.fn(async (path) => {
9
- calls.push(path);
10
- if (path.startsWith('/workspaces')) return { workspaces: [], total: 0 };
11
- if (path.startsWith('/workloads')) return { workloads: [], total: 0 };
12
- return {};
13
- }),
14
- }));
15
-
16
- const { workspaceCommand } = await import('../src/commands/workspace.js');
17
- const { workloadCommand } = await import('../src/commands/workload.js');
18
-
19
- // chalk stub: any style method returns its first argument unchanged.
20
- const chalk = new Proxy({}, { get: () => (s) => s });
21
- const config = { apiKey: 'test-key', baseUrl: 'https://aibadgr.com/v1' };
22
-
23
- function assertNoDoubleV1() {
24
- expect(calls.length).toBeGreaterThan(0);
25
- for (const path of calls) {
26
- expect(path.startsWith('/v1/')).toBe(false);
27
- expect(`${config.baseUrl}${path}`).not.toContain('/v1/v1/');
28
- }
29
- }
30
-
31
- beforeEach(() => {
32
- calls.length = 0;
33
- vi.spyOn(console, 'log').mockImplementation(() => {});
34
- });
35
-
36
- describe('CLI workload/workspace request paths', () => {
37
- it('workspace list targets /workspaces (no doubled /v1)', async () => {
38
- await workspaceCommand(config, ['list'], chalk);
39
- assertNoDoubleV1();
40
- });
41
-
42
- it('workload list targets /workloads (no doubled /v1)', async () => {
43
- await workloadCommand(config, ['list'], chalk);
44
- assertNoDoubleV1();
45
- });
46
- });