@datalayer/core 1.2.19 → 1.2.21
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/lib/api/evals/client.d.ts +6 -6
- package/lib/api/evals/client.js +5 -5
- package/lib/api/evals/status.d.ts +3 -3
- package/lib/api/evals/status.js +3 -3
- package/lib/api/evals/types.d.ts +9 -9
- package/lib/api/iam/secrets.js +2 -2
- package/lib/api/iam/servicePrincipals.js +1 -1
- package/lib/api/iam/trials.js +1 -1
- package/lib/api/orchestration/generated.d.ts +12 -12
- package/lib/api/orchestration/generated.js +1 -1
- package/lib/api/orchestration/index.d.ts +2 -2
- package/lib/api/orchestration/index.js +2 -2
- package/lib/api/orchestration/lifecycle.d.ts +1 -1
- package/lib/api/orchestration/lifecycle.js +1 -1
- package/lib/api/scheduler/client.d.ts +1 -1
- package/lib/api/scheduler/client.js +1 -1
- package/lib/api/scheduler/types.d.ts +1 -1
- package/lib/api/spacer/comments.d.ts +1 -1
- package/lib/api/spacer/comments.js +1 -1
- package/lib/api/spacer/spaces.d.ts +1 -1
- package/lib/api/spacer/spaces.js +1 -1
- package/lib/components/avatars/UserAvatar.d.ts +10 -11
- package/lib/components/avatars/UserAvatar.js +23 -28
- package/lib/components/avatars/UserProfileAvatar.js +1 -1
- package/lib/components/avatars/avatarChoice.d.ts +42 -0
- package/lib/components/avatars/avatarChoice.js +65 -0
- package/lib/components/avatars/index.d.ts +1 -0
- package/lib/components/avatars/index.js +1 -0
- package/lib/components/collaboration/LiveEditorCollaborators.d.ts +3 -4
- package/lib/components/collaboration/LiveEditorCollaborators.js +7 -5
- package/lib/components/emoji/faceEmojis.js +48 -0
- package/lib/components/emoji/fluent/loaders.js +46 -0
- package/lib/components/emoji/fluent/svg/1f30a.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f30a.js +5 -0
- package/lib/components/emoji/fluent/svg/1f310.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f310.js +5 -0
- package/lib/components/emoji/fluent/svg/1f324.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f324.js +5 -0
- package/lib/components/emoji/fluent/svg/1f326.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f326.js +5 -0
- package/lib/components/emoji/fluent/svg/1f327.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f327.js +5 -0
- package/lib/components/emoji/fluent/svg/1f33e.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f33e.js +5 -0
- package/lib/components/emoji/fluent/svg/1f372.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f372.js +5 -0
- package/lib/components/emoji/fluent/svg/1f373.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f373.js +5 -0
- package/lib/components/emoji/fluent/svg/1f39b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f39b.js +5 -0
- package/lib/components/emoji/fluent/svg/1f3ab.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f3ab.js +5 -0
- package/lib/components/emoji/fluent/svg/1f41b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f41b.js +5 -0
- package/lib/components/emoji/fluent/svg/1f441.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f441.js +5 -0
- package/lib/components/emoji/fluent/svg/1f465.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f465.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4b9.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4b9.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4be.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4be.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4c1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c1.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4c2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c2.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4c4.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4c4.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4d3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4d3.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4d6.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4d6.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4dc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4dc.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4e1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e1.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4e2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e2.js +5 -0
- package/lib/components/emoji/fluent/svg/1f4e7.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f4e7.js +5 -0
- package/lib/components/emoji/fluent/svg/1f500.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f500.js +5 -0
- package/lib/components/emoji/fluent/svg/1f501.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f501.js +5 -0
- package/lib/components/emoji/fluent/svg/1f504.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f504.js +5 -0
- package/lib/components/emoji/fluent/svg/1f52d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f52d.js +5 -0
- package/lib/components/emoji/fluent/svg/1f552.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f552.js +5 -0
- package/lib/components/emoji/fluent/svg/1f58b.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f58b.js +5 -0
- package/lib/components/emoji/fluent/svg/1f5b2.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5b2.js +5 -0
- package/lib/components/emoji/fluent/svg/1f5c3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5c3.js +5 -0
- package/lib/components/emoji/fluent/svg/1f5d1.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5d1.js +5 -0
- package/lib/components/emoji/fluent/svg/1f5dc.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f5dc.js +5 -0
- package/lib/components/emoji/fluent/svg/1f604.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f604.js +5 -0
- package/lib/components/emoji/fluent/svg/1f917.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f917.js +5 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-2696.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1f9d1-200d-2696.js +5 -0
- package/lib/components/emoji/fluent/svg/1fa79.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa79.js +5 -0
- package/lib/components/emoji/fluent/svg/1fa9d.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa9d.js +5 -0
- package/lib/components/emoji/fluent/svg/1fa9f.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/1fa9f.js +5 -0
- package/lib/components/emoji/fluent/svg/23f3.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/23f3.js +5 -0
- package/lib/components/emoji/fluent/svg/2611.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2611.js +5 -0
- package/lib/components/emoji/fluent/svg/2702.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2702.js +5 -0
- package/lib/components/emoji/fluent/svg/270f.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/270f.js +5 -0
- package/lib/components/emoji/fluent/svg/2728.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2728.js +5 -0
- package/lib/components/emoji/fluent/svg/2b1c.d.ts +2 -0
- package/lib/components/emoji/fluent/svg/2b1c.js +5 -0
- package/lib/components/principal/Principal.js +1 -1
- package/lib/components/principal/PrincipalAppearance.d.ts +24 -1
- package/lib/components/principal/PrincipalAppearance.js +105 -34
- package/lib/components/principal/PrincipalAvatar.d.ts +5 -7
- package/lib/components/principal/PrincipalAvatar.js +12 -18
- package/lib/components/principal/PrincipalDetailsOverlay.d.ts +4 -7
- package/lib/components/principal/PrincipalDetailsOverlay.js +2 -2
- package/lib/components/principal/PrincipalSwitcherMenu.js +1 -1
- package/lib/hooks/unlinkIAMProvider.d.ts +22 -0
- package/lib/hooks/unlinkIAMProvider.js +24 -0
- package/lib/hooks/useCache.d.ts +8 -1
- package/lib/hooks/useCache.js +37 -6
- package/lib/hooks/useNavigate.js +8 -2
- package/lib/models/IAMProviderLinked.d.ts +9 -0
- package/lib/models/IAMProviderLinked.js +34 -5
- package/lib/models/McpTask.d.ts +18 -1
- package/lib/models/McpTask.js +15 -0
- package/lib/models/Profile.d.ts +2 -2
- package/lib/models/Secret.d.ts +1 -1
- package/lib/models/Secret.js +1 -1
- package/lib/models/StartedBy.d.ts +1 -1
- package/lib/models/StartedBy.js +1 -1
- package/lib/models/User.js +5 -12
- package/lib/models/UserOnboarding.d.ts +9 -0
- package/lib/models/UserOnboarding.js +33 -0
- package/lib/portable/index.d.ts +3 -2
- package/lib/portable/index.js +4 -2
- package/lib/portable/states.d.ts +39 -0
- package/lib/portable/states.js +71 -0
- package/lib/state/substates/NavigationState.d.ts +5 -3
- package/lib/state/substates/NavigationState.js +12 -3
- package/lib/views/mcp/AlertDestinations.js +2 -2
- package/lib/views/mcp/ApprovalQueue.js +2 -2
- package/lib/views/mcp/EnterpriseConsole.js +2 -2
- package/lib/views/mcp/McpDashboard.js +2 -2
- package/lib/views/mcp/McpHome.js +4 -4
- package/lib/views/mcp/McpObservability.js +5 -5
- package/lib/views/mcp/NotebookRuns.js +2 -2
- package/lib/views/mcp/OrganizationUsage.js +2 -2
- package/lib/views/mcp/Policies.js +2 -2
- package/lib/views/mcp/RunDetail.d.ts +1 -1
- package/lib/views/mcp/RunDetail.js +4 -1
- package/lib/views/mcp/ScimProvisioning.js +2 -2
- package/lib/views/mcp/ToolAccess.js +2 -2
- package/lib/views/secrets/SecretNew.js +1 -1
- package/package.json +1 -1
- package/scripts/generate-orchestration-types.py +12 -12
|
@@ -15,7 +15,7 @@ export type ListEvalsetsQuery = {
|
|
|
15
15
|
run_environment?: EvalRunEnvironment;
|
|
16
16
|
category?: EvalsetCategory;
|
|
17
17
|
q?: string;
|
|
18
|
-
/** Only the benchmarks reading this dataset (B5-12
|
|
18
|
+
/** Only the benchmarks reading this dataset (B5-12). */
|
|
19
19
|
dataset?: string;
|
|
20
20
|
/** …and pinned to this revision of it: one revision is not evidence about another. */
|
|
21
21
|
revision?: string;
|
|
@@ -68,8 +68,8 @@ export declare const previewEvalsetPublication: (options: EvalsClientOptions, ev
|
|
|
68
68
|
/**
|
|
69
69
|
* Publish the package: the immutable snapshot of the definition, the data, the
|
|
70
70
|
* subjects, the environment, the results, the report, the evidence and the
|
|
71
|
-
* evaluators
|
|
72
|
-
*
|
|
71
|
+
* evaluators. Refused with `detail.problems` where something stands in the
|
|
72
|
+
* way of publishing it.
|
|
73
73
|
*/
|
|
74
74
|
export declare const publishEvalsetPackage: (options: EvalsClientOptions, evalsetId: string, body?: {
|
|
75
75
|
launch_ids?: string[];
|
|
@@ -118,13 +118,13 @@ export declare const getPublicEvalsetLeaderboard: (options: EvalsClientOptions,
|
|
|
118
118
|
*/
|
|
119
119
|
export declare const getSubjectUsage: (options: EvalsClientOptions, subjectRef: string) => Promise<SubjectUsageResponse>;
|
|
120
120
|
/**
|
|
121
|
-
* Whether anything will run the account's benchmarks (B5-12
|
|
121
|
+
* Whether anything will run the account's benchmarks (B5-12):
|
|
122
122
|
* the executor, whether a worker polls the benchmark queue, and the account's
|
|
123
123
|
* own queued and running launches.
|
|
124
124
|
*/
|
|
125
125
|
export declare const getBenchmarkCompute: (options: EvalsClientOptions) => Promise<BenchmarkComputeResponse>;
|
|
126
126
|
/**
|
|
127
|
-
* What benchmark work a sandbox is doing (B5-12
|
|
127
|
+
* What benchmark work a sandbox is doing (B5-12).
|
|
128
128
|
*
|
|
129
129
|
* The ref is a pool slot's name (`benchmark-<run>-slot-<n>`) or the snapshot
|
|
130
130
|
* a sandbox was restored from. A sandbox of nobody's benchmark answers
|
|
@@ -132,7 +132,7 @@ export declare const getBenchmarkCompute: (options: EvalsClientOptions) => Promi
|
|
|
132
132
|
*/
|
|
133
133
|
export declare const getSandboxProvenance: (options: EvalsClientOptions, sandboxRef: string) => Promise<SandboxProvenanceResponse>;
|
|
134
134
|
/**
|
|
135
|
-
* Find things across the caller's benchmarks (B5-11
|
|
135
|
+
* Find things across the caller's benchmarks (B5-11): benchmarks,
|
|
136
136
|
* launches, tasks, reports and investigations, each row keeping its kind and
|
|
137
137
|
* what it belongs to.
|
|
138
138
|
*
|
package/lib/api/evals/client.js
CHANGED
|
@@ -58,8 +58,8 @@ export const previewEvalsetPublication = (options, evalsetId, query = {}) => eva
|
|
|
58
58
|
/**
|
|
59
59
|
* Publish the package: the immutable snapshot of the definition, the data, the
|
|
60
60
|
* subjects, the environment, the results, the report, the evidence and the
|
|
61
|
-
* evaluators
|
|
62
|
-
*
|
|
61
|
+
* evaluators. Refused with `detail.problems` where something stands in the
|
|
62
|
+
* way of publishing it.
|
|
63
63
|
*/
|
|
64
64
|
export const publishEvalsetPackage = (options, evalsetId, body = {}) => evalsRequest(options, `/evalsets/${segment(evalsetId)}/publications`, {
|
|
65
65
|
method: 'POST',
|
|
@@ -97,13 +97,13 @@ export const getPublicEvalsetLeaderboard = (options, evalsetId) => evalsRequest(
|
|
|
97
97
|
*/
|
|
98
98
|
export const getSubjectUsage = (options, subjectRef) => evalsRequest(options, `/subjects/${subjectRef.split('/').map(encodeURIComponent).join('/')}/usage`);
|
|
99
99
|
/**
|
|
100
|
-
* Whether anything will run the account's benchmarks (B5-12
|
|
100
|
+
* Whether anything will run the account's benchmarks (B5-12):
|
|
101
101
|
* the executor, whether a worker polls the benchmark queue, and the account's
|
|
102
102
|
* own queued and running launches.
|
|
103
103
|
*/
|
|
104
104
|
export const getBenchmarkCompute = (options) => evalsRequest(options, '/compute/operations');
|
|
105
105
|
/**
|
|
106
|
-
* What benchmark work a sandbox is doing (B5-12
|
|
106
|
+
* What benchmark work a sandbox is doing (B5-12).
|
|
107
107
|
*
|
|
108
108
|
* The ref is a pool slot's name (`benchmark-<run>-slot-<n>`) or the snapshot
|
|
109
109
|
* a sandbox was restored from. A sandbox of nobody's benchmark answers
|
|
@@ -111,7 +111,7 @@ export const getBenchmarkCompute = (options) => evalsRequest(options, '/compute/
|
|
|
111
111
|
*/
|
|
112
112
|
export const getSandboxProvenance = (options, sandboxRef) => evalsRequest(options, `/sandboxes/${sandboxRef.split('/').map(encodeURIComponent).join('/')}/provenance`);
|
|
113
113
|
/**
|
|
114
|
-
* Find things across the caller's benchmarks (B5-11
|
|
114
|
+
* Find things across the caller's benchmarks (B5-11): benchmarks,
|
|
115
115
|
* launches, tasks, reports and investigations, each row keeping its kind and
|
|
116
116
|
* what it belongs to.
|
|
117
117
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* time (`queued`, `init`, `pending`, `running`, `completed`, `failed`,
|
|
6
6
|
* `error`, `success`, `done`, …). This is the same mapping as
|
|
7
7
|
* `agent_runtimes.evals.status` in Python: every word a writer has used maps
|
|
8
|
-
* onto the product vocabulary
|
|
8
|
+
* onto the product vocabulary, and "finished" is
|
|
9
9
|
* answered once. A word nobody has used maps to itself, lower-cased, so it is
|
|
10
10
|
* visible rather than misread.
|
|
11
11
|
*
|
|
@@ -17,9 +17,9 @@ export declare const CASE_STATUSES: readonly ["waiting", "provisioning", "runnin
|
|
|
17
17
|
export type CaseStatus = (typeof CASE_STATUSES)[number];
|
|
18
18
|
export declare const TERMINAL_RUN_STATUSES: ReadonlySet<string>;
|
|
19
19
|
export declare const TERMINAL_CASE_STATUSES: ReadonlySet<string>;
|
|
20
|
-
/** The
|
|
20
|
+
/** The product word for a run status, whatever a writer wrote. */
|
|
21
21
|
export declare const normalizeRunStatus: (value: unknown) => RunStatus | string;
|
|
22
|
-
/** The
|
|
22
|
+
/** The product word for a case status. */
|
|
23
23
|
export declare const normalizeCaseStatus: (value: unknown) => CaseStatus | string;
|
|
24
24
|
/** Whether a run with this status is over. */
|
|
25
25
|
export declare const isTerminalRunStatus: (value: unknown) => boolean;
|
package/lib/api/evals/status.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* time (`queued`, `init`, `pending`, `running`, `completed`, `failed`,
|
|
14
14
|
* `error`, `success`, `done`, …). This is the same mapping as
|
|
15
15
|
* `agent_runtimes.evals.status` in Python: every word a writer has used maps
|
|
16
|
-
* onto the product vocabulary
|
|
16
|
+
* onto the product vocabulary, and "finished" is
|
|
17
17
|
* answered once. A word nobody has used maps to itself, lower-cased, so it is
|
|
18
18
|
* visible rather than misread.
|
|
19
19
|
*
|
|
@@ -106,12 +106,12 @@ const word = (value) => String(value ?? '')
|
|
|
106
106
|
.trim()
|
|
107
107
|
.toLowerCase()
|
|
108
108
|
.replace(/[-\s]/g, '_');
|
|
109
|
-
/** The
|
|
109
|
+
/** The product word for a run status, whatever a writer wrote. */
|
|
110
110
|
export const normalizeRunStatus = (value) => {
|
|
111
111
|
const key = word(value);
|
|
112
112
|
return LEGACY_RUN_STATUS[key] ?? key;
|
|
113
113
|
};
|
|
114
|
-
/** The
|
|
114
|
+
/** The product word for a case status. */
|
|
115
115
|
export const normalizeCaseStatus = (value) => {
|
|
116
116
|
const key = word(value);
|
|
117
117
|
return LEGACY_CASE_STATUS[key] ?? key;
|
package/lib/api/evals/types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
export type EvalRunEnvironment = 'ui' | 'sdk';
|
|
18
18
|
/** Fixed cases replayed (`batch`) or live events evaluated (`interactive`). */
|
|
19
19
|
export type EvalKind = 'batch' | 'interactive';
|
|
20
|
-
/** What a benchmark measures, the closed list
|
|
20
|
+
/** What a benchmark measures, the closed list the benchmark pages render by. */
|
|
21
21
|
export type EvalsetCategory = 'data' | 'coding' | 'tool-use' | 'model' | 'visual' | 'performance';
|
|
22
22
|
/** The dataset revision a benchmark reads; contents holds the revision. */
|
|
23
23
|
export interface DatasetRef {
|
|
@@ -285,7 +285,7 @@ export interface LaunchPlanResponse {
|
|
|
285
285
|
/**
|
|
286
286
|
* How run mode, run environment and execution target relate, stated by
|
|
287
287
|
* the service so the wizard explains it inline rather than failing after
|
|
288
|
-
* submission
|
|
288
|
+
* submission.
|
|
289
289
|
*/
|
|
290
290
|
run_mode_constraint: string;
|
|
291
291
|
problems: LaunchPlanProblem[];
|
|
@@ -466,7 +466,7 @@ export interface EvalsetPackageItem {
|
|
|
466
466
|
uid: string;
|
|
467
467
|
label: string;
|
|
468
468
|
}
|
|
469
|
-
/** What stands in the way of a publication
|
|
469
|
+
/** What stands in the way of a publication. */
|
|
470
470
|
export interface EvalsetPackageProblem {
|
|
471
471
|
code: string;
|
|
472
472
|
detail: string;
|
|
@@ -636,7 +636,7 @@ export interface SubjectUsage {
|
|
|
636
636
|
active_launches: SubjectLaunch[];
|
|
637
637
|
totals: SubjectTotals;
|
|
638
638
|
}
|
|
639
|
-
/** What a search made of the words somebody typed (B5-11
|
|
639
|
+
/** What a search made of the words somebody typed (B5-11). */
|
|
640
640
|
export interface EvalsSearchQuery {
|
|
641
641
|
raw: string;
|
|
642
642
|
/** What is left to look for by name, once the words that mean something else are taken out. */
|
|
@@ -676,7 +676,7 @@ export interface SubjectUsageResponse {
|
|
|
676
676
|
usage: SubjectUsage;
|
|
677
677
|
}
|
|
678
678
|
/**
|
|
679
|
-
* What benchmark work a sandbox is doing (B5-12
|
|
679
|
+
* What benchmark work a sandbox is doing (B5-12).
|
|
680
680
|
*
|
|
681
681
|
* A pool slot's sandbox is named after the run it serves, and a sandbox
|
|
682
682
|
* restored from a task's snapshot is found by that snapshot; either way the
|
|
@@ -723,7 +723,7 @@ export interface SandboxProvenanceResponse {
|
|
|
723
723
|
provenance: SandboxProvenance;
|
|
724
724
|
}
|
|
725
725
|
/**
|
|
726
|
-
* Whether anything will run the account's benchmarks (B5-12
|
|
726
|
+
* Whether anything will run the account's benchmarks (B5-12).
|
|
727
727
|
*
|
|
728
728
|
* A launch at `queued` looks the same whether the queue is busy or nothing
|
|
729
729
|
* polls it. `serving` is the difference. The depth is the account's own
|
|
@@ -1050,7 +1050,7 @@ export interface EvalsetVersionResponse {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
export type InvestigationScope = 'case' | 'run' | 'launch' | 'window';
|
|
1052
1052
|
export type InvestigationStatus = 'open' | 'closed';
|
|
1053
|
-
/** The restored sandbox
|
|
1053
|
+
/** The restored sandbox. */
|
|
1054
1054
|
export type SandboxState = 'available' | 'restoring' | 'running' | 'expired' | 'none';
|
|
1055
1055
|
/** The work a person does on a benchmark result: one per task, run, launch or window. */
|
|
1056
1056
|
export interface EvalInvestigation {
|
|
@@ -1165,7 +1165,7 @@ export interface EvalsSharingResponse extends SuccessResponse {
|
|
|
1165
1165
|
};
|
|
1166
1166
|
}
|
|
1167
1167
|
/**
|
|
1168
|
-
* How far a record reaches (
|
|
1168
|
+
* How far a record reaches (B5-09), narrowest
|
|
1169
1169
|
* first. Derived from the grants and the public flag rather than stored, so it
|
|
1170
1170
|
* cannot disagree with who may actually read the thing.
|
|
1171
1171
|
*/
|
|
@@ -1178,7 +1178,7 @@ export interface EvalsPermissionsResponse extends SuccessResponse {
|
|
|
1178
1178
|
/** The widest thing that is true of this record. */
|
|
1179
1179
|
visibility: EvalsVisibility;
|
|
1180
1180
|
}
|
|
1181
|
-
/** The states of a report
|
|
1181
|
+
/** The states of a report, in the order a report goes through them. */
|
|
1182
1182
|
export type ReportState = 'draft' | 'in_review' | 'approved' | 'published_private' | 'published_public' | 'superseded';
|
|
1183
1183
|
/** A report over runs of one benchmark: its document and its state. */
|
|
1184
1184
|
export interface EvalReport {
|
package/lib/api/iam/secrets.js
CHANGED
|
@@ -36,8 +36,8 @@ export const createSecret = async (token, data, baseUrl = DEFAULT_SERVICE_URLS.I
|
|
|
36
36
|
variant: data.variant || 'generic',
|
|
37
37
|
name: data.name,
|
|
38
38
|
description: data.description || '',
|
|
39
|
-
// As it is. A secret has one representation end to end (
|
|
40
|
-
//
|
|
39
|
+
// As it is. A secret has one representation end to end (E3-05):
|
|
40
|
+
// this used to base64-encode, and nothing on the read side undid
|
|
41
41
|
// it, so a build secret arrived at its build encoded and opened nothing.
|
|
42
42
|
value: data.value,
|
|
43
43
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Service principals: a deployed LOOP application as a principal of its
|
|
7
|
-
* own (
|
|
7
|
+
* own (I-02).
|
|
8
8
|
*
|
|
9
9
|
* The service agents' kin — a key that is exchanged for an hour's token, an
|
|
10
10
|
* audit that names it — with two differences: a person may own one, not only
|
package/lib/api/iam/trials.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* The anonymous trial: running the public benchmark before signing up
|
|
11
|
-
* (
|
|
11
|
+
* (B2-14).
|
|
12
12
|
*
|
|
13
13
|
* A visitor with no account asks for a trial and gets a principal of its
|
|
14
14
|
* own with one benchmark it may run, a few credits and a short expiry. The
|
|
@@ -11,7 +11,7 @@ export interface Acknowledgement {
|
|
|
11
11
|
checkpointId?: string | null;
|
|
12
12
|
detail?: string | null;
|
|
13
13
|
}
|
|
14
|
-
/** The five milestones
|
|
14
|
+
/** The five acknowledgement milestones, in the order they are reached. */
|
|
15
15
|
export type AcknowledgementKind = 'received' | 'accepted' | 'started' | 'checkpointed' | 'completed';
|
|
16
16
|
/** What a caller must present to be let in. */
|
|
17
17
|
export interface AgentAuthentication {
|
|
@@ -148,11 +148,11 @@ export interface ArtifactProvenance {
|
|
|
148
148
|
contentHash?: string | null;
|
|
149
149
|
traceId?: string | null;
|
|
150
150
|
}
|
|
151
|
-
/** Where an artifact stands against the commit rule
|
|
151
|
+
/** Where an artifact stands against the commit rule: the first attempt to commit wins. */
|
|
152
152
|
export type ArtifactStatus = 'registered' | 'committed' | 'superseded';
|
|
153
|
-
/** What an artifact is,
|
|
153
|
+
/** What an artifact is, one of nine kinds. */
|
|
154
154
|
export type ArtifactType = 'notebook' | 'report' | 'dataset' | 'cell-output' | 'file' | 'evaluation' | 'execution-log' | 'sandbox-snapshot' | 'json';
|
|
155
|
-
/** One dispatch of an execution to a worker
|
|
155
|
+
/** One dispatch of an execution to a worker. */
|
|
156
156
|
export interface Attempt {
|
|
157
157
|
attemptId: string;
|
|
158
158
|
executionId: string;
|
|
@@ -227,7 +227,7 @@ export interface CommandAnswer {
|
|
|
227
227
|
execution: Execution;
|
|
228
228
|
success?: boolean;
|
|
229
229
|
}
|
|
230
|
-
/** The twelve commands of
|
|
230
|
+
/** The twelve commands of the orchestration lifecycle. */
|
|
231
231
|
export type CommandName = 'agents.discover' | 'agents.create' | 'agents.attach' | 'executions.delegate' | 'executions.steer' | 'executions.pause' | 'executions.resume' | 'executions.cancel' | 'executions.checkpoint' | 'executions.collect' | 'executions.terminate' | 'executions.subscribe';
|
|
232
232
|
/** Whether a worker may only read the reference, or also write it. */
|
|
233
233
|
export type ContextAccess = 'read-only' | 'writable';
|
|
@@ -272,7 +272,7 @@ export interface DelegateAnswer {
|
|
|
272
272
|
execution: Execution;
|
|
273
273
|
success?: boolean;
|
|
274
274
|
}
|
|
275
|
-
/** The bounds a tree is created under,
|
|
275
|
+
/** The bounds a tree is created under, with the decided defaults. */
|
|
276
276
|
export interface DelegationLimits {
|
|
277
277
|
maxDepth?: number;
|
|
278
278
|
maxChildrenPerParent?: number;
|
|
@@ -588,7 +588,7 @@ export interface ReportAnswer {
|
|
|
588
588
|
execution: Execution;
|
|
589
589
|
success?: boolean;
|
|
590
590
|
}
|
|
591
|
-
/** How a failed attempt is tried again:
|
|
591
|
+
/** How a failed attempt is tried again: two retries, backing off. */
|
|
592
592
|
export interface RetryPolicy {
|
|
593
593
|
maxRetries?: number;
|
|
594
594
|
initialBackoffSeconds?: number;
|
|
@@ -604,7 +604,7 @@ export interface RuntimeRequirements {
|
|
|
604
604
|
/** A Datalayer runtime environment name, when it runs on one. */
|
|
605
605
|
environment?: string | null;
|
|
606
606
|
}
|
|
607
|
-
/** The W3C context that makes one tree one trace (
|
|
607
|
+
/** The W3C context that makes one tree one trace (O0-11). */
|
|
608
608
|
export interface Trace {
|
|
609
609
|
traceparent?: string | null;
|
|
610
610
|
tracestate?: string | null;
|
|
@@ -649,9 +649,9 @@ export interface WorkerAnswer {
|
|
|
649
649
|
success?: boolean;
|
|
650
650
|
worker: Worker;
|
|
651
651
|
}
|
|
652
|
-
/** A lifecycle operation a worker supports, named as
|
|
652
|
+
/** A lifecycle operation a worker supports, named as the orchestration lifecycle names it. */
|
|
653
653
|
export type WorkerOperation = 'delegate' | 'steer' | 'pause' | 'resume' | 'cancel' | 'checkpoint' | 'collect' | 'terminate' | 'subscribe';
|
|
654
|
-
/** The lifecycle
|
|
654
|
+
/** The lifecycle: what a state accepts, and where it leads. */
|
|
655
655
|
export interface OrchestrationLifecycle {
|
|
656
656
|
readonly initial: ExecutionState;
|
|
657
657
|
readonly states: readonly ExecutionState[];
|
|
@@ -668,9 +668,9 @@ export interface OrchestrationCommand {
|
|
|
668
668
|
readonly mutating: boolean;
|
|
669
669
|
}
|
|
670
670
|
export declare const ORCHESTRATION_COMMANDS: readonly OrchestrationCommand[];
|
|
671
|
-
/** The five milestones
|
|
671
|
+
/** The five milestones, in the order they are reached. */
|
|
672
672
|
export declare const ORCHESTRATION_ACKNOWLEDGEMENT_ORDER: readonly AcknowledgementKind[];
|
|
673
|
-
/** The default limits
|
|
673
|
+
/** The default limits, read from the models' own defaults. */
|
|
674
674
|
export interface OrchestrationLimits {
|
|
675
675
|
readonly delegation: DelegationLimits;
|
|
676
676
|
readonly retry: RetryPolicy;
|
|
@@ -91,7 +91,7 @@ export const ORCHESTRATION_COMMANDS = [
|
|
|
91
91
|
{ name: 'executions.terminate', mutating: true },
|
|
92
92
|
{ name: 'executions.subscribe', mutating: false },
|
|
93
93
|
];
|
|
94
|
-
/** The five milestones
|
|
94
|
+
/** The five milestones, in the order they are reached. */
|
|
95
95
|
export const ORCHESTRATION_ACKNOWLEDGEMENT_ORDER = ['received', 'accepted', 'started', 'checkpointed', 'completed'];
|
|
96
96
|
export const ORCHESTRATION_LIMITS = {
|
|
97
97
|
delegation: {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* work it is delegating, supervising, steering, recovering or stopping.
|
|
4
4
|
*
|
|
5
5
|
* Every type here is generated from the pydantic models in
|
|
6
|
-
* `datalayer_core/orchestration`, which are the source of truth
|
|
7
|
-
*
|
|
6
|
+
* `datalayer_core/orchestration`, which are the source of truth,
|
|
7
|
+
* and from the control plane's OpenAPI
|
|
8
8
|
* document for the answers it wraps them in and the operations it serves.
|
|
9
9
|
* Regenerate with `npm run generate:orchestration`;
|
|
10
10
|
* `npm run check:orchestration-generated` is the gate that fails when the
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* work it is delegating, supervising, steering, recovering or stopping.
|
|
8
8
|
*
|
|
9
9
|
* Every type here is generated from the pydantic models in
|
|
10
|
-
* `datalayer_core/orchestration`, which are the source of truth
|
|
11
|
-
*
|
|
10
|
+
* `datalayer_core/orchestration`, which are the source of truth,
|
|
11
|
+
* and from the control plane's OpenAPI
|
|
12
12
|
* document for the answers it wraps them in and the operations it serves.
|
|
13
13
|
* Regenerate with `npm run generate:orchestration`;
|
|
14
14
|
* `npm run check:orchestration-generated` is the gate that fails when the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The canonical execution lifecycle (
|
|
2
|
+
* The canonical execution lifecycle (O0-02).
|
|
3
3
|
*
|
|
4
4
|
* The states and the moves between them are not written here: they are
|
|
5
5
|
* generated from `datalayer_core/orchestration/lifecycle.py`, which is the
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* The canonical execution lifecycle (
|
|
6
|
+
* The canonical execution lifecycle (O0-02).
|
|
7
7
|
*
|
|
8
8
|
* The states and the moves between them are not written here: they are
|
|
9
9
|
* generated from `datalayer_core/orchestration/lifecycle.py`, which is the
|
|
@@ -17,7 +17,7 @@ export declare const listSchedules: (options: SchedulerClientOptions, query?: {
|
|
|
17
17
|
/** One schedule. */
|
|
18
18
|
export declare const getSchedule: (options: SchedulerClientOptions, scheduleUid: string) => Promise<ScheduleResponse>;
|
|
19
19
|
/**
|
|
20
|
-
* Create the one schedule a target has, or replace it (
|
|
20
|
+
* Create the one schedule a target has, or replace it (B2-16):
|
|
21
21
|
* a schedule is unique per owner and target, so upserting is how a person
|
|
22
22
|
* changes an `evalset` schedule's cron or configuration too.
|
|
23
23
|
*/
|
|
@@ -24,7 +24,7 @@ export const listSchedules = (options, query = {}) => schedulerRequest(options,
|
|
|
24
24
|
/** One schedule. */
|
|
25
25
|
export const getSchedule = (options, scheduleUid) => schedulerRequest(options, `/schedules/${scheduleSegment(scheduleUid)}`);
|
|
26
26
|
/**
|
|
27
|
-
* Create the one schedule a target has, or replace it (
|
|
27
|
+
* Create the one schedule a target has, or replace it (B2-16):
|
|
28
28
|
* a schedule is unique per owner and target, so upserting is how a person
|
|
29
29
|
* changes an `evalset` schedule's cron or configuration too.
|
|
30
30
|
*/
|
|
@@ -33,7 +33,7 @@ export interface ScheduleRecord {
|
|
|
33
33
|
creation_ts_dt?: string;
|
|
34
34
|
last_update_ts_dt?: string;
|
|
35
35
|
}
|
|
36
|
-
/** What an `evalset` schedule's `config_json_t` holds (
|
|
36
|
+
/** What an `evalset` schedule's `config_json_t` holds (B2-16). */
|
|
37
37
|
export interface EvalsetScheduleConfig {
|
|
38
38
|
/** Empty means every live experiment of the evalset, resolved at run time. */
|
|
39
39
|
experiment_ids?: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Comments on documents and notebooks (
|
|
2
|
+
* Comments on documents and notebooks (B4-01).
|
|
3
3
|
*
|
|
4
4
|
* A thread is its first comment, about one anchor — the highlighted text, a
|
|
5
5
|
* report's evidence block, a cell, a task, a data point — and a reply names
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Distributed under the terms of the Modified BSD License.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
* Comments on documents and notebooks (
|
|
10
|
+
* Comments on documents and notebooks (B4-01).
|
|
11
11
|
*
|
|
12
12
|
* A thread is its first comment, about one anchor — the highlighted text, a
|
|
13
13
|
* report's evidence block, a cell, a task, a data point — and a reply names
|
|
@@ -55,7 +55,7 @@ export interface WorkspaceSearchResponse {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Search the caller's own workspace: notebooks, documents, datasets, files
|
|
58
|
-
* (
|
|
58
|
+
* (B5-11).
|
|
59
59
|
*
|
|
60
60
|
* Scoped by the service to what this person may open — never other people's
|
|
61
61
|
* public items, which the Library's own search answers. An empty query lists
|
package/lib/api/spacer/spaces.js
CHANGED
|
@@ -34,7 +34,7 @@ export const getManagedSpace = async (options, kind, accountUid) => {
|
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Search the caller's own workspace: notebooks, documents, datasets, files
|
|
37
|
-
* (
|
|
37
|
+
* (B5-11).
|
|
38
38
|
*
|
|
39
39
|
* Scoped by the service to what this person may open — never other people's
|
|
40
40
|
* public items, which the Library's own search answers. An empty query lists
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* UserAvatar – Single source of truth for rendering a user's avatar.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* {@link AlienIcon} placeholder so every consumer (profile,
|
|
7
|
-
* principal overlay, …) shares the same
|
|
4
|
+
* Drawn by primer-addons' `EntityAvatar`, so its ground, shape and ring are
|
|
5
|
+
* the theme's — a person's emoji, chosen icon or photograph, or a themed,
|
|
6
|
+
* colormoded {@link AlienIcon} placeholder, so every consumer (profile,
|
|
7
|
+
* sidebar, principal overlay, …) shares the same look, in every theme.
|
|
8
8
|
*/
|
|
9
9
|
import type { JSX } from 'react';
|
|
10
10
|
/**
|
|
@@ -14,14 +14,13 @@ import type { JSX } from 'react';
|
|
|
14
14
|
export declare function hasRealAvatar(url?: string): boolean;
|
|
15
15
|
export type UserAvatarProps = {
|
|
16
16
|
avatarUrl?: string;
|
|
17
|
-
avatarIcon?: string;
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* The chosen avatar, as it is kept (`components/avatars/avatarChoice`):
|
|
19
|
+
* `emoji:👀` — drawn in Fluent Emoji, the same on every platform (LOOP
|
|
20
|
+
* T-20) — or `@datalayer/icons-react:RobotIcon`. Checked before
|
|
21
|
+
* `avatarUrl`: a chosen picture wins over a photograph.
|
|
23
22
|
*/
|
|
24
|
-
|
|
23
|
+
avatar?: string;
|
|
25
24
|
/** Avatar edge length in pixels. Defaults to 100. */
|
|
26
25
|
size?: number;
|
|
27
26
|
/** Render with rounded square corners instead of a circle. Defaults to true. */
|
|
@@ -42,5 +41,5 @@ export type UserAvatarProps = {
|
|
|
42
41
|
ring?: boolean;
|
|
43
42
|
className?: string;
|
|
44
43
|
};
|
|
45
|
-
export declare const UserAvatar: ({ avatarUrl,
|
|
44
|
+
export declare const UserAvatar: ({ avatarUrl, avatar, size, square, iconSize, fallbackBackground, fallbackForeground, ring, className, }: UserAvatarProps) => JSX.Element;
|
|
46
45
|
export default UserAvatar;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AlienIcon } from '@datalayer/icons-react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { FluentEmoji } from '../emoji/FluentEmoji.js';
|
|
3
|
+
import { EntityAvatar, useColorPalette } from '@datalayer/primer-addons';
|
|
4
|
+
import { getAvatarURL } from '../../utils/index.js';
|
|
5
|
+
import { ChosenAvatar, principalAvatarOf, } from '../principal/PrincipalAppearance.js';
|
|
7
6
|
/**
|
|
8
7
|
* Returns `true` when the given URL points to a real user avatar (i.e. not a
|
|
9
8
|
* Gravatar default placeholder).
|
|
@@ -17,35 +16,31 @@ export function hasRealAvatar(url) {
|
|
|
17
16
|
}
|
|
18
17
|
return true;
|
|
19
18
|
}
|
|
20
|
-
export const UserAvatar = ({ avatarUrl,
|
|
19
|
+
export const UserAvatar = ({ avatarUrl, avatar, size = 100, square = true, iconSize, fallbackBackground, fallbackForeground, ring = false, className, }) => {
|
|
21
20
|
const palette = useColorPalette();
|
|
21
|
+
// A rounded square takes the theme's corner, a circle is a circle; the
|
|
22
|
+
// ring is drawn just outside the edge, so the avatar keeps its size.
|
|
23
|
+
const shape = square ? 'rounded' : 'circle';
|
|
24
|
+
const chosen = principalAvatarOf(avatar);
|
|
25
|
+
if (chosen?.kind === 'emoji') {
|
|
26
|
+
return (_jsx(EntityAvatar, { alt: chosen.emoji, className: className, size: size, shape: shape, ring: ring, bg: fallbackBackground || 'canvas.default', children: _jsx(ChosenAvatar, { avatar: avatar, size: iconSize ?? Math.round(size * 0.6) }) }));
|
|
27
|
+
}
|
|
22
28
|
/*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* A border would take from the size asked for — the avatar is laid out
|
|
26
|
-
* against others of the same measure — so it is drawn just outside the
|
|
27
|
-
* edge instead, following whatever shape the avatar has.
|
|
29
|
+
* A chosen icon and the default one are the same drawing in two shapes:
|
|
30
|
+
* the plain icon, coloured by the theme, on the accent's wash.
|
|
28
31
|
*/
|
|
29
|
-
const
|
|
30
|
-
? {
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return (_jsx(Box, { className: className, width: size, height: size, borderRadius: square ? 2 : '50%', overflow: "hidden", display: "flex", alignItems: "center", justifyContent: "center", bg: fallbackBackground || 'accent.subtle', sx: {
|
|
38
|
-
'--datalayer-icon-fg': fallbackForeground || palette.primary,
|
|
39
|
-
...ringSx,
|
|
40
|
-
}, children: _jsx(SelectedIcon, { size: iconSize ?? Math.round(size * 0.62), themed: true, colormode: true }) }));
|
|
32
|
+
const iconGround = {
|
|
33
|
+
...(fallbackBackground ? { bg: fallbackBackground } : undefined),
|
|
34
|
+
style: {
|
|
35
|
+
'--datalayer-icon-fg': fallbackForeground || palette.primary,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
if (chosen?.kind === 'icon') {
|
|
39
|
+
return (_jsx(EntityAvatar, { className: className, size: size, shape: shape, ring: ring, ...iconGround, children: _jsx(ChosenAvatar, { avatar: avatar, size: iconSize ?? Math.round(size * 0.62) }) }));
|
|
41
40
|
}
|
|
42
41
|
if (hasRealAvatar(avatarUrl)) {
|
|
43
|
-
return (_jsx(
|
|
42
|
+
return (_jsx(EntityAvatar, { className: className, src: getAvatarURL(avatarUrl), size: size, shape: shape, ring: ring }));
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
return (_jsx(Box, { className: className, width: size, height: size, borderRadius: square ? 2 : '50%', bg: fallbackBackground || 'accent.subtle', display: "flex", alignItems: "center", justifyContent: "center", sx: {
|
|
47
|
-
'--datalayer-icon-fg': fallbackForeground || palette.primary,
|
|
48
|
-
...ringSx,
|
|
49
|
-
}, children: _jsx(AlienIcon, { size: resolvedIconSize, themed: true, colormode: true }) }));
|
|
44
|
+
return (_jsx(EntityAvatar, { className: className, size: size, shape: shape, ring: ring, ...iconGround, children: _jsx(AlienIcon, { size: iconSize ?? Math.round(size * 0.48), themed: true, colormode: true }) }));
|
|
50
45
|
};
|
|
51
46
|
export default UserAvatar;
|
|
@@ -8,7 +8,7 @@ import { Box } from '@datalayer/primer-addons';
|
|
|
8
8
|
import { AvatarSkeleton } from '../../components/display/index.js';
|
|
9
9
|
import { UserAvatar } from './UserAvatar.js';
|
|
10
10
|
const Profile = ({ user, size = 100, onClick }) => {
|
|
11
|
-
return (_jsx(Box, { style: { width: size }, onClick: onClick, children: _jsx(UserAvatar, { avatarUrl: user?.avatarUrl,
|
|
11
|
+
return (_jsx(Box, { style: { width: size }, onClick: onClick, children: _jsx(UserAvatar, { avatarUrl: user?.avatarUrl, avatar: user?.avatarIcon, size: size }) }));
|
|
12
12
|
};
|
|
13
13
|
export const UserProfileAvatar = ({ onClick, user, size = 100, }) => {
|
|
14
14
|
return user ? (onClick ? (_jsx(Link, { href: "javascript: return false;", onClick: onClick, children: _jsx(Profile, { user: user, size: size, onClick: onClick }) })) : (_jsx(Profile, { user: user, size: size, onClick: onClick }))) : (_jsx(AvatarSkeleton, { size: size }));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The avatar a person, an organization, a team or an application chose, as it
|
|
3
|
+
* is kept: one string, prefixed by what it is.
|
|
4
|
+
*
|
|
5
|
+
* - `emoji:👀` — an emoji, drawn in Fluent Emoji (`FluentEmoji`);
|
|
6
|
+
* - `@datalayer/icons-react:RobotIcon` — a drawing of the avatar set
|
|
7
|
+
* (`PRINCIPAL_AVATAR_ICONS`), by its component name.
|
|
8
|
+
*
|
|
9
|
+
* Nothing else is an avatar: a bare name, an unknown prefix, an icon outside
|
|
10
|
+
* the set or an emoji that is not one is refused, in a sentence.
|
|
11
|
+
*
|
|
12
|
+
* @module components/avatars/avatarChoice
|
|
13
|
+
*/
|
|
14
|
+
/** The prefix of an emoji avatar. */
|
|
15
|
+
export declare const AVATAR_EMOJI_PREFIX = "emoji:";
|
|
16
|
+
/** The prefix of an avatar drawn from `@datalayer/icons-react`. */
|
|
17
|
+
export declare const AVATAR_ICON_PREFIX = "@datalayer/icons-react:";
|
|
18
|
+
/** What an avatar is: an emoji, or an icon of the set by name. */
|
|
19
|
+
export type AvatarChoice = {
|
|
20
|
+
kind: 'emoji';
|
|
21
|
+
emoji: string;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'icon';
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
/** Why a value is not an avatar, in a sentence. */
|
|
27
|
+
export declare class AvatarRefused extends Error {
|
|
28
|
+
constructor(message: string);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The avatar a value names.
|
|
32
|
+
*
|
|
33
|
+
* `icons` is the set an icon must belong to (the names of
|
|
34
|
+
* `PRINCIPAL_AVATAR_ICONS`); throws `AvatarRefused` for anything else.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseAvatar(value: string, icons: ReadonlySet<string>): AvatarChoice;
|
|
37
|
+
/** The value an avatar is kept as. */
|
|
38
|
+
export declare function avatarValue(choice: AvatarChoice): string;
|
|
39
|
+
/** An emoji, as an avatar value. */
|
|
40
|
+
export declare const emojiAvatar: (emoji: string) => string;
|
|
41
|
+
/** An icon of the set, by its component name, as an avatar value. */
|
|
42
|
+
export declare const iconAvatar: (name: string) => string;
|