orbital-ds 0.40.0 → 0.44.1
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/AGENTS.md +29 -10
- package/components.manifest.json +6469 -3349
- package/dist/auth-form-B1hgbXkI.d.ts +144 -0
- package/dist/hooks/use-ds-messages.d.ts +89 -0
- package/dist/lib/a2ui-catalog.d.ts +42 -0
- package/dist/lib/a2ui-catalog.js +558 -0
- package/dist/lib/a2ui.d.ts +289 -0
- package/dist/lib/a2ui.js +215 -0
- package/dist/lib/ai-events.d.ts +15 -0
- package/dist/lib/ai-events.js +202 -0
- package/dist/lib/auth-flow.d.ts +3 -1
- package/dist/lib/auth-flow.js +24 -3
- package/dist/lib/format.d.ts +57 -0
- package/dist/lib/format.js +177 -0
- package/dist/lib/i18n.d.ts +96 -2
- package/dist/lib/i18n.js +278 -2
- package/dist/lib/locales/de.d.ts +7 -0
- package/dist/lib/locales/de.js +535 -0
- package/dist/lib/locales/fr.d.ts +7 -0
- package/dist/lib/locales/fr.js +535 -0
- package/dist/lib/locales/he.d.ts +7 -0
- package/dist/lib/locales/he.js +535 -0
- package/dist/lib/locales/it.d.ts +7 -0
- package/dist/lib/locales/it.js +535 -0
- package/dist/styles.css +62 -2
- package/dist/ui/a2ui-renderer.d.ts +44 -0
- package/dist/ui/a2ui-renderer.js +793 -0
- package/dist/ui/agent-events.d.ts +49 -0
- package/dist/ui/agent-events.js +108 -0
- package/dist/ui/ai-tag.d.ts +16 -0
- package/dist/ui/alert-dialog.d.ts +37 -0
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/animated-number.d.ts +11 -0
- package/dist/ui/app-bar.d.ts +22 -0
- package/dist/ui/attachment.d.ts +1 -1
- package/dist/ui/auth-backdrop.d.ts +17 -0
- package/dist/ui/auth-form.d.ts +3 -110
- package/dist/ui/auth-form.js +46 -11
- package/dist/ui/auth-layout.d.ts +38 -0
- package/dist/ui/avatar.d.ts +27 -0
- package/dist/ui/ayuda.d.ts +1 -1
- package/dist/ui/ayuda.js +4 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/bottom-nav.d.ts +22 -0
- package/dist/ui/breadcrumb.d.ts +22 -0
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/calendar.d.ts +13 -0
- package/dist/ui/calendar.js +3 -0
- package/dist/ui/card-stack.d.ts +27 -0
- package/dist/ui/card.d.ts +33 -0
- package/dist/ui/carousel.d.ts +35 -0
- package/dist/ui/carousel.js +10 -5
- package/dist/ui/chain-of-thought.d.ts +34 -0
- package/dist/ui/chain-of-thought.js +90 -0
- package/dist/ui/chart-card.d.ts +19 -0
- package/dist/ui/chart.d.ts +19 -0
- package/dist/ui/chat-composer.d.ts +58 -0
- package/dist/ui/chat-composer.js +192 -0
- package/dist/ui/choice-card.d.ts +33 -0
- package/dist/ui/code-block.d.ts +15 -0
- package/dist/ui/combobox.d.ts +48 -0
- package/dist/ui/command-palette.d.ts +18 -0
- package/dist/ui/command.d.ts +34 -0
- package/dist/ui/confirm-action.d.ts +30 -0
- package/dist/ui/confirm-dialog.d.ts +23 -0
- package/dist/ui/content-card.d.ts +14 -0
- package/dist/ui/context-menu.d.ts +35 -0
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/conversation-list.d.ts +44 -0
- package/dist/ui/conversation-list.js +141 -0
- package/dist/ui/copy-button.d.ts +11 -0
- package/dist/ui/date-time.d.ts +40 -0
- package/dist/ui/date-time.js +55 -0
- package/dist/ui/description-list.d.ts +49 -0
- package/dist/ui/description-list.js +86 -0
- package/dist/ui/detail-panel.d.ts +22 -0
- package/dist/ui/dialog.d.ts +35 -0
- package/dist/ui/dock.d.ts +17 -0
- package/dist/ui/drawer.d.ts +41 -0
- package/dist/ui/dropdown-menu.d.ts +32 -0
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/echart.d.ts +15 -0
- package/dist/ui/empty.d.ts +1 -1
- package/dist/ui/entity-list.d.ts +32 -0
- package/dist/ui/form-layout.d.ts +24 -0
- package/dist/ui/gauge.d.ts +26 -0
- package/dist/ui/generated-image.d.ts +33 -0
- package/dist/ui/generated-image.js +65 -0
- package/dist/ui/generated-table.d.ts +29 -0
- package/dist/ui/generated-table.js +59 -0
- package/dist/ui/heatmap-grid.d.ts +20 -0
- package/dist/ui/hero.d.ts +58 -0
- package/dist/ui/hero.js +145 -0
- package/dist/ui/i18n-provider.d.ts +16 -0
- package/dist/ui/icon-tile.d.ts +2 -2
- package/dist/ui/input-group.d.ts +1 -1
- package/dist/ui/input-otp.d.ts +23 -0
- package/dist/ui/input.d.ts +16 -0
- package/dist/ui/instruction-editor.d.ts +17 -0
- package/dist/ui/item.d.ts +3 -3
- package/dist/ui/label.d.ts +17 -0
- package/dist/ui/legend.d.ts +25 -0
- package/dist/ui/level-meter.d.ts +12 -0
- package/dist/ui/load-more.d.ts +17 -0
- package/dist/ui/loading-state.d.ts +12 -0
- package/dist/ui/markdown.d.ts +29 -0
- package/dist/ui/markdown.js +123 -0
- package/dist/ui/media-card.d.ts +16 -0
- package/dist/ui/menubar.d.ts +39 -0
- package/dist/ui/message-actions.d.ts +21 -0
- package/dist/ui/message-actions.js +79 -0
- package/dist/ui/message-scroller.d.ts +30 -0
- package/dist/ui/message.d.ts +33 -0
- package/dist/ui/mfa-challenge.d.ts +3 -32
- package/dist/ui/mfa-challenge.js +1 -1
- package/dist/ui/mfa-setup.d.ts +1 -1
- package/dist/ui/mosaic.d.ts +23 -0
- package/dist/ui/motion-provider.d.ts +17 -0
- package/dist/ui/native-select.d.ts +22 -0
- package/dist/ui/next-step-card.d.ts +55 -0
- package/dist/ui/next-step-card.js +92 -0
- package/dist/ui/notice-review.d.ts +32 -0
- package/dist/ui/oauth-consent.d.ts +1 -1
- package/dist/ui/page-header.d.ts +46 -4
- package/dist/ui/page-header.js +20 -11
- package/dist/ui/page-loader.d.ts +17 -0
- package/dist/ui/page-shell.d.ts +17 -0
- package/dist/ui/pagination.d.ts +20 -0
- package/dist/ui/pagination.js +2 -2
- package/dist/ui/panel.d.ts +1 -1
- package/dist/ui/password-strength.d.ts +14 -0
- package/dist/ui/popover.d.ts +32 -0
- package/dist/ui/proportion-bar.d.ts +25 -0
- package/dist/ui/quantity.d.ts +25 -0
- package/dist/ui/quantity.js +27 -0
- package/dist/ui/questionnaire.d.ts +38 -0
- package/dist/ui/reasoning.d.ts +24 -0
- package/dist/ui/reasoning.js +62 -0
- package/dist/ui/reveal.d.ts +17 -0
- package/dist/ui/sheet.d.ts +39 -2
- package/dist/ui/sheet.js +6 -2
- package/dist/ui/shield.d.ts +14 -0
- package/dist/ui/show-more.d.ts +14 -0
- package/dist/ui/sidebar.d.ts +4 -2
- package/dist/ui/sidebar.js +7 -3
- package/dist/ui/sparkline.d.ts +1 -1
- package/dist/ui/stat-group.d.ts +32 -0
- package/dist/ui/stat.d.ts +1 -1
- package/dist/ui/status-badge.d.ts +3 -3
- package/dist/ui/status-hero.d.ts +18 -0
- package/dist/ui/step-dots.d.ts +12 -0
- package/dist/ui/step-ring.d.ts +14 -0
- package/dist/ui/suggestions.d.ts +17 -0
- package/dist/ui/suggestions.js +39 -0
- package/dist/ui/table.d.ts +26 -0
- package/dist/ui/tag-input.d.ts +21 -0
- package/dist/ui/tag-input.js +169 -0
- package/dist/ui/task-loader.d.ts +15 -0
- package/dist/ui/task-progress.d.ts +14 -0
- package/dist/ui/textarea.d.ts +22 -1
- package/dist/ui/textarea.js +7 -1
- package/dist/ui/timeline.d.ts +26 -0
- package/dist/ui/toggle-group.d.ts +24 -0
- package/dist/ui/tool-call.d.ts +27 -0
- package/dist/ui/tool-call.js +74 -0
- package/dist/ui/usage-meter.d.ts +42 -0
- package/dist/ui/usage-meter.js +116 -0
- package/dist/ui/week-strip.d.ts +11 -0
- package/dist/ui/week-strip.js +2 -2
- package/dist/ui/workflow-run.d.ts +51 -0
- package/dist/ui/workflow-run.js +185 -0
- package/docs/adr/0001-rtl-clases-logicas.md +14 -1
- package/docs/designer/criterio.md +87 -87
- package/docs/designer/flujo.md +1 -1
- package/docs/designer/patrones.md +43 -2
- package/manifest/actions.json +364 -0
- package/manifest/agents.json +399 -0
- package/manifest/ai.json +128 -0
- package/manifest/auth.json +1547 -0
- package/manifest/chat.json +612 -0
- package/manifest/content.json +2298 -0
- package/manifest/data.json +2904 -0
- package/manifest/feedback.json +1005 -0
- package/manifest/forms.json +1954 -0
- package/manifest/motion.json +196 -0
- package/manifest/navigation.json +1792 -0
- package/manifest/overlays.json +931 -0
- package/package.json +35 -21
- package/scripts/cli.mjs +105 -8
- package/scripts/doctor.mjs +126 -1
- package/scripts/eslint-plugin.mjs +93 -0
- package/scripts/i18n.mjs +1 -1
- package/scripts/manifest.mjs +159 -7
- package/skill/SKILL.md +8 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
const str = (v) => typeof v === "string" && v ? v : void 0;
|
|
2
|
+
const pretty = (v) => {
|
|
3
|
+
if (v === void 0 || v === null || v === "") return void 0;
|
|
4
|
+
if (typeof v === "string") return v;
|
|
5
|
+
try {
|
|
6
|
+
return JSON.stringify(v, null, 2);
|
|
7
|
+
} catch {
|
|
8
|
+
return String(v);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
function chipsFromMeta(meta) {
|
|
12
|
+
const chips = [];
|
|
13
|
+
const k = (n) => n >= 1e3 ? `${(n / 1e3).toFixed(1)}k` : String(n);
|
|
14
|
+
if (meta.model) chips.push({ kind: "model", label: meta.model });
|
|
15
|
+
if (meta.tokensIn != null || meta.tokensOut != null)
|
|
16
|
+
chips.push({ kind: "tokens", label: `${k(meta.tokensIn ?? 0)}/${k(meta.tokensOut ?? 0)} tok` });
|
|
17
|
+
if (meta.costUsd != null) chips.push({ kind: "cost", label: `$${meta.costUsd.toFixed(4)}` });
|
|
18
|
+
return chips;
|
|
19
|
+
}
|
|
20
|
+
function toAgentEvents(stream) {
|
|
21
|
+
const out = [];
|
|
22
|
+
const byId = /* @__PURE__ */ new Map();
|
|
23
|
+
let thinking;
|
|
24
|
+
let message;
|
|
25
|
+
let model;
|
|
26
|
+
let seq = 0;
|
|
27
|
+
const id = (p) => `${p}-${++seq}`;
|
|
28
|
+
const toolStart = (key, name) => {
|
|
29
|
+
const e = { id: `tool-${key}`, type: "tool", title: name, status: "running" };
|
|
30
|
+
byId.set(key, e);
|
|
31
|
+
out.push(e);
|
|
32
|
+
return e;
|
|
33
|
+
};
|
|
34
|
+
const tool = (key) => byId.get(key) ?? toolStart(key, void 0);
|
|
35
|
+
const closeThinking = () => {
|
|
36
|
+
if (thinking) thinking.status = "done";
|
|
37
|
+
thinking = void 0;
|
|
38
|
+
};
|
|
39
|
+
const closeMessage = () => {
|
|
40
|
+
if (message) message.status = "done";
|
|
41
|
+
message = void 0;
|
|
42
|
+
};
|
|
43
|
+
const addThinking = (delta) => {
|
|
44
|
+
if (!thinking) {
|
|
45
|
+
thinking = { id: id("thinking"), type: "thinking", status: "running" };
|
|
46
|
+
out.push(thinking);
|
|
47
|
+
}
|
|
48
|
+
if (delta) thinking.detail = `${thinking.detail ?? ""}${delta}`;
|
|
49
|
+
};
|
|
50
|
+
const addText = (delta) => {
|
|
51
|
+
closeThinking();
|
|
52
|
+
if (!message) {
|
|
53
|
+
message = { id: id("message"), type: "message", status: "running" };
|
|
54
|
+
out.push(message);
|
|
55
|
+
}
|
|
56
|
+
if (delta) message.summary = `${message.summary ?? ""}${delta}`;
|
|
57
|
+
};
|
|
58
|
+
const fail = (e) => {
|
|
59
|
+
out.push({
|
|
60
|
+
id: id("error"),
|
|
61
|
+
type: "error",
|
|
62
|
+
summary: str(e.message) ?? str(e.error) ?? pretty(e.error),
|
|
63
|
+
status: "error"
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
for (const item of stream) {
|
|
67
|
+
if (!item || typeof item !== "object") continue;
|
|
68
|
+
const e = item;
|
|
69
|
+
const key = str(e.toolId) ?? str(e.toolCallId);
|
|
70
|
+
switch (e.type) {
|
|
71
|
+
case "stream.start":
|
|
72
|
+
model = str(e.model);
|
|
73
|
+
break;
|
|
74
|
+
case "RUN_STARTED":
|
|
75
|
+
break;
|
|
76
|
+
case "text.delta":
|
|
77
|
+
case "TEXT_MESSAGE_CONTENT":
|
|
78
|
+
addText(str(e.delta));
|
|
79
|
+
break;
|
|
80
|
+
case "TEXT_MESSAGE_START":
|
|
81
|
+
addText(void 0);
|
|
82
|
+
break;
|
|
83
|
+
case "TEXT_MESSAGE_END":
|
|
84
|
+
closeMessage();
|
|
85
|
+
break;
|
|
86
|
+
case "thinking.start":
|
|
87
|
+
case "THINKING_START":
|
|
88
|
+
case "THINKING_TEXT_MESSAGE_START":
|
|
89
|
+
addThinking(void 0);
|
|
90
|
+
break;
|
|
91
|
+
case "thinking.delta":
|
|
92
|
+
case "THINKING_TEXT_MESSAGE_CONTENT":
|
|
93
|
+
addThinking(str(e.delta));
|
|
94
|
+
break;
|
|
95
|
+
case "thinking.done":
|
|
96
|
+
case "THINKING_END":
|
|
97
|
+
case "THINKING_TEXT_MESSAGE_END":
|
|
98
|
+
closeThinking();
|
|
99
|
+
break;
|
|
100
|
+
case "tool.start":
|
|
101
|
+
case "TOOL_CALL_START":
|
|
102
|
+
closeThinking();
|
|
103
|
+
if (key) toolStart(key, str(e.name) ?? str(e.toolCallName));
|
|
104
|
+
break;
|
|
105
|
+
case "tool.delta":
|
|
106
|
+
case "TOOL_CALL_ARGS":
|
|
107
|
+
if (key) {
|
|
108
|
+
const t = tool(key);
|
|
109
|
+
t.detail = `${typeof t.detail === "string" ? t.detail : ""}${str(e.delta) ?? ""}`;
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
case "TOOL_CALL_END":
|
|
113
|
+
break;
|
|
114
|
+
case "tool.done":
|
|
115
|
+
case "TOOL_CALL_RESULT":
|
|
116
|
+
if (key) {
|
|
117
|
+
const t = tool(key);
|
|
118
|
+
t.status = "done";
|
|
119
|
+
const result = pretty(e.result ?? e.content);
|
|
120
|
+
if (result) t.summary = result.length > 160 ? `${result.slice(0, 157)}\u2026` : result;
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case "tool.error":
|
|
124
|
+
if (key) {
|
|
125
|
+
const t = tool(key);
|
|
126
|
+
t.status = "error";
|
|
127
|
+
t.summary = str(e.error) ?? str(e.message) ?? pretty(e.error);
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case "STEP_STARTED":
|
|
131
|
+
out.push({ id: id("step"), type: "handoff", title: str(e.stepName), status: "running" });
|
|
132
|
+
break;
|
|
133
|
+
case "STEP_FINISHED": {
|
|
134
|
+
const s = [...out].reverse().find((x) => x.type === "handoff" && x.title === str(e.stepName));
|
|
135
|
+
if (s) s.status = "done";
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
case "stream.end":
|
|
139
|
+
case "RUN_FINISHED":
|
|
140
|
+
closeThinking();
|
|
141
|
+
closeMessage();
|
|
142
|
+
out.push({
|
|
143
|
+
id: id("done"),
|
|
144
|
+
type: "done",
|
|
145
|
+
chips: chipsFromMeta({
|
|
146
|
+
model,
|
|
147
|
+
tokensIn: e.usage?.inputTokens,
|
|
148
|
+
tokensOut: e.usage?.outputTokens
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
break;
|
|
152
|
+
case "error":
|
|
153
|
+
case "RUN_ERROR":
|
|
154
|
+
closeThinking();
|
|
155
|
+
closeMessage();
|
|
156
|
+
fail(e);
|
|
157
|
+
break;
|
|
158
|
+
default:
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return out;
|
|
163
|
+
}
|
|
164
|
+
function fromUiMessageParts(parts) {
|
|
165
|
+
const out = [];
|
|
166
|
+
parts.forEach((p, i) => {
|
|
167
|
+
if (!p || typeof p !== "object") return;
|
|
168
|
+
const part = p;
|
|
169
|
+
const type = part.type ?? "";
|
|
170
|
+
if (type === "reasoning") {
|
|
171
|
+
out.push({
|
|
172
|
+
id: `r-${i}`,
|
|
173
|
+
type: "thinking",
|
|
174
|
+
detail: str(part.text),
|
|
175
|
+
status: part.state === "streaming" ? "running" : "done"
|
|
176
|
+
});
|
|
177
|
+
} else if (type === "text") {
|
|
178
|
+
out.push({
|
|
179
|
+
id: `t-${i}`,
|
|
180
|
+
type: "message",
|
|
181
|
+
summary: str(part.text),
|
|
182
|
+
status: part.state === "streaming" ? "running" : "done"
|
|
183
|
+
});
|
|
184
|
+
} else if (type === "dynamic-tool" || type.startsWith("tool-")) {
|
|
185
|
+
const state = str(part.state);
|
|
186
|
+
out.push({
|
|
187
|
+
id: str(part.toolCallId) ?? `tool-${i}`,
|
|
188
|
+
type: "tool",
|
|
189
|
+
title: type === "dynamic-tool" ? str(part.toolName) : type.slice(5),
|
|
190
|
+
summary: state === "output-error" ? str(part.errorText) : void 0,
|
|
191
|
+
detail: pretty(part.output ?? part.input),
|
|
192
|
+
status: state === "output-error" ? "error" : state === "output-available" ? "done" : "running"
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
return out;
|
|
197
|
+
}
|
|
198
|
+
export {
|
|
199
|
+
chipsFromMeta,
|
|
200
|
+
fromUiMessageParts,
|
|
201
|
+
toAgentEvents
|
|
202
|
+
};
|
package/dist/lib/auth-flow.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { MfaMethod } from './auth.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './i18n.js';
|
|
5
5
|
|
|
6
|
-
type AuthFlowPreset = "standard" | "social" | "passwordless" | "partner" | "enterprise" | "hybrid" | "sso-only";
|
|
6
|
+
type AuthFlowPreset = "standard" | "social" | "passwordless" | "partner" | "enterprise" | "hybrid" | "sso-only" | "sso-staff";
|
|
7
7
|
type AuthAudience = "internal" | "external" | "mixed";
|
|
8
8
|
type AuthSignUp = "open" | "invite" | "none";
|
|
9
9
|
type AuthSignInMethod = "password" | "social" | "passkey" | "magic-link" | "email-code" | "sso";
|
|
@@ -26,6 +26,8 @@ type AuthFlowConfig = {
|
|
|
26
26
|
signIn: "sign-in" | "social" | "magic-link" | "email-code" | "sso";
|
|
27
27
|
/** Identificador primero (home realm discovery). */
|
|
28
28
|
identifierFirst: boolean;
|
|
29
|
+
/** Inicio de la pantalla: pide el correo (identifier) o ofrece dos puertas sin escribir: «Continuar con SSO» y «Acceso para personas externas» (doors). */
|
|
30
|
+
entry?: "identifier" | "doors";
|
|
29
31
|
/** Dominios de la plantilla (sin @): su correo va al SSO corporativo. Obligatorio en `mixed`. */
|
|
30
32
|
internalDomains: string[];
|
|
31
33
|
/** Cómo se crean las cuentas: registro abierto, por invitación o desde el directorio (SSO). */
|
package/dist/lib/auth-flow.js
CHANGED
|
@@ -65,6 +65,22 @@ const AUTH_FLOW_PRESETS = {
|
|
|
65
65
|
mfa: { required: true, methods: ["totp", "passkey", "backup-code"] },
|
|
66
66
|
layout: { preset: "split", surface: "plain", motion: "entrance" }
|
|
67
67
|
},
|
|
68
|
+
"sso-staff": {
|
|
69
|
+
audience: "mixed",
|
|
70
|
+
methods: ["sso", "password", "passkey"],
|
|
71
|
+
providers: [],
|
|
72
|
+
signIn: "sign-in",
|
|
73
|
+
identifierFirst: false,
|
|
74
|
+
internalDomains: [],
|
|
75
|
+
entry: "doors",
|
|
76
|
+
signUp: "invite",
|
|
77
|
+
mfa: { required: true, methods: ["totp", "passkey", "backup-code"] },
|
|
78
|
+
access: {
|
|
79
|
+
internal: { methods: ["sso"], mfaRequired: false, signUp: "none" },
|
|
80
|
+
external: { methods: ["password", "passkey"], mfaRequired: true, signUp: "invite" }
|
|
81
|
+
},
|
|
82
|
+
layout: { preset: "split", surface: "plain", motion: "entrance" }
|
|
83
|
+
},
|
|
68
84
|
"sso-only": {
|
|
69
85
|
audience: "internal",
|
|
70
86
|
methods: ["sso"],
|
|
@@ -84,7 +100,10 @@ function defineAuthFlow(preset, overrides = {}) {
|
|
|
84
100
|
...overrides,
|
|
85
101
|
preset,
|
|
86
102
|
mfa: { ...base.mfa, ...overrides.mfa },
|
|
87
|
-
access: {
|
|
103
|
+
access: {
|
|
104
|
+
internal: { ...base.access?.internal, ...overrides.access?.internal },
|
|
105
|
+
external: { ...base.access?.external, ...overrides.access?.external }
|
|
106
|
+
},
|
|
88
107
|
layout: { ...base.layout, ...overrides.layout }
|
|
89
108
|
};
|
|
90
109
|
}
|
|
@@ -133,8 +152,10 @@ function validateAuthFlow(flow) {
|
|
|
133
152
|
if (flow.audience === "mixed") {
|
|
134
153
|
if (!has("sso")) issues.push('Mixed audience without the "sso" method for staff.');
|
|
135
154
|
if (!ownAccount) issues.push("Mixed audience without a method for external people.");
|
|
136
|
-
if (
|
|
137
|
-
|
|
155
|
+
if (flow.entry !== "doors") {
|
|
156
|
+
if (!flow.internalDomains.length) issues.push("Mixed audience without `internalDomains`: staff cannot be routed to SSO.");
|
|
157
|
+
if (!flow.identifierFirst) issues.push("Mixed audience works best with identifierFirst: the email decides the door.");
|
|
158
|
+
}
|
|
138
159
|
}
|
|
139
160
|
if (flow.access?.internal?.signUp && flow.access.internal.signUp !== "none") issues.push('`access.internal.signUp` should be "none": staff accounts come from the directory.');
|
|
140
161
|
if (flow.access?.external?.methods?.includes("sso") && flow.audience !== "external") issues.push('`access.external.methods` with "sso": SSO is the staff door; external SSO goes through `onIdentify` (their own company).');
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
type DsUnitDisplay = "short" | "long" | "narrow";
|
|
2
|
+
interface DsQuantityOptions {
|
|
3
|
+
/** Etiqueta BCP 47 (p. ej. "es", "pt-BR"). Por defecto, la del entorno. */
|
|
4
|
+
locale?: string;
|
|
5
|
+
/** "si" (1000, GB) por defecto; "binary" (1024, GiB) para memoria o cuando el contrato lo diga. */
|
|
6
|
+
system?: "si" | "binary";
|
|
7
|
+
/** Forma de la unidad: "short" (12 GB), "long" (12 gigabytes), "narrow" (12GB). */
|
|
8
|
+
unitDisplay?: DsUnitDisplay;
|
|
9
|
+
/** Decimales máximos. Por defecto: 1 en bytes y tasas escaladas, 0 en el resto salvo que el valor los traiga. */
|
|
10
|
+
maximumFractionDigits?: number;
|
|
11
|
+
/** Notación compacta para recuentos grandes (1,2 mil). */
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** ¿La unidad es de bytes (UCUM)? */
|
|
15
|
+
declare function isByteUnit(unit: string | undefined): boolean;
|
|
16
|
+
/** Pasa un valor en bytes UCUM (`GBy`, `MiBy`…) a bytes. Devuelve null si la unidad no es de bytes. */
|
|
17
|
+
declare function toBytes(value: number, unit: string): number | null;
|
|
18
|
+
/**
|
|
19
|
+
* Formatea un valor con su unidad UCUM en el idioma indicado.
|
|
20
|
+
*
|
|
21
|
+
* formatQuantity(12_000_000_000, "By", { locale: "es" }) → "12 GB"
|
|
22
|
+
* formatQuantity(50, "GBy", { locale: "es" }) → "50 GB"
|
|
23
|
+
* formatQuantity(73.5, "%", { locale: "es" }) → "73,5 %"
|
|
24
|
+
* formatQuantity(3, "{device}") → "3"
|
|
25
|
+
* formatQuantity(null, "By") → null
|
|
26
|
+
*/
|
|
27
|
+
declare function formatQuantity(value: number | null | undefined, unit?: string, options?: DsQuantityOptions): string | null;
|
|
28
|
+
/** Proporción (0..1) como porcentaje: formatRatio(0.24, { locale: "es" }) → "24 %". */
|
|
29
|
+
declare function formatRatio(ratio: number | null | undefined, options?: {
|
|
30
|
+
locale?: string;
|
|
31
|
+
maximumFractionDigits?: number;
|
|
32
|
+
}): string | null;
|
|
33
|
+
type DsDateInput = Date | string | number | null | undefined;
|
|
34
|
+
/** Pasa una fecha (Date, ISO 8601 o milisegundos) a Date; null si no es válida. */
|
|
35
|
+
declare function toDate(input: DsDateInput): Date | null;
|
|
36
|
+
type DsDateStyle = "date" | "datetime" | "time" | "long" | "short";
|
|
37
|
+
/** Fecha absoluta en el idioma indicado. `style` o, para algo concreto, `format` (Intl.DateTimeFormatOptions). */
|
|
38
|
+
declare function formatDate(input: DsDateInput, options?: {
|
|
39
|
+
locale?: string;
|
|
40
|
+
style?: DsDateStyle;
|
|
41
|
+
format?: Intl.DateTimeFormatOptions;
|
|
42
|
+
timeZone?: string;
|
|
43
|
+
}): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Tiempo relativo («hace 5 minutos», «en 3 días», «ayer») eligiendo la unidad sola.
|
|
46
|
+
* `now` permite fijar el instante de referencia (pruebas, servidor).
|
|
47
|
+
*/
|
|
48
|
+
declare function formatRelativeTime(input: DsDateInput, options?: {
|
|
49
|
+
locale?: string;
|
|
50
|
+
now?: DsDateInput;
|
|
51
|
+
numeric?: "auto" | "always";
|
|
52
|
+
style?: "long" | "short" | "narrow";
|
|
53
|
+
}): string | null;
|
|
54
|
+
/** Cada cuánto conviene refrescar un tiempo relativo según su distancia al presente (ms). */
|
|
55
|
+
declare function relativeTimeRefreshMs(input: DsDateInput, now?: DsDateInput): number;
|
|
56
|
+
|
|
57
|
+
export { type DsDateInput, type DsDateStyle, type DsQuantityOptions, type DsUnitDisplay, formatDate, formatQuantity, formatRatio, formatRelativeTime, isByteUnit, relativeTimeRefreshMs, toBytes, toDate };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
const BYTE_UNITS = {
|
|
2
|
+
By: 1,
|
|
3
|
+
kBy: 1e3,
|
|
4
|
+
MBy: 1e6,
|
|
5
|
+
GBy: 1e9,
|
|
6
|
+
TBy: 1e12,
|
|
7
|
+
PBy: 1e15,
|
|
8
|
+
KiBy: 1024,
|
|
9
|
+
MiBy: 1024 ** 2,
|
|
10
|
+
GiBy: 1024 ** 3,
|
|
11
|
+
TiBy: 1024 ** 4,
|
|
12
|
+
PiBy: 1024 ** 5
|
|
13
|
+
};
|
|
14
|
+
const BIT_RATE_UNITS = {
|
|
15
|
+
"bit/s": 1,
|
|
16
|
+
"kbit/s": 1e3,
|
|
17
|
+
"Mbit/s": 1e6,
|
|
18
|
+
"Gbit/s": 1e9,
|
|
19
|
+
"By/s": 8,
|
|
20
|
+
"kBy/s": 8e3,
|
|
21
|
+
"MBy/s": 8e6
|
|
22
|
+
};
|
|
23
|
+
const SI_BYTE_STEPS = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"];
|
|
24
|
+
const BINARY_BYTE_STEPS = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
|
|
25
|
+
const BIT_RATE_STEPS = ["bit-per-second", "kilobit-per-second", "megabit-per-second", "gigabit-per-second"];
|
|
26
|
+
const INTL_UNITS = {
|
|
27
|
+
"%": "percent",
|
|
28
|
+
ms: "millisecond",
|
|
29
|
+
s: "second",
|
|
30
|
+
min: "minute",
|
|
31
|
+
h: "hour",
|
|
32
|
+
d: "day",
|
|
33
|
+
wk: "week",
|
|
34
|
+
mo: "month",
|
|
35
|
+
a: "year",
|
|
36
|
+
m: "meter",
|
|
37
|
+
km: "kilometer",
|
|
38
|
+
cm: "centimeter",
|
|
39
|
+
g: "gram",
|
|
40
|
+
kg: "kilogram",
|
|
41
|
+
L: "liter",
|
|
42
|
+
l: "liter",
|
|
43
|
+
Cel: "celsius",
|
|
44
|
+
"[degF]": "fahrenheit"
|
|
45
|
+
};
|
|
46
|
+
function isFiniteNumber(v) {
|
|
47
|
+
return typeof v === "number" && Number.isFinite(v);
|
|
48
|
+
}
|
|
49
|
+
function isByteUnit(unit) {
|
|
50
|
+
return !!unit && unit in BYTE_UNITS;
|
|
51
|
+
}
|
|
52
|
+
function toBytes(value, unit) {
|
|
53
|
+
const f = BYTE_UNITS[unit];
|
|
54
|
+
return f === void 0 ? null : value * f;
|
|
55
|
+
}
|
|
56
|
+
function scaled(value, base, steps) {
|
|
57
|
+
let n = value;
|
|
58
|
+
let i = 0;
|
|
59
|
+
while (Math.abs(n) >= base && i < steps.length - 1) {
|
|
60
|
+
n /= base;
|
|
61
|
+
i++;
|
|
62
|
+
}
|
|
63
|
+
return { n, step: steps[i] };
|
|
64
|
+
}
|
|
65
|
+
function digitsFor(n, max, fallback) {
|
|
66
|
+
if (max !== void 0) return max;
|
|
67
|
+
return Number.isInteger(n) ? 0 : fallback;
|
|
68
|
+
}
|
|
69
|
+
function formatQuantity(value, unit, options = {}) {
|
|
70
|
+
if (!isFiniteNumber(value)) return null;
|
|
71
|
+
const { locale, system = "si", unitDisplay = "short", maximumFractionDigits, compact } = options;
|
|
72
|
+
if (unit && unit in BYTE_UNITS) {
|
|
73
|
+
const bytes = value * BYTE_UNITS[unit];
|
|
74
|
+
if (system === "binary") {
|
|
75
|
+
const { n: n2, step: step2 } = scaled(bytes, 1024, BINARY_BYTE_STEPS);
|
|
76
|
+
const num = new Intl.NumberFormat(locale, { maximumFractionDigits: digitsFor(n2, maximumFractionDigits, 1) }).format(n2);
|
|
77
|
+
return `${num}\xA0${step2}`;
|
|
78
|
+
}
|
|
79
|
+
const { n, step } = scaled(bytes, 1e3, SI_BYTE_STEPS);
|
|
80
|
+
return new Intl.NumberFormat(locale, {
|
|
81
|
+
style: "unit",
|
|
82
|
+
unit: step,
|
|
83
|
+
unitDisplay,
|
|
84
|
+
maximumFractionDigits: digitsFor(n, maximumFractionDigits, 1)
|
|
85
|
+
}).format(n);
|
|
86
|
+
}
|
|
87
|
+
if (unit && unit in BIT_RATE_UNITS) {
|
|
88
|
+
const { n, step } = scaled(value * BIT_RATE_UNITS[unit], 1e3, BIT_RATE_STEPS);
|
|
89
|
+
return new Intl.NumberFormat(locale, {
|
|
90
|
+
style: "unit",
|
|
91
|
+
unit: step,
|
|
92
|
+
unitDisplay,
|
|
93
|
+
maximumFractionDigits: digitsFor(n, maximumFractionDigits, 1)
|
|
94
|
+
}).format(n);
|
|
95
|
+
}
|
|
96
|
+
const intlUnit = unit ? INTL_UNITS[unit] : void 0;
|
|
97
|
+
if (intlUnit) {
|
|
98
|
+
return new Intl.NumberFormat(locale, {
|
|
99
|
+
style: "unit",
|
|
100
|
+
unit: intlUnit,
|
|
101
|
+
unitDisplay,
|
|
102
|
+
maximumFractionDigits: digitsFor(value, maximumFractionDigits, 2)
|
|
103
|
+
}).format(value);
|
|
104
|
+
}
|
|
105
|
+
const plain = new Intl.NumberFormat(locale, {
|
|
106
|
+
maximumFractionDigits: digitsFor(value, maximumFractionDigits, 2),
|
|
107
|
+
...compact ? { notation: "compact" } : {}
|
|
108
|
+
}).format(value);
|
|
109
|
+
if (!unit || unit === "1" || /^\{.*\}$/.test(unit)) return plain;
|
|
110
|
+
return `${plain}\xA0${unit}`;
|
|
111
|
+
}
|
|
112
|
+
function formatRatio(ratio, options = {}) {
|
|
113
|
+
if (!isFiniteNumber(ratio)) return null;
|
|
114
|
+
return new Intl.NumberFormat(options.locale, {
|
|
115
|
+
style: "percent",
|
|
116
|
+
maximumFractionDigits: options.maximumFractionDigits ?? 0
|
|
117
|
+
}).format(ratio);
|
|
118
|
+
}
|
|
119
|
+
function toDate(input) {
|
|
120
|
+
if (input === null || input === void 0 || input === "") return null;
|
|
121
|
+
const d = input instanceof Date ? input : new Date(input);
|
|
122
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
123
|
+
}
|
|
124
|
+
const DATE_STYLES = {
|
|
125
|
+
date: { dateStyle: "medium" },
|
|
126
|
+
datetime: { dateStyle: "medium", timeStyle: "short" },
|
|
127
|
+
time: { timeStyle: "short" },
|
|
128
|
+
long: { dateStyle: "long" },
|
|
129
|
+
short: { dateStyle: "short" }
|
|
130
|
+
};
|
|
131
|
+
function formatDate(input, options = {}) {
|
|
132
|
+
const d = toDate(input);
|
|
133
|
+
if (!d) return null;
|
|
134
|
+
const fmt = options.format ?? DATE_STYLES[options.style ?? "date"];
|
|
135
|
+
return new Intl.DateTimeFormat(options.locale, { ...fmt, ...options.timeZone ? { timeZone: options.timeZone } : {} }).format(d);
|
|
136
|
+
}
|
|
137
|
+
const RELATIVE_STEPS = [
|
|
138
|
+
["second", 60],
|
|
139
|
+
["minute", 60],
|
|
140
|
+
["hour", 24],
|
|
141
|
+
["day", 7],
|
|
142
|
+
["week", 4.345],
|
|
143
|
+
["month", 12],
|
|
144
|
+
["year", Number.POSITIVE_INFINITY]
|
|
145
|
+
];
|
|
146
|
+
function formatRelativeTime(input, options = {}) {
|
|
147
|
+
const d = toDate(input);
|
|
148
|
+
if (!d) return null;
|
|
149
|
+
const now = toDate(options.now) ?? /* @__PURE__ */ new Date();
|
|
150
|
+
let delta = (d.getTime() - now.getTime()) / 1e3;
|
|
151
|
+
const rtf = new Intl.RelativeTimeFormat(options.locale, { numeric: options.numeric ?? "auto", style: options.style ?? "long" });
|
|
152
|
+
for (const [unit, size] of RELATIVE_STEPS) {
|
|
153
|
+
if (Math.abs(delta) < size) return rtf.format(Math.round(delta), unit);
|
|
154
|
+
delta /= size;
|
|
155
|
+
}
|
|
156
|
+
return rtf.format(Math.round(delta), "year");
|
|
157
|
+
}
|
|
158
|
+
function relativeTimeRefreshMs(input, now = /* @__PURE__ */ new Date()) {
|
|
159
|
+
const d = toDate(input);
|
|
160
|
+
const n = toDate(now);
|
|
161
|
+
if (!d || !n) return 0;
|
|
162
|
+
const s = Math.abs(d.getTime() - n.getTime()) / 1e3;
|
|
163
|
+
if (s < 60) return 1e4;
|
|
164
|
+
if (s < 3600) return 6e4;
|
|
165
|
+
if (s < 86400) return 36e5;
|
|
166
|
+
return 0;
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
formatDate,
|
|
170
|
+
formatQuantity,
|
|
171
|
+
formatRatio,
|
|
172
|
+
formatRelativeTime,
|
|
173
|
+
isByteUnit,
|
|
174
|
+
relativeTimeRefreshMs,
|
|
175
|
+
toBytes,
|
|
176
|
+
toDate
|
|
177
|
+
};
|
package/dist/lib/i18n.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** Idiomas que trae orbital-ds (`he` es de derecha a izquierda: ver `dsDirection`). */
|
|
2
|
+
declare const DS_LOCALES: readonly ["en", "es", "pt-BR", "fr", "it", "de", "he"];
|
|
2
3
|
type DsLocale = (typeof DS_LOCALES)[number];
|
|
3
4
|
declare const DS_DEFAULT_LOCALE: DsLocale;
|
|
4
5
|
declare const en: {
|
|
@@ -128,6 +129,86 @@ declare const en: {
|
|
|
128
129
|
noticeStateResolved: string;
|
|
129
130
|
entityRetry: string;
|
|
130
131
|
showMore: string;
|
|
132
|
+
reasoningTitle: string;
|
|
133
|
+
reasoningThinking: string;
|
|
134
|
+
reasoningDone: string;
|
|
135
|
+
toolRunning: string;
|
|
136
|
+
toolDone: string;
|
|
137
|
+
toolError: string;
|
|
138
|
+
toolInput: string;
|
|
139
|
+
toolOutput: string;
|
|
140
|
+
composerPlaceholder: string;
|
|
141
|
+
composerSend: string;
|
|
142
|
+
composerStop: string;
|
|
143
|
+
composerAttach: string;
|
|
144
|
+
suggestionsLabel: string;
|
|
145
|
+
eventThinking: string;
|
|
146
|
+
eventTool: string;
|
|
147
|
+
eventMessage: string;
|
|
148
|
+
eventHandoff: string;
|
|
149
|
+
eventError: string;
|
|
150
|
+
eventDone: string;
|
|
151
|
+
composerVoice: string;
|
|
152
|
+
voiceRecording: string;
|
|
153
|
+
voiceCancel: string;
|
|
154
|
+
voiceConfirm: string;
|
|
155
|
+
voiceTranscribing: string;
|
|
156
|
+
voiceError: string;
|
|
157
|
+
voiceRetry: string;
|
|
158
|
+
composerRemoveFile: string;
|
|
159
|
+
tagRemove: string;
|
|
160
|
+
tagAdd: string;
|
|
161
|
+
composerCounter: string;
|
|
162
|
+
composerDrop: string;
|
|
163
|
+
composerUploading: string;
|
|
164
|
+
composerFileError: string;
|
|
165
|
+
conversationNew: string;
|
|
166
|
+
conversationSearch: string;
|
|
167
|
+
conversationPinned: string;
|
|
168
|
+
conversationToday: string;
|
|
169
|
+
conversationYesterday: string;
|
|
170
|
+
conversationWeek: string;
|
|
171
|
+
conversationOlder: string;
|
|
172
|
+
conversationRename: string;
|
|
173
|
+
conversationDelete: string;
|
|
174
|
+
conversationPin: string;
|
|
175
|
+
conversationUnpin: string;
|
|
176
|
+
conversationEmpty: string;
|
|
177
|
+
conversationListLabel: string;
|
|
178
|
+
conversationActions: string;
|
|
179
|
+
messageCopy: string;
|
|
180
|
+
messageRetry: string;
|
|
181
|
+
messageGood: string;
|
|
182
|
+
messageBad: string;
|
|
183
|
+
messageActionsLabel: string;
|
|
184
|
+
chainWorking: string;
|
|
185
|
+
chainDone: string;
|
|
186
|
+
workflowRunning: string;
|
|
187
|
+
workflowSucceeded: string;
|
|
188
|
+
workflowFailed: string;
|
|
189
|
+
workflowCancelled: string;
|
|
190
|
+
workflowCancel: string;
|
|
191
|
+
workflowRetry: string;
|
|
192
|
+
workflowProgress: string;
|
|
193
|
+
workflowParallel: string;
|
|
194
|
+
workflowSkipped: string;
|
|
195
|
+
workflowWaiting: string;
|
|
196
|
+
toolApprove: string;
|
|
197
|
+
toolDeny: string;
|
|
198
|
+
toolAwaiting: string;
|
|
199
|
+
imageGenerating: string;
|
|
200
|
+
imageError: string;
|
|
201
|
+
imageDownload: string;
|
|
202
|
+
tableEmpty: string;
|
|
203
|
+
tableDownload: string;
|
|
204
|
+
calloutNote: string;
|
|
205
|
+
calloutTip: string;
|
|
206
|
+
calloutImportant: string;
|
|
207
|
+
calloutWarning: string;
|
|
208
|
+
calloutCaution: string;
|
|
209
|
+
markdownLinkExternal: string;
|
|
210
|
+
a2uiUnknown: string;
|
|
211
|
+
a2uiModalTitle: string;
|
|
131
212
|
showLess: string;
|
|
132
213
|
loadMore: string;
|
|
133
214
|
loadMoreDone: string;
|
|
@@ -156,6 +237,10 @@ declare const en: {
|
|
|
156
237
|
filterAll: string;
|
|
157
238
|
filterClear: string;
|
|
158
239
|
statNoData: string;
|
|
240
|
+
usageOf: string;
|
|
241
|
+
usageUnlimited: string;
|
|
242
|
+
usageRemaining: string;
|
|
243
|
+
usageOver: string;
|
|
159
244
|
heatmapLow: string;
|
|
160
245
|
heatmapHigh: string;
|
|
161
246
|
dataTableFilter: string;
|
|
@@ -238,6 +323,7 @@ declare const en: {
|
|
|
238
323
|
copy: string;
|
|
239
324
|
copied: string;
|
|
240
325
|
copyValue: string;
|
|
326
|
+
helpAbout: string;
|
|
241
327
|
aiGenerated: string;
|
|
242
328
|
bottomNav: string;
|
|
243
329
|
dockLabel: string;
|
|
@@ -314,6 +400,10 @@ declare const en: {
|
|
|
314
400
|
authSsoRedirecting: string;
|
|
315
401
|
authChange: string;
|
|
316
402
|
authUseSso: string;
|
|
403
|
+
authContinueSso: string;
|
|
404
|
+
authDoorStaffHint: string;
|
|
405
|
+
authDoorExternalHint: string;
|
|
406
|
+
authDoorExternal: string;
|
|
317
407
|
authBackToSignIn: string;
|
|
318
408
|
authNoAccount: string;
|
|
319
409
|
authSignUpLink: string;
|
|
@@ -459,5 +549,9 @@ declare function dsFormat(text: string, vars: Record<string, string | number>):
|
|
|
459
549
|
declare function dsMessagesFor(tag?: string | null, overrides?: Partial<DsMessages>): DsMessages;
|
|
460
550
|
declare const DS_RTL_LANGS: readonly ["ar", "he", "fa", "ur", "ps", "sd", "ug", "yi", "dv", "ckb"];
|
|
461
551
|
declare function dsDirection(tag: string | null | undefined): "ltr" | "rtl";
|
|
552
|
+
/** Lado de un panel: `start`/`end` siguen la dirección de lectura; `left`/`right` son físicos. */
|
|
553
|
+
type DsInlineSide = "start" | "end" | "left" | "right";
|
|
554
|
+
/** Traduce un lado lógico al físico según la dirección (`start` = izquierda en ltr, derecha en rtl). */
|
|
555
|
+
declare function dsPhysicalSide(side: DsInlineSide, dir: "ltr" | "rtl"): "left" | "right";
|
|
462
556
|
|
|
463
|
-
export { DS_DEFAULT_LOCALE, DS_LOCALES, DS_RTL_LANGS, type DsLocale, type DsMessageKey, type DsMessages, dsCatalogs, dsDirection, dsFormat, dsMessagesFor, resolveDsLocale };
|
|
557
|
+
export { DS_DEFAULT_LOCALE, DS_LOCALES, DS_RTL_LANGS, type DsInlineSide, type DsLocale, type DsMessageKey, type DsMessages, dsCatalogs, dsDirection, dsFormat, dsMessagesFor, dsPhysicalSide, resolveDsLocale };
|