forked from stitionai/devika
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* deleted old svelte files; initialized sveltekit project; moved api.js and store.js to src/lib; moved ui/public/assets to ui/static/assets * moved components to src/lib * src/App.svelte => src/routes/+page.svelte; fixed imports () * added /components * src/routes/+layout.js: ssr = false (temporary fix for xterm not working in ssr context) * moved Sidebar to +layout.svelte so that it's persistent across pages; made Sidebar a fixed element (fixed top-0 left-0 h-dvh z-10) * force added api.js & store.js --------- Co-authored-by: Vivek R <[email protected]>
- Loading branch information
1 parent
68f3dd4
commit c246fa7
Showing
37 changed files
with
182 additions
and
166 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
.DS_Store | ||
node_modules/ | ||
/build | ||
/.svelte-kit | ||
/package | ||
.env | ||
.env.* | ||
!.env.example | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,26 @@ | ||
{ | ||
"name": "devika-ui", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"name": "ui", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite", | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@sveltejs/adapter-auto": "^3.0.0", | ||
"@sveltejs/kit": "^2.0.0", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.0", | ||
"autoprefixer": "^10.4.16", | ||
"postcss": "^8.4.32", | ||
"postcss-load-config": "^5.0.2", | ||
"svelte": "^4.2.7", | ||
"tailwindcss": "^3.3.6", | ||
"vite": "^5.0.3" | ||
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@babel/core": "^7.24.1", | ||
"@babel/preset-env": "^7.24.1", | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@sveltejs/vite-plugin-svelte": "^3.0.2", | ||
"autoprefixer": "latest", | ||
"css-loader": "^6.10.0", | ||
"mini-css-extract-plugin": "^2.8.1", | ||
"postcss": "latest", | ||
"postcss-loader": "^8.1.1", | ||
"rollup": "^4.13.0", | ||
"rollup-plugin-css-only": "^4.5.2", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"rollup-plugin-svelte": "^7.2.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"svelte": "^4.2.12", | ||
"svelte-loader": "^3.2.0", | ||
"tailwindcss": "latest", | ||
"vite": "^5.1.6", | ||
"xterm": "^5.2.0", | ||
"xterm": "^5.3.0", | ||
"xterm-addon-fit": "^0.8.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const tailwindcss = require("tailwindcss"); | ||
const autoprefixer = require("autoprefixer"); | ||
|
||
const config = { | ||
plugins: [ | ||
//Some plugins, like tailwindcss/nesting, need to run before Tailwind, | ||
tailwindcss(), | ||
//But others, like autoprefixer, need to run after, | ||
autoprefixer, | ||
], | ||
}; | ||
|
||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" /> | ||
%sveltekit.head% | ||
</head> | ||
<body data-sveltekit-preload-data="hover" class="bg-slate-950 text-white font-sans"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* Write your global styles here, in PostCSS syntax */ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
ui/src/components/BrowserWidget.svelte → ui/src/lib/components/BrowserWidget.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ui/src/components/ControlPanel.svelte → ui/src/lib/components/ControlPanel.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/src/components/InternalMonologue.svelte → ...c/lib/components/InternalMonologue.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<script> | ||
import { agentState } from "../store"; | ||
import { agentState } from "$lib/store"; | ||
</script> | ||
|
||
<div | ||
|
2 changes: 1 addition & 1 deletion
2
ui/src/components/MessageContainer.svelte → ...rc/lib/components/MessageContainer.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ui/src/components/MessageInput.svelte → ui/src/lib/components/MessageInput.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/src/components/Sidebar.svelte → ui/src/lib/components/Sidebar.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const ssr = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script> | ||
import "../app.pcss" | ||
import Sidebar from '$lib/components/Sidebar.svelte' | ||
</script> | ||
|
||
<main class="h-dvh w-[calc(100dvw-5rem)] ml-20"> | ||
<Sidebar /> | ||
<slot /> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<script> | ||
import { onMount } from "svelte"; | ||
import ControlPanel from "$lib/components/ControlPanel.svelte"; | ||
import MessageContainer from "$lib/components/MessageContainer.svelte"; | ||
import InternalMonologue from "$lib/components/InternalMonologue.svelte"; | ||
import MessageInput from "$lib/components/MessageInput.svelte"; | ||
import BrowserWidget from "$lib/components/BrowserWidget.svelte"; | ||
import TerminalWidget from "$lib/components/TerminalWidget.svelte"; | ||
import { | ||
fetchProjectList, | ||
fetchModelList, | ||
fetchAgentState, | ||
fetchMessages, | ||
checkInternetStatus, | ||
} from "$lib/api"; | ||
onMount(() => { | ||
localStorage.clear(); | ||
const intervalId = setInterval(async () => { | ||
await fetchProjectList(); | ||
await fetchModelList(); | ||
await fetchAgentState(); | ||
await fetchMessages(); | ||
await checkInternetStatus(); | ||
}, 1000); | ||
return () => clearInterval(intervalId); | ||
}); | ||
</script> | ||
|
||
<div class="flex flex-col p-4 h-full"> | ||
<ControlPanel /> | ||
|
||
<div class="flex h-full space-x-4"> | ||
<div class="flex flex-col w-1/2"> | ||
<MessageContainer /> | ||
<InternalMonologue /> | ||
<MessageInput /> | ||
</div> | ||
|
||
<div class="flex flex-col w-1/2 space-y-4"> | ||
<BrowserWidget /> | ||
<TerminalWidget /> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
:global(::-webkit-scrollbar) { | ||
width: 10px; | ||
} | ||
:global(::-webkit-scrollbar-track) { | ||
background: #2d3748; | ||
border-radius: 10px; | ||
} | ||
:global(::-webkit-scrollbar-thumb) { | ||
background: #4a5568; | ||
border-radius: 10px; | ||
} | ||
:global(::-webkit-scrollbar-thumb:hover) { | ||
background: #6b7280; | ||
} | ||
</style> |
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; | ||
import adapter from "@sveltejs/adapter-auto"; | ||
|
||
/** @type {import('@sveltejs/kit').Config} */ | ||
const config = { | ||
kit: { | ||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. | ||
// If your environment is not supported or you settled on a specific environment, switch out the adapter. | ||
// See https://kit.svelte.dev/docs/adapters for more information about adapters. | ||
adapter: adapter(), | ||
}, | ||
|
||
preprocess: [vitePreprocess({})], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @type {import('tailwindcss').Config}*/ | ||
const config = { | ||
content: ["./src/**/*.{html,js,svelte,ts}"], | ||
|
||
theme: { | ||
extend: {}, | ||
}, | ||
|
||
plugins: [], | ||
}; | ||
|
||
module.exports = config; |
Oops, something went wrong.