@milabench/bujang 0.1.19 → 0.1.20

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/README.md CHANGED
@@ -64,6 +64,22 @@ import '@milabench/bujang/theme.css'; // default colour tokens (optional, host t
64
64
 
65
65
  // sidebar entries
66
66
  bujangNavItems(createBujangPaths('/slurm')); // [{ view, label, path }, ...]
67
+ bujangNavItems(paths, { setup: false }); // without the Setup Guide entry (a host that sets bujang up itself)
68
+ ```
69
+
70
+ The **Projects** section (local code repositories the jobs are linked into) is opt-in: it only makes sense
71
+ when the bujang server runs on the user's machine. Mount its routes and put its own sidebar section
72
+ (a "Projects" header, a + to register a repository, a quick link per project) where you want it:
73
+
74
+ ```tsx
75
+ {bujangRouteElements({ basePath: '/slurm', projects: true })} // /projects, /projects/:projectName
76
+ <BujangProjectsNav collapsed={false} onNavigate={closeDrawer} />
77
+
78
+ // the experiments and groups: pages with a searchable, paginated table, a sidebar section each
79
+ // (the 5 most recent, hidden while there are none)
80
+ {bujangRouteElements({ basePath: '/slurm', organizers: true })} // /experiments[/:value], /groups[/:value]
81
+ <BujangOrganizerNav organizer="experiments" />
82
+ <BujangOrganizerNav organizer="groups" />
67
83
  ```
68
84
 
69
85
  `bujangRoutes(options)` returns the same routes as plain `{ id, path, element }` objects for
package/dist/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { SlurmJob, SlurmJobSubmitResponse, SlurmJobAccounting, SlurmJobDetail, SlurmClusterInfo, SlurmProfile, SlurmClusterStatus, PersitedJobInfo, SlurmJobStatusResponse, EarlySyncResponse, PipelineTemplatePayload, PipelineRunResponse, PipelineRunSummary, PipelineRunStatus, ScheduledJob, ScheduledJobRun, ScheduledJobTemplateDiff, AgentEvent, AgentSession, SettingsInfo, SettingsUpdateResponse, UpdateCheck, OrganizerGroups, Project, ProjectsInfo, ProjectsSyncReport, SyncStatus, JobEnvironment, JobArtifacts, JobData, JobDataRole, JobOverviewLayout, OverviewLayout, OverviewScope, SavedOverviewLayout, JobMarks, UpdateResult, SettingsSecrets, SshSettings, SshPlan, SshPlanRequest, SshTestResponse, SshConnections, SshLogin, JobAttachment, JanitorOverview, JanitorRun, JanitorCleanupInfo, JanitorArchiveResult, JanitorStaleResult } from './types';
1
+ import type { SlurmJob, SlurmJobSubmitResponse, SlurmJobAccounting, SlurmJobDetail, SlurmClusterInfo, SlurmProfile, SlurmClusterStatus, PersitedJobInfo, SlurmJobStatusResponse, EarlySyncResponse, PipelineTemplatePayload, PipelineRunResponse, PipelineRunSummary, PipelineRunStatus, ScheduledJob, ScheduledJobRun, ScheduledJobTemplateDiff, AgentEvent, AgentSession, SettingsInfo, SettingsUpdateResponse, UpdateCheck, OrganizerGroups, OrganizerValuesPage, Project, ProjectsInfo, ProjectsSyncReport, SyncStatus, JobEnvironment, JobArtifacts, JobData, JobDataRole, JobOverviewLayout, OverviewLayout, OverviewScope, SavedOverviewLayout, JobMarks, UpdateResult, SettingsSecrets, SshSettings, SshPlan, SshPlanRequest, SshTestResponse, SshConnections, SshLogin, JobAttachment, JanitorOverview, JanitorRun, JanitorCleanupInfo, JanitorArchiveResult, JanitorStaleResult } from './types';
2
2
  export declare const DEFAULT_API_BASE = "/api/slurm";
3
3
  /**
4
4
  * What bujang needs from an axios instance. Typed structurally so the host's instance fits even
@@ -163,6 +163,12 @@ export declare const getJobArtifacts: (jrJobId: string) => Promise<JobArtifacts>
163
163
  export declare const jobArtifactUrl: (jrJobId: string, path: string) => string;
164
164
  /** The layout of a job's Overview tab and where it comes from. */
165
165
  export declare const getJobOverviewLayout: (jrJobId: string) => Promise<JobOverviewLayout>;
166
+ /**
167
+ * The id the Overview of a collection goes by: "@<organizer>/<value>" ("@experiments/lr-sweep"). The data and
168
+ * layout calls below take it in place of a job id: the panels of a job's Overview work on the jobs of the
169
+ * collection (each file under "<job id>/", each row with `_job`, `_label`, `args`).
170
+ */
171
+ export declare const collectionId: (organizer: string, value: string) => string;
166
172
  /** The Overview layouts saved for an experiment or a script. */
167
173
  export declare const getOverviewLayouts: () => Promise<SavedOverviewLayout[]>;
168
174
  /** Save the Overview layout of an experiment or a script; null removes it. */
@@ -172,7 +178,7 @@ export declare const saveOverviewLayout: (scope: OverviewScope, key: string, lay
172
178
  key: string;
173
179
  removed: boolean;
174
180
  }>;
175
- /** The JSONL files of the artifact folders of a job, with their events and fields (cached server side). */
181
+ /** The data files of the artifact folders of a job, with their events and fields (cached server side). */
176
182
  export declare const getJobData: (jrJobId: string) => Promise<JobData>;
177
183
  /** Query of GET /jobs/<jr>/data/rows: comma separated files (or globs), events, dotted fields. */
178
184
  export interface JobDataRowsQuery {
@@ -185,7 +191,7 @@ export interface JobDataRowsQuery {
185
191
  require?: string[];
186
192
  limit?: number;
187
193
  }
188
- /** The rows of the JSONL files of a job (each with `_file` and `_name`), for plots. */
194
+ /** The rows of the data files of a job (each with `_file` and `_name`), for plots. */
189
195
  export declare const getJobDataRows: (jrJobId: string, query: JobDataRowsQuery) => Promise<Record<string, unknown>[]>;
190
196
  /** URL of the rows of a job: a Vega-Lite / Altair data url (relative to the page when apiBase is). */
191
197
  export declare const jobDataRowsUrl: (jrJobId: string, query: JobDataRowsQuery) => string;
@@ -195,6 +201,13 @@ export declare const getSyncStatus: () => Promise<SyncStatus>;
195
201
  export declare const syncNow: () => Promise<SyncStatus>;
196
202
  /** The organizer folders (clusters/, experiments/, ...): their values and the job ids under each. */
197
203
  export declare const getOrganizers: () => Promise<OrganizerGroups[]>;
204
+ /** A page of the values of an organizer (experiments, groups): job count, last activity; `search` in the name. */
205
+ export declare const getOrganizerValues: (name: string, params?: {
206
+ search?: string;
207
+ sort?: "last" | "name" | "jobs";
208
+ offset?: number;
209
+ limit?: number;
210
+ }) => Promise<OrganizerValuesPage>;
198
211
  /** The registered projects: code repositories the jobs tagged for them are linked into. */
199
212
  export declare const getProjects: () => Promise<ProjectsInfo>;
200
213
  /** Register a repository (or change its folder): makes <path>/<folder> and links the jobs already tagged. */
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import type { IconType } from 'react-icons';
3
+ import type { BujangPaths } from '../paths';
4
+ /** The organizers with a page of their own: their labels, icons and links */
5
+ export interface OrganizerPage {
6
+ label: string;
7
+ /** one of them ("experiment") */
8
+ singular: string;
9
+ icon: IconType;
10
+ list: (paths: BujangPaths) => string;
11
+ detail: (paths: BujangPaths, value: string) => string;
12
+ }
13
+ export declare const ORGANIZER_PAGES: Record<'experiments' | 'groups', OrganizerPage>;
14
+ export interface BujangOrganizerNavProps {
15
+ /** "experiments" or "groups" */
16
+ organizer: keyof typeof ORGANIZER_PAGES;
17
+ /** how many values to show, the most recent first (default 5) */
18
+ limit?: number;
19
+ /** icons only (a collapsed side panel) */
20
+ collapsed?: boolean;
21
+ /** called when a link is followed (close a drawer) */
22
+ onNavigate?: () => void;
23
+ }
24
+ /**
25
+ * A sidebar section for the experiments or the groups: its header opens the page of all of them, then
26
+ * the most recent ones (5). Shows nothing while there are none. Opt-in: bujangRoutes({ organizers: true }).
27
+ */
28
+ export declare const BujangOrganizerNav: React.FC<BujangOrganizerNavProps>;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { ProjectsInfo } from '../types';
3
+ /** The registered projects (GET /projects), shared with the Projects pages */
4
+ export declare function useBujangProjects(): import("@tanstack/react-query").UseQueryResult<ProjectsInfo, Error>;
5
+ export interface BujangProjectsNavProps {
6
+ /** icons only (a collapsed side panel) */
7
+ collapsed?: boolean;
8
+ /** called when a link is followed (close a drawer) */
9
+ onNavigate?: () => void;
10
+ }
11
+ /**
12
+ * A sidebar section of its own: "Projects" (the Projects page), a + to register a repository, and a
13
+ * quick link to each project (its jobs). Opt-in: mount it with `bujangRoutes({ projects: true })`.
14
+ */
15
+ export declare const BujangProjectsNav: React.FC<BujangProjectsNavProps>;
package/dist/index.d.ts CHANGED
@@ -7,6 +7,14 @@ export { PipelineGraph, pipelineMermaid, pipelineSteps } from './views/PipelineG
7
7
  export type { GraphStep } from './views/PipelineGraph';
8
8
  export { ScheduledJobsView } from './views/ScheduledJobsView';
9
9
  export { ProjectsView } from './views/ProjectsView';
10
+ export { ProjectDetailsView } from './views/ProjectDetailsView';
11
+ export { BujangProjectsNav, useBujangProjects } from './components/ProjectsNav';
12
+ export { BujangOrganizerNav } from './components/OrganizerNav';
13
+ export type { BujangOrganizerNavProps } from './components/OrganizerNav';
14
+ export { OrganizerValuesView, OrganizerValueView } from './views/OrganizerValuesView';
15
+ export { CollectionOverview, CollectionTabs } from './views/CollectionView';
16
+ export { ComparePanel, CollectionJobs } from './views/OverviewPanels';
17
+ export type { BujangProjectsNavProps } from './components/ProjectsNav';
10
18
  export { AgentActivityView, AgentBadge, McpHelp } from './views/AgentActivityView';
11
19
  export { SettingsView } from './views/SettingsView';
12
20
  export { JanitorView } from './views/JanitorView';
@@ -19,8 +27,8 @@ export { JobArtifactsCard } from './views/JobArtifacts';
19
27
  export { JobImportantButton, JobGroupsButton, JobImportantStar } from './views/JobMarks';
20
28
  export { BujangProvider, useBujang, useBujangPaths } from './context';
21
29
  export type { BujangProviderProps, BujangContextValue } from './context';
22
- export { createBujangPaths, defaultRoutePatterns, normalizeBasePath, bujangNavItems } from './paths';
23
- export type { BujangPaths, BujangView, BujangNavItem } from './paths';
30
+ export { createBujangPaths, defaultRoutePatterns, normalizeBasePath, bujangNavItems, OPTIONAL_VIEWS, PROJECT_VIEWS, ORGANIZER_VIEWS } from './paths';
31
+ export type { BujangPaths, BujangView, BujangNavItem, BujangNavOptions } from './paths';
24
32
  export { bujangRoutes, bujangRouteElements } from './routes';
25
33
  export type { BujangRoutesOptions, BujangRouteObject } from './routes';
26
34
  export { Tooltip } from './components/tooltip';