@happyvertical/smrt-svelte 0.30.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.
- package/AGENTS.md +317 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +185 -0
- package/dist/Provider.svelte +204 -0
- package/dist/Provider.svelte.d.ts +73 -0
- package/dist/Provider.svelte.d.ts.map +1 -0
- package/dist/__tests__/app-state.test.js +156 -0
- package/dist/__tests__/warm-clients.test.js +186 -0
- package/dist/browser-ai/adapters/llm/factory.d.ts +38 -0
- package/dist/browser-ai/adapters/llm/factory.d.ts.map +1 -0
- package/dist/browser-ai/adapters/llm/factory.js +91 -0
- package/dist/browser-ai/adapters/llm/index.d.ts +7 -0
- package/dist/browser-ai/adapters/llm/index.d.ts.map +1 -0
- package/dist/browser-ai/adapters/llm/index.js +6 -0
- package/dist/browser-ai/adapters/llm/types.d.ts +182 -0
- package/dist/browser-ai/adapters/llm/types.d.ts.map +1 -0
- package/dist/browser-ai/adapters/llm/types.js +43 -0
- package/dist/browser-ai/adapters/llm/webllm.d.ts +33 -0
- package/dist/browser-ai/adapters/llm/webllm.d.ts.map +1 -0
- package/dist/browser-ai/adapters/llm/webllm.js +225 -0
- package/dist/browser-ai/adapters/stt/browser-speech.d.ts +31 -0
- package/dist/browser-ai/adapters/stt/browser-speech.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/browser-speech.js +217 -0
- package/dist/browser-ai/adapters/stt/factory.d.ts +49 -0
- package/dist/browser-ai/adapters/stt/factory.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/factory.js +110 -0
- package/dist/browser-ai/adapters/stt/index.d.ts +9 -0
- package/dist/browser-ai/adapters/stt/index.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/index.js +8 -0
- package/dist/browser-ai/adapters/stt/types.d.ts +154 -0
- package/dist/browser-ai/adapters/stt/types.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/types.js +4 -0
- package/dist/browser-ai/adapters/stt/whisper-cpp.d.ts +46 -0
- package/dist/browser-ai/adapters/stt/whisper-cpp.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/whisper-cpp.js +348 -0
- package/dist/browser-ai/adapters/stt/whisper-wasm.d.ts +51 -0
- package/dist/browser-ai/adapters/stt/whisper-wasm.d.ts.map +1 -0
- package/dist/browser-ai/adapters/stt/whisper-wasm.js +380 -0
- package/dist/browser-ai/adapters/tts/browser-synthesis.d.ts +42 -0
- package/dist/browser-ai/adapters/tts/browser-synthesis.d.ts.map +1 -0
- package/dist/browser-ai/adapters/tts/browser-synthesis.js +235 -0
- package/dist/browser-ai/adapters/tts/factory.d.ts +53 -0
- package/dist/browser-ai/adapters/tts/factory.d.ts.map +1 -0
- package/dist/browser-ai/adapters/tts/factory.js +92 -0
- package/dist/browser-ai/adapters/tts/index.d.ts +7 -0
- package/dist/browser-ai/adapters/tts/index.d.ts.map +1 -0
- package/dist/browser-ai/adapters/tts/index.js +6 -0
- package/dist/browser-ai/adapters/tts/types.d.ts +140 -0
- package/dist/browser-ai/adapters/tts/types.d.ts.map +1 -0
- package/dist/browser-ai/adapters/tts/types.js +4 -0
- package/dist/browser-ai/capabilities/detector.d.ts +38 -0
- package/dist/browser-ai/capabilities/detector.d.ts.map +1 -0
- package/dist/browser-ai/capabilities/detector.js +211 -0
- package/dist/browser-ai/core/errors.d.ts +62 -0
- package/dist/browser-ai/core/errors.d.ts.map +1 -0
- package/dist/browser-ai/core/errors.js +92 -0
- package/dist/browser-ai/core/index.d.ts +6 -0
- package/dist/browser-ai/core/index.d.ts.map +1 -0
- package/dist/browser-ai/core/index.js +5 -0
- package/dist/browser-ai/core/types.d.ts +115 -0
- package/dist/browser-ai/core/types.d.ts.map +1 -0
- package/dist/browser-ai/core/types.js +34 -0
- package/dist/browser-ai/index.d.ts +12 -0
- package/dist/browser-ai/index.d.ts.map +1 -0
- package/dist/browser-ai/index.js +16 -0
- package/dist/browser-ai/svelte/components/AILoadingOverlay.svelte +77 -0
- package/dist/browser-ai/svelte/components/AILoadingOverlay.svelte.d.ts +16 -0
- package/dist/browser-ai/svelte/components/AILoadingOverlay.svelte.d.ts.map +1 -0
- package/dist/browser-ai/svelte/components/CapabilityGate.svelte +57 -0
- package/dist/browser-ai/svelte/components/CapabilityGate.svelte.d.ts +15 -0
- package/dist/browser-ai/svelte/components/CapabilityGate.svelte.d.ts.map +1 -0
- package/dist/browser-ai/svelte/components/DownloadProgress.svelte +141 -0
- package/dist/browser-ai/svelte/components/DownloadProgress.svelte.d.ts +15 -0
- package/dist/browser-ai/svelte/components/DownloadProgress.svelte.d.ts.map +1 -0
- package/dist/browser-ai/svelte/components/STTTest.svelte +379 -0
- package/dist/browser-ai/svelte/components/STTTest.svelte.d.ts +9 -0
- package/dist/browser-ai/svelte/components/STTTest.svelte.d.ts.map +1 -0
- package/dist/browser-ai/svelte/components/VoiceInput.svelte +200 -0
- package/dist/browser-ai/svelte/components/VoiceInput.svelte.d.ts +16 -0
- package/dist/browser-ai/svelte/components/VoiceInput.svelte.d.ts.map +1 -0
- package/dist/browser-ai/svelte/index.d.ts +15 -0
- package/dist/browser-ai/svelte/index.d.ts.map +1 -0
- package/dist/browser-ai/svelte/index.js +28 -0
- package/dist/browser-ai/ui.d.ts +16 -0
- package/dist/browser-ai/ui.d.ts.map +1 -0
- package/dist/browser-ai/ui.js +67 -0
- package/dist/components/admin/AgentAdminPanel.svelte +111 -0
- package/dist/components/admin/AgentAdminPanel.svelte.d.ts +25 -0
- package/dist/components/admin/AgentAdminPanel.svelte.d.ts.map +1 -0
- package/dist/components/admin/AgentAdminTabs.svelte +280 -0
- package/dist/components/admin/AgentAdminTabs.svelte.d.ts +23 -0
- package/dist/components/admin/AgentAdminTabs.svelte.d.ts.map +1 -0
- package/dist/components/admin/AgentSettingsShell.svelte +257 -0
- package/dist/components/admin/AgentSettingsShell.svelte.d.ts +33 -0
- package/dist/components/admin/AgentSettingsShell.svelte.d.ts.map +1 -0
- package/dist/components/admin/index.d.ts +5 -0
- package/dist/components/admin/index.d.ts.map +1 -0
- package/dist/components/admin/index.js +6 -0
- package/dist/components/forms/AddressInput.svelte +500 -0
- package/dist/components/forms/AddressInput.svelte.d.ts +36 -0
- package/dist/components/forms/AddressInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/CheckboxInput.svelte +208 -0
- package/dist/components/forms/CheckboxInput.svelte.d.ts +20 -0
- package/dist/components/forms/CheckboxInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/DateRangeInput.svelte +628 -0
- package/dist/components/forms/DateRangeInput.svelte.d.ts +33 -0
- package/dist/components/forms/DateRangeInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/DateTimeInput.svelte +521 -0
- package/dist/components/forms/DateTimeInput.svelte.d.ts +24 -0
- package/dist/components/forms/DateTimeInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/FileUpload.svelte +358 -0
- package/dist/components/forms/FileUpload.svelte.d.ts +22 -0
- package/dist/components/forms/FileUpload.svelte.d.ts.map +1 -0
- package/dist/components/forms/Form.svelte +771 -0
- package/dist/components/forms/Form.svelte.d.ts +26 -0
- package/dist/components/forms/Form.svelte.d.ts.map +1 -0
- package/dist/components/forms/FormGroup.svelte +86 -0
- package/dist/components/forms/FormGroup.svelte.d.ts +13 -0
- package/dist/components/forms/FormGroup.svelte.d.ts.map +1 -0
- package/dist/components/forms/FormMicButton.svelte +179 -0
- package/dist/components/forms/FormMicButton.svelte.d.ts +10 -0
- package/dist/components/forms/FormMicButton.svelte.d.ts.map +1 -0
- package/dist/components/forms/Input.svelte +83 -0
- package/dist/components/forms/Input.svelte.d.ts +9 -0
- package/dist/components/forms/Input.svelte.d.ts.map +1 -0
- package/dist/components/forms/MeasurementInput.svelte +505 -0
- package/dist/components/forms/MeasurementInput.svelte.d.ts +35 -0
- package/dist/components/forms/MeasurementInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/MoneyInput.svelte +412 -0
- package/dist/components/forms/MoneyInput.svelte.d.ts +30 -0
- package/dist/components/forms/MoneyInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/NumberInput.svelte +310 -0
- package/dist/components/forms/NumberInput.svelte.d.ts +28 -0
- package/dist/components/forms/NumberInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/PhoneInput.svelte +530 -0
- package/dist/components/forms/PhoneInput.svelte.d.ts +22 -0
- package/dist/components/forms/PhoneInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/SearchInput.svelte +358 -0
- package/dist/components/forms/SearchInput.svelte.d.ts +33 -0
- package/dist/components/forms/SearchInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/Select.svelte +83 -0
- package/dist/components/forms/Select.svelte.d.ts +11 -0
- package/dist/components/forms/Select.svelte.d.ts.map +1 -0
- package/dist/components/forms/SelectInput.svelte +254 -0
- package/dist/components/forms/SelectInput.svelte.d.ts +25 -0
- package/dist/components/forms/SelectInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/TextInput.svelte +415 -0
- package/dist/components/forms/TextInput.svelte.d.ts +26 -0
- package/dist/components/forms/TextInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/Textarea.svelte +85 -0
- package/dist/components/forms/Textarea.svelte.d.ts +10 -0
- package/dist/components/forms/Textarea.svelte.d.ts.map +1 -0
- package/dist/components/forms/TextareaInput.svelte +386 -0
- package/dist/components/forms/TextareaInput.svelte.d.ts +26 -0
- package/dist/components/forms/TextareaInput.svelte.d.ts.map +1 -0
- package/dist/components/forms/Toggle.svelte +217 -0
- package/dist/components/forms/Toggle.svelte.d.ts +37 -0
- package/dist/components/forms/Toggle.svelte.d.ts.map +1 -0
- package/dist/components/forms/__tests__/AddressInput.behavior.test.js +122 -0
- package/dist/components/forms/__tests__/CheckboxInput.test.js +92 -0
- package/dist/components/forms/__tests__/DateRangeInput.behavior.test.js +135 -0
- package/dist/components/forms/__tests__/DateTimeInput.behavior.test.js +103 -0
- package/dist/components/forms/__tests__/FileUpload.test.js +90 -0
- package/dist/components/forms/__tests__/Form.behavior.test.js +137 -0
- package/dist/components/forms/__tests__/Form.test.js +58 -0
- package/dist/components/forms/__tests__/FormGroup.test.js +48 -0
- package/dist/components/forms/__tests__/FormMicButton.test.js +86 -0
- package/dist/components/forms/__tests__/Input.test.js +49 -0
- package/dist/components/forms/__tests__/MeasurementInput.behavior.test.js +129 -0
- package/dist/components/forms/__tests__/MoneyInput.behavior.test.js +124 -0
- package/dist/components/forms/__tests__/NumberInput.behavior.test.js +141 -0
- package/dist/components/forms/__tests__/PhoneInput.behavior.test.js +96 -0
- package/dist/components/forms/__tests__/SearchInput.test.js +79 -0
- package/dist/components/forms/__tests__/Select.test.js +37 -0
- package/dist/components/forms/__tests__/SelectInput.behavior.test.js +132 -0
- package/dist/components/forms/__tests__/TextInput.behavior.test.js +131 -0
- package/dist/components/forms/__tests__/Textarea.test.js +39 -0
- package/dist/components/forms/__tests__/TextareaInput.behavior.test.js +96 -0
- package/dist/components/forms/__tests__/Toggle.test.js +87 -0
- package/dist/components/forms/__tests__/composite-inputs-a11y.test.js +69 -0
- package/dist/components/forms/__tests__/form-group-input.fixture.svelte +16 -0
- package/dist/components/forms/__tests__/form-group-input.fixture.svelte.d.ts +9 -0
- package/dist/components/forms/__tests__/form-group-input.fixture.svelte.d.ts.map +1 -0
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte +33 -0
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts +12 -0
- package/dist/components/forms/__tests__/form-with-fields.fixture.svelte.d.ts.map +1 -0
- package/dist/components/forms/__tests__/rich-inputs-a11y.test.js +87 -0
- package/dist/components/forms/index.d.ts +25 -0
- package/dist/components/forms/index.d.ts.map +1 -0
- package/dist/components/forms/index.js +25 -0
- package/dist/components/forms/types.d.ts +33 -0
- package/dist/components/forms/types.d.ts.map +1 -0
- package/dist/components/forms/types.js +4 -0
- package/dist/components/module/ModulePanel.svelte +134 -0
- package/dist/components/module/ModulePanel.svelte.d.ts +22 -0
- package/dist/components/module/ModulePanel.svelte.d.ts.map +1 -0
- package/dist/components/module/index.d.ts +5 -0
- package/dist/components/module/index.d.ts.map +1 -0
- package/dist/components/module/index.js +4 -0
- package/dist/components/workspace/Breadcrumbs.svelte +141 -0
- package/dist/components/workspace/Breadcrumbs.svelte.d.ts +21 -0
- package/dist/components/workspace/Breadcrumbs.svelte.d.ts.map +1 -0
- package/dist/components/workspace/NavTree.svelte +354 -0
- package/dist/components/workspace/NavTree.svelte.d.ts +45 -0
- package/dist/components/workspace/NavTree.svelte.d.ts.map +1 -0
- package/dist/components/workspace/README.md +34 -0
- package/dist/components/workspace/RoleShell.svelte +309 -0
- package/dist/components/workspace/RoleShell.svelte.d.ts +91 -0
- package/dist/components/workspace/RoleShell.svelte.d.ts.map +1 -0
- package/dist/components/workspace/WorkspaceShell.svelte +951 -0
- package/dist/components/workspace/WorkspaceShell.svelte.d.ts +112 -0
- package/dist/components/workspace/WorkspaceShell.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/RoleShell.test.js +772 -0
- package/dist/components/workspace/__tests__/WorkspaceShell.test.js +630 -0
- package/dist/components/workspace/__tests__/breadcrumbs-helpers.test.js +141 -0
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte +45 -0
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts +21 -0
- package/dist/components/workspace/__tests__/context-forwarding-harness.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/define-tools-dock.test.js +1010 -0
- package/dist/components/workspace/__tests__/harness.svelte +25 -0
- package/dist/components/workspace/__tests__/harness.svelte.d.ts +14 -0
- package/dist/components/workspace/__tests__/harness.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/index.test.js +37 -0
- package/dist/components/workspace/__tests__/manifest-nav-helpers.test.js +24 -0
- package/dist/components/workspace/__tests__/manifest-nav.test.js +599 -0
- package/dist/components/workspace/__tests__/nav-helpers.test.js +95 -0
- package/dist/components/workspace/__tests__/render-harness.svelte +66 -0
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts +32 -0
- package/dist/components/workspace/__tests__/render-harness.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/render-tools-dock.test.js +243 -0
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte +58 -0
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts +16 -0
- package/dist/components/workspace/__tests__/role-shell-bind-harness.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte +41 -0
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts +13 -0
- package/dist/components/workspace/__tests__/role-shell-switch-harness.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/test-icon.svelte +17 -0
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts +19 -0
- package/dist/components/workspace/__tests__/test-icon.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte +38 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts +22 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/TypedTool.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts +65 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/register-typed-tool.js +115 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts +15 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture/typed-tool-types.js +7 -0
- package/dist/components/workspace/__tests__/typed-tool-fixture.test.js +115 -0
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte +9 -0
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts +19 -0
- package/dist/components/workspace/__tests__/use-harness-orphan.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/use-harness.svelte +23 -0
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts +8 -0
- package/dist/components/workspace/__tests__/use-harness.svelte.d.ts.map +1 -0
- package/dist/components/workspace/__tests__/use-tools-dock.test.js +33 -0
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte +43 -0
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts +11 -0
- package/dist/components/workspace/__tests__/workspace-shell-bind-harness.svelte.d.ts.map +1 -0
- package/dist/components/workspace/breadcrumbs-helpers.d.ts +44 -0
- package/dist/components/workspace/breadcrumbs-helpers.d.ts.map +1 -0
- package/dist/components/workspace/breadcrumbs-helpers.js +88 -0
- package/dist/components/workspace/index.d.ts +16 -0
- package/dist/components/workspace/index.d.ts.map +1 -0
- package/dist/components/workspace/index.js +14 -0
- package/dist/components/workspace/manifest-nav.d.ts +200 -0
- package/dist/components/workspace/manifest-nav.d.ts.map +1 -0
- package/dist/components/workspace/manifest-nav.js +408 -0
- package/dist/components/workspace/nav-helpers.d.ts +36 -0
- package/dist/components/workspace/nav-helpers.d.ts.map +1 -0
- package/dist/components/workspace/nav-helpers.js +60 -0
- package/dist/components/workspace/server/__tests__/compose-availability.test.js +383 -0
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts +78 -0
- package/dist/components/workspace/server/__tests__/typed-context-fixture.d.ts.map +1 -0
- package/dist/components/workspace/server/__tests__/typed-context-fixture.js +104 -0
- package/dist/components/workspace/server/compose-availability.d.ts +73 -0
- package/dist/components/workspace/server/compose-availability.d.ts.map +1 -0
- package/dist/components/workspace/server/compose-availability.js +114 -0
- package/dist/components/workspace/server/index.d.ts +13 -0
- package/dist/components/workspace/server/index.d.ts.map +1 -0
- package/dist/components/workspace/server/index.js +11 -0
- package/dist/components/workspace/server/types.d.ts +108 -0
- package/dist/components/workspace/server/types.d.ts.map +1 -0
- package/dist/components/workspace/server/types.js +11 -0
- package/dist/components/workspace/tools-dock/ToolsDock.svelte +565 -0
- package/dist/components/workspace/tools-dock/ToolsDock.svelte.d.ts +14 -0
- package/dist/components/workspace/tools-dock/ToolsDock.svelte.d.ts.map +1 -0
- package/dist/components/workspace/tools-dock/define-tools-dock.svelte.d.ts +143 -0
- package/dist/components/workspace/tools-dock/define-tools-dock.svelte.d.ts.map +1 -0
- package/dist/components/workspace/tools-dock/define-tools-dock.svelte.js +487 -0
- package/dist/components/workspace/tools-dock/use-tools-dock.d.ts +41 -0
- package/dist/components/workspace/tools-dock/use-tools-dock.d.ts.map +1 -0
- package/dist/components/workspace/tools-dock/use-tools-dock.js +50 -0
- package/dist/components/workspace/types.d.ts +372 -0
- package/dist/components/workspace/types.d.ts.map +1 -0
- package/dist/components/workspace/types.js +6 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/useAppState.svelte.d.ts +46 -0
- package/dist/hooks/useAppState.svelte.d.ts.map +1 -0
- package/dist/hooks/useAppState.svelte.js +59 -0
- package/dist/hooks/useAuth.svelte.d.ts +41 -0
- package/dist/hooks/useAuth.svelte.d.ts.map +1 -0
- package/dist/hooks/useAuth.svelte.js +43 -0
- package/dist/hooks/useLLM.svelte.d.ts +69 -0
- package/dist/hooks/useLLM.svelte.d.ts.map +1 -0
- package/dist/hooks/useLLM.svelte.js +85 -0
- package/dist/hooks/useSTT.svelte.d.ts +68 -0
- package/dist/hooks/useSTT.svelte.d.ts.map +1 -0
- package/dist/hooks/useSTT.svelte.js +97 -0
- package/dist/hooks/useSocket.svelte.d.ts +45 -0
- package/dist/hooks/useSocket.svelte.d.ts.map +1 -0
- package/dist/hooks/useSocket.svelte.js +54 -0
- package/dist/hooks/useTTS.svelte.d.ts +65 -0
- package/dist/hooks/useTTS.svelte.d.ts.map +1 -0
- package/dist/hooks/useTTS.svelte.js +93 -0
- package/dist/hooks/useTheme.d.ts +13 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +16 -0
- package/dist/i18n/__tests__/server.spec.js +50 -0
- package/dist/i18n/server.d.ts +47 -0
- package/dist/i18n/server.d.ts.map +1 -0
- package/dist/i18n/server.js +58 -0
- package/dist/i18n/strings.forms.d.ts +33 -0
- package/dist/i18n/strings.forms.d.ts.map +1 -0
- package/dist/i18n/strings.forms.js +54 -0
- package/dist/i18n/strings.workspace.d.ts +34 -0
- package/dist/i18n/strings.workspace.d.ts.map +1 -0
- package/dist/i18n/strings.workspace.js +40 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/state/__tests__/warm-clients.test.js +40 -0
- package/dist/state/app-state.d.ts +308 -0
- package/dist/state/app-state.d.ts.map +1 -0
- package/dist/state/app-state.js +64 -0
- package/dist/state/app-state.svelte.d.ts +196 -0
- package/dist/state/app-state.svelte.d.ts.map +1 -0
- package/dist/state/app-state.svelte.js +774 -0
- package/dist/state/context.d.ts +23 -0
- package/dist/state/context.d.ts.map +1 -0
- package/dist/state/context.js +32 -0
- package/dist/state/form-context.d.ts +59 -0
- package/dist/state/form-context.d.ts.map +1 -0
- package/dist/state/form-context.js +31 -0
- package/dist/state/form-group-context.d.ts +13 -0
- package/dist/state/form-group-context.d.ts.map +1 -0
- package/dist/state/form-group-context.js +28 -0
- package/dist/state/index.d.ts +9 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +8 -0
- package/dist/state/warm-clients.d.ts +136 -0
- package/dist/state/warm-clients.d.ts.map +1 -0
- package/dist/state/warm-clients.js +231 -0
- package/package.json +137 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useToolsDock - read the {@link ToolsDockApi} from Svelte context.
|
|
3
|
+
*
|
|
4
|
+
* Tools and arbitrary descendants of `<ToolsDock>` use this to obtain the
|
|
5
|
+
* dock instance that owns them — open/close themselves, push events through
|
|
6
|
+
* the typed bus, react to the current `context`, etc.
|
|
7
|
+
*
|
|
8
|
+
* Throws a clear error if called outside a `<ToolsDock>` provider tree so
|
|
9
|
+
* misuse fails loudly during development rather than producing silent nulls.
|
|
10
|
+
*
|
|
11
|
+
* The returned `dock.context` is the default {@link ToolsDockContext} shape.
|
|
12
|
+
* For typed access from within a tool body, the recommended pattern is to
|
|
13
|
+
* type the component's own `context` prop locally — see the JSDoc on
|
|
14
|
+
* {@link ToolDef.component} for an example. (`ToolDef` deliberately erases
|
|
15
|
+
* its context generic at registration time so the dock can store tools as
|
|
16
|
+
* a single homogeneous `ToolDef[]`.)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```svelte
|
|
20
|
+
* <script lang="ts">
|
|
21
|
+
* import { useToolsDock } from '@happyvertical/smrt-svelte/workspace';
|
|
22
|
+
* const dock = useToolsDock();
|
|
23
|
+
* </script>
|
|
24
|
+
*
|
|
25
|
+
* <button type="button" onclick={() => dock.close()}>Close</button>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
import { getContext } from 'svelte';
|
|
29
|
+
import { TOOLS_DOCK_KEY } from './define-tools-dock.svelte.js';
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve the {@link ToolsDockApi} from Svelte context.
|
|
32
|
+
*
|
|
33
|
+
* @throws Error when called outside a `<ToolsDock>` provider tree
|
|
34
|
+
*/
|
|
35
|
+
export function useToolsDock() {
|
|
36
|
+
const dock = getContext(TOOLS_DOCK_KEY);
|
|
37
|
+
if (!dock) {
|
|
38
|
+
throw new Error('[useToolsDock] No ToolsDock instance found on Svelte context. ' +
|
|
39
|
+
'Wrap your tree in <ToolsDock dock={defineToolsDock(...)} /> first.');
|
|
40
|
+
}
|
|
41
|
+
return dock;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Non-throwing variant — returns `null` outside a provider. Useful for
|
|
45
|
+
* optional integrations where a tool should degrade gracefully if not
|
|
46
|
+
* embedded inside a `<ToolsDock>`.
|
|
47
|
+
*/
|
|
48
|
+
export function tryUseToolsDock() {
|
|
49
|
+
return getContext(TOOLS_DOCK_KEY) ?? null;
|
|
50
|
+
}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the workspace shell primitives.
|
|
3
|
+
*
|
|
4
|
+
* See @happyvertical/smrt#1226 (epic) and #1227 / #1228 / #1229 (implementers).
|
|
5
|
+
*/
|
|
6
|
+
import type { Component } from 'svelte';
|
|
7
|
+
export interface NavItem {
|
|
8
|
+
href: string;
|
|
9
|
+
label: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
exact?: boolean;
|
|
13
|
+
defaultExpanded?: boolean;
|
|
14
|
+
badge?: number | string | null;
|
|
15
|
+
children?: NavItem[];
|
|
16
|
+
}
|
|
17
|
+
export interface BreadcrumbItem {
|
|
18
|
+
href?: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Configuration for a single role in a multi-role admin shell. The role
|
|
23
|
+
* determines which navigation sections are shown, the display label, and
|
|
24
|
+
* an optional color identifier consumers can use to theme the shell.
|
|
25
|
+
*
|
|
26
|
+
* Role IDs are arbitrary strings — the framework doesn't know about specific
|
|
27
|
+
* roles. Consumers pick whatever set fits their app (e.g. 'super', 'admin',
|
|
28
|
+
* 'tenant-owner', 'editor').
|
|
29
|
+
*
|
|
30
|
+
* See `RoleShell` for the renderer that consumes this config and
|
|
31
|
+
* `happyvertical/smrt#1226` (Phase 4b) for design context.
|
|
32
|
+
*/
|
|
33
|
+
export interface RoleConfig {
|
|
34
|
+
/** Stable role identifier. */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Display label (e.g. "Super Admin"). */
|
|
37
|
+
label: string;
|
|
38
|
+
/** Optional subtitle / description. */
|
|
39
|
+
description?: string;
|
|
40
|
+
/** Optional icon string/glyph for the role's header area. */
|
|
41
|
+
icon?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Optional color identifier. Rendered as a CSS custom property
|
|
44
|
+
* `--smrt-role-color: <value>` on the shell root so consumer CSS can
|
|
45
|
+
* theme child components. Pick a semantic name your design system
|
|
46
|
+
* understands (e.g. 'blue', 'success', 'primary').
|
|
47
|
+
*/
|
|
48
|
+
color?: string;
|
|
49
|
+
/** Navigation sections shown for this role. Same shape as NavItem[]. */
|
|
50
|
+
sections: NavItem[];
|
|
51
|
+
}
|
|
52
|
+
export interface ToolDef {
|
|
53
|
+
id: string;
|
|
54
|
+
label: string;
|
|
55
|
+
/**
|
|
56
|
+
* Single-character glyph or emoji rendered in the rail layout when no
|
|
57
|
+
* `iconComponent` is provided. Defaults to the uppercased first character
|
|
58
|
+
* of `label` when both are omitted.
|
|
59
|
+
*
|
|
60
|
+
* Note: ambiguous in dense docks (e.g. "Chat" and "Claim Audit" both
|
|
61
|
+
* collapse to "C"). Provide `iconComponent` for production docks — see
|
|
62
|
+
* the `iconComponent` field below.
|
|
63
|
+
*/
|
|
64
|
+
icon?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Component rendered in the rail layout (and as a leading glyph in the
|
|
67
|
+
* topbar layout) for this tool. Takes precedence over `icon`. Matches
|
|
68
|
+
* the pattern used by `NavTree` for per-item icons — pass the icon
|
|
69
|
+
* component from your library of choice (lucide-svelte etc.) directly,
|
|
70
|
+
* or a thin `.svelte` wrapper around it.
|
|
71
|
+
*
|
|
72
|
+
* The component is rendered with no props (`<IconComponent />`); if your
|
|
73
|
+
* icon library needs sizing, wrap it in a thin `.svelte` component that
|
|
74
|
+
* hard-codes the dimensions you want (typically ~18px to match
|
|
75
|
+
* `.tools-dock__rail-glyph`).
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import MessageSquare from 'lucide-svelte/icons/message-square';
|
|
80
|
+
* import ChatPanel from './ChatPanel.svelte';
|
|
81
|
+
*
|
|
82
|
+
* const tool: ToolDef = {
|
|
83
|
+
* id: 'chat',
|
|
84
|
+
* label: 'Chat',
|
|
85
|
+
* iconComponent: MessageSquare,
|
|
86
|
+
* component: ChatPanel,
|
|
87
|
+
* };
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
iconComponent?: Component;
|
|
91
|
+
/**
|
|
92
|
+
* Panel component rendered when this tool is active. Receives the dock's
|
|
93
|
+
* current `context` and the dock API.
|
|
94
|
+
*
|
|
95
|
+
* Tools that want typed access to `context.data` / `context.actions`
|
|
96
|
+
* should locally type their own props inside the component, e.g.
|
|
97
|
+
*
|
|
98
|
+
* ```svelte
|
|
99
|
+
* <script lang="ts">
|
|
100
|
+
* import type { ToolsDockApi, ToolsDockContext } from
|
|
101
|
+
* '@happyvertical/smrt-svelte/workspace';
|
|
102
|
+
*
|
|
103
|
+
* interface MyData { siteSlug: string; contentId: string }
|
|
104
|
+
* interface MyActions { triggerSave(): void }
|
|
105
|
+
*
|
|
106
|
+
* let { context, dock }: {
|
|
107
|
+
* context: ToolsDockContext<MyData, MyActions> | null;
|
|
108
|
+
* dock: ToolsDockApi;
|
|
109
|
+
* } = $props();
|
|
110
|
+
* </script>
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* The dock erases tool-specific types at registration (tools are stored
|
|
114
|
+
* as a homogeneous `ToolDef[]`), so the props type is intentionally
|
|
115
|
+
* `Component<any>`. Svelte component props are checked contravariantly,
|
|
116
|
+
* which means a hard-coded `Component<{ context: ToolsDockContext | null; ... }>`
|
|
117
|
+
* slot would reject any component declaring a narrower
|
|
118
|
+
* `context: ToolsDockContext<MyData, MyActions> | null` prop — defeating
|
|
119
|
+
* the point of letting consumers type the prop locally. Erasing here
|
|
120
|
+
* means the per-component prop annotation shown above compiles without
|
|
121
|
+
* a registration-site cast.
|
|
122
|
+
*
|
|
123
|
+
* A previous version of this API carried a `<TCtx>` generic on `ToolDef`
|
|
124
|
+
* that flowed into the `context` prop. In practice it was always erased
|
|
125
|
+
* at registration, so consumers cast at the registration site and
|
|
126
|
+
* re-declared the prop shape inside the component anyway. The current
|
|
127
|
+
* shape preserves the typed-context ergonomics while removing both the
|
|
128
|
+
* useless generic and the registration-site cast.
|
|
129
|
+
*/
|
|
130
|
+
component: Component<any>;
|
|
131
|
+
badge?: number | string | null;
|
|
132
|
+
/**
|
|
133
|
+
* Optional gate IDs that must all evaluate to true for the tool to be
|
|
134
|
+
* visible. Convention: `<subsystem>:<identifier>`, e.g.:
|
|
135
|
+
*
|
|
136
|
+
* - `'permission:articles.publish'` (consumer wires a `PermissionResolver` as the `permission` evaluator)
|
|
137
|
+
* - `'feature:video-tools'` (consumer wires a `FeatureResolver` as the `feature` evaluator)
|
|
138
|
+
* - `'myapp:my-custom-gate'` (consumer wires their own evaluator)
|
|
139
|
+
*
|
|
140
|
+
* Gates are evaluated server-side via `composeDockAvailability` from
|
|
141
|
+
* `@happyvertical/smrt-svelte/workspace/server`. Each gate's prefix
|
|
142
|
+
* (text before the `:`) selects the evaluator from the caller-supplied
|
|
143
|
+
* map. The framework does NOT ship built-in evaluators — consumers
|
|
144
|
+
* register evaluators for every prefix they use. Tools with unknown
|
|
145
|
+
* prefixes throw at composition time (loud-fail beats silent-leak).
|
|
146
|
+
*
|
|
147
|
+
* Recommended prefix conventions for ecosystem cohesion (not enforced —
|
|
148
|
+
* the framework treats every prefix as caller-defined):
|
|
149
|
+
* - `permission:` for RBAC checks (typically wraps smrt-users)
|
|
150
|
+
* - `feature:` for feature flags (typically wraps smrt-features)
|
|
151
|
+
* - `user-pref:` for per-user UI settings
|
|
152
|
+
*
|
|
153
|
+
* Consumers writing their own gates should pick an app-specific
|
|
154
|
+
* namespace (e.g., `myapp:`) to avoid colliding with future built-ins.
|
|
155
|
+
*/
|
|
156
|
+
gates?: string[];
|
|
157
|
+
}
|
|
158
|
+
export interface AvailableTool {
|
|
159
|
+
id: string;
|
|
160
|
+
label?: string;
|
|
161
|
+
badge?: number | string | null;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Context blob the dock surfaces to tools and `fetchAvailability`. Both
|
|
165
|
+
* generics default so existing call sites keep compiling:
|
|
166
|
+
*
|
|
167
|
+
* - `TData` types the shape of `data` (route data, selection, etc.).
|
|
168
|
+
* Defaults to `Record<string, unknown>`.
|
|
169
|
+
* - `TActions` types the shape of `actions` — the host-supplied callback
|
|
170
|
+
* map tools may invoke to reach back into the page (`triggerSave`,
|
|
171
|
+
* `openDialog`, etc.). Defaults to a permissive
|
|
172
|
+
* `Record<string, (...args: any[]) => unknown>` so the untyped pattern
|
|
173
|
+
* `dock.setContext({ actions: { triggerSave() {} } })` keeps compiling
|
|
174
|
+
* without a generic argument.
|
|
175
|
+
*
|
|
176
|
+
* The constraint is a self-mapped
|
|
177
|
+
* `{ [K in keyof TActions]: (...args: any[]) => any }` rather than
|
|
178
|
+
* `Record<string, ...>`. This accepts interface-style action maps without
|
|
179
|
+
* an explicit string index signature — the common pattern Copilot flagged
|
|
180
|
+
* in the original PR review. A bare `Record<string, ...>` constraint
|
|
181
|
+
* rejects interfaces (which have no index signature) under strict TS,
|
|
182
|
+
* forcing consumers to use type aliases or add `[key: string]: ...`.
|
|
183
|
+
*
|
|
184
|
+
* Recommended consumer pattern: thread these generics into the tool
|
|
185
|
+
* component's own `context` prop so `context?.actions?.foo()` is fully
|
|
186
|
+
* typed without a cast.
|
|
187
|
+
*
|
|
188
|
+
* ```ts
|
|
189
|
+
* interface MyData { siteSlug: string; contentId: string }
|
|
190
|
+
* interface MyActions { triggerSave(): void; openReview(kind: string): void }
|
|
191
|
+
*
|
|
192
|
+
* // factory site:
|
|
193
|
+
* const dock = defineToolsDock<MyData, MyActions>({ ... });
|
|
194
|
+
*
|
|
195
|
+
* // tool component:
|
|
196
|
+
* let { context }: {
|
|
197
|
+
* context: ToolsDockContext<MyData, MyActions> | null;
|
|
198
|
+
* } = $props();
|
|
199
|
+
* context?.actions?.triggerSave(); // typed
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
export interface ToolsDockContext<TData = Record<string, unknown>, TActions extends {
|
|
203
|
+
[K in keyof TActions]: (...args: any[]) => any;
|
|
204
|
+
} = Record<string, (...args: any[]) => unknown>> {
|
|
205
|
+
type: string;
|
|
206
|
+
title?: string;
|
|
207
|
+
url?: string;
|
|
208
|
+
data?: TData;
|
|
209
|
+
actions?: TActions;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Typed payloads for dock-owned events. Event names under the `dock:` prefix
|
|
213
|
+
* are reserved for the workspace primitives. Consumers should pick names in
|
|
214
|
+
* their own namespace (e.g. `'my-app:foo'`) and use the stringly-typed
|
|
215
|
+
* overloads of {@link ToolsDockApi.on} / {@link ToolsDockApi.emit}:
|
|
216
|
+
*
|
|
217
|
+
* ```ts
|
|
218
|
+
* dock.on<MyPayload>('my-app:selection-changed', (e) => {
|
|
219
|
+
* // ...
|
|
220
|
+
* });
|
|
221
|
+
* dock.emit<MyPayload>('my-app:selection-changed', payload);
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
export interface ToolsDockEvents {
|
|
225
|
+
/**
|
|
226
|
+
* Fired when `isOpen` or `activeTool` changes — i.e. `open()`, `close()`,
|
|
227
|
+
* `toggle()`, and availability-driven `activeTool` clears.
|
|
228
|
+
* Does NOT fire when only `context` changes (use `'dock:context-changed'`
|
|
229
|
+
* for that). Payload reflects post-mutation values, no-op-guarded by the
|
|
230
|
+
* same equality checks as the mutators.
|
|
231
|
+
*
|
|
232
|
+
* Useful for consumers that mirror only the open/active surface (a
|
|
233
|
+
* workbench panel, a route guard) and don't care about context refreshes.
|
|
234
|
+
*/
|
|
235
|
+
'dock:state-changed': {
|
|
236
|
+
isOpen: boolean;
|
|
237
|
+
activeTool: string | null;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Fired only when `context` changes (via `setContext()` with a different
|
|
241
|
+
* reference). Does NOT fire on `open()` / `close()` / `toggle()`.
|
|
242
|
+
* No-op-guarded — same-reference `setContext` calls stay silent.
|
|
243
|
+
*
|
|
244
|
+
* Useful for consumers that mirror only the context (analytics, server
|
|
245
|
+
* sync) and don't care about open/close transitions.
|
|
246
|
+
*
|
|
247
|
+
* The payload uses the default-typed `ToolsDockContext`; the dock's
|
|
248
|
+
* event registry is shared across all `ToolsDockApi` instances and can't
|
|
249
|
+
* flow the factory's `<TData, TActions>` through to per-instance
|
|
250
|
+
* subscribers. Consumers that want typed access should either:
|
|
251
|
+
*
|
|
252
|
+
* 1. Cast at the handler site:
|
|
253
|
+
* ```ts
|
|
254
|
+
* dock.on('dock:context-changed', ({ context }) => {
|
|
255
|
+
* const typed = context as ToolsDockContext<MyData, MyActions> | null;
|
|
256
|
+
* // ... typed.data?.siteSlug
|
|
257
|
+
* });
|
|
258
|
+
* ```
|
|
259
|
+
* 2. Use `dock.context` inside a `$derived` — that read is typed by the
|
|
260
|
+
* factory's `<TData, TActions>` generics on the returned instance.
|
|
261
|
+
*/
|
|
262
|
+
'dock:context-changed': {
|
|
263
|
+
context: ToolsDockContext | null;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Fired by the dock after `isOpen`, `activeTool`, or `context` change —
|
|
267
|
+
* i.e. `open()`, `close()`, `toggle()`, `setContext()`, and availability
|
|
268
|
+
* changes that clear the active tool or shift visible badges. Payload
|
|
269
|
+
* reflects post-mutation values.
|
|
270
|
+
*
|
|
271
|
+
* @deprecated Prefer `'dock:state-changed'` / `'dock:context-changed'`
|
|
272
|
+
* for finer-grained subscriptions — they let consumers ignore the slice
|
|
273
|
+
* of change they don't care about. `'dock:change'` continues to fire
|
|
274
|
+
* (back-compat) and may be removed in a future major.
|
|
275
|
+
*/
|
|
276
|
+
'dock:change': {
|
|
277
|
+
isOpen: boolean;
|
|
278
|
+
activeTool: string | null;
|
|
279
|
+
context: ToolsDockContext | null;
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Public reactive API for a tools dock instance. Two generics carry through
|
|
284
|
+
* from the factory site so `dock.context` and `dock.setContext()` flow with
|
|
285
|
+
* the consumer's narrowed types:
|
|
286
|
+
*
|
|
287
|
+
* - `TData` types the shape of `context.data`. Defaults to
|
|
288
|
+
* `Record<string, unknown>`.
|
|
289
|
+
* - `TActions` types the shape of `context.actions`. Defaults to
|
|
290
|
+
* `Record<string, (...args: any[]) => unknown>` so the untyped pattern
|
|
291
|
+
* `dock.setContext({ actions: { triggerSave() {} } })` keeps compiling
|
|
292
|
+
* without a generic argument.
|
|
293
|
+
*
|
|
294
|
+
* The constraint mirrors {@link ToolsDockContext} — a self-mapped
|
|
295
|
+
* `{ [K in keyof TActions]: (...args: any[]) => any }` — so interface-style
|
|
296
|
+
* action maps satisfy the bound without requiring a string index signature.
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```ts
|
|
300
|
+
* interface MyData { siteSlug: string }
|
|
301
|
+
* interface MyActions { triggerSave(): void }
|
|
302
|
+
*
|
|
303
|
+
* const dock = defineToolsDock<MyData, MyActions>({ tools: [...] });
|
|
304
|
+
*
|
|
305
|
+
* // typed:
|
|
306
|
+
* dock.setContext({
|
|
307
|
+
* type: 'route',
|
|
308
|
+
* data: { siteSlug: 'demo' },
|
|
309
|
+
* actions: { triggerSave() {} },
|
|
310
|
+
* });
|
|
311
|
+
* const slug: string | undefined = dock.context?.data?.siteSlug;
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
export interface ToolsDockApi<TData = Record<string, unknown>, TActions extends {
|
|
315
|
+
[K in keyof TActions]: (...args: any[]) => any;
|
|
316
|
+
} = Record<string, (...args: any[]) => unknown>> {
|
|
317
|
+
readonly activeTool: string | null;
|
|
318
|
+
readonly isOpen: boolean;
|
|
319
|
+
readonly availableTools: ReadonlyArray<AvailableTool>;
|
|
320
|
+
/**
|
|
321
|
+
* The current dock context (route data, selection, etc.) as supplied via
|
|
322
|
+
* `setContext()`. Typed against the factory's `<TData, TActions>` generics —
|
|
323
|
+
* narrow them at the `defineToolsDock<TData, TActions>(...)` call site for
|
|
324
|
+
* typed access without a cast.
|
|
325
|
+
*/
|
|
326
|
+
readonly context: ToolsDockContext<TData, TActions> | null;
|
|
327
|
+
open(id?: string): void;
|
|
328
|
+
close(): void;
|
|
329
|
+
toggle(id?: string): void;
|
|
330
|
+
setContext(ctx: ToolsDockContext<TData, TActions> | null): void;
|
|
331
|
+
/**
|
|
332
|
+
* Force a re-run of the `fetchAvailability` callback with the current
|
|
333
|
+
* context. Useful when a side-channel event signals that availability or
|
|
334
|
+
* badges changed without the dock context itself changing (e.g. a job
|
|
335
|
+
* completes, a content row's status flips, a websocket "updated" event
|
|
336
|
+
* arrives). `setContext()` short-circuits on strict-equal references so
|
|
337
|
+
* the only way to refetch with the same context is to call this method.
|
|
338
|
+
*
|
|
339
|
+
* If no `fetchAvailability` is configured, this resets `availableTools`
|
|
340
|
+
* to the full registered set (same behavior as the implicit initial
|
|
341
|
+
* snapshot). Concurrent / overlapping calls are token-gated — stale
|
|
342
|
+
* results are dropped, only the latest fetch applies.
|
|
343
|
+
*/
|
|
344
|
+
refreshAvailability(): void;
|
|
345
|
+
/**
|
|
346
|
+
* Emit an event to all subscribers. The typed overload covers built-in
|
|
347
|
+
* `'dock:*'` events (see {@link ToolsDockEvents}); the stringly-typed
|
|
348
|
+
* overload covers any consumer-defined event name. Consumers should pick
|
|
349
|
+
* names in their own namespace (e.g. `'my-app:foo'`) — `'dock:*'` is
|
|
350
|
+
* reserved for the workspace primitives.
|
|
351
|
+
*/
|
|
352
|
+
emit<K extends keyof ToolsDockEvents>(event: K, payload: ToolsDockEvents[K]): void;
|
|
353
|
+
emit<TPayload>(event: string, payload: TPayload): void;
|
|
354
|
+
/**
|
|
355
|
+
* Subscribe to a dock event. Returns an unsubscribe function. When the
|
|
356
|
+
* event name is a key of {@link ToolsDockEvents} (i.e. `'dock:*'`), the
|
|
357
|
+
* payload type is inferred automatically; otherwise an explicit
|
|
358
|
+
* `TPayload` may be supplied via the stringly-typed overload.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```ts
|
|
362
|
+
* const off = dock.on('dock:change', ({ isOpen, activeTool, context }) => {
|
|
363
|
+
* // mirror to another store
|
|
364
|
+
* });
|
|
365
|
+
* // ...later
|
|
366
|
+
* off();
|
|
367
|
+
* ```
|
|
368
|
+
*/
|
|
369
|
+
on<K extends keyof ToolsDockEvents>(event: K, handler: (payload: ToolsDockEvents[K]) => void): () => void;
|
|
370
|
+
on<TPayload>(event: string, handler: (payload: TPayload) => void): () => void;
|
|
371
|
+
}
|
|
372
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svelte hooks for app state, AI, auth, socket, and theme functionality
|
|
3
|
+
*/
|
|
4
|
+
export * from './useAppState.svelte.js';
|
|
5
|
+
export * from './useAuth.svelte.js';
|
|
6
|
+
export * from './useLLM.svelte.js';
|
|
7
|
+
export * from './useSocket.svelte.js';
|
|
8
|
+
export * from './useSTT.svelte.js';
|
|
9
|
+
export * from './useTheme.js';
|
|
10
|
+
export * from './useTTS.svelte.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svelte hooks for app state, AI, auth, socket, and theme functionality
|
|
3
|
+
*/
|
|
4
|
+
export * from './useAppState.svelte.js';
|
|
5
|
+
export * from './useAuth.svelte.js';
|
|
6
|
+
export * from './useLLM.svelte.js';
|
|
7
|
+
export * from './useSocket.svelte.js';
|
|
8
|
+
export * from './useSTT.svelte.js';
|
|
9
|
+
export * from './useTheme.js';
|
|
10
|
+
export * from './useTTS.svelte.js';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access app state from context
|
|
3
|
+
*/
|
|
4
|
+
import type { AppMode } from '../state/app-state.js';
|
|
5
|
+
import type { SmrtAppStateManager } from '../state/app-state.svelte.js';
|
|
6
|
+
/**
|
|
7
|
+
* Get the app state manager from context
|
|
8
|
+
*
|
|
9
|
+
* @throws If called outside of SmrtProvider
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```svelte
|
|
13
|
+
* <script>
|
|
14
|
+
* import { useAppState } from '@happyvertical/smrt-svelte';
|
|
15
|
+
*
|
|
16
|
+
* const app = useAppState();
|
|
17
|
+
*
|
|
18
|
+
* // Access reactive state
|
|
19
|
+
* $: mode = app.state.mode;
|
|
20
|
+
* $: isSmrt = mode === 'smrt';
|
|
21
|
+
* </script>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function useAppState(): SmrtAppStateManager;
|
|
25
|
+
/**
|
|
26
|
+
* Try to get app state, returns null if not in context
|
|
27
|
+
*/
|
|
28
|
+
export declare function tryUseAppState(): SmrtAppStateManager | null;
|
|
29
|
+
/**
|
|
30
|
+
* Helper to check if smrt mode is enabled
|
|
31
|
+
*/
|
|
32
|
+
export declare function useIsSmrt(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Helper to get current mode
|
|
35
|
+
*/
|
|
36
|
+
export declare function useMode(): AppMode;
|
|
37
|
+
/**
|
|
38
|
+
* Helper to check permissions
|
|
39
|
+
*/
|
|
40
|
+
export declare function usePermissions(): {
|
|
41
|
+
has: (permission: string) => boolean;
|
|
42
|
+
hasAll: (permissions: string[]) => boolean;
|
|
43
|
+
hasAny: (permissions: string[]) => boolean;
|
|
44
|
+
list: string[];
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=useAppState.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppState.svelte.d.ts","sourceRoot":"","sources":["../../src/hooks/useAppState.svelte.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,IAAI,mBAAmB,CAEjD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,mBAAmB,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAGnC;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAGjC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI;IAChC,GAAG,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,MAAM,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;IAC3C,MAAM,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;IAC3C,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAWA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access app state from context
|
|
3
|
+
*/
|
|
4
|
+
import { getAppStateContext, tryGetAppStateContext } from '../state/context.js';
|
|
5
|
+
/**
|
|
6
|
+
* Get the app state manager from context
|
|
7
|
+
*
|
|
8
|
+
* @throws If called outside of SmrtProvider
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```svelte
|
|
12
|
+
* <script>
|
|
13
|
+
* import { useAppState } from '@happyvertical/smrt-svelte';
|
|
14
|
+
*
|
|
15
|
+
* const app = useAppState();
|
|
16
|
+
*
|
|
17
|
+
* // Access reactive state
|
|
18
|
+
* $: mode = app.state.mode;
|
|
19
|
+
* $: isSmrt = mode === 'smrt';
|
|
20
|
+
* </script>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function useAppState() {
|
|
24
|
+
return getAppStateContext();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Try to get app state, returns null if not in context
|
|
28
|
+
*/
|
|
29
|
+
export function tryUseAppState() {
|
|
30
|
+
return tryGetAppStateContext();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Helper to check if smrt mode is enabled
|
|
34
|
+
*/
|
|
35
|
+
export function useIsSmrt() {
|
|
36
|
+
const app = getAppStateContext();
|
|
37
|
+
return app.state.mode === 'smrt';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Helper to get current mode
|
|
41
|
+
*/
|
|
42
|
+
export function useMode() {
|
|
43
|
+
const app = getAppStateContext();
|
|
44
|
+
return app.state.mode;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Helper to check permissions
|
|
48
|
+
*/
|
|
49
|
+
export function usePermissions() {
|
|
50
|
+
const app = getAppStateContext();
|
|
51
|
+
return {
|
|
52
|
+
has: (permission) => app.hasPermission(permission),
|
|
53
|
+
hasAll: (permissions) => app.hasAllPermissions(permissions),
|
|
54
|
+
hasAny: (permissions) => app.hasAnyPermission(permissions),
|
|
55
|
+
get list() {
|
|
56
|
+
return app.state.session.permissions;
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access authentication state
|
|
3
|
+
*/
|
|
4
|
+
import type { User } from '../state/app-state.js';
|
|
5
|
+
/**
|
|
6
|
+
* Access authentication state and permission checking
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```svelte
|
|
10
|
+
* <script>
|
|
11
|
+
* import { useAuth } from '@happyvertical/smrt-svelte';
|
|
12
|
+
*
|
|
13
|
+
* const auth = useAuth();
|
|
14
|
+
* </script>
|
|
15
|
+
*
|
|
16
|
+
* {#if auth.isAuthenticated}
|
|
17
|
+
* <p>Welcome, {auth.user?.email}</p>
|
|
18
|
+
*
|
|
19
|
+
* {#if auth.hasPermission('articles.create')}
|
|
20
|
+
* <button>Create Article</button>
|
|
21
|
+
* {/if}
|
|
22
|
+
* {:else}
|
|
23
|
+
* <a href="/login">Sign In</a>
|
|
24
|
+
* {/if}
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useAuth(): {
|
|
28
|
+
/** The authenticated user (null if not authenticated) */
|
|
29
|
+
readonly user: User | null;
|
|
30
|
+
/** Whether a user is authenticated */
|
|
31
|
+
readonly isAuthenticated: boolean;
|
|
32
|
+
/** List of user's permissions */
|
|
33
|
+
readonly permissions: readonly string[];
|
|
34
|
+
/** Check if user has a specific permission */
|
|
35
|
+
hasPermission: (permission: string) => boolean;
|
|
36
|
+
/** Check if user has all of the specified permissions */
|
|
37
|
+
hasAllPermissions: (permissions: string[]) => boolean;
|
|
38
|
+
/** Check if user has any of the specified permissions */
|
|
39
|
+
hasAnyPermission: (permissions: string[]) => boolean;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=useAuth.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuth.svelte.d.ts","sourceRoot":"","sources":["../../src/hooks/useAuth.svelte.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,OAAO,IAAI;IACzB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,iCAAiC;IACjC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,8CAA8C;IAC9C,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,yDAAyD;IACzD,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;IACtD,yDAAyD;IACzD,gBAAgB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;CACtD,CAmBA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access authentication state
|
|
3
|
+
*/
|
|
4
|
+
import { getAppStateContext } from '../state/context.js';
|
|
5
|
+
/**
|
|
6
|
+
* Access authentication state and permission checking
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```svelte
|
|
10
|
+
* <script>
|
|
11
|
+
* import { useAuth } from '@happyvertical/smrt-svelte';
|
|
12
|
+
*
|
|
13
|
+
* const auth = useAuth();
|
|
14
|
+
* </script>
|
|
15
|
+
*
|
|
16
|
+
* {#if auth.isAuthenticated}
|
|
17
|
+
* <p>Welcome, {auth.user?.email}</p>
|
|
18
|
+
*
|
|
19
|
+
* {#if auth.hasPermission('articles.create')}
|
|
20
|
+
* <button>Create Article</button>
|
|
21
|
+
* {/if}
|
|
22
|
+
* {:else}
|
|
23
|
+
* <a href="/login">Sign In</a>
|
|
24
|
+
* {/if}
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function useAuth() {
|
|
28
|
+
const app = getAppStateContext();
|
|
29
|
+
return {
|
|
30
|
+
get user() {
|
|
31
|
+
return app.state.session.user;
|
|
32
|
+
},
|
|
33
|
+
get isAuthenticated() {
|
|
34
|
+
return app.state.session.isAuthenticated;
|
|
35
|
+
},
|
|
36
|
+
get permissions() {
|
|
37
|
+
return app.state.session.permissions;
|
|
38
|
+
},
|
|
39
|
+
hasPermission: (permission) => app.hasPermission(permission),
|
|
40
|
+
hasAllPermissions: (permissions) => app.hasAllPermissions(permissions),
|
|
41
|
+
hasAnyPermission: (permissions) => app.hasAnyPermission(permissions),
|
|
42
|
+
};
|
|
43
|
+
}
|