@happyvertical/smrt-svelte 0.53.1 → 0.53.3
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/package.json +15 -15
- package/dist/__tests__/app-state.test.js +0 -156
- package/dist/__tests__/data-surface-bridge.test.js +0 -351
- package/dist/__tests__/provider-mode-harness.svelte +0 -14
- package/dist/__tests__/provider-mode-harness.svelte.d.ts +0 -11
- package/dist/__tests__/provider-mode-harness.svelte.d.ts.map +0 -1
- package/dist/__tests__/provider-mode-probe.svelte +0 -13
- package/dist/__tests__/provider-mode-probe.svelte.d.ts +0 -8
- package/dist/__tests__/provider-mode-probe.svelte.d.ts.map +0 -1
- package/dist/__tests__/provider-webmcp-harness.svelte +0 -14
- package/dist/__tests__/provider-webmcp-harness.svelte.d.ts +0 -8
- package/dist/__tests__/provider-webmcp-harness.svelte.d.ts.map +0 -1
- package/dist/__tests__/success-never-text.test.js +0 -100
- package/dist/__tests__/warm-clients.test.js +0 -186
- package/dist/browser-ai/adapters/llm/bitgpu-inference-backend.test.js +0 -464
- package/dist/browser-ai/adapters/llm/webllm-inference-backend.test.js +0 -646
- package/dist/browser-ai/adapters/stt/browser-speech.test.js +0 -113
- package/dist/browser-ai/adapters/stt/dictation-source.test.js +0 -52
- package/dist/browser-ai/svelte/components/__tests__/ModelStatusControl.test.js +0 -172
- package/dist/components/board/__tests__/Board.test.js +0 -498
- package/dist/components/board/__tests__/BoardSsrHarness.svelte +0 -30
- package/dist/components/board/__tests__/BoardSsrHarness.svelte.d.ts +0 -19
- package/dist/components/board/__tests__/BoardSsrHarness.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/AddressInput.behavior.test.js +0 -216
- package/dist/components/forms/__tests__/CheckboxInput.test.js +0 -92
- package/dist/components/forms/__tests__/DateRangeInput.behavior.test.js +0 -135
- package/dist/components/forms/__tests__/DateTimeInput.behavior.test.js +0 -113
- package/dist/components/forms/__tests__/FileUpload.error-alert.test.js +0 -37
- package/dist/components/forms/__tests__/FileUpload.native-form.test.js +0 -249
- package/dist/components/forms/__tests__/FileUpload.test.js +0 -90
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte +0 -24
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/FileUploadReset.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/Form.behavior.test.js +0 -137
- package/dist/components/forms/__tests__/Form.extraction.test.js +0 -68
- package/dist/components/forms/__tests__/Form.stt-error.test.js +0 -57
- package/dist/components/forms/__tests__/Form.test.js +0 -86
- package/dist/components/forms/__tests__/Form.ui-controls.test.js +0 -119
- package/dist/components/forms/__tests__/Form.webmcp.test.js +0 -2336
- package/dist/components/forms/__tests__/FormMicButton.test.js +0 -92
- package/dist/components/forms/__tests__/FormScope.test.js +0 -39
- package/dist/components/forms/__tests__/MeasurementInput.behavior.test.js +0 -129
- package/dist/components/forms/__tests__/MoneyInput.behavior.test.js +0 -124
- package/dist/components/forms/__tests__/NumberInput.behavior.test.js +0 -151
- package/dist/components/forms/__tests__/PhoneInput.behavior.test.js +0 -96
- package/dist/components/forms/__tests__/SearchInput.test.js +0 -79
- package/dist/components/forms/__tests__/SelectInput.behavior.test.js +0 -132
- package/dist/components/forms/__tests__/TextInput.behavior.test.js +0 -131
- package/dist/components/forms/__tests__/TextareaInput.behavior.test.js +0 -96
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte +0 -30
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte.d.ts +0 -7
- package/dist/components/forms/__tests__/async-invalid-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte +0 -19
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/async-validation-form.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte +0 -21
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte.d.ts +0 -8
- package/dist/components/forms/__tests__/async-validation-snapshot-form.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/composite-inputs-a11y.test.js +0 -69
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte +0 -27
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/compound-registration-wrapper.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte +0 -48
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/custom-registration-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte +0 -26
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte.d.ts +0 -13
- package/dist/components/forms/__tests__/form-extraction-values.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte +0 -52
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte.d.ts +0 -16
- package/dist/components/forms/__tests__/form-registration-lifecycle.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-scope.fixture.svelte +0 -30
- package/dist/components/forms/__tests__/form-scope.fixture.svelte.d.ts +0 -10
- package/dist/components/forms/__tests__/form-scope.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte +0 -158
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts +0 -51
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte +0 -24
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte.d.ts +0 -11
- package/dist/components/forms/__tests__/form-with-policy-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte +0 -105
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte.d.ts +0 -42
- package/dist/components/forms/__tests__/form-with-structured-fields.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte +0 -84
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte.d.ts +0 -14
- package/dist/components/forms/__tests__/form-with-ui-controls.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte +0 -44
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte.d.ts +0 -9
- package/dist/components/forms/__tests__/legacy-form-context.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/mic-keyboard-a11y.test.js +0 -74
- package/dist/components/forms/__tests__/policy-field.fixture.svelte +0 -35
- package/dist/components/forms/__tests__/policy-field.fixture.svelte.d.ts +0 -8
- package/dist/components/forms/__tests__/policy-field.fixture.svelte.d.ts.map +0 -1
- package/dist/components/forms/__tests__/rich-inputs-a11y.test.js +0 -87
- package/dist/components/settings/__tests__/SettingsCatalog.test.js +0 -69
- package/dist/components/settings/__tests__/catalog.test.js +0 -46
- package/dist/components/workspace/__tests__/AdminShell.responsive.test.js +0 -597
- package/dist/components/workspace/__tests__/AdminShell.test.js +0 -572
- package/dist/components/workspace/__tests__/RoleShell.test.js +0 -772
- package/dist/components/workspace/__tests__/TenantNav.test.js +0 -208
- package/dist/components/workspace/__tests__/WorkspaceAccountMenu.test.js +0 -79
- package/dist/components/workspace/__tests__/WorkspaceShell.test.js +0 -630
- package/dist/components/workspace/__tests__/admin-shell-header-overflow.test.js +0 -25
- package/dist/components/workspace/__tests__/admin-shell-hotkeys.test.js +0 -34
- package/dist/components/workspace/__tests__/admin-shell-mobile.test.js +0 -217
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte +0 -52
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte.d.ts +0 -23
- package/dist/components/workspace/__tests__/admin-shell-mutation-effect-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/admin-shell-page-contracts.test.js +0 -30
- package/dist/components/workspace/__tests__/admin-shell-responsive-state.test.js +0 -184
- package/dist/components/workspace/__tests__/admin-shell-settings.test.js +0 -25
- package/dist/components/workspace/__tests__/admin-shell-state.test.js +0 -286
- package/dist/components/workspace/__tests__/admin-shell-theme-hooks.test.js +0 -36
- package/dist/components/workspace/__tests__/breadcrumbs-helpers.test.js +0 -141
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte +0 -45
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts +0 -21
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/define-tools-dock.test.js +0 -1188
- package/dist/components/workspace/__tests__/harness.svelte +0 -25
- package/dist/components/workspace/__tests__/harness.svelte.d.ts +0 -14
- package/dist/components/workspace/__tests__/harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/index.test.js +0 -28
- package/dist/components/workspace/__tests__/legacy-index.test.js +0 -9
- package/dist/components/workspace/__tests__/manifest-nav-helpers.test.js +0 -24
- package/dist/components/workspace/__tests__/manifest-nav.test.js +0 -599
- package/dist/components/workspace/__tests__/nav-helpers.test.js +0 -95
- package/dist/components/workspace/__tests__/render-harness.svelte +0 -66
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts +0 -32
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/render-tools-dock.test.js +0 -260
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte +0 -58
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts +0 -16
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte +0 -41
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts +0 -13
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/shell-chrome-components.test.js +0 -108
- package/dist/components/workspace/__tests__/system-feed.test.js +0 -327
- package/dist/components/workspace/__tests__/test-icon.svelte +0 -17
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts +0 -19
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte +0 -38
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts +0 -22
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts +0 -66
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.js +0 -115
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts +0 -15
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.js +0 -7
- package/dist/components/workspace/__tests__/typed-tool-fixture.test.js +0 -115
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte +0 -9
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts +0 -19
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/use-harness.svelte +0 -23
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts +0 -8
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/__tests__/use-tools-dock.test.js +0 -33
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte +0 -43
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts +0 -11
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts.map +0 -1
- package/dist/components/workspace/server/__tests__/compose-availability.test.js +0 -383
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts +0 -78
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts.map +0 -1
- package/dist/components/workspace/server/__tests__/typed-context-fixture.js +0 -104
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte +0 -25
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte.d.ts +0 -15
- package/dist/hooks/__tests__/stt-consumer.fixture.svelte.d.ts.map +0 -1
- package/dist/hooks/__tests__/stt-ownership-harness.svelte +0 -42
- package/dist/hooks/__tests__/stt-ownership-harness.svelte.d.ts +0 -20
- package/dist/hooks/__tests__/stt-ownership-harness.svelte.d.ts.map +0 -1
- package/dist/hooks/__tests__/useSTT-ownership.test.js +0 -102
- package/dist/i18n/__tests__/server.spec.js +0 -57
- package/dist/internal/logger.test.js +0 -54
- package/dist/provider-mode.test.js +0 -86
- package/dist/provider-webmcp.test.js +0 -244
- package/dist/state/__tests__/app-state-ai-lifecycle.test.js +0 -240
- package/dist/state/__tests__/warm-clients.test.js +0 -40
- package/dist/web/__tests__/activity-feed-harness.svelte +0 -32
- package/dist/web/__tests__/activity-feed-harness.svelte.d.ts +0 -18
- package/dist/web/__tests__/activity-feed-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/activity-feed.integration.svelte.test.js +0 -190
- package/dist/web/__tests__/activity-feed.svelte.test.js +0 -235
- package/dist/web/__tests__/assistant-dock.integration.svelte.test.js +0 -204
- package/dist/web/__tests__/data-surface-conformance.integration.svelte.test.js +0 -1392
- package/dist/web/__tests__/harness.svelte +0 -25
- package/dist/web/__tests__/harness.svelte.d.ts +0 -15
- package/dist/web/__tests__/harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-data-surface.fixture.svelte +0 -59
- package/dist/web/__tests__/list-data-surface.fixture.svelte.d.ts +0 -14
- package/dist/web/__tests__/list-data-surface.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-data-surface.svelte.test.js +0 -106
- package/dist/web/__tests__/list-data-surface.test.js +0 -651
- package/dist/web/__tests__/list-sort-surface.fixture.svelte +0 -41
- package/dist/web/__tests__/list-sort-surface.fixture.svelte.d.ts +0 -15
- package/dist/web/__tests__/list-sort-surface.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/list-sort-surface.svelte.test.js +0 -59
- package/dist/web/__tests__/live-collection.svelte.test.js +0 -185
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte +0 -43
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte.d.ts +0 -13
- package/dist/web/__tests__/provider-ui-registry.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/provider-ui-registry.test.js +0 -235
- package/dist/web/__tests__/remote-query-harness.svelte +0 -27
- package/dist/web/__tests__/remote-query-harness.svelte.d.ts +0 -11
- package/dist/web/__tests__/remote-query-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/remote-query.svelte.test.js +0 -101
- package/dist/web/__tests__/surfaces.child.fixture.svelte +0 -69
- package/dist/web/__tests__/surfaces.child.fixture.svelte.d.ts +0 -16
- package/dist/web/__tests__/surfaces.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/surfaces.fixture.svelte +0 -26
- package/dist/web/__tests__/surfaces.fixture.svelte.d.ts +0 -18
- package/dist/web/__tests__/surfaces.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/surfaces.svelte.test.js +0 -140
- package/dist/web/__tests__/update-available-harness.svelte +0 -46
- package/dist/web/__tests__/update-available-harness.svelte.d.ts +0 -22
- package/dist/web/__tests__/update-available-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/update-available.svelte.test.js +0 -137
- package/dist/web/__tests__/view-intent-provider.fixture.svelte +0 -28
- package/dist/web/__tests__/view-intent-provider.fixture.svelte.d.ts +0 -13
- package/dist/web/__tests__/view-intent-provider.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.fixture.svelte +0 -33
- package/dist/web/__tests__/view-intent.fixture.svelte.d.ts +0 -15
- package/dist/web/__tests__/view-intent.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.intents.d.ts +0 -14
- package/dist/web/__tests__/view-intent.intents.d.ts.map +0 -1
- package/dist/web/__tests__/view-intent.intents.js +0 -38
- package/dist/web/__tests__/view-intent.svelte.test.js +0 -244
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte +0 -73
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte.d.ts +0 -8
- package/dist/web/__tests__/webmcp-composed.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-composed.fixture.svelte +0 -52
- package/dist/web/__tests__/webmcp-composed.fixture.svelte.d.ts +0 -12
- package/dist/web/__tests__/webmcp-composed.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-composed.integration.svelte.test.js +0 -251
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte +0 -16
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-effects-reactivity.child.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte +0 -11
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte.d.ts +0 -8
- package/dist/web/__tests__/webmcp-effects-reactivity.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte +0 -20
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte.d.ts +0 -7
- package/dist/web/__tests__/webmcp-harness-reactive-samename.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte +0 -14
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-harness-unannotated.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-harness.svelte +0 -18
- package/dist/web/__tests__/webmcp-harness.svelte.d.ts +0 -7
- package/dist/web/__tests__/webmcp-harness.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte +0 -13
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte.d.ts +0 -19
- package/dist/web/__tests__/webmcp-ssr.fixture.svelte.d.ts.map +0 -1
- package/dist/web/__tests__/webmcp-ui.test.js +0 -723
- package/dist/web/__tests__/webmcp.test.js +0 -234
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* "Green is never text" — the Svelte-stack half of the rule (#2323).
|
|
3
|
-
*
|
|
4
|
-
* `--smrt-color-success` is the one palette role that is not reliably
|
|
5
|
-
* text-safe: a green that reads as "running" at a glance sits in a narrow
|
|
6
|
-
* luminance band, so under the happyvertical light scheme it measures
|
|
7
|
-
* 4.22–4.44:1 on `surfaceDim` / `surfaceContainerHighest` / `surfaceVariant` /
|
|
8
|
-
* `background` — under the WCAG AA 4.5:1 floor for normal text. It stays legal
|
|
9
|
-
* as a MARKER: status lamps, dots, borders, and container fills (which pair
|
|
10
|
-
* with `on-success-container` ink and are AA by construction).
|
|
11
|
-
*
|
|
12
|
-
* `smrt-ui` pins this for its own components in
|
|
13
|
-
* `src/themes/__tests__/happyvertical-theme.test.ts`; that scan cannot see this
|
|
14
|
-
* package, which is how `SystemStatusChips` and `PhoneInput` drifted. This is
|
|
15
|
-
* the same check with the same matcher, scoped here.
|
|
16
|
-
*/
|
|
17
|
-
import { readdirSync, readFileSync } from 'node:fs';
|
|
18
|
-
import { join } from 'node:path';
|
|
19
|
-
import { describe, expect, it } from 'vitest';
|
|
20
|
-
const packageRoot = process.cwd().endsWith('packages/smrt-svelte')
|
|
21
|
-
? process.cwd()
|
|
22
|
-
: join(process.cwd(), 'packages/smrt-svelte');
|
|
23
|
-
const SKIP_DIRS = new Set(['node_modules', 'dist', '.svelte-kit', 'build']);
|
|
24
|
-
function svelteFilesUnder(dir) {
|
|
25
|
-
const out = [];
|
|
26
|
-
let entries;
|
|
27
|
-
try {
|
|
28
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return out;
|
|
32
|
-
}
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
const full = join(dir, entry.name);
|
|
35
|
-
if (entry.isDirectory()) {
|
|
36
|
-
if (!SKIP_DIRS.has(entry.name))
|
|
37
|
-
out.push(...svelteFilesUnder(full));
|
|
38
|
-
}
|
|
39
|
-
else if (entry.name.endsWith('.svelte')) {
|
|
40
|
-
out.push(full);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return out;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Does this source paint TEXT with the success token?
|
|
47
|
-
*
|
|
48
|
-
* Matches on the declaration VALUE rather than requiring `var(` to sit next to
|
|
49
|
-
* `color:`, so wrappers count — `color-mix(…)`, `light-dark(…)`, and
|
|
50
|
-
* `var(--x, var(--smrt-color-success))` all paint letterforms just as directly.
|
|
51
|
-
* Resolves one level of custom-property indirection, because
|
|
52
|
-
* `--chip-color: var(--smrt-color-success)` followed by `color: var(--chip-color)`
|
|
53
|
-
* is the shape that hides this from a naive grep. `(?![\w-])` keeps
|
|
54
|
-
* `--smrt-color-success-container` (a fill, with its own ink) from matching.
|
|
55
|
-
*/
|
|
56
|
-
function paintsTextWithSuccess(source) {
|
|
57
|
-
const declaration = /(?<![-\w])color\s*:\s*([^;{}]*)/g;
|
|
58
|
-
const successToken = /--smrt-color-success(?![\w-])/;
|
|
59
|
-
const customProperty = /(--[\w-]+)\s*:\s*([^;{}]*)/g;
|
|
60
|
-
const greenProperties = new Set();
|
|
61
|
-
for (const [, name, value] of source.matchAll(customProperty)) {
|
|
62
|
-
if (successToken.test(value))
|
|
63
|
-
greenProperties.add(name);
|
|
64
|
-
}
|
|
65
|
-
for (const [, value] of source.matchAll(declaration)) {
|
|
66
|
-
if (successToken.test(value))
|
|
67
|
-
return true;
|
|
68
|
-
for (const property of greenProperties) {
|
|
69
|
-
if (value.includes(`var(${property}`))
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
describe('success is a marker colour, never text (#2323)', () => {
|
|
76
|
-
const files = svelteFilesUnder(join(packageRoot, 'src'));
|
|
77
|
-
it('finds components to scan', () => {
|
|
78
|
-
expect(files.length).toBeGreaterThan(0);
|
|
79
|
-
});
|
|
80
|
-
it('no component paints text with --smrt-color-success', () => {
|
|
81
|
-
const offenders = files
|
|
82
|
-
.filter((file) => paintsTextWithSuccess(readFileSync(file, 'utf8')))
|
|
83
|
-
.map((file) => file.slice(packageRoot.length + 1));
|
|
84
|
-
expect(offenders).toEqual([]);
|
|
85
|
-
});
|
|
86
|
-
it('detects the wrapped and indirect forms the naive check missed', () => {
|
|
87
|
-
expect(paintsTextWithSuccess('.x { color: var(--smrt-color-success); }')).toBe(true);
|
|
88
|
-
expect(paintsTextWithSuccess('.x { color: color-mix(in srgb, var(--smrt-color-success) 80%, transparent); }')).toBe(true);
|
|
89
|
-
expect(paintsTextWithSuccess('.x { color: light-dark(var(--smrt-color-success), #fff); }')).toBe(true);
|
|
90
|
-
expect(paintsTextWithSuccess('.x { color: var(--y, var(--smrt-color-success)); }')).toBe(true);
|
|
91
|
-
expect(paintsTextWithSuccess('.a { --tone: var(--smrt-color-success); } .b { color: var(--tone); }')).toBe(true);
|
|
92
|
-
});
|
|
93
|
-
it('leaves marker, fill, and border uses alone', () => {
|
|
94
|
-
expect(paintsTextWithSuccess('.x { background: var(--smrt-color-success); }')).toBe(false);
|
|
95
|
-
expect(paintsTextWithSuccess('.x { border-color: var(--smrt-color-success); }')).toBe(false);
|
|
96
|
-
expect(paintsTextWithSuccess('.x { background-color: var(--smrt-color-success); }')).toBe(false);
|
|
97
|
-
expect(paintsTextWithSuccess('.x { color: var(--smrt-color-success-container); }')).toBe(false);
|
|
98
|
-
expect(paintsTextWithSuccess('.x { color: var(--smrt-color-on-success); }')).toBe(false);
|
|
99
|
-
});
|
|
100
|
-
});
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for warm client cache
|
|
3
|
-
*/
|
|
4
|
-
import { afterEach, describe, expect, it } from 'vitest';
|
|
5
|
-
import { clearAllCaches, getCachedLLM, getCachedSTT, getCachedTTS, getCacheStats, removeCachedLLM, removeCachedSTT, removeCachedTTS, setCachedLLM, setCachedSTT, setCachedTTS, updateLLMCacheState, updateSTTCacheState, updateTTSCacheState, } from '../state/warm-clients.js';
|
|
6
|
-
// Mock adapters for testing
|
|
7
|
-
const createMockSTTAdapter = () => ({
|
|
8
|
-
type: 'whisper-cpp',
|
|
9
|
-
dispose: () => Promise.resolve(),
|
|
10
|
-
ensureInitialized: () => Promise.resolve(),
|
|
11
|
-
start: () => Promise.resolve(),
|
|
12
|
-
stop: () => Promise.resolve(),
|
|
13
|
-
onResult: () => { },
|
|
14
|
-
onStart: () => { },
|
|
15
|
-
onEnd: () => { },
|
|
16
|
-
onError: () => { },
|
|
17
|
-
});
|
|
18
|
-
const createMockTTSAdapter = () => ({
|
|
19
|
-
type: 'browser-synthesis',
|
|
20
|
-
dispose: () => Promise.resolve(),
|
|
21
|
-
ensureInitialized: () => Promise.resolve(),
|
|
22
|
-
speak: () => Promise.resolve(),
|
|
23
|
-
stop: () => { },
|
|
24
|
-
pause: () => { },
|
|
25
|
-
resume: () => { },
|
|
26
|
-
getVoices: () => [],
|
|
27
|
-
onStart: () => { },
|
|
28
|
-
onEnd: () => { },
|
|
29
|
-
onError: () => { },
|
|
30
|
-
});
|
|
31
|
-
const createMockLLMAdapter = () => ({
|
|
32
|
-
type: 'webllm',
|
|
33
|
-
currentModel: 'test-model',
|
|
34
|
-
dispose: () => Promise.resolve(),
|
|
35
|
-
ensureInitialized: () => Promise.resolve(),
|
|
36
|
-
message: () => Promise.resolve('response'),
|
|
37
|
-
unloadModel: () => Promise.resolve(),
|
|
38
|
-
});
|
|
39
|
-
describe('warm-clients', () => {
|
|
40
|
-
afterEach(async () => {
|
|
41
|
-
await clearAllCaches();
|
|
42
|
-
});
|
|
43
|
-
describe('STT cache', () => {
|
|
44
|
-
it('caches STT adapter', () => {
|
|
45
|
-
const adapter = createMockSTTAdapter();
|
|
46
|
-
setCachedSTT('whisper-cpp', adapter);
|
|
47
|
-
const cached = getCachedSTT('whisper-cpp');
|
|
48
|
-
expect(cached).toBeDefined();
|
|
49
|
-
expect(cached?.adapter).toBe(adapter);
|
|
50
|
-
expect(cached?.initState).toBe('ready');
|
|
51
|
-
expect(cached?.type).toBe('whisper-cpp');
|
|
52
|
-
});
|
|
53
|
-
it('returns undefined for uncached adapter', () => {
|
|
54
|
-
const cached = getCachedSTT('browser-speech');
|
|
55
|
-
expect(cached).toBeUndefined();
|
|
56
|
-
});
|
|
57
|
-
it('updates cache state', () => {
|
|
58
|
-
const adapter = createMockSTTAdapter();
|
|
59
|
-
setCachedSTT('whisper-cpp', adapter);
|
|
60
|
-
updateSTTCacheState('whisper-cpp', {
|
|
61
|
-
initState: 'initializing',
|
|
62
|
-
downloadProgress: {
|
|
63
|
-
state: 'downloading',
|
|
64
|
-
percent: 50,
|
|
65
|
-
bytesLoaded: 50,
|
|
66
|
-
bytesTotal: 100,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
const cached = getCachedSTT('whisper-cpp');
|
|
70
|
-
expect(cached?.initState).toBe('initializing');
|
|
71
|
-
expect(cached?.downloadProgress?.percent).toBe(50);
|
|
72
|
-
});
|
|
73
|
-
it('removes cached adapter', () => {
|
|
74
|
-
const adapter = createMockSTTAdapter();
|
|
75
|
-
setCachedSTT('whisper-cpp', adapter);
|
|
76
|
-
removeCachedSTT('whisper-cpp');
|
|
77
|
-
const cached = getCachedSTT('whisper-cpp');
|
|
78
|
-
expect(cached).toBeUndefined();
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
describe('TTS cache', () => {
|
|
82
|
-
it('caches TTS adapter', () => {
|
|
83
|
-
const adapter = createMockTTSAdapter();
|
|
84
|
-
setCachedTTS('browser-synthesis', adapter);
|
|
85
|
-
const cached = getCachedTTS('browser-synthesis');
|
|
86
|
-
expect(cached).toBeDefined();
|
|
87
|
-
expect(cached?.adapter).toBe(adapter);
|
|
88
|
-
expect(cached?.initState).toBe('ready');
|
|
89
|
-
});
|
|
90
|
-
it('updates cache state', () => {
|
|
91
|
-
const adapter = createMockTTSAdapter();
|
|
92
|
-
setCachedTTS('browser-synthesis', adapter);
|
|
93
|
-
updateTTSCacheState('browser-synthesis', {
|
|
94
|
-
initState: 'error',
|
|
95
|
-
error: new Error('test error'),
|
|
96
|
-
});
|
|
97
|
-
const cached = getCachedTTS('browser-synthesis');
|
|
98
|
-
expect(cached?.initState).toBe('error');
|
|
99
|
-
expect(cached?.error?.message).toBe('test error');
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
describe('LLM cache', () => {
|
|
103
|
-
it('caches LLM adapter with model ID', () => {
|
|
104
|
-
const adapter = createMockLLMAdapter();
|
|
105
|
-
setCachedLLM('webllm', adapter, 'test-model');
|
|
106
|
-
const cached = getCachedLLM('webllm', 'test-model');
|
|
107
|
-
expect(cached).toBeDefined();
|
|
108
|
-
expect(cached?.adapter).toBe(adapter);
|
|
109
|
-
expect(cached?.initState).toBe('ready');
|
|
110
|
-
});
|
|
111
|
-
it('caches LLM adapter without model ID', () => {
|
|
112
|
-
const adapter = createMockLLMAdapter();
|
|
113
|
-
setCachedLLM('webllm', adapter);
|
|
114
|
-
const cached = getCachedLLM('webllm');
|
|
115
|
-
expect(cached).toBeDefined();
|
|
116
|
-
expect(cached?.adapter).toBe(adapter);
|
|
117
|
-
});
|
|
118
|
-
it('distinguishes between models', () => {
|
|
119
|
-
const adapter1 = createMockLLMAdapter();
|
|
120
|
-
const adapter2 = {
|
|
121
|
-
...createMockLLMAdapter(),
|
|
122
|
-
currentModel: 'other-model',
|
|
123
|
-
};
|
|
124
|
-
setCachedLLM('webllm', adapter1, 'model-1');
|
|
125
|
-
setCachedLLM('webllm', adapter2, 'model-2');
|
|
126
|
-
expect(getCachedLLM('webllm', 'model-1')?.adapter).toBe(adapter1);
|
|
127
|
-
expect(getCachedLLM('webllm', 'model-2')?.adapter).toBe(adapter2);
|
|
128
|
-
});
|
|
129
|
-
it('updates cache state', () => {
|
|
130
|
-
const adapter = createMockLLMAdapter();
|
|
131
|
-
setCachedLLM('webllm', adapter, 'test-model');
|
|
132
|
-
updateLLMCacheState('webllm', 'test-model', {
|
|
133
|
-
initState: 'initializing',
|
|
134
|
-
downloadProgress: {
|
|
135
|
-
state: 'downloading',
|
|
136
|
-
percent: 75,
|
|
137
|
-
bytesLoaded: 75,
|
|
138
|
-
bytesTotal: 100,
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
const cached = getCachedLLM('webllm', 'test-model');
|
|
142
|
-
expect(cached?.initState).toBe('initializing');
|
|
143
|
-
expect(cached?.downloadProgress?.percent).toBe(75);
|
|
144
|
-
});
|
|
145
|
-
it('removes cached adapter', () => {
|
|
146
|
-
const adapter = createMockLLMAdapter();
|
|
147
|
-
setCachedLLM('webllm', adapter, 'test-model');
|
|
148
|
-
removeCachedLLM('webllm', 'test-model');
|
|
149
|
-
const cached = getCachedLLM('webllm', 'test-model');
|
|
150
|
-
expect(cached).toBeUndefined();
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
describe('getCacheStats', () => {
|
|
154
|
-
it('returns empty stats initially', async () => {
|
|
155
|
-
const stats = getCacheStats();
|
|
156
|
-
expect(stats.stt.count).toBe(0);
|
|
157
|
-
expect(stats.tts.count).toBe(0);
|
|
158
|
-
expect(stats.llm.count).toBe(0);
|
|
159
|
-
});
|
|
160
|
-
it('returns correct counts after caching', () => {
|
|
161
|
-
setCachedSTT('whisper-cpp', createMockSTTAdapter());
|
|
162
|
-
setCachedSTT('browser-speech', createMockSTTAdapter());
|
|
163
|
-
setCachedTTS('browser-synthesis', createMockTTSAdapter());
|
|
164
|
-
setCachedLLM('webllm', createMockLLMAdapter(), 'model-1');
|
|
165
|
-
const stats = getCacheStats();
|
|
166
|
-
expect(stats.stt.count).toBe(2);
|
|
167
|
-
expect(stats.stt.types).toContain('whisper-cpp');
|
|
168
|
-
expect(stats.stt.types).toContain('browser-speech');
|
|
169
|
-
expect(stats.tts.count).toBe(1);
|
|
170
|
-
expect(stats.llm.count).toBe(1);
|
|
171
|
-
expect(stats.llm.keys).toContain('webllm:model-1');
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
describe('clearAllCaches', () => {
|
|
175
|
-
it('clears all cached adapters', async () => {
|
|
176
|
-
setCachedSTT('whisper-cpp', createMockSTTAdapter());
|
|
177
|
-
setCachedTTS('browser-synthesis', createMockTTSAdapter());
|
|
178
|
-
setCachedLLM('webllm', createMockLLMAdapter());
|
|
179
|
-
await clearAllCaches();
|
|
180
|
-
const stats = getCacheStats();
|
|
181
|
-
expect(stats.stt.count).toBe(0);
|
|
182
|
-
expect(stats.tts.count).toBe(0);
|
|
183
|
-
expect(stats.llm.count).toBe(0);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
});
|