├── .eslintrc.yaml
├── .github
└── workflows
│ ├── publish.yaml
│ └── tests.yaml
├── .gitignore
├── .gitmodules
├── .pre-commit-config.yaml
├── .vscode
└── extensions.json
├── Dockerfile
├── LICENSE
├── LICENSE.GPL-3.0
├── LICENSE.rtf
├── Makefile
├── README.md
├── RELEASE.md
├── package.json
├── src-svelte
├── .eslintrc.yaml
├── .gitignore
├── .prettierrc
├── .storybook
│ ├── main.ts
│ └── preview.ts
├── Makefile
├── diff-screenshots.py
├── package.json
├── retina-proportions.py
├── screenshots
│ ├── .gitignore
│ └── baseline
│ │ ├── layout
│ │ ├── app
│ │ │ └── static.png
│ │ ├── background
│ │ │ ├── static-variant-1.png
│ │ │ └── static.png
│ │ ├── sidebar
│ │ │ ├── credits-selected.png
│ │ │ ├── dashboard-selected.png
│ │ │ └── settings-selected.png
│ │ └── snackbar
│ │ │ └── message
│ │ │ ├── error-variant-1.png
│ │ │ ├── error.png
│ │ │ ├── info-variant-1.png
│ │ │ └── info.png
│ │ ├── reusable
│ │ ├── button
│ │ │ ├── disabled.png
│ │ │ ├── group
│ │ │ │ ├── narrow.png
│ │ │ │ └── wide.png
│ │ │ └── regular.png
│ │ ├── external-link
│ │ │ └── external-link.png
│ │ ├── infobox
│ │ │ ├── regular.png
│ │ │ └── transparent.png
│ │ ├── scrollable
│ │ │ ├── fixed
│ │ │ │ ├── bottom.png
│ │ │ │ └── top.png
│ │ │ └── growable
│ │ │ │ ├── large-variant-1.png
│ │ │ │ ├── large.png
│ │ │ │ ├── small-variant-1.png
│ │ │ │ └── small.png
│ │ ├── slider
│ │ │ ├── tablet.png
│ │ │ ├── tiny-phone-screen-with-long-label.png
│ │ │ └── tiny-phone-screen.png
│ │ ├── switch
│ │ │ ├── off.png
│ │ │ └── on.png
│ │ └── warning
│ │ │ ├── long.png
│ │ │ └── short.png
│ │ └── screens
│ │ ├── chat
│ │ ├── conversation
│ │ │ ├── bottom-scroll-indicator.png
│ │ │ ├── empty.png
│ │ │ ├── extra-long-input.png
│ │ │ ├── full-message-width.png
│ │ │ ├── multiline-chat.png
│ │ │ ├── new-message-sent.png
│ │ │ ├── not-empty.png
│ │ │ └── typing-indicator-static.png
│ │ └── message
│ │ │ ├── ai-code.png
│ │ │ ├── ai-multiline.png
│ │ │ ├── ai.png
│ │ │ ├── highlighted-ai-code.png
│ │ │ ├── highlighted-human-code.png
│ │ │ ├── human-code.png
│ │ │ ├── human.png
│ │ │ └── mixed-khmer-and-english.png
│ │ ├── credits
│ │ └── creditor
│ │ │ ├── dependency-with-icon.png
│ │ │ ├── github-contributor.png
│ │ │ ├── regular.png
│ │ │ └── typodermic-font.png
│ │ ├── dashboard
│ │ ├── api-keys-display
│ │ │ ├── editing-pre-filled.png
│ │ │ ├── editing.png
│ │ │ ├── known.png
│ │ │ ├── loading.png
│ │ │ └── unknown.png
│ │ └── metadata
│ │ │ ├── loaded.png
│ │ │ └── loading.png
│ │ ├── database
│ │ ├── list
│ │ │ ├── empty.png
│ │ │ ├── full-variant-1.png
│ │ │ ├── full.png
│ │ │ └── small.png
│ │ ├── llm-call
│ │ │ ├── actions
│ │ │ │ └── wide.png
│ │ │ ├── import
│ │ │ │ └── static.png
│ │ │ ├── khmer.png
│ │ │ ├── lots-of-code.png
│ │ │ ├── narrow.png
│ │ │ ├── new
│ │ │ │ ├── blank-variant-1.png
│ │ │ │ ├── blank.png
│ │ │ │ ├── busy-variant-1.png
│ │ │ │ ├── busy.png
│ │ │ │ ├── edit-continued-conversation-variant-1.png
│ │ │ │ ├── edit-continued-conversation.png
│ │ │ │ ├── with-emoji-variant-1.png
│ │ │ │ ├── with-emoji-variant-2.png
│ │ │ │ └── with-emoji.png
│ │ │ ├── unknown-provider-prompt.png
│ │ │ ├── variant.png
│ │ │ └── wide.png
│ │ └── terminal-session
│ │ │ ├── finished.png
│ │ │ ├── in-progress.png
│ │ │ └── new.png
│ │ └── settings
│ │ ├── large-phone-screen.png
│ │ ├── tablet.png
│ │ └── tiny-phone-screen.png
├── src
│ ├── app.d.ts
│ ├── app.html
│ ├── lib
│ │ ├── ApiCallReference.svelte
│ │ ├── ApiCallReferenceLink.svelte
│ │ ├── EmptyPlaceholder.svelte
│ │ ├── Explanation.svelte
│ │ ├── ExternalLink.stories.ts
│ │ ├── ExternalLinkView.svelte
│ │ ├── FixedScrollable.stories.ts
│ │ ├── FixedScrollable.svelte
│ │ ├── FixedScrollableView.svelte
│ │ ├── InfoBox.stories.ts
│ │ ├── InfoBox.svelte
│ │ ├── InfoBox.test.ts
│ │ ├── InfoBoxView.svelte
│ │ ├── Loading.svelte
│ │ ├── RoundDef.svelte
│ │ ├── Scrollable.stories.ts
│ │ ├── Scrollable.svelte
│ │ ├── ScrollableView.svelte
│ │ ├── Slider.playwright.test.ts
│ │ ├── Slider.stories.ts
│ │ ├── Slider.svelte
│ │ ├── SubInfoBox.svelte
│ │ ├── Switch.playwright.test.ts
│ │ ├── Switch.stories.ts
│ │ ├── Switch.svelte
│ │ ├── Switch.test.ts
│ │ ├── Table.svelte
│ │ ├── Warning.stories.ts
│ │ ├── Warning.svelte
│ │ ├── WarningView.svelte
│ │ ├── __mocks__
│ │ │ ├── MockAppLayout.svelte
│ │ │ ├── MockFullPageLayout.svelte
│ │ │ ├── MockPageTransitions.svelte
│ │ │ ├── MockRemount.svelte
│ │ │ ├── MockTransitions.svelte
│ │ │ ├── invoke.ts
│ │ │ └── stores.ts
│ │ ├── additionalTypes.ts
│ │ ├── animation-timing.test.ts
│ │ ├── animation-timing.ts
│ │ ├── autoupdate.ts
│ │ ├── bindings.ts
│ │ ├── controls
│ │ │ ├── Button.stories.ts
│ │ │ ├── Button.svelte
│ │ │ ├── ButtonGroup.stories.ts
│ │ │ ├── ButtonGroup.svelte
│ │ │ ├── ButtonGroupView.svelte
│ │ │ ├── ButtonView.svelte
│ │ │ ├── Select.svelte
│ │ │ ├── SendInputForm.svelte
│ │ │ └── TextInput.svelte
│ │ ├── firstPageLoad.ts
│ │ ├── label-id.ts
│ │ ├── preferences.ts
│ │ ├── sample-call-testing.test.ts
│ │ ├── sample-call-testing.ts
│ │ ├── sample-call.ts
│ │ ├── snackbar
│ │ │ ├── Message.stories.ts
│ │ │ ├── Message.svelte
│ │ │ ├── Snackbar.stories.ts
│ │ │ ├── Snackbar.svelte
│ │ │ ├── Snackbar.test.ts
│ │ │ └── SnackbarView.svelte
│ │ ├── sound.ts
│ │ ├── system-info.ts
│ │ ├── tauri.ts
│ │ └── test-helpers.ts
│ ├── routes
│ │ ├── +layout.svelte
│ │ ├── +layout.ts
│ │ ├── +page.svelte
│ │ ├── AnimationControl.svelte
│ │ ├── AnimationControl.test.ts
│ │ ├── AppLayout.stories.ts
│ │ ├── AppLayout.svelte
│ │ ├── AppLayout.test.ts
│ │ ├── Background.svelte
│ │ ├── BackgroundUI.stories.ts
│ │ ├── BackgroundUI.svelte
│ │ ├── BackgroundUI.test.ts
│ │ ├── BackgroundUIView.svelte
│ │ ├── Dashboard.stories.ts
│ │ ├── Dashboard.svelte
│ │ ├── PageTransition.stories.ts
│ │ ├── PageTransition.svelte
│ │ ├── PageTransition.test.ts
│ │ ├── PageTransitionControl.svelte
│ │ ├── PageTransitionView.svelte
│ │ ├── Sidebar.svelte
│ │ ├── SidebarUI.stories.ts
│ │ ├── SidebarUI.svelte
│ │ ├── SidebarUI.test.ts
│ │ ├── chat
│ │ │ ├── +page.svelte
│ │ │ ├── Chat.mock-data.ts
│ │ │ ├── Chat.reveal.stories.ts
│ │ │ ├── Chat.stories.ts
│ │ │ ├── Chat.svelte
│ │ │ ├── Chat.test.ts
│ │ │ ├── CodeRender.svelte
│ │ │ ├── Message.stories.ts
│ │ │ ├── Message.svelte
│ │ │ ├── Message.test.ts
│ │ │ ├── MessageUI.svelte
│ │ │ ├── MessageUI.test.ts
│ │ │ ├── PersistentChatView.stories.ts
│ │ │ ├── PersistentChatView.svelte
│ │ │ └── TypingIndicator.svelte
│ │ ├── components
│ │ │ ├── Metadata.stories.ts
│ │ │ ├── Metadata.svelte
│ │ │ ├── Metadata.test.ts
│ │ │ └── api-keys
│ │ │ │ ├── Display.stories.ts
│ │ │ │ ├── Display.svelte
│ │ │ │ ├── Display.test.ts
│ │ │ │ ├── Form.svelte
│ │ │ │ └── Service.svelte
│ │ ├── credits
│ │ │ ├── +page.svelte
│ │ │ ├── Creditor.stories.ts
│ │ │ ├── Creditor.svelte
│ │ │ ├── Creditor.test.ts
│ │ │ ├── Credits.stories.ts
│ │ │ ├── Credits.svelte
│ │ │ ├── GitHubIcon.svelte
│ │ │ ├── Grid.svelte
│ │ │ └── TypodermicIcon.svelte
│ │ ├── database
│ │ │ ├── +page.svelte
│ │ │ ├── DatabaseView.full-page.stories.ts
│ │ │ ├── DatabaseView.playwright.test.ts
│ │ │ ├── DatabaseView.stories.ts
│ │ │ ├── DatabaseView.svelte
│ │ │ ├── DatabaseView.test.ts
│ │ │ ├── api-calls
│ │ │ │ ├── ApiCallBlurb.svelte
│ │ │ │ ├── ApiCallsTable.svelte
│ │ │ │ ├── [slug]
│ │ │ │ │ ├── +page.svelte
│ │ │ │ │ ├── Actions.stories.ts
│ │ │ │ │ ├── Actions.svelte
│ │ │ │ │ ├── ApiCall.stories.ts
│ │ │ │ │ ├── ApiCall.svelte
│ │ │ │ │ ├── ApiCallDisplay.svelte
│ │ │ │ │ ├── Prompt.stories.ts
│ │ │ │ │ ├── Prompt.svelte
│ │ │ │ │ ├── UnloadedApiCall.stories.ts
│ │ │ │ │ ├── UnloadedApiCall.svelte
│ │ │ │ │ ├── UnloadedApiCall.test.ts
│ │ │ │ │ └── sample-calls.ts
│ │ │ │ └── new
│ │ │ │ │ ├── +page.svelte
│ │ │ │ │ ├── ApiCallEditor.stories.ts
│ │ │ │ │ ├── ApiCallEditor.svelte
│ │ │ │ │ ├── ApiCallEditor.test.ts
│ │ │ │ │ ├── PersistentApiCallEditor.stories.ts
│ │ │ │ │ ├── PersistentApiCallEditorView.svelte
│ │ │ │ │ ├── import
│ │ │ │ │ ├── +page.svelte
│ │ │ │ │ ├── ApiCallImport.stories.ts
│ │ │ │ │ ├── ApiCallImport.svelte
│ │ │ │ │ └── ApiCallImport.test.ts
│ │ │ │ │ └── test.data.ts
│ │ │ └── terminal-sessions
│ │ │ │ ├── TerminalSession.stories.ts
│ │ │ │ ├── TerminalSession.svelte
│ │ │ │ ├── TerminalSession.test.ts
│ │ │ │ ├── TerminalSessionBlurb.svelte
│ │ │ │ ├── TerminalSessionsTable.svelte
│ │ │ │ ├── UnloadedTerminalSession.stories.ts
│ │ │ │ ├── UnloadedTerminalSession.svelte
│ │ │ │ ├── UnloadedTerminalSession.test.ts
│ │ │ │ ├── [slug]
│ │ │ │ └── +page.svelte
│ │ │ │ └── new
│ │ │ │ └── +page.svelte
│ │ ├── settings
│ │ │ ├── +page.svelte
│ │ │ ├── Database.svelte
│ │ │ ├── Database.test.ts
│ │ │ ├── Page.svelte
│ │ │ ├── Settings.stories.ts
│ │ │ ├── Settings.svelte
│ │ │ ├── Settings.test.ts
│ │ │ ├── SettingsSlider.svelte
│ │ │ ├── SettingsSwitch.svelte
│ │ │ └── SettingsSwitch.test.ts
│ │ ├── storybook.test.ts
│ │ └── styles.css
│ ├── testSetup.ts
│ ├── vite-env.d.ts
│ └── vitest-mocks
│ │ ├── navigation.ts
│ │ └── stores.ts
├── static
│ ├── favicon.png
│ ├── logo.png
│ ├── logos
│ │ ├── amos-ng.jpg
│ │ ├── async-openai.png
│ │ ├── diesel.png
│ │ ├── docker.svg
│ │ ├── element-plus.png
│ │ ├── font-awesome.svg
│ │ ├── google.svg
│ │ ├── gravity-ui.png
│ │ ├── iconify.png
│ │ ├── jest-image-snapshot.png
│ │ ├── mingcute.svg
│ │ ├── neodrag.svg
│ │ ├── phosphor-icons.svg
│ │ ├── pixabay.jpeg
│ │ ├── playwright.svg
│ │ ├── pre-commit.svg
│ │ ├── quicktype.png
│ │ ├── soundreality.png
│ │ ├── specta.png
│ │ ├── storybook.svg
│ │ ├── streamline.svg
│ │ ├── svelte.svg
│ │ ├── tabler.svg
│ │ ├── tauri.png
│ │ ├── typodermic.png
│ │ ├── unplugin.svg
│ │ ├── vaadin.svg
│ │ ├── vite.svg
│ │ ├── vitest.svg
│ │ └── webdriverio.svg
│ ├── public-fonts
│ │ └── zhi-mang-xing.ttf
│ └── robots.txt
├── svelte.config.js
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── vitest.config.ts
├── src-tauri
├── .gitignore
├── .rustfmt.toml
├── Cargo.lock
├── Cargo.toml
├── Makefile
├── api
│ ├── sample-call-schema.json
│ ├── sample-calls
│ │ ├── chat-continue-conversation.yaml
│ │ ├── chat-edit-conversation.yaml
│ │ ├── chat-fork-conversation-python.yaml
│ │ ├── chat-fork-conversation-rust.yaml
│ │ ├── chat-manual-conversation-recreation.yaml
│ │ ├── chat-re-edit-conversation.yaml
│ │ ├── chat-start-conversation-ollama.yaml
│ │ ├── chat-start-conversation.yaml
│ │ ├── export_db-api-key.yaml
│ │ ├── export_db-conversations.yaml
│ │ ├── export_db-terminal-sessions.yaml
│ │ ├── get_api_call-continue-conversation.yaml
│ │ ├── get_api_call-edit.yaml
│ │ ├── get_api_call-no-links.yaml
│ │ ├── get_api_call-ollama.yaml
│ │ ├── get_api_call-start-conversation.yaml
│ │ ├── get_api_call-unknown-provider-prompt.yaml
│ │ ├── get_api_calls-empty.yaml
│ │ ├── get_api_calls-full.yaml
│ │ ├── get_api_calls-offset-empty.yaml
│ │ ├── get_api_calls-offset.yaml
│ │ ├── get_api_calls-small.yaml
│ │ ├── get_api_calls-unknown-provider-prompt.yaml
│ │ ├── get_api_keys-empty.yaml
│ │ ├── get_api_keys-openai.yaml
│ │ ├── get_preferences-animation-speed-override.yaml
│ │ ├── get_preferences-animations-override.yaml
│ │ ├── get_preferences-extra-settings.yaml
│ │ ├── get_preferences-high-dpi-adjust-on.yaml
│ │ ├── get_preferences-no-file-mac.yaml
│ │ ├── get_preferences-no-file-windows.yaml
│ │ ├── get_preferences-no-file.yaml
│ │ ├── get_preferences-sound-override.yaml
│ │ ├── get_preferences-transparency-off.yaml
│ │ ├── get_preferences-transparency-on.yaml
│ │ ├── get_preferences-volume-override.yaml
│ │ ├── get_system_info-linux.yaml
│ │ ├── get_terminal_session-bash-interleaved.yaml
│ │ ├── get_terminal_session-bash.yaml
│ │ ├── get_terminal_sessions-empty.yaml
│ │ ├── get_terminal_sessions-small.yaml
│ │ ├── import_db-api-key.yaml
│ │ ├── import_db-conflicting-api-key.yaml
│ │ ├── import_db-conflicting-llm-call.yaml
│ │ ├── import_db-initially-empty.yaml
│ │ ├── import_db-terminal-sessions.yaml
│ │ ├── import_db-unknown-provider-prompt.yaml
│ │ ├── import_db-unknown-provider.yaml
│ │ ├── play_sound-switch.yaml
│ │ ├── play_sound-whoosh.yaml
│ │ ├── run_command-bash.yaml
│ │ ├── run_command-cmd.yaml
│ │ ├── run_command-date.yaml
│ │ ├── send_command_input-bash-interleaved.yaml
│ │ ├── send_command_input-cmd-dir.yaml
│ │ ├── set_api_key-different.yaml
│ │ ├── set_api_key-empty-filename.yaml
│ │ ├── set_api_key-existing-no-newline.yaml
│ │ ├── set_api_key-existing-with-newline.yaml
│ │ ├── set_api_key-invalid-filename.yaml
│ │ ├── set_api_key-nested-folder.yaml
│ │ ├── set_api_key-no-disk-write.yaml
│ │ ├── set_api_key-no-file.yaml
│ │ ├── set_api_key-unset.yaml
│ │ ├── set_preferences-high-dpi-adjust-off.yaml
│ │ ├── set_preferences-high-dpi-adjust-on.yaml
│ │ ├── set_preferences-sound-off.yaml
│ │ ├── set_preferences-sound-on.yaml
│ │ ├── set_preferences-transparency-off.yaml
│ │ ├── set_preferences-transparency-on.yaml
│ │ ├── set_preferences-volume-partial.yaml
│ │ ├── upgrade-first-init.yaml
│ │ ├── upgrade-from-future-version.yaml
│ │ └── upgrade-to-v0.1.4.yaml
│ ├── sample-database-writes
│ │ ├── command-run-bash-interleaved
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── command-run-bash
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── command-run-cmd-dir
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── command-run-cmd
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── command-run-date
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-continued
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-edited-2
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-edited
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-forked-step-1
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-forked-step-2
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-manually-recreated
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-started-ollama
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── conversation-started
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── different-openai-api-key
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── empty
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── many-api-calls
│ │ │ ├── dump.sql
│ │ │ ├── dump.yaml
│ │ │ └── generate.py
│ │ ├── openai-api-key
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── sample-v0.1.3-db
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── sample-v0.1.4-db
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── unknown-provider-import
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ ├── unknown-provider-prompt-export
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ │ └── unknown-provider-prompt
│ │ │ ├── dump.sql
│ │ │ └── dump.yaml
│ ├── sample-disk-writes
│ │ ├── db-import-export
│ │ │ ├── conflicting-llm-call
│ │ │ │ └── conflicting-db.yaml
│ │ │ ├── conversation-edited-2
│ │ │ │ └── test-folder
│ │ │ │ │ └── exported-db.yaml
│ │ │ ├── different-api-key
│ │ │ │ └── different.zamm.yaml
│ │ │ ├── forward-compatibility
│ │ │ │ ├── unknown-provider-prompt.zamm.yaml
│ │ │ │ └── unknown-provider.zamm.yaml
│ │ │ └── terminal-sessions
│ │ │ │ └── exported-db.yaml
│ │ ├── empty
│ │ │ └── .gitkeep
│ │ ├── preferences
│ │ │ ├── future-version
│ │ │ │ └── preferences.toml
│ │ │ ├── high-dpi-adjust-off
│ │ │ │ └── preferences.toml
│ │ │ ├── high-dpi-adjust-on
│ │ │ │ └── preferences.toml
│ │ │ ├── sound-off-extra-settings
│ │ │ │ └── preferences.toml
│ │ │ ├── sound-on-extra-settings
│ │ │ │ └── preferences.toml
│ │ │ ├── sound-override
│ │ │ │ └── preferences.toml
│ │ │ ├── transparency-off
│ │ │ │ └── preferences.toml
│ │ │ ├── transparency-on
│ │ │ │ └── preferences.toml
│ │ │ ├── v0.1.3
│ │ │ │ └── preferences.toml
│ │ │ ├── version-init
│ │ │ │ └── preferences.toml
│ │ │ ├── version-update
│ │ │ │ └── preferences.toml
│ │ │ └── volume-override
│ │ │ │ └── preferences.toml
│ │ └── shell-init
│ │ │ ├── different
│ │ │ └── .bashrc
│ │ │ ├── nested
│ │ │ ├── end
│ │ │ │ └── folder
│ │ │ │ │ └── .bashrc
│ │ │ └── start
│ │ │ │ └── folder
│ │ │ │ └── .bashrc
│ │ │ ├── new-file
│ │ │ └── .bashrc
│ │ │ ├── no-newline
│ │ │ ├── end
│ │ │ │ └── .bashrc
│ │ │ └── start
│ │ │ │ └── .bashrc
│ │ │ └── with-newline
│ │ │ ├── end
│ │ │ └── .bashrc
│ │ │ └── start
│ │ │ └── .bashrc
│ ├── sample-network-requests
│ │ ├── continue-conversation.json
│ │ ├── edit-conversation.json
│ │ ├── fork-conversation-python.json
│ │ ├── fork-conversation-rust.json
│ │ ├── re-edit-conversation.json
│ │ ├── start-conversation-ollama.json
│ │ └── start-conversation.json
│ └── sample-terminal-sessions
│ │ ├── bash.cast
│ │ ├── date.cast
│ │ ├── interleaved.py
│ │ ├── pause.cast
│ │ ├── pause.py
│ │ └── windows.cast
├── binaries
│ └── .gitignore
├── build.rs
├── capabilities
│ └── migrated.json
├── clippy.py
├── diesel.toml
├── icons
│ ├── 128x128.png
│ ├── 128x128@2x.png
│ ├── 32x32.png
│ ├── Square107x107Logo.png
│ ├── Square142x142Logo.png
│ ├── Square150x150Logo.png
│ ├── Square284x284Logo.png
│ ├── Square30x30Logo.png
│ ├── Square310x310Logo.png
│ ├── Square44x44Logo.png
│ ├── Square71x71Logo.png
│ ├── Square89x89Logo.png
│ ├── StoreLogo.png
│ ├── icon.icns
│ ├── icon.ico
│ ├── icon.png
│ └── icon.xcf
├── migrations
│ ├── .keep
│ ├── 2024-01-07-035038_create_api_keys
│ │ ├── down.sql
│ │ └── up.sql
│ ├── 2024-01-13-023144_create_llm_calls
│ │ ├── down.sql
│ │ └── up.sql
│ ├── 2024-05-13-135101_add_api_call_follow_ups
│ │ ├── down.sql
│ │ └── up.sql
│ ├── 2024-05-29-071520_ordered_names
│ │ ├── down.sql
│ │ └── up.sql
│ ├── 2024-05-29-183428_variant_links
│ │ ├── down.sql
│ │ └── up.sql
│ └── 2024-06-27-125941_add_asciicasts
│ │ ├── down.sql
│ │ └── up.sql
├── sounds
│ ├── switch.ogg
│ └── whoosh.ogg
├── src
│ ├── cli.rs
│ ├── commands
│ │ ├── database
│ │ │ ├── export.rs
│ │ │ ├── import.rs
│ │ │ ├── metadata.rs
│ │ │ └── mod.rs
│ │ ├── errors
│ │ │ ├── error.rs
│ │ │ ├── import.rs
│ │ │ ├── mod.rs
│ │ │ ├── rodio.rs
│ │ │ └── serde.rs
│ │ ├── keys
│ │ │ ├── get.rs
│ │ │ ├── mod.rs
│ │ │ └── set.rs
│ │ ├── llms
│ │ │ ├── chat.rs
│ │ │ ├── get_api_call.rs
│ │ │ ├── get_api_calls.rs
│ │ │ └── mod.rs
│ │ ├── mod.rs
│ │ ├── preferences
│ │ │ ├── mod.rs
│ │ │ ├── models.rs
│ │ │ ├── read.rs
│ │ │ └── write.rs
│ │ ├── sounds.rs
│ │ ├── system.rs
│ │ └── terminal
│ │ │ ├── get_session.rs
│ │ │ ├── get_sessions.rs
│ │ │ ├── mod.rs
│ │ │ ├── models.rs
│ │ │ ├── parse.rs
│ │ │ ├── run.rs
│ │ │ └── send_input.rs
│ ├── main.rs
│ ├── models
│ │ ├── api_keys.rs
│ │ ├── asciicasts.rs
│ │ ├── database_contents.rs
│ │ ├── llm_calls
│ │ │ ├── chat_message.rs
│ │ │ ├── entity_id.rs
│ │ │ ├── lightweight_llm_call.rs
│ │ │ ├── linkage.rs
│ │ │ ├── llm_call.rs
│ │ │ ├── mod.rs
│ │ │ ├── prompt.rs
│ │ │ ├── row.rs
│ │ │ └── various.rs
│ │ ├── mod.rs
│ │ ├── os.rs
│ │ └── shell.rs
│ ├── python_api.rs
│ ├── sample_call.rs
│ ├── schema.rs
│ ├── setup
│ │ ├── api_keys.rs
│ │ ├── db.rs
│ │ └── mod.rs
│ ├── test_helpers
│ │ ├── api_testing.rs
│ │ ├── database.rs
│ │ ├── mod.rs
│ │ ├── sqlite.rs
│ │ ├── temp_files.rs
│ │ └── terminal.rs
│ ├── upgrades.rs
│ └── views.rs
└── tauri.conf.json
├── tmux.sh
├── webdriver
├── .eslintrc.yaml
├── .prettierrc
├── package.json
├── screenshots
│ ├── .gitignore
│ └── baseline
│ │ └── desktop_wry
│ │ ├── api-call-individual.png
│ │ ├── api-calls-populated.png
│ │ ├── api-calls.png
│ │ ├── chat-screen.png
│ │ ├── credits-screen.png
│ │ ├── import-api-call.png
│ │ ├── new-api-call.png
│ │ ├── new-terminal-session.png
│ │ ├── running-terminal-session.png
│ │ ├── settings-screen.png
│ │ ├── terminal-sessions.png
│ │ └── welcome-screen.png
├── test
│ └── specs
│ │ └── e2e.test.js
├── tsconfig.json
├── wdio.conf.ts
├── yarn.lock
└── zamm.bashrc
└── yarn.lock
/.eslintrc.yaml:
--------------------------------------------------------------------------------
1 | # https://github.com/janosh/awesome-sveltekit/blob/main/site/.eslintrc.yml
2 | env:
3 | browser: true
4 | node: true
5 | extends:
6 | - prettier
7 | - eslint:recommended
8 | - plugin:@typescript-eslint/recommended
9 | rules:
10 | max-len:
11 | - error
12 | - code: 88
13 | "@typescript-eslint/ban-ts-comment": off
14 | "@typescript-eslint/no-explicit-any": off
15 | "@typescript-eslint/no-unused-vars":
16 | [error, { argsIgnorePattern: ^_, varsIgnorePattern: ^_ }]
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 | .pnpm-store
15 |
16 | # Editor directories and files
17 | .vscode/*
18 | !.vscode/extensions.json
19 | .idea
20 | .DS_Store
21 | *.suo
22 | *.ntvs*
23 | *.njsproj
24 | *.sln
25 | *.sw?
26 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "src-svelte/static/fonts"]
2 | path = src-svelte/static/fonts
3 | url = https://github.com/amosjyng/zamm-fonts.git
4 | [submodule "forks/neodrag"]
5 | path = forks/neodrag
6 | url = https://github.com/amosjyng/neodrag.git
7 | [submodule "forks/async-openai"]
8 | path = forks/async-openai
9 | url = https://github.com/amosjyng/async-openai.git
10 | [submodule "forks/rvcr"]
11 | path = forks/rvcr
12 | url = https://github.com/amosjyng/rvcr.git
13 | [submodule "forks/ollama-rs"]
14 | path = forks/ollama-rs
15 | url = https://github.com/zamm-dev/ollama-rs.git
16 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "svelte.svelte-vscode",
4 | "tauri-apps.tauri-vscode",
5 | "rust-lang.rust-analyzer",
6 | "ZixuanChen.vitest-explorer",
7 | "ms-vscode.makefile-tools",
8 | "ms-azuretools.vscode-docker"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ZAMM
2 |
3 | 
4 |
5 | This is an incomplete, experimental AI chat app.
6 |
7 | You can learn more about it on [the website](http://zamm.dev).
8 |
9 | ## Development
10 |
11 | The most up-to-date dependencies and their versions can be seen at [`.github/workflows/tests.yaml`](/.github/workflows/tests.yaml). You can either build the project by running `make` or looking at the [Makefile](/Makefile) to see the steps needed to build the project.
12 |
13 | To set a custom directory for Storybook tests (because the screenshots differ slightly on different machines), you can set
14 |
15 | ```bash
16 | export SCREENSHOTS_BASE_DIR=screenshots/local
17 | ```
18 |
19 | If tests are timing out, you may also want to set
20 |
21 | ```bash
22 | export PLAYWRIGHT_TIMEOUT=20000
23 | ```
24 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "zamm",
3 | "private": true,
4 | "version": "0.0.0",
5 | "type": "module",
6 | "scripts": {
7 | "tauri": "tauri",
8 | "e2e-test": "cd webdriver && yarn test"
9 | },
10 | "workspaces": [
11 | "src-svelte",
12 | "webdriver"
13 | ],
14 | "devDependencies": {
15 | "@tauri-apps/cli": "^2.0.4",
16 | "@typescript-eslint/eslint-plugin": "^5.52.0",
17 | "@typescript-eslint/parser": "^6.3.0",
18 | "eslint": "^8.0.1",
19 | "eslint-config-prettier": "^9.0.0",
20 | "eslint-config-standard-with-typescript": "^37.0.0",
21 | "eslint-plugin-import": "^2.25.2",
22 | "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
23 | "eslint-plugin-promise": "^6.0.0",
24 | "prettier": "^3.2.5",
25 | "tslib": "^2.6.0",
26 | "typescript": "*"
27 | },
28 | "optionalDependencies": {
29 | "quicktype": "^23.0.71"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src-svelte/.eslintrc.yaml:
--------------------------------------------------------------------------------
1 | # https://github.com/janosh/awesome-sveltekit/blob/main/site/.eslintrc.yml
2 | extends:
3 | - plugin:svelte/recommended
4 | overrides:
5 | - files: ["*.svelte"]
6 | parser: svelte-eslint-parser
7 | parserOptions:
8 | parser: "@typescript-eslint/parser"
9 | rules:
10 | no-inner-declarations: off
11 | no-undef: off
12 | ignorePatterns:
13 | - build/
14 | - dist/
15 | - "!.storybook"
16 | - src/lib/sample-call.ts
17 |
--------------------------------------------------------------------------------
/src-svelte/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /.svelte-kit
3 | /package
4 | .env
5 | .env.*
6 | !.env.example
7 | .vercel
8 | .output
9 | vite.config.js.timestamp-*
10 | vite.config.ts.timestamp-*
11 |
--------------------------------------------------------------------------------
/src-svelte/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "trailingComma": "all",
3 | "plugins": ["prettier-plugin-svelte"]
4 | }
5 |
--------------------------------------------------------------------------------
/src-svelte/.storybook/preview.ts:
--------------------------------------------------------------------------------
1 | import "../src/routes/styles.css";
2 | import { MINIMAL_VIEWPORTS } from "@storybook/addon-viewport";
3 |
4 | /** @type { import('@storybook/svelte').Preview } */
5 | const preview = {
6 | parameters: {
7 | actions: { argTypesRegex: "^on[A-Z].*" },
8 | controls: {
9 | matchers: {
10 | color: /(background|color)$/i,
11 | date: /Date$/,
12 | },
13 | },
14 | viewport: {
15 | viewports: {
16 | ...MINIMAL_VIEWPORTS,
17 | smallTablet: {
18 | name: "Small Tablet",
19 | styles: {
20 | width: "834px",
21 | height: "650px",
22 | },
23 | },
24 | tallerSmallMobile: {
25 | name: "Taller Small Mobile",
26 | styles: {
27 | width: "320px",
28 | height: "650px",
29 | },
30 | },
31 | },
32 | },
33 | },
34 | decorators: [],
35 | };
36 |
37 | export default preview;
38 |
--------------------------------------------------------------------------------
/src-svelte/retina-proportions.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | DEFAULT_REM = 18
4 | RETINA_REM = 15
5 | RETINA_RATIO = 15 / 18
6 | # round to nearest half-integer
7 | ROUNDING_PRECISION = 2
8 |
9 |
10 | def retina_proportion(measurement: float) -> float:
11 | return round(measurement * RETINA_RATIO * ROUNDING_PRECISION) / ROUNDING_PRECISION
12 |
13 |
14 | def convert() -> None:
15 | measurement = float(input("Original: "))
16 | retina = retina_proportion(measurement)
17 | print(f"Retina: \033[1m\033[92m{retina}\033[0m")
18 |
19 |
20 | if __name__ == "__main__":
21 | try:
22 | while True:
23 | convert()
24 | except KeyboardInterrupt:
25 | pass
26 |
--------------------------------------------------------------------------------
/src-svelte/screenshots/.gitignore:
--------------------------------------------------------------------------------
1 | testing/
2 | local/
3 |
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/app/static.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/app/static.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/background/static-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/background/static-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/background/static.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/background/static.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/sidebar/credits-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/sidebar/credits-selected.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/sidebar/dashboard-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/sidebar/dashboard-selected.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/sidebar/settings-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/sidebar/settings-selected.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/snackbar/message/error-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/snackbar/message/error-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/snackbar/message/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/snackbar/message/error.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/snackbar/message/info-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/snackbar/message/info-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/layout/snackbar/message/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/layout/snackbar/message/info.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/button/disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/button/disabled.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/button/group/narrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/button/group/narrow.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/button/group/wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/button/group/wide.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/button/regular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/button/regular.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/external-link/external-link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/external-link/external-link.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/infobox/regular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/infobox/regular.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/infobox/transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/infobox/transparent.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/scrollable/fixed/bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/scrollable/fixed/bottom.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/scrollable/fixed/top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/scrollable/fixed/top.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/scrollable/growable/large-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/scrollable/growable/large-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/scrollable/growable/large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/scrollable/growable/large.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/scrollable/growable/small-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/scrollable/growable/small-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/scrollable/growable/small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/scrollable/growable/small.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/slider/tablet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/slider/tablet.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/slider/tiny-phone-screen-with-long-label.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/slider/tiny-phone-screen-with-long-label.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/slider/tiny-phone-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/slider/tiny-phone-screen.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/switch/off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/switch/off.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/switch/on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/switch/on.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/warning/long.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/warning/long.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/reusable/warning/short.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/reusable/warning/short.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/bottom-scroll-indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/bottom-scroll-indicator.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/empty.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/extra-long-input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/extra-long-input.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/full-message-width.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/full-message-width.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/multiline-chat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/multiline-chat.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/new-message-sent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/new-message-sent.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/not-empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/not-empty.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/conversation/typing-indicator-static.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/conversation/typing-indicator-static.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/ai-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/ai-code.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/ai-multiline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/ai-multiline.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/ai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/ai.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/highlighted-ai-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/highlighted-ai-code.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/highlighted-human-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/highlighted-human-code.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/human-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/human-code.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/human.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/human.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/chat/message/mixed-khmer-and-english.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/chat/message/mixed-khmer-and-english.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/credits/creditor/dependency-with-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/credits/creditor/dependency-with-icon.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/credits/creditor/github-contributor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/credits/creditor/github-contributor.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/credits/creditor/regular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/credits/creditor/regular.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/credits/creditor/typodermic-font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/credits/creditor/typodermic-font.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/editing-pre-filled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/editing-pre-filled.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/editing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/editing.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/known.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/known.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/loading.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/unknown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/dashboard/api-keys-display/unknown.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/dashboard/metadata/loaded.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/dashboard/metadata/loaded.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/dashboard/metadata/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/dashboard/metadata/loading.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/list/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/list/empty.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/list/full-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/list/full-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/list/full.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/list/full.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/list/small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/list/small.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/actions/wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/actions/wide.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/import/static.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/import/static.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/khmer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/khmer.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/lots-of-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/lots-of-code.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/narrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/narrow.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/blank-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/blank-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/blank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/blank.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/busy-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/busy-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/busy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/busy.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/edit-continued-conversation-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/edit-continued-conversation-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/edit-continued-conversation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/edit-continued-conversation.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/with-emoji-variant-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/with-emoji-variant-1.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/with-emoji-variant-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/with-emoji-variant-2.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/new/with-emoji.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/new/with-emoji.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/unknown-provider-prompt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/unknown-provider-prompt.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/variant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/variant.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/llm-call/wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/llm-call/wide.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/terminal-session/finished.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/terminal-session/finished.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/terminal-session/in-progress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/terminal-session/in-progress.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/database/terminal-session/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/database/terminal-session/new.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/settings/large-phone-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/settings/large-phone-screen.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/settings/tablet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/settings/tablet.png
--------------------------------------------------------------------------------
/src-svelte/screenshots/baseline/screens/settings/tiny-phone-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/screenshots/baseline/screens/settings/tiny-phone-screen.png
--------------------------------------------------------------------------------
/src-svelte/src/app.d.ts:
--------------------------------------------------------------------------------
1 | // See https://kit.svelte.dev/docs/types#app
2 | // for information about these interfaces
3 |
4 | import "unplugin-icons/types/svelte";
5 | import IconSettings from "~icons/ion/settings";
6 |
7 | declare global {
8 | namespace App {
9 | interface Route {
10 | name: string;
11 | path: string;
12 | icon: typeof IconSettings;
13 | }
14 | }
15 |
16 | interface Window {
17 | __TAURI_IPC__?: () => void;
18 | // @ts-ignore
19 | [key: string]: any;
20 | }
21 | }
22 |
23 | export {};
24 |
--------------------------------------------------------------------------------
/src-svelte/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | %sveltekit.head%
8 |
9 |
10 | %sveltekit.body%
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/ApiCallReference.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 | {#if selfContained}
10 |
13 | {:else}
14 |
15 | {/if}
16 |
17 |
23 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/ApiCallReferenceLink.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 | {#if nolink}
9 | {apiCall.snippet}
10 | {:else}
11 | {apiCall.snippet}
12 | {/if}
13 |
14 |
25 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/EmptyPlaceholder.svelte:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/Explanation.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | [?]
7 |
8 |
9 |
14 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/ExternalLink.stories.ts:
--------------------------------------------------------------------------------
1 | import ExternalLinkView from "./ExternalLinkView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: ExternalLinkView,
6 | title: "Reusable/External Link",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: ExternalLinkView,
12 | props: args,
13 | });
14 |
15 | export const ExternalLink: StoryObj = Template.bind({}) as any;
16 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/ExternalLinkView.svelte:
--------------------------------------------------------------------------------
1 |
2 | This is a link to Google .
3 | Clicking on it will open a new page.
4 |
5 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/FixedScrollable.stories.ts:
--------------------------------------------------------------------------------
1 | import FixedScrollableComponent from "./FixedScrollableView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: FixedScrollableComponent,
6 | title: "Reusable/Scrollable/Fixed",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: FixedScrollableComponent,
12 | props: args,
13 | });
14 |
15 | export const Top: StoryObj = Template.bind({}) as any;
16 | Top.args = {
17 | initialPosition: "top",
18 | };
19 |
20 | export const Bottom: StoryObj = Template.bind({}) as any;
21 | Bottom.args = {
22 | initialPosition: "bottom",
23 | };
24 |
25 | export const AutoScroll: StoryObj = Template.bind({}) as any;
26 | AutoScroll.args = {
27 | autoscroll: true,
28 | };
29 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/InfoBoxView.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
14 |
15 | How do we know that even the realest of realities wouldn't be subjective,
16 | in the final analysis? Nobody can prove his existence, can he? — Simulacron 3
19 |
20 |
21 |
22 |
23 |
29 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/Loading.svelte:
--------------------------------------------------------------------------------
1 | ...loading
2 |
3 |
8 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/RoundDef.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/Scrollable.stories.ts:
--------------------------------------------------------------------------------
1 | import ScrollableComponent from "./ScrollableView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: ScrollableComponent,
6 | title: "Reusable/Scrollable/Growable",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: ScrollableComponent,
12 | props: args,
13 | });
14 |
15 | export const Small: StoryObj = Template.bind({}) as any;
16 | Small.args = {
17 | initialPosition: "top",
18 | };
19 | Small.parameters = {
20 | viewport: {
21 | defaultViewport: "mobile1",
22 | },
23 | };
24 |
25 | export const Large: StoryObj = Template.bind({}) as any;
26 | Large.args = {
27 | initialPosition: "top",
28 | };
29 | Large.parameters = {
30 | viewport: {
31 | defaultViewport: "smallTablet",
32 | },
33 | };
34 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/SubInfoBox.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
{subheading}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/Warning.stories.ts:
--------------------------------------------------------------------------------
1 | import WarningView from "./WarningView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: WarningView,
6 | title: "Reusable/Warning",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: WarningView,
12 | props: args,
13 | });
14 |
15 | export const Short: StoryObj = Template.bind({}) as any;
16 | Short.args = {
17 | text: "This is a warning.",
18 | };
19 | Short.parameters = {
20 | viewport: {
21 | defaultViewport: "tablet",
22 | },
23 | };
24 |
25 | export const Long: StoryObj = Template.bind({}) as any;
26 | Long.args = {
27 | text:
28 | "Please note that this is a warning. " +
29 | "It is important to pay attention to this warning, " +
30 | "or else the integrity of the simulation may be at stake.",
31 | };
32 | Long.parameters = {
33 | viewport: {
34 | defaultViewport: "tablet",
35 | },
36 | };
37 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/Warning.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
35 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/WarningView.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | {text}
8 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/__mocks__/MockAppLayout.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/__mocks__/MockFullPageLayout.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
12 |
13 |
22 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/__mocks__/MockPageTransitions.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
40 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/__mocks__/MockRemount.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 | Remount
11 |
12 | {#if visible}
13 |
14 | {/if}
15 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/__mocks__/MockTransitions.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | {#if visible}
16 |
17 | {/if}
18 |
19 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/additionalTypes.ts:
--------------------------------------------------------------------------------
1 | import { type ChatPrompt } from "./bindings";
2 |
3 | export type ChatPromptVariant = { type: "Chat" } & ChatPrompt;
4 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/autoupdate.ts:
--------------------------------------------------------------------------------
1 | import { check } from "@tauri-apps/plugin-updater";
2 | import { relaunch } from "@tauri-apps/plugin-process";
3 | import { ask } from "@tauri-apps/plugin-dialog";
4 |
5 | export async function checkForUpdates() {
6 | const update = await check();
7 | if (update?.available) {
8 | const yes = await ask(
9 | `ZAMM v${update.version} is available!\n\nRelease notes: ${update.body}`,
10 | {
11 | title: "Update Available",
12 | kind: "info",
13 | okLabel: "Update",
14 | cancelLabel: "Cancel",
15 | },
16 | );
17 | if (yes) {
18 | await update.downloadAndInstall();
19 | await relaunch();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/controls/Button.stories.ts:
--------------------------------------------------------------------------------
1 | import Button from "./ButtonView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: Button,
6 | title: "Reusable/Button",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: Button,
12 | props: args,
13 | });
14 |
15 | export const Regular: StoryObj = Template.bind({}) as any;
16 | Regular.args = {
17 | text: "Simulate",
18 | };
19 |
20 | export const Disabled: StoryObj = Template.bind({}) as any;
21 | Disabled.args = {
22 | text: "Simulate",
23 | disabled: true,
24 | };
25 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/controls/ButtonGroup.stories.ts:
--------------------------------------------------------------------------------
1 | import ButtonGroupComponent from "./ButtonGroupView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: ButtonGroupComponent,
6 | title: "Reusable/Button/Group",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: ButtonGroupComponent,
12 | props: args,
13 | });
14 |
15 | export const Wide: StoryObj = Template.bind({}) as any;
16 | Wide.parameters = {
17 | viewport: {
18 | defaultViewport: "smallTablet",
19 | },
20 | };
21 |
22 | export const Narrow: StoryObj = Template.bind({}) as any;
23 | Narrow.parameters = {
24 | viewport: {
25 | defaultViewport: "mobile2",
26 | },
27 | };
28 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/controls/ButtonGroup.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
38 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/controls/ButtonGroupView.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 | Edit API call
8 | Restore conversation
9 |
10 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/controls/ButtonView.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 | {text}
8 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/controls/TextInput.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
42 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/firstPageLoad.ts:
--------------------------------------------------------------------------------
1 | import { writable } from "svelte/store";
2 |
3 | export const firstAppLoad = writable(true);
4 | export const firstPageLoad = writable(true);
5 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/label-id.ts:
--------------------------------------------------------------------------------
1 | import { customAlphabet } from "nanoid/non-secure";
2 |
3 | const nanoid = customAlphabet("1234567890", 6);
4 |
5 | export default function getComponentId(componentType?: string) {
6 | const prefix = componentType || "component";
7 | return `${prefix}-${nanoid()}`;
8 | }
9 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/preferences.ts:
--------------------------------------------------------------------------------
1 | import { writable, derived, get } from "svelte/store";
2 |
3 | export const STANDARD_ROOT_EM = 18;
4 | export const SMALLER_ROOT_EM = 15;
5 |
6 | export const animationsOn = writable(true);
7 | export const transparencyOn = writable(false);
8 | export const highDpiAdjust = writable(false);
9 | export const backgroundAnimation = writable(false);
10 | export const animationSpeed = writable(1);
11 | export const soundOn = writable(true);
12 | export const volume = writable(1);
13 |
14 | export const standardDuration = derived(
15 | [animationsOn, animationSpeed],
16 | ([$animationsOn, $animationSpeed]) =>
17 | $animationsOn ? 100 / $animationSpeed : 0,
18 | );
19 |
20 | export const rootEm = derived(highDpiAdjust, ($highDpiAdjustOn) => {
21 | return $highDpiAdjustOn ? SMALLER_ROOT_EM : STANDARD_ROOT_EM;
22 | });
23 |
24 | export function getAdjustedFontSize(fontSize: number) {
25 | return Math.round(fontSize * (get(rootEm) / STANDARD_ROOT_EM));
26 | }
27 |
28 | export function newEmStore(initialValue: number) {
29 | return derived(rootEm, (_) => getAdjustedFontSize(initialValue));
30 | }
31 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/sample-call-testing.test.ts:
--------------------------------------------------------------------------------
1 | import { TauriInvokePlayback } from "./sample-call-testing";
2 |
3 | describe("TauriInvokePlayback", () => {
4 | it("should mock matched calls", async () => {
5 | const playback = new TauriInvokePlayback();
6 | playback.addCalls({
7 | request: ["command", { inputArg: "input" }],
8 | response: { outputKey: "output" },
9 | succeeded: true,
10 | });
11 | const result = await playback.mockCall("command", { inputArg: "input" });
12 | expect(result).toEqual({ outputKey: "output" });
13 | });
14 |
15 | it("should throw an error for unmatched calls", async () => {
16 | const playback = new TauriInvokePlayback();
17 | playback.addCalls({
18 | request: ["command", { inputArg: "input" }],
19 | response: { outputKey: "output" },
20 | succeeded: true,
21 | });
22 | expect(() => playback.mockCall("command", { inputArg: "wrong" })).toThrow(
23 | 'No matching call found for ["command",{"inputArg":"wrong"}].\n' +
24 | 'Candidates are ["command",{"inputArg":"input"}]',
25 | );
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/snackbar/Message.stories.ts:
--------------------------------------------------------------------------------
1 | import MessageComponent from "./Message.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: MessageComponent,
6 | title: "Layout/Snackbar/Message",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: MessageComponent,
12 | props: args,
13 | });
14 |
15 | export const Error: StoryObj = Template.bind({}) as any;
16 | Error.args = {
17 | message: "Something is wrong.",
18 | messageType: "error",
19 | dismiss: () => {
20 | console.log("Dismiss button clicked.");
21 | },
22 | };
23 | Error.parameters = {
24 | viewport: {
25 | defaultViewport: "mobile1",
26 | },
27 | };
28 |
29 | export const Info: StoryObj = Template.bind({}) as any;
30 | Info.args = {
31 | message: "Something is known.",
32 | messageType: "info",
33 | dismiss: () => {
34 | console.log("Dismiss button clicked.");
35 | },
36 | };
37 | Info.parameters = {
38 | viewport: {
39 | defaultViewport: "mobile1",
40 | },
41 | };
42 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/snackbar/Message.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | {message}
11 |
12 |
13 |
14 |
15 |
48 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/snackbar/Snackbar.stories.ts:
--------------------------------------------------------------------------------
1 | import SnackbarView from "./SnackbarView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import SvelteStoresDecorator from "$lib/__mocks__/stores";
4 |
5 | export default {
6 | component: SnackbarView,
7 | title: "Layout/Snackbar",
8 | argTypes: {},
9 | decorators: [SvelteStoresDecorator],
10 | };
11 |
12 | const Template = ({ ...args }) => ({
13 | Component: SnackbarView,
14 | props: args,
15 | });
16 |
17 | export const Default: StoryObj = Template.bind({}) as any;
18 |
19 | export const SlowMotion: StoryObj = Template.bind({}) as any;
20 | SlowMotion.parameters = {
21 | preferences: {
22 | animationSpeed: 0.1,
23 | },
24 | };
25 |
26 | export const Motionless: StoryObj = Template.bind({}) as any;
27 | Motionless.parameters = {
28 | preferences: {
29 | animationsOn: false,
30 | },
31 | };
32 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/snackbar/SnackbarView.svelte:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 | Show Error
16 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/sound.ts:
--------------------------------------------------------------------------------
1 | import { get } from "svelte/store";
2 | import { commands, type Sound } from "./bindings";
3 | import { soundOn, volume } from "./preferences";
4 |
5 | export function playSoundEffect(sound: Sound, speed?: number) {
6 | if (get(soundOn)) {
7 | const soundEffectSpeed = speed || 1;
8 | // boost volume to compensate for lowered volume from lower speed
9 | const soundEffectVolume = get(volume) / soundEffectSpeed;
10 | try {
11 | commands.playSound(sound, soundEffectVolume, soundEffectSpeed);
12 | } catch (e) {
13 | console.error(`Problem playing ${sound}: ${e}`);
14 | }
15 | if (window._testRecordSoundPlayed !== undefined) {
16 | window._testRecordSoundPlayed();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/system-info.ts:
--------------------------------------------------------------------------------
1 | import { writable, type Writable } from "svelte/store";
2 | import type { SystemInfo, ApiKeys } from "./bindings";
3 |
4 | export const systemInfo: Writable = writable(undefined);
5 | export const apiKeys: Writable = writable({
6 | openai: null,
7 | });
8 |
9 | export const NullSystemInfo: SystemInfo = {
10 | zamm_version: "dummy",
11 | os: null,
12 | shell: null,
13 | shell_init_file: null,
14 | };
15 |
--------------------------------------------------------------------------------
/src-svelte/src/lib/tauri.ts:
--------------------------------------------------------------------------------
1 | import { type Result } from "./bindings";
2 |
3 | export async function unwrap(promise: Promise>) {
4 | const result = await promise;
5 | if (result.status === "ok") {
6 | return result.data;
7 | } else {
8 | throw result.error;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/+layout.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/+layout.ts:
--------------------------------------------------------------------------------
1 | export const prerender = true;
2 | export const ssr = false;
3 |
4 | export function load({ url }) {
5 | return {
6 | url: url.pathname || "/",
7 | };
8 | }
9 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/AnimationControl.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
20 |
21 |
22 |
23 |
34 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/AppLayout.stories.ts:
--------------------------------------------------------------------------------
1 | import AppLayout from "./AppLayout.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import SvelteStoresDecorator from "$lib/__mocks__/stores";
4 |
5 | export default {
6 | component: AppLayout,
7 | title: "Layout/App",
8 | argTypes: {},
9 | decorators: [SvelteStoresDecorator],
10 | };
11 |
12 | const Template = ({ ...args }) => ({
13 | Component: AppLayout,
14 | props: args,
15 | });
16 |
17 | export const Dynamic: StoryObj = Template.bind({}) as any;
18 | Dynamic.args = {
19 | currentRoute: "/",
20 | };
21 | Dynamic.parameters = {
22 | preferences: {
23 | backgroundAnimation: true,
24 | },
25 | };
26 |
27 | export const Static: StoryObj = Template.bind({}) as any;
28 | Static.args = {
29 | currentRoute: "/",
30 | };
31 | Static.parameters = {
32 | preferences: {
33 | backgroundAnimation: false,
34 | },
35 | };
36 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/Background.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/BackgroundUI.stories.ts:
--------------------------------------------------------------------------------
1 | import BackgroundComponent from "./BackgroundUI.svelte";
2 | import type { StoryFn, StoryObj } from "@storybook/svelte";
3 | import SvelteStoresDecorator from "$lib/__mocks__/stores";
4 | import BackgroundUIView from "./BackgroundUIView.svelte";
5 |
6 | export default {
7 | component: BackgroundComponent,
8 | title: "Layout/Background",
9 | argTypes: {},
10 | decorators: [
11 | SvelteStoresDecorator,
12 | (story: StoryFn) => {
13 | return {
14 | Component: BackgroundUIView,
15 | slot: story,
16 | };
17 | },
18 | ],
19 | };
20 |
21 | const Template = ({ ...args }) => ({
22 | Component: BackgroundComponent,
23 | props: args,
24 | });
25 |
26 | export const Static: StoryObj = Template.bind({}) as any;
27 | Static.args = {
28 | animated: false,
29 | };
30 | export const Dynamic: StoryObj = Template.bind({}) as any;
31 | Dynamic.args = {
32 | animated: true,
33 | };
34 |
35 | export const SlowMotion: StoryObj = Template.bind({}) as any;
36 | SlowMotion.args = {
37 | animated: true,
38 | };
39 | SlowMotion.parameters = {
40 | preferences: {
41 | animationSpeed: 0.1,
42 | },
43 | };
44 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/BackgroundUIView.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
20 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/Dashboard.stories.ts:
--------------------------------------------------------------------------------
1 | import DashboardComponent from "./Dashboard.svelte";
2 | import type { StoryFn, StoryObj } from "@storybook/svelte";
3 | import TauriInvokeDecorator from "$lib/__mocks__/invoke";
4 | import MockPageTransitions from "$lib/__mocks__/MockPageTransitions.svelte";
5 |
6 | export default {
7 | component: DashboardComponent,
8 | title: "Screens/Dashboard",
9 | argTypes: {},
10 | decorators: [
11 | TauriInvokeDecorator,
12 | (story: StoryFn) => {
13 | return {
14 | Component: MockPageTransitions,
15 | slot: story,
16 | };
17 | },
18 | ],
19 | };
20 |
21 | const Template = ({ ...args }) => ({
22 | Component: DashboardComponent,
23 | props: args,
24 | });
25 |
26 | export const FullPage: StoryObj = Template.bind({}) as any;
27 | FullPage.parameters = {
28 | sampleCallFiles: [
29 | "/api/sample-calls/get_api_keys-openai.yaml",
30 | "/api/sample-calls/get_system_info-linux.yaml",
31 | ],
32 | };
33 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/Dashboard.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
31 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/PageTransition.stories.ts:
--------------------------------------------------------------------------------
1 | import PageTransitionView from "./PageTransitionView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import SvelteStoresDecorator from "$lib/__mocks__/stores";
4 |
5 | export default {
6 | component: PageTransitionView,
7 | title: "Layout/Page Transitions",
8 | argTypes: {},
9 | decorators: [SvelteStoresDecorator],
10 | };
11 |
12 | const Template = ({ ...args }) => ({
13 | Component: PageTransitionView,
14 | props: args,
15 | });
16 |
17 | export const Default: StoryObj = Template.bind({}) as any;
18 |
19 | export const SlowMotion: StoryObj = Template.bind({}) as any;
20 | SlowMotion.parameters = {
21 | preferences: {
22 | animationSpeed: 0.1,
23 | },
24 | };
25 |
26 | export const Subpath: StoryObj = Template.bind({}) as any;
27 | Subpath.args = {
28 | routeBAddress: "/a/subpath",
29 | };
30 | Subpath.parameters = {
31 | preferences: {
32 | animationSpeed: 0.1,
33 | },
34 | };
35 |
36 | export const Motionless: StoryObj = Template.bind({}) as any;
37 | Motionless.parameters = {
38 | preferences: {
39 | animationsOn: false,
40 | },
41 | };
42 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/PageTransitionControl.svelte:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 | Navigate
15 |
16 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/Sidebar.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/chat/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/chat/Chat.reveal.stories.ts:
--------------------------------------------------------------------------------
1 | import ChatComponent from "./Chat.svelte";
2 | import SvelteStoresDecorator from "$lib/__mocks__/stores";
3 | import MockPageTransitions from "$lib/__mocks__/MockPageTransitions.svelte";
4 | import TauriInvokeDecorator from "$lib/__mocks__/invoke";
5 | import type { StoryFn, StoryObj } from "@storybook/svelte";
6 | import { conversation } from "./Chat.mock-data";
7 |
8 | export default {
9 | component: ChatComponent,
10 | title: "Screens/Chat/Conversation",
11 | argTypes: {},
12 | decorators: [
13 | SvelteStoresDecorator,
14 | TauriInvokeDecorator,
15 | (story: StoryFn) => {
16 | return {
17 | Component: MockPageTransitions,
18 | slot: story,
19 | };
20 | },
21 | ],
22 | };
23 |
24 | const Template = ({ ...args }) => ({
25 | Component: ChatComponent,
26 | props: args,
27 | });
28 |
29 | export const FullPage: StoryObj = Template.bind({}) as any;
30 |
31 | export const FullPageConversation: StoryObj = Template.bind({}) as any;
32 | FullPageConversation.parameters = {
33 | stores: {
34 | conversation,
35 | },
36 | };
37 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/chat/Message.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
42 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/chat/Message.test.ts:
--------------------------------------------------------------------------------
1 | import Message from "./Message.svelte";
2 | import "@testing-library/jest-dom";
3 | import { render, screen } from "@testing-library/svelte";
4 | import { expect } from "vitest";
5 |
6 | describe("Text messages", () => {
7 | it("should render without Khmer spans when no Khmer is present", () => {
8 | render(Message, {
9 | message: {
10 | role: "Human",
11 | text: "Hello, how are you?",
12 | },
13 | });
14 | expect(screen.getByRole("listitem")).toHaveTextContent(
15 | "Hello, how are you?",
16 | );
17 | });
18 |
19 | it("should pick out Khmer text embedded in other text", () => {
20 | const { container } = render(Message, {
21 | message: {
22 | role: "Human",
23 | text: "Hello, សួស្ដី, what languages do you speak? ចេះខ្មែរអត់?",
24 | },
25 | });
26 | expect(screen.getByRole("listitem")).toHaveTextContent(
27 | "Hello, សួស្ដី, what languages do you speak? ចេះខ្មែរអត់?",
28 | );
29 |
30 | const khmerSpans = container.getElementsByClassName("khmer");
31 | const khmerSpanText = Array.from(khmerSpans).map(
32 | (span) => span.textContent,
33 | );
34 | expect(khmerSpanText).toEqual(["សួស្ដី", "ចេះខ្មែរអត់"]);
35 | });
36 | });
37 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/chat/MessageUI.test.ts:
--------------------------------------------------------------------------------
1 | import { styleKhmer } from "./MessageUI.svelte";
2 |
3 | describe("Khmer styling", () => {
4 | it("should leave text without Khmer unchanged", () => {
5 | expect(styleKhmer("Hello, how are you?")).toEqual("Hello, how are you?");
6 | });
7 |
8 | it("should select the entire text if it is all Khmer", () => {
9 | expect(styleKhmer("ខ្ញុំសុខសប្បាយ")).toEqual(
10 | 'ខ្ញុំសុខសប្បាយ ',
11 | );
12 | });
13 |
14 | it("should pick out Khmer text from within other text", () => {
15 | expect(
16 | styleKhmer("Hello, សួស្ដី, what languages do you speak? ចេះខ្មែរអត់?"),
17 | ).toEqual(
18 | 'Hello, សួស្ដី , what languages do you speak?' +
19 | ' ចេះខ្មែរអត់ ?',
20 | );
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/chat/PersistentChatView.stories.ts:
--------------------------------------------------------------------------------
1 | import ChatComponent from "./PersistentChatView.svelte";
2 | import MockFullPageLayout from "$lib/__mocks__/MockFullPageLayout.svelte";
3 | import SvelteStoresDecorator from "$lib/__mocks__/stores";
4 | import TauriInvokeDecorator from "$lib/__mocks__/invoke";
5 | import type { StoryFn, StoryObj } from "@storybook/svelte";
6 |
7 | export default {
8 | component: ChatComponent,
9 | title: "Screens/Chat/Conversation",
10 | argTypes: {},
11 | decorators: [
12 | SvelteStoresDecorator,
13 | TauriInvokeDecorator,
14 | (story: StoryFn) => {
15 | return {
16 | Component: MockFullPageLayout,
17 | slot: story,
18 | };
19 | },
20 | ],
21 | };
22 |
23 | const Template = ({ ...args }) => ({
24 | Component: ChatComponent,
25 | props: args,
26 | });
27 |
28 | export const Remountable: StoryObj = Template.bind({}) as any;
29 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/chat/PersistentChatView.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/components/Metadata.stories.ts:
--------------------------------------------------------------------------------
1 | import MetadataComponent from "./Metadata.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import TauriInvokeDecorator from "$lib/__mocks__/invoke";
4 |
5 | export default {
6 | component: MetadataComponent,
7 | title: "Screens/Dashboard/Metadata",
8 | argTypes: {},
9 | decorators: [TauriInvokeDecorator],
10 | };
11 |
12 | const Template = ({ ...args }) => ({
13 | Component: MetadataComponent,
14 | props: args,
15 | });
16 |
17 | export const Loaded: StoryObj = Template.bind({}) as any;
18 | Loaded.parameters = {
19 | viewport: {
20 | defaultViewport: "mobile2",
21 | },
22 | sampleCallFiles: ["/api/sample-calls/get_system_info-linux.yaml"],
23 | };
24 |
25 | export const Loading: StoryObj = Template.bind({}) as any;
26 | Loading.parameters = {
27 | viewport: {
28 | defaultViewport: "mobile2",
29 | },
30 | shouldWait: true,
31 | };
32 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/components/api-keys/Display.svelte:
--------------------------------------------------------------------------------
1 |
29 |
30 |
31 | {#if isLoading}
32 |
33 | {:else}
34 |
35 |
41 |
42 | {/if}
43 |
44 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/credits/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/credits/Creditor.stories.ts:
--------------------------------------------------------------------------------
1 | import CreditorComponent from "./Creditor.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 |
4 | export default {
5 | component: CreditorComponent,
6 | title: "Screens/Credits/Creditor",
7 | argTypes: {},
8 | };
9 |
10 | const Template = ({ ...args }) => ({
11 | Component: CreditorComponent,
12 | props: args,
13 | });
14 |
15 | export const Regular: StoryObj = Template.bind({}) as any;
16 | Regular.args = {
17 | name: "Serde",
18 | url: "https://serde.rs/",
19 | };
20 |
21 | export const GithubContributor: StoryObj = Template.bind({}) as any;
22 | GithubContributor.args = {
23 | name: "Amos Jun-yeung Ng",
24 | url: "https://github.com/amosjyng/",
25 | isPerson: true,
26 | };
27 |
28 | export const TypodermicFont: StoryObj = Template.bind({}) as any;
29 | TypodermicFont.args = {
30 | name: "Nasalization",
31 | url: "https://typodermicfonts.com/nasalization/",
32 | };
33 |
34 | export const DependencyWithIcon: StoryObj = Template.bind({}) as any;
35 | DependencyWithIcon.args = {
36 | name: "Tauri",
37 | logo: "tauri.png",
38 | url: "https://tauri.app/",
39 | };
40 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/credits/Creditor.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, test } from "vitest";
2 | import { formatUrl } from "./Creditor.svelte";
3 |
4 | describe("URL formatter", () => {
5 | test("formats HTTP(S) URL correctly", () => {
6 | expect(formatUrl("http://yahoo.com")).toEqual("yahoo.com");
7 | expect(formatUrl("https://google.com")).toEqual("google.com");
8 | });
9 |
10 | test("formats Github username URLs correctly", () => {
11 | expect(formatUrl("https://github.com/amosjyng/")).toEqual("amosjyng");
12 | });
13 |
14 | test("formats Github project URLs correctly", () => {
15 | expect(formatUrl("https://github.com/ai/nanoid")).toEqual("ai/nanoid");
16 | });
17 |
18 | test("strips ending slash from URL", () => {
19 | expect(formatUrl("https://tauri.app/")).toEqual("tauri.app");
20 | });
21 |
22 | test("strips www from URL", () => {
23 | expect(formatUrl("https://www.neodrag.dev/")).toEqual("neodrag.dev");
24 | });
25 |
26 | test("preserves path", () => {
27 | expect(formatUrl("https://www.a.com/b/c")).toEqual("a.com/b/c");
28 | });
29 |
30 | test("truncates long URLs", () => {
31 | expect(formatUrl("https://www.jacklmoore.com/autosize/")).toEqual(
32 | "jacklmoore.c...",
33 | );
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/credits/Credits.stories.ts:
--------------------------------------------------------------------------------
1 | import CreditsComponent from "./Credits.svelte";
2 | import MockPageTransitions from "$lib/__mocks__/MockPageTransitions.svelte";
3 | import type { StoryObj, StoryFn } from "@storybook/svelte";
4 |
5 | export default {
6 | component: CreditsComponent,
7 | title: "Screens/Credits",
8 | argTypes: {},
9 | };
10 |
11 | const Template = ({ ...args }) => ({
12 | Component: CreditsComponent,
13 | props: args,
14 | });
15 |
16 | export const Tablet: StoryObj = Template.bind({}) as any;
17 | Tablet.parameters = {
18 | viewport: {
19 | defaultViewport: "tablet",
20 | },
21 | };
22 |
23 | export const FullPage: StoryObj = Template.bind({}) as any;
24 | FullPage.decorators = [
25 | (story: StoryFn) => {
26 | return {
27 | Component: MockPageTransitions,
28 | slot: story,
29 | };
30 | },
31 | ];
32 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/credits/GitHubIcon.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
11 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/credits/TypodermicIcon.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/DatabaseView.full-page.stories.ts:
--------------------------------------------------------------------------------
1 | import DatabaseView from "./DatabaseView.svelte";
2 | import MockPageTransitions from "$lib/__mocks__/MockPageTransitions.svelte";
3 | import type { StoryFn, StoryObj } from "@storybook/svelte";
4 | import TauriInvokeDecorator from "$lib/__mocks__/invoke";
5 |
6 | export default {
7 | component: DatabaseView,
8 | title: "Screens/Database/List",
9 | argTypes: {},
10 | decorators: [
11 | TauriInvokeDecorator,
12 | (story: StoryFn) => {
13 | return {
14 | Component: MockPageTransitions,
15 | slot: story,
16 | };
17 | },
18 | ],
19 | };
20 |
21 | const Template = ({ ...args }) => ({
22 | Component: DatabaseView,
23 | props: args,
24 | });
25 |
26 | export const FullPage: StoryObj = Template.bind({}) as any;
27 | FullPage.args = {
28 | dateTimeLocale: "en-GB",
29 | timeZone: "Asia/Phnom_Penh",
30 | };
31 | FullPage.parameters = {
32 | viewport: {
33 | defaultViewport: "smallTablet",
34 | },
35 | sampleCallFiles: [
36 | "/api/sample-calls/get_api_calls-full.yaml",
37 | "/api/sample-calls/get_api_calls-offset.yaml",
38 | ],
39 | };
40 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/ApiCallBlurb.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/ApiCallsTable.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
19 | Looks like you haven't made any calls to an LLM yet. Get started via
20 | chat
21 | or by making one from scratch .
22 |
23 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/[slug]/+page.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/[slug]/Actions.stories.ts:
--------------------------------------------------------------------------------
1 | import ActionsComponent from "./Actions.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import TauriInvokeDecorator from "$lib/__mocks__/invoke";
4 |
5 | export default {
6 | component: ActionsComponent,
7 | title: "Screens/Database/LLM Call/Actions",
8 | argTypes: {},
9 | decorators: [TauriInvokeDecorator],
10 | };
11 |
12 | const Template = ({ ...args }) => ({
13 | Component: ActionsComponent,
14 | props: args,
15 | });
16 |
17 | export const Wide: StoryObj = Template.bind({}) as any;
18 | Wide.parameters = {
19 | viewport: {
20 | defaultViewport: "smallTablet",
21 | },
22 | };
23 |
24 | export const Narrow: StoryObj = Template.bind({}) as any;
25 | Narrow.parameters = {
26 | viewport: {
27 | defaultViewport: "mobile2",
28 | },
29 | };
30 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/[slug]/ApiCall.stories.ts:
--------------------------------------------------------------------------------
1 | import ApiCallComponent from "./ApiCall.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import TauriInvokeDecorator from "$lib/__mocks__/invoke";
4 | import { KHMER_CALL, LOTS_OF_CODE_CALL } from "./sample-calls";
5 |
6 | export default {
7 | component: ApiCallComponent,
8 | title: "Screens/Database/LLM Call",
9 | argTypes: {},
10 | decorators: [TauriInvokeDecorator],
11 | };
12 |
13 | const Template = ({ ...args }) => ({
14 | Component: ApiCallComponent,
15 | props: args,
16 | });
17 |
18 | export const Khmer: StoryObj = Template.bind({}) as any;
19 | Khmer.args = {
20 | apiCall: KHMER_CALL,
21 | showActions: false,
22 | dateTimeLocale: "en-GB",
23 | timeZone: "Asia/Phnom_Penh",
24 | };
25 | Khmer.parameters = {
26 | viewport: {
27 | defaultViewport: "smallTablet",
28 | },
29 | };
30 |
31 | export const LotsOfCode: StoryObj = Template.bind({}) as any;
32 | LotsOfCode.args = {
33 | apiCall: LOTS_OF_CODE_CALL,
34 | showActions: false,
35 | dateTimeLocale: "en-GB",
36 | timeZone: "Asia/Phnom_Penh",
37 | };
38 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/[slug]/ApiCall.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 | {#if showActions}
13 |
14 | {/if}
15 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/[slug]/Prompt.stories.ts:
--------------------------------------------------------------------------------
1 | import PromptComponent from "./Prompt.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import { CONTINUE_CONVERSATION_PROMPT } from "./sample-calls";
4 |
5 | export default {
6 | component: PromptComponent,
7 | title: "Screens/Database/LLM Call/Prompt",
8 | argTypes: {},
9 | };
10 |
11 | const Template = ({ ...args }) => ({
12 | Component: PromptComponent,
13 | props: args,
14 | });
15 |
16 | export const Uneditable: StoryObj = Template.bind({}) as any;
17 | Uneditable.args = {
18 | prompt: CONTINUE_CONVERSATION_PROMPT,
19 | };
20 |
21 | export const Editable: StoryObj = Template.bind({}) as any;
22 | Editable.args = {
23 | editable: true,
24 | prompt: CONTINUE_CONVERSATION_PROMPT,
25 | };
26 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/[slug]/UnloadedApiCall.svelte:
--------------------------------------------------------------------------------
1 |
19 |
20 | {#if apiCall}
21 |
22 | {:else}
23 |
24 | {/if}
25 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/new/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/new/PersistentApiCallEditor.stories.ts:
--------------------------------------------------------------------------------
1 | import PersistentApiCallEditor from "./PersistentApiCallEditorView.svelte";
2 | import type { StoryObj } from "@storybook/svelte";
3 | import SvelteStoresDecorator from "$lib/__mocks__/stores";
4 |
5 | export default {
6 | component: PersistentApiCallEditor,
7 | title: "Screens/Database/LLM Call/New",
8 | argTypes: {},
9 | decorators: [SvelteStoresDecorator],
10 | };
11 |
12 | const Template = ({ ...args }) => ({
13 | Component: PersistentApiCallEditor,
14 | props: args,
15 | });
16 |
17 | export const Remountable: StoryObj = Template.bind({}) as any;
18 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/new/PersistentApiCallEditorView.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/new/import/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/new/import/ApiCallImport.stories.ts:
--------------------------------------------------------------------------------
1 | import ApiCallImport from "./ApiCallImport.svelte";
2 | import type { StoryFn, StoryObj } from "@storybook/svelte";
3 | import MockFullPageLayout from "$lib/__mocks__/MockFullPageLayout.svelte";
4 | import MockTransitions from "$lib/__mocks__/MockTransitions.svelte";
5 |
6 | export default {
7 | component: ApiCallImport,
8 | title: "Screens/Database/LLM Call/Import",
9 | argTypes: {},
10 | decorators: [
11 | (story: StoryFn) => {
12 | return {
13 | Component: MockFullPageLayout,
14 | slot: story,
15 | };
16 | },
17 | ],
18 | };
19 |
20 | const Template = ({ ...args }) => ({
21 | Component: ApiCallImport,
22 | props: args,
23 | });
24 |
25 | export const Static: StoryObj = Template.bind({}) as any;
26 | Static.parameters = {
27 | viewport: {
28 | defaultViewport: "smallTablet",
29 | },
30 | };
31 |
32 | export const MountTransition: StoryObj = Template.bind({}) as any;
33 | MountTransition.parameters = {
34 | viewport: {
35 | defaultViewport: "smallTablet",
36 | },
37 | };
38 | MountTransition.decorators = [
39 | (story: StoryFn) => {
40 | return {
41 | Component: MockTransitions,
42 | slot: story,
43 | };
44 | },
45 | ];
46 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/api-calls/new/test.data.ts:
--------------------------------------------------------------------------------
1 | import type { ChatPromptVariant } from "$lib/additionalTypes";
2 |
3 | export const EDIT_CANONICAL_REF = {
4 | id: "c13c1e67-2de3-48de-a34c-a32079c03316",
5 | snippet:
6 | "Sure, here's a joke for you: Why don't scientists trust atoms? " +
7 | "Because they make up everything!",
8 | };
9 |
10 | export const EMOJI_CANONICAL_REF = {
11 | id: "e0e97af6-71bc-444f-8661-86a45134638c",
12 | snippet: `Ah, excellent question, General! 🤔`,
13 | };
14 |
15 | export const START_PROMPT: ChatPromptVariant = {
16 | type: "Chat",
17 | messages: [
18 | {
19 | role: "System",
20 | text: "You are ZAMM, a chat program. Respond in first person.",
21 | },
22 | {
23 | role: "Human",
24 | text: "Hello, does this work?",
25 | },
26 | ],
27 | };
28 |
29 | export const EDIT_PROMPT: ChatPromptVariant = {
30 | type: "Chat",
31 | messages: [
32 | {
33 | role: "System",
34 | text: "You are ZAMM, a chat program. Respond in first person.",
35 | },
36 | {
37 | role: "Human",
38 | text: "Hello, does this work?",
39 | },
40 | {
41 | role: "AI",
42 | text: "Yes, it works. How can I assist you today?",
43 | },
44 | {
45 | role: "Human",
46 | text: "Tell me something funny.",
47 | },
48 | ],
49 | };
50 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/terminal-sessions/TerminalSessionBlurb.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | {item.command}
10 | {#if item.last_io}
11 | {item.last_io}
12 | {/if}
13 |
14 |
15 |
16 |
37 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/terminal-sessions/TerminalSessionsTable.svelte:
--------------------------------------------------------------------------------
1 |
12 |
13 |
20 | Looks like you haven't started any
21 | terminal sessions yet.
22 |
23 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/terminal-sessions/UnloadedTerminalSession.svelte:
--------------------------------------------------------------------------------
1 |
20 |
21 | {#if session}
22 |
23 | {:else}
24 |
25 | {/if}
26 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/terminal-sessions/[slug]/+page.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/database/terminal-sessions/new/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/settings/+page.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/settings/Page.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/settings/Settings.stories.ts:
--------------------------------------------------------------------------------
1 | import SettingsComponent from "./Settings.svelte";
2 | import MockPageTransitions from "$lib/__mocks__/MockPageTransitions.svelte";
3 | import type { StoryObj, StoryFn } from "@storybook/svelte";
4 |
5 | export default {
6 | component: SettingsComponent,
7 | title: "Screens/Settings",
8 | argTypes: {},
9 | };
10 |
11 | const Template = ({ ...args }) => ({
12 | Component: SettingsComponent,
13 | props: args,
14 | });
15 |
16 | export const TinyPhoneScreen: StoryObj = Template.bind({}) as any;
17 | TinyPhoneScreen.parameters = {
18 | viewport: {
19 | defaultViewport: "tallerSmallMobile",
20 | },
21 | };
22 |
23 | export const LargePhoneScreen: StoryObj = Template.bind({}) as any;
24 | LargePhoneScreen.parameters = {
25 | viewport: {
26 | defaultViewport: "mobile2",
27 | },
28 | };
29 |
30 | export const Tablet: StoryObj = Template.bind({}) as any;
31 | Tablet.parameters = {
32 | viewport: {
33 | defaultViewport: "tablet",
34 | },
35 | };
36 |
37 | export const FullPage: StoryObj = Template.bind({}) as any;
38 | FullPage.decorators = [
39 | (story: StoryFn) => {
40 | return {
41 | Component: MockPageTransitions,
42 | slot: story,
43 | };
44 | },
45 | ];
46 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/settings/SettingsSlider.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
33 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/settings/SettingsSwitch.svelte:
--------------------------------------------------------------------------------
1 |
9 |
10 |
15 |
22 |
23 |
24 |
36 |
--------------------------------------------------------------------------------
/src-svelte/src/routes/settings/SettingsSwitch.test.ts:
--------------------------------------------------------------------------------
1 | import { assert, expect, test, vi } from "vitest";
2 | import "@testing-library/jest-dom";
3 |
4 | import { act, render, screen } from "@testing-library/svelte";
5 | import userEvent from "@testing-library/user-event";
6 | import SettingsSwitch from "./SettingsSwitch.svelte";
7 | import { stubGlobalInvoke } from "$lib/sample-call-testing";
8 |
9 | const tauriInvokeMock = vi.fn();
10 | stubGlobalInvoke(tauriInvokeMock);
11 |
12 | describe("Settings switch", () => {
13 | test("can be toggled on from clicking the container", async () => {
14 | const { container } = render(SettingsSwitch, { label: "Test" });
15 |
16 | const switchContainer = container.querySelector(".settings-switch");
17 | assert(switchContainer);
18 | const onOffSwitch = screen.getByRole("switch");
19 | expect(onOffSwitch).toHaveAttribute("aria-checked", "false");
20 | await act(() => userEvent.click(switchContainer));
21 | expect(onOffSwitch).toHaveAttribute("aria-checked", "true");
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src-svelte/src/testSetup.ts:
--------------------------------------------------------------------------------
1 | import { ensureStorybookRunning, killStorybook } from "$lib/test-helpers";
2 |
3 | export default async function setup() {
4 | const storybookProcess = await ensureStorybookRunning();
5 |
6 | return () => killStorybook(storybookProcess);
7 | }
8 |
--------------------------------------------------------------------------------
/src-svelte/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/src-svelte/src/vitest-mocks/navigation.ts:
--------------------------------------------------------------------------------
1 | import { mockStores } from "./stores";
2 |
3 | export function goto(url: string) {
4 | mockStores.page.set({
5 | url: new URL(url, window.location.href),
6 | params: {},
7 | });
8 | }
9 |
--------------------------------------------------------------------------------
/src-svelte/src/vitest-mocks/stores.ts:
--------------------------------------------------------------------------------
1 | import { readable, writable } from "svelte/store";
2 | import type { Subscriber } from "svelte/store";
3 |
4 | interface Page {
5 | url: URL;
6 | params: Record;
7 | }
8 |
9 | export const mockStores = {
10 | navigating: readable(null),
11 | page: writable({ url: new URL("http://localhost"), params: {} }),
12 | session: writable(null),
13 | updated: readable(false),
14 | };
15 |
16 | export const page = {
17 | subscribe(fn: Subscriber) {
18 | return mockStores.page.subscribe(fn);
19 | },
20 | };
21 |
--------------------------------------------------------------------------------
/src-svelte/static/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/favicon.png
--------------------------------------------------------------------------------
/src-svelte/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logo.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/amos-ng.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/amos-ng.jpg
--------------------------------------------------------------------------------
/src-svelte/static/logos/async-openai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/async-openai.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/diesel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/diesel.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/element-plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/element-plus.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/font-awesome.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src-svelte/static/logos/gravity-ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/gravity-ui.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/iconify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/iconify.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/jest-image-snapshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/jest-image-snapshot.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/phosphor-icons.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src-svelte/static/logos/pixabay.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/pixabay.jpeg
--------------------------------------------------------------------------------
/src-svelte/static/logos/quicktype.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/quicktype.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/soundreality.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/soundreality.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/specta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/specta.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/streamline.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src-svelte/static/logos/tabler.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src-svelte/static/logos/tauri.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/tauri.png
--------------------------------------------------------------------------------
/src-svelte/static/logos/typodermic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/logos/typodermic.png
--------------------------------------------------------------------------------
/src-svelte/static/public-fonts/zhi-mang-xing.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-svelte/static/public-fonts/zhi-mang-xing.ttf
--------------------------------------------------------------------------------
/src-svelte/static/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src-svelte/svelte.config.js:
--------------------------------------------------------------------------------
1 | import adapter from "@sveltejs/adapter-static";
2 | import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
3 |
4 | /** @type {import('@sveltejs/kit').Config} */
5 | const config = {
6 | // Consult https://kit.svelte.dev/docs/integrations#preprocessors
7 | // for more information about preprocessors
8 | preprocess: vitePreprocess(),
9 |
10 | kit: {
11 | adapter: adapter(),
12 | prerender: {
13 | crawl: false,
14 | entries: [
15 | "*",
16 | "/database/api-calls/new/",
17 | "/database/api-calls/[slug]",
18 | "/database/terminal-sessions/new/",
19 | "/database/terminal-sessions/[slug]",
20 | ],
21 | },
22 | },
23 | };
24 |
25 | export default config;
26 |
--------------------------------------------------------------------------------
/src-svelte/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./.svelte-kit/tsconfig.json",
3 | "compilerOptions": {
4 | "allowJs": true,
5 | "checkJs": true,
6 | "esModuleInterop": true,
7 | "forceConsistentCasingInFileNames": true,
8 | "resolveJsonModule": true,
9 | "skipLibCheck": true,
10 | "sourceMap": true,
11 | "strict": true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src-svelte/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler"
7 | },
8 | "include": ["vite.config.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/src-svelte/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import { sveltekit } from "@sveltejs/kit/vite";
3 | import Icons from "unplugin-icons/vite";
4 |
5 | // https://vitejs.dev/config/
6 | export default defineConfig(async () => ({
7 | plugins: [
8 | sveltekit(),
9 | Icons({
10 | compiler: "svelte",
11 | }),
12 | ],
13 |
14 | // Vite options tailored for Tauri development and only applied in `tauri dev`
15 | // or `tauri build`
16 | //
17 | // 1. prevent vite from obscuring rust errors
18 | clearScreen: false,
19 | // 2. tauri expects a fixed port, fail if that port is not available
20 | server: {
21 | port: 1420,
22 | strictPort: true,
23 | },
24 | // 3. to make use of `TAURI_DEBUG` and other env variables
25 | // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand
26 | envPrefix: [`VITE_`, `TAURI_`],
27 | }));
28 |
--------------------------------------------------------------------------------
/src-svelte/vitest.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vitest/config";
2 | import { svelte } from "@sveltejs/vite-plugin-svelte";
3 | import Icons from "unplugin-icons/vite";
4 | import * as path from "path";
5 |
6 | export default defineConfig({
7 | plugins: [
8 | svelte({ hot: !process.env.VITEST }),
9 | Icons({
10 | compiler: "svelte",
11 | }),
12 | ],
13 | resolve: {
14 | alias: {
15 | $lib: path.resolve("src/lib"),
16 | $app: path.resolve("src/vitest-mocks"),
17 | },
18 | },
19 | test: {
20 | include: ["src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
21 | globals: true,
22 | environment: "jsdom",
23 | alias: [{ find: /^svelte$/, replacement: "svelte/internal" }],
24 | globalSetup: "src/testSetup.ts",
25 | poolOptions: {
26 | threads: {
27 | singleThread: true,
28 | },
29 | },
30 | },
31 | });
32 |
--------------------------------------------------------------------------------
/src-tauri/.gitignore:
--------------------------------------------------------------------------------
1 | # Generated by Cargo
2 | # will have compiled files and executables
3 | /target/
4 | /gen/
5 |
--------------------------------------------------------------------------------
/src-tauri/.rustfmt.toml:
--------------------------------------------------------------------------------
1 | # to be compatible with Python black
2 | max_width = 88
3 |
--------------------------------------------------------------------------------
/src-tauri/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: format lint test tests clean release
2 |
3 | target/release/zamm: ./Cargo.toml ../src-svelte/build $(shell find . -type f \( -name "*.rs" \) -not -path "./target/*")
4 | cargo build --release --features custom-protocol
5 | touch target/release/zamm
6 |
7 | all: format lint test build
8 |
9 | format:
10 | cargo fmt
11 |
12 | lint:
13 | cargo clippy -- -Dwarnings
14 |
15 | test: tests
16 | tests:
17 | cargo test -- --include-ignored --test-threads=1
18 |
19 | test-files:
20 | python3 api/sample-database-writes/many-api-calls/generate.py
21 |
22 | clean:
23 | cargo clean
24 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/chat-manual-conversation-recreation.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - chat
3 | - >
4 | {
5 | "args": {
6 | "provider": "OpenAI",
7 | "llm": "gpt-4",
8 | "temperature": null,
9 | "prompt": [
10 | {
11 | "role": "System",
12 | "text": "You are ZAMM, a chat program. Respond in first person."
13 | },
14 | {
15 | "role": "Human",
16 | "text": "Hello, does this work?"
17 | },
18 | {
19 | "role": "AI",
20 | "text": "Yes, it works. How can I assist you today?"
21 | },
22 | {
23 | "role": "Human",
24 | "text": "Tell me something funny."
25 | }
26 | ]
27 | }
28 | }
29 | response:
30 | message: >
31 | {
32 | "id": "c13c1e67-2de3-48de-a34c-a32079c03316",
33 | "timestamp": "2024-01-16T09:50:19.738093890",
34 | "response_message": {
35 | "role": "AI",
36 | "text": "Sure, here's a joke for you: Why don't scientists trust atoms? Because they make up everything!"
37 | }
38 | }
39 | sideEffects:
40 | database:
41 | startStateDump: conversation-started
42 | endStateDump: conversation-manually-recreated
43 | network:
44 | recordingFile: continue-conversation.json
45 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/chat-start-conversation-ollama.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - chat
3 | - >
4 | {
5 | "args": {
6 | "provider": "Ollama",
7 | "llm": "llama3:8b",
8 | "temperature": null,
9 | "prompt": [
10 | {
11 | "role": "System",
12 | "text": "You are ZAMM, a chat program. Respond in first person."
13 | },
14 | {
15 | "role": "Human",
16 | "text": "Hello, does this work?"
17 | }
18 | ]
19 | }
20 | }
21 | response:
22 | message: >
23 | {
24 | "id": "506e2d1f-549c-45cc-ad65-57a0741f06ee",
25 | "timestamp": "2024-08-07T18:46:15.717997",
26 | "response_message": {
27 | "role": "AI",
28 | "text": "Hello there! Yes, it looks like I'm functioning properly. I'm ZAMM, a chat program designed to assist and converse with you. I'm happy to be here and help answer any questions or topics you'd like to discuss. What's on your mind today?"
29 | }
30 | }
31 | sideEffects:
32 | database:
33 | endStateDump: conversation-started-ollama
34 | network:
35 | recordingFile: start-conversation-ollama.json
36 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/chat-start-conversation.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - chat
3 | - >
4 | {
5 | "args": {
6 | "provider": "OpenAI",
7 | "llm": "gpt-4",
8 | "temperature": null,
9 | "prompt": [
10 | {
11 | "role": "System",
12 | "text": "You are ZAMM, a chat program. Respond in first person."
13 | },
14 | {
15 | "role": "Human",
16 | "text": "Hello, does this work?"
17 | }
18 | ]
19 | }
20 | }
21 | response:
22 | message: >
23 | {
24 | "id": "d5ad1e49-f57f-4481-84fb-4d70ba8a7a74",
25 | "timestamp": "2024-01-16T08:50:19.738093890",
26 | "response_message": {
27 | "role": "AI",
28 | "text": "Yes, it works. How can I assist you today?"
29 | }
30 | }
31 | sideEffects:
32 | database:
33 | endStateDump: conversation-started
34 | network:
35 | recordingFile: start-conversation.json
36 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/export_db-api-key.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - export_db
3 | - >
4 | {
5 | "path": "different.zamm.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "num_api_keys": 1
11 | }
12 | sideEffects:
13 | disk:
14 | endStateDirectory: db-import-export/different-api-key
15 | database:
16 | startStateDump: different-openai-api-key
17 | endStateDump: different-openai-api-key
18 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/export_db-conversations.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - export_db
3 | - >
4 | {
5 | "path": "test-folder/exported-db.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "num_llm_calls": 6
11 | }
12 | sideEffects:
13 | disk:
14 | endStateDirectory: db-import-export/conversation-edited-2
15 | database:
16 | startStateDump: conversation-edited-2
17 | endStateDump: conversation-edited-2
18 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/export_db-terminal-sessions.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - export_db
3 | - >
4 | {
5 | "path": "exported-db.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "num_terminal_sessions": 1
11 | }
12 | sideEffects:
13 | disk:
14 | endStateDirectory: db-import-export/terminal-sessions
15 | database:
16 | startStateDump: command-run-cmd-dir
17 | endStateDump: command-run-cmd-dir
18 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_call-no-links.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_api_call
3 | - >
4 | {
5 | "id": "d5ad1e49-f57f-4481-84fb-4d70ba8a7a74"
6 | }
7 | response:
8 | message: >
9 | {
10 | "id": "d5ad1e49-f57f-4481-84fb-4d70ba8a7a74",
11 | "timestamp": "2024-01-16T08:50:19.738093890",
12 | "llm": {
13 | "name": "gpt-4-0613",
14 | "requested": "gpt-4",
15 | "provider": "OpenAI"
16 | },
17 | "request": {
18 | "prompt": {
19 | "type": "Chat",
20 | "messages": [
21 | {
22 | "role": "System",
23 | "text": "You are ZAMM, a chat program. Respond in first person."
24 | },
25 | {
26 | "role": "Human",
27 | "text": "Hello, does this work?"
28 | }
29 | ]
30 | },
31 | "temperature": 1.0
32 | },
33 | "response": {
34 | "completion": {
35 | "role": "AI",
36 | "text": "Yes, it works. How can I assist you today?"
37 | }
38 | },
39 | "tokens": {
40 | "prompt": 32,
41 | "response": 12,
42 | "total": 44
43 | }
44 | }
45 | sideEffects:
46 | database:
47 | startStateDump: conversation-started
48 | endStateDump: conversation-started
49 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_call-unknown-provider-prompt.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_api_call
3 | - >
4 | {
5 | "id": "037b28dd-6f24-4e68-9dfb-3caa1889d886"
6 | }
7 | response:
8 | message: >
9 | {
10 | "id": "037b28dd-6f24-4e68-9dfb-3caa1889d886",
11 | "timestamp": "2024-07-29T17:30:11.073212",
12 | "llm": {
13 | "name": "unknown-future-llm",
14 | "requested": "unknown-future-llm",
15 | "provider": {
16 | "Unknown": "Unknown Future Provider"
17 | }
18 | },
19 | "request": {
20 | "prompt": {
21 | "type": "Unknown"
22 | },
23 | "temperature": 1.0
24 | },
25 | "response": {
26 | "completion": {
27 | "role": "AI",
28 | "text": "I'm sorry to hear that. How can I assist you better?"
29 | }
30 | },
31 | "tokens": {
32 | "prompt": 47,
33 | "response": 14,
34 | "total": 61
35 | }
36 | }
37 | sideEffects:
38 | database:
39 | startStateDump: unknown-provider-prompt-export
40 | endStateDump: unknown-provider-prompt-export
41 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_calls-empty.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_api_calls
3 | - >
4 | {
5 | "offset": 0
6 | }
7 | response:
8 | message: >
9 | []
10 | sideEffects:
11 | database:
12 | startStateDump: empty
13 | endStateDump: empty
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_calls-offset-empty.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_api_calls
3 | - >
4 | {
5 | "offset": 100
6 | }
7 | response:
8 | message: >
9 | []
10 | sideEffects:
11 | database:
12 | startStateDump: many-api-calls
13 | endStateDump: many-api-calls
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_calls-small.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_api_calls
3 | - >
4 | {
5 | "offset": 0
6 | }
7 | response:
8 | message: >
9 | [
10 | {
11 | "id": "c13c1e67-2de3-48de-a34c-a32079c03316",
12 | "timestamp": "2024-01-16T09:50:19.738093890",
13 | "response_message": {
14 | "role": "AI",
15 | "text": "Sure, here's a joke for you: Why don't scientists trust atoms? Because they make up everything!"
16 | }
17 | },
18 | {
19 | "id": "d5ad1e49-f57f-4481-84fb-4d70ba8a7a74",
20 | "timestamp": "2024-01-16T08:50:19.738093890",
21 | "response_message": {
22 | "role": "AI",
23 | "text": "Yes, it works. How can I assist you today?"
24 | }
25 | }
26 | ]
27 | sideEffects:
28 | database:
29 | startStateDump: conversation-continued
30 | endStateDump: conversation-continued
31 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_calls-unknown-provider-prompt.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_api_calls
3 | - >
4 | {
5 | "offset": 0
6 | }
7 | response:
8 | message: >
9 | [
10 | {
11 | "id": "037b28dd-6f24-4e68-9dfb-3caa1889d886",
12 | "timestamp": "2024-07-29T17:30:11.073212",
13 | "response_message": {
14 | "role": "AI",
15 | "text": "I'm sorry to hear that. How can I assist you better?"
16 | }
17 | },
18 | {
19 | "id": "c13c1e67-2de3-48de-a34c-a32079c03316",
20 | "timestamp": "2024-01-16T09:50:19.738093890",
21 | "response_message": {
22 | "role": "AI",
23 | "text": "Sure, here's a joke for you: Why don't scientists trust atoms? Because they make up everything!"
24 | }
25 | },
26 | {
27 | "id": "d5ad1e49-f57f-4481-84fb-4d70ba8a7a74",
28 | "timestamp": "2024-01-16T08:50:19.738093890",
29 | "response_message": {
30 | "role": "AI",
31 | "text": "Yes, it works. How can I assist you today?"
32 | }
33 | }
34 | ]
35 | sideEffects:
36 | database:
37 | startStateDump: unknown-provider-prompt
38 | endStateDump: unknown-provider-prompt-export
39 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_keys-empty.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_api_keys"]
2 | response:
3 | message: >
4 | {
5 | "openai": null
6 | }
7 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_api_keys-openai.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_api_keys"]
2 | response:
3 | message: >
4 | {
5 | "openai": "0p3n41-4p1-k3y"
6 | }
7 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-animation-speed-override.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "animation_speed": 0.9
6 | }
7 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-animations-override.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "animations_on": false
6 | }
7 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-extra-settings.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "sound_on": false
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: preferences/sound-off-extra-settings
10 | endStateDirectory: preferences/sound-off-extra-settings
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-high-dpi-adjust-on.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "high_dpi_adjust": true
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: preferences/high-dpi-adjust-on
10 | endStateDirectory: preferences/high-dpi-adjust-on
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-no-file-mac.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "high_dpi_adjust": true
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: empty
10 | endStateDirectory: empty
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-no-file-windows.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "transparency_on": true
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: empty
10 | endStateDirectory: empty
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-no-file.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {}
5 | sideEffects:
6 | disk:
7 | startStateDirectory: empty
8 | endStateDirectory: empty
9 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-sound-override.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "sound_on": false
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: preferences/sound-override
10 | endStateDirectory: preferences/sound-override
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-transparency-off.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "transparency_on": false
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: preferences/transparency-off
10 | endStateDirectory: preferences/transparency-off
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-transparency-on.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "transparency_on": true
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: preferences/transparency-on
10 | endStateDirectory: preferences/transparency-on
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_preferences-volume-override.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_preferences"]
2 | response:
3 | message: >
4 | {
5 | "volume": 0.8
6 | }
7 | sideEffects:
8 | disk:
9 | startStateDirectory: preferences/volume-override
10 | endStateDirectory: preferences/volume-override
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_system_info-linux.yaml:
--------------------------------------------------------------------------------
1 | request: ["get_system_info"]
2 | response:
3 | message: >
4 | {
5 | "zamm_version": "0.0.0",
6 | "os": "Linux",
7 | "shell": "Zsh",
8 | "shell_init_file": "/root/.zshrc"
9 | }
10 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_terminal_session-bash-interleaved.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_terminal_session
3 | - >
4 | {
5 | "id": "3717ed48-ab52-4654-9f33-de5797af5118"
6 | }
7 | response:
8 | message: >
9 | {
10 | "id": "3717ed48-ab52-4654-9f33-de5797af5118",
11 | "timestamp": "2024-09-24T16:27:25",
12 | "command": "bash",
13 | "os": "Mac",
14 | "output": "The default interactive shell is now zsh.\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\nFor more details, please visit https://support.apple.com/kb/HT208050.\nbash-3.2$ python api/sample-terminal-sessions/interleaved.py\nstdout\nstderr\nstdout\nbash-3.2$ ",
15 | "is_active": false
16 | }
17 | sideEffects:
18 | database:
19 | startStateDump: command-run-bash-interleaved
20 | endStateDump: command-run-bash-interleaved
21 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_terminal_session-bash.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_terminal_session
3 | - >
4 | {
5 | "id": "3717ed48-ab52-4654-9f33-de5797af5118"
6 | }
7 | response:
8 | message: >
9 | {
10 | "id": "3717ed48-ab52-4654-9f33-de5797af5118",
11 | "timestamp": "2024-09-24T16:27:25",
12 | "command": "bash",
13 | "os": "Mac",
14 | "output": "The default interactive shell is now zsh.\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\nFor more details, please visit https://support.apple.com/kb/HT208050.\nbash-3.2$ ",
15 | "is_active": true
16 | }
17 | sideEffects:
18 | database:
19 | startStateDump: command-run-bash
20 | endStateDump: command-run-bash
21 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_terminal_sessions-empty.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_terminal_sessions
3 | - >
4 | {
5 | "offset": 0
6 | }
7 | response:
8 | message: >
9 | []
10 | sideEffects:
11 | database:
12 | startStateDump: empty
13 | endStateDump: empty
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/get_terminal_sessions-small.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - get_terminal_sessions
3 | - >
4 | {
5 | "offset": 0
6 | }
7 | response:
8 | message: >
9 | [
10 | {
11 | "id": "3717ed48-ab52-4654-9f33-de5797af5118",
12 | "timestamp": "2024-09-24T16:27:25",
13 | "command": "bash",
14 | "last_io": "python api/sample-terminal-sessions/interleaved.py"
15 | }
16 | ]
17 | sideEffects:
18 | database:
19 | startStateDump: command-run-bash-interleaved
20 | endStateDump: command-run-bash-interleaved
21 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/import_db-api-key.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - import_db
3 | - >
4 | {
5 | "path": "different.zamm.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "imported": {
11 | "num_api_keys": 1
12 | }
13 | }
14 | sideEffects:
15 | disk:
16 | startStateDirectory: db-import-export/different-api-key
17 | endStateDirectory: db-import-export/different-api-key
18 | database:
19 | endStateDump: different-openai-api-key
20 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/import_db-conflicting-api-key.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - import_db
3 | - >
4 | {
5 | "path": "different.zamm.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "ignored": {
11 | "num_api_keys": 1
12 | }
13 | }
14 | sideEffects:
15 | disk:
16 | startStateDirectory: db-import-export/different-api-key
17 | endStateDirectory: db-import-export/different-api-key
18 | database:
19 | startStateDump: openai-api-key
20 | endStateDump: openai-api-key
21 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/import_db-conflicting-llm-call.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - import_db
3 | - >
4 | {
5 | "path": "conflicting-db.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "imported": {
11 | "num_llm_calls": 1
12 | },
13 | "ignored": {
14 | "num_llm_calls": 1
15 | }
16 | }
17 | sideEffects:
18 | disk:
19 | startStateDirectory: db-import-export/conflicting-llm-call
20 | endStateDirectory: db-import-export/conflicting-llm-call
21 | database:
22 | startStateDump: conversation-edited
23 | endStateDump: conversation-edited-2
24 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/import_db-initially-empty.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - import_db
3 | - >
4 | {
5 | "path": "test-folder/exported-db.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "imported": {
11 | "num_llm_calls": 6
12 | }
13 | }
14 | sideEffects:
15 | disk:
16 | startStateDirectory: db-import-export/conversation-edited-2
17 | endStateDirectory: db-import-export/conversation-edited-2
18 | database:
19 | endStateDump: conversation-edited-2
20 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/import_db-terminal-sessions.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - import_db
3 | - >
4 | {
5 | "path": "exported-db.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "imported": {
11 | "num_terminal_sessions": 1
12 | }
13 | }
14 | sideEffects:
15 | disk:
16 | startStateDirectory: db-import-export/terminal-sessions
17 | endStateDirectory: db-import-export/terminal-sessions
18 | database:
19 | endStateDump: command-run-cmd-dir
20 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/import_db-unknown-provider-prompt.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - import_db
3 | - >
4 | {
5 | "path": "unknown-provider-prompt.zamm.yaml"
6 | }
7 | response:
8 | success: false
9 | message: >
10 | "Cannot import from ZAMM version 99.0.0. Data contains unknown prompt types."
11 | sideEffects:
12 | disk:
13 | startStateDirectory: db-import-export/forward-compatibility
14 | endStateDirectory: db-import-export/forward-compatibility
15 | database:
16 | endStateDump: empty
17 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/import_db-unknown-provider.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - import_db
3 | - >
4 | {
5 | "path": "unknown-provider.zamm.yaml"
6 | }
7 | response:
8 | message: >
9 | {
10 | "imported": {
11 | "num_llm_calls": 3
12 | }
13 | }
14 | sideEffects:
15 | disk:
16 | startStateDirectory: db-import-export/forward-compatibility
17 | endStateDirectory: db-import-export/forward-compatibility
18 | database:
19 | endStateDump: unknown-provider-import
20 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/play_sound-switch.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - play_sound
3 | - >
4 | {
5 | "sound": "Switch",
6 | "volume": 1,
7 | "speed": 1
8 | }
9 | response:
10 | message: "null"
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/play_sound-whoosh.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - play_sound
3 | - >
4 | {
5 | "sound": "Whoosh",
6 | "volume": 0.5,
7 | "speed": 0.25
8 | }
9 | response:
10 | message: "null"
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/run_command-bash.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - run_command
3 | - >
4 | {
5 | "command": "bash"
6 | }
7 | response:
8 | message: >
9 | {
10 | "id": "3717ed48-ab52-4654-9f33-de5797af5118",
11 | "timestamp": "2024-09-24T16:27:25",
12 | "command": "bash",
13 | "os": "Mac",
14 | "output": "The default interactive shell is now zsh.\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\nFor more details, please visit https://support.apple.com/kb/HT208050.\nbash-3.2$ ",
15 | "is_active": true
16 | }
17 | sideEffects:
18 | database:
19 | endStateDump: command-run-bash
20 | terminal:
21 | recordingFile: bash.cast
22 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/run_command-cmd.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - run_command
3 | - >
4 | {
5 | "command": "cmd"
6 | }
7 | response:
8 | message: >
9 | {
10 | "id": "319cc7fd-58cc-4320-ab46-2f0ba11c5402",
11 | "timestamp": "2024-10-17T06:02:13",
12 | "command": "cmd",
13 | "os": "Windows",
14 | "output": "Microsoft Windows [Version 10.0.22631.4169]\n(c) Microsoft Corporation. All rights reserved.\n\nC:\\Users\\Amos Ng\\Documents\\projects\\zamm-dev\\zamm\\src-tauri>",
15 | "is_active": true
16 | }
17 | sideEffects:
18 | database:
19 | endStateDump: command-run-cmd
20 | terminal:
21 | recordingFile: windows.cast
22 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/run_command-date.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - run_command
3 | - >
4 | {
5 | "command": "date \"+%A %B %e, %Y %R %z\""
6 | }
7 | response:
8 | message: >
9 | {
10 | "id": "38a5e2ea-2222-4913-9b20-2a1c682ab358",
11 | "timestamp": "2024-09-20T11:23:53",
12 | "command": "date \"+%A %B %e, %Y %R %z\"",
13 | "os": "Linux",
14 | "output": "Friday September 20, 2024 18:23 +0700\n",
15 | "is_active": true
16 | }
17 | sideEffects:
18 | database:
19 | endStateDump: command-run-date
20 | terminal:
21 | recordingFile: date.cast
22 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/send_command_input-bash-interleaved.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - send_command_input
3 | - >
4 | {
5 | "session_id": "3717ed48-ab52-4654-9f33-de5797af5118",
6 | "input": "python api/sample-terminal-sessions/interleaved.py"
7 | }
8 | response:
9 | message: >
10 | "python api/sample-terminal-sessions/interleaved.py\nstdout\nstderr\nstdout\nbash-3.2$ "
11 | sideEffects:
12 | database:
13 | startStateDump: command-run-bash
14 | endStateDump: command-run-bash-interleaved
15 | terminal:
16 | recordingFile: bash.cast
17 | startingIndex: 1
18 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-different.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": ".bashrc",
6 | "service": "OpenAI",
7 | "api_key": "4-d1ff3r3n7-k3y"
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: shell-init/different
14 | database:
15 | startStateDump: openai-api-key
16 | endStateDump: different-openai-api-key
17 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-empty-filename.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": "",
6 | "service": "OpenAI",
7 | "api_key": "0p3n41-4p1-k3y"
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | startStateDirectory: empty
14 | endStateDirectory: empty
15 | database:
16 | startStateDump: empty
17 | endStateDump: openai-api-key
18 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-existing-no-newline.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": ".bashrc",
6 | "service": "OpenAI",
7 | "api_key": "0p3n41-4p1-k3y"
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | startStateDirectory: shell-init/no-newline/start
14 | endStateDirectory: shell-init/no-newline/end
15 | database:
16 | endStateDump: openai-api-key
17 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-existing-with-newline.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": ".bashrc",
6 | "service": "OpenAI",
7 | "api_key": "0p3n41-4p1-k3y"
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | startStateDirectory: shell-init/with-newline/start
14 | endStateDirectory: shell-init/with-newline/end
15 | database:
16 | endStateDump: openai-api-key
17 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-invalid-filename.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": "/",
6 | "service": "OpenAI",
7 | "api_key": "0p3n41-4p1-k3y"
8 | }
9 | response:
10 | success: false
11 | message: >
12 | "IO error: Is a directory (os error 21)"
13 | sideEffects:
14 | disk:
15 | startStateDirectory: empty
16 | endStateDirectory: empty
17 | database:
18 | endStateDump: openai-api-key
19 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-nested-folder.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": "folder/.bashrc",
6 | "service": "OpenAI",
7 | "api_key": "0p3n41-4p1-k3y"
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | startStateDirectory: shell-init/nested/start
14 | endStateDirectory: shell-init/nested/end
15 | database:
16 | endStateDump: openai-api-key
17 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-no-disk-write.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": null,
6 | "service": "OpenAI",
7 | "api_key": "0p3n41-4p1-k3y"
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | startStateDirectory: empty
14 | endStateDirectory: empty
15 | database:
16 | endStateDump: openai-api-key
17 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-no-file.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": ".bashrc",
6 | "service": "OpenAI",
7 | "api_key": "0p3n41-4p1-k3y"
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: shell-init/new-file
14 | database:
15 | endStateDump: openai-api-key
16 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_api_key-unset.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_api_key
3 | - >
4 | {
5 | "filename": ".bashrc",
6 | "service": "OpenAI",
7 | "api_key": ""
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | startStateDirectory: shell-init/with-newline/end
14 | endStateDirectory: shell-init/with-newline/end
15 | database:
16 | startStateDump: openai-api-key
17 | endStateDump: empty
18 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_preferences-high-dpi-adjust-off.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_preferences
3 | - >
4 | {
5 | "preferences": {
6 | "high_dpi_adjust": false
7 | }
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: preferences/high-dpi-adjust-off
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_preferences-high-dpi-adjust-on.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_preferences
3 | - >
4 | {
5 | "preferences": {
6 | "high_dpi_adjust": true
7 | }
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: preferences/high-dpi-adjust-on
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_preferences-sound-off.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_preferences
3 | - >
4 | {
5 | "preferences": {
6 | "sound_on": false
7 | }
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: preferences/sound-override
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_preferences-sound-on.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_preferences
3 | - >
4 | {
5 | "preferences": {
6 | "sound_on": true
7 | }
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | startStateDirectory: preferences/sound-off-extra-settings
14 | endStateDirectory: preferences/sound-on-extra-settings
15 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_preferences-transparency-off.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_preferences
3 | - >
4 | {
5 | "preferences": {
6 | "transparency_on": false
7 | }
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: preferences/transparency-off
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_preferences-transparency-on.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_preferences
3 | - >
4 | {
5 | "preferences": {
6 | "transparency_on": true
7 | }
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: preferences/transparency-on
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/set_preferences-volume-partial.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - set_preferences
3 | - >
4 | {
5 | "preferences": {
6 | "volume": 0.8
7 | }
8 | }
9 | response:
10 | message: "null"
11 | sideEffects:
12 | disk:
13 | endStateDirectory: preferences/volume-override
14 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/upgrade-first-init.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - upgrade
3 | response:
4 | message: "null"
5 | sideEffects:
6 | disk:
7 | endStateDirectory: preferences/version-init
8 | database:
9 | startStateDump: empty
10 | endStateDump: empty
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/upgrade-from-future-version.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - upgrade
3 | response:
4 | message: "null"
5 | sideEffects:
6 | disk:
7 | startStateDirectory: preferences/future-version
8 | endStateDirectory: preferences/future-version
9 | database:
10 | startStateDump: sample-v0.1.3-db
11 | endStateDump: sample-v0.1.3-db
12 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-calls/upgrade-to-v0.1.4.yaml:
--------------------------------------------------------------------------------
1 | request:
2 | - upgrade
3 | response:
4 | message: "null"
5 | sideEffects:
6 | disk:
7 | startStateDirectory: preferences/sound-override
8 | endStateDirectory: preferences/version-update
9 | database:
10 | startStateDump: sample-v0.1.3-db
11 | endStateDump: sample-v0.1.4-db
12 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-bash-interleaved/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO asciicasts VALUES('3717ed48-ab52-4654-9f33-de5797af5118','2024-09-24 16:27:25','bash','Mac',replace('{"version":2,"width":80,"height":24,"timestamp":1727195245,"command":"bash"}\012[0.208,"o","\r\nThe default interactive shell is now zsh.\r\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\r\nFor more details, please visit https://support.apple.com/kb/HT208050.\r\nbash-3.2$ "]\012[0.208,"i","python api/sample-terminal-sessions/interleaved.py\n"]\012[0.412,"o","python api/sample-terminal-sessions/interleaved.py\r\nstdout\r\nstderr\r\nstdout\r\nbash-3.2$ "]','\012',char(10)));
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-bash-interleaved/dump.yaml:
--------------------------------------------------------------------------------
1 | terminal_sessions:
2 | - id: 3717ed48-ab52-4654-9f33-de5797af5118
3 | timestamp: 2024-09-24T16:27:25
4 | command: bash
5 | os: Mac
6 | cast: |-
7 | {"version":2,"width":80,"height":24,"timestamp":1727195245,"command":"bash"}
8 | [0.208,"o","\r\nThe default interactive shell is now zsh.\r\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\r\nFor more details, please visit https://support.apple.com/kb/HT208050.\r\nbash-3.2$ "]
9 | [0.208,"i","python api/sample-terminal-sessions/interleaved.py\n"]
10 | [0.412,"o","python api/sample-terminal-sessions/interleaved.py\r\nstdout\r\nstderr\r\nstdout\r\nbash-3.2$ "]
11 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-bash/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO asciicasts VALUES('3717ed48-ab52-4654-9f33-de5797af5118','2024-09-24 16:27:25','bash','Mac',replace('{"version":2,"width":80,"height":24,"timestamp":1727195245,"command":"bash"}\012[0.208,"o","\r\nThe default interactive shell is now zsh.\r\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\r\nFor more details, please visit https://support.apple.com/kb/HT208050.\r\nbash-3.2$ "]','\012',char(10)));
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-bash/dump.yaml:
--------------------------------------------------------------------------------
1 | terminal_sessions:
2 | - id: 3717ed48-ab52-4654-9f33-de5797af5118
3 | timestamp: 2024-09-24T16:27:25
4 | command: bash
5 | os: Mac
6 | cast: |-
7 | {"version":2,"width":80,"height":24,"timestamp":1727195245,"command":"bash"}
8 | [0.208,"o","\r\nThe default interactive shell is now zsh.\r\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\r\nFor more details, please visit https://support.apple.com/kb/HT208050.\r\nbash-3.2$ "]
9 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-cmd/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO asciicasts VALUES('319cc7fd-58cc-4320-ab46-2f0ba11c5402','2024-10-17 06:02:13','cmd','Windows',replace('{"version":2,"width":80,"height":24,"timestamp":1729144933,"command":"cmd"}\012[0.208,"o","\u001b[?25l\u001b[2J\u001b[m\u001b[HMicrosoft Windows [Version 10.0.22631.4169]\r\n(c) Microsoft Corporation. All rights reserved.\u001b[4;1HC:\\Users\\Amos Ng\\Documents\\projects\\zamm-dev\\zamm\\src-tauri>\u001b]0;C:\\WINDOWS\\system32\\cmd.EXE\u0007\u001b[?25h"]','\012',char(10)));
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-cmd/dump.yaml:
--------------------------------------------------------------------------------
1 | terminal_sessions:
2 | - id: 319cc7fd-58cc-4320-ab46-2f0ba11c5402
3 | timestamp: 2024-10-17T06:02:13
4 | command: cmd
5 | os: Windows
6 | cast: |-
7 | {"version":2,"width":80,"height":24,"timestamp":1729144933,"command":"cmd"}
8 | [0.208,"o","\u001b[?25l\u001b[2J\u001b[m\u001b[HMicrosoft Windows [Version 10.0.22631.4169]\r\n(c) Microsoft Corporation. All rights reserved.\u001b[4;1HC:\\Users\\Amos Ng\\Documents\\projects\\zamm-dev\\zamm\\src-tauri>\u001b]0;C:\\WINDOWS\\system32\\cmd.EXE\u0007\u001b[?25h"]
9 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-date/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO asciicasts VALUES('38a5e2ea-2222-4913-9b20-2a1c682ab358','2024-09-20 11:23:53','date "+%A %B %e, %Y %R %z"','Linux',replace('{"version":2,"width":80,"height":24,"timestamp":1726831433,"command":"date \"+%A %B %e, %Y %R %z\""}\012[0.102,"o","Friday September 20, 2024 18:23 +0700\r\n"]','\012',char(10)));
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/command-run-date/dump.yaml:
--------------------------------------------------------------------------------
1 | terminal_sessions:
2 | - id: 38a5e2ea-2222-4913-9b20-2a1c682ab358
3 | timestamp: 2024-09-20T11:23:53
4 | command: date "+%A %B %e, %Y %R %z"
5 | os: Linux
6 | cast: |-
7 | {"version":2,"width":80,"height":24,"timestamp":1726831433,"command":"date \"+%A %B %e, %Y %R %z\""}
8 | [0.102,"o","Friday September 20, 2024 18:23 +0700\r\n"]
9 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/conversation-continued/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO llm_calls VALUES('d5ad1e49-f57f-4481-84fb-4d70ba8a7a74','2024-01-16 08:50:19.738093890','open_ai','gpt-4','gpt-4-0613',1.0,32,12,44,'{"type":"Chat","messages":[{"role":"System","text":"You are ZAMM, a chat program. Respond in first person."},{"role":"Human","text":"Hello, does this work?"}]}','{"role":"AI","text":"Yes, it works. How can I assist you today?"}');
2 | INSERT INTO llm_calls VALUES('c13c1e67-2de3-48de-a34c-a32079c03316','2024-01-16 09:50:19.738093890','open_ai','gpt-4','gpt-4-0613',1.0,57,22,79,'{"type":"Chat","messages":[{"role":"System","text":"You are ZAMM, a chat program. Respond in first person."},{"role":"Human","text":"Hello, does this work?"},{"role":"AI","text":"Yes, it works. How can I assist you today?"},{"role":"Human","text":"Tell me something funny."}]}','{"role":"AI","text":"Sure, here''s a joke for you: Why don''t scientists trust atoms? Because they make up everything!"}');
3 | INSERT INTO llm_call_follow_ups VALUES('d5ad1e49-f57f-4481-84fb-4d70ba8a7a74','c13c1e67-2de3-48de-a34c-a32079c03316');
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/conversation-manually-recreated/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO llm_calls VALUES('d5ad1e49-f57f-4481-84fb-4d70ba8a7a74','2024-01-16 08:50:19.738093890','open_ai','gpt-4','gpt-4-0613',1.0,32,12,44,'{"type":"Chat","messages":[{"role":"System","text":"You are ZAMM, a chat program. Respond in first person."},{"role":"Human","text":"Hello, does this work?"}]}','{"role":"AI","text":"Yes, it works. How can I assist you today?"}');
2 | INSERT INTO llm_calls VALUES('c13c1e67-2de3-48de-a34c-a32079c03316','2024-01-16 09:50:19.738093890','open_ai','gpt-4','gpt-4-0613',1.0,57,22,79,'{"type":"Chat","messages":[{"role":"System","text":"You are ZAMM, a chat program. Respond in first person."},{"role":"Human","text":"Hello, does this work?"},{"role":"AI","text":"Yes, it works. How can I assist you today?"},{"role":"Human","text":"Tell me something funny."}]}','{"role":"AI","text":"Sure, here''s a joke for you: Why don''t scientists trust atoms? Because they make up everything!"}');
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/conversation-started-ollama/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO llm_calls VALUES('506e2d1f-549c-45cc-ad65-57a0741f06ee','2024-08-07 18:46:15.717997','ollama','llama3:8b','llama3:8b',1.0,36,57,93,'{"type":"Chat","messages":[{"role":"System","text":"You are ZAMM, a chat program. Respond in first person."},{"role":"Human","text":"Hello, does this work?"}]}','{"role":"AI","text":"Hello there! Yes, it looks like I''m functioning properly. I''m ZAMM, a chat program designed to assist and converse with you. I''m happy to be here and help answer any questions or topics you''d like to discuss. What''s on your mind today?"}');
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/conversation-started-ollama/dump.yaml:
--------------------------------------------------------------------------------
1 | llm_calls:
2 | instances:
3 | - id: 506e2d1f-549c-45cc-ad65-57a0741f06ee
4 | timestamp: 2024-08-07T18:46:15.717997
5 | provider: Ollama
6 | llm_requested: llama3:8b
7 | llm: llama3:8b
8 | temperature: 1.0
9 | prompt_tokens: 36
10 | response_tokens: 57
11 | total_tokens: 93
12 | prompt:
13 | type: Chat
14 | messages:
15 | - role: System
16 | text: You are ZAMM, a chat program. Respond in first person.
17 | - role: Human
18 | text: Hello, does this work?
19 | completion:
20 | role: AI
21 | text: Hello there! Yes, it looks like I'm functioning properly. I'm ZAMM, a chat program designed to assist and converse with you. I'm happy to be here and help answer any questions or topics you'd like to discuss. What's on your mind today?
22 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/conversation-started/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO llm_calls VALUES('d5ad1e49-f57f-4481-84fb-4d70ba8a7a74','2024-01-16 08:50:19.738093890','open_ai','gpt-4','gpt-4-0613',1.0,32,12,44,'{"type":"Chat","messages":[{"role":"System","text":"You are ZAMM, a chat program. Respond in first person."},{"role":"Human","text":"Hello, does this work?"}]}','{"role":"AI","text":"Yes, it works. How can I assist you today?"}');
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/conversation-started/dump.yaml:
--------------------------------------------------------------------------------
1 | llm_calls:
2 | instances:
3 | - id: d5ad1e49-f57f-4481-84fb-4d70ba8a7a74
4 | timestamp: 2024-01-16T08:50:19.738093890
5 | provider: OpenAI
6 | llm_requested: gpt-4
7 | llm: gpt-4-0613
8 | temperature: 1.0
9 | prompt_tokens: 32
10 | response_tokens: 12
11 | total_tokens: 44
12 | prompt:
13 | type: Chat
14 | messages:
15 | - role: System
16 | text: You are ZAMM, a chat program. Respond in first person.
17 | - role: Human
18 | text: Hello, does this work?
19 | completion:
20 | role: AI
21 | text: Yes, it works. How can I assist you today?
22 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/different-openai-api-key/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO api_keys VALUES('open_ai','4-d1ff3r3n7-k3y');
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/different-openai-api-key/dump.yaml:
--------------------------------------------------------------------------------
1 | api_keys:
2 | - service: OpenAI
3 | api_key: 4-d1ff3r3n7-k3y
4 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/empty/dump.sql:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/api/sample-database-writes/empty/dump.sql
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/empty/dump.yaml:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/openai-api-key/dump.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO api_keys VALUES('open_ai','0p3n41-4p1-k3y');
--------------------------------------------------------------------------------
/src-tauri/api/sample-database-writes/openai-api-key/dump.yaml:
--------------------------------------------------------------------------------
1 | api_keys:
2 | - service: OpenAI
3 | api_key: 0p3n41-4p1-k3y
4 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/db-import-export/different-api-key/different.zamm.yaml:
--------------------------------------------------------------------------------
1 | zamm_version: 0.2.2
2 | api_keys:
3 | - service: OpenAI
4 | api_key: 4-d1ff3r3n7-k3y
5 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/empty/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/api/sample-disk-writes/empty/.gitkeep
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/future-version/preferences.toml:
--------------------------------------------------------------------------------
1 | version = "1.9.9"
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/high-dpi-adjust-off/preferences.toml:
--------------------------------------------------------------------------------
1 | high_dpi_adjust = false
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/high-dpi-adjust-on/preferences.toml:
--------------------------------------------------------------------------------
1 | high_dpi_adjust = true
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/sound-off-extra-settings/preferences.toml:
--------------------------------------------------------------------------------
1 | sound_on=false
2 | unknown_key=123
3 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/sound-on-extra-settings/preferences.toml:
--------------------------------------------------------------------------------
1 | sound_on = true
2 | unknown_key = 123
3 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/sound-override/preferences.toml:
--------------------------------------------------------------------------------
1 | sound_on = false
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/transparency-off/preferences.toml:
--------------------------------------------------------------------------------
1 | transparency_on = false
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/transparency-on/preferences.toml:
--------------------------------------------------------------------------------
1 | transparency_on = true
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/v0.1.3/preferences.toml:
--------------------------------------------------------------------------------
1 | version = "0.1.3"
2 | sound_on = false
3 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/version-init/preferences.toml:
--------------------------------------------------------------------------------
1 | version = "0.2.2"
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/version-update/preferences.toml:
--------------------------------------------------------------------------------
1 | sound_on = false
2 | version = "0.2.2"
3 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/preferences/volume-override/preferences.toml:
--------------------------------------------------------------------------------
1 | volume = 0.8
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/different/.bashrc:
--------------------------------------------------------------------------------
1 | export OPENAI_API_KEY="4-d1ff3r3n7-k3y"
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/nested/end/folder/.bashrc:
--------------------------------------------------------------------------------
1 | # don't mind me
2 | export OPENAI_API_KEY="0p3n41-4p1-k3y"
3 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/nested/start/folder/.bashrc:
--------------------------------------------------------------------------------
1 | # don't mind me
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/new-file/.bashrc:
--------------------------------------------------------------------------------
1 | export OPENAI_API_KEY="0p3n41-4p1-k3y"
2 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/no-newline/end/.bashrc:
--------------------------------------------------------------------------------
1 | # dummy initial bashrc file
2 | export SOME_ENV_VAR="some value"
3 | # no newline at end of file to check that it still works
4 | export OPENAI_API_KEY="0p3n41-4p1-k3y"
5 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/no-newline/start/.bashrc:
--------------------------------------------------------------------------------
1 | # dummy initial bashrc file
2 | export SOME_ENV_VAR="some value"
3 | # no newline at end of file to check that it still works
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/with-newline/end/.bashrc:
--------------------------------------------------------------------------------
1 | # dummy initial bashrc file
2 | # check that newline at end of file doesn't result in ugly whitespace
3 | export SOME_ENV_VAR="some value"
4 | export OPENAI_API_KEY="0p3n41-4p1-k3y"
5 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-disk-writes/shell-init/with-newline/start/.bashrc:
--------------------------------------------------------------------------------
1 | # dummy initial bashrc file
2 | # check that newline at end of file doesn't result in ugly whitespace
3 | export SOME_ENV_VAR="some value"
4 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-terminal-sessions/bash.cast:
--------------------------------------------------------------------------------
1 | {"version":2,"width":80,"height":24,"timestamp":1727195245,"command":"bash"}
2 | [0.208,"o","\r\nThe default interactive shell is now zsh.\r\nTo update your account to use zsh, please run `chsh -s /bin/zsh`.\r\nFor more details, please visit https://support.apple.com/kb/HT208050.\r\nbash-3.2$ "]
3 | [0.208,"i","python api/sample-terminal-sessions/interleaved.py\n"]
4 | [0.412,"o","python api/sample-terminal-sessions/interleaved.py\r\nstdout\r\nstderr\r\nstdout\r\nbash-3.2$ "]
--------------------------------------------------------------------------------
/src-tauri/api/sample-terminal-sessions/date.cast:
--------------------------------------------------------------------------------
1 | {"version":2,"width":80,"height":24,"timestamp":1726831433,"command":"date \"+%A %B %e, %Y %R %z\""}
2 | [0.102,"o","Friday September 20, 2024 18:23 +0700\r\n"]
--------------------------------------------------------------------------------
/src-tauri/api/sample-terminal-sessions/interleaved.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import sys
4 |
5 | print("stdout")
6 | sys.stdout.flush()
7 | print("stderr", file=sys.stderr)
8 | print("stdout")
9 |
--------------------------------------------------------------------------------
/src-tauri/api/sample-terminal-sessions/pause.cast:
--------------------------------------------------------------------------------
1 | {"version":2,"width":80,"height":24,"timestamp":1726831353,"command":"python api/sample-terminal-sessions/pause.py"}
2 | [0.315,"o","First\r\n"]
3 | [1.319,"o","Second\r\n"]
--------------------------------------------------------------------------------
/src-tauri/api/sample-terminal-sessions/pause.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import sys
4 | import time
5 |
6 | print("First")
7 | sys.stdout.flush()
8 |
9 | time.sleep(0.5)
10 | print("Second")
11 | sys.stdout.flush()
12 |
--------------------------------------------------------------------------------
/src-tauri/binaries/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/src-tauri/build.rs:
--------------------------------------------------------------------------------
1 | fn main() {
2 | println!("cargo:rerun-if-changed=migrations");
3 | tauri_build::build()
4 | }
5 |
--------------------------------------------------------------------------------
/src-tauri/capabilities/migrated.json:
--------------------------------------------------------------------------------
1 | {
2 | "identifier": "migrated",
3 | "description": "permissions that were migrated from v1",
4 | "local": true,
5 | "windows": ["main"],
6 | "permissions": [
7 | "core:default",
8 | "updater:default",
9 | "dialog:allow-ask",
10 | "dialog:allow-open",
11 | "dialog:allow-save"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/src-tauri/clippy.py:
--------------------------------------------------------------------------------
1 | import subprocess
2 | import sys
3 |
4 |
5 | def cut_off_separate(output: str, separator: str) -> str:
6 | if separator not in output:
7 | return output
8 | separator_line = output.split(separator)[1]
9 | return "\n".join(separator_line.split("\n")[1:])
10 |
11 |
12 | clippy_command = "cargo clippy --color never --manifest-path src-tauri/Cargo.toml --fix --allow-dirty --allow-staged --all-targets --all-features -- -Dwarnings"
13 | clippy_process = subprocess.Popen(
14 | clippy_command, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE
15 | )
16 | clippy_output = clippy_process.communicate()[0].decode()
17 |
18 | zamm_output = cut_off_separate(
19 | clippy_output, "warning: `async-openai` (lib) generated "
20 | )
21 | zamm_output = cut_off_separate(zamm_output, "warning: `ollama-rs` (lib) generated ")
22 |
23 | print(zamm_output)
24 |
25 | if "warning" in zamm_output:
26 | sys.exit(1)
27 |
--------------------------------------------------------------------------------
/src-tauri/diesel.toml:
--------------------------------------------------------------------------------
1 | # For documentation on how to configure this file,
2 | # see https://diesel.rs/guides/configuring-diesel-cli
3 |
4 | [print_schema]
5 | file = "src/schema.rs"
6 | custom_type_derives = ["diesel::query_builder::QueryId"]
7 |
8 | [migrations_directory]
9 | dir = "migrations"
10 |
--------------------------------------------------------------------------------
/src-tauri/icons/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/128x128.png
--------------------------------------------------------------------------------
/src-tauri/icons/128x128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/128x128@2x.png
--------------------------------------------------------------------------------
/src-tauri/icons/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/32x32.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square107x107Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square107x107Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square142x142Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square142x142Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square150x150Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square150x150Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square284x284Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square284x284Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square30x30Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square30x30Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square310x310Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square310x310Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square44x44Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square44x44Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square71x71Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square71x71Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/Square89x89Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/Square89x89Logo.png
--------------------------------------------------------------------------------
/src-tauri/icons/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/StoreLogo.png
--------------------------------------------------------------------------------
/src-tauri/icons/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/icon.icns
--------------------------------------------------------------------------------
/src-tauri/icons/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/icon.ico
--------------------------------------------------------------------------------
/src-tauri/icons/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/icon.png
--------------------------------------------------------------------------------
/src-tauri/icons/icon.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/icons/icon.xcf
--------------------------------------------------------------------------------
/src-tauri/migrations/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/migrations/.keep
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-01-07-035038_create_api_keys/down.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE api_keys
2 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-01-07-035038_create_api_keys/up.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE api_keys (
2 | service VARCHAR PRIMARY KEY NOT NULL,
3 | api_key VARCHAR NOT NULL
4 | )
5 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-01-13-023144_create_llm_calls/down.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE llm_calls
2 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-01-13-023144_create_llm_calls/up.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE llm_calls (
2 | id VARCHAR PRIMARY KEY NOT NULL,
3 | timestamp DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
4 | provider VARCHAR NOT NULL,
5 | llm_requested VARCHAR NOT NULL,
6 | llm VARCHAR NOT NULL,
7 | temperature REAL NOT NULL,
8 | prompt_tokens INTEGER,
9 | response_tokens INTEGER,
10 | total_tokens INTEGER,
11 | prompt TEXT NOT NULL,
12 | completion TEXT NOT NULL
13 | )
14 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-05-13-135101_add_api_call_follow_ups/down.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE llm_call_follow_ups;
2 | DROP VIEW llm_call_named_follow_ups;
3 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-05-13-135101_add_api_call_follow_ups/up.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE llm_call_follow_ups (
2 | previous_call_id VARCHAR NOT NULL,
3 | next_call_id VARCHAR NOT NULL,
4 | PRIMARY KEY (previous_call_id, next_call_id),
5 | FOREIGN KEY (previous_call_id) REFERENCES llm_calls (id) ON DELETE CASCADE,
6 | FOREIGN KEY (next_call_id) REFERENCES llm_calls (id) ON DELETE CASCADE
7 | );
8 |
9 | CREATE VIEW llm_call_named_follow_ups AS
10 | SELECT
11 | llm_call_follow_ups.previous_call_id AS previous_call_id,
12 | previous_call.completion AS previous_call_completion,
13 | llm_call_follow_ups.next_call_id AS next_call_id,
14 | next_call.completion AS next_call_completion
15 | FROM
16 | llm_call_follow_ups
17 | JOIN llm_calls AS previous_call ON llm_call_follow_ups.previous_call_id = previous_call.id
18 | JOIN llm_calls AS next_call ON llm_call_follow_ups.next_call_id = next_call.id;
19 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-05-29-071520_ordered_names/down.sql:
--------------------------------------------------------------------------------
1 | DROP VIEW llm_call_named_follow_ups;
2 | CREATE VIEW llm_call_named_follow_ups AS
3 | SELECT
4 | llm_call_follow_ups.previous_call_id AS previous_call_id,
5 | previous_call.completion AS previous_call_completion,
6 | llm_call_follow_ups.next_call_id AS next_call_id,
7 | next_call.completion AS next_call_completion
8 | FROM
9 | llm_call_follow_ups
10 | JOIN llm_calls AS previous_call ON llm_call_follow_ups.previous_call_id = previous_call.id
11 | JOIN llm_calls AS next_call ON llm_call_follow_ups.next_call_id = next_call.id;
12 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-05-29-071520_ordered_names/up.sql:
--------------------------------------------------------------------------------
1 | DROP VIEW llm_call_named_follow_ups;
2 | CREATE VIEW llm_call_named_follow_ups AS
3 | SELECT
4 | llm_call_follow_ups.previous_call_id AS previous_call_id,
5 | previous_call.completion AS previous_call_completion,
6 | llm_call_follow_ups.next_call_id AS next_call_id,
7 | next_call.completion AS next_call_completion
8 | FROM
9 | llm_call_follow_ups
10 | JOIN llm_calls AS previous_call ON llm_call_follow_ups.previous_call_id = previous_call.id
11 | JOIN llm_calls AS next_call ON llm_call_follow_ups.next_call_id = next_call.id
12 | ORDER BY next_call.timestamp ASC;
13 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-05-29-183428_variant_links/down.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE llm_call_variants;
2 | DROP VIEW llm_call_named_variants;
3 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-05-29-183428_variant_links/up.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE llm_call_variants (
2 | canonical_id VARCHAR NOT NULL,
3 | variant_id VARCHAR NOT NULL,
4 | PRIMARY KEY (canonical_id, variant_id),
5 | FOREIGN KEY (canonical_id) REFERENCES llm_calls (id) ON DELETE CASCADE,
6 | FOREIGN KEY (variant_id) REFERENCES llm_calls (id) ON DELETE CASCADE
7 | );
8 |
9 | CREATE VIEW llm_call_named_variants AS
10 | SELECT
11 | llm_call_variants.canonical_id AS canonical_id,
12 | canonical.completion AS canonical_completion,
13 | llm_call_variants.variant_id AS variant_id,
14 | variant.completion AS variant_completion
15 | FROM
16 | llm_call_variants
17 | JOIN llm_calls AS canonical ON llm_call_variants.canonical_id = canonical.id
18 | JOIN llm_calls AS variant ON llm_call_variants.variant_id = variant.id
19 | ORDER BY variant.timestamp ASC;
20 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-06-27-125941_add_asciicasts/down.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE asciicasts;
2 |
--------------------------------------------------------------------------------
/src-tauri/migrations/2024-06-27-125941_add_asciicasts/up.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE asciicasts (
2 | id VARCHAR PRIMARY KEY NOT NULL,
3 | timestamp DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
4 | command VARCHAR NOT NULL,
5 | os VARCHAR,
6 | cast TEXT NOT NULL
7 | );
8 |
--------------------------------------------------------------------------------
/src-tauri/sounds/switch.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/sounds/switch.ogg
--------------------------------------------------------------------------------
/src-tauri/sounds/whoosh.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/src-tauri/sounds/whoosh.ogg
--------------------------------------------------------------------------------
/src-tauri/src/cli.rs:
--------------------------------------------------------------------------------
1 | use clap::{Parser, Subcommand};
2 |
3 | #[derive(Subcommand)]
4 | pub enum Commands {
5 | /// Run the GUI. This is the default command.
6 | Gui {},
7 | /// Export Specta bindings for development purposes
8 | #[cfg(debug_assertions)]
9 | ExportBindings {},
10 | }
11 |
12 | /// Zen and the Automation of Metaprogramming for the Masses
13 | ///
14 | /// This is an experimental tool meant for automating programming-related activities,
15 | /// although none have been implemented yet. Blog posts on progress can be found at
16 | /// https://zamm.dev/
17 | #[derive(Parser)]
18 | #[command(name = "zamm")]
19 | #[command(version)]
20 | #[command(about = "Zen and the Automation of Metaprogramming for the Masses")]
21 | pub struct Cli {
22 | #[command(subcommand)]
23 | pub command: Option,
24 | }
25 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/database/metadata.rs:
--------------------------------------------------------------------------------
1 | fn is_zero(num: &i32) -> bool {
2 | *num == 0
3 | }
4 |
5 | #[derive(Debug, Default, serde::Serialize, serde::Deserialize, specta::Type)]
6 | pub struct DatabaseCounts {
7 | #[serde(skip_serializing_if = "is_zero")]
8 | #[serde(default)]
9 | pub num_api_keys: i32,
10 | #[serde(skip_serializing_if = "is_zero")]
11 | #[serde(default)]
12 | pub num_llm_calls: i32,
13 | #[serde(skip_serializing_if = "is_zero")]
14 | #[serde(default)]
15 | pub num_terminal_sessions: i32,
16 | }
17 |
18 | impl DatabaseCounts {
19 | pub fn is_empty(&self) -> bool {
20 | self.num_api_keys == 0
21 | && self.num_llm_calls == 0
22 | && self.num_terminal_sessions == 0
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/database/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod export;
2 | pub mod import;
3 | mod metadata;
4 |
5 | pub use export::export_db;
6 | pub use import::import_db;
7 |
8 | #[cfg(test)]
9 | pub use export::write_database_contents;
10 | #[cfg(test)]
11 | pub use import::read_database_contents;
12 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/errors/import.rs:
--------------------------------------------------------------------------------
1 | #[derive(thiserror::Error, Debug, specta::Type)]
2 | pub enum ImportError {
3 | #[error("Data contains unknown prompt types.")]
4 | UnknownPromptType {},
5 | }
6 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/errors/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod error;
2 | pub mod import;
3 | pub mod rodio;
4 | pub mod serde;
5 |
6 | pub use error::{Error, ZammResult};
7 | pub use import::ImportError;
8 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/errors/rodio.rs:
--------------------------------------------------------------------------------
1 | #[derive(thiserror::Error, Debug, specta::Type)]
2 | pub enum RodioError {
3 | #[error("Stream error: {0}")]
4 | Stream(String),
5 | #[error("Decoder error: {0}")]
6 | Decode(String),
7 | #[error("Play error: {0}")]
8 | Play(String),
9 | }
10 |
11 | impl From for RodioError {
12 | fn from(err: rodio::StreamError) -> Self {
13 | Self::Stream(err.to_string())
14 | }
15 | }
16 |
17 | impl From for RodioError {
18 | fn from(err: rodio::decoder::DecoderError) -> Self {
19 | Self::Decode(err.to_string())
20 | }
21 | }
22 |
23 | impl From for RodioError {
24 | fn from(err: rodio::PlayError) -> Self {
25 | Self::Play(err.to_string())
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/errors/serde.rs:
--------------------------------------------------------------------------------
1 | #[derive(thiserror::Error, Debug, specta::Type)]
2 | pub enum SerdeError {
3 | #[error("JSON error: {0}")]
4 | Json(String),
5 | #[error("YAML error: {0}")]
6 | Yaml(String),
7 | #[error("TOML error: {0}")]
8 | Toml(String),
9 | }
10 |
11 | impl From for SerdeError {
12 | fn from(err: serde_json::Error) -> Self {
13 | Self::Json(err.to_string())
14 | }
15 | }
16 |
17 | impl From for SerdeError {
18 | fn from(err: serde_yaml::Error) -> Self {
19 | Self::Yaml(err.to_string())
20 | }
21 | }
22 |
23 | impl From for SerdeError {
24 | fn from(err: toml::de::Error) -> Self {
25 | Self::Toml(err.to_string())
26 | }
27 | }
28 |
29 | impl From for SerdeError {
30 | fn from(err: toml::ser::Error) -> Self {
31 | Self::Toml(err.to_string())
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/keys/mod.rs:
--------------------------------------------------------------------------------
1 | mod get;
2 | mod set;
3 |
4 | pub use get::get_api_keys;
5 | pub use set::set_api_key;
6 |
7 | #[cfg(test)]
8 | mod tests {
9 | use super::*;
10 | use crate::setup::api_keys::ApiKeys;
11 | use crate::ZammApiKeys;
12 | use get::tests::check_get_api_keys_sample;
13 | use set::tests::check_set_api_key_sample;
14 | use std::collections::HashMap;
15 | use stdext::function_name;
16 | use tokio::sync::Mutex;
17 |
18 | #[tokio::test]
19 | async fn test_get_after_set() {
20 | let api_keys = ZammApiKeys(Mutex::new(ApiKeys::default()));
21 |
22 | check_set_api_key_sample(
23 | function_name!(),
24 | &api_keys,
25 | "api/sample-calls/set_api_key-existing-no-newline.yaml",
26 | HashMap::new(),
27 | )
28 | .await;
29 |
30 | check_get_api_keys_sample(
31 | "./api/sample-calls/get_api_keys-openai.yaml",
32 | &api_keys,
33 | )
34 | .await;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/llms/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod chat;
2 | pub mod get_api_call;
3 | pub mod get_api_calls;
4 |
5 | pub use chat::chat;
6 | pub use get_api_call::get_api_call;
7 | pub use get_api_calls::get_api_calls;
8 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod database;
2 | pub mod errors;
3 | mod keys;
4 | mod llms;
5 | pub mod preferences;
6 | mod sounds;
7 | mod system;
8 | pub mod terminal;
9 |
10 | // size of one page of results in database list view
11 | const PAGE_SIZE: i64 = 50;
12 |
13 | pub use database::{export_db, import_db};
14 | pub use errors::Error;
15 | pub use keys::{get_api_keys, set_api_key};
16 | pub use llms::{chat, get_api_call, get_api_calls};
17 | pub use preferences::{get_preferences, set_preferences};
18 | pub use sounds::play_sound;
19 | pub use system::get_system_info;
20 | pub use terminal::{
21 | get_terminal_session, get_terminal_sessions, run_command, send_command_input,
22 | };
23 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/preferences/mod.rs:
--------------------------------------------------------------------------------
1 | mod models;
2 | mod read;
3 | mod write;
4 |
5 | pub use read::{get_preferences, get_preferences_file_contents};
6 | pub use write::{set_preferences, set_preferences_helper};
7 |
--------------------------------------------------------------------------------
/src-tauri/src/commands/terminal/mod.rs:
--------------------------------------------------------------------------------
1 | mod get_session;
2 | mod get_sessions;
3 | pub mod models;
4 | mod parse;
5 | mod run;
6 | mod send_input;
7 |
8 | pub use get_session::get_terminal_session;
9 | pub use get_sessions::get_terminal_sessions;
10 | pub use models::{ActualTerminal, Terminal};
11 | pub use run::run_command;
12 | pub use send_input::send_command_input;
13 |
--------------------------------------------------------------------------------
/src-tauri/src/models/llm_calls/lightweight_llm_call.rs:
--------------------------------------------------------------------------------
1 | use crate::models::llm_calls::chat_message::ChatMessage;
2 | use crate::models::llm_calls::entity_id::EntityId;
3 | use crate::models::llm_calls::llm_call::LlmCall;
4 | use crate::models::llm_calls::row::LlmCallRow;
5 | use chrono::naive::NaiveDateTime;
6 | use serde::{Deserialize, Serialize};
7 |
8 | #[derive(Debug, Clone, Serialize, Deserialize, specta::Type)]
9 | pub struct LightweightLlmCall {
10 | pub id: EntityId,
11 | pub timestamp: NaiveDateTime,
12 | pub response_message: ChatMessage,
13 | }
14 |
15 | impl From for LightweightLlmCall {
16 | fn from(value: LlmCall) -> Self {
17 | LightweightLlmCall {
18 | id: value.id,
19 | timestamp: value.timestamp,
20 | response_message: value.response.completion,
21 | }
22 | }
23 | }
24 |
25 | impl From for LightweightLlmCall {
26 | fn from(value: LlmCallRow) -> Self {
27 | LightweightLlmCall {
28 | id: value.id,
29 | timestamp: value.timestamp,
30 | response_message: value.completion,
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src-tauri/src/models/llm_calls/mod.rs:
--------------------------------------------------------------------------------
1 | mod chat_message;
2 | mod entity_id;
3 | mod lightweight_llm_call;
4 | mod linkage;
5 | mod llm_call;
6 | mod prompt;
7 | mod row;
8 | mod various;
9 |
10 | pub use chat_message::ChatMessage;
11 | pub use entity_id::EntityId;
12 | pub use lightweight_llm_call::LightweightLlmCall;
13 | #[allow(unused_imports)]
14 | pub use linkage::{
15 | LlmCallFollowUp, LlmCallVariant, NewLlmCallFollowUp, NewLlmCallVariant,
16 | };
17 | pub use llm_call::{LlmCall, LlmCallLeftJoinResult};
18 | pub use prompt::{ChatPrompt, Prompt};
19 | #[allow(unused_imports)]
20 | pub use row::{LlmCallRow, NewLlmCallRow};
21 | pub use various::TokenMetadata;
22 |
--------------------------------------------------------------------------------
/src-tauri/src/models/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod api_keys;
2 | pub mod asciicasts;
3 | pub mod database_contents;
4 | pub mod llm_calls;
5 | pub mod os;
6 | pub mod shell;
7 |
8 | pub use api_keys::{ApiKey, NewApiKey};
9 | pub use database_contents::{DatabaseContents, LlmCallData};
10 | pub use llm_calls::EntityId;
11 |
--------------------------------------------------------------------------------
/src-tauri/src/models/shell.rs:
--------------------------------------------------------------------------------
1 | use serde::{Deserialize, Serialize};
2 | use specta::Type;
3 |
4 | use std::env;
5 |
6 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize, Type)]
7 | pub enum Shell {
8 | Bash,
9 | Zsh,
10 | #[allow(clippy::enum_variant_names)]
11 | PowerShell,
12 | }
13 |
14 | pub fn get_shell() -> Option {
15 | if let Ok(shell) = env::var("SHELL") {
16 | if shell.ends_with("/zsh") {
17 | return Some(Shell::Zsh);
18 | }
19 | if shell.ends_with("/bash") {
20 | return Some(Shell::Bash);
21 | }
22 | }
23 |
24 | if env::var("ZSH_NAME").is_ok() {
25 | return Some(Shell::Zsh);
26 | }
27 | if env::var("BASH").is_ok() {
28 | return Some(Shell::Bash);
29 | }
30 |
31 | #[cfg(target_os = "windows")]
32 | return Some(Shell::PowerShell);
33 | #[cfg(not(target_os = "windows"))]
34 | return None;
35 | }
36 |
37 | #[cfg(test)]
38 | mod tests {
39 | use super::*;
40 |
41 | #[ignore]
42 | #[test]
43 | fn test_can_determine_shell() {
44 | let shell = get_shell();
45 | println!(
46 | "Determined shell to be {:?} from env var {:?}",
47 | shell,
48 | env::var("SHELL")
49 | );
50 | assert!(shell.is_some());
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src-tauri/src/python_api.rs:
--------------------------------------------------------------------------------
1 | // Example code that deserializes and serializes the model.
2 | // extern crate serde;
3 | // #[macro_use]
4 | // extern crate serde_derive;
5 | // extern crate serde_json;
6 | //
7 | // use generated_module::greet_args;
8 | //
9 | // fn main() {
10 | // let json = r#"{"answer": 42}"#;
11 | // let model: greet_args = serde_json::from_str(&json).unwrap();
12 | // }
13 |
14 | use serde::{Deserialize, Serialize};
15 |
16 | #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
17 | pub struct GreetArgs {
18 | pub name: String,
19 | }
20 |
21 | #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
22 | pub struct GreetResponse {
23 | pub greeting: String,
24 | }
25 |
--------------------------------------------------------------------------------
/src-tauri/src/setup/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod api_keys;
2 | pub mod db;
3 |
4 | pub use db::get_db;
5 |
--------------------------------------------------------------------------------
/src-tauri/src/test_helpers/database.rs:
--------------------------------------------------------------------------------
1 | use crate::setup::db::MIGRATIONS;
2 | use crate::ZammDatabase;
3 | use diesel::prelude::*;
4 | use diesel_migrations::MigrationHarness;
5 | use std::path::PathBuf;
6 | use tokio::sync::Mutex;
7 |
8 | pub fn setup_database(file: Option<&PathBuf>) -> SqliteConnection {
9 | let mut conn = match file {
10 | Some(file) => {
11 | SqliteConnection::establish(file.as_path().to_str().unwrap()).unwrap()
12 | }
13 | None => SqliteConnection::establish(":memory:").unwrap(),
14 | };
15 |
16 | conn.run_pending_migrations(MIGRATIONS).unwrap();
17 | conn
18 | }
19 |
20 | pub fn setup_zamm_db(file: Option<&PathBuf>) -> ZammDatabase {
21 | ZammDatabase(Mutex::new(Some(setup_database(file))))
22 | }
23 |
--------------------------------------------------------------------------------
/src-tauri/src/test_helpers/mod.rs:
--------------------------------------------------------------------------------
1 | #[macro_use]
2 | pub mod api_testing;
3 | pub mod database;
4 | pub mod sqlite;
5 | pub mod temp_files;
6 | pub mod terminal;
7 |
8 | pub use api_testing::{
9 | DirectReturn, SampleCallTestCase, SideEffectsHelpers, ZammResultReturn,
10 | };
11 |
--------------------------------------------------------------------------------
/src-tauri/src/test_helpers/sqlite.rs:
--------------------------------------------------------------------------------
1 | use crate::ZammDatabase;
2 | use diesel::connection::SimpleConnection;
3 | use std::fs;
4 | use std::path::PathBuf;
5 |
6 | pub async fn load_sqlite_database(zamm_db: &ZammDatabase, dump_path: &PathBuf) {
7 | let db = &mut zamm_db.0.lock().await;
8 | let conn = db.as_mut().unwrap();
9 | let dump = fs::read_to_string(dump_path).expect("Error reading dump file");
10 | conn.batch_execute(&dump)
11 | .expect("Error loading dump into database");
12 | }
13 |
14 | pub fn dump_sqlite_database(db_path: &PathBuf, dump_path: &PathBuf) {
15 | let dump_output = std::process::Command::new("sqlite3")
16 | .arg(db_path)
17 | // avoid the inserts into __diesel_schema_migrations
18 | .arg(
19 | ".dump api_keys llm_calls llm_call_follow_ups llm_call_variants asciicasts",
20 | )
21 | .output()
22 | .expect("Error running sqlite3 .dump command");
23 | // filter output by lines starting with "INSERT"
24 | let inserts = String::from_utf8_lossy(&dump_output.stdout)
25 | .lines()
26 | .filter(|line| line.starts_with("INSERT"))
27 | .collect::>()
28 | .join("\n");
29 | fs::write(dump_path, inserts).expect("Error writing dump file");
30 | }
31 |
--------------------------------------------------------------------------------
/src-tauri/src/test_helpers/temp_files.rs:
--------------------------------------------------------------------------------
1 | use std::env;
2 | use std::fs;
3 | use std::path::PathBuf;
4 |
5 | pub fn get_temp_test_dir(test_name: &str) -> PathBuf {
6 | let mut test_dir = env::temp_dir();
7 | test_dir.push("zamm/tests");
8 | test_dir.push(test_name);
9 | if test_dir.exists() {
10 | fs::remove_dir_all(&test_dir).unwrap_or_else(|_| {
11 | panic!("Can't remove temp test dir at {}", test_dir.display())
12 | });
13 | }
14 | fs::create_dir_all(&test_dir).unwrap_or_else(|_| {
15 | panic!("Can't create temp test dir at {}", test_dir.display())
16 | });
17 | test_dir
18 | }
19 |
--------------------------------------------------------------------------------
/src-tauri/src/views.rs:
--------------------------------------------------------------------------------
1 | use crate::schema::llm_calls;
2 |
3 | diesel::table! {
4 | llm_call_named_follow_ups (previous_call_id, next_call_id) {
5 | previous_call_id -> Text,
6 | previous_call_completion -> Text,
7 | next_call_id -> Text,
8 | next_call_completion -> Text,
9 | }
10 | }
11 |
12 | diesel::table! {
13 | llm_call_named_variants (canonical_id, variant_id) {
14 | canonical_id -> Text,
15 | canonical_completion -> Text,
16 | variant_id -> Text,
17 | variant_completion -> Text,
18 | }
19 | }
20 |
21 | diesel::allow_tables_to_appear_in_same_query!(
22 | llm_call_named_follow_ups,
23 | llm_call_named_variants,
24 | llm_calls
25 | );
26 |
--------------------------------------------------------------------------------
/tmux.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SESSION_NAME="zamm"
4 |
5 | tmux has-session -t $SESSION_NAME
6 |
7 | if [ $? != 0 ]; then
8 | tmux new-session -d -s $SESSION_NAME -n 'processes' 'yarn workspace gui storybook --ci'
9 | tmux split-window -h 'yarn tauri dev'
10 | tmux new-window -t $SESSION_NAME:1 -n 'shell'
11 | tmux split-window -t $SESSION_NAME:1
12 | tmux send-keys -t $SESSION_NAME:1.1 'cd src-svelte' Enter
13 | tmux split-window -t $SESSION_NAME:1.1
14 | tmux send-keys -t $SESSION_NAME:1.2 'cd src-tauri' Enter
15 | tmux select-layout -t $SESSION_NAME:1 even-horizontal
16 | fi
17 |
18 | tmux attach-session -t $SESSION_NAME
19 |
--------------------------------------------------------------------------------
/webdriver/.eslintrc.yaml:
--------------------------------------------------------------------------------
1 | plugins:
2 | - wdio
3 | - mocha
4 | extends:
5 | - plugin:wdio/recommended
6 | - plugin:mocha/recommended
7 | rules:
8 | "@typescript-eslint/no-var-requires": off
9 | "wdio/no-pause": off
10 |
--------------------------------------------------------------------------------
/webdriver/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "trailingComma": "all"
3 | }
4 |
--------------------------------------------------------------------------------
/webdriver/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "webdriver",
3 | "private": true,
4 | "version": "0.0.0",
5 | "scripts": {
6 | "test": "wdio run ./wdio.conf.ts"
7 | },
8 | "devDependencies": {
9 | "@tauri-apps/api": "~2",
10 | "@tauri-apps/cli": "~2",
11 | "@types/mocha": "^10.0.1",
12 | "@typescript-eslint/parser": "^6.3.0",
13 | "@wdio/cli": "^8.15.9",
14 | "@wdio/local-runner": "^8.15.9",
15 | "@wdio/mocha-framework": "^8.15.9",
16 | "@wdio/spec-reporter": "^8.15.7",
17 | "canvas": "^2.11.2",
18 | "eslint": "^8.0.1",
19 | "eslint-config-prettier": "^9.0.0",
20 | "eslint-plugin-import": "^2.25.2",
21 | "eslint-plugin-mocha": "^10.1.0",
22 | "eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
23 | "eslint-plugin-wdio": "^7.25.3",
24 | "prettier": "^3.0.1",
25 | "ts-node": "^10.9.1",
26 | "typescript": "*",
27 | "wdio-image-comparison-service": "^5.0.3"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/webdriver/screenshots/.gitignore:
--------------------------------------------------------------------------------
1 | testing/
2 |
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/api-call-individual.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/api-call-individual.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/api-calls-populated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/api-calls-populated.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/api-calls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/api-calls.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/chat-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/chat-screen.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/credits-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/credits-screen.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/import-api-call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/import-api-call.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/new-api-call.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/new-api-call.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/new-terminal-session.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/new-terminal-session.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/running-terminal-session.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/running-terminal-session.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/settings-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/settings-screen.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/terminal-sessions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/terminal-sessions.png
--------------------------------------------------------------------------------
/webdriver/screenshots/baseline/desktop_wry/welcome-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zamm-dev/zamm/c136ce057302ae44c003c5b6ade86dfaad625fc3/webdriver/screenshots/baseline/desktop_wry/welcome-screen.png
--------------------------------------------------------------------------------
/webdriver/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "types": ["node", "@wdio/globals/types"]
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/webdriver/zamm.bashrc:
--------------------------------------------------------------------------------
1 | export PS1="zamm-e2e-testing> "
2 |
--------------------------------------------------------------------------------