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.
Files changed (197) hide show
  1. package/AGENTS.md +29 -10
  2. package/components.manifest.json +6469 -3349
  3. package/dist/auth-form-B1hgbXkI.d.ts +144 -0
  4. package/dist/hooks/use-ds-messages.d.ts +89 -0
  5. package/dist/lib/a2ui-catalog.d.ts +42 -0
  6. package/dist/lib/a2ui-catalog.js +558 -0
  7. package/dist/lib/a2ui.d.ts +289 -0
  8. package/dist/lib/a2ui.js +215 -0
  9. package/dist/lib/ai-events.d.ts +15 -0
  10. package/dist/lib/ai-events.js +202 -0
  11. package/dist/lib/auth-flow.d.ts +3 -1
  12. package/dist/lib/auth-flow.js +24 -3
  13. package/dist/lib/format.d.ts +57 -0
  14. package/dist/lib/format.js +177 -0
  15. package/dist/lib/i18n.d.ts +96 -2
  16. package/dist/lib/i18n.js +278 -2
  17. package/dist/lib/locales/de.d.ts +7 -0
  18. package/dist/lib/locales/de.js +535 -0
  19. package/dist/lib/locales/fr.d.ts +7 -0
  20. package/dist/lib/locales/fr.js +535 -0
  21. package/dist/lib/locales/he.d.ts +7 -0
  22. package/dist/lib/locales/he.js +535 -0
  23. package/dist/lib/locales/it.d.ts +7 -0
  24. package/dist/lib/locales/it.js +535 -0
  25. package/dist/styles.css +62 -2
  26. package/dist/ui/a2ui-renderer.d.ts +44 -0
  27. package/dist/ui/a2ui-renderer.js +793 -0
  28. package/dist/ui/agent-events.d.ts +49 -0
  29. package/dist/ui/agent-events.js +108 -0
  30. package/dist/ui/ai-tag.d.ts +16 -0
  31. package/dist/ui/alert-dialog.d.ts +37 -0
  32. package/dist/ui/alert.d.ts +1 -1
  33. package/dist/ui/animated-number.d.ts +11 -0
  34. package/dist/ui/app-bar.d.ts +22 -0
  35. package/dist/ui/attachment.d.ts +1 -1
  36. package/dist/ui/auth-backdrop.d.ts +17 -0
  37. package/dist/ui/auth-form.d.ts +3 -110
  38. package/dist/ui/auth-form.js +46 -11
  39. package/dist/ui/auth-layout.d.ts +38 -0
  40. package/dist/ui/avatar.d.ts +27 -0
  41. package/dist/ui/ayuda.d.ts +1 -1
  42. package/dist/ui/ayuda.js +4 -1
  43. package/dist/ui/badge.d.ts +1 -1
  44. package/dist/ui/banner.d.ts +1 -1
  45. package/dist/ui/bottom-nav.d.ts +22 -0
  46. package/dist/ui/breadcrumb.d.ts +22 -0
  47. package/dist/ui/breadcrumb.js +1 -1
  48. package/dist/ui/bubble.d.ts +1 -1
  49. package/dist/ui/button.d.ts +2 -2
  50. package/dist/ui/calendar.d.ts +13 -0
  51. package/dist/ui/calendar.js +3 -0
  52. package/dist/ui/card-stack.d.ts +27 -0
  53. package/dist/ui/card.d.ts +33 -0
  54. package/dist/ui/carousel.d.ts +35 -0
  55. package/dist/ui/carousel.js +10 -5
  56. package/dist/ui/chain-of-thought.d.ts +34 -0
  57. package/dist/ui/chain-of-thought.js +90 -0
  58. package/dist/ui/chart-card.d.ts +19 -0
  59. package/dist/ui/chart.d.ts +19 -0
  60. package/dist/ui/chat-composer.d.ts +58 -0
  61. package/dist/ui/chat-composer.js +192 -0
  62. package/dist/ui/choice-card.d.ts +33 -0
  63. package/dist/ui/code-block.d.ts +15 -0
  64. package/dist/ui/combobox.d.ts +48 -0
  65. package/dist/ui/command-palette.d.ts +18 -0
  66. package/dist/ui/command.d.ts +34 -0
  67. package/dist/ui/confirm-action.d.ts +30 -0
  68. package/dist/ui/confirm-dialog.d.ts +23 -0
  69. package/dist/ui/content-card.d.ts +14 -0
  70. package/dist/ui/context-menu.d.ts +35 -0
  71. package/dist/ui/context-menu.js +1 -1
  72. package/dist/ui/conversation-list.d.ts +44 -0
  73. package/dist/ui/conversation-list.js +141 -0
  74. package/dist/ui/copy-button.d.ts +11 -0
  75. package/dist/ui/date-time.d.ts +40 -0
  76. package/dist/ui/date-time.js +55 -0
  77. package/dist/ui/description-list.d.ts +49 -0
  78. package/dist/ui/description-list.js +86 -0
  79. package/dist/ui/detail-panel.d.ts +22 -0
  80. package/dist/ui/dialog.d.ts +35 -0
  81. package/dist/ui/dock.d.ts +17 -0
  82. package/dist/ui/drawer.d.ts +41 -0
  83. package/dist/ui/dropdown-menu.d.ts +32 -0
  84. package/dist/ui/dropdown-menu.js +1 -1
  85. package/dist/ui/echart.d.ts +15 -0
  86. package/dist/ui/empty.d.ts +1 -1
  87. package/dist/ui/entity-list.d.ts +32 -0
  88. package/dist/ui/form-layout.d.ts +24 -0
  89. package/dist/ui/gauge.d.ts +26 -0
  90. package/dist/ui/generated-image.d.ts +33 -0
  91. package/dist/ui/generated-image.js +65 -0
  92. package/dist/ui/generated-table.d.ts +29 -0
  93. package/dist/ui/generated-table.js +59 -0
  94. package/dist/ui/heatmap-grid.d.ts +20 -0
  95. package/dist/ui/hero.d.ts +58 -0
  96. package/dist/ui/hero.js +145 -0
  97. package/dist/ui/i18n-provider.d.ts +16 -0
  98. package/dist/ui/icon-tile.d.ts +2 -2
  99. package/dist/ui/input-group.d.ts +1 -1
  100. package/dist/ui/input-otp.d.ts +23 -0
  101. package/dist/ui/input.d.ts +16 -0
  102. package/dist/ui/instruction-editor.d.ts +17 -0
  103. package/dist/ui/item.d.ts +3 -3
  104. package/dist/ui/label.d.ts +17 -0
  105. package/dist/ui/legend.d.ts +25 -0
  106. package/dist/ui/level-meter.d.ts +12 -0
  107. package/dist/ui/load-more.d.ts +17 -0
  108. package/dist/ui/loading-state.d.ts +12 -0
  109. package/dist/ui/markdown.d.ts +29 -0
  110. package/dist/ui/markdown.js +123 -0
  111. package/dist/ui/media-card.d.ts +16 -0
  112. package/dist/ui/menubar.d.ts +39 -0
  113. package/dist/ui/message-actions.d.ts +21 -0
  114. package/dist/ui/message-actions.js +79 -0
  115. package/dist/ui/message-scroller.d.ts +30 -0
  116. package/dist/ui/message.d.ts +33 -0
  117. package/dist/ui/mfa-challenge.d.ts +3 -32
  118. package/dist/ui/mfa-challenge.js +1 -1
  119. package/dist/ui/mfa-setup.d.ts +1 -1
  120. package/dist/ui/mosaic.d.ts +23 -0
  121. package/dist/ui/motion-provider.d.ts +17 -0
  122. package/dist/ui/native-select.d.ts +22 -0
  123. package/dist/ui/next-step-card.d.ts +55 -0
  124. package/dist/ui/next-step-card.js +92 -0
  125. package/dist/ui/notice-review.d.ts +32 -0
  126. package/dist/ui/oauth-consent.d.ts +1 -1
  127. package/dist/ui/page-header.d.ts +46 -4
  128. package/dist/ui/page-header.js +20 -11
  129. package/dist/ui/page-loader.d.ts +17 -0
  130. package/dist/ui/page-shell.d.ts +17 -0
  131. package/dist/ui/pagination.d.ts +20 -0
  132. package/dist/ui/pagination.js +2 -2
  133. package/dist/ui/panel.d.ts +1 -1
  134. package/dist/ui/password-strength.d.ts +14 -0
  135. package/dist/ui/popover.d.ts +32 -0
  136. package/dist/ui/proportion-bar.d.ts +25 -0
  137. package/dist/ui/quantity.d.ts +25 -0
  138. package/dist/ui/quantity.js +27 -0
  139. package/dist/ui/questionnaire.d.ts +38 -0
  140. package/dist/ui/reasoning.d.ts +24 -0
  141. package/dist/ui/reasoning.js +62 -0
  142. package/dist/ui/reveal.d.ts +17 -0
  143. package/dist/ui/sheet.d.ts +39 -2
  144. package/dist/ui/sheet.js +6 -2
  145. package/dist/ui/shield.d.ts +14 -0
  146. package/dist/ui/show-more.d.ts +14 -0
  147. package/dist/ui/sidebar.d.ts +4 -2
  148. package/dist/ui/sidebar.js +7 -3
  149. package/dist/ui/sparkline.d.ts +1 -1
  150. package/dist/ui/stat-group.d.ts +32 -0
  151. package/dist/ui/stat.d.ts +1 -1
  152. package/dist/ui/status-badge.d.ts +3 -3
  153. package/dist/ui/status-hero.d.ts +18 -0
  154. package/dist/ui/step-dots.d.ts +12 -0
  155. package/dist/ui/step-ring.d.ts +14 -0
  156. package/dist/ui/suggestions.d.ts +17 -0
  157. package/dist/ui/suggestions.js +39 -0
  158. package/dist/ui/table.d.ts +26 -0
  159. package/dist/ui/tag-input.d.ts +21 -0
  160. package/dist/ui/tag-input.js +169 -0
  161. package/dist/ui/task-loader.d.ts +15 -0
  162. package/dist/ui/task-progress.d.ts +14 -0
  163. package/dist/ui/textarea.d.ts +22 -1
  164. package/dist/ui/textarea.js +7 -1
  165. package/dist/ui/timeline.d.ts +26 -0
  166. package/dist/ui/toggle-group.d.ts +24 -0
  167. package/dist/ui/tool-call.d.ts +27 -0
  168. package/dist/ui/tool-call.js +74 -0
  169. package/dist/ui/usage-meter.d.ts +42 -0
  170. package/dist/ui/usage-meter.js +116 -0
  171. package/dist/ui/week-strip.d.ts +11 -0
  172. package/dist/ui/week-strip.js +2 -2
  173. package/dist/ui/workflow-run.d.ts +51 -0
  174. package/dist/ui/workflow-run.js +185 -0
  175. package/docs/adr/0001-rtl-clases-logicas.md +14 -1
  176. package/docs/designer/criterio.md +87 -87
  177. package/docs/designer/flujo.md +1 -1
  178. package/docs/designer/patrones.md +43 -2
  179. package/manifest/actions.json +364 -0
  180. package/manifest/agents.json +399 -0
  181. package/manifest/ai.json +128 -0
  182. package/manifest/auth.json +1547 -0
  183. package/manifest/chat.json +612 -0
  184. package/manifest/content.json +2298 -0
  185. package/manifest/data.json +2904 -0
  186. package/manifest/feedback.json +1005 -0
  187. package/manifest/forms.json +1954 -0
  188. package/manifest/motion.json +196 -0
  189. package/manifest/navigation.json +1792 -0
  190. package/manifest/overlays.json +931 -0
  191. package/package.json +35 -21
  192. package/scripts/cli.mjs +105 -8
  193. package/scripts/doctor.mjs +126 -1
  194. package/scripts/eslint-plugin.mjs +93 -0
  195. package/scripts/i18n.mjs +1 -1
  196. package/scripts/manifest.mjs +159 -7
  197. 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
+ };
@@ -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). */
@@ -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: { internal: { ...overrides.access?.internal }, external: { ...overrides.access?.external } },
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 (!flow.internalDomains.length) issues.push("Mixed audience without `internalDomains`: staff cannot be routed to SSO.");
137
- if (!flow.identifierFirst) issues.push("Mixed audience works best with identifierFirst: the email decides the door.");
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
+ };
@@ -1,4 +1,5 @@
1
- declare const DS_LOCALES: readonly ["en", "es", "pt-BR"];
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 };