@docyrus/rn-assistant 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +477 -0
- package/dist/commonjs/components/agent-selector/agent-selector.js +300 -0
- package/dist/commonjs/components/agent-selector/agent-selector.js.map +1 -0
- package/dist/commonjs/components/agent-selector/index.js +17 -0
- package/dist/commonjs/components/agent-selector/index.js.map +1 -0
- package/dist/commonjs/components/assistant-animations/assistant-animations.js +169 -0
- package/dist/commonjs/components/assistant-animations/assistant-animations.js.map +1 -0
- package/dist/commonjs/components/assistant-animations/index.js +17 -0
- package/dist/commonjs/components/assistant-animations/index.js.map +1 -0
- package/dist/commonjs/components/assistant-screen/assistant-screen.js +809 -0
- package/dist/commonjs/components/assistant-screen/assistant-screen.js.map +1 -0
- package/dist/commonjs/components/assistant-screen/index.js +17 -0
- package/dist/commonjs/components/assistant-screen/index.js.map +1 -0
- package/dist/commonjs/components/index.js +116 -0
- package/dist/commonjs/components/index.js.map +1 -0
- package/dist/commonjs/components/message-parts/index.js +13 -0
- package/dist/commonjs/components/message-parts/index.js.map +1 -0
- package/dist/commonjs/components/message-parts/message-parts.js +209 -0
- package/dist/commonjs/components/message-parts/message-parts.js.map +1 -0
- package/dist/commonjs/components/new-chat/index.js +17 -0
- package/dist/commonjs/components/new-chat/index.js.map +1 -0
- package/dist/commonjs/components/new-chat/new-chat.js +100 -0
- package/dist/commonjs/components/new-chat/new-chat.js.map +1 -0
- package/dist/commonjs/components/prompt-input/attachment-picker.js +341 -0
- package/dist/commonjs/components/prompt-input/attachment-picker.js.map +1 -0
- package/dist/commonjs/components/prompt-input/attachment-preview.js +229 -0
- package/dist/commonjs/components/prompt-input/attachment-preview.js.map +1 -0
- package/dist/commonjs/components/prompt-input/index.js +41 -0
- package/dist/commonjs/components/prompt-input/index.js.map +1 -0
- package/dist/commonjs/components/prompt-input/prompt-input.js +288 -0
- package/dist/commonjs/components/prompt-input/prompt-input.js.map +1 -0
- package/dist/commonjs/components/prompt-input/provider-selector.js +542 -0
- package/dist/commonjs/components/prompt-input/provider-selector.js.map +1 -0
- package/dist/commonjs/components/prompt-input/reasoning-level-selector.js +350 -0
- package/dist/commonjs/components/prompt-input/reasoning-level-selector.js.map +1 -0
- package/dist/commonjs/components/prompt-input/voice-recorder.js +260 -0
- package/dist/commonjs/components/prompt-input/voice-recorder.js.map +1 -0
- package/dist/commonjs/components/sessions-list/index.js +17 -0
- package/dist/commonjs/components/sessions-list/index.js.map +1 -0
- package/dist/commonjs/components/sessions-list/sessions-list.js +820 -0
- package/dist/commonjs/components/sessions-list/sessions-list.js.map +1 -0
- package/dist/commonjs/hooks/index.js +34 -0
- package/dist/commonjs/hooks/index.js.map +1 -0
- package/dist/commonjs/hooks/use-agent-models.js +104 -0
- package/dist/commonjs/hooks/use-agent-models.js.map +1 -0
- package/dist/commonjs/hooks/use-assistant.js +402 -0
- package/dist/commonjs/hooks/use-assistant.js.map +1 -0
- package/dist/commonjs/hooks/use-attachment-picker.js +308 -0
- package/dist/commonjs/hooks/use-attachment-picker.js.map +1 -0
- package/dist/commonjs/hooks/use-voice-recorder.js +217 -0
- package/dist/commonjs/hooks/use-voice-recorder.js.map +1 -0
- package/dist/commonjs/index.js +112 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/theme/assistant-theme.js +105 -0
- package/dist/commonjs/theme/assistant-theme.js.map +1 -0
- package/dist/commonjs/theme/index.js +19 -0
- package/dist/commonjs/theme/index.js.map +1 -0
- package/dist/commonjs/types/index.js +2 -0
- package/dist/commonjs/types/index.js.map +1 -0
- package/dist/commonjs/ui/action-sheet.js +348 -0
- package/dist/commonjs/ui/action-sheet.js.map +1 -0
- package/dist/commonjs/ui/alert-dialog.js +134 -0
- package/dist/commonjs/ui/alert-dialog.js.map +1 -0
- package/dist/commonjs/ui/docyrus-brand-mark.js +52 -0
- package/dist/commonjs/ui/docyrus-brand-mark.js.map +1 -0
- package/dist/commonjs/ui/docyrus-icon.js +298 -0
- package/dist/commonjs/ui/docyrus-icon.js.map +1 -0
- package/dist/commonjs/ui/index.js +34 -0
- package/dist/commonjs/ui/index.js.map +1 -0
- package/dist/commonjs/utils/api-client.js +99 -0
- package/dist/commonjs/utils/api-client.js.map +1 -0
- package/dist/commonjs/utils/default-api-config.js +195 -0
- package/dist/commonjs/utils/default-api-config.js.map +1 -0
- package/dist/commonjs/utils/index.js +39 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/commonjs/utils/resolve-api-headers.js +16 -0
- package/dist/commonjs/utils/resolve-api-headers.js.map +1 -0
- package/dist/module/components/agent-selector/agent-selector.js +296 -0
- package/dist/module/components/agent-selector/agent-selector.js.map +1 -0
- package/dist/module/components/agent-selector/index.js +4 -0
- package/dist/module/components/agent-selector/index.js.map +1 -0
- package/dist/module/components/assistant-animations/assistant-animations.js +164 -0
- package/dist/module/components/assistant-animations/assistant-animations.js.map +1 -0
- package/dist/module/components/assistant-animations/index.js +4 -0
- package/dist/module/components/assistant-animations/index.js.map +1 -0
- package/dist/module/components/assistant-screen/assistant-screen.js +801 -0
- package/dist/module/components/assistant-screen/assistant-screen.js.map +1 -0
- package/dist/module/components/assistant-screen/index.js +4 -0
- package/dist/module/components/assistant-screen/index.js.map +1 -0
- package/dist/module/components/index.js +23 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/message-parts/index.js +4 -0
- package/dist/module/components/message-parts/index.js.map +1 -0
- package/dist/module/components/message-parts/message-parts.js +205 -0
- package/dist/module/components/message-parts/message-parts.js.map +1 -0
- package/dist/module/components/new-chat/index.js +4 -0
- package/dist/module/components/new-chat/index.js.map +1 -0
- package/dist/module/components/new-chat/new-chat.js +96 -0
- package/dist/module/components/new-chat/new-chat.js.map +1 -0
- package/dist/module/components/prompt-input/attachment-picker.js +337 -0
- package/dist/module/components/prompt-input/attachment-picker.js.map +1 -0
- package/dist/module/components/prompt-input/attachment-preview.js +225 -0
- package/dist/module/components/prompt-input/attachment-preview.js.map +1 -0
- package/dist/module/components/prompt-input/index.js +15 -0
- package/dist/module/components/prompt-input/index.js.map +1 -0
- package/dist/module/components/prompt-input/prompt-input.js +284 -0
- package/dist/module/components/prompt-input/prompt-input.js.map +1 -0
- package/dist/module/components/prompt-input/provider-selector.js +538 -0
- package/dist/module/components/prompt-input/provider-selector.js.map +1 -0
- package/dist/module/components/prompt-input/reasoning-level-selector.js +346 -0
- package/dist/module/components/prompt-input/reasoning-level-selector.js.map +1 -0
- package/dist/module/components/prompt-input/voice-recorder.js +256 -0
- package/dist/module/components/prompt-input/voice-recorder.js.map +1 -0
- package/dist/module/components/sessions-list/index.js +4 -0
- package/dist/module/components/sessions-list/index.js.map +1 -0
- package/dist/module/components/sessions-list/sessions-list.js +816 -0
- package/dist/module/components/sessions-list/sessions-list.js.map +1 -0
- package/dist/module/hooks/index.js +18 -0
- package/dist/module/hooks/index.js.map +1 -0
- package/dist/module/hooks/use-agent-models.js +100 -0
- package/dist/module/hooks/use-agent-models.js.map +1 -0
- package/dist/module/hooks/use-assistant.js +398 -0
- package/dist/module/hooks/use-assistant.js.map +1 -0
- package/dist/module/hooks/use-attachment-picker.js +303 -0
- package/dist/module/hooks/use-attachment-picker.js.map +1 -0
- package/dist/module/hooks/use-voice-recorder.js +214 -0
- package/dist/module/hooks/use-voice-recorder.js.map +1 -0
- package/dist/module/index.js +59 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/theme/assistant-theme.js +100 -0
- package/dist/module/theme/assistant-theme.js.map +1 -0
- package/dist/module/theme/index.js +4 -0
- package/dist/module/theme/index.js.map +1 -0
- package/dist/module/types/index.js +2 -0
- package/dist/module/types/index.js.map +1 -0
- package/dist/module/ui/action-sheet.js +344 -0
- package/dist/module/ui/action-sheet.js.map +1 -0
- package/dist/module/ui/alert-dialog.js +130 -0
- package/dist/module/ui/alert-dialog.js.map +1 -0
- package/dist/module/ui/docyrus-brand-mark.js +48 -0
- package/dist/module/ui/docyrus-brand-mark.js.map +1 -0
- package/dist/module/ui/docyrus-icon.js +294 -0
- package/dist/module/ui/docyrus-icon.js.map +1 -0
- package/dist/module/ui/index.js +7 -0
- package/dist/module/ui/index.js.map +1 -0
- package/dist/module/utils/api-client.js +95 -0
- package/dist/module/utils/api-client.js.map +1 -0
- package/dist/module/utils/default-api-config.js +190 -0
- package/dist/module/utils/default-api-config.js.map +1 -0
- package/dist/module/utils/index.js +12 -0
- package/dist/module/utils/index.js.map +1 -0
- package/dist/module/utils/resolve-api-headers.js +12 -0
- package/dist/module/utils/resolve-api-headers.js.map +1 -0
- package/dist/typescript/commonjs/eslint.config.d.mts +4 -0
- package/dist/typescript/commonjs/eslint.config.d.mts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts +49 -0
- package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts +122 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +11 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/message-parts/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/message-parts/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts +22 -0
- package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/new-chat/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/new-chat/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts +34 -0
- package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts +53 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts +42 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts +9 -0
- package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts +139 -0
- package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts +11 -0
- package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
- package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts +48 -0
- package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts +59 -0
- package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/index.d.ts +8 -0
- package/dist/typescript/commonjs/src/hooks/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts +68 -0
- package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts +55 -0
- package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts +99 -0
- package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts +101 -0
- package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/index.d.ts +47 -0
- package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts +51 -0
- package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/theme/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/theme/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/types/index.d.ts +167 -0
- package/dist/typescript/commonjs/src/types/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/action-sheet.d.ts +29 -0
- package/dist/typescript/commonjs/src/ui/action-sheet.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts +12 -0
- package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts +5 -0
- package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts +11 -0
- package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/index.d.ts +5 -0
- package/dist/typescript/commonjs/src/ui/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/api-client.d.ts +35 -0
- package/dist/typescript/commonjs/src/utils/api-client.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/default-api-config.d.ts +38 -0
- package/dist/typescript/commonjs/src/utils/default-api-config.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/index.d.ts +9 -0
- package/dist/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts +3 -0
- package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts.map +1 -0
- package/dist/typescript/module/eslint.config.d.mts +4 -0
- package/dist/typescript/module/eslint.config.d.mts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts +49 -0
- package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/agent-selector/index.d.ts +2 -0
- package/dist/typescript/module/src/components/agent-selector/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts +8 -0
- package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-animations/index.d.ts +2 -0
- package/dist/typescript/module/src/components/assistant-animations/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts +122 -0
- package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-screen/index.d.ts +2 -0
- package/dist/typescript/module/src/components/assistant-screen/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +11 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/message-parts/index.d.ts +2 -0
- package/dist/typescript/module/src/components/message-parts/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/message-parts/message-parts.d.ts +22 -0
- package/dist/typescript/module/src/components/message-parts/message-parts.d.ts.map +1 -0
- package/dist/typescript/module/src/components/new-chat/index.d.ts +2 -0
- package/dist/typescript/module/src/components/new-chat/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/new-chat/new-chat.d.ts +34 -0
- package/dist/typescript/module/src/components/new-chat/new-chat.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts +53 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts +42 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/index.d.ts +9 -0
- package/dist/typescript/module/src/components/prompt-input/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts +139 -0
- package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts +11 -0
- package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
- package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts +48 -0
- package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
- package/dist/typescript/module/src/components/sessions-list/index.d.ts +2 -0
- package/dist/typescript/module/src/components/sessions-list/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts +59 -0
- package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/index.d.ts +8 -0
- package/dist/typescript/module/src/hooks/index.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-agent-models.d.ts +68 -0
- package/dist/typescript/module/src/hooks/use-agent-models.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-assistant.d.ts +55 -0
- package/dist/typescript/module/src/hooks/use-assistant.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts +99 -0
- package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts +101 -0
- package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts.map +1 -0
- package/dist/typescript/module/src/index.d.ts +47 -0
- package/dist/typescript/module/src/index.d.ts.map +1 -0
- package/dist/typescript/module/src/theme/assistant-theme.d.ts +51 -0
- package/dist/typescript/module/src/theme/assistant-theme.d.ts.map +1 -0
- package/dist/typescript/module/src/theme/index.d.ts +2 -0
- package/dist/typescript/module/src/theme/index.d.ts.map +1 -0
- package/dist/typescript/module/src/types/index.d.ts +167 -0
- package/dist/typescript/module/src/types/index.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/action-sheet.d.ts +29 -0
- package/dist/typescript/module/src/ui/action-sheet.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/alert-dialog.d.ts +12 -0
- package/dist/typescript/module/src/ui/alert-dialog.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts +5 -0
- package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/docyrus-icon.d.ts +11 -0
- package/dist/typescript/module/src/ui/docyrus-icon.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/index.d.ts +5 -0
- package/dist/typescript/module/src/ui/index.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/api-client.d.ts +35 -0
- package/dist/typescript/module/src/utils/api-client.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/default-api-config.d.ts +38 -0
- package/dist/typescript/module/src/utils/default-api-config.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/index.d.ts +9 -0
- package/dist/typescript/module/src/utils/index.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/resolve-api-headers.d.ts +3 -0
- package/dist/typescript/module/src/utils/resolve-api-headers.d.ts.map +1 -0
- package/package.json +176 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAttachmentPicker = useAttachmentPicker;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var DocumentPicker = _interopRequireWildcard(require("expo-document-picker"));
|
|
9
|
+
var ImagePicker = _interopRequireWildcard(require("expo-image-picker"));
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
+
/**
|
|
12
|
+
* Generate unique ID for attachments
|
|
13
|
+
*/
|
|
14
|
+
const generateId = () => `attachment_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get file extension from name or URI
|
|
18
|
+
*/
|
|
19
|
+
const getFileExtension = name => {
|
|
20
|
+
const match = name.match(/\.([^.]+)$/);
|
|
21
|
+
return match?.[1]?.toLowerCase() ?? '';
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Determine MIME type from extension
|
|
26
|
+
*/
|
|
27
|
+
const getMimeType = (name, providedMime) => {
|
|
28
|
+
if (providedMime && providedMime !== 'application/octet-stream') {
|
|
29
|
+
return providedMime;
|
|
30
|
+
}
|
|
31
|
+
const ext = getFileExtension(name);
|
|
32
|
+
const mimeMap = {
|
|
33
|
+
pdf: 'application/pdf',
|
|
34
|
+
doc: 'application/msword',
|
|
35
|
+
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
36
|
+
xls: 'application/vnd.ms-excel',
|
|
37
|
+
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
38
|
+
ppt: 'application/vnd.ms-powerpoint',
|
|
39
|
+
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
40
|
+
txt: 'text/plain',
|
|
41
|
+
csv: 'text/csv',
|
|
42
|
+
json: 'application/json',
|
|
43
|
+
jpg: 'image/jpeg',
|
|
44
|
+
jpeg: 'image/jpeg',
|
|
45
|
+
png: 'image/png',
|
|
46
|
+
gif: 'image/gif',
|
|
47
|
+
webp: 'image/webp',
|
|
48
|
+
heic: 'image/heic',
|
|
49
|
+
mp3: 'audio/mpeg',
|
|
50
|
+
wav: 'audio/wav',
|
|
51
|
+
m4a: 'audio/m4a',
|
|
52
|
+
mp4: 'video/mp4',
|
|
53
|
+
mov: 'video/quicktime'
|
|
54
|
+
};
|
|
55
|
+
return mimeMap[ext] || 'application/octet-stream';
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Hook for picking and managing attachments
|
|
60
|
+
*
|
|
61
|
+
* Supports documents via expo-document-picker and images via expo-image-picker.
|
|
62
|
+
* Converts picked files to AIMessageFile format.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* const {
|
|
67
|
+
* attachments,
|
|
68
|
+
* pickDocuments,
|
|
69
|
+
* pickImages,
|
|
70
|
+
* takePhoto,
|
|
71
|
+
* removeAttachment,
|
|
72
|
+
* clearAttachments
|
|
73
|
+
* } = useAttachmentPicker({
|
|
74
|
+
* maxAttachments: 5,
|
|
75
|
+
* onAttachmentsChange: (files) => console.log('Attachments:', files)
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
function useAttachmentPicker(options = {}) {
|
|
80
|
+
const {
|
|
81
|
+
allowedDocumentTypes = ['*/*'],
|
|
82
|
+
allowedImageTypes = ['images'],
|
|
83
|
+
maxAttachments = 10,
|
|
84
|
+
maxFileSize = 10 * 1024 * 1024,
|
|
85
|
+
// 10MB
|
|
86
|
+
allowMultiple = true,
|
|
87
|
+
onAttachmentsChange,
|
|
88
|
+
onError
|
|
89
|
+
} = options;
|
|
90
|
+
const [attachments, setAttachments] = (0, _react.useState)([]);
|
|
91
|
+
const [isLoading, setIsLoading] = (0, _react.useState)(false);
|
|
92
|
+
const [isPicking, setIsPicking] = (0, _react.useState)(false);
|
|
93
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
94
|
+
const updateAttachments = (0, _react.useCallback)(newAttachments => {
|
|
95
|
+
setAttachments(newAttachments);
|
|
96
|
+
onAttachmentsChange?.(newAttachments);
|
|
97
|
+
}, [onAttachmentsChange]);
|
|
98
|
+
const validateFile = (0, _react.useCallback)(file => {
|
|
99
|
+
if (file.size && file.size > maxFileSize) {
|
|
100
|
+
const err = new Error(`File "${file.name}" exceeds maximum size of ${Math.round(maxFileSize / 1024 / 1024)}MB`);
|
|
101
|
+
setError(err);
|
|
102
|
+
onError?.(err);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}, [maxFileSize, onError]);
|
|
107
|
+
const checkAttachmentLimit = (0, _react.useCallback)(countToAdd => {
|
|
108
|
+
if (attachments.length + countToAdd > maxAttachments) {
|
|
109
|
+
const err = new Error(`Maximum ${maxAttachments} attachments allowed`);
|
|
110
|
+
setError(err);
|
|
111
|
+
onError?.(err);
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
}, [attachments.length, maxAttachments, onError]);
|
|
116
|
+
const pickDocuments = (0, _react.useCallback)(async () => {
|
|
117
|
+
// Prevent multiple concurrent picks
|
|
118
|
+
if (isPicking) {
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
setError(null);
|
|
122
|
+
setIsLoading(true);
|
|
123
|
+
setIsPicking(true);
|
|
124
|
+
try {
|
|
125
|
+
const result = await DocumentPicker.getDocumentAsync({
|
|
126
|
+
type: allowedDocumentTypes,
|
|
127
|
+
multiple: allowMultiple,
|
|
128
|
+
copyToCacheDirectory: true
|
|
129
|
+
});
|
|
130
|
+
if (result.canceled || !result.assets) {
|
|
131
|
+
return [];
|
|
132
|
+
}
|
|
133
|
+
const availableSlots = maxAttachments - attachments.length;
|
|
134
|
+
const assetsToAdd = result.assets.slice(0, availableSlots);
|
|
135
|
+
if (result.assets.length > availableSlots) {
|
|
136
|
+
const err = new Error(`Only ${availableSlots} more attachment(s) allowed. Some files were not added.`);
|
|
137
|
+
setError(err);
|
|
138
|
+
onError?.(err);
|
|
139
|
+
}
|
|
140
|
+
const newAttachments = [];
|
|
141
|
+
for (const asset of assetsToAdd) {
|
|
142
|
+
if (!validateFile({
|
|
143
|
+
size: asset.size,
|
|
144
|
+
name: asset.name
|
|
145
|
+
})) {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
newAttachments.push({
|
|
149
|
+
id: generateId(),
|
|
150
|
+
name: asset.name,
|
|
151
|
+
type: getMimeType(asset.name, asset.mimeType),
|
|
152
|
+
uri: asset.uri,
|
|
153
|
+
size: asset.size
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
const updatedAttachments = [...attachments, ...newAttachments];
|
|
157
|
+
updateAttachments(updatedAttachments);
|
|
158
|
+
return newAttachments;
|
|
159
|
+
} catch (err) {
|
|
160
|
+
const pickerError = err instanceof Error ? err : new Error('Failed to pick documents');
|
|
161
|
+
setError(pickerError);
|
|
162
|
+
onError?.(pickerError);
|
|
163
|
+
return [];
|
|
164
|
+
} finally {
|
|
165
|
+
setIsLoading(false);
|
|
166
|
+
setIsPicking(false);
|
|
167
|
+
}
|
|
168
|
+
}, [isPicking, allowedDocumentTypes, allowMultiple, attachments, maxAttachments, validateFile, updateAttachments, onError]);
|
|
169
|
+
const pickImages = (0, _react.useCallback)(async () => {
|
|
170
|
+
// Prevent multiple concurrent picks
|
|
171
|
+
if (isPicking) {
|
|
172
|
+
return [];
|
|
173
|
+
}
|
|
174
|
+
setError(null);
|
|
175
|
+
setIsLoading(true);
|
|
176
|
+
setIsPicking(true);
|
|
177
|
+
try {
|
|
178
|
+
// Request permissions
|
|
179
|
+
const permissionResult = await ImagePicker.requestMediaLibraryPermissionsAsync();
|
|
180
|
+
if (!permissionResult.granted) {
|
|
181
|
+
throw new Error('Permission to access media library was denied');
|
|
182
|
+
}
|
|
183
|
+
const result = await ImagePicker.launchImageLibraryAsync({
|
|
184
|
+
mediaTypes: allowedImageTypes,
|
|
185
|
+
allowsMultipleSelection: allowMultiple,
|
|
186
|
+
quality: 0.8
|
|
187
|
+
});
|
|
188
|
+
if (result.canceled || !result.assets) {
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
191
|
+
const availableSlots = maxAttachments - attachments.length;
|
|
192
|
+
const assetsToAdd = result.assets.slice(0, availableSlots);
|
|
193
|
+
if (result.assets.length > availableSlots) {
|
|
194
|
+
const err = new Error(`Only ${availableSlots} more attachment(s) allowed. Some images were not added.`);
|
|
195
|
+
setError(err);
|
|
196
|
+
onError?.(err);
|
|
197
|
+
}
|
|
198
|
+
const newAttachments = [];
|
|
199
|
+
for (const asset of assetsToAdd) {
|
|
200
|
+
const fileName = asset.fileName || `image_${Date.now()}.${asset.type === 'video' ? 'mp4' : 'jpg'}`;
|
|
201
|
+
if (!validateFile({
|
|
202
|
+
size: asset.fileSize,
|
|
203
|
+
name: fileName
|
|
204
|
+
})) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
newAttachments.push({
|
|
208
|
+
id: generateId(),
|
|
209
|
+
name: fileName,
|
|
210
|
+
type: asset.mimeType || getMimeType(fileName),
|
|
211
|
+
uri: asset.uri,
|
|
212
|
+
size: asset.fileSize
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
const updatedAttachments = [...attachments, ...newAttachments];
|
|
216
|
+
updateAttachments(updatedAttachments);
|
|
217
|
+
return newAttachments;
|
|
218
|
+
} catch (err) {
|
|
219
|
+
const pickerError = err instanceof Error ? err : new Error('Failed to pick images');
|
|
220
|
+
setError(pickerError);
|
|
221
|
+
onError?.(pickerError);
|
|
222
|
+
return [];
|
|
223
|
+
} finally {
|
|
224
|
+
setIsLoading(false);
|
|
225
|
+
setIsPicking(false);
|
|
226
|
+
}
|
|
227
|
+
}, [isPicking, allowedImageTypes, allowMultiple, attachments, maxAttachments, validateFile, updateAttachments, onError]);
|
|
228
|
+
const takePhoto = (0, _react.useCallback)(async () => {
|
|
229
|
+
// Prevent multiple concurrent picks
|
|
230
|
+
if (isPicking) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
setError(null);
|
|
234
|
+
if (!checkAttachmentLimit(1)) {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
setIsLoading(true);
|
|
238
|
+
setIsPicking(true);
|
|
239
|
+
try {
|
|
240
|
+
// Request camera permissions
|
|
241
|
+
const permissionResult = await ImagePicker.requestCameraPermissionsAsync();
|
|
242
|
+
if (!permissionResult.granted) {
|
|
243
|
+
throw new Error('Permission to access camera was denied');
|
|
244
|
+
}
|
|
245
|
+
const result = await ImagePicker.launchCameraAsync({
|
|
246
|
+
mediaTypes: ['images'],
|
|
247
|
+
quality: 0.8
|
|
248
|
+
});
|
|
249
|
+
const asset = result.assets?.[0];
|
|
250
|
+
if (result.canceled || !asset) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
const fileName = asset.fileName || `photo_${Date.now()}.jpg`;
|
|
254
|
+
if (!validateFile({
|
|
255
|
+
size: asset.fileSize,
|
|
256
|
+
name: fileName
|
|
257
|
+
})) {
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
const newAttachment = {
|
|
261
|
+
id: generateId(),
|
|
262
|
+
name: fileName,
|
|
263
|
+
type: asset.mimeType || 'image/jpeg',
|
|
264
|
+
uri: asset.uri,
|
|
265
|
+
size: asset.fileSize
|
|
266
|
+
};
|
|
267
|
+
const updatedAttachments = [...attachments, newAttachment];
|
|
268
|
+
updateAttachments(updatedAttachments);
|
|
269
|
+
return newAttachment;
|
|
270
|
+
} catch (err) {
|
|
271
|
+
const cameraError = err instanceof Error ? err : new Error('Failed to take photo');
|
|
272
|
+
setError(cameraError);
|
|
273
|
+
onError?.(cameraError);
|
|
274
|
+
return null;
|
|
275
|
+
} finally {
|
|
276
|
+
setIsLoading(false);
|
|
277
|
+
setIsPicking(false);
|
|
278
|
+
}
|
|
279
|
+
}, [isPicking, attachments, checkAttachmentLimit, validateFile, updateAttachments, onError]);
|
|
280
|
+
const addAttachment = (0, _react.useCallback)(attachment => {
|
|
281
|
+
if (!checkAttachmentLimit(1)) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const updatedAttachments = [...attachments, attachment];
|
|
285
|
+
updateAttachments(updatedAttachments);
|
|
286
|
+
}, [attachments, checkAttachmentLimit, updateAttachments]);
|
|
287
|
+
const removeAttachment = (0, _react.useCallback)(id => {
|
|
288
|
+
const updatedAttachments = attachments.filter(a => a.id !== id);
|
|
289
|
+
updateAttachments(updatedAttachments);
|
|
290
|
+
setError(null);
|
|
291
|
+
}, [attachments, updateAttachments]);
|
|
292
|
+
const clearAttachments = (0, _react.useCallback)(() => {
|
|
293
|
+
updateAttachments([]);
|
|
294
|
+
setError(null);
|
|
295
|
+
}, [updateAttachments]);
|
|
296
|
+
return {
|
|
297
|
+
attachments,
|
|
298
|
+
isLoading,
|
|
299
|
+
pickDocuments,
|
|
300
|
+
pickImages,
|
|
301
|
+
takePhoto,
|
|
302
|
+
addAttachment,
|
|
303
|
+
removeAttachment,
|
|
304
|
+
clearAttachments,
|
|
305
|
+
error
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=use-attachment-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","DocumentPicker","_interopRequireWildcard","ImagePicker","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","generateId","Date","now","Math","random","toString","substring","getFileExtension","name","match","toLowerCase","getMimeType","providedMime","ext","mimeMap","pdf","doc","docx","xls","xlsx","ppt","pptx","txt","csv","json","jpg","jpeg","png","gif","webp","heic","mp3","wav","m4a","mp4","mov","useAttachmentPicker","options","allowedDocumentTypes","allowedImageTypes","maxAttachments","maxFileSize","allowMultiple","onAttachmentsChange","onError","attachments","setAttachments","useState","isLoading","setIsLoading","isPicking","setIsPicking","error","setError","updateAttachments","useCallback","newAttachments","validateFile","file","size","err","Error","round","checkAttachmentLimit","countToAdd","length","pickDocuments","result","getDocumentAsync","type","multiple","copyToCacheDirectory","canceled","assets","availableSlots","assetsToAdd","slice","asset","push","id","mimeType","uri","updatedAttachments","pickerError","pickImages","permissionResult","requestMediaLibraryPermissionsAsync","granted","launchImageLibraryAsync","mediaTypes","allowsMultipleSelection","quality","fileName","fileSize","takePhoto","requestCameraPermissionsAsync","launchCameraAsync","newAttachment","cameraError","addAttachment","attachment","removeAttachment","filter","a","clearAttachments"],"sourceRoot":"../../../src","sources":["hooks/use-attachment-picker.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,uBAAA,CAAAF,OAAA;AAAiD,SAAAE,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,i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B,kBAAkB,CAAC;EACvC,CAAC,EAAE,CAACrC,WAAW,EAAEkB,oBAAoB,EAAET,iBAAiB,CAAC,CAAC;EAE1D,MAAM+C,gBAAgB,GAAG,IAAA9C,kBAAW,EAAEwB,EAAU,IAAK;IACnD,MAAMG,kBAAkB,GAAGrC,WAAW,CAACyD,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACxB,EAAE,KAAKA,EAAE,CAAC;IAE/DzB,iBAAiB,CAAC4B,kBAAkB,CAAC;IACrC7B,QAAQ,CAAC,IAAI,CAAC;EAChB,CAAC,EAAE,CAACR,WAAW,EAAES,iBAAiB,CAAC,CAAC;EAEpC,MAAMkD,gBAAgB,GAAG,IAAAjD,kBAAW,EAAC,MAAM;IACzCD,iBAAiB,CAAC,EAAE,CAAC;IACrBD,QAAQ,CAAC,IAAI,CAAC;EAChB,CAAC,EAAE,CAACC,iBAAiB,CAAC,CAAC;EAEvB,OAAO;IACLT,WAAW;IACXG,SAAS;IACTkB,aAAa;IACbkB,UAAU;IACVU,SAAS;IACTK,aAAa;IACbE,gBAAgB;IAChBG,gBAAgB;IAChBpD;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useVoiceRecorder = useVoiceRecorder;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _expoAudio = require("expo-audio");
|
|
9
|
+
var _apiClient = require("../utils/api-client.js");
|
|
10
|
+
var _resolveApiHeaders = require("../utils/resolve-api-headers.js");
|
|
11
|
+
/**
|
|
12
|
+
* Custom recording preset optimized for speech transcription
|
|
13
|
+
* Uses WAV format for universal compatibility with transcription APIs
|
|
14
|
+
*/
|
|
15
|
+
const TRANSCRIPTION_PRESET = {
|
|
16
|
+
extension: '.wav',
|
|
17
|
+
sampleRate: 16000,
|
|
18
|
+
numberOfChannels: 1,
|
|
19
|
+
bitRate: 128000,
|
|
20
|
+
android: {
|
|
21
|
+
outputFormat: 'default',
|
|
22
|
+
audioEncoder: 'default',
|
|
23
|
+
extension: '.wav'
|
|
24
|
+
},
|
|
25
|
+
ios: {
|
|
26
|
+
outputFormat: _expoAudio.IOSOutputFormat.LINEARPCM,
|
|
27
|
+
audioQuality: _expoAudio.AudioQuality.HIGH,
|
|
28
|
+
linearPCMBitDepth: 16,
|
|
29
|
+
linearPCMIsBigEndian: false,
|
|
30
|
+
linearPCMIsFloat: false
|
|
31
|
+
},
|
|
32
|
+
web: {
|
|
33
|
+
mimeType: 'audio/wav',
|
|
34
|
+
bitsPerSecond: 128000
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Hook for voice recording with optional transcription
|
|
39
|
+
*
|
|
40
|
+
* Uses expo-audio (new API) for recording.
|
|
41
|
+
* Supports optional transcription via external endpoint.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* const {
|
|
46
|
+
* isRecording,
|
|
47
|
+
* duration,
|
|
48
|
+
* startRecording,
|
|
49
|
+
* stopAndTranscribe,
|
|
50
|
+
* transcribedText
|
|
51
|
+
* } = useVoiceRecorder({
|
|
52
|
+
* transcribeEndpoint: 'https://api.example.com/transcribe',
|
|
53
|
+
* onTranscription: (text) => console.log('Transcribed:', text)
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
function useVoiceRecorder(options = {}) {
|
|
58
|
+
const {
|
|
59
|
+
transcribeEndpoint,
|
|
60
|
+
transcribeHeaders,
|
|
61
|
+
onRecordingStart,
|
|
62
|
+
onRecordingStop,
|
|
63
|
+
onTranscription,
|
|
64
|
+
onError
|
|
65
|
+
} = options;
|
|
66
|
+
const [status, setStatus] = (0, _react.useState)('idle');
|
|
67
|
+
const [recordingUri, setRecordingUri] = (0, _react.useState)(null);
|
|
68
|
+
const [transcribedText, setTranscribedText] = (0, _react.useState)(null);
|
|
69
|
+
const [isTranscribing, setIsTranscribing] = (0, _react.useState)(false);
|
|
70
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
71
|
+
const [permissionGranted, setPermissionGranted] = (0, _react.useState)(false);
|
|
72
|
+
const audioRecorder = (0, _expoAudio.useAudioRecorder)(TRANSCRIPTION_PRESET);
|
|
73
|
+
const recorderState = (0, _expoAudio.useAudioRecorderState)(audioRecorder);
|
|
74
|
+
const startTimeRef = (0, _react.useRef)(null);
|
|
75
|
+
const ensureRecordingPermission = (0, _react.useCallback)(async () => {
|
|
76
|
+
if (permissionGranted) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const result = await _expoAudio.AudioModule.requestRecordingPermissionsAsync();
|
|
81
|
+
if (!result.granted) {
|
|
82
|
+
const permissionError = new Error('Recording permission denied');
|
|
83
|
+
setError(permissionError);
|
|
84
|
+
setStatus('error');
|
|
85
|
+
onError?.(permissionError);
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
setPermissionGranted(true);
|
|
89
|
+
await (0, _expoAudio.setAudioModeAsync)({
|
|
90
|
+
playsInSilentMode: true,
|
|
91
|
+
allowsRecording: true
|
|
92
|
+
});
|
|
93
|
+
return true;
|
|
94
|
+
} catch (err) {
|
|
95
|
+
const recordError = err instanceof Error ? err : new Error('Failed to request permissions');
|
|
96
|
+
setError(recordError);
|
|
97
|
+
setStatus('error');
|
|
98
|
+
onError?.(recordError);
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}, [onError, permissionGranted]);
|
|
102
|
+
const startRecording = (0, _react.useCallback)(async () => {
|
|
103
|
+
const hasPermission = await ensureRecordingPermission();
|
|
104
|
+
if (!hasPermission) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
setError(null);
|
|
109
|
+
setTranscribedText(null);
|
|
110
|
+
setRecordingUri(null);
|
|
111
|
+
await audioRecorder.prepareToRecordAsync();
|
|
112
|
+
audioRecorder.record();
|
|
113
|
+
startTimeRef.current = Date.now();
|
|
114
|
+
setStatus('recording');
|
|
115
|
+
onRecordingStart?.();
|
|
116
|
+
} catch (err) {
|
|
117
|
+
const recordError = err instanceof Error ? err : new Error('Failed to start recording');
|
|
118
|
+
setError(recordError);
|
|
119
|
+
setStatus('error');
|
|
120
|
+
onError?.(recordError);
|
|
121
|
+
}
|
|
122
|
+
}, [ensureRecordingPermission, audioRecorder, onRecordingStart, onError]);
|
|
123
|
+
const stopRecording = (0, _react.useCallback)(async () => {
|
|
124
|
+
try {
|
|
125
|
+
await audioRecorder.stop();
|
|
126
|
+
const {
|
|
127
|
+
uri
|
|
128
|
+
} = audioRecorder;
|
|
129
|
+
if (uri) {
|
|
130
|
+
setRecordingUri(uri);
|
|
131
|
+
setStatus('stopped');
|
|
132
|
+
onRecordingStop?.(uri);
|
|
133
|
+
return uri;
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
} catch (err) {
|
|
137
|
+
const recordError = err instanceof Error ? err : new Error('Failed to stop recording');
|
|
138
|
+
setError(recordError);
|
|
139
|
+
setStatus('error');
|
|
140
|
+
onError?.(recordError);
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}, [audioRecorder, onRecordingStop, onError]);
|
|
144
|
+
const transcribe = (0, _react.useCallback)(async uri => {
|
|
145
|
+
if (!transcribeEndpoint) {
|
|
146
|
+
const err = new Error('Transcription endpoint not configured');
|
|
147
|
+
setError(err);
|
|
148
|
+
onError?.(err);
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
setIsTranscribing(true);
|
|
152
|
+
try {
|
|
153
|
+
/*
|
|
154
|
+
* Recording is already in WAV format (LINEARPCM)
|
|
155
|
+
* WAV has universal MIME type recognition: audio/wav
|
|
156
|
+
*/
|
|
157
|
+
const formData = new FormData();
|
|
158
|
+
formData.append('file', {
|
|
159
|
+
uri,
|
|
160
|
+
type: 'audio/wav',
|
|
161
|
+
name: 'recording.wav'
|
|
162
|
+
});
|
|
163
|
+
const result = await (0, _apiClient.apiClient)(transcribeEndpoint, {
|
|
164
|
+
method: 'POST',
|
|
165
|
+
headers: await (0, _resolveApiHeaders.resolveAPIHeaders)(transcribeHeaders),
|
|
166
|
+
body: formData,
|
|
167
|
+
isFormData: true
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// API returns: { success: true, data: { transcription: { text: "..." } } }
|
|
171
|
+
const text = result.data?.transcription?.text || result.data?.text || result.text || result.transcription?.text || result.transcription || '';
|
|
172
|
+
setTranscribedText(text);
|
|
173
|
+
onTranscription?.(text);
|
|
174
|
+
return text;
|
|
175
|
+
} catch (err) {
|
|
176
|
+
const transcribeError = err instanceof Error ? err : new Error('Transcription failed');
|
|
177
|
+
setError(transcribeError);
|
|
178
|
+
onError?.(transcribeError);
|
|
179
|
+
return null;
|
|
180
|
+
} finally {
|
|
181
|
+
setIsTranscribing(false);
|
|
182
|
+
}
|
|
183
|
+
}, [transcribeEndpoint, transcribeHeaders, onTranscription, onError]);
|
|
184
|
+
const stopAndTranscribe = (0, _react.useCallback)(async () => {
|
|
185
|
+
const uri = await stopRecording();
|
|
186
|
+
if (uri && transcribeEndpoint) {
|
|
187
|
+
return transcribe(uri);
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}, [stopRecording, transcribe, transcribeEndpoint]);
|
|
191
|
+
const reset = (0, _react.useCallback)(() => {
|
|
192
|
+
setStatus('idle');
|
|
193
|
+
setRecordingUri(null);
|
|
194
|
+
setTranscribedText(null);
|
|
195
|
+
setIsTranscribing(false);
|
|
196
|
+
setError(null);
|
|
197
|
+
startTimeRef.current = null;
|
|
198
|
+
}, []);
|
|
199
|
+
|
|
200
|
+
// Calculate duration from recorder state
|
|
201
|
+
const duration = recorderState.isRecording ? Math.floor((Date.now() - (startTimeRef.current || Date.now())) / 1000) : 0;
|
|
202
|
+
return {
|
|
203
|
+
status,
|
|
204
|
+
isRecording: recorderState.isRecording,
|
|
205
|
+
duration,
|
|
206
|
+
recordingUri,
|
|
207
|
+
transcribedText,
|
|
208
|
+
isTranscribing,
|
|
209
|
+
startRecording,
|
|
210
|
+
stopRecording,
|
|
211
|
+
stopAndTranscribe,
|
|
212
|
+
transcribe,
|
|
213
|
+
reset,
|
|
214
|
+
error
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=use-voice-recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_expoAudio","_apiClient","_resolveApiHeaders","TRANSCRIPTION_PRESET","extension","sampleRate","numberOfChannels","bitRate","android","outputFormat","audioEncoder","ios","IOSOutputFormat","LINEARPCM","audioQuality","AudioQuality","HIGH","linearPCMBitDepth","linearPCMIsBigEndian","linearPCMIsFloat","web","mimeType","bitsPerSecond","useVoiceRecorder","options","transcribeEndpoint","transcribeHeaders","onRecordingStart","onRecordingStop","onTranscription","onError","status","setStatus","useState","recordingUri","setRecordingUri","transcribedText","setTranscribedText","isTranscribing","setIsTranscribing","error","setError","permissionGranted","setPermissionGranted","audioRecorder","useAudioRecorder","recorderState","useAudioRecorderState","startTimeRef","useRef","ensureRecordingPermission","useCallback","result","AudioModule","requestRecordingPermissionsAsync","granted","permissionError","Error","setAudioModeAsync","playsInSilentMode","allowsRecording","err","recordError","startRecording","hasPermission","prepareToRecordAsync","record","current","Date","now","stopRecording","stop","uri","transcribe","formData","FormData","append","type","name","apiClient","method","headers","resolveAPIHeaders","body","isFormData","text","data","transcription","transcribeError","stopAndTranscribe","reset","duration","isRecording","Math","floor"],"sourceRoot":"../../../src","sources":["hooks/use-voice-recorder.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,UAAA,GAAAD,OAAA;AAWA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAEA;AACA;AACA;AACA;AACA,MAAMI,oBAAsC,GAAG;EA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,iBAAiB;IACjBhB,UAAU;IACViB,KAAK;IACLlD;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
DocyrusRNAssistant: true,
|
|
8
|
+
DocyrusRNAssistantEmbedded: true,
|
|
9
|
+
DocyrusRNAssistantModal: true,
|
|
10
|
+
DocyrusRNAssistantSheet: true,
|
|
11
|
+
createDocyrusAPIConfig: true,
|
|
12
|
+
createDocyrusRNAssistantConfig: true
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "DocyrusRNAssistant", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return _index2.DocyrusRNAssistant;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "DocyrusRNAssistantEmbedded", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _index2.DocyrusRNAssistantEmbedded;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "DocyrusRNAssistantModal", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return _index2.DocyrusRNAssistantModal;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "DocyrusRNAssistantSheet", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _index2.DocyrusRNAssistantSheet;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "createDocyrusAPIConfig", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _defaultApiConfig.createDocyrusAPIConfig;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "createDocyrusRNAssistantConfig", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _defaultApiConfig.createDocyrusRNAssistantConfig;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var _index = require("./components/index.js");
|
|
51
|
+
Object.keys(_index).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
54
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
55
|
+
Object.defineProperty(exports, key, {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return _index[key];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
var _index2 = require("./components/assistant-screen/index.js");
|
|
63
|
+
var _index3 = require("./hooks/index.js");
|
|
64
|
+
Object.keys(_index3).forEach(function (key) {
|
|
65
|
+
if (key === "default" || key === "__esModule") return;
|
|
66
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
67
|
+
if (key in exports && exports[key] === _index3[key]) return;
|
|
68
|
+
Object.defineProperty(exports, key, {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return _index3[key];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
var _index4 = require("./theme/index.js");
|
|
76
|
+
Object.keys(_index4).forEach(function (key) {
|
|
77
|
+
if (key === "default" || key === "__esModule") return;
|
|
78
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
79
|
+
if (key in exports && exports[key] === _index4[key]) return;
|
|
80
|
+
Object.defineProperty(exports, key, {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () {
|
|
83
|
+
return _index4[key];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
var _index5 = require("./utils/index.js");
|
|
88
|
+
Object.keys(_index5).forEach(function (key) {
|
|
89
|
+
if (key === "default" || key === "__esModule") return;
|
|
90
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
91
|
+
if (key in exports && exports[key] === _index5[key]) return;
|
|
92
|
+
Object.defineProperty(exports, key, {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () {
|
|
95
|
+
return _index5[key];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
var _defaultApiConfig = require("./utils/default-api-config.js");
|
|
100
|
+
var _index6 = require("./types/index.js");
|
|
101
|
+
Object.keys(_index6).forEach(function (key) {
|
|
102
|
+
if (key === "default" || key === "__esModule") return;
|
|
103
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
104
|
+
if (key in exports && exports[key] === _index6[key]) return;
|
|
105
|
+
Object.defineProperty(exports, key, {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () {
|
|
108
|
+
return _index6[key];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_index","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index2","_index3","_index4","_index5","_defaultApiConfig","_index6"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CA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