@flowdular/sdk 0.1.0 → 0.2.0

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 (174) hide show
  1. package/.ai/skills/test-hardening/SKILL.md +1 -1
  2. package/README.md +69 -12
  3. package/assets/flowdular-banner.png +0 -0
  4. package/modules/agents/package.json +1 -1
  5. package/modules/auth/package.json +1 -1
  6. package/modules/auth/src/client/AuthenticationCore.tsrx +3 -1
  7. package/modules/auth/src/server/endpoints.ts +3 -1
  8. package/modules/auth/src/server/runtime.ts +4 -0
  9. package/modules/automations/package.json +1 -1
  10. package/modules/automations-workflows-integration/package.json +1 -1
  11. package/modules/profile/package.json +1 -1
  12. package/modules/sandbox/package.json +1 -1
  13. package/modules/system/package.json +1 -1
  14. package/modules/users/package.json +1 -1
  15. package/modules/workflows/package.json +1 -1
  16. package/package.json +5 -13
  17. package/packages/ai-provider/package.json +1 -1
  18. package/packages/cli-protocol/package.json +1 -1
  19. package/packages/client/package.json +1 -1
  20. package/packages/client/src/routing.ts +39 -2
  21. package/packages/client/src/shell/BrandMark.tsrx +5 -1
  22. package/packages/client/src/shell/navigation.ts +3 -1
  23. package/packages/client/src/state.ts +6 -2
  24. package/packages/contracts/package.json +1 -1
  25. package/packages/contracts/schemas/project.schema.json +16 -42
  26. package/packages/database/package.json +1 -1
  27. package/packages/database-pglite/package.json +1 -1
  28. package/packages/database-testing/package.json +1 -1
  29. package/packages/dev-console/package.json +1 -1
  30. package/packages/harness/package.json +1 -1
  31. package/packages/kernel/package.json +1 -1
  32. package/packages/server/package.json +1 -1
  33. package/packages/server/src/application-routes.ts +80 -8
  34. package/packages/server/src/index.ts +4 -1
  35. package/packages/server/src/web-html.ts +9 -5
  36. package/packages/server/src/web.ts +59 -7
  37. package/packages/ui/package.json +1 -1
  38. package/packages/coding-agent/package.json +0 -44
  39. package/packages/coding-agent/src/drivers/byok.ts +0 -322
  40. package/packages/coding-agent/src/drivers/claude-code.ts +0 -290
  41. package/packages/coding-agent/src/drivers/codex.ts +0 -281
  42. package/packages/coding-agent/src/index.ts +0 -56
  43. package/packages/coding-agent/src/registry.ts +0 -119
  44. package/packages/coding-agent/src/roles/contract.ts +0 -60
  45. package/packages/coding-agent/src/roles/defaults.ts +0 -134
  46. package/packages/coding-agent/src/roles/handoff.ts +0 -41
  47. package/packages/coding-agent/src/roles/registry.ts +0 -156
  48. package/packages/coding-agent/src/roles/skills.ts +0 -72
  49. package/packages/coding-agent/src/roles/sync.ts +0 -88
  50. package/packages/coding-agent/src/types.ts +0 -102
  51. package/packages/coding-agent/src/workspace.ts +0 -275
  52. package/packages/sandbox/README.md +0 -691
  53. package/packages/sandbox/bin/flowdular-sandbox.mjs +0 -393
  54. package/packages/sandbox/dist/client/assets/App-ClMOrpyg.js +0 -11
  55. package/packages/sandbox/dist/client/assets/PreviewHost-BHiHrfbQ.js +0 -1
  56. package/packages/sandbox/dist/client/assets/auto-buGEq6de.js +0 -3
  57. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  58. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  59. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  60. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  61. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  62. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  63. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  64. package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  65. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  66. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  67. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  68. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  69. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  70. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  71. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  72. package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  73. package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  74. package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  75. package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  76. package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  77. package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
  78. package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
  79. package/packages/sandbox/dist/client/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
  80. package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  81. package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  82. package/packages/sandbox/dist/client/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
  83. package/packages/sandbox/dist/client/assets/index-CvwhlQ87.js +0 -4
  84. package/packages/sandbox/dist/client/assets/styles-BPWaGf55.js +0 -3
  85. package/packages/sandbox/dist/client/assets/styles-Dx1_KOag.css +0 -1
  86. package/packages/sandbox/dist/client/favicon.svg +0 -1
  87. package/packages/sandbox/dist/server/assets/auto-CVGNYyb3.js +0 -12785
  88. package/packages/sandbox/dist/server/assets/chunk-DDJLRBDX-3OUNo51g.js +0 -4125
  89. package/packages/sandbox/dist/server/assets/nodefs-DVSI7kG0.js +0 -24
  90. package/packages/sandbox/dist/server/assets/opfs-ahp-D56iokt1.js +0 -388
  91. package/packages/sandbox/dist/server/assets/token-Bvaq7Anz.js +0 -55
  92. package/packages/sandbox/dist/server/assets/token-util-BqSvdIPQ.js +0 -3
  93. package/packages/sandbox/dist/server/assets/token-util-CktFFT4z.js +0 -494
  94. package/packages/sandbox/dist/server/entry.js +0 -91671
  95. package/packages/sandbox/dist/server/favicon.svg +0 -1
  96. package/packages/sandbox/dist/server/index.html +0 -161
  97. package/packages/sandbox/index.html +0 -159
  98. package/packages/sandbox/octane.config.ts +0 -36
  99. package/packages/sandbox/package.json +0 -83
  100. package/packages/sandbox/public/favicon.svg +0 -1
  101. package/packages/sandbox/public/og.png +0 -0
  102. package/packages/sandbox/src/App.tsrx +0 -924
  103. package/packages/sandbox/src/client/ApprovalHandoff.tsrx +0 -39
  104. package/packages/sandbox/src/client/ChatPane.tsrx +0 -694
  105. package/packages/sandbox/src/client/ConnectView.tsrx +0 -86
  106. package/packages/sandbox/src/client/DiffPane.tsrx +0 -150
  107. package/packages/sandbox/src/client/EjectModal.tsrx +0 -571
  108. package/packages/sandbox/src/client/GateResults.tsrx +0 -60
  109. package/packages/sandbox/src/client/GitHubSettingsModal.tsrx +0 -219
  110. package/packages/sandbox/src/client/NewSessionForm.tsrx +0 -214
  111. package/packages/sandbox/src/client/SessionBar.tsrx +0 -151
  112. package/packages/sandbox/src/client/SessionPicker.tsrx +0 -472
  113. package/packages/sandbox/src/client/SpecEditor.tsrx +0 -109
  114. package/packages/sandbox/src/client/SpecReviewCard.tsrx +0 -321
  115. package/packages/sandbox/src/client/WorkCard.tsrx +0 -128
  116. package/packages/sandbox/src/client/WorkbenchModal.tsrx +0 -161
  117. package/packages/sandbox/src/client/WorkspaceMenu.tsrx +0 -100
  118. package/packages/sandbox/src/client/api.ts +0 -797
  119. package/packages/sandbox/src/client/attachments.ts +0 -73
  120. package/packages/sandbox/src/client/dashboard.ts +0 -46
  121. package/packages/sandbox/src/client/github-settings.ts +0 -48
  122. package/packages/sandbox/src/client/highlight.ts +0 -105
  123. package/packages/sandbox/src/client/i18n.ts +0 -32
  124. package/packages/sandbox/src/client/locales/en.json +0 -466
  125. package/packages/sandbox/src/client/locales/pl.json +0 -466
  126. package/packages/sandbox/src/client/session-labels.ts +0 -77
  127. package/packages/sandbox/src/client/state.ts +0 -108
  128. package/packages/sandbox/src/index.ts +0 -10
  129. package/packages/sandbox/src/preview/PreviewHost.tsrx +0 -373
  130. package/packages/sandbox/src/preview/load-module.ts +0 -16
  131. package/packages/sandbox/src/server/attachments.ts +0 -308
  132. package/packages/sandbox/src/server/auto-review.ts +0 -181
  133. package/packages/sandbox/src/server/checkpoints.ts +0 -90
  134. package/packages/sandbox/src/server/config.ts +0 -460
  135. package/packages/sandbox/src/server/dashboard.ts +0 -245
  136. package/packages/sandbox/src/server/delivery/configuration.ts +0 -193
  137. package/packages/sandbox/src/server/delivery/git-pr.ts +0 -1473
  138. package/packages/sandbox/src/server/delivery/index.ts +0 -83
  139. package/packages/sandbox/src/server/delivery/local.ts +0 -151
  140. package/packages/sandbox/src/server/delivery/official-modules.ts +0 -516
  141. package/packages/sandbox/src/server/delivery/plan.ts +0 -218
  142. package/packages/sandbox/src/server/delivery/policies.ts +0 -239
  143. package/packages/sandbox/src/server/delivery/record.ts +0 -41
  144. package/packages/sandbox/src/server/delivery/steps.ts +0 -464
  145. package/packages/sandbox/src/server/delivery/types.ts +0 -158
  146. package/packages/sandbox/src/server/dependencies.ts +0 -88
  147. package/packages/sandbox/src/server/diff.ts +0 -230
  148. package/packages/sandbox/src/server/gates.ts +0 -388
  149. package/packages/sandbox/src/server/index.ts +0 -139
  150. package/packages/sandbox/src/server/path-guard.ts +0 -282
  151. package/packages/sandbox/src/server/planning.ts +0 -749
  152. package/packages/sandbox/src/server/platform-client.ts +0 -189
  153. package/packages/sandbox/src/server/preview-database-host.ts +0 -340
  154. package/packages/sandbox/src/server/preview-database-protocol.ts +0 -163
  155. package/packages/sandbox/src/server/preview-database-proxy.ts +0 -356
  156. package/packages/sandbox/src/server/preview-database.ts +0 -109
  157. package/packages/sandbox/src/server/preview-ipc.ts +0 -15
  158. package/packages/sandbox/src/server/preview-modules.ts +0 -83
  159. package/packages/sandbox/src/server/preview-revision.ts +0 -44
  160. package/packages/sandbox/src/server/preview-runtime.ts +0 -467
  161. package/packages/sandbox/src/server/preview-worker-manager.ts +0 -436
  162. package/packages/sandbox/src/server/preview-worker.ts +0 -168
  163. package/packages/sandbox/src/server/reference.ts +0 -251
  164. package/packages/sandbox/src/server/routes.ts +0 -2258
  165. package/packages/sandbox/src/server/runtime.ts +0 -188
  166. package/packages/sandbox/src/server/session-owner.ts +0 -23
  167. package/packages/sandbox/src/server/sessions.ts +0 -849
  168. package/packages/sandbox/src/server/spec.ts +0 -471
  169. package/packages/sandbox/src/server/turn-lifecycle.ts +0 -56
  170. package/packages/sandbox/src/server/turns.ts +0 -993
  171. package/packages/sandbox/src/server/workspace-install.ts +0 -266
  172. package/packages/sandbox/src/server/workspace-root.ts +0 -73
  173. package/packages/sandbox/src/styles.css +0 -1573
  174. package/packages/sandbox/vite.config.ts +0 -133
@@ -1,73 +0,0 @@
1
- import { activeLocale, t } from './i18n.ts';
2
-
3
- /* The composer's mirror of the limits server/attachments.ts enforces. The
4
- server stays the authority; refusing here only saves an upload that would be
5
- rejected, and the two lists must move together. */
6
- export const ATTACHMENT_EXTENSIONS = [
7
- 'png',
8
- 'jpg',
9
- 'jpeg',
10
- 'gif',
11
- 'webp',
12
- 'md',
13
- 'txt',
14
- 'json',
15
- 'csv',
16
- 'pdf',
17
- 'svg',
18
- ];
19
-
20
- export const MAX_ATTACHMENTS = 10;
21
- export const MAX_ATTACHMENT_BYTES = 5 * 1024 * 1024;
22
-
23
- export const ATTACH_ACCEPT =
24
- 'image/png,image/jpeg,image/gif,image/webp,image/svg+xml,.png,.jpg,.jpeg,.gif,.webp,.svg,.md,.txt,.json,.csv,.pdf';
25
-
26
- export function formatBytes(size: number): string {
27
- const value =
28
- size < 1024
29
- ? size
30
- : size < 1024 * 1024
31
- ? size / 1024
32
- : size / (1024 * 1024);
33
- const count = new Intl.NumberFormat(activeLocale(), {
34
- maximumFractionDigits: size < 1024 * 1024 ? 0 : 1,
35
- }).format(value);
36
- return size < 1024
37
- ? t('sandbox.attachments.bytes', { count })
38
- : size < 1024 * 1024
39
- ? t('sandbox.attachments.kilobytes', { count })
40
- : t('sandbox.attachments.megabytes', { count });
41
- }
42
-
43
- export function attachmentKind(file: File): 'image' | 'file' {
44
- return file.type.startsWith('image/') && file.type !== 'image/svg+xml'
45
- ? 'image'
46
- : 'file';
47
- }
48
-
49
- /* Why this file cannot be attached, or null when it can. `held` is how many the
50
- composer already holds. */
51
- export function attachmentRefusal(file: File, held: number): string | null {
52
- if (held >= MAX_ATTACHMENTS) {
53
- return t('sandbox.attachments.limit', { count: MAX_ATTACHMENTS });
54
- }
55
- const dot = file.name.lastIndexOf('.');
56
- const extension = dot > 0 ? file.name.slice(dot + 1).toLowerCase() : '';
57
- if (!ATTACHMENT_EXTENSIONS.includes(extension)) {
58
- return t('sandbox.attachments.type', {
59
- name: file.name,
60
- types: ATTACHMENT_EXTENSIONS.join(', '),
61
- });
62
- }
63
- if (file.size === 0) {
64
- return t('sandbox.attachments.empty', { name: file.name });
65
- }
66
- if (file.size > MAX_ATTACHMENT_BYTES) {
67
- return t('sandbox.attachments.tooLarge', {
68
- name: file.name,
69
- size: MAX_ATTACHMENT_BYTES / (1024 * 1024),
70
- });
71
- }
72
- return null;
73
- }
@@ -1,46 +0,0 @@
1
- import type { DashboardRow, WorkUsage } from '../server/dashboard.ts';
2
-
3
- export function filterWork(
4
- rows: readonly DashboardRow[],
5
- query: string,
6
- status: string,
7
- archived: boolean,
8
- locale: string,
9
- ): readonly DashboardRow[] {
10
- const term = query.trim().toLocaleLowerCase(locale);
11
- return rows.filter(
12
- (row) =>
13
- (!status || row.status === status) &&
14
- (archived || status === 'archived' || row.status !== 'archived') &&
15
- (!term ||
16
- [
17
- row.session.title,
18
- row.session.brief,
19
- ...row.session.modules.map((module) => module.id),
20
- ].some((value) => value.toLocaleLowerCase(locale).includes(term))),
21
- );
22
- }
23
-
24
- export function formatTokens(usage: WorkUsage, locale: string): string {
25
- if (!usage.reportedTurns && usage.missingUsage) return '?';
26
- return (
27
- new Intl.NumberFormat(locale).format(usage.totalTokens) +
28
- (usage.missingUsage ? ' +' : '')
29
- );
30
- }
31
-
32
- export function formatCost(usage: WorkUsage, locale: string): string {
33
- if (
34
- !usage.pricedTurns &&
35
- (usage.unpricedTurns || usage.reportedTurns || usage.missingUsage)
36
- )
37
- return '?';
38
- return (
39
- new Intl.NumberFormat(locale, {
40
- style: 'currency',
41
- currency: 'USD',
42
- minimumFractionDigits: 2,
43
- maximumFractionDigits: 4,
44
- }).format(usage.knownCostUsd) + (usage.unpricedTurns ? ' +' : '')
45
- );
46
- }
@@ -1,48 +0,0 @@
1
- import type { SafeSandboxConfiguration } from '../server/config.ts';
2
- import type { GitHubSettingsInput } from './GitHubSettingsModal.tsrx';
3
-
4
- /* Hidden custom fields must not erase the saved local settings when switching
5
- back to repository defaults. A blank credential preserves the sealed token. */
6
- export function githubSettingsInput(
7
- form: FormData,
8
- current: SafeSandboxConfiguration['github'],
9
- ): GitHubSettingsInput {
10
- const value = (name: string, fallback = '') => {
11
- const entry = form.get(name);
12
- return typeof entry === 'string' ? entry.trim() : fallback;
13
- };
14
- const custom = form.get('githubOverridesProject') === 'on';
15
- const token = value('githubToken');
16
- return {
17
- githubEnabled: form.get('githubEnabled') === 'on',
18
- githubOverridesProject: custom,
19
- githubRemote: custom
20
- ? value('githubRemote', current.remote)
21
- : current.remote,
22
- githubRepository: custom
23
- ? value('githubRepository', current.repository ?? '')
24
- : (current.repository ?? ''),
25
- githubBaseBranch: custom
26
- ? value('githubBaseBranch', current.baseBranch)
27
- : current.baseBranch,
28
- githubBranchPrefix: custom
29
- ? value('githubBranchPrefix', current.branchPrefix)
30
- : current.branchPrefix,
31
- githubMode: custom
32
- ? (value('githubMode', current.mode) as GitHubSettingsInput['githubMode'])
33
- : current.mode,
34
- githubForkOwner: custom
35
- ? value('githubForkOwner', current.forkOwner ?? '')
36
- : (current.forkOwner ?? ''),
37
- githubReviewers: custom
38
- ? value('githubReviewers', current.reviewers.join(','))
39
- .split(',')
40
- .map((entry) => entry.trim())
41
- .filter(Boolean)
42
- : current.reviewers,
43
- ...(token ? { githubToken: token } : {}),
44
- ...(form.get('githubClearToken') === 'on'
45
- ? { githubClearToken: true }
46
- : {}),
47
- };
48
- }
@@ -1,105 +0,0 @@
1
- export interface Token {
2
- /* Position in the line, so a rendered token has a stable key. */
3
- readonly id: number;
4
- readonly text: string;
5
- readonly kind: 'plain' | 'keyword' | 'string' | 'comment' | 'number' | 'type';
6
- }
7
-
8
- const KEYWORDS = new Set([
9
- 'import',
10
- 'export',
11
- 'from',
12
- 'const',
13
- 'let',
14
- 'var',
15
- 'function',
16
- 'return',
17
- 'if',
18
- 'else',
19
- 'for',
20
- 'of',
21
- 'in',
22
- 'while',
23
- 'class',
24
- 'extends',
25
- 'implements',
26
- 'interface',
27
- 'type',
28
- 'enum',
29
- 'new',
30
- 'await',
31
- 'async',
32
- 'try',
33
- 'catch',
34
- 'finally',
35
- 'throw',
36
- 'typeof',
37
- 'instanceof',
38
- 'readonly',
39
- 'public',
40
- 'private',
41
- 'protected',
42
- 'static',
43
- 'true',
44
- 'false',
45
- 'null',
46
- 'undefined',
47
- 'this',
48
- 'super',
49
- 'as',
50
- 'satisfies',
51
- 'default',
52
- 'CREATE',
53
- 'TABLE',
54
- 'SELECT',
55
- 'INSERT',
56
- 'UPDATE',
57
- 'DELETE',
58
- 'FROM',
59
- 'WHERE',
60
- 'INDEX',
61
- 'NOT',
62
- 'NULL',
63
- 'PRIMARY',
64
- 'KEY',
65
- 'REFERENCES',
66
- ]);
67
-
68
- const PATTERN =
69
- /(\/\/[^\n]*|\/\*[\s\S]*?\*\/|--[^\n]*)|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`)|(\b\d[\d_.]*\b)|([A-Za-z_$][\w$]*)/g;
70
-
71
- /* A deliberately small highlighter: the sandbox diff shows TypeScript, TSRX,
72
- JSON, YAML, CSS, and SQL, and a dependency-free tokenizer keeps the preview
73
- free of third-party runtime code. */
74
- export function tokenize(line: string): readonly Token[] {
75
- const tokens: Token[] = [];
76
- const push = (value: string, kind: Token['kind']) => {
77
- tokens.push({ id: tokens.length, text: value, kind });
78
- };
79
- let lastIndex = 0;
80
- PATTERN.lastIndex = 0;
81
- for (;;) {
82
- const match = PATTERN.exec(line);
83
- if (!match) break;
84
- if (match.index > lastIndex) {
85
- push(line.slice(lastIndex, match.index), 'plain');
86
- }
87
- const [value, comment, string, number, word] = match;
88
- if (comment) push(value, 'comment');
89
- else if (string) push(value, 'string');
90
- else if (number) push(value, 'number');
91
- else if (word) {
92
- push(
93
- value,
94
- KEYWORDS.has(word) ? 'keyword' : /^[A-Z]/.test(word) ? 'type' : 'plain',
95
- );
96
- }
97
- lastIndex = match.index + value.length;
98
- }
99
- if (lastIndex < line.length) push(line.slice(lastIndex), 'plain');
100
- return tokens;
101
- }
102
-
103
- export function tokenClass(kind: Token['kind']): string {
104
- return kind === 'plain' ? '' : `tok-${kind}`;
105
- }
@@ -1,32 +0,0 @@
1
- import {
2
- activeLocale,
3
- registerModuleTranslations,
4
- restorePersistedLocale,
5
- setActiveLocale,
6
- SUPPORTED_LOCALES,
7
- t,
8
- useTranslation,
9
- } from '@flowdular/sdk/client';
10
- import en from './locales/en.json';
11
- import pl from './locales/pl.json';
12
-
13
- /** The standalone sandbox shares the platform translation runtime and keys. */
14
- export function registerSandboxTranslations(): void {
15
- /* The translation runtime may be replaced independently by Vite HMR. The
16
- catalog is the source of truth, so a stale local boolean must not suppress
17
- recovery and expose raw keys in the workspace menu. */
18
- if (t('sandbox.workspace.language.en') !== 'sandbox.workspace.language.en')
19
- return;
20
- registerModuleTranslations([
21
- {
22
- moduleId: 'sandbox.app',
23
- translations: { en, pl },
24
- },
25
- ]);
26
- }
27
-
28
- export function restoreSandboxLocale(): void {
29
- restorePersistedLocale();
30
- }
31
-
32
- export { activeLocale, setActiveLocale, SUPPORTED_LOCALES, t, useTranslation };